vn-verdnaturachat/app/containers/markdown/styles.ts

166 lines
2.6 KiB
TypeScript
Raw Normal View History

import { Platform, StyleSheet } from 'react-native';
import sharedStyles from '../../views/Styles';
const codeFontFamily = Platform.select({
ios: { fontFamily: 'Courier New' },
android: { fontFamily: 'monospace' }
});
export default StyleSheet.create<any>({
container: {
alignItems: 'flex-start',
flexDirection: 'row'
},
childContainer: {
flex: 1
},
block: {
alignItems: 'flex-start',
flexDirection: 'row',
2019-10-02 12:41:51 +00:00
flexWrap: 'wrap',
flex: 1
},
emph: {
fontStyle: 'italic'
},
strong: {
fontWeight: 'bold'
},
del: {
textDecorationLine: 'line-through'
},
[NEW] Support new message parser (#3313) * Add message parser to profile view and db * Add md to db * Remove changes to Xcode project * Remove message-parser lib and add enable message parser field to User model * Fix message parser * Remove admin enableMessageParserEarlyAdoption * Add NewMarkdown component * Remove NewMarkdown component and add specific components for new message parser * Add new parser components * Fix BigEmoji * Updated components and added more Code components * update components and add storybooks * Update Code component and add it to storybooks * Update Mention component * Minor tweaks * Add server message parser validation * Renamed folder, add @rocket.chat/message-parser, migrate some files to TypeScript * Migrate components to TypeScript and fix styling * Change interfaces and add TaskListComponent and styles * Fix new markdown and styles * Fix inlinecode * Stop using server setting * Use enableMessageParserEarlyAdoption on mapStateToProps * Remove React.FC * add link to bold, italic and strike * Update parser components * Fix missing components * Minor tweak * Fix lint and add getCustomEmojis * Fix customEmojis * Update emojis * Minor tweak * disconnect markdown from store * Use @rocket.chat/message-parser@0.30.0 * Fix link style * Unify lists and styles * Remove style prop * Use big emoji as a normal token * Remove unnecessary memo * Fix code styles * Update tests * Conditionally create renderer * Use Context instead of prop drill * Fix Link component * Fix plain text regression and update tests Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-10-20 16:32:58 +00:00
plainText: {
fontSize: 16,
flexShrink: 1
},
text: {
fontSize: 16,
...sharedStyles.textRegular
},
textInfo: {
fontStyle: 'italic',
fontSize: 16,
...sharedStyles.textRegular
},
textBig: {
fontSize: 30,
...sharedStyles.textRegular
},
customEmoji: {
width: 20,
height: 20
},
customEmojiBig: {
width: 30,
height: 30
},
temp: { opacity: 0.3 },
mention: {
fontSize: 16,
...sharedStyles.textSemibold
},
paragraph: {
marginTop: 0,
marginBottom: 0,
flexWrap: 'wrap',
flexDirection: 'row',
alignItems: 'flex-start',
justifyContent: 'flex-start'
},
inlineImage: {
width: 300,
height: 300,
resizeMode: 'contain'
},
codeInline: {
[NEW] Support new message parser (#3313) * Add message parser to profile view and db * Add md to db * Remove changes to Xcode project * Remove message-parser lib and add enable message parser field to User model * Fix message parser * Remove admin enableMessageParserEarlyAdoption * Add NewMarkdown component * Remove NewMarkdown component and add specific components for new message parser * Add new parser components * Fix BigEmoji * Updated components and added more Code components * update components and add storybooks * Update Code component and add it to storybooks * Update Mention component * Minor tweaks * Add server message parser validation * Renamed folder, add @rocket.chat/message-parser, migrate some files to TypeScript * Migrate components to TypeScript and fix styling * Change interfaces and add TaskListComponent and styles * Fix new markdown and styles * Fix inlinecode * Stop using server setting * Use enableMessageParserEarlyAdoption on mapStateToProps * Remove React.FC * add link to bold, italic and strike * Update parser components * Fix missing components * Minor tweak * Fix lint and add getCustomEmojis * Fix customEmojis * Update emojis * Minor tweak * disconnect markdown from store * Use @rocket.chat/message-parser@0.30.0 * Fix link style * Unify lists and styles * Remove style prop * Use big emoji as a normal token * Remove unnecessary memo * Fix code styles * Update tests * Conditionally create renderer * Use Context instead of prop drill * Fix Link component * Fix plain text regression and update tests Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-10-20 16:32:58 +00:00
fontSize: 16,
...sharedStyles.textRegular,
...codeFontFamily,
borderWidth: 1,
[NEW] Support new message parser (#3313) * Add message parser to profile view and db * Add md to db * Remove changes to Xcode project * Remove message-parser lib and add enable message parser field to User model * Fix message parser * Remove admin enableMessageParserEarlyAdoption * Add NewMarkdown component * Remove NewMarkdown component and add specific components for new message parser * Add new parser components * Fix BigEmoji * Updated components and added more Code components * update components and add storybooks * Update Code component and add it to storybooks * Update Mention component * Minor tweaks * Add server message parser validation * Renamed folder, add @rocket.chat/message-parser, migrate some files to TypeScript * Migrate components to TypeScript and fix styling * Change interfaces and add TaskListComponent and styles * Fix new markdown and styles * Fix inlinecode * Stop using server setting * Use enableMessageParserEarlyAdoption on mapStateToProps * Remove React.FC * add link to bold, italic and strike * Update parser components * Fix missing components * Minor tweak * Fix lint and add getCustomEmojis * Fix customEmojis * Update emojis * Minor tweak * disconnect markdown from store * Use @rocket.chat/message-parser@0.30.0 * Fix link style * Unify lists and styles * Remove style prop * Use big emoji as a normal token * Remove unnecessary memo * Fix code styles * Update tests * Conditionally create renderer * Use Context instead of prop drill * Fix Link component * Fix plain text regression and update tests Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-10-20 16:32:58 +00:00
borderRadius: 4,
paddingLeft: 2,
paddingTop: 2
},
codeBlock: {
[NEW] Support new message parser (#3313) * Add message parser to profile view and db * Add md to db * Remove changes to Xcode project * Remove message-parser lib and add enable message parser field to User model * Fix message parser * Remove admin enableMessageParserEarlyAdoption * Add NewMarkdown component * Remove NewMarkdown component and add specific components for new message parser * Add new parser components * Fix BigEmoji * Updated components and added more Code components * update components and add storybooks * Update Code component and add it to storybooks * Update Mention component * Minor tweaks * Add server message parser validation * Renamed folder, add @rocket.chat/message-parser, migrate some files to TypeScript * Migrate components to TypeScript and fix styling * Change interfaces and add TaskListComponent and styles * Fix new markdown and styles * Fix inlinecode * Stop using server setting * Use enableMessageParserEarlyAdoption on mapStateToProps * Remove React.FC * add link to bold, italic and strike * Update parser components * Fix missing components * Minor tweak * Fix lint and add getCustomEmojis * Fix customEmojis * Update emojis * Minor tweak * disconnect markdown from store * Use @rocket.chat/message-parser@0.30.0 * Fix link style * Unify lists and styles * Remove style prop * Use big emoji as a normal token * Remove unnecessary memo * Fix code styles * Update tests * Conditionally create renderer * Use Context instead of prop drill * Fix Link component * Fix plain text regression and update tests Co-authored-by: Diego Mello <diegolmello@gmail.com>
2021-10-20 16:32:58 +00:00
fontSize: 16,
...sharedStyles.textRegular,
...codeFontFamily,
borderWidth: 1,
borderRadius: 4,
padding: 4
},
link: {
fontSize: 16,
...sharedStyles.textRegular
},
edited: {
fontSize: 14,
...sharedStyles.textRegular
},
heading1: {
...sharedStyles.textBold,
fontSize: 24
},
heading2: {
...sharedStyles.textBold,
fontSize: 22
},
heading3: {
...sharedStyles.textSemibold,
fontSize: 20
},
heading4: {
...sharedStyles.textSemibold,
fontSize: 18
},
heading5: {
...sharedStyles.textMedium,
fontSize: 16
},
heading6: {
...sharedStyles.textMedium,
fontSize: 14
},
quote: {
height: '100%',
width: 2,
marginRight: 5
},
touchableTable: {
justifyContent: 'center'
},
containerTable: {
borderBottomWidth: 1,
borderRightWidth: 1
},
table: {
borderLeftWidth: 1,
borderTopWidth: 1
},
tableExtraBorders: {
borderBottomWidth: 1,
borderRightWidth: 1
},
row: {
flexDirection: 'row'
},
rowBottomBorder: {
borderBottomWidth: 1
},
cell: {
justifyContent: 'flex-start',
paddingHorizontal: 13,
paddingVertical: 6
},
cellRightBorder: {
borderRightWidth: 1
},
alignCenter: {
textAlign: 'center'
},
alignRight: {
textAlign: 'right'
}
});