@etrepum/lexical-builder-markdown 0.0.25 → 0.0.26-nightly.20240625.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/index.js +18 -18
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -4,7 +4,7 @@ import { $createCodeNode as X } from "@lexical/code";
|
|
4
4
|
import { $isListNode as x, $isListItemNode as G } from "@lexical/list";
|
5
5
|
import { $isQuoteNode as U } from "@lexical/rich-text";
|
6
6
|
import { $findMatchingParent as H, IS_SAFARI as N, IS_IOS as E, IS_APPLE_WEBKIT as $ } from "@lexical/utils";
|
7
|
-
import { $getSelection as S, $setSelection as Q, $isParagraphNode as P, $isTextNode as p, $createParagraphNode as _, $isElementNode as
|
7
|
+
import { $getSelection as S, $setSelection as Q, $isParagraphNode as P, $isTextNode as p, $createParagraphNode as _, $isElementNode as g, $createTextNode as F, $createLineBreakNode as V, $isRootOrShadowRoot as Y, $getRoot as q, $isDecoratorNode as k, $isLineBreakNode as J } from "lexical";
|
8
8
|
const R = /[!-/:-@[-`{-~\s]/, Z = /^\s{0,3}$/;
|
9
9
|
function T(e) {
|
10
10
|
if (!P(e))
|
@@ -49,7 +49,7 @@ function te(e, t) {
|
|
49
49
|
const a = [];
|
50
50
|
for (let f = l.getFirstChild(); f; f = f.getNextSibling())
|
51
51
|
u(
|
52
|
-
|
52
|
+
g(f),
|
53
53
|
"markdownImport: Expected child of type %s to be an ElementNode",
|
54
54
|
f.getType()
|
55
55
|
), (r || !T(f)) && a.push(f);
|
@@ -66,7 +66,7 @@ function ne(e, t, n, i, s) {
|
|
66
66
|
break;
|
67
67
|
}
|
68
68
|
}
|
69
|
-
if (
|
69
|
+
if (m(
|
70
70
|
c,
|
71
71
|
i,
|
72
72
|
s
|
@@ -101,7 +101,7 @@ function oe(e, t, n) {
|
|
101
101
|
}
|
102
102
|
return [null, t];
|
103
103
|
}
|
104
|
-
function
|
104
|
+
function m(e, t, n) {
|
105
105
|
const i = e.getTextContent(), s = re(i, t);
|
106
106
|
if (!s) {
|
107
107
|
O(e, n);
|
@@ -129,15 +129,15 @@ function d(e, t, n) {
|
|
129
129
|
if (l)
|
130
130
|
for (const a of l.format)
|
131
131
|
r.hasFormat(a) || r.toggleFormat(a);
|
132
|
-
r.hasFormat("code") ||
|
132
|
+
r.hasFormat("code") || m(
|
133
133
|
r,
|
134
134
|
t,
|
135
135
|
n
|
136
|
-
), o &&
|
136
|
+
), o && m(
|
137
137
|
o,
|
138
138
|
t,
|
139
139
|
n
|
140
|
-
), c &&
|
140
|
+
), c && m(
|
141
141
|
c,
|
142
142
|
t,
|
143
143
|
n
|
@@ -241,21 +241,21 @@ function ce(e, t, n, i) {
|
|
241
241
|
for (const s of t) {
|
242
242
|
const r = s.export(
|
243
243
|
e,
|
244
|
-
(c) =>
|
244
|
+
(c) => d(c, n, i)
|
245
245
|
);
|
246
246
|
if (r != null)
|
247
247
|
return r;
|
248
248
|
}
|
249
|
-
return
|
249
|
+
return g(e) ? d(e, n, i) : k(e) ? e.getTextContent() : null;
|
250
250
|
}
|
251
|
-
function
|
251
|
+
function d(e, t, n) {
|
252
252
|
const i = [], s = e.getChildren();
|
253
253
|
e:
|
254
254
|
for (const r of s) {
|
255
255
|
for (const c of n) {
|
256
256
|
const o = c.export(
|
257
257
|
r,
|
258
|
-
(l) =>
|
258
|
+
(l) => d(
|
259
259
|
l,
|
260
260
|
t,
|
261
261
|
n
|
@@ -270,8 +270,8 @@ function g(e, t, n) {
|
|
270
270
|
J(r) ? i.push(`
|
271
271
|
`) : p(r) ? i.push(
|
272
272
|
C(r, r.getTextContent(), t)
|
273
|
-
) :
|
274
|
-
|
273
|
+
) : g(r) ? i.push(
|
274
|
+
d(r, t, n)
|
275
275
|
) : k(r) && i.push(r.getTextContent());
|
276
276
|
}
|
277
277
|
return i.join("");
|
@@ -303,7 +303,7 @@ function v(e, t) {
|
|
303
303
|
i.isInline() && (n = t ? i.getPreviousSibling() : i.getNextSibling());
|
304
304
|
}
|
305
305
|
for (; n; ) {
|
306
|
-
if (
|
306
|
+
if (g(n)) {
|
307
307
|
if (!n.isInline())
|
308
308
|
break;
|
309
309
|
const i = t ? n.getLastDescendant() : n.getFirstDescendant();
|
@@ -313,7 +313,7 @@ function v(e, t) {
|
|
313
313
|
}
|
314
314
|
if (p(n))
|
315
315
|
return n;
|
316
|
-
if (!
|
316
|
+
if (!g(n))
|
317
317
|
return null;
|
318
318
|
}
|
319
319
|
return null;
|
@@ -325,7 +325,7 @@ function M({ nodes: e }, t) {
|
|
325
325
|
const n = e.has.bind(e);
|
326
326
|
return t.filter((i) => i.dependencies.every(n));
|
327
327
|
}
|
328
|
-
const
|
328
|
+
const de = b({
|
329
329
|
name: "@etrepum/lexical-builder-markdown/MarkdownTransformers",
|
330
330
|
dependencies: [L],
|
331
331
|
config: D({
|
@@ -358,8 +358,8 @@ const ge = b({
|
|
358
358
|
};
|
359
359
|
},
|
360
360
|
register: (e, t, n) => j(n.getInitResult())
|
361
|
-
}), he = "0.0.
|
361
|
+
}), he = "0.0.26-nightly.20240625.0";
|
362
362
|
export {
|
363
|
-
|
363
|
+
de as MarkdownTransformersPlan,
|
364
364
|
he as PACKAGE_VERSION
|
365
365
|
};
|