@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.
- package/README.md +35 -11
- package/dist/{Lexical.dev-DTxuYHmG.mjs → Lexical.dev-Cck4n26y.mjs} +998 -584
- package/dist/{Lexical.node-BlCLnfA6.mjs → Lexical.node-D6wf2D5M.mjs} +15 -5
- package/dist/Lexical.prod-DCwS1oTq.mjs +7170 -0
- package/dist/{LexicalClipboard.dev-CdFkLR_D.mjs → LexicalClipboard.dev-CMkPHV7O.mjs} +6 -6
- package/dist/{LexicalClipboard.node-ktUajxsv.mjs → LexicalClipboard.node-m4nZ7IYw.mjs} +2 -2
- package/dist/{LexicalClipboard.prod-DliyLofW.mjs → LexicalClipboard.prod-B_rN1vE1.mjs} +10 -8
- package/dist/{LexicalCodeCore.dev-CL9tHWJX.mjs → LexicalCodeCore.dev-DyJw3i8V.mjs} +62 -72
- package/dist/{LexicalCodeCore.prod-BoMSJc29.mjs → LexicalCodeCore.prod-DPXLHQLF.mjs} +212 -213
- package/dist/{LexicalDragon.dev-CqW7Aq5H.mjs → LexicalDragon.dev-ZkNfMwrE.mjs} +3 -3
- package/dist/{LexicalDragon.node-DLXctJyy.mjs → LexicalDragon.node-Ds9oLUFh.mjs} +2 -2
- package/dist/{LexicalDragon.prod-DHI3T6n5.mjs → LexicalDragon.prod-B58ic2av.mjs} +5 -4
- package/dist/{LexicalExtension.dev-BP-18zns.mjs → LexicalExtension.dev-DvwHs1Xv.mjs} +79 -67
- package/dist/{LexicalExtension.node-BWH6xbzG.mjs → LexicalExtension.node-5OymZQfy.mjs} +4 -2
- package/dist/{LexicalExtension.prod-Cs6OgrDn.mjs → LexicalExtension.prod-Ce0T5smQ.mjs} +372 -358
- package/dist/{LexicalHeadless.dev-DJp__UcP.mjs → LexicalHeadless.dev-DA0WldSR.mjs} +2 -2
- package/dist/{LexicalHeadless.prod-o0v9cIu5.mjs → LexicalHeadless.prod-1kQgKB6c.mjs} +2 -2
- package/dist/{LexicalHtml.dev-DoymwFpG.mjs → LexicalHtml.dev-BDB7CUrx.mjs} +14 -12
- package/dist/{LexicalHtml.node-CVkbWtUA.mjs → LexicalHtml.node-DpVNt7It.mjs} +4 -4
- package/dist/{LexicalHtml.prod-C2b3z99k.mjs → LexicalHtml.prod-HkxM5scw.mjs} +331 -300
- package/dist/{LexicalLink.dev-7cgLOLIe.mjs → LexicalLink.dev-C5zNJlrm.mjs} +65 -59
- package/dist/{LexicalLink.prod-DWFgoXHR.mjs → LexicalLink.prod-Bkt9hQAt.mjs} +196 -201
- package/dist/{LexicalList.dev-Ci2iOxFx.mjs → LexicalList.dev-B7VgME-m.mjs} +55 -82
- package/dist/LexicalList.prod-B8c7TDjH.mjs +951 -0
- package/dist/{LexicalMarkdown.dev-C0ZYCyuR.mjs → LexicalMarkdown.dev-B5z9kLbV.mjs} +62 -42
- package/dist/{LexicalMarkdown.prod-0M-Nc-rh.mjs → LexicalMarkdown.prod-wKzw7FFH.mjs} +255 -202
- package/dist/{LexicalRichText.dev-Cnr1kDym.mjs → LexicalRichText.dev-CUd6Li5F.mjs} +399 -120
- package/dist/{LexicalRichText.node-BUJZAiap.mjs → LexicalRichText.node-BKfaQ-CH.mjs} +12 -8
- package/dist/LexicalRichText.prod-SBewjJHx.mjs +708 -0
- package/dist/{LexicalSelection.dev-C4L7l8OB.mjs → LexicalSelection.dev-D27JOCqj.mjs} +48 -17
- package/dist/{LexicalSelection.node-CLKroUMQ.mjs → LexicalSelection.node-DBEwPjBu.mjs} +5 -4
- package/dist/{LexicalSelection.prod-DzFqpTlw.mjs → LexicalSelection.prod-OaYhXHOL.mjs} +101 -92
- package/dist/{LexicalTable.dev-Cc9-zqKa.mjs → LexicalTable.dev-6IFFOAE0.mjs} +590 -259
- package/dist/LexicalTable.prod-2CaLZ7fH.mjs +2524 -0
- package/dist/{LexicalUtils.dev-BRgK0L6G.mjs → LexicalUtils.dev-DJA7J_7v.mjs} +15 -19
- package/dist/{LexicalUtils.node-BVAwOkL4.mjs → LexicalUtils.node-Df9oPTlA.mjs} +6 -6
- package/dist/{LexicalUtils.prod-C1gtvVDP.mjs → LexicalUtils.prod-Bb7V4Ewg.mjs} +155 -159
- package/dist/bin/mxs.mjs +1 -1
- package/dist/esm-CDcJmHkG.mjs +2 -0
- package/dist/{esm-BNu4sUWV.mjs → esm-DLzrv7gD.mjs} +1837 -6015
- package/dist/index.d.mts +57 -62
- package/dist/index.mjs +1 -1
- package/dist/{mxs-CMX2yklg.mjs → mxs-BIRW5Axj.mjs} +13579 -8682
- package/dist/rolldown-runtime-JspESFgx.mjs +35 -0
- package/dist/vendor/litexml/cli.mjs +7043 -6207
- package/dist/vendor/litexml/litexml-html-preview-client.css +80 -47
- package/dist/vendor/litexml/litexml-html-preview-client.js +14422 -10838
- package/dist/vendor/litexml/style.css +6 -2
- package/package.json +23 -23
- package/skills/commands-ai.md +45 -12
- package/skills/overview.md +1 -1
- package/dist/Lexical.prod-CeB9UQuo.mjs +0 -6816
- package/dist/LexicalList.prod-D0xX5d3G.mjs +0 -944
- package/dist/LexicalRichText.prod-BfbMQ9uM.mjs +0 -538
- package/dist/LexicalTable.prod-BgO4nCxy.mjs +0 -2336
- package/dist/esm-jbwcVZth.mjs +0 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { A as $getChildCaret, Ct as $
|
|
2
|
-
import { a as $handleIndentAndOutdent, c as $isBlockFullySelected,
|
|
3
|
-
//#region ../../node_modules/.pnpm/@lexical+extension@0.
|
|
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
|
|
12
|
-
function
|
|
13
|
-
if (
|
|
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 =
|
|
17
|
-
for (
|
|
18
|
-
}(); void 0 !==
|
|
19
|
-
let n =
|
|
20
|
-
for (
|
|
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) &&
|
|
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 (
|
|
30
|
+
if (Vt = 0, Bt--, e) throw t;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
if (
|
|
34
|
-
|
|
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
|
-
|
|
38
|
+
$t();
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
let
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
|
|
49
|
+
Tt = e;
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
|
-
let
|
|
52
|
-
|
|
53
|
-
|
|
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 !==
|
|
61
|
+
return void 0 === e || e.t !== Tt ? (e = {
|
|
56
62
|
i: 0,
|
|
57
63
|
S: t,
|
|
58
|
-
p:
|
|
64
|
+
p: Tt.s,
|
|
59
65
|
n: void 0,
|
|
60
|
-
t:
|
|
66
|
+
t: Tt,
|
|
61
67
|
e: void 0,
|
|
62
68
|
x: void 0,
|
|
63
69
|
r: e
|
|
64
|
-
}, 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
|
|
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
|
|
70
|
-
return new
|
|
75
|
+
function Yt(t, e) {
|
|
76
|
+
return new Xt(t, e);
|
|
71
77
|
}
|
|
72
|
-
function
|
|
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
|
|
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
|
|
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
|
|
94
|
-
|
|
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
|
|
97
|
-
return new
|
|
102
|
+
function ne(t, e) {
|
|
103
|
+
return new ee(t, e);
|
|
98
104
|
}
|
|
99
|
-
function
|
|
105
|
+
function ie(t) {
|
|
100
106
|
const e = t.m;
|
|
101
107
|
if (t.m = void 0, "function" == typeof e) {
|
|
102
|
-
|
|
103
|
-
const n =
|
|
104
|
-
|
|
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,
|
|
114
|
+
throw t.f &= -2, t.f |= 8, oe(t), e;
|
|
109
115
|
} finally {
|
|
110
|
-
|
|
116
|
+
Tt = n, $t();
|
|
111
117
|
}
|
|
112
118
|
}
|
|
113
119
|
}
|
|
114
|
-
function
|
|
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,
|
|
122
|
+
t.x = void 0, t.s = void 0, ie(t);
|
|
117
123
|
}
|
|
118
|
-
function
|
|
119
|
-
if (
|
|
120
|
-
|
|
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
|
|
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
|
|
126
|
-
const n = new
|
|
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
|
|
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] =
|
|
145
|
+
n[i] = Yt(void 0 === o ? t[i] : o);
|
|
140
146
|
}
|
|
141
147
|
return n;
|
|
142
148
|
}
|
|
143
|
-
|
|
149
|
+
Xt.prototype.brand = Kt, Xt.prototype.h = function() {
|
|
144
150
|
return !0;
|
|
145
|
-
},
|
|
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 :
|
|
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
|
-
},
|
|
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 &&
|
|
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
|
-
},
|
|
160
|
-
return
|
|
161
|
-
const e = this.value, n =
|
|
162
|
-
|
|
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
|
-
|
|
172
|
+
Tt = n;
|
|
167
173
|
}
|
|
168
174
|
}, { name: "sub" });
|
|
169
|
-
},
|
|
175
|
+
}, Xt.prototype.valueOf = function() {
|
|
170
176
|
return this.value;
|
|
171
|
-
},
|
|
177
|
+
}, Xt.prototype.toString = function() {
|
|
172
178
|
return this.value + "";
|
|
173
|
-
},
|
|
179
|
+
}, Xt.prototype.toJSON = function() {
|
|
174
180
|
return this.value;
|
|
175
|
-
},
|
|
176
|
-
const t =
|
|
177
|
-
|
|
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
|
-
|
|
187
|
+
Tt = t;
|
|
182
188
|
}
|
|
183
|
-
}, Object.defineProperty(
|
|
189
|
+
}, Object.defineProperty(Xt.prototype, "value", {
|
|
184
190
|
get() {
|
|
185
|
-
const t =
|
|
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 (
|
|
196
|
+
if (Vt > 100) throw new Error("Cycle detected");
|
|
191
197
|
(function(t) {
|
|
192
|
-
0 !==
|
|
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:
|
|
202
|
+
o: Wt
|
|
197
203
|
});
|
|
198
|
-
})(this), this.v = t, this.i++,
|
|
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
|
-
|
|
208
|
+
$t();
|
|
203
209
|
}
|
|
204
210
|
}
|
|
205
211
|
}
|
|
206
|
-
}),
|
|
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 ===
|
|
210
|
-
if (this.g =
|
|
211
|
-
const 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
|
-
|
|
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
|
|
220
|
-
},
|
|
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
|
-
|
|
226
|
-
},
|
|
227
|
-
if (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
|
-
},
|
|
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(
|
|
242
|
+
}, Object.defineProperty(ee.prototype, "value", { get() {
|
|
237
243
|
if (1 & this.f) throw new Error("Cycle detected");
|
|
238
|
-
const t =
|
|
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
|
-
} }),
|
|
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
|
-
},
|
|
257
|
+
}, re.prototype.S = function() {
|
|
252
258
|
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
|
-
},
|
|
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
|
|
264
|
-
build: (t, e, n) =>
|
|
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
|
|
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
|
|
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
|
|
285
|
-
return t.registerCommand(CLEAR_EDITOR_COMMAND, (
|
|
290
|
+
function ue(t, e = le) {
|
|
291
|
+
return t.registerCommand(CLEAR_EDITOR_COMMAND, () => (e(), !0), COMMAND_PRIORITY_EDITOR);
|
|
286
292
|
}
|
|
287
|
-
const
|
|
288
|
-
build: (t, e, n) =>
|
|
289
|
-
config: /* @__PURE__ */ safeCast({ $onClear:
|
|
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
|
|
299
|
+
return ce(() => ue(t, i.value));
|
|
294
300
|
}
|
|
295
301
|
});
|
|
296
|
-
function
|
|
302
|
+
function he(t) {
|
|
297
303
|
return !!$isDecoratorNode(t) || !(!$isElementNode(t) || !t.isShadowRoot());
|
|
298
304
|
}
|
|
299
|
-
function
|
|
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
|
|
308
|
-
build: (t, e) =>
|
|
313
|
+
const pe = /* @__PURE__ */ defineExtension({
|
|
314
|
+
build: (t, e) => ae(e),
|
|
309
315
|
config: /* @__PURE__ */ safeCast({
|
|
310
|
-
$shouldInsertAfter:
|
|
316
|
+
$shouldInsertAfter: he,
|
|
311
317
|
disabled: !1
|
|
312
318
|
}),
|
|
313
319
|
name: "@lexical/ClickAfterLastBlock",
|
|
314
|
-
register: (t, e, n) =>
|
|
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
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
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
|
|
341
|
+
function me(t) {
|
|
336
342
|
const e = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
|
|
337
|
-
for (const i of
|
|
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
|
|
352
|
+
function ve(t) {
|
|
347
353
|
return ("function" == typeof t.nodes ? t.nodes() : t.nodes) || [];
|
|
348
354
|
}
|
|
349
|
-
const
|
|
350
|
-
var
|
|
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:
|
|
365
|
+
stateConfig: xe
|
|
357
366
|
}]
|
|
358
367
|
});
|
|
359
368
|
}
|
|
360
|
-
getFormat() {
|
|
361
|
-
return $getState(this,
|
|
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,
|
|
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
|
|
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
|
|
394
|
+
return t instanceof ye;
|
|
389
395
|
}
|
|
390
|
-
function
|
|
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
|
|
395
|
-
|
|
396
|
-
|
|
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
|
-
|
|
399
|
-
|
|
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
|
|
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
|
-
}
|
|
421
|
+
};
|
|
422
|
+
const Re = /* @__PURE__ */ defineExtension({
|
|
414
423
|
name: "@lexical/extension/DecoratorText",
|
|
415
|
-
nodes: () => [
|
|
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
|
|
426
|
+
function Ce(t, e) {
|
|
423
427
|
let n;
|
|
424
|
-
return
|
|
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
|
|
434
|
-
build: (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
|
|
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
|
|
449
|
+
let Fe;
|
|
446
450
|
try {
|
|
447
|
-
|
|
451
|
+
Fe = "0.49.0+prod.esm";
|
|
448
452
|
} catch (t) {}
|
|
449
|
-
const
|
|
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
|
|
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) !
|
|
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
|
|
463
|
-
|
|
464
|
-
|
|
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
|
|
478
|
+
function We(t) {
|
|
467
479
|
return t.id === Le;
|
|
468
480
|
}
|
|
469
|
-
function
|
|
481
|
+
function Be(t) {
|
|
470
482
|
return function(t) {
|
|
471
|
-
return t.id ===
|
|
472
|
-
}(t) ||
|
|
483
|
+
return t.id === Pe;
|
|
484
|
+
}(t) || Ie(305, String(t.id), String(Pe)), Object.assign(t, { id: Le });
|
|
473
485
|
}
|
|
474
|
-
const
|
|
475
|
-
var
|
|
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:
|
|
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
|
-
|
|
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:
|
|
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:
|
|
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 !==
|
|
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:
|
|
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 !==
|
|
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:
|
|
556
|
+
return Object.assign(t, { id: Te });
|
|
545
557
|
}(n), () => {
|
|
546
558
|
const t = this.state;
|
|
547
|
-
t.id !==
|
|
548
|
-
return Object.assign(t, { id:
|
|
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 !==
|
|
556
|
-
return Object.assign(t, { id:
|
|
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 &&
|
|
572
|
+
return void 0 === this._signal && Ie(311), this._signal;
|
|
561
573
|
}
|
|
562
574
|
getInitResult() {
|
|
563
|
-
void 0 === this.extension.init &&
|
|
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 >=
|
|
567
|
-
}(t) ||
|
|
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 >=
|
|
577
|
-
}(t) ||
|
|
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 &&
|
|
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 &&
|
|
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 >=
|
|
595
|
-
}(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) ||
|
|
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 >=
|
|
609
|
-
})(t) ||
|
|
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
|
|
619
|
-
function
|
|
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
|
|
635
|
+
const Je = /* @__PURE__ */ defineExtension({
|
|
624
636
|
config: /* @__PURE__ */ safeCast({
|
|
625
|
-
setOptions:
|
|
626
|
-
updateOptions:
|
|
637
|
+
setOptions: Ze,
|
|
638
|
+
updateOptions: Ze
|
|
627
639
|
}),
|
|
628
|
-
init: ({ $initialEditorState: t =
|
|
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
|
-
})
|
|
657
|
-
|
|
658
|
-
|
|
668
|
+
});
|
|
669
|
+
const Xe = Symbol.for("@lexical/extension/LexicalBuilder");
|
|
670
|
+
function Ye(...t) {
|
|
671
|
+
return nn.fromExtensions(t).buildEditor();
|
|
659
672
|
}
|
|
660
|
-
function
|
|
661
|
-
function
|
|
673
|
+
function qe() {}
|
|
674
|
+
function Qe(t) {
|
|
662
675
|
throw t;
|
|
663
676
|
}
|
|
664
|
-
function
|
|
677
|
+
function tn(t) {
|
|
665
678
|
return Array.isArray(t) ? t : [t];
|
|
666
679
|
}
|
|
667
|
-
const
|
|
668
|
-
var
|
|
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 =
|
|
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 = [
|
|
682
|
-
for (const n of t) e.push(
|
|
683
|
-
return new
|
|
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[
|
|
687
|
-
return e && (e.PACKAGE_VERSION !==
|
|
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 =
|
|
691
|
-
return void 0 === 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
|
-
}), { [
|
|
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 =
|
|
720
|
+
let t = qe;
|
|
708
721
|
function e() {
|
|
709
722
|
try {
|
|
710
723
|
t();
|
|
711
724
|
} finally {
|
|
712
|
-
t =
|
|
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 &&
|
|
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 &&
|
|
736
|
-
const [n] =
|
|
737
|
-
"string" != 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 &&
|
|
740
|
-
i = new
|
|
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 &&
|
|
743
|
-
for (const t of n.conflictsWith || []) this.extensionNameMap.has(t) &&
|
|
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 =
|
|
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 (
|
|
768
|
+
if (We(o)) return;
|
|
756
769
|
const s = n.extension.name;
|
|
757
770
|
var r;
|
|
758
|
-
|
|
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 =
|
|
777
|
+
o = Be(o), n.state = o, t.push(n);
|
|
765
778
|
};
|
|
766
|
-
for (const t of this.extensionNameMap.values())
|
|
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 &&
|
|
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
|
|
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 &&
|
|
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 &&
|
|
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 =
|
|
824
|
+
return t.onError || (t.onError = Qe), t;
|
|
812
825
|
}
|
|
813
826
|
};
|
|
814
|
-
function
|
|
815
|
-
const n =
|
|
816
|
-
return void 0 === n &&
|
|
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
|
|
819
|
-
const n =
|
|
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
|
|
825
|
-
const n =
|
|
826
|
-
return void 0 === 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
|
|
829
|
-
return
|
|
841
|
+
function cn(t) {
|
|
842
|
+
return on($getEditor(), t);
|
|
830
843
|
}
|
|
831
|
-
function
|
|
832
|
-
return
|
|
844
|
+
function an(t) {
|
|
845
|
+
return cn(t).output;
|
|
833
846
|
}
|
|
834
|
-
function
|
|
835
|
-
return
|
|
847
|
+
function dn(t) {
|
|
848
|
+
return sn($getEditor(), t);
|
|
836
849
|
}
|
|
837
|
-
const
|
|
850
|
+
const ln = /* @__PURE__ */ new Set();
|
|
851
|
+
const un = /* @__PURE__ */ defineExtension({
|
|
838
852
|
build(t, e, n) {
|
|
839
|
-
const i = n.getDependency(
|
|
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 =
|
|
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: [
|
|
874
|
+
dependencies: [De],
|
|
861
875
|
name: "@lexical/extension/NodeSelection"
|
|
862
|
-
})
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
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:
|
|
886
|
+
return { element: $getDocument().createElement("hr") };
|
|
881
887
|
}
|
|
882
888
|
createDOM(t) {
|
|
883
|
-
const e =
|
|
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
|
|
897
|
-
return { node:
|
|
902
|
+
function gn() {
|
|
903
|
+
return { node: pn() };
|
|
898
904
|
}
|
|
899
|
-
function
|
|
900
|
-
return $create(
|
|
905
|
+
function pn() {
|
|
906
|
+
return $create(hn);
|
|
901
907
|
}
|
|
902
|
-
function
|
|
903
|
-
return t instanceof
|
|
908
|
+
function mn(t) {
|
|
909
|
+
return t instanceof hn;
|
|
904
910
|
}
|
|
905
|
-
const
|
|
906
|
-
dependencies: [
|
|
911
|
+
const vn = /* @__PURE__ */ defineExtension({
|
|
912
|
+
dependencies: [De, un],
|
|
907
913
|
name: "@lexical/extension/HorizontalRule",
|
|
908
|
-
nodes: () => [
|
|
914
|
+
nodes: () => [hn],
|
|
909
915
|
register(t, e, n) {
|
|
910
|
-
const { watchNodeKey: i } = n.getDependency(
|
|
911
|
-
return mergeRegister(t.registerCommand(
|
|
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(
|
|
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 (
|
|
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(
|
|
927
|
-
|
|
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:
|
|
940
|
+
domNode: Yt(r),
|
|
935
941
|
selectedSignal: i(s)
|
|
936
942
|
}));
|
|
937
943
|
}
|
|
938
944
|
n && (s.value = { nodeSelections: o });
|
|
939
945
|
});
|
|
940
|
-
}),
|
|
946
|
+
}), ce(() => {
|
|
941
947
|
const t = [];
|
|
942
|
-
for (const { domNode: e, selectedSignal: n } of s.value.nodeSelections.values()) t.push(
|
|
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
|
-
})
|
|
955
|
+
});
|
|
956
|
+
const xn = /* @__PURE__ */ defineExtension({
|
|
950
957
|
build: (t) => ({
|
|
951
|
-
composingTextNode:
|
|
952
|
-
compositionKey:
|
|
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),
|
|
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
|
-
|
|
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
|
|
985
|
-
build: (t, e) =>
|
|
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
|
|
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) =>
|
|
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
|
-
})
|
|
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(
|
|
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 &&
|
|
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
|
|
1048
|
+
function bn(t) {
|
|
1044
1049
|
$isElementNode(t) && t.isInline() && t.isEmpty() && t.remove();
|
|
1045
1050
|
}
|
|
1046
|
-
const
|
|
1047
|
-
build: (t, e, n) =>
|
|
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
|
|
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(
|
|
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
|
-
})
|
|
1061
|
-
const
|
|
1062
|
-
|
|
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,
|
|
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) =>
|
|
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
|
-
|
|
1095
|
-
|
|
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
|
|
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
|
|
1108
|
-
build: (t, e, n) =>
|
|
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
|
|
1119
|
+
return ce(() => {
|
|
1114
1120
|
if (!i.disabled.value) return t.registerRootListener((t) => {
|
|
1115
|
-
if (t) return t
|
|
1121
|
+
if (t) return registerEventListener(t, "keydown", On, !0);
|
|
1116
1122
|
});
|
|
1117
1123
|
});
|
|
1118
1124
|
}
|
|
1119
1125
|
});
|
|
1120
|
-
const
|
|
1121
|
-
build: (t
|
|
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: [
|
|
1138
|
+
dependencies: [Rn],
|
|
1127
1139
|
name: "@lexical/extension/SelectBlock",
|
|
1128
1140
|
register: (t, e, n) => {
|
|
1129
|
-
const i = n.getOutput(), o = n.getDependency(
|
|
1130
|
-
return mergeRegister(
|
|
1141
|
+
const i = n.getOutput(), o = n.getDependency(Rn).output;
|
|
1142
|
+
return mergeRegister(ce(() => {
|
|
1131
1143
|
o.disabled.value = i.disabled.value;
|
|
1132
|
-
}),
|
|
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(),
|
|
1151
|
-
if (
|
|
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
|
-
})
|
|
1163
|
-
|
|
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
|
|
1184
|
+
return ce(() => {
|
|
1172
1185
|
if (!i.disabled.value) return selectionAlwaysOnDisplay(t, i.onReposition.value);
|
|
1173
1186
|
});
|
|
1174
1187
|
}
|
|
1175
1188
|
});
|
|
1176
|
-
function
|
|
1189
|
+
function Fn(t) {
|
|
1177
1190
|
return t.canIndent();
|
|
1178
1191
|
}
|
|
1179
|
-
function
|
|
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
|
|
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
|
|
1208
|
-
build: (t, e, n) =>
|
|
1220
|
+
const kn = /* @__PURE__ */ defineExtension({
|
|
1221
|
+
build: (t, e, n) => ae(e),
|
|
1209
1222
|
config: /* @__PURE__ */ safeCast({
|
|
1210
|
-
$canIndent:
|
|
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
|
|
1218
|
-
if (!i.value) return
|
|
1230
|
+
return ce(() => {
|
|
1231
|
+
if (!i.value) return Mn(t, o, s);
|
|
1219
1232
|
});
|
|
1220
1233
|
}
|
|
1221
|
-
})
|
|
1222
|
-
|
|
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 {
|
|
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 };
|