@mx-space/cli 0.14.1 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +35 -11
  2. package/dist/{Lexical.dev-DTxuYHmG.mjs → Lexical.dev-Cck4n26y.mjs} +998 -584
  3. package/dist/{Lexical.node-BlCLnfA6.mjs → Lexical.node-D6wf2D5M.mjs} +15 -5
  4. package/dist/Lexical.prod-DCwS1oTq.mjs +7170 -0
  5. package/dist/{LexicalClipboard.dev-CdFkLR_D.mjs → LexicalClipboard.dev-CMkPHV7O.mjs} +6 -6
  6. package/dist/{LexicalClipboard.node-ktUajxsv.mjs → LexicalClipboard.node-m4nZ7IYw.mjs} +2 -2
  7. package/dist/{LexicalClipboard.prod-DliyLofW.mjs → LexicalClipboard.prod-B_rN1vE1.mjs} +10 -8
  8. package/dist/{LexicalCodeCore.dev-CL9tHWJX.mjs → LexicalCodeCore.dev-DyJw3i8V.mjs} +62 -72
  9. package/dist/{LexicalCodeCore.prod-BoMSJc29.mjs → LexicalCodeCore.prod-DPXLHQLF.mjs} +212 -213
  10. package/dist/{LexicalDragon.dev-CqW7Aq5H.mjs → LexicalDragon.dev-ZkNfMwrE.mjs} +3 -3
  11. package/dist/{LexicalDragon.node-DLXctJyy.mjs → LexicalDragon.node-Ds9oLUFh.mjs} +2 -2
  12. package/dist/{LexicalDragon.prod-DHI3T6n5.mjs → LexicalDragon.prod-B58ic2av.mjs} +5 -4
  13. package/dist/{LexicalExtension.dev-BP-18zns.mjs → LexicalExtension.dev-DvwHs1Xv.mjs} +79 -67
  14. package/dist/{LexicalExtension.node-BWH6xbzG.mjs → LexicalExtension.node-5OymZQfy.mjs} +4 -2
  15. package/dist/{LexicalExtension.prod-Cs6OgrDn.mjs → LexicalExtension.prod-Ce0T5smQ.mjs} +372 -358
  16. package/dist/{LexicalHeadless.dev-DJp__UcP.mjs → LexicalHeadless.dev-DA0WldSR.mjs} +2 -2
  17. package/dist/{LexicalHeadless.prod-o0v9cIu5.mjs → LexicalHeadless.prod-1kQgKB6c.mjs} +2 -2
  18. package/dist/{LexicalHtml.dev-DoymwFpG.mjs → LexicalHtml.dev-BDB7CUrx.mjs} +14 -12
  19. package/dist/{LexicalHtml.node-CVkbWtUA.mjs → LexicalHtml.node-DpVNt7It.mjs} +4 -4
  20. package/dist/{LexicalHtml.prod-C2b3z99k.mjs → LexicalHtml.prod-HkxM5scw.mjs} +331 -300
  21. package/dist/{LexicalLink.dev-7cgLOLIe.mjs → LexicalLink.dev-C5zNJlrm.mjs} +65 -59
  22. package/dist/{LexicalLink.prod-DWFgoXHR.mjs → LexicalLink.prod-Bkt9hQAt.mjs} +196 -201
  23. package/dist/{LexicalList.dev-Ci2iOxFx.mjs → LexicalList.dev-B7VgME-m.mjs} +55 -82
  24. package/dist/LexicalList.prod-B8c7TDjH.mjs +951 -0
  25. package/dist/{LexicalMarkdown.dev-C0ZYCyuR.mjs → LexicalMarkdown.dev-B5z9kLbV.mjs} +62 -42
  26. package/dist/{LexicalMarkdown.prod-0M-Nc-rh.mjs → LexicalMarkdown.prod-wKzw7FFH.mjs} +255 -202
  27. package/dist/{LexicalRichText.dev-Cnr1kDym.mjs → LexicalRichText.dev-CUd6Li5F.mjs} +399 -120
  28. package/dist/{LexicalRichText.node-BUJZAiap.mjs → LexicalRichText.node-BKfaQ-CH.mjs} +12 -8
  29. package/dist/LexicalRichText.prod-SBewjJHx.mjs +708 -0
  30. package/dist/{LexicalSelection.dev-C4L7l8OB.mjs → LexicalSelection.dev-D27JOCqj.mjs} +48 -17
  31. package/dist/{LexicalSelection.node-CLKroUMQ.mjs → LexicalSelection.node-DBEwPjBu.mjs} +5 -4
  32. package/dist/{LexicalSelection.prod-DzFqpTlw.mjs → LexicalSelection.prod-OaYhXHOL.mjs} +101 -92
  33. package/dist/{LexicalTable.dev-Cc9-zqKa.mjs → LexicalTable.dev-6IFFOAE0.mjs} +590 -259
  34. package/dist/LexicalTable.prod-2CaLZ7fH.mjs +2524 -0
  35. package/dist/{LexicalUtils.dev-BRgK0L6G.mjs → LexicalUtils.dev-DJA7J_7v.mjs} +15 -19
  36. package/dist/{LexicalUtils.node-BVAwOkL4.mjs → LexicalUtils.node-Df9oPTlA.mjs} +6 -6
  37. package/dist/{LexicalUtils.prod-C1gtvVDP.mjs → LexicalUtils.prod-Bb7V4Ewg.mjs} +155 -159
  38. package/dist/bin/mxs.mjs +1 -1
  39. package/dist/esm-CDcJmHkG.mjs +2 -0
  40. package/dist/{esm-BNu4sUWV.mjs → esm-DLzrv7gD.mjs} +1837 -6015
  41. package/dist/index.d.mts +57 -62
  42. package/dist/index.mjs +1 -1
  43. package/dist/{mxs-CMX2yklg.mjs → mxs-BIRW5Axj.mjs} +13579 -8682
  44. package/dist/rolldown-runtime-JspESFgx.mjs +35 -0
  45. package/dist/vendor/litexml/cli.mjs +7043 -6207
  46. package/dist/vendor/litexml/litexml-html-preview-client.css +80 -47
  47. package/dist/vendor/litexml/litexml-html-preview-client.js +14422 -10838
  48. package/dist/vendor/litexml/style.css +6 -2
  49. package/package.json +23 -23
  50. package/skills/commands-ai.md +45 -12
  51. package/skills/overview.md +1 -1
  52. package/dist/Lexical.prod-CeB9UQuo.mjs +0 -6816
  53. package/dist/LexicalList.prod-D0xX5d3G.mjs +0 -944
  54. package/dist/LexicalRichText.prod-BfbMQ9uM.mjs +0 -538
  55. package/dist/LexicalTable.prod-BgO4nCxy.mjs +0 -2336
  56. package/dist/esm-jbwcVZth.mjs +0 -2
@@ -1,6 +1,6 @@
1
- import { A as $getChildCaret, Ct as $normalizeCaret, D as $getCaretRange, Dt as $rewindSiblingCaret, Fr as getStaticNodeConfig, G as $getSiblingCaret, Gr as isExactShortcutMatch, Gt as COMMAND_PRIORITY_BEFORE_EDITOR, H as $getPreviousSelection, Ht as CLICK_COMMAND, I as $getEditor, J as $getSlotHost, Jn as KEY_TAB_COMMAND, Kt as COMMAND_PRIORITY_CRITICAL, Lt as $updateDOMSelection, Mt as $setSelection, Nr as getRegisteredSubtypeMap, Nt as $setSelectionFromCaretRange, O as $getCaretRangeInDirection, Ot as $selectAll, Pt as $setState, Qn as OUTDENT_CONTENT_COMMAND, Qt as COMPOSITION_START_TAG, Sr as getActiveElement, Tr as getDOMSelection, U as $getRoot, V as $getNodeFromDOMNode, Vr as isDOMNode, Vt as CLEAR_EDITOR_COMMAND, W as $getSelection, Wt as COMMAND_PRIORITY_BEFORE_CRITICAL, X as $getState, Yn as LineBreakNode, Yt as COMMAND_PRIORITY_LOW, Zt as COMPOSITION_START_COMMAND, _r as createEditor, _t as $isSiblingCaret, a as $caretRangeFromSelection, ai as safeCast, at as $isElementNode, br as defineExtension, bt as $isTextNode, cr as SKIP_SCROLL_INTO_VIEW_TAG, di as toggleTextFormatType, dn as ElementNode, dr as TabNode, dt as $isNodeSelection, f as $createNodeSelection, fr as TextNode, gn as HISTORY_MERGE_TAG, gr as createCommand, h as $createRangeSelection, hr as configExtension, ii as removeClassNamesFromElement, ir as SELECTION_CHANGE_COMMAND, it as $isEditorState, li as shallowMergeConfig, lr as SKIP_SELECTION_FOCUS_TAG, mn as FORMAT_TEXT_COMMAND, mt as $isRootNode, ni as mergeRegister, nt as $isChildCaret, or as SELECT_ALL_COMMAND, p as $createParagraphNode, pr as addClassNamesToElement, pt as $isRangeSelection, q as $getSlotFrame, qr as isHTMLElement, qt as COMMAND_PRIORITY_EDITOR, rr as RootNode, rt as $isDecoratorNode, tr as ParagraphNode, tt as $isBlockElementNode, u as $create, ui as stopLexicalPropagation, un as DecoratorNode, ur as TEXT_TYPE_TO_FORMAT, ut as $isLineBreakNode, vn as INDENT_CONTENT_COMMAND, vr as createState, wt as $normalizeSelection__EXPERIMENTAL, xn as INSERT_TAB_COMMAND, xt as $isTextPointCaret, yr as declarePeerDependency, z as $getNodeByKey } from "./Lexical.node-BlCLnfA6.mjs";
2
- import { a as $handleIndentAndOutdent, c as $isBlockFullySelected, f as IS_APPLE, g as selectionAlwaysOnDisplay, r as $getNearestBlockElementAncestorOrThrow, s as $insertNodeToNearestRoot } from "./LexicalUtils.node-BVAwOkL4.mjs";
3
- //#region ../../node_modules/.pnpm/@lexical+extension@0.46.0_typescript@6.0.3/node_modules/@lexical/extension/dist/LexicalExtension.prod.mjs
1
+ import { $n as LineBreakNode, $r as isHTMLElement, $t as COMMAND_PRIORITY_LOW, A as $getChildCaret, At as $rewindSiblingCaret, B as $getNodeByKey, Cr as createState, Ct as $isTextPointCaret, D as $getCaretRange, Dt as $normalizeSelection__EXPERIMENTAL, Et as $normalizeCaret, Ft as $setSelection, G as $getSelection, Gt as CLEAR_EDITOR_COMMAND, H as $getNodeFromDOMNode, I as $getDocument, It as $setSelectionFromCaretRange, J as $getSlotFrame, Jt as COMMAND_PRIORITY_BEFORE_CRITICAL, K as $getSiblingCaret, Kt as CLICK_COMMAND, L as $getEditor, Lt as $setState, O as $getCaretRangeInDirection, Or as getActiveElement, Qn as KEY_TAB_COMMAND, Sn as INDENT_CONTENT_COMMAND, Sr as createEditor, St as $isTextNode, Tn as INSERT_TAB_COMMAND, Tr as defineExtension, U as $getPreviousSelection, Vr as getStaticNodeConfig, Vt as $updateDOMSelection, W as $getRoot, Xt as COMMAND_PRIORITY_CRITICAL, Y as $getSlotHost, Yt as COMMAND_PRIORITY_BEFORE_EDITOR, Z as $getState, Zr as isExactShortcutMatch, Zt as COMMAND_PRIORITY_EDITOR, _i as shallowMergeConfig, _r as TextNode, a as $caretRangeFromSelection, ar as ParagraphNode, at as $isEditorState, bn as HISTORY_MERGE_TAG, br as configExtension, ci as mergeRegister, cr as SELECTION_CHANGE_COMMAND, di as registerEventListeners, dt as $isLineBreakNode, f as $createNodeSelection, fi as removeClassNamesFromElement, ft as $isNodeSelection, gr as TabNode, h as $createRangeSelection, hn as ElementNode, hr as TEXT_TYPE_TO_FORMAT, ht as $isRootNode, it as $isDecoratorNode, jr as getDOMSelection, jt as $selectAll, kn as IS_APPLE, mn as DecoratorNode, mr as SKIP_SELECTION_FOCUS_TAG, mt as $isRangeSelection, nn as COMPOSITION_START_TAG, nr as OUTDENT_CONTENT_COMMAND, nt as $isBlockElementNode, ot as $isElementNode, p as $createParagraphNode, pi as safeCast, pr as SKIP_SCROLL_INTO_VIEW_TAG, qr as isDOMNode, rt as $isChildCaret, sr as RootNode, tn as COMPOSITION_START_COMMAND, u as $create, ui as registerEventListener, ur as SELECT_ALL_COMMAND, vi as stopLexicalPropagation, vr as addClassNamesToElement, wr as declarePeerDependency, xr as createCommand, yi as toggleTextFormatType, yt as $isSiblingCaret, zr as getRegisteredSubtypeMap } from "./Lexical.node-D6wf2D5M.mjs";
2
+ import { a as $handleIndentAndOutdent, c as $isBlockFullySelected, h as selectionAlwaysOnDisplay, r as $getNearestBlockElementAncestorOrThrow, s as $insertNodeToNearestRoot } from "./LexicalUtils.node-Df9oPTlA.mjs";
3
+ //#region ../../node_modules/.pnpm/@lexical+extension@0.49.0_typescript@6.0.3/node_modules/@lexical/extension/dist/LexicalExtension.prod.mjs
4
4
  /**
5
5
  * Copyright (c) Meta Platforms, Inc. and affiliates.
6
6
  *
@@ -8,18 +8,18 @@ import { a as $handleIndentAndOutdent, c as $isBlockFullySelected, f as IS_APPLE
8
8
  * LICENSE file in the root directory of this source tree.
9
9
  *
10
10
  */
