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