@etrepum/lexical-builder-link 0.0.27

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 ADDED
@@ -0,0 +1,3 @@
1
+ # `@etrepum/lexical-builder-link`
2
+
3
+ **EXPERIMENTAL** Lexical Builder Link
@@ -0,0 +1,35 @@
1
+ import { AutoLinkAttributes } from '@lexical/link';
2
+
3
+ type ChangeHandler = (url: string | null, prevUrl: string | null) => void;
4
+ export interface LinkMatcherResult {
5
+ attributes?: AutoLinkAttributes;
6
+ index: number;
7
+ length: number;
8
+ text: string;
9
+ url: string;
10
+ }
11
+ export type LinkMatcher = (text: string) => LinkMatcherResult | null;
12
+ export declare function createLinkMatcherWithRegExp(regExp: RegExp, urlTransformer?: (text: string) => string): (text: string) => {
13
+ index: number;
14
+ length: number;
15
+ text: string;
16
+ url: string;
17
+ } | null;
18
+ export interface AutoLinkConfig {
19
+ matchers: LinkMatcher[];
20
+ onChange: ChangeHandler;
21
+ disabled: boolean;
22
+ }
23
+ export declare const DEFAULT_MATCHERS: ((text: string) => {
24
+ index: number;
25
+ length: number;
26
+ text: string;
27
+ url: string;
28
+ } | null)[];
29
+ export interface AutoLinkOutput {
30
+ isDisabled: () => boolean;
31
+ setDisabled: (disabled: boolean) => void;
32
+ }
33
+ export declare const AutoLinkPlan: import('@etrepum/lexical-builder').LexicalPlan<AutoLinkConfig, "@etrepum/lexical-builder-link/AutoLink", AutoLinkOutput, unknown>;
34
+ export {};
35
+ //# sourceMappingURL=AutoLinkPlan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AutoLinkPlan.d.ts","sourceRoot":"","sources":["../src/AutoLinkPlan.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AA+BxD,KAAK,aAAa,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;AAG1E,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;AAQD,eAAO,MAAM,gBAAgB,UA7Zb,MAAM;;;;;WAoarB,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,OAAO,CAAC;IAC1B,WAAW,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C;AAED,eAAO,MAAM,YAAY,mIA6DvB,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ export interface ClickableLinkConfig {
9
+ newTab: boolean;
10
+ disabled: boolean;
11
+ clickable: boolean;
12
+ }
13
+ export interface ClickableLinkOutput {
14
+ isDisabled: () => boolean;
15
+ setDisabled: (disabled: boolean) => void;
16
+ isClickable: () => boolean;
17
+ setClickable: (clickable: boolean) => void;
18
+ }
19
+ export declare const ClickableLinkPlan: import('@etrepum/lexical-builder').LexicalPlan<ClickableLinkConfig, "@etrepum/lexical-builder-link/ClickableLink", ClickableLinkOutput, unknown>;
20
+ //# sourceMappingURL=ClickableLinkPlan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ClickableLinkPlan.d.ts","sourceRoot":"","sources":["../src/ClickableLinkPlan.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAiCH,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,OAAO,CAAC;IAC1B,WAAW,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;IACzC,WAAW,EAAE,MAAM,OAAO,CAAC;IAC3B,YAAY,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5C;AAED,eAAO,MAAM,iBAAiB,kJAqG5B,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { TOGGLE_LINK_COMMAND } from '@lexical/link';
2
+ import { CommandPayloadType } from 'lexical';
3
+
4
+ export interface LinkConfig {
5
+ validateUrl?: (url: string) => boolean;
6
+ disabled: boolean;
7
+ }
8
+ export interface LinkOutput {
9
+ toggleLink: (payload: CommandPayloadType<typeof TOGGLE_LINK_COMMAND>) => void;
10
+ isDisabled: () => boolean;
11
+ setDisabled: (disabled: boolean) => void;
12
+ }
13
+ export declare const LinkPlan: import('@etrepum/lexical-builder').LexicalPlan<LinkConfig, "@etrepum/lexical-builder-link/LinkPlan", LinkOutput, unknown>;
14
+ //# sourceMappingURL=LinkPlan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinkPlan.d.ts","sourceRoot":"","sources":["../src/LinkPlan.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAQH,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,UAAU;IACzB,UAAU,EAAE,CAAC,OAAO,EAAE,kBAAkB,CAAC,OAAO,mBAAmB,CAAC,KAAK,IAAI,CAAC;IAC9E,UAAU,EAAE,MAAM,OAAO,CAAC;IAC1B,WAAW,EAAE,CAAC,QAAQ,EAAE,OAAO,KAAK,IAAI,CAAC;CAC1C;AAED,eAAO,MAAM,QAAQ,2HA8EnB,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
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';
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +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"}
package/dist/index.js ADDED
@@ -0,0 +1,368 @@
1
+ import { definePlan as R, safeCast as w, disabledToggle as O, provideOutput as P } from "@etrepum/lexical-builder";
2
+ import { LinkNode as H, TOGGLE_LINK_COMMAND as S, $toggleLink as U, AutoLinkNode as X, $isAutoLinkNode as L, $isLinkNode as z, $createAutoLinkNode as q } from "@lexical/link";
3
+ import { mergeRegister as W, objectKlassEquals as Y, $findMatchingParent as J, isHTMLAnchorElement as Q } from "@lexical/utils";
4
+ import { COMMAND_PRIORITY_LOW as $, PASTE_COMMAND as ee, $getSelection as M, $isRangeSelection as _, $isElementNode as v, TextNode as te, $isTextNode as x, $isLineBreakNode as Z, $createTextNode as V, $isNodeSelection as ne, getNearestEditorFromDOMNode as re, $getNearestNodeFromDOMNode as ie } from "lexical";
5
+ const y = R({
6
+ name: "@etrepum/lexical-builder-link/LinkPlan",
7
+ config: w({ disabled: !1 }),
8
+ nodes: [H],
9
+ register(e, t) {
10
+ const [n, r] = O({
11
+ disabled: t.disabled,
12
+ register() {
13
+ const { validateUrl: o } = t;
14
+ return W(
15
+ e.registerCommand(
16
+ S,
17
+ (i) => {
18
+ if (i === null)
19
+ return U(i), !0;
20
+ if (typeof i == "string")
21
+ return o === void 0 || o(i) ? (U(i), !0) : !1;
22
+ {
23
+ const { url: s, target: l, rel: c, title: u } = i;
24
+ return U(s, { rel: c, target: l, title: u }), !0;
25
+ }
26
+ },
27
+ $
28
+ ),
29
+ o !== void 0 ? e.registerCommand(
30
+ ee,
31
+ (i) => {
32
+ const s = M();
33
+ if (!_(s) || s.isCollapsed() || !Y(i, ClipboardEvent))
34
+ return !1;
35
+ const l = i;
36
+ if (l.clipboardData === null)
37
+ return !1;
38
+ const c = l.clipboardData.getData("text");
39
+ return o(c) ? s.getNodes().some((u) => v(u)) ? !1 : (e.dispatchCommand(S, c), i.preventDefault(), !0) : !1;
40
+ },
41
+ $
42
+ ) : () => {
43
+ }
44
+ );
45
+ }
46
+ });
47
+ return P(
48
+ {
49
+ ...n,
50
+ toggleLink: (o) => e.dispatchCommand(S, o)
51
+ },
52
+ r
53
+ );
54
+ }
55
+ });
56
+ function A(e, t, ...n) {
57
+ if (!e)
58
+ throw new Error(
59
+ n.reduce((r, o) => r.replace("%s", String(o)), t || "")
60
+ );
61
+ }
62
+ function I(e, t = (n) => n) {
63
+ return (n) => {
64
+ const r = e.exec(n);
65
+ return r === null ? null : {
66
+ index: r.index,
67
+ length: r[0].length,
68
+ text: r[0],
69
+ url: t(r[0])
70
+ };
71
+ };
72
+ }
73
+ function B(e, t) {
74
+ for (const n of t) {
75
+ const r = n(e);
76
+ if (r)
77
+ return r;
78
+ }
79
+ return null;
80
+ }
81
+ const se = /[.,;\s]/;
82
+ function E(e) {
83
+ return se.test(e);
84
+ }
85
+ function G(e) {
86
+ return E(e[e.length - 1]);
87
+ }
88
+ function F(e) {
89
+ return E(e[0]);
90
+ }
91
+ function le(e) {
92
+ return /^\.[a-zA-Z0-9]{1,}/.test(e);
93
+ }
94
+ function K(e) {
95
+ let t = e.getPreviousSibling();
96
+ return v(t) && (t = t.getLastDescendant()), t === null || Z(t) || x(t) && G(t.getTextContent());
97
+ }
98
+ function j(e) {
99
+ let t = e.getNextSibling();
100
+ return v(t) && (t = t.getFirstDescendant()), t === null || Z(t) || x(t) && F(t.getTextContent());
101
+ }
102
+ function oe(e, t, n, r) {
103
+ return (e > 0 ? E(n[e - 1]) : K(r[0])) ? t < n.length ? E(n[t]) : j(r[r.length - 1]) : !1;
104
+ }
105
+ function ce(e, t, n) {
106
+ const r = [], o = [], i = [];
107
+ let s = 0, l = 0;
108
+ const c = [...e];
109
+ for (; c.length > 0; ) {
110
+ const u = c[0], a = u.getTextContent().length, d = l;
111
+ l + a <= t ? (r.push(u), s += a) : d >= n ? i.push(u) : o.push(u), l += a, c.shift();
112
+ }
113
+ return [
114
+ s,
115
+ r,
116
+ o,
117
+ i
118
+ ];
119
+ }
120
+ function ue(e, t, n, r) {
121
+ const o = q(r.url, r.attributes);
122
+ if (e.length === 1) {
123
+ let i = e[0], s;
124
+ A(
125
+ i !== void 0,
126
+ "$createAutoLinkNode_ remainingTextNode must be defined"
127
+ ), t === 0 ? [s, i] = i.splitText(n) : [, s, i] = i.splitText(
128
+ t,
129
+ n
130
+ ), A(
131
+ s !== void 0,
132
+ "$createAutoLinkNode_ linkTextNode must be defined"
133
+ );
134
+ const l = V(r.text);
135
+ return l.setFormat(s.getFormat()), l.setDetail(s.getDetail()), l.setStyle(s.getStyle()), o.append(l), s.replace(o), i;
136
+ } else if (e.length > 1) {
137
+ const i = e[0];
138
+ let s = i.getTextContent().length, l;
139
+ t === 0 ? l = i : [, l] = i.splitText(t);
140
+ const c = [];
141
+ let u;
142
+ for (let h = 1; h < e.length; h++) {
143
+ const g = e[h], p = g.getTextContent().length, m = s, k = s + p;
144
+ if (m < n)
145
+ if (k <= n)
146
+ c.push(g);
147
+ else {
148
+ const [N, b] = g.splitText(
149
+ n - m
150
+ );
151
+ A(
152
+ N !== void 0,
153
+ "$createAutoLinkNode_ linkTextNode must be defined"
154
+ ), c.push(N), u = b;
155
+ }
156
+ s += p;
157
+ }
158
+ const f = M(), a = f ? f.getNodes().find(x) : void 0;
159
+ A(
160
+ l !== void 0,
161
+ "$createAutoLinkNode_ firstLinkTextNode must be defined"
162
+ );
163
+ const d = V(l.getTextContent());
164
+ return d.setFormat(l.getFormat()), d.setDetail(l.getDetail()), d.setStyle(l.getStyle()), o.append(d, ...c), a && a === l && (_(f) ? d.select(f.anchor.offset, f.focus.offset) : ne(f) && d.select(0, d.getTextContent().length)), l.replace(o), u;
165
+ }
166
+ }
167
+ function ae(e, t, n) {
168
+ let r = [...e];
169
+ const o = r.map((c) => c.getTextContent()).join("");
170
+ let i = o, s, l = 0;
171
+ for (; (s = B(i, t)) && s !== null; ) {
172
+ const c = s.index, u = s.length, f = c + u;
173
+ if (oe(
174
+ l + c,
175
+ l + f,
176
+ o,
177
+ r
178
+ )) {
179
+ const [d, , h, g] = ce(
180
+ r,
181
+ l + c,
182
+ l + f
183
+ ), T = l + c - d, p = l + f - d, m = ue(
184
+ h,
185
+ T,
186
+ p,
187
+ s
188
+ );
189
+ r = m ? [m, ...g] : g, n(s.url, null), l = 0;
190
+ } else
191
+ l += f;
192
+ i = i.substring(f);
193
+ }
194
+ }
195
+ function D(e, t, n) {
196
+ const r = e.getChildren(), o = r.length;
197
+ for (let c = 0; c < o; c++) {
198
+ const u = r[c];
199
+ if (!x(u) || !u.isSimpleText()) {
200
+ C(e), n(null, e.getURL());
201
+ return;
202
+ }
203
+ }
204
+ const i = e.getTextContent(), s = B(i, t);
205
+ if (s === null || s.text !== i) {
206
+ C(e), n(null, e.getURL());
207
+ return;
208
+ }
209
+ if (!K(e) || !j(e)) {
210
+ C(e), n(null, e.getURL());
211
+ return;
212
+ }
213
+ const l = e.getURL();
214
+ if (l !== s.url && (e.setURL(s.url), n(s.url, l)), s.attributes) {
215
+ const c = e.getRel();
216
+ c !== s.attributes.rel && (e.setRel(s.attributes.rel || null), n(s.attributes.rel || null, c));
217
+ const u = e.getTarget();
218
+ u !== s.attributes.target && (e.setTarget(s.attributes.target || null), n(s.attributes.target || null, u));
219
+ }
220
+ }
221
+ function de(e, t, n) {
222
+ const r = e.getPreviousSibling(), o = e.getNextSibling(), i = e.getTextContent();
223
+ L(r) && !r.getIsUnlinked() && (!F(i) || le(i)) && (r.append(e), D(r, t, n), n(null, r.getURL())), L(o) && !o.getIsUnlinked() && !G(i) && (C(o), D(o, t, n), n(null, o.getURL()));
224
+ }
225
+ function C(e) {
226
+ const t = e.getChildren(), n = t.length;
227
+ for (let r = n - 1; r >= 0; r--)
228
+ e.insertAfter(t[r]);
229
+ return e.remove(), t.map((r) => r.getLatest());
230
+ }
231
+ function fe(e) {
232
+ const t = [e];
233
+ let n = e.getNextSibling();
234
+ for (; n !== null && x(n) && n.isSimpleText() && (t.push(n), !/[\s]/.test(n.getTextContent())); )
235
+ n = n.getNextSibling();
236
+ return t;
237
+ }
238
+ const ge = new RegExp("((https?:\\/\\/(www\\.)?)|(www\\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)(?<![-.+():%])"), he = /(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/, pe = [
239
+ I(ge, (e) => e.startsWith("http") ? e : `https://${e}`),
240
+ I(he, (e) => `mailto:${e}`)
241
+ ], xe = R({
242
+ name: "@etrepum/lexical-builder-link/AutoLink",
243
+ dependencies: [y],
244
+ nodes: [X],
245
+ config: w({
246
+ matchers: pe,
247
+ onChange: (e, t) => {
248
+ },
249
+ disabled: !1
250
+ }),
251
+ register(e, t) {
252
+ return P(
253
+ ...O({
254
+ disabled: t.disabled,
255
+ register() {
256
+ const { matchers: n, onChange: r } = t;
257
+ return W(
258
+ e.registerNodeTransform(te, (o) => {
259
+ const i = o.getParentOrThrow(), s = o.getPreviousSibling();
260
+ if (L(i) && !i.getIsUnlinked())
261
+ D(i, n, r);
262
+ else if (!z(i)) {
263
+ if (o.isSimpleText() && (F(o.getTextContent()) || !L(s))) {
264
+ const l = fe(o);
265
+ ae(l, n, r);
266
+ }
267
+ de(o, n, r);
268
+ }
269
+ }),
270
+ e.registerCommand(
271
+ S,
272
+ (o) => {
273
+ const i = M();
274
+ return o !== null || !_(i) || i.extract().forEach((l) => {
275
+ const c = l.getParent();
276
+ if (L(c))
277
+ return c.setIsUnlinked(!c.getIsUnlinked()), c.markDirty(), !0;
278
+ }), !1;
279
+ },
280
+ $
281
+ )
282
+ );
283
+ }
284
+ })
285
+ );
286
+ }
287
+ });
288
+ function me(e, t) {
289
+ let n = e;
290
+ for (; n != null; ) {
291
+ if (t(n))
292
+ return n;
293
+ n = n.parentNode;
294
+ }
295
+ return null;
296
+ }
297
+ const ke = R({
298
+ name: "@etrepum/lexical-builder-link/ClickableLink",
299
+ dependencies: [y],
300
+ config: w({
301
+ disabled: !1,
302
+ newTab: !0,
303
+ clickable: !0
304
+ }),
305
+ register(e, t, n) {
306
+ let { clickable: r } = t;
307
+ const o = () => r;
308
+ function i(c) {
309
+ r = c;
310
+ }
311
+ const [s, l] = O({
312
+ disabled: t.disabled,
313
+ register() {
314
+ const { newTab: c } = t, u = (a) => {
315
+ const d = a.target;
316
+ if (!(d instanceof Node))
317
+ return;
318
+ const h = re(d);
319
+ if (h === null)
320
+ return;
321
+ let g = null, T = null;
322
+ if (h.update(() => {
323
+ const k = ie(d);
324
+ if (k !== null) {
325
+ const N = J(
326
+ k,
327
+ v
328
+ );
329
+ if (r)
330
+ if (z(N))
331
+ g = N.sanitizeUrl(N.getURL()), T = N.getTarget();
332
+ else {
333
+ const b = me(d, Q);
334
+ b !== null && (g = b.href, T = b.target);
335
+ }
336
+ }
337
+ }), g === null || g === "")
338
+ return;
339
+ const p = e.getEditorState().read(M);
340
+ if (_(p) && !p.isCollapsed()) {
341
+ a.preventDefault();
342
+ return;
343
+ }
344
+ const m = a.type === "auxclick" && a.button === 1;
345
+ window.open(
346
+ g,
347
+ c || m || a.metaKey || a.ctrlKey || T === "_blank" ? "_blank" : "_self"
348
+ ), a.preventDefault();
349
+ }, f = (a) => {
350
+ a.button === 1 && u(a);
351
+ };
352
+ return e.registerRootListener((a, d) => {
353
+ d !== null && (d.removeEventListener("click", u), d.removeEventListener("mouseup", f)), a !== null && (a.addEventListener("click", u), a.addEventListener("mouseup", f));
354
+ });
355
+ }
356
+ });
357
+ return P(
358
+ { ...s, isClickable: o, setClickable: i },
359
+ l
360
+ );
361
+ }
362
+ }), Ae = "0.0.27";
363
+ export {
364
+ xe as AutoLinkPlan,
365
+ ke as ClickableLinkPlan,
366
+ y as LinkPlan,
367
+ Ae as PACKAGE_VERSION
368
+ };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ *
7
+ */
8
+ export default function invariant(cond?: boolean, message?: string, ...args: string[]): asserts cond;
9
+ //# sourceMappingURL=invariant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invariant.d.ts","sourceRoot":"","sources":["../../src/shared/invariant.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,MAAM,CAAC,OAAO,UAAU,SAAS,CAC/B,IAAI,CAAC,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,MAAM,EAChB,GAAG,IAAI,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,IAAI,CAQd"}
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@etrepum/lexical-builder-link",
3
+ "description": "[EXPERIMENTAL] Lexical Builder @etrepum/lexical-builder-link",
4
+ "type": "module",
5
+ "keywords": [
6
+ "lexical",
7
+ "lexical-builder",
8
+ "plug-in",
9
+ "plan"
10
+ ],
11
+ "scripts": {
12
+ "build": "tsc --noEmit && vite build",
13
+ "dev": "vite",
14
+ "test": "vitest run",
15
+ "test:watch": "vitest",
16
+ "lint": "eslint"
17
+ },
18
+ "version": "0.0.27",
19
+ "license": "MIT",
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/etrepum/lexical-builder.git",
23
+ "directory": "packages/lexical-builder-link"
24
+ },
25
+ "bugs": {
26
+ "url": "https://github.com/etrepum/lexical-builder/issues"
27
+ },
28
+ "homepage": "https://github.com/etrepum/lexical-builder",
29
+ "dependencies": {
30
+ "@etrepum/lexical-builder": "*"
31
+ },
32
+ "peerDependencies": {
33
+ "lexical": ">=0.16.1-nightly.20240626",
34
+ "@lexical/link": ">=0.16.1-nightly.20240626"
35
+ },
36
+ "sideEffects": false,
37
+ "devDependencies": {
38
+ "@testing-library/dom": "^10.1.0",
39
+ "@testing-library/jest-dom": "^6.4.5",
40
+ "@testing-library/user-event": "^14.5.2",
41
+ "@repo/eslint-config": "*",
42
+ "eslint": "^8.57.0",
43
+ "jsdom": "^24.1.0",
44
+ "tslib": "^2.6.2",
45
+ "typescript": "^5.4.5",
46
+ "vite": "^5.2.11",
47
+ "vite-plugin-dts": "^3.9.1",
48
+ "vite-plugin-package-version": "^1.1.0",
49
+ "vitest": "^1.6.0"
50
+ },
51
+ "module": "dist/index.js",
52
+ "types": "dist/index.d.ts",
53
+ "files": [
54
+ "dist"
55
+ ]
56
+ }