@etrepum/lexical-builder-link 0.0.36-nightly.20250711.0 → 0.0.36

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.
@@ -27,6 +27,6 @@ export declare const DEFAULT_MATCHERS: ((text: string) => {
27
27
  url: string;
28
28
  } | null)[];
29
29
  export type AutoLinkOutput = DisabledToggleOutput;
30
- export declare const AutoLinkPlan: import('@etrepum/lexical-builder').LexicalPlan<AutoLinkConfig, "@etrepum/lexical-builder-link/AutoLink", DisabledToggleOutput, unknown>;
30
+ export declare const AutoLinkExtension: import('@etrepum/lexical-builder').LexicalExtension<AutoLinkConfig, "@etrepum/lexical-builder-link/AutoLink", DisabledToggleOutput, unknown>;
31
31
  export {};
32
- //# sourceMappingURL=AutoLinkPlan.d.ts.map
32
+ //# sourceMappingURL=AutoLinkExtension.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AutoLinkExtension.d.ts","sourceRoot":"","sources":["../src/AutoLinkExtension.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAqBxD,OAAO,EAGL,KAAK,oBAAoB,EAG1B,MAAM,0BAA0B,CAAC;AAIlC,KAAK,aAAa,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;AAE1E,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,iBAAiB,GAAG,IAAI,CAAC;AAErE,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,MAAM,EACd,cAAc,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAuB,UAE3C,MAAM;;;;;SAYrB;AAqYD,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,QAAQ,EAAE,aAAa,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAUD,eAAO,MAAM,gBAAgB,UA/Zb,MAAM;;;;;WAsarB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,oBAAoB,CAAC;AAElD,eAAO,MAAM,iBAAiB,8IA+D5B,CAAC"}
@@ -7,5 +7,5 @@ export interface ClickableLinkConfig {
7
7
  export interface ClickableLinkOutput extends DisabledToggleOutput {
8
8
  clickable: WritableStore<boolean>;
9
9
  }
10
- export declare const ClickableLinkPlan: import('@etrepum/lexical-builder').LexicalPlan<ClickableLinkConfig, "@etrepum/lexical-builder-link/ClickableLink", ClickableLinkOutput, unknown>;
11
- //# sourceMappingURL=ClickableLinkPlan.d.ts.map
10
+ export declare const ClickableLinkExtension: import('@etrepum/lexical-builder').LexicalExtension<ClickableLinkConfig, "@etrepum/lexical-builder-link/ClickableLink", ClickableLinkOutput, unknown>;
11
+ //# sourceMappingURL=ClickableLinkExtension.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClickableLinkExtension.d.ts","sourceRoot":"","sources":["../src/ClickableLinkExtension.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAGL,KAAK,oBAAoB,EAIzB,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAC;AA0BlC,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB;IAC/D,SAAS,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;CACnC;AAED,eAAO,MAAM,sBAAsB,uJAmGjC,CAAC"}
@@ -8,5 +8,5 @@ export interface LinkConfig {
8
8
  export interface LinkOutput extends DisabledToggleOutput {
9
9
  toggleLink: (payload: CommandPayloadType<typeof TOGGLE_LINK_COMMAND>) => void;
10
10
  }
11
- export declare const LinkPlan: import('@etrepum/lexical-builder').LexicalPlan<LinkConfig, "@etrepum/lexical-builder-link/Link", LinkOutput, unknown>;
12
- //# sourceMappingURL=LinkPlan.d.ts.map
11
+ export declare const LinkExtension: import('@etrepum/lexical-builder').LexicalExtension<LinkConfig, "@etrepum/lexical-builder-link/Link", LinkOutput, unknown>;
12
+ //# sourceMappingURL=LinkExtension.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinkExtension.d.ts","sourceRoot":"","sources":["../src/LinkExtension.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAGL,KAAK,oBAAoB,EAG1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAyB,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EAKL,KAAK,kBAAkB,EAExB,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,UAAU;IACzB,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IACvC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,UAAW,SAAQ,oBAAoB;IACtD,UAAU,EAAE,CAAC,OAAO,EAAE,kBAAkB,CAAC,OAAO,mBAAmB,CAAC,KAAK,IAAI,CAAC;CAC/E;AAED,eAAO,MAAM,aAAa,4HA8ExB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  *
7
7
  */
8
8
  export declare const PACKAGE_VERSION: string;
9
- export { type LinkConfig, type LinkOutput, LinkPlan } from './LinkPlan';
10
- export { type AutoLinkConfig, type AutoLinkOutput, AutoLinkPlan, } from './AutoLinkPlan';
11
- export { type ClickableLinkConfig, type ClickableLinkOutput, ClickableLinkPlan, } from './ClickableLinkPlan';
9
+ export { type LinkConfig, type LinkOutput, LinkExtension } from './LinkExtension';
10
+ export { type AutoLinkConfig, type AutoLinkOutput, AutoLinkExtension, } from './AutoLinkExtension';
11
+ export { type ClickableLinkConfig, type ClickableLinkOutput, ClickableLinkExtension, } from './ClickableLinkExtension';
12
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,eAAe,EAAE,MAAwC,CAAC;AAEvE,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,YAAY,GACb,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,eAAe,EAAE,MAAwC,CAAC;AAEvE,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAClF,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,sBAAsB,GACvB,MAAM,0BAA0B,CAAC"}
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { definePlan as $, safeCast as w, disabledToggle as D, provideOutput as R, Store as H } from "@etrepum/lexical-builder";
1
+ import { defineExtension 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 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 = $({
3
+ import { mergeRegister as z, 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 E, $isRangeSelection as C, $isElementNode as M, TextNode as ne, $isTextNode as b, $isLineBreakNode as W, $createTextNode as F, $isNodeSelection as re, getNearestEditorFromDOMNode as ie, $getNearestNodeFromDOMNode as se } from "lexical";
5
+ const y = $({
6
6
  name: "@etrepum/lexical-builder-link/Link",
7
7
  config: w({ disabled: !1 }),
8
8
  nodes: [X],
@@ -10,31 +10,31 @@ const W = $({
10
10
  const [n, r] = D({
11
11
  disabled: t.disabled,
12
12
  register() {
13
- const { validateUrl: o } = t;
14
- return y(
13
+ const { validateUrl: l } = t;
14
+ return z(
15
15
  e.registerCommand(
16
16
  k,
17
17
  (i) => {
18
18
  if (i === null)
19
19
  return _(i), !0;
20
20
  if (typeof i == "string")
21
- return o === void 0 || o(i) ? (_(i), !0) : !1;
22
- const { url: s, target: l, rel: c, title: u } = i;
23
- return _(s, { rel: c, target: l, title: u }), !0;
21
+ return l === void 0 || l(i) ? (_(i), !0) : !1;
22
+ const { url: s, target: o, rel: c, title: u } = i;
23
+ return _(s, { rel: c, target: o, title: u }), !0;
24
24
  },
25
25
  v
26
26
  ),
27
- o !== void 0 ? e.registerCommand(
27
+ l !== void 0 ? e.registerCommand(
28
28
  te,
29
29
  (i) => {
30
- const s = C();
31
- if (!E(s) || s.isCollapsed() || !J(i, ClipboardEvent))
30
+ const s = E();
31
+ if (!C(s) || s.isCollapsed() || !J(i, ClipboardEvent))
32
32
  return !1;
33
- const l = i;
34
- if (l.clipboardData === null)
33
+ const o = i;
34
+ if (o.clipboardData === null)
35
35
  return !1;
36
- const c = l.clipboardData.getData("text");
37
- return o(c) ? s.getNodes().some((u) => M(u)) ? !1 : (e.dispatchCommand(k, c), i.preventDefault(), !0) : !1;
36
+ const c = o.clipboardData.getData("text");
37
+ return l(c) ? s.getNodes().some((u) => M(u)) ? !1 : (e.dispatchCommand(k, c), i.preventDefault(), !0) : !1;
38
38
  },
39
39
  v
40
40
  ) : () => {
@@ -45,16 +45,16 @@ const W = $({
45
45
  return R(
46
46
  {
47
47
  ...n,
48
- toggleLink: (o) => e.dispatchCommand(k, o)
48
+ toggleLink: (l) => e.dispatchCommand(k, l)
49
49
  },
50
50
  r
51
51
  );
52
52
  }
53
53
  });
54
- function x(e, t, ...n) {
54
+ function L(e, t, ...n) {
55
55
  if (!e)
56
56
  throw new Error(
57
- n.reduce((r, o) => r.replace("%s", String(o)), t || "")
57
+ n.reduce((r, l) => r.replace("%s", String(l)), t || "")
58
58
  );
59
59
  }
60
60
  function V(e, t = (n) => n) {
@@ -76,9 +76,9 @@ function Z(e, t) {
76
76
  }
77
77
  return null;
78
78
  }
79
- const le = /[.,;\s]/;
79
+ const oe = /[.,;\s]/;
80
80
  function S(e) {
81
- return le.test(e);
81
+ return oe.test(e);
82
82
  }
83
83
  function B(e) {
84
84
  return S(e[e.length - 1]);
@@ -86,55 +86,55 @@ function B(e) {
86
86
  function O(e) {
87
87
  return S(e[0]);
88
88
  }
89
- function oe(e) {
89
+ function le(e) {
90
90
  return /^\.[a-zA-Z0-9]{1,}/.test(e);
91
91
  }
92
92
  function G(e) {
93
93
  let t = e.getPreviousSibling();
94
- return M(t) && (t = t.getLastDescendant()), t === null || z(t) || b(t) && B(t.getTextContent());
94
+ return M(t) && (t = t.getLastDescendant()), t === null || W(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 || z(t) || b(t) && O(t.getTextContent());
98
+ return M(t) && (t = t.getFirstDescendant()), t === null || W(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;
102
102
  }
103
103
  function ue(e, t, n) {
104
- const r = [], o = [], i = [];
105
- let s = 0, l = 0;
104
+ const r = [], l = [], i = [];
105
+ let s = 0, o = 0;
106
106
  const c = [...e];
107
107
  for (; c.length > 0; ) {
108
- const u = c[0], f = u.getTextContent().length, d = l;
109
- l + f <= t ? (r.push(u), s += f) : d >= n ? i.push(u) : o.push(u), l += f, c.shift();
108
+ const u = c[0], f = u.getTextContent().length, d = o;
109
+ o + f <= t ? (r.push(u), s += f) : d >= n ? i.push(u) : l.push(u), o += f, c.shift();
110
110
  }
111
111
  return [
112
112
  s,
113
113
  r,
114
- o,
114
+ l,
115
115
  i
116
116
  ];
117
117
  }
118
118
  function ae(e, t, n, r) {
119
- const o = Y(r.url, r.attributes);
119
+ const l = Y(r.url, r.attributes);
120
120
  if (e.length === 1) {
121
121
  let i = e[0], s;
122
- x(
122
+ L(
123
123
  i !== void 0,
124
124
  "$createAutoLinkNode_ remainingTextNode must be defined"
125
125
  ), t === 0 ? [s, i] = i.splitText(n) : [, s, i] = i.splitText(
126
126
  t,
127
127
  n
128
- ), x(
128
+ ), L(
129
129
  s !== void 0,
130
130
  "$createAutoLinkNode_ linkTextNode must be defined"
131
131
  );
132
- const l = F(r.text);
133
- return l.setFormat(s.getFormat()), l.setDetail(s.getDetail()), l.setStyle(s.getStyle()), o.append(l), s.replace(o), i;
132
+ const o = F(r.text);
133
+ return o.setFormat(s.getFormat()), o.setDetail(s.getDetail()), o.setStyle(s.getStyle()), l.append(o), s.replace(l), i;
134
134
  } else if (e.length > 1) {
135
135
  const i = e[0];
136
- let s = i.getTextContent().length, l;
137
- t === 0 ? l = i : [, l] = i.splitText(t);
136
+ let s = i.getTextContent().length, o;
137
+ t === 0 ? o = i : [, o] = i.splitText(t);
138
138
  const c = [];
139
139
  let u;
140
140
  for (let g = 1; g < e.length; g++) {
@@ -146,53 +146,53 @@ function ae(e, t, n, r) {
146
146
  const [P, j] = p.splitText(
147
147
  n - h
148
148
  );
149
- x(
149
+ L(
150
150
  P !== void 0,
151
151
  "$createAutoLinkNode_ linkTextNode must be defined"
152
152
  ), c.push(P), u = j;
153
153
  }
154
154
  s += m;
155
155
  }
156
- const a = C(), f = a ? a.getNodes().find(b) : void 0;
157
- x(
158
- l !== void 0,
156
+ const a = E(), f = a ? a.getNodes().find(b) : void 0;
157
+ L(
158
+ o !== void 0,
159
159
  "$createAutoLinkNode_ firstLinkTextNode must be defined"
160
160
  );
161
- const d = F(l.getTextContent());
162
- return d.setFormat(l.getFormat()), d.setDetail(l.getDetail()), d.setStyle(l.getStyle()), o.append(d, ...c), f && f === l && (E(a) ? d.select(a.anchor.offset, a.focus.offset) : re(a) && d.select(0, d.getTextContent().length)), l.replace(o), u;
161
+ const d = F(o.getTextContent());
162
+ return d.setFormat(o.getFormat()), d.setDetail(o.getDetail()), d.setStyle(o.getStyle()), l.append(d, ...c), f && f === o && (C(a) ? d.select(a.anchor.offset, a.focus.offset) : re(a) && d.select(0, d.getTextContent().length)), o.replace(l), u;
163
163
  }
164
164
  }
165
165
  function de(e, t, n) {
166
166
  let r = [...e];
167
- const o = r.map((c) => c.getTextContent()).join("");
168
- let i = o, s, l = 0;
167
+ const l = r.map((c) => c.getTextContent()).join("");
168
+ let i = l, s, o = 0;
169
169
  for (; s = Z(i, t); ) {
170
170
  const c = s.index, u = s.length, a = c + u;
171
171
  if (ce(
172
- l + c,
173
- l + a,
174
- o,
172
+ o + c,
173
+ o + a,
174
+ l,
175
175
  r
176
176
  )) {
177
177
  const [d, , g, p] = ue(
178
178
  r,
179
- l + c,
180
- l + a
181
- ), L = l + c - d, m = l + a - d, h = ae(
179
+ o + c,
180
+ o + a
181
+ ), x = o + c - d, m = o + a - d, h = ae(
182
182
  g,
183
- L,
183
+ x,
184
184
  m,
185
185
  s
186
186
  );
187
- r = h ? [h, ...p] : p, n(s.url, null), l = 0;
187
+ r = h ? [h, ...p] : p, n(s.url, null), o = 0;
188
188
  } else
189
- l += a;
189
+ o += a;
190
190
  i = i.substring(a);
191
191
  }
192
192
  }
193
193
  function U(e, t, n) {
194
- const r = e.getChildren(), o = r.length;
195
- for (let c = 0; c < o; c++) {
194
+ const r = e.getChildren(), l = r.length;
195
+ for (let c = 0; c < l; c++) {
196
196
  const u = r[c];
197
197
  if (!b(u) || !u.isSimpleText()) {
198
198
  A(e), n(null, e.getURL());
@@ -208,8 +208,8 @@ function U(e, t, n) {
208
208
  A(e), n(null, e.getURL());
209
209
  return;
210
210
  }
211
- const l = e.getURL();
212
- if (l !== s.url && (e.setURL(s.url), n(s.url, l)), s.attributes) {
211
+ const o = e.getURL();
212
+ if (o !== s.url && (e.setURL(s.url), n(s.url, o)), s.attributes) {
213
213
  const c = e.getRel();
214
214
  c !== s.attributes.rel && (e.setRel(s.attributes.rel || null), n(s.attributes.rel || null, c));
215
215
  const u = e.getTarget();
@@ -217,8 +217,8 @@ function U(e, t, n) {
217
217
  }
218
218
  }
219
219
  function fe(e, t, n) {
220
- const r = e.getPreviousSibling(), o = e.getNextSibling(), i = e.getTextContent();
221
- T(r) && !r.getIsUnlinked() && (!O(i) || oe(i)) && (r.append(e), U(r, t, n), n(null, r.getURL())), T(o) && !o.getIsUnlinked() && !B(i) && (A(o), U(o, t, n), n(null, o.getURL()));
220
+ const r = e.getPreviousSibling(), l = e.getNextSibling(), i = e.getTextContent();
221
+ T(r) && !r.getIsUnlinked() && (!O(i) || le(i)) && (r.append(e), U(r, t, n), n(null, r.getURL())), T(l) && !l.getIsUnlinked() && !B(i) && (A(l), U(l, t, n), n(null, l.getURL()));
222
222
  }
223
223
  function A(e) {
224
224
  const t = e.getChildren(), n = t.length;
@@ -244,7 +244,7 @@ const he = (
244
244
  V(pe, (e) => `mailto:${e}`)
245
245
  ], ke = $({
246
246
  name: "@etrepum/lexical-builder-link/AutoLink",
247
- dependencies: [W],
247
+ dependencies: [y],
248
248
  nodes: [q],
249
249
  config: w({
250
250
  matchers: me,
@@ -258,25 +258,25 @@ const he = (
258
258
  disabled: t.disabled,
259
259
  register() {
260
260
  const { matchers: n, onChange: r } = t;
261
- return y(
262
- e.registerNodeTransform(ne, (o) => {
263
- const i = o.getParentOrThrow(), s = o.getPreviousSibling();
261
+ return z(
262
+ e.registerNodeTransform(ne, (l) => {
263
+ const i = l.getParentOrThrow(), s = l.getPreviousSibling();
264
264
  if (T(i) && !i.getIsUnlinked())
265
265
  U(i, n, r);
266
266
  else if (!I(i)) {
267
- if (o.isSimpleText() && (O(o.getTextContent()) || !T(s))) {
268
- const l = ge(o);
269
- de(l, n, r);
267
+ if (l.isSimpleText() && (O(l.getTextContent()) || !T(s))) {
268
+ const o = ge(l);
269
+ de(o, n, r);
270
270
  }
271
- fe(o, n, r);
271
+ fe(l, n, r);
272
272
  }
273
273
  }),
274
274
  e.registerCommand(
275
275
  k,
276
- (o) => {
277
- const i = C();
278
- return o !== null || !E(i) || i.extract().forEach((l) => {
279
- const c = l.getParent();
276
+ (l) => {
277
+ const i = E();
278
+ return l !== null || !C(i) || i.extract().forEach((o) => {
279
+ const c = o.getParent();
280
280
  if (T(c))
281
281
  return c.setIsUnlinked(!c.getIsUnlinked()), c.markDirty(), !0;
282
282
  }), !1;
@@ -300,17 +300,17 @@ function Ne(e, t) {
300
300
  }
301
301
  const Ae = $({
302
302
  name: "@etrepum/lexical-builder-link/ClickableLink",
303
- dependencies: [W],
303
+ dependencies: [y],
304
304
  config: w({
305
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] = D({
310
+ const r = new H(t.clickable), [l, i] = D({
311
311
  disabled: t.disabled,
312
312
  register() {
313
- const { newTab: s } = t, l = (u) => {
313
+ const { newTab: s } = t, o = (u) => {
314
314
  const a = u.target;
315
315
  if (!(a instanceof Node))
316
316
  return;
@@ -335,34 +335,34 @@ const Ae = $({
335
335
  }
336
336
  }), d === null || d === "")
337
337
  return;
338
- const p = e.getEditorState().read(C);
339
- if (E(p) && !p.isCollapsed()) {
338
+ const p = e.getEditorState().read(E);
339
+ if (C(p) && !p.isCollapsed()) {
340
340
  u.preventDefault();
341
341
  return;
342
342
  }
343
- const L = u.type === "auxclick" && u.button === 1;
343
+ const x = u.type === "auxclick" && u.button === 1;
344
344
  window.open(
345
345
  d,
346
- s || L || u.metaKey || u.ctrlKey || // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- false positive
346
+ s || x || u.metaKey || u.ctrlKey || // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- false positive
347
347
  g === "_blank" ? "_blank" : "_self"
348
348
  ), u.preventDefault();
349
349
  }, c = (u) => {
350
- u.button === 1 && l(u);
350
+ u.button === 1 && o(u);
351
351
  };
352
352
  return e.registerRootListener((u, a) => {
353
- a !== null && (a.removeEventListener("click", l), a.removeEventListener("mouseup", c)), u !== null && (u.addEventListener("click", l), u.addEventListener("mouseup", c));
353
+ a !== null && (a.removeEventListener("click", o), a.removeEventListener("mouseup", c)), u !== null && (u.addEventListener("click", o), u.addEventListener("mouseup", c));
354
354
  });
355
355
  }
356
356
  });
357
357
  return R(
358
- { ...o, clickable: r },
358
+ { ...l, clickable: r },
359
359
  i
360
360
  );
361
361
  }
362
- }), Se = "0.0.36-nightly.20250711.0";
362
+ }), Se = "0.0.36";
363
363
  export {
364
- ke as AutoLinkPlan,
365
- Ae as ClickableLinkPlan,
366
- W as LinkPlan,
364
+ ke as AutoLinkExtension,
365
+ Ae as ClickableLinkExtension,
366
+ y as LinkExtension,
367
367
  Se as PACKAGE_VERSION
368
368
  };
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "lexical",
7
7
  "lexical-builder",
8
8
  "plug-in",
9
- "plan"
9
+ "extension"
10
10
  ],
11
11
  "scripts": {
12
12
  "build": "tsc --noEmit && vite build",
@@ -15,7 +15,7 @@
15
15
  "test:watch": "vitest",
16
16
  "lint": "eslint"
17
17
  },
18
- "version": "0.0.36-nightly.20250711.0",
18
+ "version": "0.0.36",
19
19
  "license": "MIT",
20
20
  "repository": {
21
21
  "type": "git",
@@ -30,9 +30,9 @@
30
30
  "@etrepum/lexical-builder": "*"
31
31
  },
32
32
  "peerDependencies": {
33
- "@lexical/link": ">=0.31.0 || >=0.31.1-nightly.0",
34
- "@lexical/utils": ">=0.31.0 || >=0.31.1-nightly.0",
35
- "lexical": ">=0.31.0 || >=0.31.1-nightly.0"
33
+ "@lexical/link": ">=0.33.1 || >=0.33.2-nightly.0",
34
+ "@lexical/utils": ">=0.33.1 || >=0.33.2-nightly.0",
35
+ "lexical": ">=0.33.1 || >=0.33.2-nightly.0"
36
36
  },
37
37
  "sideEffects": false,
38
38
  "devDependencies": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"AutoLinkPlan.d.ts","sourceRoot":"","sources":["../src/AutoLinkPlan.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAqBxD,OAAO,EAGL,KAAK,oBAAoB,EAG1B,MAAM,0BAA0B,CAAC;AAIlC,KAAK,aAAa,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;AAE1E,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,iBAAiB,GAAG,IAAI,CAAC;AAErE,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,MAAM,EACd,cAAc,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAuB,UAE3C,MAAM;;;;;SAYrB;AAqYD,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,QAAQ,EAAE,aAAa,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAUD,eAAO,MAAM,gBAAgB,UA/Zb,MAAM;;;;;WAsarB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,oBAAoB,CAAC;AAElD,eAAO,MAAM,YAAY,yIA+DvB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ClickableLinkPlan.d.ts","sourceRoot":"","sources":["../src/ClickableLinkPlan.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAGL,KAAK,oBAAoB,EAIzB,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAC;AA0BlC,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,mBAAoB,SAAQ,oBAAoB;IAC/D,SAAS,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;CACnC;AAED,eAAO,MAAM,iBAAiB,kJAmG5B,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"LinkPlan.d.ts","sourceRoot":"","sources":["../src/LinkPlan.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAGL,KAAK,oBAAoB,EAG1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAyB,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAE3E,OAAO,EAKL,KAAK,kBAAkB,EAExB,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,UAAU;IACzB,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IACvC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,UAAW,SAAQ,oBAAoB;IACtD,UAAU,EAAE,CAAC,OAAO,EAAE,kBAAkB,CAAC,OAAO,mBAAmB,CAAC,KAAK,IAAI,CAAC;CAC/E;AAED,eAAO,MAAM,QAAQ,uHA8EnB,CAAC"}