-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMarkdownStyle.ts
More file actions
235 lines (211 loc) · 5.33 KB
/
MarkdownStyle.ts
File metadata and controls
235 lines (211 loc) · 5.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
type TextAlign = 'auto' | 'left' | 'right' | 'center' | 'justify';
interface BaseBlockStyle {
fontSize?: number;
fontFamily?: string;
fontWeight?: string;
color?: string;
marginTop?: number;
marginBottom?: number;
lineHeight?: number;
}
interface ParagraphStyle extends BaseBlockStyle {
textAlign?: TextAlign;
}
interface HeadingStyle extends BaseBlockStyle {
textAlign?: TextAlign;
}
interface BlockquoteStyle extends BaseBlockStyle {
borderColor?: string;
borderWidth?: number;
gapWidth?: number;
backgroundColor?: string;
}
interface ListStyle extends BaseBlockStyle {
bulletColor?: string;
bulletSize?: number;
/**
* Minimum reserved marker column width applied uniformly to UL/OL/task lists.
* `0` (the default) means no minimum — each list uses its natural marker width.
*/
markerMinWidth?: number;
markerColor?: string;
markerFontWeight?: string;
gapWidth?: number;
marginLeft?: number;
}
interface CodeBlockStyle extends BaseBlockStyle {
backgroundColor?: string;
borderColor?: string;
borderRadius?: number;
borderWidth?: number;
padding?: number;
}
interface LinkStyle {
fontFamily?: string;
color?: string;
underline?: boolean;
}
interface StrongStyle {
fontFamily?: string;
/**
* Controls whether bold is applied on top of the custom fontFamily.
* Only relevant when fontFamily is set. Defaults to 'bold'.
* Set to 'normal' to use the font face as-is without adding bold.
*/
fontWeight?: 'bold' | 'normal';
color?: string;
}
interface EmphasisStyle {
fontFamily?: string;
/**
* Controls whether italic is applied on top of the custom fontFamily.
* Only relevant when fontFamily is set. Defaults to 'italic'.
* Set to 'normal' to use the font face as-is without adding italic.
*/
fontStyle?: 'italic' | 'normal';
color?: string;
}
interface StrikethroughStyle {
/**
* Color of the strikethrough line.
* @platform iOS
*/
color?: string;
}
interface UnderlineStyle {
/**
* Color of the underline.
* @platform iOS
*/
color?: string;
}
interface CodeStyle {
fontFamily?: string;
fontSize?: number;
color?: string;
backgroundColor?: string;
borderColor?: string;
}
interface ImageStyle {
height?: number;
borderRadius?: number;
marginTop?: number;
marginBottom?: number;
}
interface InlineImageStyle {
size?: number;
}
interface ThematicBreakStyle {
color?: string;
height?: number;
marginTop?: number;
marginBottom?: number;
}
interface TableStyle extends BaseBlockStyle {
headerFontFamily?: string;
headerBackgroundColor?: string;
headerTextColor?: string;
rowEvenBackgroundColor?: string;
rowOddBackgroundColor?: string;
borderColor?: string;
borderWidth?: number;
borderRadius?: number;
cellPaddingHorizontal?: number;
cellPaddingVertical?: number;
}
interface TaskListStyle {
checkedColor?: string;
borderColor?: string;
checkboxSize?: number;
checkboxBorderRadius?: number;
checkmarkColor?: string;
checkedTextColor?: string;
checkedStrikethrough?: boolean;
}
interface MathStyle {
fontSize?: number;
color?: string;
backgroundColor?: string;
padding?: number;
marginTop?: number;
marginBottom?: number;
textAlign?: 'left' | 'center' | 'right';
}
interface InlineMathStyle {
color?: string;
}
interface SpoilerParticlesStyle {
/**
* Number of particles per 100x100pt area.
* Higher values = denser, more opaque concealment.
* @default 8
*/
density?: number;
/**
* Base speed of particle drift in points per second.
* @default 20
*/
speed?: number;
}
interface SpoilerSolidStyle {
/**
* Corner radius of the solid spoiler overlay rectangles.
* @default 4
*/
borderRadius?: number;
}
interface SpoilerStyle {
/** Color used by all presets for the spoiler overlay. */
color?: string;
/** Particle-preset tuning (only applies when spoilerOverlay='particles'). */
particles?: SpoilerParticlesStyle;
/** Solid-preset tuning (only applies when spoilerOverlay='solid'). */
solid?: SpoilerSolidStyle;
}
export interface MarkdownStyle {
paragraph?: ParagraphStyle;
h1?: HeadingStyle;
h2?: HeadingStyle;
h3?: HeadingStyle;
h4?: HeadingStyle;
h5?: HeadingStyle;
h6?: HeadingStyle;
blockquote?: BlockquoteStyle;
list?: ListStyle;
codeBlock?: CodeBlockStyle;
link?: LinkStyle;
strong?: StrongStyle;
em?: EmphasisStyle;
strikethrough?: StrikethroughStyle;
underline?: UnderlineStyle;
code?: CodeStyle;
image?: ImageStyle;
inlineImage?: InlineImageStyle;
thematicBreak?: ThematicBreakStyle;
table?: TableStyle;
taskList?: TaskListStyle;
math?: MathStyle;
inlineMath?: InlineMathStyle;
spoiler?: SpoilerStyle;
}
/**
* MD4C parser flags configuration.
* Controls how the markdown parser interprets certain syntax.
*/
export interface Md4cFlags {
/**
* Enable underline syntax support (__text__).
* When enabled, underscores are treated as underline markers.
* When disabled, underscores are treated as emphasis markers (same as asterisks).
* @default false
*/
underline?: boolean;
/**
* Enable LaTeX math span parsing ($..$ and $$..$$).
* When enabled, the parser recognizes LaTeX math delimiters.
* When disabled, dollar signs are treated as plain text.
* Requires the optional iosMath (iOS) / AndroidMath (Android) native dependencies.
* @default true
*/
latexMath?: boolean;
}