@etrepum/lexical-builder-link 0.0.32-nightly.20240809.0 → 0.0.33-nightly.20240812.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/dist/index.js +22 -22
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { definePlan as $, safeCast as
|
|
1
|
+
import { definePlan as $, safeCast as w, disabledToggle as D, provideOutput as R, Store as H } from "@etrepum/lexical-builder";
|
|
2
2
|
import { LinkNode as X, TOGGLE_LINK_COMMAND as k, $toggleLink as _, AutoLinkNode as q, $isAutoLinkNode as T, $isLinkNode as I, $createAutoLinkNode as Y } from "@lexical/link";
|
|
3
|
-
import { mergeRegister as
|
|
4
|
-
import { COMMAND_PRIORITY_LOW as v, PASTE_COMMAND as te, $getSelection as C, $isRangeSelection as E, $isElementNode as M, TextNode as ne, $isTextNode as b, $isLineBreakNode as
|
|
5
|
-
const
|
|
3
|
+
import { mergeRegister as y, objectKlassEquals as J, $findMatchingParent as Q, isHTMLAnchorElement as ee } from "@lexical/utils";
|
|
4
|
+
import { COMMAND_PRIORITY_LOW as v, PASTE_COMMAND as te, $getSelection as C, $isRangeSelection as E, $isElementNode as M, TextNode as ne, $isTextNode as b, $isLineBreakNode as z, $createTextNode as F, $isNodeSelection as re, getNearestEditorFromDOMNode as ie, $getNearestNodeFromDOMNode as se } from "lexical";
|
|
5
|
+
const W = $({
|
|
6
6
|
name: "@etrepum/lexical-builder-link/Link",
|
|
7
|
-
config:
|
|
7
|
+
config: w({ disabled: !1 }),
|
|
8
8
|
nodes: [X],
|
|
9
9
|
register(e, t) {
|
|
10
|
-
const [n, r] =
|
|
10
|
+
const [n, r] = D({
|
|
11
11
|
disabled: t.disabled,
|
|
12
12
|
register() {
|
|
13
13
|
const { validateUrl: o } = t;
|
|
14
|
-
return
|
|
14
|
+
return y(
|
|
15
15
|
e.registerCommand(
|
|
16
16
|
k,
|
|
17
17
|
(i) => {
|
|
@@ -42,7 +42,7 @@ const y = $({
|
|
|
42
42
|
);
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
|
-
return
|
|
45
|
+
return R(
|
|
46
46
|
{
|
|
47
47
|
...n,
|
|
48
48
|
toggleLink: (o) => e.dispatchCommand(k, o)
|
|
@@ -91,11 +91,11 @@ function oe(e) {
|
|
|
91
91
|
}
|
|
92
92
|
function G(e) {
|
|
93
93
|
let t = e.getPreviousSibling();
|
|
94
|
-
return M(t) && (t = t.getLastDescendant()), t === null ||
|
|
94
|
+
return M(t) && (t = t.getLastDescendant()), t === null || z(t) || b(t) && B(t.getTextContent());
|
|
95
95
|
}
|
|
96
96
|
function K(e) {
|
|
97
97
|
let t = e.getNextSibling();
|
|
98
|
-
return M(t) && (t = t.getFirstDescendant()), t === null ||
|
|
98
|
+
return M(t) && (t = t.getFirstDescendant()), t === null || z(t) || b(t) && O(t.getTextContent());
|
|
99
99
|
}
|
|
100
100
|
function ce(e, t, n, r) {
|
|
101
101
|
return (e > 0 ? S(n[e - 1]) : G(r[0])) ? t < n.length ? S(n[t]) : K(r[r.length - 1]) : !1;
|
|
@@ -244,21 +244,21 @@ const he = (
|
|
|
244
244
|
V(pe, (e) => `mailto:${e}`)
|
|
245
245
|
], ke = $({
|
|
246
246
|
name: "@etrepum/lexical-builder-link/AutoLink",
|
|
247
|
-
dependencies: [
|
|
247
|
+
dependencies: [W],
|
|
248
248
|
nodes: [q],
|
|
249
|
-
config:
|
|
249
|
+
config: w({
|
|
250
250
|
matchers: me,
|
|
251
251
|
onChange: (e, t) => {
|
|
252
252
|
},
|
|
253
253
|
disabled: !1
|
|
254
254
|
}),
|
|
255
255
|
register(e, t) {
|
|
256
|
-
return
|
|
257
|
-
...
|
|
256
|
+
return R(
|
|
257
|
+
...D({
|
|
258
258
|
disabled: t.disabled,
|
|
259
259
|
register() {
|
|
260
260
|
const { matchers: n, onChange: r } = t;
|
|
261
|
-
return
|
|
261
|
+
return y(
|
|
262
262
|
e.registerNodeTransform(ne, (o) => {
|
|
263
263
|
const i = o.getParentOrThrow(), s = o.getPreviousSibling();
|
|
264
264
|
if (T(i) && !i.getIsUnlinked())
|
|
@@ -300,14 +300,14 @@ function Ne(e, t) {
|
|
|
300
300
|
}
|
|
301
301
|
const Ae = $({
|
|
302
302
|
name: "@etrepum/lexical-builder-link/ClickableLink",
|
|
303
|
-
dependencies: [
|
|
304
|
-
config:
|
|
305
|
-
disabled:
|
|
303
|
+
dependencies: [W],
|
|
304
|
+
config: w({
|
|
305
|
+
disabled: typeof window > "u",
|
|
306
306
|
newTab: !0,
|
|
307
307
|
clickable: !0
|
|
308
308
|
}),
|
|
309
309
|
register(e, t, n) {
|
|
310
|
-
const r = new H(t.clickable), [o, i] =
|
|
310
|
+
const r = new H(t.clickable), [o, i] = D({
|
|
311
311
|
disabled: t.disabled,
|
|
312
312
|
register() {
|
|
313
313
|
const { newTab: s } = t, l = (u) => {
|
|
@@ -354,15 +354,15 @@ const Ae = $({
|
|
|
354
354
|
});
|
|
355
355
|
}
|
|
356
356
|
});
|
|
357
|
-
return
|
|
357
|
+
return R(
|
|
358
358
|
{ ...o, clickable: r },
|
|
359
359
|
i
|
|
360
360
|
);
|
|
361
361
|
}
|
|
362
|
-
}), Se = "0.0.
|
|
362
|
+
}), Se = "0.0.33-nightly.20240812.0";
|
|
363
363
|
export {
|
|
364
364
|
ke as AutoLinkPlan,
|
|
365
365
|
Ae as ClickableLinkPlan,
|
|
366
|
-
|
|
366
|
+
W as LinkPlan,
|
|
367
367
|
Se as PACKAGE_VERSION
|
|
368
368
|
};
|