@mx-space/cli 0.13.0 → 0.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -1
- package/dist/{Lexical.dev-By5dOKBN.mjs → Lexical.dev-BsbWMhb3.mjs} +2265 -429
- package/dist/{Lexical.node-fXM8Jp7p.mjs → Lexical.node-DnR_u_Ke.mjs} +47 -10
- package/dist/Lexical.prod-B7L8eVsO.mjs +6816 -0
- package/dist/{LexicalClipboard.dev--HxGoSkO.mjs → LexicalClipboard.dev-BGSFbuTA.mjs} +131 -39
- package/dist/{LexicalClipboard.node-C3mRbrmW.mjs → LexicalClipboard.node-CUD_tpWb.mjs} +2 -2
- package/dist/LexicalClipboard.prod-DQXfRt3h.mjs +429 -0
- package/dist/{LexicalCodeCore.dev-DjSrd4A4.mjs → LexicalCodeCore.dev-B9lK_GSN.mjs} +81 -67
- package/dist/LexicalCodeCore.prod-CNWMPXhg.mjs +651 -0
- package/dist/LexicalDragon.dev-DRm2bGZ1.mjs +186 -0
- package/dist/{LexicalDragon.node-BVhw4C7s.mjs → LexicalDragon.node-d8gPruly.mjs} +3 -2
- package/dist/LexicalDragon.prod-ey3uKDJF.mjs +121 -0
- package/dist/{LexicalExtension.dev-BPNyvGqe.mjs → LexicalExtension.dev-CXtOJb83.mjs} +349 -35
- package/dist/{LexicalExtension.node-BVlcrgOx.mjs → LexicalExtension.node-CMsupJZs.mjs} +9 -4
- package/dist/{LexicalExtension.prod-DFKbiNt-.mjs → LexicalExtension.prod-BCLGhzcg.mjs} +477 -328
- package/dist/{LexicalHeadless.dev-B-cj7Pr5.mjs → LexicalHeadless.dev-yVDOBd64.mjs} +2 -2
- package/dist/{LexicalHeadless.prod-Byp1vNzT.mjs → LexicalHeadless.prod-B8qauuEA.mjs} +2 -2
- package/dist/{LexicalHtml.dev-prBAwszN.mjs → LexicalHtml.dev-3rdckXIU.mjs} +323 -265
- package/dist/{LexicalHtml.node-BvNF96jZ.mjs → LexicalHtml.node-DagZUjQ_.mjs} +6 -4
- package/dist/{LexicalHtml.prod-Sz3CW1ht.mjs → LexicalHtml.prod-B5AQaJDb.mjs} +354 -352
- package/dist/{LexicalLink.dev-NySTYhVR.mjs → LexicalLink.dev-CspSwLNB.mjs} +69 -58
- package/dist/{LexicalLink.prod-BuCM8gts.mjs → LexicalLink.prod-Da-ZW6H5.mjs} +210 -211
- package/dist/{LexicalList.dev-DIMOvSFD.mjs → LexicalList.dev-CNXmV6v8.mjs} +246 -198
- package/dist/LexicalList.prod-DgQzj4v9.mjs +944 -0
- package/dist/{LexicalMarkdown.dev-C7aylvCG.mjs → LexicalMarkdown.dev-0XURdo96.mjs} +129 -37
- package/dist/LexicalMarkdown.prod-qUsIQfJx.mjs +932 -0
- package/dist/{LexicalRichText.dev-DfICq6lU.mjs → LexicalRichText.dev-BqsEA7I9.mjs} +151 -122
- package/dist/{LexicalRichText.node-Bg9jND3Q.mjs → LexicalRichText.node-D73RR0Ck.mjs} +8 -11
- package/dist/LexicalRichText.prod-4Atyd7OR.mjs +538 -0
- package/dist/{LexicalSelection.dev-DGjj12wW.mjs → LexicalSelection.dev-DK5xfxKP.mjs} +10 -9
- package/dist/{LexicalSelection.node-BU5L4193.mjs → LexicalSelection.node-pyZyrANz.mjs} +4 -4
- package/dist/{LexicalSelection.prod-D-PwRbyK.mjs → LexicalSelection.prod-C5GrCbDC.mjs} +144 -146
- package/dist/{LexicalTable.dev-ChP7cugd.mjs → LexicalTable.dev-DiR_4rdI.mjs} +184 -119
- package/dist/LexicalTable.prod-Cbc5EasT.mjs +2336 -0
- package/dist/{LexicalUtils.dev-BiFU3789.mjs → LexicalUtils.dev-jhPjn1vQ.mjs} +375 -35
- package/dist/{LexicalUtils.node-j3Llm7Y3.mjs → LexicalUtils.node-Ck74ludK.mjs} +24 -12
- package/dist/LexicalUtils.prod-nuTBxnk_.mjs +504 -0
- package/dist/bin/mxs.mjs +1 -1
- package/dist/esm-BumPuCXw.mjs +2 -0
- package/dist/{esm-lpolVSUJ.mjs → esm-DupC6TTP.mjs} +172 -172
- package/dist/index.d.mts +16 -16
- package/dist/index.mjs +1 -1
- package/dist/{mxs-PFV8OJ-M.mjs → mxs-BgAyMQdq.mjs} +1595 -314
- package/package.json +17 -17
- package/dist/Lexical.prod-BlCvXPGa.mjs +0 -6088
- package/dist/LexicalClipboard.prod-DNJzFMcT.mjs +0 -371
- package/dist/LexicalCodeCore.prod-DTDShkR3.mjs +0 -642
- package/dist/LexicalDragon.dev-DwprRH0z.mjs +0 -88
- package/dist/LexicalDragon.prod-nh4J-8vn.mjs +0 -59
- package/dist/LexicalList.prod-MVqfA6Vo.mjs +0 -925
- package/dist/LexicalMarkdown.prod-CfQSM406.mjs +0 -868
- package/dist/LexicalRichText.prod-GsFzCK-o.mjs +0 -550
- package/dist/LexicalTable.prod-Bpr9YRXp.mjs +0 -2311
- package/dist/LexicalUtils.prod-DCvrA78p.mjs +0 -373
- package/dist/esm-DGvoYR6n.mjs +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
//#region ../../node_modules/.pnpm/@lexical+extension@0.
|
|
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-DnR_u_Ke.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-Ck74ludK.mjs";
|
|
3
|
+
//#region ../../node_modules/.pnpm/@lexical+extension@0.46.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 { c as $insertNodeToNearestRoot, i as $getNearestBlockElementAncestorOrTh
|
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*
|
|
10
10
|
*/
|
|
11
|
-
const
|
|
12
|
-
function
|
|
13
|
-
if (
|
|
11
|
+
const At = Symbol.for("preact-signals");
|
|
12
|
+
function Pt() {
|
|
13
|
+
if (Ut > 1) return void Ut--;
|
|
14
14
|
let t, e = !1;
|
|
15
15
|
for (function() {
|
|
16
|
-
let t =
|
|
17
|
-
for (
|
|
18
|
-
}(); void 0 !==
|
|
19
|
-
let n =
|
|
20
|
-
for (
|
|
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;) {
|
|
21
21
|
const i = n.u;
|
|
22
|
-
if (n.u = void 0, n.f &= -3, !(8 & n.f) &&
|
|
22
|
+
if (n.u = void 0, n.f &= -3, !(8 & n.f) && Xt(n)) try {
|
|
23
23
|
n.c();
|
|
24
24
|
} catch (n) {
|
|
25
25
|
e || (t = n, e = !0);
|
|
@@ -27,53 +27,53 @@ function St() {
|
|
|
27
27
|
n = i;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
if (
|
|
30
|
+
if (Wt = 0, Ut--, e) throw t;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
if (
|
|
34
|
-
|
|
32
|
+
function Kt(t) {
|
|
33
|
+
if (Ut > 0) return t();
|
|
34
|
+
Vt = ++Bt, Ut++;
|
|
35
35
|
try {
|
|
36
36
|
return t();
|
|
37
37
|
} finally {
|
|
38
|
-
|
|
38
|
+
Pt();
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
let
|
|
42
|
-
function
|
|
43
|
-
const e =
|
|
44
|
-
|
|
41
|
+
let $t, Tt;
|
|
42
|
+
function jt(t) {
|
|
43
|
+
const e = $t;
|
|
44
|
+
$t = void 0;
|
|
45
45
|
try {
|
|
46
46
|
return t();
|
|
47
47
|
} finally {
|
|
48
|
-
|
|
48
|
+
$t = e;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
let
|
|
52
|
-
function
|
|
53
|
-
if (void 0 ===
|
|
51
|
+
let zt, Ut = 0, Wt = 0, Bt = 0, Vt = 0, Gt = 0;
|
|
52
|
+
function Zt(t) {
|
|
53
|
+
if (void 0 === $t) return;
|
|
54
54
|
let e = t.n;
|
|
55
|
-
return void 0 === e || e.t !==
|
|
55
|
+
return void 0 === e || e.t !== $t ? (e = {
|
|
56
56
|
i: 0,
|
|
57
57
|
S: t,
|
|
58
|
-
p:
|
|
58
|
+
p: $t.s,
|
|
59
59
|
n: void 0,
|
|
60
|
-
t:
|
|
60
|
+
t: $t,
|
|
61
61
|
e: void 0,
|
|
62
62
|
x: void 0,
|
|
63
63
|
r: e
|
|
64
|
-
}, void 0 !==
|
|
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;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function Jt(t, e) {
|
|
67
67
|
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
68
|
}
|
|
69
|
-
function
|
|
70
|
-
return new
|
|
69
|
+
function Ht(t, e) {
|
|
70
|
+
return new Jt(t, e);
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function Xt(t) {
|
|
73
73
|
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
74
|
return !1;
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function Yt(t) {
|
|
77
77
|
for (let e = t.s; void 0 !== e; e = e.n) {
|
|
78
78
|
const n = e.S.n;
|
|
79
79
|
if (void 0 !== n && (e.r = n), e.S.n = e, e.i = -1, void 0 === e.n) {
|
|
@@ -82,7 +82,7 @@ function $t(t) {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function qt(t) {
|
|
86
86
|
let e, n = t.s;
|
|
87
87
|
for (; void 0 !== n;) {
|
|
88
88
|
const t = n.p;
|
|
@@ -90,40 +90,40 @@ function Lt(t) {
|
|
|
90
90
|
}
|
|
91
91
|
t.s = e;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
|
|
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;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
97
|
-
return new
|
|
96
|
+
function te(t, e) {
|
|
97
|
+
return new Qt(t, e);
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function ee(t) {
|
|
100
100
|
const e = t.m;
|
|
101
101
|
if (t.m = void 0, "function" == typeof e) {
|
|
102
|
-
|
|
103
|
-
const n =
|
|
104
|
-
|
|
102
|
+
Ut++;
|
|
103
|
+
const n = $t;
|
|
104
|
+
$t = void 0;
|
|
105
105
|
try {
|
|
106
106
|
e();
|
|
107
107
|
} catch (e) {
|
|
108
|
-
throw t.f &= -2, t.f |= 8,
|
|
108
|
+
throw t.f &= -2, t.f |= 8, ne(t), e;
|
|
109
109
|
} finally {
|
|
110
|
-
|
|
110
|
+
$t = n, Pt();
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function ne(t) {
|
|
115
115
|
for (let e = t.s; void 0 !== e; e = e.n) e.S.U(e);
|
|
116
|
-
t.x = void 0, t.s = void 0,
|
|
116
|
+
t.x = void 0, t.s = void 0, ee(t);
|
|
117
117
|
}
|
|
118
|
-
function
|
|
119
|
-
if (
|
|
120
|
-
|
|
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();
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function oe(t, e) {
|
|
123
123
|
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
124
|
}
|
|
125
|
-
function
|
|
126
|
-
const n = new
|
|
125
|
+
function se(t, e) {
|
|
126
|
+
const n = new oe(t, e);
|
|
127
127
|
try {
|
|
128
128
|
n.c();
|
|
129
129
|
} catch (t) {
|
|
@@ -132,113 +132,113 @@ function Vt(t, e) {
|
|
|
132
132
|
const i = n.d.bind(n);
|
|
133
133
|
return i[Symbol.dispose] = i, i;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function re(t, e = {}) {
|
|
136
136
|
const n = {};
|
|
137
137
|
for (const i in t) {
|
|
138
138
|
const o = e[i];
|
|
139
|
-
n[i] =
|
|
139
|
+
n[i] = Ht(void 0 === o ? t[i] : o);
|
|
140
140
|
}
|
|
141
141
|
return n;
|
|
142
142
|
}
|
|
143
|
-
|
|
143
|
+
Jt.prototype.brand = At, Jt.prototype.h = function() {
|
|
144
144
|
return !0;
|
|
145
|
-
},
|
|
145
|
+
}, Jt.prototype.S = function(t) {
|
|
146
146
|
const e = this.t;
|
|
147
|
-
e !== t && void 0 === t.e && (t.x = e, this.t = t, void 0 !== e ? e.e = t :
|
|
147
|
+
e !== t && void 0 === t.e && (t.x = e, this.t = t, void 0 !== e ? e.e = t : jt(() => {
|
|
148
148
|
var t;
|
|
149
149
|
null == (t = this.W) || t.call(this);
|
|
150
150
|
}));
|
|
151
|
-
},
|
|
151
|
+
}, Jt.prototype.U = function(t) {
|
|
152
152
|
if (void 0 !== this.t) {
|
|
153
153
|
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 &&
|
|
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(() => {
|
|
155
155
|
var t;
|
|
156
156
|
null == (t = this.Z) || t.call(this);
|
|
157
157
|
}));
|
|
158
158
|
}
|
|
159
|
-
},
|
|
160
|
-
return
|
|
161
|
-
const e = this.value, n =
|
|
162
|
-
|
|
159
|
+
}, Jt.prototype.subscribe = function(t) {
|
|
160
|
+
return se(() => {
|
|
161
|
+
const e = this.value, n = $t;
|
|
162
|
+
$t = void 0;
|
|
163
163
|
try {
|
|
164
164
|
t(e);
|
|
165
165
|
} finally {
|
|
166
|
-
|
|
166
|
+
$t = n;
|
|
167
167
|
}
|
|
168
168
|
}, { name: "sub" });
|
|
169
|
-
},
|
|
169
|
+
}, Jt.prototype.valueOf = function() {
|
|
170
170
|
return this.value;
|
|
171
|
-
},
|
|
171
|
+
}, Jt.prototype.toString = function() {
|
|
172
172
|
return this.value + "";
|
|
173
|
-
},
|
|
173
|
+
}, Jt.prototype.toJSON = function() {
|
|
174
174
|
return this.value;
|
|
175
|
-
},
|
|
176
|
-
const t =
|
|
177
|
-
|
|
175
|
+
}, Jt.prototype.peek = function() {
|
|
176
|
+
const t = $t;
|
|
177
|
+
$t = void 0;
|
|
178
178
|
try {
|
|
179
179
|
return this.value;
|
|
180
180
|
} finally {
|
|
181
|
-
|
|
181
|
+
$t = t;
|
|
182
182
|
}
|
|
183
|
-
}, Object.defineProperty(
|
|
183
|
+
}, Object.defineProperty(Jt.prototype, "value", {
|
|
184
184
|
get() {
|
|
185
|
-
const t =
|
|
185
|
+
const t = Zt(this);
|
|
186
186
|
return void 0 !== t && (t.i = this.i), this.v;
|
|
187
187
|
},
|
|
188
188
|
set(t) {
|
|
189
189
|
if (t !== this.v) {
|
|
190
|
-
if (
|
|
190
|
+
if (Wt > 100) throw new Error("Cycle detected");
|
|
191
191
|
(function(t) {
|
|
192
|
-
0 !==
|
|
192
|
+
0 !== Ut && 0 === Wt && t.l !== Vt && (t.l = Vt, zt = {
|
|
193
193
|
S: t,
|
|
194
194
|
v: t.v,
|
|
195
195
|
i: t.i,
|
|
196
|
-
o:
|
|
196
|
+
o: zt
|
|
197
197
|
});
|
|
198
|
-
})(this), this.v = t, this.i++,
|
|
198
|
+
})(this), this.v = t, this.i++, Gt++, Ut++;
|
|
199
199
|
try {
|
|
200
200
|
for (let t = this.t; void 0 !== t; t = t.x) t.t.N();
|
|
201
201
|
} finally {
|
|
202
|
-
|
|
202
|
+
Pt();
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
}),
|
|
206
|
+
}), Qt.prototype = new Jt(), Qt.prototype.h = function() {
|
|
207
207
|
if (this.f &= -3, 1 & this.f) return !1;
|
|
208
208
|
if (32 == (36 & this.f)) return !0;
|
|
209
|
-
if (this.f &= -5, this.g ===
|
|
210
|
-
if (this.g =
|
|
211
|
-
const t =
|
|
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;
|
|
212
212
|
try {
|
|
213
|
-
|
|
213
|
+
Yt(this), $t = this;
|
|
214
214
|
const t = this.x();
|
|
215
215
|
(16 & this.f || this.v !== t || 0 === this.i) && (this.v = t, this.f &= -17, this.i++);
|
|
216
216
|
} catch (t) {
|
|
217
217
|
this.v = t, this.f |= 16, this.i++;
|
|
218
218
|
}
|
|
219
|
-
return
|
|
220
|
-
},
|
|
219
|
+
return $t = t, qt(this), this.f &= -2, !0;
|
|
220
|
+
}, Qt.prototype.S = function(t) {
|
|
221
221
|
if (void 0 === this.t) {
|
|
222
222
|
this.f |= 36;
|
|
223
223
|
for (let t = this.s; void 0 !== t; t = t.n) t.S.S(t);
|
|
224
224
|
}
|
|
225
|
-
|
|
226
|
-
},
|
|
227
|
-
if (void 0 !== this.t && (
|
|
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)) {
|
|
228
228
|
this.f &= -33;
|
|
229
229
|
for (let t = this.s; void 0 !== t; t = t.n) t.S.U(t);
|
|
230
230
|
}
|
|
231
|
-
},
|
|
231
|
+
}, Qt.prototype.N = function() {
|
|
232
232
|
if (!(2 & this.f)) {
|
|
233
233
|
this.f |= 6;
|
|
234
234
|
for (let t = this.t; void 0 !== t; t = t.x) t.t.N();
|
|
235
235
|
}
|
|
236
|
-
}, Object.defineProperty(
|
|
236
|
+
}, Object.defineProperty(Qt.prototype, "value", { get() {
|
|
237
237
|
if (1 & this.f) throw new Error("Cycle detected");
|
|
238
|
-
const t =
|
|
238
|
+
const t = Zt(this);
|
|
239
239
|
if (this.h(), void 0 !== t && (t.i = this.i), 16 & this.f) throw this.v;
|
|
240
240
|
return this.v;
|
|
241
|
-
} }),
|
|
241
|
+
} }), oe.prototype.c = function() {
|
|
242
242
|
const t = this.S();
|
|
243
243
|
try {
|
|
244
244
|
if (8 & this.f) return;
|
|
@@ -248,77 +248,77 @@ _t.prototype.brand = yt, _t.prototype.h = function() {
|
|
|
248
248
|
} finally {
|
|
249
249
|
t();
|
|
250
250
|
}
|
|
251
|
-
},
|
|
251
|
+
}, oe.prototype.S = function() {
|
|
252
252
|
if (1 & this.f) throw new Error("Cycle detected");
|
|
253
|
-
this.f |= 1, this.f &= -9,
|
|
254
|
-
const t =
|
|
255
|
-
return
|
|
256
|
-
},
|
|
257
|
-
2 & this.f || (this.f |= 2, this.u =
|
|
258
|
-
},
|
|
259
|
-
this.f |= 8, 1 & this.f ||
|
|
260
|
-
},
|
|
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() {
|
|
261
261
|
this.d();
|
|
262
262
|
};
|
|
263
|
-
const
|
|
264
|
-
build: (t, e, n) =>
|
|
265
|
-
config: safeCast({
|
|
263
|
+
const ce = /* @__PURE__ */ defineExtension({
|
|
264
|
+
build: (t, e, n) => re(e),
|
|
265
|
+
config: /* @__PURE__ */ safeCast({
|
|
266
266
|
defaultSelection: "rootEnd",
|
|
267
267
|
disabled: !1
|
|
268
268
|
}),
|
|
269
269
|
name: "@lexical/extension/AutoFocus",
|
|
270
|
-
register(t, e,
|
|
271
|
-
const
|
|
272
|
-
return
|
|
270
|
+
register(t, e, i) {
|
|
271
|
+
const o = i.getOutput();
|
|
272
|
+
return se(() => o.disabled.value ? void 0 : t.registerRootListener((e) => {
|
|
273
273
|
t.focus(() => {
|
|
274
|
-
const t =
|
|
274
|
+
const t = null !== e ? getActiveElement(e) : null;
|
|
275
275
|
null === e || null !== t && e.contains(t) || e.focus({ preventScroll: !0 });
|
|
276
|
-
}, { defaultSelection:
|
|
276
|
+
}, { defaultSelection: o.defaultSelection.peek() });
|
|
277
277
|
}));
|
|
278
278
|
}
|
|
279
279
|
});
|
|
280
|
-
function
|
|
280
|
+
function ae() {
|
|
281
281
|
const t = $getRoot(), e = $getSelection(), n = $createParagraphNode();
|
|
282
282
|
t.clear(), t.append(n), null !== e && n.select(), $isRangeSelection(e) && (e.format = 0);
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function de(t, e = ae) {
|
|
285
285
|
return t.registerCommand(CLEAR_EDITOR_COMMAND, (n) => (t.update(e), !0), COMMAND_PRIORITY_EDITOR);
|
|
286
286
|
}
|
|
287
|
-
const
|
|
288
|
-
build: (t, e, n) =>
|
|
289
|
-
config: safeCast({ $onClear:
|
|
287
|
+
const ue = /* @__PURE__ */ defineExtension({
|
|
288
|
+
build: (t, e, n) => re(e),
|
|
289
|
+
config: /* @__PURE__ */ safeCast({ $onClear: ae }),
|
|
290
290
|
name: "@lexical/extension/ClearEditor",
|
|
291
291
|
register(t, e, n) {
|
|
292
292
|
const { $onClear: i } = n.getOutput();
|
|
293
|
-
return
|
|
293
|
+
return se(() => de(t, i.value));
|
|
294
294
|
}
|
|
295
295
|
});
|
|
296
|
-
function
|
|
296
|
+
function le(t) {
|
|
297
297
|
return !!$isDecoratorNode(t) || !(!$isElementNode(t) || !t.isShadowRoot());
|
|
298
298
|
}
|
|
299
|
-
function
|
|
300
|
-
return !!t.isEditable() && n.target === e && t.
|
|
299
|
+
function fe(t, e, n, i) {
|
|
300
|
+
return !!t.isEditable() && n.target === e && t.read("latest", () => {
|
|
301
301
|
const e = $getRoot().getLastChild();
|
|
302
302
|
if (null === e) return !1;
|
|
303
|
-
const
|
|
304
|
-
return null !==
|
|
305
|
-
}
|
|
303
|
+
const o = t.getElementByKey(e.getKey());
|
|
304
|
+
return null !== o && !(n.clientY <= o.getBoundingClientRect().bottom) && i(e);
|
|
305
|
+
});
|
|
306
306
|
}
|
|
307
|
-
const
|
|
308
|
-
build: (t, e) =>
|
|
309
|
-
config: safeCast({
|
|
310
|
-
$shouldInsertAfter:
|
|
307
|
+
const he = /* @__PURE__ */ defineExtension({
|
|
308
|
+
build: (t, e) => re(e),
|
|
309
|
+
config: /* @__PURE__ */ safeCast({
|
|
310
|
+
$shouldInsertAfter: le,
|
|
311
311
|
disabled: !1
|
|
312
312
|
}),
|
|
313
313
|
name: "@lexical/ClickAfterLastBlock",
|
|
314
|
-
register: (t, e, n) =>
|
|
314
|
+
register: (t, e, n) => se(() => {
|
|
315
315
|
const e = n.getOutput();
|
|
316
316
|
if (!e.disabled.value) return t.registerRootListener((n) => {
|
|
317
317
|
if (null === n) return;
|
|
318
318
|
const i = (i) => {
|
|
319
|
-
|
|
320
|
-
},
|
|
321
|
-
|
|
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
322
|
const t = $getRoot().getLastChild();
|
|
323
323
|
if (null === t) return;
|
|
324
324
|
if (!e.$shouldInsertAfter.peek()(t)) return;
|
|
@@ -326,15 +326,15 @@ const Qt = defineExtension({
|
|
|
326
326
|
t.insertAfter(n), n.select();
|
|
327
327
|
}));
|
|
328
328
|
};
|
|
329
|
-
return n.addEventListener("mousedown", i, !0), n.addEventListener("click",
|
|
330
|
-
n.removeEventListener("mousedown", i, !0), n.removeEventListener("click",
|
|
329
|
+
return n.addEventListener("mousedown", i, !0), n.addEventListener("click", o, !0), () => {
|
|
330
|
+
n.removeEventListener("mousedown", i, !0), n.removeEventListener("click", o, !0);
|
|
331
331
|
};
|
|
332
332
|
});
|
|
333
333
|
})
|
|
334
334
|
});
|
|
335
|
-
function
|
|
335
|
+
function ge(t) {
|
|
336
336
|
const e = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
|
|
337
|
-
for (const i of
|
|
337
|
+
for (const i of pe(t)) {
|
|
338
338
|
const t = "function" == typeof i ? i : i.replace;
|
|
339
339
|
getStaticNodeConfig(t), e.add(t.getType()), n.add(t);
|
|
340
340
|
}
|
|
@@ -343,22 +343,22 @@ function Xt(t) {
|
|
|
343
343
|
types: e
|
|
344
344
|
};
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function pe(t) {
|
|
347
347
|
return ("function" == typeof t.nodes ? t.nodes() : t.nodes) || [];
|
|
348
348
|
}
|
|
349
|
-
const
|
|
350
|
-
var
|
|
349
|
+
const me = /* @__PURE__ */ createState("format", { parse: (t) => "number" == typeof t ? t : 0 });
|
|
350
|
+
var ve = class extends DecoratorNode {
|
|
351
351
|
$config() {
|
|
352
352
|
return this.config("decorator-text", {
|
|
353
353
|
extends: DecoratorNode,
|
|
354
354
|
stateConfigs: [{
|
|
355
355
|
flat: !0,
|
|
356
|
-
stateConfig:
|
|
356
|
+
stateConfig: me
|
|
357
357
|
}]
|
|
358
358
|
});
|
|
359
359
|
}
|
|
360
360
|
getFormat() {
|
|
361
|
-
return $getState(this,
|
|
361
|
+
return $getState(this, me);
|
|
362
362
|
}
|
|
363
363
|
getFormatFlags(t, e) {
|
|
364
364
|
return toggleTextFormatType(this.getFormat(), t, e);
|
|
@@ -368,7 +368,7 @@ var ne = class extends DecoratorNode {
|
|
|
368
368
|
return 0 !== (this.getFormat() & e);
|
|
369
369
|
}
|
|
370
370
|
setFormat(t) {
|
|
371
|
-
return $setState(this,
|
|
371
|
+
return $setState(this, me, t);
|
|
372
372
|
}
|
|
373
373
|
toggleFormat(t) {
|
|
374
374
|
const n = toggleTextFormatType(this.getFormat(), t, null);
|
|
@@ -384,22 +384,22 @@ var ne = class extends DecoratorNode {
|
|
|
384
384
|
return !1;
|
|
385
385
|
}
|
|
386
386
|
};
|
|
387
|
-
function
|
|
388
|
-
return t instanceof
|
|
387
|
+
function Ee(t) {
|
|
388
|
+
return t instanceof ve;
|
|
389
389
|
}
|
|
390
|
-
function
|
|
390
|
+
function ye(t, e, n) {
|
|
391
391
|
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
392
|
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
393
|
}
|
|
394
|
-
function
|
|
395
|
-
for (const [i, o] of Object.entries(n)) t.hasFormat(o) && (e =
|
|
394
|
+
function xe(t, e, n = Se) {
|
|
395
|
+
for (const [i, o] of Object.entries(n)) t.hasFormat(o) && (e = be(e, i));
|
|
396
396
|
return e;
|
|
397
397
|
}
|
|
398
|
-
function
|
|
398
|
+
function be(t, e) {
|
|
399
399
|
const n = document.createElement(e);
|
|
400
400
|
return n.appendChild(t), n;
|
|
401
401
|
}
|
|
402
|
-
const
|
|
402
|
+
const Se = {
|
|
403
403
|
b: "bold",
|
|
404
404
|
code: "code",
|
|
405
405
|
em: "italic",
|
|
@@ -410,18 +410,18 @@ const ce = {
|
|
|
410
410
|
sub: "subscript",
|
|
411
411
|
sup: "superscript",
|
|
412
412
|
u: "underline"
|
|
413
|
-
},
|
|
413
|
+
}, we = /* @__PURE__ */ defineExtension({
|
|
414
414
|
name: "@lexical/extension/DecoratorText",
|
|
415
|
-
nodes: () => [
|
|
415
|
+
nodes: () => [ve],
|
|
416
416
|
register: (t, e, n) => t.registerCommand(FORMAT_TEXT_COMMAND, (t) => {
|
|
417
417
|
const e = $getSelection();
|
|
418
|
-
if ($isNodeSelection(e) || $isRangeSelection(e)) for (const n of e.getNodes())
|
|
418
|
+
if ($isNodeSelection(e) || $isRangeSelection(e)) for (const n of e.getNodes()) Ee(n) && n.toggleFormat(t);
|
|
419
419
|
return !1;
|
|
420
420
|
}, COMMAND_PRIORITY_LOW)
|
|
421
421
|
});
|
|
422
|
-
function
|
|
422
|
+
function Ne(t, e) {
|
|
423
423
|
let n;
|
|
424
|
-
return
|
|
424
|
+
return Ht(t(), {
|
|
425
425
|
unwatched() {
|
|
426
426
|
n && (n(), n = void 0);
|
|
427
427
|
},
|
|
@@ -430,45 +430,49 @@ function de(t, e) {
|
|
|
430
430
|
}
|
|
431
431
|
});
|
|
432
432
|
}
|
|
433
|
-
const
|
|
434
|
-
build: (t) =>
|
|
433
|
+
const Oe = /* @__PURE__ */ defineExtension({
|
|
434
|
+
build: (t) => Ne(() => t.getEditorState(), (e) => t.registerUpdateListener((t) => {
|
|
435
435
|
e.value = t.editorState;
|
|
436
436
|
})),
|
|
437
437
|
name: "@lexical/extension/EditorState"
|
|
438
438
|
});
|
|
439
|
-
function
|
|
439
|
+
function Ce(t, ...e) {
|
|
440
440
|
const n = new URL("https://lexical.dev/docs/error"), i = new URLSearchParams();
|
|
441
441
|
i.append("code", t);
|
|
442
442
|
for (const t of e) i.append("v", t);
|
|
443
443
|
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
444
|
}
|
|
445
|
-
let
|
|
445
|
+
let Re;
|
|
446
446
|
try {
|
|
447
|
-
|
|
447
|
+
Re = "0.46.0+prod.esm";
|
|
448
448
|
} catch (t) {}
|
|
449
|
-
const
|
|
450
|
-
|
|
449
|
+
const De = Re ?? "\"<unknown>+source\"", Ie = new Set([
|
|
450
|
+
"__proto__",
|
|
451
|
+
"constructor",
|
|
452
|
+
"prototype"
|
|
453
|
+
]);
|
|
454
|
+
function Fe(t, e) {
|
|
451
455
|
if (t && e && !Array.isArray(e) && "object" == typeof t && "object" == typeof e) {
|
|
452
456
|
const n = t, i = e;
|
|
453
|
-
for (const t in i) n[t] =
|
|
457
|
+
for (const t in i) !Ie.has(t) && Object.prototype.hasOwnProperty.call(i, t) && (n[t] = Fe(n[t], i[t]));
|
|
454
458
|
return t;
|
|
455
459
|
}
|
|
456
460
|
return e;
|
|
457
461
|
}
|
|
458
|
-
const
|
|
459
|
-
function
|
|
460
|
-
return t.id ===
|
|
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;
|
|
461
465
|
}
|
|
462
|
-
function
|
|
463
|
-
return t.id ===
|
|
466
|
+
function je(t) {
|
|
467
|
+
return t.id === Le;
|
|
464
468
|
}
|
|
465
|
-
function
|
|
469
|
+
function ze(t) {
|
|
466
470
|
return function(t) {
|
|
467
|
-
return t.id ===
|
|
468
|
-
}(t) ||
|
|
471
|
+
return t.id === ke;
|
|
472
|
+
}(t) || Ce(305, String(t.id), String(ke)), Object.assign(t, { id: Le });
|
|
469
473
|
}
|
|
470
|
-
const
|
|
471
|
-
var
|
|
474
|
+
const Ue = /* @__PURE__ */ new Set();
|
|
475
|
+
var We = class {
|
|
472
476
|
builder;
|
|
473
477
|
configs;
|
|
474
478
|
_dependency;
|
|
@@ -477,7 +481,7 @@ var Re = class {
|
|
|
477
481
|
state;
|
|
478
482
|
_signal;
|
|
479
483
|
constructor(t, e) {
|
|
480
|
-
this.builder = t, this.extension = e, this.configs = /* @__PURE__ */ new Set(), this.state = { id:
|
|
484
|
+
this.builder = t, this.extension = e, this.configs = /* @__PURE__ */ new Set(), this.state = { id: Me };
|
|
481
485
|
}
|
|
482
486
|
mergeConfigs() {
|
|
483
487
|
let t = this.extension.config || {};
|
|
@@ -487,7 +491,7 @@ var Re = class {
|
|
|
487
491
|
}
|
|
488
492
|
init(t) {
|
|
489
493
|
const e = this.state;
|
|
490
|
-
|
|
494
|
+
je(e) || Ce(306, String(e.id));
|
|
491
495
|
const n = {
|
|
492
496
|
getDependency: this.getInitDependency.bind(this),
|
|
493
497
|
getDirectDependentNames: this.getDirectDependentNames.bind(this),
|
|
@@ -501,14 +505,14 @@ var Re = class {
|
|
|
501
505
|
}, o = function(t, e, n) {
|
|
502
506
|
return Object.assign(t, {
|
|
503
507
|
config: e,
|
|
504
|
-
id:
|
|
508
|
+
id: _e,
|
|
505
509
|
registerState: n
|
|
506
510
|
});
|
|
507
511
|
}(e, this.mergeConfigs(), n);
|
|
508
512
|
let s;
|
|
509
513
|
this.state = o, this.extension.init && (s = this.extension.init(t, o.config, n)), this.state = function(t, e, n) {
|
|
510
514
|
return Object.assign(t, {
|
|
511
|
-
id:
|
|
515
|
+
id: Ae,
|
|
512
516
|
initResult: e,
|
|
513
517
|
registerState: n
|
|
514
518
|
});
|
|
@@ -517,7 +521,7 @@ var Re = class {
|
|
|
517
521
|
build(t) {
|
|
518
522
|
const e = this.state;
|
|
519
523
|
let n;
|
|
520
|
-
e.id !==
|
|
524
|
+
e.id !== Ae && Ce(307, String(e.id), String(Pe)), this.extension.build && (n = this.extension.build(t, e.config, e.registerState));
|
|
521
525
|
const i = {
|
|
522
526
|
...e.registerState,
|
|
523
527
|
getOutput: () => n,
|
|
@@ -525,7 +529,7 @@ var Re = class {
|
|
|
525
529
|
};
|
|
526
530
|
this.state = function(t, e, n) {
|
|
527
531
|
return Object.assign(t, {
|
|
528
|
-
id:
|
|
532
|
+
id: Pe,
|
|
529
533
|
output: e,
|
|
530
534
|
registerState: n
|
|
531
535
|
});
|
|
@@ -534,33 +538,33 @@ var Re = class {
|
|
|
534
538
|
register(t, e) {
|
|
535
539
|
this._signal = e;
|
|
536
540
|
const n = this.state;
|
|
537
|
-
n.id !==
|
|
541
|
+
n.id !== Pe && Ce(308, String(n.id), String(Pe));
|
|
538
542
|
const i = this.extension.register && this.extension.register(t, n.config, n.registerState);
|
|
539
543
|
return this.state = function(t) {
|
|
540
|
-
return Object.assign(t, { id:
|
|
544
|
+
return Object.assign(t, { id: Ke });
|
|
541
545
|
}(n), () => {
|
|
542
546
|
const t = this.state;
|
|
543
|
-
t.id !==
|
|
544
|
-
return Object.assign(t, { id:
|
|
547
|
+
t.id !== $e && Ce(309, String(n.id), String($e)), this.state = function(t) {
|
|
548
|
+
return Object.assign(t, { id: Pe });
|
|
545
549
|
}(t), i && i();
|
|
546
550
|
};
|
|
547
551
|
}
|
|
548
552
|
afterRegistration(t) {
|
|
549
553
|
const e = this.state;
|
|
550
554
|
let n;
|
|
551
|
-
return e.id !==
|
|
552
|
-
return Object.assign(t, { id:
|
|
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 });
|
|
553
557
|
}(e), n;
|
|
554
558
|
}
|
|
555
559
|
getSignal() {
|
|
556
|
-
return void 0 === this._signal &&
|
|
560
|
+
return void 0 === this._signal && Ce(311), this._signal;
|
|
557
561
|
}
|
|
558
562
|
getInitResult() {
|
|
559
|
-
void 0 === this.extension.init &&
|
|
563
|
+
void 0 === this.extension.init && Ce(312, this.extension.name);
|
|
560
564
|
const t = this.state;
|
|
561
565
|
return function(t) {
|
|
562
|
-
return t.id >=
|
|
563
|
-
}(t) ||
|
|
566
|
+
return t.id >= Ae;
|
|
567
|
+
}(t) || Ce(313, String(t.id), String(Ae)), t.initResult;
|
|
564
568
|
}
|
|
565
569
|
getInitPeer(t) {
|
|
566
570
|
const e = this.builder.extensionNameMap.get(t);
|
|
@@ -569,8 +573,8 @@ var Re = class {
|
|
|
569
573
|
getExtensionInitDependency() {
|
|
570
574
|
const t = this.state;
|
|
571
575
|
return function(t) {
|
|
572
|
-
return t.id >=
|
|
573
|
-
}(t) ||
|
|
576
|
+
return t.id >= _e;
|
|
577
|
+
}(t) || Ce(314, String(t.id), String(_e)), { config: t.config };
|
|
574
578
|
}
|
|
575
579
|
getPeer(t) {
|
|
576
580
|
const e = this.builder.extensionNameMap.get(t);
|
|
@@ -578,20 +582,20 @@ var Re = class {
|
|
|
578
582
|
}
|
|
579
583
|
getInitDependency(t) {
|
|
580
584
|
const e = this.builder.getExtensionRep(t);
|
|
581
|
-
return void 0 === e &&
|
|
585
|
+
return void 0 === e && Ce(315, this.extension.name, t.name), e.getExtensionInitDependency();
|
|
582
586
|
}
|
|
583
587
|
getDependency(t) {
|
|
584
588
|
const e = this.builder.getExtensionRep(t);
|
|
585
|
-
return void 0 === e &&
|
|
589
|
+
return void 0 === e && Ce(315, this.extension.name, t.name), e.getExtensionDependency();
|
|
586
590
|
}
|
|
587
591
|
getState() {
|
|
588
592
|
const t = this.state;
|
|
589
593
|
return function(t) {
|
|
590
|
-
return t.id >=
|
|
591
|
-
}(t) ||
|
|
594
|
+
return t.id >= $e;
|
|
595
|
+
}(t) || Ce(316, String(t.id), String($e)), t;
|
|
592
596
|
}
|
|
593
597
|
getDirectDependentNames() {
|
|
594
|
-
return this.builder.incomingEdges.get(this.extension.name) ||
|
|
598
|
+
return this.builder.incomingEdges.get(this.extension.name) || Ue;
|
|
595
599
|
}
|
|
596
600
|
getPeerNameSet() {
|
|
597
601
|
let t = this._peerNameSet;
|
|
@@ -601,8 +605,8 @@ var Re = class {
|
|
|
601
605
|
if (!this._dependency) {
|
|
602
606
|
const t = this.state;
|
|
603
607
|
(function(t) {
|
|
604
|
-
return t.id >=
|
|
605
|
-
})(t) ||
|
|
608
|
+
return t.id >= Pe;
|
|
609
|
+
})(t) || Ce(317, this.extension.name), this._dependency = {
|
|
606
610
|
config: t.config,
|
|
607
611
|
init: t.initResult,
|
|
608
612
|
output: t.output
|
|
@@ -611,17 +615,17 @@ var Re = class {
|
|
|
611
615
|
return this._dependency;
|
|
612
616
|
}
|
|
613
617
|
};
|
|
614
|
-
const
|
|
615
|
-
function
|
|
618
|
+
const Be = { tag: HISTORY_MERGE_TAG };
|
|
619
|
+
function Ve() {
|
|
616
620
|
const t = $getRoot();
|
|
617
621
|
t.isEmpty() && t.append($createParagraphNode());
|
|
618
622
|
}
|
|
619
|
-
const
|
|
620
|
-
config: safeCast({
|
|
621
|
-
setOptions:
|
|
622
|
-
updateOptions:
|
|
623
|
+
const Ge = /* @__PURE__ */ defineExtension({
|
|
624
|
+
config: /* @__PURE__ */ safeCast({
|
|
625
|
+
setOptions: Be,
|
|
626
|
+
updateOptions: Be
|
|
623
627
|
}),
|
|
624
|
-
init: ({ $initialEditorState: t =
|
|
628
|
+
init: ({ $initialEditorState: t = Ve }) => ({
|
|
625
629
|
$initialEditorState: t,
|
|
626
630
|
initialized: !1
|
|
627
631
|
}),
|
|
@@ -649,19 +653,19 @@ const Ie = defineExtension({
|
|
|
649
653
|
TabNode,
|
|
650
654
|
ParagraphNode
|
|
651
655
|
]
|
|
652
|
-
}),
|
|
653
|
-
function
|
|
654
|
-
return
|
|
656
|
+
}), Ze = Symbol.for("@lexical/extension/LexicalBuilder");
|
|
657
|
+
function Je(...t) {
|
|
658
|
+
return Qe.fromExtensions(t).buildEditor();
|
|
655
659
|
}
|
|
656
|
-
function
|
|
657
|
-
function
|
|
660
|
+
function He() {}
|
|
661
|
+
function Xe(t) {
|
|
658
662
|
throw t;
|
|
659
663
|
}
|
|
660
|
-
function
|
|
664
|
+
function Ye(t) {
|
|
661
665
|
return Array.isArray(t) ? t : [t];
|
|
662
666
|
}
|
|
663
|
-
const
|
|
664
|
-
var
|
|
667
|
+
const qe = De;
|
|
668
|
+
var Qe = class Qe {
|
|
665
669
|
roots;
|
|
666
670
|
extensionNameMap;
|
|
667
671
|
outgoingConfigEdges;
|
|
@@ -670,39 +674,42 @@ var Le = class Le {
|
|
|
670
674
|
_sortedExtensionReps;
|
|
671
675
|
PACKAGE_VERSION;
|
|
672
676
|
constructor(t) {
|
|
673
|
-
this.outgoingConfigEdges = /* @__PURE__ */ new Map(), this.incomingEdges = /* @__PURE__ */ new Map(), this.extensionNameMap = /* @__PURE__ */ new Map(), this.conflicts = /* @__PURE__ */ new Map(), this.PACKAGE_VERSION =
|
|
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;
|
|
674
678
|
for (const e of t) this.addExtension(e);
|
|
675
679
|
}
|
|
676
680
|
static fromExtensions(t) {
|
|
677
|
-
const e = [
|
|
678
|
-
for (const n of t) e.push(
|
|
679
|
-
return new
|
|
681
|
+
const e = [Ye(Ge)];
|
|
682
|
+
for (const n of t) e.push(Ye(n));
|
|
683
|
+
return new Qe(e);
|
|
680
684
|
}
|
|
681
685
|
static maybeFromEditor(t) {
|
|
682
|
-
const e = t[
|
|
683
|
-
return e && (e.PACKAGE_VERSION !==
|
|
686
|
+
const e = t[Ze];
|
|
687
|
+
return e && (e.PACKAGE_VERSION !== qe && Ce(292, e.PACKAGE_VERSION, qe), e instanceof Qe || Ce(293)), e;
|
|
684
688
|
}
|
|
685
689
|
static fromEditor(t) {
|
|
686
|
-
const e =
|
|
687
|
-
return void 0 === e &&
|
|
690
|
+
const e = Qe.maybeFromEditor(t);
|
|
691
|
+
return void 0 === e && Ce(294), e;
|
|
688
692
|
}
|
|
689
693
|
constructEditor() {
|
|
690
|
-
const { $initialEditorState: t, onError: e,
|
|
691
|
-
...
|
|
694
|
+
const { $initialEditorState: t, onError: e, onWarn: n, ...i } = this.buildCreateEditorArgs(), o = Object.assign(createEditor({
|
|
695
|
+
...i,
|
|
692
696
|
...e ? { onError: (t) => {
|
|
693
|
-
e(t,
|
|
697
|
+
e(t, o);
|
|
698
|
+
} } : {},
|
|
699
|
+
...n ? { onWarn: (t) => {
|
|
700
|
+
n(t, o);
|
|
694
701
|
} } : {}
|
|
695
|
-
}), { [
|
|
696
|
-
for (const t of this.sortedExtensionReps()) t.build(
|
|
697
|
-
return
|
|
702
|
+
}), { [Ze]: this });
|
|
703
|
+
for (const t of this.sortedExtensionReps()) t.build(o);
|
|
704
|
+
return o;
|
|
698
705
|
}
|
|
699
706
|
buildEditor() {
|
|
700
|
-
let t =
|
|
707
|
+
let t = He;
|
|
701
708
|
function e() {
|
|
702
709
|
try {
|
|
703
710
|
t();
|
|
704
711
|
} finally {
|
|
705
|
-
t =
|
|
712
|
+
t = He;
|
|
706
713
|
}
|
|
707
714
|
}
|
|
708
715
|
const n = Object.assign(this.constructEditor(), {
|
|
@@ -716,7 +723,7 @@ var Le = class Le {
|
|
|
716
723
|
}
|
|
717
724
|
getExtensionRep(t) {
|
|
718
725
|
const e = this.extensionNameMap.get(t.name);
|
|
719
|
-
if (e) return e.extension !== t &&
|
|
726
|
+
if (e) return e.extension !== t && Ce(295, t.name), e;
|
|
720
727
|
}
|
|
721
728
|
addEdge(t, e, n) {
|
|
722
729
|
const i = this.outgoingConfigEdges.get(t);
|
|
@@ -725,17 +732,17 @@ var Le = class Le {
|
|
|
725
732
|
o ? o.add(t) : this.incomingEdges.set(e, new Set([t]));
|
|
726
733
|
}
|
|
727
734
|
addExtension(t) {
|
|
728
|
-
void 0 !== this._sortedExtensionReps &&
|
|
729
|
-
const [n] =
|
|
730
|
-
"string" != typeof n.name &&
|
|
735
|
+
void 0 !== this._sortedExtensionReps && Ce(296);
|
|
736
|
+
const [n] = Ye(t);
|
|
737
|
+
"string" != typeof n.name && Ce(297, typeof n.name);
|
|
731
738
|
let i = this.extensionNameMap.get(n.name);
|
|
732
|
-
if (void 0 !== i && i.extension !== n &&
|
|
733
|
-
i = new
|
|
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);
|
|
734
741
|
const t = this.conflicts.get(n.name);
|
|
735
|
-
"string" == typeof t &&
|
|
736
|
-
for (const t of n.conflictsWith || []) this.extensionNameMap.has(t) &&
|
|
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);
|
|
737
744
|
for (const t of n.dependencies || []) {
|
|
738
|
-
const e =
|
|
745
|
+
const e = Ye(t);
|
|
739
746
|
this.addEdge(n.name, e[0].name, e.slice(1)), this.addExtension(e);
|
|
740
747
|
}
|
|
741
748
|
for (const [t, e] of n.peerDependencies || []) this.addEdge(n.name, t, e ? [e] : []);
|
|
@@ -745,25 +752,25 @@ var Le = class Le {
|
|
|
745
752
|
if (this._sortedExtensionReps) return this._sortedExtensionReps;
|
|
746
753
|
const t = [], e = (n, i) => {
|
|
747
754
|
let o = n.state;
|
|
748
|
-
if (
|
|
755
|
+
if (je(o)) return;
|
|
749
756
|
const s = n.extension.name;
|
|
750
757
|
var r;
|
|
751
|
-
|
|
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;
|
|
752
759
|
const c = this.outgoingConfigEdges.get(s);
|
|
753
760
|
if (c) for (const t of c.keys()) {
|
|
754
761
|
const n = this.extensionNameMap.get(t);
|
|
755
762
|
n && e(n, s);
|
|
756
763
|
}
|
|
757
|
-
o =
|
|
764
|
+
o = ze(o), n.state = o, t.push(n);
|
|
758
765
|
};
|
|
759
|
-
for (const t of this.extensionNameMap.values())
|
|
766
|
+
for (const t of this.extensionNameMap.values()) Te(t.state) && e(t);
|
|
760
767
|
for (const e of t) for (const [t, n] of this.outgoingConfigEdges.get(e.extension.name) || []) if (n.length > 0) {
|
|
761
768
|
const e = this.extensionNameMap.get(t);
|
|
762
769
|
if (e) for (const t of n) e.configs.add(t);
|
|
763
770
|
}
|
|
764
771
|
for (const [t, ...e] of this.roots) if (e.length > 0) {
|
|
765
772
|
const n = this.extensionNameMap.get(t.name);
|
|
766
|
-
void 0 === n &&
|
|
773
|
+
void 0 === n && Ce(301, t.name);
|
|
767
774
|
for (const t of e) n.configs.add(t);
|
|
768
775
|
}
|
|
769
776
|
return this._sortedExtensionReps = t, this._sortedExtensionReps;
|
|
@@ -784,10 +791,10 @@ var Le = class Le {
|
|
|
784
791
|
const t = {}, e = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), o = {}, s = {}, r = this.sortedExtensionReps();
|
|
785
792
|
for (const c of r) {
|
|
786
793
|
const { extension: r } = c;
|
|
787
|
-
if (void 0 !== r.onError && (t.onError = r.onError), 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
|
|
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)) {
|
|
788
795
|
if ("function" != typeof t) {
|
|
789
796
|
const e = n.get(t.replace);
|
|
790
|
-
e &&
|
|
797
|
+
e && Ce(302, r.name, t.replace.name, e.extension.name), n.set(t.replace, c);
|
|
791
798
|
}
|
|
792
799
|
e.add(t);
|
|
793
800
|
}
|
|
@@ -795,42 +802,42 @@ var Le = class Le {
|
|
|
795
802
|
if (r.html.export) for (const [t, e] of r.html.export.entries()) i.set(t, e);
|
|
796
803
|
r.html.import && Object.assign(o, r.html.import);
|
|
797
804
|
}
|
|
798
|
-
r.theme &&
|
|
805
|
+
r.theme && Fe(s, r.theme);
|
|
799
806
|
}
|
|
800
807
|
Object.keys(s).length > 0 && (t.theme = s), e.size && (t.nodes = [...e]);
|
|
801
808
|
const c = Object.keys(o).length > 0, a = i.size > 0;
|
|
802
809
|
(c || a) && (t.html = {}, c && (t.html.import = o), a && (t.html.export = i));
|
|
803
810
|
for (const e of r) e.init(t);
|
|
804
|
-
return t.onError || (t.onError =
|
|
811
|
+
return t.onError || (t.onError = Xe), t;
|
|
805
812
|
}
|
|
806
813
|
};
|
|
807
|
-
function
|
|
808
|
-
const n =
|
|
809
|
-
return void 0 === n &&
|
|
814
|
+
function tn(t, e) {
|
|
815
|
+
const n = Qe.fromEditor(t).getExtensionRep(e);
|
|
816
|
+
return void 0 === n && Ce(303, e.name), n.getExtensionDependency();
|
|
810
817
|
}
|
|
811
|
-
function
|
|
812
|
-
const n =
|
|
818
|
+
function en(t, e) {
|
|
819
|
+
const n = Qe.maybeFromEditor(t);
|
|
813
820
|
if (!n) return;
|
|
814
821
|
const i = n.extensionNameMap.get(e);
|
|
815
822
|
return i ? i.getExtensionDependency() : void 0;
|
|
816
823
|
}
|
|
817
|
-
function
|
|
818
|
-
const n =
|
|
819
|
-
return void 0 === n &&
|
|
824
|
+
function nn(t, e) {
|
|
825
|
+
const n = en(t, e);
|
|
826
|
+
return void 0 === n && Ce(291, e), n;
|
|
820
827
|
}
|
|
821
|
-
function
|
|
822
|
-
return
|
|
828
|
+
function on(t) {
|
|
829
|
+
return tn($getEditor(), t);
|
|
823
830
|
}
|
|
824
|
-
function
|
|
825
|
-
return
|
|
831
|
+
function sn(t) {
|
|
832
|
+
return on(t).output;
|
|
826
833
|
}
|
|
827
|
-
function
|
|
828
|
-
return
|
|
834
|
+
function rn(t) {
|
|
835
|
+
return en($getEditor(), t);
|
|
829
836
|
}
|
|
830
|
-
const
|
|
837
|
+
const cn = /* @__PURE__ */ new Set(), an = /* @__PURE__ */ defineExtension({
|
|
831
838
|
build(t, e, n) {
|
|
832
|
-
const i = n.getDependency(
|
|
833
|
-
const t =
|
|
839
|
+
const i = n.getDependency(Oe).output, o = Ht({ watchedNodeKeys: /* @__PURE__ */ new Map() }), s = Ne(() => {}, () => se(() => {
|
|
840
|
+
const t = s.peek(), { watchedNodeKeys: e } = o.value;
|
|
834
841
|
let n, c = !1;
|
|
835
842
|
i.value.read(() => {
|
|
836
843
|
if ($getSelection()) for (const [i, o] of e.entries()) {
|
|
@@ -841,31 +848,31 @@ const Ve = /* @__PURE__ */ new Set(), We = defineExtension({
|
|
|
841
848
|
const s = $getNodeByKey(i), r = s && s.isSelected() || !1;
|
|
842
849
|
c = c || r !== (!!t && t.has(i)), r && (n = n || /* @__PURE__ */ new Set(), n.add(i));
|
|
843
850
|
}
|
|
844
|
-
}), !c && n && t && n.size === t.size || (
|
|
851
|
+
}), !c && n && t && n.size === t.size || (s.value = n);
|
|
845
852
|
}));
|
|
846
853
|
return { watchNodeKey: function(t) {
|
|
847
|
-
const e =
|
|
854
|
+
const e = te(() => (s.value || cn).has(t)), { watchedNodeKeys: n } = o.peek();
|
|
848
855
|
let i = n.get(t);
|
|
849
|
-
const
|
|
850
|
-
return i = i || /* @__PURE__ */ new Set(), i.add(e),
|
|
856
|
+
const r = void 0 !== i;
|
|
857
|
+
return i = i || /* @__PURE__ */ new Set(), i.add(e), r || (n.set(t, i), o.value = { watchedNodeKeys: n }), e;
|
|
851
858
|
} };
|
|
852
859
|
},
|
|
853
|
-
dependencies: [
|
|
860
|
+
dependencies: [Oe],
|
|
854
861
|
name: "@lexical/extension/NodeSelection"
|
|
855
|
-
}),
|
|
856
|
-
var
|
|
862
|
+
}), dn = /* @__PURE__ */ createCommand("INSERT_HORIZONTAL_RULE_COMMAND");
|
|
863
|
+
var un = class un extends DecoratorNode {
|
|
857
864
|
static getType() {
|
|
858
865
|
return "horizontalrule";
|
|
859
866
|
}
|
|
860
867
|
static clone(t) {
|
|
861
|
-
return new
|
|
868
|
+
return new un(t.__key);
|
|
862
869
|
}
|
|
863
870
|
static importJSON(t) {
|
|
864
|
-
return
|
|
871
|
+
return fn().updateFromJSON(t);
|
|
865
872
|
}
|
|
866
873
|
static importDOM() {
|
|
867
874
|
return { hr: () => ({
|
|
868
|
-
conversion:
|
|
875
|
+
conversion: ln,
|
|
869
876
|
priority: 0
|
|
870
877
|
}) };
|
|
871
878
|
}
|
|
@@ -886,66 +893,100 @@ var Ze = class Ze extends DecoratorNode {
|
|
|
886
893
|
return !1;
|
|
887
894
|
}
|
|
888
895
|
};
|
|
889
|
-
function
|
|
890
|
-
return { node:
|
|
896
|
+
function ln() {
|
|
897
|
+
return { node: fn() };
|
|
891
898
|
}
|
|
892
|
-
function
|
|
893
|
-
return $create(
|
|
899
|
+
function fn() {
|
|
900
|
+
return $create(un);
|
|
894
901
|
}
|
|
895
|
-
function
|
|
896
|
-
return t instanceof
|
|
902
|
+
function hn(t) {
|
|
903
|
+
return t instanceof un;
|
|
897
904
|
}
|
|
898
|
-
const
|
|
899
|
-
dependencies: [
|
|
905
|
+
const gn = /* @__PURE__ */ defineExtension({
|
|
906
|
+
dependencies: [Oe, an],
|
|
900
907
|
name: "@lexical/extension/HorizontalRule",
|
|
901
|
-
nodes: () => [
|
|
908
|
+
nodes: () => [un],
|
|
902
909
|
register(t, e, n) {
|
|
903
|
-
const { watchNodeKey:
|
|
904
|
-
return mergeRegister(t.registerCommand(
|
|
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) => {
|
|
905
912
|
const e = $getSelection();
|
|
906
913
|
if (!$isRangeSelection(e)) return !1;
|
|
907
|
-
if (null !== e.focus.getNode()) $insertNodeToNearestRoot(
|
|
914
|
+
if (null !== e.focus.getNode()) $insertNodeToNearestRoot(fn());
|
|
908
915
|
return !0;
|
|
909
916
|
}, COMMAND_PRIORITY_EDITOR), t.registerCommand(CLICK_COMMAND, (t) => {
|
|
910
917
|
if (isDOMNode(t.target)) {
|
|
911
918
|
const e = $getNodeFromDOMNode(t.target);
|
|
912
|
-
if (
|
|
919
|
+
if (hn(e)) return function(t, e = !1) {
|
|
913
920
|
const n = $getSelection(), i = t.isSelected(), o = t.getKey();
|
|
914
|
-
let
|
|
915
|
-
e && $isNodeSelection(n) ?
|
|
921
|
+
let s;
|
|
922
|
+
e && $isNodeSelection(n) ? s = n : (s = $createNodeSelection(), $setSelection(s)), i ? s.delete(o) : s.add(o);
|
|
916
923
|
}(e, t.shiftKey), !0;
|
|
917
924
|
}
|
|
918
925
|
return !1;
|
|
919
|
-
}, COMMAND_PRIORITY_LOW), t.registerMutationListener(
|
|
920
|
-
|
|
926
|
+
}, COMMAND_PRIORITY_LOW), t.registerMutationListener(un, (e, n) => {
|
|
927
|
+
Kt(() => {
|
|
921
928
|
let n = !1;
|
|
922
|
-
const { nodeSelections:
|
|
923
|
-
for (const [s, r] of e.entries()) if ("destroyed" === r)
|
|
929
|
+
const { nodeSelections: o } = s.peek();
|
|
930
|
+
for (const [s, r] of e.entries()) if ("destroyed" === r) o.delete(s), n = !0;
|
|
924
931
|
else {
|
|
925
|
-
const e =
|
|
926
|
-
e ? e.domNode.value = r : (n = !0,
|
|
927
|
-
domNode:
|
|
928
|
-
selectedSignal:
|
|
932
|
+
const e = o.get(s), r = t.getElementByKey(s);
|
|
933
|
+
e ? e.domNode.value = r : (n = !0, o.set(s, {
|
|
934
|
+
domNode: Ht(r),
|
|
935
|
+
selectedSignal: i(s)
|
|
929
936
|
}));
|
|
930
937
|
}
|
|
931
|
-
n && (
|
|
938
|
+
n && (s.value = { nodeSelections: o });
|
|
932
939
|
});
|
|
933
|
-
}),
|
|
940
|
+
}), se(() => {
|
|
934
941
|
const t = [];
|
|
935
|
-
for (const { domNode: e, selectedSignal: n } of
|
|
942
|
+
for (const { domNode: e, selectedSignal: n } of s.value.nodeSelections.values()) t.push(se(() => {
|
|
936
943
|
const t = e.value;
|
|
937
|
-
if (t) n.value ? addClassNamesToElement(t,
|
|
944
|
+
if (t) n.value ? addClassNamesToElement(t, c) : removeClassNamesFromElement(t, c);
|
|
938
945
|
}));
|
|
939
946
|
return mergeRegister(...t);
|
|
940
947
|
}));
|
|
941
948
|
}
|
|
949
|
+
}), pn = /* @__PURE__ */ defineExtension({
|
|
950
|
+
build: (t) => ({
|
|
951
|
+
composingTextNode: Ht(null),
|
|
952
|
+
compositionKey: Ht(null)
|
|
953
|
+
}),
|
|
954
|
+
name: "@lexical/extension/IME",
|
|
955
|
+
register(t, e, n) {
|
|
956
|
+
const { compositionKey: i, composingTextNode: o } = n.getOutput();
|
|
957
|
+
return mergeRegister(t.registerCommand(COMPOSITION_START_COMMAND, () => {
|
|
958
|
+
const t = $getSelection();
|
|
959
|
+
return $isRangeSelection(t) && (i.value = t.anchor.key), !1;
|
|
960
|
+
}, COMMAND_PRIORITY_BEFORE_EDITOR), se(() => {
|
|
961
|
+
const e = i.value;
|
|
962
|
+
o.value = null !== e ? t.read("latest", () => {
|
|
963
|
+
const t = $getNodeByKey(e);
|
|
964
|
+
return $isTextNode(t) ? t : null;
|
|
965
|
+
}) : null;
|
|
966
|
+
}), t.registerUpdateListener(({ tags: t, editorState: e }) => {
|
|
967
|
+
t.has(COMPOSITION_START_TAG) && e.read(() => {
|
|
968
|
+
const t = $getSelection();
|
|
969
|
+
if (!$isRangeSelection(t)) return;
|
|
970
|
+
const e = t.anchor.getNode();
|
|
971
|
+
$isTextNode(e) && (o.value = e);
|
|
972
|
+
});
|
|
973
|
+
}), t.registerRootListener((t) => {
|
|
974
|
+
if (null === t) return void (i.value = null);
|
|
975
|
+
const e = () => {
|
|
976
|
+
i.value = null;
|
|
977
|
+
};
|
|
978
|
+
return t.addEventListener("compositionend", e), () => {
|
|
979
|
+
t.removeEventListener("compositionend", e);
|
|
980
|
+
};
|
|
981
|
+
}));
|
|
982
|
+
}
|
|
942
983
|
});
|
|
943
|
-
const
|
|
944
|
-
build: (t, e) =>
|
|
945
|
-
config: safeCast({
|
|
984
|
+
const mn = /* @__PURE__ */ defineExtension({
|
|
985
|
+
build: (t, e) => re({ inheritEditableFromParent: e.inheritEditableFromParent }),
|
|
986
|
+
config: /* @__PURE__ */ safeCast({
|
|
946
987
|
$getParentEditor: function() {
|
|
947
988
|
const t = $getEditor();
|
|
948
|
-
return
|
|
989
|
+
return Qe.fromEditor(t), t;
|
|
949
990
|
},
|
|
950
991
|
inheritEditableFromParent: !1
|
|
951
992
|
}),
|
|
@@ -954,32 +995,72 @@ const Qe = defineExtension({
|
|
|
954
995
|
t.parentEditor = i, t.theme = t.theme || i._config.theme;
|
|
955
996
|
},
|
|
956
997
|
name: "@lexical/extension/NestedEditor",
|
|
957
|
-
register: (t, e, n) =>
|
|
998
|
+
register: (t, e, n) => se(() => {
|
|
958
999
|
const e = t._parentEditor;
|
|
959
1000
|
if (e && n.getOutput().inheritEditableFromParent.value) return t.setEditable(e.isEditable()), e.registerEditableListener(t.setEditable.bind(t));
|
|
960
1001
|
})
|
|
1002
|
+
}), vn = /* @__PURE__ */ defineExtension({
|
|
1003
|
+
config: /* @__PURE__ */ safeCast({
|
|
1004
|
+
attribute: "data-selected",
|
|
1005
|
+
nodes: []
|
|
1006
|
+
}),
|
|
1007
|
+
init(t, e) {
|
|
1008
|
+
const n = /* @__PURE__ */ new Set(), i = getRegisteredSubtypeMap(ge(t).nodes);
|
|
1009
|
+
for (const t of e.nodes) {
|
|
1010
|
+
const e = t.getType(), o = i.get(e);
|
|
1011
|
+
void 0 === o && Ce(339, t.name, e), n.add(e);
|
|
1012
|
+
for (const t of o) n.add(t);
|
|
1013
|
+
}
|
|
1014
|
+
return { matchTypes: n };
|
|
1015
|
+
},
|
|
1016
|
+
mergeConfig: (t, e) => shallowMergeConfig(t, {
|
|
1017
|
+
...e,
|
|
1018
|
+
...e.nodes && { nodes: [...t.nodes, ...e.nodes] }
|
|
1019
|
+
}),
|
|
1020
|
+
name: "@lexical/extension/NodeSelectionDataSelected",
|
|
1021
|
+
register(t, e, n) {
|
|
1022
|
+
const { attribute: i } = e, { matchTypes: o } = n.getInitResult(), s = /* @__PURE__ */ new Map(), c = (e) => {
|
|
1023
|
+
const n = /* @__PURE__ */ new Set();
|
|
1024
|
+
e.read(() => {
|
|
1025
|
+
const t = $getSelection();
|
|
1026
|
+
if ($isNodeSelection(t)) for (const e of t.getNodes()) o.has(e.getType()) && n.add(e.getKey());
|
|
1027
|
+
});
|
|
1028
|
+
for (const [t, e] of s) n.has(t) || (e.removeAttribute(i), s.delete(t));
|
|
1029
|
+
for (const e of n) {
|
|
1030
|
+
const n = t.getElementByKey(e);
|
|
1031
|
+
null !== n && (n.setAttribute(i, "true"), s.set(e, n));
|
|
1032
|
+
}
|
|
1033
|
+
};
|
|
1034
|
+
c(t.getEditorState());
|
|
1035
|
+
const a = t.registerUpdateListener(({ editorState: t }) => c(t));
|
|
1036
|
+
return () => {
|
|
1037
|
+
a();
|
|
1038
|
+
for (const t of s.values()) t.removeAttribute(i);
|
|
1039
|
+
s.clear();
|
|
1040
|
+
};
|
|
1041
|
+
}
|
|
961
1042
|
});
|
|
962
|
-
function
|
|
1043
|
+
function En(t) {
|
|
963
1044
|
$isElementNode(t) && t.isInline() && t.isEmpty() && t.remove();
|
|
964
1045
|
}
|
|
965
|
-
const
|
|
966
|
-
build: (t, e, n) =>
|
|
967
|
-
config: safeCast({ disabled: !1 }),
|
|
1046
|
+
const yn = /* @__PURE__ */ defineExtension({
|
|
1047
|
+
build: (t, e, n) => re(e),
|
|
1048
|
+
config: /* @__PURE__ */ safeCast({ disabled: !1 }),
|
|
968
1049
|
name: "@lexical/NormalizeInlineElements",
|
|
969
1050
|
register: (t, e, n) => {
|
|
970
1051
|
const i = n.getOutput();
|
|
971
|
-
return
|
|
1052
|
+
return se(() => {
|
|
972
1053
|
if (!i.disabled.value) {
|
|
973
1054
|
const e = [];
|
|
974
|
-
for (const { klass: n, transforms: i } of t._nodes.values()) n.prototype instanceof ElementNode && n.prototype.isInline !== ElementNode.prototype.isInline && (i.add(
|
|
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)));
|
|
975
1056
|
return () => e.forEach((t) => t());
|
|
976
1057
|
}
|
|
977
1058
|
});
|
|
978
1059
|
}
|
|
979
|
-
}),
|
|
980
|
-
const
|
|
981
|
-
build: (t, e, n) =>
|
|
982
|
-
config: safeCast({
|
|
1060
|
+
}), xn = new Set([SKIP_SELECTION_FOCUS_TAG, SKIP_SCROLL_INTO_VIEW_TAG]);
|
|
1061
|
+
const bn = /* @__PURE__ */ defineExtension({
|
|
1062
|
+
build: (t, e, n) => re(e),
|
|
1063
|
+
config: /* @__PURE__ */ safeCast({
|
|
983
1064
|
$fixFocusOverselection: function() {
|
|
984
1065
|
const t = $getSelection();
|
|
985
1066
|
if ($isRangeSelection(t) && !t.isCollapsed()) {
|
|
@@ -988,7 +1069,7 @@ const nn = defineExtension({
|
|
|
988
1069
|
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"));
|
|
989
1070
|
if ($isSiblingCaret(n) && $isElementNode(n.origin) && (n = $normalizeCaret($getChildCaret(n.origin, "previous")).getFlipped()), n = $normalizeCaret(n), !n.isSamePointCaret(e.focus)) {
|
|
990
1071
|
const t = $setSelectionFromCaretRange($getCaretRange(e.anchor, n)), i = $getEditor().getRootElement(), o = i && getDOMSelection(i.ownerDocument.defaultView);
|
|
991
|
-
o && $updateDOMSelection($getPreviousSelection(), t, $getEditor(), o,
|
|
1072
|
+
o && $updateDOMSelection($getPreviousSelection(), t, $getEditor(), o, xn, i);
|
|
992
1073
|
}
|
|
993
1074
|
}
|
|
994
1075
|
},
|
|
@@ -997,7 +1078,7 @@ const nn = defineExtension({
|
|
|
997
1078
|
thresholdMsec: 100
|
|
998
1079
|
}),
|
|
999
1080
|
name: "@lexical/NormalizeTripleClickSelection",
|
|
1000
|
-
register: (t, e, n) =>
|
|
1081
|
+
register: (t, e, n) => se(() => {
|
|
1001
1082
|
const e = n.getOutput();
|
|
1002
1083
|
if (!e.disabled.value) return t.registerRootListener((n) => {
|
|
1003
1084
|
if (!n) return;
|
|
@@ -1015,24 +1096,87 @@ const nn = defineExtension({
|
|
|
1015
1096
|
})());
|
|
1016
1097
|
});
|
|
1017
1098
|
})
|
|
1018
|
-
})
|
|
1019
|
-
|
|
1020
|
-
|
|
1099
|
+
});
|
|
1100
|
+
function Sn(t) {
|
|
1101
|
+
const e = t.target;
|
|
1102
|
+
isExactShortcutMatch(t, "a", {
|
|
1103
|
+
ctrlKey: !IS_APPLE,
|
|
1104
|
+
metaKey: IS_APPLE
|
|
1105
|
+
}) && isHTMLElement(e) && ("INPUT" === e.tagName || "TEXTAREA" === e.tagName) && e.addEventListener("keydown", stopLexicalPropagation, { once: !0 });
|
|
1106
|
+
}
|
|
1107
|
+
const wn = /* @__PURE__ */ defineExtension({
|
|
1108
|
+
build: (t, e, n) => re(e),
|
|
1109
|
+
config: /* @__PURE__ */ safeCast({ disabled: !1 }),
|
|
1110
|
+
name: "@lexical/extension/PreventSelectAll",
|
|
1111
|
+
register: (t, e, n) => {
|
|
1112
|
+
const i = n.getOutput();
|
|
1113
|
+
return se(() => {
|
|
1114
|
+
if (!i.disabled.value) return t.registerRootListener((t) => {
|
|
1115
|
+
if (t) return t.addEventListener("keydown", Sn, !0), () => t.removeEventListener("keydown", Sn, !0);
|
|
1116
|
+
});
|
|
1117
|
+
});
|
|
1118
|
+
}
|
|
1119
|
+
});
|
|
1120
|
+
const Nn = /* @__PURE__ */ defineExtension({
|
|
1121
|
+
build: (t, e, n) => re(e),
|
|
1122
|
+
config: /* @__PURE__ */ safeCast({
|
|
1123
|
+
cascadeSelection: !1,
|
|
1124
|
+
disabled: !1
|
|
1125
|
+
}),
|
|
1126
|
+
dependencies: [wn],
|
|
1127
|
+
name: "@lexical/extension/SelectBlock",
|
|
1128
|
+
register: (t, e, n) => {
|
|
1129
|
+
const i = n.getOutput(), o = n.getDependency(wn).output;
|
|
1130
|
+
return mergeRegister(se(() => {
|
|
1131
|
+
o.disabled.value = i.disabled.value;
|
|
1132
|
+
}), se(() => {
|
|
1133
|
+
if (!i.disabled.value) return t.registerCommand(SELECT_ALL_COMMAND, (e, n) => {
|
|
1134
|
+
if (n !== t) {
|
|
1135
|
+
if (!i.cascadeSelection.peek()) return !1;
|
|
1136
|
+
return !!n.read("pending", () => {
|
|
1137
|
+
const t = $getSelection();
|
|
1138
|
+
return $isRangeSelection(t) && $isBlockFullySelected($getRoot(), t);
|
|
1139
|
+
}) && ($selectAll(), !0);
|
|
1140
|
+
}
|
|
1141
|
+
const o = $getSelection();
|
|
1142
|
+
if ($isNodeSelection(o)) {
|
|
1143
|
+
const t = o.getNodes(), e = t[0];
|
|
1144
|
+
if (!e) return !1;
|
|
1145
|
+
const n = e.getTopLevelElement();
|
|
1146
|
+
return !n || $isRootNode(n) || n.is(e) || t.length > 1 && (c = n, !t.every((t) => c.is(t.getTopLevelElement()))) ? $selectAll() : $isElementNode(n) && n.select(0, n.getChildrenSize()), !0;
|
|
1147
|
+
}
|
|
1148
|
+
var c;
|
|
1149
|
+
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;
|
|
1152
|
+
let f = $getSlotFrame(d);
|
|
1153
|
+
for (; null !== f;) {
|
|
1154
|
+
if ($isElementNode(f) && !$isBlockFullySelected(f, o)) return f.select(0, f.getChildrenSize()), !0;
|
|
1155
|
+
const t = $getSlotHost(f);
|
|
1156
|
+
f = null === t ? null : $getSlotFrame(t);
|
|
1157
|
+
}
|
|
1158
|
+
return $isBlockFullySelected($getRoot(), o) || $selectAll(), !0;
|
|
1159
|
+
}, COMMAND_PRIORITY_LOW);
|
|
1160
|
+
}));
|
|
1161
|
+
}
|
|
1162
|
+
}), On = /* @__PURE__ */ defineExtension({
|
|
1163
|
+
build: (t, e, n) => re(e),
|
|
1164
|
+
config: /* @__PURE__ */ safeCast({
|
|
1021
1165
|
disabled: !1,
|
|
1022
1166
|
onReposition: void 0
|
|
1023
1167
|
}),
|
|
1024
1168
|
name: "@lexical/utils/SelectionAlwaysOnDisplay",
|
|
1025
1169
|
register: (t, e, n) => {
|
|
1026
1170
|
const i = n.getOutput();
|
|
1027
|
-
return
|
|
1171
|
+
return se(() => {
|
|
1028
1172
|
if (!i.disabled.value) return selectionAlwaysOnDisplay(t, i.onReposition.value);
|
|
1029
1173
|
});
|
|
1030
1174
|
}
|
|
1031
1175
|
});
|
|
1032
|
-
function
|
|
1176
|
+
function Cn(t) {
|
|
1033
1177
|
return t.canIndent();
|
|
1034
1178
|
}
|
|
1035
|
-
function
|
|
1179
|
+
function Rn(t, e, n = Cn) {
|
|
1036
1180
|
return mergeRegister(t.registerCommand(KEY_TAB_COMMAND, (e) => {
|
|
1037
1181
|
const n = $getSelection();
|
|
1038
1182
|
if (!$isRangeSelection(n)) return !1;
|
|
@@ -1060,20 +1204,25 @@ function rn(t, e, n = sn) {
|
|
|
1060
1204
|
});
|
|
1061
1205
|
}, COMMAND_PRIORITY_CRITICAL));
|
|
1062
1206
|
}
|
|
1063
|
-
const
|
|
1064
|
-
build: (t, e, n) =>
|
|
1065
|
-
config: safeCast({
|
|
1066
|
-
$canIndent:
|
|
1207
|
+
const Dn = /* @__PURE__ */ defineExtension({
|
|
1208
|
+
build: (t, e, n) => re(e),
|
|
1209
|
+
config: /* @__PURE__ */ safeCast({
|
|
1210
|
+
$canIndent: Cn,
|
|
1067
1211
|
disabled: !1,
|
|
1068
1212
|
maxIndent: null
|
|
1069
1213
|
}),
|
|
1070
1214
|
name: "@lexical/extension/TabIndentation",
|
|
1071
1215
|
register(t, e, n) {
|
|
1072
1216
|
const { disabled: i, maxIndent: o, $canIndent: s } = n.getOutput();
|
|
1073
|
-
return
|
|
1074
|
-
if (!i.value) return
|
|
1217
|
+
return se(() => {
|
|
1218
|
+
if (!i.value) return Rn(t, o, s);
|
|
1075
1219
|
});
|
|
1076
1220
|
}
|
|
1221
|
+
}), In = /* @__PURE__ */ defineExtension({
|
|
1222
|
+
build: (t) => Ne(() => t.isEditable(), (e) => t.registerEditableListener((t) => {
|
|
1223
|
+
e.value = t;
|
|
1224
|
+
})),
|
|
1225
|
+
name: "@lexical/extension/WatchEditable"
|
|
1077
1226
|
});
|
|
1078
1227
|
//#endregion
|
|
1079
|
-
export {
|
|
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 };
|