@mx-space/cli 0.7.8 → 0.9.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 +30 -0
- package/ROADMAP.md +1 -0
- package/dist/{Lexical.dev-rcxzwpir.mjs → Lexical.dev-By5dOKBN.mjs} +1486 -356
- package/dist/{Lexical.node-BUsI9gWr.mjs → Lexical.node-fXM8Jp7p.mjs} +39 -17
- package/dist/{Lexical.prod-C8HtkSD6.mjs → Lexical.prod-BlCvXPGa.mjs} +2279 -1768
- package/dist/LexicalClipboard.dev--HxGoSkO.mjs +915 -0
- package/dist/{LexicalClipboard.node-CO-MCKx5.mjs → LexicalClipboard.node-C3mRbrmW.mjs} +10 -3
- package/dist/LexicalClipboard.prod-DNJzFMcT.mjs +371 -0
- package/dist/LexicalCodeCore.dev-DjSrd4A4.mjs +1109 -0
- package/dist/LexicalCodeCore.prod-DTDShkR3.mjs +642 -0
- package/dist/{LexicalDragon.dev-gBP8WSRS.mjs → LexicalDragon.dev-DwprRH0z.mjs} +3 -3
- package/dist/{LexicalDragon.node-OG6G55nl.mjs → LexicalDragon.node-BVhw4C7s.mjs} +2 -2
- package/dist/{LexicalDragon.prod-DP-_Q8cv.mjs → LexicalDragon.prod-nh4J-8vn.mjs} +3 -3
- package/dist/{LexicalExtension.dev-DVbjljrm.mjs → LexicalExtension.dev-BPNyvGqe.mjs} +335 -6
- package/dist/{LexicalExtension.node-CF3EAPN7.mjs → LexicalExtension.node-BVlcrgOx.mjs} +15 -8
- package/dist/{LexicalExtension.prod-DklHHErZ.mjs → LexicalExtension.prod-DFKbiNt-.mjs} +375 -265
- package/dist/{LexicalHeadless.dev-DdWLM7Nl.mjs → LexicalHeadless.dev-B-cj7Pr5.mjs} +2 -2
- package/dist/{LexicalHeadless.prod-CoiiTDzR.mjs → LexicalHeadless.prod-Byp1vNzT.mjs} +2 -2
- package/dist/LexicalHtml.dev-prBAwszN.mjs +2424 -0
- package/dist/LexicalHtml.node-BvNF96jZ.mjs +56 -0
- package/dist/LexicalHtml.prod-Sz3CW1ht.mjs +1207 -0
- package/dist/{LexicalLink.dev-BS1Bf-yD.mjs → LexicalLink.dev-NySTYhVR.mjs} +42 -8
- package/dist/{LexicalLink.prod-B_crkoHP.mjs → LexicalLink.prod-BuCM8gts.mjs} +209 -191
- package/dist/{LexicalList.dev-OMqmcnQ-.mjs → LexicalList.dev-DIMOvSFD.mjs} +252 -80
- package/dist/{LexicalList.prod-CpL1s8vS.mjs → LexicalList.prod-MVqfA6Vo.mjs} +364 -278
- package/dist/{LexicalMarkdown.dev-BHSdx_Gr.mjs → LexicalMarkdown.dev-C7aylvCG.mjs} +729 -552
- package/dist/LexicalMarkdown.prod-CfQSM406.mjs +868 -0
- package/dist/{LexicalRichText.dev-Bz9A_WbM.mjs → LexicalRichText.dev-DfICq6lU.mjs} +272 -77
- package/dist/{LexicalRichText.node-DDpwfE-P.mjs → LexicalRichText.node-Bg9jND3Q.mjs} +21 -8
- package/dist/LexicalRichText.prod-GsFzCK-o.mjs +550 -0
- package/dist/{LexicalSelection.dev-CQ380fnD.mjs → LexicalSelection.dev-DGjj12wW.mjs} +50 -38
- package/dist/{LexicalSelection.node-DesBMjIE.mjs → LexicalSelection.node-BU5L4193.mjs} +4 -4
- package/dist/{LexicalSelection.prod-D2jivCDB.mjs → LexicalSelection.prod-D-PwRbyK.mjs} +158 -140
- package/dist/{LexicalTable.dev-Ca7mQ7Jk.mjs → LexicalTable.dev-ChP7cugd.mjs} +215 -53
- package/dist/{LexicalTable.prod-DyPAcC7y.mjs → LexicalTable.prod-Bpr9YRXp.mjs} +668 -573
- package/dist/{LexicalUtils.dev-HxM8F0g6.mjs → LexicalUtils.dev-BiFU3789.mjs} +10 -47
- package/dist/{LexicalUtils.node-lCWjRjoG.mjs → LexicalUtils.node-j3Llm7Y3.mjs} +2 -2
- package/dist/{LexicalUtils.prod-Bti5w4ki.mjs → LexicalUtils.prod-DCvrA78p.mjs} +103 -105
- package/dist/bin/mxs.d.mts +1 -1
- package/dist/bin/mxs.mjs +1 -1
- package/dist/esm-By7trG9K.mjs +2 -0
- package/dist/{esm-CK9m5JKX.mjs → esm-Dg-WhPCe.mjs} +989 -989
- package/dist/index.d.mts +11 -2
- package/dist/index.mjs +1 -1
- package/dist/{mxs-BZt1cLW9.mjs → mxs-BR5Y5ash.mjs} +25141 -24672
- package/package.json +15 -14
- package/skills/commands-auth.md +1 -1
- package/skills/commands-category.md +1 -1
- package/skills/commands-comment.md +1 -1
- package/skills/commands-config.md +1 -1
- package/skills/commands-preview.md +1 -1
- package/skills/commands-profile.md +1 -1
- package/skills/commands-project.md +57 -0
- package/skills/commands-topic.md +1 -1
- package/skills/output-modes.md +1 -1
- package/skills/overview.md +2 -1
- package/skills/safety.md +10 -0
- package/dist/LexicalClipboard.dev-BpqRwTLP.mjs +0 -494
- package/dist/LexicalClipboard.prod-B_xdeiAC.mjs +0 -291
- package/dist/LexicalCodeCore.dev-7_cexm39.mjs +0 -537
- package/dist/LexicalCodeCore.prod-Bd6WFHcO.mjs +0 -381
- package/dist/LexicalHtml.dev-C3ZSWBFZ.mjs +0 -684
- package/dist/LexicalHtml.node-D0TD152E.mjs +0 -24
- package/dist/LexicalHtml.prod-CX47X0zl.mjs +0 -430
- package/dist/LexicalMarkdown.prod-C-S7Ii6-.mjs +0 -754
- package/dist/LexicalRichText.prod-C8qXACDL.mjs +0 -427
- package/dist/esm-DRbkkY3r.mjs +0 -2
- /package/dist/{mxs-CM8-6uAr.d.mts → mxs-iqJBopvE.d.mts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { $n as
|
|
2
|
-
import { c as $insertNodeToNearestRoot, i as $getNearestBlockElementAncestorOrThrow, o as $handleIndentAndOutdent, v as selectionAlwaysOnDisplay } from "./LexicalUtils.node-
|
|
3
|
-
//#region ../../node_modules/.pnpm/@lexical+extension@0.
|
|
1
|
+
import { $ as $isElementNode, $n as TabNode, $t as ElementNode, Ar as removeClassNamesFromElement, B as $getNodeFromDOMNode, Bn as OUTDENT_CONTENT_COMMAND, Bt as COMMAND_PRIORITY_LOW, D as $getCaretRangeInDirection, E as $getCaretRange, Et as $setState, F as $getEditor, Fr as shallowMergeConfig, G as $getState, Gn as RootNode, H as $getRoot, In as KEY_TAB_COMMAND, Ir as stopLexicalPropagation, It as COMMAND_PRIORITY_BEFORE_CRITICAL, Kn as SELECTION_CHANGE_COMMAND, Ln as LineBreakNode, Lr as toggleTextFormatType, Lt as COMMAND_PRIORITY_CRITICAL, Nt as CLEAR_EDITOR_COMMAND, Or as mergeRegister, Pt as CLICK_COMMAND, Q as $isEditorState, Qn as TEXT_TYPE_TO_FORMAT, Qt as DecoratorNode, R as $getNodeByKey, Rt as COMMAND_PRIORITY_EDITOR, Tt as $setSelectionFromCaretRange, U as $getSelection, Un as ParagraphNode, V as $getPreviousSelection, W as $getSiblingCaret, X as $isChildCaret, Xn as SKIP_SCROLL_INTO_VIEW_TAG, Y as $isBlockElementNode, Z as $isDecoratorNode, Zn as SKIP_SELECTION_FOCUS_TAG, ar as createEditor, at as $isNodeSelection, cr as defineExtension, d as $createNodeSelection, er as TextNode, f as $createParagraphNode, fr as getStaticNodeConfig, gt as $normalizeSelection__EXPERIMENTAL, ht as $normalizeCaret, i as $caretRangeFromSelection, in as HISTORY_MERGE_TAG, ir as createCommand, it as $isLineBreakNode, jr as safeCast, k as $getChildCaret, kt as $updateDOMSelection, l as $create, ln as INSERT_TAB_COMMAND, lr as getDOMSelection, m as $createRangeSelection, nn as FORMAT_TEXT_COMMAND, on as INDENT_CONTENT_COMMAND, or as createState, pt as $isTextPointCaret, rr as configExtension, sr as declarePeerDependency, st as $isRangeSelection, tr as addClassNamesToElement, ut as $isSiblingCaret, vr as isDOMNode, wt as $setSelection, yt as $rewindSiblingCaret } from "./Lexical.node-fXM8Jp7p.mjs";
|
|
2
|
+
import { c as $insertNodeToNearestRoot, i as $getNearestBlockElementAncestorOrThrow, o as $handleIndentAndOutdent, v as selectionAlwaysOnDisplay } from "./LexicalUtils.node-j3Llm7Y3.mjs";
|
|
3
|
+
//#region ../../node_modules/.pnpm/@lexical+extension@0.45.0/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 yt = Symbol.for("preact-signals");
|
|
12
|
+
function St() {
|
|
13
|
+
if (Rt > 1) return void Rt--;
|
|
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 = Ct;
|
|
17
|
+
for (Ct = void 0; void 0 !== t;) t.S.v === t.v && (t.S.i = t.i), t = t.o;
|
|
18
|
+
}(); void 0 !== Nt;) {
|
|
19
|
+
let n = Nt;
|
|
20
|
+
for (Nt = void 0, Dt++; 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) && Pt(n)) try {
|
|
23
23
|
n.c();
|
|
24
24
|
} catch (n) {
|
|
25
25
|
e || (t = n, e = !0);
|
|
@@ -27,53 +27,53 @@ function X() {
|
|
|
27
27
|
n = i;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
if (
|
|
30
|
+
if (Dt = 0, Rt--, e) throw t;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
if (
|
|
34
|
-
|
|
32
|
+
function bt(t) {
|
|
33
|
+
if (Rt > 0) return t();
|
|
34
|
+
It = ++Ft, Rt++;
|
|
35
35
|
try {
|
|
36
36
|
return t();
|
|
37
37
|
} finally {
|
|
38
|
-
|
|
38
|
+
St();
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
let
|
|
42
|
-
function
|
|
43
|
-
const e =
|
|
44
|
-
|
|
41
|
+
let wt, Nt;
|
|
42
|
+
function Ot(t) {
|
|
43
|
+
const e = wt;
|
|
44
|
+
wt = void 0;
|
|
45
45
|
try {
|
|
46
46
|
return t();
|
|
47
47
|
} finally {
|
|
48
|
-
|
|
48
|
+
wt = e;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
let
|
|
52
|
-
function
|
|
53
|
-
if (void 0 ===
|
|
51
|
+
let Ct, Rt = 0, Dt = 0, Ft = 0, It = 0, Mt = 0;
|
|
52
|
+
function kt(t) {
|
|
53
|
+
if (void 0 === wt) return;
|
|
54
54
|
let e = t.n;
|
|
55
|
-
return void 0 === e || e.t !==
|
|
55
|
+
return void 0 === e || e.t !== wt ? (e = {
|
|
56
56
|
i: 0,
|
|
57
57
|
S: t,
|
|
58
|
-
p:
|
|
58
|
+
p: wt.s,
|
|
59
59
|
n: void 0,
|
|
60
|
-
t:
|
|
60
|
+
t: wt,
|
|
61
61
|
e: void 0,
|
|
62
62
|
x: void 0,
|
|
63
63
|
r: e
|
|
64
|
-
}, void 0 !==
|
|
64
|
+
}, void 0 !== wt.s && (wt.s.n = e), wt.s = e, t.n = e, 32 & wt.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 = wt.s, e.n = void 0, wt.s.n = e, wt.s = e), e) : void 0;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function _t(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 At(t, e) {
|
|
70
|
+
return new _t(t, e);
|
|
71
71
|
}
|
|
72
|
-
function
|
|
72
|
+
function Pt(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 $t(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 ht(t) {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function Lt(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 gt(t) {
|
|
|
90
90
|
}
|
|
91
91
|
t.s = e;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
|
|
93
|
+
function jt(t, e) {
|
|
94
|
+
_t.call(this, void 0), this.x = t, this.s = void 0, this.g = Mt - 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 Kt(t, e) {
|
|
97
|
+
return new jt(t, e);
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function zt(t) {
|
|
100
100
|
const e = t.m;
|
|
101
101
|
if (t.m = void 0, "function" == typeof e) {
|
|
102
|
-
|
|
103
|
-
const n =
|
|
104
|
-
|
|
102
|
+
Rt++;
|
|
103
|
+
const n = wt;
|
|
104
|
+
wt = 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, Ut(t), e;
|
|
109
109
|
} finally {
|
|
110
|
-
|
|
110
|
+
wt = n, St();
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function Ut(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, zt(t);
|
|
117
117
|
}
|
|
118
|
-
function
|
|
119
|
-
if (
|
|
120
|
-
|
|
118
|
+
function Tt(t) {
|
|
119
|
+
if (wt !== this) throw new Error("Out-of-order effect");
|
|
120
|
+
Lt(this), wt = t, this.f &= -2, 8 & this.f && Ut(this), St();
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function Bt(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 Vt(t, e) {
|
|
126
|
+
const n = new Bt(t, e);
|
|
127
127
|
try {
|
|
128
128
|
n.c();
|
|
129
129
|
} catch (t) {
|
|
@@ -132,113 +132,113 @@ function St(t, e) {
|
|
|
132
132
|
const i = n.d.bind(n);
|
|
133
133
|
return i[Symbol.dispose] = i, i;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function Wt(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] = At(void 0 === o ? t[i] : o);
|
|
140
140
|
}
|
|
141
141
|
return n;
|
|
142
142
|
}
|
|
143
|
-
|
|
143
|
+
_t.prototype.brand = yt, _t.prototype.h = function() {
|
|
144
144
|
return !0;
|
|
145
|
-
},
|
|
145
|
+
}, _t.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 : Ot(() => {
|
|
148
148
|
var t;
|
|
149
149
|
null == (t = this.W) || t.call(this);
|
|
150
150
|
}));
|
|
151
|
-
},
|
|
151
|
+
}, _t.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 && Ot(() => {
|
|
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
|
+
}, _t.prototype.subscribe = function(t) {
|
|
160
|
+
return Vt(() => {
|
|
161
|
+
const e = this.value, n = wt;
|
|
162
|
+
wt = void 0;
|
|
163
163
|
try {
|
|
164
164
|
t(e);
|
|
165
165
|
} finally {
|
|
166
|
-
|
|
166
|
+
wt = n;
|
|
167
167
|
}
|
|
168
168
|
}, { name: "sub" });
|
|
169
|
-
},
|
|
169
|
+
}, _t.prototype.valueOf = function() {
|
|
170
170
|
return this.value;
|
|
171
|
-
},
|
|
171
|
+
}, _t.prototype.toString = function() {
|
|
172
172
|
return this.value + "";
|
|
173
|
-
},
|
|
173
|
+
}, _t.prototype.toJSON = function() {
|
|
174
174
|
return this.value;
|
|
175
|
-
},
|
|
176
|
-
const t =
|
|
177
|
-
|
|
175
|
+
}, _t.prototype.peek = function() {
|
|
176
|
+
const t = wt;
|
|
177
|
+
wt = void 0;
|
|
178
178
|
try {
|
|
179
179
|
return this.value;
|
|
180
180
|
} finally {
|
|
181
|
-
|
|
181
|
+
wt = t;
|
|
182
182
|
}
|
|
183
|
-
}, Object.defineProperty(
|
|
183
|
+
}, Object.defineProperty(_t.prototype, "value", {
|
|
184
184
|
get() {
|
|
185
|
-
const t =
|
|
185
|
+
const t = kt(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 (Dt > 100) throw new Error("Cycle detected");
|
|
191
191
|
(function(t) {
|
|
192
|
-
0 !==
|
|
192
|
+
0 !== Rt && 0 === Dt && t.l !== It && (t.l = It, Ct = {
|
|
193
193
|
S: t,
|
|
194
194
|
v: t.v,
|
|
195
195
|
i: t.i,
|
|
196
|
-
o:
|
|
196
|
+
o: Ct
|
|
197
197
|
});
|
|
198
|
-
})(this), this.v = t, this.i++,
|
|
198
|
+
})(this), this.v = t, this.i++, Mt++, Rt++;
|
|
199
199
|
try {
|
|
200
200
|
for (let t = this.t; void 0 !== t; t = t.x) t.t.N();
|
|
201
201
|
} finally {
|
|
202
|
-
|
|
202
|
+
St();
|
|
203
203
|
}
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
}),
|
|
206
|
+
}), jt.prototype = new _t(), jt.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 === Mt) return !0;
|
|
210
|
+
if (this.g = Mt, this.f |= 1, this.i > 0 && !Pt(this)) return this.f &= -2, !0;
|
|
211
|
+
const t = wt;
|
|
212
212
|
try {
|
|
213
|
-
|
|
213
|
+
$t(this), wt = 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 wt = t, Lt(this), this.f &= -2, !0;
|
|
220
|
+
}, jt.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
|
+
_t.prototype.S.call(this, t);
|
|
226
|
+
}, jt.prototype.U = function(t) {
|
|
227
|
+
if (void 0 !== this.t && (_t.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
|
+
}, jt.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(jt.prototype, "value", { get() {
|
|
237
237
|
if (1 & this.f) throw new Error("Cycle detected");
|
|
238
|
-
const t =
|
|
238
|
+
const t = kt(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
|
+
} }), Bt.prototype.c = function() {
|
|
242
242
|
const t = this.S();
|
|
243
243
|
try {
|
|
244
244
|
if (8 & this.f) return;
|
|
@@ -248,20 +248,20 @@ ut.prototype.brand = Q, ut.prototype.h = function() {
|
|
|
248
248
|
} finally {
|
|
249
249
|
t();
|
|
250
250
|
}
|
|
251
|
-
},
|
|
251
|
+
}, Bt.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, zt(this), $t(this), Rt++;
|
|
254
|
+
const t = wt;
|
|
255
|
+
return wt = this, Tt.bind(this, t);
|
|
256
|
+
}, Bt.prototype.N = function() {
|
|
257
|
+
2 & this.f || (this.f |= 2, this.u = Nt, Nt = this);
|
|
258
|
+
}, Bt.prototype.d = function() {
|
|
259
|
+
this.f |= 8, 1 & this.f || Ut(this);
|
|
260
|
+
}, Bt.prototype.dispose = function() {
|
|
261
261
|
this.d();
|
|
262
262
|
};
|
|
263
|
-
const
|
|
264
|
-
build: (t, e, n) =>
|
|
263
|
+
const Gt = defineExtension({
|
|
264
|
+
build: (t, e, n) => Wt(e),
|
|
265
265
|
config: safeCast({
|
|
266
266
|
defaultSelection: "rootEnd",
|
|
267
267
|
disabled: !1
|
|
@@ -269,7 +269,7 @@ const wt = defineExtension({
|
|
|
269
269
|
name: "@lexical/extension/AutoFocus",
|
|
270
270
|
register(t, e, n) {
|
|
271
271
|
const i = n.getOutput();
|
|
272
|
-
return
|
|
272
|
+
return Vt(() => i.disabled.value ? void 0 : t.registerRootListener((e) => {
|
|
273
273
|
t.focus(() => {
|
|
274
274
|
const t = document.activeElement;
|
|
275
275
|
null === e || null !== t && e.contains(t) || e.focus({ preventScroll: !0 });
|
|
@@ -277,25 +277,64 @@ const wt = defineExtension({
|
|
|
277
277
|
}));
|
|
278
278
|
}
|
|
279
279
|
});
|
|
280
|
-
function
|
|
280
|
+
function Zt() {
|
|
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 Jt(t, e = Zt) {
|
|
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 Ht = defineExtension({
|
|
288
|
+
build: (t, e, n) => Wt(e),
|
|
289
|
+
config: safeCast({ $onClear: Zt }),
|
|
290
290
|
name: "@lexical/extension/ClearEditor",
|
|
291
291
|
register(t, e, n) {
|
|
292
292
|
const { $onClear: i } = n.getOutput();
|
|
293
|
-
return
|
|
293
|
+
return Vt(() => Jt(t, i.value));
|
|
294
294
|
}
|
|
295
295
|
});
|
|
296
|
-
function
|
|
296
|
+
function Yt(t) {
|
|
297
|
+
return !!$isDecoratorNode(t) || !(!$isElementNode(t) || !t.isShadowRoot());
|
|
298
|
+
}
|
|
299
|
+
function qt(t, e, n, i) {
|
|
300
|
+
return !!t.isEditable() && n.target === e && t.getEditorState().read(() => {
|
|
301
|
+
const e = $getRoot().getLastChild();
|
|
302
|
+
if (null === e) return !1;
|
|
303
|
+
const s = t.getElementByKey(e.getKey());
|
|
304
|
+
return null !== s && !(n.clientY <= s.getBoundingClientRect().bottom) && i(e);
|
|
305
|
+
}, { editor: t });
|
|
306
|
+
}
|
|
307
|
+
const Qt = defineExtension({
|
|
308
|
+
build: (t, e) => Wt(e),
|
|
309
|
+
config: safeCast({
|
|
310
|
+
$shouldInsertAfter: Yt,
|
|
311
|
+
disabled: !1
|
|
312
|
+
}),
|
|
313
|
+
name: "@lexical/ClickAfterLastBlock",
|
|
314
|
+
register: (t, e, n) => Vt(() => {
|
|
315
|
+
const e = n.getOutput();
|
|
316
|
+
if (!e.disabled.value) return t.registerRootListener((n) => {
|
|
317
|
+
if (null === n) return;
|
|
318
|
+
const i = (i) => {
|
|
319
|
+
qt(t, n, i, e.$shouldInsertAfter.peek()) && i.preventDefault();
|
|
320
|
+
}, s = (i) => {
|
|
321
|
+
qt(t, n, i, e.$shouldInsertAfter.peek()) && (i.preventDefault(), stopLexicalPropagation(i), t.update(() => {
|
|
322
|
+
const t = $getRoot().getLastChild();
|
|
323
|
+
if (null === t) return;
|
|
324
|
+
if (!e.$shouldInsertAfter.peek()(t)) return;
|
|
325
|
+
const n = $createParagraphNode();
|
|
326
|
+
t.insertAfter(n), n.select();
|
|
327
|
+
}));
|
|
328
|
+
};
|
|
329
|
+
return n.addEventListener("mousedown", i, !0), n.addEventListener("click", s, !0), () => {
|
|
330
|
+
n.removeEventListener("mousedown", i, !0), n.removeEventListener("click", s, !0);
|
|
331
|
+
};
|
|
332
|
+
});
|
|
333
|
+
})
|
|
334
|
+
});
|
|
335
|
+
function Xt(t) {
|
|
297
336
|
const e = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set();
|
|
298
|
-
for (const i of
|
|
337
|
+
for (const i of te(t)) {
|
|
299
338
|
const t = "function" == typeof i ? i : i.replace;
|
|
300
339
|
getStaticNodeConfig(t), e.add(t.getType()), n.add(t);
|
|
301
340
|
}
|
|
@@ -304,22 +343,22 @@ function Ct(t) {
|
|
|
304
343
|
types: e
|
|
305
344
|
};
|
|
306
345
|
}
|
|
307
|
-
function
|
|
346
|
+
function te(t) {
|
|
308
347
|
return ("function" == typeof t.nodes ? t.nodes() : t.nodes) || [];
|
|
309
348
|
}
|
|
310
|
-
const
|
|
311
|
-
var
|
|
349
|
+
const ee = createState("format", { parse: (t) => "number" == typeof t ? t : 0 });
|
|
350
|
+
var ne = class extends DecoratorNode {
|
|
312
351
|
$config() {
|
|
313
352
|
return this.config("decorator-text", {
|
|
314
353
|
extends: DecoratorNode,
|
|
315
354
|
stateConfigs: [{
|
|
316
355
|
flat: !0,
|
|
317
|
-
stateConfig:
|
|
356
|
+
stateConfig: ee
|
|
318
357
|
}]
|
|
319
358
|
});
|
|
320
359
|
}
|
|
321
360
|
getFormat() {
|
|
322
|
-
return $getState(this,
|
|
361
|
+
return $getState(this, ee);
|
|
323
362
|
}
|
|
324
363
|
getFormatFlags(t, e) {
|
|
325
364
|
return toggleTextFormatType(this.getFormat(), t, e);
|
|
@@ -329,7 +368,7 @@ var Mt = class extends DecoratorNode {
|
|
|
329
368
|
return 0 !== (this.getFormat() & e);
|
|
330
369
|
}
|
|
331
370
|
setFormat(t) {
|
|
332
|
-
return $setState(this,
|
|
371
|
+
return $setState(this, ee, t);
|
|
333
372
|
}
|
|
334
373
|
toggleFormat(t) {
|
|
335
374
|
const n = toggleTextFormatType(this.getFormat(), t, null);
|
|
@@ -345,22 +384,22 @@ var Mt = class extends DecoratorNode {
|
|
|
345
384
|
return !1;
|
|
346
385
|
}
|
|
347
386
|
};
|
|
348
|
-
function
|
|
349
|
-
return t instanceof
|
|
387
|
+
function ie(t) {
|
|
388
|
+
return t instanceof ne;
|
|
350
389
|
}
|
|
351
|
-
function
|
|
390
|
+
function oe(t, e, n) {
|
|
352
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;
|
|
353
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;
|
|
354
393
|
}
|
|
355
|
-
function
|
|
356
|
-
for (const [i, o] of Object.entries(n)) t.hasFormat(o) && (e =
|
|
394
|
+
function se(t, e, n = ce) {
|
|
395
|
+
for (const [i, o] of Object.entries(n)) t.hasFormat(o) && (e = re(e, i));
|
|
357
396
|
return e;
|
|
358
397
|
}
|
|
359
|
-
function
|
|
398
|
+
function re(t, e) {
|
|
360
399
|
const n = document.createElement(e);
|
|
361
400
|
return n.appendChild(t), n;
|
|
362
401
|
}
|
|
363
|
-
const
|
|
402
|
+
const ce = {
|
|
364
403
|
b: "bold",
|
|
365
404
|
code: "code",
|
|
366
405
|
em: "italic",
|
|
@@ -371,18 +410,18 @@ const jt = {
|
|
|
371
410
|
sub: "subscript",
|
|
372
411
|
sup: "superscript",
|
|
373
412
|
u: "underline"
|
|
374
|
-
},
|
|
413
|
+
}, ae = defineExtension({
|
|
375
414
|
name: "@lexical/extension/DecoratorText",
|
|
376
|
-
nodes: () => [
|
|
415
|
+
nodes: () => [ne],
|
|
377
416
|
register: (t, e, n) => t.registerCommand(FORMAT_TEXT_COMMAND, (t) => {
|
|
378
417
|
const e = $getSelection();
|
|
379
|
-
if ($isNodeSelection(e) || $isRangeSelection(e)) for (const n of e.getNodes())
|
|
418
|
+
if ($isNodeSelection(e) || $isRangeSelection(e)) for (const n of e.getNodes()) ie(n) && n.toggleFormat(t);
|
|
380
419
|
return !1;
|
|
381
420
|
}, COMMAND_PRIORITY_LOW)
|
|
382
421
|
});
|
|
383
|
-
function
|
|
422
|
+
function de(t, e) {
|
|
384
423
|
let n;
|
|
385
|
-
return
|
|
424
|
+
return At(t(), {
|
|
386
425
|
unwatched() {
|
|
387
426
|
n && (n(), n = void 0);
|
|
388
427
|
},
|
|
@@ -391,40 +430,45 @@ function $t(t, e) {
|
|
|
391
430
|
}
|
|
392
431
|
});
|
|
393
432
|
}
|
|
394
|
-
const
|
|
395
|
-
build: (t) =>
|
|
433
|
+
const ue = defineExtension({
|
|
434
|
+
build: (t) => de(() => t.getEditorState(), (e) => t.registerUpdateListener((t) => {
|
|
396
435
|
e.value = t.editorState;
|
|
397
436
|
})),
|
|
398
437
|
name: "@lexical/extension/EditorState"
|
|
399
438
|
});
|
|
400
|
-
function
|
|
439
|
+
function le(t, ...e) {
|
|
401
440
|
const n = new URL("https://lexical.dev/docs/error"), i = new URLSearchParams();
|
|
402
441
|
i.append("code", t);
|
|
403
442
|
for (const t of e) i.append("v", t);
|
|
404
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.`);
|
|
405
444
|
}
|
|
406
|
-
|
|
445
|
+
let fe;
|
|
446
|
+
try {
|
|
447
|
+
fe = "0.45.0+prod.esm";
|
|
448
|
+
} catch (t) {}
|
|
449
|
+
const he = fe ?? "0.45.0+source";
|
|
450
|
+
function ge(t, e) {
|
|
407
451
|
if (t && e && !Array.isArray(e) && "object" == typeof t && "object" == typeof e) {
|
|
408
452
|
const n = t, i = e;
|
|
409
|
-
for (const t in i) n[t] =
|
|
453
|
+
for (const t in i) n[t] = ge(n[t], i[t]);
|
|
410
454
|
return t;
|
|
411
455
|
}
|
|
412
456
|
return e;
|
|
413
457
|
}
|
|
414
|
-
const
|
|
415
|
-
function
|
|
416
|
-
return t.id ===
|
|
458
|
+
const pe = 0, me = 1, ve = 2, Ee = 3, xe = 4, ye = 5, Se = 6, be = 7;
|
|
459
|
+
function we(t) {
|
|
460
|
+
return t.id === pe;
|
|
417
461
|
}
|
|
418
|
-
function
|
|
419
|
-
return t.id ===
|
|
462
|
+
function Ne(t) {
|
|
463
|
+
return t.id === ve;
|
|
420
464
|
}
|
|
421
|
-
function
|
|
465
|
+
function Oe(t) {
|
|
422
466
|
return function(t) {
|
|
423
|
-
return t.id ===
|
|
424
|
-
}(t) ||
|
|
467
|
+
return t.id === me;
|
|
468
|
+
}(t) || le(305, String(t.id), String(me)), Object.assign(t, { id: ve });
|
|
425
469
|
}
|
|
426
|
-
const
|
|
427
|
-
var
|
|
470
|
+
const Ce = /* @__PURE__ */ new Set();
|
|
471
|
+
var Re = class {
|
|
428
472
|
builder;
|
|
429
473
|
configs;
|
|
430
474
|
_dependency;
|
|
@@ -433,7 +477,7 @@ var Yt = class {
|
|
|
433
477
|
state;
|
|
434
478
|
_signal;
|
|
435
479
|
constructor(t, e) {
|
|
436
|
-
this.builder = t, this.extension = e, this.configs = /* @__PURE__ */ new Set(), this.state = { id:
|
|
480
|
+
this.builder = t, this.extension = e, this.configs = /* @__PURE__ */ new Set(), this.state = { id: pe };
|
|
437
481
|
}
|
|
438
482
|
mergeConfigs() {
|
|
439
483
|
let t = this.extension.config || {};
|
|
@@ -443,7 +487,7 @@ var Yt = class {
|
|
|
443
487
|
}
|
|
444
488
|
init(t) {
|
|
445
489
|
const e = this.state;
|
|
446
|
-
|
|
490
|
+
Ne(e) || le(306, String(e.id));
|
|
447
491
|
const n = {
|
|
448
492
|
getDependency: this.getInitDependency.bind(this),
|
|
449
493
|
getDirectDependentNames: this.getDirectDependentNames.bind(this),
|
|
@@ -457,14 +501,14 @@ var Yt = class {
|
|
|
457
501
|
}, o = function(t, e, n) {
|
|
458
502
|
return Object.assign(t, {
|
|
459
503
|
config: e,
|
|
460
|
-
id:
|
|
504
|
+
id: Ee,
|
|
461
505
|
registerState: n
|
|
462
506
|
});
|
|
463
507
|
}(e, this.mergeConfigs(), n);
|
|
464
508
|
let s;
|
|
465
509
|
this.state = o, this.extension.init && (s = this.extension.init(t, o.config, n)), this.state = function(t, e, n) {
|
|
466
510
|
return Object.assign(t, {
|
|
467
|
-
id:
|
|
511
|
+
id: xe,
|
|
468
512
|
initResult: e,
|
|
469
513
|
registerState: n
|
|
470
514
|
});
|
|
@@ -473,7 +517,7 @@ var Yt = class {
|
|
|
473
517
|
build(t) {
|
|
474
518
|
const e = this.state;
|
|
475
519
|
let n;
|
|
476
|
-
e.id !==
|
|
520
|
+
e.id !== xe && le(307, String(e.id), String(ye)), this.extension.build && (n = this.extension.build(t, e.config, e.registerState));
|
|
477
521
|
const i = {
|
|
478
522
|
...e.registerState,
|
|
479
523
|
getOutput: () => n,
|
|
@@ -481,7 +525,7 @@ var Yt = class {
|
|
|
481
525
|
};
|
|
482
526
|
this.state = function(t, e, n) {
|
|
483
527
|
return Object.assign(t, {
|
|
484
|
-
id:
|
|
528
|
+
id: ye,
|
|
485
529
|
output: e,
|
|
486
530
|
registerState: n
|
|
487
531
|
});
|
|
@@ -490,33 +534,33 @@ var Yt = class {
|
|
|
490
534
|
register(t, e) {
|
|
491
535
|
this._signal = e;
|
|
492
536
|
const n = this.state;
|
|
493
|
-
n.id !==
|
|
537
|
+
n.id !== ye && le(308, String(n.id), String(ye));
|
|
494
538
|
const i = this.extension.register && this.extension.register(t, n.config, n.registerState);
|
|
495
539
|
return this.state = function(t) {
|
|
496
|
-
return Object.assign(t, { id:
|
|
540
|
+
return Object.assign(t, { id: Se });
|
|
497
541
|
}(n), () => {
|
|
498
542
|
const t = this.state;
|
|
499
|
-
t.id !==
|
|
500
|
-
return Object.assign(t, { id:
|
|
543
|
+
t.id !== be && le(309, String(n.id), String(be)), this.state = function(t) {
|
|
544
|
+
return Object.assign(t, { id: ye });
|
|
501
545
|
}(t), i && i();
|
|
502
546
|
};
|
|
503
547
|
}
|
|
504
548
|
afterRegistration(t) {
|
|
505
549
|
const e = this.state;
|
|
506
550
|
let n;
|
|
507
|
-
return e.id !==
|
|
508
|
-
return Object.assign(t, { id:
|
|
551
|
+
return e.id !== Se && le(310, String(e.id), String(Se)), this.extension.afterRegistration && (n = this.extension.afterRegistration(t, e.config, e.registerState)), this.state = function(t) {
|
|
552
|
+
return Object.assign(t, { id: be });
|
|
509
553
|
}(e), n;
|
|
510
554
|
}
|
|
511
555
|
getSignal() {
|
|
512
|
-
return void 0 === this._signal &&
|
|
556
|
+
return void 0 === this._signal && le(311), this._signal;
|
|
513
557
|
}
|
|
514
558
|
getInitResult() {
|
|
515
|
-
void 0 === this.extension.init &&
|
|
559
|
+
void 0 === this.extension.init && le(312, this.extension.name);
|
|
516
560
|
const t = this.state;
|
|
517
561
|
return function(t) {
|
|
518
|
-
return t.id >=
|
|
519
|
-
}(t) ||
|
|
562
|
+
return t.id >= xe;
|
|
563
|
+
}(t) || le(313, String(t.id), String(xe)), t.initResult;
|
|
520
564
|
}
|
|
521
565
|
getInitPeer(t) {
|
|
522
566
|
const e = this.builder.extensionNameMap.get(t);
|
|
@@ -525,8 +569,8 @@ var Yt = class {
|
|
|
525
569
|
getExtensionInitDependency() {
|
|
526
570
|
const t = this.state;
|
|
527
571
|
return function(t) {
|
|
528
|
-
return t.id >=
|
|
529
|
-
}(t) ||
|
|
572
|
+
return t.id >= Ee;
|
|
573
|
+
}(t) || le(314, String(t.id), String(Ee)), { config: t.config };
|
|
530
574
|
}
|
|
531
575
|
getPeer(t) {
|
|
532
576
|
const e = this.builder.extensionNameMap.get(t);
|
|
@@ -534,20 +578,20 @@ var Yt = class {
|
|
|
534
578
|
}
|
|
535
579
|
getInitDependency(t) {
|
|
536
580
|
const e = this.builder.getExtensionRep(t);
|
|
537
|
-
return void 0 === e &&
|
|
581
|
+
return void 0 === e && le(315, this.extension.name, t.name), e.getExtensionInitDependency();
|
|
538
582
|
}
|
|
539
583
|
getDependency(t) {
|
|
540
584
|
const e = this.builder.getExtensionRep(t);
|
|
541
|
-
return void 0 === e &&
|
|
585
|
+
return void 0 === e && le(315, this.extension.name, t.name), e.getExtensionDependency();
|
|
542
586
|
}
|
|
543
587
|
getState() {
|
|
544
588
|
const t = this.state;
|
|
545
589
|
return function(t) {
|
|
546
|
-
return t.id >=
|
|
547
|
-
}(t) ||
|
|
590
|
+
return t.id >= be;
|
|
591
|
+
}(t) || le(316, String(t.id), String(be)), t;
|
|
548
592
|
}
|
|
549
593
|
getDirectDependentNames() {
|
|
550
|
-
return this.builder.incomingEdges.get(this.extension.name) ||
|
|
594
|
+
return this.builder.incomingEdges.get(this.extension.name) || Ce;
|
|
551
595
|
}
|
|
552
596
|
getPeerNameSet() {
|
|
553
597
|
let t = this._peerNameSet;
|
|
@@ -557,8 +601,8 @@ var Yt = class {
|
|
|
557
601
|
if (!this._dependency) {
|
|
558
602
|
const t = this.state;
|
|
559
603
|
(function(t) {
|
|
560
|
-
return t.id >=
|
|
561
|
-
})(t) ||
|
|
604
|
+
return t.id >= ye;
|
|
605
|
+
})(t) || le(317, this.extension.name), this._dependency = {
|
|
562
606
|
config: t.config,
|
|
563
607
|
init: t.initResult,
|
|
564
608
|
output: t.output
|
|
@@ -567,17 +611,17 @@ var Yt = class {
|
|
|
567
611
|
return this._dependency;
|
|
568
612
|
}
|
|
569
613
|
};
|
|
570
|
-
const
|
|
571
|
-
function
|
|
614
|
+
const De = { tag: HISTORY_MERGE_TAG };
|
|
615
|
+
function Fe() {
|
|
572
616
|
const t = $getRoot();
|
|
573
617
|
t.isEmpty() && t.append($createParagraphNode());
|
|
574
618
|
}
|
|
575
|
-
const
|
|
619
|
+
const Ie = defineExtension({
|
|
576
620
|
config: safeCast({
|
|
577
|
-
setOptions:
|
|
578
|
-
updateOptions:
|
|
621
|
+
setOptions: De,
|
|
622
|
+
updateOptions: De
|
|
579
623
|
}),
|
|
580
|
-
init: ({ $initialEditorState: t =
|
|
624
|
+
init: ({ $initialEditorState: t = Fe }) => ({
|
|
581
625
|
$initialEditorState: t,
|
|
582
626
|
initialized: !1
|
|
583
627
|
}),
|
|
@@ -605,19 +649,19 @@ const ne = defineExtension({
|
|
|
605
649
|
TabNode,
|
|
606
650
|
ParagraphNode
|
|
607
651
|
]
|
|
608
|
-
}),
|
|
609
|
-
function
|
|
610
|
-
return
|
|
652
|
+
}), Me = Symbol.for("@lexical/extension/LexicalBuilder");
|
|
653
|
+
function ke(...t) {
|
|
654
|
+
return Le.fromExtensions(t).buildEditor();
|
|
611
655
|
}
|
|
612
|
-
function
|
|
613
|
-
function
|
|
656
|
+
function _e() {}
|
|
657
|
+
function Ae(t) {
|
|
614
658
|
throw t;
|
|
615
659
|
}
|
|
616
|
-
function
|
|
660
|
+
function Pe(t) {
|
|
617
661
|
return Array.isArray(t) ? t : [t];
|
|
618
662
|
}
|
|
619
|
-
const
|
|
620
|
-
var
|
|
663
|
+
const $e = he;
|
|
664
|
+
var Le = class Le {
|
|
621
665
|
roots;
|
|
622
666
|
extensionNameMap;
|
|
623
667
|
outgoingConfigEdges;
|
|
@@ -626,21 +670,21 @@ var de = class de {
|
|
|
626
670
|
_sortedExtensionReps;
|
|
627
671
|
PACKAGE_VERSION;
|
|
628
672
|
constructor(t) {
|
|
629
|
-
this.outgoingConfigEdges = /* @__PURE__ */ new Map(), this.incomingEdges = /* @__PURE__ */ new Map(), this.extensionNameMap = /* @__PURE__ */ new Map(), this.conflicts = /* @__PURE__ */ new Map(), this.PACKAGE_VERSION =
|
|
673
|
+
this.outgoingConfigEdges = /* @__PURE__ */ new Map(), this.incomingEdges = /* @__PURE__ */ new Map(), this.extensionNameMap = /* @__PURE__ */ new Map(), this.conflicts = /* @__PURE__ */ new Map(), this.PACKAGE_VERSION = $e, this.roots = t;
|
|
630
674
|
for (const e of t) this.addExtension(e);
|
|
631
675
|
}
|
|
632
676
|
static fromExtensions(t) {
|
|
633
|
-
const e = [
|
|
634
|
-
for (const n of t) e.push(
|
|
635
|
-
return new
|
|
677
|
+
const e = [Pe(Ie)];
|
|
678
|
+
for (const n of t) e.push(Pe(n));
|
|
679
|
+
return new Le(e);
|
|
636
680
|
}
|
|
637
681
|
static maybeFromEditor(t) {
|
|
638
|
-
const e = t[
|
|
639
|
-
return e && (e.PACKAGE_VERSION !==
|
|
682
|
+
const e = t[Me];
|
|
683
|
+
return e && (e.PACKAGE_VERSION !== $e && le(292, e.PACKAGE_VERSION, $e), e instanceof Le || le(293)), e;
|
|
640
684
|
}
|
|
641
685
|
static fromEditor(t) {
|
|
642
|
-
const e =
|
|
643
|
-
return void 0 === e &&
|
|
686
|
+
const e = Le.maybeFromEditor(t);
|
|
687
|
+
return void 0 === e && le(294), e;
|
|
644
688
|
}
|
|
645
689
|
constructEditor() {
|
|
646
690
|
const { $initialEditorState: t, onError: e, ...n } = this.buildCreateEditorArgs(), i = Object.assign(createEditor({
|
|
@@ -648,17 +692,17 @@ var de = class de {
|
|
|
648
692
|
...e ? { onError: (t) => {
|
|
649
693
|
e(t, i);
|
|
650
694
|
} } : {}
|
|
651
|
-
}), { [
|
|
695
|
+
}), { [Me]: this });
|
|
652
696
|
for (const t of this.sortedExtensionReps()) t.build(i);
|
|
653
697
|
return i;
|
|
654
698
|
}
|
|
655
699
|
buildEditor() {
|
|
656
|
-
let t =
|
|
700
|
+
let t = _e;
|
|
657
701
|
function e() {
|
|
658
702
|
try {
|
|
659
703
|
t();
|
|
660
704
|
} finally {
|
|
661
|
-
t =
|
|
705
|
+
t = _e;
|
|
662
706
|
}
|
|
663
707
|
}
|
|
664
708
|
const n = Object.assign(this.constructEditor(), {
|
|
@@ -672,7 +716,7 @@ var de = class de {
|
|
|
672
716
|
}
|
|
673
717
|
getExtensionRep(t) {
|
|
674
718
|
const e = this.extensionNameMap.get(t.name);
|
|
675
|
-
if (e) return e.extension !== t &&
|
|
719
|
+
if (e) return e.extension !== t && le(295, t.name), e;
|
|
676
720
|
}
|
|
677
721
|
addEdge(t, e, n) {
|
|
678
722
|
const i = this.outgoingConfigEdges.get(t);
|
|
@@ -681,17 +725,17 @@ var de = class de {
|
|
|
681
725
|
o ? o.add(t) : this.incomingEdges.set(e, new Set([t]));
|
|
682
726
|
}
|
|
683
727
|
addExtension(t) {
|
|
684
|
-
void 0 !== this._sortedExtensionReps &&
|
|
685
|
-
const [n] =
|
|
686
|
-
"string" != typeof n.name &&
|
|
728
|
+
void 0 !== this._sortedExtensionReps && le(296);
|
|
729
|
+
const [n] = Pe(t);
|
|
730
|
+
"string" != typeof n.name && le(297, typeof n.name);
|
|
687
731
|
let i = this.extensionNameMap.get(n.name);
|
|
688
|
-
if (void 0 !== i && i.extension !== n &&
|
|
689
|
-
i = new
|
|
732
|
+
if (void 0 !== i && i.extension !== n && le(298, n.name), !i) {
|
|
733
|
+
i = new Re(this, n), this.extensionNameMap.set(n.name, i);
|
|
690
734
|
const t = this.conflicts.get(n.name);
|
|
691
|
-
"string" == typeof t &&
|
|
692
|
-
for (const t of n.conflictsWith || []) this.extensionNameMap.has(t) &&
|
|
735
|
+
"string" == typeof t && le(299, n.name, t);
|
|
736
|
+
for (const t of n.conflictsWith || []) this.extensionNameMap.has(t) && le(299, n.name, t), this.conflicts.set(t, n.name);
|
|
693
737
|
for (const t of n.dependencies || []) {
|
|
694
|
-
const e =
|
|
738
|
+
const e = Pe(t);
|
|
695
739
|
this.addEdge(n.name, e[0].name, e.slice(1)), this.addExtension(e);
|
|
696
740
|
}
|
|
697
741
|
for (const [t, e] of n.peerDependencies || []) this.addEdge(n.name, t, e ? [e] : []);
|
|
@@ -701,25 +745,25 @@ var de = class de {
|
|
|
701
745
|
if (this._sortedExtensionReps) return this._sortedExtensionReps;
|
|
702
746
|
const t = [], e = (n, i) => {
|
|
703
747
|
let o = n.state;
|
|
704
|
-
if (
|
|
748
|
+
if (Ne(o)) return;
|
|
705
749
|
const s = n.extension.name;
|
|
706
750
|
var r;
|
|
707
|
-
|
|
751
|
+
we(o) || le(300, s, i || "[unknown]"), we(r = o) || le(304, String(r.id), String(pe)), o = Object.assign(r, { id: me }), n.state = o;
|
|
708
752
|
const c = this.outgoingConfigEdges.get(s);
|
|
709
753
|
if (c) for (const t of c.keys()) {
|
|
710
754
|
const n = this.extensionNameMap.get(t);
|
|
711
755
|
n && e(n, s);
|
|
712
756
|
}
|
|
713
|
-
o =
|
|
757
|
+
o = Oe(o), n.state = o, t.push(n);
|
|
714
758
|
};
|
|
715
|
-
for (const t of this.extensionNameMap.values())
|
|
759
|
+
for (const t of this.extensionNameMap.values()) we(t.state) && e(t);
|
|
716
760
|
for (const e of t) for (const [t, n] of this.outgoingConfigEdges.get(e.extension.name) || []) if (n.length > 0) {
|
|
717
761
|
const e = this.extensionNameMap.get(t);
|
|
718
762
|
if (e) for (const t of n) e.configs.add(t);
|
|
719
763
|
}
|
|
720
764
|
for (const [t, ...e] of this.roots) if (e.length > 0) {
|
|
721
765
|
const n = this.extensionNameMap.get(t.name);
|
|
722
|
-
void 0 === n &&
|
|
766
|
+
void 0 === n && le(301, t.name);
|
|
723
767
|
for (const t of e) n.configs.add(t);
|
|
724
768
|
}
|
|
725
769
|
return this._sortedExtensionReps = t, this._sortedExtensionReps;
|
|
@@ -740,10 +784,10 @@ var de = class de {
|
|
|
740
784
|
const t = {}, e = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), o = {}, s = {}, r = this.sortedExtensionReps();
|
|
741
785
|
for (const c of r) {
|
|
742
786
|
const { extension: r } = c;
|
|
743
|
-
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
|
|
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 te(r)) {
|
|
744
788
|
if ("function" != typeof t) {
|
|
745
789
|
const e = n.get(t.replace);
|
|
746
|
-
e &&
|
|
790
|
+
e && le(302, r.name, t.replace.name, e.extension.name), n.set(t.replace, c);
|
|
747
791
|
}
|
|
748
792
|
e.add(t);
|
|
749
793
|
}
|
|
@@ -751,32 +795,41 @@ var de = class de {
|
|
|
751
795
|
if (r.html.export) for (const [t, e] of r.html.export.entries()) i.set(t, e);
|
|
752
796
|
r.html.import && Object.assign(o, r.html.import);
|
|
753
797
|
}
|
|
754
|
-
r.theme &&
|
|
798
|
+
r.theme && ge(s, r.theme);
|
|
755
799
|
}
|
|
756
800
|
Object.keys(s).length > 0 && (t.theme = s), e.size && (t.nodes = [...e]);
|
|
757
801
|
const c = Object.keys(o).length > 0, a = i.size > 0;
|
|
758
802
|
(c || a) && (t.html = {}, c && (t.html.import = o), a && (t.html.export = i));
|
|
759
803
|
for (const e of r) e.init(t);
|
|
760
|
-
return t.onError || (t.onError =
|
|
804
|
+
return t.onError || (t.onError = Ae), t;
|
|
761
805
|
}
|
|
762
806
|
};
|
|
763
|
-
function
|
|
764
|
-
const n =
|
|
765
|
-
return void 0 === n &&
|
|
807
|
+
function je(t, e) {
|
|
808
|
+
const n = Le.fromEditor(t).getExtensionRep(e);
|
|
809
|
+
return void 0 === n && le(303, e.name), n.getExtensionDependency();
|
|
766
810
|
}
|
|
767
|
-
function
|
|
768
|
-
const n =
|
|
811
|
+
function Ke(t, e) {
|
|
812
|
+
const n = Le.maybeFromEditor(t);
|
|
769
813
|
if (!n) return;
|
|
770
814
|
const i = n.extensionNameMap.get(e);
|
|
771
815
|
return i ? i.getExtensionDependency() : void 0;
|
|
772
816
|
}
|
|
773
|
-
function
|
|
774
|
-
const n =
|
|
775
|
-
return void 0 === n &&
|
|
817
|
+
function ze(t, e) {
|
|
818
|
+
const n = Ke(t, e);
|
|
819
|
+
return void 0 === n && le(291, e), n;
|
|
776
820
|
}
|
|
777
|
-
|
|
821
|
+
function Ue(t) {
|
|
822
|
+
return je($getEditor(), t);
|
|
823
|
+
}
|
|
824
|
+
function Te(t) {
|
|
825
|
+
return Ue(t).output;
|
|
826
|
+
}
|
|
827
|
+
function Be(t) {
|
|
828
|
+
return Ke($getEditor(), t);
|
|
829
|
+
}
|
|
830
|
+
const Ve = /* @__PURE__ */ new Set(), We = defineExtension({
|
|
778
831
|
build(t, e, n) {
|
|
779
|
-
const i = n.getDependency(
|
|
832
|
+
const i = n.getDependency(ue).output, o = At({ watchedNodeKeys: /* @__PURE__ */ new Map() }), r = de(() => {}, () => Vt(() => {
|
|
780
833
|
const t = r.peek(), { watchedNodeKeys: e } = o.value;
|
|
781
834
|
let n, c = !1;
|
|
782
835
|
i.value.read(() => {
|
|
@@ -791,28 +844,28 @@ const he = /* @__PURE__ */ new Set(), ge = defineExtension({
|
|
|
791
844
|
}), !c && n && t && n.size === t.size || (r.value = n);
|
|
792
845
|
}));
|
|
793
846
|
return { watchNodeKey: function(t) {
|
|
794
|
-
const e =
|
|
847
|
+
const e = Kt(() => (r.value || Ve).has(t)), { watchedNodeKeys: n } = o.peek();
|
|
795
848
|
let i = n.get(t);
|
|
796
849
|
const s = void 0 !== i;
|
|
797
850
|
return i = i || /* @__PURE__ */ new Set(), i.add(e), s || (n.set(t, i), o.value = { watchedNodeKeys: n }), e;
|
|
798
851
|
} };
|
|
799
852
|
},
|
|
800
|
-
dependencies: [
|
|
853
|
+
dependencies: [ue],
|
|
801
854
|
name: "@lexical/extension/NodeSelection"
|
|
802
|
-
}),
|
|
803
|
-
var
|
|
855
|
+
}), Ge = createCommand("INSERT_HORIZONTAL_RULE_COMMAND");
|
|
856
|
+
var Ze = class Ze extends DecoratorNode {
|
|
804
857
|
static getType() {
|
|
805
858
|
return "horizontalrule";
|
|
806
859
|
}
|
|
807
860
|
static clone(t) {
|
|
808
|
-
return new
|
|
861
|
+
return new Ze(t.__key);
|
|
809
862
|
}
|
|
810
863
|
static importJSON(t) {
|
|
811
|
-
return
|
|
864
|
+
return He().updateFromJSON(t);
|
|
812
865
|
}
|
|
813
866
|
static importDOM() {
|
|
814
867
|
return { hr: () => ({
|
|
815
|
-
conversion:
|
|
868
|
+
conversion: Je,
|
|
816
869
|
priority: 0
|
|
817
870
|
}) };
|
|
818
871
|
}
|
|
@@ -833,53 +886,53 @@ var me = class me extends DecoratorNode {
|
|
|
833
886
|
return !1;
|
|
834
887
|
}
|
|
835
888
|
};
|
|
836
|
-
function
|
|
837
|
-
return { node:
|
|
889
|
+
function Je() {
|
|
890
|
+
return { node: He() };
|
|
838
891
|
}
|
|
839
|
-
function
|
|
840
|
-
return $create(
|
|
892
|
+
function He() {
|
|
893
|
+
return $create(Ze);
|
|
841
894
|
}
|
|
842
|
-
function
|
|
843
|
-
return t instanceof
|
|
895
|
+
function Ye(t) {
|
|
896
|
+
return t instanceof Ze;
|
|
844
897
|
}
|
|
845
|
-
const
|
|
846
|
-
dependencies: [
|
|
898
|
+
const qe = defineExtension({
|
|
899
|
+
dependencies: [ue, We],
|
|
847
900
|
name: "@lexical/extension/HorizontalRule",
|
|
848
|
-
nodes: () => [
|
|
901
|
+
nodes: () => [Ze],
|
|
849
902
|
register(t, e, n) {
|
|
850
|
-
const { watchNodeKey: o } = n.getDependency(
|
|
851
|
-
return mergeRegister(t.registerCommand(
|
|
903
|
+
const { watchNodeKey: o } = n.getDependency(We).output, r = At({ nodeSelections: /* @__PURE__ */ new Map() }), a = t._config.theme.hrSelected ?? "selected";
|
|
904
|
+
return mergeRegister(t.registerCommand(Ge, (t) => {
|
|
852
905
|
const e = $getSelection();
|
|
853
906
|
if (!$isRangeSelection(e)) return !1;
|
|
854
|
-
if (null !== e.focus.getNode()) $insertNodeToNearestRoot(
|
|
907
|
+
if (null !== e.focus.getNode()) $insertNodeToNearestRoot(He());
|
|
855
908
|
return !0;
|
|
856
909
|
}, COMMAND_PRIORITY_EDITOR), t.registerCommand(CLICK_COMMAND, (t) => {
|
|
857
910
|
if (isDOMNode(t.target)) {
|
|
858
911
|
const e = $getNodeFromDOMNode(t.target);
|
|
859
|
-
if (
|
|
912
|
+
if (Ye(e)) return function(t, e = !1) {
|
|
860
913
|
const n = $getSelection(), i = t.isSelected(), o = t.getKey();
|
|
861
914
|
let r;
|
|
862
915
|
e && $isNodeSelection(n) ? r = n : (r = $createNodeSelection(), $setSelection(r)), i ? r.delete(o) : r.add(o);
|
|
863
916
|
}(e, t.shiftKey), !0;
|
|
864
917
|
}
|
|
865
918
|
return !1;
|
|
866
|
-
}, COMMAND_PRIORITY_LOW), t.registerMutationListener(
|
|
867
|
-
|
|
919
|
+
}, COMMAND_PRIORITY_LOW), t.registerMutationListener(Ze, (e, n) => {
|
|
920
|
+
bt(() => {
|
|
868
921
|
let n = !1;
|
|
869
922
|
const { nodeSelections: i } = r.peek();
|
|
870
923
|
for (const [s, r] of e.entries()) if ("destroyed" === r) i.delete(s), n = !0;
|
|
871
924
|
else {
|
|
872
925
|
const e = i.get(s), r = t.getElementByKey(s);
|
|
873
926
|
e ? e.domNode.value = r : (n = !0, i.set(s, {
|
|
874
|
-
domNode:
|
|
927
|
+
domNode: At(r),
|
|
875
928
|
selectedSignal: o(s)
|
|
876
929
|
}));
|
|
877
930
|
}
|
|
878
931
|
n && (r.value = { nodeSelections: i });
|
|
879
932
|
});
|
|
880
|
-
}),
|
|
933
|
+
}), Vt(() => {
|
|
881
934
|
const t = [];
|
|
882
|
-
for (const { domNode: e, selectedSignal: n } of r.value.nodeSelections.values()) t.push(
|
|
935
|
+
for (const { domNode: e, selectedSignal: n } of r.value.nodeSelections.values()) t.push(Vt(() => {
|
|
883
936
|
const t = e.value;
|
|
884
937
|
if (t) n.value ? addClassNamesToElement(t, a) : removeClassNamesFromElement(t, a);
|
|
885
938
|
}));
|
|
@@ -887,12 +940,12 @@ const Ee = defineExtension({
|
|
|
887
940
|
}));
|
|
888
941
|
}
|
|
889
942
|
});
|
|
890
|
-
const
|
|
891
|
-
build: (t, e) =>
|
|
943
|
+
const Qe = defineExtension({
|
|
944
|
+
build: (t, e) => Wt({ inheritEditableFromParent: e.inheritEditableFromParent }),
|
|
892
945
|
config: safeCast({
|
|
893
946
|
$getParentEditor: function() {
|
|
894
947
|
const t = $getEditor();
|
|
895
|
-
return
|
|
948
|
+
return Le.fromEditor(t), t;
|
|
896
949
|
},
|
|
897
950
|
inheritEditableFromParent: !1
|
|
898
951
|
}),
|
|
@@ -901,12 +954,69 @@ const Se = defineExtension({
|
|
|
901
954
|
t.parentEditor = i, t.theme = t.theme || i._config.theme;
|
|
902
955
|
},
|
|
903
956
|
name: "@lexical/extension/NestedEditor",
|
|
904
|
-
register: (t, e, n) =>
|
|
957
|
+
register: (t, e, n) => Vt(() => {
|
|
905
958
|
const e = t._parentEditor;
|
|
906
959
|
if (e && n.getOutput().inheritEditableFromParent.value) return t.setEditable(e.isEditable()), e.registerEditableListener(t.setEditable.bind(t));
|
|
907
960
|
})
|
|
908
|
-
})
|
|
909
|
-
|
|
961
|
+
});
|
|
962
|
+
function Xe(t) {
|
|
963
|
+
$isElementNode(t) && t.isInline() && t.isEmpty() && t.remove();
|
|
964
|
+
}
|
|
965
|
+
const tn = defineExtension({
|
|
966
|
+
build: (t, e, n) => Wt(e),
|
|
967
|
+
config: safeCast({ disabled: !1 }),
|
|
968
|
+
name: "@lexical/NormalizeInlineElements",
|
|
969
|
+
register: (t, e, n) => {
|
|
970
|
+
const i = n.getOutput();
|
|
971
|
+
return Vt(() => {
|
|
972
|
+
if (!i.disabled.value) {
|
|
973
|
+
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(Xe), e.push(() => i.delete(Xe)));
|
|
975
|
+
return () => e.forEach((t) => t());
|
|
976
|
+
}
|
|
977
|
+
});
|
|
978
|
+
}
|
|
979
|
+
}), en = new Set([SKIP_SELECTION_FOCUS_TAG, SKIP_SCROLL_INTO_VIEW_TAG]);
|
|
980
|
+
const nn = defineExtension({
|
|
981
|
+
build: (t, e, n) => Wt(e),
|
|
982
|
+
config: safeCast({
|
|
983
|
+
$fixFocusOverselection: function() {
|
|
984
|
+
const t = $getSelection();
|
|
985
|
+
if ($isRangeSelection(t) && !t.isCollapsed()) {
|
|
986
|
+
const e = $getCaretRangeInDirection($caretRangeFromSelection(t), "next");
|
|
987
|
+
let n = e.focus;
|
|
988
|
+
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
|
+
if ($isSiblingCaret(n) && $isElementNode(n.origin) && (n = $normalizeCaret($getChildCaret(n.origin, "previous")).getFlipped()), n = $normalizeCaret(n), !n.isSamePointCaret(e.focus)) {
|
|
990
|
+
const t = $setSelectionFromCaretRange($getCaretRange(e.anchor, n)), i = $getEditor().getRootElement(), o = i && getDOMSelection(i.ownerDocument.defaultView);
|
|
991
|
+
o && $updateDOMSelection($getPreviousSelection(), t, $getEditor(), o, en, i);
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
},
|
|
995
|
+
dateNow: Date.now,
|
|
996
|
+
disabled: !1,
|
|
997
|
+
thresholdMsec: 100
|
|
998
|
+
}),
|
|
999
|
+
name: "@lexical/NormalizeTripleClickSelection",
|
|
1000
|
+
register: (t, e, n) => Vt(() => {
|
|
1001
|
+
const e = n.getOutput();
|
|
1002
|
+
if (!e.disabled.value) return t.registerRootListener((n) => {
|
|
1003
|
+
if (!n) return;
|
|
1004
|
+
let i = 0;
|
|
1005
|
+
const o = (t) => {
|
|
1006
|
+
if (t ? 3 === t.detail : i > 0) {
|
|
1007
|
+
const n = e.dateNow.peek()();
|
|
1008
|
+
i = t && "mousedown" === t.type || n - i <= e.thresholdMsec.peek() ? n : 0;
|
|
1009
|
+
}
|
|
1010
|
+
return i;
|
|
1011
|
+
};
|
|
1012
|
+
return mergeRegister(t.registerCommand(SELECTION_CHANGE_COMMAND, () => (o(null) && (i = 0, e.$fixFocusOverselection.peek()()), !1), COMMAND_PRIORITY_BEFORE_CRITICAL), (() => {
|
|
1013
|
+
const t = ["mouseup", "mousedown"];
|
|
1014
|
+
return t.forEach((t) => n.addEventListener(t, o, !0)), () => t.forEach((t) => n.removeEventListener(t, o, !0));
|
|
1015
|
+
})());
|
|
1016
|
+
});
|
|
1017
|
+
})
|
|
1018
|
+
}), on = defineExtension({
|
|
1019
|
+
build: (t, e, n) => Wt(e),
|
|
910
1020
|
config: safeCast({
|
|
911
1021
|
disabled: !1,
|
|
912
1022
|
onReposition: void 0
|
|
@@ -914,15 +1024,15 @@ const Se = defineExtension({
|
|
|
914
1024
|
name: "@lexical/utils/SelectionAlwaysOnDisplay",
|
|
915
1025
|
register: (t, e, n) => {
|
|
916
1026
|
const i = n.getOutput();
|
|
917
|
-
return
|
|
1027
|
+
return Vt(() => {
|
|
918
1028
|
if (!i.disabled.value) return selectionAlwaysOnDisplay(t, i.onReposition.value);
|
|
919
1029
|
});
|
|
920
1030
|
}
|
|
921
1031
|
});
|
|
922
|
-
function
|
|
923
|
-
return t.
|
|
1032
|
+
function sn(t) {
|
|
1033
|
+
return t.canIndent();
|
|
924
1034
|
}
|
|
925
|
-
function
|
|
1035
|
+
function rn(t, e, n = sn) {
|
|
926
1036
|
return mergeRegister(t.registerCommand(KEY_TAB_COMMAND, (e) => {
|
|
927
1037
|
const n = $getSelection();
|
|
928
1038
|
if (!$isRangeSelection(n)) return !1;
|
|
@@ -950,20 +1060,20 @@ function Ne(t, e, n = we) {
|
|
|
950
1060
|
});
|
|
951
1061
|
}, COMMAND_PRIORITY_CRITICAL));
|
|
952
1062
|
}
|
|
953
|
-
const
|
|
954
|
-
build: (t, e, n) =>
|
|
1063
|
+
const cn = defineExtension({
|
|
1064
|
+
build: (t, e, n) => Wt(e),
|
|
955
1065
|
config: safeCast({
|
|
956
|
-
$canIndent:
|
|
1066
|
+
$canIndent: sn,
|
|
957
1067
|
disabled: !1,
|
|
958
1068
|
maxIndent: null
|
|
959
1069
|
}),
|
|
960
1070
|
name: "@lexical/extension/TabIndentation",
|
|
961
1071
|
register(t, e, n) {
|
|
962
1072
|
const { disabled: i, maxIndent: o, $canIndent: s } = n.getOutput();
|
|
963
|
-
return
|
|
964
|
-
if (!i.value) return
|
|
1073
|
+
return Vt(() => {
|
|
1074
|
+
if (!i.value) return rn(t, o, s);
|
|
965
1075
|
});
|
|
966
1076
|
}
|
|
967
1077
|
});
|
|
968
1078
|
//#endregion
|
|
969
|
-
export {
|
|
1079
|
+
export { He as $createHorizontalRuleNode, Yt as $defaultShouldInsertAfter, Ue as $getExtensionDependency, Te as $getExtensionOutput, Be as $getPeerDependency, ie as $isDecoratorTextNode, Ye as $isHorizontalRuleNode, Gt as AutoFocusExtension, Ht as ClearEditorExtension, Qt as ClickAfterLastBlockExtension, ae as DecoratorTextExtension, ne as DecoratorTextNode, ue as EditorStateExtension, qe as HorizontalRuleExtension, Ze as HorizontalRuleNode, Ge as INSERT_HORIZONTAL_RULE_COMMAND, Ie as InitialStateExtension, Le as LexicalBuilder, Qe as NestedEditorExtension, We as NodeSelectionExtension, tn as NormalizeInlineElementsExtension, nn as NormalizeTripleClickSelectionExtension, on as SelectionAlwaysOnDisplayExtension, cn as TabIndentationExtension, oe as applyFormatFromStyle, se as applyFormatToDom, bt as batch, ke as buildEditorFromExtensions, Kt as computed, configExtension, declarePeerDependency, defineExtension, Vt as effect, je as getExtensionDependencyFromEditor, Xt as getKnownTypesAndNodes, Ke as getPeerDependencyFromEditor, ze as getPeerDependencyFromEditorOrThrow, Wt as namedSignals, Jt as registerClearEditor, rn as registerTabIndentation, safeCast, shallowMergeConfig, At as signal, Ot as untracked, de as watchedSignal };
|