lexical-medium-editor 1.2.15 → 1.2.16

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