@portabletext/plugin-markdown-shortcuts 1.0.15 → 1.1.0
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/index.cjs +262 -247
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +262 -246
- package/dist/index.js.map +1 -1
- package/package.json +7 -6
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
2
3
|
import { useEditor } from "@portabletext/editor";
|
|
3
4
|
import { CharacterPairDecoratorPlugin } from "@portabletext/plugin-character-pair-decorator";
|
|
4
5
|
import { useEffect } from "react";
|
|
@@ -8,7 +9,10 @@ import * as utils from "@portabletext/editor/utils";
|
|
|
8
9
|
function createMarkdownBehaviors(config) {
|
|
9
10
|
const automaticBlockquoteOnSpace = defineBehavior({
|
|
10
11
|
on: "insert.text",
|
|
11
|
-
guard: ({
|
|
12
|
+
guard: ({
|
|
13
|
+
snapshot,
|
|
14
|
+
event
|
|
15
|
+
}) => {
|
|
12
16
|
if (event.text !== " ")
|
|
13
17
|
return !1;
|
|
14
18
|
const selectionCollapsed = selectors.isSelectionCollapsed(snapshot), focusTextBlock = selectors.getFocusTextBlock(snapshot), focusSpan = selectors.getFocusSpan(snapshot);
|
|
@@ -17,11 +21,11 @@ function createMarkdownBehaviors(config) {
|
|
|
17
21
|
const previousInlineObject = selectors.getPreviousInlineObject(snapshot), blockOffset = utils.spanSelectionPointToBlockOffset({
|
|
18
22
|
context: snapshot.context,
|
|
19
23
|
selectionPoint: {
|
|
20
|
-
path: [
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
],
|
|
24
|
+
path: [{
|
|
25
|
+
_key: focusTextBlock.node._key
|
|
26
|
+
}, "children", {
|
|
27
|
+
_key: focusSpan.node._key
|
|
28
|
+
}],
|
|
25
29
|
offset: snapshot.context.selection?.focus.offset ?? 0
|
|
26
30
|
}
|
|
27
31
|
});
|
|
@@ -30,44 +34,46 @@ function createMarkdownBehaviors(config) {
|
|
|
30
34
|
const blockText = utils.getTextBlockText(focusTextBlock.node), caretAtTheEndOfQuote = blockOffset.offset === 1, looksLikeMarkdownQuote = /^>/.test(blockText), blockquoteStyle = config.blockquoteStyle?.({
|
|
31
35
|
schema: snapshot.context.schema
|
|
32
36
|
});
|
|
33
|
-
return caretAtTheEndOfQuote && looksLikeMarkdownQuote && blockquoteStyle !== void 0 ? {
|
|
37
|
+
return caretAtTheEndOfQuote && looksLikeMarkdownQuote && blockquoteStyle !== void 0 ? {
|
|
38
|
+
focusTextBlock,
|
|
39
|
+
style: blockquoteStyle
|
|
40
|
+
} : !1;
|
|
34
41
|
},
|
|
35
|
-
actions: [
|
|
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
|
-
]
|
|
42
|
+
actions: [() => [execute({
|
|
43
|
+
type: "insert.text",
|
|
44
|
+
text: " "
|
|
45
|
+
})], (_, {
|
|
46
|
+
focusTextBlock,
|
|
47
|
+
style
|
|
48
|
+
}) => [execute({
|
|
49
|
+
type: "block.unset",
|
|
50
|
+
props: ["listItem", "level"],
|
|
51
|
+
at: focusTextBlock.path
|
|
52
|
+
}), execute({
|
|
53
|
+
type: "block.set",
|
|
54
|
+
props: {
|
|
55
|
+
style
|
|
56
|
+
},
|
|
57
|
+
at: focusTextBlock.path
|
|
58
|
+
}), execute({
|
|
59
|
+
type: "delete.text",
|
|
60
|
+
at: {
|
|
61
|
+
anchor: {
|
|
62
|
+
path: focusTextBlock.path,
|
|
63
|
+
offset: 0
|
|
64
|
+
},
|
|
65
|
+
focus: {
|
|
66
|
+
path: focusTextBlock.path,
|
|
67
|
+
offset: 2
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
})]]
|
|
68
71
|
}), automaticHr = defineBehavior({
|
|
69
72
|
on: "insert.text",
|
|
70
|
-
guard: ({
|
|
73
|
+
guard: ({
|
|
74
|
+
snapshot,
|
|
75
|
+
event
|
|
76
|
+
}) => {
|
|
71
77
|
const hrCharacter = event.text === "-" ? "-" : event.text === "*" ? "*" : event.text === "_" ? "_" : void 0;
|
|
72
78
|
if (hrCharacter === void 0)
|
|
73
79
|
return !1;
|
|
@@ -86,81 +92,91 @@ function createMarkdownBehaviors(config) {
|
|
|
86
92
|
offset: 3
|
|
87
93
|
}
|
|
88
94
|
};
|
|
89
|
-
return !previousInlineObject && textBefore === `${hrCharacter}${hrCharacter}` ? {
|
|
95
|
+
return !previousInlineObject && textBefore === `${hrCharacter}${hrCharacter}` ? {
|
|
96
|
+
hrObject,
|
|
97
|
+
focusBlock,
|
|
98
|
+
hrCharacter,
|
|
99
|
+
hrBlockOffsets
|
|
100
|
+
} : !1;
|
|
90
101
|
},
|
|
91
|
-
actions: [
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
})
|
|
112
|
-
]
|
|
113
|
-
]
|
|
102
|
+
actions: [(_, {
|
|
103
|
+
hrCharacter
|
|
104
|
+
}) => [execute({
|
|
105
|
+
type: "insert.text",
|
|
106
|
+
text: hrCharacter
|
|
107
|
+
})], (_, {
|
|
108
|
+
hrObject,
|
|
109
|
+
hrBlockOffsets
|
|
110
|
+
}) => [execute({
|
|
111
|
+
type: "insert.block",
|
|
112
|
+
block: {
|
|
113
|
+
_type: hrObject.name,
|
|
114
|
+
...hrObject.value ?? {}
|
|
115
|
+
},
|
|
116
|
+
placement: "before",
|
|
117
|
+
select: "none"
|
|
118
|
+
}), execute({
|
|
119
|
+
type: "delete.text",
|
|
120
|
+
at: hrBlockOffsets
|
|
121
|
+
})]]
|
|
114
122
|
}), automaticHrOnPaste = defineBehavior({
|
|
115
123
|
on: "clipboard.paste",
|
|
116
|
-
guard: ({
|
|
124
|
+
guard: ({
|
|
125
|
+
snapshot,
|
|
126
|
+
event
|
|
127
|
+
}) => {
|
|
117
128
|
const text = event.originEvent.dataTransfer.getData("text/plain"), hrRegExp = /^(---)$|(___)$|(\*\*\*)$/, hrCharacters = text.match(hrRegExp)?.[0], hrObject = config.horizontalRuleObject?.({
|
|
118
129
|
schema: snapshot.context.schema
|
|
119
130
|
}), focusBlock = selectors.getFocusBlock(snapshot), focusTextBlock = selectors.getFocusTextBlock(snapshot);
|
|
120
|
-
return !hrCharacters || !hrObject || !focusBlock ? !1 : {
|
|
131
|
+
return !hrCharacters || !hrObject || !focusBlock ? !1 : {
|
|
132
|
+
hrCharacters,
|
|
133
|
+
hrObject,
|
|
134
|
+
focusBlock,
|
|
135
|
+
focusTextBlock
|
|
136
|
+
};
|
|
121
137
|
},
|
|
122
|
-
actions: [
|
|
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
|
-
]
|
|
138
|
+
actions: [(_, {
|
|
139
|
+
hrCharacters
|
|
140
|
+
}) => [execute({
|
|
141
|
+
type: "insert.text",
|
|
142
|
+
text: hrCharacters
|
|
143
|
+
})], ({
|
|
144
|
+
snapshot
|
|
145
|
+
}, {
|
|
146
|
+
hrObject,
|
|
147
|
+
focusBlock,
|
|
148
|
+
focusTextBlock
|
|
149
|
+
}) => focusTextBlock ? [execute({
|
|
150
|
+
type: "insert.block",
|
|
151
|
+
block: {
|
|
152
|
+
_type: snapshot.context.schema.block.name,
|
|
153
|
+
children: focusTextBlock.node.children
|
|
154
|
+
},
|
|
155
|
+
placement: "after"
|
|
156
|
+
}), execute({
|
|
157
|
+
type: "insert.block",
|
|
158
|
+
block: {
|
|
159
|
+
_type: hrObject.name,
|
|
160
|
+
...hrObject.value ?? {}
|
|
161
|
+
},
|
|
162
|
+
placement: "after"
|
|
163
|
+
}), execute({
|
|
164
|
+
type: "delete.block",
|
|
165
|
+
at: focusBlock.path
|
|
166
|
+
})] : [execute({
|
|
167
|
+
type: "insert.block",
|
|
168
|
+
block: {
|
|
169
|
+
_type: hrObject.name,
|
|
170
|
+
...hrObject.value ?? {}
|
|
171
|
+
},
|
|
172
|
+
placement: "after"
|
|
173
|
+
})]]
|
|
161
174
|
}), automaticHeadingOnSpace = defineBehavior({
|
|
162
175
|
on: "insert.text",
|
|
163
|
-
guard: ({
|
|
176
|
+
guard: ({
|
|
177
|
+
snapshot,
|
|
178
|
+
event
|
|
179
|
+
}) => {
|
|
164
180
|
if (event.text !== " ")
|
|
165
181
|
return !1;
|
|
166
182
|
const selectionCollapsed = selectors.isSelectionCollapsed(snapshot), focusTextBlock = selectors.getFocusTextBlock(snapshot), focusSpan = selectors.getFocusSpan(snapshot);
|
|
@@ -169,11 +185,11 @@ function createMarkdownBehaviors(config) {
|
|
|
169
185
|
const blockOffset = utils.spanSelectionPointToBlockOffset({
|
|
170
186
|
context: snapshot.context,
|
|
171
187
|
selectionPoint: {
|
|
172
|
-
path: [
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
],
|
|
188
|
+
path: [{
|
|
189
|
+
_key: focusTextBlock.node._key
|
|
190
|
+
}, "children", {
|
|
191
|
+
_key: focusSpan.node._key
|
|
192
|
+
}],
|
|
177
193
|
offset: snapshot.context.selection?.focus.offset ?? 0
|
|
178
194
|
}
|
|
179
195
|
});
|
|
@@ -182,64 +198,77 @@ function createMarkdownBehaviors(config) {
|
|
|
182
198
|
const previousInlineObject = selectors.getPreviousInlineObject(snapshot), blockText = utils.getTextBlockText(focusTextBlock.node), markdownHeadingSearch = /^#+/.exec(blockText), level = markdownHeadingSearch ? markdownHeadingSearch[0].length : void 0, caretAtTheEndOfHeading = blockOffset.offset === level;
|
|
183
199
|
if (previousInlineObject || !caretAtTheEndOfHeading)
|
|
184
200
|
return !1;
|
|
185
|
-
const style = level !== void 0 ? config.headingStyle?.({
|
|
201
|
+
const style = level !== void 0 ? config.headingStyle?.({
|
|
202
|
+
schema: snapshot.context.schema,
|
|
203
|
+
level
|
|
204
|
+
}) : void 0;
|
|
186
205
|
return level !== void 0 && style !== void 0 ? {
|
|
187
206
|
focusTextBlock,
|
|
188
207
|
style,
|
|
189
208
|
level
|
|
190
209
|
} : !1;
|
|
191
210
|
},
|
|
192
|
-
actions: [
|
|
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
|
-
|
|
211
|
+
actions: [({
|
|
212
|
+
event
|
|
213
|
+
}) => [execute(event)], (_, {
|
|
214
|
+
focusTextBlock,
|
|
215
|
+
style,
|
|
216
|
+
level
|
|
217
|
+
}) => [execute({
|
|
218
|
+
type: "block.unset",
|
|
219
|
+
props: ["listItem", "level"],
|
|
220
|
+
at: focusTextBlock.path
|
|
221
|
+
}), execute({
|
|
222
|
+
type: "block.set",
|
|
223
|
+
props: {
|
|
224
|
+
style
|
|
225
|
+
},
|
|
226
|
+
at: focusTextBlock.path
|
|
227
|
+
}), execute({
|
|
228
|
+
type: "delete.text",
|
|
229
|
+
at: {
|
|
230
|
+
anchor: {
|
|
231
|
+
path: focusTextBlock.path,
|
|
232
|
+
offset: 0
|
|
233
|
+
},
|
|
234
|
+
focus: {
|
|
235
|
+
path: focusTextBlock.path,
|
|
236
|
+
offset: level + 1
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
})]]
|
|
220
240
|
}), clearStyleOnBackspace = defineBehavior({
|
|
221
241
|
on: "delete.backward",
|
|
222
|
-
guard: ({
|
|
242
|
+
guard: ({
|
|
243
|
+
snapshot
|
|
244
|
+
}) => {
|
|
223
245
|
const selectionCollapsed = selectors.isSelectionCollapsed(snapshot), focusTextBlock = selectors.getFocusTextBlock(snapshot), focusSpan = selectors.getFocusSpan(snapshot);
|
|
224
246
|
if (!selectionCollapsed || !focusTextBlock || !focusSpan)
|
|
225
247
|
return !1;
|
|
226
248
|
const atTheBeginningOfBLock = focusTextBlock.node.children[0]._key === focusSpan.node._key && snapshot.context.selection?.focus.offset === 0, defaultStyle = config.defaultStyle?.({
|
|
227
249
|
schema: snapshot.context.schema
|
|
228
250
|
});
|
|
229
|
-
return atTheBeginningOfBLock && defaultStyle && focusTextBlock.node.style !== defaultStyle ? {
|
|
251
|
+
return atTheBeginningOfBLock && defaultStyle && focusTextBlock.node.style !== defaultStyle ? {
|
|
252
|
+
defaultStyle,
|
|
253
|
+
focusTextBlock
|
|
254
|
+
} : !1;
|
|
230
255
|
},
|
|
231
|
-
actions: [
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
256
|
+
actions: [(_, {
|
|
257
|
+
defaultStyle,
|
|
258
|
+
focusTextBlock
|
|
259
|
+
}) => [execute({
|
|
260
|
+
type: "block.set",
|
|
261
|
+
props: {
|
|
262
|
+
style: defaultStyle
|
|
263
|
+
},
|
|
264
|
+
at: focusTextBlock.path
|
|
265
|
+
})]]
|
|
240
266
|
}), automaticListOnSpace = defineBehavior({
|
|
241
267
|
on: "insert.text",
|
|
242
|
-
guard: ({
|
|
268
|
+
guard: ({
|
|
269
|
+
snapshot,
|
|
270
|
+
event
|
|
271
|
+
}) => {
|
|
243
272
|
if (event.text !== " ")
|
|
244
273
|
return !1;
|
|
245
274
|
const selectionCollapsed = selectors.isSelectionCollapsed(snapshot), focusTextBlock = selectors.getFocusTextBlock(snapshot), focusSpan = selectors.getFocusSpan(snapshot);
|
|
@@ -248,11 +277,11 @@ function createMarkdownBehaviors(config) {
|
|
|
248
277
|
const previousInlineObject = selectors.getPreviousInlineObject(snapshot), blockOffset = utils.spanSelectionPointToBlockOffset({
|
|
249
278
|
context: snapshot.context,
|
|
250
279
|
selectionPoint: {
|
|
251
|
-
path: [
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
],
|
|
280
|
+
path: [{
|
|
281
|
+
_key: focusTextBlock.node._key
|
|
282
|
+
}, "children", {
|
|
283
|
+
_key: focusSpan.node._key
|
|
284
|
+
}],
|
|
256
285
|
offset: snapshot.context.selection?.focus.offset ?? 0
|
|
257
286
|
}
|
|
258
287
|
});
|
|
@@ -280,101 +309,88 @@ function createMarkdownBehaviors(config) {
|
|
|
280
309
|
style: defaultStyle
|
|
281
310
|
} : !1;
|
|
282
311
|
},
|
|
283
|
-
actions: [
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
312
|
+
actions: [({
|
|
313
|
+
event
|
|
314
|
+
}) => [execute(event)], (_, {
|
|
315
|
+
focusTextBlock,
|
|
316
|
+
style,
|
|
317
|
+
listItem,
|
|
318
|
+
listItemLength
|
|
319
|
+
}) => [execute({
|
|
320
|
+
type: "block.set",
|
|
321
|
+
props: {
|
|
322
|
+
listItem,
|
|
323
|
+
level: 1,
|
|
324
|
+
style
|
|
325
|
+
},
|
|
326
|
+
at: focusTextBlock.path
|
|
327
|
+
}), execute({
|
|
328
|
+
type: "delete.text",
|
|
329
|
+
at: {
|
|
330
|
+
anchor: {
|
|
331
|
+
path: focusTextBlock.path,
|
|
332
|
+
offset: 0
|
|
333
|
+
},
|
|
334
|
+
focus: {
|
|
335
|
+
path: focusTextBlock.path,
|
|
336
|
+
offset: listItemLength + 1
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
})]]
|
|
310
340
|
});
|
|
311
|
-
return [
|
|
312
|
-
automaticBlockquoteOnSpace,
|
|
313
|
-
automaticHeadingOnSpace,
|
|
314
|
-
automaticHr,
|
|
315
|
-
automaticHrOnPaste,
|
|
316
|
-
clearStyleOnBackspace,
|
|
317
|
-
automaticListOnSpace
|
|
318
|
-
];
|
|
341
|
+
return [automaticBlockquoteOnSpace, automaticHeadingOnSpace, automaticHr, automaticHrOnPaste, clearStyleOnBackspace, automaticListOnSpace];
|
|
319
342
|
}
|
|
320
343
|
function MarkdownShortcutsPlugin(props) {
|
|
321
|
-
const editor = useEditor();
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
344
|
+
const $ = c(17), editor = useEditor();
|
|
345
|
+
let t0, t1;
|
|
346
|
+
$[0] !== editor || $[1] !== props ? (t0 = () => {
|
|
347
|
+
const unregisterBehaviors = createMarkdownBehaviors(props).map((behavior) => editor.registerBehavior({
|
|
348
|
+
behavior
|
|
349
|
+
}));
|
|
326
350
|
return () => {
|
|
327
351
|
for (const unregisterBehavior of unregisterBehaviors)
|
|
328
352
|
unregisterBehavior();
|
|
329
353
|
};
|
|
330
|
-
}, [editor, props]
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
props.strikeThroughDecorator ? /* @__PURE__ */ jsx(
|
|
371
|
-
CharacterPairDecoratorPlugin,
|
|
372
|
-
{
|
|
373
|
-
decorator: props.strikeThroughDecorator,
|
|
374
|
-
pair: { char: "~", amount: 2 }
|
|
375
|
-
}
|
|
376
|
-
) : null
|
|
377
|
-
] });
|
|
354
|
+
}, t1 = [editor, props], $[0] = editor, $[1] = props, $[2] = t0, $[3] = t1) : (t0 = $[2], t1 = $[3]), useEffect(t0, t1);
|
|
355
|
+
let t2;
|
|
356
|
+
$[4] !== props.boldDecorator ? (t2 = props.boldDecorator ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
357
|
+
/* @__PURE__ */ jsx(CharacterPairDecoratorPlugin, { decorator: props.boldDecorator, pair: {
|
|
358
|
+
char: "*",
|
|
359
|
+
amount: 2
|
|
360
|
+
} }),
|
|
361
|
+
/* @__PURE__ */ jsx(CharacterPairDecoratorPlugin, { decorator: props.boldDecorator, pair: {
|
|
362
|
+
char: "_",
|
|
363
|
+
amount: 2
|
|
364
|
+
} })
|
|
365
|
+
] }) : null, $[4] = props.boldDecorator, $[5] = t2) : t2 = $[5];
|
|
366
|
+
let t3;
|
|
367
|
+
$[6] !== props.codeDecorator ? (t3 = props.codeDecorator ? /* @__PURE__ */ jsx(CharacterPairDecoratorPlugin, { decorator: props.codeDecorator, pair: {
|
|
368
|
+
char: "`",
|
|
369
|
+
amount: 1
|
|
370
|
+
} }) : null, $[6] = props.codeDecorator, $[7] = t3) : t3 = $[7];
|
|
371
|
+
let t4;
|
|
372
|
+
$[8] !== props.italicDecorator ? (t4 = props.italicDecorator ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
373
|
+
/* @__PURE__ */ jsx(CharacterPairDecoratorPlugin, { decorator: props.italicDecorator, pair: {
|
|
374
|
+
char: "*",
|
|
375
|
+
amount: 1
|
|
376
|
+
} }),
|
|
377
|
+
/* @__PURE__ */ jsx(CharacterPairDecoratorPlugin, { decorator: props.italicDecorator, pair: {
|
|
378
|
+
char: "_",
|
|
379
|
+
amount: 1
|
|
380
|
+
} })
|
|
381
|
+
] }) : null, $[8] = props.italicDecorator, $[9] = t4) : t4 = $[9];
|
|
382
|
+
let t5;
|
|
383
|
+
$[10] !== props.strikeThroughDecorator ? (t5 = props.strikeThroughDecorator ? /* @__PURE__ */ jsx(CharacterPairDecoratorPlugin, { decorator: props.strikeThroughDecorator, pair: {
|
|
384
|
+
char: "~",
|
|
385
|
+
amount: 2
|
|
386
|
+
} }) : null, $[10] = props.strikeThroughDecorator, $[11] = t5) : t5 = $[11];
|
|
387
|
+
let t6;
|
|
388
|
+
return $[12] !== t2 || $[13] !== t3 || $[14] !== t4 || $[15] !== t5 ? (t6 = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
389
|
+
t2,
|
|
390
|
+
t3,
|
|
391
|
+
t4,
|
|
392
|
+
t5
|
|
393
|
+
] }), $[12] = t2, $[13] = t3, $[14] = t4, $[15] = t5, $[16] = t6) : t6 = $[16], t6;
|
|
378
394
|
}
|
|
379
395
|
export {
|
|
380
396
|
MarkdownShortcutsPlugin
|