@mx-space/cli 0.14.0 → 0.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Lexical.dev-DTxuYHmG.mjs → Lexical.dev-CtGmYDoh.mjs} +770 -271
- package/dist/{Lexical.node-BlCLnfA6.mjs → Lexical.node-8sRFmq2X.mjs} +15 -5
- package/dist/Lexical.prod-D-VfeKDz.mjs +7200 -0
- package/dist/{LexicalClipboard.dev-CdFkLR_D.mjs → LexicalClipboard.dev-CzQ15z6E.mjs} +6 -6
- package/dist/{LexicalClipboard.node-ktUajxsv.mjs → LexicalClipboard.node-D4gMGws6.mjs} +2 -2
- package/dist/{LexicalClipboard.prod-DliyLofW.mjs → LexicalClipboard.prod-CltkQpzS.mjs} +10 -8
- package/dist/{LexicalCodeCore.dev-CL9tHWJX.mjs → LexicalCodeCore.dev-DkYBZRGB.mjs} +11 -9
- package/dist/{LexicalCodeCore.prod-BoMSJc29.mjs → LexicalCodeCore.prod-COc3_QL8.mjs} +178 -167
- package/dist/{LexicalDragon.dev-CqW7Aq5H.mjs → LexicalDragon.dev-Dv5_WUae.mjs} +3 -3
- package/dist/{LexicalDragon.node-DLXctJyy.mjs → LexicalDragon.node-DgjrmWkd.mjs} +2 -2
- package/dist/{LexicalDragon.prod-DHI3T6n5.mjs → LexicalDragon.prod-DnpbDe-_.mjs} +5 -4
- package/dist/{LexicalExtension.dev-BP-18zns.mjs → LexicalExtension.dev-JMH_6-OZ.mjs} +73 -52
- package/dist/{LexicalExtension.node-BWH6xbzG.mjs → LexicalExtension.node-BUozzx4t.mjs} +4 -2
- package/dist/{LexicalExtension.prod-Cs6OgrDn.mjs → LexicalExtension.prod-UiyDgmou.mjs} +370 -347
- package/dist/{LexicalHeadless.dev-DJp__UcP.mjs → LexicalHeadless.dev-BfLGciiX.mjs} +2 -2
- package/dist/{LexicalHeadless.prod-o0v9cIu5.mjs → LexicalHeadless.prod-CWF7edmQ.mjs} +2 -2
- package/dist/{LexicalHtml.dev-DoymwFpG.mjs → LexicalHtml.dev-D5EF5PGW.mjs} +13 -11
- package/dist/{LexicalHtml.node-CVkbWtUA.mjs → LexicalHtml.node-BYbzHNVe.mjs} +4 -4
- package/dist/{LexicalHtml.prod-C2b3z99k.mjs → LexicalHtml.prod-D_FfkvVD.mjs} +330 -299
- package/dist/{LexicalLink.dev-7cgLOLIe.mjs → LexicalLink.dev-D3Pgh6ik.mjs} +53 -23
- package/dist/{LexicalLink.prod-DWFgoXHR.mjs → LexicalLink.prod-XZoAYVYD.mjs} +217 -198
- package/dist/{LexicalList.dev-Ci2iOxFx.mjs → LexicalList.dev-B5d3ObhB.mjs} +49 -44
- package/dist/LexicalList.prod-OQDpVAEb.mjs +967 -0
- package/dist/{LexicalMarkdown.dev-C0ZYCyuR.mjs → LexicalMarkdown.dev-BkM8G3DG.mjs} +61 -42
- package/dist/{LexicalMarkdown.prod-0M-Nc-rh.mjs → LexicalMarkdown.prod-DcVXCex6.mjs} +254 -202
- package/dist/{LexicalRichText.dev-Cnr1kDym.mjs → LexicalRichText.dev-DppD7IrA.mjs} +337 -52
- package/dist/{LexicalRichText.node-BUJZAiap.mjs → LexicalRichText.node-CPSn7dkg.mjs} +12 -8
- package/dist/LexicalRichText.prod-h7JPxFNp.mjs +718 -0
- package/dist/{LexicalSelection.dev-C4L7l8OB.mjs → LexicalSelection.dev-CD0SLbxP.mjs} +48 -17
- package/dist/{LexicalSelection.node-CLKroUMQ.mjs → LexicalSelection.node-CGlJgUlZ.mjs} +5 -4
- package/dist/{LexicalSelection.prod-DzFqpTlw.mjs → LexicalSelection.prod-DbVZN5AV.mjs} +101 -92
- package/dist/{LexicalTable.dev-Cc9-zqKa.mjs → LexicalTable.dev-D0HU14UV.mjs} +340 -138
- package/dist/LexicalTable.prod-BcPNSrxP.mjs +2468 -0
- package/dist/{LexicalUtils.dev-BRgK0L6G.mjs → LexicalUtils.dev-iKy_TrRT.mjs} +15 -19
- package/dist/{LexicalUtils.node-BVAwOkL4.mjs → LexicalUtils.node-CIgMS8cG.mjs} +6 -6
- package/dist/{LexicalUtils.prod-C1gtvVDP.mjs → LexicalUtils.prod-DIAsKJzu.mjs} +155 -159
- package/dist/bin/mxs.mjs +1 -1
- package/dist/esm-CH7CrOvh.mjs +2 -0
- package/dist/{esm-BNu4sUWV.mjs → esm-CwXl1N0a.mjs} +1801 -6013
- package/dist/index.d.mts +57 -62
- package/dist/index.mjs +1 -1
- package/dist/{mxs-BUqt-N3N.mjs → mxs-iW9DgqSZ.mjs} +14960 -9235
- package/dist/rolldown-runtime-JspESFgx.mjs +35 -0
- package/dist/vendor/litexml/cli.mjs +6693 -5762
- package/dist/vendor/litexml/litexml-html-preview-client.js +11912 -8698
- package/package.json +31 -30
- package/LICENSE +0 -33
- 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,8 +1,8 @@
|
|
|
1
|
-
import { f as namedSignals, l as effect } from "./LexicalExtension.node-
|
|
2
|
-
import { $ as
|
|
3
|
-
import { c as
|
|
4
|
-
import {
|
|
5
|
-
//#region ../../node_modules/.pnpm/@lexical+link@0.
|
|
1
|
+
import { f as namedSignals, l as effect } from "./LexicalExtension.node-BUozzx4t.mjs";
|
|
2
|
+
import { $t as COMMAND_PRIORITY_LOW, A as $getChildCaret, At as $rewindSiblingCaret, Dt as $normalizeSelection__EXPERIMENTAL, Et as $normalizeCaret, Ft as $setSelection, G as $getSelection, I as $getDocument, Lr as getNearestEditorFromDOMNode, Pt as $setPointFromCaret, Qr as isHTMLAnchorElement, St as $isTextNode, Tr as defineExtension, Zt as COMMAND_PRIORITY_EDITOR, _i as shallowMergeConfig, _r as TextNode, b as $findMatchingParent, br as configExtension, ci as mergeRegister, di as registerEventListeners, dt as $isLineBreakNode, et as $insertNodeToNearestRootAtCaret, ft as $isNodeSelection, hn as ElementNode, i as $caretFromPoint, l as $copyNode, mt as $isRangeSelection, n as $applyNodeReplacement, ot as $isElementNode, pi as safeCast, qr as isDOMNode, rr as PASTE_COMMAND, v as $createTextNode, vr as addClassNamesToElement, xr as createCommand, yt as $isSiblingCaret, z as $getNearestNodeFromDOMNode } from "./Lexical.node-8sRFmq2X.mjs";
|
|
3
|
+
import { c as CoreImportExtension, g as defineImportRule, l as DOMImportExtension, t as $distributeInlineWrapper, y as sel } from "./LexicalHtml.node-BYbzHNVe.mjs";
|
|
4
|
+
import { m as objectKlassEquals } from "./LexicalUtils.node-CIgMS8cG.mjs";
|
|
5
|
+
//#region ../../node_modules/.pnpm/@lexical+link@0.48.0_typescript@6.0.3/node_modules/@lexical/link/dist/LexicalLink.prod.mjs
|
|
6
6
|
/**
|
|
7
7
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
8
8
|
*
|
|
@@ -10,14 +10,14 @@ import { h as objectKlassEquals } from "./LexicalUtils.node-BVAwOkL4.mjs";
|
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
|
-
const
|
|
13
|
+
const j = /* @__PURE__ */ new Set([
|
|
14
14
|
"http:",
|
|
15
15
|
"https:",
|
|
16
16
|
"mailto:",
|
|
17
17
|
"sms:",
|
|
18
18
|
"tel:"
|
|
19
19
|
]);
|
|
20
|
-
var
|
|
20
|
+
var Z = class Z extends ElementNode {
|
|
21
21
|
__url;
|
|
22
22
|
__target;
|
|
23
23
|
__rel;
|
|
@@ -26,7 +26,7 @@ var z = class z extends ElementNode {
|
|
|
26
26
|
return "link";
|
|
27
27
|
}
|
|
28
28
|
static clone(t) {
|
|
29
|
-
return new
|
|
29
|
+
return new Z(t.__url, {
|
|
30
30
|
rel: t.__rel,
|
|
31
31
|
target: t.__target,
|
|
32
32
|
title: t.__title
|
|
@@ -34,14 +34,14 @@ var z = class z extends ElementNode {
|
|
|
34
34
|
}
|
|
35
35
|
constructor(t = "", e = {}, n) {
|
|
36
36
|
super(n);
|
|
37
|
-
const { target: r = null, rel: i = null, title:
|
|
38
|
-
this.__url = t, this.__target = r, this.__rel = i, this.__title =
|
|
37
|
+
const { target: r = null, rel: i = null, title: l = null } = e;
|
|
38
|
+
this.__url = t, this.__target = r, this.__rel = i, this.__title = l;
|
|
39
39
|
}
|
|
40
40
|
afterCloneFrom(t) {
|
|
41
41
|
super.afterCloneFrom(t), this.__url = t.__url, this.__rel = t.__rel, this.__target = t.__target, this.__title = t.__title;
|
|
42
42
|
}
|
|
43
43
|
createDOM(t) {
|
|
44
|
-
const e =
|
|
44
|
+
const e = $getDocument().createElement("a");
|
|
45
45
|
return this.updateLinkDOM(null, e, t), addClassNamesToElement(e, t.theme.link), e;
|
|
46
46
|
}
|
|
47
47
|
updateLinkDOM(t, e, n) {
|
|
@@ -62,23 +62,25 @@ var z = class z extends ElementNode {
|
|
|
62
62
|
}
|
|
63
63
|
static importDOM() {
|
|
64
64
|
return { a: (t) => ({
|
|
65
|
-
conversion:
|
|
65
|
+
conversion: Q,
|
|
66
66
|
priority: 1
|
|
67
67
|
}) };
|
|
68
68
|
}
|
|
69
69
|
static importJSON(t) {
|
|
70
|
-
return
|
|
70
|
+
return V().updateFromJSON(t);
|
|
71
71
|
}
|
|
72
72
|
updateFromJSON(t) {
|
|
73
73
|
return super.updateFromJSON(t).setURL(t.url).setRel(t.rel || null).setTarget(t.target || null).setTitle(t.title || null);
|
|
74
74
|
}
|
|
75
75
|
sanitizeUrl(t) {
|
|
76
|
-
|
|
76
|
+
const e = t;
|
|
77
|
+
t = st(t);
|
|
77
78
|
try {
|
|
78
|
-
const e = new URL(
|
|
79
|
-
if (!
|
|
80
|
-
} catch (
|
|
81
|
-
|
|
79
|
+
const e = new URL(st(t));
|
|
80
|
+
if (!j.has(e.protocol)) return "about:blank";
|
|
81
|
+
} catch (t) {
|
|
82
|
+
const n = e.replace(/[\u0000-\u001F\u007F\s]/g, "").match(/^([a-z][a-z0-9+.-]*):/i);
|
|
83
|
+
if (null != n && !j.has(`${n[1].toLowerCase()}:`)) return "about:blank";
|
|
82
84
|
}
|
|
83
85
|
return t;
|
|
84
86
|
}
|
|
@@ -150,48 +152,48 @@ var z = class z extends ElementNode {
|
|
|
150
152
|
return this.getType() === t.getType() && this.__url === t.__url && this.__target === t.__target && this.__rel === t.__rel && this.__title === t.__title;
|
|
151
153
|
}
|
|
152
154
|
};
|
|
153
|
-
function
|
|
155
|
+
function H(t) {
|
|
154
156
|
const e = $caretFromPoint(t, "next");
|
|
155
157
|
return [e, e.getFlipped()];
|
|
156
158
|
}
|
|
157
|
-
function
|
|
159
|
+
function G(t, e) {
|
|
158
160
|
for (const n of e) if (n.origin.isAttached()) {
|
|
159
161
|
$setPointFromCaret(t, $normalizeCaret(n));
|
|
160
162
|
return;
|
|
161
163
|
}
|
|
162
164
|
}
|
|
163
|
-
function
|
|
165
|
+
function q(t) {
|
|
164
166
|
const e = $getSelection();
|
|
165
167
|
let n = null, r = null;
|
|
166
168
|
function i() {
|
|
167
|
-
$isRangeSelection(e) && (
|
|
169
|
+
$isRangeSelection(e) && (G(e.anchor, n), G(e.focus, r), $normalizeSelection__EXPERIMENTAL(e));
|
|
168
170
|
}
|
|
169
|
-
$isRangeSelection(e) && (n =
|
|
170
|
-
let
|
|
171
|
+
$isRangeSelection(e) && (n = H(e.anchor), r = H(e.focus));
|
|
172
|
+
let l = !1;
|
|
171
173
|
for (const e of $getChildCaret(t, "next")) {
|
|
172
174
|
const n = e.origin;
|
|
173
175
|
if ($isElementNode(n) && !n.isInline()) {
|
|
174
176
|
const r = n.getChildren();
|
|
175
177
|
if (r.length > 0) {
|
|
176
178
|
const e = $copyNode(t);
|
|
177
|
-
e.append(...r), n.append(e),
|
|
179
|
+
e.append(...r), n.append(e), l = !0;
|
|
178
180
|
}
|
|
179
181
|
$insertNodeToNearestRootAtCaret(n, $rewindSiblingCaret(e), { $shouldSplit: () => !1 });
|
|
180
182
|
}
|
|
181
183
|
}
|
|
182
184
|
function u(t, e, n) {
|
|
183
|
-
const [r, i] = t,
|
|
184
|
-
if (!
|
|
185
|
-
const
|
|
186
|
-
return [
|
|
185
|
+
const [r, i] = t, l = (t) => $isSiblingCaret(t) && t.origin.is(e);
|
|
186
|
+
if (!l(r) && !l(i)) return t;
|
|
187
|
+
const s = $normalizeCaret($getChildCaret(n, "next"));
|
|
188
|
+
return [s, s.getFlipped()];
|
|
187
189
|
}
|
|
188
190
|
if (t.isAttached()) {
|
|
189
191
|
const e = t.getPreviousSibling();
|
|
190
|
-
if (
|
|
192
|
+
if (X(e) && e.shouldMergeAdjacentLink(t)) return n && (n = u(n, e, t)), r && (r = u(r, e, t)), e.append(...t.getChildren()), t.remove(), void i();
|
|
191
193
|
const s = t.getNextSibling();
|
|
192
|
-
|
|
194
|
+
X(s) && t.shouldMergeAdjacentLink(s) && (n && (n = u(n, t, s)), r && (r = u(r, t, s)), t.append(...s.getChildren()), s.remove(), l = !0);
|
|
193
195
|
}
|
|
194
|
-
if (
|
|
196
|
+
if (l) {
|
|
195
197
|
if (!t.canBeEmpty() && t.isEmpty()) {
|
|
196
198
|
const e = t.getParent();
|
|
197
199
|
t.remove(), e && e.isEmpty() && e.remove();
|
|
@@ -199,11 +201,11 @@ function G(t) {
|
|
|
199
201
|
i();
|
|
200
202
|
}
|
|
201
203
|
}
|
|
202
|
-
function
|
|
204
|
+
function Q(t) {
|
|
203
205
|
let e = null;
|
|
204
206
|
if (isHTMLAnchorElement(t)) {
|
|
205
207
|
const n = t.textContent;
|
|
206
|
-
(null !== n && "" !== n || t.children.length > 0) && (e =
|
|
208
|
+
(null !== n && "" !== n || t.children.length > 0) && (e = V(t.getAttribute("href") || "", {
|
|
207
209
|
rel: t.getAttribute("rel"),
|
|
208
210
|
target: t.getAttribute("target"),
|
|
209
211
|
title: t.getAttribute("title")
|
|
@@ -211,13 +213,13 @@ function Z(t) {
|
|
|
211
213
|
}
|
|
212
214
|
return { node: e };
|
|
213
215
|
}
|
|
214
|
-
function
|
|
215
|
-
return $applyNodeReplacement(new
|
|
216
|
+
function V(t = "", e) {
|
|
217
|
+
return $applyNodeReplacement(new Z(t, e));
|
|
216
218
|
}
|
|
217
|
-
function
|
|
218
|
-
return t instanceof
|
|
219
|
+
function X(t) {
|
|
220
|
+
return t instanceof Z;
|
|
219
221
|
}
|
|
220
|
-
var
|
|
222
|
+
var Y = class Y extends Z {
|
|
221
223
|
__isUnlinked;
|
|
222
224
|
constructor(t = "", e = {}, n) {
|
|
223
225
|
super(t, e, n), this.__isUnlinked = void 0 !== e.isUnlinked && null !== e.isUnlinked && e.isUnlinked;
|
|
@@ -229,7 +231,7 @@ var V = class V extends z {
|
|
|
229
231
|
return "autolink";
|
|
230
232
|
}
|
|
231
233
|
static clone(t) {
|
|
232
|
-
return new
|
|
234
|
+
return new Y(t.__url, {
|
|
233
235
|
isUnlinked: t.__isUnlinked,
|
|
234
236
|
rel: t.__rel,
|
|
235
237
|
target: t.__target,
|
|
@@ -247,13 +249,13 @@ var V = class V extends z {
|
|
|
247
249
|
return e.__isUnlinked = t, e;
|
|
248
250
|
}
|
|
249
251
|
createDOM(t) {
|
|
250
|
-
return this.__isUnlinked ?
|
|
252
|
+
return this.__isUnlinked ? $getDocument().createElement("span") : super.createDOM(t);
|
|
251
253
|
}
|
|
252
254
|
updateDOM(t, e, n) {
|
|
253
255
|
return super.updateDOM(t, e, n) || t.__isUnlinked !== this.__isUnlinked;
|
|
254
256
|
}
|
|
255
257
|
static importJSON(t) {
|
|
256
|
-
return
|
|
258
|
+
return tt().updateFromJSON(t);
|
|
257
259
|
}
|
|
258
260
|
updateFromJSON(t) {
|
|
259
261
|
return super.updateFromJSON(t).setIsUnlinked(t.isUnlinked || !1);
|
|
@@ -268,7 +270,7 @@ var V = class V extends z {
|
|
|
268
270
|
};
|
|
269
271
|
}
|
|
270
272
|
insertNewAfter(t, e = !0) {
|
|
271
|
-
const n =
|
|
273
|
+
const n = tt(this.__url, {
|
|
272
274
|
isUnlinked: this.__isUnlinked,
|
|
273
275
|
rel: this.__rel,
|
|
274
276
|
target: this.__target,
|
|
@@ -277,14 +279,14 @@ var V = class V extends z {
|
|
|
277
279
|
return this.insertAfter(n, e), n;
|
|
278
280
|
}
|
|
279
281
|
};
|
|
280
|
-
function
|
|
281
|
-
return $applyNodeReplacement(new
|
|
282
|
+
function tt(t = "", e) {
|
|
283
|
+
return $applyNodeReplacement(new Y(t, e));
|
|
282
284
|
}
|
|
283
|
-
function
|
|
284
|
-
return t instanceof
|
|
285
|
+
function et(t) {
|
|
286
|
+
return t instanceof Y;
|
|
285
287
|
}
|
|
286
|
-
const
|
|
287
|
-
function
|
|
288
|
+
const nt = /* @__PURE__ */ createCommand("TOGGLE_LINK_COMMAND");
|
|
289
|
+
function rt(t, e) {
|
|
288
290
|
if ("element" === t.type) {
|
|
289
291
|
const n = t.getNode();
|
|
290
292
|
$isElementNode(n) || function(t, ...e) {
|
|
@@ -297,7 +299,7 @@ function et(t, e) {
|
|
|
297
299
|
}
|
|
298
300
|
return null;
|
|
299
301
|
}
|
|
300
|
-
function
|
|
302
|
+
function it(t, e = {}) {
|
|
301
303
|
let n;
|
|
302
304
|
if (t && "object" == typeof t) {
|
|
303
305
|
const { url: r, ...i } = t;
|
|
@@ -306,21 +308,21 @@ function nt(t, e = {}) {
|
|
|
306
308
|
...e
|
|
307
309
|
};
|
|
308
310
|
} else n = t;
|
|
309
|
-
const { target: r, title: i } = e,
|
|
311
|
+
const { target: r, title: i } = e, l = void 0 === e.rel ? "noreferrer" : e.rel, u = $getSelection();
|
|
310
312
|
if (null === u || !$isRangeSelection(u) && !$isNodeSelection(u)) return;
|
|
311
313
|
if ($isNodeSelection(u)) {
|
|
312
314
|
const t = u.getNodes();
|
|
313
315
|
if (0 === t.length) return;
|
|
314
316
|
t.forEach((t) => {
|
|
315
317
|
if (null === n) {
|
|
316
|
-
const e = $findMatchingParent(t, (t) => !
|
|
318
|
+
const e = $findMatchingParent(t, (t) => !et(t) && X(t));
|
|
317
319
|
e && (e.insertBefore(t), 0 === e.getChildren().length && e.remove());
|
|
318
320
|
} else {
|
|
319
|
-
const e = $findMatchingParent(t, (t) => !
|
|
320
|
-
if (e) e.setURL(n), void 0 !== r && e.setTarget(r), void 0 !==
|
|
321
|
+
const e = $findMatchingParent(t, (t) => !et(t) && X(t));
|
|
322
|
+
if (e) e.setURL(n), void 0 !== r && e.setTarget(r), void 0 !== l && e.setRel(l);
|
|
321
323
|
else {
|
|
322
|
-
const e =
|
|
323
|
-
rel:
|
|
324
|
+
const e = V(n, {
|
|
325
|
+
rel: l,
|
|
324
326
|
target: r
|
|
325
327
|
});
|
|
326
328
|
t.insertBefore(e), e.append(t);
|
|
@@ -330,15 +332,15 @@ function nt(t, e = {}) {
|
|
|
330
332
|
return;
|
|
331
333
|
}
|
|
332
334
|
if (u.isCollapsed() && null === n) for (const t of u.getNodes()) {
|
|
333
|
-
const e = $findMatchingParent(t, (t) => !
|
|
335
|
+
const e = $findMatchingParent(t, (t) => !et(t) && X(t));
|
|
334
336
|
null !== e && (e.getParentOrThrow().splice(e.getIndexWithinParent(), 0, e.getChildren()), e.remove());
|
|
335
337
|
return;
|
|
336
338
|
}
|
|
337
|
-
const
|
|
339
|
+
const a = u.extract();
|
|
338
340
|
if (null === n) {
|
|
339
341
|
const t = /* @__PURE__ */ new Set();
|
|
340
|
-
|
|
341
|
-
const n = $findMatchingParent(e, (t) => !
|
|
342
|
+
a.forEach((e) => {
|
|
343
|
+
const n = $findMatchingParent(e, (t) => !et(t) && X(t));
|
|
342
344
|
if (null !== n) {
|
|
343
345
|
const e = n.getKey();
|
|
344
346
|
if (t.has(e)) return;
|
|
@@ -356,24 +358,24 @@ function nt(t, e = {}) {
|
|
|
356
358
|
l[l.length - 1].insertAfter(n), e.forEach((t) => n.append(t));
|
|
357
359
|
}
|
|
358
360
|
}
|
|
359
|
-
})(n,
|
|
361
|
+
})(n, a), t.add(e);
|
|
360
362
|
}
|
|
361
363
|
});
|
|
362
364
|
return;
|
|
363
365
|
}
|
|
364
|
-
const
|
|
365
|
-
|
|
366
|
+
const p = /* @__PURE__ */ new Set(), m = (t) => {
|
|
367
|
+
p.has(t.getKey()) || (p.add(t.getKey()), t.setURL(n), void 0 !== r && t.setTarget(r), void 0 !== l && t.setRel(l), void 0 !== i && t.setTitle(i));
|
|
366
368
|
};
|
|
367
|
-
if (1 ===
|
|
368
|
-
const t =
|
|
369
|
+
if (1 === a.length) {
|
|
370
|
+
const t = a[0], e = $findMatchingParent(t, X);
|
|
369
371
|
if (null !== e) return m(e);
|
|
370
372
|
}
|
|
371
373
|
(function(t) {
|
|
372
374
|
const e = $getSelection();
|
|
373
375
|
if (!$isRangeSelection(e)) return t();
|
|
374
|
-
const n = $normalizeSelection__EXPERIMENTAL(e), r = n.isBackward(), i =
|
|
376
|
+
const n = $normalizeSelection__EXPERIMENTAL(e), r = n.isBackward(), i = rt(n.anchor, r ? -1 : 0), l = rt(n.focus, r ? 0 : -1);
|
|
375
377
|
t();
|
|
376
|
-
if (i ||
|
|
378
|
+
if (i || l) {
|
|
377
379
|
const t = $getSelection();
|
|
378
380
|
if ($isRangeSelection(t)) {
|
|
379
381
|
const e = t.clone();
|
|
@@ -381,26 +383,26 @@ function nt(t, e = {}) {
|
|
|
381
383
|
const t = i.getParent();
|
|
382
384
|
t && e.anchor.set(t.getKey(), i.getIndexWithinParent() + (r ? 1 : 0), "element");
|
|
383
385
|
}
|
|
384
|
-
if (
|
|
385
|
-
const t =
|
|
386
|
-
t && e.focus.set(t.getKey(),
|
|
386
|
+
if (l) {
|
|
387
|
+
const t = l.getParent();
|
|
388
|
+
t && e.focus.set(t.getKey(), l.getIndexWithinParent() + (r ? 0 : 1), "element");
|
|
387
389
|
}
|
|
388
390
|
$setSelection($normalizeSelection__EXPERIMENTAL(e));
|
|
389
391
|
}
|
|
390
392
|
}
|
|
391
393
|
})(() => {
|
|
392
394
|
let t = null;
|
|
393
|
-
for (const e of
|
|
395
|
+
for (const e of a) {
|
|
394
396
|
if (!e.isAttached()) continue;
|
|
395
|
-
const s = $findMatchingParent(e,
|
|
397
|
+
const s = $findMatchingParent(e, X);
|
|
396
398
|
if (s) {
|
|
397
399
|
m(s);
|
|
398
400
|
continue;
|
|
399
401
|
}
|
|
400
402
|
if ($isElementNode(e)) {
|
|
401
403
|
if (!e.isInline()) continue;
|
|
402
|
-
if (
|
|
403
|
-
if (!(
|
|
404
|
+
if (X(e)) {
|
|
405
|
+
if (!(et(e) || null !== t && t.getParentOrThrow().isParentOf(e))) {
|
|
404
406
|
m(e), t = e;
|
|
405
407
|
continue;
|
|
406
408
|
}
|
|
@@ -409,20 +411,20 @@ function nt(t, e = {}) {
|
|
|
409
411
|
continue;
|
|
410
412
|
}
|
|
411
413
|
}
|
|
412
|
-
const
|
|
413
|
-
|
|
414
|
-
rel:
|
|
414
|
+
const o = e.getPreviousSibling();
|
|
415
|
+
X(o) && o.is(t) ? o.append(e) : (t = V(n, {
|
|
416
|
+
rel: l,
|
|
415
417
|
target: r,
|
|
416
418
|
title: i
|
|
417
419
|
}), e.insertAfter(t), t.append(e));
|
|
418
420
|
}
|
|
419
421
|
});
|
|
420
422
|
}
|
|
421
|
-
const
|
|
422
|
-
function
|
|
423
|
-
return t.match(/^[a-z][a-z0-9+.-]*:/i) || t.match(/^[/#.]/) ? t : t.includes("@") ? `mailto:${t}` :
|
|
423
|
+
const lt = /^\+?[0-9\s()-]{5,}$/;
|
|
424
|
+
function st(t) {
|
|
425
|
+
return t.match(/^[a-z][a-z0-9+.-]*:/i) || t.match(/^[/#.]/) ? t : t.includes("@") ? `mailto:${t}` : lt.test(t) ? `tel:${t}` : `https://${t}`;
|
|
424
426
|
}
|
|
425
|
-
const
|
|
427
|
+
const ot = [/* @__PURE__ */ defineImportRule({
|
|
426
428
|
$import: (t, e) => {
|
|
427
429
|
if (!e.textContent && 0 === e.children.length) return [];
|
|
428
430
|
const n = e.getAttribute("href") || "", r = {
|
|
@@ -430,23 +432,23 @@ const st = [/* @__PURE__ */ defineImportRule({
|
|
|
430
432
|
target: e.getAttribute("target"),
|
|
431
433
|
title: e.getAttribute("title")
|
|
432
434
|
};
|
|
433
|
-
return $distributeInlineWrapper(t.$importChildren(e), () =>
|
|
435
|
+
return $distributeInlineWrapper(t.$importChildren(e), () => V(n, r));
|
|
434
436
|
},
|
|
435
437
|
match: sel.tag("a"),
|
|
436
438
|
name: "@lexical/link/a"
|
|
437
439
|
})];
|
|
438
|
-
function
|
|
439
|
-
return mergeRegister(t.registerNodeTransform(
|
|
440
|
+
function ut(t, n) {
|
|
441
|
+
return mergeRegister(t.registerNodeTransform(Z, q), t.registerCommand(nt, (t) => {
|
|
440
442
|
const e = n.validateUrl.peek(), r = n.attributes.peek();
|
|
441
|
-
if (null === t) return
|
|
442
|
-
if ("string" == typeof t) return !(void 0 !== e && !e(t)) && (
|
|
443
|
+
if (null === t) return it(null), !0;
|
|
444
|
+
if ("string" == typeof t) return !(void 0 !== e && !e(t)) && (it(t, r), !0);
|
|
443
445
|
{
|
|
444
|
-
const { url: e, target: n, rel: i, title:
|
|
445
|
-
return
|
|
446
|
+
const { url: e, target: n, rel: i, title: l } = t;
|
|
447
|
+
return it(e, {
|
|
446
448
|
...r,
|
|
447
449
|
rel: i,
|
|
448
450
|
target: n,
|
|
449
|
-
title:
|
|
451
|
+
title: l
|
|
450
452
|
}), !0;
|
|
451
453
|
}
|
|
452
454
|
}, COMMAND_PRIORITY_EDITOR), effect(() => {
|
|
@@ -457,45 +459,46 @@ function lt(t, n) {
|
|
|
457
459
|
const i = $getSelection();
|
|
458
460
|
if (!$isRangeSelection(i) || i.isCollapsed() || !objectKlassEquals(n, ClipboardEvent)) return !1;
|
|
459
461
|
if (null === n.clipboardData) return !1;
|
|
460
|
-
const
|
|
461
|
-
if (!e(
|
|
462
|
-
return !i.getNodes().some((t) => $isElementNode(t) || $isTextNode(t) && !t.isSimpleText()) && (t.dispatchCommand(
|
|
462
|
+
const l = n.clipboardData.getData("text");
|
|
463
|
+
if (!e(l)) return !1;
|
|
464
|
+
return !i.getNodes().some((t) => $isElementNode(t) || $isTextNode(t) && !t.isSimpleText()) && (t.dispatchCommand(nt, {
|
|
463
465
|
...r,
|
|
464
|
-
url:
|
|
466
|
+
url: l
|
|
465
467
|
}), n.preventDefault(), !0);
|
|
466
468
|
}, COMMAND_PRIORITY_LOW);
|
|
467
469
|
}));
|
|
468
470
|
}
|
|
469
|
-
const
|
|
471
|
+
const at = /* @__PURE__ */ defineExtension({
|
|
470
472
|
build: (e, n, r) => namedSignals(n),
|
|
471
473
|
config: {
|
|
472
474
|
attributes: void 0,
|
|
473
475
|
validateUrl: void 0
|
|
474
476
|
},
|
|
475
|
-
dependencies: [CoreImportExtension, /* @__PURE__ */ configExtension(DOMImportExtension, { rules:
|
|
477
|
+
dependencies: [CoreImportExtension, /* @__PURE__ */ configExtension(DOMImportExtension, { rules: ot })],
|
|
476
478
|
mergeConfig(t, e) {
|
|
477
479
|
const n = shallowMergeConfig(t, e);
|
|
478
480
|
return t.attributes && (n.attributes = shallowMergeConfig(t.attributes, n.attributes)), n;
|
|
479
481
|
},
|
|
480
482
|
name: "@lexical/link/Link",
|
|
481
|
-
nodes: () => [
|
|
482
|
-
register: (t, e, n) =>
|
|
483
|
-
})
|
|
484
|
-
|
|
483
|
+
nodes: () => [Z],
|
|
484
|
+
register: (t, e, n) => ut(t, n.getOutput())
|
|
485
|
+
});
|
|
486
|
+
const ct = /* @__PURE__ */ defineExtension({
|
|
487
|
+
dependencies: [at],
|
|
485
488
|
name: "@lexical/link/Import"
|
|
486
489
|
});
|
|
487
|
-
function
|
|
490
|
+
function gt(t, e, n = {}) {
|
|
488
491
|
const r = (n) => {
|
|
489
492
|
const r = n.target;
|
|
490
493
|
if (!isDOMNode(r)) return;
|
|
491
|
-
const
|
|
492
|
-
if (null ===
|
|
493
|
-
let
|
|
494
|
-
if (
|
|
494
|
+
const i = getNearestEditorFromDOMNode(r);
|
|
495
|
+
if (null === i) return;
|
|
496
|
+
let s = null, u = null, a = !1;
|
|
497
|
+
if (i.update(() => {
|
|
495
498
|
const t = $getNearestNodeFromDOMNode(r);
|
|
496
499
|
if (null !== t) {
|
|
497
500
|
const n = $findMatchingParent(t, $isElementNode);
|
|
498
|
-
if (!e.disabled.peek()) if (
|
|
501
|
+
if (!e.disabled.peek()) if (X(n)) a = et(n) && n.getIsUnlinked(), s = n.sanitizeUrl(n.getURL()), u = n.getTarget();
|
|
499
502
|
else {
|
|
500
503
|
const t = function(t, e) {
|
|
501
504
|
let n = t;
|
|
@@ -505,34 +508,35 @@ function at(t, e, n = {}) {
|
|
|
505
508
|
}
|
|
506
509
|
return null;
|
|
507
510
|
}(r, isHTMLAnchorElement);
|
|
508
|
-
null !== t && (
|
|
511
|
+
null !== t && (s = t.href, u = t.target);
|
|
509
512
|
}
|
|
510
513
|
}
|
|
511
|
-
}), null ===
|
|
512
|
-
const
|
|
513
|
-
if ($isRangeSelection(
|
|
514
|
-
const
|
|
515
|
-
window.open(
|
|
516
|
-
},
|
|
514
|
+
}), null === s || "" === s || a) return;
|
|
515
|
+
const g = t.read("latest", $getSelection);
|
|
516
|
+
if ($isRangeSelection(g) && !g.isCollapsed()) return void n.preventDefault();
|
|
517
|
+
const d = "auxclick" === n.type && 1 === n.button;
|
|
518
|
+
window.open(s, e.newTab.peek() || d || n.metaKey || n.ctrlKey || "_blank" === u ? "_blank" : "_self"), n.preventDefault();
|
|
519
|
+
}, i = (t) => {
|
|
517
520
|
1 === t.button && r(t);
|
|
518
521
|
};
|
|
519
522
|
return t.registerRootListener((t) => {
|
|
520
|
-
if (t) return
|
|
521
|
-
|
|
522
|
-
|
|
523
|
+
if (t) return registerEventListeners(t, {
|
|
524
|
+
click: r,
|
|
525
|
+
mouseup: i
|
|
526
|
+
}, n);
|
|
523
527
|
});
|
|
524
528
|
}
|
|
525
|
-
const
|
|
529
|
+
const ft = /* @__PURE__ */ defineExtension({
|
|
526
530
|
build: (e, n, r) => namedSignals(n),
|
|
527
531
|
config: /* @__PURE__ */ safeCast({
|
|
528
532
|
disabled: !1,
|
|
529
533
|
newTab: !1
|
|
530
534
|
}),
|
|
531
|
-
dependencies: [
|
|
535
|
+
dependencies: [at],
|
|
532
536
|
name: "@lexical/link/ClickableLink",
|
|
533
|
-
register: (t, e, n) =>
|
|
537
|
+
register: (t, e, n) => gt(t, n.getOutput())
|
|
534
538
|
});
|
|
535
|
-
function
|
|
539
|
+
function dt(t, e = (t) => t) {
|
|
536
540
|
return (n) => {
|
|
537
541
|
const r = t.exec(n);
|
|
538
542
|
return null === r ? null : {
|
|
@@ -543,86 +547,101 @@ function gt(t, e = (t) => t) {
|
|
|
543
547
|
};
|
|
544
548
|
};
|
|
545
549
|
}
|
|
546
|
-
|
|
550
|
+
const ht = /((https?:\/\/(www\.)?)|(www\.))[-\p{L}\p{N}@:%._+~#=]{1,256}\.[\p{L}\p{N}]{1,6}(?:[-\p{L}\p{N}()@:%_+.~#?&//=]*[\p{L}\p{N}()@_~#?&//=])?/u;
|
|
551
|
+
const pt = (t) => {
|
|
552
|
+
const e = ht.exec(t);
|
|
553
|
+
if (null === e) return null;
|
|
554
|
+
let n = e[0], r = 0;
|
|
555
|
+
for (const t of n) "(" === t ? r++ : ")" === t && r--;
|
|
556
|
+
for (; r < 0 && n.endsWith(")");) n = n.slice(0, -1), r++;
|
|
557
|
+
return {
|
|
558
|
+
index: e.index,
|
|
559
|
+
length: n.length,
|
|
560
|
+
text: n,
|
|
561
|
+
url: n.startsWith("http") ? n : `https://${n}`
|
|
562
|
+
};
|
|
563
|
+
};
|
|
564
|
+
const _t = dt(/(([^<>()[\]\\.,;:\s@"]{1,64}(\.[^<>()[\]\\.,;:\s@"]{1,64}){0,63})|(".{1,255}"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]{1,63}\.){1,127}[a-zA-Z]{2,63}))/, (t) => `mailto:${t}`);
|
|
565
|
+
function mt(t, e) {
|
|
547
566
|
for (let n = 0; n < e.length; n++) {
|
|
548
567
|
const r = e[n](t);
|
|
549
568
|
if (r) return r;
|
|
550
569
|
}
|
|
551
570
|
return null;
|
|
552
571
|
}
|
|
553
|
-
const
|
|
554
|
-
function
|
|
572
|
+
const xt = /[.,;\s]/;
|
|
573
|
+
function bt(t, e) {
|
|
555
574
|
return e.test(t);
|
|
556
575
|
}
|
|
557
|
-
function
|
|
558
|
-
return
|
|
576
|
+
function kt(t, e) {
|
|
577
|
+
return bt(t[t.length - 1], e);
|
|
559
578
|
}
|
|
560
|
-
function
|
|
561
|
-
return
|
|
579
|
+
function Ut(t, e) {
|
|
580
|
+
return bt(t[0], e);
|
|
562
581
|
}
|
|
563
|
-
function
|
|
582
|
+
function vt(t, e) {
|
|
564
583
|
let n = t.getPreviousSibling();
|
|
565
|
-
return $isElementNode(n) && (n = n.getLastDescendant()), null === n || $isLineBreakNode(n) || $isTextNode(n) &&
|
|
584
|
+
return $isElementNode(n) && (n = n.getLastDescendant()), null === n || $isLineBreakNode(n) || $isTextNode(n) && kt(n.getTextContent(), e);
|
|
566
585
|
}
|
|
567
|
-
function
|
|
586
|
+
function Tt(t, e) {
|
|
568
587
|
let n = t.getNextSibling();
|
|
569
|
-
return $isElementNode(n) && (n = n.getFirstDescendant()), null === n || $isLineBreakNode(n) || $isTextNode(n) &&
|
|
588
|
+
return $isElementNode(n) && (n = n.getFirstDescendant()), null === n || $isLineBreakNode(n) || $isTextNode(n) && Ut(n.getTextContent(), e);
|
|
570
589
|
}
|
|
571
|
-
function
|
|
572
|
-
if (!(t > 0 ?
|
|
573
|
-
return e < r.length ?
|
|
590
|
+
function Ct(t, e, n, r, i) {
|
|
591
|
+
if (!(t > 0 ? bt(r[t - 1], n) : vt(i[0], n))) return !1;
|
|
592
|
+
return e < r.length ? bt(r[e], n) : Tt(i[i.length - 1], n);
|
|
574
593
|
}
|
|
575
|
-
function
|
|
576
|
-
const r = [], i = [],
|
|
577
|
-
let
|
|
594
|
+
function Lt(t, e, n) {
|
|
595
|
+
const r = [], i = [], l = [];
|
|
596
|
+
let s = 0, o = 0;
|
|
578
597
|
const u = [...t];
|
|
579
598
|
for (; u.length > 0;) {
|
|
580
599
|
const t = u[0], a = t.getTextContent().length, c = o;
|
|
581
|
-
o + a <= e ? (r.push(t),
|
|
600
|
+
o + a <= e ? (r.push(t), s += a) : c >= n ? l.push(t) : i.push(t), o += a, u.shift();
|
|
582
601
|
}
|
|
583
602
|
return [
|
|
584
|
-
|
|
603
|
+
s,
|
|
585
604
|
r,
|
|
586
605
|
i,
|
|
587
|
-
|
|
606
|
+
l
|
|
588
607
|
];
|
|
589
608
|
}
|
|
590
|
-
function
|
|
591
|
-
const i =
|
|
609
|
+
function St(t, e, n, r) {
|
|
610
|
+
const i = tt(r.url, r.attributes);
|
|
592
611
|
if (1 === t.length) {
|
|
593
|
-
let
|
|
594
|
-
0 === e ? [
|
|
612
|
+
let l, s = t[0];
|
|
613
|
+
0 === e ? [l, s] = s.splitText(n) : [, l, s] = s.splitText(e, n);
|
|
595
614
|
const o = $createTextNode(r.text);
|
|
596
|
-
return o.setFormat(
|
|
615
|
+
return o.setFormat(l.getFormat()), o.setDetail(l.getDetail()), o.setStyle(l.getStyle()), i.append(o), l.replace(i), s;
|
|
597
616
|
}
|
|
598
617
|
if (t.length > 1) {
|
|
599
618
|
const r = t[0];
|
|
600
|
-
let
|
|
601
|
-
0 === e ?
|
|
619
|
+
let l, s = r.getTextContent().length;
|
|
620
|
+
0 === e ? l = r : [, l] = r.splitText(e);
|
|
602
621
|
const u = [];
|
|
603
|
-
let
|
|
622
|
+
let a;
|
|
604
623
|
for (let e = 1; e < t.length; e++) {
|
|
605
|
-
const r = t[e], i = r.getTextContent().length,
|
|
606
|
-
if (
|
|
624
|
+
const r = t[e], i = r.getTextContent().length, l = s;
|
|
625
|
+
if (l < n) if (s + i <= n) u.push(r);
|
|
607
626
|
else {
|
|
608
|
-
const [t, e] = r.splitText(n -
|
|
609
|
-
u.push(t),
|
|
627
|
+
const [t, e] = r.splitText(n - l);
|
|
628
|
+
u.push(t), a = e;
|
|
610
629
|
}
|
|
611
|
-
|
|
630
|
+
s += i;
|
|
612
631
|
}
|
|
613
|
-
const f = $getSelection(), d = f ? f.getNodes().find($isTextNode) : void 0, h = $createTextNode(
|
|
614
|
-
return h.setFormat(
|
|
632
|
+
const f = $getSelection(), d = f ? f.getNodes().find($isTextNode) : void 0, h = $createTextNode(l.getTextContent());
|
|
633
|
+
return h.setFormat(l.getFormat()), h.setDetail(l.getDetail()), h.setStyle(l.getStyle()), i.append(h, ...u), d && d === l && ($isRangeSelection(f) ? h.select(f.anchor.offset, f.focus.offset) : $isNodeSelection(f) && h.select(0, h.getTextContent().length)), l.replace(i), a;
|
|
615
634
|
}
|
|
616
635
|
}
|
|
617
|
-
function
|
|
618
|
-
const i = t.getChildren(),
|
|
619
|
-
for (let e = 0; e <
|
|
636
|
+
function Nt(t, e, n, r) {
|
|
637
|
+
const i = t.getChildren(), l = i.length;
|
|
638
|
+
for (let e = 0; e < l; e++) {
|
|
620
639
|
const r = i[e];
|
|
621
|
-
if (!$isTextNode(r) || !r.isSimpleText()) return
|
|
640
|
+
if (!$isTextNode(r) || !r.isSimpleText()) return Ot(t), void n(null, t.getURL());
|
|
622
641
|
}
|
|
623
|
-
const
|
|
624
|
-
if (null === o || o.text !==
|
|
625
|
-
if (!
|
|
642
|
+
const s = t.getTextContent(), o = mt(s, e);
|
|
643
|
+
if (null === o || o.text !== s) return Ot(t), void n(null, t.getURL());
|
|
644
|
+
if (!vt(t, r) || !Tt(t, r)) return Ot(t), void n(null, t.getURL());
|
|
626
645
|
const u = t.getURL();
|
|
627
646
|
if (u !== o.url && (t.setURL(o.url), n(o.url, u)), o.attributes) {
|
|
628
647
|
const e = t.getRel();
|
|
@@ -631,41 +650,41 @@ function Ut(t, e, n, r) {
|
|
|
631
650
|
r !== o.attributes.target && (t.setTarget(o.attributes.target || null), n(o.attributes.target || null, r));
|
|
632
651
|
}
|
|
633
652
|
}
|
|
634
|
-
function
|
|
653
|
+
function Ot(t) {
|
|
635
654
|
const e = t.getChildren();
|
|
636
655
|
for (let n = e.length - 1; n >= 0; n--) t.insertAfter(e[n]);
|
|
637
656
|
return t.remove(), e.map((t) => t.getLatest());
|
|
638
657
|
}
|
|
639
|
-
const
|
|
658
|
+
const At = {
|
|
640
659
|
changeHandlers: [],
|
|
641
660
|
excludeParents: [],
|
|
642
661
|
matchers: [],
|
|
643
|
-
separatorRegex:
|
|
662
|
+
separatorRegex: xt
|
|
644
663
|
};
|
|
645
|
-
function
|
|
646
|
-
const { matchers: n, changeHandlers: r, excludeParents: i, separatorRegex:
|
|
664
|
+
function Pt(t, e = At) {
|
|
665
|
+
const { matchers: n, changeHandlers: r, excludeParents: i, separatorRegex: l = xt } = e, s = (t, e) => {
|
|
647
666
|
for (const n of r) n(t, e);
|
|
648
667
|
};
|
|
649
668
|
return mergeRegister(t.registerNodeTransform(TextNode, (t) => {
|
|
650
669
|
const e = t.getParentOrThrow(), r = t.getPreviousSibling();
|
|
651
|
-
if (
|
|
652
|
-
else if (!
|
|
653
|
-
if (t.isSimpleText() && (
|
|
670
|
+
if (et(e)) Nt(e, n, s, l);
|
|
671
|
+
else if (!X(e) && !i.some((t) => t(e))) {
|
|
672
|
+
if (t.isSimpleText() && (Ut(t.getTextContent(), l) || !et(r))) (function(t, e, n, r) {
|
|
654
673
|
for (const e of t) {
|
|
655
674
|
const t = e.getParent();
|
|
656
|
-
if (
|
|
675
|
+
if (et(t) && !t.getIsUnlinked()) return;
|
|
657
676
|
}
|
|
658
677
|
let i = [...t];
|
|
659
|
-
const
|
|
660
|
-
let
|
|
661
|
-
for (; (
|
|
662
|
-
const t =
|
|
663
|
-
if (
|
|
664
|
-
const [r, ,
|
|
678
|
+
const l = i.map((t) => t.getTextContent()).join("");
|
|
679
|
+
let s, o = l, u = 0;
|
|
680
|
+
for (; (s = mt(o, e)) && null !== s;) {
|
|
681
|
+
const t = s.index, e = t + s.length;
|
|
682
|
+
if (Ct(u + t, u + e, r, l, i)) {
|
|
683
|
+
const [r, , l, a] = Lt(i, u + t, u + e);
|
|
665
684
|
let c = !1;
|
|
666
|
-
for (const t of
|
|
685
|
+
for (const t of l) {
|
|
667
686
|
const e = t.getParent();
|
|
668
|
-
if (
|
|
687
|
+
if (et(e) && !e.getIsUnlinked()) {
|
|
669
688
|
c = !0;
|
|
670
689
|
break;
|
|
671
690
|
}
|
|
@@ -674,8 +693,8 @@ function Lt(t, e = Ct) {
|
|
|
674
693
|
u += e, o = o.substring(e);
|
|
675
694
|
continue;
|
|
676
695
|
}
|
|
677
|
-
const g =
|
|
678
|
-
i = g ? [g, ...a] : a, n(
|
|
696
|
+
const g = St(l, u + t - r, u + e - r, s);
|
|
697
|
+
i = g ? [g, ...a] : a, n(s.url, null), u = 0;
|
|
679
698
|
} else u += e;
|
|
680
699
|
o = o.substring(e);
|
|
681
700
|
}
|
|
@@ -684,34 +703,34 @@ function Lt(t, e = Ct) {
|
|
|
684
703
|
let n = t.getNextSibling();
|
|
685
704
|
for (; null !== n && $isTextNode(n) && n.isSimpleText() && (e.push(n), !/[\s]/.test(n.getTextContent()));) n = n.getNextSibling();
|
|
686
705
|
return e;
|
|
687
|
-
}(t), n,
|
|
706
|
+
}(t), n, s, l);
|
|
688
707
|
(function(t, e, n, r) {
|
|
689
|
-
const i = t.getParent(),
|
|
690
|
-
if (!
|
|
691
|
-
if (
|
|
692
|
-
if (!
|
|
693
|
-
if (u = o,
|
|
694
|
-
const i =
|
|
695
|
-
null !==
|
|
708
|
+
const i = t.getParent(), l = t.getPreviousSibling(), s = t.getNextSibling(), o = t.getTextContent();
|
|
709
|
+
if (!et(i) || i.getIsUnlinked()) {
|
|
710
|
+
if (et(l) && !l.getIsUnlinked() && l.is(t.getPreviousSibling()) && t.getParent() === l.getParent()) {
|
|
711
|
+
if (!Ut(o, r)) return Ot(l), void n(null, l.getURL());
|
|
712
|
+
if (u = o, l.isEmailURI() ? /^\.[a-zA-Z]{2,}/.test(u) : /^\.[a-zA-Z0-9]{1,}/.test(u)) {
|
|
713
|
+
const i = l.getTextContent() + o, s = mt(i, e);
|
|
714
|
+
null !== s && s.text === i && (l.append(t), Nt(l, e, n, r), n(null, l.getURL()));
|
|
696
715
|
}
|
|
697
716
|
}
|
|
698
717
|
var u;
|
|
699
|
-
!
|
|
718
|
+
!et(s) || s.getIsUnlinked() || kt(o, r) || s.is(t.getNextSibling()) && t.getParent() === s.getParent() && (Ot(s), n(null, s.getURL()));
|
|
700
719
|
}
|
|
701
|
-
})(t, n,
|
|
720
|
+
})(t, n, s, l);
|
|
702
721
|
}
|
|
703
|
-
}), t.registerCommand(
|
|
722
|
+
}), t.registerCommand(nt, (t) => {
|
|
704
723
|
const e = $getSelection();
|
|
705
724
|
if (null !== t || !$isRangeSelection(e)) return !1;
|
|
706
725
|
return e.extract().forEach((t) => {
|
|
707
726
|
const e = t.getParent();
|
|
708
|
-
|
|
727
|
+
et(e) && (e.setIsUnlinked(!e.getIsUnlinked()), e.markDirty());
|
|
709
728
|
}), !1;
|
|
710
729
|
}, COMMAND_PRIORITY_LOW));
|
|
711
730
|
}
|
|
712
|
-
const
|
|
713
|
-
config:
|
|
714
|
-
dependencies: [
|
|
731
|
+
const yt = /* @__PURE__ */ defineExtension({
|
|
732
|
+
config: At,
|
|
733
|
+
dependencies: [at],
|
|
715
734
|
mergeConfig(t, e) {
|
|
716
735
|
const n = shallowMergeConfig(t, e);
|
|
717
736
|
for (const r of [
|
|
@@ -725,8 +744,8 @@ const St = /* @__PURE__ */ defineExtension({
|
|
|
725
744
|
return n;
|
|
726
745
|
},
|
|
727
746
|
name: "@lexical/link/AutoLink",
|
|
728
|
-
nodes: [
|
|
729
|
-
register:
|
|
747
|
+
nodes: [Y],
|
|
748
|
+
register: Pt
|
|
730
749
|
});
|
|
731
750
|
//#endregion
|
|
732
|
-
export {
|
|
751
|
+
export { tt as $createAutoLinkNode, V as $createLinkNode, et as $isAutoLinkNode, X as $isLinkNode, it as $toggleLink, yt as AutoLinkExtension, Y as AutoLinkNode, ft as ClickableLinkExtension, at as LinkExtension, ct as LinkImportExtension, ot as LinkImportRules, Z as LinkNode, nt as TOGGLE_LINK_COMMAND, _t as autoLinkEmailMatcher, pt as autoLinkUrlMatcher, dt as createLinkMatcherWithRegExp, st as formatUrl, Pt as registerAutoLink, gt as registerClickableLink, ut as registerLink };
|