lexical-medium-editor 1.2.13 → 1.2.15

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.
@@ -1,42 +1,42 @@
1
1
  import './lexical-medium-editor.css';
2
- import { jsxs as I, Fragment as be, jsx as a } from "react/jsx-runtime";
3
- import { AutoFocusPlugin as we } from "@lexical/react/LexicalAutoFocusPlugin";
2
+ import { jsxs as $, Fragment as Ie, jsx as l } from "react/jsx-runtime";
3
+ import { AutoFocusPlugin as Fe } from "@lexical/react/LexicalAutoFocusPlugin";
4
4
  import { LexicalComposer as Ke } from "@lexical/react/LexicalComposer";
5
- import { RichTextPlugin as Fe } from "@lexical/react/LexicalRichTextPlugin";
6
- import { HistoryPlugin as We } from "@lexical/react/LexicalHistoryPlugin";
7
- import { LexicalErrorBoundary as Ge } from "@lexical/react/LexicalErrorBoundary";
8
- import { useLexicalComposerContext as p } from "@lexical/react/LexicalComposerContext";
9
- import { createCommand as _, $getSelection as N, $isRangeSelection as f, $createParagraphNode as F, COMMAND_PRIORITY_HIGH as m, $getRoot as U, CLICK_COMMAND as ze, COMMAND_PRIORITY_LOW as Le, TextNode as W, $isParagraphNode as B, $getCharacterOffsets as qe, FORMAT_TEXT_COMMAND as J, SELECTION_CHANGE_COMMAND as A, BLUR_COMMAND as ie, $getNodeByKey as G, $isLineBreakNode as w, $getPreviousSelection as Y, KEY_BACKSPACE_COMMAND as se, $isNodeSelection as ae, PASTE_COMMAND as Ue, $setSelection as Me, KEY_ARROW_RIGHT_COMMAND as Ye, $getAdjacentNode as oe, $createTextNode as Qe, COMMAND_PRIORITY_NORMAL as je, KEY_ENTER_COMMAND as Xe, $isTextNode as Ve, ParagraphNode as Ze, $createLineBreakNode as Je, KEY_TAB_COMMAND as et } from "lexical";
10
- import { useEffect as u, useState as b, useRef as z, useLayoutEffect as tt } from "react";
11
- import { createPortal as le } from "react-dom";
12
- import { $findMatchingParent as E, $dfs as nt } from "@lexical/utils";
13
- import { Toolbar as ce, TextField as ot, Input as Ie, Group as K, Button as v, ToggleButton as H, Separator as ue, ComboBox as rt, Popover as $e, ListBox as it, ListBoxItem as st, DialogTrigger as at, FileTrigger as lt } from "react-aria-components";
14
- import { IconCheck as ct, IconX as dt, IconBold as ut, IconItalic as gt, IconCode as ft, IconTextSize as mt, IconBlockquote as ht, IconLink as Nt, IconCaretDownFilled as Ct, IconPlus as pt, IconPhoto as Tt, IconCodePlus as Et, IconLineDashed as bt } from "@tabler/icons-react";
15
- import { $isAtNodeEnd as ge, $setBlocksType as Se, createDOMRange as Lt } from "@lexical/selection";
16
- import { $createHeadingNode as xe, HeadingNode as Mt, $createQuoteNode as It, $isHeadingNode as re, $isQuoteNode as $t } from "@lexical/rich-text";
17
- import { $toggleLink as St, $isLinkNode as xt } from "@lexical/link";
18
- import { $isListNode as yt, $isListItemNode as fe, $insertList as me } from "@lexical/list";
19
- import { $ as k, a as R, b as D, H as Ot, c as vt, I as he, d as Ne, e as Pt, M as Q, f as Dt, g as ee, h as O, i as At, j as te } from "./ImageNode-BhH71HMX.js";
20
- import { $isCodeNode as j, getCodeLanguages as _t, getLanguageFriendlyName as ne, registerCodeHighlighting as kt, $createCodeNode as Ce } from "@lexical/code";
21
- import { NodeEventPlugin as de } from "@lexical/react/LexicalNodeEventPlugin";
22
- import { ListPlugin as Bt } from "@lexical/react/LexicalListPlugin";
23
- import { OnChangePlugin as Ht } from "@lexical/react/LexicalOnChangePlugin";
24
- import { ContentEditable as Rt } from "@lexical/react/LexicalContentEditable";
25
- import { ClearEditorPlugin as wt } from "@lexical/react/LexicalClearEditorPlugin";
26
- const $ = -1e3;
5
+ import { RichTextPlugin as We } from "@lexical/react/LexicalRichTextPlugin";
6
+ import { HistoryPlugin as Ge } from "@lexical/react/LexicalHistoryPlugin";
7
+ import { LexicalErrorBoundary as ze } from "@lexical/react/LexicalErrorBoundary";
8
+ import { useLexicalComposerContext as b } from "@lexical/react/LexicalComposerContext";
9
+ import { createCommand as _, $getSelection as T, $isRangeSelection as N, $createParagraphNode as G, COMMAND_PRIORITY_HIGH as h, $getRoot as j, CLICK_COMMAND as qe, COMMAND_PRIORITY_LOW as Se, TextNode as z, $isParagraphNode as R, $getCharacterOffsets as Ue, FORMAT_TEXT_COMMAND as oe, SELECTION_CHANGE_COMMAND as A, BLUR_COMMAND as J, $getNodeByKey as q, $isLineBreakNode as K, $getPreviousSelection as X, KEY_BACKSPACE_COMMAND as ce, $isNodeSelection as de, PASTE_COMMAND as Ye, $setSelection as $e, KEY_ARROW_RIGHT_COMMAND as Qe, $getAdjacentNode as ae, $createTextNode as je, COMMAND_PRIORITY_NORMAL as Xe, KEY_ENTER_COMMAND as Ve, $isTextNode as Ze, ParagraphNode as Je, $createLineBreakNode as et, KEY_TAB_COMMAND as tt } from "lexical";
10
+ import { useEffect as u, useState as M, useRef as U, useLayoutEffect as nt, useCallback as Y } from "react";
11
+ import { createPortal as ue } from "react-dom";
12
+ import { $findMatchingParent as I, $dfs as ot } from "@lexical/utils";
13
+ import { Toolbar as ge, TextField as rt, Input as xe, Group as W, Button as B, ToggleButton as w, Separator as me, ComboBox as it, Popover as ve, ListBox as st, ListBoxItem as at, DialogTrigger as lt, FileTrigger as ct } from "react-aria-components";
14
+ import { IconCheck as dt, IconX as ut, IconBold as gt, IconItalic as ft, IconCode as mt, IconTextSize as ht, IconBlockquote as Nt, IconLink as Ct, IconCaretDownFilled as pt, IconPlus as Tt, IconPhoto as Et, IconCodePlus as bt, IconLineDashed as Lt } from "@tabler/icons-react";
15
+ import { $isAtNodeEnd as he, $setBlocksType as ye, createDOMRange as Mt } from "@lexical/selection";
16
+ import { $createHeadingNode as Oe, HeadingNode as It, $createQuoteNode as St, $isHeadingNode as le, $isQuoteNode as $t } from "@lexical/rich-text";
17
+ import { $toggleLink as xt, $isLinkNode as vt } from "@lexical/link";
18
+ import { $isListNode as yt, $isListItemNode as Ne, $insertList as Ce } from "@lexical/list";
19
+ import { $ as H, a as F, b as k, H as Ot, c as Pt, I as pe, d as Te, e as Bt, M as V, f as Dt, g as re, h as P, i as kt, j as ie } from "./ImageNode-BhH71HMX.js";
20
+ import { $isCodeNode as Z, getCodeLanguages as At, getLanguageFriendlyName as se, registerCodeHighlighting as _t, $createCodeNode as Ee } from "@lexical/code";
21
+ import { NodeEventPlugin as fe } from "@lexical/react/LexicalNodeEventPlugin";
22
+ import { ListPlugin as Ht } from "@lexical/react/LexicalListPlugin";
23
+ import { OnChangePlugin as Rt } from "@lexical/react/LexicalOnChangePlugin";
24
+ import { ContentEditable as wt } from "@lexical/react/LexicalContentEditable";
25
+ import { ClearEditorPlugin as Ft } from "@lexical/react/LexicalClearEditorPlugin";
26
+ const x = -1e3;
27
27
  function Kt(e, s, t = 0) {
28
28
  if (!s || !s.current)
29
29
  return console.error("Invalid popover reference"), {
30
- x: $,
31
- y: $
30
+ x,
31
+ y: x
32
32
  };
33
- const n = s.current, { x: i, y: o } = e, { width: r, height: c } = n.getBoundingClientRect(), l = i - r / 2, d = o - c - t;
33
+ const n = s.current, { x: i, y: o } = e, { width: r, height: c } = n.getBoundingClientRect(), a = i - r / 2, d = o - c - t;
34
34
  return {
35
- x: l,
35
+ x: a,
36
36
  y: d
37
37
  };
38
38
  }
