react-native-marked 6.0.0-rc.0 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/lib/Parser.js +36 -0
- package/dist/commonjs/lib/Parser.js.map +1 -1
- package/dist/commonjs/lib/Renderer.js.map +1 -1
- package/dist/commonjs/theme/styles.js +61 -84
- package/dist/commonjs/theme/styles.js.map +1 -1
- package/dist/module/lib/Parser.js +36 -0
- package/dist/module/lib/Parser.js.map +1 -1
- package/dist/module/lib/Renderer.js.map +1 -1
- package/dist/module/theme/styles.js +61 -84
- package/dist/module/theme/styles.js.map +1 -1
- package/dist/typescript/lib/Parser.d.ts +1 -0
- package/dist/typescript/lib/Parser.d.ts.map +1 -1
- package/dist/typescript/lib/Renderer.d.ts +3 -3
- package/dist/typescript/lib/Renderer.d.ts.map +1 -1
- package/dist/typescript/lib/types.d.ts +3 -3
- package/dist/typescript/lib/types.d.ts.map +1 -1
- package/dist/typescript/theme/styles.d.ts.map +1 -1
- package/package.json +18 -18
- package/src/lib/Parser.tsx +40 -0
- package/src/lib/Renderer.tsx +3 -3
- package/src/lib/types.ts +3 -3
- package/src/theme/styles.ts +164 -127
package/src/theme/styles.ts
CHANGED
|
@@ -27,133 +27,170 @@ const getStyles = (
|
|
|
27
27
|
|
|
28
28
|
const fontStyle = getFontStyles(mdColors);
|
|
29
29
|
return StyleSheet.create<MarkedStyles>({
|
|
30
|
-
em:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
30
|
+
em: StyleSheet.flatten([
|
|
31
|
+
fontStyle.regular,
|
|
32
|
+
{
|
|
33
|
+
fontStyle: "italic",
|
|
34
|
+
},
|
|
35
|
+
userStyles?.em,
|
|
36
|
+
]),
|
|
37
|
+
strong: StyleSheet.flatten([
|
|
38
|
+
fontStyle.regular,
|
|
39
|
+
{
|
|
40
|
+
fontWeight: "bold",
|
|
41
|
+
},
|
|
42
|
+
userStyles?.strong,
|
|
43
|
+
]),
|
|
44
|
+
strikethrough: StyleSheet.flatten([
|
|
45
|
+
fontStyle.regular,
|
|
46
|
+
{
|
|
47
|
+
textDecorationLine: "line-through",
|
|
48
|
+
textDecorationStyle: "solid",
|
|
49
|
+
},
|
|
50
|
+
userStyles?.strikethrough,
|
|
51
|
+
]),
|
|
52
|
+
text: StyleSheet.flatten([fontStyle.regular, userStyles?.text]),
|
|
53
|
+
paragraph: StyleSheet.flatten([
|
|
54
|
+
fontStyle.regular,
|
|
55
|
+
{
|
|
56
|
+
paddingVertical: mdSpacing.m,
|
|
57
|
+
},
|
|
58
|
+
userStyles?.paragraph,
|
|
59
|
+
]),
|
|
60
|
+
link: StyleSheet.flatten([
|
|
61
|
+
fontStyle.regular,
|
|
62
|
+
{
|
|
63
|
+
fontStyle: "italic",
|
|
64
|
+
color: mdColors.link,
|
|
65
|
+
},
|
|
66
|
+
userStyles?.link,
|
|
67
|
+
]),
|
|
68
|
+
blockquote: StyleSheet.flatten([
|
|
69
|
+
{
|
|
70
|
+
borderLeftColor: mdColors.border,
|
|
71
|
+
paddingLeft: mdSpacing.l,
|
|
72
|
+
borderLeftWidth: mdSpacing.s,
|
|
73
|
+
opacity: 0.8,
|
|
74
|
+
},
|
|
75
|
+
userStyles?.blockquote,
|
|
76
|
+
]),
|
|
77
|
+
h1: StyleSheet.flatten([
|
|
78
|
+
{
|
|
79
|
+
fontSize: 32,
|
|
80
|
+
lineHeight: 40,
|
|
81
|
+
fontWeight: "bold",
|
|
82
|
+
marginVertical: mdSpacing.m,
|
|
83
|
+
letterSpacing: 0,
|
|
84
|
+
paddingBottom: mdSpacing.s,
|
|
85
|
+
borderBottomColor: mdColors.border,
|
|
86
|
+
borderBottomWidth: 1,
|
|
87
|
+
},
|
|
88
|
+
userStyles?.h1,
|
|
89
|
+
]),
|
|
90
|
+
h2: StyleSheet.flatten([
|
|
91
|
+
fontStyle.heading,
|
|
92
|
+
{
|
|
93
|
+
fontSize: 28,
|
|
94
|
+
lineHeight: 36,
|
|
95
|
+
marginVertical: mdSpacing.m,
|
|
96
|
+
paddingBottom: mdSpacing.s,
|
|
97
|
+
borderBottomColor: mdColors.border,
|
|
98
|
+
borderBottomWidth: 1,
|
|
99
|
+
},
|
|
100
|
+
userStyles?.h2,
|
|
101
|
+
]),
|
|
102
|
+
h3: StyleSheet.flatten([
|
|
103
|
+
fontStyle.heading,
|
|
104
|
+
{
|
|
105
|
+
fontSize: 24,
|
|
106
|
+
lineHeight: 32,
|
|
107
|
+
marginVertical: mdSpacing.s,
|
|
108
|
+
},
|
|
109
|
+
userStyles?.h3,
|
|
110
|
+
]),
|
|
111
|
+
h4: StyleSheet.flatten([
|
|
112
|
+
fontStyle.heading,
|
|
113
|
+
{
|
|
114
|
+
fontSize: 22,
|
|
115
|
+
lineHeight: 28,
|
|
116
|
+
marginVertical: mdSpacing.s,
|
|
117
|
+
},
|
|
118
|
+
userStyles?.h4,
|
|
119
|
+
]),
|
|
120
|
+
h5: StyleSheet.flatten([
|
|
121
|
+
fontStyle.regular,
|
|
122
|
+
fontStyle.heading,
|
|
123
|
+
{
|
|
124
|
+
marginVertical: mdSpacing.xs,
|
|
125
|
+
},
|
|
126
|
+
userStyles?.h5,
|
|
127
|
+
]),
|
|
128
|
+
h6: StyleSheet.flatten([
|
|
129
|
+
fontStyle.heading,
|
|
130
|
+
{
|
|
131
|
+
fontSize: 14,
|
|
132
|
+
lineHeight: 20,
|
|
133
|
+
marginVertical: mdSpacing.xs,
|
|
134
|
+
},
|
|
135
|
+
userStyles?.h6,
|
|
136
|
+
]),
|
|
137
|
+
codespan: StyleSheet.flatten([
|
|
138
|
+
fontStyle.regular,
|
|
139
|
+
{
|
|
140
|
+
fontStyle: "italic",
|
|
141
|
+
backgroundColor: mdColors.code,
|
|
142
|
+
fontWeight: "300",
|
|
143
|
+
},
|
|
144
|
+
userStyles?.codespan,
|
|
145
|
+
]),
|
|
146
|
+
code: StyleSheet.flatten([
|
|
147
|
+
{
|
|
148
|
+
padding: mdSpacing.l,
|
|
149
|
+
backgroundColor: mdColors.code,
|
|
150
|
+
minWidth: "100%",
|
|
151
|
+
},
|
|
152
|
+
userStyles?.code,
|
|
153
|
+
]),
|
|
154
|
+
hr: StyleSheet.flatten([
|
|
155
|
+
{
|
|
156
|
+
borderBottomWidth: 1,
|
|
157
|
+
borderBottomColor: mdColors.border,
|
|
158
|
+
marginVertical: mdSpacing.s,
|
|
159
|
+
},
|
|
160
|
+
userStyles?.hr,
|
|
161
|
+
]),
|
|
162
|
+
li: StyleSheet.flatten([
|
|
163
|
+
fontStyle.regular,
|
|
164
|
+
{
|
|
165
|
+
flexShrink: 1,
|
|
166
|
+
},
|
|
167
|
+
userStyles?.li,
|
|
168
|
+
]),
|
|
169
|
+
image: StyleSheet.flatten([
|
|
170
|
+
{
|
|
171
|
+
resizeMode: "cover",
|
|
172
|
+
},
|
|
173
|
+
userStyles?.image,
|
|
174
|
+
]),
|
|
175
|
+
table: StyleSheet.flatten([
|
|
176
|
+
{
|
|
177
|
+
borderWidth: 1,
|
|
178
|
+
borderColor: mdColors.border,
|
|
179
|
+
},
|
|
180
|
+
userStyles?.table,
|
|
181
|
+
]),
|
|
182
|
+
tableRow: StyleSheet.flatten([
|
|
183
|
+
{
|
|
184
|
+
flexDirection: "row",
|
|
185
|
+
},
|
|
186
|
+
userStyles?.tableRow,
|
|
187
|
+
]),
|
|
188
|
+
tableCell: StyleSheet.flatten([
|
|
189
|
+
{
|
|
190
|
+
padding: mdSpacing.s,
|
|
191
|
+
},
|
|
192
|
+
userStyles?.tableCell,
|
|
193
|
+
]),
|
|
157
194
|
});
|
|
158
195
|
};
|
|
159
196
|
|