@levo-so/site-runtime 0.3.8 → 0.3.10
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/{DateTimeWidget-hFjcn3o6.js → DateTimeWidget-U3lD0q1q.js} +1 -1
- package/{KBChatWidget-ClHFDgJ5.js → KBChatWidget-ByOwQQNg.js} +404 -397
- package/PopupBody-BI-MJqmd-DW3qWKam.js +159 -0
- package/PopupRenderer-D66Gx63H-BnOmWsyj.js +388 -0
- package/RichTextWidget-DfakML79.js +749 -0
- package/RteThemeProvider-BQmfSXSl.js +20 -0
- package/{nodeAlignment-BnJljFlw.js → content.cssm-XdMsTGIB.js} +24 -32
- package/{dist-CRDgdAkQ.js → dist-BdNHqoWi.js} +498 -466
- package/{dist-DPmVG7VB.js → dist-Cl_sKk9y.js} +3 -3
- package/index.d.ts +539 -9
- package/index.js +998 -798
- package/inlineRteTheme-CRPtkNXy.js +10 -0
- package/{kbChat-C00LVlxP.js → kbChat-GBcfFoss.js} +15 -15
- package/package.json +41 -27
- package/pillChrome-_hpGdrBS.js +50 -0
- package/popups.js +1 -1
- package/{PopupBody-DZVwDLkg-Cfy3lWGs.js → react-Cj_U6VZQ.js} +816 -850
- package/rich-text.d.ts +25 -0
- package/rich-text.js +1644 -0
- package/routes-CyKmkoRM.js +316 -0
- package/start.d.ts +38 -0
- package/start.js +19 -0
- package/styles.css +1 -1
- package/{usePopupRedirect-BThP_YPW-COUseDik.js → usePopupRedirect-CAAdcpaW-Ddjyf4KK.js} +15 -13
- package/PopupRenderer-BjW1jg70-W2y-PEPH.js +0 -387
- package/RichTextWidget-DkKHEq4j.js +0 -759
- package/pillChrome-BAu5AfCT.js +0 -30
- /package/{PhoneWidget-BmBO-kvA.js → PhoneWidget-DQQa4bL6.js} +0 -0
- /package/{Popover-3N88sRp4.js → Popover-C29yJ7rz.js} +0 -0
- /package/{es-CztjLuNy.js → es-ByBbirnH.js} +0 -0
- /package/{popupState-JmpeKzgM-qhNTV79U.js → popupState-JmpeKzgM-D_77LiAa.js} +0 -0
- /package/{react-CV3jf2mc.js → react-B9yvlbH0.js} +0 -0
- /package/{rteTheme.cssm-xg0gJ28J.js → rteTheme.cssm-W4gTOijw.js} +0 -0
package/rich-text.js
ADDED
|
@@ -0,0 +1,1644 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { r as e } from "./dist-BdNHqoWi.js";
|
|
3
|
+
import { t } from "./LevoProvider-Bsjkcwc8.js";
|
|
4
|
+
import { t as n } from "./inlineBaseTheme-BB9e6h5f.js";
|
|
5
|
+
import { t as r } from "./dist-Cl_sKk9y.js";
|
|
6
|
+
import { _ as i, a, c as o, d as s, f as c, g as l, h as u, i as d, l as f, m as p, n as m, o as h, p as g, r as _, s as v, t as y, u as b, v as x } from "./react-Cj_U6VZQ.js";
|
|
7
|
+
import { i as S, n as C, r as w, t as T } from "./content.cssm-XdMsTGIB.js";
|
|
8
|
+
import { t as E } from "./RteThemeProvider-BQmfSXSl.js";
|
|
9
|
+
import { getLevoError as ee } from "@levo-so/core";
|
|
10
|
+
import { c as D } from "react/compiler-runtime";
|
|
11
|
+
import O, { clsx as te } from "clsx";
|
|
12
|
+
import { Fragment as ne, jsx as k, jsxs as A } from "react/jsx-runtime";
|
|
13
|
+
import { createRuntimeFn as re } from "@vanilla-extract/recipes/createRuntimeFn";
|
|
14
|
+
import ie, { createContext as ae, use as oe, useContext as se, useEffect as ce, useState as j } from "react";
|
|
15
|
+
import { Extension as M, InputRule as le, Node as N, createAtomBlockMarkdownSpec as ue, isNodeSelection as de, mergeAttributes as P, nodePasteRule as fe } from "@tiptap/core";
|
|
16
|
+
import { NodeSelection as F, Selection as pe, TextSelection as I } from "@tiptap/pm/state";
|
|
17
|
+
import { Blockquote as me } from "@tiptap/extension-blockquote";
|
|
18
|
+
import { Link as he, isAllowedUri as ge } from "@tiptap/extension-link";
|
|
19
|
+
import { CodeBlock as _e } from "@tiptap/extension-code-block";
|
|
20
|
+
import { Document as ve } from "@tiptap/extension-document";
|
|
21
|
+
import { Details as ye, DetailsContent as be, DetailsSummary as xe } from "@tiptap/extension-details";
|
|
22
|
+
import { TextStyle as Se } from "@tiptap/extension-text-style";
|
|
23
|
+
import Ce from "@tiptap/extension-horizontal-rule";
|
|
24
|
+
import { Image as we } from "@tiptap/extension-image";
|
|
25
|
+
import { closeHistory as L } from "@tiptap/pm/history";
|
|
26
|
+
import { TaskItem as Te, TaskList as Ee } from "@tiptap/extension-list";
|
|
27
|
+
import { cellAround as De, columnResizing as Oe, tableEditing as ke } from "@tiptap/pm/tables";
|
|
28
|
+
import { TableCell as Ae, TableHeader as je, TableRow as Me } from "@tiptap/extension-table";
|
|
29
|
+
import { Table as Ne } from "@tiptap/extension-table/table";
|
|
30
|
+
import { Subscript as Pe } from "@tiptap/extension-subscript";
|
|
31
|
+
import { Superscript as Fe } from "@tiptap/extension-superscript";
|
|
32
|
+
import { Typography as Ie } from "@tiptap/extension-typography";
|
|
33
|
+
import { UniqueID as Le } from "@tiptap/extension-unique-id";
|
|
34
|
+
//#region ../../libraries/blog-renderer/dist/views/BookmarkView.cssm.js
|
|
35
|
+
var Re = "_2zpuyk0", ze = "_2zpuyk1", Be = "_2zpuyk2", Ve = "_2zpuyk3", He = "_2zpuyk4", Ue = "_2zpuyk6 _2zpuyk5", We = "_2zpuyk7 _2zpuyk5", Ge = "_2zpuyk9", R = "_2zpuyka", Ke = "_2zpuykb", qe = (e) => {
|
|
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
|
+
if (n[0] !== c || n[1] !== r || n[2] !== u || n[3] !== i || n[4] !== d ? (g = () => {
|
|
38
|
+
if (!r || !i) {
|
|
39
|
+
p(!1);
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
let e = !0;
|
|
43
|
+
return p(!0), c?.getSingleBlog(r, i, d ? { workspace_id: d } : void 0).then((t) => {
|
|
44
|
+
e && h(t?.content?.data ?? null);
|
|
45
|
+
}).catch((t) => {
|
|
46
|
+
if (!e) return;
|
|
47
|
+
let n = ee(t);
|
|
48
|
+
u?.error("Failed to fetch bookmark post", { exception: n }), h(null);
|
|
49
|
+
}).finally(() => {
|
|
50
|
+
e && p(!1);
|
|
51
|
+
}), () => {
|
|
52
|
+
e = !1;
|
|
53
|
+
};
|
|
54
|
+
}, _ = [
|
|
55
|
+
c,
|
|
56
|
+
r,
|
|
57
|
+
i,
|
|
58
|
+
d,
|
|
59
|
+
u
|
|
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
|
+
let e;
|
|
62
|
+
n[7] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ k("div", { className: We }), n[7] = e) : e = n[7];
|
|
63
|
+
let t;
|
|
64
|
+
n[8] === Symbol.for("react.memo_cache_sentinel") ? (t = /* @__PURE__ */ k("div", {
|
|
65
|
+
className: R,
|
|
66
|
+
style: {
|
|
67
|
+
height: "1rem",
|
|
68
|
+
width: "65%"
|
|
69
|
+
}
|
|
70
|
+
}), n[8] = t) : t = n[8];
|
|
71
|
+
let r;
|
|
72
|
+
n[9] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ k("div", {
|
|
73
|
+
className: R,
|
|
74
|
+
style: { width: "100%" }
|
|
75
|
+
}), n[9] = r) : r = n[9];
|
|
76
|
+
let i;
|
|
77
|
+
n[10] === Symbol.for("react.memo_cache_sentinel") ? (i = /* @__PURE__ */ k("div", {
|
|
78
|
+
className: R,
|
|
79
|
+
style: { width: "92%" }
|
|
80
|
+
}), n[10] = i) : i = n[10];
|
|
81
|
+
let a;
|
|
82
|
+
return n[11] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ k("div", {
|
|
83
|
+
className: Re,
|
|
84
|
+
children: /* @__PURE__ */ A("div", {
|
|
85
|
+
className: `${ze} ${Ge}`,
|
|
86
|
+
children: [e, /* @__PURE__ */ A("div", {
|
|
87
|
+
className: Be,
|
|
88
|
+
children: [t, /* @__PURE__ */ A("div", {
|
|
89
|
+
className: Ke,
|
|
90
|
+
children: [
|
|
91
|
+
r,
|
|
92
|
+
i,
|
|
93
|
+
/* @__PURE__ */ k("div", {
|
|
94
|
+
className: R,
|
|
95
|
+
style: { width: "60%" }
|
|
96
|
+
})
|
|
97
|
+
]
|
|
98
|
+
})]
|
|
99
|
+
})]
|
|
100
|
+
})
|
|
101
|
+
}), n[11] = a) : a = n[11], a;
|
|
102
|
+
}
|
|
103
|
+
if (!m) return null;
|
|
104
|
+
let v = m.cover_image?.location, y = m.canonical_url || void 0, b = s ? y : void 0, x;
|
|
105
|
+
n[12] === s ? x = n[13] : (x = s ? void 0 : { pointerEvents: "none" }, n[12] = s, n[13] = x);
|
|
106
|
+
let S = s ? void 0 : -1, C;
|
|
107
|
+
n[14] !== v || n[15] !== m.title ? (C = v ? /* @__PURE__ */ k("img", {
|
|
108
|
+
className: Ue,
|
|
109
|
+
src: v,
|
|
110
|
+
alt: m.title,
|
|
111
|
+
loading: "lazy"
|
|
112
|
+
}) : /* @__PURE__ */ k("div", { className: We }), n[14] = v, n[15] = m.title, n[16] = C) : C = n[16];
|
|
113
|
+
let w;
|
|
114
|
+
n[17] === m.title ? w = n[18] : (w = /* @__PURE__ */ k("h3", {
|
|
115
|
+
className: Ve,
|
|
116
|
+
children: m.title
|
|
117
|
+
}), n[17] = m.title, n[18] = w);
|
|
118
|
+
let T;
|
|
119
|
+
n[19] === m.summary ? T = n[20] : (T = m.summary ? /* @__PURE__ */ k("p", {
|
|
120
|
+
className: He,
|
|
121
|
+
children: m.summary
|
|
122
|
+
}) : null, n[19] = m.summary, n[20] = T);
|
|
123
|
+
let E;
|
|
124
|
+
n[21] !== w || n[22] !== T ? (E = /* @__PURE__ */ A("div", {
|
|
125
|
+
className: Be,
|
|
126
|
+
children: [w, T]
|
|
127
|
+
}), n[21] = w, n[22] = T, n[23] = E) : E = n[23];
|
|
128
|
+
let O;
|
|
129
|
+
return n[24] !== E || n[25] !== b || n[26] !== x || n[27] !== S || n[28] !== C ? (O = /* @__PURE__ */ k("div", {
|
|
130
|
+
className: Re,
|
|
131
|
+
children: /* @__PURE__ */ A("a", {
|
|
132
|
+
className: ze,
|
|
133
|
+
href: b,
|
|
134
|
+
target: "_blank",
|
|
135
|
+
rel: "noopener noreferrer",
|
|
136
|
+
style: x,
|
|
137
|
+
tabIndex: S,
|
|
138
|
+
children: [C, E]
|
|
139
|
+
})
|
|
140
|
+
}), n[24] = E, n[25] = b, n[26] = x, n[27] = S, n[28] = C, n[29] = O) : O = n[29], O;
|
|
141
|
+
}, Je = (e) => {
|
|
142
|
+
let t = D(3), { node: n } = e, r = n?.attrs?.blogId, i = n?.attrs?.postId;
|
|
143
|
+
if (!r || !i) return null;
|
|
144
|
+
let a;
|
|
145
|
+
return t[0] !== r || t[1] !== i ? (a = /* @__PURE__ */ k(qe, {
|
|
146
|
+
blogId: r,
|
|
147
|
+
postId: i
|
|
148
|
+
}), t[0] = r, t[1] = i, t[2] = a) : a = t[2], a;
|
|
149
|
+
}, Ye = N.create({
|
|
150
|
+
name: "quote",
|
|
151
|
+
content: "block+",
|
|
152
|
+
defining: !0,
|
|
153
|
+
addAttributes() {
|
|
154
|
+
return { class: { default: "quote" } };
|
|
155
|
+
},
|
|
156
|
+
parseHTML() {
|
|
157
|
+
return [{ tag: "blockquote" }];
|
|
158
|
+
},
|
|
159
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
160
|
+
return [
|
|
161
|
+
"blockquote",
|
|
162
|
+
P(e),
|
|
163
|
+
0
|
|
164
|
+
];
|
|
165
|
+
},
|
|
166
|
+
addKeyboardShortcuts() {
|
|
167
|
+
return { Backspace: ({ editor: e }) => {
|
|
168
|
+
let { state: t } = e, { selection: n } = t, { $from: r, empty: i } = n;
|
|
169
|
+
if (!i || r.parentOffset !== 0) return !1;
|
|
170
|
+
let a = r.node(r.depth - 1);
|
|
171
|
+
if (a.type.name !== this.name || r.index(r.depth - 1) !== 0) return !1;
|
|
172
|
+
if (a.textContent === "" && a.childCount === 1 && (a.firstChild?.content.size ?? 0) === 0) {
|
|
173
|
+
for (let t = r.depth; t > 0; t--) if (r.node(t).type.name === "blockquoteFigure") {
|
|
174
|
+
let n = r.before(t), i = r.node(t);
|
|
175
|
+
if (e.chain().deleteRange({
|
|
176
|
+
from: n,
|
|
177
|
+
to: n + i.nodeSize
|
|
178
|
+
}).setTextSelection(Math.max(n - 1, 0)).run()) return !0;
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return e.commands.toggleBlockquote();
|
|
183
|
+
} };
|
|
184
|
+
}
|
|
185
|
+
}), Xe = N.create({
|
|
186
|
+
name: "quoteCaption",
|
|
187
|
+
group: "block",
|
|
188
|
+
content: "text*",
|
|
189
|
+
defining: !0,
|
|
190
|
+
isolating: !0,
|
|
191
|
+
addAttributes() {
|
|
192
|
+
return { class: { default: "quoteCaption" } };
|
|
193
|
+
},
|
|
194
|
+
parseHTML() {
|
|
195
|
+
return [{ tag: "figcaption" }];
|
|
196
|
+
},
|
|
197
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
198
|
+
return [
|
|
199
|
+
"figcaption",
|
|
200
|
+
P(e),
|
|
201
|
+
0
|
|
202
|
+
];
|
|
203
|
+
},
|
|
204
|
+
addKeyboardShortcuts() {
|
|
205
|
+
return {
|
|
206
|
+
Backspace: ({ editor: e }) => {
|
|
207
|
+
let { state: { selection: { $from: t, empty: n } } } = e;
|
|
208
|
+
if (!n || t.parent.type !== this.type || t.parentOffset !== 0) return !1;
|
|
209
|
+
let r = t.node(t.depth - 1);
|
|
210
|
+
if (r.type.name !== "blockquoteFigure") return !1;
|
|
211
|
+
let i = r.firstChild;
|
|
212
|
+
if (!i || i.type.name !== "quote") return !1;
|
|
213
|
+
let a = t.before(t.depth);
|
|
214
|
+
if (i.textContent.trim() === "" && t.parent.textContent.length > 0) {
|
|
215
|
+
let n = t.parent.textContent;
|
|
216
|
+
return e.chain().deleteRange({
|
|
217
|
+
from: t.start(),
|
|
218
|
+
to: t.end()
|
|
219
|
+
}).focus(a - 1).insertContent(n).run();
|
|
220
|
+
}
|
|
221
|
+
return e.chain().focus(a - 1).run();
|
|
222
|
+
},
|
|
223
|
+
Enter: ({ editor: e }) => {
|
|
224
|
+
let { state: { selection: { $from: t, empty: n } } } = e;
|
|
225
|
+
if (!n || t.parent.type !== this.type || t.parentOffset !== t.parent.nodeSize - 2) return !1;
|
|
226
|
+
let r = e.state.selection.$from.end();
|
|
227
|
+
return e.chain().focus(r).insertContentAt(r + 1, { type: "paragraph" }).run();
|
|
228
|
+
}
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
}), Ze = (e) => {
|
|
232
|
+
let { state: t } = e, { selection: n } = t;
|
|
233
|
+
if (n.empty || !(n instanceof I)) return !1;
|
|
234
|
+
let { $from: r, $to: i } = n, a = -1;
|
|
235
|
+
for (let e = r.depth; e > 0; e--) if (r.node(e).type.name === "blockquoteFigure") {
|
|
236
|
+
a = e;
|
|
237
|
+
break;
|
|
238
|
+
}
|
|
239
|
+
if (a === -1) return !1;
|
|
240
|
+
let o = r.before(a), s = r.node(a), c = o + s.nodeSize;
|
|
241
|
+
if (i.pos >= c) return !1;
|
|
242
|
+
let l = s.child(0), u = o + 1 + l.nodeSize, d = u + 1;
|
|
243
|
+
if (!(r.pos < u && i.pos > u)) return !1;
|
|
244
|
+
let f = t.doc.textBetween(r.pos, i.pos, "\n"), p = t.doc.textBetween(o, c, "\n");
|
|
245
|
+
if (f.length >= p.length) return e.chain().deleteRange({
|
|
246
|
+
from: o,
|
|
247
|
+
to: c
|
|
248
|
+
}).run();
|
|
249
|
+
let m = t.tr;
|
|
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
|
+
}, Qe = N.create({
|
|
252
|
+
name: "blockquoteFigure",
|
|
253
|
+
group: "block",
|
|
254
|
+
content: "quote quoteCaption",
|
|
255
|
+
isolating: !0,
|
|
256
|
+
addExtensions() {
|
|
257
|
+
return [Ye, Xe];
|
|
258
|
+
},
|
|
259
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
260
|
+
return [
|
|
261
|
+
"figure",
|
|
262
|
+
P(e, { "data-type": this.name }),
|
|
263
|
+
0
|
|
264
|
+
];
|
|
265
|
+
},
|
|
266
|
+
addKeyboardShortcuts() {
|
|
267
|
+
return {
|
|
268
|
+
Backspace: ({ editor: e }) => Ze(e),
|
|
269
|
+
Delete: ({ editor: e }) => Ze(e)
|
|
270
|
+
};
|
|
271
|
+
},
|
|
272
|
+
addInputRules() {
|
|
273
|
+
return [new le({
|
|
274
|
+
find: /^>\s$/,
|
|
275
|
+
handler: ({ state: e, range: t, chain: n }) => {
|
|
276
|
+
let r = e.doc.resolve(t.from);
|
|
277
|
+
if (r.parent.type.name !== "paragraph") return;
|
|
278
|
+
for (let e = r.depth; e > 0; e--) if (r.node(e).type.name === this.name) return;
|
|
279
|
+
let i = r.depth - 1, a = r.node(i), o = r.index(i);
|
|
280
|
+
if (!a.canReplaceWith(o, o + 1, this.type)) return;
|
|
281
|
+
let s = r.parent.cut(t.to - r.start()), c = r.before(), l = r.after();
|
|
282
|
+
n().insertContentAt({
|
|
283
|
+
from: c,
|
|
284
|
+
to: l
|
|
285
|
+
}, {
|
|
286
|
+
type: this.name,
|
|
287
|
+
content: [{
|
|
288
|
+
type: "quote",
|
|
289
|
+
content: [s.content.size ? s.toJSON() : { type: "paragraph" }]
|
|
290
|
+
}, { type: "quoteCaption" }]
|
|
291
|
+
}).focus(c + 3).run();
|
|
292
|
+
}
|
|
293
|
+
})];
|
|
294
|
+
},
|
|
295
|
+
addCommands() {
|
|
296
|
+
return {
|
|
297
|
+
setBlockquote: () => ({ state: e, chain: t }) => {
|
|
298
|
+
let n = e.selection.$from.start(), r = e.selection.content();
|
|
299
|
+
return t().focus().insertContent({
|
|
300
|
+
type: this.name,
|
|
301
|
+
content: [{
|
|
302
|
+
type: "quote",
|
|
303
|
+
content: r.content.toJSON() || [{ type: "paragraph" }]
|
|
304
|
+
}, { type: "quoteCaption" }]
|
|
305
|
+
}).focus(n + 1).run();
|
|
306
|
+
},
|
|
307
|
+
toggleBlockquote: () => ({ state: e, chain: t }) => {
|
|
308
|
+
if (this.editor.isActive(this.name)) {
|
|
309
|
+
let { $from: n } = e.selection, r = -1, i = null;
|
|
310
|
+
for (let e = n.depth; e > 0; e--) {
|
|
311
|
+
let t = n.node(e);
|
|
312
|
+
if (t.type.name === this.name) {
|
|
313
|
+
r = n.before(e), i = t;
|
|
314
|
+
break;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
if (i) {
|
|
318
|
+
let e = [];
|
|
319
|
+
return i.forEach((t) => {
|
|
320
|
+
t.type.name === "quote" ? t.forEach((t) => {
|
|
321
|
+
e.push(t.toJSON());
|
|
322
|
+
}) : t.type.name === "quoteCaption" && t.textContent.trim() !== "" && e.push({
|
|
323
|
+
type: "paragraph",
|
|
324
|
+
content: [{
|
|
325
|
+
type: "text",
|
|
326
|
+
text: t.textContent
|
|
327
|
+
}]
|
|
328
|
+
});
|
|
329
|
+
}), e.length === 0 && e.push({ type: "paragraph" }), t().insertContentAt({
|
|
330
|
+
from: r,
|
|
331
|
+
to: r + i.nodeSize
|
|
332
|
+
}, e).focus(r + 1).run();
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
return t().setBlockquote().run();
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
}), $e = N.create({
|
|
340
|
+
name: "bookmark",
|
|
341
|
+
atom: !0,
|
|
342
|
+
group: "block",
|
|
343
|
+
draggable: !0,
|
|
344
|
+
addAttributes() {
|
|
345
|
+
return {
|
|
346
|
+
blogId: {
|
|
347
|
+
default: null,
|
|
348
|
+
parseHTML: (e) => e.getAttribute("data-blog-id"),
|
|
349
|
+
renderHTML: (e) => e?.blogId ? { "data-blog-id": e?.blogId } : {}
|
|
350
|
+
},
|
|
351
|
+
postId: {
|
|
352
|
+
default: null,
|
|
353
|
+
parseHTML: (e) => e.getAttribute("data-post-id"),
|
|
354
|
+
renderHTML: (e) => e?.postId ? { "data-post-id": e?.postId } : {}
|
|
355
|
+
}
|
|
356
|
+
};
|
|
357
|
+
},
|
|
358
|
+
parseHTML() {
|
|
359
|
+
return [{ tag: `div[data-type="${this.name}"]` }];
|
|
360
|
+
},
|
|
361
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
362
|
+
return ["div", P(e, { "data-type": this.name })];
|
|
363
|
+
}
|
|
364
|
+
}), z = "levo-button-trigger", B = (e) => e === "popup" ? "button" : "a", V = (e) => e && ge(e) ? e : "", H = {
|
|
365
|
+
variant: "primary",
|
|
366
|
+
size: "md",
|
|
367
|
+
align: "left",
|
|
368
|
+
target: "_self",
|
|
369
|
+
actionType: "link"
|
|
370
|
+
}, et = N.create({
|
|
371
|
+
name: "button",
|
|
372
|
+
group: "block",
|
|
373
|
+
atom: !0,
|
|
374
|
+
draggable: !0,
|
|
375
|
+
selectable: !0,
|
|
376
|
+
addOptions() {
|
|
377
|
+
return { HTMLAttributes: {} };
|
|
378
|
+
},
|
|
379
|
+
addAttributes() {
|
|
380
|
+
return {
|
|
381
|
+
label: {
|
|
382
|
+
default: "Button",
|
|
383
|
+
parseHTML: (e) => e.querySelector("a")?.textContent || e.textContent || "Button",
|
|
384
|
+
renderHTML: () => ({})
|
|
385
|
+
},
|
|
386
|
+
href: {
|
|
387
|
+
default: null,
|
|
388
|
+
parseHTML: (e) => e.querySelector("a")?.getAttribute("href") ?? null,
|
|
389
|
+
renderHTML: () => ({})
|
|
390
|
+
},
|
|
391
|
+
target: {
|
|
392
|
+
default: H.target,
|
|
393
|
+
parseHTML: (e) => e.querySelector("a")?.getAttribute("target") === "_blank" ? "_blank" : "_self",
|
|
394
|
+
renderHTML: () => ({})
|
|
395
|
+
},
|
|
396
|
+
variant: {
|
|
397
|
+
default: H.variant,
|
|
398
|
+
parseHTML: (e) => e.getAttribute("data-variant") || H.variant,
|
|
399
|
+
renderHTML: (e) => ({ "data-variant": e.variant ?? H.variant })
|
|
400
|
+
},
|
|
401
|
+
size: {
|
|
402
|
+
default: H.size,
|
|
403
|
+
parseHTML: (e) => e.getAttribute("data-size") || H.size,
|
|
404
|
+
renderHTML: (e) => ({ "data-size": e.size ?? H.size })
|
|
405
|
+
},
|
|
406
|
+
align: {
|
|
407
|
+
default: H.align,
|
|
408
|
+
parseHTML: (e) => e.getAttribute("data-align") || H.align,
|
|
409
|
+
renderHTML: (e) => ({ "data-align": e.align ?? H.align })
|
|
410
|
+
},
|
|
411
|
+
actionType: {
|
|
412
|
+
default: H.actionType,
|
|
413
|
+
parseHTML: (e) => e.getAttribute("data-action-type") || H.actionType,
|
|
414
|
+
renderHTML: (e) => ({ "data-action-type": e.actionType ?? H.actionType })
|
|
415
|
+
},
|
|
416
|
+
popupId: {
|
|
417
|
+
default: null,
|
|
418
|
+
parseHTML: (e) => e.getAttribute("data-popup-id") || null,
|
|
419
|
+
renderHTML: (e) => e.popupId ? { "data-popup-id": e.popupId } : {}
|
|
420
|
+
}
|
|
421
|
+
};
|
|
422
|
+
},
|
|
423
|
+
parseHTML() {
|
|
424
|
+
return [{
|
|
425
|
+
tag: "div[data-type=\"button\"]",
|
|
426
|
+
getAttrs: (e) => {
|
|
427
|
+
let t = e.querySelector("a")?.getAttribute("href");
|
|
428
|
+
return t && !ge(t) ? !1 : null;
|
|
429
|
+
}
|
|
430
|
+
}];
|
|
431
|
+
},
|
|
432
|
+
renderHTML({ HTMLAttributes: e, node: t }) {
|
|
433
|
+
let n = t.attrs.label ?? "Button", r = P(this.options.HTMLAttributes, e, { "data-type": "button" });
|
|
434
|
+
if (B(t.attrs.actionType) === "button") return [
|
|
435
|
+
"div",
|
|
436
|
+
r,
|
|
437
|
+
[
|
|
438
|
+
"button",
|
|
439
|
+
{
|
|
440
|
+
class: z,
|
|
441
|
+
type: "button"
|
|
442
|
+
},
|
|
443
|
+
n
|
|
444
|
+
]
|
|
445
|
+
];
|
|
446
|
+
let i = t.attrs.target === "_blank" ? "_blank" : "_self";
|
|
447
|
+
return [
|
|
448
|
+
"div",
|
|
449
|
+
r,
|
|
450
|
+
[
|
|
451
|
+
"a",
|
|
452
|
+
{
|
|
453
|
+
class: z,
|
|
454
|
+
href: V(t.attrs.href),
|
|
455
|
+
target: i,
|
|
456
|
+
rel: i === "_blank" ? "noopener noreferrer" : null
|
|
457
|
+
},
|
|
458
|
+
n
|
|
459
|
+
]
|
|
460
|
+
];
|
|
461
|
+
},
|
|
462
|
+
addCommands() {
|
|
463
|
+
return { setButton: (e) => ({ commands: t }) => t.insertContent({
|
|
464
|
+
type: this.name,
|
|
465
|
+
attrs: e
|
|
466
|
+
}) };
|
|
467
|
+
}
|
|
468
|
+
}), tt = N.create({
|
|
469
|
+
name: "callout",
|
|
470
|
+
group: "layoutBlock",
|
|
471
|
+
content: "block+",
|
|
472
|
+
defining: !0,
|
|
473
|
+
draggable: !0,
|
|
474
|
+
addAttributes() {
|
|
475
|
+
return {
|
|
476
|
+
backgroundColor: {
|
|
477
|
+
default: null,
|
|
478
|
+
parseHTML: (e) => e.style.backgroundColor || null,
|
|
479
|
+
renderHTML: (e) => e?.backgroundColor ? { style: `background-color: ${e.backgroundColor}` } : {}
|
|
480
|
+
},
|
|
481
|
+
foregroundColor: {
|
|
482
|
+
default: null,
|
|
483
|
+
parseHTML: (e) => e.dataset.foregroundColor || null,
|
|
484
|
+
renderHTML: (e) => {
|
|
485
|
+
if (!e?.foregroundColor) return {};
|
|
486
|
+
let t = n({ colors: { heading: e.foregroundColor } });
|
|
487
|
+
return {
|
|
488
|
+
style: [...Object.entries(t).map(([e, t]) => `${e}: ${t}`), `color: ${e.foregroundColor}`].join(";"),
|
|
489
|
+
"data-foreground-color": e.foregroundColor
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
};
|
|
494
|
+
},
|
|
495
|
+
parseHTML() {
|
|
496
|
+
return [{ tag: `div[data-type="${this.name}"]` }];
|
|
497
|
+
},
|
|
498
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
499
|
+
return [
|
|
500
|
+
"div",
|
|
501
|
+
P(e, { "data-type": this.name }),
|
|
502
|
+
0
|
|
503
|
+
];
|
|
504
|
+
},
|
|
505
|
+
addKeyboardShortcuts() {
|
|
506
|
+
return { Backspace: ({ editor: e }) => {
|
|
507
|
+
let { state: t } = e, { selection: n } = t, { $from: r } = n;
|
|
508
|
+
if (!n.empty || r.parentOffset !== 0 || r.depth !== 1 || r.parent.type.name !== "paragraph" || r.parent.content.size !== 0) return !1;
|
|
509
|
+
let i = r.index(0);
|
|
510
|
+
if (i === 0 || t.doc.child(i - 1).type !== this.type) return !1;
|
|
511
|
+
let a = r.before(1), o = r.after(1);
|
|
512
|
+
return e.chain().deleteRange({
|
|
513
|
+
from: a,
|
|
514
|
+
to: o
|
|
515
|
+
}).command(({ tr: e }) => (e.setSelection(I.near(e.doc.resolve(Math.max(a - 1, 0)), -1)), !0)).run();
|
|
516
|
+
} };
|
|
517
|
+
},
|
|
518
|
+
addCommands() {
|
|
519
|
+
return {
|
|
520
|
+
setCallout: () => ({ commands: e }) => e.wrapIn(this.name),
|
|
521
|
+
toggleCallout: () => ({ commands: e }) => e.toggleWrap(this.name),
|
|
522
|
+
unsetCallout: () => ({ commands: e }) => e.lift(this.name)
|
|
523
|
+
};
|
|
524
|
+
}
|
|
525
|
+
}), nt = _e.configure({ defaultLanguage: null }), rt = "_10e5beq0", it = re({
|
|
526
|
+
defaultClassName: "_10e5beq1",
|
|
527
|
+
variantClassNames: { layout: {
|
|
528
|
+
"sidebar-left": "_10e5beq2",
|
|
529
|
+
"sidebar-right": "_10e5beq3",
|
|
530
|
+
"two-column": "_10e5beq4"
|
|
531
|
+
} },
|
|
532
|
+
defaultVariants: { layout: "two-column" },
|
|
533
|
+
compoundVariants: []
|
|
534
|
+
}), at = N.create({
|
|
535
|
+
name: "column",
|
|
536
|
+
content: "block+",
|
|
537
|
+
isolating: !0,
|
|
538
|
+
addAttributes() {
|
|
539
|
+
return { position: {
|
|
540
|
+
default: "",
|
|
541
|
+
parseHTML: (e) => e.getAttribute("data-position"),
|
|
542
|
+
renderHTML: (e) => ({ "data-position": e.position })
|
|
543
|
+
} };
|
|
544
|
+
},
|
|
545
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
546
|
+
return [
|
|
547
|
+
"div",
|
|
548
|
+
P(e, {
|
|
549
|
+
"data-type": "column",
|
|
550
|
+
class: rt
|
|
551
|
+
}),
|
|
552
|
+
0
|
|
553
|
+
];
|
|
554
|
+
},
|
|
555
|
+
parseHTML() {
|
|
556
|
+
return [{ tag: "div[data-type=\"column\"]" }];
|
|
557
|
+
}
|
|
558
|
+
}), ot = /* @__PURE__ */ function(e) {
|
|
559
|
+
return e.SidebarLeft = "sidebar-left", e.SidebarRight = "sidebar-right", e.TwoColumn = "two-column", e;
|
|
560
|
+
}({}), st = N.create({
|
|
561
|
+
name: "columns",
|
|
562
|
+
group: "layoutBlock",
|
|
563
|
+
content: "column column",
|
|
564
|
+
defining: !0,
|
|
565
|
+
isolating: !0,
|
|
566
|
+
addAttributes() {
|
|
567
|
+
return { layout: { default: ot.TwoColumn } };
|
|
568
|
+
},
|
|
569
|
+
addCommands() {
|
|
570
|
+
return {
|
|
571
|
+
setColumns: () => ({ commands: e }) => e.insertContent("<div data-type=\"columns\"><div data-type=\"column\" data-position=\"left\"><p></p></div><div data-type=\"column\" data-position=\"right\"><p></p></div></div>"),
|
|
572
|
+
setLayout: (e) => ({ commands: t }) => t.updateAttributes("columns", { layout: e })
|
|
573
|
+
};
|
|
574
|
+
},
|
|
575
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
576
|
+
return [
|
|
577
|
+
"div",
|
|
578
|
+
{
|
|
579
|
+
"data-type": "columns",
|
|
580
|
+
class: it({ layout: e.layout })
|
|
581
|
+
},
|
|
582
|
+
0
|
|
583
|
+
];
|
|
584
|
+
},
|
|
585
|
+
parseHTML() {
|
|
586
|
+
return [{ tag: "div[data-type=\"columns\"]" }];
|
|
587
|
+
}
|
|
588
|
+
}), ct = ve.extend({ content: "(block | layoutBlock)+" }), lt = M.create({
|
|
589
|
+
name: "detailsKit",
|
|
590
|
+
addExtensions() {
|
|
591
|
+
let e = [];
|
|
592
|
+
return this.options.details !== !1 && e.push(ye.extend({ group: "layoutBlock" }).configure({
|
|
593
|
+
persist: !0,
|
|
594
|
+
HTMLAttributes: { class: "details" },
|
|
595
|
+
...this.options.details || {}
|
|
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
|
+
}
|
|
598
|
+
}), ut = N.create({
|
|
599
|
+
name: "iframe",
|
|
600
|
+
group: "block",
|
|
601
|
+
atom: !0,
|
|
602
|
+
addOptions() {
|
|
603
|
+
return {
|
|
604
|
+
allowFullscreen: !0,
|
|
605
|
+
HTMLAttributes: { class: "iframe-wrapper" }
|
|
606
|
+
};
|
|
607
|
+
},
|
|
608
|
+
addAttributes() {
|
|
609
|
+
return {
|
|
610
|
+
src: { default: null },
|
|
611
|
+
width: {
|
|
612
|
+
default: null,
|
|
613
|
+
parseHTML: (e) => e.getAttribute("width"),
|
|
614
|
+
renderHTML: (e) => ({ width: e.width })
|
|
615
|
+
},
|
|
616
|
+
height: {
|
|
617
|
+
default: null,
|
|
618
|
+
parseHTML: (e) => e.getAttribute("height"),
|
|
619
|
+
renderHTML: (e) => ({ height: e.height })
|
|
620
|
+
},
|
|
621
|
+
title: {
|
|
622
|
+
default: null,
|
|
623
|
+
parseHTML: (e) => e.getAttribute("title"),
|
|
624
|
+
renderHTML: (e) => ({ title: e.title })
|
|
625
|
+
},
|
|
626
|
+
allowFullScreen: {
|
|
627
|
+
default: this.options.allowFullscreen,
|
|
628
|
+
parseHTML: () => this.options.allowFullscreen
|
|
629
|
+
}
|
|
630
|
+
};
|
|
631
|
+
},
|
|
632
|
+
parseHTML() {
|
|
633
|
+
return [{ tag: "iframe" }];
|
|
634
|
+
},
|
|
635
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
636
|
+
return [
|
|
637
|
+
"div",
|
|
638
|
+
this.options.HTMLAttributes,
|
|
639
|
+
["iframe", P(e, { frameBorder: "0" })]
|
|
640
|
+
];
|
|
641
|
+
},
|
|
642
|
+
addCommands() {
|
|
643
|
+
return { setIframe: (e) => ({ tr: t, dispatch: n }) => {
|
|
644
|
+
let { selection: r } = t;
|
|
645
|
+
if (de(r) && r.node.type.name === "iframe") {
|
|
646
|
+
let i = this.type.create({
|
|
647
|
+
...r.node.attrs,
|
|
648
|
+
...e
|
|
649
|
+
});
|
|
650
|
+
return n && t.replaceWith(r.from, r.to, i), !0;
|
|
651
|
+
}
|
|
652
|
+
let i = this.type.create(e);
|
|
653
|
+
return n && t.replaceRangeWith(r.from, r.to, i), !0;
|
|
654
|
+
} };
|
|
655
|
+
}
|
|
656
|
+
}), dt = Ce.extend({ renderHTML() {
|
|
657
|
+
return [
|
|
658
|
+
"div",
|
|
659
|
+
P(this.options.HTMLAttributes, { "data-type": this.name }),
|
|
660
|
+
["hr"]
|
|
661
|
+
];
|
|
662
|
+
} }), ft = (e) => ({
|
|
663
|
+
src: e.getAttribute("src"),
|
|
664
|
+
alt: e.getAttribute("alt"),
|
|
665
|
+
title: e.getAttribute("title"),
|
|
666
|
+
width: e.getAttribute("width"),
|
|
667
|
+
height: e.getAttribute("height"),
|
|
668
|
+
srcset: e.getAttribute("srcset")
|
|
669
|
+
});
|
|
670
|
+
function pt(e) {
|
|
671
|
+
let t = { src: e.src || "" };
|
|
672
|
+
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
|
+
}
|
|
674
|
+
function mt(e, t) {
|
|
675
|
+
let n = e?.trim();
|
|
676
|
+
return n ? t || !n.toLowerCase().startsWith("data:") : !1;
|
|
677
|
+
}
|
|
678
|
+
function ht(e, t) {
|
|
679
|
+
let n = t.toUpperCase();
|
|
680
|
+
return Array.from(e.children).filter((e) => e.tagName === n);
|
|
681
|
+
}
|
|
682
|
+
function gt(e, t) {
|
|
683
|
+
let n = ht(e, "img");
|
|
684
|
+
if (n.length !== 1) return null;
|
|
685
|
+
let r = n[0];
|
|
686
|
+
return r && mt(r.getAttribute("src"), t) ? r : null;
|
|
687
|
+
}
|
|
688
|
+
function U(e, t) {
|
|
689
|
+
if (e instanceof F && e.node.type === t) return {
|
|
690
|
+
imageNode: e.node,
|
|
691
|
+
imagePos: e.from,
|
|
692
|
+
atStart: !0,
|
|
693
|
+
atEnd: !0
|
|
694
|
+
};
|
|
695
|
+
if (e.$from.parent.type === t && e.$to.parent === e.$from.parent) {
|
|
696
|
+
let { $from: t, $to: n } = e;
|
|
697
|
+
return {
|
|
698
|
+
imageNode: t.parent,
|
|
699
|
+
imagePos: t.before(),
|
|
700
|
+
atStart: t.parentOffset === 0,
|
|
701
|
+
atEnd: n.parentOffset === t.parent.content.size
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
return null;
|
|
705
|
+
}
|
|
706
|
+
function W(e, t) {
|
|
707
|
+
let n = e.view.dom.ownerDocument.getSelection() ?? null;
|
|
708
|
+
if (!n?.isCollapsed || !n.anchorNode || !e.view.dom.contains(n.anchorNode.nodeType === globalThis.Node.ELEMENT_NODE ? n.anchorNode : n.anchorNode.parentElement)) return null;
|
|
709
|
+
try {
|
|
710
|
+
let r = e.view.posAtDOM(n.anchorNode, n.anchorOffset, 1), i = e.state.doc.resolve(r);
|
|
711
|
+
return i.parent.type === t ? {
|
|
712
|
+
imageNode: i.parent,
|
|
713
|
+
imagePos: i.before(),
|
|
714
|
+
atStart: i.parentOffset === 0,
|
|
715
|
+
atEnd: i.parentOffset === i.parent.content.size
|
|
716
|
+
} : null;
|
|
717
|
+
} catch {
|
|
718
|
+
return null;
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
function G(e, t) {
|
|
722
|
+
return e.type === t && !e.attrs.showCaption && e.content.size === 0;
|
|
723
|
+
}
|
|
724
|
+
function K(e, t) {
|
|
725
|
+
let { state: n, view: r } = e, i = I.create(n.doc, t);
|
|
726
|
+
return r.dispatch(n.tr.setSelection(i).scrollIntoView()), !0;
|
|
727
|
+
}
|
|
728
|
+
function q(e, t) {
|
|
729
|
+
let { state: n, view: r } = e;
|
|
730
|
+
return r.dispatch(n.tr.setSelection(F.create(n.doc, t)).scrollIntoView()), !0;
|
|
731
|
+
}
|
|
732
|
+
function _t(e, t, n) {
|
|
733
|
+
if (!n) return !1;
|
|
734
|
+
let r = e.doc.resolve(t), i = r.index();
|
|
735
|
+
return r.parent.canReplaceWith(i, i, n) ? (e.insert(t, n.create()), e.setSelection(I.create(e.doc, t + 1)), !0) : !1;
|
|
736
|
+
}
|
|
737
|
+
function vt(e, t, n, r) {
|
|
738
|
+
let i = e.doc.resolve(t), a = i.parent, o = i.index(), s = t;
|
|
739
|
+
if (n === 1) for (; o < a.childCount && G(a.child(o), r);) s += a.child(o).nodeSize, o += 1;
|
|
740
|
+
else for (; o > 0 && G(a.child(o - 1), r);) --o, s -= a.child(o).nodeSize;
|
|
741
|
+
if ((n === 1 ? o === a.childCount : o === 0) && _t(e, s, r.schema.nodes.paragraph)) return !0;
|
|
742
|
+
let c = pe.findFrom(e.doc.resolve(s), n, !0);
|
|
743
|
+
return c && !(c.$from.parent.type === r && G(c.$from.parent, r)) ? (e.setSelection(c), !0) : !1;
|
|
744
|
+
}
|
|
745
|
+
function J(e, t, n, r) {
|
|
746
|
+
let { state: i, view: a } = e, o = i.tr;
|
|
747
|
+
return vt(o, t, n, r) ? (a.dispatch(o.scrollIntoView()), !0) : !1;
|
|
748
|
+
}
|
|
749
|
+
function Y(e, t) {
|
|
750
|
+
let { $from: n } = e;
|
|
751
|
+
if (!n.parent.isTextblock || n.depth < 1) return null;
|
|
752
|
+
let r = n.depth, i = r - 1, a = n.node(i), o = n.index(i) + t;
|
|
753
|
+
if (o < 0 || o >= a.childCount) return null;
|
|
754
|
+
let s = n.before(r), c = a.child(o);
|
|
755
|
+
return {
|
|
756
|
+
node: c,
|
|
757
|
+
position: t === 1 ? s + n.parent.nodeSize : s - c.nodeSize
|
|
758
|
+
};
|
|
759
|
+
}
|
|
760
|
+
function yt(e, t) {
|
|
761
|
+
if (!e.isEditable) return !1;
|
|
762
|
+
let { state: n } = e, r = U(n.selection, t);
|
|
763
|
+
if (r?.atStart) return J(e, r.imagePos, -1, t);
|
|
764
|
+
let { selection: i } = n;
|
|
765
|
+
if (!(i instanceof I) || !i.empty || i.$from.parentOffset !== 0) return !1;
|
|
766
|
+
let a = Y(i, -1);
|
|
767
|
+
return !a || a.node.type !== t ? !1 : G(a.node, t) ? J(e, a.position, -1, t) : K(e, a.position + a.node.nodeSize - 1);
|
|
768
|
+
}
|
|
769
|
+
function bt(e, t) {
|
|
770
|
+
if (!e.isEditable) return !1;
|
|
771
|
+
let { state: n } = e, r = U(n.selection, t);
|
|
772
|
+
if (r?.atEnd) return J(e, r.imagePos + r.imageNode.nodeSize, 1, t);
|
|
773
|
+
let { selection: i } = n, { $from: a } = i;
|
|
774
|
+
if (!(i instanceof I) || !i.empty || a.parentOffset !== a.parent.content.size) return !1;
|
|
775
|
+
let o = Y(i, 1);
|
|
776
|
+
if (o?.node.type === t) return G(o.node, t) ? J(e, o.position + o.node.nodeSize, 1, t) : K(e, o.position + 1);
|
|
777
|
+
let s = Y(i, -1);
|
|
778
|
+
return !!(!o && s && G(s.node, t));
|
|
779
|
+
}
|
|
780
|
+
function xt(e, t) {
|
|
781
|
+
if (!e.isEditable) return !1;
|
|
782
|
+
let { selection: n } = e.state, r = U(n, t);
|
|
783
|
+
if (r && (n instanceof F || n.empty && r.atStart)) return J(e, r.imagePos, -1, t);
|
|
784
|
+
if (!(n instanceof I) || !n.empty || n.$from.parentOffset !== 0) return !1;
|
|
785
|
+
let i = Y(n, -1);
|
|
786
|
+
return !i || i.node.type !== t ? !1 : G(i.node, t) ? q(e, i.position) : K(e, i.position + i.node.nodeSize - 1);
|
|
787
|
+
}
|
|
788
|
+
function St(e, t) {
|
|
789
|
+
if (!e.isEditable) return !1;
|
|
790
|
+
let { selection: n } = e.state, r = U(n, t);
|
|
791
|
+
if (r && (n instanceof F || n.empty && r.atEnd)) return J(e, r.imagePos + r.imageNode.nodeSize, 1, t);
|
|
792
|
+
if (!(n instanceof I) || !n.empty || n.$from.parentOffset !== n.$from.parent.content.size) return !1;
|
|
793
|
+
let i = Y(n, 1);
|
|
794
|
+
return !i || i.node.type !== t ? !1 : G(i.node, t) ? q(e, i.position) : K(e, i.position + 1);
|
|
795
|
+
}
|
|
796
|
+
function Ct(e, t) {
|
|
797
|
+
if (!e.isEditable) return !1;
|
|
798
|
+
let { state: n, view: r } = e, { selection: i } = n, a = U(i, t);
|
|
799
|
+
if (!a) return !1;
|
|
800
|
+
let o = n.tr;
|
|
801
|
+
!(i instanceof F) && !i.empty && o.deleteSelection();
|
|
802
|
+
let s = o.mapping.map(a.imagePos, -1), c = o.doc.nodeAt(s);
|
|
803
|
+
if (!c || c.type !== t) return !1;
|
|
804
|
+
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) : _t(o, l, d) || vt(o, l, 1, t) ? (r.dispatch(o.scrollIntoView()), !0) : !1;
|
|
806
|
+
}
|
|
807
|
+
function wt(e, t) {
|
|
808
|
+
if (!e.isEditable) return !1;
|
|
809
|
+
let { state: n, view: r } = e, i = U(n.selection, t), a = n.schema.nodes.hardBreak;
|
|
810
|
+
if (!i || n.selection instanceof F || !a || !i.imageNode.contentMatchAt(0).matchType(a)) return !1;
|
|
811
|
+
let o = n.tr.replaceSelectionWith(a.create());
|
|
812
|
+
return r.dispatch(o.scrollIntoView()), !0;
|
|
813
|
+
}
|
|
814
|
+
function Tt(e, t) {
|
|
815
|
+
if (!e.isEditable) return !1;
|
|
816
|
+
let { state: n, view: r } = e, { selection: i } = n;
|
|
817
|
+
if (i instanceof F && i.node.type === t) return r.dispatch(L(n.tr.deleteSelection()).scrollIntoView()), !0;
|
|
818
|
+
let a = W(e, t), o = U(i, t);
|
|
819
|
+
if (a?.atStart) return q(e, a.imagePos);
|
|
820
|
+
if (o && !(i instanceof F) && i.empty && o.atStart) return q(e, o.imagePos);
|
|
821
|
+
if (!(i instanceof I) || !i.empty || i.$from.parentOffset !== 0) return !1;
|
|
822
|
+
let s = Y(i, -1);
|
|
823
|
+
if (!s || s.node.type !== t) return !1;
|
|
824
|
+
let c = i.$from.parent;
|
|
825
|
+
if (c.type.name === "paragraph" && c.content.size === 0) {
|
|
826
|
+
let e = i.$from.before(1), t = i.$from.after(1), a = n.tr.delete(e, t);
|
|
827
|
+
return a.setSelection(F.create(a.doc, s.position)), r.dispatch(a.scrollIntoView()), !0;
|
|
828
|
+
}
|
|
829
|
+
return q(e, s.position);
|
|
830
|
+
}
|
|
831
|
+
function Et(e, t) {
|
|
832
|
+
if (!e.isEditable) return !1;
|
|
833
|
+
let { state: n, view: r } = e, { selection: i } = n;
|
|
834
|
+
if (i instanceof F && i.node.type === t) return r.dispatch(L(n.tr.deleteSelection()).scrollIntoView()), !0;
|
|
835
|
+
let a = W(e, t), o = U(i, t);
|
|
836
|
+
if (a?.atEnd) return q(e, a.imagePos);
|
|
837
|
+
if (o && !(i instanceof F) && i.empty && o.atEnd) return q(e, o.imagePos);
|
|
838
|
+
if (!(i instanceof I) || !i.empty || i.$from.parentOffset !== i.$from.parent.content.size) return !1;
|
|
839
|
+
let s = Y(i, 1);
|
|
840
|
+
return !s || s.node.type !== t ? !1 : q(e, s.position);
|
|
841
|
+
}
|
|
842
|
+
function Dt(e, t) {
|
|
843
|
+
if (!e.isEditable) return !1;
|
|
844
|
+
let { state: n, view: r } = e, i = U(n.selection, t) ?? W(e, t);
|
|
845
|
+
if (!i || n.selection instanceof F) return !1;
|
|
846
|
+
let a = n.tr;
|
|
847
|
+
return i.imageNode.content.size === 0 && i.imageNode.attrs.showCaption && (a = a.setNodeMarkup(i.imagePos, void 0, {
|
|
848
|
+
...i.imageNode.attrs,
|
|
849
|
+
showCaption: !1
|
|
850
|
+
})), a = a.setSelection(F.create(a.doc, i.imagePos)), r.dispatch(a.scrollIntoView()), !0;
|
|
851
|
+
}
|
|
852
|
+
var Ot = we.extend({
|
|
853
|
+
name: "imageBlock",
|
|
854
|
+
content: "inline*",
|
|
855
|
+
isolating: !0,
|
|
856
|
+
addOptions() {
|
|
857
|
+
return {
|
|
858
|
+
...this.parent?.(),
|
|
859
|
+
allowBase64: !0
|
|
860
|
+
};
|
|
861
|
+
},
|
|
862
|
+
addAttributes() {
|
|
863
|
+
return {
|
|
864
|
+
...this.parent?.(),
|
|
865
|
+
srcset: { default: null },
|
|
866
|
+
width: { default: null },
|
|
867
|
+
height: { default: null },
|
|
868
|
+
"data-align": { default: null },
|
|
869
|
+
"data-link-href": { default: null },
|
|
870
|
+
"data-id": { default: null },
|
|
871
|
+
"data-mimetype": { default: null },
|
|
872
|
+
showCaption: {
|
|
873
|
+
default: !1,
|
|
874
|
+
parseHTML: (e) => e.tagName === "FIGURE" || e.getAttribute("data-show-caption") === "true",
|
|
875
|
+
renderHTML: (e) => e.showCaption ? { "data-show-caption": "true" } : {}
|
|
876
|
+
}
|
|
877
|
+
};
|
|
878
|
+
},
|
|
879
|
+
parseHTML() {
|
|
880
|
+
return [{
|
|
881
|
+
tag: "figure",
|
|
882
|
+
getAttrs: (e) => {
|
|
883
|
+
let t = gt(e, this.options.allowBase64);
|
|
884
|
+
return t ? {
|
|
885
|
+
...ft(t),
|
|
886
|
+
"data-align": e.getAttribute("data-align"),
|
|
887
|
+
"data-link-href": e.getAttribute("data-link-href"),
|
|
888
|
+
"data-id": e.getAttribute("data-id") ?? t.getAttribute("data-id"),
|
|
889
|
+
"data-mimetype": e.getAttribute("data-mimetype") ?? t.getAttribute("data-mimetype"),
|
|
890
|
+
showCaption: !0
|
|
891
|
+
} : !1;
|
|
892
|
+
},
|
|
893
|
+
contentElement: (e) => ht(e, "figcaption")[0] ?? e.ownerDocument.createElement("figcaption")
|
|
894
|
+
}, {
|
|
895
|
+
tag: "img",
|
|
896
|
+
getAttrs: (e) => {
|
|
897
|
+
if (!mt(e.getAttribute("src"), this.options.allowBase64)) return !1;
|
|
898
|
+
let t = e.closest("figure");
|
|
899
|
+
return t && gt(t, this.options.allowBase64) === e ? !1 : {
|
|
900
|
+
...ft(e),
|
|
901
|
+
"data-align": e.getAttribute("data-align"),
|
|
902
|
+
"data-link-href": e.getAttribute("data-link-href"),
|
|
903
|
+
"data-id": e.getAttribute("data-id"),
|
|
904
|
+
"data-mimetype": e.getAttribute("data-mimetype"),
|
|
905
|
+
showCaption: !1
|
|
906
|
+
};
|
|
907
|
+
}
|
|
908
|
+
}];
|
|
909
|
+
},
|
|
910
|
+
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 = pt({
|
|
912
|
+
src: t,
|
|
913
|
+
alt: n,
|
|
914
|
+
title: r,
|
|
915
|
+
width: a,
|
|
916
|
+
height: o,
|
|
917
|
+
srcset: i
|
|
918
|
+
}), p = e.content.size > 0;
|
|
919
|
+
if (s || p) {
|
|
920
|
+
let e = { "data-url": t || "" };
|
|
921
|
+
return s && (e["data-show-caption"] = "true"), c && (e["data-align"] = c), l && (e["data-link-href"] = l), u && (e["data-id"] = u), d && (e["data-mimetype"] = d), [
|
|
922
|
+
"figure",
|
|
923
|
+
e,
|
|
924
|
+
["img", f],
|
|
925
|
+
[
|
|
926
|
+
"figcaption",
|
|
927
|
+
{},
|
|
928
|
+
0
|
|
929
|
+
]
|
|
930
|
+
];
|
|
931
|
+
}
|
|
932
|
+
return c && (f["data-align"] = c), l && (f["data-link-href"] = l), u && (f["data-id"] = u), d && (f["data-mimetype"] = d), ["img", f];
|
|
933
|
+
},
|
|
934
|
+
addKeyboardShortcuts() {
|
|
935
|
+
return {
|
|
936
|
+
"Mod-a": ({ editor: e }) => {
|
|
937
|
+
let { state: t, view: n } = e, { selection: r } = t, { $from: i } = r, a = null, o = null;
|
|
938
|
+
for (let e = i.depth; e >= 0; e--) {
|
|
939
|
+
let t = i.node(e);
|
|
940
|
+
if (t.type === this.type) {
|
|
941
|
+
o = t, a = e === 0 ? 0 : i.before(e);
|
|
942
|
+
break;
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
if (!o || a == null || o.content.size === 0) return !1;
|
|
946
|
+
let s = a + 1, c = a + o.nodeSize - 1;
|
|
947
|
+
if (r instanceof I && r.from === s && r.to === c) return !1;
|
|
948
|
+
let l = t.tr.setSelection(I.create(t.doc, s, c));
|
|
949
|
+
return n.dispatch(l), !0;
|
|
950
|
+
},
|
|
951
|
+
ArrowUp: ({ editor: e }) => yt(e, this.type),
|
|
952
|
+
ArrowDown: ({ editor: e }) => bt(e, this.type),
|
|
953
|
+
ArrowLeft: ({ editor: e }) => xt(e, this.type),
|
|
954
|
+
ArrowRight: ({ editor: e }) => St(e, this.type),
|
|
955
|
+
Enter: ({ editor: e }) => Ct(e, this.type),
|
|
956
|
+
"Shift-Enter": ({ editor: e }) => wt(e, this.type),
|
|
957
|
+
"Mod-Enter": ({ editor: e }) => wt(e, this.type),
|
|
958
|
+
Backspace: ({ editor: e }) => Tt(e, this.type),
|
|
959
|
+
Delete: ({ editor: e }) => Et(e, this.type),
|
|
960
|
+
Escape: ({ editor: e }) => Dt(e, this.type)
|
|
961
|
+
};
|
|
962
|
+
}
|
|
963
|
+
}), kt = N.create({
|
|
964
|
+
name: "levoCollection",
|
|
965
|
+
atom: !0,
|
|
966
|
+
group: "block",
|
|
967
|
+
draggable: !0,
|
|
968
|
+
addAttributes() {
|
|
969
|
+
return {
|
|
970
|
+
collectionId: {
|
|
971
|
+
default: null,
|
|
972
|
+
parseHTML: (e) => e.getAttribute("data-collection-id"),
|
|
973
|
+
renderHTML: (e) => e?.collectionId ? { "data-collection-id": e?.collectionId } : {}
|
|
974
|
+
},
|
|
975
|
+
variant: {
|
|
976
|
+
default: null,
|
|
977
|
+
parseHTML: (e) => e.getAttribute("data-variant"),
|
|
978
|
+
renderHTML: (e) => e?.variant ? { "data-variant": e?.variant } : {}
|
|
979
|
+
}
|
|
980
|
+
};
|
|
981
|
+
},
|
|
982
|
+
parseHTML() {
|
|
983
|
+
return [{ tag: `div[data-type="${this.name}"]` }];
|
|
984
|
+
},
|
|
985
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
986
|
+
return ["div", P(e, { "data-type": this.name })];
|
|
987
|
+
}
|
|
988
|
+
}), At = M.create({
|
|
989
|
+
name: "indentAttribute",
|
|
990
|
+
addGlobalAttributes() {
|
|
991
|
+
return [{
|
|
992
|
+
types: ["paragraph", "heading"],
|
|
993
|
+
attributes: { indent: {
|
|
994
|
+
default: 0,
|
|
995
|
+
parseHTML: (e) => {
|
|
996
|
+
let t = Number(e.getAttribute("data-indent"));
|
|
997
|
+
return Number.isFinite(t) ? Math.max(0, Math.min(8, t)) : 0;
|
|
998
|
+
},
|
|
999
|
+
renderHTML: (e) => {
|
|
1000
|
+
let t = Number(e.indent) || 0;
|
|
1001
|
+
return t === 0 ? {} : {
|
|
1002
|
+
"data-indent": String(t),
|
|
1003
|
+
style: `--tt-indent-level: ${t}`
|
|
1004
|
+
};
|
|
1005
|
+
}
|
|
1006
|
+
} }
|
|
1007
|
+
}];
|
|
1008
|
+
}
|
|
1009
|
+
});
|
|
1010
|
+
//#endregion
|
|
1011
|
+
//#region ../../libraries/editor-core/dist/extensions/nodeStyling/nodeBackground.js
|
|
1012
|
+
function jt(e, t) {
|
|
1013
|
+
if (e.length === 0) return null;
|
|
1014
|
+
for (let n of e) if ((n.node.attrs?.backgroundColor ?? null) !== t) return t;
|
|
1015
|
+
return null;
|
|
1016
|
+
}
|
|
1017
|
+
var Mt = M.create({
|
|
1018
|
+
name: "nodeBackground",
|
|
1019
|
+
addOptions() {
|
|
1020
|
+
return {
|
|
1021
|
+
types: [
|
|
1022
|
+
"paragraph",
|
|
1023
|
+
"heading",
|
|
1024
|
+
"quote",
|
|
1025
|
+
"blockquoteFigure",
|
|
1026
|
+
"taskList",
|
|
1027
|
+
"bulletList",
|
|
1028
|
+
"orderedList",
|
|
1029
|
+
"tableCell",
|
|
1030
|
+
"tableHeader"
|
|
1031
|
+
],
|
|
1032
|
+
useStyle: !0
|
|
1033
|
+
};
|
|
1034
|
+
},
|
|
1035
|
+
addGlobalAttributes() {
|
|
1036
|
+
return [{
|
|
1037
|
+
types: this.options.types,
|
|
1038
|
+
attributes: { backgroundColor: {
|
|
1039
|
+
default: null,
|
|
1040
|
+
parseHTML: (e) => e.style?.backgroundColor || e.getAttribute("data-background-color") || null,
|
|
1041
|
+
renderHTML: (e) => {
|
|
1042
|
+
let t = e.backgroundColor;
|
|
1043
|
+
return t ? this.options.useStyle ? { style: `background-color: ${t}` } : { "data-background-color": t } : {};
|
|
1044
|
+
}
|
|
1045
|
+
} }
|
|
1046
|
+
}];
|
|
1047
|
+
},
|
|
1048
|
+
addCommands() {
|
|
1049
|
+
let e = (e) => (t) => ({ state: n, tr: r }) => {
|
|
1050
|
+
let i = S(n.selection, this.options.types);
|
|
1051
|
+
return i.length === 0 ? !1 : w(r, i, "backgroundColor", e(i, t));
|
|
1052
|
+
};
|
|
1053
|
+
return {
|
|
1054
|
+
setNodeBackgroundColor: e((e, t) => t || null),
|
|
1055
|
+
unsetNodeBackgroundColor: e(() => null),
|
|
1056
|
+
toggleNodeBackgroundColor: e((e, t) => jt(e, t || ""))
|
|
1057
|
+
};
|
|
1058
|
+
}
|
|
1059
|
+
}), Nt = 35, Pt = 120, Ft = Ne.extend({
|
|
1060
|
+
group: "layoutBlock",
|
|
1061
|
+
addProseMirrorPlugins() {
|
|
1062
|
+
let e = this.options.resizable && this.editor.isEditable, t = this.options.cellMinWidth < Pt ? Pt : this.options.cellMinWidth;
|
|
1063
|
+
return [...e ? [Oe({
|
|
1064
|
+
handleWidth: this.options.handleWidth,
|
|
1065
|
+
cellMinWidth: Nt,
|
|
1066
|
+
defaultCellMinWidth: t,
|
|
1067
|
+
lastColumnResizable: this.options.lastColumnResizable
|
|
1068
|
+
})] : [], ke({ allowTableNodeSelection: this.options.allowTableNodeSelection })];
|
|
1069
|
+
}
|
|
1070
|
+
}), It = Ae.extend({
|
|
1071
|
+
content: "paragraph+",
|
|
1072
|
+
addAttributes() {
|
|
1073
|
+
return { ...this.parent?.() };
|
|
1074
|
+
},
|
|
1075
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
1076
|
+
let { colspan: t, rowspan: n, ...r } = e;
|
|
1077
|
+
return [
|
|
1078
|
+
"td",
|
|
1079
|
+
{
|
|
1080
|
+
...r,
|
|
1081
|
+
colSpan: t,
|
|
1082
|
+
rowSpan: n
|
|
1083
|
+
},
|
|
1084
|
+
0
|
|
1085
|
+
];
|
|
1086
|
+
},
|
|
1087
|
+
addKeyboardShortcuts() {
|
|
1088
|
+
return {
|
|
1089
|
+
...this.parent?.(),
|
|
1090
|
+
"Mod-a": () => {
|
|
1091
|
+
let { state: e, view: t } = this.editor, { selection: n, doc: r } = e, i = n.$anchor, a = De(i);
|
|
1092
|
+
if (!a) return !1;
|
|
1093
|
+
let o = r.nodeAt(a.pos);
|
|
1094
|
+
if (!o || !o.textContent) return !1;
|
|
1095
|
+
let s = a.pos + 1, c = a.pos + o.nodeSize - 1;
|
|
1096
|
+
if (s >= c) return !0;
|
|
1097
|
+
let l = r.resolve(s), u = r.resolve(c), d = I.between(l, u, 1);
|
|
1098
|
+
return !d || e.selection.eq(d) || t.dispatch(e.tr.setSelection(d)), !0;
|
|
1099
|
+
}
|
|
1100
|
+
};
|
|
1101
|
+
}
|
|
1102
|
+
}), Lt = je.extend({
|
|
1103
|
+
content: "paragraph+",
|
|
1104
|
+
addAttributes() {
|
|
1105
|
+
return { ...this.parent?.() };
|
|
1106
|
+
},
|
|
1107
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
1108
|
+
let { colspan: t, rowspan: n, ...r } = e;
|
|
1109
|
+
return [
|
|
1110
|
+
"th",
|
|
1111
|
+
{
|
|
1112
|
+
...r,
|
|
1113
|
+
colSpan: t,
|
|
1114
|
+
rowSpan: n
|
|
1115
|
+
},
|
|
1116
|
+
0
|
|
1117
|
+
];
|
|
1118
|
+
}
|
|
1119
|
+
}), Rt = M.create({
|
|
1120
|
+
name: "tableKit",
|
|
1121
|
+
addExtensions() {
|
|
1122
|
+
let e = [];
|
|
1123
|
+
return this.options.table !== !1 && e.push(Ft.configure({
|
|
1124
|
+
...this.options.table,
|
|
1125
|
+
renderWrapper: !0
|
|
1126
|
+
})), this.options.tableCell !== !1 && e.push(It.configure(this.options.tableCell)), this.options.tableHeader !== !1 && e.push(Lt.configure(this.options.tableHeader)), this.options.tableRow !== !1 && e.push(Me.configure(this.options.tableRow)), e;
|
|
1127
|
+
}
|
|
1128
|
+
}), zt = (e) => {
|
|
1129
|
+
let t = D(10), { label: n, href: r, target: i, actionType: a, onActivate: o } = e, s = n || "Button";
|
|
1130
|
+
if (B(a) === "button") {
|
|
1131
|
+
let e;
|
|
1132
|
+
return t[0] !== o || t[1] !== s ? (e = /* @__PURE__ */ k("button", {
|
|
1133
|
+
className: z,
|
|
1134
|
+
type: "button",
|
|
1135
|
+
onClick: o,
|
|
1136
|
+
children: s
|
|
1137
|
+
}), t[0] = o, t[1] = s, t[2] = e) : e = t[2], e;
|
|
1138
|
+
}
|
|
1139
|
+
let c = i === "_blank" ? "_blank" : "_self", l;
|
|
1140
|
+
t[3] === r ? l = t[4] : (l = V(r), t[3] = r, t[4] = l);
|
|
1141
|
+
let u = l, d = c === "_blank" ? "noopener noreferrer" : void 0, f;
|
|
1142
|
+
return t[5] !== u || t[6] !== c || t[7] !== d || t[8] !== s ? (f = /* @__PURE__ */ k("a", {
|
|
1143
|
+
className: z,
|
|
1144
|
+
href: u,
|
|
1145
|
+
target: c,
|
|
1146
|
+
rel: d,
|
|
1147
|
+
children: s
|
|
1148
|
+
}), t[5] = u, t[6] = c, t[7] = d, t[8] = s, t[9] = f) : f = t[9], f;
|
|
1149
|
+
}, Bt = (e) => {
|
|
1150
|
+
let t = D(16), { node: n } = e, i;
|
|
1151
|
+
t[0] === n?.attrs ? i = t[1] : (i = n?.attrs ?? {}, t[0] = n?.attrs, t[1] = i);
|
|
1152
|
+
let a = i, { openPopup: o } = r(), s = a.popupId, c;
|
|
1153
|
+
t[2] !== o || t[3] !== s ? (c = s ? () => o(s) : void 0, t[2] = o, t[3] = s, t[4] = c) : c = t[4];
|
|
1154
|
+
let l;
|
|
1155
|
+
t[5] !== a.actionType || t[6] !== a.href || t[7] !== a.label || t[8] !== a.target || t[9] !== c ? (l = /* @__PURE__ */ k(zt, {
|
|
1156
|
+
label: a.label,
|
|
1157
|
+
href: a.href,
|
|
1158
|
+
target: a.target,
|
|
1159
|
+
actionType: a.actionType,
|
|
1160
|
+
onActivate: c
|
|
1161
|
+
}), t[5] = a.actionType, t[6] = a.href, t[7] = a.label, t[8] = a.target, t[9] = c, t[10] = l) : l = t[10];
|
|
1162
|
+
let u;
|
|
1163
|
+
return t[11] !== a.align || t[12] !== a.size || t[13] !== a.variant || t[14] !== l ? (u = /* @__PURE__ */ k("div", {
|
|
1164
|
+
"data-type": "button",
|
|
1165
|
+
"data-variant": a.variant,
|
|
1166
|
+
"data-size": a.size,
|
|
1167
|
+
"data-align": a.align,
|
|
1168
|
+
children: l
|
|
1169
|
+
}), t[11] = a.align, t[12] = a.size, t[13] = a.variant, t[14] = l, t[15] = u) : u = t[15], u;
|
|
1170
|
+
}, X = null, Vt = () => (X ??= import("lowlight").then(({ common: e, createLowlight: t }) => t(e)).catch((e) => {
|
|
1171
|
+
throw X = null, e;
|
|
1172
|
+
}), X), Ht = (e, t) => {
|
|
1173
|
+
if (e.type === "text") return e.value;
|
|
1174
|
+
if (e.type === "element") {
|
|
1175
|
+
let { className: n, ...r } = e.properties || {};
|
|
1176
|
+
return ie.createElement(e.tagName, {
|
|
1177
|
+
key: t,
|
|
1178
|
+
...r,
|
|
1179
|
+
className: Array.isArray(n) ? n.join(" ") : n
|
|
1180
|
+
}, e.children?.map((e, n) => Ht(e, `${t}-${n}`)));
|
|
1181
|
+
}
|
|
1182
|
+
return null;
|
|
1183
|
+
}, Z = (e) => {
|
|
1184
|
+
if (!e) return "";
|
|
1185
|
+
if (typeof e == "string") return e;
|
|
1186
|
+
if (e.text) return e.text;
|
|
1187
|
+
if (typeof e.textContent == "string") return e.textContent;
|
|
1188
|
+
if (e.content) {
|
|
1189
|
+
if (Array.isArray(e.content)) return e.content.map(Z).join("");
|
|
1190
|
+
if (typeof e.content.forEach == "function") {
|
|
1191
|
+
let t = "";
|
|
1192
|
+
return e.content.forEach((e) => {
|
|
1193
|
+
t += Z(e);
|
|
1194
|
+
}), t;
|
|
1195
|
+
}
|
|
1196
|
+
}
|
|
1197
|
+
return "";
|
|
1198
|
+
}, Ut = ({ node: e, children: t }) => {
|
|
1199
|
+
let n = oe(Vt()), r = e?.attrs?.language, i = Z(e);
|
|
1200
|
+
if (!i) return /* @__PURE__ */ k("pre", { children: /* @__PURE__ */ k("code", { children: t }) });
|
|
1201
|
+
let a;
|
|
1202
|
+
try {
|
|
1203
|
+
a = r && n.registered(r) ? n.highlight(r, i) : n.highlightAuto(i);
|
|
1204
|
+
} catch {
|
|
1205
|
+
return /* @__PURE__ */ k("pre", { children: /* @__PURE__ */ k("code", { children: i }) });
|
|
1206
|
+
}
|
|
1207
|
+
return !a || !a.children || a.children.length === 0 ? /* @__PURE__ */ k("pre", { children: /* @__PURE__ */ k("code", { children: i }) }) : /* @__PURE__ */ k("pre", { children: /* @__PURE__ */ k("code", {
|
|
1208
|
+
className: r ? `language-${r}` : "",
|
|
1209
|
+
children: a.children.map((e, t) => Ht(e, `code-${t}`))
|
|
1210
|
+
}) });
|
|
1211
|
+
}, Wt = (e) => {
|
|
1212
|
+
let t = D(9), n;
|
|
1213
|
+
t[0] === e.node ? n = t[1] : (n = Z(e.node), t[0] = e.node, t[1] = n);
|
|
1214
|
+
let r = n, i;
|
|
1215
|
+
t[2] === r ? i = t[3] : (i = /* @__PURE__ */ k("pre", { children: /* @__PURE__ */ k("code", { children: r }) }), t[2] = r, t[3] = i);
|
|
1216
|
+
let a;
|
|
1217
|
+
t[4] === e ? a = t[5] : (a = /* @__PURE__ */ k(Ut, { ...e }), t[4] = e, t[5] = a);
|
|
1218
|
+
let o;
|
|
1219
|
+
return t[6] !== i || t[7] !== a ? (o = /* @__PURE__ */ k(ie.Suspense, {
|
|
1220
|
+
fallback: i,
|
|
1221
|
+
children: a
|
|
1222
|
+
}), t[6] = i, t[7] = a, t[8] = o) : o = t[8], o;
|
|
1223
|
+
}, Q = ae({
|
|
1224
|
+
open: !1,
|
|
1225
|
+
toggle: () => {}
|
|
1226
|
+
}), Gt = (e) => {
|
|
1227
|
+
let t = D(15), { node: n, children: r } = e, [i, a] = j(!!n.attrs?.open), o;
|
|
1228
|
+
t[0] === Symbol.for("react.memo_cache_sentinel") ? (o = () => a(Jt), t[0] = o) : o = t[0];
|
|
1229
|
+
let s = o, c = i && "is-open", l;
|
|
1230
|
+
t[1] === c ? l = t[2] : (l = te("details", c), t[1] = c, t[2] = l);
|
|
1231
|
+
let u;
|
|
1232
|
+
t[3] === i ? u = t[4] : (u = /* @__PURE__ */ k("button", {
|
|
1233
|
+
type: "button",
|
|
1234
|
+
"aria-expanded": i,
|
|
1235
|
+
onClick: s
|
|
1236
|
+
}), t[3] = i, t[4] = u);
|
|
1237
|
+
let d;
|
|
1238
|
+
t[5] === i ? d = t[6] : (d = {
|
|
1239
|
+
open: i,
|
|
1240
|
+
toggle: s
|
|
1241
|
+
}, t[5] = i, t[6] = d);
|
|
1242
|
+
let f;
|
|
1243
|
+
t[7] !== r || t[8] !== d ? (f = /* @__PURE__ */ k("div", { children: /* @__PURE__ */ k(Q.Provider, {
|
|
1244
|
+
value: d,
|
|
1245
|
+
children: r
|
|
1246
|
+
}) }), t[7] = r, t[8] = d, t[9] = f) : f = t[9];
|
|
1247
|
+
let p;
|
|
1248
|
+
return t[10] !== i || t[11] !== l || t[12] !== u || t[13] !== f ? (p = /* @__PURE__ */ A("div", {
|
|
1249
|
+
className: l,
|
|
1250
|
+
"data-open": i,
|
|
1251
|
+
children: [u, f]
|
|
1252
|
+
}), t[10] = i, t[11] = l, t[12] = u, t[13] = f, t[14] = p) : p = t[14], p;
|
|
1253
|
+
}, Kt = (e) => {
|
|
1254
|
+
let t = D(7), { children: n } = e, { open: r, toggle: i } = se(Q), a;
|
|
1255
|
+
t[0] === i ? a = t[1] : (a = (e) => {
|
|
1256
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), i());
|
|
1257
|
+
}, t[0] = i, t[1] = a);
|
|
1258
|
+
let o;
|
|
1259
|
+
return t[2] !== n || t[3] !== r || t[4] !== a || t[5] !== i ? (o = /* @__PURE__ */ k("summary", {
|
|
1260
|
+
role: "button",
|
|
1261
|
+
tabIndex: 0,
|
|
1262
|
+
"aria-expanded": r,
|
|
1263
|
+
onClick: i,
|
|
1264
|
+
onKeyDown: a,
|
|
1265
|
+
children: n
|
|
1266
|
+
}), t[2] = n, t[3] = r, t[4] = a, t[5] = i, t[6] = o) : o = t[6], o;
|
|
1267
|
+
}, qt = (e) => {
|
|
1268
|
+
let t = D(5), { children: n } = e, { open: r } = se(Q), i;
|
|
1269
|
+
t[0] === r ? i = t[1] : (i = r ? {} : { hidden: !0 }, t[0] = r, t[1] = i);
|
|
1270
|
+
let a;
|
|
1271
|
+
return t[2] !== n || t[3] !== i ? (a = /* @__PURE__ */ k("div", {
|
|
1272
|
+
"data-type": "detailsContent",
|
|
1273
|
+
...i,
|
|
1274
|
+
children: n
|
|
1275
|
+
}), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
|
|
1276
|
+
};
|
|
1277
|
+
function Jt(e) {
|
|
1278
|
+
return !e;
|
|
1279
|
+
}
|
|
1280
|
+
//#endregion
|
|
1281
|
+
//#region ../../libraries/blog-renderer/dist/views/ImageView.cssm.js
|
|
1282
|
+
var Yt = "_10kj0ro0", Xt = "_10kj0ro1", Zt = "_10kj0ro2", Qt = (e) => e ? typeof e == "string" && e.endsWith("%") ? e : `${e}px` : "fit-content", $t = (e) => {
|
|
1283
|
+
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;
|
|
1284
|
+
if (!c) return null;
|
|
1285
|
+
let g = l || "", _ = u || void 0, v;
|
|
1286
|
+
t[0] !== a || t[1] !== i || t[2] !== c || t[3] !== g || t[4] !== _ ? (v = /* @__PURE__ */ k("img", {
|
|
1287
|
+
ref: i,
|
|
1288
|
+
src: c,
|
|
1289
|
+
alt: g,
|
|
1290
|
+
srcSet: _,
|
|
1291
|
+
className: Zt,
|
|
1292
|
+
loading: "lazy",
|
|
1293
|
+
...a
|
|
1294
|
+
}), t[0] = a, t[1] = i, t[2] = c, t[3] = g, t[4] = _, t[5] = v) : v = t[5];
|
|
1295
|
+
let y = v, b;
|
|
1296
|
+
t[6] !== y || t[7] !== f ? (b = f ? /* @__PURE__ */ k("a", {
|
|
1297
|
+
href: f,
|
|
1298
|
+
target: "_blank",
|
|
1299
|
+
rel: "noopener noreferrer",
|
|
1300
|
+
children: y
|
|
1301
|
+
}) : y, t[6] = y, t[7] = f, t[8] = b) : b = t[8];
|
|
1302
|
+
let x;
|
|
1303
|
+
t[9] !== m || t[10] !== h ? (x = h && /* @__PURE__ */ k("div", {
|
|
1304
|
+
className: te("figcaption", "_10kj0ro3"),
|
|
1305
|
+
children: m
|
|
1306
|
+
}), t[9] = m, t[10] = h, t[11] = x) : x = t[11];
|
|
1307
|
+
let S;
|
|
1308
|
+
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;
|
|
1309
|
+
}, en = (e) => {
|
|
1310
|
+
let t = D(13), { node: n, children: r } = e, i = n.attrs, a = i["data-align"];
|
|
1311
|
+
if (!i.src) return null;
|
|
1312
|
+
let o;
|
|
1313
|
+
t[0] === i.width ? o = t[1] : (o = Qt(i.width), t[0] = i.width, t[1] = o);
|
|
1314
|
+
let s;
|
|
1315
|
+
t[2] === o ? s = t[3] : (s = { width: o }, t[2] = o, t[3] = s);
|
|
1316
|
+
let c;
|
|
1317
|
+
t[4] !== r || t[5] !== n ? (c = /* @__PURE__ */ k($t, {
|
|
1318
|
+
node: n,
|
|
1319
|
+
children: r
|
|
1320
|
+
}), t[4] = r, t[5] = n, t[6] = c) : c = t[6];
|
|
1321
|
+
let l;
|
|
1322
|
+
t[7] !== s || t[8] !== c ? (l = /* @__PURE__ */ k("div", {
|
|
1323
|
+
className: Xt,
|
|
1324
|
+
style: s,
|
|
1325
|
+
children: c
|
|
1326
|
+
}), t[7] = s, t[8] = c, t[9] = l) : l = t[9];
|
|
1327
|
+
let u;
|
|
1328
|
+
return t[10] !== a || t[11] !== l ? (u = /* @__PURE__ */ k("div", {
|
|
1329
|
+
"data-align": a,
|
|
1330
|
+
className: Yt,
|
|
1331
|
+
children: l
|
|
1332
|
+
}), t[10] = a, t[11] = l, t[12] = u) : u = t[12], u;
|
|
1333
|
+
}, tn = "_1dotpmp0", nn = (t) => {
|
|
1334
|
+
let n = D(10), { collectionId: r, workspaceId: i, preview: a, variant: o } = t, s = a === void 0 ? !1 : a, c = o ?? void 0, l;
|
|
1335
|
+
n[0] === Symbol.for("react.memo_cache_sentinel") ? (l = {
|
|
1336
|
+
show: !0,
|
|
1337
|
+
text: "Submit"
|
|
1338
|
+
}, n[0] = l) : l = n[0];
|
|
1339
|
+
let u;
|
|
1340
|
+
n[1] === Symbol.for("react.memo_cache_sentinel") ? (u = {
|
|
1341
|
+
hideFormHeading: !0,
|
|
1342
|
+
hideSectionHeadings: !0
|
|
1343
|
+
}, n[1] = u) : u = n[1];
|
|
1344
|
+
let d;
|
|
1345
|
+
n[2] === s ? d = n[3] : (d = { style: s ? { pointerEvents: "none" } : {} }, n[2] = s, n[3] = d);
|
|
1346
|
+
let f;
|
|
1347
|
+
return n[4] !== r || n[5] !== s || n[6] !== c || n[7] !== d || n[8] !== i ? (f = /* @__PURE__ */ k(e, {
|
|
1348
|
+
collection_id: r,
|
|
1349
|
+
formVariant: c,
|
|
1350
|
+
submitButtonConfig: l,
|
|
1351
|
+
workspace_id: i,
|
|
1352
|
+
preview: s,
|
|
1353
|
+
disableCaptcha: s,
|
|
1354
|
+
uiConfig: u,
|
|
1355
|
+
theme: d
|
|
1356
|
+
}), n[4] = r, n[5] = s, n[6] = c, n[7] = d, n[8] = i, n[9] = f) : f = n[9], f;
|
|
1357
|
+
}, rn = (e) => {
|
|
1358
|
+
let n = D(4), { node: r } = e, i = r?.attrs?.collectionId, a = r?.attrs?.variant, { workspace: o } = t();
|
|
1359
|
+
if (!i || !o) return null;
|
|
1360
|
+
let s;
|
|
1361
|
+
return n[0] !== i || n[1] !== a || n[2] !== o ? (s = /* @__PURE__ */ k("div", {
|
|
1362
|
+
className: tn,
|
|
1363
|
+
children: /* @__PURE__ */ k(nn, {
|
|
1364
|
+
collectionId: i,
|
|
1365
|
+
workspaceId: o,
|
|
1366
|
+
variant: a
|
|
1367
|
+
})
|
|
1368
|
+
}), n[0] = i, n[1] = a, n[2] = o, n[3] = s) : s = n[3], s;
|
|
1369
|
+
}, an = /^((?:https?:)?\/\/)?((?:www|m|music)\.)?((?:youtube\.com|youtu\.be|youtube-nocookie\.com))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/, on = /^((?:https?:)?\/\/)?((?:www|m|music)\.)?((?:youtube\.com|youtu\.be|youtube-nocookie\.com))(\/(?:[\w-]+\?v=|embed\/|v\/)?)([\w-]+)(\S+)?$/g, $ = (e) => e.match(an), sn = (e, t) => t ? "https://www.youtube-nocookie.com/embed/videoseries?list=" : e ? "https://www.youtube-nocookie.com/embed/" : "https://www.youtube.com/embed/", cn = (e) => {
|
|
1370
|
+
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;
|
|
1371
|
+
if (!$(t)) return null;
|
|
1372
|
+
if (t.includes("/embed/")) return t;
|
|
1373
|
+
if (t.includes("youtu.be")) {
|
|
1374
|
+
let e = t.split("/").pop();
|
|
1375
|
+
return e ? `${sn(m)}${e}` : null;
|
|
1376
|
+
}
|
|
1377
|
+
let b = /(?:(v|list)=|shorts\/)([-\w]+)/gm.exec(t);
|
|
1378
|
+
if (!b || !b[2]) return null;
|
|
1379
|
+
let x = `${sn(m, b[1] === "list")}${b[2]}`, S = [];
|
|
1380
|
+
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;
|
|
1381
|
+
}, ln = (e) => {
|
|
1382
|
+
let t;
|
|
1383
|
+
try {
|
|
1384
|
+
t = new URL(e);
|
|
1385
|
+
} catch {
|
|
1386
|
+
return null;
|
|
1387
|
+
}
|
|
1388
|
+
let n = t.hostname.replace(/^www\./, "");
|
|
1389
|
+
if (n !== "youtube.com" && n !== "youtube-nocookie.com") return null;
|
|
1390
|
+
let r = null;
|
|
1391
|
+
if (t.pathname === "/embed/videoseries") {
|
|
1392
|
+
let e = t.searchParams.get("list");
|
|
1393
|
+
if (!e) return null;
|
|
1394
|
+
r = `https://www.youtube.com/playlist?list=${e}`;
|
|
1395
|
+
} else {
|
|
1396
|
+
let e = t.pathname.match(/^\/embed\/([\w-]+)$/);
|
|
1397
|
+
if (!e?.[1]) return null;
|
|
1398
|
+
r = `https://www.youtube.com/watch?v=${e[1]}`;
|
|
1399
|
+
}
|
|
1400
|
+
if (!$(r)) return null;
|
|
1401
|
+
let i = { src: r }, a = t.searchParams.get("start");
|
|
1402
|
+
if (a) {
|
|
1403
|
+
let e = Number.parseInt(a, 10);
|
|
1404
|
+
Number.isNaN(e) || (i.start = e);
|
|
1405
|
+
}
|
|
1406
|
+
return i;
|
|
1407
|
+
}, un = (e) => {
|
|
1408
|
+
if (!e) return null;
|
|
1409
|
+
let t = e.trim();
|
|
1410
|
+
if (t === "") return null;
|
|
1411
|
+
let n = Number(t);
|
|
1412
|
+
return Number.isNaN(n) ? t : n;
|
|
1413
|
+
}, dn = (e) => {
|
|
1414
|
+
let t = e.getAttribute("src");
|
|
1415
|
+
return t ? ln(t) || { src: t } : null;
|
|
1416
|
+
}, fn = N.create({
|
|
1417
|
+
name: "youtube",
|
|
1418
|
+
addOptions() {
|
|
1419
|
+
return {
|
|
1420
|
+
addPasteHandler: !0,
|
|
1421
|
+
allowFullscreen: !0,
|
|
1422
|
+
autoplay: !1,
|
|
1423
|
+
ccLanguage: void 0,
|
|
1424
|
+
ccLoadPolicy: void 0,
|
|
1425
|
+
controls: !0,
|
|
1426
|
+
disableKBcontrols: !1,
|
|
1427
|
+
enableIFrameApi: !1,
|
|
1428
|
+
endTime: 0,
|
|
1429
|
+
height: 480,
|
|
1430
|
+
interfaceLanguage: void 0,
|
|
1431
|
+
ivLoadPolicy: 0,
|
|
1432
|
+
loop: !1,
|
|
1433
|
+
modestBranding: !1,
|
|
1434
|
+
HTMLAttributes: {},
|
|
1435
|
+
inline: !1,
|
|
1436
|
+
nocookie: !1,
|
|
1437
|
+
origin: "",
|
|
1438
|
+
playlist: "",
|
|
1439
|
+
progressBarColor: void 0,
|
|
1440
|
+
width: 640,
|
|
1441
|
+
rel: 1
|
|
1442
|
+
};
|
|
1443
|
+
},
|
|
1444
|
+
inline() {
|
|
1445
|
+
return this.options.inline;
|
|
1446
|
+
},
|
|
1447
|
+
group() {
|
|
1448
|
+
return this.options.inline ? "inline" : "block";
|
|
1449
|
+
},
|
|
1450
|
+
draggable: !0,
|
|
1451
|
+
addAttributes() {
|
|
1452
|
+
return {
|
|
1453
|
+
src: {
|
|
1454
|
+
default: null,
|
|
1455
|
+
parseHTML: (e) => dn(e)?.src
|
|
1456
|
+
},
|
|
1457
|
+
start: {
|
|
1458
|
+
default: 0,
|
|
1459
|
+
parseHTML: (e) => dn(e)?.start
|
|
1460
|
+
},
|
|
1461
|
+
width: {
|
|
1462
|
+
default: this.options.width,
|
|
1463
|
+
parseHTML: (e) => un(e.getAttribute("width"))
|
|
1464
|
+
},
|
|
1465
|
+
height: {
|
|
1466
|
+
default: this.options.height,
|
|
1467
|
+
parseHTML: (e) => un(e.getAttribute("height"))
|
|
1468
|
+
}
|
|
1469
|
+
};
|
|
1470
|
+
},
|
|
1471
|
+
parseHTML() {
|
|
1472
|
+
return [{ tag: "div[data-youtube-video] iframe" }];
|
|
1473
|
+
},
|
|
1474
|
+
addCommands() {
|
|
1475
|
+
return { setYoutubeVideo: (e) => ({ commands: t }) => $(e.src) ? t.insertContent({
|
|
1476
|
+
type: this.name,
|
|
1477
|
+
attrs: e
|
|
1478
|
+
}) : !1 };
|
|
1479
|
+
},
|
|
1480
|
+
addPasteRules() {
|
|
1481
|
+
return this.options.addPasteHandler ? [fe({
|
|
1482
|
+
find: on,
|
|
1483
|
+
type: this.type,
|
|
1484
|
+
getAttributes: (e) => ({ src: e.input })
|
|
1485
|
+
})] : [];
|
|
1486
|
+
},
|
|
1487
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
1488
|
+
return e.src = cn({
|
|
1489
|
+
url: e.src,
|
|
1490
|
+
allowFullscreen: this.options.allowFullscreen,
|
|
1491
|
+
autoplay: this.options.autoplay,
|
|
1492
|
+
ccLanguage: this.options.ccLanguage,
|
|
1493
|
+
ccLoadPolicy: this.options.ccLoadPolicy,
|
|
1494
|
+
controls: this.options.controls,
|
|
1495
|
+
disableKBcontrols: this.options.disableKBcontrols,
|
|
1496
|
+
enableIFrameApi: this.options.enableIFrameApi,
|
|
1497
|
+
endTime: this.options.endTime,
|
|
1498
|
+
interfaceLanguage: this.options.interfaceLanguage,
|
|
1499
|
+
ivLoadPolicy: this.options.ivLoadPolicy,
|
|
1500
|
+
loop: this.options.loop,
|
|
1501
|
+
modestBranding: this.options.modestBranding,
|
|
1502
|
+
nocookie: this.options.nocookie,
|
|
1503
|
+
origin: this.options.origin,
|
|
1504
|
+
playlist: this.options.playlist,
|
|
1505
|
+
progressBarColor: this.options.progressBarColor,
|
|
1506
|
+
startAt: e.start || 0,
|
|
1507
|
+
rel: this.options.rel
|
|
1508
|
+
}), [
|
|
1509
|
+
"div",
|
|
1510
|
+
{ "data-youtube-video": "" },
|
|
1511
|
+
["iframe", P(this.options.HTMLAttributes, {
|
|
1512
|
+
width: this.options.width,
|
|
1513
|
+
height: this.options.height,
|
|
1514
|
+
allowfullscreen: this.options.allowFullscreen,
|
|
1515
|
+
autoplay: this.options.autoplay,
|
|
1516
|
+
ccLanguage: this.options.ccLanguage,
|
|
1517
|
+
ccLoadPolicy: this.options.ccLoadPolicy,
|
|
1518
|
+
disableKBcontrols: this.options.disableKBcontrols,
|
|
1519
|
+
enableIFrameApi: this.options.enableIFrameApi,
|
|
1520
|
+
endTime: this.options.endTime,
|
|
1521
|
+
interfaceLanguage: this.options.interfaceLanguage,
|
|
1522
|
+
ivLoadPolicy: this.options.ivLoadPolicy,
|
|
1523
|
+
loop: this.options.loop,
|
|
1524
|
+
modestBranding: this.options.modestBranding,
|
|
1525
|
+
origin: this.options.origin,
|
|
1526
|
+
playlist: this.options.playlist,
|
|
1527
|
+
progressBarColor: this.options.progressBarColor,
|
|
1528
|
+
rel: this.options.rel
|
|
1529
|
+
}, e)]
|
|
1530
|
+
];
|
|
1531
|
+
},
|
|
1532
|
+
...ue({
|
|
1533
|
+
nodeName: "youtube",
|
|
1534
|
+
allowedAttributes: [
|
|
1535
|
+
"src",
|
|
1536
|
+
"width",
|
|
1537
|
+
"height",
|
|
1538
|
+
"start"
|
|
1539
|
+
]
|
|
1540
|
+
})
|
|
1541
|
+
}), pn = [
|
|
1542
|
+
ct,
|
|
1543
|
+
h,
|
|
1544
|
+
d,
|
|
1545
|
+
s,
|
|
1546
|
+
l,
|
|
1547
|
+
f,
|
|
1548
|
+
a,
|
|
1549
|
+
p,
|
|
1550
|
+
u,
|
|
1551
|
+
v,
|
|
1552
|
+
o,
|
|
1553
|
+
me,
|
|
1554
|
+
c,
|
|
1555
|
+
_,
|
|
1556
|
+
he.configure({ openOnClick: !1 }),
|
|
1557
|
+
Se,
|
|
1558
|
+
i,
|
|
1559
|
+
Ie,
|
|
1560
|
+
Fe,
|
|
1561
|
+
Pe,
|
|
1562
|
+
g,
|
|
1563
|
+
b.configure({ multicolor: !0 }),
|
|
1564
|
+
Mt,
|
|
1565
|
+
x,
|
|
1566
|
+
Le.configure({ types: [
|
|
1567
|
+
"table",
|
|
1568
|
+
"paragraph",
|
|
1569
|
+
"bulletList",
|
|
1570
|
+
"orderedList",
|
|
1571
|
+
"taskList",
|
|
1572
|
+
"heading",
|
|
1573
|
+
"blockquoteFigure",
|
|
1574
|
+
"codeBlock"
|
|
1575
|
+
] }),
|
|
1576
|
+
Ee.configure({ itemTypeName: "taskItem" }),
|
|
1577
|
+
Te.configure({ nested: !0 }),
|
|
1578
|
+
Rt.configure({ table: { cellMinWidth: 120 } }),
|
|
1579
|
+
Ot,
|
|
1580
|
+
At,
|
|
1581
|
+
C,
|
|
1582
|
+
Qe,
|
|
1583
|
+
et,
|
|
1584
|
+
st,
|
|
1585
|
+
at,
|
|
1586
|
+
dt,
|
|
1587
|
+
lt,
|
|
1588
|
+
tt,
|
|
1589
|
+
nt,
|
|
1590
|
+
fn.configure({
|
|
1591
|
+
allowFullscreen: !0,
|
|
1592
|
+
nocookie: !0,
|
|
1593
|
+
HTMLAttributes: { referrerpolicy: "strict-origin-when-cross-origin" }
|
|
1594
|
+
}),
|
|
1595
|
+
ut,
|
|
1596
|
+
kt,
|
|
1597
|
+
$e
|
|
1598
|
+
], mn = (e) => m(e, pn), hn = (e) => {
|
|
1599
|
+
let t = D(18), n, r, i, a, o;
|
|
1600
|
+
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);
|
|
1601
|
+
let s;
|
|
1602
|
+
t[6] === r ? s = t[7] : (s = y({
|
|
1603
|
+
content: r,
|
|
1604
|
+
extensions: pn,
|
|
1605
|
+
options: { nodeMapping: {
|
|
1606
|
+
bookmark: Je,
|
|
1607
|
+
button: Bt,
|
|
1608
|
+
details: Gt,
|
|
1609
|
+
detailsSummary: Kt,
|
|
1610
|
+
detailsContent: qt,
|
|
1611
|
+
codeBlock: Wt,
|
|
1612
|
+
imageBlock: en,
|
|
1613
|
+
levoCollection: rn
|
|
1614
|
+
} }
|
|
1615
|
+
}), t[6] = r, t[7] = s);
|
|
1616
|
+
let c = s, l;
|
|
1617
|
+
t[8] === n ? l = t[9] : (l = O(T, n), t[8] = n, t[9] = l);
|
|
1618
|
+
let u;
|
|
1619
|
+
t[10] !== c || t[11] !== i || t[12] !== a || t[13] !== l ? (u = /* @__PURE__ */ k("div", {
|
|
1620
|
+
ref: i,
|
|
1621
|
+
className: l,
|
|
1622
|
+
...a,
|
|
1623
|
+
children: c
|
|
1624
|
+
}), t[10] = c, t[11] = i, t[12] = a, t[13] = l, t[14] = u) : u = t[14];
|
|
1625
|
+
let d;
|
|
1626
|
+
return t[15] !== u || t[16] !== o ? (d = /* @__PURE__ */ k(E, {
|
|
1627
|
+
theme: o,
|
|
1628
|
+
children: u
|
|
1629
|
+
}), t[15] = u, t[16] = o, t[17] = d) : d = t[17], d;
|
|
1630
|
+
}, gn = (e) => {
|
|
1631
|
+
if (!e) return null;
|
|
1632
|
+
if (typeof e == "string") return e.trim() ? mn(e) : null;
|
|
1633
|
+
if (typeof e != "object") return null;
|
|
1634
|
+
let t = e;
|
|
1635
|
+
return t.json ? t.json : typeof t.html == "string" ? t.html.trim() ? mn(t.html) : null : t.type === "doc" ? t : null;
|
|
1636
|
+
}, _n = ({ content: e, ...t }) => {
|
|
1637
|
+
let n = gn(e);
|
|
1638
|
+
return n ? /* @__PURE__ */ k(hn, {
|
|
1639
|
+
content: n,
|
|
1640
|
+
...t
|
|
1641
|
+
}) : null;
|
|
1642
|
+
};
|
|
1643
|
+
//#endregion
|
|
1644
|
+
export { _n as LevoRichText };
|