@milkdown/preset-commonmark 6.3.2 → 6.4.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/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.es.js +660 -525
- package/lib/index.es.js.map +1 -1
- package/lib/mark/code-inline.d.ts.map +1 -1
- package/lib/mark/em.d.ts.map +1 -1
- package/lib/mark/link.d.ts.map +1 -1
- package/lib/mark/strong.d.ts.map +1 -1
- package/lib/node/bullet-list.d.ts.map +1 -1
- package/lib/node/heading.d.ts.map +1 -1
- package/lib/node/image.d.ts.map +1 -1
- package/lib/node/list-item.d.ts.map +1 -1
- package/lib/node/ordered-list.d.ts.map +1 -1
- package/lib/plugin/index.d.ts +2 -0
- package/lib/plugin/index.d.ts.map +1 -1
- package/lib/plugin/inline-sync/config.d.ts +24 -0
- package/lib/plugin/inline-sync/config.d.ts.map +1 -0
- package/lib/plugin/inline-sync/context.d.ts +12 -0
- package/lib/plugin/inline-sync/context.d.ts.map +1 -0
- package/lib/plugin/inline-sync/index.d.ts +6 -0
- package/lib/plugin/inline-sync/index.d.ts.map +1 -0
- package/lib/plugin/inline-sync/regexp.d.ts +3 -0
- package/lib/plugin/inline-sync/regexp.d.ts.map +1 -0
- package/lib/plugin/inline-sync/replacer.d.ts +5 -0
- package/lib/plugin/inline-sync/replacer.d.ts.map +1 -0
- package/lib/plugin/inline-sync/utils.d.ts +8 -0
- package/lib/plugin/inline-sync/utils.d.ts.map +1 -0
- package/package.json +5 -5
- package/src/index.ts +1 -0
- package/src/mark/code-inline.ts +25 -4
- package/src/mark/em.ts +1 -6
- package/src/mark/link.ts +1 -19
- package/src/mark/strong.ts +1 -5
- package/src/node/bullet-list.ts +33 -4
- package/src/node/heading.ts +10 -6
- package/src/node/image.ts +4 -5
- package/src/node/list-item.ts +9 -4
- package/src/node/ordered-list.ts +11 -3
- package/src/plugin/index.ts +9 -4
- package/src/plugin/inline-sync/config.ts +56 -0
- package/src/plugin/inline-sync/context.ts +115 -0
- package/src/plugin/inline-sync/index.ts +48 -0
- package/src/plugin/inline-sync/regexp.ts +6 -0
- package/src/plugin/inline-sync/replacer.ts +43 -0
- package/src/plugin/inline-sync/utils.ts +73 -0
package/lib/index.es.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { createMark as
|
|
2
|
-
import { createCmdKey as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { ReplaceStep as
|
|
10
|
-
import { DecorationSet as O, Decoration as
|
|
11
|
-
import { splitListItem as
|
|
12
|
-
import
|
|
13
|
-
import { visit as
|
|
1
|
+
import { createMark as R, createShortcut as h, createNode as w, pipe as Oe, createPlugin as Se, AtomList as be } from "@milkdown/utils";
|
|
2
|
+
import { createCmdKey as y, createCmd as M, commandsCtx as we, editorViewCtx as A, schemaCtx as P, getPalette as Ae, createSlice as ve, serializerCtx as Ee, parserCtx as _e } from "@milkdown/core";
|
|
3
|
+
import { toggleMark as me, wrapIn as pe, setBlockType as S } from "@milkdown/prose/commands";
|
|
4
|
+
import { expectDomTypeError as C, missingRootElement as $e } from "@milkdown/exception";
|
|
5
|
+
import { calculateTextPosition as Pe, cloneTr as Be, findSelectedNodeOfType as K, getNodeFromSchema as Re } from "@milkdown/prose";
|
|
6
|
+
import { PluginKey as T, TextSelection as J, Plugin as x, NodeSelection as We, Selection as Le } from "@milkdown/prose/state";
|
|
7
|
+
import { wrappingInputRule as W, textblockTypeInputRule as Q, InputRule as Ce } from "@milkdown/prose/inputrules";
|
|
8
|
+
import { Fragment as B } from "@milkdown/prose/model";
|
|
9
|
+
import { ReplaceStep as qe, AddMarkStep as Ke } from "@milkdown/prose/transform";
|
|
10
|
+
import { DecorationSet as O, Decoration as X } from "@milkdown/prose/view";
|
|
11
|
+
import { splitListItem as Fe, sinkListItem as je, liftListItem as ze } from "@milkdown/prose/schema-list";
|
|
12
|
+
import Ue from "remark-inline-links";
|
|
13
|
+
import { visit as Ve } from "unist-util-visit";
|
|
14
14
|
const k = {
|
|
15
15
|
HardBreak: "HardBreak",
|
|
16
16
|
Blockquote: "Blockquote",
|
|
@@ -31,14 +31,14 @@ const k = {
|
|
|
31
31
|
NextListItem: "NextListItem",
|
|
32
32
|
SinkListItem: "SinkListItem",
|
|
33
33
|
LiftListItem: "LiftListItem"
|
|
34
|
-
},
|
|
35
|
-
id:
|
|
34
|
+
}, he = "code_inline", Z = y("ToggleInlineCode"), Ge = R((a) => ({
|
|
35
|
+
id: he,
|
|
36
36
|
schema: () => ({
|
|
37
37
|
priority: 100,
|
|
38
38
|
code: !0,
|
|
39
39
|
inclusive: !1,
|
|
40
40
|
parseDOM: [{ tag: "code" }],
|
|
41
|
-
toDOM: (e) => ["code", { class:
|
|
41
|
+
toDOM: (e) => ["code", { class: a.getClassName(e.attrs, "code-inline") }],
|
|
42
42
|
parseMarkdown: {
|
|
43
43
|
match: (e) => e.type === "inlineCode",
|
|
44
44
|
runner: (e, t, r) => {
|
|
@@ -46,26 +46,36 @@ const k = {
|
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
toMarkdown: {
|
|
49
|
-
match: (e) => e.type.name ===
|
|
49
|
+
match: (e) => e.type.name === he,
|
|
50
50
|
runner: (e, t, r) => {
|
|
51
51
|
e.withMark(t, "inlineCode", r.text || "");
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
}),
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
commands: (e) => [
|
|
56
|
+
M(Z, () => (t, r) => {
|
|
57
|
+
const { selection: n, tr: s } = t;
|
|
58
|
+
if (n.empty)
|
|
59
|
+
return !1;
|
|
60
|
+
const { from: l, to: o } = n;
|
|
61
|
+
return t.doc.rangeHasMark(l, o, e) ? (r == null || r(s.removeMark(l, o, e)), !0) : (Object.keys(t.schema.marks).filter((u) => u !== e.name).map((u) => t.schema.marks[u]).forEach((u) => {
|
|
62
|
+
s.removeMark(l, o, u);
|
|
63
|
+
}), r == null || r(s.addMark(l, o, e.create())), !0);
|
|
64
|
+
})
|
|
65
|
+
],
|
|
57
66
|
shortcuts: {
|
|
58
|
-
[k.CodeInline]: h(
|
|
67
|
+
[k.CodeInline]: h(Z, "Mod-e")
|
|
59
68
|
}
|
|
60
|
-
})),
|
|
61
|
-
id:
|
|
69
|
+
})), F = "em", ee = y("ToggleItalic"), Ye = R((a) => ({
|
|
70
|
+
id: F,
|
|
62
71
|
schema: () => ({
|
|
72
|
+
inclusive: !1,
|
|
63
73
|
parseDOM: [
|
|
64
74
|
{ tag: "i" },
|
|
65
75
|
{ tag: "em" },
|
|
66
76
|
{ style: "font-style", getAttrs: (e) => e === "italic" }
|
|
67
77
|
],
|
|
68
|
-
toDOM: (e) => ["em", { class:
|
|
78
|
+
toDOM: (e) => ["em", { class: a.getClassName(e.attrs, F) }],
|
|
69
79
|
parseMarkdown: {
|
|
70
80
|
match: (e) => e.type === "emphasis",
|
|
71
81
|
runner: (e, t, r) => {
|
|
@@ -73,48 +83,43 @@ const k = {
|
|
|
73
83
|
}
|
|
74
84
|
},
|
|
75
85
|
toMarkdown: {
|
|
76
|
-
match: (e) => e.type.name ===
|
|
86
|
+
match: (e) => e.type.name === F,
|
|
77
87
|
runner: (e, t) => {
|
|
78
88
|
e.withMark(t, "emphasis");
|
|
79
89
|
}
|
|
80
90
|
}
|
|
81
91
|
}),
|
|
82
|
-
|
|
83
|
-
_(/(?:^|[^_])(_([^_]+)_)$/, e),
|
|
84
|
-
_(/(?:^|[^*])(\*([^*]+)\*)$/, e)
|
|
85
|
-
],
|
|
86
|
-
commands: (e) => [M(Y, () => W(e))],
|
|
92
|
+
commands: (e) => [M(ee, () => me(e))],
|
|
87
93
|
shortcuts: {
|
|
88
|
-
[k.Em]: h(
|
|
94
|
+
[k.Em]: h(ee, "Mod-i")
|
|
89
95
|
}
|
|
90
|
-
})),
|
|
91
|
-
id:
|
|
96
|
+
})), Je = new T("MILKDOWN_LINK_INPUT"), xe = y("ToggleLink"), te = y("ModifyLink"), E = "link", Qe = R((a, e) => ({
|
|
97
|
+
id: E,
|
|
92
98
|
schema: () => ({
|
|
93
99
|
attrs: {
|
|
94
100
|
href: {},
|
|
95
101
|
title: { default: null }
|
|
96
102
|
},
|
|
97
|
-
inclusive: !1,
|
|
98
103
|
parseDOM: [
|
|
99
104
|
{
|
|
100
105
|
tag: "a[href]",
|
|
101
106
|
getAttrs: (t) => {
|
|
102
107
|
if (!(t instanceof HTMLElement))
|
|
103
|
-
throw
|
|
108
|
+
throw C(t);
|
|
104
109
|
return { href: t.getAttribute("href"), title: t.getAttribute("title") };
|
|
105
110
|
}
|
|
106
111
|
}
|
|
107
112
|
],
|
|
108
|
-
toDOM: (t) => ["a", { ...t.attrs, class:
|
|
113
|
+
toDOM: (t) => ["a", { ...t.attrs, class: a.getClassName(t.attrs, E) }],
|
|
109
114
|
parseMarkdown: {
|
|
110
115
|
match: (t) => t.type === "link",
|
|
111
116
|
runner: (t, r, n) => {
|
|
112
|
-
const s = r.url,
|
|
113
|
-
t.openMark(n, { href: s, title:
|
|
117
|
+
const s = r.url, l = r.title;
|
|
118
|
+
t.openMark(n, { href: s, title: l }), t.next(r.children), t.closeMark(n);
|
|
114
119
|
}
|
|
115
120
|
},
|
|
116
121
|
toMarkdown: {
|
|
117
|
-
match: (t) => t.type.name ===
|
|
122
|
+
match: (t) => t.type.name === E,
|
|
118
123
|
runner: (t, r) => {
|
|
119
124
|
t.withMark(r, "link", void 0, {
|
|
120
125
|
title: r.attrs.title,
|
|
@@ -124,114 +129,105 @@ const k = {
|
|
|
124
129
|
}
|
|
125
130
|
}),
|
|
126
131
|
commands: (t) => [
|
|
127
|
-
M(
|
|
128
|
-
M(
|
|
129
|
-
var
|
|
132
|
+
M(xe, (r = "") => me(t, { href: r })),
|
|
133
|
+
M(te, (r = "") => (n, s) => {
|
|
134
|
+
var I;
|
|
130
135
|
if (!s)
|
|
131
136
|
return !1;
|
|
132
|
-
const { marks:
|
|
133
|
-
let o,
|
|
134
|
-
const { selection:
|
|
135
|
-
if (n.doc.nodesBetween(u, u === f ? f + 1 : f, (
|
|
136
|
-
var
|
|
137
|
-
if ((
|
|
138
|
-
return o =
|
|
137
|
+
const { marks: l } = n.schema;
|
|
138
|
+
let o, c = -1;
|
|
139
|
+
const { selection: i } = n, { from: u, to: f } = i;
|
|
140
|
+
if (n.doc.nodesBetween(u, u === f ? f + 1 : f, (b, H) => {
|
|
141
|
+
var L;
|
|
142
|
+
if ((L = l.link) != null && L.isInSet(b.marks))
|
|
143
|
+
return o = b, c = H, !1;
|
|
139
144
|
}), !o)
|
|
140
145
|
return !1;
|
|
141
|
-
const d = o.marks.find(({ type:
|
|
146
|
+
const d = o.marks.find(({ type: b }) => b === t);
|
|
142
147
|
if (!d)
|
|
143
148
|
return !1;
|
|
144
|
-
const m =
|
|
145
|
-
return
|
|
146
|
-
})
|
|
147
|
-
],
|
|
148
|
-
inputRules: (t, r) => [
|
|
149
|
-
new me(/\[(?<text>.*?)]\((?<href>.*?)(?=“|\))"?(?<title>[^"]+)?"?\)/, (n, s, a, o) => {
|
|
150
|
-
const [l, c = "", u, f] = s, { tr: d } = n;
|
|
151
|
-
if (l) {
|
|
152
|
-
const m = c || "link";
|
|
153
|
-
d.replaceWith(a, o, r.get(A).text(m)).addMark(a, m.length + a, t.create({ title: f, href: u }));
|
|
154
|
-
}
|
|
155
|
-
return d;
|
|
149
|
+
const m = c, p = c + o.nodeSize, { tr: g } = n, N = (I = l.link) == null ? void 0 : I.create({ ...d.attrs, href: r });
|
|
150
|
+
return N ? (s(g.removeMark(m, p, d).addMark(m, p, N).setSelection(new J(g.selection.$anchor)).scrollIntoView()), !0) : !1;
|
|
156
151
|
})
|
|
157
152
|
],
|
|
158
153
|
prosePlugins: (t, r) => {
|
|
159
154
|
let n = !1;
|
|
160
155
|
return [
|
|
161
|
-
new
|
|
162
|
-
key:
|
|
156
|
+
new x({
|
|
157
|
+
key: Je,
|
|
163
158
|
view: (s) => {
|
|
164
159
|
var u, f, d;
|
|
165
|
-
const
|
|
160
|
+
const l = a.themeManager.get("input-chip", {
|
|
166
161
|
placeholder: (f = (u = e == null ? void 0 : e.input) == null ? void 0 : u.placeholder) != null ? f : "Input Web Link",
|
|
167
162
|
buttonText: (d = e == null ? void 0 : e.input) == null ? void 0 : d.buttonText,
|
|
168
163
|
onUpdate: (m) => {
|
|
169
|
-
r.get(
|
|
164
|
+
r.get(we).call(te, m);
|
|
170
165
|
},
|
|
171
|
-
calculatePosition: (m,
|
|
172
|
-
|
|
173
|
-
const
|
|
174
|
-
if (!
|
|
175
|
-
throw
|
|
176
|
-
const
|
|
177
|
-
let
|
|
178
|
-
return n && (
|
|
166
|
+
calculatePosition: (m, p) => {
|
|
167
|
+
Pe(m, p, (g, N, I, b) => {
|
|
168
|
+
const H = m.dom.parentElement;
|
|
169
|
+
if (!H)
|
|
170
|
+
throw $e();
|
|
171
|
+
const L = N.left - g.left;
|
|
172
|
+
let q = g.left - b.left - (I.width - L) / 2, ge = g.bottom - b.top + 14 + H.scrollTop;
|
|
173
|
+
return n && (ge = g.top - b.top - I.height - 14 + H.scrollTop), q < 0 && (q = 0), [ge, q];
|
|
179
174
|
});
|
|
180
175
|
}
|
|
181
176
|
});
|
|
182
|
-
if (!
|
|
177
|
+
if (!l)
|
|
183
178
|
return {};
|
|
184
179
|
const o = (m) => {
|
|
185
|
-
const { selection:
|
|
180
|
+
const { selection: p, doc: g } = m.state, { from: N, to: I } = p;
|
|
186
181
|
if (!m.hasFocus())
|
|
187
182
|
return !1;
|
|
188
|
-
if (
|
|
183
|
+
if (p.empty && p instanceof J && I < g.content.size && N < g.content.size && g.rangeHasMark(N, N === I ? I + 1 : I, t))
|
|
189
184
|
return n = !1, !0;
|
|
190
|
-
if (
|
|
191
|
-
const { node:
|
|
192
|
-
if (
|
|
185
|
+
if (p instanceof We) {
|
|
186
|
+
const { node: b } = p;
|
|
187
|
+
if (b.type.name === "image" && b.marks.findIndex((H) => H.type.name === E) > -1)
|
|
193
188
|
return n = !0, !0;
|
|
194
189
|
}
|
|
195
190
|
return !1;
|
|
196
|
-
}, l = (m) => {
|
|
197
|
-
const { selection: g } = m.state;
|
|
198
|
-
let p;
|
|
199
|
-
const { from: b, to: y } = g;
|
|
200
|
-
if (m.state.doc.nodesBetween(b, b === y ? y + 1 : y, (w) => {
|
|
201
|
-
if (t.isInSet(w.marks))
|
|
202
|
-
return p = w, !1;
|
|
203
|
-
}), !p)
|
|
204
|
-
return;
|
|
205
|
-
const N = p.marks.find((w) => w.type === t);
|
|
206
|
-
return N ? N.attrs.href : void 0;
|
|
207
191
|
}, c = (m) => {
|
|
192
|
+
const { selection: p } = m.state;
|
|
193
|
+
let g;
|
|
194
|
+
const { from: N, to: I } = p;
|
|
195
|
+
if (m.state.doc.nodesBetween(N, N === I ? I + 1 : I, (L) => {
|
|
196
|
+
if (t.isInSet(L.marks))
|
|
197
|
+
return g = L, !1;
|
|
198
|
+
}), !g)
|
|
199
|
+
return;
|
|
200
|
+
const b = g.marks.find((L) => L.type === t);
|
|
201
|
+
return b ? b.attrs.href : void 0;
|
|
202
|
+
}, i = (m) => {
|
|
208
203
|
if (!m.editable)
|
|
209
204
|
return;
|
|
210
|
-
o(m) ? (
|
|
205
|
+
o(m) ? (l.show(m), l.update(c(m))) : l.hide();
|
|
211
206
|
};
|
|
212
|
-
return
|
|
213
|
-
update: (m,
|
|
214
|
-
(
|
|
215
|
-
|
|
207
|
+
return l.init(s), i(s), {
|
|
208
|
+
update: (m, p) => {
|
|
209
|
+
(p == null ? void 0 : p.doc.eq(m.state.doc)) && p.selection.eq(m.state.selection) || requestAnimationFrame(() => {
|
|
210
|
+
i(m);
|
|
216
211
|
});
|
|
217
212
|
},
|
|
218
213
|
destroy: () => {
|
|
219
|
-
|
|
214
|
+
l.destroy();
|
|
220
215
|
}
|
|
221
216
|
};
|
|
222
217
|
}
|
|
223
218
|
})
|
|
224
219
|
];
|
|
225
220
|
}
|
|
226
|
-
})),
|
|
227
|
-
id:
|
|
221
|
+
})), j = "strong", re = y("ToggleBold"), Xe = R((a) => ({
|
|
222
|
+
id: j,
|
|
228
223
|
schema: () => ({
|
|
224
|
+
inclusive: !1,
|
|
229
225
|
parseDOM: [
|
|
230
226
|
{ tag: "b" },
|
|
231
227
|
{ tag: "strong" },
|
|
232
228
|
{ style: "font-style", getAttrs: (e) => e === "bold" }
|
|
233
229
|
],
|
|
234
|
-
toDOM: (e) => ["strong", { class:
|
|
230
|
+
toDOM: (e) => ["strong", { class: a.getClassName(e.attrs, j) }],
|
|
235
231
|
parseMarkdown: {
|
|
236
232
|
match: (e) => e.type === "strong",
|
|
237
233
|
runner: (e, t, r) => {
|
|
@@ -239,75 +235,95 @@ const k = {
|
|
|
239
235
|
}
|
|
240
236
|
},
|
|
241
237
|
toMarkdown: {
|
|
242
|
-
match: (e) => e.type.name ===
|
|
238
|
+
match: (e) => e.type.name === j,
|
|
243
239
|
runner: (e, t) => {
|
|
244
240
|
e.withMark(t, "strong");
|
|
245
241
|
}
|
|
246
242
|
}
|
|
247
243
|
}),
|
|
248
|
-
|
|
249
|
-
_(/(?:__)([^_]+)(?:__)$/, e),
|
|
250
|
-
_(/(?:\*\*)([^*]+)(?:\*\*)$/, e)
|
|
251
|
-
],
|
|
252
|
-
commands: (e) => [M(ee, () => W(e))],
|
|
244
|
+
commands: (e) => [M(re, () => me(e))],
|
|
253
245
|
shortcuts: {
|
|
254
|
-
[k.Bold]: h(
|
|
246
|
+
[k.Bold]: h(re, "Mod-b")
|
|
255
247
|
}
|
|
256
|
-
})),
|
|
257
|
-
id:
|
|
248
|
+
})), Ze = [Ge(), Ye(), Xe(), Qe()], _ = "blockquote", ne = y("WrapInBlockquote"), et = w((a) => ({
|
|
249
|
+
id: _,
|
|
258
250
|
schema: () => ({
|
|
259
251
|
content: "block+",
|
|
260
252
|
group: "block",
|
|
261
253
|
defining: !0,
|
|
262
254
|
parseDOM: [{ tag: "blockquote" }],
|
|
263
|
-
toDOM: (e) => ["blockquote", { class:
|
|
255
|
+
toDOM: (e) => ["blockquote", { class: a.getClassName(e.attrs, _) }, 0],
|
|
264
256
|
parseMarkdown: {
|
|
265
|
-
match: ({ type: e }) => e ===
|
|
257
|
+
match: ({ type: e }) => e === _,
|
|
266
258
|
runner: (e, t, r) => {
|
|
267
259
|
e.openNode(r).next(t.children).closeNode();
|
|
268
260
|
}
|
|
269
261
|
},
|
|
270
262
|
toMarkdown: {
|
|
271
|
-
match: (e) => e.type.name ===
|
|
263
|
+
match: (e) => e.type.name === _,
|
|
272
264
|
runner: (e, t) => {
|
|
273
265
|
e.openNode("blockquote").next(t.content).closeNode();
|
|
274
266
|
}
|
|
275
267
|
}
|
|
276
268
|
}),
|
|
277
|
-
inputRules: (e) => [
|
|
278
|
-
commands: (e) => [M(
|
|
269
|
+
inputRules: (e) => [W(/^\s*>\s$/, e)],
|
|
270
|
+
commands: (e) => [M(ne, () => pe(e))],
|
|
279
271
|
shortcuts: {
|
|
280
|
-
[k.Blockquote]: h(
|
|
272
|
+
[k.Blockquote]: h(ne, "Mod-Shift-b")
|
|
281
273
|
}
|
|
282
|
-
})),
|
|
274
|
+
})), se = y("WrapInBulletList"), tt = w((a) => {
|
|
283
275
|
const e = "bullet_list";
|
|
284
276
|
return {
|
|
285
277
|
id: e,
|
|
286
278
|
schema: () => ({
|
|
287
279
|
content: "listItem+",
|
|
288
280
|
group: "block",
|
|
289
|
-
|
|
290
|
-
|
|
281
|
+
attrs: {
|
|
282
|
+
spread: {
|
|
283
|
+
default: !1
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
parseDOM: [
|
|
287
|
+
{
|
|
288
|
+
tag: "ul",
|
|
289
|
+
getAttrs: (t) => {
|
|
290
|
+
if (!(t instanceof HTMLElement))
|
|
291
|
+
throw C(t);
|
|
292
|
+
return {
|
|
293
|
+
spread: t.dataset.spread
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
],
|
|
298
|
+
toDOM: (t) => [
|
|
299
|
+
"ul",
|
|
300
|
+
{
|
|
301
|
+
"data-spread": t.attrs.spread,
|
|
302
|
+
class: a.getClassName(t.attrs, "bullet-list")
|
|
303
|
+
},
|
|
304
|
+
0
|
|
305
|
+
],
|
|
291
306
|
parseMarkdown: {
|
|
292
307
|
match: ({ type: t, ordered: r }) => t === "list" && !r,
|
|
293
308
|
runner: (t, r, n) => {
|
|
294
|
-
|
|
309
|
+
const s = r.spread != null ? `${r.spread}` : "false";
|
|
310
|
+
t.openNode(n, { spread: s }).next(r.children).closeNode();
|
|
295
311
|
}
|
|
296
312
|
},
|
|
297
313
|
toMarkdown: {
|
|
298
314
|
match: (t) => t.type.name === e,
|
|
299
315
|
runner: (t, r) => {
|
|
300
|
-
t.openNode("list", void 0, { ordered: !1 }).next(r.content).closeNode();
|
|
316
|
+
t.openNode("list", void 0, { ordered: !1, spread: r.attrs.spread === "true" }).next(r.content).closeNode();
|
|
301
317
|
}
|
|
302
318
|
}
|
|
303
319
|
}),
|
|
304
|
-
inputRules: (t) => [
|
|
305
|
-
commands: (t) => [M(
|
|
320
|
+
inputRules: (t) => [W(/^\s*([-+*])\s$/, t)],
|
|
321
|
+
commands: (t) => [M(se, () => pe(t))],
|
|
306
322
|
shortcuts: {
|
|
307
|
-
[k.BulletList]: h(
|
|
323
|
+
[k.BulletList]: h(se, "Mod-Alt-8")
|
|
308
324
|
}
|
|
309
325
|
};
|
|
310
|
-
}),
|
|
326
|
+
}), rt = [
|
|
311
327
|
"",
|
|
312
328
|
"javascript",
|
|
313
329
|
"typescript",
|
|
@@ -324,10 +340,10 @@ const k = {
|
|
|
324
340
|
"go",
|
|
325
341
|
"rust",
|
|
326
342
|
"markdown"
|
|
327
|
-
],
|
|
328
|
-
const t = (e == null ? void 0 : e.languageList) ||
|
|
343
|
+
], nt = /^```(?<language>[a-z]*)?[\s\n]$/, st = /^~~~(?<language>[a-z]*)?[\s\n]$/, oe = y("TurnIntoCodeFence"), z = "fence", ot = w((a, e) => {
|
|
344
|
+
const t = (e == null ? void 0 : e.languageList) || rt;
|
|
329
345
|
return {
|
|
330
|
-
id:
|
|
346
|
+
id: z,
|
|
331
347
|
schema: (r) => ({
|
|
332
348
|
content: "text*",
|
|
333
349
|
group: "block",
|
|
@@ -349,18 +365,18 @@ const k = {
|
|
|
349
365
|
getAttrs: (n) => {
|
|
350
366
|
var s;
|
|
351
367
|
if (!(n instanceof HTMLElement))
|
|
352
|
-
throw
|
|
368
|
+
throw C(n);
|
|
353
369
|
return { language: (s = n.querySelector("pre")) == null ? void 0 : s.dataset.language };
|
|
354
370
|
},
|
|
355
371
|
getContent: (n, s) => {
|
|
356
|
-
var
|
|
372
|
+
var c, i;
|
|
357
373
|
if (!(n instanceof HTMLElement))
|
|
358
|
-
throw
|
|
359
|
-
const
|
|
360
|
-
if (!
|
|
361
|
-
return
|
|
362
|
-
const o = s.text(
|
|
363
|
-
return
|
|
374
|
+
throw C(n);
|
|
375
|
+
const l = (i = (c = n.querySelector("pre")) == null ? void 0 : c.textContent) != null ? i : "";
|
|
376
|
+
if (!l)
|
|
377
|
+
return B.empty;
|
|
378
|
+
const o = s.text(l);
|
|
379
|
+
return B.from(o);
|
|
364
380
|
}
|
|
365
381
|
},
|
|
366
382
|
{
|
|
@@ -368,30 +384,30 @@ const k = {
|
|
|
368
384
|
preserveWhitespace: "full",
|
|
369
385
|
getAttrs: (n) => {
|
|
370
386
|
if (!(n instanceof HTMLElement))
|
|
371
|
-
throw
|
|
387
|
+
throw C(n);
|
|
372
388
|
return { language: n.dataset.language };
|
|
373
389
|
}
|
|
374
390
|
}
|
|
375
391
|
],
|
|
376
392
|
toDOM: (n) => {
|
|
377
393
|
const s = document.createElement("select");
|
|
378
|
-
return t.forEach((
|
|
394
|
+
return t.forEach((l) => {
|
|
379
395
|
const o = document.createElement("option");
|
|
380
|
-
o.value =
|
|
381
|
-
}), s.onchange = (
|
|
382
|
-
const o =
|
|
396
|
+
o.value = l, o.innerText = l || "--", l === n.attrs.language && (o.selected = !0), s.appendChild(o);
|
|
397
|
+
}), s.onchange = (l) => {
|
|
398
|
+
const o = l.target;
|
|
383
399
|
if (!(o instanceof HTMLSelectElement))
|
|
384
400
|
return;
|
|
385
|
-
const
|
|
386
|
-
if (!
|
|
401
|
+
const c = r.get(A);
|
|
402
|
+
if (!c.editable) {
|
|
387
403
|
o.value = n.attrs.language;
|
|
388
404
|
return;
|
|
389
405
|
}
|
|
390
|
-
const { top:
|
|
406
|
+
const { top: i, left: u } = o.getBoundingClientRect(), f = c.posAtCoords({ top: i, left: u });
|
|
391
407
|
if (!f)
|
|
392
408
|
return;
|
|
393
|
-
const { tr: d } =
|
|
394
|
-
|
|
409
|
+
const { tr: d } = c.state;
|
|
410
|
+
c.dispatch(d.setNodeMarkup(f.inside, void 0, {
|
|
395
411
|
...n.attrs,
|
|
396
412
|
language: o.value
|
|
397
413
|
}));
|
|
@@ -405,7 +421,7 @@ const k = {
|
|
|
405
421
|
"pre",
|
|
406
422
|
{
|
|
407
423
|
"data-language": n.attrs.language,
|
|
408
|
-
class:
|
|
424
|
+
class: a.getClassName(n.attrs, "code-fence")
|
|
409
425
|
},
|
|
410
426
|
["code", { spellCheck: "false" }, 0]
|
|
411
427
|
]
|
|
@@ -413,93 +429,93 @@ const k = {
|
|
|
413
429
|
},
|
|
414
430
|
parseMarkdown: {
|
|
415
431
|
match: ({ type: n }) => n === "code",
|
|
416
|
-
runner: (n, s,
|
|
417
|
-
const o = s.lang,
|
|
418
|
-
n.openNode(
|
|
432
|
+
runner: (n, s, l) => {
|
|
433
|
+
const o = s.lang, c = s.value;
|
|
434
|
+
n.openNode(l, { language: o }), c && n.addText(c), n.closeNode();
|
|
419
435
|
}
|
|
420
436
|
},
|
|
421
437
|
toMarkdown: {
|
|
422
|
-
match: (n) => n.type.name ===
|
|
438
|
+
match: (n) => n.type.name === z,
|
|
423
439
|
runner: (n, s) => {
|
|
424
|
-
var
|
|
425
|
-
n.addNode("code", void 0, ((
|
|
440
|
+
var l;
|
|
441
|
+
n.addNode("code", void 0, ((l = s.content.firstChild) == null ? void 0 : l.text) || "", {
|
|
426
442
|
lang: s.attrs.language
|
|
427
443
|
});
|
|
428
444
|
}
|
|
429
445
|
}
|
|
430
446
|
}),
|
|
431
447
|
inputRules: (r) => [
|
|
432
|
-
|
|
433
|
-
const [s,
|
|
448
|
+
Q(nt, r, (n) => {
|
|
449
|
+
const [s, l] = n;
|
|
434
450
|
if (!!s)
|
|
435
|
-
return { language:
|
|
451
|
+
return { language: l };
|
|
436
452
|
}),
|
|
437
|
-
|
|
438
|
-
const [s,
|
|
453
|
+
Q(st, r, (n) => {
|
|
454
|
+
const [s, l] = n;
|
|
439
455
|
if (!!s)
|
|
440
|
-
return { language:
|
|
456
|
+
return { language: l };
|
|
441
457
|
})
|
|
442
458
|
],
|
|
443
|
-
commands: (r) => [M(
|
|
459
|
+
commands: (r) => [M(oe, () => S(r))],
|
|
444
460
|
shortcuts: {
|
|
445
|
-
[k.CodeFence]: h(
|
|
461
|
+
[k.CodeFence]: h(oe, "Mod-Alt-c")
|
|
446
462
|
},
|
|
447
463
|
view: () => (r, n, s) => {
|
|
448
|
-
let
|
|
449
|
-
const o = (
|
|
450
|
-
const { tr:
|
|
451
|
-
n.dispatch(
|
|
464
|
+
let l = r;
|
|
465
|
+
const o = (g) => {
|
|
466
|
+
const { tr: N } = n.state;
|
|
467
|
+
n.dispatch(N.setNodeMarkup(s(), void 0, {
|
|
452
468
|
fold: !0,
|
|
453
|
-
language:
|
|
469
|
+
language: g
|
|
454
470
|
}));
|
|
455
|
-
},
|
|
456
|
-
const { tr:
|
|
457
|
-
n.dispatch(
|
|
458
|
-
...
|
|
471
|
+
}, c = () => {
|
|
472
|
+
const { tr: g } = n.state;
|
|
473
|
+
n.dispatch(g.setNodeMarkup(s(), void 0, {
|
|
474
|
+
...l.attrs,
|
|
459
475
|
fold: !0
|
|
460
476
|
}));
|
|
461
|
-
},
|
|
462
|
-
const { tr:
|
|
463
|
-
n.dispatch(
|
|
464
|
-
...
|
|
477
|
+
}, i = () => {
|
|
478
|
+
const { tr: g } = n.state;
|
|
479
|
+
n.dispatch(g.setNodeMarkup(s(), void 0, {
|
|
480
|
+
...l.attrs,
|
|
465
481
|
fold: !1
|
|
466
482
|
}));
|
|
467
|
-
}, u =
|
|
468
|
-
onBlur:
|
|
469
|
-
onFocus:
|
|
483
|
+
}, u = a.themeManager.get("code-fence", {
|
|
484
|
+
onBlur: c,
|
|
485
|
+
onFocus: i,
|
|
470
486
|
onSelectLanguage: o,
|
|
471
487
|
editable: () => n.editable,
|
|
472
488
|
languageList: t
|
|
473
489
|
});
|
|
474
490
|
if (!u)
|
|
475
491
|
return {};
|
|
476
|
-
const { dom: f, contentDOM: d, onUpdate: m, onDestroy:
|
|
477
|
-
return m(
|
|
492
|
+
const { dom: f, contentDOM: d, onUpdate: m, onDestroy: p } = u;
|
|
493
|
+
return m(l), {
|
|
478
494
|
dom: f,
|
|
479
495
|
contentDOM: d,
|
|
480
|
-
update: (
|
|
481
|
-
destroy:
|
|
496
|
+
update: (g) => g.type.name !== z ? !1 : (l = g, m(l), !0),
|
|
497
|
+
destroy: p
|
|
482
498
|
};
|
|
483
499
|
}
|
|
484
500
|
};
|
|
485
|
-
}),
|
|
501
|
+
}), at = w(() => ({
|
|
486
502
|
id: "doc",
|
|
487
503
|
schema: () => ({
|
|
488
504
|
content: "block+",
|
|
489
505
|
parseMarkdown: {
|
|
490
|
-
match: ({ type:
|
|
491
|
-
runner: (
|
|
492
|
-
|
|
506
|
+
match: ({ type: a }) => a === "root",
|
|
507
|
+
runner: (a, e, t) => {
|
|
508
|
+
a.injectRoot(e, t);
|
|
493
509
|
}
|
|
494
510
|
},
|
|
495
511
|
toMarkdown: {
|
|
496
|
-
match: (
|
|
497
|
-
runner: (
|
|
498
|
-
|
|
512
|
+
match: (a) => a.type.name === "doc",
|
|
513
|
+
runner: (a, e) => {
|
|
514
|
+
a.openNode("root"), a.next(e.content);
|
|
499
515
|
}
|
|
500
516
|
}
|
|
501
517
|
})
|
|
502
|
-
})),
|
|
518
|
+
})), ae = y("InsertHardbreak"), lt = new T("MILKDOWN_HARDBREAK_FILTER"), ct = w((a, e) => {
|
|
503
519
|
var r;
|
|
504
520
|
const t = (r = e == null ? void 0 : e.notIn) != null ? r : ["table", "fence"];
|
|
505
521
|
return {
|
|
@@ -509,11 +525,11 @@ const k = {
|
|
|
509
525
|
group: "inline",
|
|
510
526
|
selectable: !1,
|
|
511
527
|
parseDOM: [{ tag: "br" }],
|
|
512
|
-
toDOM: (n) => ["br", { class:
|
|
528
|
+
toDOM: (n) => ["br", { class: a.getClassName(n.attrs, "hardbreak") }],
|
|
513
529
|
parseMarkdown: {
|
|
514
530
|
match: ({ type: n }) => n === "break",
|
|
515
|
-
runner: (n, s,
|
|
516
|
-
n.addNode(
|
|
531
|
+
runner: (n, s, l) => {
|
|
532
|
+
n.addNode(l);
|
|
517
533
|
}
|
|
518
534
|
},
|
|
519
535
|
toMarkdown: {
|
|
@@ -524,27 +540,27 @@ const k = {
|
|
|
524
540
|
}
|
|
525
541
|
}),
|
|
526
542
|
commands: (n) => [
|
|
527
|
-
M(
|
|
528
|
-
var
|
|
529
|
-
const { selection: o, tr:
|
|
543
|
+
M(ae, () => (s, l) => {
|
|
544
|
+
var i;
|
|
545
|
+
const { selection: o, tr: c } = s;
|
|
530
546
|
if (o.empty) {
|
|
531
547
|
const u = o.$from.node();
|
|
532
|
-
if (u.childCount > 0 && ((
|
|
533
|
-
return
|
|
548
|
+
if (u.childCount > 0 && ((i = u.lastChild) == null ? void 0 : i.type.name) === "hardbreak")
|
|
549
|
+
return l == null || l(c.replaceRangeWith(o.to - 1, o.to, s.schema.node("paragraph")).setSelection(Le.near(c.doc.resolve(o.to))).scrollIntoView()), !0;
|
|
534
550
|
}
|
|
535
|
-
return
|
|
551
|
+
return l == null || l(c.setMeta("hardbreak", !0).replaceSelectionWith(n.create()).scrollIntoView()), !0;
|
|
536
552
|
})
|
|
537
553
|
],
|
|
538
554
|
shortcuts: {
|
|
539
|
-
[k.HardBreak]: h(
|
|
555
|
+
[k.HardBreak]: h(ae, "Shift-Enter")
|
|
540
556
|
},
|
|
541
557
|
prosePlugins: (n) => [
|
|
542
|
-
new
|
|
543
|
-
key:
|
|
544
|
-
filterTransaction: (s,
|
|
545
|
-
const o = s.getMeta("hardbreak"), [
|
|
546
|
-
if (o &&
|
|
547
|
-
const { from:
|
|
558
|
+
new x({
|
|
559
|
+
key: lt,
|
|
560
|
+
filterTransaction: (s, l) => {
|
|
561
|
+
const o = s.getMeta("hardbreak"), [c] = s.steps;
|
|
562
|
+
if (o && c) {
|
|
563
|
+
const { from: i } = c, u = l.doc.resolve(i);
|
|
548
564
|
let f = u.depth, d = !0;
|
|
549
565
|
for (; f > 0; )
|
|
550
566
|
t.includes(u.node(f).type.name) && (d = !1), f--;
|
|
@@ -553,109 +569,111 @@ const k = {
|
|
|
553
569
|
return !0;
|
|
554
570
|
}
|
|
555
571
|
}),
|
|
556
|
-
new
|
|
572
|
+
new x({
|
|
557
573
|
key: new T("MILKDOWN_HARDBREAK_MARKS"),
|
|
558
|
-
appendTransaction: (s,
|
|
574
|
+
appendTransaction: (s, l, o) => {
|
|
559
575
|
if (!s.length)
|
|
560
576
|
return;
|
|
561
|
-
const [
|
|
562
|
-
if (!
|
|
577
|
+
const [c] = s;
|
|
578
|
+
if (!c)
|
|
563
579
|
return;
|
|
564
|
-
const [
|
|
565
|
-
if (
|
|
566
|
-
if (!(
|
|
580
|
+
const [i] = c.steps;
|
|
581
|
+
if (c.getMeta("hardbreak")) {
|
|
582
|
+
if (!(i instanceof qe))
|
|
567
583
|
return;
|
|
568
|
-
const { from: d } =
|
|
584
|
+
const { from: d } = i;
|
|
569
585
|
return o.tr.setNodeMarkup(d, n, void 0, []);
|
|
570
586
|
}
|
|
571
|
-
if (
|
|
587
|
+
if (i instanceof Ke) {
|
|
572
588
|
let d = o.tr;
|
|
573
|
-
const { from: m, to:
|
|
574
|
-
return o.doc.nodesBetween(m,
|
|
575
|
-
|
|
589
|
+
const { from: m, to: p } = i;
|
|
590
|
+
return o.doc.nodesBetween(m, p, (g, N) => {
|
|
591
|
+
g.type === n && (d = d.setNodeMarkup(N, n, void 0, []));
|
|
576
592
|
}), d;
|
|
577
593
|
}
|
|
578
594
|
}
|
|
579
595
|
})
|
|
580
596
|
]
|
|
581
597
|
};
|
|
582
|
-
}),
|
|
598
|
+
}), ke = Array(6).fill(0).map((a, e) => e + 1), D = y("TurnIntoHeading"), Me = y("DowngradeHeading"), U = new T("MILKDOWN_HEADING_ID"), it = new T("MILKDOWN_HEADING_HASH"), ut = (a) => a.textContent.replace(/[\p{P}\p{S}]/gu, "").replace(/\s/g, "-").toLowerCase().trim(), dt = (a, e, t) => {
|
|
583
599
|
let r = !1;
|
|
584
|
-
const n = (s,
|
|
585
|
-
const o = s.tr;
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
600
|
+
const n = (s, l) => {
|
|
601
|
+
const o = s.tr.setMeta("addToHistory", !1);
|
|
602
|
+
let c = !1;
|
|
603
|
+
s.doc.descendants((i, u) => {
|
|
604
|
+
if (i.type === e && !r) {
|
|
605
|
+
if (i.textContent.trim().length === 0)
|
|
589
606
|
return;
|
|
590
|
-
const
|
|
591
|
-
|
|
592
|
-
...
|
|
593
|
-
id:
|
|
594
|
-
});
|
|
607
|
+
const f = i.attrs, d = t(i);
|
|
608
|
+
f.id !== d && (c = !0, o.setMeta(U, !0).setNodeMarkup(u, void 0, {
|
|
609
|
+
...f,
|
|
610
|
+
id: d
|
|
611
|
+
}));
|
|
595
612
|
}
|
|
596
|
-
}),
|
|
613
|
+
}), c && l(o);
|
|
597
614
|
};
|
|
598
|
-
return new
|
|
599
|
-
key:
|
|
615
|
+
return new x({
|
|
616
|
+
key: U,
|
|
600
617
|
props: {
|
|
601
618
|
handleDOMEvents: {
|
|
602
619
|
compositionstart: () => (r = !0, !1),
|
|
603
620
|
compositionend: () => {
|
|
604
621
|
r = !1;
|
|
605
|
-
const s =
|
|
622
|
+
const s = a.get(A);
|
|
606
623
|
return setTimeout(() => {
|
|
607
|
-
n(s.state, (
|
|
624
|
+
n(s.state, (l) => s.dispatch(l));
|
|
608
625
|
}, 0), !1;
|
|
609
626
|
}
|
|
610
627
|
}
|
|
611
628
|
},
|
|
612
|
-
appendTransaction: (s,
|
|
613
|
-
let
|
|
614
|
-
return s.every((
|
|
615
|
-
|
|
616
|
-
}),
|
|
629
|
+
appendTransaction: (s, l, o) => {
|
|
630
|
+
let c = null;
|
|
631
|
+
return s.every((i) => !i.getMeta(U)) && s.some((i) => i.docChanged) && n(o, (i) => {
|
|
632
|
+
c = i;
|
|
633
|
+
}), c;
|
|
617
634
|
},
|
|
618
635
|
view: (s) => {
|
|
619
|
-
const
|
|
620
|
-
let o = s.state.tr;
|
|
621
|
-
return
|
|
622
|
-
|
|
623
|
-
...
|
|
624
|
-
id: t(
|
|
636
|
+
const l = s.state.doc;
|
|
637
|
+
let o = s.state.tr.setMeta("addToHistory", !1);
|
|
638
|
+
return l.descendants((c, i) => {
|
|
639
|
+
c.type.name === "heading" && c.attrs.level && (c.attrs.id || (o = o.setNodeMarkup(i, void 0, {
|
|
640
|
+
...c.attrs,
|
|
641
|
+
id: t(c)
|
|
625
642
|
})));
|
|
626
643
|
}), s.dispatch(o), {};
|
|
627
644
|
}
|
|
628
645
|
});
|
|
629
|
-
},
|
|
630
|
-
key:
|
|
646
|
+
}, ft = (a, e, t) => new x({
|
|
647
|
+
key: it,
|
|
631
648
|
state: {
|
|
632
649
|
init: () => O.empty,
|
|
633
650
|
apply: (r) => {
|
|
634
|
-
|
|
635
|
-
|
|
651
|
+
var f;
|
|
652
|
+
const n = a.get(A);
|
|
653
|
+
if (!((f = n.hasFocus) != null && f.call(n)) || !n.editable)
|
|
636
654
|
return O.empty;
|
|
637
|
-
const { $from: s } = r.selection,
|
|
638
|
-
if (
|
|
655
|
+
const { $from: s } = r.selection, l = s.node();
|
|
656
|
+
if (l.type !== e)
|
|
639
657
|
return O.empty;
|
|
640
|
-
const o =
|
|
641
|
-
|
|
642
|
-
const
|
|
643
|
-
const
|
|
644
|
-
return
|
|
658
|
+
const o = l.attrs.level, c = (d) => Array(d).fill(0).map((m) => "#").join(""), i = document.createElement("span");
|
|
659
|
+
i.textContent = c(o), i.contentEditable = "false", t.themeManager.onFlush(() => {
|
|
660
|
+
const d = t.getStyle(({ css: m }) => {
|
|
661
|
+
const p = Ae(t.themeManager);
|
|
662
|
+
return m`
|
|
645
663
|
margin-right: 4px;
|
|
646
|
-
color: ${
|
|
664
|
+
color: ${p("primary")};
|
|
647
665
|
`;
|
|
648
666
|
});
|
|
649
|
-
|
|
667
|
+
d && (i.className = d);
|
|
650
668
|
});
|
|
651
|
-
const u =
|
|
669
|
+
const u = X.widget(s.before() + 1, i, { side: -1 });
|
|
652
670
|
return O.create(r.doc, [u]);
|
|
653
671
|
}
|
|
654
672
|
},
|
|
655
673
|
props: {
|
|
656
674
|
handleDOMEvents: {
|
|
657
675
|
focus: (r) => {
|
|
658
|
-
const n =
|
|
676
|
+
const n = Be(r.state.tr);
|
|
659
677
|
return r.dispatch(n), !1;
|
|
660
678
|
}
|
|
661
679
|
},
|
|
@@ -663,9 +681,9 @@ const k = {
|
|
|
663
681
|
return this.getState(r);
|
|
664
682
|
}
|
|
665
683
|
}
|
|
666
|
-
}),
|
|
667
|
-
var s,
|
|
668
|
-
const t = "heading", r = (s = e == null ? void 0 : e.getId) != null ? s :
|
|
684
|
+
}), mt = w((a, e) => {
|
|
685
|
+
var s, l;
|
|
686
|
+
const t = "heading", r = (s = e == null ? void 0 : e.getId) != null ? s : ut, n = (l = e == null ? void 0 : e.displayHashtag) != null ? l : !0;
|
|
669
687
|
return {
|
|
670
688
|
id: t,
|
|
671
689
|
schema: () => ({
|
|
@@ -680,89 +698,89 @@ const k = {
|
|
|
680
698
|
default: 1
|
|
681
699
|
}
|
|
682
700
|
},
|
|
683
|
-
parseDOM:
|
|
701
|
+
parseDOM: ke.map((o) => ({
|
|
684
702
|
tag: `h${o}`,
|
|
685
|
-
getAttrs: (
|
|
686
|
-
if (!(
|
|
687
|
-
throw
|
|
688
|
-
return { level: o, id:
|
|
703
|
+
getAttrs: (c) => {
|
|
704
|
+
if (!(c instanceof HTMLElement))
|
|
705
|
+
throw C(c);
|
|
706
|
+
return { level: o, id: c.id };
|
|
689
707
|
}
|
|
690
708
|
})),
|
|
691
709
|
toDOM: (o) => [
|
|
692
710
|
`h${o.attrs.level}`,
|
|
693
711
|
{
|
|
694
712
|
id: o.attrs.id || r(o),
|
|
695
|
-
class:
|
|
713
|
+
class: a.getClassName(o.attrs, `heading h${o.attrs.level}`)
|
|
696
714
|
},
|
|
697
715
|
0
|
|
698
716
|
],
|
|
699
717
|
parseMarkdown: {
|
|
700
718
|
match: ({ type: o }) => o === t,
|
|
701
|
-
runner: (o,
|
|
702
|
-
const u =
|
|
703
|
-
o.openNode(
|
|
719
|
+
runner: (o, c, i) => {
|
|
720
|
+
const u = c.depth;
|
|
721
|
+
o.openNode(i, { level: u }), o.next(c.children), o.closeNode();
|
|
704
722
|
}
|
|
705
723
|
},
|
|
706
724
|
toMarkdown: {
|
|
707
725
|
match: (o) => o.type.name === t,
|
|
708
|
-
runner: (o,
|
|
726
|
+
runner: (o, c) => {
|
|
709
727
|
var u;
|
|
710
|
-
if (o.openNode("heading", void 0, { depth:
|
|
728
|
+
if (o.openNode("heading", void 0, { depth: c.attrs.level }), c.childCount >= 1 && ((u = c.lastChild) == null ? void 0 : u.type.name) === "hardbreak") {
|
|
711
729
|
const f = [];
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
}), o.next(
|
|
730
|
+
c.content.forEach((d, m, p) => {
|
|
731
|
+
p !== c.childCount - 1 && f.push(d);
|
|
732
|
+
}), o.next(B.fromArray(f));
|
|
715
733
|
} else
|
|
716
|
-
o.next(
|
|
734
|
+
o.next(c.content);
|
|
717
735
|
o.closeNode();
|
|
718
736
|
}
|
|
719
737
|
}
|
|
720
738
|
}),
|
|
721
|
-
inputRules: (o,
|
|
722
|
-
const u =
|
|
739
|
+
inputRules: (o, c) => ke.map((i) => Q(new RegExp(`^(#{1,${i}})\\s$`), o, () => {
|
|
740
|
+
const u = c.get(A), { $from: f } = u.state.selection, d = f.node();
|
|
723
741
|
if (d.type.name === "heading") {
|
|
724
|
-
let m = Number(d.attrs.level) + Number(
|
|
742
|
+
let m = Number(d.attrs.level) + Number(i);
|
|
725
743
|
return m > 6 && (m = 6), {
|
|
726
744
|
level: m
|
|
727
745
|
};
|
|
728
746
|
}
|
|
729
747
|
return {
|
|
730
|
-
level:
|
|
748
|
+
level: i
|
|
731
749
|
};
|
|
732
750
|
})),
|
|
733
|
-
commands: (o,
|
|
734
|
-
M(
|
|
735
|
-
M(
|
|
736
|
-
const { $from: d } =
|
|
737
|
-
if (m.type !== o || !
|
|
751
|
+
commands: (o, c) => [
|
|
752
|
+
M(D, (i = 1) => i < 1 ? S(i === 0 && c.get(P).nodes.paragraph || o) : S(i === 0 && c.get(P).nodes.paragraph || o, { level: i })),
|
|
753
|
+
M(Me, () => (i, u, f) => {
|
|
754
|
+
const { $from: d } = i.selection, m = d.node();
|
|
755
|
+
if (m.type !== o || !i.selection.empty || d.parentOffset !== 0)
|
|
738
756
|
return !1;
|
|
739
|
-
const
|
|
740
|
-
return
|
|
757
|
+
const p = m.attrs.level - 1;
|
|
758
|
+
return p ? (u == null || u(i.tr.setNodeMarkup(i.selection.$from.before(), void 0, {
|
|
741
759
|
...m.attrs,
|
|
742
|
-
level:
|
|
743
|
-
})), !0) :
|
|
760
|
+
level: p
|
|
761
|
+
})), !0) : S(c.get(P).nodes.paragraph || o)(i, u, f);
|
|
744
762
|
})
|
|
745
763
|
],
|
|
746
764
|
shortcuts: {
|
|
747
|
-
[k.H1]: h(
|
|
748
|
-
[k.H2]: h(
|
|
749
|
-
[k.H3]: h(
|
|
750
|
-
[k.H4]: h(
|
|
751
|
-
[k.H5]: h(
|
|
752
|
-
[k.H6]: h(
|
|
753
|
-
[k.DowngradeHeading]: h(
|
|
765
|
+
[k.H1]: h(D, "Mod-Alt-1", 1),
|
|
766
|
+
[k.H2]: h(D, "Mod-Alt-2", 2),
|
|
767
|
+
[k.H3]: h(D, "Mod-Alt-3", 3),
|
|
768
|
+
[k.H4]: h(D, "Mod-Alt-4", 4),
|
|
769
|
+
[k.H5]: h(D, "Mod-Alt-5", 5),
|
|
770
|
+
[k.H6]: h(D, "Mod-Alt-6", 6),
|
|
771
|
+
[k.DowngradeHeading]: h(Me, ["Backspace", "Delete"])
|
|
754
772
|
},
|
|
755
|
-
prosePlugins: (o,
|
|
756
|
-
const
|
|
757
|
-
return n &&
|
|
773
|
+
prosePlugins: (o, c) => {
|
|
774
|
+
const i = [dt(c, o, r)];
|
|
775
|
+
return n && i.push(ft(c, o, a)), i;
|
|
758
776
|
}
|
|
759
777
|
};
|
|
760
|
-
}),
|
|
761
|
-
id:
|
|
778
|
+
}), V = "hr", Te = y("InsertHr"), pt = w((a) => ({
|
|
779
|
+
id: V,
|
|
762
780
|
schema: () => ({
|
|
763
781
|
group: "block",
|
|
764
782
|
parseDOM: [{ tag: "hr" }],
|
|
765
|
-
toDOM: (e) => ["hr", { class:
|
|
783
|
+
toDOM: (e) => ["hr", { class: a.getClassName(e.attrs, V) }],
|
|
766
784
|
parseMarkdown: {
|
|
767
785
|
match: ({ type: e }) => e === "thematicBreak",
|
|
768
786
|
runner: (e, t, r) => {
|
|
@@ -770,30 +788,30 @@ const k = {
|
|
|
770
788
|
}
|
|
771
789
|
},
|
|
772
790
|
toMarkdown: {
|
|
773
|
-
match: (e) => e.type.name ===
|
|
791
|
+
match: (e) => e.type.name === V,
|
|
774
792
|
runner: (e) => {
|
|
775
793
|
e.addNode("thematicBreak");
|
|
776
794
|
}
|
|
777
795
|
}
|
|
778
796
|
}),
|
|
779
797
|
inputRules: (e) => [
|
|
780
|
-
new
|
|
781
|
-
const { tr:
|
|
782
|
-
return r[0] &&
|
|
798
|
+
new Ce(/^(?:---|___\s|\*\*\*\s)$/, (t, r, n, s) => {
|
|
799
|
+
const { tr: l } = t;
|
|
800
|
+
return r[0] && l.replaceWith(n - 1, s, e.create()), l;
|
|
783
801
|
})
|
|
784
802
|
],
|
|
785
803
|
commands: (e, t) => [
|
|
786
|
-
M(
|
|
804
|
+
M(Te, () => (r, n) => {
|
|
787
805
|
if (!n)
|
|
788
806
|
return !0;
|
|
789
|
-
const s = t.get(
|
|
790
|
-
if (!
|
|
807
|
+
const s = t.get(P).node("paragraph"), { tr: l, selection: o } = r, { from: c } = o, i = e.create();
|
|
808
|
+
if (!i)
|
|
791
809
|
return !0;
|
|
792
|
-
const u =
|
|
810
|
+
const u = l.replaceSelectionWith(i).insert(c, s), f = Le.findFrom(u.doc.resolve(c), 1, !0);
|
|
793
811
|
return f && n(u.setSelection(f).scrollIntoView()), !0;
|
|
794
812
|
})
|
|
795
813
|
]
|
|
796
|
-
})),
|
|
814
|
+
})), le = y("ModifyImage"), He = y("InsertImage"), $ = "image", gt = new T("MILKDOWN_IMAGE_INPUT"), ht = w((a, e) => ({
|
|
797
815
|
id: "image",
|
|
798
816
|
schema: () => ({
|
|
799
817
|
inline: !0,
|
|
@@ -806,20 +824,19 @@ const k = {
|
|
|
806
824
|
isolating: !0,
|
|
807
825
|
attrs: {
|
|
808
826
|
src: { default: "" },
|
|
809
|
-
alt: { default:
|
|
810
|
-
title: { default:
|
|
827
|
+
alt: { default: "" },
|
|
828
|
+
title: { default: "" }
|
|
811
829
|
},
|
|
812
830
|
parseDOM: [
|
|
813
831
|
{
|
|
814
832
|
tag: "img[src]",
|
|
815
833
|
getAttrs: (t) => {
|
|
816
834
|
if (!(t instanceof HTMLElement))
|
|
817
|
-
throw
|
|
835
|
+
throw C(t);
|
|
818
836
|
return {
|
|
819
837
|
src: t.getAttribute("src") || "",
|
|
820
|
-
alt: t.getAttribute("alt"),
|
|
821
|
-
title: t.getAttribute("title") || t.getAttribute("alt")
|
|
822
|
-
width: t.getAttribute("width")
|
|
838
|
+
alt: t.getAttribute("alt") || "",
|
|
839
|
+
title: t.getAttribute("title") || t.getAttribute("alt") || ""
|
|
823
840
|
};
|
|
824
841
|
}
|
|
825
842
|
}
|
|
@@ -828,22 +845,22 @@ const k = {
|
|
|
828
845
|
"img",
|
|
829
846
|
{
|
|
830
847
|
...t.attrs,
|
|
831
|
-
class:
|
|
848
|
+
class: a.getClassName(t.attrs, $)
|
|
832
849
|
}
|
|
833
850
|
],
|
|
834
851
|
parseMarkdown: {
|
|
835
|
-
match: ({ type: t }) => t ===
|
|
852
|
+
match: ({ type: t }) => t === $,
|
|
836
853
|
runner: (t, r, n) => {
|
|
837
|
-
const s = r.url,
|
|
854
|
+
const s = r.url, l = r.alt, o = r.title;
|
|
838
855
|
t.addNode(n, {
|
|
839
856
|
src: s,
|
|
840
|
-
alt:
|
|
857
|
+
alt: l,
|
|
841
858
|
title: o
|
|
842
859
|
});
|
|
843
860
|
}
|
|
844
861
|
},
|
|
845
862
|
toMarkdown: {
|
|
846
|
-
match: (t) => t.type.name ===
|
|
863
|
+
match: (t) => t.type.name === $,
|
|
847
864
|
runner: (t, r) => {
|
|
848
865
|
t.addNode("image", void 0, void 0, {
|
|
849
866
|
title: r.attrs.title,
|
|
@@ -854,42 +871,42 @@ const k = {
|
|
|
854
871
|
}
|
|
855
872
|
}),
|
|
856
873
|
commands: (t) => [
|
|
857
|
-
M(
|
|
874
|
+
M(He, (r = "") => (n, s) => {
|
|
858
875
|
if (!s)
|
|
859
876
|
return !0;
|
|
860
|
-
const { tr:
|
|
877
|
+
const { tr: l } = n, o = t.create({ src: r });
|
|
861
878
|
if (!o)
|
|
862
879
|
return !0;
|
|
863
|
-
const
|
|
864
|
-
return s(
|
|
880
|
+
const c = l.replaceSelectionWith(o);
|
|
881
|
+
return s(c.scrollIntoView()), !0;
|
|
865
882
|
}),
|
|
866
|
-
M(
|
|
867
|
-
const
|
|
868
|
-
if (!
|
|
883
|
+
M(le, (r = "") => (n, s) => {
|
|
884
|
+
const l = K(n.selection, t);
|
|
885
|
+
if (!l)
|
|
869
886
|
return !1;
|
|
870
887
|
const { tr: o } = n;
|
|
871
|
-
return s == null || s(o.setNodeMarkup(
|
|
888
|
+
return s == null || s(o.setNodeMarkup(l.pos, void 0, { ...l.node.attrs, loading: !0, src: r }).scrollIntoView()), !0;
|
|
872
889
|
})
|
|
873
890
|
],
|
|
874
891
|
inputRules: (t) => [
|
|
875
|
-
new
|
|
876
|
-
const [o,
|
|
877
|
-
return o && f.replaceWith(s,
|
|
892
|
+
new Ce(/!\[(?<alt>.*?)]\((?<filename>.*?)\s*(?="|\))"?(?<title>[^"]+)?"?\)/, (r, n, s, l) => {
|
|
893
|
+
const [o, c, i = "", u] = n, { tr: f } = r;
|
|
894
|
+
return o && f.replaceWith(s, l, t.create({ src: i, alt: c, title: u })), f;
|
|
878
895
|
})
|
|
879
896
|
],
|
|
880
897
|
view: () => (t) => {
|
|
881
|
-
var
|
|
898
|
+
var i, u;
|
|
882
899
|
let r = t;
|
|
883
|
-
const n = (
|
|
900
|
+
const n = (i = e == null ? void 0 : e.placeholder) != null ? i : "Add an Image", s = (u = e == null ? void 0 : e.isBlock) != null ? u : !1, l = a.themeManager.get("image", {
|
|
884
901
|
placeholder: n,
|
|
885
902
|
isBlock: s
|
|
886
903
|
});
|
|
887
|
-
if (!
|
|
904
|
+
if (!l)
|
|
888
905
|
return {};
|
|
889
|
-
const { dom: o, onUpdate:
|
|
890
|
-
return
|
|
906
|
+
const { dom: o, onUpdate: c } = l;
|
|
907
|
+
return c(r), {
|
|
891
908
|
dom: o,
|
|
892
|
-
update: (f) => f.type.name !==
|
|
909
|
+
update: (f) => f.type.name !== $ ? !1 : (r = f, c(r), !0),
|
|
893
910
|
selectNode: () => {
|
|
894
911
|
o.classList.add("ProseMirror-selectednode");
|
|
895
912
|
},
|
|
@@ -899,30 +916,30 @@ const k = {
|
|
|
899
916
|
};
|
|
900
917
|
},
|
|
901
918
|
prosePlugins: (t, r) => [
|
|
902
|
-
new
|
|
903
|
-
key:
|
|
919
|
+
new x({
|
|
920
|
+
key: gt,
|
|
904
921
|
view: (n) => {
|
|
905
|
-
var
|
|
906
|
-
const s =
|
|
907
|
-
placeholder: (u = (
|
|
922
|
+
var i, u, f;
|
|
923
|
+
const s = a.themeManager.get("input-chip", {
|
|
924
|
+
placeholder: (u = (i = e == null ? void 0 : e.input) == null ? void 0 : i.placeholder) != null ? u : "Input Image Link",
|
|
908
925
|
buttonText: (f = e == null ? void 0 : e.input) == null ? void 0 : f.buttonText,
|
|
909
926
|
onUpdate: (d) => {
|
|
910
|
-
r.get(
|
|
927
|
+
r.get(we).call(le, d);
|
|
911
928
|
}
|
|
912
929
|
});
|
|
913
930
|
if (!s)
|
|
914
931
|
return {};
|
|
915
|
-
const
|
|
916
|
-
const m =
|
|
932
|
+
const l = (d) => Boolean(d.hasFocus() && t && K(d.state.selection, t)), o = (d) => {
|
|
933
|
+
const m = K(d.state.selection, t);
|
|
917
934
|
return m ? m.node.attrs.src : void 0;
|
|
918
|
-
},
|
|
935
|
+
}, c = (d) => {
|
|
919
936
|
if (!d.editable)
|
|
920
937
|
return;
|
|
921
|
-
|
|
938
|
+
l(d) ? (s.show(d), s.update(o(d))) : s.hide();
|
|
922
939
|
};
|
|
923
|
-
return s.init(n),
|
|
940
|
+
return s.init(n), c(n), {
|
|
924
941
|
update: (d, m) => {
|
|
925
|
-
(m == null ? void 0 : m.doc.eq(d.state.doc)) && m.selection.eq(d.state.selection) ||
|
|
942
|
+
(m == null ? void 0 : m.doc.eq(d.state.doc)) && m.selection.eq(d.state.selection) || c(d);
|
|
926
943
|
},
|
|
927
944
|
destroy: () => {
|
|
928
945
|
s.destroy();
|
|
@@ -931,35 +948,31 @@ const k = {
|
|
|
931
948
|
}
|
|
932
949
|
})
|
|
933
950
|
]
|
|
934
|
-
})),
|
|
951
|
+
})), ye = "list_item", ce = y("SplitListItem"), ie = y("SinkListItem"), ue = y("LiftListItem"), kt = new T("MILKDOWN_KEEP_LIST_ORDER"), Mt = (a) => {
|
|
935
952
|
const e = (t, r) => {
|
|
936
|
-
const n =
|
|
953
|
+
const n = Re("ordered_list", t.schema);
|
|
937
954
|
let s = t.tr;
|
|
938
|
-
t.doc.descendants((
|
|
939
|
-
if (
|
|
955
|
+
t.doc.descendants((l, o, c, i) => {
|
|
956
|
+
if (l.type === a && (c == null ? void 0 : c.type) === n) {
|
|
940
957
|
let u = !1;
|
|
941
|
-
const f = { ...
|
|
942
|
-
|
|
943
|
-
const d =
|
|
944
|
-
|
|
945
|
-
const m = d.attrs.label;
|
|
946
|
-
f.label = `${Number(m.slice(0, -1)) + c}.`, u = !0;
|
|
947
|
-
}
|
|
948
|
-
a.attrs.label === "\u2022" && (f.label = `${c + 1}.`, u = !0), u && (s = s.setNodeMarkup(o, void 0, f));
|
|
958
|
+
const f = { ...l.attrs };
|
|
959
|
+
l.attrs.listType !== "ordered" && (f.listType = "ordered", u = !0);
|
|
960
|
+
const d = c == null ? void 0 : c.maybeChild(0);
|
|
961
|
+
d && d.type === a && d.attrs.listType === "ordered" && (f.label = `${i + 1}.`, u = !0), l.attrs.label === "\u2022" && (f.label = `${i + 1}.`, u = !0), u && (s = s.setNodeMarkup(o, void 0, f));
|
|
949
962
|
}
|
|
950
963
|
}), r(s);
|
|
951
964
|
};
|
|
952
|
-
return new
|
|
953
|
-
key:
|
|
965
|
+
return new x({
|
|
966
|
+
key: kt,
|
|
954
967
|
appendTransaction: (t, r, n) => {
|
|
955
968
|
let s = null;
|
|
956
|
-
return t.some((
|
|
957
|
-
s =
|
|
969
|
+
return t.some((l) => l.docChanged) && e(n, (l) => {
|
|
970
|
+
s = l;
|
|
958
971
|
}), s;
|
|
959
972
|
}
|
|
960
973
|
});
|
|
961
|
-
},
|
|
962
|
-
id:
|
|
974
|
+
}, yt = w((a) => ({
|
|
975
|
+
id: ye,
|
|
963
976
|
schema: () => ({
|
|
964
977
|
group: "listItem",
|
|
965
978
|
content: "paragraph block*",
|
|
@@ -969,6 +982,9 @@ const k = {
|
|
|
969
982
|
},
|
|
970
983
|
listType: {
|
|
971
984
|
default: "bullet"
|
|
985
|
+
},
|
|
986
|
+
spread: {
|
|
987
|
+
default: "true"
|
|
972
988
|
}
|
|
973
989
|
},
|
|
974
990
|
defining: !0,
|
|
@@ -977,10 +993,11 @@ const k = {
|
|
|
977
993
|
tag: "li.list-item",
|
|
978
994
|
getAttrs: (e) => {
|
|
979
995
|
if (!(e instanceof HTMLElement))
|
|
980
|
-
throw
|
|
996
|
+
throw C(e);
|
|
981
997
|
return {
|
|
982
998
|
label: e.dataset.label,
|
|
983
|
-
listType: e.dataset["list-type"]
|
|
999
|
+
listType: e.dataset["list-type"],
|
|
1000
|
+
spread: e.dataset.spread
|
|
984
1001
|
};
|
|
985
1002
|
},
|
|
986
1003
|
contentElement: "div.list-item_body"
|
|
@@ -990,47 +1007,51 @@ const k = {
|
|
|
990
1007
|
toDOM: (e) => [
|
|
991
1008
|
"li",
|
|
992
1009
|
{
|
|
993
|
-
class:
|
|
1010
|
+
class: a.getClassName(e.attrs, "list-item"),
|
|
994
1011
|
"data-label": e.attrs.label,
|
|
995
|
-
"data-list-type": e.attrs.listType
|
|
1012
|
+
"data-list-type": e.attrs.listType,
|
|
1013
|
+
"data-spread": e.attrs.spread
|
|
996
1014
|
},
|
|
997
|
-
["div", { class:
|
|
998
|
-
["div", { class:
|
|
1015
|
+
["div", { class: a.getClassName(e.attrs, "list-item_label") }, e.attrs.label],
|
|
1016
|
+
["div", { class: a.getClassName(e.attrs, "list-item_body") }, 0]
|
|
999
1017
|
],
|
|
1000
1018
|
parseMarkdown: {
|
|
1001
1019
|
match: ({ type: e, checked: t }) => e === "listItem" && t === null,
|
|
1002
1020
|
runner: (e, t, r) => {
|
|
1003
|
-
const n = t.label != null ? `${t.label}.` : "\u2022", s = t.label != null ? "ordered" : "bullet";
|
|
1004
|
-
e.openNode(r, { label: n, listType: s }), e.next(t.children), e.closeNode();
|
|
1021
|
+
const n = t.label != null ? `${t.label}.` : "\u2022", s = t.label != null ? "ordered" : "bullet", l = t.spread != null ? `${t.spread}` : "true";
|
|
1022
|
+
e.openNode(r, { label: n, listType: s, spread: l }), e.next(t.children), e.closeNode();
|
|
1005
1023
|
}
|
|
1006
1024
|
},
|
|
1007
1025
|
toMarkdown: {
|
|
1008
|
-
match: (e) => e.type.name ===
|
|
1026
|
+
match: (e) => e.type.name === ye,
|
|
1009
1027
|
runner: (e, t) => {
|
|
1010
|
-
e.openNode("listItem"), e.next(t.content), e.closeNode();
|
|
1028
|
+
e.openNode("listItem", void 0, { spread: t.attrs.spread === "true" }), e.next(t.content), e.closeNode();
|
|
1011
1029
|
}
|
|
1012
1030
|
}
|
|
1013
1031
|
}),
|
|
1014
|
-
inputRules: (e) => [
|
|
1032
|
+
inputRules: (e) => [W(/^\s*([-+*])\s$/, e)],
|
|
1015
1033
|
commands: (e) => [
|
|
1016
|
-
M(
|
|
1017
|
-
M(
|
|
1018
|
-
M(
|
|
1034
|
+
M(ce, () => Fe(e)),
|
|
1035
|
+
M(ie, () => je(e)),
|
|
1036
|
+
M(ue, () => ze(e))
|
|
1019
1037
|
],
|
|
1020
1038
|
shortcuts: {
|
|
1021
|
-
[k.NextListItem]: h(
|
|
1022
|
-
[k.SinkListItem]: h(
|
|
1023
|
-
[k.LiftListItem]: h(
|
|
1039
|
+
[k.NextListItem]: h(ce, "Enter"),
|
|
1040
|
+
[k.SinkListItem]: h(ie, "Mod-]"),
|
|
1041
|
+
[k.LiftListItem]: h(ue, "Mod-[")
|
|
1024
1042
|
},
|
|
1025
|
-
prosePlugins: (e) => [
|
|
1026
|
-
})),
|
|
1027
|
-
id:
|
|
1043
|
+
prosePlugins: (e) => [Mt(e)]
|
|
1044
|
+
})), de = y("WrapInOrderedList"), Ne = "ordered_list", Nt = w((a) => ({
|
|
1045
|
+
id: Ne,
|
|
1028
1046
|
schema: () => ({
|
|
1029
1047
|
content: "listItem+",
|
|
1030
1048
|
group: "block",
|
|
1031
1049
|
attrs: {
|
|
1032
1050
|
order: {
|
|
1033
1051
|
default: 1
|
|
1052
|
+
},
|
|
1053
|
+
spread: {
|
|
1054
|
+
default: !1
|
|
1034
1055
|
}
|
|
1035
1056
|
},
|
|
1036
1057
|
parseDOM: [
|
|
@@ -1038,8 +1059,11 @@ const k = {
|
|
|
1038
1059
|
tag: "ol",
|
|
1039
1060
|
getAttrs: (e) => {
|
|
1040
1061
|
if (!(e instanceof HTMLElement))
|
|
1041
|
-
throw
|
|
1042
|
-
return {
|
|
1062
|
+
throw C(e);
|
|
1063
|
+
return {
|
|
1064
|
+
spread: e.dataset.spread,
|
|
1065
|
+
order: e.hasAttribute("start") ? Number(e.getAttribute("start")) : 1
|
|
1066
|
+
};
|
|
1043
1067
|
}
|
|
1044
1068
|
}
|
|
1045
1069
|
],
|
|
@@ -1047,37 +1071,39 @@ const k = {
|
|
|
1047
1071
|
"ol",
|
|
1048
1072
|
{
|
|
1049
1073
|
...e.attrs.order === 1 ? {} : e.attrs.order,
|
|
1050
|
-
|
|
1074
|
+
"data-spread": e.attrs.spread,
|
|
1075
|
+
class: a.getClassName(e.attrs, "ordered-list")
|
|
1051
1076
|
},
|
|
1052
1077
|
0
|
|
1053
1078
|
],
|
|
1054
1079
|
parseMarkdown: {
|
|
1055
1080
|
match: ({ type: e, ordered: t }) => e === "list" && !!t,
|
|
1056
1081
|
runner: (e, t, r) => {
|
|
1057
|
-
|
|
1082
|
+
const n = t.spread != null ? `${t.spread}` : "true";
|
|
1083
|
+
e.openNode(r, { spread: n }).next(t.children).closeNode();
|
|
1058
1084
|
}
|
|
1059
1085
|
},
|
|
1060
1086
|
toMarkdown: {
|
|
1061
|
-
match: (e) => e.type.name ===
|
|
1087
|
+
match: (e) => e.type.name === Ne,
|
|
1062
1088
|
runner: (e, t) => {
|
|
1063
|
-
e.openNode("list", void 0, { ordered: !0, start: 1 }), e.next(t.content), e.closeNode();
|
|
1089
|
+
e.openNode("list", void 0, { ordered: !0, start: 1, spread: t.attrs.spread === "true" }), e.next(t.content), e.closeNode();
|
|
1064
1090
|
}
|
|
1065
1091
|
}
|
|
1066
1092
|
}),
|
|
1067
1093
|
inputRules: (e) => [
|
|
1068
|
-
|
|
1094
|
+
W(/^(\d+)\.\s$/, e, (t) => ({ order: Number(t[1]) }), (t, r) => r.childCount + r.attrs.order === Number(t[1]))
|
|
1069
1095
|
],
|
|
1070
|
-
commands: (e) => [M(
|
|
1096
|
+
commands: (e) => [M(de, () => pe(e))],
|
|
1071
1097
|
shortcuts: {
|
|
1072
|
-
[k.OrderedList]: h(
|
|
1098
|
+
[k.OrderedList]: h(de, "Mod-Alt-7")
|
|
1073
1099
|
}
|
|
1074
|
-
})),
|
|
1075
|
-
id:
|
|
1100
|
+
})), fe = y("TurnIntoText"), Ie = "paragraph", It = w((a) => ({
|
|
1101
|
+
id: Ie,
|
|
1076
1102
|
schema: () => ({
|
|
1077
1103
|
content: "inline*",
|
|
1078
1104
|
group: "block",
|
|
1079
1105
|
parseDOM: [{ tag: "p" }],
|
|
1080
|
-
toDOM: (e) => ["p", { class:
|
|
1106
|
+
toDOM: (e) => ["p", { class: a.getClassName(e.attrs, Ie) }, 0],
|
|
1081
1107
|
parseMarkdown: {
|
|
1082
1108
|
match: (e) => e.type === "paragraph",
|
|
1083
1109
|
runner: (e, t, r) => {
|
|
@@ -1090,94 +1116,94 @@ const k = {
|
|
|
1090
1116
|
var n;
|
|
1091
1117
|
if (e.openNode("paragraph"), t.childCount >= 1 && ((n = t.lastChild) == null ? void 0 : n.type.name) === "hardbreak") {
|
|
1092
1118
|
const s = [];
|
|
1093
|
-
t.content.forEach((
|
|
1094
|
-
|
|
1095
|
-
}), e.next(
|
|
1119
|
+
t.content.forEach((l, o, c) => {
|
|
1120
|
+
c !== t.childCount - 1 && s.push(l);
|
|
1121
|
+
}), e.next(B.fromArray(s));
|
|
1096
1122
|
} else
|
|
1097
1123
|
e.next(t.content);
|
|
1098
1124
|
e.closeNode();
|
|
1099
1125
|
}
|
|
1100
1126
|
}
|
|
1101
1127
|
}),
|
|
1102
|
-
commands: (e) => [M(
|
|
1128
|
+
commands: (e) => [M(fe, () => S(e))],
|
|
1103
1129
|
shortcuts: {
|
|
1104
|
-
[k.Text]: h(
|
|
1130
|
+
[k.Text]: h(fe, "Mod-Alt-0")
|
|
1105
1131
|
}
|
|
1106
|
-
})),
|
|
1132
|
+
})), bt = w(() => ({
|
|
1107
1133
|
id: "text",
|
|
1108
1134
|
schema: () => ({
|
|
1109
1135
|
group: "inline",
|
|
1110
1136
|
parseMarkdown: {
|
|
1111
|
-
match: ({ type:
|
|
1112
|
-
runner: (
|
|
1113
|
-
|
|
1137
|
+
match: ({ type: a }) => a === "text",
|
|
1138
|
+
runner: (a, e) => {
|
|
1139
|
+
a.addText(e.value);
|
|
1114
1140
|
}
|
|
1115
1141
|
},
|
|
1116
1142
|
toMarkdown: {
|
|
1117
|
-
match: (
|
|
1118
|
-
runner: (
|
|
1119
|
-
|
|
1143
|
+
match: (a) => a.type.name === "text",
|
|
1144
|
+
runner: (a, e) => {
|
|
1145
|
+
a.addNode("text", void 0, e.text);
|
|
1120
1146
|
}
|
|
1121
1147
|
}
|
|
1122
1148
|
})
|
|
1123
|
-
})),
|
|
1124
|
-
|
|
1125
|
-
|
|
1149
|
+
})), wt = [
|
|
1150
|
+
at(),
|
|
1151
|
+
It(),
|
|
1152
|
+
ct(),
|
|
1153
|
+
et(),
|
|
1154
|
+
ot(),
|
|
1126
1155
|
tt(),
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
Ge(),
|
|
1130
|
-
ft(),
|
|
1156
|
+
Nt(),
|
|
1157
|
+
yt(),
|
|
1131
1158
|
mt(),
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
We(e, "list", (t) => {
|
|
1159
|
+
pt(),
|
|
1160
|
+
ht(),
|
|
1161
|
+
bt()
|
|
1162
|
+
], Lt = () => {
|
|
1163
|
+
function a(e) {
|
|
1164
|
+
Ve(e, "list", (t) => {
|
|
1139
1165
|
var r;
|
|
1140
1166
|
if (t.ordered) {
|
|
1141
1167
|
const n = (r = t.start) != null ? r : 1;
|
|
1142
|
-
t.children.forEach((s,
|
|
1143
|
-
s.label =
|
|
1168
|
+
t.children.forEach((s, l) => {
|
|
1169
|
+
s.label = l + n;
|
|
1144
1170
|
});
|
|
1145
1171
|
return;
|
|
1146
1172
|
}
|
|
1147
1173
|
});
|
|
1148
1174
|
}
|
|
1149
|
-
return
|
|
1150
|
-
},
|
|
1151
|
-
function
|
|
1152
|
-
return t(
|
|
1175
|
+
return a;
|
|
1176
|
+
}, Ct = (a) => !!a.children, xt = (a) => a.type === "html";
|
|
1177
|
+
function Tt(a, e) {
|
|
1178
|
+
return t(a, 0, null)[0];
|
|
1153
1179
|
function t(r, n, s) {
|
|
1154
|
-
if (
|
|
1155
|
-
const
|
|
1156
|
-
for (let o = 0,
|
|
1157
|
-
const
|
|
1158
|
-
if (
|
|
1159
|
-
const u = t(
|
|
1180
|
+
if (Ct(r)) {
|
|
1181
|
+
const l = [];
|
|
1182
|
+
for (let o = 0, c = r.children.length; o < c; o++) {
|
|
1183
|
+
const i = r.children[o];
|
|
1184
|
+
if (i) {
|
|
1185
|
+
const u = t(i, o, r);
|
|
1160
1186
|
if (u)
|
|
1161
1187
|
for (let f = 0, d = u.length; f < d; f++) {
|
|
1162
1188
|
const m = u[f];
|
|
1163
|
-
m &&
|
|
1189
|
+
m && l.push(m);
|
|
1164
1190
|
}
|
|
1165
1191
|
}
|
|
1166
1192
|
}
|
|
1167
|
-
r.children =
|
|
1193
|
+
r.children = l;
|
|
1168
1194
|
}
|
|
1169
1195
|
return e(r, n, s);
|
|
1170
1196
|
}
|
|
1171
1197
|
}
|
|
1172
|
-
const
|
|
1173
|
-
function
|
|
1174
|
-
|
|
1198
|
+
const Ht = () => {
|
|
1199
|
+
function a(e) {
|
|
1200
|
+
Tt(e, (t) => xt(t) ? [] : [t]);
|
|
1175
1201
|
}
|
|
1176
|
-
return
|
|
1177
|
-
},
|
|
1178
|
-
let
|
|
1179
|
-
const e = new
|
|
1180
|
-
key:
|
|
1202
|
+
return a;
|
|
1203
|
+
}, Dt = new T("MILKDOWN_INLINE_NODES_CURSOR"), Ot = () => {
|
|
1204
|
+
let a = !1;
|
|
1205
|
+
const e = new x({
|
|
1206
|
+
key: Dt,
|
|
1181
1207
|
state: {
|
|
1182
1208
|
init() {
|
|
1183
1209
|
return !1;
|
|
@@ -1191,15 +1217,15 @@ const yt = () => {
|
|
|
1191
1217
|
},
|
|
1192
1218
|
props: {
|
|
1193
1219
|
handleDOMEvents: {
|
|
1194
|
-
compositionend: (t, r) =>
|
|
1220
|
+
compositionend: (t, r) => a ? (a = !1, requestAnimationFrame(() => {
|
|
1195
1221
|
if (e.getState(t.state)) {
|
|
1196
1222
|
const s = t.state.selection.from;
|
|
1197
1223
|
r.preventDefault(), t.dispatch(t.state.tr.insertText(r.data || "", s));
|
|
1198
1224
|
}
|
|
1199
1225
|
}), !0) : !1,
|
|
1200
|
-
compositionstart: (t) => (e.getState(t.state) && (
|
|
1226
|
+
compositionstart: (t) => (e.getState(t.state) && (a = !0), !1),
|
|
1201
1227
|
beforeinput: (t, r) => {
|
|
1202
|
-
if (e.getState(t.state) && r instanceof InputEvent && r.data && !
|
|
1228
|
+
if (e.getState(t.state) && r instanceof InputEvent && r.data && !a) {
|
|
1203
1229
|
const s = t.state.selection.from;
|
|
1204
1230
|
return r.preventDefault(), t.dispatch(t.state.tr.insertText(r.data || "", s)), !0;
|
|
1205
1231
|
}
|
|
@@ -1208,90 +1234,199 @@ const yt = () => {
|
|
|
1208
1234
|
},
|
|
1209
1235
|
decorations(t) {
|
|
1210
1236
|
if (e.getState(t)) {
|
|
1211
|
-
const s = t.selection.$from.pos,
|
|
1237
|
+
const s = t.selection.$from.pos, l = document.createElement("span"), o = X.widget(s, l, {
|
|
1212
1238
|
side: -1
|
|
1213
|
-
}),
|
|
1239
|
+
}), c = document.createElement("span"), i = X.widget(s, c);
|
|
1214
1240
|
return setTimeout(() => {
|
|
1215
|
-
|
|
1216
|
-
}), O.create(t.doc, [o,
|
|
1241
|
+
l.contentEditable = "true", c.contentEditable = "true";
|
|
1242
|
+
}), O.create(t.doc, [o, i]);
|
|
1217
1243
|
}
|
|
1218
1244
|
return O.empty;
|
|
1219
1245
|
}
|
|
1220
1246
|
}
|
|
1221
1247
|
});
|
|
1222
1248
|
return e;
|
|
1223
|
-
},
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1249
|
+
}, G = /\[(?<span>((www|https:\/\/|http:\/\/)\S+))]\((?<url>\S+)\)/, St = (a) => new RegExp(`\\\\(?=[^\\w\\s${a}\\\\]|_)`, "g"), At = (a) => {
|
|
1250
|
+
let e = a, t = e.match(G);
|
|
1251
|
+
for (; t && t.groups; ) {
|
|
1252
|
+
const { span: r } = t.groups;
|
|
1253
|
+
e = e.replace(G, r), t = e.match(G);
|
|
1254
|
+
}
|
|
1255
|
+
return e;
|
|
1256
|
+
}, vt = (a, e, t) => {
|
|
1257
|
+
const r = a.split(""), n = r[e];
|
|
1258
|
+
return r[e] && r[t] && (r[e] = r[t], r[t] = n), r.join("").toString();
|
|
1259
|
+
}, Et = (a) => (e) => e.replace(St(a), ""), _t = (a) => (e) => {
|
|
1260
|
+
const t = e.indexOf(a.hole), r = e.charAt(t - 1), n = e.charAt(t + 1), s = /[^\w]|_/;
|
|
1261
|
+
return n ? r && s.test(r) && s.test(n) ? a.punctuation : a.char : a.punctuation;
|
|
1262
|
+
}, $t = (a, e, t) => {
|
|
1263
|
+
let r = e, n = !1;
|
|
1264
|
+
return a.descendants((s) => {
|
|
1265
|
+
var l;
|
|
1266
|
+
if (n)
|
|
1267
|
+
return !1;
|
|
1268
|
+
if (s.isText) {
|
|
1269
|
+
const o = (l = s.text) == null ? void 0 : l.indexOf(t);
|
|
1270
|
+
if (o != null && o >= 0)
|
|
1271
|
+
return n = !0, r += o, !1;
|
|
1272
|
+
}
|
|
1273
|
+
r += s.nodeSize;
|
|
1274
|
+
}), r;
|
|
1275
|
+
}, Pt = {
|
|
1276
|
+
placeholderConfig: {
|
|
1277
|
+
hole: "\u2205",
|
|
1278
|
+
punctuation: "\u2042",
|
|
1279
|
+
char: "\u2234"
|
|
1280
|
+
},
|
|
1281
|
+
globalNodes: ["footnote_definition"],
|
|
1282
|
+
shouldSyncNode: ({ prevNode: a, nextNode: e }) => a.inlineContent && e && a.type === e.type && !a.eq(e),
|
|
1283
|
+
movePlaceholder: (a, e) => {
|
|
1284
|
+
const t = ["*", "_"];
|
|
1285
|
+
let r = e.indexOf(a);
|
|
1286
|
+
for (; t.includes(e[r - 1] || "") && t.includes(e[r + 1] || ""); )
|
|
1287
|
+
e = vt(e, r, r + 1), r = r + 1;
|
|
1288
|
+
return e;
|
|
1289
|
+
}
|
|
1290
|
+
}, v = ve(Pt, "inlineSyncConfig"), Bt = (a) => {
|
|
1291
|
+
const { selection: e } = a, { $from: t } = e;
|
|
1292
|
+
return t.node();
|
|
1293
|
+
}, Rt = (a, e, t, r) => {
|
|
1294
|
+
const n = a.get(Ee), s = e.schema.topNodeType.create(void 0, [t, ...r]);
|
|
1295
|
+
return n(s);
|
|
1296
|
+
}, Wt = (a, e) => {
|
|
1297
|
+
const t = a.get(v), r = t.placeholderConfig.hole, [n = "", ...s] = e.split(`
|
|
1298
|
+
|
|
1299
|
+
`), l = (u) => t.movePlaceholder(r, u);
|
|
1300
|
+
let c = Oe(Et(r), l, At)(n);
|
|
1301
|
+
const i = _t(t.placeholderConfig)(c);
|
|
1302
|
+
return c = c.replace(r, i), c = [c, ...s].join(`
|
|
1303
|
+
|
|
1304
|
+
`), [c, i];
|
|
1305
|
+
}, qt = (a, e) => {
|
|
1306
|
+
const r = a.get(_e)(e);
|
|
1307
|
+
return r ? r.firstChild : null;
|
|
1308
|
+
}, Kt = (a, e) => {
|
|
1309
|
+
const { globalNodes: t } = a.get(v), r = [];
|
|
1310
|
+
return e.doc.descendants((n) => {
|
|
1311
|
+
if (t.includes(n.type.name) || t.includes(n.type))
|
|
1312
|
+
return r.push(n), !1;
|
|
1313
|
+
}), r;
|
|
1314
|
+
}, Ft = (a) => a.split(`
|
|
1315
|
+
|
|
1316
|
+
`)[0] || "", De = (a, e) => {
|
|
1317
|
+
try {
|
|
1318
|
+
const t = Kt(a, e), r = Bt(e), n = Rt(a, e, r, t), [s, l] = Wt(a, n), o = qt(a, s);
|
|
1319
|
+
return !o || r.type !== o.type ? null : (o.attrs = { ...r.attrs }, o.descendants((c) => {
|
|
1320
|
+
var f;
|
|
1321
|
+
const u = c.marks.find((d) => d.type.name === "link");
|
|
1322
|
+
u && ((f = c.text) == null ? void 0 : f.includes(l)) && u.attrs.href.includes(l) && (u.attrs.href = u.attrs.href.replace(l, ""));
|
|
1323
|
+
}), {
|
|
1324
|
+
text: Ft(s),
|
|
1325
|
+
prevNode: r,
|
|
1326
|
+
nextNode: o,
|
|
1327
|
+
placeholder: l
|
|
1328
|
+
});
|
|
1329
|
+
} catch {
|
|
1330
|
+
return null;
|
|
1331
|
+
}
|
|
1332
|
+
}, jt = (a, e, t, r, n) => {
|
|
1333
|
+
const { placeholderConfig: s } = a.get(v), l = s.hole;
|
|
1334
|
+
let o = t.tr.setMeta(e, !0).insertText(l, t.selection.from);
|
|
1335
|
+
const c = t.apply(o), i = De(a, c);
|
|
1336
|
+
if (!i)
|
|
1337
|
+
return;
|
|
1338
|
+
const { $from: u } = c.selection, f = u.before(), d = u.after(), m = $t(i.nextNode, f, i.placeholder);
|
|
1339
|
+
o = o.replaceWith(f, d, i.nextNode).setNodeMarkup(f, void 0, n).delete(m + 1, m + 2), o = o.setSelection(J.near(o.doc.resolve(m + 1))), r(o);
|
|
1340
|
+
}, Y = new T("MILKDOWN_INLINE_SYNC"), zt = (a) => new x({
|
|
1341
|
+
key: Y,
|
|
1342
|
+
state: {
|
|
1343
|
+
init: () => null,
|
|
1344
|
+
apply: (t, r, n, s) => {
|
|
1345
|
+
if (!t.docChanged || t.getMeta(Y))
|
|
1346
|
+
return null;
|
|
1347
|
+
const o = De(a, s);
|
|
1348
|
+
if (!o)
|
|
1349
|
+
return null;
|
|
1350
|
+
const { prevNode: c, nextNode: i, text: u } = o, { shouldSyncNode: f } = a.get(v);
|
|
1351
|
+
return f({ prevNode: c, nextNode: i, ctx: a, tr: t, text: u }) && requestAnimationFrame(() => {
|
|
1352
|
+
const { dispatch: d, state: m } = a.get(A);
|
|
1353
|
+
jt(a, Y, m, d, c.attrs);
|
|
1354
|
+
}), null;
|
|
1355
|
+
}
|
|
1356
|
+
}
|
|
1357
|
+
}), Ut = [
|
|
1358
|
+
Se(() => ({
|
|
1359
|
+
prosePlugins: (a, e) => [Ot(), zt(e)],
|
|
1360
|
+
remarkPlugins: () => [Ue, Ht, Lt]
|
|
1361
|
+
}), [v])()
|
|
1362
|
+
], Vt = be.create([...wt, ...Ze]), lr = be.create([...Ut, ...Vt]), cr = {
|
|
1363
|
+
ToggleInlineCode: Z,
|
|
1364
|
+
ToggleItalic: ee,
|
|
1365
|
+
ToggleLink: xe,
|
|
1366
|
+
ToggleBold: re,
|
|
1367
|
+
ModifyLink: te,
|
|
1368
|
+
ModifyImage: le,
|
|
1369
|
+
WrapInBlockquote: ne,
|
|
1370
|
+
WrapInBulletList: se,
|
|
1371
|
+
WrapInOrderedList: de,
|
|
1372
|
+
TurnIntoCodeFence: oe,
|
|
1373
|
+
TurnIntoHeading: D,
|
|
1374
|
+
TurnIntoText: fe,
|
|
1375
|
+
InsertHardbreak: ae,
|
|
1376
|
+
InsertHr: Te,
|
|
1377
|
+
InsertImage: He,
|
|
1378
|
+
SplitListItem: ce,
|
|
1379
|
+
SinkListItem: ie,
|
|
1380
|
+
LiftListItem: ue
|
|
1247
1381
|
};
|
|
1248
1382
|
export {
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1383
|
+
Me as DowngradeHeading,
|
|
1384
|
+
lt as HardbreakFilterPluginKey,
|
|
1385
|
+
ae as InsertHardbreak,
|
|
1386
|
+
Te as InsertHr,
|
|
1387
|
+
He as InsertImage,
|
|
1388
|
+
ue as LiftListItem,
|
|
1389
|
+
le as ModifyImage,
|
|
1390
|
+
te as ModifyLink,
|
|
1391
|
+
ie as SinkListItem,
|
|
1392
|
+
ce as SplitListItem,
|
|
1259
1393
|
k as SupportedKeys,
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1394
|
+
re as ToggleBold,
|
|
1395
|
+
Z as ToggleInlineCode,
|
|
1396
|
+
ee as ToggleItalic,
|
|
1397
|
+
xe as ToggleLink,
|
|
1398
|
+
oe as TurnIntoCodeFence,
|
|
1399
|
+
D as TurnIntoHeading,
|
|
1400
|
+
fe as TurnIntoText,
|
|
1401
|
+
ne as WrapInBlockquote,
|
|
1402
|
+
se as WrapInBulletList,
|
|
1403
|
+
de as WrapInOrderedList,
|
|
1404
|
+
nt as backtickInputRegex,
|
|
1405
|
+
et as blockquote,
|
|
1406
|
+
tt as bulletList,
|
|
1407
|
+
ot as codeFence,
|
|
1408
|
+
Ge as codeInline,
|
|
1409
|
+
cr as commands,
|
|
1410
|
+
lr as commonmark,
|
|
1411
|
+
Vt as commonmarkNodes,
|
|
1412
|
+
Ut as commonmarkPlugins,
|
|
1413
|
+
at as doc,
|
|
1414
|
+
Ye as em,
|
|
1415
|
+
ct as hardbreak,
|
|
1416
|
+
mt as heading,
|
|
1417
|
+
it as headingHashPluginKey,
|
|
1418
|
+
U as headingIdPluginKey,
|
|
1419
|
+
pt as hr,
|
|
1420
|
+
ht as image,
|
|
1421
|
+
v as inlineSyncConfigCtx,
|
|
1422
|
+
Qe as link,
|
|
1423
|
+
yt as listItem,
|
|
1424
|
+
Ze as marks,
|
|
1425
|
+
wt as nodes,
|
|
1426
|
+
Nt as orderedList,
|
|
1427
|
+
It as paragraph,
|
|
1428
|
+
Xe as strong,
|
|
1429
|
+
bt as text,
|
|
1430
|
+
st as tildeInputRegex
|
|
1296
1431
|
};
|
|
1297
1432
|
//# sourceMappingURL=index.es.js.map
|