lexical-medium-editor 1.2.17 → 1.2.19
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/README.md +272 -30
- package/dist-lib/{ImageNode-BhH71HMX.js → ImageNode-Cqkp_4Y6.js} +92 -71
- package/dist-lib/ImageNode-Cqkp_4Y6.js.map +1 -0
- package/dist-lib/editorConfig.es.js +3 -3
- package/dist-lib/index.es.js +715 -702
- package/dist-lib/index.es.js.map +1 -1
- package/dist-lib/lexical-medium-editor.css +1 -1
- package/package.json +1 -1
- package/dist-lib/ImageNode-BhH71HMX.js.map +0 -1
package/dist-lib/index.es.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
import './lexical-medium-editor.css';
|
|
2
|
-
import { jsxs as D, Fragment as
|
|
3
|
-
import { AutoFocusPlugin as
|
|
4
|
-
import { LexicalComposer as
|
|
5
|
-
import { RichTextPlugin as
|
|
6
|
-
import { HistoryPlugin as
|
|
7
|
-
import { LexicalErrorBoundary as
|
|
2
|
+
import { jsxs as D, Fragment as tt, jsx as h } from "react/jsx-runtime";
|
|
3
|
+
import { AutoFocusPlugin as Et } from "@lexical/react/LexicalAutoFocusPlugin";
|
|
4
|
+
import { LexicalComposer as xt } from "@lexical/react/LexicalComposer";
|
|
5
|
+
import { RichTextPlugin as Tt } from "@lexical/react/LexicalRichTextPlugin";
|
|
6
|
+
import { HistoryPlugin as At } from "@lexical/react/LexicalHistoryPlugin";
|
|
7
|
+
import { LexicalErrorBoundary as St } from "@lexical/react/LexicalErrorBoundary";
|
|
8
8
|
import { useLexicalComposerContext as M } from "@lexical/react/LexicalComposerContext";
|
|
9
|
-
import { createCommand as
|
|
10
|
-
import { useEffect as
|
|
11
|
-
import { createPortal as
|
|
12
|
-
import { $findMatchingParent as I, $dfs as
|
|
13
|
-
import { Toolbar as
|
|
14
|
-
import { IconCheck as
|
|
15
|
-
import { $isAtNodeEnd as
|
|
16
|
-
import { $createHeadingNode as
|
|
17
|
-
import { $toggleLink as
|
|
18
|
-
import { $isListNode as
|
|
19
|
-
import { $ as
|
|
20
|
-
import { $isCodeNode as
|
|
21
|
-
import { NodeEventPlugin as
|
|
22
|
-
import { ListPlugin as
|
|
23
|
-
import { OnChangePlugin as
|
|
24
|
-
import { ContentEditable as
|
|
25
|
-
import { ClearEditorPlugin as
|
|
9
|
+
import { createCommand as Z, $getSelection as F, $isRangeSelection as k, $createParagraphNode as pe, COMMAND_PRIORITY_HIGH as $, $getRoot as fe, CLICK_COMMAND as Lt, COMMAND_PRIORITY_LOW as nt, TextNode as se, $isParagraphNode as J, $getCharacterOffsets as $t, FORMAT_TEXT_COMMAND as xe, SELECTION_CHANGE_COMMAND as Y, BLUR_COMMAND as be, $getNodeByKey as j, $isLineBreakNode as ie, $getPreviousSelection as ve, KEY_BACKSPACE_COMMAND as Ie, $isNodeSelection as Me, PASTE_COMMAND as Oe, $setSelection as rt, KEY_ARROW_RIGHT_COMMAND as Ft, $getAdjacentNode as Fe, $createTextNode as kt, COMMAND_PRIORITY_NORMAL as wt, KEY_ENTER_COMMAND as It, $isTextNode as Mt, ParagraphNode as Ot, $createLineBreakNode as Pt, KEY_TAB_COMMAND as _t } from "lexical";
|
|
10
|
+
import { useEffect as b, useState as O, useRef as ee, useLayoutEffect as Dt, useCallback as de } from "react";
|
|
11
|
+
import { createPortal as Pe } from "react-dom";
|
|
12
|
+
import { $findMatchingParent as I, $dfs as Bt } from "@lexical/utils";
|
|
13
|
+
import { Toolbar as _e, TextField as Ht, Input as it, Group as oe, Button as q, ToggleButton as ne, Separator as Ge, ComboBox as Rt, Popover as ot, ListBox as zt, ListBoxItem as Gt, DialogTrigger as Wt, FileTrigger as Kt } from "react-aria-components";
|
|
14
|
+
import { IconCheck as Ut, IconX as qt, IconBold as jt, IconItalic as Yt, IconCode as Zt, IconTextSize as Qt, IconBlockquote as Xt, IconLink as Vt, IconCaretDownFilled as Jt, IconPlus as en, IconPhoto as tn, IconCodePlus as nn, IconLineDashed as rn } from "@tabler/icons-react";
|
|
15
|
+
import { $isAtNodeEnd as We, $setBlocksType as st, createDOMRange as on } from "@lexical/selection";
|
|
16
|
+
import { $createHeadingNode as at, HeadingNode as sn, $createQuoteNode as an, $isHeadingNode as ke, $isQuoteNode as ln } from "@lexical/rich-text";
|
|
17
|
+
import { $toggleLink as cn, $isLinkNode as un } from "@lexical/link";
|
|
18
|
+
import { $isListNode as dn, $isListItemNode as Ke, $insertList as Ue } from "@lexical/list";
|
|
19
|
+
import { $ as V, a as X, b as W, H as gn, c as fn, I as qe, d as Te, e as hn, f as re, M as he, g as mn, h as Ae, i as U, j as pn, k as Se } from "./ImageNode-Cqkp_4Y6.js";
|
|
20
|
+
import { $isCodeNode as me, getCodeLanguages as bn, getLanguageFriendlyName as Le, registerCodeHighlighting as vn, $createCodeNode as je } from "@lexical/code";
|
|
21
|
+
import { NodeEventPlugin as De } from "@lexical/react/LexicalNodeEventPlugin";
|
|
22
|
+
import { ListPlugin as Cn } from "@lexical/react/LexicalListPlugin";
|
|
23
|
+
import { OnChangePlugin as yn } from "@lexical/react/LexicalOnChangePlugin";
|
|
24
|
+
import { ContentEditable as Nn } from "@lexical/react/LexicalContentEditable";
|
|
25
|
+
import { ClearEditorPlugin as En } from "@lexical/react/LexicalClearEditorPlugin";
|
|
26
26
|
const B = -1e3;
|
|
27
|
-
function
|
|
27
|
+
function xn(t, a, e = 0) {
|
|
28
28
|
if (!a || !a.current)
|
|
29
29
|
return console.error("Invalid popover reference"), {
|
|
30
30
|
x: B,
|
|
31
31
|
y: B
|
|
32
32
|
};
|
|
33
|
-
const n = a.current, { x:
|
|
33
|
+
const n = a.current, { x: o, y: r } = t, { width: i, height: s } = n.getBoundingClientRect(), u = o - i / 2, m = r - s - e;
|
|
34
34
|
return {
|
|
35
35
|
x: u,
|
|
36
36
|
y: m
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function Tn(t) {
|
|
40
40
|
if (!t || typeof t.getBoundingClientRect != "function")
|
|
41
41
|
return console.error("Invalid DOM range"), null;
|
|
42
42
|
const a = t.getBoundingClientRect(), e = a.left + a.width / 2, n = a.top + window.scrollY;
|
|
@@ -45,50 +45,50 @@ function Nn(t) {
|
|
|
45
45
|
y: n
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function An(t, a, e = 0) {
|
|
49
49
|
if (!a || !a.current)
|
|
50
50
|
return console.error("Invalid popover reference"), {
|
|
51
51
|
x: B,
|
|
52
52
|
y: B
|
|
53
53
|
};
|
|
54
|
-
const { x: n, y:
|
|
54
|
+
const { x: n, y: o } = t, r = a.current, { width: i, height: s } = r.getBoundingClientRect(), u = n - i - e, m = o - s / 2;
|
|
55
55
|
return {
|
|
56
56
|
x: u,
|
|
57
57
|
y: m
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
function
|
|
60
|
+
function Sn(t, a, e = 16, n = 12) {
|
|
61
61
|
if (!a || !a.current)
|
|
62
62
|
return console.error("Invalid popover reference"), {
|
|
63
63
|
x: B,
|
|
64
64
|
y: B
|
|
65
65
|
};
|
|
66
|
-
const
|
|
66
|
+
const o = a.current, { x: r, y: i } = t, { width: s } = o.getBoundingClientRect(), u = r - s - e, m = i + n;
|
|
67
67
|
return {
|
|
68
68
|
x: u,
|
|
69
69
|
y: m
|
|
70
70
|
};
|
|
71
71
|
}
|
|
72
|
-
const
|
|
73
|
-
function
|
|
74
|
-
const a = t.anchor, e = t.focus, n = t.anchor.getNode(),
|
|
75
|
-
return n ===
|
|
72
|
+
const lt = Z("TOGGLE_HEADING_COMMAND"), ct = Z("TOGGLE_QUOTE_COMMAND"), ut = Z("TOGGLE_LINK_COMMAND");
|
|
73
|
+
function Ce(t) {
|
|
74
|
+
const a = t.anchor, e = t.focus, n = t.anchor.getNode(), o = t.focus.getNode();
|
|
75
|
+
return n === o ? n : t.isBackward() ? We(e) ? n : o : We(a) ? n : o;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
78
|
-
const a = I(t,
|
|
77
|
+
function Ye(t) {
|
|
78
|
+
const a = I(t, ke);
|
|
79
79
|
return a ? a.getTag() : null;
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function Ln(t) {
|
|
82
82
|
const a = {
|
|
83
83
|
isHeadingOne: !1,
|
|
84
84
|
isHeadingTwo: !1,
|
|
85
85
|
isHeadingThree: !1
|
|
86
86
|
}, e = t.getNodes();
|
|
87
87
|
if (!e.length) return a;
|
|
88
|
-
const n =
|
|
88
|
+
const n = Ye(e[0]);
|
|
89
89
|
if (!n) return a;
|
|
90
90
|
if (e.every(
|
|
91
|
-
(r) =>
|
|
91
|
+
(r) => Ye(r) === n
|
|
92
92
|
)) {
|
|
93
93
|
const r = {
|
|
94
94
|
h1: "isHeadingOne",
|
|
@@ -99,17 +99,17 @@ function Tn(t) {
|
|
|
99
99
|
}
|
|
100
100
|
return a;
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function $n() {
|
|
103
103
|
const [t] = M();
|
|
104
|
-
return
|
|
105
|
-
|
|
104
|
+
return b(() => t.registerCommand(
|
|
105
|
+
lt,
|
|
106
106
|
(e) => {
|
|
107
|
-
const { isHeadingOne: n, isHeadingTwo:
|
|
108
|
-
if (
|
|
107
|
+
const { isHeadingOne: n, isHeadingTwo: o, isHeadingThree: r } = e, i = F();
|
|
108
|
+
if (k(i)) {
|
|
109
109
|
let s;
|
|
110
|
-
n ||
|
|
111
|
-
|
|
112
|
-
() => s ?
|
|
110
|
+
n || o ? s = "h3" : r ? s = null : s = "h2", st(
|
|
111
|
+
i,
|
|
112
|
+
() => s ? at(s) : pe()
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
115
|
return !0;
|
|
@@ -117,18 +117,18 @@ function An() {
|
|
|
117
117
|
$
|
|
118
118
|
), [t]), null;
|
|
119
119
|
}
|
|
120
|
-
function
|
|
120
|
+
function Fn() {
|
|
121
121
|
const [t] = M();
|
|
122
|
-
return
|
|
122
|
+
return b(() => {
|
|
123
123
|
const a = t.registerNodeTransform(
|
|
124
|
-
|
|
124
|
+
sn,
|
|
125
125
|
(e) => {
|
|
126
126
|
if (e.getTag() !== "h2")
|
|
127
127
|
return;
|
|
128
|
-
const
|
|
129
|
-
if (
|
|
130
|
-
const r = e.getChildren(),
|
|
131
|
-
|
|
128
|
+
const o = fe().getFirstChild();
|
|
129
|
+
if (o !== null && e.is(o)) {
|
|
130
|
+
const r = e.getChildren(), i = at("h1");
|
|
131
|
+
i.append(...r), e.replace(i);
|
|
132
132
|
}
|
|
133
133
|
}
|
|
134
134
|
);
|
|
@@ -137,109 +137,109 @@ function Sn() {
|
|
|
137
137
|
};
|
|
138
138
|
}, [t]), null;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
return I(t,
|
|
140
|
+
function kn(t) {
|
|
141
|
+
return I(t, ln);
|
|
142
142
|
}
|
|
143
|
-
function
|
|
143
|
+
function wn(t) {
|
|
144
144
|
const a = t.getNodes();
|
|
145
|
-
return a.length ? a.length > 0 && a.every((e) =>
|
|
145
|
+
return a.length ? a.length > 0 && a.every((e) => kn(e)) : !1;
|
|
146
146
|
}
|
|
147
|
-
function
|
|
147
|
+
function In() {
|
|
148
148
|
const [t] = M();
|
|
149
|
-
return
|
|
150
|
-
|
|
149
|
+
return b(() => t.registerCommand(
|
|
150
|
+
ct,
|
|
151
151
|
(e) => {
|
|
152
|
-
const n =
|
|
153
|
-
return
|
|
152
|
+
const n = F();
|
|
153
|
+
return k(n) && st(
|
|
154
154
|
n,
|
|
155
|
-
() => e.isQuote ?
|
|
155
|
+
() => e.isQuote ? pe() : an()
|
|
156
156
|
), !0;
|
|
157
157
|
},
|
|
158
158
|
$
|
|
159
159
|
), [t]), null;
|
|
160
160
|
}
|
|
161
|
-
function
|
|
162
|
-
if (!
|
|
161
|
+
function dt(t) {
|
|
162
|
+
if (!k(t))
|
|
163
163
|
return null;
|
|
164
|
-
const a =
|
|
165
|
-
return I(a,
|
|
164
|
+
const a = Ce(t);
|
|
165
|
+
return I(a, un);
|
|
166
166
|
}
|
|
167
|
-
function
|
|
167
|
+
function Mn() {
|
|
168
168
|
const [t] = M();
|
|
169
|
-
return
|
|
170
|
-
|
|
169
|
+
return b(() => t.registerCommand(
|
|
170
|
+
Lt,
|
|
171
171
|
(e) => {
|
|
172
|
-
const n =
|
|
173
|
-
return
|
|
172
|
+
const n = F(), o = dt(n);
|
|
173
|
+
return o && (e.metaKey || e.ctrlKey) ? (window.open(o.getURL(), "_blank"), !0) : !1;
|
|
174
174
|
},
|
|
175
|
-
|
|
176
|
-
), [t]),
|
|
177
|
-
|
|
178
|
-
(e) => (
|
|
175
|
+
nt
|
|
176
|
+
), [t]), b(() => t.registerCommand(
|
|
177
|
+
ut,
|
|
178
|
+
(e) => (cn(e), !0),
|
|
179
179
|
$
|
|
180
180
|
), [t]), null;
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function On() {
|
|
183
183
|
const [t] = M(), a = "heading-above";
|
|
184
|
-
return
|
|
185
|
-
|
|
184
|
+
return b(() => t.registerNodeTransform(
|
|
185
|
+
se,
|
|
186
186
|
(n) => {
|
|
187
|
-
const
|
|
188
|
-
if (!
|
|
187
|
+
const o = I(n, J) || I(n, dn);
|
|
188
|
+
if (!o || ke(o))
|
|
189
189
|
return;
|
|
190
|
-
const r =
|
|
191
|
-
if (!
|
|
190
|
+
const r = o, i = t.getElementByKey(r.getKey());
|
|
191
|
+
if (!i)
|
|
192
192
|
return;
|
|
193
|
-
const s = r.getPreviousSibling(), u =
|
|
194
|
-
u && !m ?
|
|
193
|
+
const s = r.getPreviousSibling(), u = ke(s), m = i.classList.contains(a);
|
|
194
|
+
u && !m ? i.classList.add(a) : !u && m && i.classList.remove(a);
|
|
195
195
|
}
|
|
196
196
|
), [t]), null;
|
|
197
197
|
}
|
|
198
|
-
function
|
|
199
|
-
return /* @__PURE__ */ D(
|
|
200
|
-
/* @__PURE__ */ h(
|
|
201
|
-
t && /* @__PURE__ */ h(
|
|
202
|
-
/* @__PURE__ */ h(
|
|
203
|
-
/* @__PURE__ */ h(
|
|
204
|
-
/* @__PURE__ */ h(
|
|
198
|
+
function Pn({ isHeadingOneFirst: t }) {
|
|
199
|
+
return /* @__PURE__ */ D(tt, { children: [
|
|
200
|
+
/* @__PURE__ */ h($n, {}),
|
|
201
|
+
t && /* @__PURE__ */ h(Fn, {}),
|
|
202
|
+
/* @__PURE__ */ h(In, {}),
|
|
203
|
+
/* @__PURE__ */ h(Mn, {}),
|
|
204
|
+
/* @__PURE__ */ h(On, {})
|
|
205
205
|
] });
|
|
206
206
|
}
|
|
207
|
-
function
|
|
208
|
-
const [n] = M(), [
|
|
209
|
-
return /* @__PURE__ */ D(
|
|
207
|
+
function _n({ style: t, closeToolbar: a, existingLinkURL: e }) {
|
|
208
|
+
const [n] = M(), [o, r] = O(e);
|
|
209
|
+
return /* @__PURE__ */ D(_e, { style: t, "aria-details": "link toolbar", id: "link-toolbar", children: [
|
|
210
210
|
/* @__PURE__ */ h(
|
|
211
|
-
|
|
211
|
+
Ht,
|
|
212
212
|
{
|
|
213
213
|
"aria-label": "url",
|
|
214
214
|
autoFocus: !0,
|
|
215
|
-
defaultValue:
|
|
215
|
+
defaultValue: o,
|
|
216
216
|
onChange: r,
|
|
217
|
-
children: /* @__PURE__ */ h(
|
|
217
|
+
children: /* @__PURE__ */ h(it, { placeholder: "Enter Link" })
|
|
218
218
|
}
|
|
219
219
|
),
|
|
220
|
-
/* @__PURE__ */ D(
|
|
220
|
+
/* @__PURE__ */ D(oe, { "aria-label": "edit link", children: [
|
|
221
221
|
/* @__PURE__ */ h(
|
|
222
|
-
|
|
222
|
+
q,
|
|
223
223
|
{
|
|
224
224
|
"aria-label": "Update link",
|
|
225
225
|
onPress: () => {
|
|
226
|
-
const
|
|
227
|
-
n.dispatchCommand(
|
|
226
|
+
const i = o === "" ? null : o;
|
|
227
|
+
n.dispatchCommand(ut, i), a();
|
|
228
228
|
},
|
|
229
|
-
children: /* @__PURE__ */ h(
|
|
229
|
+
children: /* @__PURE__ */ h(Ut, { size: K })
|
|
230
230
|
}
|
|
231
231
|
),
|
|
232
|
-
/* @__PURE__ */ h(
|
|
232
|
+
/* @__PURE__ */ h(q, { "aria-label": "Discard changes", onPress: a, children: /* @__PURE__ */ h(qt, { size: K }) })
|
|
233
233
|
] }),
|
|
234
234
|
/* @__PURE__ */ h("div", { className: "inline-toolbar-pointer" })
|
|
235
235
|
] });
|
|
236
236
|
}
|
|
237
|
-
const K = 24,
|
|
238
|
-
function
|
|
239
|
-
const [a, e] = O(null), [n,
|
|
237
|
+
const K = 24, Dn = 16;
|
|
238
|
+
function Bn({ editor: t }) {
|
|
239
|
+
const [a, e] = O(null), [n, o] = O({
|
|
240
240
|
x: B,
|
|
241
241
|
y: B
|
|
242
|
-
}), r =
|
|
242
|
+
}), r = ee(null), [i, s] = O({
|
|
243
243
|
isBold: !1,
|
|
244
244
|
isItalic: !1,
|
|
245
245
|
isCode: !1,
|
|
@@ -247,77 +247,77 @@ function Pn({ editor: t }) {
|
|
|
247
247
|
isHeadingTwo: !1,
|
|
248
248
|
isHeadingThree: !1,
|
|
249
249
|
isQuote: !1
|
|
250
|
-
}), [u, m] = O(!1), [
|
|
251
|
-
if (
|
|
250
|
+
}), [u, m] = O(!1), [T, A] = O(0), [S, L] = O(""), N = (p) => {
|
|
251
|
+
if (k(p)) {
|
|
252
252
|
s({
|
|
253
253
|
isBold: p.hasFormat("bold"),
|
|
254
254
|
isItalic: p.hasFormat("italic"),
|
|
255
255
|
isCode: p.hasFormat("code"),
|
|
256
|
-
isQuote:
|
|
256
|
+
isQuote: wn(p)
|
|
257
257
|
});
|
|
258
|
-
const y =
|
|
258
|
+
const y = Ln(p);
|
|
259
259
|
s((l) => ({
|
|
260
260
|
...l,
|
|
261
261
|
...y
|
|
262
262
|
}));
|
|
263
|
-
const
|
|
264
|
-
|
|
263
|
+
const x = dt(p);
|
|
264
|
+
L(x ? x.getURL() : "");
|
|
265
265
|
}
|
|
266
266
|
};
|
|
267
|
-
return
|
|
267
|
+
return b(() => {
|
|
268
268
|
t.read(() => {
|
|
269
|
-
const p =
|
|
269
|
+
const p = F();
|
|
270
270
|
N(p);
|
|
271
271
|
});
|
|
272
|
-
}, [t]),
|
|
272
|
+
}, [t]), b(() => t.registerUpdateListener(
|
|
273
273
|
({ editorState: y }) => {
|
|
274
274
|
y.read(() => {
|
|
275
|
-
const
|
|
276
|
-
N(
|
|
275
|
+
const x = F();
|
|
276
|
+
N(x);
|
|
277
277
|
});
|
|
278
278
|
}
|
|
279
|
-
), [t]),
|
|
279
|
+
), [t]), b(() => {
|
|
280
280
|
t.read(() => {
|
|
281
|
-
const p =
|
|
282
|
-
if (
|
|
283
|
-
const [y,
|
|
281
|
+
const p = F();
|
|
282
|
+
if (k(p)) {
|
|
283
|
+
const [y, x] = p.getStartEndPoints(), [l, c] = [
|
|
284
284
|
y.getNode(),
|
|
285
|
-
|
|
286
|
-
], [d, g] =
|
|
285
|
+
x.getNode()
|
|
286
|
+
], [d, g] = $t(p), f = on(
|
|
287
287
|
t,
|
|
288
288
|
l,
|
|
289
289
|
d,
|
|
290
290
|
c,
|
|
291
291
|
g
|
|
292
292
|
);
|
|
293
|
-
e(
|
|
293
|
+
e(Tn(f));
|
|
294
294
|
}
|
|
295
295
|
});
|
|
296
|
-
}, [t,
|
|
296
|
+
}, [t, i]), b(() => {
|
|
297
297
|
var p;
|
|
298
|
-
a ? (
|
|
299
|
-
|
|
298
|
+
a ? (o(
|
|
299
|
+
xn(
|
|
300
300
|
a,
|
|
301
301
|
r,
|
|
302
|
-
|
|
302
|
+
Dn
|
|
303
303
|
)
|
|
304
304
|
), setTimeout(() => {
|
|
305
305
|
var y;
|
|
306
306
|
(y = r.current) == null || y.classList.add("visible");
|
|
307
307
|
}, 50)) : (p = r.current) == null || p.classList.remove("visible");
|
|
308
|
-
}, [a]),
|
|
308
|
+
}, [a]), Dt(() => {
|
|
309
309
|
if (r.current) {
|
|
310
310
|
const p = window.getComputedStyle(r.current), y = parseFloat(p.width);
|
|
311
|
-
|
|
311
|
+
A(y);
|
|
312
312
|
}
|
|
313
313
|
}, [a]), a && (u ? /* @__PURE__ */ h(
|
|
314
|
-
|
|
314
|
+
_n,
|
|
315
315
|
{
|
|
316
316
|
style: {
|
|
317
317
|
position: "absolute",
|
|
318
318
|
top: n.y,
|
|
319
319
|
left: n.x,
|
|
320
|
-
width:
|
|
320
|
+
width: T
|
|
321
321
|
},
|
|
322
322
|
closeToolbar: () => {
|
|
323
323
|
m(!1), e(null);
|
|
@@ -325,7 +325,7 @@ function Pn({ editor: t }) {
|
|
|
325
325
|
existingLinkURL: S
|
|
326
326
|
}
|
|
327
327
|
) : /* @__PURE__ */ D(
|
|
328
|
-
|
|
328
|
+
_e,
|
|
329
329
|
{
|
|
330
330
|
style: {
|
|
331
331
|
position: "absolute",
|
|
@@ -336,66 +336,66 @@ function Pn({ editor: t }) {
|
|
|
336
336
|
id: "inline-toolbar",
|
|
337
337
|
ref: r,
|
|
338
338
|
children: [
|
|
339
|
-
/* @__PURE__ */ D(
|
|
339
|
+
/* @__PURE__ */ D(oe, { "aria-label": "Style", children: [
|
|
340
340
|
/* @__PURE__ */ h(
|
|
341
|
-
|
|
341
|
+
ne,
|
|
342
342
|
{
|
|
343
343
|
"aria-label": "Bold",
|
|
344
|
-
isSelected:
|
|
345
|
-
isDisabled:
|
|
344
|
+
isSelected: i.isBold,
|
|
345
|
+
isDisabled: i.isCode || i.isHeadingOne || i.isHeadingTwo || i.isHeadingThree,
|
|
346
346
|
onChange: () => t.dispatchCommand(xe, "bold"),
|
|
347
|
-
children: /* @__PURE__ */ h(
|
|
347
|
+
children: /* @__PURE__ */ h(jt, { size: K })
|
|
348
348
|
}
|
|
349
349
|
),
|
|
350
350
|
/* @__PURE__ */ h(
|
|
351
|
-
|
|
351
|
+
ne,
|
|
352
352
|
{
|
|
353
353
|
"aria-label": "Italic",
|
|
354
|
-
isSelected:
|
|
355
|
-
isDisabled:
|
|
354
|
+
isSelected: i.isItalic,
|
|
355
|
+
isDisabled: i.isCode || i.isHeadingOne,
|
|
356
356
|
onChange: () => t.dispatchCommand(xe, "italic"),
|
|
357
|
-
children: /* @__PURE__ */ h(
|
|
357
|
+
children: /* @__PURE__ */ h(Yt, { size: K })
|
|
358
358
|
}
|
|
359
359
|
),
|
|
360
360
|
/* @__PURE__ */ h(
|
|
361
|
-
|
|
361
|
+
ne,
|
|
362
362
|
{
|
|
363
363
|
"aria-label": "inline-code",
|
|
364
|
-
isDisabled:
|
|
365
|
-
isSelected:
|
|
364
|
+
isDisabled: i.isHeadingOne,
|
|
365
|
+
isSelected: i.isCode,
|
|
366
366
|
onChange: () => t.dispatchCommand(xe, "code"),
|
|
367
|
-
children: /* @__PURE__ */ h(
|
|
367
|
+
children: /* @__PURE__ */ h(Zt, { size: K })
|
|
368
368
|
}
|
|
369
369
|
)
|
|
370
370
|
] }),
|
|
371
|
-
/* @__PURE__ */ h(
|
|
372
|
-
/* @__PURE__ */ D(
|
|
371
|
+
/* @__PURE__ */ h(Ge, { orientation: "vertical" }),
|
|
372
|
+
/* @__PURE__ */ D(oe, { "aria-label": "Text Blocks", children: [
|
|
373
373
|
/* @__PURE__ */ h(
|
|
374
|
-
|
|
374
|
+
ne,
|
|
375
375
|
{
|
|
376
376
|
"aria-label": "Heading",
|
|
377
|
-
isSelected:
|
|
378
|
-
onChange: () => t.dispatchCommand(
|
|
379
|
-
children: /* @__PURE__ */ h(
|
|
377
|
+
isSelected: i.isHeadingOne || i.isHeadingTwo || i.isHeadingThree,
|
|
378
|
+
onChange: () => t.dispatchCommand(lt, i),
|
|
379
|
+
children: /* @__PURE__ */ h(Qt, { size: K })
|
|
380
380
|
}
|
|
381
381
|
),
|
|
382
382
|
/* @__PURE__ */ h(
|
|
383
|
-
|
|
383
|
+
ne,
|
|
384
384
|
{
|
|
385
385
|
"aria-label": "Quote",
|
|
386
|
-
isSelected:
|
|
387
|
-
onChange: () => t.dispatchCommand(
|
|
388
|
-
children: /* @__PURE__ */ h(
|
|
386
|
+
isSelected: i.isQuote,
|
|
387
|
+
onChange: () => t.dispatchCommand(ct, i),
|
|
388
|
+
children: /* @__PURE__ */ h(Xt, { size: K })
|
|
389
389
|
}
|
|
390
390
|
)
|
|
391
391
|
] }),
|
|
392
|
-
/* @__PURE__ */ h(
|
|
393
|
-
/* @__PURE__ */ h(
|
|
394
|
-
|
|
392
|
+
/* @__PURE__ */ h(Ge, { orientation: "vertical" }),
|
|
393
|
+
/* @__PURE__ */ h(oe, { "aria-label": "Links", children: /* @__PURE__ */ h(
|
|
394
|
+
q,
|
|
395
395
|
{
|
|
396
396
|
onPress: () => m(!0),
|
|
397
|
-
isDisabled:
|
|
398
|
-
children: /* @__PURE__ */ h(
|
|
397
|
+
isDisabled: i.isHeadingOne,
|
|
398
|
+
children: /* @__PURE__ */ h(Vt, { size: K })
|
|
399
399
|
}
|
|
400
400
|
) }),
|
|
401
401
|
/* @__PURE__ */ h("div", { className: "inline-toolbar-pointer" })
|
|
@@ -403,37 +403,37 @@ function Pn({ editor: t }) {
|
|
|
403
403
|
}
|
|
404
404
|
));
|
|
405
405
|
}
|
|
406
|
-
const
|
|
407
|
-
function
|
|
406
|
+
const Hn = document.body;
|
|
407
|
+
function Rn() {
|
|
408
408
|
const [t, a] = O(!1), [e] = M();
|
|
409
|
-
return
|
|
410
|
-
|
|
409
|
+
return b(() => e.registerCommand(
|
|
410
|
+
Y,
|
|
411
411
|
() => {
|
|
412
|
-
const
|
|
413
|
-
if (!
|
|
412
|
+
const o = F();
|
|
413
|
+
if (!k(o) || o.isCollapsed())
|
|
414
414
|
return a(!1), !1;
|
|
415
|
-
const r =
|
|
416
|
-
(m) => I(m,
|
|
415
|
+
const r = o.getNodes(), i = r.some((m) => V(m)), s = r.length === 1 && (X(r[0]) || I(r[0], W)), u = r.some(
|
|
416
|
+
(m) => I(m, me)
|
|
417
417
|
);
|
|
418
|
-
return a(!
|
|
418
|
+
return a(!i && !s && !u), !1;
|
|
419
419
|
},
|
|
420
420
|
$
|
|
421
|
-
), [e]),
|
|
421
|
+
), [e]), b(() => e.registerCommand(
|
|
422
422
|
be,
|
|
423
423
|
() => (setTimeout(() => {
|
|
424
|
-
const
|
|
425
|
-
|
|
424
|
+
const o = document.getElementById("inline-toolbar"), r = document.getElementById("link-toolbar"), i = document.activeElement;
|
|
425
|
+
o && (o === i || o.contains(i)) || r && (r === i || r.contains(i)) || a(!1);
|
|
426
426
|
}, 0), !1),
|
|
427
427
|
$
|
|
428
|
-
), [e]), t &&
|
|
428
|
+
), [e]), t && Pe(/* @__PURE__ */ h(Bn, { editor: e }), Hn);
|
|
429
429
|
}
|
|
430
|
-
var
|
|
431
|
-
function
|
|
430
|
+
var Ze = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
431
|
+
function zn(t) {
|
|
432
432
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
433
433
|
}
|
|
434
|
-
var
|
|
435
|
-
function
|
|
436
|
-
return
|
|
434
|
+
var $e = { exports: {} }, Qe;
|
|
435
|
+
function Gn() {
|
|
436
|
+
return Qe || (Qe = 1, function(t) {
|
|
437
437
|
var a = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
|
|
438
438
|
/**
|
|
439
439
|
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
@@ -444,7 +444,7 @@ function Hn() {
|
|
|
444
444
|
* @public
|
|
445
445
|
*/
|
|
446
446
|
var e = function(n) {
|
|
447
|
-
var
|
|
447
|
+
var o = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, r = 0, i = {}, s = {
|
|
448
448
|
/**
|
|
449
449
|
* By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
|
|
450
450
|
* current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
|
|
@@ -549,8 +549,8 @@ function Hn() {
|
|
|
549
549
|
return d[f];
|
|
550
550
|
g = /** @type {Record<string, any>} */
|
|
551
551
|
{}, d[f] = g;
|
|
552
|
-
for (var
|
|
553
|
-
c.hasOwnProperty(
|
|
552
|
+
for (var C in c)
|
|
553
|
+
c.hasOwnProperty(C) && (g[C] = l(c[C], d));
|
|
554
554
|
return (
|
|
555
555
|
/** @type {any} */
|
|
556
556
|
g
|
|
@@ -558,8 +558,8 @@ function Hn() {
|
|
|
558
558
|
case "Array":
|
|
559
559
|
return f = s.util.objId(c), d[f] ? d[f] : (g = [], d[f] = g, /** @type {Array} */
|
|
560
560
|
/** @type {any} */
|
|
561
|
-
c.forEach(function(
|
|
562
|
-
g[
|
|
561
|
+
c.forEach(function(E, v) {
|
|
562
|
+
g[v] = l(E, d);
|
|
563
563
|
}), /** @type {any} */
|
|
564
564
|
g);
|
|
565
565
|
default:
|
|
@@ -576,7 +576,7 @@ function Hn() {
|
|
|
576
576
|
*/
|
|
577
577
|
getLanguage: function(l) {
|
|
578
578
|
for (; l; ) {
|
|
579
|
-
var c =
|
|
579
|
+
var c = o.exec(l.className);
|
|
580
580
|
if (c)
|
|
581
581
|
return c[1].toLowerCase();
|
|
582
582
|
l = l.parentElement;
|
|
@@ -591,7 +591,7 @@ function Hn() {
|
|
|
591
591
|
* @returns {void}
|
|
592
592
|
*/
|
|
593
593
|
setLanguage: function(l, c) {
|
|
594
|
-
l.className = l.className.replace(RegExp(
|
|
594
|
+
l.className = l.className.replace(RegExp(o, "gi"), ""), l.classList.add("language-" + c);
|
|
595
595
|
},
|
|
596
596
|
/**
|
|
597
597
|
* Returns the script element that is currently executing.
|
|
@@ -663,10 +663,10 @@ function Hn() {
|
|
|
663
663
|
/**
|
|
664
664
|
* The grammar for plain, unformatted text.
|
|
665
665
|
*/
|
|
666
|
-
plain:
|
|
667
|
-
plaintext:
|
|
668
|
-
text:
|
|
669
|
-
txt:
|
|
666
|
+
plain: i,
|
|
667
|
+
plaintext: i,
|
|
668
|
+
text: i,
|
|
669
|
+
txt: i,
|
|
670
670
|
/**
|
|
671
671
|
* Creates a deep copy of the language with the given id and appends the given tokens.
|
|
672
672
|
*
|
|
@@ -779,28 +779,28 @@ function Hn() {
|
|
|
779
779
|
insertBefore: function(l, c, d, g) {
|
|
780
780
|
g = g || /** @type {any} */
|
|
781
781
|
s.languages;
|
|
782
|
-
var f = g[l],
|
|
783
|
-
for (var
|
|
784
|
-
if (f.hasOwnProperty(
|
|
785
|
-
if (
|
|
786
|
-
for (var
|
|
787
|
-
d.hasOwnProperty(
|
|
788
|
-
d.hasOwnProperty(
|
|
782
|
+
var f = g[l], C = {};
|
|
783
|
+
for (var E in f)
|
|
784
|
+
if (f.hasOwnProperty(E)) {
|
|
785
|
+
if (E == c)
|
|
786
|
+
for (var v in d)
|
|
787
|
+
d.hasOwnProperty(v) && (C[v] = d[v]);
|
|
788
|
+
d.hasOwnProperty(E) || (C[E] = f[E]);
|
|
789
789
|
}
|
|
790
|
-
var
|
|
791
|
-
return g[l] =
|
|
792
|
-
z ===
|
|
793
|
-
}),
|
|
790
|
+
var w = g[l];
|
|
791
|
+
return g[l] = C, s.languages.DFS(s.languages, function(P, z) {
|
|
792
|
+
z === w && P != l && (this[P] = C);
|
|
793
|
+
}), C;
|
|
794
794
|
},
|
|
795
795
|
// Traverse a language definition with Depth First Search
|
|
796
796
|
DFS: function l(c, d, g, f) {
|
|
797
797
|
f = f || {};
|
|
798
|
-
var
|
|
799
|
-
for (var
|
|
800
|
-
if (c.hasOwnProperty(
|
|
801
|
-
d.call(c,
|
|
802
|
-
var
|
|
803
|
-
|
|
798
|
+
var C = s.util.objId;
|
|
799
|
+
for (var E in c)
|
|
800
|
+
if (c.hasOwnProperty(E)) {
|
|
801
|
+
d.call(c, E, c[E], g || E);
|
|
802
|
+
var v = c[E], w = s.util.type(v);
|
|
803
|
+
w === "Object" && !f[C(v)] ? (f[C(v)] = !0, l(v, d, null, f)) : w === "Array" && !f[C(v)] && (f[C(v)] = !0, l(v, d, E, f));
|
|
804
804
|
}
|
|
805
805
|
}
|
|
806
806
|
},
|
|
@@ -842,8 +842,8 @@ function Hn() {
|
|
|
842
842
|
selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
|
|
843
843
|
};
|
|
844
844
|
s.hooks.run("before-highlightall", g), g.elements = Array.prototype.slice.apply(g.container.querySelectorAll(g.selector)), s.hooks.run("before-all-elements-highlight", g);
|
|
845
|
-
for (var f = 0,
|
|
846
|
-
s.highlightElement(
|
|
845
|
+
for (var f = 0, C; C = g.elements[f++]; )
|
|
846
|
+
s.highlightElement(C, c === !0, g.callback);
|
|
847
847
|
},
|
|
848
848
|
/**
|
|
849
849
|
* Highlights the code inside a single element.
|
|
@@ -876,36 +876,36 @@ function Hn() {
|
|
|
876
876
|
highlightElement: function(l, c, d) {
|
|
877
877
|
var g = s.util.getLanguage(l), f = s.languages[g];
|
|
878
878
|
s.util.setLanguage(l, g);
|
|
879
|
-
var
|
|
880
|
-
|
|
881
|
-
var
|
|
879
|
+
var C = l.parentElement;
|
|
880
|
+
C && C.nodeName.toLowerCase() === "pre" && s.util.setLanguage(C, g);
|
|
881
|
+
var E = l.textContent, v = {
|
|
882
882
|
element: l,
|
|
883
883
|
language: g,
|
|
884
884
|
grammar: f,
|
|
885
|
-
code:
|
|
885
|
+
code: E
|
|
886
886
|
};
|
|
887
|
-
function
|
|
888
|
-
|
|
887
|
+
function w(z) {
|
|
888
|
+
v.highlightedCode = z, s.hooks.run("before-insert", v), v.element.innerHTML = v.highlightedCode, s.hooks.run("after-highlight", v), s.hooks.run("complete", v), d && d.call(v.element);
|
|
889
889
|
}
|
|
890
|
-
if (s.hooks.run("before-sanity-check",
|
|
891
|
-
s.hooks.run("complete",
|
|
890
|
+
if (s.hooks.run("before-sanity-check", v), C = v.element.parentElement, C && C.nodeName.toLowerCase() === "pre" && !C.hasAttribute("tabindex") && C.setAttribute("tabindex", "0"), !v.code) {
|
|
891
|
+
s.hooks.run("complete", v), d && d.call(v.element);
|
|
892
892
|
return;
|
|
893
893
|
}
|
|
894
|
-
if (s.hooks.run("before-highlight",
|
|
895
|
-
|
|
894
|
+
if (s.hooks.run("before-highlight", v), !v.grammar) {
|
|
895
|
+
w(s.util.encode(v.code));
|
|
896
896
|
return;
|
|
897
897
|
}
|
|
898
898
|
if (c && n.Worker) {
|
|
899
899
|
var P = new Worker(s.filename);
|
|
900
900
|
P.onmessage = function(z) {
|
|
901
|
-
|
|
901
|
+
w(z.data);
|
|
902
902
|
}, P.postMessage(JSON.stringify({
|
|
903
|
-
language:
|
|
904
|
-
code:
|
|
903
|
+
language: v.language,
|
|
904
|
+
code: v.code,
|
|
905
905
|
immediateClose: !0
|
|
906
906
|
}));
|
|
907
907
|
} else
|
|
908
|
-
|
|
908
|
+
w(s.highlight(v.code, v.grammar, v.language));
|
|
909
909
|
},
|
|
910
910
|
/**
|
|
911
911
|
* Low-level function, only use if you know what you’re doing. It accepts a string of text as input
|
|
@@ -968,8 +968,8 @@ function Hn() {
|
|
|
968
968
|
c[g] = d[g];
|
|
969
969
|
delete c.rest;
|
|
970
970
|
}
|
|
971
|
-
var f = new
|
|
972
|
-
return S(f, f.head, l),
|
|
971
|
+
var f = new A();
|
|
972
|
+
return S(f, f.head, l), T(l, f, c, f.head, 0), N(f);
|
|
973
973
|
},
|
|
974
974
|
/**
|
|
975
975
|
* @namespace
|
|
@@ -1021,8 +1021,8 @@ function Hn() {
|
|
|
1021
1021
|
return c;
|
|
1022
1022
|
if (Array.isArray(c)) {
|
|
1023
1023
|
var g = "";
|
|
1024
|
-
return c.forEach(function(
|
|
1025
|
-
g += l(
|
|
1024
|
+
return c.forEach(function(w) {
|
|
1025
|
+
g += l(w, d);
|
|
1026
1026
|
}), g;
|
|
1027
1027
|
}
|
|
1028
1028
|
var f = {
|
|
@@ -1032,72 +1032,72 @@ function Hn() {
|
|
|
1032
1032
|
classes: ["token", c.type],
|
|
1033
1033
|
attributes: {},
|
|
1034
1034
|
language: d
|
|
1035
|
-
},
|
|
1036
|
-
|
|
1037
|
-
var
|
|
1038
|
-
for (var
|
|
1039
|
-
|
|
1040
|
-
return "<" + f.tag + ' class="' + f.classes.join(" ") + '"' +
|
|
1035
|
+
}, C = c.alias;
|
|
1036
|
+
C && (Array.isArray(C) ? Array.prototype.push.apply(f.classes, C) : f.classes.push(C)), s.hooks.run("wrap", f);
|
|
1037
|
+
var E = "";
|
|
1038
|
+
for (var v in f.attributes)
|
|
1039
|
+
E += " " + v + '="' + (f.attributes[v] || "").replace(/"/g, """) + '"';
|
|
1040
|
+
return "<" + f.tag + ' class="' + f.classes.join(" ") + '"' + E + ">" + f.content + "</" + f.tag + ">";
|
|
1041
1041
|
};
|
|
1042
1042
|
function m(l, c, d, g) {
|
|
1043
1043
|
l.lastIndex = c;
|
|
1044
1044
|
var f = l.exec(d);
|
|
1045
1045
|
if (f && g && f[1]) {
|
|
1046
|
-
var
|
|
1047
|
-
f.index +=
|
|
1046
|
+
var C = f[1].length;
|
|
1047
|
+
f.index += C, f[0] = f[0].slice(C);
|
|
1048
1048
|
}
|
|
1049
1049
|
return f;
|
|
1050
1050
|
}
|
|
1051
|
-
function
|
|
1052
|
-
for (var
|
|
1053
|
-
if (!(!d.hasOwnProperty(
|
|
1054
|
-
var
|
|
1055
|
-
|
|
1056
|
-
for (var
|
|
1057
|
-
if (
|
|
1051
|
+
function T(l, c, d, g, f, C) {
|
|
1052
|
+
for (var E in d)
|
|
1053
|
+
if (!(!d.hasOwnProperty(E) || !d[E])) {
|
|
1054
|
+
var v = d[E];
|
|
1055
|
+
v = Array.isArray(v) ? v : [v];
|
|
1056
|
+
for (var w = 0; w < v.length; ++w) {
|
|
1057
|
+
if (C && C.cause == E + "," + w)
|
|
1058
1058
|
return;
|
|
1059
|
-
var P =
|
|
1060
|
-
if (
|
|
1061
|
-
var
|
|
1062
|
-
P.pattern = RegExp(P.pattern.source,
|
|
1059
|
+
var P = v[w], z = P.inside, Be = !!P.lookbehind, He = !!P.greedy, vt = P.alias;
|
|
1060
|
+
if (He && !P.pattern.global) {
|
|
1061
|
+
var Ct = P.pattern.toString().match(/[imsuy]*$/)[0];
|
|
1062
|
+
P.pattern = RegExp(P.pattern.source, Ct + "g");
|
|
1063
1063
|
}
|
|
1064
|
-
for (var
|
|
1065
|
-
var
|
|
1064
|
+
for (var Re = P.pattern || P, _ = g.next, R = f; _ !== c.tail && !(C && R >= C.reach); R += _.value.length, _ = _.next) {
|
|
1065
|
+
var Q = _.value;
|
|
1066
1066
|
if (c.length > l.length)
|
|
1067
1067
|
return;
|
|
1068
|
-
if (!(
|
|
1068
|
+
if (!(Q instanceof u)) {
|
|
1069
1069
|
var ae = 1, H;
|
|
1070
|
-
if (
|
|
1071
|
-
if (H = m(
|
|
1070
|
+
if (He) {
|
|
1071
|
+
if (H = m(Re, R, l, Be), !H || H.index >= l.length)
|
|
1072
1072
|
break;
|
|
1073
|
-
var le = H.index,
|
|
1074
|
-
for (
|
|
1075
|
-
_ = _.next,
|
|
1076
|
-
if (
|
|
1073
|
+
var le = H.index, yt = H.index + H[0].length, G = R;
|
|
1074
|
+
for (G += _.value.length; le >= G; )
|
|
1075
|
+
_ = _.next, G += _.value.length;
|
|
1076
|
+
if (G -= _.value.length, R = G, _.value instanceof u)
|
|
1077
1077
|
continue;
|
|
1078
|
-
for (var
|
|
1079
|
-
ae++,
|
|
1080
|
-
ae--,
|
|
1081
|
-
} else if (H = m(
|
|
1078
|
+
for (var te = _; te !== c.tail && (G < yt || typeof te.value == "string"); te = te.next)
|
|
1079
|
+
ae++, G += te.value.length;
|
|
1080
|
+
ae--, Q = l.slice(R, G), H.index -= R;
|
|
1081
|
+
} else if (H = m(Re, 0, Q, Be), !H)
|
|
1082
1082
|
continue;
|
|
1083
|
-
var le = H.index, ce = H[0],
|
|
1084
|
-
|
|
1083
|
+
var le = H.index, ce = H[0], ye = Q.slice(0, le), ze = Q.slice(le + ce.length), Ne = R + Q.length;
|
|
1084
|
+
C && Ne > C.reach && (C.reach = Ne);
|
|
1085
1085
|
var ue = _.prev;
|
|
1086
|
-
|
|
1087
|
-
var
|
|
1088
|
-
if (_ = S(c, ue,
|
|
1089
|
-
var
|
|
1090
|
-
cause:
|
|
1091
|
-
reach:
|
|
1086
|
+
ye && (ue = S(c, ue, ye), R += ye.length), L(c, ue, ae);
|
|
1087
|
+
var Nt = new u(E, z ? s.tokenize(ce, z) : ce, vt, ce);
|
|
1088
|
+
if (_ = S(c, ue, Nt), ze && S(c, _, ze), ae > 1) {
|
|
1089
|
+
var Ee = {
|
|
1090
|
+
cause: E + "," + w,
|
|
1091
|
+
reach: Ne
|
|
1092
1092
|
};
|
|
1093
|
-
|
|
1093
|
+
T(l, c, d, _.prev, R, Ee), C && Ee.reach > C.reach && (C.reach = Ee.reach);
|
|
1094
1094
|
}
|
|
1095
1095
|
}
|
|
1096
1096
|
}
|
|
1097
1097
|
}
|
|
1098
1098
|
}
|
|
1099
1099
|
}
|
|
1100
|
-
function
|
|
1100
|
+
function A() {
|
|
1101
1101
|
var l = { value: null, prev: null, next: null }, c = { value: null, prev: l, next: null };
|
|
1102
1102
|
l.next = c, this.head = l, this.tail = c, this.length = 0;
|
|
1103
1103
|
}
|
|
@@ -1105,7 +1105,7 @@ function Hn() {
|
|
|
1105
1105
|
var g = c.next, f = { value: d, prev: c, next: g };
|
|
1106
1106
|
return c.next = f, g.prev = f, l.length++, f;
|
|
1107
1107
|
}
|
|
1108
|
-
function
|
|
1108
|
+
function L(l, c, d) {
|
|
1109
1109
|
for (var g = c.next, f = 0; f < d && g !== l.tail; f++)
|
|
1110
1110
|
g = g.next;
|
|
1111
1111
|
c.next = g, g.prev = c, l.length -= f;
|
|
@@ -1126,12 +1126,12 @@ function Hn() {
|
|
|
1126
1126
|
s.manual || s.highlightAll();
|
|
1127
1127
|
}
|
|
1128
1128
|
if (!s.manual) {
|
|
1129
|
-
var
|
|
1130
|
-
|
|
1129
|
+
var x = document.readyState;
|
|
1130
|
+
x === "loading" || x === "interactive" && p && p.defer ? document.addEventListener("DOMContentLoaded", y) : window.requestAnimationFrame ? window.requestAnimationFrame(y) : window.setTimeout(y, 16);
|
|
1131
1131
|
}
|
|
1132
1132
|
return s;
|
|
1133
1133
|
}(a);
|
|
1134
|
-
t.exports && (t.exports = e), typeof
|
|
1134
|
+
t.exports && (t.exports = e), typeof Ze < "u" && (Ze.Prism = e), e.languages.markup = {
|
|
1135
1135
|
comment: {
|
|
1136
1136
|
pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
|
|
1137
1137
|
greedy: !0
|
|
@@ -1222,17 +1222,17 @@ function Hn() {
|
|
|
1222
1222
|
* @example
|
|
1223
1223
|
* addInlined('style', 'css');
|
|
1224
1224
|
*/
|
|
1225
|
-
value: function(
|
|
1226
|
-
var
|
|
1227
|
-
|
|
1225
|
+
value: function(o, r) {
|
|
1226
|
+
var i = {};
|
|
1227
|
+
i["language-" + r] = {
|
|
1228
1228
|
pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
|
|
1229
1229
|
lookbehind: !0,
|
|
1230
1230
|
inside: e.languages[r]
|
|
1231
|
-
},
|
|
1231
|
+
}, i.cdata = /^<!\[CDATA\[|\]\]>$/i;
|
|
1232
1232
|
var s = {
|
|
1233
1233
|
"included-cdata": {
|
|
1234
1234
|
pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
|
|
1235
|
-
inside:
|
|
1235
|
+
inside: i
|
|
1236
1236
|
}
|
|
1237
1237
|
};
|
|
1238
1238
|
s["language-" + r] = {
|
|
@@ -1240,9 +1240,9 @@ function Hn() {
|
|
|
1240
1240
|
inside: e.languages[r]
|
|
1241
1241
|
};
|
|
1242
1242
|
var u = {};
|
|
1243
|
-
u[
|
|
1243
|
+
u[o] = {
|
|
1244
1244
|
pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
|
|
1245
|
-
return
|
|
1245
|
+
return o;
|
|
1246
1246
|
}), "i"),
|
|
1247
1247
|
lookbehind: !0,
|
|
1248
1248
|
greedy: !0,
|
|
@@ -1261,7 +1261,7 @@ function Hn() {
|
|
|
1261
1261
|
* @example
|
|
1262
1262
|
* addAttribute('style', 'css');
|
|
1263
1263
|
*/
|
|
1264
|
-
value: function(n,
|
|
1264
|
+
value: function(n, o) {
|
|
1265
1265
|
e.languages.markup.tag.inside["special-attr"].push({
|
|
1266
1266
|
pattern: RegExp(
|
|
1267
1267
|
/(^|["'\s])/.source + "(?:" + n + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
|
|
@@ -1276,8 +1276,8 @@ function Hn() {
|
|
|
1276
1276
|
value: {
|
|
1277
1277
|
pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
|
|
1278
1278
|
lookbehind: !0,
|
|
1279
|
-
alias: [
|
|
1280
|
-
inside: e.languages[
|
|
1279
|
+
alias: [o, "language-" + o],
|
|
1280
|
+
inside: e.languages[o]
|
|
1281
1281
|
},
|
|
1282
1282
|
punctuation: [
|
|
1283
1283
|
{
|
|
@@ -1292,11 +1292,11 @@ function Hn() {
|
|
|
1292
1292
|
});
|
|
1293
1293
|
}
|
|
1294
1294
|
}), e.languages.html = e.languages.markup, e.languages.mathml = e.languages.markup, e.languages.svg = e.languages.markup, e.languages.xml = e.languages.extend("markup", {}), e.languages.ssml = e.languages.xml, e.languages.atom = e.languages.xml, e.languages.rss = e.languages.xml, function(n) {
|
|
1295
|
-
var
|
|
1295
|
+
var o = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
|
|
1296
1296
|
n.languages.css = {
|
|
1297
1297
|
comment: /\/\*[\s\S]*?\*\//,
|
|
1298
1298
|
atrule: {
|
|
1299
|
-
pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" +
|
|
1299
|
+
pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + o.source + ")*?" + /(?:;|(?=\s*\{))/.source),
|
|
1300
1300
|
inside: {
|
|
1301
1301
|
rule: /^@[\w-]+/,
|
|
1302
1302
|
"selector-function-argument": {
|
|
@@ -1313,23 +1313,23 @@ function Hn() {
|
|
|
1313
1313
|
},
|
|
1314
1314
|
url: {
|
|
1315
1315
|
// https://drafts.csswg.org/css-values-3/#urls
|
|
1316
|
-
pattern: RegExp("\\burl\\((?:" +
|
|
1316
|
+
pattern: RegExp("\\burl\\((?:" + o.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
|
|
1317
1317
|
greedy: !0,
|
|
1318
1318
|
inside: {
|
|
1319
1319
|
function: /^url/i,
|
|
1320
1320
|
punctuation: /^\(|\)$/,
|
|
1321
1321
|
string: {
|
|
1322
|
-
pattern: RegExp("^" +
|
|
1322
|
+
pattern: RegExp("^" + o.source + "$"),
|
|
1323
1323
|
alias: "url"
|
|
1324
1324
|
}
|
|
1325
1325
|
}
|
|
1326
1326
|
},
|
|
1327
1327
|
selector: {
|
|
1328
|
-
pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` +
|
|
1328
|
+
pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + o.source + ")*(?=\\s*\\{)"),
|
|
1329
1329
|
lookbehind: !0
|
|
1330
1330
|
},
|
|
1331
1331
|
string: {
|
|
1332
|
-
pattern:
|
|
1332
|
+
pattern: o,
|
|
1333
1333
|
greedy: !0
|
|
1334
1334
|
},
|
|
1335
1335
|
property: {
|
|
@@ -1509,9 +1509,9 @@ function Hn() {
|
|
|
1509
1509
|
if (typeof e > "u" || typeof document > "u")
|
|
1510
1510
|
return;
|
|
1511
1511
|
Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
|
|
1512
|
-
var n = "Loading…",
|
|
1512
|
+
var n = "Loading…", o = function(p, y) {
|
|
1513
1513
|
return "✖ Error " + p + " while fetching file: " + y;
|
|
1514
|
-
}, r = "✖ Error: File does not exist or is empty",
|
|
1514
|
+
}, r = "✖ Error: File does not exist or is empty", i = {
|
|
1515
1515
|
js: "javascript",
|
|
1516
1516
|
py: "python",
|
|
1517
1517
|
rb: "ruby",
|
|
@@ -1521,52 +1521,52 @@ function Hn() {
|
|
|
1521
1521
|
bat: "batch",
|
|
1522
1522
|
h: "c",
|
|
1523
1523
|
tex: "latex"
|
|
1524
|
-
}, s = "data-src-status", u = "loading", m = "loaded",
|
|
1525
|
-
function S(p, y,
|
|
1524
|
+
}, s = "data-src-status", u = "loading", m = "loaded", T = "failed", A = "pre[data-src]:not([" + s + '="' + m + '"]):not([' + s + '="' + u + '"])';
|
|
1525
|
+
function S(p, y, x) {
|
|
1526
1526
|
var l = new XMLHttpRequest();
|
|
1527
1527
|
l.open("GET", p, !0), l.onreadystatechange = function() {
|
|
1528
|
-
l.readyState == 4 && (l.status < 400 && l.responseText ? y(l.responseText) : l.status >= 400 ?
|
|
1528
|
+
l.readyState == 4 && (l.status < 400 && l.responseText ? y(l.responseText) : l.status >= 400 ? x(o(l.status, l.statusText)) : x(r));
|
|
1529
1529
|
}, l.send(null);
|
|
1530
1530
|
}
|
|
1531
|
-
function
|
|
1531
|
+
function L(p) {
|
|
1532
1532
|
var y = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(p || "");
|
|
1533
1533
|
if (y) {
|
|
1534
|
-
var
|
|
1535
|
-
return l ? c ? [
|
|
1534
|
+
var x = Number(y[1]), l = y[2], c = y[3];
|
|
1535
|
+
return l ? c ? [x, Number(c)] : [x, void 0] : [x, x];
|
|
1536
1536
|
}
|
|
1537
1537
|
}
|
|
1538
1538
|
e.hooks.add("before-highlightall", function(p) {
|
|
1539
|
-
p.selector += ", " +
|
|
1539
|
+
p.selector += ", " + A;
|
|
1540
1540
|
}), e.hooks.add("before-sanity-check", function(p) {
|
|
1541
1541
|
var y = (
|
|
1542
1542
|
/** @type {HTMLPreElement} */
|
|
1543
1543
|
p.element
|
|
1544
1544
|
);
|
|
1545
|
-
if (y.matches(
|
|
1545
|
+
if (y.matches(A)) {
|
|
1546
1546
|
p.code = "", y.setAttribute(s, u);
|
|
1547
|
-
var
|
|
1548
|
-
|
|
1547
|
+
var x = y.appendChild(document.createElement("CODE"));
|
|
1548
|
+
x.textContent = n;
|
|
1549
1549
|
var l = y.getAttribute("data-src"), c = p.language;
|
|
1550
1550
|
if (c === "none") {
|
|
1551
1551
|
var d = (/\.(\w+)$/.exec(l) || [, "none"])[1];
|
|
1552
|
-
c =
|
|
1552
|
+
c = i[d] || d;
|
|
1553
1553
|
}
|
|
1554
|
-
e.util.setLanguage(
|
|
1554
|
+
e.util.setLanguage(x, c), e.util.setLanguage(y, c);
|
|
1555
1555
|
var g = e.plugins.autoloader;
|
|
1556
1556
|
g && g.loadLanguages(c), S(
|
|
1557
1557
|
l,
|
|
1558
1558
|
function(f) {
|
|
1559
1559
|
y.setAttribute(s, m);
|
|
1560
|
-
var
|
|
1561
|
-
if (
|
|
1562
|
-
var
|
|
1563
|
-
|
|
1564
|
-
`), y.hasAttribute("data-start") || y.setAttribute("data-start", String(
|
|
1560
|
+
var C = L(y.getAttribute("data-range"));
|
|
1561
|
+
if (C) {
|
|
1562
|
+
var E = f.split(/\r\n?|\n/g), v = C[0], w = C[1] == null ? E.length : C[1];
|
|
1563
|
+
v < 0 && (v += E.length), v = Math.max(0, Math.min(v - 1, E.length)), w < 0 && (w += E.length), w = Math.max(0, Math.min(w, E.length)), f = E.slice(v, w).join(`
|
|
1564
|
+
`), y.hasAttribute("data-start") || y.setAttribute("data-start", String(v + 1));
|
|
1565
1565
|
}
|
|
1566
|
-
|
|
1566
|
+
x.textContent = f, e.highlightElement(x);
|
|
1567
1567
|
},
|
|
1568
1568
|
function(f) {
|
|
1569
|
-
y.setAttribute(s,
|
|
1569
|
+
y.setAttribute(s, T), x.textContent = f;
|
|
1570
1570
|
}
|
|
1571
1571
|
);
|
|
1572
1572
|
}
|
|
@@ -1579,7 +1579,7 @@ function Hn() {
|
|
|
1579
1579
|
* @param {ParentNode} [container=document]
|
|
1580
1580
|
*/
|
|
1581
1581
|
highlight: function(y) {
|
|
1582
|
-
for (var
|
|
1582
|
+
for (var x = (y || document).querySelectorAll(A), l = 0, c; c = x[l++]; )
|
|
1583
1583
|
e.highlightElement(c);
|
|
1584
1584
|
}
|
|
1585
1585
|
};
|
|
@@ -1588,32 +1588,32 @@ function Hn() {
|
|
|
1588
1588
|
N || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), N = !0), e.plugins.fileHighlight.highlight.apply(this, arguments);
|
|
1589
1589
|
};
|
|
1590
1590
|
}();
|
|
1591
|
-
}(
|
|
1591
|
+
}($e)), $e.exports;
|
|
1592
1592
|
}
|
|
1593
|
-
var
|
|
1594
|
-
const
|
|
1595
|
-
typeof globalThis < "u" && (globalThis.Prism =
|
|
1596
|
-
function
|
|
1597
|
-
const [e] = M(), [n,
|
|
1593
|
+
var Wn = Gn();
|
|
1594
|
+
const Kn = /* @__PURE__ */ zn(Wn);
|
|
1595
|
+
typeof globalThis < "u" && (globalThis.Prism = Kn);
|
|
1596
|
+
function Un({ codeBlockCoords: t, codeNodeKey: a }) {
|
|
1597
|
+
const [e] = M(), [n, o] = O({
|
|
1598
1598
|
x: B,
|
|
1599
1599
|
y: B
|
|
1600
|
-
}), r =
|
|
1601
|
-
new Set(u.map((
|
|
1602
|
-
),
|
|
1603
|
-
return u.forEach((
|
|
1604
|
-
const S =
|
|
1605
|
-
|
|
1606
|
-
}),
|
|
1607
|
-
|
|
1608
|
-
}, [t]),
|
|
1600
|
+
}), r = ee(null), [i, s] = O(""), u = bn(), m = Array.from(
|
|
1601
|
+
new Set(u.map((A) => Le(A)))
|
|
1602
|
+
), T = {};
|
|
1603
|
+
return u.forEach((A) => {
|
|
1604
|
+
const S = Le(A);
|
|
1605
|
+
T[S] || (T[S] = A);
|
|
1606
|
+
}), b(() => {
|
|
1607
|
+
o(Sn(t, r));
|
|
1608
|
+
}, [t]), b(() => {
|
|
1609
1609
|
e.read(() => {
|
|
1610
1610
|
if (a) {
|
|
1611
|
-
const S =
|
|
1612
|
-
s(
|
|
1611
|
+
const S = j(a).getLanguage();
|
|
1612
|
+
s(Le(S));
|
|
1613
1613
|
}
|
|
1614
1614
|
});
|
|
1615
1615
|
}, [e, a]), /* @__PURE__ */ D(
|
|
1616
|
-
|
|
1616
|
+
Rt,
|
|
1617
1617
|
{
|
|
1618
1618
|
id: "code-highlight-menu",
|
|
1619
1619
|
ref: r,
|
|
@@ -1623,54 +1623,54 @@ function Wn({ codeBlockCoords: t, codeNodeKey: a }) {
|
|
|
1623
1623
|
left: n.x
|
|
1624
1624
|
},
|
|
1625
1625
|
"aria-label": "Code menu",
|
|
1626
|
-
inputValue:
|
|
1627
|
-
onInputChange: (
|
|
1628
|
-
const S = A
|
|
1629
|
-
e.dispatchCommand(
|
|
1626
|
+
inputValue: i,
|
|
1627
|
+
onInputChange: (A) => {
|
|
1628
|
+
const S = T[A];
|
|
1629
|
+
e.dispatchCommand(ft, [
|
|
1630
1630
|
a,
|
|
1631
1631
|
S
|
|
1632
|
-
]), s(
|
|
1632
|
+
]), s(A);
|
|
1633
1633
|
},
|
|
1634
1634
|
children: [
|
|
1635
1635
|
/* @__PURE__ */ D("div", { children: [
|
|
1636
|
-
/* @__PURE__ */ h(
|
|
1637
|
-
/* @__PURE__ */ h(
|
|
1636
|
+
/* @__PURE__ */ h(it, {}),
|
|
1637
|
+
/* @__PURE__ */ h(q, { children: /* @__PURE__ */ h(Jt, { size: 24 }) })
|
|
1638
1638
|
] }),
|
|
1639
|
-
/* @__PURE__ */ h(
|
|
1639
|
+
/* @__PURE__ */ h(ot, { children: /* @__PURE__ */ h(zt, { children: m.map((A, S) => /* @__PURE__ */ h(Gt, { children: A }, S)) }) })
|
|
1640
1640
|
]
|
|
1641
1641
|
}
|
|
1642
1642
|
);
|
|
1643
1643
|
}
|
|
1644
|
-
const
|
|
1644
|
+
const qn = document.body, gt = Z(
|
|
1645
1645
|
"INSERT_CODE_BLOCK_COMMAND"
|
|
1646
|
-
),
|
|
1646
|
+
), ft = Z(
|
|
1647
1647
|
"SET_CODE_LANGUAGE_COMMAND"
|
|
1648
1648
|
);
|
|
1649
|
-
function
|
|
1650
|
-
const [t, a] = O(null), [e, n] = O(null), [
|
|
1649
|
+
function jn() {
|
|
1650
|
+
const [t, a] = O(null), [e, n] = O(null), [o, r] = O(!1), [i, s] = O(!1), [u] = M(), m = de(() => {
|
|
1651
1651
|
a(null), n(null);
|
|
1652
|
-
}, []), A = de(() => {
|
|
1653
|
-
const F = document.getElementById("code-highlight-menu"), N = document.activeElement;
|
|
1654
|
-
return !!(F && N && (F === N || F.contains(N)));
|
|
1655
1652
|
}, []), T = de(() => {
|
|
1656
|
-
const
|
|
1657
|
-
return
|
|
1658
|
-
}, [
|
|
1659
|
-
const
|
|
1660
|
-
|
|
1661
|
-
}, [
|
|
1662
|
-
|
|
1663
|
-
|
|
1653
|
+
const L = document.getElementById("code-highlight-menu"), N = document.activeElement;
|
|
1654
|
+
return !!(L && N && (L === N || L.contains(N)));
|
|
1655
|
+
}, []), A = de(() => {
|
|
1656
|
+
const L = T();
|
|
1657
|
+
return s(L), L;
|
|
1658
|
+
}, [T]), S = de(() => {
|
|
1659
|
+
const L = A();
|
|
1660
|
+
r(!1), L || m();
|
|
1661
|
+
}, [m, A]);
|
|
1662
|
+
return b(() => u.registerCommand(
|
|
1663
|
+
Y,
|
|
1664
1664
|
() => {
|
|
1665
|
-
const N =
|
|
1665
|
+
const N = A(), p = u.getRootElement();
|
|
1666
1666
|
if (p) {
|
|
1667
1667
|
const c = p === document.activeElement || p.contains(document.activeElement);
|
|
1668
1668
|
r((d) => d === c ? d : c);
|
|
1669
1669
|
}
|
|
1670
|
-
const y =
|
|
1671
|
-
if (!
|
|
1670
|
+
const y = F();
|
|
1671
|
+
if (!k(y))
|
|
1672
1672
|
return N || m(), !1;
|
|
1673
|
-
const
|
|
1673
|
+
const x = Ce(y), l = I(x, me);
|
|
1674
1674
|
if (l) {
|
|
1675
1675
|
const d = u.getElementByKey(l.getKey()).getBoundingClientRect(), g = d.right, f = d.top + window.scrollY;
|
|
1676
1676
|
a({ x: g, y: f }), n(l.getKey());
|
|
@@ -1679,46 +1679,46 @@ function Kn() {
|
|
|
1679
1679
|
return !1;
|
|
1680
1680
|
},
|
|
1681
1681
|
$
|
|
1682
|
-
), [u,
|
|
1682
|
+
), [u, A, m]), b(() => u.registerCommand(
|
|
1683
1683
|
be,
|
|
1684
1684
|
() => (setTimeout(S, 0), !1),
|
|
1685
1685
|
$
|
|
1686
|
-
), [u, S]),
|
|
1687
|
-
const
|
|
1686
|
+
), [u, S]), b(() => {
|
|
1687
|
+
const L = () => {
|
|
1688
1688
|
r(!0), s(!1);
|
|
1689
1689
|
}, N = () => setTimeout(S, 0);
|
|
1690
1690
|
return u.registerRootListener((p, y) => {
|
|
1691
|
-
p && (p.addEventListener("focus",
|
|
1691
|
+
p && (p.addEventListener("focus", L), p.addEventListener("blur", N)), y && (y.removeEventListener("focus", L), y.removeEventListener("blur", N));
|
|
1692
1692
|
});
|
|
1693
|
-
}, [u, S]), t && (
|
|
1694
|
-
/* @__PURE__ */ h(
|
|
1695
|
-
|
|
1693
|
+
}, [u, S]), t && (o || i) && Pe(
|
|
1694
|
+
/* @__PURE__ */ h(Un, { codeBlockCoords: t, codeNodeKey: e }),
|
|
1695
|
+
qn
|
|
1696
1696
|
);
|
|
1697
1697
|
}
|
|
1698
|
-
function
|
|
1698
|
+
function Yn() {
|
|
1699
1699
|
const [t] = M();
|
|
1700
|
-
return
|
|
1700
|
+
return b(() => vn(t), [t]), b(() => t.registerNodeTransform(se, (e) => {
|
|
1701
1701
|
if (!e.isSimpleText())
|
|
1702
1702
|
return;
|
|
1703
1703
|
const n = e.getTextContent();
|
|
1704
1704
|
if (n.startsWith("``` ")) {
|
|
1705
|
-
const
|
|
1706
|
-
if (
|
|
1705
|
+
const o = e.getPreviousSibling(), r = I(e, J), i = r !== null && r.getChildrenSize() === 1, s = ie(o);
|
|
1706
|
+
if (i || s) {
|
|
1707
1707
|
if (n.length > 4)
|
|
1708
1708
|
return;
|
|
1709
|
-
const u =
|
|
1709
|
+
const u = je();
|
|
1710
1710
|
e.replace(u), u.select();
|
|
1711
1711
|
const m = u.getNextSibling();
|
|
1712
|
-
|
|
1712
|
+
ie(m) && m.remove();
|
|
1713
1713
|
return;
|
|
1714
1714
|
}
|
|
1715
1715
|
}
|
|
1716
|
-
}), [t]),
|
|
1717
|
-
|
|
1716
|
+
}), [t]), b(() => t.registerCommand(
|
|
1717
|
+
gt,
|
|
1718
1718
|
() => {
|
|
1719
|
-
const e =
|
|
1720
|
-
if (
|
|
1721
|
-
const n =
|
|
1719
|
+
const e = ve();
|
|
1720
|
+
if (k(e)) {
|
|
1721
|
+
const n = je();
|
|
1722
1722
|
return e.insertNodes([n]), n.selectStart(), setTimeout(() => {
|
|
1723
1723
|
t.focus();
|
|
1724
1724
|
}, 0), !0;
|
|
@@ -1726,48 +1726,48 @@ function qn() {
|
|
|
1726
1726
|
return !1;
|
|
1727
1727
|
},
|
|
1728
1728
|
$
|
|
1729
|
-
), [t]),
|
|
1730
|
-
|
|
1729
|
+
), [t]), b(() => t.registerCommand(
|
|
1730
|
+
ft,
|
|
1731
1731
|
(e) => {
|
|
1732
|
-
const [n,
|
|
1733
|
-
return
|
|
1732
|
+
const [n, o] = e, r = j(n);
|
|
1733
|
+
return me(r) ? (r.setLanguage(o), !0) : !1;
|
|
1734
1734
|
},
|
|
1735
1735
|
$
|
|
1736
|
-
), [t]),
|
|
1737
|
-
|
|
1736
|
+
), [t]), b(() => t.registerCommand(
|
|
1737
|
+
Ie,
|
|
1738
1738
|
(e) => {
|
|
1739
|
-
const n =
|
|
1740
|
-
if (!
|
|
1739
|
+
const n = F();
|
|
1740
|
+
if (!k(n) || !n.isCollapsed())
|
|
1741
1741
|
return !1;
|
|
1742
|
-
const
|
|
1742
|
+
const o = n.anchor.getNode(), r = I(o, me);
|
|
1743
1743
|
return r && n.anchor.offset === 0 && r.getTextContent() === "" ? (r.remove(), !0) : !1;
|
|
1744
1744
|
},
|
|
1745
1745
|
$
|
|
1746
1746
|
), [t]), null;
|
|
1747
1747
|
}
|
|
1748
|
-
function
|
|
1749
|
-
return /* @__PURE__ */ D(
|
|
1750
|
-
/* @__PURE__ */ h(
|
|
1751
|
-
/* @__PURE__ */ h(
|
|
1748
|
+
function Zn() {
|
|
1749
|
+
return /* @__PURE__ */ D(tt, { children: [
|
|
1750
|
+
/* @__PURE__ */ h(Yn, {}),
|
|
1751
|
+
/* @__PURE__ */ h(jn, {})
|
|
1752
1752
|
] });
|
|
1753
1753
|
}
|
|
1754
|
-
const
|
|
1754
|
+
const ht = Z(
|
|
1755
1755
|
"INSERT_HORIZONTAL_DIVIDER_COMMAND"
|
|
1756
1756
|
);
|
|
1757
|
-
function
|
|
1757
|
+
function Qn() {
|
|
1758
1758
|
const [t] = M();
|
|
1759
|
-
return
|
|
1760
|
-
if (!t.hasNodes([
|
|
1759
|
+
return b(() => {
|
|
1760
|
+
if (!t.hasNodes([gn]))
|
|
1761
1761
|
throw new Error("HorizontalDividerNode not registered on editor");
|
|
1762
1762
|
return t.registerCommand(
|
|
1763
|
-
|
|
1763
|
+
ht,
|
|
1764
1764
|
() => {
|
|
1765
|
-
const e =
|
|
1766
|
-
if (
|
|
1767
|
-
const n =
|
|
1765
|
+
const e = ve();
|
|
1766
|
+
if (k(e)) {
|
|
1767
|
+
const n = fn();
|
|
1768
1768
|
e.insertNodes([n]);
|
|
1769
|
-
let
|
|
1770
|
-
return
|
|
1769
|
+
let o = n.getNextSibling() || n.getParent().getNextSibling();
|
|
1770
|
+
return o || (o = pe(), n.insertAfter(o)), o.selectStart(), setTimeout(() => {
|
|
1771
1771
|
t.focus();
|
|
1772
1772
|
}, 0), !0;
|
|
1773
1773
|
}
|
|
@@ -1777,82 +1777,101 @@ function jn() {
|
|
|
1777
1777
|
);
|
|
1778
1778
|
}, [t]), null;
|
|
1779
1779
|
}
|
|
1780
|
-
const
|
|
1781
|
-
function
|
|
1780
|
+
const we = Z("INSERT_IMAGE_COMMAND"), Xe = "selected";
|
|
1781
|
+
function Ve(t) {
|
|
1782
1782
|
return t && t.type && t.type.startsWith("image/");
|
|
1783
1783
|
}
|
|
1784
|
-
function
|
|
1785
|
-
const
|
|
1786
|
-
|
|
1787
|
-
|
|
1784
|
+
function Je(t, a) {
|
|
1785
|
+
const e = ve() || F();
|
|
1786
|
+
if (!k(e))
|
|
1787
|
+
return null;
|
|
1788
|
+
const n = hn(t, a);
|
|
1789
|
+
e.insertNodes([n]);
|
|
1790
|
+
let o = n.getNextSibling() || n.getParent().getNextSibling();
|
|
1791
|
+
return o || (o = pe(), n.insertAfter(o)), n.select(), n.getKey();
|
|
1792
|
+
}
|
|
1793
|
+
function Xn({ onImageUpload: t }) {
|
|
1794
|
+
const [a] = M(), e = ee(null), n = ee(t);
|
|
1795
|
+
b(() => {
|
|
1796
|
+
n.current = t;
|
|
1797
|
+
}, [t]), b(() => {
|
|
1798
|
+
if (!a.hasNode(qe))
|
|
1788
1799
|
throw new Error("ImagePlugin: ImageNode not registered on editor");
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1800
|
+
}, [a]);
|
|
1801
|
+
const o = (r, i, s) => {
|
|
1802
|
+
const u = n.current;
|
|
1803
|
+
u && Promise.resolve().then(() => u(i)).then((m) => {
|
|
1804
|
+
if (typeof m != "string" || !m)
|
|
1805
|
+
throw new Error("onImageUpload must resolve to a URL string");
|
|
1806
|
+
a.update(() => {
|
|
1807
|
+
const T = j(r);
|
|
1808
|
+
Te(T) && (T.setSrc(m), T.setUploadState(re.UPLOADED));
|
|
1809
|
+
}), URL.revokeObjectURL(s);
|
|
1810
|
+
}).catch((m) => {
|
|
1811
|
+
console.error("ImagePlugin: image upload failed", m), a.update(() => {
|
|
1812
|
+
const T = j(r);
|
|
1813
|
+
Te(T) && T.setUploadState(re.ERROR);
|
|
1814
|
+
});
|
|
1815
|
+
});
|
|
1816
|
+
};
|
|
1817
|
+
return b(() => a.registerCommand(
|
|
1818
|
+
we,
|
|
1819
|
+
(i) => {
|
|
1820
|
+
if (typeof i == "string")
|
|
1821
|
+
return Je(i, re.UPLOADED), !0;
|
|
1822
|
+
if (i instanceof File && Ve(i)) {
|
|
1823
|
+
const s = URL.createObjectURL(i), u = !!n.current, m = Je(
|
|
1824
|
+
s,
|
|
1825
|
+
u ? re.UPLOADING : re.UPLOADED
|
|
1826
|
+
);
|
|
1827
|
+
return m && u && o(m, i, s), !0;
|
|
1814
1828
|
}
|
|
1815
1829
|
return !1;
|
|
1816
1830
|
},
|
|
1817
|
-
|
|
1818
|
-
), [
|
|
1819
|
-
|
|
1820
|
-
(
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
return !1;
|
|
1830
|
-
const m = URL.createObjectURL(s), A = Ke(m);
|
|
1831
|
-
u.insertNodes([A]);
|
|
1832
|
-
let T = A.getNextSibling() || A.getParent().getNextSibling();
|
|
1833
|
-
return T || (T = re(), A.insertAfter(T)), A.select(), !0;
|
|
1831
|
+
$
|
|
1832
|
+
), [a]), b(() => a.registerCommand(
|
|
1833
|
+
Y,
|
|
1834
|
+
() => {
|
|
1835
|
+
e.current && (e.current.classList.remove(Xe), e.current = null);
|
|
1836
|
+
const i = F();
|
|
1837
|
+
if (Me(i) && i.getNodes().length === 1) {
|
|
1838
|
+
const s = i.getNodes()[0];
|
|
1839
|
+
if (Te(s)) {
|
|
1840
|
+
const u = a.getElementByKey(s.getKey());
|
|
1841
|
+
u.classList.add(Xe), e.current = u;
|
|
1842
|
+
}
|
|
1834
1843
|
}
|
|
1835
1844
|
return !1;
|
|
1836
1845
|
},
|
|
1837
|
-
|
|
1838
|
-
), [
|
|
1839
|
-
/* @__PURE__ */ h(
|
|
1846
|
+
nt
|
|
1847
|
+
), [a]), b(() => a.registerCommand(
|
|
1840
1848
|
Oe,
|
|
1849
|
+
(i) => {
|
|
1850
|
+
const s = i.clipboardData;
|
|
1851
|
+
if (!s) return !1;
|
|
1852
|
+
const u = Array.from(s.files).filter(Ve);
|
|
1853
|
+
if (u.length !== 1) return !1;
|
|
1854
|
+
const m = F() || ve();
|
|
1855
|
+
return k(m) ? (i.preventDefault(), a.dispatchCommand(we, u[0]), !0) : !1;
|
|
1856
|
+
},
|
|
1857
|
+
$
|
|
1858
|
+
), [a]), /* @__PURE__ */ h(
|
|
1859
|
+
De,
|
|
1841
1860
|
{
|
|
1842
|
-
nodeType:
|
|
1861
|
+
nodeType: qe,
|
|
1843
1862
|
eventType: "click",
|
|
1844
|
-
eventListener: (
|
|
1845
|
-
|
|
1863
|
+
eventListener: (r, i, s) => {
|
|
1864
|
+
j(s).select();
|
|
1846
1865
|
}
|
|
1847
1866
|
}
|
|
1848
1867
|
);
|
|
1849
1868
|
}
|
|
1850
1869
|
const ge = 24;
|
|
1851
|
-
function
|
|
1870
|
+
function Vn() {
|
|
1852
1871
|
const [t] = M();
|
|
1853
|
-
return /* @__PURE__ */ h(
|
|
1872
|
+
return /* @__PURE__ */ h(_e, { "aria-label": "Block toolbar", id: "block-toolbar", children: /* @__PURE__ */ D(oe, { "aria-label": "Media", children: [
|
|
1854
1873
|
/* @__PURE__ */ h(
|
|
1855
|
-
|
|
1874
|
+
Kt,
|
|
1856
1875
|
{
|
|
1857
1876
|
acceptedFileTypes: ["image/png", "image/jpeg", "image/gif"],
|
|
1858
1877
|
onSelect: (e) => {
|
|
@@ -1863,125 +1882,118 @@ function Qn() {
|
|
|
1863
1882
|
alert("Please select an image file.");
|
|
1864
1883
|
return;
|
|
1865
1884
|
}
|
|
1866
|
-
|
|
1867
|
-
i.onload = (r) => {
|
|
1868
|
-
var s;
|
|
1869
|
-
const o = (s = r.target) == null ? void 0 : s.result;
|
|
1870
|
-
typeof o == "string" ? t.dispatchCommand(dt, o) : alert("Failed to read file as Data URL.");
|
|
1871
|
-
}, i.onerror = (r) => {
|
|
1872
|
-
console.error("Error reading file:", r), alert("Error reading file.");
|
|
1873
|
-
}, i.readAsDataURL(n);
|
|
1885
|
+
t.dispatchCommand(we, n);
|
|
1874
1886
|
},
|
|
1875
1887
|
allowsMultiple: !1,
|
|
1876
|
-
children: /* @__PURE__ */ h(
|
|
1888
|
+
children: /* @__PURE__ */ h(q, { "aria-label": "image", children: /* @__PURE__ */ h(tn, { size: ge }) })
|
|
1877
1889
|
}
|
|
1878
1890
|
),
|
|
1879
1891
|
/* @__PURE__ */ h(
|
|
1880
|
-
|
|
1892
|
+
q,
|
|
1881
1893
|
{
|
|
1882
1894
|
"aria-label": "code block",
|
|
1883
1895
|
onPress: () => {
|
|
1884
|
-
t.dispatchCommand(
|
|
1896
|
+
t.dispatchCommand(gt, void 0);
|
|
1885
1897
|
},
|
|
1886
|
-
children: /* @__PURE__ */ h(
|
|
1898
|
+
children: /* @__PURE__ */ h(nn, { size: ge })
|
|
1887
1899
|
}
|
|
1888
1900
|
),
|
|
1889
1901
|
/* @__PURE__ */ h(
|
|
1890
|
-
|
|
1902
|
+
q,
|
|
1891
1903
|
{
|
|
1892
1904
|
"aria-label": "horizontal divider",
|
|
1893
1905
|
onPress: () => {
|
|
1894
1906
|
t.dispatchCommand(
|
|
1895
|
-
|
|
1907
|
+
ht,
|
|
1896
1908
|
void 0
|
|
1897
1909
|
);
|
|
1898
1910
|
},
|
|
1899
|
-
children: /* @__PURE__ */ h(
|
|
1911
|
+
children: /* @__PURE__ */ h(rn, { size: ge })
|
|
1900
1912
|
}
|
|
1901
1913
|
)
|
|
1902
1914
|
] }) });
|
|
1903
1915
|
}
|
|
1904
|
-
function
|
|
1916
|
+
function Jn({
|
|
1905
1917
|
selectionRectCoords: t,
|
|
1906
1918
|
TOOLBAR_OFFSET: a,
|
|
1907
1919
|
toolbarTriggerId: e,
|
|
1908
1920
|
toolbarPopoverId: n
|
|
1909
1921
|
}) {
|
|
1910
|
-
const [
|
|
1922
|
+
const [o, r] = O({
|
|
1911
1923
|
x: B,
|
|
1912
1924
|
y: B
|
|
1913
|
-
}),
|
|
1914
|
-
return
|
|
1925
|
+
}), i = ee(null);
|
|
1926
|
+
return b(() => {
|
|
1915
1927
|
r(
|
|
1916
|
-
|
|
1928
|
+
An(
|
|
1917
1929
|
t,
|
|
1918
|
-
|
|
1930
|
+
i,
|
|
1919
1931
|
a
|
|
1920
1932
|
)
|
|
1921
1933
|
);
|
|
1922
|
-
}, [t]), /* @__PURE__ */ D(
|
|
1934
|
+
}, [t]), /* @__PURE__ */ D(Wt, { children: [
|
|
1923
1935
|
/* @__PURE__ */ h(
|
|
1924
|
-
|
|
1936
|
+
q,
|
|
1925
1937
|
{
|
|
1926
1938
|
"aria-label": "Block toolbar trigger",
|
|
1927
1939
|
className: "block-toolbar-trigger",
|
|
1928
1940
|
id: e,
|
|
1929
|
-
ref:
|
|
1941
|
+
ref: i,
|
|
1930
1942
|
style: {
|
|
1931
1943
|
position: "absolute",
|
|
1932
|
-
top:
|
|
1933
|
-
left:
|
|
1944
|
+
top: o.y,
|
|
1945
|
+
left: o.x
|
|
1934
1946
|
},
|
|
1935
|
-
children: /* @__PURE__ */ h(
|
|
1947
|
+
children: /* @__PURE__ */ h(en, { size: ge })
|
|
1936
1948
|
}
|
|
1937
1949
|
),
|
|
1938
1950
|
/* @__PURE__ */ h(
|
|
1939
|
-
|
|
1951
|
+
ot,
|
|
1940
1952
|
{
|
|
1941
1953
|
className: "block-toolbar-popover",
|
|
1942
1954
|
id: n,
|
|
1943
1955
|
placement: "end",
|
|
1944
1956
|
shouldFlip: !1,
|
|
1945
1957
|
offset: a,
|
|
1946
|
-
children: /* @__PURE__ */ h(
|
|
1958
|
+
children: /* @__PURE__ */ h(Vn, {})
|
|
1947
1959
|
}
|
|
1948
1960
|
)
|
|
1949
1961
|
] });
|
|
1950
1962
|
}
|
|
1951
|
-
const
|
|
1952
|
-
function
|
|
1953
|
-
const [a, e] = O(null), [n] = M(), [
|
|
1963
|
+
const er = document.body;
|
|
1964
|
+
function tr({ toolbarGap: t }) {
|
|
1965
|
+
const [a, e] = O(null), [n] = M(), [o, r] = O(!1), [i, s] = O(!1), u = ee(Math.random().toString(36).substring(2, 9)), m = `block-toolbar-trigger-${u.current}`, T = `block-toolbar-popover-${u.current}`, A = () => r(!0), S = (L) => {
|
|
1954
1966
|
setTimeout(() => {
|
|
1955
1967
|
const N = document.getElementById(m);
|
|
1956
|
-
N && (N === document.activeElement || N.contains(document.activeElement) || N.contains(
|
|
1968
|
+
N && (N === document.activeElement || N.contains(document.activeElement) || N.contains(L.relatedTarget)) || r(!1);
|
|
1957
1969
|
}, 10);
|
|
1958
1970
|
};
|
|
1959
|
-
return
|
|
1960
|
-
const
|
|
1961
|
-
const p = !!document.getElementById(
|
|
1971
|
+
return b(() => {
|
|
1972
|
+
const L = () => {
|
|
1973
|
+
const p = !!document.getElementById(T);
|
|
1962
1974
|
s(p);
|
|
1963
|
-
}, N = new MutationObserver(
|
|
1975
|
+
}, N = new MutationObserver(L);
|
|
1964
1976
|
return N.observe(document.body, {
|
|
1965
1977
|
childList: !0,
|
|
1966
1978
|
subtree: !0
|
|
1967
|
-
}),
|
|
1968
|
-
}, []),
|
|
1979
|
+
}), L(), () => N.disconnect();
|
|
1980
|
+
}, []), b(() => n.registerRootListener(
|
|
1969
1981
|
(N, p) => {
|
|
1970
|
-
N && (N.addEventListener("focus",
|
|
1982
|
+
N && (N.addEventListener("focus", A), N.addEventListener("blur", S)), p && (p.removeEventListener("focus", A), p.removeEventListener("blur", S));
|
|
1971
1983
|
}
|
|
1972
|
-
), [n]),
|
|
1973
|
-
|
|
1984
|
+
), [n]), b(() => n.registerCommand(
|
|
1985
|
+
Y,
|
|
1974
1986
|
() => {
|
|
1975
1987
|
const N = n.getRootElement();
|
|
1976
1988
|
if (N) {
|
|
1977
|
-
const
|
|
1978
|
-
|
|
1989
|
+
const x = N === document.activeElement || N.contains(document.activeElement);
|
|
1990
|
+
x !== o && r(x);
|
|
1979
1991
|
}
|
|
1980
|
-
const p =
|
|
1981
|
-
if (!
|
|
1992
|
+
const p = F();
|
|
1993
|
+
if (!k(p) || !p.isCollapsed())
|
|
1982
1994
|
return e(null), !1;
|
|
1983
|
-
const y =
|
|
1984
|
-
if (
|
|
1995
|
+
const y = Ce(p);
|
|
1996
|
+
if (J(y) && y.getTextContent() === "") {
|
|
1985
1997
|
const l = n.getElementByKey(y.getKey()).getBoundingClientRect(), c = l.left, d = l.top + l.height / 2 + window.scrollY;
|
|
1986
1998
|
e({ x: c, y: d });
|
|
1987
1999
|
} else
|
|
@@ -1989,427 +2001,428 @@ function Jn({ toolbarGap: t }) {
|
|
|
1989
2001
|
return !1;
|
|
1990
2002
|
},
|
|
1991
2003
|
$
|
|
1992
|
-
), [n]), a && (
|
|
2004
|
+
), [n]), a && (o || i) && Pe(
|
|
1993
2005
|
/* @__PURE__ */ h(
|
|
1994
|
-
|
|
2006
|
+
Jn,
|
|
1995
2007
|
{
|
|
1996
2008
|
selectionRectCoords: a,
|
|
1997
2009
|
TOOLBAR_OFFSET: t,
|
|
1998
2010
|
toolbarTriggerId: m,
|
|
1999
|
-
toolbarPopoverId:
|
|
2011
|
+
toolbarPopoverId: T
|
|
2000
2012
|
}
|
|
2001
2013
|
),
|
|
2002
|
-
|
|
2014
|
+
er
|
|
2003
2015
|
);
|
|
2004
2016
|
}
|
|
2005
|
-
const
|
|
2017
|
+
const nr = [
|
|
2006
2018
|
["$", "$"],
|
|
2007
2019
|
["\\(", "\\)"]
|
|
2008
|
-
],
|
|
2020
|
+
], rr = [
|
|
2009
2021
|
["$$", "$$"],
|
|
2010
2022
|
["\\[", "\\]"]
|
|
2011
|
-
],
|
|
2023
|
+
], et = (t) => t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), mt = (t, a) => {
|
|
2012
2024
|
let e = null;
|
|
2013
|
-
for (const [n,
|
|
2014
|
-
const
|
|
2015
|
-
`(.*?)(${
|
|
2025
|
+
for (const [n, o] of a) {
|
|
2026
|
+
const i = new RegExp(
|
|
2027
|
+
`(.*?)(${et(n)})(.*?)(${et(o)})`,
|
|
2016
2028
|
"g"
|
|
2017
2029
|
).exec(t);
|
|
2018
|
-
if (
|
|
2019
|
-
const s =
|
|
2030
|
+
if (i) {
|
|
2031
|
+
const s = i[3];
|
|
2020
2032
|
if (s && s.trim() !== "") {
|
|
2021
|
-
const u =
|
|
2033
|
+
const u = i.index + i[1].length, m = i.index + i[0].length;
|
|
2022
2034
|
(!e || u < e.start) && (e = {
|
|
2023
2035
|
start: u,
|
|
2024
2036
|
end: m,
|
|
2025
|
-
content: n + s +
|
|
2037
|
+
content: n + s + o
|
|
2026
2038
|
});
|
|
2027
2039
|
}
|
|
2028
2040
|
}
|
|
2029
2041
|
}
|
|
2030
2042
|
return e;
|
|
2031
|
-
},
|
|
2032
|
-
if (!
|
|
2043
|
+
}, pt = (t, a) => {
|
|
2044
|
+
if (!k(t))
|
|
2033
2045
|
return null;
|
|
2034
|
-
const e = t.anchor.getNode(), n = t.focus.getNode(),
|
|
2035
|
-
return !
|
|
2036
|
-
},
|
|
2037
|
-
function
|
|
2046
|
+
const e = t.anchor.getNode(), n = t.focus.getNode(), o = a(e) ? e : I(e, a), r = a(n) ? n : I(n, a);
|
|
2047
|
+
return !o || !r ? null : o.getKey() === r.getKey() ? o : null;
|
|
2048
|
+
}, bt = (t) => t.getData("text/plain") || t.getData("text") || t.getData("text/uri-list");
|
|
2049
|
+
function ir() {
|
|
2038
2050
|
const [t] = M();
|
|
2039
|
-
return
|
|
2040
|
-
if (!t.hasNodes([
|
|
2051
|
+
return b(() => {
|
|
2052
|
+
if (!t.hasNodes([he, mn]))
|
|
2041
2053
|
throw new Error(
|
|
2042
2054
|
"MathInlinePlugin: MathNode or MathHighlightNodeInline not registered on editor"
|
|
2043
2055
|
);
|
|
2044
|
-
}, [t]),
|
|
2045
|
-
if (!e.isSimpleText() ||
|
|
2056
|
+
}, [t]), b(() => t.registerNodeTransform(se, (e) => {
|
|
2057
|
+
if (!e.isSimpleText() || X(e) || I(e, W))
|
|
2046
2058
|
return;
|
|
2047
|
-
const n = e.getTextContent(),
|
|
2048
|
-
if (
|
|
2049
|
-
const { start: r, end:
|
|
2059
|
+
const n = e.getTextContent(), o = mt(n, nr);
|
|
2060
|
+
if (o) {
|
|
2061
|
+
const { start: r, end: i, content: s } = o;
|
|
2050
2062
|
let u;
|
|
2051
|
-
const m =
|
|
2052
|
-
return r === 0 ? ([u] = e.splitText(
|
|
2063
|
+
const m = U(s, !0);
|
|
2064
|
+
return r === 0 ? ([u] = e.splitText(i), u.insertBefore(m), u.remove()) : ([, u] = e.splitText(r, i), u.replace(m)), m;
|
|
2053
2065
|
}
|
|
2054
|
-
}), [t]),
|
|
2055
|
-
|
|
2066
|
+
}), [t]), b(() => t.registerCommand(
|
|
2067
|
+
Y,
|
|
2056
2068
|
() => {
|
|
2057
|
-
const e =
|
|
2058
|
-
if (
|
|
2059
|
-
const
|
|
2060
|
-
if (
|
|
2061
|
-
const s =
|
|
2069
|
+
const e = F(), n = /* @__PURE__ */ new Set();
|
|
2070
|
+
if (Me(e)) {
|
|
2071
|
+
const i = e.getNodes();
|
|
2072
|
+
if (i.length === 1 && V(i[0])) {
|
|
2073
|
+
const s = i[0];
|
|
2062
2074
|
if (s.isInline()) {
|
|
2063
2075
|
let u = s.getEquation();
|
|
2064
2076
|
u.startsWith("$") && u.endsWith("$") ? u = u.slice(1, -1) : u.startsWith("\\(") && u.endsWith("\\)") && (u = u.slice(2, -2));
|
|
2065
|
-
const m =
|
|
2077
|
+
const m = Ae(u);
|
|
2066
2078
|
return s.replace(m), m.select(), !0;
|
|
2067
2079
|
}
|
|
2068
2080
|
}
|
|
2069
|
-
} else
|
|
2070
|
-
return fe().getAllTextNodes().forEach((
|
|
2071
|
-
if (
|
|
2072
|
-
let s =
|
|
2081
|
+
} else k(e) && e.getNodes().forEach((i) => n.add(i.getKey()));
|
|
2082
|
+
return fe().getAllTextNodes().forEach((i) => {
|
|
2083
|
+
if (X(i) && !n.has(i.getKey())) {
|
|
2084
|
+
let s = i.getTextContent();
|
|
2073
2085
|
if (!s) {
|
|
2074
|
-
|
|
2086
|
+
i.remove();
|
|
2075
2087
|
return;
|
|
2076
2088
|
}
|
|
2077
2089
|
let u = !1;
|
|
2078
2090
|
s.startsWith("$") && s.endsWith("$") && s.length >= 2 && (s = s.slice(1, -1), u = !0);
|
|
2079
|
-
const m = u ?
|
|
2080
|
-
|
|
2091
|
+
const m = u ? U(`$$${s}$$`, !1) : U(`$${s}$`, !0);
|
|
2092
|
+
i.replace(m);
|
|
2081
2093
|
}
|
|
2082
2094
|
}), !1;
|
|
2083
2095
|
},
|
|
2084
2096
|
$
|
|
2085
|
-
), [t]),
|
|
2097
|
+
), [t]), b(() => t.registerCommand(
|
|
2086
2098
|
be,
|
|
2087
2099
|
() => (t.update(() => {
|
|
2088
2100
|
fe().getAllTextNodes().forEach((n) => {
|
|
2089
|
-
if (
|
|
2090
|
-
let
|
|
2091
|
-
if (!
|
|
2101
|
+
if (X(n)) {
|
|
2102
|
+
let o = n.getTextContent();
|
|
2103
|
+
if (!o) {
|
|
2092
2104
|
n.remove();
|
|
2093
2105
|
return;
|
|
2094
2106
|
}
|
|
2095
2107
|
let r = !1;
|
|
2096
|
-
|
|
2097
|
-
const
|
|
2098
|
-
n.replace(
|
|
2108
|
+
o.startsWith("$") && o.endsWith("$") && o.length >= 2 && (o = o.slice(1, -1), r = !0);
|
|
2109
|
+
const i = r ? U(`$$${o}$$`, !1) : U(`$${o}$`, !0);
|
|
2110
|
+
n.replace(i), rt(null);
|
|
2099
2111
|
}
|
|
2100
2112
|
});
|
|
2101
2113
|
}), !1),
|
|
2102
2114
|
$
|
|
2103
|
-
), [t]),
|
|
2104
|
-
|
|
2115
|
+
), [t]), b(() => t.registerCommand(
|
|
2116
|
+
Ft,
|
|
2105
2117
|
(a) => {
|
|
2106
|
-
const e =
|
|
2107
|
-
if (!
|
|
2118
|
+
const e = F();
|
|
2119
|
+
if (!k(e) || !e.isCollapsed())
|
|
2108
2120
|
return !1;
|
|
2109
2121
|
const n = Fe(e.anchor, !1);
|
|
2110
|
-
if (
|
|
2122
|
+
if (V(n) && n.isInline()) {
|
|
2111
2123
|
let r = n.getEquation();
|
|
2112
2124
|
r.startsWith("$") && r.endsWith("$") ? r = r.slice(1, -1) : r.startsWith("\\(") && r.endsWith("\\)") && (r = r.slice(2, -2));
|
|
2113
|
-
const
|
|
2114
|
-
return n.replace(
|
|
2125
|
+
const i = Ae(r);
|
|
2126
|
+
return n.replace(i), i.select(0, 0), !0;
|
|
2115
2127
|
}
|
|
2116
2128
|
return !1;
|
|
2117
2129
|
},
|
|
2118
2130
|
$
|
|
2119
|
-
), [t]),
|
|
2120
|
-
|
|
2131
|
+
), [t]), b(() => t.registerCommand(
|
|
2132
|
+
Ie,
|
|
2121
2133
|
(a) => {
|
|
2122
|
-
const e =
|
|
2123
|
-
if (!
|
|
2134
|
+
const e = F();
|
|
2135
|
+
if (!k(e) || !e.isCollapsed())
|
|
2124
2136
|
return !1;
|
|
2125
2137
|
const n = Fe(e.anchor, !0);
|
|
2126
|
-
if (
|
|
2138
|
+
if (V(n) && n.isInline()) {
|
|
2127
2139
|
let r = n.getEquation();
|
|
2128
2140
|
r.startsWith("$") && r.endsWith("$") ? r = r.slice(1, -1) : r.startsWith("\\(") && r.endsWith("\\)") && (r = r.slice(2, -2));
|
|
2129
|
-
const
|
|
2130
|
-
return n.replace(
|
|
2141
|
+
const i = Ae(r);
|
|
2142
|
+
return n.replace(i), i.select(), !0;
|
|
2131
2143
|
}
|
|
2132
2144
|
return !1;
|
|
2133
2145
|
},
|
|
2134
2146
|
$
|
|
2135
|
-
), [t]),
|
|
2136
|
-
|
|
2147
|
+
), [t]), b(() => t.registerCommand(
|
|
2148
|
+
Oe,
|
|
2137
2149
|
(a) => {
|
|
2138
2150
|
const e = a.clipboardData;
|
|
2139
2151
|
if (!e)
|
|
2140
2152
|
return !1;
|
|
2141
|
-
const n =
|
|
2142
|
-
if (!
|
|
2153
|
+
const n = F();
|
|
2154
|
+
if (!pt(
|
|
2143
2155
|
n,
|
|
2144
|
-
|
|
2156
|
+
X
|
|
2145
2157
|
))
|
|
2146
2158
|
return !1;
|
|
2147
|
-
const r =
|
|
2159
|
+
const r = bt(e);
|
|
2148
2160
|
return r ? (a.preventDefault(), n.insertText(r), !0) : !1;
|
|
2149
2161
|
},
|
|
2150
2162
|
$
|
|
2151
|
-
), [t]),
|
|
2152
|
-
|
|
2163
|
+
), [t]), b(() => t.registerCommand(
|
|
2164
|
+
Y,
|
|
2153
2165
|
() => {
|
|
2154
|
-
const a =
|
|
2155
|
-
if (!
|
|
2166
|
+
const a = F();
|
|
2167
|
+
if (!k(a) || !a.isCollapsed())
|
|
2156
2168
|
return !1;
|
|
2157
2169
|
const e = a.anchor.getNode();
|
|
2158
|
-
return
|
|
2170
|
+
return X(e) && (e.getNextSibling() || e.insertAfter(kt(" "))), !1;
|
|
2159
2171
|
},
|
|
2160
|
-
|
|
2172
|
+
wt
|
|
2161
2173
|
), [t]), // Register click event for MathNode
|
|
2162
2174
|
/* @__PURE__ */ h(
|
|
2163
|
-
|
|
2175
|
+
De,
|
|
2164
2176
|
{
|
|
2165
|
-
nodeType:
|
|
2177
|
+
nodeType: he,
|
|
2166
2178
|
eventType: "click",
|
|
2167
2179
|
eventListener: (a, e, n) => {
|
|
2168
|
-
const
|
|
2169
|
-
|
|
2180
|
+
const o = j(n);
|
|
2181
|
+
o && o.isInline() && o.select();
|
|
2170
2182
|
}
|
|
2171
2183
|
}
|
|
2172
2184
|
);
|
|
2173
2185
|
}
|
|
2174
|
-
function
|
|
2186
|
+
function or() {
|
|
2175
2187
|
const [t] = M();
|
|
2176
|
-
return
|
|
2177
|
-
if (!t.hasNodes([
|
|
2188
|
+
return b(() => {
|
|
2189
|
+
if (!t.hasNodes([he, pn]))
|
|
2178
2190
|
throw new Error(
|
|
2179
2191
|
"MathBlockPlugin: MathNode or MathHighlightNodeBlock not registered on editor"
|
|
2180
2192
|
);
|
|
2181
|
-
}, [t]),
|
|
2182
|
-
if (!e.isSimpleText() || I(e,
|
|
2193
|
+
}, [t]), b(() => t.registerNodeTransform(se, (e) => {
|
|
2194
|
+
if (!e.isSimpleText() || I(e, W))
|
|
2183
2195
|
return;
|
|
2184
2196
|
const n = e.getTextContent();
|
|
2185
2197
|
if (n.startsWith("$$ ")) {
|
|
2186
|
-
const r = e.getPreviousSibling(),
|
|
2198
|
+
const r = e.getPreviousSibling(), i = I(e, J), s = i !== null && i.getChildrenSize() === 1, u = ie(r);
|
|
2187
2199
|
if (s || u) {
|
|
2188
2200
|
if (n.length > 3)
|
|
2189
2201
|
return;
|
|
2190
|
-
const m =
|
|
2202
|
+
const m = Se("");
|
|
2191
2203
|
e.replace(m), m.select();
|
|
2192
|
-
const
|
|
2193
|
-
|
|
2204
|
+
const T = m.getNextSibling();
|
|
2205
|
+
ie(T) && T.remove();
|
|
2194
2206
|
return;
|
|
2195
2207
|
}
|
|
2196
2208
|
}
|
|
2197
|
-
const
|
|
2198
|
-
if (
|
|
2199
|
-
const { start: r, end:
|
|
2209
|
+
const o = mt(n, rr);
|
|
2210
|
+
if (o) {
|
|
2211
|
+
const { start: r, end: i, content: s } = o;
|
|
2200
2212
|
let u;
|
|
2201
|
-
const m =
|
|
2202
|
-
return r === 0 ? ([u] = e.splitText(
|
|
2213
|
+
const m = U(s, !1);
|
|
2214
|
+
return r === 0 ? ([u] = e.splitText(i), u.insertBefore(m), u.remove()) : ([, u] = e.splitText(r, i), u.replace(m)), m;
|
|
2203
2215
|
}
|
|
2204
|
-
}), [t]),
|
|
2205
|
-
|
|
2216
|
+
}), [t]), b(() => t.registerCommand(
|
|
2217
|
+
Y,
|
|
2206
2218
|
() => {
|
|
2207
|
-
const e =
|
|
2208
|
-
if (
|
|
2209
|
-
const
|
|
2210
|
-
if (
|
|
2211
|
-
const s =
|
|
2219
|
+
const e = F(), n = /* @__PURE__ */ new Set();
|
|
2220
|
+
if (Me(e)) {
|
|
2221
|
+
const i = e.getNodes();
|
|
2222
|
+
if (i.length === 1 && V(i[0])) {
|
|
2223
|
+
const s = i[0];
|
|
2212
2224
|
if (!s.isInline()) {
|
|
2213
2225
|
let u = s.getEquation();
|
|
2214
2226
|
(u.startsWith("$$") && u.endsWith("$$") || u.startsWith("\\[") && u.endsWith("\\]")) && (u = u.slice(2, -2));
|
|
2215
|
-
const m =
|
|
2227
|
+
const m = Se(u);
|
|
2216
2228
|
return s.replace(m), m.select(), !0;
|
|
2217
2229
|
}
|
|
2218
2230
|
}
|
|
2219
|
-
} else
|
|
2220
|
-
n.add(
|
|
2221
|
-
const s = I(
|
|
2231
|
+
} else k(e) && e.getNodes().forEach((i) => {
|
|
2232
|
+
n.add(i.getKey());
|
|
2233
|
+
const s = I(i, W);
|
|
2222
2234
|
s && n.add(s.getKey());
|
|
2223
2235
|
});
|
|
2224
2236
|
const r = t.getEditorState()._nodeMap;
|
|
2225
|
-
for (const [,
|
|
2226
|
-
if (
|
|
2227
|
-
const s =
|
|
2237
|
+
for (const [, i] of r)
|
|
2238
|
+
if (W(i) && i.isAttached() && !n.has(i.getKey())) {
|
|
2239
|
+
const s = i.getTextContent();
|
|
2228
2240
|
if (!s) {
|
|
2229
|
-
|
|
2241
|
+
i.remove();
|
|
2230
2242
|
continue;
|
|
2231
2243
|
}
|
|
2232
|
-
const u =
|
|
2233
|
-
|
|
2244
|
+
const u = U(`$$${s}$$`, !1);
|
|
2245
|
+
i.replace(u);
|
|
2234
2246
|
}
|
|
2235
2247
|
return !1;
|
|
2236
2248
|
},
|
|
2237
2249
|
$
|
|
2238
|
-
), [t]),
|
|
2250
|
+
), [t]), b(() => t.registerCommand(
|
|
2239
2251
|
be,
|
|
2240
2252
|
() => (t.update(() => {
|
|
2241
2253
|
const a = fe();
|
|
2242
|
-
|
|
2243
|
-
if (
|
|
2244
|
-
const
|
|
2245
|
-
if (!
|
|
2254
|
+
Bt(a).forEach(({ node: n }) => {
|
|
2255
|
+
if (W(n)) {
|
|
2256
|
+
const o = n.getTextContent();
|
|
2257
|
+
if (!o) {
|
|
2246
2258
|
n.remove();
|
|
2247
2259
|
return;
|
|
2248
2260
|
}
|
|
2249
|
-
const r =
|
|
2250
|
-
n.replace(r),
|
|
2261
|
+
const r = U(`$$${o}$$`, !1);
|
|
2262
|
+
n.replace(r), rt(null);
|
|
2251
2263
|
}
|
|
2252
2264
|
});
|
|
2253
2265
|
}), !1),
|
|
2254
2266
|
$
|
|
2255
|
-
), [t]),
|
|
2256
|
-
|
|
2267
|
+
), [t]), b(() => t.registerCommand(
|
|
2268
|
+
It,
|
|
2257
2269
|
() => {
|
|
2258
|
-
const e =
|
|
2259
|
-
if (!
|
|
2270
|
+
const e = F();
|
|
2271
|
+
if (!k(e))
|
|
2260
2272
|
return !1;
|
|
2261
|
-
const n = e.getNodes()[0],
|
|
2273
|
+
const n = e.getNodes()[0], o = I(
|
|
2262
2274
|
n,
|
|
2263
|
-
|
|
2275
|
+
W
|
|
2264
2276
|
);
|
|
2265
|
-
if (!
|
|
2277
|
+
if (!o)
|
|
2266
2278
|
return !1;
|
|
2267
|
-
const r =
|
|
2268
|
-
return e.isCollapsed() && (e.anchor.getNode().getKey() ===
|
|
2279
|
+
const r = o.getLastChild();
|
|
2280
|
+
return e.isCollapsed() && (e.anchor.getNode().getKey() === o.getKey() && e.anchor.offset === 0 && o.getChildrenSize() === 0 || r && ie(r) && e.anchor.getNode().getKey() === o.getKey() && e.anchor.offset === o.getChildrenSize() || r && Mt(r) && e.anchor.getNode().getKey() === r.getKey() && e.anchor.offset === r.getTextContent().length) ? !1 : (e.insertLineBreak(), !0);
|
|
2269
2281
|
},
|
|
2270
2282
|
$
|
|
2271
|
-
), [t]),
|
|
2272
|
-
|
|
2283
|
+
), [t]), b(() => t.registerCommand(
|
|
2284
|
+
Ie,
|
|
2273
2285
|
(a) => {
|
|
2274
|
-
const e =
|
|
2275
|
-
if (!
|
|
2286
|
+
const e = F();
|
|
2287
|
+
if (!k(e) || !e.isCollapsed())
|
|
2276
2288
|
return !1;
|
|
2277
2289
|
const n = Fe(e.anchor, !0);
|
|
2278
|
-
if (
|
|
2290
|
+
if (V(n) && !n.isInline()) {
|
|
2279
2291
|
let r = n.getEquation();
|
|
2280
2292
|
(r.startsWith("$$") && r.endsWith("$$") || r.startsWith("\\[") && r.endsWith("\\]")) && (r = r.slice(2, -2));
|
|
2281
|
-
const
|
|
2282
|
-
return n.replace(
|
|
2293
|
+
const i = Se(r);
|
|
2294
|
+
return n.replace(i), i.select(), !0;
|
|
2283
2295
|
}
|
|
2284
2296
|
return !1;
|
|
2285
2297
|
},
|
|
2286
2298
|
$
|
|
2287
|
-
), [t]),
|
|
2288
|
-
|
|
2299
|
+
), [t]), b(() => t.registerCommand(
|
|
2300
|
+
Oe,
|
|
2289
2301
|
(a) => {
|
|
2290
2302
|
const e = a.clipboardData;
|
|
2291
2303
|
if (!e)
|
|
2292
2304
|
return !1;
|
|
2293
|
-
const n =
|
|
2294
|
-
if (!
|
|
2305
|
+
const n = F();
|
|
2306
|
+
if (!pt(
|
|
2295
2307
|
n,
|
|
2296
|
-
|
|
2308
|
+
W
|
|
2297
2309
|
))
|
|
2298
2310
|
return !1;
|
|
2299
|
-
const r =
|
|
2311
|
+
const r = bt(e);
|
|
2300
2312
|
return r ? (a.preventDefault(), n.insertRawText(r), !0) : !1;
|
|
2301
2313
|
},
|
|
2302
2314
|
$
|
|
2303
2315
|
), [t]), /* @__PURE__ */ h(
|
|
2304
|
-
|
|
2316
|
+
De,
|
|
2305
2317
|
{
|
|
2306
|
-
nodeType:
|
|
2318
|
+
nodeType: he,
|
|
2307
2319
|
eventType: "click",
|
|
2308
2320
|
eventListener: (a, e, n) => {
|
|
2309
|
-
const
|
|
2310
|
-
|
|
2321
|
+
const o = j(n);
|
|
2322
|
+
o && !o.isInline() && o.select();
|
|
2311
2323
|
}
|
|
2312
2324
|
}
|
|
2313
2325
|
);
|
|
2314
2326
|
}
|
|
2315
|
-
const
|
|
2316
|
-
function
|
|
2327
|
+
const sr = 3;
|
|
2328
|
+
function ar() {
|
|
2317
2329
|
const [t] = M();
|
|
2318
|
-
return
|
|
2319
|
-
|
|
2330
|
+
return b(() => t.registerNodeTransform(
|
|
2331
|
+
Ot,
|
|
2320
2332
|
(e) => {
|
|
2321
2333
|
const n = e.getParent();
|
|
2322
|
-
if (
|
|
2323
|
-
const
|
|
2324
|
-
e.replace(
|
|
2334
|
+
if (Ke(n)) {
|
|
2335
|
+
const o = Pt();
|
|
2336
|
+
e.replace(o), o.selectEnd();
|
|
2325
2337
|
}
|
|
2326
2338
|
}
|
|
2327
|
-
), [t]),
|
|
2328
|
-
if (!I(e,
|
|
2339
|
+
), [t]), b(() => t.registerNodeTransform(se, (e) => {
|
|
2340
|
+
if (!I(e, J) || I(e, J).getFirstDescendant() !== e)
|
|
2329
2341
|
return;
|
|
2330
|
-
const
|
|
2331
|
-
if (
|
|
2332
|
-
const
|
|
2333
|
-
e.getTextContent() === "1. " &&
|
|
2342
|
+
const o = F();
|
|
2343
|
+
if (k(o) && o.isCollapsed()) {
|
|
2344
|
+
const i = o.anchor.offset;
|
|
2345
|
+
e.getTextContent() === "1. " && i === 3 ? (Ue("number"), e.setTextContent("")) : e.getTextContent() === "- " && i === 2 && (Ue("bullet"), e.setTextContent(""));
|
|
2334
2346
|
}
|
|
2335
|
-
}), [t]),
|
|
2336
|
-
|
|
2347
|
+
}), [t]), b(() => t.registerCommand(
|
|
2348
|
+
_t,
|
|
2337
2349
|
(e) => {
|
|
2338
|
-
const n =
|
|
2339
|
-
if (!
|
|
2350
|
+
const n = F();
|
|
2351
|
+
if (!k(n))
|
|
2340
2352
|
return !1;
|
|
2341
|
-
const
|
|
2353
|
+
const o = Ce(n), r = I(o, Ke);
|
|
2342
2354
|
if (!r)
|
|
2343
2355
|
return !1;
|
|
2344
|
-
const
|
|
2356
|
+
const i = r.getIndent();
|
|
2345
2357
|
if (e.shiftKey) {
|
|
2346
|
-
if (
|
|
2358
|
+
if (i <= 0)
|
|
2347
2359
|
return !1;
|
|
2348
|
-
r.setIndent(
|
|
2360
|
+
r.setIndent(i - 1);
|
|
2349
2361
|
} else {
|
|
2350
|
-
if (
|
|
2362
|
+
if (i > sr)
|
|
2351
2363
|
return !1;
|
|
2352
|
-
r.setIndent(
|
|
2364
|
+
r.setIndent(i + 1);
|
|
2353
2365
|
}
|
|
2354
2366
|
return !0;
|
|
2355
2367
|
},
|
|
2356
2368
|
$
|
|
2357
2369
|
), [t]), null;
|
|
2358
2370
|
}
|
|
2359
|
-
function
|
|
2371
|
+
function lr() {
|
|
2360
2372
|
const [t] = M(), a = (e) => {
|
|
2361
2373
|
e.key === "Tab" && e.preventDefault();
|
|
2362
2374
|
};
|
|
2363
|
-
return
|
|
2364
|
-
(n,
|
|
2365
|
-
n && n.addEventListener("keydown", a),
|
|
2375
|
+
return b(() => t.registerRootListener(
|
|
2376
|
+
(n, o) => {
|
|
2377
|
+
n && n.addEventListener("keydown", a), o && o.removeEventListener("keydown", a);
|
|
2366
2378
|
}
|
|
2367
2379
|
), [t]), null;
|
|
2368
2380
|
}
|
|
2369
|
-
function
|
|
2381
|
+
function cr({ editorRef: t }) {
|
|
2370
2382
|
const [a] = M();
|
|
2371
|
-
return
|
|
2383
|
+
return b(() => {
|
|
2372
2384
|
if (t)
|
|
2373
2385
|
return t.current = a, () => {
|
|
2374
2386
|
t && (t.current = null);
|
|
2375
2387
|
};
|
|
2376
2388
|
}, [a, t]), null;
|
|
2377
2389
|
}
|
|
2378
|
-
function
|
|
2390
|
+
function Or({
|
|
2379
2391
|
initialConfig: t,
|
|
2380
2392
|
onChange: a,
|
|
2381
2393
|
editorRef: e,
|
|
2382
2394
|
blockToolbarGap: n,
|
|
2383
|
-
spellCheck:
|
|
2384
|
-
isHeadingOneFirst: r
|
|
2395
|
+
spellCheck: o,
|
|
2396
|
+
isHeadingOneFirst: r,
|
|
2397
|
+
onImageUpload: i
|
|
2385
2398
|
}) {
|
|
2386
|
-
return /* @__PURE__ */ D(
|
|
2399
|
+
return /* @__PURE__ */ D(xt, { initialConfig: t, children: [
|
|
2387
2400
|
/* @__PURE__ */ h(
|
|
2388
|
-
|
|
2401
|
+
Tt,
|
|
2389
2402
|
{
|
|
2390
|
-
contentEditable: /* @__PURE__ */ h(
|
|
2391
|
-
ErrorBoundary:
|
|
2403
|
+
contentEditable: /* @__PURE__ */ h(Nn, { spellCheck: o, className: "editor-input" }),
|
|
2404
|
+
ErrorBoundary: St
|
|
2392
2405
|
}
|
|
2393
2406
|
),
|
|
2394
|
-
/* @__PURE__ */ h(
|
|
2395
|
-
/* @__PURE__ */ h(
|
|
2396
|
-
/* @__PURE__ */ h(
|
|
2397
|
-
/* @__PURE__ */ h(
|
|
2398
|
-
/* @__PURE__ */ h(
|
|
2399
|
-
/* @__PURE__ */ h(
|
|
2400
|
-
/* @__PURE__ */ h(rr, {}),
|
|
2401
|
-
/* @__PURE__ */ h(Un, {}),
|
|
2402
|
-
/* @__PURE__ */ h(jn, {}),
|
|
2403
|
-
/* @__PURE__ */ h(Zn, {}),
|
|
2404
|
-
/* @__PURE__ */ h(pn, {}),
|
|
2407
|
+
/* @__PURE__ */ h(Pn, { isHeadingOneFirst: r }),
|
|
2408
|
+
/* @__PURE__ */ h(Rn, {}),
|
|
2409
|
+
/* @__PURE__ */ h(tr, { toolbarGap: n }),
|
|
2410
|
+
/* @__PURE__ */ h(Et, {}),
|
|
2411
|
+
/* @__PURE__ */ h(At, {}),
|
|
2412
|
+
/* @__PURE__ */ h(ir, {}),
|
|
2405
2413
|
/* @__PURE__ */ h(or, {}),
|
|
2406
|
-
/* @__PURE__ */ h(
|
|
2407
|
-
/* @__PURE__ */ h(
|
|
2408
|
-
/* @__PURE__ */ h(
|
|
2409
|
-
/* @__PURE__ */ h(Cn, {})
|
|
2414
|
+
/* @__PURE__ */ h(Zn, {}),
|
|
2415
|
+
/* @__PURE__ */ h(Qn, {}),
|
|
2416
|
+
/* @__PURE__ */ h(Xn, { onImageUpload: i }),
|
|
2417
|
+
/* @__PURE__ */ h(Cn, {}),
|
|
2418
|
+
/* @__PURE__ */ h(ar, {}),
|
|
2419
|
+
/* @__PURE__ */ h(lr, {}),
|
|
2420
|
+
/* @__PURE__ */ h(yn, { onChange: a }),
|
|
2421
|
+
/* @__PURE__ */ h(cr, { editorRef: e }),
|
|
2422
|
+
/* @__PURE__ */ h(En, {})
|
|
2410
2423
|
] });
|
|
2411
2424
|
}
|
|
2412
2425
|
export {
|
|
2413
|
-
|
|
2426
|
+
Or as default
|
|
2414
2427
|
};
|
|
2415
2428
|
//# sourceMappingURL=index.es.js.map
|