39
- function Ft(e) {
39
+ function Wt(e) {
40
40
  if (!e || typeof e.getBoundingClientRect != "function")
41
41
  return console.error("Invalid DOM range"), null;
42
42
  const s = e.getBoundingClientRect(), t = s.left + s.width / 2, n = s.top + window.scrollY;
@@ -45,50 +45,50 @@ function Ft(e) {
45
45
  y: n
46
46
  };
47
47
  }
48
- function Wt(e, s, t = 0) {
48
+ function Gt(e, s, t = 0) {
49
49
  if (!s || !s.current)
50
50
  return console.error("Invalid popover reference"), {
51
- x: $,
52
- y: $
51
+ x,
52
+ y: x
53
53
  };
54
- const { x: n, y: i } = e, o = s.current, { width: r, height: c } = o.getBoundingClientRect(), l = n - r - t, d = i - c / 2;
54
+ const { x: n, y: i } = e, o = s.current, { width: r, height: c } = o.getBoundingClientRect(), a = n - r - t, d = i - c / 2;
55
55
  return {
56
- x: l,
56
+ x: a,
57
57
  y: d
58
58
  };
59
59
  }
60
- function Gt(e, s, t = 16, n = 12) {
60
+ function zt(e, s, t = 16, n = 12) {
61
61
  if (!s || !s.current)
62
62
  return console.error("Invalid popover reference"), {
63
- x: $,
64
- y: $
63
+ x,
64
+ y: x
65
65
  };
66
- const i = s.current, { x: o, y: r } = e, { width: c } = i.getBoundingClientRect(), l = o - c - t, d = r + n;
66
+ const i = s.current, { x: o, y: r } = e, { width: c } = i.getBoundingClientRect(), a = o - c - t, d = r + n;
67
67
  return {
68
- x: l,
68
+ x: a,
69
69
  y: d
70
70
  };
71
71
  }
72
- const ye = _("TOGGLE_HEADING_COMMAND"), Oe = _("TOGGLE_QUOTE_COMMAND"), ve = _("TOGGLE_LINK_COMMAND");
73
- function X(e) {
72
+ const Pe = _("TOGGLE_HEADING_COMMAND"), Be = _("TOGGLE_QUOTE_COMMAND"), De = _("TOGGLE_LINK_COMMAND");
73
+ function ee(e) {
74
74
  const s = e.anchor, t = e.focus, n = e.anchor.getNode(), i = e.focus.getNode();
75
- return n === i ? n : e.isBackward() ? ge(t) ? n : i : ge(s) ? n : i;
75
+ return n === i ? n : e.isBackward() ? he(t) ? n : i : he(s) ? n : i;
76
76
  }
77
- function pe(e) {
78
- const s = E(e, re);
77
+ function be(e) {
78
+ const s = I(e, le);
79
79
  return s ? s.getTag() : null;
80
80
  }
81
- function zt(e) {
81
+ function qt(e) {
82
82
  const s = {
83
83
  isHeadingOne: !1,
84
84
  isHeadingTwo: !1,
85
85
  isHeadingThree: !1
86
86
  }, t = e.getNodes();
87
87
  if (!t.length) return s;
88
- const n = pe(t[0]);
88
+ const n = be(t[0]);
89
89
  if (!n) return s;
90
90
  if (t.every(
91
- (o) => pe(o) === n
91
+ (o) => be(o) === n
92
92
  )) {
93
93
  const o = {
94
94
  h1: "isHeadingOne",
@@ -99,35 +99,35 @@ function zt(e) {
99
99
  }
100
100
  return s;
101
101
  }
102
- function qt() {
103
- const [e] = p();
102
+ function Ut() {
103
+ const [e] = b();
104
104
  return u(() => e.registerCommand(
105
- ye,
105
+ Pe,
106
106
  (t) => {
107
- const { isHeadingOne: n, isHeadingTwo: i, isHeadingThree: o } = t, r = N();
108
- if (f(r)) {
107
+ const { isHeadingOne: n, isHeadingTwo: i, isHeadingThree: o } = t, r = T();
108
+ if (N(r)) {
109
109
  let c;
110
- n || i ? c = "h3" : o ? c = null : c = "h2", Se(
110
+ n || i ? c = "h3" : o ? c = null : c = "h2", ye(
111
111
  r,
112
- () => c ? xe(c) : F()
112
+ () => c ? Oe(c) : G()
113
113
  );
114
114
  }
115
115
  return !0;
116
116
  },
117
- m
117
+ h
118
118
  ), [e]), null;
119
119
  }
120
- function Ut() {
121
- const [e] = p();
120
+ function Yt() {
121
+ const [e] = b();
122
122
  return u(() => {
123
123
  const s = e.registerNodeTransform(
124
- Mt,
124
+ It,
125
125
  (t) => {
126
126
  if (t.getTag() !== "h2")
127
127
  return;
128
- const i = U().getFirstChild();
128
+ const i = j().getFirstChild();
129
129
  if (i !== null && t.is(i)) {
130
- const o = t.getChildren(), r = xe("h1");
130
+ const o = t.getChildren(), r = Oe("h1");
131
131
  r.append(...o), t.replace(r);
132
132
  }
133
133
  }
@@ -137,109 +137,109 @@ function Ut() {
137
137
  };
138
138
  }, [e]), null;
139
139
  }
140
- function Yt(e) {
141
- return E(e, $t);
142
- }
143
140
  function Qt(e) {
141
+ return I(e, $t);
142
+ }
143
+ function jt(e) {
144
144
  const s = e.getNodes();
145
- return s.length ? s.length > 0 && s.every((t) => Yt(t)) : !1;
145
+ return s.length ? s.length > 0 && s.every((t) => Qt(t)) : !1;
146
146
  }
147
- function jt() {
148
- const [e] = p();
147
+ function Xt() {
148
+ const [e] = b();
149
149
  return u(() => e.registerCommand(
150
- Oe,
150
+ Be,
151
151
  (t) => {
152
- const n = N();
153
- return f(n) && Se(
152
+ const n = T();
153
+ return N(n) && ye(
154
154
  n,
155
- () => t.isQuote ? F() : It()
155
+ () => t.isQuote ? G() : St()
156
156
  ), !0;
157
157
  },
158
- m
158
+ h
159
159
  ), [e]), null;
160
160
  }
161
- function Pe(e) {
162
- if (!f(e))
161
+ function ke(e) {
162
+ if (!N(e))
163
163
  return null;
164
- const s = X(e);
165
- return E(s, xt);
164
+ const s = ee(e);
165
+ return I(s, vt);
166
166
  }
167
- function Xt() {
168
- const [e] = p();
167
+ function Vt() {
168
+ const [e] = b();
169
169
  return u(() => e.registerCommand(
170
- ze,
170
+ qe,
171
171
  (t) => {
172
- const n = N(), i = Pe(n);
172
+ const n = T(), i = ke(n);
173
173
  return i && (t.metaKey || t.ctrlKey) ? (window.open(i.getURL(), "_blank"), !0) : !1;
174
174
  },
175
- Le
175
+ Se
176
176
  ), [e]), u(() => e.registerCommand(
177
- ve,
178
- (t) => (St(t), !0),
179
- m
177
+ De,
178
+ (t) => (xt(t), !0),
179
+ h
180
180
  ), [e]), null;
181
181
  }
182
- function Vt() {
183
- const [e] = p(), s = "heading-above";
182
+ function Zt() {
183
+ const [e] = b(), s = "heading-above";
184
184
  return u(() => e.registerNodeTransform(
185
- W,
185
+ z,
186
186
  (n) => {
187
- const i = E(n, B) || E(n, yt);
188
- if (!i || re(i))
187
+ const i = I(n, R) || I(n, yt);
188
+ if (!i || le(i))
189
189
  return;
190
190
  const o = i, r = e.getElementByKey(o.getKey());
191
191
  if (!r)
192
192
  return;
193
- const c = o.getPreviousSibling(), l = re(c), d = r.classList.contains(s);
194
- l && !d ? r.classList.add(s) : !l && d && r.classList.remove(s);
193
+ const c = o.getPreviousSibling(), a = le(c), d = r.classList.contains(s);
194
+ a && !d ? r.classList.add(s) : !a && d && r.classList.remove(s);
195
195
  }
196
196
  ), [e]), null;
197
197
  }
198
- function Zt({ isHeadingOneFirst: e }) {
199
- return /* @__PURE__ */ I(be, { children: [
200
- /* @__PURE__ */ a(qt, {}),
201
- e && /* @__PURE__ */ a(Ut, {}),
202
- /* @__PURE__ */ a(jt, {}),
203
- /* @__PURE__ */ a(Xt, {}),
204
- /* @__PURE__ */ a(Vt, {})
198
+ function Jt({ isHeadingOneFirst: e }) {
199
+ return /* @__PURE__ */ $(Ie, { children: [
200
+ /* @__PURE__ */ l(Ut, {}),
201
+ e && /* @__PURE__ */ l(Yt, {}),
202
+ /* @__PURE__ */ l(Xt, {}),
203
+ /* @__PURE__ */ l(Vt, {}),
204
+ /* @__PURE__ */ l(Zt, {})
205
205
  ] });
206
206
  }
207
- function Jt({ style: e, closeToolbar: s, existingLinkURL: t }) {
208
- const [n] = p(), [i, o] = b(t);
209
- return /* @__PURE__ */ I(ce, { style: e, "aria-details": "link toolbar", id: "link-toolbar", children: [
210
- /* @__PURE__ */ a(
211
- ot,
207
+ function en({ style: e, closeToolbar: s, existingLinkURL: t }) {
208
+ const [n] = b(), [i, o] = M(t);
209
+ return /* @__PURE__ */ $(ge, { style: e, "aria-details": "link toolbar", id: "link-toolbar", children: [
210
+ /* @__PURE__ */ l(
211
+ rt,
212
212
  {
213
213
  "aria-label": "url",
214
214
  autoFocus: !0,
215
215
  defaultValue: i,
216
216
  onChange: o,
217
- children: /* @__PURE__ */ a(Ie, { placeholder: "Enter Link" })
217
+ children: /* @__PURE__ */ l(xe, { placeholder: "Enter Link" })
218
218
  }
219
219
  ),
220
- /* @__PURE__ */ I(K, { "aria-label": "edit link", children: [
221
- /* @__PURE__ */ a(
222
- v,
220
+ /* @__PURE__ */ $(W, { "aria-label": "edit link", children: [
221
+ /* @__PURE__ */ l(
222
+ B,
223
223
  {
224
224
  "aria-label": "Update link",
225
225
  onPress: () => {
226
226
  const r = i === "" ? null : i;
227
- n.dispatchCommand(ve, r), s();
227
+ n.dispatchCommand(De, r), s();
228
228
  },
229
- children: /* @__PURE__ */ a(ct, { size: y })
229
+ children: /* @__PURE__ */ l(dt, { size: O })
230
230
  }
231
231
  ),
232
- /* @__PURE__ */ a(v, { "aria-label": "Discard changes", onPress: s, children: /* @__PURE__ */ a(dt, { size: y }) })
232
+ /* @__PURE__ */ l(B, { "aria-label": "Discard changes", onPress: s, children: /* @__PURE__ */ l(ut, { size: O }) })
233
233
  ] }),
234
- /* @__PURE__ */ a("div", { className: "inline-toolbar-pointer" })
234
+ /* @__PURE__ */ l("div", { className: "inline-toolbar-pointer" })
235
235
  ] });
236
236
  }
237
- const y = 24, en = 16;
238
- function tn({ editor: e }) {
239
- const [s, t] = b(null), [n, i] = b({
240
- x: $,
241
- y: $
242
- }), o = z(null), [r, c] = b({
237
+ const O = 24, tn = 16;
238
+ function nn({ editor: e }) {
239
+ const [s, t] = M(null), [n, i] = M({
240
+ x,
241
+ y: x
242
+ }), o = U(null), [r, c] = M({
243
243
  isBold: !1,
244
244
  isItalic: !1,
245
245
  isCode: !1,
@@ -247,50 +247,50 @@ function tn({ editor: e }) {
247
247
  isHeadingTwo: !1,
248
248
  isHeadingThree: !1,
249
249
  isQuote: !1
250
- }), [l, d] = b(!1), [C, h] = b(0), [L, x] = b(""), T = (g) => {
251
- if (f(g)) {
250
+ }), [a, d] = M(!1), [E, m] = M(0), [L, C] = M(""), f = (g) => {
251
+ if (N(g)) {
252
252
  c({
253
253
  isBold: g.hasFormat("bold"),
254
254
  isItalic: g.hasFormat("italic"),
255
255
  isCode: g.hasFormat("code"),
256
- isQuote: Qt(g)
256
+ isQuote: jt(g)
257
257
  });
258
- const M = zt(g);
259
- c((P) => ({
260
- ...P,
261
- ...M
258
+ const p = qt(g);
259
+ c((v) => ({
260
+ ...v,
261
+ ...p
262
262
  }));
263
- const S = Pe(g);
264
- x(S ? S.getURL() : "");
263
+ const S = ke(g);
264
+ C(S ? S.getURL() : "");
265
265
  }
266
266
  };
267
267
  return u(() => {
268
268
  e.read(() => {
269
- const g = N();
270
- T(g);
269
+ const g = T();
270
+ f(g);
271
271
  });
272
272
  }, [e]), u(() => e.registerUpdateListener(
273
- ({ editorState: M }) => {
274
- M.read(() => {
275
- const S = N();
276
- T(S);
273
+ ({ editorState: p }) => {
274
+ p.read(() => {
275
+ const S = T();
276
+ f(S);
277
277
  });
278
278
  }
279
279
  ), [e]), u(() => {
280
280
  e.read(() => {
281
- const g = N();
282
- if (f(g)) {
283
- const [M, S] = g.getStartEndPoints(), [P, V] = [
284
- M.getNode(),
281
+ const g = T();
282
+ if (N(g)) {
283
+ const [p, S] = g.getStartEndPoints(), [v, D] = [
284
+ p.getNode(),
285
285
  S.getNode()
286
- ], [Z, He] = qe(g), Re = Lt(
286
+ ], [y, te] = Ue(g), ne = Mt(
287
287
  e,
288
- P,
289
- Z,
290
- V,
291
- He
288
+ v,
289
+ y,
290
+ D,
291
+ te
292
292
  );
293
- t(Ft(Re));
293
+ t(Wt(ne));
294
294
  }
295
295
  });
296
296
  }, [e, r]), u(() => {
@@ -299,33 +299,33 @@ function tn({ editor: e }) {
299
299
  Kt(
300
300
  s,
301
301
  o,
302
- en
302
+ tn
303
303
  )
304
304
  ), setTimeout(() => {
305
- var M;
306
- (M = o.current) == null || M.classList.add("visible");
305
+ var p;
306
+ (p = o.current) == null || p.classList.add("visible");
307
307
  }, 50)) : (g = o.current) == null || g.classList.remove("visible");
308
- }, [s]), tt(() => {
308
+ }, [s]), nt(() => {
309
309
  if (o.current) {
310
- const g = window.getComputedStyle(o.current), M = parseFloat(g.width);
311
- h(M);
310
+ const g = window.getComputedStyle(o.current), p = parseFloat(g.width);
311
+ m(p);
312
312
  }
313
- }, [s]), s && (l ? /* @__PURE__ */ a(
314
- Jt,
313
+ }, [s]), s && (a ? /* @__PURE__ */ l(
314
+ en,
315
315
  {
316
316
  style: {
317
317
  position: "absolute",
318
318
  top: n.y,
319
319
  left: n.x,
320
- width: C
320
+ width: E
321
321
  },
322
322
  closeToolbar: () => {
323
323
  d(!1), t(null);
324
324
  },
325
325
  existingLinkURL: L
326
326
  }
327
- ) : /* @__PURE__ */ I(
328
- ce,
327
+ ) : /* @__PURE__ */ $(
328
+ ge,
329
329
  {
330
330
  style: {
331
331
  position: "absolute",
@@ -336,119 +336,120 @@ function tn({ editor: e }) {
336
336
  id: "inline-toolbar",
337
337
  ref: o,
338
338
  children: [
339
- /* @__PURE__ */ I(K, { "aria-label": "Style", children: [
340
- /* @__PURE__ */ a(
341
- H,
339
+ /* @__PURE__ */ $(W, { "aria-label": "Style", children: [
340
+ /* @__PURE__ */ l(
341
+ w,
342
342
  {
343
343
  "aria-label": "Bold",
344
344
  isSelected: r.isBold,
345
345
  isDisabled: r.isCode || r.isHeadingOne || r.isHeadingTwo || r.isHeadingThree,
346
- onChange: () => e.dispatchCommand(J, "bold"),
347
- children: /* @__PURE__ */ a(ut, { size: y })
346
+ onChange: () => e.dispatchCommand(oe, "bold"),
347
+ children: /* @__PURE__ */ l(gt, { size: O })
348
348
  }
349
349
  ),
350
- /* @__PURE__ */ a(
351
- H,
350
+ /* @__PURE__ */ l(
351
+ w,
352
352
  {
353
353
  "aria-label": "Italic",
354
354
  isSelected: r.isItalic,
355
355
  isDisabled: r.isCode || r.isHeadingOne,
356
- onChange: () => e.dispatchCommand(J, "italic"),
357
- children: /* @__PURE__ */ a(gt, { size: y })
356
+ onChange: () => e.dispatchCommand(oe, "italic"),
357
+ children: /* @__PURE__ */ l(ft, { size: O })
358
358
  }
359
359
  ),
360
- /* @__PURE__ */ a(
361
- H,
360
+ /* @__PURE__ */ l(
361
+ w,
362
362
  {
363
363
  "aria-label": "inline-code",
364
364
  isDisabled: r.isHeadingOne,
365
365
  isSelected: r.isCode,
366
- onChange: () => e.dispatchCommand(J, "code"),
367
- children: /* @__PURE__ */ a(ft, { size: y })
366
+ onChange: () => e.dispatchCommand(oe, "code"),
367
+ children: /* @__PURE__ */ l(mt, { size: O })
368
368
  }
369
369
  )
370
370
  ] }),
371
- /* @__PURE__ */ a(ue, { orientation: "vertical" }),
372
- /* @__PURE__ */ I(K, { "aria-label": "Text Blocks", children: [
373
- /* @__PURE__ */ a(
374
- H,
371
+ /* @__PURE__ */ l(me, { orientation: "vertical" }),
372
+ /* @__PURE__ */ $(W, { "aria-label": "Text Blocks", children: [
373
+ /* @__PURE__ */ l(
374
+ w,
375
375
  {
376
376
  "aria-label": "Heading",
377
377
  isSelected: r.isHeadingOne || r.isHeadingTwo || r.isHeadingThree,
378
- onChange: () => e.dispatchCommand(ye, r),
379
- children: /* @__PURE__ */ a(mt, { size: y })
378
+ onChange: () => e.dispatchCommand(Pe, r),
379
+ children: /* @__PURE__ */ l(ht, { size: O })
380
380
  }
381
381
  ),
382
- /* @__PURE__ */ a(
383
- H,
382
+ /* @__PURE__ */ l(
383
+ w,
384
384
  {
385
385
  "aria-label": "Quote",
386
386
  isSelected: r.isQuote,
387
- onChange: () => e.dispatchCommand(Oe, r),
388
- children: /* @__PURE__ */ a(ht, { size: y })
387
+ onChange: () => e.dispatchCommand(Be, r),
388
+ children: /* @__PURE__ */ l(Nt, { size: O })
389
389
  }
390
390
  )
391
391
  ] }),
392
- /* @__PURE__ */ a(ue, { orientation: "vertical" }),
393
- /* @__PURE__ */ a(K, { "aria-label": "Links", children: /* @__PURE__ */ a(
394
- v,
392
+ /* @__PURE__ */ l(me, { orientation: "vertical" }),
393
+ /* @__PURE__ */ l(W, { "aria-label": "Links", children: /* @__PURE__ */ l(
394
+ B,
395
395
  {
396
396
  onPress: () => d(!0),
397
397
  isDisabled: r.isHeadingOne,
398
- children: /* @__PURE__ */ a(Nt, { size: y })
398
+ children: /* @__PURE__ */ l(Ct, { size: O })
399
399
  }
400
400
  ) }),
401
- /* @__PURE__ */ a("div", { className: "inline-toolbar-pointer" })
401
+ /* @__PURE__ */ l("div", { className: "inline-toolbar-pointer" })
402
402
  ]
403
403
  }
404
404
  ));
405
405
  }
406
- const nn = document.body;
407
- function on() {
408
- const [e, s] = b(!1), [t] = p();
406
+ const on = document.body;
407
+ function rn() {
408
+ const [e, s] = M(!1), [t] = b();
409
409
  return u(() => t.registerCommand(
410
410
  A,
411
411
  () => {
412
- const i = N();
413
- if (!f(i) || i.isCollapsed())
412
+ const i = T();
413
+ if (!N(i) || i.isCollapsed())
414
414
  return s(!1), !1;
415
- const o = i.getNodes(), r = o.some((d) => k(d)), c = o.length === 1 && (R(o[0]) || E(o[0], D)), l = o.some(
416
- (d) => E(d, j)
415
+ const o = i.getNodes(), r = o.some((d) => H(d)), c = o.length === 1 && (F(o[0]) || I(o[0], k)), a = o.some(
416
+ (d) => I(d, Z)
417
417
  );
418
- return s(!r && !c && !l), !1;
418
+ return s(!r && !c && !a), !1;
419
419
  },
420
- m
420
+ h
421
421
  ), [t]), u(() => t.registerCommand(
422
- ie,
422
+ J,
423
423
  () => (setTimeout(() => {
424
424
  const i = document.getElementById("inline-toolbar"), o = document.getElementById("link-toolbar"), r = document.activeElement;
425
425
  i && (i === r || i.contains(r)) || o && (o === r || o.contains(r)) || s(!1);
426
426
  }, 0), !1),
427
- m
428
- ), [t]), e && le(/* @__PURE__ */ a(tn, { editor: t }), nn);
427
+ h
428
+ ), [t]), e && ue(/* @__PURE__ */ l(nn, { editor: t }), on);
429
429
  }
430
- function rn({ codeBlockCoords: e, codeNodeKey: s }) {
431
- const [t] = p(), [n, i] = b({
432
- x: $,
433
- y: $
434
- }), o = z(null), [r, c] = b(""), l = _t(), d = Array.from(
435
- new Set(l.map((h) => ne(h)))
436
- ), C = {};
437
- return l.forEach((h) => {
438
- const L = ne(h);
439
- C[L] || (C[L] = h);
430
+ function sn({ codeBlockCoords: e, codeNodeKey: s }) {
431
+ const [t] = b(), [n, i] = M({
432
+ x,
433
+ y: x
434
+ }), o = U(null), [r, c] = M(""), a = At(), d = Array.from(
435
+ new Set(a.map((m) => se(m)))
436
+ ), E = {};
437
+ return a.forEach((m) => {
438
+ const L = se(m);
439
+ E[L] || (E[L] = m);
440
440
  }), u(() => {
441
- i(Gt(e, o));
441
+ i(zt(e, o));
442
442
  }, [e]), u(() => {
443
443
  t.read(() => {
444
444
  if (s) {
445
- const L = G(s).getLanguage();
446
- c(ne(L));
445
+ const L = q(s).getLanguage();
446
+ c(se(L));
447
447
  }
448
448
  });
449
- }, [t, s]), /* @__PURE__ */ I(
450
- rt,
449
+ }, [t, s]), /* @__PURE__ */ $(
450
+ it,
451
451
  {
452
+ id: "code-highlight-menu",
452
453
  ref: o,
453
454
  style: {
454
455
  position: "absolute",
@@ -457,208 +458,235 @@ function rn({ codeBlockCoords: e, codeNodeKey: s }) {
457
458
  },
458
459
  "aria-label": "Code menu",
459
460
  inputValue: r,
460
- onInputChange: (h) => {
461
- const L = C[h];
462
- t.dispatchCommand(Ae, [
461
+ onInputChange: (m) => {
462
+ const L = E[m];
463
+ t.dispatchCommand(_e, [
463
464
  s,
464
465
  L
465
- ]), c(h);
466
+ ]), c(m);
466
467
  },
467
468
  children: [
468
- /* @__PURE__ */ I("div", { children: [
469
- /* @__PURE__ */ a(Ie, {}),
470
- /* @__PURE__ */ a(v, { children: /* @__PURE__ */ a(Ct, { size: 24 }) })
469
+ /* @__PURE__ */ $("div", { children: [
470
+ /* @__PURE__ */ l(xe, {}),
471
+ /* @__PURE__ */ l(B, { children: /* @__PURE__ */ l(pt, { size: 24 }) })
471
472
  ] }),
472
- /* @__PURE__ */ a($e, { children: /* @__PURE__ */ a(it, { children: d.map((h, L) => /* @__PURE__ */ a(st, { children: h }, L)) }) })
473
+ /* @__PURE__ */ l(ve, { children: /* @__PURE__ */ l(st, { children: d.map((m, L) => /* @__PURE__ */ l(at, { children: m }, L)) }) })
473
474
  ]
474
475
  }
475
476
  );
476
477
  }
477
- const sn = document.body, De = _(
478
+ const an = document.body, Ae = _(
478
479
  "INSERT_CODE_BLOCK_COMMAND"
479
- ), Ae = _(
480
+ ), _e = _(
480
481
  "SET_CODE_LANGUAGE_COMMAND"
481
482
  );
482
- function an() {
483
- const [e, s] = b(null), [t, n] = b(null), [i] = p();
484
- return u(() => i.registerCommand(
483
+ function ln() {
484
+ const [e, s] = M(null), [t, n] = M(null), [i, o] = M(!1), [r, c] = M(!1), [a] = b(), d = Y(() => {
485
+ s(null), n(null);
486
+ }, []), E = Y(() => {
487
+ const C = document.getElementById("code-highlight-menu"), f = document.activeElement;
488
+ return !!(C && f && (C === f || C.contains(f)));
489
+ }, []), m = Y(() => {
490
+ const C = E();
491
+ return c(C), C;
492
+ }, [E]), L = Y(() => {
493
+ const C = m();
494
+ o(!1), C || d();
495
+ }, [d, m]);
496
+ return u(() => a.registerCommand(
485
497
  A,
486
498
  () => {
487
- const r = N();
488
- if (!f(r))
489
- return s(null), !1;
490
- const c = X(r), l = E(c, j);
491
- if (l) {
492
- const C = i.getElementByKey(l.getKey()).getBoundingClientRect(), h = C.right, L = C.top + window.scrollY;
493
- s({ x: h, y: L }), n(l.getKey());
499
+ const f = m(), g = a.getRootElement();
500
+ if (g) {
501
+ const D = g === document.activeElement || g.contains(document.activeElement);
502
+ o((y) => y === D ? y : D);
503
+ }
504
+ const p = T();
505
+ if (!N(p))
506
+ return f || d(), !1;
507
+ const S = ee(p), v = I(S, Z);
508
+ if (v) {
509
+ const y = a.getElementByKey(v.getKey()).getBoundingClientRect(), te = y.right, ne = y.top + window.scrollY;
510
+ s({ x: te, y: ne }), n(v.getKey());
494
511
  } else
495
- s(null);
512
+ f || d();
496
513
  return !1;
497
514
  },
498
- m
499
- ), [i]), e && le(
500
- /* @__PURE__ */ a(rn, { codeBlockCoords: e, codeNodeKey: t }),
501
- sn
515
+ h
516
+ ), [a, m, d]), u(() => a.registerCommand(
517
+ J,
518
+ () => (setTimeout(L, 0), !1),
519
+ h
520
+ ), [a, L]), u(() => {
521
+ const C = () => {
522
+ o(!0), c(!1);
523
+ }, f = () => setTimeout(L, 0);
524
+ return a.registerRootListener((g, p) => {
525
+ g && (g.addEventListener("focus", C), g.addEventListener("blur", f)), p && (p.removeEventListener("focus", C), p.removeEventListener("blur", f));
526
+ });
527
+ }, [a, L]), e && (i || r) && ue(
528
+ /* @__PURE__ */ l(sn, { codeBlockCoords: e, codeNodeKey: t }),
529
+ an
502
530
  );
503
531
  }
504
- function ln() {
505
- const [e] = p();
506
- return u(() => kt(e), [e]), u(() => e.registerNodeTransform(W, (t) => {
532
+ function cn() {
533
+ const [e] = b();
534
+ return u(() => _t(e), [e]), u(() => e.registerNodeTransform(z, (t) => {
507
535
  if (!t.isSimpleText())
508
536
  return;
509
537
  const n = t.getTextContent();
510
538
  if (n.startsWith("``` ")) {
511
- const i = t.getPreviousSibling(), o = E(t, B), r = o !== null && o.getChildrenSize() === 1, c = w(i);
539
+ const i = t.getPreviousSibling(), o = I(t, R), r = o !== null && o.getChildrenSize() === 1, c = K(i);
512
540
  if (r || c) {
513
541
  if (n.length > 4)
514
542
  return;
515
- const l = Ce();
516
- t.replace(l), l.select();
517
- const d = l.getNextSibling();
518
- w(d) && d.remove();
543
+ const a = Ee();
544
+ t.replace(a), a.select();
545
+ const d = a.getNextSibling();
546
+ K(d) && d.remove();
519
547
  return;
520
548
  }
521
549
  }
522
550
  }), [e]), u(() => e.registerCommand(
523
- De,
551
+ Ae,
524
552
  () => {
525
- const t = Y();
526
- if (f(t)) {
527
- const n = Ce();
553
+ const t = X();
554
+ if (N(t)) {
555
+ const n = Ee();
528
556
  return t.insertNodes([n]), n.selectStart(), setTimeout(() => {
529
557
  e.focus();
530
558
  }, 0), !0;
531
559
  }
532
560
  return !1;
533
561
  },
534
- m
562
+ h
535
563
  ), [e]), u(() => e.registerCommand(
536
- Ae,
564
+ _e,
537
565
  (t) => {
538
- const [n, i] = t, o = G(n);
539
- return j(o) ? (o.setLanguage(i), !0) : !1;
566
+ const [n, i] = t, o = q(n);
567
+ return Z(o) ? (o.setLanguage(i), !0) : !1;
540
568
  },
541
- m
569
+ h
542
570
  ), [e]), u(() => e.registerCommand(
543
- se,
571
+ ce,
544
572
  (t) => {
545
- const n = N();
546
- if (!f(n) || !n.isCollapsed())
573
+ const n = T();
574
+ if (!N(n) || !n.isCollapsed())
547
575
  return !1;
548
- const i = n.anchor.getNode(), o = E(i, j);
576
+ const i = n.anchor.getNode(), o = I(i, Z);
549
577
  return o && n.anchor.offset === 0 && o.getTextContent() === "" ? (o.remove(), !0) : !1;
550
578
  },
551
- m
579
+ h
552
580
  ), [e]), null;
553
581
  }
554
- function cn() {
555
- return /* @__PURE__ */ I(be, { children: [
556
- /* @__PURE__ */ a(ln, {}),
557
- /* @__PURE__ */ a(an, {})
582
+ function dn() {
583
+ return /* @__PURE__ */ $(Ie, { children: [
584
+ /* @__PURE__ */ l(cn, {}),
585
+ /* @__PURE__ */ l(ln, {})
558
586
  ] });
559
587
  }
560
- const _e = _(
588
+ const He = _(
561
589
  "INSERT_HORIZONTAL_DIVIDER_COMMAND"
562
590
  );
563
- function dn() {
564
- const [e] = p();
591
+ function un() {
592
+ const [e] = b();
565
593
  return u(() => {
566
594
  if (!e.hasNodes([Ot]))
567
595
  throw new Error("HorizontalDividerNode not registered on editor");
568
596
  return e.registerCommand(
569
- _e,
597
+ He,
570
598
  () => {
571
- const t = Y();
572
- if (f(t)) {
573
- const n = vt();
599
+ const t = X();
600
+ if (N(t)) {
601
+ const n = Pt();
574
602
  t.insertNodes([n]);
575
603
  let i = n.getNextSibling() || n.getParent().getNextSibling();
576
- return i || (i = F(), n.insertAfter(i)), i.selectStart(), setTimeout(() => {
604
+ return i || (i = G(), n.insertAfter(i)), i.selectStart(), setTimeout(() => {
577
605
  e.focus();
578
606
  }, 0), !0;
579
607
  }
580
608
  return !1;
581
609
  },
582
- m
610
+ h
583
611
  );
584
612
  }, [e]), null;
585
613
  }
586
- const ke = _("INSERT_IMAGE_COMMAND"), Te = "selected";
587
- function un(e) {
614
+ const Re = _("INSERT_IMAGE_COMMAND"), Le = "selected";
615
+ function gn(e) {
588
616
  return e && e.type && e.type.startsWith("image/");
589
617
  }
590
- function gn() {
591
- const [e] = p(), s = z(null);
618
+ function fn() {
619
+ const [e] = b(), s = U(null);
592
620
  return u(() => {
593
- if (!e.hasNode(he))
621
+ if (!e.hasNode(pe))
594
622
  throw new Error("ImagePlugin: ImageNode not registered on editor");
595
623
  return e.registerCommand(
596
- ke,
624
+ Re,
597
625
  (n) => {
598
- const i = n, o = Y();
599
- if (f(o)) {
600
- const r = Ne(i);
626
+ const i = n, o = X();
627
+ if (N(o)) {
628
+ const r = Te(i);
601
629
  o.insertNodes([r]);
602
630
  let c = r.getNextSibling() || r.getParent().getNextSibling();
603
- return c || (c = F(), r.insertAfter(c)), r.select(), !0;
631
+ return c || (c = G(), r.insertAfter(c)), r.select(), !0;
604
632
  }
605
633
  return !1;
606
634
  },
607
- m
635
+ h
608
636
  );
609
637
  }, [e]), u(() => e.registerCommand(
610
638
  A,
611
639
  () => {
612
- s.current && (s.current.classList.remove(Te), s.current = null);
613
- const n = N();
614
- if (ae(n) && n.getNodes().length === 1) {
640
+ s.current && (s.current.classList.remove(Le), s.current = null);
641
+ const n = T();
642
+ if (de(n) && n.getNodes().length === 1) {
615
643
  const i = n.getNodes()[0];
616
- if (Pt(i)) {
644
+ if (Bt(i)) {
617
645
  const o = e.getElementByKey(i.getKey());
618
- o.classList.add(Te), s.current = o;
646
+ o.classList.add(Le), s.current = o;
619
647
  }
620
648
  }
621
649
  return !1;
622
650
  },
623
- Le
651
+ Se
624
652
  ), [e]), u(() => e.registerCommand(
625
- Ue,
653
+ Ye,
626
654
  (n) => {
627
655
  const i = n.clipboardData;
628
656
  if (!i)
629
657
  return !1;
630
- const r = Array.from(i.files).filter(un);
658
+ const r = Array.from(i.files).filter(gn);
631
659
  if (r.length === 1) {
632
660
  n.preventDefault();
633
- const c = r[0], l = N() || Y();
634
- if (!f(l))
661
+ const c = r[0], a = T() || X();
662
+ if (!N(a))
635
663
  return !1;
636
- const d = URL.createObjectURL(c), C = Ne(d);
637
- l.insertNodes([C]);
638
- let h = C.getNextSibling() || C.getParent().getNextSibling();
639
- return h || (h = F(), C.insertAfter(h)), C.select(), !0;
664
+ const d = URL.createObjectURL(c), E = Te(d);
665
+ a.insertNodes([E]);
666
+ let m = E.getNextSibling() || E.getParent().getNextSibling();
667
+ return m || (m = G(), E.insertAfter(m)), E.select(), !0;
640
668
  }
641
669
  return !1;
642
670
  },
643
- m
671
+ h
644
672
  ), [e]), // Make the Image selectable
645
- /* @__PURE__ */ a(
646
- de,
673
+ /* @__PURE__ */ l(
674
+ fe,
647
675
  {
648
- nodeType: he,
676
+ nodeType: pe,
649
677
  eventType: "click",
650
678
  eventListener: (t, n, i) => {
651
- G(i).select();
679
+ q(i).select();
652
680
  }
653
681
  }
654
682
  );
655
683
  }
656
- const q = 24;
657
- function fn() {
658
- const [e] = p();
659
- return /* @__PURE__ */ a(ce, { "aria-label": "Block toolbar", id: "block-toolbar", children: /* @__PURE__ */ I(K, { "aria-label": "Media", children: [
660
- /* @__PURE__ */ a(
661
- lt,
684
+ const Q = 24;
685
+ function mn() {
686
+ const [e] = b();
687
+ return /* @__PURE__ */ l(ge, { "aria-label": "Block toolbar", id: "block-toolbar", children: /* @__PURE__ */ $(W, { "aria-label": "Media", children: [
688
+ /* @__PURE__ */ l(
689
+ ct,
662
690
  {
663
691
  acceptedFileTypes: ["image/png", "image/jpeg", "image/gif"],
664
692
  onSelect: (t) => {
@@ -673,61 +701,61 @@ function fn() {
673
701
  i.onload = (o) => {
674
702
  var c;
675
703
  const r = (c = o.target) == null ? void 0 : c.result;
676
- typeof r == "string" ? e.dispatchCommand(ke, r) : alert("Failed to read file as Data URL.");
704
+ typeof r == "string" ? e.dispatchCommand(Re, r) : alert("Failed to read file as Data URL.");
677
705
  }, i.onerror = (o) => {
678
706
  console.error("Error reading file:", o), alert("Error reading file.");
679
707
  }, i.readAsDataURL(n);
680
708
  },
681
709
  allowsMultiple: !1,
682
- children: /* @__PURE__ */ a(v, { "aria-label": "image", children: /* @__PURE__ */ a(Tt, { size: q }) })
710
+ children: /* @__PURE__ */ l(B, { "aria-label": "image", children: /* @__PURE__ */ l(Et, { size: Q }) })
683
711
  }
684
712
  ),
685
- /* @__PURE__ */ a(
686
- v,
713
+ /* @__PURE__ */ l(
714
+ B,
687
715
  {
688
716
  "aria-label": "code block",
689
717
  onPress: () => {
690
- e.dispatchCommand(De, void 0);
718
+ e.dispatchCommand(Ae, void 0);
691
719
  },
692
- children: /* @__PURE__ */ a(Et, { size: q })
720
+ children: /* @__PURE__ */ l(bt, { size: Q })
693
721
  }
694
722
  ),
695
- /* @__PURE__ */ a(
696
- v,
723
+ /* @__PURE__ */ l(
724
+ B,
697
725
  {
698
726
  "aria-label": "horizontal divider",
699
727
  onPress: () => {
700
728
  e.dispatchCommand(
701
- _e,
729
+ He,
702
730
  void 0
703
731
  );
704
732
  },
705
- children: /* @__PURE__ */ a(bt, { size: q })
733
+ children: /* @__PURE__ */ l(Lt, { size: Q })
706
734
  }
707
735
  )
708
736
  ] }) });
709
737
  }
710
- function mn({
738
+ function hn({
711
739
  selectionRectCoords: e,
712
740
  TOOLBAR_OFFSET: s,
713
741
  toolbarTriggerId: t,
714
742
  toolbarPopoverId: n
715
743
  }) {
716
- const [i, o] = b({
717
- x: $,
718
- y: $
719
- }), r = z(null);
744
+ const [i, o] = M({
745
+ x,
746
+ y: x
747
+ }), r = U(null);
720
748
  return u(() => {
721
749
  o(
722
- Wt(
750
+ Gt(
723
751
  e,
724
752
  r,
725
753
  s
726
754
  )
727
755
  );
728
- }, [e]), /* @__PURE__ */ I(at, { children: [
729
- /* @__PURE__ */ a(
730
- v,
756
+ }, [e]), /* @__PURE__ */ $(lt, { children: [
757
+ /* @__PURE__ */ l(
758
+ B,
731
759
  {
732
760
  "aria-label": "Block toolbar trigger",
733
761
  className: "block-toolbar-trigger",
@@ -738,95 +766,95 @@ function mn({
738
766
  top: i.y,
739
767
  left: i.x
740
768
  },
741
- children: /* @__PURE__ */ a(pt, { size: q })
769
+ children: /* @__PURE__ */ l(Tt, { size: Q })
742
770
  }
743
771
  ),
744
- /* @__PURE__ */ a(
745
- $e,
772
+ /* @__PURE__ */ l(
773
+ ve,
746
774
  {
747
775
  className: "block-toolbar-popover",
748
776
  id: n,
749
777
  placement: "end",
750
778
  shouldFlip: !1,
751
779
  offset: s,
752
- children: /* @__PURE__ */ a(fn, {})
780
+ children: /* @__PURE__ */ l(mn, {})
753
781
  }
754
782
  )
755
783
  ] });
756
784
  }
757
- const hn = document.body;
758
- function Nn({ toolbarGap: e }) {
759
- const [s, t] = b(null), [n] = p(), [i, o] = b(!1), [r, c] = b(!1), l = z(Math.random().toString(36).substring(2, 9)), d = `block-toolbar-trigger-${l.current}`, C = `block-toolbar-popover-${l.current}`, h = () => o(!0), L = (x) => {
785
+ const Nn = document.body;
786
+ function Cn({ toolbarGap: e }) {
787
+ const [s, t] = M(null), [n] = b(), [i, o] = M(!1), [r, c] = M(!1), a = U(Math.random().toString(36).substring(2, 9)), d = `block-toolbar-trigger-${a.current}`, E = `block-toolbar-popover-${a.current}`, m = () => o(!0), L = (C) => {
760
788
  setTimeout(() => {
761
- const T = document.getElementById(d);
762
- T && (T === document.activeElement || T.contains(document.activeElement) || T.contains(x.relatedTarget)) || o(!1);
789
+ const f = document.getElementById(d);
790
+ f && (f === document.activeElement || f.contains(document.activeElement) || f.contains(C.relatedTarget)) || o(!1);
763
791
  }, 10);
764
792
  };
765
793
  return u(() => {
766
- const x = () => {
767
- const g = !!document.getElementById(C);
794
+ const C = () => {
795
+ const g = !!document.getElementById(E);
768
796
  c(g);
769
- }, T = new MutationObserver(x);
770
- return T.observe(document.body, {
797
+ }, f = new MutationObserver(C);
798
+ return f.observe(document.body, {
771
799
  childList: !0,
772
800
  subtree: !0
773
- }), x(), () => T.disconnect();
801
+ }), C(), () => f.disconnect();
774
802
  }, []), u(() => n.registerRootListener(
775
- (T, g) => {
776
- T && (T.addEventListener("focus", h), T.addEventListener("blur", L)), g && (g.removeEventListener("focus", h), g.removeEventListener("blur", L));
803
+ (f, g) => {
804
+ f && (f.addEventListener("focus", m), f.addEventListener("blur", L)), g && (g.removeEventListener("focus", m), g.removeEventListener("blur", L));
777
805
  }
778
806
  ), [n]), u(() => n.registerCommand(
779
807
  A,
780
808
  () => {
781
- const T = n.getRootElement();
782
- if (T) {
783
- const S = T === document.activeElement || T.contains(document.activeElement);
809
+ const f = n.getRootElement();
810
+ if (f) {
811
+ const S = f === document.activeElement || f.contains(document.activeElement);
784
812
  S !== i && o(S);
785
813
  }
786
- const g = N();
787
- if (!f(g) || !g.isCollapsed())
814
+ const g = T();
815
+ if (!N(g) || !g.isCollapsed())
788
816
  return t(null), !1;
789
- const M = X(g);
790
- if (B(M) && M.getTextContent() === "") {
791
- const P = n.getElementByKey(M.getKey()).getBoundingClientRect(), V = P.left, Z = P.top + P.height / 2 + window.scrollY;
792
- t({ x: V, y: Z });
817
+ const p = ee(g);
818
+ if (R(p) && p.getTextContent() === "") {
819
+ const v = n.getElementByKey(p.getKey()).getBoundingClientRect(), D = v.left, y = v.top + v.height / 2 + window.scrollY;
820
+ t({ x: D, y });
793
821
  } else
794
822
  t(null);
795
823
  return !1;
796
824
  },
797
- m
798
- ), [n]), s && (i || r) && le(
799
- /* @__PURE__ */ a(
800
- mn,
825
+ h
826
+ ), [n]), s && (i || r) && ue(
827
+ /* @__PURE__ */ l(
828
+ hn,
801
829
  {
802
830
  selectionRectCoords: s,
803
831
  TOOLBAR_OFFSET: e,
804
832
  toolbarTriggerId: d,
805
- toolbarPopoverId: C
833
+ toolbarPopoverId: E
806
834
  }
807
835
  ),
808
- hn
836
+ Nn
809
837
  );
810
838
  }
811
- const Cn = [
839
+ const pn = [
812
840
  ["$", "$"],
813
841
  ["\\(", "\\)"]
814
- ], pn = [
842
+ ], Tn = [
815
843
  ["$$", "$$"],
816
844
  ["\\[", "\\]"]
817
- ], Ee = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), Be = (e, s) => {
845
+ ], Me = (e) => e.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), we = (e, s) => {
818
846
  let t = null;
819
847
  for (const [n, i] of s) {
820
848
  const r = new RegExp(
821
- `(.*?)(${Ee(n)})(.*?)(${Ee(i)})`,
849
+ `(.*?)(${Me(n)})(.*?)(${Me(i)})`,
822
850
  "g"
823
851
  ).exec(e);
824
852
  if (r) {
825
853
  const c = r[3];
826
854
  if (c && c.trim() !== "") {
827
- const l = r.index + r[1].length, d = r.index + r[0].length;
828
- (!t || l < t.start) && (t = {
829
- start: l,
855
+ const a = r.index + r[1].length, d = r.index + r[0].length;
856
+ (!t || a < t.start) && (t = {
857
+ start: a,
830
858
  end: d,
831
859
  content: n + c + i
832
860
  });
@@ -835,59 +863,59 @@ const Cn = [
835
863
  }
836
864
  return t;
837
865
  };
838
- function Tn() {
839
- const [e] = p();
866
+ function En() {
867
+ const [e] = b();
840
868
  return u(() => {
841
- if (!e.hasNodes([Q, Dt]))
869
+ if (!e.hasNodes([V, Dt]))
842
870
  throw new Error(
843
871
  "MathInlinePlugin: MathNode or MathHighlightNodeInline not registered on editor"
844
872
  );
845
- }, [e]), u(() => e.registerNodeTransform(W, (t) => {
846
- if (!t.isSimpleText() || R(t) || E(t, D))
873
+ }, [e]), u(() => e.registerNodeTransform(z, (t) => {
874
+ if (!t.isSimpleText() || F(t) || I(t, k))
847
875
  return;
848
- const n = t.getTextContent(), i = Be(n, Cn);
876
+ const n = t.getTextContent(), i = we(n, pn);
849
877
  if (i) {
850
878
  const { start: o, end: r, content: c } = i;
851
- let l;
852
- const d = O(c, !0);
853
- return o === 0 ? ([l] = t.splitText(r), l.insertBefore(d), l.remove()) : ([, l] = t.splitText(o, r), l.replace(d)), d;
879
+ let a;
880
+ const d = P(c, !0);
881
+ return o === 0 ? ([a] = t.splitText(r), a.insertBefore(d), a.remove()) : ([, a] = t.splitText(o, r), a.replace(d)), d;
854
882
  }
855
883
  }), [e]), u(() => e.registerCommand(
856
884
  A,
857
885
  () => {
858
- const t = N(), n = /* @__PURE__ */ new Set();
859
- if (ae(t)) {
886
+ const t = T(), n = /* @__PURE__ */ new Set();
887
+ if (de(t)) {
860
888
  const r = t.getNodes();
861
- if (r.length === 1 && k(r[0])) {
889
+ if (r.length === 1 && H(r[0])) {
862
890
  const c = r[0];
863
891
  if (c.isInline()) {
864
- let l = c.getEquation();
865
- l.startsWith("$") && l.endsWith("$") ? l = l.slice(1, -1) : l.startsWith("\\(") && l.endsWith("\\)") && (l = l.slice(2, -2));
866
- const d = ee(l);
892
+ let a = c.getEquation();
893
+ a.startsWith("$") && a.endsWith("$") ? a = a.slice(1, -1) : a.startsWith("\\(") && a.endsWith("\\)") && (a = a.slice(2, -2));
894
+ const d = re(a);
867
895
  return c.replace(d), d.select(), !0;
868
896
  }
869
897
  }
870
- } else f(t) && t.getNodes().forEach((r) => n.add(r.getKey()));
871
- return U().getAllTextNodes().forEach((r) => {
872
- if (R(r) && !n.has(r.getKey())) {
898
+ } else N(t) && t.getNodes().forEach((r) => n.add(r.getKey()));
899
+ return j().getAllTextNodes().forEach((r) => {
900
+ if (F(r) && !n.has(r.getKey())) {
873
901
  let c = r.getTextContent();
874
902
  if (!c) {
875
903
  r.remove();
876
904
  return;
877
905
  }
878
- let l = !1;
879
- c.startsWith("$") && c.endsWith("$") && c.length >= 2 && (c = c.slice(1, -1), l = !0);
880
- const d = l ? O(`$$${c}$$`, !1) : O(`$${c}$`, !0);
906
+ let a = !1;
907
+ c.startsWith("$") && c.endsWith("$") && c.length >= 2 && (c = c.slice(1, -1), a = !0);
908
+ const d = a ? P(`$$${c}$$`, !1) : P(`$${c}$`, !0);
881
909
  r.replace(d);
882
910
  }
883
911
  }), !1;
884
912
  },
885
- m
913
+ h
886
914
  ), [e]), u(() => e.registerCommand(
887
- ie,
915
+ J,
888
916
  () => (e.update(() => {
889
- U().getAllTextNodes().forEach((n) => {
890
- if (R(n)) {
917
+ j().getAllTextNodes().forEach((n) => {
918
+ if (F(n)) {
891
919
  let i = n.getTextContent();
892
920
  if (!i) {
893
921
  n.remove();
@@ -895,219 +923,219 @@ function Tn() {
895
923
  }
896
924
  let o = !1;
897
925
  i.startsWith("$") && i.endsWith("$") && i.length >= 2 && (i = i.slice(1, -1), o = !0);
898
- const r = o ? O(`$$${i}$$`, !1) : O(`$${i}$`, !0);
899
- n.replace(r), Me(null);
926
+ const r = o ? P(`$$${i}$$`, !1) : P(`$${i}$`, !0);
927
+ n.replace(r), $e(null);
900
928
  }
901
929
  });
902
930
  }), !1),
903
- m
931
+ h
904
932
  ), [e]), u(() => e.registerCommand(
905
- Ye,
933
+ Qe,
906
934
  (s) => {
907
- const t = N();
908
- if (!f(t) || !t.isCollapsed())
935
+ const t = T();
936
+ if (!N(t) || !t.isCollapsed())
909
937
  return !1;
910
- const n = oe(t.anchor, !1);
911
- if (k(n) && n.isInline()) {
938
+ const n = ae(t.anchor, !1);
939
+ if (H(n) && n.isInline()) {
912
940
  let o = n.getEquation();
913
941
  o.startsWith("$") && o.endsWith("$") ? o = o.slice(1, -1) : o.startsWith("\\(") && o.endsWith("\\)") && (o = o.slice(2, -2));
914
- const r = ee(o);
942
+ const r = re(o);
915
943
  return n.replace(r), r.select(0, 0), !0;
916
944
  }
917
945
  return !1;
918
946
  },
919
- m
947
+ h
920
948
  ), [e]), u(() => e.registerCommand(
921
- se,
949
+ ce,
922
950
  (s) => {
923
- const t = N();
924
- if (!f(t) || !t.isCollapsed())
951
+ const t = T();
952
+ if (!N(t) || !t.isCollapsed())
925
953
  return !1;
926
- const n = oe(t.anchor, !0);
927
- if (k(n) && n.isInline()) {
954
+ const n = ae(t.anchor, !0);
955
+ if (H(n) && n.isInline()) {
928
956
  let o = n.getEquation();
929
957
  o.startsWith("$") && o.endsWith("$") ? o = o.slice(1, -1) : o.startsWith("\\(") && o.endsWith("\\)") && (o = o.slice(2, -2));
930
- const r = ee(o);
958
+ const r = re(o);
931
959
  return n.replace(r), r.select(), !0;
932
960
  }
933
961
  return !1;
934
962
  },
935
- m
963
+ h
936
964
  ), [e]), u(() => e.registerCommand(
937
965
  A,
938
966
  () => {
939
- const s = N();
940
- if (!f(s) || !s.isCollapsed())
967
+ const s = T();
968
+ if (!N(s) || !s.isCollapsed())
941
969
  return !1;
942
970
  const t = s.anchor.getNode();
943
- return R(t) && (t.getNextSibling() || t.insertAfter(Qe(" "))), !1;
971
+ return F(t) && (t.getNextSibling() || t.insertAfter(je(" "))), !1;
944
972
  },
945
- je
973
+ Xe
946
974
  ), [e]), // Register click event for MathNode
947
- /* @__PURE__ */ a(
948
- de,
975
+ /* @__PURE__ */ l(
976
+ fe,
949
977
  {
950
- nodeType: Q,
978
+ nodeType: V,
951
979
  eventType: "click",
952
980
  eventListener: (s, t, n) => {
953
- const i = G(n);
981
+ const i = q(n);
954
982
  i && i.isInline() && i.select();
955
983
  }
956
984
  }
957
985
  );
958
986
  }
959
- function En() {
960
- const [e] = p();
987
+ function bn() {
988
+ const [e] = b();
961
989
  return u(() => {
962
- if (!e.hasNodes([Q, At]))
990
+ if (!e.hasNodes([V, kt]))
963
991
  throw new Error(
964
992
  "MathBlockPlugin: MathNode or MathHighlightNodeBlock not registered on editor"
965
993
  );
966
- }, [e]), u(() => e.registerNodeTransform(W, (t) => {
967
- if (!t.isSimpleText() || E(t, D))
994
+ }, [e]), u(() => e.registerNodeTransform(z, (t) => {
995
+ if (!t.isSimpleText() || I(t, k))
968
996
  return;
969
997
  const n = t.getTextContent();
970
998
  if (n.startsWith("$$ ")) {
971
- const o = t.getPreviousSibling(), r = E(t, B), c = r !== null && r.getChildrenSize() === 1, l = w(o);
972
- if (c || l) {
999
+ const o = t.getPreviousSibling(), r = I(t, R), c = r !== null && r.getChildrenSize() === 1, a = K(o);
1000
+ if (c || a) {
973
1001
  if (n.length > 3)
974
1002
  return;
975
- const d = te("");
1003
+ const d = ie("");
976
1004
  t.replace(d), d.select();
977
- const C = d.getNextSibling();
978
- w(C) && C.remove();
1005
+ const E = d.getNextSibling();
1006
+ K(E) && E.remove();
979
1007
  return;
980
1008
  }
981
1009
  }
982
- const i = Be(n, pn);
1010
+ const i = we(n, Tn);
983
1011
  if (i) {
984
1012
  const { start: o, end: r, content: c } = i;
985
- let l;
986
- const d = O(c, !1);
987
- return o === 0 ? ([l] = t.splitText(r), l.insertBefore(d), l.remove()) : ([, l] = t.splitText(o, r), l.replace(d)), d;
1013
+ let a;
1014
+ const d = P(c, !1);
1015
+ return o === 0 ? ([a] = t.splitText(r), a.insertBefore(d), a.remove()) : ([, a] = t.splitText(o, r), a.replace(d)), d;
988
1016
  }
989
1017
  }), [e]), u(() => e.registerCommand(
990
1018
  A,
991
1019
  () => {
992
- const t = N(), n = /* @__PURE__ */ new Set();
993
- if (ae(t)) {
1020
+ const t = T(), n = /* @__PURE__ */ new Set();
1021
+ if (de(t)) {
994
1022
  const r = t.getNodes();
995
- if (r.length === 1 && k(r[0])) {
1023
+ if (r.length === 1 && H(r[0])) {
996
1024
  const c = r[0];
997
1025
  if (!c.isInline()) {
998
- let l = c.getEquation();
999
- (l.startsWith("$$") && l.endsWith("$$") || l.startsWith("\\[") && l.endsWith("\\]")) && (l = l.slice(2, -2));
1000
- const d = te(l);
1026
+ let a = c.getEquation();
1027
+ (a.startsWith("$$") && a.endsWith("$$") || a.startsWith("\\[") && a.endsWith("\\]")) && (a = a.slice(2, -2));
1028
+ const d = ie(a);
1001
1029
  return c.replace(d), d.select(), !0;
1002
1030
  }
1003
1031
  }
1004
- } else f(t) && t.getNodes().forEach((r) => {
1032
+ } else N(t) && t.getNodes().forEach((r) => {
1005
1033
  n.add(r.getKey());
1006
- const c = E(r, D);
1034
+ const c = I(r, k);
1007
1035
  c && n.add(c.getKey());
1008
1036
  });
1009
1037
  const o = e.getEditorState()._nodeMap;
1010
1038
  for (const [, r] of o)
1011
- if (D(r) && r.isAttached() && !n.has(r.getKey())) {
1039
+ if (k(r) && r.isAttached() && !n.has(r.getKey())) {
1012
1040
  const c = r.getTextContent();
1013
1041
  if (!c) {
1014
1042
  r.remove();
1015
1043
  continue;
1016
1044
  }
1017
- const l = O(`$$${c}$$`, !1);
1018
- r.replace(l);
1045
+ const a = P(`$$${c}$$`, !1);
1046
+ r.replace(a);
1019
1047
  }
1020
1048
  return !1;
1021
1049
  },
1022
- m
1050
+ h
1023
1051
  ), [e]), u(() => e.registerCommand(
1024
- ie,
1052
+ J,
1025
1053
  () => (e.update(() => {
1026
- const s = U();
1027
- nt(s).forEach(({ node: n }) => {
1028
- if (D(n)) {
1054
+ const s = j();
1055
+ ot(s).forEach(({ node: n }) => {
1056
+ if (k(n)) {
1029
1057
  const i = n.getTextContent();
1030
1058
  if (!i) {
1031
1059
  n.remove();
1032
1060
  return;
1033
1061
  }
1034
- const o = O(`$$${i}$$`, !1);
1035
- n.replace(o), Me(null);
1062
+ const o = P(`$$${i}$$`, !1);
1063
+ n.replace(o), $e(null);
1036
1064
  }
1037
1065
  });
1038
1066
  }), !1),
1039
- m
1067
+ h
1040
1068
  ), [e]), u(() => e.registerCommand(
1041
- Xe,
1069
+ Ve,
1042
1070
  () => {
1043
- const t = N();
1044
- if (!f(t))
1071
+ const t = T();
1072
+ if (!N(t))
1045
1073
  return !1;
1046
- const n = t.getNodes()[0], i = E(
1074
+ const n = t.getNodes()[0], i = I(
1047
1075
  n,
1048
- D
1076
+ k
1049
1077
  );
1050
1078
  if (!i)
1051
1079
  return !1;
1052
1080
  const o = i.getLastChild();
1053
- return t.isCollapsed() && (t.anchor.getNode().getKey() === i.getKey() && t.anchor.offset === 0 && i.getChildrenSize() === 0 || o && w(o) && t.anchor.getNode().getKey() === i.getKey() && t.anchor.offset === i.getChildrenSize() || o && Ve(o) && t.anchor.getNode().getKey() === o.getKey() && t.anchor.offset === o.getTextContent().length) ? !1 : (t.insertLineBreak(), !0);
1081
+ return t.isCollapsed() && (t.anchor.getNode().getKey() === i.getKey() && t.anchor.offset === 0 && i.getChildrenSize() === 0 || o && K(o) && t.anchor.getNode().getKey() === i.getKey() && t.anchor.offset === i.getChildrenSize() || o && Ze(o) && t.anchor.getNode().getKey() === o.getKey() && t.anchor.offset === o.getTextContent().length) ? !1 : (t.insertLineBreak(), !0);
1054
1082
  },
1055
- m
1083
+ h
1056
1084
  ), [e]), u(() => e.registerCommand(
1057
- se,
1085
+ ce,
1058
1086
  (s) => {
1059
- const t = N();
1060
- if (!f(t) || !t.isCollapsed())
1087
+ const t = T();
1088
+ if (!N(t) || !t.isCollapsed())
1061
1089
  return !1;
1062
- const n = oe(t.anchor, !0);
1063
- if (k(n) && !n.isInline()) {
1090
+ const n = ae(t.anchor, !0);
1091
+ if (H(n) && !n.isInline()) {
1064
1092
  let o = n.getEquation();
1065
1093
  (o.startsWith("$$") && o.endsWith("$$") || o.startsWith("\\[") && o.endsWith("\\]")) && (o = o.slice(2, -2));
1066
- const r = te(o);
1094
+ const r = ie(o);
1067
1095
  return n.replace(r), r.select(), !0;
1068
1096
  }
1069
1097
  return !1;
1070
1098
  },
1071
- m
1072
- ), [e]), /* @__PURE__ */ a(
1073
- de,
1099
+ h
1100
+ ), [e]), /* @__PURE__ */ l(
1101
+ fe,
1074
1102
  {
1075
- nodeType: Q,
1103
+ nodeType: V,
1076
1104
  eventType: "click",
1077
1105
  eventListener: (s, t, n) => {
1078
- const i = G(n);
1106
+ const i = q(n);
1079
1107
  i && !i.isInline() && i.select();
1080
1108
  }
1081
1109
  }
1082
1110
  );
1083
1111
  }
1084
- const bn = 3;
1085
- function Ln() {
1086
- const [e] = p();
1112
+ const Ln = 3;
1113
+ function Mn() {
1114
+ const [e] = b();
1087
1115
  return u(() => e.registerNodeTransform(
1088
- Ze,
1116
+ Je,
1089
1117
  (t) => {
1090
1118
  const n = t.getParent();
1091
- if (fe(n)) {
1092
- const i = Je();
1119
+ if (Ne(n)) {
1120
+ const i = et();
1093
1121
  t.replace(i), i.selectEnd();
1094
1122
  }
1095
1123
  }
1096
- ), [e]), u(() => e.registerNodeTransform(W, (t) => {
1097
- if (!E(t, B) || E(t, B).getFirstDescendant() !== t)
1124
+ ), [e]), u(() => e.registerNodeTransform(z, (t) => {
1125
+ if (!I(t, R) || I(t, R).getFirstDescendant() !== t)
1098
1126
  return;
1099
- const i = N();
1100
- if (f(i) && i.isCollapsed()) {
1127
+ const i = T();
1128
+ if (N(i) && i.isCollapsed()) {
1101
1129
  const r = i.anchor.offset;
1102
- t.getTextContent() === "1. " && r === 3 ? (me("number"), t.setTextContent("")) : t.getTextContent() === "- " && r === 2 && (me("bullet"), t.setTextContent(""));
1130
+ t.getTextContent() === "1. " && r === 3 ? (Ce("number"), t.setTextContent("")) : t.getTextContent() === "- " && r === 2 && (Ce("bullet"), t.setTextContent(""));
1103
1131
  }
1104
1132
  }), [e]), u(() => e.registerCommand(
1105
- et,
1133
+ tt,
1106
1134
  (t) => {
1107
- const n = N();
1108
- if (!f(n))
1135
+ const n = T();
1136
+ if (!N(n))
1109
1137
  return !1;
1110
- const i = X(n), o = E(i, fe);
1138
+ const i = ee(n), o = I(i, Ne);
1111
1139
  if (!o)
1112
1140
  return !1;
1113
1141
  const r = o.getIndent();
@@ -1116,17 +1144,17 @@ function Ln() {
1116
1144
  return !1;
1117
1145
  o.setIndent(r - 1);
1118
1146
  } else {
1119
- if (r > bn)
1147
+ if (r > Ln)
1120
1148
  return !1;
1121
1149
  o.setIndent(r + 1);
1122
1150
  }
1123
1151
  return !0;
1124
1152
  },
1125
- m
1153
+ h
1126
1154
  ), [e]), null;
1127
1155
  }
1128
- function Mn() {
1129
- const [e] = p(), s = (t) => {
1156
+ function In() {
1157
+ const [e] = b(), s = (t) => {
1130
1158
  t.key === "Tab" && t.preventDefault();
1131
1159
  };
1132
1160
  return u(() => e.registerRootListener(
@@ -1135,8 +1163,8 @@ function Mn() {
1135
1163
  }
1136
1164
  ), [e]), null;
1137
1165
  }
1138
- function In({ editorRef: e }) {
1139
- const [s] = p();
1166
+ function Sn({ editorRef: e }) {
1167
+ const [s] = b();
1140
1168
  return u(() => {
1141
1169
  if (e)
1142
1170
  return e.current = s, () => {
@@ -1144,7 +1172,7 @@ function In({ editorRef: e }) {
1144
1172
  };
1145
1173
  }, [s, e]), null;
1146
1174
  }
1147
- function jn({
1175
+ function Xn({
1148
1176
  initialConfig: e,
1149
1177
  onChange: s,
1150
1178
  editorRef: t,
@@ -1152,33 +1180,33 @@ function jn({
1152
1180
  spellCheck: i,
1153
1181
  isHeadingOneFirst: o
1154
1182
  }) {
1155
- return /* @__PURE__ */ I(Ke, { initialConfig: e, children: [
1156
- /* @__PURE__ */ a(
1157
- Fe,
1183
+ return /* @__PURE__ */ $(Ke, { initialConfig: e, children: [
1184
+ /* @__PURE__ */ l(
1185
+ We,
1158
1186
  {
1159
- contentEditable: /* @__PURE__ */ a(Rt, { spellCheck: i, className: "editor-input" }),
1160
- ErrorBoundary: Ge
1187
+ contentEditable: /* @__PURE__ */ l(wt, { spellCheck: i, className: "editor-input" }),
1188
+ ErrorBoundary: ze
1161
1189
  }
1162
1190
  ),
1163
- /* @__PURE__ */ a(Zt, { isHeadingOneFirst: o }),
1164
- /* @__PURE__ */ a(on, {}),
1165
- /* @__PURE__ */ a(Nn, { toolbarGap: n }),
1166
- /* @__PURE__ */ a(we, {}),
1167
- /* @__PURE__ */ a(We, {}),
1168
- /* @__PURE__ */ a(Tn, {}),
1169
- /* @__PURE__ */ a(En, {}),
1170
- /* @__PURE__ */ a(cn, {}),
1171
- /* @__PURE__ */ a(dn, {}),
1172
- /* @__PURE__ */ a(gn, {}),
1173
- /* @__PURE__ */ a(Bt, {}),
1174
- /* @__PURE__ */ a(Ln, {}),
1175
- /* @__PURE__ */ a(Mn, {}),
1176
- /* @__PURE__ */ a(Ht, { onChange: s }),
1177
- /* @__PURE__ */ a(In, { editorRef: t }),
1178
- /* @__PURE__ */ a(wt, {})
1191
+ /* @__PURE__ */ l(Jt, { isHeadingOneFirst: o }),
1192
+ /* @__PURE__ */ l(rn, {}),
1193
+ /* @__PURE__ */ l(Cn, { toolbarGap: n }),
1194
+ /* @__PURE__ */ l(Fe, {}),
1195
+ /* @__PURE__ */ l(Ge, {}),
1196
+ /* @__PURE__ */ l(En, {}),
1197
+ /* @__PURE__ */ l(bn, {}),
1198
+ /* @__PURE__ */ l(dn, {}),
1199
+ /* @__PURE__ */ l(un, {}),
1200
+ /* @__PURE__ */ l(fn, {}),
1201
+ /* @__PURE__ */ l(Ht, {}),
1202
+ /* @__PURE__ */ l(Mn, {}),
1203
+ /* @__PURE__ */ l(In, {}),
1204
+ /* @__PURE__ */ l(Rt, { onChange: s }),
1205
+ /* @__PURE__ */ l(Sn, { editorRef: t }),
1206
+ /* @__PURE__ */ l(Ft, {})
1179
1207
  ] });
1180
1208
  }
1181
1209
  export {
1182
- jn as default
1210
+ Xn as default
1183
1211
  };
1184
1212
  //# sourceMappingURL=index.es.js.map