11
- const At = Symbol.for("preact-signals");
12
- function Pt() {
13
- if (Ut > 1) return void Ut--;
11
+ const Kt = Symbol.for("preact-signals");
12
+ function $t() {
13
+ if (Bt > 1) return void Bt--;
14
14
  let t, e = !1;
15
15
  for (function() {
16
- let t = zt;
17
- for (zt = void 0; void 0 !== t;) t.S.v === t.v && (t.S.i = t.i), t = t.o;
18
- }(); void 0 !== Tt;) {
19
- let n = Tt;
20
- for (Tt = void 0, Wt++; void 0 !== n;) {
16
+ let t = Wt;
17
+ for (Wt = void 0; void 0 !== t;) t.S.v === t.v && (t.S.i = t.i), t = t.o;
18
+ }(); void 0 !== zt;) {
19
+ let n = zt;
20
+ for (zt = void 0, Vt++; void 0 !== n;) {
21
21
  const i = n.u;
22
- if (n.u = void 0, n.f &= -3, !(8 & n.f) && Xt(n)) try {
22
+ if (n.u = void 0, n.f &= -3, !(8 & n.f) && qt(n)) try {
23
23
  n.c();
24
24
  } catch (n) {
25
25
  e || (t = n, e = !0);
@@ -27,53 +27,59 @@ function Pt() {
27
27
  n = i;
28
28
  }
29
29
  }
30
- if (Wt = 0, Ut--, e) throw t;
30
+ if (Vt = 0, Bt--, e) throw t;
31
31
  }
32
- function Kt(t) {
33
- if (Ut > 0) return t();
34
- Vt = ++Bt, Ut++;
32
+ function jt(t) {
33
+ if (Bt > 0) return t();
34
+ Zt = ++Gt, Bt++;
35
35
  try {
36
36
  return t();
37
37
  } finally {
38
- Pt();
38
+ $t();
39
39
  }
40
40
  }
41
- let $t, Tt;
42
- function jt(t) {
43
- const e = $t;
44
- $t = void 0;
41
+ let Tt;
42
+ let zt;
43
+ function Ut(t) {
44
+ const e = Tt;
45
+ Tt = void 0;
45
46
  try {
46
47
  return t();
47
48
  } finally {
48
- $t = e;
49
+ Tt = e;
49
50
  }
50
51
  }
51
- let zt, Ut = 0, Wt = 0, Bt = 0, Vt = 0, Gt = 0;
52
- function Zt(t) {
53
- if (void 0 === $t) return;
52
+ let Wt;
53
+ let Bt = 0;
54
+ let Vt = 0;
55
+ let Gt = 0;
56
+ let Zt = 0;
57
+ let Ht = 0;
58
+ function Jt(t) {
59
+ if (void 0 === Tt) return;
54
60
  let e = t.n;
55
- return void 0 === e || e.t !== $t ? (e = {
61
+ return void 0 === e || e.t !== Tt ? (e = {
56
62
  i: 0,
57
63
  S: t,
58
- p: $t.s,
64
+ p: Tt.s,
59
65
  n: void 0,
60
- t: $t,
66
+ t: Tt,
61
67
  e: void 0,
62
68
  x: void 0,
63
69
  r: e
64
- }, void 0 !== $t.s && ($t.s.n = e), $t.s = e, t.n = e, 32 & $t.f && t.S(e), e) : -1 === e.i ? (e.i = 0, void 0 !== e.n && (e.n.p = e.p, void 0 !== e.p && (e.p.n = e.n), e.p = $t.s, e.n = void 0, $t.s.n = e, $t.s = e), e) : void 0;
70
+ }, void 0 !== Tt.s && (Tt.s.n = e), Tt.s = e, t.n = e, 32 & Tt.f && t.S(e), e) : -1 === e.i ? (e.i = 0, void 0 !== e.n && (e.n.p = e.p, void 0 !== e.p && (e.p.n = e.n), e.p = Tt.s, e.n = void 0, Tt.s.n = e, Tt.s = e), e) : void 0;
65
71
  }
66
- function Jt(t, e) {
72
+ function Xt(t, e) {
67
73
  this.v = t, this.i = 0, this.n = void 0, this.t = void 0, this.l = 0, this.W = null == e ? void 0 : e.watched, this.Z = null == e ? void 0 : e.unwatched, this.name = null == e ? void 0 : e.name;
68
74
  }
69
- function Ht(t, e) {
70
- return new Jt(t, e);
75
+ function Yt(t, e) {
76
+ return new Xt(t, e);
71
77
  }
72
- function Xt(t) {
78
+ function qt(t) {
73
79
  for (let e = t.s; void 0 !== e; e = e.n) if (e.S.i !== e.i || !e.S.h() || e.S.i !== e.i) return !0;
74
80
  return !1;
75
81
  }
76
- function Yt(t) {
82
+ function Qt(t) {
77
83
  for (let e = t.s; void 0 !== e; e = e.n) {
78
84
  const n = e.S.n;
79
85
  if (void 0 !== n && (e.r = n), e.S.n = e, e.i = -1, void 0 === e.n) {
@@ -82,7 +88,7 @@ function Yt(t) {
82
88
  }
83
89
  }
84
90
  }
85
- function qt(t) {
91
+ function te(t) {
86
92
  let e, n = t.s;
87
93
  for (; void 0 !== n;) {
88
94
  const t = n.p;
@@ -90,40 +96,40 @@ function qt(t) {
90
96
  }
91
97
  t.s = e;
92
98
  }
93
- function Qt(t, e) {
94
- Jt.call(this, void 0), this.x = t, this.s = void 0, this.g = Gt - 1, this.f = 4, this.W = null == e ? void 0 : e.watched, this.Z = null == e ? void 0 : e.unwatched, this.name = null == e ? void 0 : e.name;
99
+ function ee(t, e) {
100
+ Xt.call(this, void 0), this.x = t, this.s = void 0, this.g = Ht - 1, this.f = 4, this.W = null == e ? void 0 : e.watched, this.Z = null == e ? void 0 : e.unwatched, this.name = null == e ? void 0 : e.name;
95
101
  }
96
- function te(t, e) {
97
- return new Qt(t, e);
102
+ function ne(t, e) {
103
+ return new ee(t, e);
98
104
  }
99
- function ee(t) {
105
+ function ie(t) {
100
106
  const e = t.m;
101
107
  if (t.m = void 0, "function" == typeof e) {
102
- Ut++;
103
- const n = $t;
104
- $t = void 0;
108
+ Bt++;
109
+ const n = Tt;
110
+ Tt = void 0;
105
111
  try {
106
112
  e();
107
113
  } catch (e) {
108
- throw t.f &= -2, t.f |= 8, ne(t), e;
114
+ throw t.f &= -2, t.f |= 8, oe(t), e;
109
115
  } finally {
110
- $t = n, Pt();
116
+ Tt = n, $t();
111
117
  }
112
118
  }
113
119
  }
114
- function ne(t) {
120
+ function oe(t) {
115
121
  for (let e = t.s; void 0 !== e; e = e.n) e.S.U(e);
116
- t.x = void 0, t.s = void 0, ee(t);
122
+ t.x = void 0, t.s = void 0, ie(t);
117
123
  }
118
- function ie(t) {
119
- if ($t !== this) throw new Error("Out-of-order effect");
120
- qt(this), $t = t, this.f &= -2, 8 & this.f && ne(this), Pt();
124
+ function se(t) {
125
+ if (Tt !== this) throw new Error("Out-of-order effect");
126
+ te(this), Tt = t, this.f &= -2, 8 & this.f && oe(this), $t();
121
127
  }
122
- function oe(t, e) {
128
+ function re(t, e) {
123
129
  this.x = t, this.m = void 0, this.s = void 0, this.u = void 0, this.f = 32, this.name = null == e ? void 0 : e.name;
124
130
  }
125
- function se(t, e) {
126
- const n = new oe(t, e);
131
+ function ce(t, e) {
132
+ const n = new re(t, e);
127
133
  try {
128
134
  n.c();
129
135
  } catch (t) {
@@ -132,113 +138,113 @@ function se(t, e) {
132
138
  const i = n.d.bind(n);
133
139
  return i[Symbol.dispose] = i, i;
134
140
  }
135
- function re(t, e = {}) {
141
+ function ae(t, e = {}) {
136
142
  const n = {};
137
143
  for (const i in t) {
138
144
  const o = e[i];
139
- n[i] = Ht(void 0 === o ? t[i] : o);
145
+ n[i] = Yt(void 0 === o ? t[i] : o);
140
146
  }
141
147
  return n;
142
148
  }
143
- Jt.prototype.brand = At, Jt.prototype.h = function() {
149
+ Xt.prototype.brand = Kt, Xt.prototype.h = function() {
144
150
  return !0;
145
- }, Jt.prototype.S = function(t) {
151
+ }, Xt.prototype.S = function(t) {
146
152
  const e = this.t;
147
- e !== t && void 0 === t.e && (t.x = e, this.t = t, void 0 !== e ? e.e = t : jt(() => {
153
+ e !== t && void 0 === t.e && (t.x = e, this.t = t, void 0 !== e ? e.e = t : Ut(() => {
148
154
  var t;
149
155
  null == (t = this.W) || t.call(this);
150
156
  }));
151
- }, Jt.prototype.U = function(t) {
157
+ }, Xt.prototype.U = function(t) {
152
158
  if (void 0 !== this.t) {
153
159
  const e = t.e, n = t.x;
154
- void 0 !== e && (e.x = n, t.e = void 0), void 0 !== n && (n.e = e, t.x = void 0), t === this.t && (this.t = n, void 0 === n && jt(() => {
160
+ void 0 !== e && (e.x = n, t.e = void 0), void 0 !== n && (n.e = e, t.x = void 0), t === this.t && (this.t = n, void 0 === n && Ut(() => {
155
161
  var t;
156
162
  null == (t = this.Z) || t.call(this);
157
163
  }));
158
164
  }
159
- }, Jt.prototype.subscribe = function(t) {
160
- return se(() => {
161
- const e = this.value, n = $t;
162
- $t = void 0;
165
+ }, Xt.prototype.subscribe = function(t) {
166
+ return ce(() => {
167
+ const e = this.value, n = Tt;
168
+ Tt = void 0;
163
169
  try {
164
170
  t(e);
165
171
  } finally {
166
- $t = n;
172
+ Tt = n;
167
173
  }
168
174
  }, { name: "sub" });
169
- }, Jt.prototype.valueOf = function() {
175
+ }, Xt.prototype.valueOf = function() {
170
176
  return this.value;
171
- }, Jt.prototype.toString = function() {
177
+ }, Xt.prototype.toString = function() {
172
178
  return this.value + "";
173
- }, Jt.prototype.toJSON = function() {
179
+ }, Xt.prototype.toJSON = function() {
174
180
  return this.value;
175
- }, Jt.prototype.peek = function() {
176
- const t = $t;
177
- $t = void 0;
181
+ }, Xt.prototype.peek = function() {
182
+ const t = Tt;
183
+ Tt = void 0;
178
184
  try {
179
185
  return this.value;
180
186
  } finally {
181
- $t = t;
187
+ Tt = t;
182
188
  }
183
- }, Object.defineProperty(Jt.prototype, "value", {
189
+ }, Object.defineProperty(Xt.prototype, "value", {
184
190
  get() {
185
- const t = Zt(this);
191
+ const t = Jt(this);
186
192
  return void 0 !== t && (t.i = this.i), this.v;
187
193
  },
188
194
  set(t) {
189
195
  if (t !== this.v) {
190
- if (Wt > 100) throw new Error("Cycle detected");
196
+ if (Vt > 100) throw new Error("Cycle detected");
191
197
  (function(t) {
192
- 0 !== Ut && 0 === Wt && t.l !== Vt && (t.l = Vt, zt = {
198
+ 0 !== Bt && 0 === Vt && t.l !== Zt && (t.l = Zt, Wt = {
193
199
  S: t,
194
200
  v: t.v,
195
201
  i: t.i,
196
- o: zt
202
+ o: Wt
197
203
  });
198
- })(this), this.v = t, this.i++, Gt++, Ut++;
204
+ })(this), this.v = t, this.i++, Ht++, Bt++;
199
205
  try {
200
206
  for (let t = this.t; void 0 !== t; t = t.x) t.t.N();
201
207
  } finally {
202
- Pt();
208
+ $t();
203
209
  }
204
210
  }
205
211
  }
206
- }), Qt.prototype = new Jt(), Qt.prototype.h = function() {
212
+ }), ee.prototype = new Xt(), ee.prototype.h = function() {
207
213
  if (this.f &= -3, 1 & this.f) return !1;
208
214
  if (32 == (36 & this.f)) return !0;
209
- if (this.f &= -5, this.g === Gt) return !0;
210
- if (this.g = Gt, this.f |= 1, this.i > 0 && !Xt(this)) return this.f &= -2, !0;
211
- const t = $t;
215
+ if (this.f &= -5, this.g === Ht) return !0;
216
+ if (this.g = Ht, this.f |= 1, this.i > 0 && !qt(this)) return this.f &= -2, !0;
217
+ const t = Tt;
212
218
  try {
213
- Yt(this), $t = this;
219
+ Qt(this), Tt = this;
214
220
  const t = this.x();
215
221
  (16 & this.f || this.v !== t || 0 === this.i) && (this.v = t, this.f &= -17, this.i++);
216
222
  } catch (t) {
217
223
  this.v = t, this.f |= 16, this.i++;
218
224
  }
219
- return $t = t, qt(this), this.f &= -2, !0;
220
- }, Qt.prototype.S = function(t) {
225
+ return Tt = t, te(this), this.f &= -2, !0;
226
+ }, ee.prototype.S = function(t) {
221
227
  if (void 0 === this.t) {
222
228
  this.f |= 36;
223
229
  for (let t = this.s; void 0 !== t; t = t.n) t.S.S(t);
224
230
  }
225
- Jt.prototype.S.call(this, t);
226
- }, Qt.prototype.U = function(t) {
227
- if (void 0 !== this.t && (Jt.prototype.U.call(this, t), void 0 === this.t)) {
231
+ Xt.prototype.S.call(this, t);
232
+ }, ee.prototype.U = function(t) {
233
+ if (void 0 !== this.t && (Xt.prototype.U.call(this, t), void 0 === this.t)) {
228
234
  this.f &= -33;
229
235
  for (let t = this.s; void 0 !== t; t = t.n) t.S.U(t);
230
236
  }
231
- }, Qt.prototype.N = function() {
237
+ }, ee.prototype.N = function() {
232
238
  if (!(2 & this.f)) {
233
239
  this.f |= 6;
234
240
  for (let t = this.t; void 0 !== t; t = t.x) t.t.N();
235
241
  }
236
- }, Object.defineProperty(Qt.prototype, "value", { get() {
242
+ }, Object.defineProperty(ee.prototype, "value", { get() {
237
243
  if (1 & this.f) throw new Error("Cycle detected");
238
- const t = Zt(this);
244
+ const t = Jt(this);
239
245
  if (this.h(), void 0 !== t && (t.i = this.i), 16 & this.f) throw this.v;
240
246
  return this.v;
241
- } }), oe.prototype.c = function() {
247
+ } }), re.prototype.c = function() {
242
248
  const t = this.S();
243
249
  try {
244
250
  if (8 & this.f) return;
@@ -248,20 +254,20 @@ Jt.prototype.brand = At, Jt.prototype.h = function() {
248
254
  } finally {
249
255
  t();
250
256
  }
251
- }, oe.prototype.S = function() {
257
+ }, re.prototype.S = function() {
252
258
  if (1 & this.f) throw new Error("Cycle detected");
253
- this.f |= 1, this.f &= -9, ee(this), Yt(this), Ut++;
254
- const t = $t;
255
- return $t = this, ie.bind(this, t);
256
- }, oe.prototype.N = function() {
257
- 2 & this.f || (this.f |= 2, this.u = Tt, Tt = this);
258
- }, oe.prototype.d = function() {
259
- this.f |= 8, 1 & this.f || ne(this);
260
- }, oe.prototype.dispose = function() {
259
+ this.f |= 1, this.f &= -9, ie(this), Qt(this), Bt++;
260
+ const t = Tt;
261
+ return Tt = this, se.bind(this, t);
262
+ }, re.prototype.N = function() {
263
+ 2 & this.f || (this.f |= 2, this.u = zt, zt = this);
264
+ }, re.prototype.d = function() {
265
+ this.f |= 8, 1 & this.f || oe(this);
266
+ }, re.prototype.dispose = function() {
261
267
  this.d();
262
268
  };
263
- const ce = /* @__PURE__ */ defineExtension({
264
- build: (t, e, n) => re(e),
269
+ const de = /* @__PURE__ */ defineExtension({
270
+ build: (t, e, n) => ae(e),
265
271
  config: /* @__PURE__ */ safeCast({
266
272
  defaultSelection: "rootEnd",
267
273
  disabled: !1
@@ -269,7 +275,7 @@ const ce = /* @__PURE__ */ defineExtension({
269
275
  name: "@lexical/extension/AutoFocus",
270
276
  register(t, e, i) {
271
277
  const o = i.getOutput();
272
- return se(() => o.disabled.value ? void 0 : t.registerRootListener((e) => {
278
+ return ce(() => o.disabled.value ? void 0 : t.registerRootListener((e) => {
273
279
  t.focus(() => {
274
280
  const t = null !== e ? getActiveElement(e) : null;
275
281
  null === e || null !== t && e.contains(t) || e.focus({ preventScroll: !0 });
@@ -277,26 +283,26 @@ const ce = /* @__PURE__ */ defineExtension({
277
283
  }));
278
284
  }
279
285
  });
280
- function ae() {
286
+ function le() {
281
287
  const t = $getRoot(), e = $getSelection(), n = $createParagraphNode();
282
288
  t.clear(), t.append(n), null !== e && n.select(), $isRangeSelection(e) && (e.format = 0);
283
289
  }
284
- function de(t, e = ae) {
285
- return t.registerCommand(CLEAR_EDITOR_COMMAND, (n) => (t.update(e), !0), COMMAND_PRIORITY_EDITOR);
290
+ function ue(t, e = le) {
291
+ return t.registerCommand(CLEAR_EDITOR_COMMAND, () => (e(), !0), COMMAND_PRIORITY_EDITOR);
286
292
  }
287
- const ue = /* @__PURE__ */ defineExtension({
288
- build: (t, e, n) => re(e),
289
- config: /* @__PURE__ */ safeCast({ $onClear: ae }),
293
+ const fe = /* @__PURE__ */ defineExtension({
294
+ build: (t, e, n) => ae(e),
295
+ config: /* @__PURE__ */ safeCast({ $onClear: le }),
290
296
  name: "@lexical/extension/ClearEditor",
291
297
  register(t, e, n) {
292
298
  const { $onClear: i } = n.getOutput();
293
- return se(() => de(t, i.value));
299
+ return ce(() => ue(t, i.value));
294
300
  }
295
301
  });
296
- function le(t) {
302
+ function he(t) {
297
303
  return !!$isDecoratorNode(t) || !(!$isElementNode(t) || !t.isShadowRoot());
298
304
  }
299
- function fe(t, e, n, i) {
305
+ function ge(t, e, n, i) {
300
306
  return !!t.isEditable() && n.target === e && t.read("latest", () => {
301
307
  const e = $getRoot().getLastChild();
302
308
  if (null === e) return !1;
@@ -304,37 +310,37 @@ function fe(t, e, n, i) {
304
310
  return null !== o && !(n.clientY <= o.getBoundingClientRect().bottom) && i(e);
305
311
  });
306
312
  }
307
- const he = /* @__PURE__ */ defineExtension({
308
- build: (t, e) => re(e),
313
+ const pe = /* @__PURE__ */ defineExtension({
314
+ build: (t, e) => ae(e),
309
315
  config: /* @__PURE__ */ safeCast({
310
- $shouldInsertAfter: le,
316
+ $shouldInsertAfter: he,
311
317
  disabled: !1
312
318
  }),
313
319
  name: "@lexical/ClickAfterLastBlock",
314
- register: (t, e, n) => se(() => {
320
+ register: (t, e, n) => ce(() => {
315
321
  const e = n.getOutput();
316
322
  if (!e.disabled.value) return t.registerRootListener((n) => {
317
323
  if (null === n) return;
318
- const i = (i) => {
319
- fe(t, n, i, e.$shouldInsertAfter.peek()) && i.preventDefault();
320
- }, o = (i) => {
321
- fe(t, n, i, e.$shouldInsertAfter.peek()) && (i.preventDefault(), stopLexicalPropagation(i), t.update(() => {
322
- const t = $getRoot().getLastChild();
323
- if (null === t) return;
324
- if (!e.$shouldInsertAfter.peek()(t)) return;
325
- const n = $createParagraphNode();
326
- t.insertAfter(n), n.select();
327
- }));
328
- };
329
- return n.addEventListener("mousedown", i, !0), n.addEventListener("click", o, !0), () => {
330
- n.removeEventListener("mousedown", i, !0), n.removeEventListener("click", o, !0);
331
- };
324
+ return registerEventListeners(n, {
325
+ click: (i) => {
326
+ ge(t, n, i, e.$shouldInsertAfter.peek()) && (i.preventDefault(), stopLexicalPropagation(i), t.update(() => {
327
+ const t = $getRoot().getLastChild();
328
+ if (null === t) return;
329
+ if (!e.$shouldInsertAfter.peek()(t)) return;
330
+ const n = $createParagraphNode();
331
+ t.insertAfter(n), n.select();
332
+ }));
333
+ },
334
+ mousedown: (i) => {
335
+ ge(t, n, i, e.$shouldInsertAfter.peek()) && i.preventDefault();
336
+ }
337
+ }, !0);
332
338
  });
333
339
  })
334
340
  });
335
- function ge(t) {
341
+ function me(t) {
336
342
  const e = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
337
- for (const i of pe(t)) {
343
+ for (const i of ve(t)) {
338
344
  const t = "function" == typeof i ? i : i.replace;
339
345
  getStaticNodeConfig(t), e.add(t.getType()), n.add(t);
340
346
  }
@@ -343,22 +349,25 @@ function ge(t) {
343
349
  types: e
344
350
  };
345
351
  }
346
- function pe(t) {
352
+ function ve(t) {
347
353
  return ("function" == typeof t.nodes ? t.nodes() : t.nodes) || [];
348
354
  }
349
- const me = /* @__PURE__ */ createState("format", { parse: (t) => "number" == typeof t ? t : 0 });
350
- var ve = class extends DecoratorNode {
355
+ const xe = /* @__PURE__ */ createState("format", { parse: (t) => "number" == typeof t ? t : 0 });
356
+ var ye = class extends DecoratorNode {
357
+ get __isInlineFormattable() {
358
+ return !0;
359
+ }
351
360
  $config() {
352
361
  return this.config("decorator-text", {
353
362
  extends: DecoratorNode,
354
363
  stateConfigs: [{
355
364
  flat: !0,
356
- stateConfig: me
365
+ stateConfig: xe
357
366
  }]
358
367
  });
359
368
  }
360
- getFormat() {
361
- return $getState(this, me);
369
+ getFormat(t) {
370
+ return $getState(this, xe, t);
362
371
  }
363
372
  getFormatFlags(t, e) {
364
373
  return toggleTextFormatType(this.getFormat(), t, e);
@@ -368,7 +377,7 @@ var ve = class extends DecoratorNode {
368
377
  return 0 !== (this.getFormat() & e);
369
378
  }
370
379
  setFormat(t) {
371
- return $setState(this, me, t);
380
+ return $setState(this, xe, t);
372
381
  }
373
382
  toggleFormat(t) {
374
383
  const n = toggleTextFormatType(this.getFormat(), t, null);
@@ -377,29 +386,28 @@ var ve = class extends DecoratorNode {
377
386
  isInline() {
378
387
  return !0;
379
388
  }
380
- createDOM() {
381
- return document.createElement("span");
382
- }
383
- updateDOM() {
384
- return !1;
389
+ createDOM(t, e) {
390
+ return $getDocument().createElement("span");
385
391
  }
386
392
  };
387
393
  function Ee(t) {
388
- return t instanceof ve;
394
+ return t instanceof ye;
389
395
  }
390
- function ye(t, e, n) {
396
+ function be(t, e, n) {
391
397
  const i = e.fontWeight, o = e.textDecoration.split(" "), s = "700" === i || "bold" === i, r = o.includes("line-through"), c = "italic" === e.fontStyle, a = o.includes("underline"), d = e.verticalAlign;
392
398
  return s && !t.hasFormat("bold") && t.toggleFormat("bold"), r && !t.hasFormat("strikethrough") && t.toggleFormat("strikethrough"), c && !t.hasFormat("italic") && t.toggleFormat("italic"), a && !t.hasFormat("underline") && t.toggleFormat("underline"), "sub" !== d || t.hasFormat("subscript") || t.toggleFormat("subscript"), "super" !== d || t.hasFormat("superscript") || t.toggleFormat("superscript"), n && !t.hasFormat(n) && t.toggleFormat(n), t;
393
399
  }
394
- function xe(t, e, n = Se) {
395
- for (const [i, o] of Object.entries(n)) t.hasFormat(o) && (e = be(e, i));
396
- return e;
400
+ function Se(t, e, n = Oe) {
401
+ let i = e;
402
+ for (const [e, o] of Object.entries(n)) t.hasFormat(o) && (i = Ne(i, e));
403
+ return i;
397
404
  }
398
- function be(t, e) {
399
- const n = document.createElement(e);
405
+ const we = Se;
406
+ function Ne(t, e) {
407
+ const n = t.ownerDocument.createElement(e);
400
408
  return n.appendChild(t), n;
401
409
  }
402
- const Se = {
410
+ const Oe = {
403
411
  b: "bold",
404
412
  code: "code",
405
413
  em: "italic",
@@ -410,18 +418,14 @@ const Se = {
410
418
  sub: "subscript",
411
419
  sup: "superscript",
412
420
  u: "underline"
413
- }, we = /* @__PURE__ */ defineExtension({
421
+ };
422
+ const Re = /* @__PURE__ */ defineExtension({
414
423
  name: "@lexical/extension/DecoratorText",
415
- nodes: () => [ve],
416
- register: (t, e, n) => t.registerCommand(FORMAT_TEXT_COMMAND, (t) => {
417
- const e = $getSelection();
418
- if ($isNodeSelection(e) || $isRangeSelection(e)) for (const n of e.getNodes()) Ee(n) && n.toggleFormat(t);
419
- return !1;
420
- }, COMMAND_PRIORITY_LOW)
424
+ nodes: () => [ye]
421
425
  });
422
- function Ne(t, e) {
426
+ function Ce(t, e) {
423
427
  let n;
424
- return Ht(t(), {
428
+ return Yt(t(), {
425
429
  unwatched() {
426
430
  n && (n(), n = void 0);
427
431
  },
@@ -430,49 +434,57 @@ function Ne(t, e) {
430
434
  }
431
435
  });
432
436
  }
433
- const Oe = /* @__PURE__ */ defineExtension({
434
- build: (t) => Ne(() => t.getEditorState(), (e) => t.registerUpdateListener((t) => {
437
+ const De = /* @__PURE__ */ defineExtension({
438
+ build: (t) => Ce(() => t.getEditorState(), (e) => t.registerUpdateListener((t) => {
435
439
  e.value = t.editorState;
436
440
  })),
437
441
  name: "@lexical/extension/EditorState"
438
442
  });
439
- function Ce(t, ...e) {
443
+ function Ie(t, ...e) {
440
444
  const n = new URL("https://lexical.dev/docs/error"), i = new URLSearchParams();
441
445
  i.append("code", t);
442
446
  for (const t of e) i.append("v", t);
443
447
  throw n.search = i.toString(), Error(`Minified Lexical error #${t}; visit ${n.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`);
444
448
  }
445
- let Re;
449
+ let Fe;
446
450
  try {
447
- Re = "0.46.0+prod.esm";
451
+ Fe = "0.49.0+prod.esm";
448
452
  } catch (t) {}
449
- const De = Re ?? "\"<unknown>+source\"", Ie = /* @__PURE__ */ new Set([
453
+ const Me = Fe ?? "\"<unknown>+source\"";
454
+ const ke = /* @__PURE__ */ new Set([
450
455
  "__proto__",
451
456
  "constructor",
452
457
  "prototype"
453
458
  ]);
454
- function Fe(t, e) {
459
+ function _e(t, e) {
455
460
  if (t && e && !Array.isArray(e) && "object" == typeof t && "object" == typeof e) {
456
461
  const n = t, i = e;
457
- for (const t in i) !Ie.has(t) && Object.prototype.hasOwnProperty.call(i, t) && (n[t] = Fe(n[t], i[t]));
462
+ for (const t in i) !ke.has(t) && Object.prototype.hasOwnProperty.call(i, t) && (n[t] = _e(n[t], i[t]));
458
463
  return t;
459
464
  }
460
465
  return e;
461
466
  }
462
- const Me = 0, ke = 1, Le = 2, _e = 3, Ae = 4, Pe = 5, Ke = 6, $e = 7;
463
- function Te(t) {
464
- return t.id === Me;
467
+ const Ae = 0;
468
+ const Pe = 1;
469
+ const Le = 2;
470
+ const Ke = 3;
471
+ const $e = 4;
472
+ const je = 5;
473
+ const Te = 6;
474
+ const ze = 7;
475
+ function Ue(t) {
476
+ return t.id === Ae;
465
477
  }
466
- function je(t) {
478
+ function We(t) {
467
479
  return t.id === Le;
468
480
  }
469
- function ze(t) {
481
+ function Be(t) {
470
482
  return function(t) {
471
- return t.id === ke;
472
- }(t) || Ce(305, String(t.id), String(ke)), Object.assign(t, { id: Le });
483
+ return t.id === Pe;
484
+ }(t) || Ie(305, String(t.id), String(Pe)), Object.assign(t, { id: Le });
473
485
  }
474
- const Ue = /* @__PURE__ */ new Set();
475
- var We = class {
486
+ const Ve = /* @__PURE__ */ new Set();
487
+ var Ge = class {
476
488
  builder;
477
489
  configs;
478
490
  _dependency;
@@ -481,7 +493,7 @@ var We = class {
481
493
  state;
482
494
  _signal;
483
495
  constructor(t, e) {
484
- this.builder = t, this.extension = e, this.configs = /* @__PURE__ */ new Set(), this.state = { id: Me };
496
+ this.builder = t, this.extension = e, this.configs = /* @__PURE__ */ new Set(), this.state = { id: Ae };
485
497
  }
486
498
  mergeConfigs() {
487
499
  let t = this.extension.config || {};
@@ -491,7 +503,7 @@ var We = class {
491
503
  }
492
504
  init(t) {
493
505
  const e = this.state;
494
- je(e) || Ce(306, String(e.id));
506
+ We(e) || Ie(306, String(e.id));
495
507
  const n = {
496
508
  getDependency: this.getInitDependency.bind(this),
497
509
  getDirectDependentNames: this.getDirectDependentNames.bind(this),
@@ -505,14 +517,14 @@ var We = class {
505
517
  }, o = function(t, e, n) {
506
518
  return Object.assign(t, {
507
519
  config: e,
508
- id: _e,
520
+ id: Ke,
509
521
  registerState: n
510
522
  });
511
523
  }(e, this.mergeConfigs(), n);
512
524
  let s;
513
525
  this.state = o, this.extension.init && (s = this.extension.init(t, o.config, n)), this.state = function(t, e, n) {
514
526
  return Object.assign(t, {
515
- id: Ae,
527
+ id: $e,
516
528
  initResult: e,
517
529
  registerState: n
518
530
  });
@@ -521,7 +533,7 @@ var We = class {
521
533
  build(t) {
522
534
  const e = this.state;
523
535
  let n;
524
- e.id !== Ae && Ce(307, String(e.id), String(Pe)), this.extension.build && (n = this.extension.build(t, e.config, e.registerState));
536
+ e.id !== $e && Ie(307, String(e.id), String(je)), this.extension.build && (n = this.extension.build(t, e.config, e.registerState));
525
537
  const i = {
526
538
  ...e.registerState,
527
539
  getOutput: () => n,
@@ -529,7 +541,7 @@ var We = class {
529
541
  };
530
542
  this.state = function(t, e, n) {
531
543
  return Object.assign(t, {
532
- id: Pe,
544
+ id: je,
533
545
  output: e,
534
546
  registerState: n
535
547
  });
@@ -538,33 +550,33 @@ var We = class {
538
550
  register(t, e) {
539
551
  this._signal = e;
540
552
  const n = this.state;
541
- n.id !== Pe && Ce(308, String(n.id), String(Pe));
553
+ n.id !== je && Ie(308, String(n.id), String(je));
542
554
  const i = this.extension.register && this.extension.register(t, n.config, n.registerState);
543
555
  return this.state = function(t) {
544
- return Object.assign(t, { id: Ke });
556
+ return Object.assign(t, { id: Te });
545
557
  }(n), () => {
546
558
  const t = this.state;
547
- t.id !== $e && Ce(309, String(n.id), String($e)), this.state = function(t) {
548
- return Object.assign(t, { id: Pe });
559
+ t.id !== ze && Ie(309, String(n.id), String(ze)), this.state = function(t) {
560
+ return Object.assign(t, { id: je });
549
561
  }(t), i && i();
550
562
  };
551
563
  }
552
564
  afterRegistration(t) {
553
565
  const e = this.state;
554
566
  let n;
555
- return e.id !== Ke && Ce(310, String(e.id), String(Ke)), this.extension.afterRegistration && (n = this.extension.afterRegistration(t, e.config, e.registerState)), this.state = function(t) {
556
- return Object.assign(t, { id: $e });
567
+ return e.id !== Te && Ie(310, String(e.id), String(Te)), this.extension.afterRegistration && (n = this.extension.afterRegistration(t, e.config, e.registerState)), this.state = function(t) {
568
+ return Object.assign(t, { id: ze });
557
569
  }(e), n;
558
570
  }
559
571
  getSignal() {
560
- return void 0 === this._signal && Ce(311), this._signal;
572
+ return void 0 === this._signal && Ie(311), this._signal;
561
573
  }
562
574
  getInitResult() {
563
- void 0 === this.extension.init && Ce(312, this.extension.name);
575
+ void 0 === this.extension.init && Ie(312, this.extension.name);
564
576
  const t = this.state;
565
577
  return function(t) {
566
- return t.id >= Ae;
567
- }(t) || Ce(313, String(t.id), String(Ae)), t.initResult;
578
+ return t.id >= $e;
579
+ }(t) || Ie(313, String(t.id), String($e)), t.initResult;
568
580
  }
569
581
  getInitPeer(t) {
570
582
  const e = this.builder.extensionNameMap.get(t);
@@ -573,8 +585,8 @@ var We = class {
573
585
  getExtensionInitDependency() {
574
586
  const t = this.state;
575
587
  return function(t) {
576
- return t.id >= _e;
577
- }(t) || Ce(314, String(t.id), String(_e)), { config: t.config };
588
+ return t.id >= Ke;
589
+ }(t) || Ie(314, String(t.id), String(Ke)), { config: t.config };
578
590
  }
579
591
  getPeer(t) {
580
592
  const e = this.builder.extensionNameMap.get(t);
@@ -582,20 +594,20 @@ var We = class {
582
594
  }
583
595
  getInitDependency(t) {
584
596
  const e = this.builder.getExtensionRep(t);
585
- return void 0 === e && Ce(315, this.extension.name, t.name), e.getExtensionInitDependency();
597
+ return void 0 === e && Ie(315, this.extension.name, t.name), e.getExtensionInitDependency();
586
598
  }
587
599
  getDependency(t) {
588
600
  const e = this.builder.getExtensionRep(t);
589
- return void 0 === e && Ce(315, this.extension.name, t.name), e.getExtensionDependency();
601
+ return void 0 === e && Ie(315, this.extension.name, t.name), e.getExtensionDependency();
590
602
  }
591
603
  getState() {
592
604
  const t = this.state;
593
605
  return function(t) {
594
- return t.id >= $e;
595
- }(t) || Ce(316, String(t.id), String($e)), t;
606
+ return t.id >= ze;
607
+ }(t) || Ie(316, String(t.id), String(ze)), t;
596
608
  }
597
609
  getDirectDependentNames() {
598
- return this.builder.incomingEdges.get(this.extension.name) || Ue;
610
+ return this.builder.incomingEdges.get(this.extension.name) || Ve;
599
611
  }
600
612
  getPeerNameSet() {
601
613
  let t = this._peerNameSet;
@@ -605,8 +617,8 @@ var We = class {
605
617
  if (!this._dependency) {
606
618
  const t = this.state;
607
619
  (function(t) {
608
- return t.id >= Pe;
609
- })(t) || Ce(317, this.extension.name), this._dependency = {
620
+ return t.id >= je;
621
+ })(t) || Ie(317, this.extension.name), this._dependency = {
610
622
  config: t.config,
611
623
  init: t.initResult,
612
624
  output: t.output
@@ -615,17 +627,17 @@ var We = class {
615
627
  return this._dependency;
616
628
  }
617
629
  };
618
- const Be = { tag: HISTORY_MERGE_TAG };
619
- function Ve() {
630
+ const Ze = { tag: HISTORY_MERGE_TAG };
631
+ function He() {
620
632
  const t = $getRoot();
621
633
  t.isEmpty() && t.append($createParagraphNode());
622
634
  }
623
- const Ge = /* @__PURE__ */ defineExtension({
635
+ const Je = /* @__PURE__ */ defineExtension({
624
636
  config: /* @__PURE__ */ safeCast({
625
- setOptions: Be,
626
- updateOptions: Be
637
+ setOptions: Ze,
638
+ updateOptions: Ze
627
639
  }),
628
- init: ({ $initialEditorState: t = Ve }) => ({
640
+ init: ({ $initialEditorState: t = He }) => ({
629
641
  $initialEditorState: t,
630
642
  initialized: !1
631
643
  }),
@@ -653,19 +665,20 @@ const Ge = /* @__PURE__ */ defineExtension({
653
665
  TabNode,
654
666
  ParagraphNode
655
667
  ]
656
- }), Ze = Symbol.for("@lexical/extension/LexicalBuilder");
657
- function Je(...t) {
658
- return Qe.fromExtensions(t).buildEditor();
668
+ });
669
+ const Xe = Symbol.for("@lexical/extension/LexicalBuilder");
670
+ function Ye(...t) {
671
+ return nn.fromExtensions(t).buildEditor();
659
672
  }
660
- function He() {}
661
- function Xe(t) {
673
+ function qe() {}
674
+ function Qe(t) {
662
675
  throw t;
663
676
  }
664
- function Ye(t) {
677
+ function tn(t) {
665
678
  return Array.isArray(t) ? t : [t];
666
679
  }
667
- const qe = De;
668
- var Qe = class Qe {
680
+ const en = Me;
681
+ var nn = class nn {
669
682
  roots;
670
683
  extensionNameMap;
671
684
  outgoingConfigEdges;
@@ -674,21 +687,21 @@ var Qe = class Qe {
674
687
  _sortedExtensionReps;
675
688
  PACKAGE_VERSION;
676
689
  constructor(t) {
677
- this.outgoingConfigEdges = /* @__PURE__ */ new Map(), this.incomingEdges = /* @__PURE__ */ new Map(), this.extensionNameMap = /* @__PURE__ */ new Map(), this.conflicts = /* @__PURE__ */ new Map(), this.PACKAGE_VERSION = qe, this.roots = t;
690
+ this.outgoingConfigEdges = /* @__PURE__ */ new Map(), this.incomingEdges = /* @__PURE__ */ new Map(), this.extensionNameMap = /* @__PURE__ */ new Map(), this.conflicts = /* @__PURE__ */ new Map(), this.PACKAGE_VERSION = en, this.roots = t;
678
691
  for (const e of t) this.addExtension(e);
679
692
  }
680
693
  static fromExtensions(t) {
681
- const e = [Ye(Ge)];
682
- for (const n of t) e.push(Ye(n));
683
- return new Qe(e);
694
+ const e = [tn(Je)];
695
+ for (const n of t) e.push(tn(n));
696
+ return new nn(e);
684
697
  }
685
698
  static maybeFromEditor(t) {
686
- const e = t[Ze];
687
- return e && (e.PACKAGE_VERSION !== qe && Ce(292, e.PACKAGE_VERSION, qe), e instanceof Qe || Ce(293)), e;
699
+ const e = t[Xe];
700
+ return e && (e.PACKAGE_VERSION !== en && Ie(292, e.PACKAGE_VERSION, en), e instanceof nn || Ie(293)), e;
688
701
  }
689
702
  static fromEditor(t) {
690
- const e = Qe.maybeFromEditor(t);
691
- return void 0 === e && Ce(294), e;
703
+ const e = nn.maybeFromEditor(t);
704
+ return void 0 === e && Ie(294), e;
692
705
  }
693
706
  constructEditor() {
694
707
  const { $initialEditorState: t, onError: e, onWarn: n, ...i } = this.buildCreateEditorArgs(), o = Object.assign(createEditor({
@@ -699,17 +712,17 @@ var Qe = class Qe {
699
712
  ...n ? { onWarn: (t) => {
700
713
  n(t, o);
701
714
  } } : {}
702
- }), { [Ze]: this });
715
+ }), { [Xe]: this });
703
716
  for (const t of this.sortedExtensionReps()) t.build(o);
704
717
  return o;
705
718
  }
706
719
  buildEditor() {
707
- let t = He;
720
+ let t = qe;
708
721
  function e() {
709
722
  try {
710
723
  t();
711
724
  } finally {
712
- t = He;
725
+ t = qe;
713
726
  }
714
727
  }
715
728
  const n = Object.assign(this.constructEditor(), {
@@ -723,7 +736,7 @@ var Qe = class Qe {
723
736
  }
724
737
  getExtensionRep(t) {
725
738
  const e = this.extensionNameMap.get(t.name);
726
- if (e) return e.extension !== t && Ce(295, t.name), e;
739
+ if (e) return e.extension !== t && Ie(295, t.name), e;
727
740
  }
728
741
  addEdge(t, e, n) {
729
742
  const i = this.outgoingConfigEdges.get(t);
@@ -732,17 +745,17 @@ var Qe = class Qe {
732
745
  o ? o.add(t) : this.incomingEdges.set(e, /* @__PURE__ */ new Set([t]));
733
746
  }
734
747
  addExtension(t) {
735
- void 0 !== this._sortedExtensionReps && Ce(296);
736
- const [n] = Ye(t);
737
- "string" != typeof n.name && Ce(297, typeof n.name);
748
+ void 0 !== this._sortedExtensionReps && Ie(296);
749
+ const [n] = tn(t);
750
+ "string" != typeof n.name && Ie(297, typeof n.name);
738
751
  let i = this.extensionNameMap.get(n.name);
739
- if (void 0 !== i && i.extension !== n && Ce(298, n.name), !i) {
740
- i = new We(this, n), this.extensionNameMap.set(n.name, i);
752
+ if (void 0 !== i && i.extension !== n && Ie(298, n.name), !i) {
753
+ i = new Ge(this, n), this.extensionNameMap.set(n.name, i);
741
754
  const t = this.conflicts.get(n.name);
742
- "string" == typeof t && Ce(299, n.name, t);
743
- for (const t of n.conflictsWith || []) this.extensionNameMap.has(t) && Ce(299, n.name, t), this.conflicts.set(t, n.name);
755
+ "string" == typeof t && Ie(299, n.name, t);
756
+ for (const t of n.conflictsWith || []) this.extensionNameMap.has(t) && Ie(299, n.name, t), this.conflicts.set(t, n.name);
744
757
  for (const t of n.dependencies || []) {
745
- const e = Ye(t);
758
+ const e = tn(t);
746
759
  this.addEdge(n.name, e[0].name, e.slice(1)), this.addExtension(e);
747
760
  }
748
761
  for (const [t, e] of n.peerDependencies || []) this.addEdge(n.name, t, e ? [e] : []);
@@ -752,25 +765,25 @@ var Qe = class Qe {
752
765
  if (this._sortedExtensionReps) return this._sortedExtensionReps;
753
766
  const t = [], e = (n, i) => {
754
767
  let o = n.state;
755
- if (je(o)) return;
768
+ if (We(o)) return;
756
769
  const s = n.extension.name;
757
770
  var r;
758
- Te(o) || Ce(300, s, i || "[unknown]"), Te(r = o) || Ce(304, String(r.id), String(Me)), o = Object.assign(r, { id: ke }), n.state = o;
771
+ Ue(o) || Ie(300, s, i || "[unknown]"), Ue(r = o) || Ie(304, String(r.id), String(Ae)), o = Object.assign(r, { id: Pe }), n.state = o;
759
772
  const c = this.outgoingConfigEdges.get(s);
760
773
  if (c) for (const t of c.keys()) {
761
774
  const n = this.extensionNameMap.get(t);
762
775
  n && e(n, s);
763
776
  }
764
- o = ze(o), n.state = o, t.push(n);
777
+ o = Be(o), n.state = o, t.push(n);
765
778
  };
766
- for (const t of this.extensionNameMap.values()) Te(t.state) && e(t);
779
+ for (const t of this.extensionNameMap.values()) Ue(t.state) && e(t);
767
780
  for (const e of t) for (const [t, n] of this.outgoingConfigEdges.get(e.extension.name) || []) if (n.length > 0) {
768
781
  const e = this.extensionNameMap.get(t);
769
782
  if (e) for (const t of n) e.configs.add(t);
770
783
  }
771
784
  for (const [t, ...e] of this.roots) if (e.length > 0) {
772
785
  const n = this.extensionNameMap.get(t.name);
773
- void 0 === n && Ce(301, t.name);
786
+ void 0 === n && Ie(301, t.name);
774
787
  for (const t of e) n.configs.add(t);
775
788
  }
776
789
  return this._sortedExtensionReps = t, this._sortedExtensionReps;
@@ -791,10 +804,10 @@ var Qe = class Qe {
791
804
  const t = {}, e = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), o = {}, s = {}, r = this.sortedExtensionReps();
792
805
  for (const c of r) {
793
806
  const { extension: r } = c;
794
- if (void 0 !== r.onError && (t.onError = r.onError), void 0 !== r.onWarn && (t.onWarn = r.onWarn), void 0 !== r.disableEvents && (t.disableEvents = r.disableEvents), void 0 !== r.parentEditor && (t.parentEditor = r.parentEditor), void 0 !== r.editable && (t.editable = r.editable), void 0 !== r.namespace && (t.namespace = r.namespace), void 0 !== r.$initialEditorState && (t.$initialEditorState = r.$initialEditorState), r.nodes) for (const t of pe(r)) {
807
+ if (void 0 !== r.onError && (t.onError = r.onError), void 0 !== r.onWarn && (t.onWarn = r.onWarn), void 0 !== r.disableEvents && (t.disableEvents = r.disableEvents), void 0 !== r.parentEditor && (t.parentEditor = r.parentEditor), void 0 !== r.editable && (t.editable = r.editable), void 0 !== r.namespace && (t.namespace = r.namespace), void 0 !== r.$initialEditorState && (t.$initialEditorState = r.$initialEditorState), r.nodes) for (const t of ve(r)) {
795
808
  if ("function" != typeof t) {
796
809
  const e = n.get(t.replace);
797
- e && Ce(302, r.name, t.replace.name, e.extension.name), n.set(t.replace, c);
810
+ e && Ie(302, r.name, t.replace.name, e.extension.name), n.set(t.replace, c);
798
811
  }
799
812
  e.add(t);
800
813
  }
@@ -802,41 +815,42 @@ var Qe = class Qe {
802
815
  if (r.html.export) for (const [t, e] of r.html.export.entries()) i.set(t, e);
803
816
  r.html.import && Object.assign(o, r.html.import);
804
817
  }
805
- r.theme && Fe(s, r.theme);
818
+ r.theme && _e(s, r.theme);
806
819
  }
807
820
  Object.keys(s).length > 0 && (t.theme = s), e.size && (t.nodes = [...e]);
808
821
  const c = Object.keys(o).length > 0, a = i.size > 0;
809
822
  (c || a) && (t.html = {}, c && (t.html.import = o), a && (t.html.export = i));
810
823
  for (const e of r) e.init(t);
811
- return t.onError || (t.onError = Xe), t;
824
+ return t.onError || (t.onError = Qe), t;
812
825
  }
813
826
  };
814
- function tn(t, e) {
815
- const n = Qe.fromEditor(t).getExtensionRep(e);
816
- return void 0 === n && Ce(303, e.name), n.getExtensionDependency();
827
+ function on(t, e) {
828
+ const n = nn.fromEditor(t).getExtensionRep(e);
829
+ return void 0 === n && Ie(303, e.name), n.getExtensionDependency();
817
830
  }
818
- function en(t, e) {
819
- const n = Qe.maybeFromEditor(t);
831
+ function sn(t, e) {
832
+ const n = nn.maybeFromEditor(t);
820
833
  if (!n) return;
821
834
  const i = n.extensionNameMap.get(e);
822
835
  return i ? i.getExtensionDependency() : void 0;
823
836
  }
824
- function nn(t, e) {
825
- const n = en(t, e);
826
- return void 0 === n && Ce(291, e), n;
837
+ function rn(t, e) {
838
+ const n = sn(t, e);
839
+ return void 0 === n && Ie(291, e), n;
827
840
  }
828
- function on(t) {
829
- return tn($getEditor(), t);
841
+ function cn(t) {
842
+ return on($getEditor(), t);
830
843
  }
831
- function sn(t) {
832
- return on(t).output;
844
+ function an(t) {
845
+ return cn(t).output;
833
846
  }
834
- function rn(t) {
835
- return en($getEditor(), t);
847
+ function dn(t) {
848
+ return sn($getEditor(), t);
836
849
  }
837
- const cn = /* @__PURE__ */ new Set(), an = /* @__PURE__ */ defineExtension({
850
+ const ln = /* @__PURE__ */ new Set();
851
+ const un = /* @__PURE__ */ defineExtension({
838
852
  build(t, e, n) {
839
- const i = n.getDependency(Oe).output, o = Ht({ watchedNodeKeys: /* @__PURE__ */ new Map() }), s = Ne(() => {}, () => se(() => {
853
+ const i = n.getDependency(De).output, o = Yt({ watchedNodeKeys: /* @__PURE__ */ new Map() }), s = Ce(() => {}, () => ce(() => {
840
854
  const t = s.peek(), { watchedNodeKeys: e } = o.value;
841
855
  let n, c = !1;
842
856
  i.value.read(() => {
@@ -851,36 +865,28 @@ const cn = /* @__PURE__ */ new Set(), an = /* @__PURE__ */ defineExtension({
851
865
  }), !c && n && t && n.size === t.size || (s.value = n);
852
866
  }));
853
867
  return { watchNodeKey: function(t) {
854
- const e = te(() => (s.value || cn).has(t)), { watchedNodeKeys: n } = o.peek();
868
+ const e = ne(() => (s.value || ln).has(t)), { watchedNodeKeys: n } = o.peek();
855
869
  let i = n.get(t);
856
870
  const r = void 0 !== i;
857
871
  return i = i || /* @__PURE__ */ new Set(), i.add(e), r || (n.set(t, i), o.value = { watchedNodeKeys: n }), e;
858
872
  } };
859
873
  },
860
- dependencies: [Oe],
874
+ dependencies: [De],
861
875
  name: "@lexical/extension/NodeSelection"
862
- }), dn = /* @__PURE__ */ createCommand("INSERT_HORIZONTAL_RULE_COMMAND");
863
- var un = class un extends DecoratorNode {
864
- static getType() {
865
- return "horizontalrule";
866
- }
867
- static clone(t) {
868
- return new un(t.__key);
869
- }
870
- static importJSON(t) {
871
- return fn().updateFromJSON(t);
872
- }
873
- static importDOM() {
874
- return { hr: () => ({
875
- conversion: ln,
876
+ });
877
+ const fn = /* @__PURE__ */ createCommand("INSERT_HORIZONTAL_RULE_COMMAND");
878
+ var hn = class extends DecoratorNode {
879
+ $config() {
880
+ return this.config("horizontalrule", { importDOM: { hr: () => ({
881
+ conversion: gn,
876
882
  priority: 0
877
- }) };
883
+ }) } });
878
884
  }
879
885
  exportDOM() {
880
- return { element: document.createElement("hr") };
886
+ return { element: $getDocument().createElement("hr") };
881
887
  }
882
888
  createDOM(t) {
883
- const e = document.createElement("hr");
889
+ const e = $getDocument().createElement("hr");
884
890
  return addClassNamesToElement(e, t.theme.hr), e;
885
891
  }
886
892
  getTextContent() {
@@ -893,63 +899,64 @@ var un = class un extends DecoratorNode {
893
899
  return !1;
894
900
  }
895
901
  };
896
- function ln() {
897
- return { node: fn() };
902
+ function gn() {
903
+ return { node: pn() };
898
904
  }
899
- function fn() {
900
- return $create(un);
905
+ function pn() {
906
+ return $create(hn);
901
907
  }
902
- function hn(t) {
903
- return t instanceof un;
908
+ function mn(t) {
909
+ return t instanceof hn;
904
910
  }
905
- const gn = /* @__PURE__ */ defineExtension({
906
- dependencies: [Oe, an],
911
+ const vn = /* @__PURE__ */ defineExtension({
912
+ dependencies: [De, un],
907
913
  name: "@lexical/extension/HorizontalRule",
908
- nodes: () => [un],
914
+ nodes: () => [hn],
909
915
  register(t, e, n) {
910
- const { watchNodeKey: i } = n.getDependency(an).output, s = Ht({ nodeSelections: /* @__PURE__ */ new Map() }), c = t._config.theme.hrSelected ?? "selected";
911
- return mergeRegister(t.registerCommand(dn, (t) => {
916
+ const { watchNodeKey: i } = n.getDependency(un).output, s = Yt({ nodeSelections: /* @__PURE__ */ new Map() }), c = t._config.theme.hrSelected ?? "selected";
917
+ return mergeRegister(t.registerCommand(fn, (t) => {
912
918
  const e = $getSelection();
913
919
  if (!$isRangeSelection(e)) return !1;
914
- if (null !== e.focus.getNode()) $insertNodeToNearestRoot(fn());
920
+ if (null !== e.focus.getNode()) $insertNodeToNearestRoot(pn());
915
921
  return !0;
916
922
  }, COMMAND_PRIORITY_EDITOR), t.registerCommand(CLICK_COMMAND, (t) => {
917
923
  if (isDOMNode(t.target)) {
918
924
  const e = $getNodeFromDOMNode(t.target);
919
- if (hn(e)) return function(t, e = !1) {
925
+ if (mn(e)) return function(t, e = !1) {
920
926
  const n = $getSelection(), i = t.isSelected(), o = t.getKey();
921
927
  let s;
922
928
  e && $isNodeSelection(n) ? s = n : (s = $createNodeSelection(), $setSelection(s)), i ? s.delete(o) : s.add(o);
923
929
  }(e, t.shiftKey), !0;
924
930
  }
925
931
  return !1;
926
- }, COMMAND_PRIORITY_LOW), t.registerMutationListener(un, (e, n) => {
927
- Kt(() => {
932
+ }, COMMAND_PRIORITY_LOW), t.registerMutationListener(hn, (e, n) => {
933
+ jt(() => {
928
934
  let n = !1;
929
935
  const { nodeSelections: o } = s.peek();
930
936
  for (const [s, r] of e.entries()) if ("destroyed" === r) o.delete(s), n = !0;
931
937
  else {
932
938
  const e = o.get(s), r = t.getElementByKey(s);
933
939
  e ? e.domNode.value = r : (n = !0, o.set(s, {
934
- domNode: Ht(r),
940
+ domNode: Yt(r),
935
941
  selectedSignal: i(s)
936
942
  }));
937
943
  }
938
944
  n && (s.value = { nodeSelections: o });
939
945
  });
940
- }), se(() => {
946
+ }), ce(() => {
941
947
  const t = [];
942
- for (const { domNode: e, selectedSignal: n } of s.value.nodeSelections.values()) t.push(se(() => {
948
+ for (const { domNode: e, selectedSignal: n } of s.value.nodeSelections.values()) t.push(ce(() => {
943
949
  const t = e.value;
944
950
  if (t) n.value ? addClassNamesToElement(t, c) : removeClassNamesFromElement(t, c);
945
951
  }));
946
952
  return mergeRegister(...t);
947
953
  }));
948
954
  }
949
- }), pn = /* @__PURE__ */ defineExtension({
955
+ });
956
+ const xn = /* @__PURE__ */ defineExtension({
950
957
  build: (t) => ({
951
- composingTextNode: Ht(null),
952
- compositionKey: Ht(null)
958
+ composingTextNode: Yt(null),
959
+ compositionKey: Yt(null)
953
960
  }),
954
961
  name: "@lexical/extension/IME",
955
962
  register(t, e, n) {
@@ -957,7 +964,7 @@ const gn = /* @__PURE__ */ defineExtension({
957
964
  return mergeRegister(t.registerCommand(COMPOSITION_START_COMMAND, () => {
958
965
  const t = $getSelection();
959
966
  return $isRangeSelection(t) && (i.value = t.anchor.key), !1;
960
- }, COMMAND_PRIORITY_BEFORE_EDITOR), se(() => {
967
+ }, COMMAND_PRIORITY_BEFORE_EDITOR), ce(() => {
961
968
  const e = i.value;
962
969
  o.value = null !== e ? t.read("latest", () => {
963
970
  const t = $getNodeByKey(e);
@@ -972,21 +979,18 @@ const gn = /* @__PURE__ */ defineExtension({
972
979
  });
973
980
  }), t.registerRootListener((t) => {
974
981
  if (null === t) return void (i.value = null);
975
- const e = () => {
982
+ return registerEventListener(t, "compositionend", () => {
976
983
  i.value = null;
977
- };
978
- return t.addEventListener("compositionend", e), () => {
979
- t.removeEventListener("compositionend", e);
980
- };
984
+ });
981
985
  }));
982
986
  }
983
987
  });
984
- const mn = /* @__PURE__ */ defineExtension({
985
- build: (t, e) => re({ inheritEditableFromParent: e.inheritEditableFromParent }),
988
+ const yn = /* @__PURE__ */ defineExtension({
989
+ build: (t, e) => ae({ inheritEditableFromParent: e.inheritEditableFromParent }),
986
990
  config: /* @__PURE__ */ safeCast({
987
991
  $getParentEditor: function() {
988
992
  const t = $getEditor();
989
- return Qe.fromEditor(t), t;
993
+ return nn.fromEditor(t), t;
990
994
  },
991
995
  inheritEditableFromParent: !1
992
996
  }),
@@ -995,20 +999,21 @@ const mn = /* @__PURE__ */ defineExtension({
995
999
  t.parentEditor = i, t.theme = t.theme || i._config.theme;
996
1000
  },
997
1001
  name: "@lexical/extension/NestedEditor",
998
- register: (t, e, n) => se(() => {
1002
+ register: (t, e, n) => ce(() => {
999
1003
  const e = t._parentEditor;
1000
1004
  if (e && n.getOutput().inheritEditableFromParent.value) return t.setEditable(e.isEditable()), e.registerEditableListener(t.setEditable.bind(t));
1001
1005
  })
1002
- }), vn = /* @__PURE__ */ defineExtension({
1006
+ });
1007
+ const En = /* @__PURE__ */ defineExtension({
1003
1008
  config: /* @__PURE__ */ safeCast({
1004
1009
  attribute: "data-selected",
1005
1010
  nodes: []
1006
1011
  }),
1007
1012
  init(t, e) {
1008
- const n = /* @__PURE__ */ new Set(), i = getRegisteredSubtypeMap(ge(t).nodes);
1013
+ const n = /* @__PURE__ */ new Set(), i = getRegisteredSubtypeMap(me(t).nodes);
1009
1014
  for (const t of e.nodes) {
1010
1015
  const e = t.getType(), o = i.get(e);
1011
- void 0 === o && Ce(339, t.name, e), n.add(e);
1016
+ void 0 === o && Ie(339, t.name, e), n.add(e);
1012
1017
  for (const t of o) n.add(t);
1013
1018
  }
1014
1019
  return { matchTypes: n };
@@ -1040,26 +1045,27 @@ const mn = /* @__PURE__ */ defineExtension({
1040
1045
  };
1041
1046
  }
1042
1047
  });
1043
- function En(t) {
1048
+ function bn(t) {
1044
1049
  $isElementNode(t) && t.isInline() && t.isEmpty() && t.remove();
1045
1050
  }
1046
- const yn = /* @__PURE__ */ defineExtension({
1047
- build: (t, e, n) => re(e),
1051
+ const Sn = /* @__PURE__ */ defineExtension({
1052
+ build: (t, e, n) => ae(e),
1048
1053
  config: /* @__PURE__ */ safeCast({ disabled: !1 }),
1049
1054
  name: "@lexical/NormalizeInlineElements",
1050
1055
  register: (t, e, n) => {
1051
1056
  const i = n.getOutput();
1052
- return se(() => {
1057
+ return ce(() => {
1053
1058
  if (!i.disabled.value) {
1054
1059
  const e = [];
1055
- for (const { klass: n, transforms: i } of t._nodes.values()) n.prototype instanceof ElementNode && n.prototype.isInline !== ElementNode.prototype.isInline && (i.add(En), e.push(() => i.delete(En)));
1060
+ for (const { klass: n, transforms: i } of t._nodes.values()) n.prototype instanceof ElementNode && n.prototype.isInline !== ElementNode.prototype.isInline && (i.add(bn), e.push(() => i.delete(bn)));
1056
1061
  return () => e.forEach((t) => t());
1057
1062
  }
1058
1063
  });
1059
1064
  }
1060
- }), xn = /* @__PURE__ */ new Set([SKIP_SELECTION_FOCUS_TAG, SKIP_SCROLL_INTO_VIEW_TAG]);
1061
- const bn = /* @__PURE__ */ defineExtension({
1062
- build: (t, e, n) => re(e),
1065
+ });
1066
+ const wn = /* @__PURE__ */ new Set([SKIP_SELECTION_FOCUS_TAG, SKIP_SCROLL_INTO_VIEW_TAG]);
1067
+ const Nn = /* @__PURE__ */ defineExtension({
1068
+ build: (t, e, n) => ae(e),
1063
1069
  config: /* @__PURE__ */ safeCast({
1064
1070
  $fixFocusOverselection: function() {
1065
1071
  const t = $getSelection();
@@ -1069,7 +1075,7 @@ const bn = /* @__PURE__ */ defineExtension({
1069
1075
  for ($isTextPointCaret(n) && e.anchor.origin !== n.origin && 0 === n.offset && (n = $rewindSiblingCaret(n.getSiblingCaret())), $isSiblingCaret(n) && e.anchor.origin !== n.origin && $isLineBreakNode(n.origin) && (n = $rewindSiblingCaret(n)); $isChildCaret(n) && e.anchor.origin !== n.origin;) n = $rewindSiblingCaret($getSiblingCaret(n.origin, "next"));
1070
1076
  if ($isSiblingCaret(n) && $isElementNode(n.origin) && (n = $normalizeCaret($getChildCaret(n.origin, "previous")).getFlipped()), n = $normalizeCaret(n), !n.isSamePointCaret(e.focus)) {
1071
1077
  const t = $setSelectionFromCaretRange($getCaretRange(e.anchor, n)), i = $getEditor().getRootElement(), o = i && getDOMSelection(i.ownerDocument.defaultView);
1072
- o && $updateDOMSelection($getPreviousSelection(), t, $getEditor(), o, xn, i);
1078
+ o && $updateDOMSelection($getPreviousSelection(), t, $getEditor(), o, wn, i);
1073
1079
  }
1074
1080
  }
1075
1081
  },
@@ -1078,7 +1084,7 @@ const bn = /* @__PURE__ */ defineExtension({
1078
1084
  thresholdMsec: 100
1079
1085
  }),
1080
1086
  name: "@lexical/NormalizeTripleClickSelection",
1081
- register: (t, e, n) => se(() => {
1087
+ register: (t, e, n) => ce(() => {
1082
1088
  const e = n.getOutput();
1083
1089
  if (!e.disabled.value) return t.registerRootListener((n) => {
1084
1090
  if (!n) return;
@@ -1090,46 +1096,52 @@ const bn = /* @__PURE__ */ defineExtension({
1090
1096
  }
1091
1097
  return i;
1092
1098
  };
1093
- return mergeRegister(t.registerCommand(SELECTION_CHANGE_COMMAND, () => (o(null) && (i = 0, e.$fixFocusOverselection.peek()()), !1), COMMAND_PRIORITY_BEFORE_CRITICAL), (() => {
1094
- const t = ["mouseup", "mousedown"];
1095
- return t.forEach((t) => n.addEventListener(t, o, !0)), () => t.forEach((t) => n.removeEventListener(t, o, !0));
1096
- })());
1099
+ return mergeRegister(t.registerCommand(SELECTION_CHANGE_COMMAND, () => (o(null) && (i = 0, e.$fixFocusOverselection.peek()()), !1), COMMAND_PRIORITY_BEFORE_CRITICAL), registerEventListeners(n, {
1100
+ mousedown: o,
1101
+ mouseup: o
1102
+ }, !0));
1097
1103
  });
1098
1104
  })
1099
1105
  });
1100
- function Sn(t) {
1106
+ function On(t) {
1101
1107
  const e = t.target;
1102
1108
  isExactShortcutMatch(t, "a", {
1103
1109
  ctrlKey: !IS_APPLE,
1104
1110
  metaKey: IS_APPLE
1105
1111
  }) && isHTMLElement(e) && ("INPUT" === e.tagName || "TEXTAREA" === e.tagName) && e.addEventListener("keydown", stopLexicalPropagation, { once: !0 });
1106
1112
  }
1107
- const wn = /* @__PURE__ */ defineExtension({
1108
- build: (t, e, n) => re(e),
1113
+ const Rn = /* @__PURE__ */ defineExtension({
1114
+ build: (t, e, n) => ae(e),
1109
1115
  config: /* @__PURE__ */ safeCast({ disabled: !1 }),
1110
1116
  name: "@lexical/extension/PreventSelectAll",
1111
1117
  register: (t, e, n) => {
1112
1118
  const i = n.getOutput();
1113
- return se(() => {
1119
+ return ce(() => {
1114
1120
  if (!i.disabled.value) return t.registerRootListener((t) => {
1115
- if (t) return t.addEventListener("keydown", Sn, !0), () => t.removeEventListener("keydown", Sn, !0);
1121
+ if (t) return registerEventListener(t, "keydown", On, !0);
1116
1122
  });
1117
1123
  });
1118
1124
  }
1119
1125
  });
1120
- const Nn = /* @__PURE__ */ defineExtension({
1121
- build: (t, e, n) => re(e),
1126
+ const Cn = /* @__PURE__ */ defineExtension({
1127
+ build: (t) => Ce(() => t.getRootElement(), (e) => t.registerRootListener((t) => {
1128
+ e.value = t;
1129
+ })),
1130
+ name: "@lexical/extension/RootElement"
1131
+ });
1132
+ const Dn = /* @__PURE__ */ defineExtension({
1133
+ build: (t, e, n) => ae(e),
1122
1134
  config: /* @__PURE__ */ safeCast({
1123
1135
  cascadeSelection: !1,
1124
1136
  disabled: !1
1125
1137
  }),
1126
- dependencies: [wn],
1138
+ dependencies: [Rn],
1127
1139
  name: "@lexical/extension/SelectBlock",
1128
1140
  register: (t, e, n) => {
1129
- const i = n.getOutput(), o = n.getDependency(wn).output;
1130
- return mergeRegister(se(() => {
1141
+ const i = n.getOutput(), o = n.getDependency(Rn).output;
1142
+ return mergeRegister(ce(() => {
1131
1143
  o.disabled.value = i.disabled.value;
1132
- }), se(() => {
1144
+ }), ce(() => {
1133
1145
  if (!i.disabled.value) return t.registerCommand(SELECT_ALL_COMMAND, (e, n) => {
1134
1146
  if (n !== t) {
1135
1147
  if (!i.cascadeSelection.peek()) return !1;
@@ -1147,8 +1159,8 @@ const Nn = /* @__PURE__ */ defineExtension({
1147
1159
  }
1148
1160
  var c;
1149
1161
  if (!$isRangeSelection(o)) return !1;
1150
- const d = o.anchor.getNode(), l = d.getTopLevelElement();
1151
- if (l && l.is(o.focus.getNode().getTopLevelElement()) && !$isBlockFullySelected(l, o)) return l.select(0, l.getChildrenSize()), !0;
1162
+ const d = o.anchor.getNode(), u = d.getTopLevelElement();
1163
+ if (u && u.is(o.focus.getNode().getTopLevelElement()) && !$isBlockFullySelected(u, o)) return u.select(0, u.getChildrenSize()), !0;
1152
1164
  let f = $getSlotFrame(d);
1153
1165
  for (; null !== f;) {
1154
1166
  if ($isElementNode(f) && !$isBlockFullySelected(f, o)) return f.select(0, f.getChildrenSize()), !0;
@@ -1159,8 +1171,9 @@ const Nn = /* @__PURE__ */ defineExtension({
1159
1171
  }, COMMAND_PRIORITY_LOW);
1160
1172
  }));
1161
1173
  }
1162
- }), On = /* @__PURE__ */ defineExtension({
1163
- build: (t, e, n) => re(e),
1174
+ });
1175
+ const In = /* @__PURE__ */ defineExtension({
1176
+ build: (t, e, n) => ae(e),
1164
1177
  config: /* @__PURE__ */ safeCast({
1165
1178
  disabled: !1,
1166
1179
  onReposition: void 0
@@ -1168,15 +1181,15 @@ const Nn = /* @__PURE__ */ defineExtension({
1168
1181
  name: "@lexical/utils/SelectionAlwaysOnDisplay",
1169
1182
  register: (t, e, n) => {
1170
1183
  const i = n.getOutput();
1171
- return se(() => {
1184
+ return ce(() => {
1172
1185
  if (!i.disabled.value) return selectionAlwaysOnDisplay(t, i.onReposition.value);
1173
1186
  });
1174
1187
  }
1175
1188
  });
1176
- function Cn(t) {
1189
+ function Fn(t) {
1177
1190
  return t.canIndent();
1178
1191
  }
1179
- function Rn(t, e, n = Cn) {
1192
+ function Mn(t, e, n = Fn) {
1180
1193
  return mergeRegister(t.registerCommand(KEY_TAB_COMMAND, (e) => {
1181
1194
  const n = $getSelection();
1182
1195
  if (!$isRangeSelection(n)) return !1;
@@ -1191,7 +1204,7 @@ function Rn(t, e, n = Cn) {
1191
1204
  }
1192
1205
  return !1;
1193
1206
  }(n) ? e.shiftKey ? OUTDENT_CONTENT_COMMAND : INDENT_CONTENT_COMMAND : INSERT_TAB_COMMAND;
1194
- return t.dispatchCommand(i, void 0);
1207
+ return t.dispatchCommand(i);
1195
1208
  }, COMMAND_PRIORITY_EDITOR), t.registerCommand(INDENT_CONTENT_COMMAND, () => {
1196
1209
  const t = "number" == typeof e ? e : e ? e.peek() : null;
1197
1210
  if (!$isRangeSelection($getSelection())) return !1;
@@ -1204,25 +1217,26 @@ function Rn(t, e, n = Cn) {
1204
1217
  });
1205
1218
  }, COMMAND_PRIORITY_CRITICAL));
1206
1219
  }
1207
- const Dn = /* @__PURE__ */ defineExtension({
1208
- build: (t, e, n) => re(e),
1220
+ const kn = /* @__PURE__ */ defineExtension({
1221
+ build: (t, e, n) => ae(e),
1209
1222
  config: /* @__PURE__ */ safeCast({
1210
- $canIndent: Cn,
1223
+ $canIndent: Fn,
1211
1224
  disabled: !1,
1212
1225
  maxIndent: null
1213
1226
  }),
1214
1227
  name: "@lexical/extension/TabIndentation",
1215
1228
  register(t, e, n) {
1216
1229
  const { disabled: i, maxIndent: o, $canIndent: s } = n.getOutput();
1217
- return se(() => {
1218
- if (!i.value) return Rn(t, o, s);
1230
+ return ce(() => {
1231
+ if (!i.value) return Mn(t, o, s);
1219
1232
  });
1220
1233
  }
1221
- }), In = /* @__PURE__ */ defineExtension({
1222
- build: (t) => Ne(() => t.isEditable(), (e) => t.registerEditableListener((t) => {
1234
+ });
1235
+ const _n = /* @__PURE__ */ defineExtension({
1236
+ build: (t) => Ce(() => t.isEditable(), (e) => t.registerEditableListener((t) => {
1223
1237
  e.value = t;
1224
1238
  })),
1225
1239
  name: "@lexical/extension/WatchEditable"
1226
1240
  });
1227
1241
  //#endregion
1228
- export { fn as $createHorizontalRuleNode, le as $defaultShouldInsertAfter, on as $getExtensionDependency, sn as $getExtensionOutput, rn as $getPeerDependency, Ee as $isDecoratorTextNode, hn as $isHorizontalRuleNode, ce as AutoFocusExtension, ue as ClearEditorExtension, he as ClickAfterLastBlockExtension, we as DecoratorTextExtension, ve as DecoratorTextNode, Oe as EditorStateExtension, gn as HorizontalRuleExtension, un as HorizontalRuleNode, pn as IMEExtension, dn as INSERT_HORIZONTAL_RULE_COMMAND, Ge as InitialStateExtension, Qe as LexicalBuilder, mn as NestedEditorExtension, vn as NodeSelectionDataSelectedExtension, an as NodeSelectionExtension, yn as NormalizeInlineElementsExtension, bn as NormalizeTripleClickSelectionExtension, wn as PreventSelectAllExtension, Nn as SelectBlockExtension, On as SelectionAlwaysOnDisplayExtension, Dn as TabIndentationExtension, In as WatchEditableExtension, ye as applyFormatFromStyle, xe as applyFormatToDom, Kt as batch, Je as buildEditorFromExtensions, te as computed, configExtension, declarePeerDependency, defineExtension, se as effect, tn as getExtensionDependencyFromEditor, ge as getKnownTypesAndNodes, en as getPeerDependencyFromEditor, nn as getPeerDependencyFromEditorOrThrow, re as namedSignals, de as registerClearEditor, Rn as registerTabIndentation, safeCast, shallowMergeConfig, Ht as signal, jt as untracked, Ne as watchedSignal };
1242
+ export { we as $applyFormatToDom, pn as $createHorizontalRuleNode, he as $defaultShouldInsertAfter, cn as $getExtensionDependency, an as $getExtensionOutput, dn as $getPeerDependency, Ee as $isDecoratorTextNode, mn as $isHorizontalRuleNode, de as AutoFocusExtension, fe as ClearEditorExtension, pe as ClickAfterLastBlockExtension, Re as DecoratorTextExtension, ye as DecoratorTextNode, De as EditorStateExtension, vn as HorizontalRuleExtension, hn as HorizontalRuleNode, xn as IMEExtension, fn as INSERT_HORIZONTAL_RULE_COMMAND, Je as InitialStateExtension, nn as LexicalBuilder, yn as NestedEditorExtension, En as NodeSelectionDataSelectedExtension, un as NodeSelectionExtension, Sn as NormalizeInlineElementsExtension, Nn as NormalizeTripleClickSelectionExtension, Rn as PreventSelectAllExtension, Cn as RootElementExtension, Dn as SelectBlockExtension, In as SelectionAlwaysOnDisplayExtension, kn as TabIndentationExtension, _n as WatchEditableExtension, be as applyFormatFromStyle, Se as applyFormatToDom, jt as batch, Ye as buildEditorFromExtensions, ne as computed, configExtension, declarePeerDependency, defineExtension, ce as effect, on as getExtensionDependencyFromEditor, me as getKnownTypesAndNodes, sn as getPeerDependencyFromEditor, rn as getPeerDependencyFromEditorOrThrow, ae as namedSignals, ue as registerClearEditor, Mn as registerTabIndentation, safeCast, shallowMergeConfig, Yt as signal, Ut as untracked, Ce as watchedSignal };