@vizel/core 0.0.1-alpha.1 → 0.0.1-alpha.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/LICENSE +21 -0
- package/dist/index.d.ts +13 -13
- package/dist/index.js +141 -141
- package/dist/index10.js +70 -110
- package/dist/index11.js +135 -168
- package/dist/index12.js +83 -74
- package/dist/index13.js +13 -134
- package/dist/index14.js +13 -146
- package/dist/index15.js +303 -15
- package/dist/index16.js +69 -14
- package/dist/index17.js +26 -295
- package/dist/index18.js +2 -2
- package/dist/index19.js +355 -24
- package/dist/index20.js +25 -264
- package/dist/index21.js +85 -68
- package/dist/index22.js +97 -353
- package/dist/index23.js +66 -84
- package/dist/index24.js +12 -36
- package/dist/index25.js +53 -92
- package/dist/index26.js +132 -96
- package/dist/index27.js +59 -126
- package/dist/index28.js +37 -53
- package/dist/index29.js +19 -62
- package/dist/index3.js +165 -60
- package/dist/index30.js +9 -37
- package/dist/index31.js +143 -19
- package/dist/index32.js +264 -11
- package/dist/index33.js +92 -9
- package/dist/index36.js +1 -1
- package/dist/index37.js +41 -57
- package/dist/index38.js +64 -4
- package/dist/index39.js +4 -123
- package/dist/index4.js +10 -86
- package/dist/index40.js +111 -315
- package/dist/index41.js +321 -481
- package/dist/index42.js +481 -42
- package/dist/index43.js +143 -138
- package/dist/index44.js +1 -1
- package/dist/index45.js +1 -1
- package/dist/index46.js +1 -1
- package/dist/index48.js +3 -3
- package/dist/index49.js +158 -1458
- package/dist/index5.js +132 -10
- package/dist/index50.js +1561 -5
- package/dist/index51.js +1408 -1467
- package/dist/index52.js +704 -183
- package/dist/index53.js +5 -723
- package/dist/index6.js +48 -131
- package/dist/index61.js +1 -1
- package/dist/index62.js +1 -1
- package/dist/index65.js +1 -1
- package/dist/index66.js +53 -1059
- package/dist/index67.js +1059 -53
- package/dist/index69.js +90 -3
- package/dist/index7.js +228 -409
- package/dist/index70.js +3 -90
- package/dist/index8.js +111 -45
- package/dist/index9.js +409 -228
- package/package.json +54 -80
package/dist/index43.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Extension as H, commands as
|
|
2
|
-
import { marked as P } from "./
|
|
1
|
+
import { Extension as H, commands as y, flattenExtensions as z, getExtensionField as C, generateJSON as L } from "@tiptap/core";
|
|
2
|
+
import { marked as P } from "./index50.js";
|
|
3
3
|
function _(e, n) {
|
|
4
4
|
const s = n.split(`
|
|
5
5
|
`).flatMap((r) => [r, ""]).map((r) => `${e}${r}`).join(`
|
|
@@ -9,7 +9,7 @@ function _(e, n) {
|
|
|
9
9
|
function O(e, n) {
|
|
10
10
|
const t = [];
|
|
11
11
|
return Array.from(e.keys()).forEach((s) => {
|
|
12
|
-
n.
|
|
12
|
+
(!n || !n.marks || !n.marks.map((r) => r.type).includes(s)) && t.push(s);
|
|
13
13
|
}), t;
|
|
14
14
|
}
|
|
15
15
|
function F(e, n) {
|
|
@@ -19,28 +19,28 @@ function F(e, n) {
|
|
|
19
19
|
}), t;
|
|
20
20
|
}
|
|
21
21
|
function N(e, n, t, s) {
|
|
22
|
-
const r = !t, i = t && t.type === "text" && (!t.marks || t.marks.length === 0),
|
|
23
|
-
if (r || i ||
|
|
22
|
+
const r = !t, i = t && t.type === "text" && (!t.marks || t.marks.length === 0), o = t && t.type === "text" && t.marks && !s(n, new Map(t.marks.map((d) => [d.type, d]))), l = [];
|
|
23
|
+
if (r || i || o)
|
|
24
24
|
if (t && t.type === "text" && t.marks) {
|
|
25
|
-
const d = new Map(t.marks.map((
|
|
26
|
-
Array.from(e.keys()).forEach((
|
|
27
|
-
d.has(
|
|
25
|
+
const d = new Map(t.marks.map((a) => [a.type, a]));
|
|
26
|
+
Array.from(e.keys()).forEach((a) => {
|
|
27
|
+
d.has(a) || l.push(a);
|
|
28
28
|
});
|
|
29
29
|
} else (r || i) && l.push(...Array.from(e.keys()));
|
|
30
30
|
return l;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function $(e, n) {
|
|
33
33
|
let t = "";
|
|
34
34
|
return Array.from(e.keys()).reverse().forEach((s) => {
|
|
35
35
|
const r = e.get(s), i = n(s, r);
|
|
36
36
|
i && (t = i + t);
|
|
37
37
|
}), e.clear(), t;
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function S(e, n, t) {
|
|
40
40
|
let s = "";
|
|
41
41
|
return Array.from(e.entries()).forEach(([r, i]) => {
|
|
42
|
-
const
|
|
43
|
-
|
|
42
|
+
const o = t(r, i);
|
|
43
|
+
o && (s += o), n.set(r, i);
|
|
44
44
|
}), s;
|
|
45
45
|
}
|
|
46
46
|
function R(e) {
|
|
@@ -87,21 +87,21 @@ var j = class {
|
|
|
87
87
|
registerExtension(e, n = !0) {
|
|
88
88
|
var t, s;
|
|
89
89
|
this.extensions.push(e);
|
|
90
|
-
const r = e.name, i = C(e, "markdownTokenName") || r,
|
|
90
|
+
const r = e.name, i = C(e, "markdownTokenName") || r, o = C(e, "parseMarkdown"), l = C(e, "renderMarkdown"), d = C(e, "markdownTokenizer"), a = (t = C(e, "markdownOptions")) != null ? t : null, c = (s = a?.indentsContent) != null ? s : !1, p = {
|
|
91
91
|
tokenName: i,
|
|
92
92
|
nodeName: r,
|
|
93
|
-
parseMarkdown:
|
|
93
|
+
parseMarkdown: o,
|
|
94
94
|
renderMarkdown: l,
|
|
95
95
|
isIndenting: c,
|
|
96
96
|
tokenizer: d
|
|
97
97
|
};
|
|
98
|
-
if (i &&
|
|
99
|
-
const
|
|
100
|
-
|
|
98
|
+
if (i && o) {
|
|
99
|
+
const u = this.registry.get(i) || [];
|
|
100
|
+
u.push(p), this.registry.set(i, u);
|
|
101
101
|
}
|
|
102
102
|
if (l) {
|
|
103
|
-
const
|
|
104
|
-
|
|
103
|
+
const u = this.nodeTypeRegistry.get(r) || [];
|
|
104
|
+
u.push(p), this.nodeTypeRegistry.set(r, u);
|
|
105
105
|
}
|
|
106
106
|
d && this.hasMarked() && (this.registerTokenizer(d), n && (this.lexer = new this.markedInstance.Lexer()));
|
|
107
107
|
}
|
|
@@ -117,27 +117,27 @@ var j = class {
|
|
|
117
117
|
};
|
|
118
118
|
let d;
|
|
119
119
|
t ? d = typeof t == "function" ? t : (c) => c.indexOf(t) : d = (c) => {
|
|
120
|
-
const
|
|
121
|
-
return
|
|
120
|
+
const p = r(c, [], l);
|
|
121
|
+
return p && p.raw ? c.indexOf(p.raw) : -1;
|
|
122
122
|
};
|
|
123
|
-
const
|
|
123
|
+
const a = {
|
|
124
124
|
name: n,
|
|
125
125
|
level: s,
|
|
126
126
|
start: d,
|
|
127
|
-
tokenizer: (c,
|
|
128
|
-
const
|
|
129
|
-
if (
|
|
127
|
+
tokenizer: (c, p) => {
|
|
128
|
+
const u = r(c, p, l);
|
|
129
|
+
if (u && u.type)
|
|
130
130
|
return {
|
|
131
|
-
...
|
|
132
|
-
type:
|
|
133
|
-
raw:
|
|
134
|
-
tokens:
|
|
131
|
+
...u,
|
|
132
|
+
type: u.type || n,
|
|
133
|
+
raw: u.raw || "",
|
|
134
|
+
tokens: u.tokens || []
|
|
135
135
|
};
|
|
136
136
|
},
|
|
137
137
|
childTokens: []
|
|
138
138
|
};
|
|
139
139
|
this.markedInstance.use({
|
|
140
|
-
extensions: [
|
|
140
|
+
extensions: [a]
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
/** Get registered handlers for a token type and try each until one succeeds. */
|
|
@@ -201,8 +201,8 @@ var j = class {
|
|
|
201
201
|
if (n.find((r) => {
|
|
202
202
|
if (!r.parseMarkdown)
|
|
203
203
|
return !1;
|
|
204
|
-
const i = r.parseMarkdown(e, t),
|
|
205
|
-
return
|
|
204
|
+
const i = r.parseMarkdown(e, t), o = this.normalizeParseResult(i);
|
|
205
|
+
return o && (!Array.isArray(o) || o.length > 0) ? (this.lastParseResult = o, !0) : !1;
|
|
206
206
|
}) && this.lastParseResult) {
|
|
207
207
|
const r = this.lastParseResult;
|
|
208
208
|
return this.lastParseResult = null, r;
|
|
@@ -225,43 +225,43 @@ var j = class {
|
|
|
225
225
|
const s = [];
|
|
226
226
|
let r = [], i = null;
|
|
227
227
|
for (let l = 0; l < e.items.length; l += 1) {
|
|
228
|
-
const d = e.items[l], { isTask:
|
|
229
|
-
let
|
|
230
|
-
if (
|
|
228
|
+
const d = e.items[l], { isTask: a, checked: c, indentLevel: p } = R(d);
|
|
229
|
+
let u = d;
|
|
230
|
+
if (a) {
|
|
231
231
|
const m = (d.raw || d.text || "").split(`
|
|
232
|
-
`),
|
|
233
|
-
let
|
|
232
|
+
`), g = m[0].match(/^\s*[-+*]\s+\[([ xX])\]\s+(.*)$/), h = g ? g[2] : "";
|
|
233
|
+
let k = [];
|
|
234
234
|
if (m.length > 1 && m.slice(1).join(`
|
|
235
235
|
`).trim()) {
|
|
236
|
-
const
|
|
236
|
+
const T = m.slice(1), v = T.filter((A) => A.trim());
|
|
237
237
|
if (v.length > 0) {
|
|
238
|
-
const A = Math.min(...v.map((x) => x.length - x.trimStart().length)), I =
|
|
238
|
+
const A = Math.min(...v.map((x) => x.length - x.trimStart().length)), I = T.map((x) => x.trim() ? x.slice(A) : "").join(`
|
|
239
239
|
`).trim();
|
|
240
|
-
I && (
|
|
240
|
+
I && (k = this.markedInstance.lexer(`${I}
|
|
241
241
|
`));
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
|
-
|
|
244
|
+
u = {
|
|
245
245
|
type: "taskItem",
|
|
246
246
|
raw: "",
|
|
247
|
-
mainContent:
|
|
248
|
-
indentLevel:
|
|
247
|
+
mainContent: h,
|
|
248
|
+
indentLevel: p,
|
|
249
249
|
checked: c ?? !1,
|
|
250
|
-
text:
|
|
251
|
-
tokens: this.lexer.inlineTokens(
|
|
252
|
-
nestedTokens:
|
|
250
|
+
text: h,
|
|
251
|
+
tokens: this.lexer.inlineTokens(h),
|
|
252
|
+
nestedTokens: k
|
|
253
253
|
};
|
|
254
254
|
}
|
|
255
|
-
const
|
|
256
|
-
i !==
|
|
255
|
+
const w = a ? "taskList" : "list";
|
|
256
|
+
i !== w ? (r.length > 0 && s.push({ type: i, items: r }), r = [u], i = w) : r.push(u);
|
|
257
257
|
}
|
|
258
258
|
r.length > 0 && s.push({ type: i, items: r });
|
|
259
|
-
const
|
|
259
|
+
const o = [];
|
|
260
260
|
for (let l = 0; l < s.length; l += 1) {
|
|
261
|
-
const d = s[l],
|
|
262
|
-
c && (Array.isArray(c) ?
|
|
261
|
+
const d = s[l], a = { ...e, type: d.type, items: d.items }, c = this.parseToken(a);
|
|
262
|
+
c && (Array.isArray(c) ? o.push(...c) : o.push(c));
|
|
263
263
|
}
|
|
264
|
-
return
|
|
264
|
+
return o.length > 0 ? o : null;
|
|
265
265
|
}
|
|
266
266
|
/**
|
|
267
267
|
* Parse a token using registered handlers (extracted for reuse).
|
|
@@ -273,8 +273,8 @@ var j = class {
|
|
|
273
273
|
if (n.find((r) => {
|
|
274
274
|
if (!r.parseMarkdown)
|
|
275
275
|
return !1;
|
|
276
|
-
const i = r.parseMarkdown(e, t),
|
|
277
|
-
return
|
|
276
|
+
const i = r.parseMarkdown(e, t), o = this.normalizeParseResult(i);
|
|
277
|
+
return o && (!Array.isArray(o) || o.length > 0) ? (this.lastParseResult = o, !0) : !1;
|
|
278
278
|
}) && this.lastParseResult) {
|
|
279
279
|
const r = this.lastParseResult;
|
|
280
280
|
return this.lastParseResult = null, r;
|
|
@@ -322,56 +322,56 @@ var j = class {
|
|
|
322
322
|
parseInlineTokens(e) {
|
|
323
323
|
var n, t, s, r;
|
|
324
324
|
const i = [];
|
|
325
|
-
for (let
|
|
326
|
-
const l = e[
|
|
325
|
+
for (let o = 0; o < e.length; o += 1) {
|
|
326
|
+
const l = e[o];
|
|
327
327
|
if (l.type === "text")
|
|
328
328
|
i.push({
|
|
329
329
|
type: "text",
|
|
330
330
|
text: l.text || ""
|
|
331
331
|
});
|
|
332
332
|
else if (l.type === "html") {
|
|
333
|
-
const d = ((t = (n = l.raw) != null ? n : l.text) != null ? t : "").toString(),
|
|
334
|
-
if (!
|
|
335
|
-
const
|
|
333
|
+
const d = ((t = (n = l.raw) != null ? n : l.text) != null ? t : "").toString(), a = /^<\/[\s]*[\w-]+/i.test(d), c = d.match(/^<[\s]*([\w-]+)(\s|>|\/|$)/i);
|
|
334
|
+
if (!a && c && !/\/>$/.test(d)) {
|
|
335
|
+
const u = c[1], w = this.escapeRegex(u), M = new RegExp(`^<\\/\\s*${w}\\b`, "i");
|
|
336
336
|
let m = -1;
|
|
337
|
-
const
|
|
338
|
-
for (let
|
|
339
|
-
const
|
|
340
|
-
if (
|
|
341
|
-
m =
|
|
337
|
+
const g = [d];
|
|
338
|
+
for (let h = o + 1; h < e.length; h += 1) {
|
|
339
|
+
const k = e[h], f = ((r = (s = k.raw) != null ? s : k.text) != null ? r : "").toString();
|
|
340
|
+
if (g.push(f), k.type === "html" && M.test(f)) {
|
|
341
|
+
m = h;
|
|
342
342
|
break;
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
if (m !== -1) {
|
|
346
|
-
const
|
|
346
|
+
const h = g.join(""), k = {
|
|
347
347
|
type: "html",
|
|
348
|
-
raw:
|
|
349
|
-
text:
|
|
348
|
+
raw: h,
|
|
349
|
+
text: h,
|
|
350
350
|
block: !1
|
|
351
|
-
},
|
|
352
|
-
if (
|
|
353
|
-
const
|
|
354
|
-
Array.isArray(
|
|
351
|
+
}, f = this.parseHTMLToken(k);
|
|
352
|
+
if (f) {
|
|
353
|
+
const T = this.normalizeParseResult(f);
|
|
354
|
+
Array.isArray(T) ? i.push(...T) : T && i.push(T);
|
|
355
355
|
}
|
|
356
|
-
|
|
356
|
+
o = m;
|
|
357
357
|
continue;
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
|
-
const
|
|
361
|
-
if (
|
|
362
|
-
const
|
|
363
|
-
Array.isArray(
|
|
360
|
+
const p = this.parseHTMLToken(l);
|
|
361
|
+
if (p) {
|
|
362
|
+
const u = this.normalizeParseResult(p);
|
|
363
|
+
Array.isArray(u) ? i.push(...u) : u && i.push(u);
|
|
364
364
|
}
|
|
365
365
|
} else if (l.type) {
|
|
366
366
|
const d = this.getHandlerForToken(l.type);
|
|
367
367
|
if (d && d.parseMarkdown) {
|
|
368
|
-
const
|
|
368
|
+
const a = this.createParseHelpers(), c = d.parseMarkdown(l, a);
|
|
369
369
|
if (this.isMarkResult(c)) {
|
|
370
|
-
const
|
|
371
|
-
i.push(...
|
|
370
|
+
const p = this.applyMarkToContent(c.mark, c.content, c.attrs);
|
|
371
|
+
i.push(...p);
|
|
372
372
|
} else {
|
|
373
|
-
const
|
|
374
|
-
Array.isArray(
|
|
373
|
+
const p = this.normalizeParseResult(c);
|
|
374
|
+
Array.isArray(p) ? i.push(...p) : p && i.push(p);
|
|
375
375
|
}
|
|
376
376
|
} else l.tokens && i.push(...this.parseInlineTokens(l.tokens));
|
|
377
377
|
}
|
|
@@ -461,12 +461,12 @@ var j = class {
|
|
|
461
461
|
const i = this.getHandlerForToken(e.type);
|
|
462
462
|
if (!i)
|
|
463
463
|
return "";
|
|
464
|
-
const
|
|
465
|
-
renderChildren: (
|
|
466
|
-
const
|
|
467
|
-
return !Array.isArray(
|
|
464
|
+
const o = {
|
|
465
|
+
renderChildren: (a, c) => {
|
|
466
|
+
const p = i.isIndenting ? s + 1 : s;
|
|
467
|
+
return !Array.isArray(a) && a.content ? this.renderNodes(a.content, e, c || "", t, p) : this.renderNodes(a, e, c || "", t, p);
|
|
468
468
|
},
|
|
469
|
-
indent: (
|
|
469
|
+
indent: (a) => this.indentString + a,
|
|
470
470
|
wrapInBlock: _
|
|
471
471
|
}, l = {
|
|
472
472
|
index: t,
|
|
@@ -474,7 +474,7 @@ var j = class {
|
|
|
474
474
|
parentType: n?.type,
|
|
475
475
|
meta: {}
|
|
476
476
|
};
|
|
477
|
-
return ((r = i.renderMarkdown) == null ? void 0 : r.call(i, e,
|
|
477
|
+
return ((r = i.renderMarkdown) == null ? void 0 : r.call(i, e, o, l)) || "";
|
|
478
478
|
}
|
|
479
479
|
/**
|
|
480
480
|
* Render a node or an array of nodes. Parent type controls how children
|
|
@@ -489,43 +489,48 @@ var j = class {
|
|
|
489
489
|
*/
|
|
490
490
|
renderNodesWithMarkBoundaries(e, n, t = "", s = 0) {
|
|
491
491
|
const r = [], i = /* @__PURE__ */ new Map();
|
|
492
|
-
return e.forEach((
|
|
492
|
+
return e.forEach((o, l) => {
|
|
493
493
|
const d = l < e.length - 1 ? e[l + 1] : null;
|
|
494
|
-
if (
|
|
495
|
-
if (
|
|
496
|
-
let
|
|
497
|
-
const c = new Map((
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
494
|
+
if (o.type)
|
|
495
|
+
if (o.type === "text") {
|
|
496
|
+
let a = o.text || "";
|
|
497
|
+
const c = new Map((o.marks || []).map((h) => [h.type, h])), p = F(i, c), u = O(c, d);
|
|
498
|
+
let w = "";
|
|
499
|
+
if (u.length > 0) {
|
|
500
|
+
const h = a.match(/(\s+)$/);
|
|
501
|
+
h && (w = h[1], a = a.slice(0, -w.length));
|
|
502
|
+
}
|
|
503
|
+
u.forEach((h) => {
|
|
504
|
+
const k = c.get(h), f = this.getMarkClosing(h, k);
|
|
505
|
+
f && (a += f), i.has(h) && i.delete(h);
|
|
501
506
|
});
|
|
502
|
-
let
|
|
503
|
-
if (
|
|
504
|
-
const
|
|
505
|
-
|
|
507
|
+
let M = "";
|
|
508
|
+
if (p.length > 0) {
|
|
509
|
+
const h = a.match(/^(\s+)/);
|
|
510
|
+
h && (M = h[1], a = a.slice(M.length));
|
|
506
511
|
}
|
|
507
|
-
|
|
508
|
-
const f = this.getMarkOpening(
|
|
509
|
-
f && (
|
|
510
|
-
}),
|
|
511
|
-
const
|
|
512
|
+
p.forEach(({ type: h, mark: k }) => {
|
|
513
|
+
const f = this.getMarkOpening(h, k);
|
|
514
|
+
f && (a = f + a), u.includes(h) || i.set(h, k);
|
|
515
|
+
}), a = M + a;
|
|
516
|
+
const m = N(
|
|
512
517
|
i,
|
|
513
518
|
c,
|
|
514
519
|
d,
|
|
515
520
|
this.markSetsEqual.bind(this)
|
|
516
521
|
);
|
|
517
|
-
let
|
|
518
|
-
if (
|
|
519
|
-
const
|
|
520
|
-
|
|
522
|
+
let g = "";
|
|
523
|
+
if (m.length > 0) {
|
|
524
|
+
const h = a.match(/(\s+)$/);
|
|
525
|
+
h && (g = h[1], a = a.slice(0, -g.length));
|
|
521
526
|
}
|
|
522
|
-
|
|
523
|
-
const k = i.get(
|
|
524
|
-
f && (
|
|
525
|
-
}),
|
|
527
|
+
m.forEach((h) => {
|
|
528
|
+
const k = i.get(h), f = this.getMarkClosing(h, k);
|
|
529
|
+
f && (a += f), i.delete(h);
|
|
530
|
+
}), a += g, a += w, r.push(a);
|
|
526
531
|
} else {
|
|
527
|
-
const
|
|
528
|
-
r.push(c +
|
|
532
|
+
const a = new Map(i), c = $(i, this.getMarkClosing.bind(this)), p = this.renderNodeToMarkdown(o, n, l, s), u = o.type === "hardBreak" ? "" : S(a, i, this.getMarkOpening.bind(this));
|
|
533
|
+
r.push(c + p + u);
|
|
529
534
|
}
|
|
530
535
|
}), r.join(t);
|
|
531
536
|
}
|
|
@@ -542,18 +547,18 @@ var j = class {
|
|
|
542
547
|
content: [{ type: "text", text: r }]
|
|
543
548
|
};
|
|
544
549
|
try {
|
|
545
|
-
const
|
|
550
|
+
const o = s.renderMarkdown(
|
|
546
551
|
i,
|
|
547
552
|
{
|
|
548
553
|
renderChildren: () => r,
|
|
549
554
|
indent: (d) => d,
|
|
550
|
-
wrapInBlock: (d,
|
|
555
|
+
wrapInBlock: (d, a) => d + a
|
|
551
556
|
},
|
|
552
557
|
{ index: 0, level: 0, parentType: "text", meta: {} }
|
|
553
|
-
), l =
|
|
554
|
-
return l >= 0 ?
|
|
555
|
-
} catch (
|
|
556
|
-
throw new Error(`Failed to get mark opening for ${e}: ${
|
|
558
|
+
), l = o.indexOf(r);
|
|
559
|
+
return l >= 0 ? o.substring(0, l) : "";
|
|
560
|
+
} catch (o) {
|
|
561
|
+
throw new Error(`Failed to get mark opening for ${e}: ${o}`);
|
|
557
562
|
}
|
|
558
563
|
}
|
|
559
564
|
/**
|
|
@@ -569,18 +574,18 @@ var j = class {
|
|
|
569
574
|
content: [{ type: "text", text: r }]
|
|
570
575
|
};
|
|
571
576
|
try {
|
|
572
|
-
const
|
|
577
|
+
const o = s.renderMarkdown(
|
|
573
578
|
i,
|
|
574
579
|
{
|
|
575
580
|
renderChildren: () => r,
|
|
576
|
-
indent: (
|
|
577
|
-
wrapInBlock: (
|
|
581
|
+
indent: (a) => a,
|
|
582
|
+
wrapInBlock: (a, c) => a + c
|
|
578
583
|
},
|
|
579
584
|
{ index: 0, level: 0, parentType: "text", meta: {} }
|
|
580
|
-
), l =
|
|
581
|
-
return l >= 0 ?
|
|
582
|
-
} catch (
|
|
583
|
-
throw new Error(`Failed to get mark closing for ${e}: ${
|
|
585
|
+
), l = o.indexOf(r), d = l + r.length;
|
|
586
|
+
return l >= 0 ? o.substring(d) : "";
|
|
587
|
+
} catch (o) {
|
|
588
|
+
throw new Error(`Failed to get mark closing for ${e}: ${o}`);
|
|
584
589
|
}
|
|
585
590
|
}
|
|
586
591
|
/**
|
|
@@ -602,27 +607,27 @@ var j = class {
|
|
|
602
607
|
return {
|
|
603
608
|
setContent: (e, n) => {
|
|
604
609
|
if (!n?.contentType)
|
|
605
|
-
return
|
|
610
|
+
return y.setContent(e, n);
|
|
606
611
|
if (E(e, n?.contentType) !== "markdown" || !this.editor.markdown)
|
|
607
|
-
return
|
|
612
|
+
return y.setContent(e, n);
|
|
608
613
|
const s = this.editor.markdown.parse(e);
|
|
609
|
-
return
|
|
614
|
+
return y.setContent(s, n);
|
|
610
615
|
},
|
|
611
616
|
insertContent: (e, n) => {
|
|
612
617
|
if (!n?.contentType)
|
|
613
|
-
return
|
|
618
|
+
return y.insertContent(e, n);
|
|
614
619
|
if (E(e, n?.contentType) !== "markdown" || !this.editor.markdown)
|
|
615
|
-
return
|
|
620
|
+
return y.insertContent(e, n);
|
|
616
621
|
const s = this.editor.markdown.parse(e);
|
|
617
|
-
return
|
|
622
|
+
return y.insertContent(s, n);
|
|
618
623
|
},
|
|
619
624
|
insertContentAt: (e, n, t) => {
|
|
620
625
|
if (!t?.contentType)
|
|
621
|
-
return
|
|
626
|
+
return y.insertContentAt(e, n, t);
|
|
622
627
|
if (E(n, t?.contentType) !== "markdown" || !this.editor.markdown)
|
|
623
|
-
return
|
|
628
|
+
return y.insertContentAt(e, n, t);
|
|
624
629
|
const r = this.editor.markdown.parse(n);
|
|
625
|
-
return
|
|
630
|
+
return y.insertContentAt(e, r, t);
|
|
626
631
|
}
|
|
627
632
|
};
|
|
628
633
|
},
|
|
@@ -666,11 +671,11 @@ export {
|
|
|
666
671
|
q as Markdown,
|
|
667
672
|
j as MarkdownManager,
|
|
668
673
|
E as assumeContentType,
|
|
669
|
-
|
|
674
|
+
$ as closeMarksBeforeNode,
|
|
670
675
|
O as findMarksToClose,
|
|
671
676
|
N as findMarksToCloseAtEnd,
|
|
672
677
|
F as findMarksToOpen,
|
|
673
678
|
R as isTaskItem,
|
|
674
|
-
|
|
679
|
+
S as reopenMarksAfterNode,
|
|
675
680
|
_ as wrapInMarkdownBlock
|
|
676
681
|
};
|
package/dist/index44.js
CHANGED
package/dist/index45.js
CHANGED
package/dist/index46.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Mark as y,
|
|
1
|
+
import { Mark as y, mergeAttributes as p, Extension as l } from "@tiptap/core";
|
|
2
2
|
var d = 20, u = (t, e = 0) => {
|
|
3
3
|
const r = [];
|
|
4
4
|
return !t.children.length || e > d || Array.from(t.children).forEach((o) => {
|
package/dist/index48.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Extension as u, callOrReturn as w, getExtensionField as S, isNodeEmpty as P, isNodeSelection as v } from "@tiptap/core";
|
|
2
|
-
import { Plugin as p, PluginKey as m } from "./
|
|
2
|
+
import { Plugin as p, PluginKey as m } from "./index42.js";
|
|
3
3
|
import { dropCursor as z } from "./index61.js";
|
|
4
|
-
import { DecorationSet as f, Decoration as g } from "./
|
|
5
|
-
import { gapCursor as E } from "./
|
|
4
|
+
import { DecorationSet as f, Decoration as g } from "./index51.js";
|
|
5
|
+
import { gapCursor as E } from "./index49.js";
|
|
6
6
|
import { history as M, redo as N, undo as O } from "./index62.js";
|
|
7
7
|
var k = u.create({
|
|
8
8
|
name: "characterCount",
|