@levo-so/site-runtime 0.3.14 → 0.3.15
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/{KBChatWidget-DCj3mo3P.js → KBChatWidget-GRi6sLpp.js} +22 -18
- package/blog-content.js +410 -270
- package/index.js +5 -2
- package/{kbChat-BIzoQwEC.js → kbChat-a2dXSeRc.js} +1 -1
- package/package.json +9 -9
- package/styles.css +1 -1
package/blog-content.js
CHANGED
|
@@ -22,17 +22,17 @@ import { Details as ye, DetailsContent as be, DetailsSummary as xe } from "@tipt
|
|
|
22
22
|
import { TextStyle as Se } from "@tiptap/extension-text-style";
|
|
23
23
|
import Ce from "@tiptap/extension-horizontal-rule";
|
|
24
24
|
import { Image as we } from "@tiptap/extension-image";
|
|
25
|
-
import { closeHistory as
|
|
26
|
-
import { TaskItem as
|
|
27
|
-
import { cellAround as
|
|
28
|
-
import { TableCell as
|
|
29
|
-
import { Table as
|
|
30
|
-
import { Subscript as
|
|
31
|
-
import { Superscript as
|
|
32
|
-
import { Typography as
|
|
33
|
-
import { UniqueID as
|
|
25
|
+
import { closeHistory as Te } from "@tiptap/pm/history";
|
|
26
|
+
import { TaskItem as Ee, TaskList as De } from "@tiptap/extension-list";
|
|
27
|
+
import { cellAround as Oe, columnResizing as ke, tableEditing as Ae } from "@tiptap/pm/tables";
|
|
28
|
+
import { TableCell as je, TableHeader as Me, TableRow as Ne } from "@tiptap/extension-table";
|
|
29
|
+
import { Table as Pe } from "@tiptap/extension-table/table";
|
|
30
|
+
import { Subscript as Fe } from "@tiptap/extension-subscript";
|
|
31
|
+
import { Superscript as Ie } from "@tiptap/extension-superscript";
|
|
32
|
+
import { Typography as Le } from "@tiptap/extension-typography";
|
|
33
|
+
import { UniqueID as Re } from "@tiptap/extension-unique-id";
|
|
34
34
|
//#region ../../libraries/blog-renderer/dist/views/BookmarkView.cssm.js
|
|
35
|
-
var
|
|
35
|
+
var ze = "_2zpuyk0", Be = "_2zpuyk1", Ve = "_2zpuyk2", He = "_2zpuyk3", Ue = "_2zpuyk4", We = "_2zpuyk6 _2zpuyk5", Ge = "_2zpuyk7 _2zpuyk5", Ke = "_2zpuyk9", L = "_2zpuyka", qe = "_2zpuykb", Je = (e) => {
|
|
36
36
|
let n = D(30), { blogId: r, postId: i, workspaceId: a, interactive: o } = e, s = o === void 0 ? !0 : o, { blog: c, workspace: l, logger: u } = t(), d = a ?? l, [f, p] = j(!0), [m, h] = j(null), g, _;
|
|
37
37
|
if (n[0] !== c || n[1] !== r || n[2] !== u || n[3] !== i || n[4] !== d ? (g = () => {
|
|
38
38
|
if (!r || !i) {
|
|
@@ -59,10 +59,10 @@ var Re = "_2zpuyk0", ze = "_2zpuyk1", Be = "_2zpuyk2", Ve = "_2zpuyk3", He = "_2
|
|
|
59
59
|
u
|
|
60
60
|
], n[0] = c, n[1] = r, n[2] = u, n[3] = i, n[4] = d, n[5] = g, n[6] = _) : (g = n[5], _ = n[6]), ce(g, _), f) {
|
|
61
61
|
let e;
|
|
62
|
-
n[7] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ k("div", { className:
|
|
62
|
+
n[7] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ k("div", { className: Ge }), n[7] = e) : e = n[7];
|
|
63
63
|
let t;
|
|
64
64
|
n[8] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ k("div", {
|
|
65
|
-
className:
|
|
65
|
+
className: L,
|
|
66
66
|
style: {
|
|
67
67
|
height: "1rem",
|
|
68
68
|
width: "65%"
|
|
@@ -70,28 +70,28 @@ var Re = "_2zpuyk0", ze = "_2zpuyk1", Be = "_2zpuyk2", Ve = "_2zpuyk3", He = "_2
|
|
|
70
70
|
}), n[8] = t) : t = n[8];
|
|
71
71
|
let r;
|
|
72
72
|
n[9] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ k("div", {
|
|
73
|
-
className:
|
|
73
|
+
className: L,
|
|
74
74
|
style: { width: "100%" }
|
|
75
75
|
}), n[9] = r) : r = n[9];
|
|
76
76
|
let i;
|
|
77
77
|
n[10] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ k("div", {
|
|
78
|
-
className:
|
|
78
|
+
className: L,
|
|
79
79
|
style: { width: "92%" }
|
|
80
80
|
}), n[10] = i) : i = n[10];
|
|
81
81
|
let a;
|
|
82
82
|
return n[11] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ k("div", {
|
|
83
|
-
className:
|
|
83
|
+
className: ze,
|
|
84
84
|
children: /* @__PURE__ */ A("div", {
|
|
85
|
-
className: `${
|
|
85
|
+
className: `${Be} ${Ke}`,
|
|
86
86
|
children: [e, /* @__PURE__ */ A("div", {
|
|
87
|
-
className:
|
|
87
|
+
className: Ve,
|
|
88
88
|
children: [t, /* @__PURE__ */ A("div", {
|
|
89
|
-
className:
|
|
89
|
+
className: qe,
|
|
90
90
|
children: [
|
|
91
91
|
r,
|
|
92
92
|
i,
|
|
93
93
|
/* @__PURE__ */ k("div", {
|
|
94
|
-
className:
|
|
94
|
+
className: L,
|
|
95
95
|
style: { width: "60%" }
|
|
96
96
|
})
|
|
97
97
|
]
|
|
@@ -105,31 +105,31 @@ var Re = "_2zpuyk0", ze = "_2zpuyk1", Be = "_2zpuyk2", Ve = "_2zpuyk3", He = "_2
|
|
|
105
105
|
n[12] === s ? x = n[13] : (x = s ? void 0 : { pointerEvents: "none" }, n[12] = s, n[13] = x);
|
|
106
106
|
let S = s ? void 0 : -1, C;
|
|
107
107
|
n[14] !== v || n[15] !== m.title ? (C = v ? /* @__PURE__ */ k("img", {
|
|
108
|
-
className:
|
|
108
|
+
className: We,
|
|
109
109
|
src: v,
|
|
110
110
|
alt: m.title,
|
|
111
111
|
loading: "lazy"
|
|
112
|
-
}) : /* @__PURE__ */ k("div", { className:
|
|
112
|
+
}) : /* @__PURE__ */ k("div", { className: Ge }), n[14] = v, n[15] = m.title, n[16] = C) : C = n[16];
|
|
113
113
|
let w;
|
|
114
114
|
n[17] === m.title ? w = n[18] : (w = /* @__PURE__ */ k("h3", {
|
|
115
|
-
className:
|
|
115
|
+
className: He,
|
|
116
116
|
children: m.title
|
|
117
117
|
}), n[17] = m.title, n[18] = w);
|
|
118
118
|
let T;
|
|
119
119
|
n[19] === m.summary ? T = n[20] : (T = m.summary ? /* @__PURE__ */ k("p", {
|
|
120
|
-
className:
|
|
120
|
+
className: Ue,
|
|
121
121
|
children: m.summary
|
|
122
122
|
}) : null, n[19] = m.summary, n[20] = T);
|
|
123
123
|
let E;
|
|
124
124
|
n[21] !== w || n[22] !== T ? (E = /* @__PURE__ */ A("div", {
|
|
125
|
-
className:
|
|
125
|
+
className: Ve,
|
|
126
126
|
children: [w, T]
|
|
127
127
|
}), n[21] = w, n[22] = T, n[23] = E) : E = n[23];
|
|
128
128
|
let O;
|
|
129
129
|
return n[24] !== E || n[25] !== b || n[26] !== x || n[27] !== S || n[28] !== C ? (O = /* @__PURE__ */ k("div", {
|
|
130
|
-
className:
|
|
130
|
+
className: ze,
|
|
131
131
|
children: /* @__PURE__ */ A("a", {
|
|
132
|
-
className:
|
|
132
|
+
className: Be,
|
|
133
133
|
href: b,
|
|
134
134
|
target: "_blank",
|
|
135
135
|
rel: "noopener noreferrer",
|
|
@@ -138,15 +138,15 @@ var Re = "_2zpuyk0", ze = "_2zpuyk1", Be = "_2zpuyk2", Ve = "_2zpuyk3", He = "_2
|
|
|
138
138
|
children: [C, E]
|
|
139
139
|
})
|
|
140
140
|
}), n[24] = E, n[25] = b, n[26] = x, n[27] = S, n[28] = C, n[29] = O) : O = n[29], O;
|
|
141
|
-
},
|
|
141
|
+
}, Ye = (e) => {
|
|
142
142
|
let t = D(3), { node: n } = e, r = n?.attrs?.blogId, i = n?.attrs?.postId;
|
|
143
143
|
if (!r || !i) return null;
|
|
144
144
|
let a;
|
|
145
|
-
return t[0] !== r || t[1] !== i ? (a = /* @__PURE__ */ k(
|
|
145
|
+
return t[0] !== r || t[1] !== i ? (a = /* @__PURE__ */ k(Je, {
|
|
146
146
|
blogId: r,
|
|
147
147
|
postId: i
|
|
148
148
|
}), t[0] = r, t[1] = i, t[2] = a) : a = t[2], a;
|
|
149
|
-
},
|
|
149
|
+
}, Xe = N.create({
|
|
150
150
|
name: "quote",
|
|
151
151
|
content: "block+",
|
|
152
152
|
defining: !0,
|
|
@@ -182,7 +182,7 @@ var Re = "_2zpuyk0", ze = "_2zpuyk1", Be = "_2zpuyk2", Ve = "_2zpuyk3", He = "_2
|
|
|
182
182
|
return e.commands.toggleBlockquote();
|
|
183
183
|
} };
|
|
184
184
|
}
|
|
185
|
-
}),
|
|
185
|
+
}), Ze = N.create({
|
|
186
186
|
name: "quoteCaption",
|
|
187
187
|
group: "block",
|
|
188
188
|
content: "text*",
|
|
@@ -228,7 +228,7 @@ var Re = "_2zpuyk0", ze = "_2zpuyk1", Be = "_2zpuyk2", Ve = "_2zpuyk3", He = "_2
|
|
|
228
228
|
}
|
|
229
229
|
};
|
|
230
230
|
}
|
|
231
|
-
}),
|
|
231
|
+
}), Qe = (e) => {
|
|
232
232
|
let { state: t } = e, { selection: n } = t;
|
|
233
233
|
if (n.empty || !(n instanceof I)) return !1;
|
|
234
234
|
let { $from: r, $to: i } = n, a = -1;
|
|
@@ -248,13 +248,13 @@ var Re = "_2zpuyk0", ze = "_2zpuyk1", Be = "_2zpuyk2", Ve = "_2zpuyk3", He = "_2
|
|
|
248
248
|
}).run();
|
|
249
249
|
let m = t.tr;
|
|
250
250
|
return i.pos > d && m.delete(d, i.pos), r.pos < u - 1 && m.delete(r.pos, u - 1), m.setSelection(I.near(m.doc.resolve(r.pos))), e.view.dispatch(m.scrollIntoView()), !0;
|
|
251
|
-
},
|
|
251
|
+
}, $e = N.create({
|
|
252
252
|
name: "blockquoteFigure",
|
|
253
253
|
group: "block",
|
|
254
254
|
content: "quote quoteCaption",
|
|
255
255
|
isolating: !0,
|
|
256
256
|
addExtensions() {
|
|
257
|
-
return [
|
|
257
|
+
return [Xe, Ze];
|
|
258
258
|
},
|
|
259
259
|
renderHTML({ HTMLAttributes: e }) {
|
|
260
260
|
return [
|
|
@@ -265,8 +265,8 @@ var Re = "_2zpuyk0", ze = "_2zpuyk1", Be = "_2zpuyk2", Ve = "_2zpuyk3", He = "_2
|
|
|
265
265
|
},
|
|
266
266
|
addKeyboardShortcuts() {
|
|
267
267
|
return {
|
|
268
|
-
Backspace: ({ editor: e }) =>
|
|
269
|
-
Delete: ({ editor: e }) =>
|
|
268
|
+
Backspace: ({ editor: e }) => Qe(e),
|
|
269
|
+
Delete: ({ editor: e }) => Qe(e)
|
|
270
270
|
};
|
|
271
271
|
},
|
|
272
272
|
addInputRules() {
|
|
@@ -336,7 +336,7 @@ var Re = "_2zpuyk0", ze = "_2zpuyk1", Be = "_2zpuyk2", Ve = "_2zpuyk3", He = "_2
|
|
|
336
336
|
}
|
|
337
337
|
};
|
|
338
338
|
}
|
|
339
|
-
}),
|
|
339
|
+
}), et = N.create({
|
|
340
340
|
name: "bookmark",
|
|
341
341
|
atom: !0,
|
|
342
342
|
group: "block",
|
|
@@ -361,13 +361,13 @@ var Re = "_2zpuyk0", ze = "_2zpuyk1", Be = "_2zpuyk2", Ve = "_2zpuyk3", He = "_2
|
|
|
361
361
|
renderHTML({ HTMLAttributes: e }) {
|
|
362
362
|
return ["div", P(e, { "data-type": this.name })];
|
|
363
363
|
}
|
|
364
|
-
}),
|
|
364
|
+
}), R = "levo-button-trigger", tt = (e) => e === "popup" ? "button" : "a", nt = (e) => e && ge(e) ? e : "", z = {
|
|
365
365
|
variant: "primary",
|
|
366
366
|
size: "md",
|
|
367
367
|
align: "left",
|
|
368
368
|
target: "_self",
|
|
369
369
|
actionType: "link"
|
|
370
|
-
},
|
|
370
|
+
}, rt = N.create({
|
|
371
371
|
name: "button",
|
|
372
372
|
group: "block",
|
|
373
373
|
atom: !0,
|
|
@@ -389,29 +389,29 @@ var Re = "_2zpuyk0", ze = "_2zpuyk1", Be = "_2zpuyk2", Ve = "_2zpuyk3", He = "_2
|
|
|
389
389
|
renderHTML: () => ({})
|
|
390
390
|
},
|
|
391
391
|
target: {
|
|
392
|
-
default:
|
|
392
|
+
default: z.target,
|
|
393
393
|
parseHTML: (e) => e.querySelector("a")?.getAttribute("target") === "_blank" ? "_blank" : "_self",
|
|
394
394
|
renderHTML: () => ({})
|
|
395
395
|
},
|
|
396
396
|
variant: {
|
|
397
|
-
default:
|
|
398
|
-
parseHTML: (e) => e.getAttribute("data-variant") ||
|
|
399
|
-
renderHTML: (e) => ({ "data-variant": e.variant ??
|
|
397
|
+
default: z.variant,
|
|
398
|
+
parseHTML: (e) => e.getAttribute("data-variant") || z.variant,
|
|
399
|
+
renderHTML: (e) => ({ "data-variant": e.variant ?? z.variant })
|
|
400
400
|
},
|
|
401
401
|
size: {
|
|
402
|
-
default:
|
|
403
|
-
parseHTML: (e) => e.getAttribute("data-size") ||
|
|
404
|
-
renderHTML: (e) => ({ "data-size": e.size ??
|
|
402
|
+
default: z.size,
|
|
403
|
+
parseHTML: (e) => e.getAttribute("data-size") || z.size,
|
|
404
|
+
renderHTML: (e) => ({ "data-size": e.size ?? z.size })
|
|
405
405
|
},
|
|
406
406
|
align: {
|
|
407
|
-
default:
|
|
408
|
-
parseHTML: (e) => e.getAttribute("data-align") ||
|
|
409
|
-
renderHTML: (e) => ({ "data-align": e.align ??
|
|
407
|
+
default: z.align,
|
|
408
|
+
parseHTML: (e) => e.getAttribute("data-align") || z.align,
|
|
409
|
+
renderHTML: (e) => ({ "data-align": e.align ?? z.align })
|
|
410
410
|
},
|
|
411
411
|
actionType: {
|
|
412
|
-
default:
|
|
413
|
-
parseHTML: (e) => e.getAttribute("data-action-type") ||
|
|
414
|
-
renderHTML: (e) => ({ "data-action-type": e.actionType ??
|
|
412
|
+
default: z.actionType,
|
|
413
|
+
parseHTML: (e) => e.getAttribute("data-action-type") || z.actionType,
|
|
414
|
+
renderHTML: (e) => ({ "data-action-type": e.actionType ?? z.actionType })
|
|
415
415
|
},
|
|
416
416
|
popupId: {
|
|
417
417
|
default: null,
|
|
@@ -431,13 +431,13 @@ var Re = "_2zpuyk0", ze = "_2zpuyk1", Be = "_2zpuyk2", Ve = "_2zpuyk3", He = "_2
|
|
|
431
431
|
},
|
|
432
432
|
renderHTML({ HTMLAttributes: e, node: t }) {
|
|
433
433
|
let n = t.attrs.label ?? "Button", r = P(this.options.HTMLAttributes, e, { "data-type": "button" });
|
|
434
|
-
if (
|
|
434
|
+
if (tt(t.attrs.actionType) === "button") return [
|
|
435
435
|
"div",
|
|
436
436
|
r,
|
|
437
437
|
[
|
|
438
438
|
"button",
|
|
439
439
|
{
|
|
440
|
-
class:
|
|
440
|
+
class: R,
|
|
441
441
|
type: "button"
|
|
442
442
|
},
|
|
443
443
|
n
|
|
@@ -450,8 +450,8 @@ var Re = "_2zpuyk0", ze = "_2zpuyk1", Be = "_2zpuyk2", Ve = "_2zpuyk3", He = "_2
|
|
|
450
450
|
[
|
|
451
451
|
"a",
|
|
452
452
|
{
|
|
453
|
-
class:
|
|
454
|
-
href:
|
|
453
|
+
class: R,
|
|
454
|
+
href: nt(t.attrs.href),
|
|
455
455
|
target: i,
|
|
456
456
|
rel: i === "_blank" ? "noopener noreferrer" : null
|
|
457
457
|
},
|
|
@@ -465,7 +465,7 @@ var Re = "_2zpuyk0", ze = "_2zpuyk1", Be = "_2zpuyk2", Ve = "_2zpuyk3", He = "_2
|
|
|
465
465
|
attrs: e
|
|
466
466
|
}) };
|
|
467
467
|
}
|
|
468
|
-
}),
|
|
468
|
+
}), it = N.create({
|
|
469
469
|
name: "callout",
|
|
470
470
|
group: "layoutBlock",
|
|
471
471
|
content: "block+",
|
|
@@ -522,7 +522,7 @@ var Re = "_2zpuyk0", ze = "_2zpuyk1", Be = "_2zpuyk2", Ve = "_2zpuyk3", He = "_2
|
|
|
522
522
|
unsetCallout: () => ({ commands: e }) => e.lift(this.name)
|
|
523
523
|
};
|
|
524
524
|
}
|
|
525
|
-
}),
|
|
525
|
+
}), at = _e.configure({ defaultLanguage: null }), ot = "_10e5beq0", st = re({
|
|
526
526
|
defaultClassName: "_10e5beq1",
|
|
527
527
|
variantClassNames: { layout: {
|
|
528
528
|
"sidebar-left": "_10e5beq2",
|
|
@@ -531,7 +531,7 @@ var Re = "_2zpuyk0", ze = "_2zpuyk1", Be = "_2zpuyk2", Ve = "_2zpuyk3", He = "_2
|
|
|
531
531
|
} },
|
|
532
532
|
defaultVariants: { layout: "two-column" },
|
|
533
533
|
compoundVariants: []
|
|
534
|
-
}),
|
|
534
|
+
}), ct = N.create({
|
|
535
535
|
name: "column",
|
|
536
536
|
content: "block+",
|
|
537
537
|
isolating: !0,
|
|
@@ -547,7 +547,7 @@ var Re = "_2zpuyk0", ze = "_2zpuyk1", Be = "_2zpuyk2", Ve = "_2zpuyk3", He = "_2
|
|
|
547
547
|
"div",
|
|
548
548
|
P(e, {
|
|
549
549
|
"data-type": "column",
|
|
550
|
-
class:
|
|
550
|
+
class: ot
|
|
551
551
|
}),
|
|
552
552
|
0
|
|
553
553
|
];
|
|
@@ -555,16 +555,16 @@ var Re = "_2zpuyk0", ze = "_2zpuyk1", Be = "_2zpuyk2", Ve = "_2zpuyk3", He = "_2
|
|
|
555
555
|
parseHTML() {
|
|
556
556
|
return [{ tag: "div[data-type=\"column\"]" }];
|
|
557
557
|
}
|
|
558
|
-
}),
|
|
558
|
+
}), lt = /* @__PURE__ */ function(e) {
|
|
559
559
|
return e.SidebarLeft = "sidebar-left", e.SidebarRight = "sidebar-right", e.TwoColumn = "two-column", e;
|
|
560
|
-
}({}),
|
|
560
|
+
}({}), ut = N.create({
|
|
561
561
|
name: "columns",
|
|
562
562
|
group: "layoutBlock",
|
|
563
563
|
content: "column column",
|
|
564
564
|
defining: !0,
|
|
565
565
|
isolating: !0,
|
|
566
566
|
addAttributes() {
|
|
567
|
-
return { layout: { default:
|
|
567
|
+
return { layout: { default: lt.TwoColumn } };
|
|
568
568
|
},
|
|
569
569
|
addCommands() {
|
|
570
570
|
return {
|
|
@@ -577,7 +577,7 @@ var Re = "_2zpuyk0", ze = "_2zpuyk1", Be = "_2zpuyk2", Ve = "_2zpuyk3", He = "_2
|
|
|
577
577
|
"div",
|
|
578
578
|
{
|
|
579
579
|
"data-type": "columns",
|
|
580
|
-
class:
|
|
580
|
+
class: st({ layout: e.layout })
|
|
581
581
|
},
|
|
582
582
|
0
|
|
583
583
|
];
|
|
@@ -585,7 +585,7 @@ var Re = "_2zpuyk0", ze = "_2zpuyk1", Be = "_2zpuyk2", Ve = "_2zpuyk3", He = "_2
|
|
|
585
585
|
parseHTML() {
|
|
586
586
|
return [{ tag: "div[data-type=\"columns\"]" }];
|
|
587
587
|
}
|
|
588
|
-
}),
|
|
588
|
+
}), dt = ve.extend({ content: "(block | layoutBlock)+" }), ft = M.create({
|
|
589
589
|
name: "detailsKit",
|
|
590
590
|
addExtensions() {
|
|
591
591
|
let e = [];
|
|
@@ -595,7 +595,14 @@ var Re = "_2zpuyk0", ze = "_2zpuyk1", Be = "_2zpuyk2", Ve = "_2zpuyk3", He = "_2
|
|
|
595
595
|
...this.options.details || {}
|
|
596
596
|
})), this.options.detailsSummary !== !1 && e.push(xe.configure(this.options.detailsSummary)), this.options.detailsContent !== !1 && e.push(be.configure(this.options.detailsContent)), e;
|
|
597
597
|
}
|
|
598
|
-
}),
|
|
598
|
+
}), pt = [
|
|
599
|
+
"left",
|
|
600
|
+
"center",
|
|
601
|
+
"right"
|
|
602
|
+
], B = (e) => typeof e == "string" && /^\d+(\.\d+)?%$/.test(e), V = (e) => B(e) ? e : null, H = (e) => e && pt.includes(e) ? e : "center", mt = (e) => {
|
|
603
|
+
let t = Number.parseFloat(e);
|
|
604
|
+
return Number.isFinite(t) ? `${Math.min(Math.max(t, 30), 100)}%` : "100%";
|
|
605
|
+
}, U = (e) => B(e) ? { style: `width: ${mt(e)}` } : {}, ht = N.create({
|
|
599
606
|
name: "iframe",
|
|
600
607
|
group: "block",
|
|
601
608
|
atom: !0,
|
|
@@ -610,8 +617,8 @@ var Re = "_2zpuyk0", ze = "_2zpuyk1", Be = "_2zpuyk2", Ve = "_2zpuyk3", He = "_2
|
|
|
610
617
|
src: { default: null },
|
|
611
618
|
width: {
|
|
612
619
|
default: null,
|
|
613
|
-
parseHTML: (e) => e.getAttribute("width"),
|
|
614
|
-
renderHTML: (e) => ({ width: e.width }
|
|
620
|
+
parseHTML: (e) => V(e.parentElement?.style.width) ?? e.getAttribute("width"),
|
|
621
|
+
renderHTML: (e) => B(e.width) ? {} : { width: e.width }
|
|
615
622
|
},
|
|
616
623
|
height: {
|
|
617
624
|
default: null,
|
|
@@ -626,17 +633,25 @@ var Re = "_2zpuyk0", ze = "_2zpuyk1", Be = "_2zpuyk2", Ve = "_2zpuyk3", He = "_2
|
|
|
626
633
|
allowFullScreen: {
|
|
627
634
|
default: this.options.allowFullscreen,
|
|
628
635
|
parseHTML: () => this.options.allowFullscreen
|
|
636
|
+
},
|
|
637
|
+
"data-align": {
|
|
638
|
+
default: "center",
|
|
639
|
+
parseHTML: (e) => H(e.parentElement?.getAttribute("data-align")),
|
|
640
|
+
renderHTML: () => ({})
|
|
629
641
|
}
|
|
630
642
|
};
|
|
631
643
|
},
|
|
632
644
|
parseHTML() {
|
|
633
645
|
return [{ tag: "iframe" }];
|
|
634
646
|
},
|
|
635
|
-
renderHTML({
|
|
647
|
+
renderHTML({ node: e, HTMLAttributes: t }) {
|
|
636
648
|
return [
|
|
637
649
|
"div",
|
|
638
|
-
this.options.HTMLAttributes,
|
|
639
|
-
|
|
650
|
+
P(this.options.HTMLAttributes, {
|
|
651
|
+
"data-align": e.attrs["data-align"],
|
|
652
|
+
...U(e.attrs.width)
|
|
653
|
+
}),
|
|
654
|
+
["iframe", P(t, { frameBorder: "0" })]
|
|
640
655
|
];
|
|
641
656
|
},
|
|
642
657
|
addCommands() {
|
|
@@ -653,13 +668,13 @@ var Re = "_2zpuyk0", ze = "_2zpuyk1", Be = "_2zpuyk2", Ve = "_2zpuyk3", He = "_2
|
|
|
653
668
|
return n && t.replaceRangeWith(r.from, r.to, i), !0;
|
|
654
669
|
} };
|
|
655
670
|
}
|
|
656
|
-
}),
|
|
671
|
+
}), gt = Ce.extend({ renderHTML() {
|
|
657
672
|
return [
|
|
658
673
|
"div",
|
|
659
674
|
P(this.options.HTMLAttributes, { "data-type": this.name }),
|
|
660
675
|
["hr"]
|
|
661
676
|
];
|
|
662
|
-
} }),
|
|
677
|
+
} }), _t = (e) => ({
|
|
663
678
|
src: e.getAttribute("src"),
|
|
664
679
|
alt: e.getAttribute("alt"),
|
|
665
680
|
title: e.getAttribute("title"),
|
|
@@ -667,25 +682,25 @@ var Re = "_2zpuyk0", ze = "_2zpuyk1", Be = "_2zpuyk2", Ve = "_2zpuyk3", He = "_2
|
|
|
667
682
|
height: e.getAttribute("height"),
|
|
668
683
|
srcset: e.getAttribute("srcset")
|
|
669
684
|
});
|
|
670
|
-
function
|
|
685
|
+
function vt(e) {
|
|
671
686
|
let t = { src: e.src || "" };
|
|
672
687
|
return e.alt && (t.alt = e.alt), e.title && (t.title = e.title), e.width && (t.width = e.width), e.height && (t.height = e.height), e.srcset && (t.srcset = e.srcset), t;
|
|
673
688
|
}
|
|
674
|
-
function
|
|
689
|
+
function yt(e, t) {
|
|
675
690
|
let n = e?.trim();
|
|
676
691
|
return n ? t || !n.toLowerCase().startsWith("data:") : !1;
|
|
677
692
|
}
|
|
678
|
-
function
|
|
693
|
+
function bt(e, t) {
|
|
679
694
|
let n = t.toUpperCase();
|
|
680
695
|
return Array.from(e.children).filter((e) => e.tagName === n);
|
|
681
696
|
}
|
|
682
|
-
function
|
|
683
|
-
let n =
|
|
697
|
+
function xt(e, t) {
|
|
698
|
+
let n = bt(e, "img");
|
|
684
699
|
if (n.length !== 1) return null;
|
|
685
700
|
let r = n[0];
|
|
686
|
-
return r &&
|
|
701
|
+
return r && yt(r.getAttribute("src"), t) ? r : null;
|
|
687
702
|
}
|
|
688
|
-
function
|
|
703
|
+
function W(e, t) {
|
|
689
704
|
if (e instanceof F && e.node.type === t) return {
|
|
690
705
|
imageNode: e.node,
|
|
691
706
|
imagePos: e.from,
|
|
@@ -703,7 +718,7 @@ function U(e, t) {
|
|
|
703
718
|
}
|
|
704
719
|
return null;
|
|
705
720
|
}
|
|
706
|
-
function
|
|
721
|
+
function G(e, t) {
|
|
707
722
|
let n = e.view.dom.ownerDocument.getSelection() ?? null;
|
|
708
723
|
if (!n?.isCollapsed || !n.anchorNode || !e.view.dom.contains(n.anchorNode.nodeType === globalThis.Node.ELEMENT_NODE ? n.anchorNode : n.anchorNode.parentElement)) return null;
|
|
709
724
|
try {
|
|
@@ -718,35 +733,35 @@ function W(e, t) {
|
|
|
718
733
|
return null;
|
|
719
734
|
}
|
|
720
735
|
}
|
|
721
|
-
function
|
|
736
|
+
function K(e, t) {
|
|
722
737
|
return e.type === t && !e.attrs.showCaption && e.content.size === 0;
|
|
723
738
|
}
|
|
724
|
-
function
|
|
739
|
+
function q(e, t) {
|
|
725
740
|
let { state: n, view: r } = e, i = I.create(n.doc, t);
|
|
726
741
|
return r.dispatch(n.tr.setSelection(i).scrollIntoView()), !0;
|
|
727
742
|
}
|
|
728
|
-
function
|
|
743
|
+
function J(e, t) {
|
|
729
744
|
let { state: n, view: r } = e;
|
|
730
745
|
return r.dispatch(n.tr.setSelection(F.create(n.doc, t)).scrollIntoView()), !0;
|
|
731
746
|
}
|
|
732
|
-
function
|
|
747
|
+
function St(e, t, n) {
|
|
733
748
|
if (!n) return !1;
|
|
734
749
|
let r = e.doc.resolve(t), i = r.index();
|
|
735
750
|
return r.parent.canReplaceWith(i, i, n) ? (e.insert(t, n.create()), e.setSelection(I.create(e.doc, t + 1)), !0) : !1;
|
|
736
751
|
}
|
|
737
|
-
function
|
|
752
|
+
function Ct(e, t, n, r) {
|
|
738
753
|
let i = e.doc.resolve(t), a = i.parent, o = i.index(), s = t;
|
|
739
|
-
if (n === 1) for (; o < a.childCount &&
|
|
740
|
-
else for (; o > 0 &&
|
|
741
|
-
if ((n === 1 ? o === a.childCount : o === 0) &&
|
|
754
|
+
if (n === 1) for (; o < a.childCount && K(a.child(o), r);) s += a.child(o).nodeSize, o += 1;
|
|
755
|
+
else for (; o > 0 && K(a.child(o - 1), r);) --o, s -= a.child(o).nodeSize;
|
|
756
|
+
if ((n === 1 ? o === a.childCount : o === 0) && St(e, s, r.schema.nodes.paragraph)) return !0;
|
|
742
757
|
let c = pe.findFrom(e.doc.resolve(s), n, !0);
|
|
743
|
-
return c && !(c.$from.parent.type === r &&
|
|
758
|
+
return c && !(c.$from.parent.type === r && K(c.$from.parent, r)) ? (e.setSelection(c), !0) : !1;
|
|
744
759
|
}
|
|
745
|
-
function
|
|
760
|
+
function Y(e, t, n, r) {
|
|
746
761
|
let { state: i, view: a } = e, o = i.tr;
|
|
747
|
-
return
|
|
762
|
+
return Ct(o, t, n, r) ? (a.dispatch(o.scrollIntoView()), !0) : !1;
|
|
748
763
|
}
|
|
749
|
-
function
|
|
764
|
+
function X(e, t) {
|
|
750
765
|
let { $from: n } = e;
|
|
751
766
|
if (!n.parent.isTextblock || n.depth < 1) return null;
|
|
752
767
|
let r = n.depth, i = r - 1, a = n.node(i), o = n.index(i) + t;
|
|
@@ -757,91 +772,91 @@ function Y(e, t) {
|
|
|
757
772
|
position: t === 1 ? s + n.parent.nodeSize : s - c.nodeSize
|
|
758
773
|
};
|
|
759
774
|
}
|
|
760
|
-
function
|
|
775
|
+
function wt(e, t) {
|
|
761
776
|
if (!e.isEditable) return !1;
|
|
762
|
-
let { state: n } = e, r =
|
|
763
|
-
if (r?.atStart) return
|
|
777
|
+
let { state: n } = e, r = W(n.selection, t);
|
|
778
|
+
if (r?.atStart) return Y(e, r.imagePos, -1, t);
|
|
764
779
|
let { selection: i } = n;
|
|
765
780
|
if (!(i instanceof I) || !i.empty || i.$from.parentOffset !== 0) return !1;
|
|
766
|
-
let a =
|
|
767
|
-
return !a || a.node.type !== t ? !1 :
|
|
781
|
+
let a = X(i, -1);
|
|
782
|
+
return !a || a.node.type !== t ? !1 : K(a.node, t) ? Y(e, a.position, -1, t) : q(e, a.position + a.node.nodeSize - 1);
|
|
768
783
|
}
|
|
769
|
-
function
|
|
784
|
+
function Tt(e, t) {
|
|
770
785
|
if (!e.isEditable) return !1;
|
|
771
|
-
let { state: n } = e, r =
|
|
772
|
-
if (r?.atEnd) return
|
|
786
|
+
let { state: n } = e, r = W(n.selection, t);
|
|
787
|
+
if (r?.atEnd) return Y(e, r.imagePos + r.imageNode.nodeSize, 1, t);
|
|
773
788
|
let { selection: i } = n, { $from: a } = i;
|
|
774
789
|
if (!(i instanceof I) || !i.empty || a.parentOffset !== a.parent.content.size) return !1;
|
|
775
|
-
let o =
|
|
776
|
-
if (o?.node.type === t) return
|
|
777
|
-
let s =
|
|
778
|
-
return !!(!o && s &&
|
|
790
|
+
let o = X(i, 1);
|
|
791
|
+
if (o?.node.type === t) return K(o.node, t) ? Y(e, o.position + o.node.nodeSize, 1, t) : q(e, o.position + 1);
|
|
792
|
+
let s = X(i, -1);
|
|
793
|
+
return !!(!o && s && K(s.node, t));
|
|
779
794
|
}
|
|
780
|
-
function
|
|
795
|
+
function Et(e, t) {
|
|
781
796
|
if (!e.isEditable) return !1;
|
|
782
|
-
let { selection: n } = e.state, r =
|
|
783
|
-
if (r && (n instanceof F || n.empty && r.atStart)) return
|
|
797
|
+
let { selection: n } = e.state, r = W(n, t);
|
|
798
|
+
if (r && (n instanceof F || n.empty && r.atStart)) return Y(e, r.imagePos, -1, t);
|
|
784
799
|
if (!(n instanceof I) || !n.empty || n.$from.parentOffset !== 0) return !1;
|
|
785
|
-
let i =
|
|
786
|
-
return !i || i.node.type !== t ? !1 :
|
|
800
|
+
let i = X(n, -1);
|
|
801
|
+
return !i || i.node.type !== t ? !1 : K(i.node, t) ? J(e, i.position) : q(e, i.position + i.node.nodeSize - 1);
|
|
787
802
|
}
|
|
788
|
-
function
|
|
803
|
+
function Dt(e, t) {
|
|
789
804
|
if (!e.isEditable) return !1;
|
|
790
|
-
let { selection: n } = e.state, r =
|
|
791
|
-
if (r && (n instanceof F || n.empty && r.atEnd)) return
|
|
805
|
+
let { selection: n } = e.state, r = W(n, t);
|
|
806
|
+
if (r && (n instanceof F || n.empty && r.atEnd)) return Y(e, r.imagePos + r.imageNode.nodeSize, 1, t);
|
|
792
807
|
if (!(n instanceof I) || !n.empty || n.$from.parentOffset !== n.$from.parent.content.size) return !1;
|
|
793
|
-
let i =
|
|
794
|
-
return !i || i.node.type !== t ? !1 :
|
|
808
|
+
let i = X(n, 1);
|
|
809
|
+
return !i || i.node.type !== t ? !1 : K(i.node, t) ? J(e, i.position) : q(e, i.position + 1);
|
|
795
810
|
}
|
|
796
|
-
function
|
|
811
|
+
function Ot(e, t) {
|
|
797
812
|
if (!e.isEditable) return !1;
|
|
798
|
-
let { state: n, view: r } = e, { selection: i } = n, a =
|
|
813
|
+
let { state: n, view: r } = e, { selection: i } = n, a = W(i, t);
|
|
799
814
|
if (!a) return !1;
|
|
800
815
|
let o = n.tr;
|
|
801
816
|
!(i instanceof F) && !i.empty && o.deleteSelection();
|
|
802
817
|
let s = o.mapping.map(a.imagePos, -1), c = o.doc.nodeAt(s);
|
|
803
818
|
if (!c || c.type !== t) return !1;
|
|
804
819
|
let l = s + c.nodeSize, u = o.doc.resolve(l).nodeAfter, d = n.schema.nodes.paragraph;
|
|
805
|
-
return d && u?.type === d && u.content.size === 0 ? (o.setSelection(I.create(o.doc, l + 1)), r.dispatch(o.scrollIntoView()), !0) :
|
|
820
|
+
return d && u?.type === d && u.content.size === 0 ? (o.setSelection(I.create(o.doc, l + 1)), r.dispatch(o.scrollIntoView()), !0) : St(o, l, d) || Ct(o, l, 1, t) ? (r.dispatch(o.scrollIntoView()), !0) : !1;
|
|
806
821
|
}
|
|
807
|
-
function
|
|
822
|
+
function kt(e, t) {
|
|
808
823
|
if (!e.isEditable) return !1;
|
|
809
|
-
let { state: n, view: r } = e, i =
|
|
824
|
+
let { state: n, view: r } = e, i = W(n.selection, t), a = n.schema.nodes.hardBreak;
|
|
810
825
|
if (!i || n.selection instanceof F || !a || !i.imageNode.contentMatchAt(0).matchType(a)) return !1;
|
|
811
826
|
let o = n.tr.replaceSelectionWith(a.create());
|
|
812
827
|
return r.dispatch(o.scrollIntoView()), !0;
|
|
813
828
|
}
|
|
814
|
-
function
|
|
829
|
+
function At(e, t) {
|
|
815
830
|
if (!e.isEditable) return !1;
|
|
816
831
|
let { state: n, view: r } = e, { selection: i } = n;
|
|
817
|
-
if (i instanceof F && i.node.type === t) return r.dispatch(
|
|
818
|
-
let a =
|
|
819
|
-
if (a?.atStart) return
|
|
820
|
-
if (o && !(i instanceof F) && i.empty && o.atStart) return
|
|
832
|
+
if (i instanceof F && i.node.type === t) return r.dispatch(Te(n.tr.deleteSelection()).scrollIntoView()), !0;
|
|
833
|
+
let a = G(e, t), o = W(i, t);
|
|
834
|
+
if (a?.atStart) return J(e, a.imagePos);
|
|
835
|
+
if (o && !(i instanceof F) && i.empty && o.atStart) return J(e, o.imagePos);
|
|
821
836
|
if (!(i instanceof I) || !i.empty || i.$from.parentOffset !== 0) return !1;
|
|
822
|
-
let s =
|
|
837
|
+
let s = X(i, -1);
|
|
823
838
|
if (!s || s.node.type !== t) return !1;
|
|
824
839
|
let c = i.$from.parent;
|
|
825
840
|
if (c.type.name === "paragraph" && c.content.size === 0) {
|
|
826
841
|
let e = i.$from.before(1), t = i.$from.after(1), a = n.tr.delete(e, t);
|
|
827
842
|
return a.setSelection(F.create(a.doc, s.position)), r.dispatch(a.scrollIntoView()), !0;
|
|
828
843
|
}
|
|
829
|
-
return
|
|
844
|
+
return J(e, s.position);
|
|
830
845
|
}
|
|
831
|
-
function
|
|
846
|
+
function jt(e, t) {
|
|
832
847
|
if (!e.isEditable) return !1;
|
|
833
848
|
let { state: n, view: r } = e, { selection: i } = n;
|
|
834
|
-
if (i instanceof F && i.node.type === t) return r.dispatch(
|
|
835
|
-
let a =
|
|
836
|
-
if (a?.atEnd) return
|
|
837
|
-
if (o && !(i instanceof F) && i.empty && o.atEnd) return
|
|
849
|
+
if (i instanceof F && i.node.type === t) return r.dispatch(Te(n.tr.deleteSelection()).scrollIntoView()), !0;
|
|
850
|
+
let a = G(e, t), o = W(i, t);
|
|
851
|
+
if (a?.atEnd) return J(e, a.imagePos);
|
|
852
|
+
if (o && !(i instanceof F) && i.empty && o.atEnd) return J(e, o.imagePos);
|
|
838
853
|
if (!(i instanceof I) || !i.empty || i.$from.parentOffset !== i.$from.parent.content.size) return !1;
|
|
839
|
-
let s =
|
|
840
|
-
return !s || s.node.type !== t ? !1 :
|
|
854
|
+
let s = X(i, 1);
|
|
855
|
+
return !s || s.node.type !== t ? !1 : J(e, s.position);
|
|
841
856
|
}
|
|
842
|
-
function
|
|
857
|
+
function Mt(e, t) {
|
|
843
858
|
if (!e.isEditable) return !1;
|
|
844
|
-
let { state: n, view: r } = e, i =
|
|
859
|
+
let { state: n, view: r } = e, i = W(n.selection, t) ?? G(e, t);
|
|
845
860
|
if (!i || n.selection instanceof F) return !1;
|
|
846
861
|
let a = n.tr;
|
|
847
862
|
return i.imageNode.content.size === 0 && i.imageNode.attrs.showCaption && (a = a.setNodeMarkup(i.imagePos, void 0, {
|
|
@@ -849,7 +864,7 @@ function Dt(e, t) {
|
|
|
849
864
|
showCaption: !1
|
|
850
865
|
})), a = a.setSelection(F.create(a.doc, i.imagePos)), r.dispatch(a.scrollIntoView()), !0;
|
|
851
866
|
}
|
|
852
|
-
var
|
|
867
|
+
var Nt = we.extend({
|
|
853
868
|
name: "imageBlock",
|
|
854
869
|
content: "inline*",
|
|
855
870
|
isolating: !0,
|
|
@@ -880,9 +895,9 @@ var Ot = we.extend({
|
|
|
880
895
|
return [{
|
|
881
896
|
tag: "figure",
|
|
882
897
|
getAttrs: (e) => {
|
|
883
|
-
let t =
|
|
898
|
+
let t = xt(e, this.options.allowBase64);
|
|
884
899
|
return t ? {
|
|
885
|
-
...
|
|
900
|
+
..._t(t),
|
|
886
901
|
"data-align": e.getAttribute("data-align"),
|
|
887
902
|
"data-link-href": e.getAttribute("data-link-href"),
|
|
888
903
|
"data-id": e.getAttribute("data-id") ?? t.getAttribute("data-id"),
|
|
@@ -890,14 +905,14 @@ var Ot = we.extend({
|
|
|
890
905
|
showCaption: !0
|
|
891
906
|
} : !1;
|
|
892
907
|
},
|
|
893
|
-
contentElement: (e) =>
|
|
908
|
+
contentElement: (e) => bt(e, "figcaption")[0] ?? e.ownerDocument.createElement("figcaption")
|
|
894
909
|
}, {
|
|
895
910
|
tag: "img",
|
|
896
911
|
getAttrs: (e) => {
|
|
897
|
-
if (!
|
|
912
|
+
if (!yt(e.getAttribute("src"), this.options.allowBase64)) return !1;
|
|
898
913
|
let t = e.closest("figure");
|
|
899
|
-
return t &&
|
|
900
|
-
...
|
|
914
|
+
return t && xt(t, this.options.allowBase64) === e ? !1 : {
|
|
915
|
+
..._t(e),
|
|
901
916
|
"data-align": e.getAttribute("data-align"),
|
|
902
917
|
"data-link-href": e.getAttribute("data-link-href"),
|
|
903
918
|
"data-id": e.getAttribute("data-id"),
|
|
@@ -908,7 +923,7 @@ var Ot = we.extend({
|
|
|
908
923
|
}];
|
|
909
924
|
},
|
|
910
925
|
renderHTML({ node: e }) {
|
|
911
|
-
let { src: t, alt: n, title: r, srcset: i, width: a, height: o, showCaption: s } = e.attrs, c = e.attrs["data-align"], l = e.attrs["data-link-href"], u = e.attrs["data-id"], d = e.attrs["data-mimetype"], f =
|
|
926
|
+
let { src: t, alt: n, title: r, srcset: i, width: a, height: o, showCaption: s } = e.attrs, c = e.attrs["data-align"], l = e.attrs["data-link-href"], u = e.attrs["data-id"], d = e.attrs["data-mimetype"], f = vt({
|
|
912
927
|
src: t,
|
|
913
928
|
alt: n,
|
|
914
929
|
title: r,
|
|
@@ -948,19 +963,19 @@ var Ot = we.extend({
|
|
|
948
963
|
let l = t.tr.setSelection(I.create(t.doc, s, c));
|
|
949
964
|
return n.dispatch(l), !0;
|
|
950
965
|
},
|
|
951
|
-
ArrowUp: ({ editor: e }) =>
|
|
952
|
-
ArrowDown: ({ editor: e }) =>
|
|
953
|
-
ArrowLeft: ({ editor: e }) =>
|
|
954
|
-
ArrowRight: ({ editor: e }) =>
|
|
955
|
-
Enter: ({ editor: e }) =>
|
|
956
|
-
"Shift-Enter": ({ editor: e }) =>
|
|
957
|
-
"Mod-Enter": ({ editor: e }) =>
|
|
958
|
-
Backspace: ({ editor: e }) =>
|
|
959
|
-
Delete: ({ editor: e }) =>
|
|
960
|
-
Escape: ({ editor: e }) =>
|
|
966
|
+
ArrowUp: ({ editor: e }) => wt(e, this.type),
|
|
967
|
+
ArrowDown: ({ editor: e }) => Tt(e, this.type),
|
|
968
|
+
ArrowLeft: ({ editor: e }) => Et(e, this.type),
|
|
969
|
+
ArrowRight: ({ editor: e }) => Dt(e, this.type),
|
|
970
|
+
Enter: ({ editor: e }) => Ot(e, this.type),
|
|
971
|
+
"Shift-Enter": ({ editor: e }) => kt(e, this.type),
|
|
972
|
+
"Mod-Enter": ({ editor: e }) => kt(e, this.type),
|
|
973
|
+
Backspace: ({ editor: e }) => At(e, this.type),
|
|
974
|
+
Delete: ({ editor: e }) => jt(e, this.type),
|
|
975
|
+
Escape: ({ editor: e }) => Mt(e, this.type)
|
|
961
976
|
};
|
|
962
977
|
}
|
|
963
|
-
}),
|
|
978
|
+
}), Pt = N.create({
|
|
964
979
|
name: "levoCollection",
|
|
965
980
|
atom: !0,
|
|
966
981
|
group: "block",
|
|
@@ -985,7 +1000,7 @@ var Ot = we.extend({
|
|
|
985
1000
|
renderHTML({ HTMLAttributes: e }) {
|
|
986
1001
|
return ["div", P(e, { "data-type": this.name })];
|
|
987
1002
|
}
|
|
988
|
-
}),
|
|
1003
|
+
}), Ft = he.extend({
|
|
989
1004
|
addOptions() {
|
|
990
1005
|
return {
|
|
991
1006
|
...this.parent?.(),
|
|
@@ -1001,7 +1016,7 @@ var Ot = we.extend({
|
|
|
1001
1016
|
}
|
|
1002
1017
|
};
|
|
1003
1018
|
}
|
|
1004
|
-
}),
|
|
1019
|
+
}), It = M.create({
|
|
1005
1020
|
name: "indentAttribute",
|
|
1006
1021
|
addGlobalAttributes() {
|
|
1007
1022
|
return [{
|
|
@@ -1025,12 +1040,12 @@ var Ot = we.extend({
|
|
|
1025
1040
|
});
|
|
1026
1041
|
//#endregion
|
|
1027
1042
|
//#region ../../libraries/editor-core/dist/extensions/nodeStyling/nodeBackground.js
|
|
1028
|
-
function
|
|
1043
|
+
function Lt(e, t) {
|
|
1029
1044
|
if (e.length === 0) return null;
|
|
1030
1045
|
for (let n of e) if ((n.node.attrs?.backgroundColor ?? null) !== t) return t;
|
|
1031
1046
|
return null;
|
|
1032
1047
|
}
|
|
1033
|
-
var
|
|
1048
|
+
var Rt = M.create({
|
|
1034
1049
|
name: "nodeBackground",
|
|
1035
1050
|
addOptions() {
|
|
1036
1051
|
return {
|
|
@@ -1069,21 +1084,21 @@ var Nt = M.create({
|
|
|
1069
1084
|
return {
|
|
1070
1085
|
setNodeBackgroundColor: e((e, t) => t || null),
|
|
1071
1086
|
unsetNodeBackgroundColor: e(() => null),
|
|
1072
|
-
toggleNodeBackgroundColor: e((e, t) =>
|
|
1087
|
+
toggleNodeBackgroundColor: e((e, t) => Lt(e, t || ""))
|
|
1073
1088
|
};
|
|
1074
1089
|
}
|
|
1075
|
-
}),
|
|
1090
|
+
}), zt = 35, Bt = 120, Vt = Pe.extend({
|
|
1076
1091
|
group: "layoutBlock",
|
|
1077
1092
|
addProseMirrorPlugins() {
|
|
1078
|
-
let e = this.options.resizable && this.editor.isEditable, t = this.options.cellMinWidth <
|
|
1079
|
-
return [...e ? [
|
|
1093
|
+
let e = this.options.resizable && this.editor.isEditable, t = this.options.cellMinWidth < Bt ? Bt : this.options.cellMinWidth;
|
|
1094
|
+
return [...e ? [ke({
|
|
1080
1095
|
handleWidth: this.options.handleWidth,
|
|
1081
|
-
cellMinWidth:
|
|
1096
|
+
cellMinWidth: zt,
|
|
1082
1097
|
defaultCellMinWidth: t,
|
|
1083
1098
|
lastColumnResizable: this.options.lastColumnResizable
|
|
1084
|
-
})] : [],
|
|
1099
|
+
})] : [], Ae({ allowTableNodeSelection: this.options.allowTableNodeSelection })];
|
|
1085
1100
|
}
|
|
1086
|
-
}),
|
|
1101
|
+
}), Ht = je.extend({
|
|
1087
1102
|
content: "paragraph+",
|
|
1088
1103
|
addAttributes() {
|
|
1089
1104
|
return { ...this.parent?.() };
|
|
@@ -1104,7 +1119,7 @@ var Nt = M.create({
|
|
|
1104
1119
|
return {
|
|
1105
1120
|
...this.parent?.(),
|
|
1106
1121
|
"Mod-a": () => {
|
|
1107
|
-
let { state: e, view: t } = this.editor, { selection: n, doc: r } = e, i = n.$anchor, a =
|
|
1122
|
+
let { state: e, view: t } = this.editor, { selection: n, doc: r } = e, i = n.$anchor, a = Oe(i);
|
|
1108
1123
|
if (!a) return !1;
|
|
1109
1124
|
let o = r.nodeAt(a.pos);
|
|
1110
1125
|
if (!o || !o.textContent) return !1;
|
|
@@ -1115,7 +1130,7 @@ var Nt = M.create({
|
|
|
1115
1130
|
}
|
|
1116
1131
|
};
|
|
1117
1132
|
}
|
|
1118
|
-
}),
|
|
1133
|
+
}), Ut = Me.extend({
|
|
1119
1134
|
content: "paragraph+",
|
|
1120
1135
|
addAttributes() {
|
|
1121
1136
|
return { ...this.parent?.() };
|
|
@@ -1132,43 +1147,114 @@ var Nt = M.create({
|
|
|
1132
1147
|
0
|
|
1133
1148
|
];
|
|
1134
1149
|
}
|
|
1135
|
-
}),
|
|
1150
|
+
}), Wt = M.create({
|
|
1136
1151
|
name: "tableKit",
|
|
1137
1152
|
addExtensions() {
|
|
1138
1153
|
let e = [];
|
|
1139
|
-
return this.options.table !== !1 && e.push(
|
|
1154
|
+
return this.options.table !== !1 && e.push(Vt.configure({
|
|
1140
1155
|
...this.options.table,
|
|
1141
1156
|
renderWrapper: !0
|
|
1142
|
-
})), this.options.tableCell !== !1 && e.push(
|
|
1157
|
+
})), this.options.tableCell !== !1 && e.push(Ht.configure(this.options.tableCell)), this.options.tableHeader !== !1 && e.push(Ut.configure(this.options.tableHeader)), this.options.tableRow !== !1 && e.push(Ne.configure(this.options.tableRow)), e;
|
|
1158
|
+
}
|
|
1159
|
+
}), Gt = [
|
|
1160
|
+
"controls",
|
|
1161
|
+
"autoplay",
|
|
1162
|
+
"loop",
|
|
1163
|
+
"muted"
|
|
1164
|
+
], Z = (e) => e.tagName === "VIDEO" ? e : e.querySelector(":scope > video"), Kt = (e) => e.tagName === "VIDEO" ? e.parentElement : e, qt = N.create({
|
|
1165
|
+
name: "videoBlock",
|
|
1166
|
+
group: "block",
|
|
1167
|
+
atom: !0,
|
|
1168
|
+
addAttributes() {
|
|
1169
|
+
return {
|
|
1170
|
+
src: {
|
|
1171
|
+
default: null,
|
|
1172
|
+
parseHTML: (e) => Z(e)?.getAttribute("src"),
|
|
1173
|
+
renderHTML: () => ({})
|
|
1174
|
+
},
|
|
1175
|
+
"data-id": {
|
|
1176
|
+
default: null,
|
|
1177
|
+
parseHTML: (e) => Z(e)?.getAttribute("data-id"),
|
|
1178
|
+
renderHTML: () => ({})
|
|
1179
|
+
},
|
|
1180
|
+
"data-mimetype": {
|
|
1181
|
+
default: null,
|
|
1182
|
+
parseHTML: (e) => Z(e)?.getAttribute("data-mimetype"),
|
|
1183
|
+
renderHTML: () => ({})
|
|
1184
|
+
},
|
|
1185
|
+
width: {
|
|
1186
|
+
default: null,
|
|
1187
|
+
parseHTML: (e) => V(Kt(e)?.style.width),
|
|
1188
|
+
renderHTML: () => ({})
|
|
1189
|
+
},
|
|
1190
|
+
"data-align": {
|
|
1191
|
+
default: "center",
|
|
1192
|
+
parseHTML: (e) => H(Kt(e)?.getAttribute("data-align")),
|
|
1193
|
+
renderHTML: () => ({})
|
|
1194
|
+
},
|
|
1195
|
+
...Object.fromEntries(Gt.map((e) => [e, {
|
|
1196
|
+
default: e === "controls",
|
|
1197
|
+
parseHTML: (t) => Z(t)?.hasAttribute(e) ?? !1,
|
|
1198
|
+
renderHTML: () => ({})
|
|
1199
|
+
}]))
|
|
1200
|
+
};
|
|
1201
|
+
},
|
|
1202
|
+
parseHTML() {
|
|
1203
|
+
return [{ tag: "div[data-type=\"videoBlock\"]" }, {
|
|
1204
|
+
tag: "video",
|
|
1205
|
+
getAttrs: (e) => e.parentElement?.getAttribute("data-type") === "videoBlock" ? !1 : null
|
|
1206
|
+
}];
|
|
1207
|
+
},
|
|
1208
|
+
renderHTML({ node: e }) {
|
|
1209
|
+
let { src: t } = e.attrs, n = e.attrs["data-id"], r = e.attrs["data-mimetype"], i = {
|
|
1210
|
+
playsinline: "",
|
|
1211
|
+
preload: "metadata"
|
|
1212
|
+
};
|
|
1213
|
+
for (let t of Gt) e.attrs[t] && (i[t] = "");
|
|
1214
|
+
return e.attrs.autoplay && (i.muted = ""), t && (i.src = t), n && (i["data-id"] = n), r && (i["data-mimetype"] = r), [
|
|
1215
|
+
"div",
|
|
1216
|
+
{
|
|
1217
|
+
"data-type": "videoBlock",
|
|
1218
|
+
"data-align": e.attrs["data-align"],
|
|
1219
|
+
...U(e.attrs.width)
|
|
1220
|
+
},
|
|
1221
|
+
["video", i]
|
|
1222
|
+
];
|
|
1223
|
+
},
|
|
1224
|
+
addCommands() {
|
|
1225
|
+
return { setVideoBlock: (e) => ({ commands: t }) => t.insertContent({
|
|
1226
|
+
type: this.name,
|
|
1227
|
+
attrs: e
|
|
1228
|
+
}) };
|
|
1143
1229
|
}
|
|
1144
|
-
}),
|
|
1230
|
+
}), Jt = (e) => {
|
|
1145
1231
|
let t = D(10), { label: n, href: r, target: i, actionType: a, onActivate: o } = e, s = n || "Button";
|
|
1146
|
-
if (
|
|
1232
|
+
if (tt(a) === "button") {
|
|
1147
1233
|
let e;
|
|
1148
1234
|
return t[0] !== o || t[1] !== s ? (e = /* @__PURE__ */ k("button", {
|
|
1149
|
-
className:
|
|
1235
|
+
className: R,
|
|
1150
1236
|
type: "button",
|
|
1151
1237
|
onClick: o,
|
|
1152
1238
|
children: s
|
|
1153
1239
|
}), t[0] = o, t[1] = s, t[2] = e) : e = t[2], e;
|
|
1154
1240
|
}
|
|
1155
1241
|
let c = i === "_blank" ? "_blank" : "_self", l;
|
|
1156
|
-
t[3] === r ? l = t[4] : (l =
|
|
1242
|
+
t[3] === r ? l = t[4] : (l = nt(r), t[3] = r, t[4] = l);
|
|
1157
1243
|
let u = l, d = c === "_blank" ? "noopener noreferrer" : void 0, f;
|
|
1158
1244
|
return t[5] !== u || t[6] !== c || t[7] !== d || t[8] !== s ? (f = /* @__PURE__ */ k("a", {
|
|
1159
|
-
className:
|
|
1245
|
+
className: R,
|
|
1160
1246
|
href: u,
|
|
1161
1247
|
target: c,
|
|
1162
1248
|
rel: d,
|
|
1163
1249
|
children: s
|
|
1164
1250
|
}), t[5] = u, t[6] = c, t[7] = d, t[8] = s, t[9] = f) : f = t[9], f;
|
|
1165
|
-
},
|
|
1251
|
+
}, Yt = (e) => {
|
|
1166
1252
|
let t = D(16), { node: n } = e, i;
|
|
1167
1253
|
t[0] === n?.attrs ? i = t[1] : (i = n?.attrs ?? {}, t[0] = n?.attrs, t[1] = i);
|
|
1168
1254
|
let a = i, { openPopup: o } = r(), s = a.popupId, c;
|
|
1169
1255
|
t[2] !== o || t[3] !== s ? (c = s ? () => o(s) : void 0, t[2] = o, t[3] = s, t[4] = c) : c = t[4];
|
|
1170
1256
|
let l;
|
|
1171
|
-
t[5] !== a.actionType || t[6] !== a.href || t[7] !== a.label || t[8] !== a.target || t[9] !== c ? (l = /* @__PURE__ */ k(
|
|
1257
|
+
t[5] !== a.actionType || t[6] !== a.href || t[7] !== a.label || t[8] !== a.target || t[9] !== c ? (l = /* @__PURE__ */ k(Jt, {
|
|
1172
1258
|
label: a.label,
|
|
1173
1259
|
href: a.href,
|
|
1174
1260
|
target: a.target,
|
|
@@ -1183,9 +1269,9 @@ var Nt = M.create({
|
|
|
1183
1269
|
"data-align": a.align,
|
|
1184
1270
|
children: l
|
|
1185
1271
|
}), t[11] = a.align, t[12] = a.size, t[13] = a.variant, t[14] = l, t[15] = u) : u = t[15], u;
|
|
1186
|
-
},
|
|
1187
|
-
throw
|
|
1188
|
-
}),
|
|
1272
|
+
}, Q = null, Xt = () => (Q ??= import("lowlight").then(({ common: e, createLowlight: t }) => t(e)).catch((e) => {
|
|
1273
|
+
throw Q = null, e;
|
|
1274
|
+
}), Q), Zt = (e, t) => {
|
|
1189
1275
|
if (e.type === "text") return e.value;
|
|
1190
1276
|
if (e.type === "element") {
|
|
1191
1277
|
let { className: n, ...r } = e.properties || {};
|
|
@@ -1193,26 +1279,26 @@ var Nt = M.create({
|
|
|
1193
1279
|
key: t,
|
|
1194
1280
|
...r,
|
|
1195
1281
|
className: Array.isArray(n) ? n.join(" ") : n
|
|
1196
|
-
}, e.children?.map((e, n) =>
|
|
1282
|
+
}, e.children?.map((e, n) => Zt(e, `${t}-${n}`)));
|
|
1197
1283
|
}
|
|
1198
1284
|
return null;
|
|
1199
|
-
},
|
|
1285
|
+
}, $ = (e) => {
|
|
1200
1286
|
if (!e) return "";
|
|
1201
1287
|
if (typeof e == "string") return e;
|
|
1202
1288
|
if (e.text) return e.text;
|
|
1203
1289
|
if (typeof e.textContent == "string") return e.textContent;
|
|
1204
1290
|
if (e.content) {
|
|
1205
|
-
if (Array.isArray(e.content)) return e.content.map(
|
|
1291
|
+
if (Array.isArray(e.content)) return e.content.map($).join("");
|
|
1206
1292
|
if (typeof e.content.forEach == "function") {
|
|
1207
1293
|
let t = "";
|
|
1208
1294
|
return e.content.forEach((e) => {
|
|
1209
|
-
t +=
|
|
1295
|
+
t += $(e);
|
|
1210
1296
|
}), t;
|
|
1211
1297
|
}
|
|
1212
1298
|
}
|
|
1213
1299
|
return "";
|
|
1214
|
-
},
|
|
1215
|
-
let n = oe(
|
|
1300
|
+
}, Qt = ({ node: e, children: t }) => {
|
|
1301
|
+
let n = oe(Xt()), r = e?.attrs?.language, i = $(e);
|
|
1216
1302
|
if (!i) return /* @__PURE__ */ k("pre", { children: /* @__PURE__ */ k("code", { children: t }) });
|
|
1217
1303
|
let a;
|
|
1218
1304
|
try {
|
|
@@ -1222,26 +1308,26 @@ var Nt = M.create({
|
|
|
1222
1308
|
}
|
|
1223
1309
|
return !a || !a.children || a.children.length === 0 ? /* @__PURE__ */ k("pre", { children: /* @__PURE__ */ k("code", { children: i }) }) : /* @__PURE__ */ k("pre", { children: /* @__PURE__ */ k("code", {
|
|
1224
1310
|
className: r ? `language-${r}` : "",
|
|
1225
|
-
children: a.children.map((e, t) =>
|
|
1311
|
+
children: a.children.map((e, t) => Zt(e, `code-${t}`))
|
|
1226
1312
|
}) });
|
|
1227
|
-
},
|
|
1313
|
+
}, $t = (e) => {
|
|
1228
1314
|
let t = D(9), n;
|
|
1229
|
-
t[0] === e.node ? n = t[1] : (n =
|
|
1315
|
+
t[0] === e.node ? n = t[1] : (n = $(e.node), t[0] = e.node, t[1] = n);
|
|
1230
1316
|
let r = n, i;
|
|
1231
1317
|
t[2] === r ? i = t[3] : (i = /* @__PURE__ */ k("pre", { children: /* @__PURE__ */ k("code", { children: r }) }), t[2] = r, t[3] = i);
|
|
1232
1318
|
let a;
|
|
1233
|
-
t[4] === e ? a = t[5] : (a = /* @__PURE__ */ k(
|
|
1319
|
+
t[4] === e ? a = t[5] : (a = /* @__PURE__ */ k(Qt, { ...e }), t[4] = e, t[5] = a);
|
|
1234
1320
|
let o;
|
|
1235
1321
|
return t[6] !== i || t[7] !== a ? (o = /* @__PURE__ */ k(ie.Suspense, {
|
|
1236
1322
|
fallback: i,
|
|
1237
1323
|
children: a
|
|
1238
1324
|
}), t[6] = i, t[7] = a, t[8] = o) : o = t[8], o;
|
|
1239
|
-
},
|
|
1325
|
+
}, en = ae({
|
|
1240
1326
|
open: !1,
|
|
1241
1327
|
toggle: () => {}
|
|
1242
|
-
}),
|
|
1328
|
+
}), tn = (e) => {
|
|
1243
1329
|
let t = D(15), { node: n, children: r } = e, [i, a] = j(!!n.attrs?.open), o;
|
|
1244
|
-
t[0] === Symbol.for("react.memo_cache_sentinel") ? (o = () => a(
|
|
1330
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (o = () => a(an), t[0] = o) : o = t[0];
|
|
1245
1331
|
let s = o, c = i && "is-open", l;
|
|
1246
1332
|
t[1] === c ? l = t[2] : (l = te("details", c), t[1] = c, t[2] = l);
|
|
1247
1333
|
let u;
|
|
@@ -1256,7 +1342,7 @@ var Nt = M.create({
|
|
|
1256
1342
|
toggle: s
|
|
1257
1343
|
}, t[5] = i, t[6] = d);
|
|
1258
1344
|
let f;
|
|
1259
|
-
t[7] !== r || t[8] !== d ? (f = /* @__PURE__ */ k("div", { children: /* @__PURE__ */ k(
|
|
1345
|
+
t[7] !== r || t[8] !== d ? (f = /* @__PURE__ */ k("div", { children: /* @__PURE__ */ k(en.Provider, {
|
|
1260
1346
|
value: d,
|
|
1261
1347
|
children: r
|
|
1262
1348
|
}) }), t[7] = r, t[8] = d, t[9] = f) : f = t[9];
|
|
@@ -1266,8 +1352,8 @@ var Nt = M.create({
|
|
|
1266
1352
|
"data-open": i,
|
|
1267
1353
|
children: [u, f]
|
|
1268
1354
|
}), t[10] = i, t[11] = l, t[12] = u, t[13] = f, t[14] = p) : p = t[14], p;
|
|
1269
|
-
},
|
|
1270
|
-
let t = D(7), { children: n } = e, { open: r, toggle: i } = se(
|
|
1355
|
+
}, nn = (e) => {
|
|
1356
|
+
let t = D(7), { children: n } = e, { open: r, toggle: i } = se(en), a;
|
|
1271
1357
|
t[0] === i ? a = t[1] : (a = (e) => {
|
|
1272
1358
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), i());
|
|
1273
1359
|
}, t[0] = i, t[1] = a);
|
|
@@ -1280,8 +1366,8 @@ var Nt = M.create({
|
|
|
1280
1366
|
onKeyDown: a,
|
|
1281
1367
|
children: n
|
|
1282
1368
|
}), t[2] = n, t[3] = r, t[4] = a, t[5] = i, t[6] = o) : o = t[6], o;
|
|
1283
|
-
},
|
|
1284
|
-
let t = D(5), { children: n } = e, { open: r } = se(
|
|
1369
|
+
}, rn = (e) => {
|
|
1370
|
+
let t = D(5), { children: n } = e, { open: r } = se(en), i;
|
|
1285
1371
|
t[0] === r ? i = t[1] : (i = r ? {} : { hidden: !0 }, t[0] = r, t[1] = i);
|
|
1286
1372
|
let a;
|
|
1287
1373
|
return t[2] !== n || t[3] !== i ? (a = /* @__PURE__ */ k("div", {
|
|
@@ -1290,12 +1376,12 @@ var Nt = M.create({
|
|
|
1290
1376
|
children: n
|
|
1291
1377
|
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
1292
1378
|
};
|
|
1293
|
-
function
|
|
1379
|
+
function an(e) {
|
|
1294
1380
|
return !e;
|
|
1295
1381
|
}
|
|
1296
1382
|
//#endregion
|
|
1297
1383
|
//#region ../../libraries/blog-renderer/dist/views/ImageView.cssm.js
|
|
1298
|
-
var
|
|
1384
|
+
var on = "_10kj0ro0", sn = "_10kj0ro1", cn = "_10kj0ro2", ln = (e) => e ? typeof e == "string" && e.endsWith("%") ? e : `${e}px` : "fit-content", un = (e) => {
|
|
1299
1385
|
let t = D(15), { node: n, children: r, imageRef: i, imageProps: a, caption: o } = e, s = n.attrs, { src: c, alt: l, srcset: u, showCaption: d } = s, f = s["data-link-href"], p = n.content.childCount > 0, m = o === void 0 ? r : o, h = (d || p) && m != null;
|
|
1300
1386
|
if (!c) return null;
|
|
1301
1387
|
let g = l || "", _ = u || void 0, v;
|
|
@@ -1304,7 +1390,7 @@ var Xt = "_10kj0ro0", Zt = "_10kj0ro1", Qt = "_10kj0ro2", $t = (e) => e ? typeof
|
|
|
1304
1390
|
src: c,
|
|
1305
1391
|
alt: g,
|
|
1306
1392
|
srcSet: _,
|
|
1307
|
-
className:
|
|
1393
|
+
className: cn,
|
|
1308
1394
|
loading: "lazy",
|
|
1309
1395
|
...a
|
|
1310
1396
|
}), t[0] = a, t[1] = i, t[2] = c, t[3] = g, t[4] = _, t[5] = v) : v = t[5];
|
|
@@ -1322,31 +1408,31 @@ var Xt = "_10kj0ro0", Zt = "_10kj0ro1", Qt = "_10kj0ro2", $t = (e) => e ? typeof
|
|
|
1322
1408
|
}), t[9] = m, t[10] = h, t[11] = x) : x = t[11];
|
|
1323
1409
|
let S;
|
|
1324
1410
|
return t[12] !== b || t[13] !== x ? (S = /* @__PURE__ */ A(ne, { children: [b, x] }), t[12] = b, t[13] = x, t[14] = S) : S = t[14], S;
|
|
1325
|
-
},
|
|
1411
|
+
}, dn = (e) => {
|
|
1326
1412
|
let t = D(13), { node: n, children: r } = e, i = n.attrs, a = i["data-align"];
|
|
1327
1413
|
if (!i.src) return null;
|
|
1328
1414
|
let o;
|
|
1329
|
-
t[0] === i.width ? o = t[1] : (o =
|
|
1415
|
+
t[0] === i.width ? o = t[1] : (o = ln(i.width), t[0] = i.width, t[1] = o);
|
|
1330
1416
|
let s;
|
|
1331
1417
|
t[2] === o ? s = t[3] : (s = { width: o }, t[2] = o, t[3] = s);
|
|
1332
1418
|
let c;
|
|
1333
|
-
t[4] !== r || t[5] !== n ? (c = /* @__PURE__ */ k(
|
|
1419
|
+
t[4] !== r || t[5] !== n ? (c = /* @__PURE__ */ k(un, {
|
|
1334
1420
|
node: n,
|
|
1335
1421
|
children: r
|
|
1336
1422
|
}), t[4] = r, t[5] = n, t[6] = c) : c = t[6];
|
|
1337
1423
|
let l;
|
|
1338
1424
|
t[7] !== s || t[8] !== c ? (l = /* @__PURE__ */ k("div", {
|
|
1339
|
-
className:
|
|
1425
|
+
className: sn,
|
|
1340
1426
|
style: s,
|
|
1341
1427
|
children: c
|
|
1342
1428
|
}), t[7] = s, t[8] = c, t[9] = l) : l = t[9];
|
|
1343
1429
|
let u;
|
|
1344
1430
|
return t[10] !== a || t[11] !== l ? (u = /* @__PURE__ */ k("div", {
|
|
1345
1431
|
"data-align": a,
|
|
1346
|
-
className:
|
|
1432
|
+
className: on,
|
|
1347
1433
|
children: l
|
|
1348
1434
|
}), t[10] = a, t[11] = l, t[12] = u) : u = t[12], u;
|
|
1349
|
-
},
|
|
1435
|
+
}, fn = "_1dotpmp0", pn = (t) => {
|
|
1350
1436
|
let n = D(10), { collectionId: r, workspaceId: i, preview: a, variant: o } = t, s = a === void 0 ? !1 : a, c = o ?? void 0, l;
|
|
1351
1437
|
n[0] === Symbol.for("react.memo_cache_sentinel") ? (l = {
|
|
1352
1438
|
show: !0,
|
|
@@ -1370,31 +1456,55 @@ var Xt = "_10kj0ro0", Zt = "_10kj0ro1", Qt = "_10kj0ro2", $t = (e) => e ? typeof
|
|
|
1370
1456
|
uiConfig: u,
|
|
1371
1457
|
theme: d
|
|
1372
1458
|
}), n[4] = r, n[5] = s, n[6] = c, n[7] = d, n[8] = i, n[9] = f) : f = n[9], f;
|
|
1373
|
-
},
|
|
1459
|
+
}, mn = (e) => {
|
|
1374
1460
|
let n = D(4), { node: r } = e, i = r?.attrs?.collectionId, a = r?.attrs?.variant, { workspace: o } = t();
|
|
1375
1461
|
if (!i || !o) return null;
|
|
1376
1462
|
let s;
|
|
1377
1463
|
return n[0] !== i || n[1] !== a || n[2] !== o ? (s = /* @__PURE__ */ k("div", {
|
|
1378
|
-
className:
|
|
1379
|
-
children: /* @__PURE__ */ k(
|
|
1464
|
+
className: fn,
|
|
1465
|
+
children: /* @__PURE__ */ k(pn, {
|
|
1380
1466
|
collectionId: i,
|
|
1381
1467
|
workspaceId: o,
|
|
1382
1468
|
variant: a
|
|
1383
1469
|
})
|
|
1384
1470
|
}), n[0] = i, n[1] = a, n[2] = o, n[3] = s) : s = n[3], s;
|
|
1385
|
-
},
|
|
1471
|
+
}, hn = (e) => {
|
|
1472
|
+
let t = D(14), { node: n } = e, r = n.attrs;
|
|
1473
|
+
if (!r.src) return null;
|
|
1474
|
+
let i = r["data-align"] ?? "center", a;
|
|
1475
|
+
t[0] === r.width ? a = t[1] : (a = B(r.width) ? { width: mt(r.width) } : void 0, t[0] = r.width, t[1] = a);
|
|
1476
|
+
let o = r["data-id"] ?? void 0, s = r["data-mimetype"] ?? void 0, c = r.muted || r.autoplay, l;
|
|
1477
|
+
t[2] !== r.autoplay || t[3] !== r.controls || t[4] !== r.loop || t[5] !== r.src || t[6] !== o || t[7] !== s || t[8] !== c ? (l = /* @__PURE__ */ k("video", {
|
|
1478
|
+
src: r.src,
|
|
1479
|
+
"data-id": o,
|
|
1480
|
+
"data-mimetype": s,
|
|
1481
|
+
controls: r.controls,
|
|
1482
|
+
autoPlay: r.autoplay,
|
|
1483
|
+
loop: r.loop,
|
|
1484
|
+
muted: c,
|
|
1485
|
+
playsInline: !0,
|
|
1486
|
+
preload: "metadata"
|
|
1487
|
+
}), t[2] = r.autoplay, t[3] = r.controls, t[4] = r.loop, t[5] = r.src, t[6] = o, t[7] = s, t[8] = c, t[9] = l) : l = t[9];
|
|
1488
|
+
let u;
|
|
1489
|
+
return t[10] !== i || t[11] !== a || t[12] !== l ? (u = /* @__PURE__ */ k("div", {
|
|
1490
|
+
"data-type": "videoBlock",
|
|
1491
|
+
"data-align": i,
|
|
1492
|
+
style: a,
|
|
1493
|
+
children: l
|
|
1494
|
+
}), t[10] = i, t[11] = a, t[12] = l, t[13] = u) : u = t[13], u;
|
|
1495
|
+
}, gn = /^((?:https?:)?\/\/)?((?:www|m|music)\.)?((?:youtube\.com|youtu\.be|youtube-nocookie\.com))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/, _n = /^((?:https?:)?\/\/)?((?:www|m|music)\.)?((?:youtube\.com|youtu\.be|youtube-nocookie\.com))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/g, vn = (e) => e.match(gn), yn = (e, t) => t ? "https://www.youtube-nocookie.com/embed/videoseries?list=" : e ? "https://www.youtube-nocookie.com/embed/" : "https://www.youtube.com/embed/", bn = (e) => {
|
|
1386
1496
|
let { url: t, allowFullscreen: n, autoplay: r, ccLanguage: i, ccLoadPolicy: a, controls: o, disableKBcontrols: s, enableIFrameApi: c, endTime: l, interfaceLanguage: u, ivLoadPolicy: d, loop: f, modestBranding: p, nocookie: m, origin: h, playlist: g, progressBarColor: _, startAt: v, rel: y } = e;
|
|
1387
|
-
if (
|
|
1497
|
+
if (!vn(t)) return null;
|
|
1388
1498
|
if (t.includes("/embed/")) return t;
|
|
1389
1499
|
if (t.includes("youtu.be")) {
|
|
1390
1500
|
let e = t.split("/").pop();
|
|
1391
|
-
return e ? `${
|
|
1501
|
+
return e ? `${yn(m)}${e}` : null;
|
|
1392
1502
|
}
|
|
1393
1503
|
let b = /(?:(v|list)=|shorts\/)([-\w]+)/gm.exec(t);
|
|
1394
1504
|
if (!b || !b[2]) return null;
|
|
1395
|
-
let x = `${
|
|
1505
|
+
let x = `${yn(m, b[1] === "list")}${b[2]}`, S = [];
|
|
1396
1506
|
return n === !1 && S.push("fs=0"), r && S.push("autoplay=1"), i && S.push(`cc_lang_pref=${i}`), a && S.push("cc_load_policy=1"), o || S.push("controls=0"), s && S.push("disablekb=1"), c && S.push("enablejsapi=1"), l && S.push(`end=${l}`), u && S.push(`hl=${u}`), d && S.push(`iv_load_policy=${d}`), f && S.push("loop=1"), p && S.push("modestbranding=1"), h && S.push(`origin=${h}`), g && S.push(`playlist=${g}`), v && S.push(`start=${v}`), _ && S.push(`color=${_}`), y !== void 0 && S.push(`rel=${y}`), S.length && (x += `${b[1] === "list" ? "&" : "?"}${S.join("&")}`), x;
|
|
1397
|
-
},
|
|
1507
|
+
}, xn = (e) => {
|
|
1398
1508
|
let t;
|
|
1399
1509
|
try {
|
|
1400
1510
|
t = new URL(e);
|
|
@@ -1413,23 +1523,23 @@ var Xt = "_10kj0ro0", Zt = "_10kj0ro1", Qt = "_10kj0ro2", $t = (e) => e ? typeof
|
|
|
1413
1523
|
if (!e?.[1]) return null;
|
|
1414
1524
|
r = `https://www.youtube.com/watch?v=${e[1]}`;
|
|
1415
1525
|
}
|
|
1416
|
-
if (
|
|
1526
|
+
if (!vn(r)) return null;
|
|
1417
1527
|
let i = { src: r }, a = t.searchParams.get("start");
|
|
1418
1528
|
if (a) {
|
|
1419
1529
|
let e = Number.parseInt(a, 10);
|
|
1420
1530
|
Number.isNaN(e) || (i.start = e);
|
|
1421
1531
|
}
|
|
1422
1532
|
return i;
|
|
1423
|
-
},
|
|
1533
|
+
}, Sn = (e) => {
|
|
1424
1534
|
if (!e) return null;
|
|
1425
1535
|
let t = e.trim();
|
|
1426
1536
|
if (t === "") return null;
|
|
1427
1537
|
let n = Number(t);
|
|
1428
1538
|
return Number.isNaN(n) ? t : n;
|
|
1429
|
-
},
|
|
1539
|
+
}, Cn = (e) => {
|
|
1430
1540
|
let t = e.getAttribute("src");
|
|
1431
|
-
return t ?
|
|
1432
|
-
},
|
|
1541
|
+
return t ? xn(t) || { src: t } : null;
|
|
1542
|
+
}, wn = N.create({
|
|
1433
1543
|
name: "youtube",
|
|
1434
1544
|
addOptions() {
|
|
1435
1545
|
return {
|
|
@@ -1468,19 +1578,19 @@ var Xt = "_10kj0ro0", Zt = "_10kj0ro1", Qt = "_10kj0ro2", $t = (e) => e ? typeof
|
|
|
1468
1578
|
return {
|
|
1469
1579
|
src: {
|
|
1470
1580
|
default: null,
|
|
1471
|
-
parseHTML: (e) =>
|
|
1581
|
+
parseHTML: (e) => Cn(e)?.src
|
|
1472
1582
|
},
|
|
1473
1583
|
start: {
|
|
1474
1584
|
default: 0,
|
|
1475
|
-
parseHTML: (e) =>
|
|
1585
|
+
parseHTML: (e) => Cn(e)?.start
|
|
1476
1586
|
},
|
|
1477
1587
|
width: {
|
|
1478
1588
|
default: this.options.width,
|
|
1479
|
-
parseHTML: (e) =>
|
|
1589
|
+
parseHTML: (e) => Sn(e.getAttribute("width"))
|
|
1480
1590
|
},
|
|
1481
1591
|
height: {
|
|
1482
1592
|
default: this.options.height,
|
|
1483
|
-
parseHTML: (e) =>
|
|
1593
|
+
parseHTML: (e) => Sn(e.getAttribute("height"))
|
|
1484
1594
|
}
|
|
1485
1595
|
};
|
|
1486
1596
|
},
|
|
@@ -1488,20 +1598,20 @@ var Xt = "_10kj0ro0", Zt = "_10kj0ro1", Qt = "_10kj0ro2", $t = (e) => e ? typeof
|
|
|
1488
1598
|
return [{ tag: "div[data-youtube-video] iframe" }];
|
|
1489
1599
|
},
|
|
1490
1600
|
addCommands() {
|
|
1491
|
-
return { setYoutubeVideo: (e) => ({ commands: t }) =>
|
|
1601
|
+
return { setYoutubeVideo: (e) => ({ commands: t }) => vn(e.src) ? t.insertContent({
|
|
1492
1602
|
type: this.name,
|
|
1493
1603
|
attrs: e
|
|
1494
1604
|
}) : !1 };
|
|
1495
1605
|
},
|
|
1496
1606
|
addPasteRules() {
|
|
1497
1607
|
return this.options.addPasteHandler ? [fe({
|
|
1498
|
-
find:
|
|
1608
|
+
find: _n,
|
|
1499
1609
|
type: this.type,
|
|
1500
1610
|
getAttributes: (e) => ({ src: e.input })
|
|
1501
1611
|
})] : [];
|
|
1502
1612
|
},
|
|
1503
1613
|
renderHTML({ HTMLAttributes: e }) {
|
|
1504
|
-
return e.src =
|
|
1614
|
+
return e.src = bn({
|
|
1505
1615
|
url: e.src,
|
|
1506
1616
|
allowFullscreen: this.options.allowFullscreen,
|
|
1507
1617
|
autoplay: this.options.autoplay,
|
|
@@ -1554,8 +1664,40 @@ var Xt = "_10kj0ro0", Zt = "_10kj0ro1", Qt = "_10kj0ro2", $t = (e) => e ? typeof
|
|
|
1554
1664
|
"start"
|
|
1555
1665
|
]
|
|
1556
1666
|
})
|
|
1557
|
-
})
|
|
1558
|
-
|
|
1667
|
+
}).extend({
|
|
1668
|
+
addAttributes() {
|
|
1669
|
+
let e = this.parent?.() ?? {};
|
|
1670
|
+
return {
|
|
1671
|
+
...e,
|
|
1672
|
+
width: {
|
|
1673
|
+
...e.width,
|
|
1674
|
+
parseHTML: (t) => V(t.parentElement?.style.width) ?? e.width?.parseHTML?.(t),
|
|
1675
|
+
renderHTML: (e) => B(e.width) ? {} : { width: e.width }
|
|
1676
|
+
},
|
|
1677
|
+
"data-align": {
|
|
1678
|
+
default: "center",
|
|
1679
|
+
parseHTML: (e) => H(e.parentElement?.getAttribute("data-align")),
|
|
1680
|
+
renderHTML: () => ({})
|
|
1681
|
+
}
|
|
1682
|
+
};
|
|
1683
|
+
},
|
|
1684
|
+
renderHTML(e) {
|
|
1685
|
+
let [t, n, r] = this.parent?.(e);
|
|
1686
|
+
return [
|
|
1687
|
+
t,
|
|
1688
|
+
P(n, {
|
|
1689
|
+
"data-align": e.node.attrs["data-align"],
|
|
1690
|
+
...U(e.node.attrs.width)
|
|
1691
|
+
}),
|
|
1692
|
+
r
|
|
1693
|
+
];
|
|
1694
|
+
}
|
|
1695
|
+
}).configure({
|
|
1696
|
+
allowFullscreen: !0,
|
|
1697
|
+
nocookie: !0,
|
|
1698
|
+
HTMLAttributes: { referrerpolicy: "strict-origin-when-cross-origin" }
|
|
1699
|
+
}), Tn = [
|
|
1700
|
+
dt,
|
|
1559
1701
|
h,
|
|
1560
1702
|
d,
|
|
1561
1703
|
s,
|
|
@@ -1569,17 +1711,17 @@ var Xt = "_10kj0ro0", Zt = "_10kj0ro1", Qt = "_10kj0ro2", $t = (e) => e ? typeof
|
|
|
1569
1711
|
me,
|
|
1570
1712
|
c,
|
|
1571
1713
|
_,
|
|
1572
|
-
|
|
1714
|
+
Ft,
|
|
1573
1715
|
Se,
|
|
1574
1716
|
i,
|
|
1717
|
+
Le,
|
|
1575
1718
|
Ie,
|
|
1576
1719
|
Fe,
|
|
1577
|
-
Pe,
|
|
1578
1720
|
g,
|
|
1579
1721
|
b.configure({ multicolor: !0 }),
|
|
1580
|
-
|
|
1722
|
+
Rt,
|
|
1581
1723
|
x,
|
|
1582
|
-
|
|
1724
|
+
Re.configure({ types: [
|
|
1583
1725
|
"table",
|
|
1584
1726
|
"paragraph",
|
|
1585
1727
|
"bulletList",
|
|
@@ -1589,44 +1731,42 @@ var Xt = "_10kj0ro0", Zt = "_10kj0ro1", Qt = "_10kj0ro2", $t = (e) => e ? typeof
|
|
|
1589
1731
|
"blockquoteFigure",
|
|
1590
1732
|
"codeBlock"
|
|
1591
1733
|
] }),
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1734
|
+
De.configure({ itemTypeName: "taskItem" }),
|
|
1735
|
+
Ee.configure({ nested: !0 }),
|
|
1736
|
+
Wt.configure({ table: { cellMinWidth: 120 } }),
|
|
1737
|
+
Nt,
|
|
1738
|
+
It,
|
|
1597
1739
|
C,
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
st,
|
|
1601
|
-
at,
|
|
1602
|
-
dt,
|
|
1603
|
-
lt,
|
|
1604
|
-
tt,
|
|
1605
|
-
nt,
|
|
1606
|
-
pn.configure({
|
|
1607
|
-
allowFullscreen: !0,
|
|
1608
|
-
nocookie: !0,
|
|
1609
|
-
HTMLAttributes: { referrerpolicy: "strict-origin-when-cross-origin" }
|
|
1610
|
-
}),
|
|
1740
|
+
$e,
|
|
1741
|
+
rt,
|
|
1611
1742
|
ut,
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1743
|
+
ct,
|
|
1744
|
+
gt,
|
|
1745
|
+
ft,
|
|
1746
|
+
it,
|
|
1747
|
+
at,
|
|
1748
|
+
wn,
|
|
1749
|
+
ht,
|
|
1750
|
+
qt,
|
|
1751
|
+
Pt,
|
|
1752
|
+
et
|
|
1753
|
+
], En = (e) => m(e, Tn), Dn = (e) => {
|
|
1615
1754
|
let t = D(18), n, r, i, a, o;
|
|
1616
1755
|
t[0] === e ? (n = t[1], r = t[2], i = t[3], a = t[4], o = t[5]) : ({content: r, className: n, ref: i, theme: o, ...a} = e, t[0] = e, t[1] = n, t[2] = r, t[3] = i, t[4] = a, t[5] = o);
|
|
1617
1756
|
let s;
|
|
1618
1757
|
t[6] === r ? s = t[7] : (s = y({
|
|
1619
1758
|
content: r,
|
|
1620
|
-
extensions:
|
|
1759
|
+
extensions: Tn,
|
|
1621
1760
|
options: { nodeMapping: {
|
|
1622
|
-
bookmark:
|
|
1623
|
-
button:
|
|
1624
|
-
details:
|
|
1625
|
-
detailsSummary:
|
|
1626
|
-
detailsContent:
|
|
1627
|
-
codeBlock:
|
|
1628
|
-
imageBlock:
|
|
1629
|
-
levoCollection:
|
|
1761
|
+
bookmark: Ye,
|
|
1762
|
+
button: Yt,
|
|
1763
|
+
details: tn,
|
|
1764
|
+
detailsSummary: nn,
|
|
1765
|
+
detailsContent: rn,
|
|
1766
|
+
codeBlock: $t,
|
|
1767
|
+
imageBlock: dn,
|
|
1768
|
+
levoCollection: mn,
|
|
1769
|
+
videoBlock: hn
|
|
1630
1770
|
} }
|
|
1631
1771
|
}), t[6] = r, t[7] = s);
|
|
1632
1772
|
let c = s, l;
|
|
@@ -1643,18 +1783,18 @@ var Xt = "_10kj0ro0", Zt = "_10kj0ro1", Qt = "_10kj0ro2", $t = (e) => e ? typeof
|
|
|
1643
1783
|
theme: o,
|
|
1644
1784
|
children: u
|
|
1645
1785
|
}), t[15] = u, t[16] = o, t[17] = d) : d = t[17], d;
|
|
1646
|
-
},
|
|
1786
|
+
}, On = (e) => {
|
|
1647
1787
|
if (!e) return null;
|
|
1648
|
-
if (typeof e == "string") return e.trim() ?
|
|
1788
|
+
if (typeof e == "string") return e.trim() ? En(e) : null;
|
|
1649
1789
|
if (typeof e != "object") return null;
|
|
1650
1790
|
let t = e;
|
|
1651
|
-
return t.json ? t.json : typeof t.html == "string" ? t.html.trim() ?
|
|
1652
|
-
},
|
|
1653
|
-
let n =
|
|
1654
|
-
return n ? /* @__PURE__ */ k(
|
|
1791
|
+
return t.json ? t.json : typeof t.html == "string" ? t.html.trim() ? En(t.html) : null : t.type === "doc" ? t : null;
|
|
1792
|
+
}, kn = ({ content: e, ...t }) => {
|
|
1793
|
+
let n = On(e);
|
|
1794
|
+
return n ? /* @__PURE__ */ k(Dn, {
|
|
1655
1795
|
content: n,
|
|
1656
1796
|
...t
|
|
1657
1797
|
}) : null;
|
|
1658
1798
|
};
|
|
1659
1799
|
//#endregion
|
|
1660
|
-
export {
|
|
1800
|
+
export { kn as LevoBlogContent };
|