@dotit/editor 1.0.0 → 1.1.0
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/dist/Ruler.d.ts +9 -0
- package/dist/index.cjs +21 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1070 -1035
- package/dist/index.mjs.map +1 -1
- package/dist/page-geometry.d.ts +2 -0
- package/dist/style.css +177 -137
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
1
|
+
import { jsxs as b, jsx as a, Fragment as me } from "react/jsx-runtime";
|
|
2
|
+
import { useState as P, useRef as B, useEffect as j, useCallback as R, useMemo as Y, useLayoutEffect as be } from "react";
|
|
3
3
|
import { useEditor as ye, EditorContent as ke } from "@tiptap/react";
|
|
4
4
|
import Se from "@tiptap/starter-kit";
|
|
5
5
|
import we from "@tiptap/extension-placeholder";
|
|
6
6
|
import ve from "@tiptap/extension-underline";
|
|
7
7
|
import { TextStyle as Te } from "@tiptap/extension-text-style";
|
|
8
8
|
import xe from "@tiptap/extension-color";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import { Extension as vt, Node as E, mergeAttributes as
|
|
9
|
+
import Le from "@tiptap/extension-highlight";
|
|
10
|
+
import Ae from "@tiptap/extension-text-align";
|
|
11
|
+
import Ce from "@tiptap/extension-font-family";
|
|
12
|
+
import Ne from "@tiptap/extension-subscript";
|
|
13
|
+
import $e from "@tiptap/extension-superscript";
|
|
14
|
+
import { Extension as vt, Node as E, mergeAttributes as _ } from "@tiptap/core";
|
|
15
15
|
import { Plugin as Xt, PluginKey as te } from "@tiptap/pm/state";
|
|
16
|
-
import { DecorationSet as St, Decoration as
|
|
17
|
-
import { parseIntentText as
|
|
16
|
+
import { DecorationSet as St, Decoration as Nt } from "@tiptap/pm/view";
|
|
17
|
+
import { parseIntentText as et, listBuiltinThemes as Me, renderPrint as ze, cssContentValue as _e, LANGUAGE_REGISTRY as He, getBuiltinTheme as Re, generateThemeCSS as Ee, verifyDocument as Pe, documentStyleCSS as Be } from "@dotit/core";
|
|
18
18
|
import Ie from "@tiptap/extension-paragraph";
|
|
19
|
-
import { Undo2 as Oe, Redo2 as De, Printer as Fe, FileCode2 as je, Droplets as We, ChevronDown as yt, Minus as Ge, Plus as
|
|
20
|
-
const
|
|
19
|
+
import { Undo2 as Oe, Redo2 as De, Printer as Fe, FileCode2 as je, Droplets as We, ChevronDown as yt, Minus as Ge, Plus as Bt, Bold as Ue, Italic as Ye, Underline as Ke, Strikethrough as qe, Palette as Je, RemoveFormatting as It, Highlighter as Ve, Code as Qe, AlignLeft as Ze, AlignCenter as Xe, AlignRight as tn, AlignJustify as en, Rows3 as nn, List as rn, ListOrdered as on, AlignHorizontalSpaceBetween as Ot, FileLock2 as sn, PenTool as an, ShieldCheck as cn } from "lucide-react";
|
|
20
|
+
const ln = vt.create({
|
|
21
21
|
name: "fontSize",
|
|
22
22
|
addOptions() {
|
|
23
23
|
return { types: ["textStyle"] };
|
|
@@ -42,23 +42,30 @@ const un = vt.create({
|
|
|
42
42
|
unsetFontSize: () => ({ chain: t }) => t().setMark("textStyle", { fontSize: null }).removeEmptyTextStyle().run()
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
|
-
}),
|
|
45
|
+
}), tt = 96 / 25.4, kt = {
|
|
46
46
|
A4: [210, 297],
|
|
47
47
|
A5: [148, 210],
|
|
48
48
|
A3: [297, 420],
|
|
49
49
|
Letter: [215.9, 279.4],
|
|
50
50
|
Legal: [215.9, 355.6],
|
|
51
51
|
Tabloid: [279.4, 431.8]
|
|
52
|
-
},
|
|
53
|
-
|
|
52
|
+
}, dn = {
|
|
53
|
+
A4: "cm",
|
|
54
|
+
A5: "cm",
|
|
55
|
+
A3: "cm",
|
|
56
|
+
LETTER: "in",
|
|
57
|
+
LEGAL: "in",
|
|
58
|
+
TABLOID: "in"
|
|
59
|
+
}, un = 20, pn = 4, fn = 120;
|
|
60
|
+
function $t(t) {
|
|
54
61
|
const e = /^(-?\d+(?:\.\d+)?)\s*(mm|cm|in|px|pt)?$/.exec(t.trim());
|
|
55
62
|
if (!e) return null;
|
|
56
63
|
const n = parseFloat(e[1]);
|
|
57
64
|
switch (e[2] || "mm") {
|
|
58
65
|
case "mm":
|
|
59
|
-
return n *
|
|
66
|
+
return n * tt;
|
|
60
67
|
case "cm":
|
|
61
|
-
return n * 10 *
|
|
68
|
+
return n * 10 * tt;
|
|
62
69
|
case "in":
|
|
63
70
|
return n * 96;
|
|
64
71
|
case "pt":
|
|
@@ -69,45 +76,46 @@ function Nt(t) {
|
|
|
69
76
|
return null;
|
|
70
77
|
}
|
|
71
78
|
}
|
|
72
|
-
function
|
|
73
|
-
const n = t.trim().split(/\s+/).map(
|
|
79
|
+
function gn(t, e) {
|
|
80
|
+
const n = t.trim().split(/\s+/).map($t);
|
|
74
81
|
if (n.some((o) => o === null) || n.length === 0)
|
|
75
82
|
return [e, e, e, e];
|
|
76
83
|
const r = n;
|
|
77
84
|
return r.length === 1 ? [r[0], r[0], r[0], r[0]] : r.length === 2 ? [r[0], r[1], r[0], r[1]] : r.length === 3 ? [r[0], r[1], r[2], r[1]] : [r[0], r[1], r[2], r[3]];
|
|
78
85
|
}
|
|
79
|
-
function
|
|
86
|
+
function Mt(t) {
|
|
80
87
|
let e = "A4", n, r = "", o = "";
|
|
81
88
|
try {
|
|
82
|
-
const
|
|
83
|
-
|
|
89
|
+
const C = et(t), w = C.blocks.find((I) => I.type === "page")?.properties || {};
|
|
90
|
+
w.size && (e = String(w.size)), n = w.margin ?? w.margins, r = C.blocks.find((I) => I.type === "header")?.content || String(w.header || ""), o = C.blocks.find((I) => I.type === "footer")?.content || String(w.footer || "");
|
|
84
91
|
} catch {
|
|
85
92
|
}
|
|
86
|
-
let l = kt.A4[0] *
|
|
87
|
-
const
|
|
88
|
-
if (
|
|
89
|
-
l =
|
|
93
|
+
let l = kt.A4[0] * tt, c = kt.A4[1] * tt, d = !1, s = "cm";
|
|
94
|
+
const f = kt[e] || kt[e.toUpperCase?.()];
|
|
95
|
+
if (f)
|
|
96
|
+
l = f[0] * tt, c = f[1] * tt, s = dn[e.toUpperCase()] || "cm";
|
|
90
97
|
else {
|
|
91
|
-
const
|
|
92
|
-
if (
|
|
93
|
-
|
|
98
|
+
const C = e.trim().split(/\s+/), v = C[0] ? $t(C[0]) : null;
|
|
99
|
+
if (v && (l = v), /(\d)\s*in\b/.test(e) && (s = "in"), C[1] === "auto")
|
|
100
|
+
d = !0, c = 1 / 0;
|
|
94
101
|
else {
|
|
95
|
-
const
|
|
96
|
-
|
|
102
|
+
const w = C[1] ? $t(C[1]) : null;
|
|
103
|
+
w && (c = w);
|
|
97
104
|
}
|
|
98
105
|
}
|
|
99
|
-
const
|
|
106
|
+
const p = (l <= fn * tt ? pn : un) * tt, [h, g, k, M] = n ? gn(n, p) : [p, p, p, p];
|
|
100
107
|
return {
|
|
101
108
|
width: l,
|
|
102
|
-
height:
|
|
103
|
-
autoHeight:
|
|
104
|
-
marginTop:
|
|
105
|
-
marginRight:
|
|
106
|
-
marginBottom:
|
|
107
|
-
marginLeft:
|
|
108
|
-
contentHeight:
|
|
109
|
+
height: c,
|
|
110
|
+
autoHeight: d,
|
|
111
|
+
marginTop: h,
|
|
112
|
+
marginRight: g,
|
|
113
|
+
marginBottom: k,
|
|
114
|
+
marginLeft: M,
|
|
115
|
+
contentHeight: d ? 1 / 0 : c - h - k,
|
|
109
116
|
header: r,
|
|
110
|
-
footer: o
|
|
117
|
+
footer: o,
|
|
118
|
+
unit: s
|
|
111
119
|
};
|
|
112
120
|
}
|
|
113
121
|
function ee(t, e, n) {
|
|
@@ -123,7 +131,7 @@ function xt(t, e, n, r) {
|
|
|
123
131
|
function hn(t) {
|
|
124
132
|
return t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
125
133
|
}
|
|
126
|
-
const
|
|
134
|
+
const mn = vt.create({
|
|
127
135
|
name: "pagination",
|
|
128
136
|
addOptions() {
|
|
129
137
|
return {
|
|
@@ -162,96 +170,96 @@ const bn = vt.create({
|
|
|
162
170
|
},
|
|
163
171
|
view(e) {
|
|
164
172
|
let n = 0, r = "";
|
|
165
|
-
const o = (
|
|
166
|
-
const
|
|
167
|
-
return
|
|
168
|
-
<div class="docs-pb-fill" style="height:${
|
|
169
|
-
<div class="docs-pb-margin docs-pb-margin-bottom" style="height:${
|
|
170
|
-
${xt("footer",
|
|
173
|
+
const o = (s, f, p, h) => {
|
|
174
|
+
const g = document.createElement("div");
|
|
175
|
+
return g.className = "docs-page-spacer", g.contentEditable = "false", g.setAttribute("data-it-spacer", ""), g.style.setProperty("--pb-mx-l", `${s.marginLeft}px`), g.style.setProperty("--pb-mx-r", `${s.marginRight}px`), g.innerHTML = `
|
|
176
|
+
<div class="docs-pb-fill" style="height:${f}px"></div>
|
|
177
|
+
<div class="docs-pb-margin docs-pb-margin-bottom" style="height:${s.marginBottom}px">
|
|
178
|
+
${xt("footer", s.footer, p, h)}
|
|
171
179
|
</div>
|
|
172
180
|
<div class="docs-pb-gap" style="height:${t.gap}px"></div>
|
|
173
|
-
<div class="docs-pb-margin docs-pb-margin-top" style="height:${
|
|
174
|
-
${xt("header",
|
|
175
|
-
</div>`,
|
|
176
|
-
}, l = (
|
|
177
|
-
const
|
|
178
|
-
return
|
|
179
|
-
<div class="docs-pb-fill" style="height:${
|
|
180
|
-
<div class="docs-pb-margin docs-pb-margin-bottom" style="height:${
|
|
181
|
-
${xt("footer",
|
|
182
|
-
</div>`,
|
|
183
|
-
},
|
|
184
|
-
const
|
|
185
|
-
if (
|
|
181
|
+
<div class="docs-pb-margin docs-pb-margin-top" style="height:${s.marginTop}px">
|
|
182
|
+
${xt("header", s.header, p + 1, h)}
|
|
183
|
+
</div>`, g;
|
|
184
|
+
}, l = (s, f, p, h) => {
|
|
185
|
+
const g = document.createElement("div");
|
|
186
|
+
return g.className = "docs-page-spacer docs-page-tail", g.contentEditable = "false", g.setAttribute("data-it-spacer", ""), g.style.setProperty("--pb-mx-l", `${s.marginLeft}px`), g.style.setProperty("--pb-mx-r", `${s.marginRight}px`), g.innerHTML = `
|
|
187
|
+
<div class="docs-pb-fill" style="height:${f}px"></div>
|
|
188
|
+
<div class="docs-pb-margin docs-pb-margin-bottom" style="height:${s.marginBottom}px">
|
|
189
|
+
${xt("footer", s.footer, p, h)}
|
|
190
|
+
</div>`, g;
|
|
191
|
+
}, c = () => {
|
|
192
|
+
const s = t.geometry(), f = e.dom, p = e.state.doc;
|
|
193
|
+
if (s.autoHeight) {
|
|
186
194
|
r !== "auto" && (r = "auto", e.dispatch(
|
|
187
195
|
e.state.tr.setMeta(ft, St.empty)
|
|
188
196
|
), t.onPages?.(1));
|
|
189
197
|
return;
|
|
190
198
|
}
|
|
191
|
-
const
|
|
192
|
-
let
|
|
193
|
-
for (const N of
|
|
199
|
+
const h = f.getBoundingClientRect().top, g = Array.from(f.children), k = [];
|
|
200
|
+
let M = 0;
|
|
201
|
+
for (const N of g) {
|
|
194
202
|
if (N.hasAttribute?.("data-it-spacer")) {
|
|
195
|
-
|
|
203
|
+
M += N.offsetHeight;
|
|
196
204
|
continue;
|
|
197
205
|
}
|
|
198
206
|
const H = N.getBoundingClientRect();
|
|
199
207
|
k.push({
|
|
200
|
-
natTop: H.top -
|
|
201
|
-
natBottom: H.bottom -
|
|
208
|
+
natTop: H.top - h - M,
|
|
209
|
+
natBottom: H.bottom - h - M
|
|
202
210
|
});
|
|
203
211
|
}
|
|
204
|
-
const
|
|
205
|
-
let
|
|
212
|
+
const C = [];
|
|
213
|
+
let v = 0, w = k.length ? k[0].natTop : 0, I = w;
|
|
206
214
|
for (let N = 0; N < k.length && N < p.childCount; N++) {
|
|
207
215
|
const H = k[N], ot = p.child(N).nodeSize;
|
|
208
|
-
H.natTop >
|
|
209
|
-
H.natBottom -
|
|
210
|
-
pos:
|
|
211
|
-
rest: Math.max(0,
|
|
212
|
-
}),
|
|
216
|
+
H.natTop > w && // never break before the page's first block
|
|
217
|
+
H.natBottom - w > s.contentHeight && (C.push({
|
|
218
|
+
pos: v,
|
|
219
|
+
rest: Math.max(0, s.contentHeight - (H.natTop - w))
|
|
220
|
+
}), w = H.natTop), I = H.natBottom, v += ot;
|
|
213
221
|
}
|
|
214
|
-
const
|
|
222
|
+
const O = C.length + 1, K = Math.max(
|
|
215
223
|
0,
|
|
216
|
-
|
|
217
|
-
),
|
|
218
|
-
if (
|
|
219
|
-
r =
|
|
220
|
-
const
|
|
221
|
-
(N, H) =>
|
|
224
|
+
s.contentHeight - (I - w)
|
|
225
|
+
), q = C.map((N) => `${N.pos}:${Math.round(N.rest)}`).join(",") + `|${Math.round(K)}|${O}|${s.header}|${s.footer}|${Math.round(s.contentHeight)}`;
|
|
226
|
+
if (q === r) return;
|
|
227
|
+
r = q;
|
|
228
|
+
const W = C.map(
|
|
229
|
+
(N, H) => Nt.widget(
|
|
222
230
|
N.pos,
|
|
223
|
-
() => o(
|
|
231
|
+
() => o(s, N.rest, H + 1, O),
|
|
224
232
|
{ side: -1, key: `pb-${H + 1}-${Math.round(N.rest)}` }
|
|
225
233
|
)
|
|
226
234
|
);
|
|
227
|
-
|
|
228
|
-
|
|
235
|
+
W.push(
|
|
236
|
+
Nt.widget(
|
|
229
237
|
p.content.size,
|
|
230
|
-
() => l(
|
|
231
|
-
{ side: 1, key: `pb-tail-${
|
|
238
|
+
() => l(s, K, O, O),
|
|
239
|
+
{ side: 1, key: `pb-tail-${O}-${Math.round(K)}` }
|
|
232
240
|
)
|
|
233
241
|
);
|
|
234
|
-
const rt = St.create(e.state.doc,
|
|
235
|
-
e.dispatch(e.state.tr.setMeta(ft, rt)), t.onPages?.(
|
|
236
|
-
},
|
|
237
|
-
cancelAnimationFrame(n), n = requestAnimationFrame(
|
|
242
|
+
const rt = St.create(e.state.doc, W);
|
|
243
|
+
e.dispatch(e.state.tr.setMeta(ft, rt)), t.onPages?.(O);
|
|
244
|
+
}, d = () => {
|
|
245
|
+
cancelAnimationFrame(n), n = requestAnimationFrame(c);
|
|
238
246
|
};
|
|
239
|
-
return
|
|
240
|
-
update:
|
|
247
|
+
return d(), {
|
|
248
|
+
update: d,
|
|
241
249
|
destroy: () => cancelAnimationFrame(n)
|
|
242
250
|
};
|
|
243
251
|
}
|
|
244
252
|
})
|
|
245
253
|
];
|
|
246
254
|
}
|
|
247
|
-
}), Dt = /* @__PURE__ */ new Set(["tip", "info", "warning", "danger", "success"]),
|
|
255
|
+
}), Dt = /* @__PURE__ */ new Set(["tip", "info", "warning", "danger", "success"]), bn = /* @__PURE__ */ new Set([
|
|
248
256
|
"page",
|
|
249
257
|
"meta",
|
|
250
258
|
"font",
|
|
251
259
|
"header",
|
|
252
260
|
"footer",
|
|
253
261
|
"watermark"
|
|
254
|
-
]),
|
|
262
|
+
]), yn = /* @__PURE__ */ new Set([
|
|
255
263
|
"sign",
|
|
256
264
|
"seal",
|
|
257
265
|
"approve",
|
|
@@ -262,10 +270,10 @@ const bn = vt.create({
|
|
|
262
270
|
title: "itTitle",
|
|
263
271
|
section: "itSection",
|
|
264
272
|
sub: "itSub"
|
|
265
|
-
},
|
|
273
|
+
}, kn = {
|
|
266
274
|
note: "text",
|
|
267
275
|
"body-text": "text"
|
|
268
|
-
},
|
|
276
|
+
}, Sn = /* @__PURE__ */ new Set([
|
|
269
277
|
"weight",
|
|
270
278
|
"italic",
|
|
271
279
|
"underline",
|
|
@@ -281,7 +289,7 @@ const bn = vt.create({
|
|
|
281
289
|
"font",
|
|
282
290
|
"bgcolor"
|
|
283
291
|
]);
|
|
284
|
-
function
|
|
292
|
+
function wn(t) {
|
|
285
293
|
if (!t || t === "{}") return {};
|
|
286
294
|
try {
|
|
287
295
|
return typeof t == "string" ? JSON.parse(t) : t || {};
|
|
@@ -289,20 +297,20 @@ function vn(t) {
|
|
|
289
297
|
return {};
|
|
290
298
|
}
|
|
291
299
|
}
|
|
292
|
-
function
|
|
300
|
+
function F(t, e) {
|
|
293
301
|
const n = Object.entries(t).filter(
|
|
294
302
|
([r, o]) => o !== void 0 && o !== "" && (!e || !e.has(r))
|
|
295
303
|
);
|
|
296
304
|
return n.length === 0 ? "" : " | " + n.map(([r, o]) => `${r}: ${o}`).join(" | ");
|
|
297
305
|
}
|
|
298
|
-
function
|
|
306
|
+
function zt(t) {
|
|
299
307
|
if (!t) return [];
|
|
300
308
|
const e = t.split("\\n"), n = [];
|
|
301
309
|
return e.forEach((r, o) => {
|
|
302
310
|
r && n.push({ type: "text", text: r }), o < e.length - 1 && n.push({ type: "hardBreak" });
|
|
303
311
|
}), n;
|
|
304
312
|
}
|
|
305
|
-
function
|
|
313
|
+
function vn(t) {
|
|
306
314
|
switch (t.type) {
|
|
307
315
|
case "bold":
|
|
308
316
|
return [{ type: "bold" }];
|
|
@@ -322,7 +330,7 @@ function Tn(t) {
|
|
|
322
330
|
return null;
|
|
323
331
|
}
|
|
324
332
|
}
|
|
325
|
-
const
|
|
333
|
+
const Tn = /* @__PURE__ */ new Set([
|
|
326
334
|
"text",
|
|
327
335
|
"bold",
|
|
328
336
|
"italic",
|
|
@@ -330,23 +338,23 @@ const xn = /* @__PURE__ */ new Set([
|
|
|
330
338
|
"highlight",
|
|
331
339
|
"styled"
|
|
332
340
|
]);
|
|
333
|
-
function
|
|
334
|
-
if (!t || t.length === 0 || t.every((r) => r.type === "text") || !t.every((r) =>
|
|
335
|
-
return
|
|
341
|
+
function xn(t, e) {
|
|
342
|
+
if (!t || t.length === 0 || t.every((r) => r.type === "text") || !t.every((r) => Tn.has(r.type)))
|
|
343
|
+
return zt(e);
|
|
336
344
|
const n = [];
|
|
337
345
|
for (const r of t) {
|
|
338
|
-
const o =
|
|
339
|
-
|
|
340
|
-
|
|
346
|
+
const o = vn(r), c = (r.value ?? "").split("\\n");
|
|
347
|
+
c.forEach((d, s) => {
|
|
348
|
+
d && n.push(o ? { type: "text", text: d, marks: o } : { type: "text", text: d }), s < c.length - 1 && n.push({ type: "hardBreak" });
|
|
341
349
|
});
|
|
342
350
|
}
|
|
343
|
-
return n.length ? n :
|
|
351
|
+
return n.length ? n : zt(e);
|
|
344
352
|
}
|
|
345
|
-
function
|
|
353
|
+
function Ln(t, e) {
|
|
346
354
|
if (!e || t.length === 0) return t;
|
|
347
|
-
const n = [], r = {}, o = e, l = o.family ?? o.font,
|
|
348
|
-
return String(o.weight || "").toLowerCase() === "bold" && n.push({ type: "bold" }), (String(o.italic || "") === "true" || String(o.style || "").toLowerCase() === "italic") && n.push({ type: "italic" }), String(o.underline || "") === "true" && n.push({ type: "underline" }), String(o.strike || "") === "true" && n.push({ type: "strike" }), String(o.valign || "") === "sub" && n.push({ type: "subscript" }), String(o.valign || "") === "super" && n.push({ type: "superscript" }), o.color && (r.color = String(o.color)), l && (r.fontFamily = String(l)), o.size && (r.fontSize = String(o.size)),
|
|
349
|
-
(
|
|
355
|
+
const n = [], r = {}, o = e, l = o.family ?? o.font, c = o.bg ?? o.bgcolor;
|
|
356
|
+
return String(o.weight || "").toLowerCase() === "bold" && n.push({ type: "bold" }), (String(o.italic || "") === "true" || String(o.style || "").toLowerCase() === "italic") && n.push({ type: "italic" }), String(o.underline || "") === "true" && n.push({ type: "underline" }), String(o.strike || "") === "true" && n.push({ type: "strike" }), String(o.valign || "") === "sub" && n.push({ type: "subscript" }), String(o.valign || "") === "super" && n.push({ type: "superscript" }), o.color && (r.color = String(o.color)), l && (r.fontFamily = String(l)), o.size && (r.fontSize = String(o.size)), c && n.push({ type: "highlight", attrs: { color: String(c) } }), Object.keys(r).length > 0 && n.push({ type: "textStyle", attrs: r }), n.length === 0 ? t : t.map(
|
|
357
|
+
(d) => d.type === "text" ? { ...d, marks: [...d.marks || [], ...n] } : d
|
|
350
358
|
);
|
|
351
359
|
}
|
|
352
360
|
function ne(t) {
|
|
@@ -380,30 +388,30 @@ function ne(t) {
|
|
|
380
388
|
}
|
|
381
389
|
return e;
|
|
382
390
|
}
|
|
383
|
-
function
|
|
391
|
+
function An(t) {
|
|
384
392
|
if (t.type === "hardBreak") return "\\n";
|
|
385
393
|
if (t.type !== "text") return Ht(t);
|
|
386
394
|
const e = t.text || "";
|
|
387
395
|
if (!e) return "";
|
|
388
396
|
const n = t.marks || [];
|
|
389
397
|
if (!n.length) return e;
|
|
390
|
-
const r = new Set(n.map((
|
|
398
|
+
const r = new Set(n.map((h) => h.type)), o = n.find((h) => h.type === "link");
|
|
391
399
|
if (o?.attrs?.href) return `[${e}](${o.attrs.href})`;
|
|
392
|
-
const l = n.find((
|
|
393
|
-
(
|
|
400
|
+
const l = n.find((h) => h.type === "textStyle")?.attrs || {}, c = n.find((h) => h.type === "highlight")?.attrs || {}, d = !!(l.color || l.fontFamily || l.fontSize || c.color), s = ["bold", "italic", "strike", "underline", "code"].filter(
|
|
401
|
+
(h) => r.has(h)
|
|
394
402
|
).length;
|
|
395
|
-
if (!
|
|
403
|
+
if (!d && s === 1 && !r.has("underline")) {
|
|
396
404
|
if (r.has("bold")) return `*${e}*`;
|
|
397
405
|
if (r.has("italic")) return `_${e}_`;
|
|
398
406
|
if (r.has("strike")) return `~${e}~`;
|
|
399
407
|
if (r.has("code")) return `\`${e}\``;
|
|
400
408
|
}
|
|
401
|
-
if (!
|
|
409
|
+
if (!d && s === 0 && r.has("highlight") && !c.color)
|
|
402
410
|
return `^${e}^`;
|
|
403
|
-
const
|
|
404
|
-
return
|
|
411
|
+
const f = ne(n), p = [];
|
|
412
|
+
return f.color && p.push(`color: ${f.color}`), f.family && p.push(`family: ${f.family}`), f.size && p.push(`size: ${f.size}`), f.weight && p.push(`weight: ${f.weight}`), f.italic === "true" && p.push("italic: true"), f.underline && p.push("underline: true"), f.strike && p.push("strike: true"), f.bg && p.push(`bg: ${f.bg}`), f.valign && p.push(`valign: ${f.valign}`), p.length ? `[${e}]{ ${p.join("; ")} }` : e;
|
|
405
413
|
}
|
|
406
|
-
const
|
|
414
|
+
const Cn = /* @__PURE__ */ new Set([
|
|
407
415
|
"bold",
|
|
408
416
|
"italic",
|
|
409
417
|
"underline",
|
|
@@ -418,7 +426,7 @@ const $n = /* @__PURE__ */ new Set([
|
|
|
418
426
|
function Nn(t) {
|
|
419
427
|
const e = /* @__PURE__ */ new Set(), n = (r) => {
|
|
420
428
|
for (const o of r.marks || [])
|
|
421
|
-
|
|
429
|
+
Cn.has(o.type) || e.add(o.type);
|
|
422
430
|
for (const o of r.content || []) n(o);
|
|
423
431
|
};
|
|
424
432
|
return n(t), [...e].sort();
|
|
@@ -428,20 +436,20 @@ function _t(t) {
|
|
|
428
436
|
return e.length === 1 && e[0].type === "text" ? {
|
|
429
437
|
text: e[0].text || "",
|
|
430
438
|
props: { ...ne(e[0].marks), ...n }
|
|
431
|
-
} : { text: e.map(
|
|
439
|
+
} : { text: e.map(An).join(""), props: { ...n } };
|
|
432
440
|
}
|
|
433
441
|
function Ht(t) {
|
|
434
442
|
return t.content ? t.content.map((e) => e.type === "text" ? e.text || "" : e.type === "hardBreak" ? "\\n" : Ht(e)).join("") : "";
|
|
435
443
|
}
|
|
436
444
|
function it(t, e, n) {
|
|
437
|
-
const r =
|
|
438
|
-
for (const o of
|
|
445
|
+
const r = wn(t);
|
|
446
|
+
for (const o of Sn) delete r[o];
|
|
439
447
|
if (n) for (const o of n) delete r[o];
|
|
440
448
|
return { ...r, ...e };
|
|
441
449
|
}
|
|
442
450
|
function Rt(t) {
|
|
443
451
|
const e = t.toLowerCase();
|
|
444
|
-
return
|
|
452
|
+
return kn[e] || e;
|
|
445
453
|
}
|
|
446
454
|
function jt(t) {
|
|
447
455
|
if (t === "---") return "divider";
|
|
@@ -454,18 +462,18 @@ function ct(t) {
|
|
|
454
462
|
function lt(t, e) {
|
|
455
463
|
return !!(t === e || t === "info" && ["tip", "warning", "danger", "success"].includes(e) || e === "info" && ["tip", "warning", "danger", "success"].includes(t));
|
|
456
464
|
}
|
|
457
|
-
function
|
|
465
|
+
function $n(t) {
|
|
458
466
|
if (!t) return { content: "", properties: {} };
|
|
459
467
|
const e = t.split(" | ");
|
|
460
468
|
let n = e[0] || "";
|
|
461
469
|
const r = {};
|
|
462
470
|
for (let o = 1; o < e.length; o++) {
|
|
463
|
-
const l = e[o],
|
|
464
|
-
if (!
|
|
471
|
+
const l = e[o], c = l.match(/^([a-zA-Z_][\w-]*)\s*:\s*(.*)$/);
|
|
472
|
+
if (!c) {
|
|
465
473
|
n += ` | ${l}`;
|
|
466
474
|
continue;
|
|
467
475
|
}
|
|
468
|
-
r[
|
|
476
|
+
r[c[1]] = c[2];
|
|
469
477
|
}
|
|
470
478
|
return { content: n, properties: r };
|
|
471
479
|
}
|
|
@@ -473,14 +481,14 @@ function Wt(t) {
|
|
|
473
481
|
if (t === "---") return { type: "divider" };
|
|
474
482
|
const e = t.match(/^([a-zA-Z][\w-]*):\s*(.*)$/);
|
|
475
483
|
if (!e) return null;
|
|
476
|
-
const n = Rt(e[1]), r = e[2] || "", { content: o, properties: l } =
|
|
477
|
-
let
|
|
484
|
+
const n = Rt(e[1]), r = e[2] || "", { content: o, properties: l } = $n(r);
|
|
485
|
+
let c;
|
|
478
486
|
try {
|
|
479
|
-
|
|
487
|
+
c = et(`text: ${o}`).blocks[0]?.inline;
|
|
480
488
|
} catch {
|
|
481
|
-
|
|
489
|
+
c = void 0;
|
|
482
490
|
}
|
|
483
|
-
return { type: n, content: o, properties: l, inline:
|
|
491
|
+
return { type: n, content: o, properties: l, inline: c };
|
|
484
492
|
}
|
|
485
493
|
function Gt(t) {
|
|
486
494
|
const e = t.match(/^[-*]\s+(.*)$/);
|
|
@@ -491,7 +499,7 @@ function Gt(t) {
|
|
|
491
499
|
function Mn(t) {
|
|
492
500
|
return {
|
|
493
501
|
type: "listItem",
|
|
494
|
-
content: [{ type: "paragraph", content:
|
|
502
|
+
content: [{ type: "paragraph", content: zt(t) }]
|
|
495
503
|
};
|
|
496
504
|
}
|
|
497
505
|
function Ut(t) {
|
|
@@ -500,106 +508,106 @@ function Ut(t) {
|
|
|
500
508
|
type: "doc",
|
|
501
509
|
content: [{ type: "paragraph" }]
|
|
502
510
|
};
|
|
503
|
-
const e =
|
|
504
|
-
for (const
|
|
505
|
-
const
|
|
506
|
-
|
|
511
|
+
const e = et(t), n = [];
|
|
512
|
+
for (const c of e.blocks) {
|
|
513
|
+
const d = Lt(c);
|
|
514
|
+
d && n.push(d);
|
|
507
515
|
}
|
|
508
516
|
const r = t.split(`
|
|
509
517
|
`);
|
|
510
518
|
let o = 0;
|
|
511
519
|
const l = [];
|
|
512
|
-
for (let
|
|
513
|
-
const
|
|
514
|
-
if (!
|
|
520
|
+
for (let c = 0; c < r.length; c++) {
|
|
521
|
+
const s = r[c].trim();
|
|
522
|
+
if (!s) continue;
|
|
515
523
|
{
|
|
516
|
-
const
|
|
517
|
-
if (
|
|
518
|
-
l.push({ type: "itMeta", attrs: { raw:
|
|
524
|
+
const g = jt(s);
|
|
525
|
+
if (g && bn.has(g)) {
|
|
526
|
+
l.push({ type: "itMeta", attrs: { raw: s } });
|
|
519
527
|
const k = e.blocks[o]?.type;
|
|
520
|
-
k && lt(
|
|
528
|
+
k && lt(g, ct(k)) && o++;
|
|
521
529
|
continue;
|
|
522
530
|
}
|
|
523
|
-
if (
|
|
524
|
-
l.push({ type: "itTrust", attrs: { raw:
|
|
531
|
+
if (g && yn.has(g)) {
|
|
532
|
+
l.push({ type: "itTrust", attrs: { raw: s, keyword: g } });
|
|
525
533
|
const k = e.blocks[o]?.type;
|
|
526
|
-
k && lt(
|
|
534
|
+
k && lt(g, ct(k)) && o++;
|
|
527
535
|
continue;
|
|
528
536
|
}
|
|
529
|
-
if (
|
|
530
|
-
l.push({ type: "itMetric", attrs: { raw:
|
|
537
|
+
if (g === "metric") {
|
|
538
|
+
l.push({ type: "itMetric", attrs: { raw: s } });
|
|
531
539
|
const k = e.blocks[o]?.type;
|
|
532
|
-
k && lt(
|
|
540
|
+
k && lt(g, ct(k)) && o++;
|
|
533
541
|
continue;
|
|
534
542
|
}
|
|
535
|
-
if (
|
|
536
|
-
l.push({ type: "itStyleRule", attrs: { raw:
|
|
543
|
+
if (g === "style") {
|
|
544
|
+
l.push({ type: "itStyleRule", attrs: { raw: s } });
|
|
537
545
|
const k = e.blocks[o]?.type;
|
|
538
|
-
k && lt(
|
|
546
|
+
k && lt(g, ct(k)) && o++;
|
|
539
547
|
continue;
|
|
540
548
|
}
|
|
541
549
|
}
|
|
542
|
-
const
|
|
543
|
-
if (
|
|
544
|
-
const
|
|
545
|
-
let
|
|
546
|
-
for (;
|
|
547
|
-
const
|
|
548
|
-
if (!
|
|
549
|
-
k.push(Mn(
|
|
550
|
-
const
|
|
551
|
-
(
|
|
550
|
+
const f = Gt(s);
|
|
551
|
+
if (f) {
|
|
552
|
+
const g = f.ordered, k = [];
|
|
553
|
+
let M = c;
|
|
554
|
+
for (; M < r.length; ) {
|
|
555
|
+
const C = r[M].trim(), v = C ? Gt(C) : null;
|
|
556
|
+
if (!v || v.ordered !== g) break;
|
|
557
|
+
k.push(Mn(v.text));
|
|
558
|
+
const w = e.blocks[o]?.type;
|
|
559
|
+
(w === "list-item" || w === "step-item") && o++, M++;
|
|
552
560
|
}
|
|
553
561
|
l.push({
|
|
554
|
-
type:
|
|
562
|
+
type: g ? "orderedList" : "bulletList",
|
|
555
563
|
content: k
|
|
556
|
-
}),
|
|
564
|
+
}), c = M - 1;
|
|
557
565
|
continue;
|
|
558
566
|
}
|
|
559
|
-
if (
|
|
560
|
-
const
|
|
561
|
-
let k =
|
|
567
|
+
if (s.startsWith("|") && s.endsWith("|") && (s.match(/\|/g) || []).length >= 3) {
|
|
568
|
+
const g = [];
|
|
569
|
+
let k = c;
|
|
562
570
|
for (; k < r.length; ) {
|
|
563
|
-
const
|
|
564
|
-
if (!(
|
|
565
|
-
|
|
566
|
-
|
|
571
|
+
const M = r[k].trim();
|
|
572
|
+
if (!(M.startsWith("|") && M.endsWith("|"))) break;
|
|
573
|
+
g.push(
|
|
574
|
+
M.slice(1, -1).split("|").map((C) => C.trim())
|
|
567
575
|
), k++;
|
|
568
576
|
}
|
|
569
|
-
l.push({ type: "itTable", attrs: { rows: JSON.stringify(
|
|
577
|
+
l.push({ type: "itTable", attrs: { rows: JSON.stringify(g) } }), c = k - 1;
|
|
570
578
|
continue;
|
|
571
579
|
}
|
|
572
|
-
if (
|
|
580
|
+
if (s.startsWith("//")) {
|
|
573
581
|
l.push({
|
|
574
582
|
type: "itComment",
|
|
575
|
-
content:
|
|
583
|
+
content: s.slice(2).trim() ? [{ type: "text", text: s.slice(2).trim() }] : []
|
|
576
584
|
});
|
|
577
585
|
continue;
|
|
578
586
|
}
|
|
579
|
-
if (
|
|
580
|
-
const p = jt(
|
|
581
|
-
if (p && (p === "text" ||
|
|
582
|
-
const
|
|
583
|
-
if (
|
|
584
|
-
const k =
|
|
587
|
+
if (s.startsWith("```")) continue;
|
|
588
|
+
const p = jt(s);
|
|
589
|
+
if (p && (p === "text" || s.includes("{{"))) {
|
|
590
|
+
const g = Wt(s);
|
|
591
|
+
if (g) {
|
|
592
|
+
const k = Lt(g);
|
|
585
593
|
if (k && l.push(k), o < e.blocks.length) {
|
|
586
|
-
const
|
|
587
|
-
lt(p,
|
|
594
|
+
const M = ct(e.blocks[o].type);
|
|
595
|
+
lt(p, M) && o++;
|
|
588
596
|
}
|
|
589
597
|
continue;
|
|
590
598
|
}
|
|
591
599
|
}
|
|
592
600
|
if (o < n.length && p) {
|
|
593
|
-
const
|
|
601
|
+
const g = e.blocks[o], k = ct(g.type);
|
|
594
602
|
if (lt(p, k)) {
|
|
595
603
|
l.push(n[o]), o++;
|
|
596
604
|
continue;
|
|
597
605
|
}
|
|
598
606
|
}
|
|
599
|
-
const
|
|
600
|
-
if (
|
|
601
|
-
const
|
|
602
|
-
|
|
607
|
+
const h = Wt(s);
|
|
608
|
+
if (h) {
|
|
609
|
+
const g = Lt(h);
|
|
610
|
+
g && l.push(g);
|
|
603
611
|
continue;
|
|
604
612
|
}
|
|
605
613
|
o < n.length && (l.push(n[o]), o++);
|
|
@@ -611,41 +619,41 @@ function Ut(t) {
|
|
|
611
619
|
content: l.length > 0 ? l : [{ type: "paragraph" }]
|
|
612
620
|
};
|
|
613
621
|
}
|
|
614
|
-
function
|
|
622
|
+
function Lt(t) {
|
|
615
623
|
const { type: e, content: n, properties: r, inline: o } = t, l = n || "";
|
|
616
|
-
let
|
|
617
|
-
|
|
618
|
-
const
|
|
624
|
+
let c = xn(o, l);
|
|
625
|
+
c = Ln(c, r);
|
|
626
|
+
const d = r ? JSON.stringify(
|
|
619
627
|
Object.fromEntries(
|
|
620
|
-
Object.entries(r).map(([p,
|
|
628
|
+
Object.entries(r).map(([p, h]) => [p, String(h)])
|
|
621
629
|
)
|
|
622
|
-
) : "{}",
|
|
630
|
+
) : "{}", s = r?.align ? String(r.align) : void 0;
|
|
623
631
|
if (e in Ft)
|
|
624
632
|
return {
|
|
625
633
|
type: Ft[e],
|
|
626
|
-
attrs: { props:
|
|
627
|
-
content:
|
|
634
|
+
attrs: { props: d, ...s && { textAlign: s } },
|
|
635
|
+
content: c.length ? c : void 0
|
|
628
636
|
};
|
|
629
637
|
if (e === "summary")
|
|
630
638
|
return {
|
|
631
639
|
type: "itSummary",
|
|
632
|
-
attrs: { props:
|
|
633
|
-
content:
|
|
640
|
+
attrs: { props: d, ...s && { textAlign: s } },
|
|
641
|
+
content: c.length ? c : void 0
|
|
634
642
|
};
|
|
635
643
|
if (e === "text" || e === "body-text") {
|
|
636
644
|
const p = {};
|
|
637
|
-
return
|
|
645
|
+
return s && (p.textAlign = s), r?.end && (p.end = String(r.end)), r?.leading && (p.leading = String(r.leading)), r?.["space-before"] && (p.spaceBefore = String(r["space-before"])), r?.["space-after"] && (p.spaceAfter = String(r["space-after"])), {
|
|
638
646
|
type: "paragraph",
|
|
639
647
|
...Object.keys(p).length && { attrs: p },
|
|
640
|
-
content:
|
|
648
|
+
content: c.length ? c : void 0
|
|
641
649
|
};
|
|
642
650
|
}
|
|
643
651
|
if (Dt.has(e)) {
|
|
644
652
|
const p = e === "info" ? String(r?.type || "info").toLowerCase() : e;
|
|
645
653
|
return {
|
|
646
654
|
type: "itCallout",
|
|
647
|
-
attrs: { variant: Dt.has(p) ? p : "info", props:
|
|
648
|
-
content:
|
|
655
|
+
attrs: { variant: Dt.has(p) ? p : "info", props: d },
|
|
656
|
+
content: c.length ? c : void 0
|
|
649
657
|
};
|
|
650
658
|
}
|
|
651
659
|
if (e === "quote")
|
|
@@ -653,17 +661,17 @@ function At(t) {
|
|
|
653
661
|
type: "itQuote",
|
|
654
662
|
attrs: {
|
|
655
663
|
by: r?.by ? String(r.by) : "",
|
|
656
|
-
props:
|
|
657
|
-
...
|
|
664
|
+
props: d,
|
|
665
|
+
...s && { textAlign: s }
|
|
658
666
|
},
|
|
659
|
-
content:
|
|
667
|
+
content: c.length ? c : void 0
|
|
660
668
|
};
|
|
661
669
|
if (e === "code")
|
|
662
670
|
return {
|
|
663
671
|
type: "itCode",
|
|
664
672
|
attrs: {
|
|
665
673
|
lang: r?.lang ? String(r.lang) : "",
|
|
666
|
-
props:
|
|
674
|
+
props: d
|
|
667
675
|
},
|
|
668
676
|
content: l ? [{ type: "text", text: l }] : void 0
|
|
669
677
|
};
|
|
@@ -671,59 +679,59 @@ function At(t) {
|
|
|
671
679
|
return { type: "itDivider" };
|
|
672
680
|
if (e === "break")
|
|
673
681
|
return { type: "itBreak" };
|
|
674
|
-
const
|
|
682
|
+
const f = r ? Object.entries(r).filter(([, p]) => p !== void 0 && p !== "").map(([p, h]) => `${p}: ${h}`).join(" | ") : "";
|
|
675
683
|
return {
|
|
676
684
|
type: "itGenericBlock",
|
|
677
|
-
attrs: { keyword: e, properties:
|
|
678
|
-
content:
|
|
685
|
+
attrs: { keyword: e, properties: f, props: d },
|
|
686
|
+
content: c.length ? c : void 0
|
|
679
687
|
};
|
|
680
688
|
}
|
|
681
|
-
function
|
|
689
|
+
function zn(t) {
|
|
682
690
|
if (!t.content) return "";
|
|
683
691
|
const e = [];
|
|
684
692
|
for (const n of t.content)
|
|
685
|
-
e.push(...
|
|
693
|
+
e.push(..._n(n));
|
|
686
694
|
return e.join(`
|
|
687
695
|
`);
|
|
688
696
|
}
|
|
689
|
-
function
|
|
697
|
+
function _n(t) {
|
|
690
698
|
if (t.type === "bulletList" && t.content)
|
|
691
699
|
return t.content.flatMap((n) => n.content ? n.content.map((r) => {
|
|
692
700
|
const { text: o, props: l } = _t(r);
|
|
693
|
-
return `- ${o}${
|
|
701
|
+
return `- ${o}${F(l)}`;
|
|
694
702
|
}) : []);
|
|
695
703
|
if (t.type === "orderedList" && t.content) {
|
|
696
704
|
let n = 1;
|
|
697
705
|
return t.content.flatMap((r) => r.content ? r.content.map((o) => {
|
|
698
|
-
const { text: l, props:
|
|
699
|
-
return `${n++}. ${l}${
|
|
706
|
+
const { text: l, props: c } = _t(o);
|
|
707
|
+
return `${n++}. ${l}${F(c)}`;
|
|
700
708
|
}) : []);
|
|
701
709
|
}
|
|
702
|
-
const e =
|
|
710
|
+
const e = Hn(t);
|
|
703
711
|
return e !== null ? [e] : [];
|
|
704
712
|
}
|
|
705
|
-
function
|
|
713
|
+
function Hn(t) {
|
|
706
714
|
const { text: e, props: n } = _t(t);
|
|
707
715
|
switch (t.type) {
|
|
708
716
|
case "itTitle": {
|
|
709
717
|
const r = it(t.attrs?.props, n);
|
|
710
|
-
return `title: ${e}${
|
|
718
|
+
return `title: ${e}${F(r)}`;
|
|
711
719
|
}
|
|
712
720
|
case "itSummary": {
|
|
713
721
|
const r = it(t.attrs?.props, n);
|
|
714
|
-
return `summary: ${e}${
|
|
722
|
+
return `summary: ${e}${F(r)}`;
|
|
715
723
|
}
|
|
716
724
|
case "itSection": {
|
|
717
725
|
const r = it(t.attrs?.props, n);
|
|
718
|
-
return `section: ${e}${
|
|
726
|
+
return `section: ${e}${F(r)}`;
|
|
719
727
|
}
|
|
720
728
|
case "itSub": {
|
|
721
729
|
const r = it(t.attrs?.props, n);
|
|
722
|
-
return `sub: ${e}${
|
|
730
|
+
return `sub: ${e}${F(r)}`;
|
|
723
731
|
}
|
|
724
732
|
case "paragraph": {
|
|
725
733
|
const r = t.attrs || {}, o = {};
|
|
726
|
-
return r.end && (o.end = String(r.end)), r.leading && (o.leading = String(r.leading)), r.spaceBefore && (o["space-before"] = String(r.spaceBefore)), r.spaceAfter && (o["space-after"] = String(r.spaceAfter)), `text: ${e}${
|
|
734
|
+
return r.end && (o.end = String(r.end)), r.leading && (o.leading = String(r.leading)), r.spaceBefore && (o["space-before"] = String(r.spaceBefore)), r.spaceAfter && (o["space-after"] = String(r.spaceAfter)), `text: ${e}${F({ ...o, ...n })}`;
|
|
727
735
|
}
|
|
728
736
|
case "itCallout": {
|
|
729
737
|
const r = t.attrs?.variant || "tip", o = it(
|
|
@@ -731,11 +739,11 @@ function Rn(t) {
|
|
|
731
739
|
n,
|
|
732
740
|
/* @__PURE__ */ new Set(["variant"])
|
|
733
741
|
);
|
|
734
|
-
return r === "info" ? `info: ${e}${
|
|
742
|
+
return r === "info" ? `info: ${e}${F(o)}` : `info: ${e} | type: ${r}${F(o, /* @__PURE__ */ new Set(["type"]))}`;
|
|
735
743
|
}
|
|
736
744
|
case "itQuote": {
|
|
737
745
|
const r = t.attrs?.by, o = r ? ` | by: ${r}` : "", l = it(t.attrs?.props, n, /* @__PURE__ */ new Set(["by"]));
|
|
738
|
-
return `quote: ${e}${o}${
|
|
746
|
+
return `quote: ${e}${o}${F(l)}`;
|
|
739
747
|
}
|
|
740
748
|
case "itCode":
|
|
741
749
|
return `\`\`\`${t.attrs?.lang || ""}
|
|
@@ -767,131 +775,131 @@ ${Ht(t)}
|
|
|
767
775
|
return e ? `// ${e}` : "//";
|
|
768
776
|
case "itGenericBlock": {
|
|
769
777
|
const r = t.attrs?.keyword || "text", o = it(t.attrs?.props, n);
|
|
770
|
-
return `${r}: ${e}${
|
|
778
|
+
return `${r}: ${e}${F(o)}`;
|
|
771
779
|
}
|
|
772
780
|
default:
|
|
773
|
-
return e ? `text: ${e}${
|
|
781
|
+
return e ? `text: ${e}${F(n)}` : null;
|
|
774
782
|
}
|
|
775
783
|
}
|
|
776
|
-
function
|
|
784
|
+
function i(t, e) {
|
|
777
785
|
return { property: t, css: e };
|
|
778
786
|
}
|
|
779
|
-
const
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
787
|
+
const Rn = [
|
|
788
|
+
i("align", "textAlign"),
|
|
789
|
+
i("color", "color"),
|
|
790
|
+
i("size", "fontSize"),
|
|
791
|
+
i("weight", "fontWeight"),
|
|
784
792
|
{ property: "style", css: "fontStyle" },
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
793
|
+
i("bgcolor", "backgroundColor"),
|
|
794
|
+
i("padding", "padding"),
|
|
795
|
+
i("indent", "paddingLeft"),
|
|
796
|
+
i("opacity", "opacity")
|
|
789
797
|
], gt = [
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
],
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
],
|
|
798
|
+
i("bgcolor", "backgroundColor"),
|
|
799
|
+
i("color", "color"),
|
|
800
|
+
i("border", "borderLeft")
|
|
801
|
+
], A = [
|
|
802
|
+
i("color", "borderColor"),
|
|
803
|
+
i("bgcolor", "backgroundColor")
|
|
804
|
+
], En = {
|
|
797
805
|
// ── Identity ──
|
|
798
806
|
title: [
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
807
|
+
i("align", "textAlign"),
|
|
808
|
+
i("color", "color"),
|
|
809
|
+
i("size", "fontSize"),
|
|
810
|
+
i("weight", "fontWeight"),
|
|
811
|
+
i("font", "fontFamily")
|
|
804
812
|
],
|
|
805
813
|
summary: [
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
814
|
+
i("align", "textAlign"),
|
|
815
|
+
i("color", "color"),
|
|
816
|
+
i("size", "fontSize"),
|
|
809
817
|
{ property: "style", css: "fontStyle" }
|
|
810
818
|
],
|
|
811
819
|
// ── Structure ──
|
|
812
820
|
section: [
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
821
|
+
i("align", "textAlign"),
|
|
822
|
+
i("color", "color"),
|
|
823
|
+
i("size", "fontSize"),
|
|
824
|
+
i("weight", "fontWeight"),
|
|
825
|
+
i("border", "borderBottom"),
|
|
826
|
+
i("spacing", "marginTop")
|
|
819
827
|
],
|
|
820
828
|
sub: [
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
829
|
+
i("align", "textAlign"),
|
|
830
|
+
i("color", "color"),
|
|
831
|
+
i("size", "fontSize"),
|
|
832
|
+
i("weight", "fontWeight")
|
|
825
833
|
],
|
|
826
834
|
divider: [
|
|
827
835
|
{ property: "style", css: "borderStyle" },
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
836
|
+
i("color", "borderColor"),
|
|
837
|
+
i("width", "borderTopWidth"),
|
|
838
|
+
i("spacing", "margin")
|
|
831
839
|
],
|
|
832
840
|
// ── Content ──
|
|
833
|
-
text: [...
|
|
841
|
+
text: [...Rn],
|
|
834
842
|
tip: [...gt],
|
|
835
843
|
info: [...gt],
|
|
836
844
|
warning: [...gt],
|
|
837
845
|
danger: [...gt],
|
|
838
846
|
success: [...gt],
|
|
839
847
|
quote: [
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
848
|
+
i("align", "textAlign"),
|
|
849
|
+
i("color", "color"),
|
|
850
|
+
i("size", "fontSize"),
|
|
843
851
|
{ property: "style", css: "fontStyle" },
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
852
|
+
i("border", "borderLeft"),
|
|
853
|
+
i("padding", "paddingLeft"),
|
|
854
|
+
i("bgcolor", "backgroundColor")
|
|
847
855
|
],
|
|
848
856
|
cite: [
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
857
|
+
i("align", "textAlign"),
|
|
858
|
+
i("color", "color"),
|
|
859
|
+
i("size", "fontSize"),
|
|
852
860
|
{ property: "style", css: "fontStyle" }
|
|
853
861
|
],
|
|
854
862
|
def: [
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
863
|
+
i("color", "color"),
|
|
864
|
+
i("bgcolor", "backgroundColor"),
|
|
865
|
+
i("border", "borderLeft"),
|
|
866
|
+
i("padding", "paddingLeft")
|
|
859
867
|
],
|
|
860
868
|
caption: [
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
869
|
+
i("align", "textAlign"),
|
|
870
|
+
i("color", "color"),
|
|
871
|
+
i("size", "fontSize"),
|
|
864
872
|
{ property: "style", css: "fontStyle" }
|
|
865
873
|
],
|
|
866
|
-
footnote: [
|
|
874
|
+
footnote: [i("color", "color"), i("size", "fontSize")],
|
|
867
875
|
byline: [
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
876
|
+
i("align", "textAlign"),
|
|
877
|
+
i("color", "color"),
|
|
878
|
+
i("size", "fontSize"),
|
|
871
879
|
{ property: "style", css: "fontStyle" },
|
|
872
|
-
|
|
880
|
+
i("weight", "fontWeight")
|
|
873
881
|
],
|
|
874
882
|
epigraph: [
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
883
|
+
i("align", "textAlign"),
|
|
884
|
+
i("color", "color"),
|
|
885
|
+
i("size", "fontSize"),
|
|
878
886
|
{ property: "style", css: "fontStyle" },
|
|
879
|
-
|
|
887
|
+
i("padding", "padding")
|
|
880
888
|
],
|
|
881
889
|
dedication: [
|
|
882
|
-
|
|
883
|
-
|
|
890
|
+
i("align", "textAlign"),
|
|
891
|
+
i("color", "color"),
|
|
884
892
|
{ property: "style", css: "fontStyle" },
|
|
885
|
-
|
|
893
|
+
i("padding", "padding")
|
|
886
894
|
],
|
|
887
895
|
// ── Media ──
|
|
888
896
|
image: [
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
897
|
+
i("width", "width"),
|
|
898
|
+
i("height", "height"),
|
|
899
|
+
i("radius", "borderRadius"),
|
|
900
|
+
i("border", "border"),
|
|
901
|
+
i("opacity", "opacity"),
|
|
902
|
+
i("bgcolor", "backgroundColor"),
|
|
895
903
|
{
|
|
896
904
|
property: "shadow",
|
|
897
905
|
css: "boxShadow",
|
|
@@ -899,134 +907,134 @@ const En = [
|
|
|
899
907
|
}
|
|
900
908
|
],
|
|
901
909
|
figure: [
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
910
|
+
i("width", "width"),
|
|
911
|
+
i("align", "textAlign"),
|
|
912
|
+
i("border", "border"),
|
|
913
|
+
i("padding", "padding"),
|
|
914
|
+
i("bgcolor", "backgroundColor"),
|
|
907
915
|
{
|
|
908
916
|
property: "shadow",
|
|
909
917
|
css: "boxShadow",
|
|
910
918
|
transform: () => "0 4px 12px rgba(0,0,0,0.15)"
|
|
911
919
|
}
|
|
912
920
|
],
|
|
913
|
-
link: [
|
|
914
|
-
ref: [
|
|
921
|
+
link: [i("color", "color"), i("weight", "fontWeight")],
|
|
922
|
+
ref: [i("color", "color"), { property: "style", css: "fontStyle" }],
|
|
915
923
|
embed: [
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
924
|
+
i("width", "width"),
|
|
925
|
+
i("height", "height"),
|
|
926
|
+
i("border", "border"),
|
|
927
|
+
i("radius", "borderRadius")
|
|
920
928
|
],
|
|
921
929
|
// ── Data ──
|
|
922
930
|
metric: [
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
931
|
+
i("color", "color"),
|
|
932
|
+
i("size", "fontSize"),
|
|
933
|
+
i("align", "textAlign"),
|
|
934
|
+
i("bgcolor", "backgroundColor"),
|
|
935
|
+
i("border", "border"),
|
|
936
|
+
i("padding", "padding")
|
|
929
937
|
],
|
|
930
938
|
columns: [
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
939
|
+
i("border", "border"),
|
|
940
|
+
i("bgcolor", "backgroundColor"),
|
|
941
|
+
i("padding", "padding"),
|
|
942
|
+
i("size", "fontSize"),
|
|
943
|
+
i("align", "textAlign")
|
|
936
944
|
],
|
|
937
945
|
row: [
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
946
|
+
i("border", "border"),
|
|
947
|
+
i("bgcolor", "backgroundColor"),
|
|
948
|
+
i("padding", "padding"),
|
|
949
|
+
i("size", "fontSize"),
|
|
950
|
+
i("align", "textAlign")
|
|
943
951
|
],
|
|
944
952
|
input: [
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
953
|
+
i("color", "color"),
|
|
954
|
+
i("bgcolor", "backgroundColor"),
|
|
955
|
+
i("border", "borderLeft"),
|
|
956
|
+
i("size", "fontSize")
|
|
949
957
|
],
|
|
950
958
|
output: [
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
959
|
+
i("color", "color"),
|
|
960
|
+
i("bgcolor", "backgroundColor"),
|
|
961
|
+
i("border", "borderLeft"),
|
|
962
|
+
i("size", "fontSize")
|
|
955
963
|
],
|
|
956
964
|
// ── Code ──
|
|
957
965
|
code: [
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
966
|
+
i("size", "fontSize"),
|
|
967
|
+
i("bgcolor", "backgroundColor"),
|
|
968
|
+
i("color", "color"),
|
|
969
|
+
i("padding", "padding"),
|
|
970
|
+
i("radius", "borderRadius"),
|
|
971
|
+
i("border", "border")
|
|
964
972
|
],
|
|
965
973
|
// ── Contact ──
|
|
966
974
|
contact: [
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
975
|
+
i("color", "color"),
|
|
976
|
+
i("bgcolor", "backgroundColor"),
|
|
977
|
+
i("border", "border"),
|
|
978
|
+
i("padding", "padding"),
|
|
979
|
+
i("size", "fontSize")
|
|
972
980
|
],
|
|
973
981
|
deadline: [
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
982
|
+
i("color", "color"),
|
|
983
|
+
i("bgcolor", "backgroundColor"),
|
|
984
|
+
i("weight", "fontWeight"),
|
|
985
|
+
i("size", "fontSize")
|
|
978
986
|
],
|
|
979
987
|
// ── Agent workflow chips ──
|
|
980
|
-
step: [...
|
|
981
|
-
decision: [...
|
|
982
|
-
gate: [...
|
|
983
|
-
trigger: [...
|
|
984
|
-
loop: [...
|
|
985
|
-
parallel: [...
|
|
986
|
-
call: [...
|
|
987
|
-
wait: [...
|
|
988
|
-
checkpoint: [...
|
|
989
|
-
error: [...
|
|
990
|
-
result: [...
|
|
991
|
-
audit: [...
|
|
992
|
-
signal: [...
|
|
993
|
-
handoff: [...
|
|
994
|
-
retry: [...
|
|
995
|
-
progress: [...
|
|
996
|
-
tool: [...
|
|
997
|
-
prompt: [...
|
|
998
|
-
memory: [...
|
|
999
|
-
policy: [...
|
|
1000
|
-
context: [...
|
|
988
|
+
step: [...A],
|
|
989
|
+
decision: [...A],
|
|
990
|
+
gate: [...A],
|
|
991
|
+
trigger: [...A],
|
|
992
|
+
loop: [...A],
|
|
993
|
+
parallel: [...A],
|
|
994
|
+
call: [...A],
|
|
995
|
+
wait: [...A],
|
|
996
|
+
checkpoint: [...A],
|
|
997
|
+
error: [...A],
|
|
998
|
+
result: [...A],
|
|
999
|
+
audit: [...A],
|
|
1000
|
+
signal: [...A],
|
|
1001
|
+
handoff: [...A],
|
|
1002
|
+
retry: [...A],
|
|
1003
|
+
progress: [...A],
|
|
1004
|
+
tool: [...A],
|
|
1005
|
+
prompt: [...A],
|
|
1006
|
+
memory: [...A],
|
|
1007
|
+
policy: [...A],
|
|
1008
|
+
context: [...A],
|
|
1001
1009
|
// ── Trust badges ──
|
|
1002
|
-
track: [...
|
|
1003
|
-
approve: [...
|
|
1004
|
-
sign: [...
|
|
1005
|
-
freeze: [...
|
|
1006
|
-
revision: [...
|
|
1007
|
-
amendment: [...
|
|
1008
|
-
history: [
|
|
1010
|
+
track: [...A],
|
|
1011
|
+
approve: [...A],
|
|
1012
|
+
sign: [...A],
|
|
1013
|
+
freeze: [...A],
|
|
1014
|
+
revision: [...A],
|
|
1015
|
+
amendment: [...A],
|
|
1016
|
+
history: [i("color", "borderColor")],
|
|
1009
1017
|
// ── v2.13 ──
|
|
1010
1018
|
assert: [
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1019
|
+
i("color", "borderColor"),
|
|
1020
|
+
i("bgcolor", "backgroundColor"),
|
|
1021
|
+
i("border", "borderLeft")
|
|
1014
1022
|
],
|
|
1015
1023
|
secret: [
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1024
|
+
i("color", "color"),
|
|
1025
|
+
i("bgcolor", "backgroundColor"),
|
|
1026
|
+
i("blur", "filter")
|
|
1019
1027
|
],
|
|
1020
1028
|
// ── Layout ──
|
|
1021
1029
|
watermark: [
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1030
|
+
i("color", "color"),
|
|
1031
|
+
i("size", "fontSize"),
|
|
1032
|
+
i("opacity", "opacity")
|
|
1025
1033
|
],
|
|
1026
|
-
signline: [
|
|
1034
|
+
signline: [i("color", "color"), i("width", "width")]
|
|
1027
1035
|
};
|
|
1028
1036
|
function Pn(t, e) {
|
|
1029
|
-
const n =
|
|
1037
|
+
const n = En[t];
|
|
1030
1038
|
if (!n) return {};
|
|
1031
1039
|
const r = {};
|
|
1032
1040
|
for (const o of n) {
|
|
@@ -1035,14 +1043,14 @@ function Pn(t, e) {
|
|
|
1035
1043
|
}
|
|
1036
1044
|
return r;
|
|
1037
1045
|
}
|
|
1038
|
-
function
|
|
1046
|
+
function J(t, e) {
|
|
1039
1047
|
const n = Pn(t, e);
|
|
1040
1048
|
return e.leading && (n.lineHeight = e.leading), e["space-before"] && (n.marginTop = e["space-before"]), e["space-after"] && (n.marginBottom = e["space-after"]), Object.entries(n).map(([r, o]) => `${r.replace(/([A-Z])/g, "-$1").toLowerCase()}:${o}`).join(";");
|
|
1041
1049
|
}
|
|
1042
1050
|
function Et(t) {
|
|
1043
1051
|
return t.end ? { "data-it-end": t.end } : {};
|
|
1044
1052
|
}
|
|
1045
|
-
const
|
|
1053
|
+
const Bn = E.create({
|
|
1046
1054
|
name: "itTitle",
|
|
1047
1055
|
group: "block",
|
|
1048
1056
|
content: "inline*",
|
|
@@ -1059,15 +1067,15 @@ const In = E.create({
|
|
|
1059
1067
|
return [{ tag: 'h1[data-it-type="title"]' }];
|
|
1060
1068
|
},
|
|
1061
1069
|
renderHTML({ HTMLAttributes: t, node: e }) {
|
|
1062
|
-
const n =
|
|
1070
|
+
const n = nt(e.attrs.props), r = _(t, {
|
|
1063
1071
|
"data-it-type": "title",
|
|
1064
1072
|
class: "it-doc-title",
|
|
1065
|
-
style:
|
|
1073
|
+
style: J("title", n),
|
|
1066
1074
|
...Et(n)
|
|
1067
1075
|
});
|
|
1068
1076
|
return n.end ? ["h1", r, ["span", { class: "it-split-main" }, 0]] : ["h1", r, 0];
|
|
1069
1077
|
}
|
|
1070
|
-
}),
|
|
1078
|
+
}), In = E.create({
|
|
1071
1079
|
name: "itSummary",
|
|
1072
1080
|
group: "block",
|
|
1073
1081
|
content: "inline*",
|
|
@@ -1081,18 +1089,18 @@ const In = E.create({
|
|
|
1081
1089
|
return [{ tag: 'p[data-it-type="summary"]' }];
|
|
1082
1090
|
},
|
|
1083
1091
|
renderHTML({ HTMLAttributes: t, node: e }) {
|
|
1084
|
-
const n =
|
|
1092
|
+
const n = nt(e.attrs.props);
|
|
1085
1093
|
return [
|
|
1086
1094
|
"p",
|
|
1087
|
-
|
|
1095
|
+
_(t, {
|
|
1088
1096
|
"data-it-type": "summary",
|
|
1089
1097
|
class: "it-doc-summary",
|
|
1090
|
-
style:
|
|
1098
|
+
style: J("summary", n)
|
|
1091
1099
|
}),
|
|
1092
1100
|
0
|
|
1093
1101
|
];
|
|
1094
1102
|
}
|
|
1095
|
-
}),
|
|
1103
|
+
}), On = E.create({
|
|
1096
1104
|
name: "itSection",
|
|
1097
1105
|
group: "block",
|
|
1098
1106
|
content: "inline*",
|
|
@@ -1106,15 +1114,15 @@ const In = E.create({
|
|
|
1106
1114
|
return [{ tag: 'h2[data-it-type="section"]' }];
|
|
1107
1115
|
},
|
|
1108
1116
|
renderHTML({ HTMLAttributes: t, node: e }) {
|
|
1109
|
-
const n =
|
|
1117
|
+
const n = nt(e.attrs.props), r = _(t, {
|
|
1110
1118
|
"data-it-type": "section",
|
|
1111
1119
|
class: "it-doc-section",
|
|
1112
|
-
style:
|
|
1120
|
+
style: J("section", n),
|
|
1113
1121
|
...Et(n)
|
|
1114
1122
|
});
|
|
1115
1123
|
return n.end ? ["h2", r, ["span", { class: "it-split-main" }, 0]] : ["h2", r, 0];
|
|
1116
1124
|
}
|
|
1117
|
-
}),
|
|
1125
|
+
}), Dn = E.create({
|
|
1118
1126
|
name: "itSub",
|
|
1119
1127
|
group: "block",
|
|
1120
1128
|
content: "inline*",
|
|
@@ -1128,15 +1136,15 @@ const In = E.create({
|
|
|
1128
1136
|
return [{ tag: 'h3[data-it-type="sub"]' }];
|
|
1129
1137
|
},
|
|
1130
1138
|
renderHTML({ HTMLAttributes: t, node: e }) {
|
|
1131
|
-
const n =
|
|
1139
|
+
const n = nt(e.attrs.props), r = _(t, {
|
|
1132
1140
|
"data-it-type": "sub",
|
|
1133
1141
|
class: "it-doc-sub",
|
|
1134
|
-
style:
|
|
1142
|
+
style: J("sub", n),
|
|
1135
1143
|
...Et(n)
|
|
1136
1144
|
});
|
|
1137
1145
|
return n.end ? ["h3", r, ["span", { class: "it-split-main" }, 0]] : ["h3", r, 0];
|
|
1138
1146
|
}
|
|
1139
|
-
}),
|
|
1147
|
+
}), Fn = E.create({
|
|
1140
1148
|
name: "itCallout",
|
|
1141
1149
|
group: "block",
|
|
1142
1150
|
content: "inline*",
|
|
@@ -1155,7 +1163,7 @@ const In = E.create({
|
|
|
1155
1163
|
return [{ tag: 'div[data-it-type="callout"]' }];
|
|
1156
1164
|
},
|
|
1157
1165
|
renderHTML({ HTMLAttributes: t, node: e }) {
|
|
1158
|
-
const n = e.attrs.variant || "tip", r =
|
|
1166
|
+
const n = e.attrs.variant || "tip", r = nt(e.attrs.props), o = {
|
|
1159
1167
|
tip: "tip",
|
|
1160
1168
|
info: "info",
|
|
1161
1169
|
warning: "warning",
|
|
@@ -1164,11 +1172,11 @@ const In = E.create({
|
|
|
1164
1172
|
};
|
|
1165
1173
|
return [
|
|
1166
1174
|
"div",
|
|
1167
|
-
|
|
1175
|
+
_(t, {
|
|
1168
1176
|
"data-it-type": "callout",
|
|
1169
1177
|
"data-variant": n,
|
|
1170
1178
|
class: `it-doc-callout it-doc-callout-${n}`,
|
|
1171
|
-
style:
|
|
1179
|
+
style: J(n, r)
|
|
1172
1180
|
}),
|
|
1173
1181
|
[
|
|
1174
1182
|
"span",
|
|
@@ -1181,7 +1189,7 @@ const In = E.create({
|
|
|
1181
1189
|
["span", { class: "it-doc-callout-text" }, 0]
|
|
1182
1190
|
];
|
|
1183
1191
|
}
|
|
1184
|
-
}),
|
|
1192
|
+
}), jn = E.create({
|
|
1185
1193
|
name: "itQuote",
|
|
1186
1194
|
group: "block",
|
|
1187
1195
|
content: "inline*",
|
|
@@ -1196,18 +1204,18 @@ const In = E.create({
|
|
|
1196
1204
|
return [{ tag: 'blockquote[data-it-type="quote"]' }];
|
|
1197
1205
|
},
|
|
1198
1206
|
renderHTML({ HTMLAttributes: t, node: e }) {
|
|
1199
|
-
const n =
|
|
1207
|
+
const n = nt(e.attrs.props);
|
|
1200
1208
|
return [
|
|
1201
1209
|
"blockquote",
|
|
1202
|
-
|
|
1210
|
+
_(t, {
|
|
1203
1211
|
"data-it-type": "quote",
|
|
1204
1212
|
class: "it-doc-quote",
|
|
1205
|
-
style:
|
|
1213
|
+
style: J("quote", n)
|
|
1206
1214
|
}),
|
|
1207
1215
|
0
|
|
1208
1216
|
];
|
|
1209
1217
|
}
|
|
1210
|
-
}),
|
|
1218
|
+
}), Wn = E.create({
|
|
1211
1219
|
name: "itCode",
|
|
1212
1220
|
group: "block",
|
|
1213
1221
|
content: "text*",
|
|
@@ -1224,19 +1232,19 @@ const In = E.create({
|
|
|
1224
1232
|
return [{ tag: "pre" }];
|
|
1225
1233
|
},
|
|
1226
1234
|
renderHTML({ HTMLAttributes: t, node: e }) {
|
|
1227
|
-
const n =
|
|
1235
|
+
const n = nt(e.attrs.props);
|
|
1228
1236
|
return [
|
|
1229
1237
|
"pre",
|
|
1230
|
-
|
|
1238
|
+
_(t, {
|
|
1231
1239
|
"data-it-type": "code",
|
|
1232
1240
|
class: "it-doc-code",
|
|
1233
1241
|
"data-lang": e.attrs.lang || "",
|
|
1234
|
-
style:
|
|
1242
|
+
style: J("code", n)
|
|
1235
1243
|
}),
|
|
1236
1244
|
["code", 0]
|
|
1237
1245
|
];
|
|
1238
1246
|
}
|
|
1239
|
-
}),
|
|
1247
|
+
}), Gn = E.create({
|
|
1240
1248
|
name: "itDivider",
|
|
1241
1249
|
group: "block",
|
|
1242
1250
|
atom: !0,
|
|
@@ -1244,9 +1252,9 @@ const In = E.create({
|
|
|
1244
1252
|
return [{ tag: "hr" }];
|
|
1245
1253
|
},
|
|
1246
1254
|
renderHTML({ HTMLAttributes: t }) {
|
|
1247
|
-
return ["hr",
|
|
1255
|
+
return ["hr", _(t, { class: "it-doc-divider" })];
|
|
1248
1256
|
}
|
|
1249
|
-
}),
|
|
1257
|
+
}), Un = E.create({
|
|
1250
1258
|
name: "itMeta",
|
|
1251
1259
|
group: "block",
|
|
1252
1260
|
atom: !0,
|
|
@@ -1266,11 +1274,11 @@ const In = E.create({
|
|
|
1266
1274
|
const n = String(e.attrs.raw || "").replace(/\s*\|\s*/g, " · ");
|
|
1267
1275
|
return [
|
|
1268
1276
|
"div",
|
|
1269
|
-
|
|
1277
|
+
_(t, { "data-it-meta": "", class: "it-doc-meta" }),
|
|
1270
1278
|
`⚙ ${n}`
|
|
1271
1279
|
];
|
|
1272
1280
|
}
|
|
1273
|
-
}),
|
|
1281
|
+
}), Yn = E.create({
|
|
1274
1282
|
name: "itTable",
|
|
1275
1283
|
group: "block",
|
|
1276
1284
|
atom: !0,
|
|
@@ -1296,7 +1304,7 @@ const In = E.create({
|
|
|
1296
1304
|
const r = n[0] || [], o = n.slice(1);
|
|
1297
1305
|
return [
|
|
1298
1306
|
"table",
|
|
1299
|
-
|
|
1307
|
+
_(t, {
|
|
1300
1308
|
"data-it-table": "",
|
|
1301
1309
|
class: "it-doc-table"
|
|
1302
1310
|
}),
|
|
@@ -1308,7 +1316,7 @@ const In = E.create({
|
|
|
1308
1316
|
"tbody",
|
|
1309
1317
|
...o.map((l) => [
|
|
1310
1318
|
"tr",
|
|
1311
|
-
...l.map((
|
|
1319
|
+
...l.map((c) => ["td", Yt(c), String(c)])
|
|
1312
1320
|
])
|
|
1313
1321
|
]
|
|
1314
1322
|
];
|
|
@@ -1317,15 +1325,15 @@ const In = E.create({
|
|
|
1317
1325
|
function Yt(t) {
|
|
1318
1326
|
return /\{\{[^}]+\}\}|^each:/.test(String(t).trim()) ? { class: "it-doc-var-cell" } : {};
|
|
1319
1327
|
}
|
|
1320
|
-
function
|
|
1321
|
-
const e = t.indexOf(":"), n = (e >= 0 ? t.slice(0, e) : t).trim().toLowerCase(), o = (e >= 0 ? t.slice(e + 1).trim() : "").split("|").map((
|
|
1322
|
-
for (const
|
|
1323
|
-
const
|
|
1324
|
-
|
|
1328
|
+
function Pt(t) {
|
|
1329
|
+
const e = t.indexOf(":"), n = (e >= 0 ? t.slice(0, e) : t).trim().toLowerCase(), o = (e >= 0 ? t.slice(e + 1).trim() : "").split("|").map((d) => d.trim()), l = o.shift() || "", c = {};
|
|
1330
|
+
for (const d of o) {
|
|
1331
|
+
const s = d.indexOf(":");
|
|
1332
|
+
s > 0 && (c[d.slice(0, s).trim().toLowerCase()] = d.slice(s + 1).trim());
|
|
1325
1333
|
}
|
|
1326
|
-
return { keyword: n, content: l, props:
|
|
1334
|
+
return { keyword: n, content: l, props: c };
|
|
1327
1335
|
}
|
|
1328
|
-
const
|
|
1336
|
+
const Kn = E.create({
|
|
1329
1337
|
name: "itTrust",
|
|
1330
1338
|
group: "block",
|
|
1331
1339
|
atom: !0,
|
|
@@ -1347,68 +1355,44 @@ const qn = E.create({
|
|
|
1347
1355
|
return [{ tag: "div[data-it-trust]" }];
|
|
1348
1356
|
},
|
|
1349
1357
|
renderHTML({ HTMLAttributes: t, node: e }) {
|
|
1350
|
-
const { keyword: n, content: r, props: o } =
|
|
1358
|
+
const { keyword: n, content: r, props: o } = Pt(
|
|
1351
1359
|
String(e.attrs.raw || "")
|
|
1352
|
-
), l = o.role || o.title || "",
|
|
1353
|
-
if (n === "seal") {
|
|
1354
|
-
const
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
);
|
|
1369
|
-
else
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
);
|
|
1376
|
-
|
|
1377
|
-
u.push(
|
|
1378
|
-
["span", { class: "it-doc-trust__icon" }, "✎"],
|
|
1379
|
-
["span", { class: "it-doc-trust__label" }, "Amendment"],
|
|
1380
|
-
["span", { class: "it-doc-trust__name" }, r],
|
|
1381
|
-
...a ? [["span", { class: "it-doc-trust__date" }, a]] : []
|
|
1382
|
-
);
|
|
1383
|
-
else
|
|
1384
|
-
return [
|
|
1385
|
-
"div",
|
|
1386
|
-
z(t, {
|
|
1387
|
-
"data-it-trust": "",
|
|
1388
|
-
"data-trust": n,
|
|
1389
|
-
class: "it-doc-trust it-doc-sign"
|
|
1390
|
-
}),
|
|
1391
|
-
["div", { class: "it-doc-sign__script" }, r || " "],
|
|
1392
|
-
["div", { class: "it-doc-sign__rule" }],
|
|
1393
|
-
[
|
|
1394
|
-
"div",
|
|
1395
|
-
{ class: "it-doc-sign__row" },
|
|
1396
|
-
["span", { class: "it-doc-sign__name" }, r],
|
|
1397
|
-
...l ? [["span", { class: "it-doc-sign__role" }, l]] : [],
|
|
1398
|
-
...a ? [["span", { class: "it-doc-sign__date" }, a]] : []
|
|
1399
|
-
]
|
|
1400
|
-
];
|
|
1360
|
+
), l = o.role || o.title || "", c = (o.at || o.date || o.time || "").slice(0, 10), d = [];
|
|
1361
|
+
if (n === "seal" || n === "freeze") {
|
|
1362
|
+
const s = n === "seal" && r || o.hash || "";
|
|
1363
|
+
d.push(["span", { class: "it-doc-trust__label" }, "Sealed document"]), c && d.push(["span", { class: "it-doc-trust__date" }, c]), s && d.push([
|
|
1364
|
+
"code",
|
|
1365
|
+
{ class: "it-doc-trust__hash" },
|
|
1366
|
+
s.length > 20 ? s.slice(0, 20) + "..." : s
|
|
1367
|
+
]);
|
|
1368
|
+
} else if (n === "approve") {
|
|
1369
|
+
const s = o.by || r, f = o.by ? r : "";
|
|
1370
|
+
d.push(["span", { class: "it-doc-trust__label" }, "Approved"]), f && d.push(["span", { class: "it-doc-trust__what" }, f]), s && d.push([
|
|
1371
|
+
"span",
|
|
1372
|
+
{ class: "it-doc-trust__who" },
|
|
1373
|
+
l ? `${s}, ${l}` : s
|
|
1374
|
+
]), c && d.push(["span", { class: "it-doc-trust__date" }, c]);
|
|
1375
|
+
} else if (n === "amend" || n === "amendment")
|
|
1376
|
+
d.push(["span", { class: "it-doc-trust__label" }, "Amendment"]), r && d.push(["span", { class: "it-doc-trust__what" }, r]), c && d.push(["span", { class: "it-doc-trust__date" }, c]);
|
|
1377
|
+
else {
|
|
1378
|
+
const s = r || o.by || "", f = !!o.hash;
|
|
1379
|
+
d.push(["span", { class: "it-doc-trust__name" }, s]), l && d.push(["span", { class: "it-doc-trust__role" }, l]), c && d.push(["span", { class: "it-doc-trust__date" }, c]), d.push([
|
|
1380
|
+
"span",
|
|
1381
|
+
{ class: "it-doc-trust__status" },
|
|
1382
|
+
f ? "Signed · verified" : "Signed"
|
|
1383
|
+
]);
|
|
1384
|
+
}
|
|
1401
1385
|
return [
|
|
1402
1386
|
"div",
|
|
1403
|
-
|
|
1387
|
+
_(t, {
|
|
1404
1388
|
"data-it-trust": "",
|
|
1405
1389
|
"data-trust": n,
|
|
1406
1390
|
class: `it-doc-trust it-doc-trust--${n}`
|
|
1407
1391
|
}),
|
|
1408
|
-
...
|
|
1392
|
+
...d
|
|
1409
1393
|
];
|
|
1410
1394
|
}
|
|
1411
|
-
}),
|
|
1395
|
+
}), qn = E.create({
|
|
1412
1396
|
name: "itMetric",
|
|
1413
1397
|
group: "block",
|
|
1414
1398
|
atom: !0,
|
|
@@ -1425,22 +1409,22 @@ const qn = E.create({
|
|
|
1425
1409
|
return [{ tag: "div[data-it-metric]" }];
|
|
1426
1410
|
},
|
|
1427
1411
|
renderHTML({ HTMLAttributes: t, node: e }) {
|
|
1428
|
-
const { content: n, props: r } =
|
|
1412
|
+
const { content: n, props: r } = Pt(String(e.attrs.raw || "")), o = [r.value, r.unit].filter(Boolean).join(" "), l = /\b(total|balance due|amount due|grand)\b/i.test(n), c = /\{\{[^}]+\}\}/.test(o);
|
|
1429
1413
|
return [
|
|
1430
1414
|
"div",
|
|
1431
|
-
|
|
1415
|
+
_(t, {
|
|
1432
1416
|
"data-it-metric": "",
|
|
1433
1417
|
class: `it-doc-metric${l ? " it-doc-metric--total" : ""}`
|
|
1434
1418
|
}),
|
|
1435
1419
|
["span", { class: "it-doc-metric__label" }, n],
|
|
1436
1420
|
[
|
|
1437
1421
|
"span",
|
|
1438
|
-
{ class: `it-doc-metric__value${
|
|
1422
|
+
{ class: `it-doc-metric__value${c ? " it-doc-var" : ""}` },
|
|
1439
1423
|
o
|
|
1440
1424
|
]
|
|
1441
1425
|
];
|
|
1442
1426
|
}
|
|
1443
|
-
}),
|
|
1427
|
+
}), Jn = E.create({
|
|
1444
1428
|
name: "itStyleRule",
|
|
1445
1429
|
group: "block",
|
|
1446
1430
|
atom: !0,
|
|
@@ -1457,10 +1441,10 @@ const qn = E.create({
|
|
|
1457
1441
|
return [{ tag: "div[data-it-style-rule]" }];
|
|
1458
1442
|
},
|
|
1459
1443
|
renderHTML({ HTMLAttributes: t, node: e }) {
|
|
1460
|
-
const { content: n, props: r } =
|
|
1444
|
+
const { content: n, props: r } = Pt(String(e.attrs.raw || "")), o = Object.entries(r).map(([l, c]) => `${l}: ${c}`).join(" · ");
|
|
1461
1445
|
return [
|
|
1462
1446
|
"div",
|
|
1463
|
-
|
|
1447
|
+
_(t, {
|
|
1464
1448
|
"data-it-style-rule": "",
|
|
1465
1449
|
class: "it-doc-stylerule"
|
|
1466
1450
|
}),
|
|
@@ -1469,7 +1453,7 @@ const qn = E.create({
|
|
|
1469
1453
|
["span", { class: "it-doc-stylerule__decl" }, o]
|
|
1470
1454
|
];
|
|
1471
1455
|
}
|
|
1472
|
-
}),
|
|
1456
|
+
}), Vn = E.create({
|
|
1473
1457
|
name: "itBreak",
|
|
1474
1458
|
group: "block",
|
|
1475
1459
|
atom: !0,
|
|
@@ -1479,13 +1463,13 @@ const qn = E.create({
|
|
|
1479
1463
|
renderHTML({ HTMLAttributes: t }) {
|
|
1480
1464
|
return [
|
|
1481
1465
|
"div",
|
|
1482
|
-
|
|
1466
|
+
_(t, {
|
|
1483
1467
|
"data-it-type": "break",
|
|
1484
1468
|
class: "it-doc-break"
|
|
1485
1469
|
})
|
|
1486
1470
|
];
|
|
1487
1471
|
}
|
|
1488
|
-
}),
|
|
1472
|
+
}), Qn = E.create({
|
|
1489
1473
|
name: "itGenericBlock",
|
|
1490
1474
|
group: "block",
|
|
1491
1475
|
content: "inline*",
|
|
@@ -1501,16 +1485,16 @@ const qn = E.create({
|
|
|
1501
1485
|
return [{ tag: '[data-it-type="generic"]' }];
|
|
1502
1486
|
},
|
|
1503
1487
|
renderHTML({ HTMLAttributes: t, node: e }) {
|
|
1504
|
-
const n = e.attrs.keyword, r =
|
|
1488
|
+
const n = e.attrs.keyword, r = nt(e.attrs.props), o = String(
|
|
1505
1489
|
r.to || r.url || r.href || r.file || ""
|
|
1506
1490
|
).trim();
|
|
1507
1491
|
return (n === "link" || n === "ref") && o ? [
|
|
1508
1492
|
"p",
|
|
1509
|
-
|
|
1493
|
+
_(t, {
|
|
1510
1494
|
"data-it-type": "generic",
|
|
1511
1495
|
"data-keyword": n,
|
|
1512
1496
|
class: `it-doc-generic it-doc-kw-${n}`,
|
|
1513
|
-
style:
|
|
1497
|
+
style: J(n, r)
|
|
1514
1498
|
}),
|
|
1515
1499
|
[
|
|
1516
1500
|
"a",
|
|
@@ -1524,16 +1508,16 @@ const qn = E.create({
|
|
|
1524
1508
|
]
|
|
1525
1509
|
] : [
|
|
1526
1510
|
"p",
|
|
1527
|
-
|
|
1511
|
+
_(t, {
|
|
1528
1512
|
"data-it-type": "generic",
|
|
1529
1513
|
"data-keyword": n,
|
|
1530
1514
|
class: `it-doc-generic it-doc-kw-${n}`,
|
|
1531
|
-
style:
|
|
1515
|
+
style: J(n, r)
|
|
1532
1516
|
}),
|
|
1533
1517
|
["span", { class: "it-doc-generic-content" }, 0]
|
|
1534
1518
|
];
|
|
1535
1519
|
}
|
|
1536
|
-
}),
|
|
1520
|
+
}), Zn = E.create({
|
|
1537
1521
|
name: "itComment",
|
|
1538
1522
|
group: "block",
|
|
1539
1523
|
content: "inline*",
|
|
@@ -1544,7 +1528,7 @@ const qn = E.create({
|
|
|
1544
1528
|
renderHTML({ HTMLAttributes: t }) {
|
|
1545
1529
|
return [
|
|
1546
1530
|
"p",
|
|
1547
|
-
|
|
1531
|
+
_(t, {
|
|
1548
1532
|
"data-it-type": "comment",
|
|
1549
1533
|
class: "it-doc-comment"
|
|
1550
1534
|
}),
|
|
@@ -1552,7 +1536,7 @@ const qn = E.create({
|
|
|
1552
1536
|
];
|
|
1553
1537
|
}
|
|
1554
1538
|
});
|
|
1555
|
-
function
|
|
1539
|
+
function nt(t) {
|
|
1556
1540
|
try {
|
|
1557
1541
|
return typeof t == "string" ? JSON.parse(t) : t || {};
|
|
1558
1542
|
} catch {
|
|
@@ -1564,7 +1548,7 @@ const re = {
|
|
|
1564
1548
|
"space-before": "spaceBefore",
|
|
1565
1549
|
"space-after": "spaceAfter",
|
|
1566
1550
|
end: "end"
|
|
1567
|
-
},
|
|
1551
|
+
}, Xn = /* @__PURE__ */ new Set([
|
|
1568
1552
|
"itTitle",
|
|
1569
1553
|
"itSummary",
|
|
1570
1554
|
"itSection",
|
|
@@ -1572,7 +1556,7 @@ const re = {
|
|
|
1572
1556
|
"itQuote",
|
|
1573
1557
|
"itCallout",
|
|
1574
1558
|
"itGenericBlock"
|
|
1575
|
-
]),
|
|
1559
|
+
]), tr = /* @__PURE__ */ new Set(["itTitle", "itSection", "itSub"]);
|
|
1576
1560
|
function oe(t) {
|
|
1577
1561
|
try {
|
|
1578
1562
|
return typeof t == "string" ? JSON.parse(t) : t || {};
|
|
@@ -1581,9 +1565,9 @@ function oe(t) {
|
|
|
1581
1565
|
}
|
|
1582
1566
|
}
|
|
1583
1567
|
function se(t, e) {
|
|
1584
|
-
return t === "paragraph" ? !0 : e === "end" ?
|
|
1568
|
+
return t === "paragraph" ? !0 : e === "end" ? tr.has(t) : Xn.has(t);
|
|
1585
1569
|
}
|
|
1586
|
-
const
|
|
1570
|
+
const er = Ie.extend({
|
|
1587
1571
|
addAttributes() {
|
|
1588
1572
|
return {
|
|
1589
1573
|
...this.parent?.(),
|
|
@@ -1612,52 +1596,52 @@ const nr = Ie.extend({
|
|
|
1612
1596
|
renderHTML({ node: t, HTMLAttributes: e }) {
|
|
1613
1597
|
return t.attrs.end ? [
|
|
1614
1598
|
"p",
|
|
1615
|
-
|
|
1599
|
+
_(e),
|
|
1616
1600
|
["span", { class: "it-split-main" }, 0]
|
|
1617
|
-
] : ["p",
|
|
1601
|
+
] : ["p", _(e), 0];
|
|
1618
1602
|
}
|
|
1619
|
-
}),
|
|
1603
|
+
}), nr = vt.create({
|
|
1620
1604
|
name: "blockProps",
|
|
1621
1605
|
addCommands() {
|
|
1622
1606
|
return {
|
|
1623
1607
|
setBlockProp: (t, e) => ({ state: n, tr: r, dispatch: o }) => {
|
|
1624
|
-
const { from: l, to:
|
|
1625
|
-
let
|
|
1626
|
-
return n.doc.nodesBetween(l,
|
|
1627
|
-
const p =
|
|
1628
|
-
if (p === "bulletList" || p === "orderedList" || !
|
|
1608
|
+
const { from: l, to: c } = n.selection;
|
|
1609
|
+
let d = !1;
|
|
1610
|
+
return n.doc.nodesBetween(l, c, (s, f) => {
|
|
1611
|
+
const p = s.type.name;
|
|
1612
|
+
if (p === "bulletList" || p === "orderedList" || !s.isBlock || s.isAtom) return !1;
|
|
1629
1613
|
if (!se(p, t)) return !0;
|
|
1630
1614
|
if (p === "paragraph")
|
|
1631
|
-
r.setNodeMarkup(
|
|
1632
|
-
...
|
|
1615
|
+
r.setNodeMarkup(f, void 0, {
|
|
1616
|
+
...s.attrs,
|
|
1633
1617
|
[re[t]]: e
|
|
1634
1618
|
});
|
|
1635
1619
|
else {
|
|
1636
|
-
const
|
|
1637
|
-
e == null || e === "" ? delete
|
|
1638
|
-
...
|
|
1639
|
-
props: JSON.stringify(
|
|
1620
|
+
const h = oe(s.attrs.props);
|
|
1621
|
+
e == null || e === "" ? delete h[t] : h[t] = e, r.setNodeMarkup(f, void 0, {
|
|
1622
|
+
...s.attrs,
|
|
1623
|
+
props: JSON.stringify(h)
|
|
1640
1624
|
});
|
|
1641
1625
|
}
|
|
1642
|
-
return
|
|
1643
|
-
}),
|
|
1626
|
+
return d = !0, !1;
|
|
1627
|
+
}), d && o && o(r), d;
|
|
1644
1628
|
}
|
|
1645
1629
|
};
|
|
1646
1630
|
}
|
|
1647
1631
|
});
|
|
1648
|
-
function
|
|
1632
|
+
function X(t, e) {
|
|
1649
1633
|
if (!t) return null;
|
|
1650
1634
|
const { state: n } = t, { from: r, to: o } = n.selection;
|
|
1651
1635
|
let l = null;
|
|
1652
|
-
return n.doc.nodesBetween(r, o, (
|
|
1636
|
+
return n.doc.nodesBetween(r, o, (c) => {
|
|
1653
1637
|
if (l !== null) return !1;
|
|
1654
|
-
const
|
|
1655
|
-
if (!se(
|
|
1656
|
-
if (
|
|
1657
|
-
const
|
|
1658
|
-
l =
|
|
1638
|
+
const d = c.type.name;
|
|
1639
|
+
if (!se(d, e)) return !0;
|
|
1640
|
+
if (d === "paragraph") {
|
|
1641
|
+
const s = c.attrs[re[e]];
|
|
1642
|
+
l = s != null ? String(s) : "";
|
|
1659
1643
|
} else
|
|
1660
|
-
l = oe(
|
|
1644
|
+
l = oe(c.attrs.props)[e] ?? "";
|
|
1661
1645
|
return !1;
|
|
1662
1646
|
}), l;
|
|
1663
1647
|
}
|
|
@@ -1670,7 +1654,7 @@ const Kt = {
|
|
|
1670
1654
|
trust: { label: "Trust", icon: "Tr", color: "#eab308" },
|
|
1671
1655
|
layout: { label: "Layout", icon: "Pg", color: "#64748b" }
|
|
1672
1656
|
};
|
|
1673
|
-
function
|
|
1657
|
+
function rr(t) {
|
|
1674
1658
|
const e = document.createElement("iframe");
|
|
1675
1659
|
e.setAttribute("aria-hidden", "true"), e.style.cssText = "position:fixed;right:0;bottom:0;width:210mm;height:297mm;border:0;visibility:hidden;", document.body.appendChild(e);
|
|
1676
1660
|
let n = !1;
|
|
@@ -1688,21 +1672,21 @@ function or(t) {
|
|
|
1688
1672
|
const o = e.contentWindow.document;
|
|
1689
1673
|
o.open(), o.write(t), o.close(), o.readyState === "complete" && window.setTimeout(r, 250);
|
|
1690
1674
|
}
|
|
1691
|
-
function
|
|
1675
|
+
function or(t, e) {
|
|
1692
1676
|
return t.includes("</head>") ? t.replace("</head>", `<style>${e}</style></head>`) : t;
|
|
1693
1677
|
}
|
|
1694
1678
|
const ie = ".it-doc-callout{background:none!important;border:1px solid #ccc!important}", qt = _e;
|
|
1695
|
-
function
|
|
1679
|
+
function sr(t, e) {
|
|
1696
1680
|
const n = document.querySelector(".docs-page .tiptap");
|
|
1697
1681
|
if (!n) return null;
|
|
1698
1682
|
const r = n.cloneNode(!0);
|
|
1699
|
-
r.querySelectorAll("[data-it-spacer]").forEach((
|
|
1683
|
+
r.querySelectorAll("[data-it-spacer]").forEach((h) => h.remove());
|
|
1700
1684
|
const o = r.innerHTML, l = Array.from(
|
|
1701
1685
|
document.querySelectorAll('style, link[rel="stylesheet"]')
|
|
1702
|
-
).map((
|
|
1703
|
-
`),
|
|
1704
|
-
let
|
|
1705
|
-
|
|
1686
|
+
).map((h) => h.outerHTML).join(`
|
|
1687
|
+
`), c = Mt(t), d = c.autoHeight ? `${c.width}px auto` : `${c.width}px ${c.height}px`, s = `${c.marginTop}px ${c.marginRight}px ${c.marginBottom}px ${c.marginLeft}px`;
|
|
1688
|
+
let f = `@page{size:${d};margin:${s};}`;
|
|
1689
|
+
c.header && (f += `@page{@top-center{content:${qt(c.header)};font:10px -apple-system,sans-serif;color:#9aa0a6;}}`), c.footer && (f += `@page{@bottom-center{content:${qt(c.footer)};font:10px -apple-system,sans-serif;color:#9aa0a6;}}`);
|
|
1706
1690
|
const p = `
|
|
1707
1691
|
html,body{margin:0;background:#fff;}
|
|
1708
1692
|
.docs-page,.docs-page.docs-sheet{box-shadow:none;border-radius:0;margin:0;width:auto;min-height:0;padding:0;background:#fff;}
|
|
@@ -1710,29 +1694,29 @@ function ir(t, e) {
|
|
|
1710
1694
|
[data-it-spacer]{display:none!important;}
|
|
1711
1695
|
${e === "minimal-ink" ? ie : ""}
|
|
1712
1696
|
`;
|
|
1713
|
-
return `<!doctype html><html><head><meta charset="utf-8">${l}<style>${
|
|
1697
|
+
return `<!doctype html><html><head><meta charset="utf-8">${l}<style>${f}${p}</style></head><body><div class="docs-page docs-sheet"><div class="tiptap">${o}</div></div></body></html>`;
|
|
1714
1698
|
}
|
|
1715
|
-
function
|
|
1699
|
+
function ir(t, e, n) {
|
|
1716
1700
|
const r = new Blob([t], { type: n }), o = URL.createObjectURL(r), l = document.createElement("a");
|
|
1717
1701
|
l.href = o, l.download = e, l.click(), URL.revokeObjectURL(o);
|
|
1718
1702
|
}
|
|
1719
1703
|
function ae(t, e, n) {
|
|
1720
|
-
let r =
|
|
1704
|
+
let r = sr(t, n);
|
|
1721
1705
|
if (!r) {
|
|
1722
|
-
const o =
|
|
1723
|
-
r =
|
|
1706
|
+
const o = et(t);
|
|
1707
|
+
r = ze(o, { theme: e }), n === "minimal-ink" && (r = or(r, ie));
|
|
1724
1708
|
}
|
|
1725
1709
|
return r;
|
|
1726
1710
|
}
|
|
1727
|
-
function
|
|
1711
|
+
function ar(t, e, n = "normal") {
|
|
1728
1712
|
try {
|
|
1729
|
-
|
|
1713
|
+
rr(ae(t, e, n));
|
|
1730
1714
|
} catch {
|
|
1731
1715
|
}
|
|
1732
1716
|
}
|
|
1733
|
-
function
|
|
1717
|
+
function cr(t, e, n = "normal") {
|
|
1734
1718
|
try {
|
|
1735
|
-
|
|
1719
|
+
ir(
|
|
1736
1720
|
ae(t, e, n),
|
|
1737
1721
|
"document.html",
|
|
1738
1722
|
"text/html"
|
|
@@ -1740,28 +1724,28 @@ function lr(t, e, n = "normal") {
|
|
|
1740
1724
|
} catch {
|
|
1741
1725
|
}
|
|
1742
1726
|
}
|
|
1743
|
-
function
|
|
1744
|
-
return
|
|
1727
|
+
function lr() {
|
|
1728
|
+
return Me();
|
|
1745
1729
|
}
|
|
1746
|
-
const
|
|
1730
|
+
const At = [
|
|
1747
1731
|
{ label: "Normal text", node: "paragraph" },
|
|
1748
1732
|
{ label: "Title", node: "itTitle" },
|
|
1749
1733
|
{ label: "Section", node: "itSection" },
|
|
1750
1734
|
{ label: "Subsection", node: "itSub" },
|
|
1751
1735
|
{ label: "Summary", node: "itSummary" },
|
|
1752
1736
|
{ label: "Quote", node: "itQuote" }
|
|
1753
|
-
],
|
|
1737
|
+
], dr = /* @__PURE__ */ new Set([
|
|
1754
1738
|
"history",
|
|
1755
1739
|
"revision",
|
|
1756
1740
|
"track",
|
|
1757
1741
|
"freeze"
|
|
1758
|
-
]),
|
|
1742
|
+
]), ur = /* @__PURE__ */ new Set([
|
|
1759
1743
|
"agent",
|
|
1760
1744
|
"model",
|
|
1761
1745
|
"meta",
|
|
1762
1746
|
"context",
|
|
1763
1747
|
"history"
|
|
1764
|
-
]),
|
|
1748
|
+
]), pr = [
|
|
1765
1749
|
"identity",
|
|
1766
1750
|
"structure",
|
|
1767
1751
|
"content",
|
|
@@ -1777,7 +1761,7 @@ const Ct = [
|
|
|
1777
1761
|
{ label: "Courier New", value: "Courier New" },
|
|
1778
1762
|
{ label: "Verdana", value: "Verdana" },
|
|
1779
1763
|
{ label: "Trebuchet MS", value: "Trebuchet MS" }
|
|
1780
|
-
],
|
|
1764
|
+
], fr = ["1", "1.15", "1.5", "2", "2.5", "3"], gr = "12px", hr = [
|
|
1781
1765
|
"#000000",
|
|
1782
1766
|
"#434343",
|
|
1783
1767
|
"#666666",
|
|
@@ -1828,7 +1812,7 @@ const Ct = [
|
|
|
1828
1812
|
"#6fa8dc",
|
|
1829
1813
|
"#8e7cc3",
|
|
1830
1814
|
"#c27ba0"
|
|
1831
|
-
],
|
|
1815
|
+
], mr = [
|
|
1832
1816
|
"#ffffff",
|
|
1833
1817
|
"#cfe2f3",
|
|
1834
1818
|
"#d9ead3",
|
|
@@ -1847,7 +1831,7 @@ function $({
|
|
|
1847
1831
|
title: r,
|
|
1848
1832
|
children: o
|
|
1849
1833
|
}) {
|
|
1850
|
-
return /* @__PURE__ */
|
|
1834
|
+
return /* @__PURE__ */ a(
|
|
1851
1835
|
"button",
|
|
1852
1836
|
{
|
|
1853
1837
|
className: `docs-tb-btn${e ? " active" : ""}`,
|
|
@@ -1863,288 +1847,293 @@ function dt({
|
|
|
1863
1847
|
children: e,
|
|
1864
1848
|
className: n = ""
|
|
1865
1849
|
}) {
|
|
1866
|
-
return /* @__PURE__ */
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1850
|
+
return /* @__PURE__ */ a(
|
|
1851
|
+
"div",
|
|
1852
|
+
{
|
|
1853
|
+
className: `ribbon-group ${n}`.trim(),
|
|
1854
|
+
role: "group",
|
|
1855
|
+
"aria-label": t,
|
|
1856
|
+
children: e
|
|
1857
|
+
}
|
|
1858
|
+
);
|
|
1870
1859
|
}
|
|
1871
|
-
function
|
|
1872
|
-
return /* @__PURE__ */
|
|
1860
|
+
function ht() {
|
|
1861
|
+
return /* @__PURE__ */ a("div", { className: "ribbon-sep" });
|
|
1873
1862
|
}
|
|
1874
|
-
function
|
|
1863
|
+
function br({
|
|
1875
1864
|
editor: t,
|
|
1876
1865
|
isRtl: e = !1,
|
|
1877
1866
|
onToggleRtl: n,
|
|
1878
1867
|
content: r,
|
|
1879
1868
|
theme: o,
|
|
1880
1869
|
onThemeChange: l,
|
|
1881
|
-
onTrustAction:
|
|
1882
|
-
locked:
|
|
1870
|
+
onTrustAction: c,
|
|
1871
|
+
locked: d = !1
|
|
1883
1872
|
}) {
|
|
1884
|
-
const [
|
|
1873
|
+
const [s, f] = P(!1), [p, h] = P(!1), [g, k] = P(!1), [M, C] = P(!1), [v, w] = P(!1), [I, O] = P(!1), [K, q] = P(!1), W = B(null), rt = B(null), N = B(null), H = B(null), ot = B(null), G = B(null);
|
|
1885
1874
|
j(() => {
|
|
1886
|
-
const
|
|
1887
|
-
const
|
|
1888
|
-
|
|
1875
|
+
const u = (x) => {
|
|
1876
|
+
const S = x.target;
|
|
1877
|
+
W.current && !W.current.contains(S) && f(!1), rt.current && !rt.current.contains(S) && h(!1), N.current && !N.current.contains(S) && k(!1), H.current && !H.current.contains(S) && C(!1), ot.current && !ot.current.contains(S) && w(!1), G.current && !G.current.contains(S) && O(!1);
|
|
1889
1878
|
};
|
|
1890
|
-
return document.addEventListener("mousedown",
|
|
1879
|
+
return document.addEventListener("mousedown", u), () => document.removeEventListener("mousedown", u);
|
|
1891
1880
|
}, []);
|
|
1892
|
-
const
|
|
1893
|
-
|
|
1881
|
+
const L = () => {
|
|
1882
|
+
f(!1), h(!1), k(!1), C(!1), w(!1), O(!1);
|
|
1894
1883
|
}, st = R(() => {
|
|
1895
1884
|
if (!t) return "Normal text";
|
|
1896
|
-
for (const
|
|
1897
|
-
if (
|
|
1898
|
-
if (!
|
|
1899
|
-
(
|
|
1900
|
-
)) return
|
|
1901
|
-
} else if (t.isActive(
|
|
1902
|
-
return
|
|
1885
|
+
for (const u of At)
|
|
1886
|
+
if (u.node === "paragraph" && t.isActive("paragraph")) {
|
|
1887
|
+
if (!At.some(
|
|
1888
|
+
(S) => S.node !== "paragraph" && t.isActive(S.node)
|
|
1889
|
+
)) return u.label;
|
|
1890
|
+
} else if (t.isActive(u.node))
|
|
1891
|
+
return u.label;
|
|
1903
1892
|
return "Normal text";
|
|
1904
1893
|
}, [t]), ut = R(() => {
|
|
1905
1894
|
if (!t) return "Default";
|
|
1906
|
-
const
|
|
1907
|
-
if (!
|
|
1908
|
-
const
|
|
1909
|
-
return
|
|
1910
|
-
}, [t]), [
|
|
1911
|
-
const
|
|
1912
|
-
for (const
|
|
1913
|
-
if (
|
|
1914
|
-
const
|
|
1895
|
+
const u = t.getAttributes("textStyle")?.fontFamily;
|
|
1896
|
+
if (!u) return "Default";
|
|
1897
|
+
const x = Jt.find((S) => S.value === u);
|
|
1898
|
+
return x ? x.label : "Default";
|
|
1899
|
+
}, [t]), [V, pt] = P(11), [, at] = P(0), m = Y(() => {
|
|
1900
|
+
const u = /* @__PURE__ */ new Map();
|
|
1901
|
+
for (const S of He) {
|
|
1902
|
+
if (S.status !== "stable" || ur.has(S.canonical) || S.category === "agent") continue;
|
|
1903
|
+
const Z = S.category, bt = u.get(Z) || [];
|
|
1915
1904
|
bt.push({
|
|
1916
|
-
label:
|
|
1917
|
-
keyword:
|
|
1918
|
-
category:
|
|
1919
|
-
description:
|
|
1920
|
-
isReadOnly:
|
|
1921
|
-
}),
|
|
1905
|
+
label: S.canonical,
|
|
1906
|
+
keyword: S.canonical,
|
|
1907
|
+
category: Z,
|
|
1908
|
+
description: S.description,
|
|
1909
|
+
isReadOnly: dr.has(S.canonical)
|
|
1910
|
+
}), u.set(Z, bt);
|
|
1922
1911
|
}
|
|
1923
|
-
const
|
|
1924
|
-
for (const
|
|
1925
|
-
const
|
|
1926
|
-
!
|
|
1927
|
-
category: Kt[
|
|
1928
|
-
items:
|
|
1912
|
+
const x = [];
|
|
1913
|
+
for (const S of pr) {
|
|
1914
|
+
const Z = u.get(S);
|
|
1915
|
+
!Z || Z.length === 0 || (Z.sort((bt, he) => bt.keyword.localeCompare(he.keyword)), x.push({
|
|
1916
|
+
category: Kt[S]?.label || S,
|
|
1917
|
+
items: Z
|
|
1929
1918
|
}));
|
|
1930
1919
|
}
|
|
1931
|
-
return
|
|
1920
|
+
return x;
|
|
1932
1921
|
}, []);
|
|
1933
1922
|
j(() => {
|
|
1934
1923
|
if (!t) return;
|
|
1935
|
-
const
|
|
1936
|
-
const
|
|
1937
|
-
if (
|
|
1938
|
-
const
|
|
1939
|
-
isNaN(
|
|
1924
|
+
const u = () => {
|
|
1925
|
+
const x = t.getAttributes("textStyle");
|
|
1926
|
+
if (x?.fontSize) {
|
|
1927
|
+
const S = parseInt(x.fontSize, 10);
|
|
1928
|
+
isNaN(S) || pt(S);
|
|
1940
1929
|
}
|
|
1941
|
-
at((
|
|
1930
|
+
at((S) => S + 1);
|
|
1942
1931
|
};
|
|
1943
|
-
return t.on("selectionUpdate",
|
|
1944
|
-
t.off("selectionUpdate",
|
|
1932
|
+
return t.on("selectionUpdate", u), t.on("transaction", u), () => {
|
|
1933
|
+
t.off("selectionUpdate", u), t.off("transaction", u);
|
|
1945
1934
|
};
|
|
1946
1935
|
}, [t]);
|
|
1947
1936
|
const y = R(
|
|
1948
|
-
(
|
|
1949
|
-
t && (
|
|
1937
|
+
(u) => {
|
|
1938
|
+
t && (u === "paragraph" ? t.chain().focus().setParagraph().run() : u === "itQuote" ? t.chain().focus().setNode("itQuote").run() : t.chain().focus().setNode(u).run(), L());
|
|
1950
1939
|
},
|
|
1951
1940
|
[t]
|
|
1952
|
-
),
|
|
1953
|
-
(
|
|
1941
|
+
), T = R(
|
|
1942
|
+
(u) => {
|
|
1954
1943
|
if (!t) return;
|
|
1955
|
-
const
|
|
1956
|
-
|
|
1944
|
+
const x = t.chain().focus();
|
|
1945
|
+
u === "divider" ? x.setNode("itDivider").run() : u === "break" ? x.setNode("itBreak").run() : u === "code" ? x.setNode("itCode", { lang: "" }).run() : ["tip", "info", "warning", "danger", "success"].includes(u) ? x.setNode("itCallout", { variant: u }).run() : x.setNode("itGenericBlock", { keyword: u, properties: "" }).run(), L();
|
|
1957
1946
|
},
|
|
1958
1947
|
[t]
|
|
1959
|
-
),
|
|
1960
|
-
(
|
|
1961
|
-
const
|
|
1962
|
-
pt(
|
|
1948
|
+
), D = R(
|
|
1949
|
+
(u) => {
|
|
1950
|
+
const x = Math.min(96, Math.max(8, V + u));
|
|
1951
|
+
pt(x), t?.chain().focus().setFontSize(`${x}pt`).run();
|
|
1963
1952
|
},
|
|
1964
|
-
[t,
|
|
1965
|
-
),
|
|
1966
|
-
(
|
|
1967
|
-
t?.chain().focus().setBlockProp("leading",
|
|
1953
|
+
[t, V]
|
|
1954
|
+
), Q = R(
|
|
1955
|
+
(u) => {
|
|
1956
|
+
t?.chain().focus().setBlockProp("leading", u).run(), L();
|
|
1968
1957
|
},
|
|
1969
1958
|
[t]
|
|
1970
|
-
),
|
|
1971
|
-
(
|
|
1959
|
+
), U = R(
|
|
1960
|
+
(u) => {
|
|
1972
1961
|
if (!t) return;
|
|
1973
|
-
const
|
|
1974
|
-
t.chain().focus().setBlockProp(
|
|
1962
|
+
const x = X(t, u);
|
|
1963
|
+
t.chain().focus().setBlockProp(u, x ? null : gr).run(), L();
|
|
1975
1964
|
},
|
|
1976
1965
|
[t]
|
|
1977
1966
|
), ce = R(() => {
|
|
1978
1967
|
if (!t) return;
|
|
1979
|
-
const
|
|
1968
|
+
const u = window.prompt(
|
|
1980
1969
|
"Space before block (e.g. 12px, 1em — empty for none):",
|
|
1981
|
-
|
|
1970
|
+
X(t, "space-before") || ""
|
|
1982
1971
|
);
|
|
1983
|
-
if (
|
|
1984
|
-
const
|
|
1972
|
+
if (u === null) return;
|
|
1973
|
+
const x = window.prompt(
|
|
1985
1974
|
"Space after block (e.g. 12px, 1em — empty for none):",
|
|
1986
|
-
|
|
1975
|
+
X(t, "space-after") || ""
|
|
1987
1976
|
);
|
|
1988
|
-
|
|
1977
|
+
x !== null && (t.chain().focus().setBlockProp("space-before", u.trim() || null).setBlockProp("space-after", x.trim() || null).run(), L());
|
|
1989
1978
|
}, [t]), le = R(() => {
|
|
1990
1979
|
if (!t) return;
|
|
1991
|
-
const
|
|
1980
|
+
const u = X(t, "end"), x = window.prompt(
|
|
1992
1981
|
"Line-end text (shown at the end of the line — empty to remove):",
|
|
1993
|
-
|
|
1982
|
+
u || ""
|
|
1994
1983
|
);
|
|
1995
|
-
|
|
1984
|
+
x !== null && t.chain().focus().setBlockProp("end", x.trim() || null).run();
|
|
1996
1985
|
}, [t]), de = R(() => {
|
|
1997
1986
|
t && (t.chain().focus().insertContent({
|
|
1998
1987
|
type: "paragraph",
|
|
1999
1988
|
attrs: { end: "End text" },
|
|
2000
1989
|
content: [{ type: "text", text: "Start text" }]
|
|
2001
|
-
}).run(),
|
|
2002
|
-
}, [t]), ue =
|
|
2003
|
-
() =>
|
|
2004
|
-
[r, o,
|
|
1990
|
+
}).run(), L());
|
|
1991
|
+
}, [t]), ue = Y(() => lr(), []), mt = K ? "minimal-ink" : "normal", pe = R(
|
|
1992
|
+
() => ar(r, o, mt),
|
|
1993
|
+
[r, o, mt]
|
|
2005
1994
|
), fe = R(
|
|
2006
|
-
() =>
|
|
2007
|
-
[r, o,
|
|
1995
|
+
() => cr(r, o, mt),
|
|
1996
|
+
[r, o, mt]
|
|
2008
1997
|
);
|
|
2009
1998
|
if (!t) return null;
|
|
2010
|
-
const Tt =
|
|
2011
|
-
return /* @__PURE__ */
|
|
2012
|
-
/* @__PURE__ */
|
|
2013
|
-
/* @__PURE__ */
|
|
1999
|
+
const Tt = X(t, "leading"), ge = !!X(t, "end");
|
|
2000
|
+
return /* @__PURE__ */ b("div", { className: "docs-toolbar docs-ribbon", children: [
|
|
2001
|
+
/* @__PURE__ */ b(dt, { label: "Edit", children: [
|
|
2002
|
+
/* @__PURE__ */ a(
|
|
2014
2003
|
$,
|
|
2015
2004
|
{
|
|
2016
2005
|
onClick: () => t.chain().focus().undo().run(),
|
|
2017
|
-
disabled:
|
|
2006
|
+
disabled: d || !t.can().undo(),
|
|
2018
2007
|
title: "Undo (⌘Z)",
|
|
2019
|
-
children: /* @__PURE__ */
|
|
2008
|
+
children: /* @__PURE__ */ a(Oe, { size: 16 })
|
|
2020
2009
|
}
|
|
2021
2010
|
),
|
|
2022
|
-
/* @__PURE__ */
|
|
2011
|
+
/* @__PURE__ */ a(
|
|
2023
2012
|
$,
|
|
2024
2013
|
{
|
|
2025
2014
|
onClick: () => t.chain().focus().redo().run(),
|
|
2026
|
-
disabled:
|
|
2015
|
+
disabled: d || !t.can().redo(),
|
|
2027
2016
|
title: "Redo (⌘⇧Z)",
|
|
2028
|
-
children: /* @__PURE__ */
|
|
2017
|
+
children: /* @__PURE__ */ a(De, { size: 16 })
|
|
2029
2018
|
}
|
|
2030
2019
|
)
|
|
2031
2020
|
] }),
|
|
2032
|
-
/* @__PURE__ */
|
|
2033
|
-
/* @__PURE__ */
|
|
2034
|
-
/* @__PURE__ */
|
|
2035
|
-
/* @__PURE__ */
|
|
2036
|
-
/* @__PURE__ */
|
|
2021
|
+
/* @__PURE__ */ a(ht, {}),
|
|
2022
|
+
/* @__PURE__ */ b(dt, { label: "File", children: [
|
|
2023
|
+
/* @__PURE__ */ b($, { onClick: pe, title: "Print / Export PDF (WYSIWYG)", children: [
|
|
2024
|
+
/* @__PURE__ */ a(Fe, { size: 16 }),
|
|
2025
|
+
/* @__PURE__ */ a("span", { className: "ribbon-btn-text", children: "PDF" })
|
|
2037
2026
|
] }),
|
|
2038
|
-
/* @__PURE__ */
|
|
2039
|
-
/* @__PURE__ */
|
|
2040
|
-
/* @__PURE__ */
|
|
2027
|
+
/* @__PURE__ */ b($, { onClick: fe, title: "Export HTML", children: [
|
|
2028
|
+
/* @__PURE__ */ a(je, { size: 16 }),
|
|
2029
|
+
/* @__PURE__ */ a("span", { className: "ribbon-btn-text", children: "HTML" })
|
|
2041
2030
|
] }),
|
|
2042
|
-
/* @__PURE__ */
|
|
2031
|
+
/* @__PURE__ */ a(
|
|
2043
2032
|
$,
|
|
2044
2033
|
{
|
|
2045
|
-
onClick: () =>
|
|
2046
|
-
active:
|
|
2034
|
+
onClick: () => q((u) => !u),
|
|
2035
|
+
active: K,
|
|
2047
2036
|
title: "Minimal ink mode (plain callouts when printing)",
|
|
2048
|
-
children: /* @__PURE__ */
|
|
2037
|
+
children: /* @__PURE__ */ a(We, { size: 16 })
|
|
2049
2038
|
}
|
|
2050
2039
|
),
|
|
2051
|
-
/* @__PURE__ */
|
|
2040
|
+
/* @__PURE__ */ a(
|
|
2052
2041
|
"select",
|
|
2053
2042
|
{
|
|
2054
2043
|
className: "ribbon-theme-select",
|
|
2055
2044
|
value: o,
|
|
2056
|
-
onChange: (
|
|
2045
|
+
onChange: (u) => l(u.target.value),
|
|
2057
2046
|
title: "Document theme (used by print/export)",
|
|
2058
|
-
children: ue.map((
|
|
2047
|
+
children: ue.map((u) => /* @__PURE__ */ a("option", { value: u, children: u.charAt(0).toUpperCase() + u.slice(1) }, u))
|
|
2059
2048
|
}
|
|
2060
2049
|
)
|
|
2061
2050
|
] }),
|
|
2062
|
-
/* @__PURE__ */
|
|
2063
|
-
/* @__PURE__ */
|
|
2064
|
-
/* @__PURE__ */
|
|
2065
|
-
/* @__PURE__ */
|
|
2066
|
-
/* @__PURE__ */
|
|
2051
|
+
/* @__PURE__ */ a(ht, {}),
|
|
2052
|
+
/* @__PURE__ */ b("div", { className: d ? "ribbon-locked" : "ribbon-editing", children: [
|
|
2053
|
+
/* @__PURE__ */ b(dt, { label: "Text", children: [
|
|
2054
|
+
/* @__PURE__ */ b("div", { className: "docs-tb-dropdown", ref: N, children: [
|
|
2055
|
+
/* @__PURE__ */ b(
|
|
2067
2056
|
"button",
|
|
2068
2057
|
{
|
|
2069
2058
|
className: "docs-tb-select docs-tb-font-select",
|
|
2070
2059
|
onClick: () => {
|
|
2071
|
-
|
|
2060
|
+
L(), k(!g);
|
|
2072
2061
|
},
|
|
2073
2062
|
children: [
|
|
2074
|
-
/* @__PURE__ */
|
|
2075
|
-
/* @__PURE__ */
|
|
2063
|
+
/* @__PURE__ */ a("span", { className: "docs-tb-select-label", children: ut() }),
|
|
2064
|
+
/* @__PURE__ */ a(yt, { size: 14 })
|
|
2076
2065
|
]
|
|
2077
2066
|
}
|
|
2078
2067
|
),
|
|
2079
|
-
|
|
2068
|
+
g && /* @__PURE__ */ a("div", { className: "docs-tb-dropdown-menu docs-font-menu", children: Jt.map((u) => /* @__PURE__ */ a(
|
|
2080
2069
|
"button",
|
|
2081
2070
|
{
|
|
2082
|
-
className: `docs-tb-dropdown-item${ut() ===
|
|
2083
|
-
style: { fontFamily:
|
|
2071
|
+
className: `docs-tb-dropdown-item${ut() === u.label ? " active" : ""}`,
|
|
2072
|
+
style: { fontFamily: u.value || "inherit" },
|
|
2084
2073
|
onClick: () => {
|
|
2085
|
-
|
|
2074
|
+
u.value ? t.chain().focus().setFontFamily(u.value).run() : t.chain().focus().unsetFontFamily().run(), L();
|
|
2086
2075
|
},
|
|
2087
|
-
children:
|
|
2076
|
+
children: u.label
|
|
2088
2077
|
},
|
|
2089
|
-
|
|
2078
|
+
u.value || "default"
|
|
2090
2079
|
)) })
|
|
2091
2080
|
] }),
|
|
2092
|
-
/* @__PURE__ */
|
|
2093
|
-
/* @__PURE__ */
|
|
2094
|
-
/* @__PURE__ */
|
|
2095
|
-
/* @__PURE__ */
|
|
2081
|
+
/* @__PURE__ */ a($, { onClick: () => D(-1), title: "Decrease font size", children: /* @__PURE__ */ a(Ge, { size: 14 }) }),
|
|
2082
|
+
/* @__PURE__ */ a("span", { className: "docs-tb-fontsize", children: V }),
|
|
2083
|
+
/* @__PURE__ */ a($, { onClick: () => D(1), title: "Increase font size", children: /* @__PURE__ */ a(Bt, { size: 14 }) }),
|
|
2084
|
+
/* @__PURE__ */ a(
|
|
2096
2085
|
$,
|
|
2097
2086
|
{
|
|
2098
2087
|
onClick: () => t.chain().focus().toggleBold().run(),
|
|
2099
2088
|
active: t.isActive("bold"),
|
|
2100
2089
|
title: "Bold (⌘B)",
|
|
2101
|
-
children: /* @__PURE__ */
|
|
2090
|
+
children: /* @__PURE__ */ a(Ue, { size: 16 })
|
|
2102
2091
|
}
|
|
2103
2092
|
),
|
|
2104
|
-
/* @__PURE__ */
|
|
2093
|
+
/* @__PURE__ */ a(
|
|
2105
2094
|
$,
|
|
2106
2095
|
{
|
|
2107
2096
|
onClick: () => t.chain().focus().toggleItalic().run(),
|
|
2108
2097
|
active: t.isActive("italic"),
|
|
2109
2098
|
title: "Italic (⌘I)",
|
|
2110
|
-
children: /* @__PURE__ */
|
|
2099
|
+
children: /* @__PURE__ */ a(Ye, { size: 16 })
|
|
2111
2100
|
}
|
|
2112
2101
|
),
|
|
2113
|
-
/* @__PURE__ */
|
|
2102
|
+
/* @__PURE__ */ a(
|
|
2114
2103
|
$,
|
|
2115
2104
|
{
|
|
2116
2105
|
onClick: () => t.chain().focus().toggleUnderline().run(),
|
|
2117
2106
|
active: t.isActive("underline"),
|
|
2118
2107
|
title: "Underline (⌘U)",
|
|
2119
|
-
children: /* @__PURE__ */
|
|
2108
|
+
children: /* @__PURE__ */ a(Ke, { size: 16 })
|
|
2120
2109
|
}
|
|
2121
2110
|
),
|
|
2122
|
-
/* @__PURE__ */
|
|
2111
|
+
/* @__PURE__ */ a(
|
|
2123
2112
|
$,
|
|
2124
2113
|
{
|
|
2125
2114
|
onClick: () => t.chain().focus().toggleStrike().run(),
|
|
2126
2115
|
active: t.isActive("strike"),
|
|
2127
2116
|
title: "Strikethrough (⌘⇧X)",
|
|
2128
|
-
children: /* @__PURE__ */
|
|
2117
|
+
children: /* @__PURE__ */ a(qe, { size: 16 })
|
|
2129
2118
|
}
|
|
2130
2119
|
),
|
|
2131
|
-
/* @__PURE__ */
|
|
2120
|
+
/* @__PURE__ */ b(
|
|
2132
2121
|
"div",
|
|
2133
2122
|
{
|
|
2134
2123
|
className: "docs-tb-dropdown docs-tb-color-dropdown",
|
|
2135
2124
|
ref: H,
|
|
2136
2125
|
children: [
|
|
2137
|
-
/* @__PURE__ */
|
|
2126
|
+
/* @__PURE__ */ b(
|
|
2138
2127
|
"button",
|
|
2139
2128
|
{
|
|
2140
2129
|
className: "docs-tb-btn docs-tb-color-btn",
|
|
2141
2130
|
onClick: () => {
|
|
2142
|
-
|
|
2131
|
+
L(), C(!M);
|
|
2143
2132
|
},
|
|
2144
2133
|
title: "Text color",
|
|
2145
2134
|
children: [
|
|
2146
|
-
/* @__PURE__ */
|
|
2147
|
-
/* @__PURE__ */
|
|
2135
|
+
/* @__PURE__ */ a(Je, { size: 16 }),
|
|
2136
|
+
/* @__PURE__ */ a(
|
|
2148
2137
|
"span",
|
|
2149
2138
|
{
|
|
2150
2139
|
className: "docs-tb-color-indicator",
|
|
@@ -2156,29 +2145,29 @@ function yr({
|
|
|
2156
2145
|
]
|
|
2157
2146
|
}
|
|
2158
2147
|
),
|
|
2159
|
-
|
|
2160
|
-
/* @__PURE__ */
|
|
2161
|
-
/* @__PURE__ */
|
|
2148
|
+
M && /* @__PURE__ */ b("div", { className: "docs-tb-dropdown-menu docs-color-grid-menu", children: [
|
|
2149
|
+
/* @__PURE__ */ a("div", { className: "docs-color-grid-label", children: "Text color" }),
|
|
2150
|
+
/* @__PURE__ */ a("div", { className: "docs-color-grid", children: hr.map((u) => /* @__PURE__ */ a(
|
|
2162
2151
|
"button",
|
|
2163
2152
|
{
|
|
2164
2153
|
className: "docs-color-swatch",
|
|
2165
|
-
style: { background:
|
|
2166
|
-
title:
|
|
2154
|
+
style: { background: u },
|
|
2155
|
+
title: u,
|
|
2167
2156
|
onClick: () => {
|
|
2168
|
-
t.chain().focus().setColor(
|
|
2157
|
+
t.chain().focus().setColor(u).run(), L();
|
|
2169
2158
|
}
|
|
2170
2159
|
},
|
|
2171
|
-
|
|
2160
|
+
u
|
|
2172
2161
|
)) }),
|
|
2173
|
-
/* @__PURE__ */
|
|
2162
|
+
/* @__PURE__ */ b(
|
|
2174
2163
|
"button",
|
|
2175
2164
|
{
|
|
2176
2165
|
className: "docs-tb-dropdown-item",
|
|
2177
2166
|
onClick: () => {
|
|
2178
|
-
t.chain().focus().unsetColor().run(),
|
|
2167
|
+
t.chain().focus().unsetColor().run(), L();
|
|
2179
2168
|
},
|
|
2180
2169
|
children: [
|
|
2181
|
-
/* @__PURE__ */
|
|
2170
|
+
/* @__PURE__ */ a(It, { size: 14 }),
|
|
2182
2171
|
" Reset"
|
|
2183
2172
|
]
|
|
2184
2173
|
}
|
|
@@ -2187,23 +2176,23 @@ function yr({
|
|
|
2187
2176
|
]
|
|
2188
2177
|
}
|
|
2189
2178
|
),
|
|
2190
|
-
/* @__PURE__ */
|
|
2179
|
+
/* @__PURE__ */ b(
|
|
2191
2180
|
"div",
|
|
2192
2181
|
{
|
|
2193
2182
|
className: "docs-tb-dropdown docs-tb-color-dropdown",
|
|
2194
2183
|
ref: ot,
|
|
2195
2184
|
children: [
|
|
2196
|
-
/* @__PURE__ */
|
|
2185
|
+
/* @__PURE__ */ b(
|
|
2197
2186
|
"button",
|
|
2198
2187
|
{
|
|
2199
2188
|
className: "docs-tb-btn docs-tb-color-btn",
|
|
2200
2189
|
onClick: () => {
|
|
2201
|
-
|
|
2190
|
+
L(), w(!v);
|
|
2202
2191
|
},
|
|
2203
2192
|
title: "Highlight color",
|
|
2204
2193
|
children: [
|
|
2205
|
-
/* @__PURE__ */
|
|
2206
|
-
/* @__PURE__ */
|
|
2194
|
+
/* @__PURE__ */ a(Ve, { size: 16 }),
|
|
2195
|
+
/* @__PURE__ */ a(
|
|
2207
2196
|
"span",
|
|
2208
2197
|
{
|
|
2209
2198
|
className: "docs-tb-color-indicator",
|
|
@@ -2215,135 +2204,117 @@ function yr({
|
|
|
2215
2204
|
]
|
|
2216
2205
|
}
|
|
2217
2206
|
),
|
|
2218
|
-
|
|
2219
|
-
/* @__PURE__ */
|
|
2220
|
-
/* @__PURE__ */
|
|
2207
|
+
v && /* @__PURE__ */ b("div", { className: "docs-tb-dropdown-menu docs-color-grid-menu", children: [
|
|
2208
|
+
/* @__PURE__ */ a("div", { className: "docs-color-grid-label", children: "Highlight color" }),
|
|
2209
|
+
/* @__PURE__ */ a("div", { className: "docs-color-grid docs-highlight-grid", children: mr.map((u) => /* @__PURE__ */ a(
|
|
2221
2210
|
"button",
|
|
2222
2211
|
{
|
|
2223
2212
|
className: "docs-color-swatch",
|
|
2224
|
-
style: { background:
|
|
2225
|
-
title:
|
|
2213
|
+
style: { background: u },
|
|
2214
|
+
title: u,
|
|
2226
2215
|
onClick: () => {
|
|
2227
|
-
|
|
2216
|
+
u === "#ffffff" ? t.chain().focus().unsetHighlight().run() : t.chain().focus().toggleHighlight({ color: u }).run(), L();
|
|
2228
2217
|
}
|
|
2229
2218
|
},
|
|
2230
|
-
|
|
2219
|
+
u
|
|
2231
2220
|
)) })
|
|
2232
2221
|
] })
|
|
2233
2222
|
]
|
|
2234
2223
|
}
|
|
2235
2224
|
),
|
|
2236
|
-
/* @__PURE__ */
|
|
2237
|
-
$,
|
|
2238
|
-
{
|
|
2239
|
-
onClick: () => t.chain().focus().toggleSubscript().run(),
|
|
2240
|
-
active: t.isActive("subscript"),
|
|
2241
|
-
title: "Subscript",
|
|
2242
|
-
children: /* @__PURE__ */ i(Qe, { size: 16 })
|
|
2243
|
-
}
|
|
2244
|
-
),
|
|
2245
|
-
/* @__PURE__ */ i(
|
|
2246
|
-
$,
|
|
2247
|
-
{
|
|
2248
|
-
onClick: () => t.chain().focus().toggleSuperscript().run(),
|
|
2249
|
-
active: t.isActive("superscript"),
|
|
2250
|
-
title: "Superscript",
|
|
2251
|
-
children: /* @__PURE__ */ i(Ze, { size: 16 })
|
|
2252
|
-
}
|
|
2253
|
-
),
|
|
2254
|
-
/* @__PURE__ */ i(
|
|
2225
|
+
/* @__PURE__ */ a(
|
|
2255
2226
|
$,
|
|
2256
2227
|
{
|
|
2257
2228
|
onClick: () => t.chain().focus().toggleCode().run(),
|
|
2258
2229
|
active: t.isActive("code"),
|
|
2259
2230
|
title: "Inline code",
|
|
2260
|
-
children: /* @__PURE__ */
|
|
2231
|
+
children: /* @__PURE__ */ a(Qe, { size: 16 })
|
|
2261
2232
|
}
|
|
2262
2233
|
),
|
|
2263
|
-
/* @__PURE__ */
|
|
2234
|
+
/* @__PURE__ */ a(
|
|
2264
2235
|
$,
|
|
2265
2236
|
{
|
|
2266
2237
|
onClick: () => t.chain().focus().unsetAllMarks().clearNodes().run(),
|
|
2267
2238
|
title: "Clear formatting",
|
|
2268
|
-
children: /* @__PURE__ */
|
|
2239
|
+
children: /* @__PURE__ */ a(It, { size: 16 })
|
|
2269
2240
|
}
|
|
2270
2241
|
)
|
|
2271
2242
|
] }),
|
|
2272
|
-
/* @__PURE__ */
|
|
2273
|
-
/* @__PURE__ */
|
|
2274
|
-
/* @__PURE__ */
|
|
2275
|
-
/* @__PURE__ */
|
|
2243
|
+
/* @__PURE__ */ a(ht, {}),
|
|
2244
|
+
/* @__PURE__ */ b(dt, { label: "Paragraph", children: [
|
|
2245
|
+
/* @__PURE__ */ b("div", { className: "docs-tb-dropdown", ref: W, children: [
|
|
2246
|
+
/* @__PURE__ */ b(
|
|
2276
2247
|
"button",
|
|
2277
2248
|
{
|
|
2278
2249
|
className: "docs-tb-select docs-tb-paragraph-select",
|
|
2279
2250
|
onClick: () => {
|
|
2280
|
-
|
|
2251
|
+
L(), f(!s);
|
|
2281
2252
|
},
|
|
2282
2253
|
children: [
|
|
2283
|
-
/* @__PURE__ */
|
|
2284
|
-
/* @__PURE__ */
|
|
2254
|
+
/* @__PURE__ */ a("span", { className: "docs-tb-select-label", children: st() }),
|
|
2255
|
+
/* @__PURE__ */ a(yt, { size: 14 })
|
|
2285
2256
|
]
|
|
2286
2257
|
}
|
|
2287
2258
|
),
|
|
2288
|
-
|
|
2259
|
+
s && /* @__PURE__ */ a("div", { className: "docs-tb-dropdown-menu docs-style-menu", children: At.map((u) => /* @__PURE__ */ a(
|
|
2289
2260
|
"button",
|
|
2290
2261
|
{
|
|
2291
|
-
className: `docs-tb-dropdown-item${st() ===
|
|
2292
|
-
onClick: () => y(
|
|
2293
|
-
children: /* @__PURE__ */
|
|
2262
|
+
className: `docs-tb-dropdown-item${st() === u.label ? " active" : ""}`,
|
|
2263
|
+
onClick: () => y(u.node),
|
|
2264
|
+
children: /* @__PURE__ */ a(
|
|
2294
2265
|
"span",
|
|
2295
2266
|
{
|
|
2296
|
-
className: `docs-style-preview docs-style-${
|
|
2297
|
-
children:
|
|
2267
|
+
className: `docs-style-preview docs-style-${u.node}`,
|
|
2268
|
+
children: u.label
|
|
2298
2269
|
}
|
|
2299
2270
|
)
|
|
2300
2271
|
},
|
|
2301
|
-
|
|
2272
|
+
u.node
|
|
2302
2273
|
)) })
|
|
2303
2274
|
] }),
|
|
2304
|
-
/* @__PURE__ */
|
|
2275
|
+
/* @__PURE__ */ a(
|
|
2305
2276
|
$,
|
|
2306
2277
|
{
|
|
2307
2278
|
onClick: () => t.chain().focus().setTextAlign("left").run(),
|
|
2308
2279
|
active: t.isActive({ textAlign: "left" }),
|
|
2309
2280
|
title: "Align left",
|
|
2310
|
-
children: /* @__PURE__ */
|
|
2281
|
+
children: /* @__PURE__ */ a(Ze, { size: 16 })
|
|
2311
2282
|
}
|
|
2312
2283
|
),
|
|
2313
|
-
/* @__PURE__ */
|
|
2284
|
+
/* @__PURE__ */ a(
|
|
2314
2285
|
$,
|
|
2315
2286
|
{
|
|
2316
2287
|
onClick: () => t.chain().focus().setTextAlign("center").run(),
|
|
2317
2288
|
active: t.isActive({ textAlign: "center" }),
|
|
2318
2289
|
title: "Align center",
|
|
2319
|
-
children: /* @__PURE__ */
|
|
2290
|
+
children: /* @__PURE__ */ a(Xe, { size: 16 })
|
|
2320
2291
|
}
|
|
2321
2292
|
),
|
|
2322
|
-
/* @__PURE__ */
|
|
2293
|
+
/* @__PURE__ */ a(
|
|
2323
2294
|
$,
|
|
2324
2295
|
{
|
|
2325
2296
|
onClick: () => t.chain().focus().setTextAlign("right").run(),
|
|
2326
2297
|
active: t.isActive({ textAlign: "right" }),
|
|
2327
2298
|
title: "Align right",
|
|
2328
|
-
children: /* @__PURE__ */
|
|
2299
|
+
children: /* @__PURE__ */ a(tn, { size: 16 })
|
|
2329
2300
|
}
|
|
2330
2301
|
),
|
|
2331
|
-
/* @__PURE__ */
|
|
2302
|
+
/* @__PURE__ */ a(
|
|
2332
2303
|
$,
|
|
2333
2304
|
{
|
|
2334
2305
|
onClick: () => t.chain().focus().setTextAlign("justify").run(),
|
|
2335
2306
|
active: t.isActive({ textAlign: "justify" }),
|
|
2336
2307
|
title: "Justify",
|
|
2337
|
-
children: /* @__PURE__ */
|
|
2308
|
+
children: /* @__PURE__ */ a(en, { size: 16 })
|
|
2338
2309
|
}
|
|
2339
2310
|
),
|
|
2340
|
-
/* @__PURE__ */
|
|
2311
|
+
/* @__PURE__ */ a(
|
|
2341
2312
|
$,
|
|
2342
2313
|
{
|
|
2343
2314
|
onClick: () => n?.(),
|
|
2344
2315
|
active: e,
|
|
2345
2316
|
title: e ? "Switch to LTR (left-to-right)" : "Switch to RTL (right-to-left)",
|
|
2346
|
-
children: /* @__PURE__ */
|
|
2317
|
+
children: /* @__PURE__ */ a(
|
|
2347
2318
|
"span",
|
|
2348
2319
|
{
|
|
2349
2320
|
style: {
|
|
@@ -2357,59 +2328,59 @@ function yr({
|
|
|
2357
2328
|
)
|
|
2358
2329
|
}
|
|
2359
2330
|
),
|
|
2360
|
-
/* @__PURE__ */
|
|
2361
|
-
/* @__PURE__ */
|
|
2331
|
+
/* @__PURE__ */ b("div", { className: "docs-tb-dropdown", ref: G, children: [
|
|
2332
|
+
/* @__PURE__ */ b(
|
|
2362
2333
|
"button",
|
|
2363
2334
|
{
|
|
2364
2335
|
className: `docs-tb-btn${Tt ? " active" : ""}`,
|
|
2365
2336
|
onClick: () => {
|
|
2366
|
-
|
|
2337
|
+
L(), O(!I);
|
|
2367
2338
|
},
|
|
2368
2339
|
title: "Line & paragraph spacing",
|
|
2369
2340
|
children: [
|
|
2370
|
-
/* @__PURE__ */
|
|
2371
|
-
/* @__PURE__ */
|
|
2341
|
+
/* @__PURE__ */ a(nn, { size: 16 }),
|
|
2342
|
+
/* @__PURE__ */ a(yt, { size: 12 })
|
|
2372
2343
|
]
|
|
2373
2344
|
}
|
|
2374
2345
|
),
|
|
2375
|
-
|
|
2376
|
-
/* @__PURE__ */
|
|
2377
|
-
/* @__PURE__ */
|
|
2346
|
+
I && /* @__PURE__ */ b("div", { className: "docs-tb-dropdown-menu docs-spacing-menu", children: [
|
|
2347
|
+
/* @__PURE__ */ a("div", { className: "docs-insert-category", children: "Line spacing" }),
|
|
2348
|
+
/* @__PURE__ */ a(
|
|
2378
2349
|
"button",
|
|
2379
2350
|
{
|
|
2380
2351
|
className: `docs-tb-dropdown-item${Tt ? "" : " active"}`,
|
|
2381
|
-
onClick: () =>
|
|
2352
|
+
onClick: () => Q(null),
|
|
2382
2353
|
children: "Default"
|
|
2383
2354
|
}
|
|
2384
2355
|
),
|
|
2385
|
-
|
|
2356
|
+
fr.map((u) => /* @__PURE__ */ a(
|
|
2386
2357
|
"button",
|
|
2387
2358
|
{
|
|
2388
|
-
className: `docs-tb-dropdown-item${Tt ===
|
|
2389
|
-
onClick: () =>
|
|
2390
|
-
children:
|
|
2359
|
+
className: `docs-tb-dropdown-item${Tt === u ? " active" : ""}`,
|
|
2360
|
+
onClick: () => Q(u),
|
|
2361
|
+
children: u === "1" ? "Single" : u === "2" ? "Double" : u
|
|
2391
2362
|
},
|
|
2392
|
-
|
|
2363
|
+
u
|
|
2393
2364
|
)),
|
|
2394
|
-
/* @__PURE__ */
|
|
2395
|
-
/* @__PURE__ */
|
|
2396
|
-
/* @__PURE__ */
|
|
2365
|
+
/* @__PURE__ */ a("div", { className: "docs-insert-divider" }),
|
|
2366
|
+
/* @__PURE__ */ a("div", { className: "docs-insert-category", children: "Paragraph spacing" }),
|
|
2367
|
+
/* @__PURE__ */ a(
|
|
2397
2368
|
"button",
|
|
2398
2369
|
{
|
|
2399
2370
|
className: "docs-tb-dropdown-item",
|
|
2400
|
-
onClick: () =>
|
|
2401
|
-
children:
|
|
2371
|
+
onClick: () => U("space-before"),
|
|
2372
|
+
children: X(t, "space-before") ? "Remove space before block" : "Add space before block"
|
|
2402
2373
|
}
|
|
2403
2374
|
),
|
|
2404
|
-
/* @__PURE__ */
|
|
2375
|
+
/* @__PURE__ */ a(
|
|
2405
2376
|
"button",
|
|
2406
2377
|
{
|
|
2407
2378
|
className: "docs-tb-dropdown-item",
|
|
2408
|
-
onClick: () =>
|
|
2409
|
-
children:
|
|
2379
|
+
onClick: () => U("space-after"),
|
|
2380
|
+
children: X(t, "space-after") ? "Remove space after block" : "Add space after block"
|
|
2410
2381
|
}
|
|
2411
2382
|
),
|
|
2412
|
-
/* @__PURE__ */
|
|
2383
|
+
/* @__PURE__ */ a(
|
|
2413
2384
|
"button",
|
|
2414
2385
|
{
|
|
2415
2386
|
className: "docs-tb-dropdown-item",
|
|
@@ -2419,123 +2390,123 @@ function yr({
|
|
|
2419
2390
|
)
|
|
2420
2391
|
] })
|
|
2421
2392
|
] }),
|
|
2422
|
-
/* @__PURE__ */
|
|
2393
|
+
/* @__PURE__ */ a(
|
|
2423
2394
|
$,
|
|
2424
2395
|
{
|
|
2425
2396
|
onClick: () => t.chain().focus().toggleBulletList().run(),
|
|
2426
2397
|
active: t.isActive("bulletList"),
|
|
2427
2398
|
title: "Bullet list",
|
|
2428
|
-
children: /* @__PURE__ */
|
|
2399
|
+
children: /* @__PURE__ */ a(rn, { size: 16 })
|
|
2429
2400
|
}
|
|
2430
2401
|
),
|
|
2431
|
-
/* @__PURE__ */
|
|
2402
|
+
/* @__PURE__ */ a(
|
|
2432
2403
|
$,
|
|
2433
2404
|
{
|
|
2434
2405
|
onClick: () => t.chain().focus().toggleOrderedList().run(),
|
|
2435
2406
|
active: t.isActive("orderedList"),
|
|
2436
2407
|
title: "Numbered list",
|
|
2437
|
-
children: /* @__PURE__ */
|
|
2408
|
+
children: /* @__PURE__ */ a(on, { size: 16 })
|
|
2438
2409
|
}
|
|
2439
2410
|
)
|
|
2440
2411
|
] }),
|
|
2441
|
-
/* @__PURE__ */
|
|
2442
|
-
/* @__PURE__ */
|
|
2443
|
-
/* @__PURE__ */
|
|
2444
|
-
/* @__PURE__ */
|
|
2412
|
+
/* @__PURE__ */ a(ht, {}),
|
|
2413
|
+
/* @__PURE__ */ b(dt, { label: "Insert", children: [
|
|
2414
|
+
/* @__PURE__ */ b("div", { className: "docs-tb-dropdown", ref: rt, children: [
|
|
2415
|
+
/* @__PURE__ */ b(
|
|
2445
2416
|
"button",
|
|
2446
2417
|
{
|
|
2447
2418
|
className: "docs-tb-select docs-tb-insert-select",
|
|
2448
2419
|
onClick: () => {
|
|
2449
|
-
|
|
2420
|
+
L(), h(!p);
|
|
2450
2421
|
},
|
|
2451
2422
|
children: [
|
|
2452
|
-
/* @__PURE__ */
|
|
2453
|
-
/* @__PURE__ */
|
|
2454
|
-
/* @__PURE__ */
|
|
2423
|
+
/* @__PURE__ */ a(Bt, { size: 15 }),
|
|
2424
|
+
/* @__PURE__ */ a("span", { children: "Insert" }),
|
|
2425
|
+
/* @__PURE__ */ a(yt, { size: 14 })
|
|
2455
2426
|
]
|
|
2456
2427
|
}
|
|
2457
2428
|
),
|
|
2458
|
-
p && /* @__PURE__ */
|
|
2459
|
-
/* @__PURE__ */
|
|
2429
|
+
p && /* @__PURE__ */ b("div", { className: "docs-tb-dropdown-menu docs-insert-menu", children: [
|
|
2430
|
+
/* @__PURE__ */ b(
|
|
2460
2431
|
"button",
|
|
2461
2432
|
{
|
|
2462
2433
|
className: "docs-tb-dropdown-item docs-insert-item",
|
|
2463
2434
|
onClick: de,
|
|
2464
2435
|
title: "Two-sided row — content at the line start, value at the line end (text: … | end: …)",
|
|
2465
2436
|
children: [
|
|
2466
|
-
/* @__PURE__ */
|
|
2467
|
-
/* @__PURE__ */
|
|
2468
|
-
/* @__PURE__ */
|
|
2437
|
+
/* @__PURE__ */ a("span", { className: "docs-insert-icon", children: /* @__PURE__ */ a(Ot, { size: 13 }) }),
|
|
2438
|
+
/* @__PURE__ */ a("span", { className: "docs-insert-label", children: "two-sided row" }),
|
|
2439
|
+
/* @__PURE__ */ a("span", { className: "docs-insert-kw", children: "end:" })
|
|
2469
2440
|
]
|
|
2470
2441
|
}
|
|
2471
2442
|
),
|
|
2472
|
-
/* @__PURE__ */
|
|
2473
|
-
m.map((
|
|
2474
|
-
|
|
2475
|
-
/* @__PURE__ */
|
|
2476
|
-
|
|
2443
|
+
/* @__PURE__ */ a("div", { className: "docs-insert-divider" }),
|
|
2444
|
+
m.map((u, x) => /* @__PURE__ */ b("div", { children: [
|
|
2445
|
+
x > 0 && /* @__PURE__ */ a("div", { className: "docs-insert-divider" }),
|
|
2446
|
+
/* @__PURE__ */ a("div", { className: "docs-insert-category", children: u.category }),
|
|
2447
|
+
u.items.map((S) => /* @__PURE__ */ b(
|
|
2477
2448
|
"button",
|
|
2478
2449
|
{
|
|
2479
2450
|
className: "docs-tb-dropdown-item docs-insert-item",
|
|
2480
|
-
onClick: () =>
|
|
2481
|
-
disabled:
|
|
2482
|
-
title:
|
|
2451
|
+
onClick: () => T(S.keyword),
|
|
2452
|
+
disabled: S.isReadOnly,
|
|
2453
|
+
title: S.description,
|
|
2483
2454
|
children: [
|
|
2484
|
-
/* @__PURE__ */
|
|
2485
|
-
/* @__PURE__ */
|
|
2486
|
-
/* @__PURE__ */
|
|
2455
|
+
/* @__PURE__ */ a("span", { className: "docs-insert-icon", children: Kt[S.category]?.icon || "•" }),
|
|
2456
|
+
/* @__PURE__ */ a("span", { className: "docs-insert-label", children: S.label }),
|
|
2457
|
+
/* @__PURE__ */ a("span", { className: "docs-insert-kw", children: S.isReadOnly ? "locked" : `.${S.keyword}` })
|
|
2487
2458
|
]
|
|
2488
2459
|
},
|
|
2489
|
-
|
|
2460
|
+
S.keyword
|
|
2490
2461
|
))
|
|
2491
|
-
] },
|
|
2462
|
+
] }, u.category))
|
|
2492
2463
|
] })
|
|
2493
2464
|
] }),
|
|
2494
|
-
/* @__PURE__ */
|
|
2465
|
+
/* @__PURE__ */ a(
|
|
2495
2466
|
$,
|
|
2496
2467
|
{
|
|
2497
2468
|
onClick: le,
|
|
2498
2469
|
active: ge,
|
|
2499
2470
|
title: "Two-sided row — set the text shown at the END of this line (end: property)",
|
|
2500
|
-
children: /* @__PURE__ */
|
|
2471
|
+
children: /* @__PURE__ */ a(Ot, { size: 16 })
|
|
2501
2472
|
}
|
|
2502
2473
|
)
|
|
2503
2474
|
] })
|
|
2504
2475
|
] }),
|
|
2505
|
-
|
|
2506
|
-
/* @__PURE__ */
|
|
2507
|
-
/* @__PURE__ */
|
|
2508
|
-
/* @__PURE__ */
|
|
2476
|
+
c && /* @__PURE__ */ b(me, { children: [
|
|
2477
|
+
/* @__PURE__ */ a(ht, {}),
|
|
2478
|
+
/* @__PURE__ */ b(dt, { label: "Trust", children: [
|
|
2479
|
+
/* @__PURE__ */ b(
|
|
2509
2480
|
$,
|
|
2510
2481
|
{
|
|
2511
|
-
onClick: () =>
|
|
2512
|
-
disabled:
|
|
2513
|
-
title:
|
|
2482
|
+
onClick: () => c("seal"),
|
|
2483
|
+
disabled: d,
|
|
2484
|
+
title: d ? "Document is already sealed" : "Seal — freeze the document with a tamper-evident hash",
|
|
2514
2485
|
children: [
|
|
2515
|
-
/* @__PURE__ */
|
|
2516
|
-
/* @__PURE__ */
|
|
2486
|
+
/* @__PURE__ */ a(sn, { size: 16 }),
|
|
2487
|
+
/* @__PURE__ */ a("span", { className: "ribbon-btn-text", children: "Seal" })
|
|
2517
2488
|
]
|
|
2518
2489
|
}
|
|
2519
2490
|
),
|
|
2520
|
-
/* @__PURE__ */
|
|
2491
|
+
/* @__PURE__ */ b(
|
|
2521
2492
|
$,
|
|
2522
2493
|
{
|
|
2523
|
-
onClick: () =>
|
|
2494
|
+
onClick: () => c("sign"),
|
|
2524
2495
|
title: "Sign — add a signature",
|
|
2525
2496
|
children: [
|
|
2526
|
-
/* @__PURE__ */
|
|
2527
|
-
/* @__PURE__ */
|
|
2497
|
+
/* @__PURE__ */ a(an, { size: 16 }),
|
|
2498
|
+
/* @__PURE__ */ a("span", { className: "ribbon-btn-text", children: "Sign" })
|
|
2528
2499
|
]
|
|
2529
2500
|
}
|
|
2530
2501
|
),
|
|
2531
|
-
/* @__PURE__ */
|
|
2502
|
+
/* @__PURE__ */ b(
|
|
2532
2503
|
$,
|
|
2533
2504
|
{
|
|
2534
|
-
onClick: () =>
|
|
2505
|
+
onClick: () => c("verify"),
|
|
2535
2506
|
title: "Verify — check the document hash and signatures",
|
|
2536
2507
|
children: [
|
|
2537
|
-
/* @__PURE__ */
|
|
2538
|
-
/* @__PURE__ */
|
|
2508
|
+
/* @__PURE__ */ a(cn, { size: 16 }),
|
|
2509
|
+
/* @__PURE__ */ a("span", { className: "ribbon-btn-text", children: "Verify" })
|
|
2539
2510
|
]
|
|
2540
2511
|
}
|
|
2541
2512
|
)
|
|
@@ -2543,65 +2514,128 @@ function yr({
|
|
|
2543
2514
|
] })
|
|
2544
2515
|
] });
|
|
2545
2516
|
}
|
|
2546
|
-
|
|
2517
|
+
const yr = { in: 96, cm: 96 / 2.54 }, kr = { in: 0.25, cm: 0.5 };
|
|
2518
|
+
function Sr({ geometry: t, zoom: e, scrollEl: n }) {
|
|
2519
|
+
const [r, o] = P(0);
|
|
2520
|
+
j(() => {
|
|
2521
|
+
const d = n.current;
|
|
2522
|
+
if (!d) return;
|
|
2523
|
+
const s = () => o(d.scrollLeft);
|
|
2524
|
+
return s(), d.addEventListener("scroll", s, { passive: !0 }), () => d.removeEventListener("scroll", s);
|
|
2525
|
+
}, [n]);
|
|
2526
|
+
const l = Y(() => {
|
|
2527
|
+
const d = yr[t.unit], s = kr[t.unit], f = [], p = t.width / d;
|
|
2528
|
+
for (let h = 0; h <= p + 1e-6; h += s) {
|
|
2529
|
+
const g = Math.abs(h - Math.round(h)) < 1e-6;
|
|
2530
|
+
f.push({
|
|
2531
|
+
x: h * d,
|
|
2532
|
+
kind: g ? "major" : "minor",
|
|
2533
|
+
label: g && h > 0 ? String(Math.round(h)) : void 0
|
|
2534
|
+
});
|
|
2535
|
+
}
|
|
2536
|
+
return f;
|
|
2537
|
+
}, [t.width, t.unit]), c = t.width * e;
|
|
2538
|
+
return /* @__PURE__ */ a("div", { className: "docs-ruler", "aria-hidden": "true", children: /* @__PURE__ */ b(
|
|
2539
|
+
"div",
|
|
2540
|
+
{
|
|
2541
|
+
className: "docs-ruler-track",
|
|
2542
|
+
style: { width: c, transform: `translateX(${-r}px)` },
|
|
2543
|
+
children: [
|
|
2544
|
+
/* @__PURE__ */ a(
|
|
2545
|
+
"div",
|
|
2546
|
+
{
|
|
2547
|
+
className: "docs-ruler-margin",
|
|
2548
|
+
style: { left: 0, width: t.marginLeft * e }
|
|
2549
|
+
}
|
|
2550
|
+
),
|
|
2551
|
+
/* @__PURE__ */ a(
|
|
2552
|
+
"div",
|
|
2553
|
+
{
|
|
2554
|
+
className: "docs-ruler-margin",
|
|
2555
|
+
style: { right: 0, width: t.marginRight * e }
|
|
2556
|
+
}
|
|
2557
|
+
),
|
|
2558
|
+
l.map(
|
|
2559
|
+
(d, s) => d.label ? /* @__PURE__ */ a(
|
|
2560
|
+
"span",
|
|
2561
|
+
{
|
|
2562
|
+
className: "docs-ruler-num",
|
|
2563
|
+
style: { left: d.x * e },
|
|
2564
|
+
children: d.label
|
|
2565
|
+
},
|
|
2566
|
+
s
|
|
2567
|
+
) : /* @__PURE__ */ a(
|
|
2568
|
+
"span",
|
|
2569
|
+
{
|
|
2570
|
+
className: `docs-ruler-tick docs-ruler-tick--${d.kind}`,
|
|
2571
|
+
style: { left: d.x * e }
|
|
2572
|
+
},
|
|
2573
|
+
s
|
|
2574
|
+
)
|
|
2575
|
+
)
|
|
2576
|
+
]
|
|
2577
|
+
}
|
|
2578
|
+
) });
|
|
2579
|
+
}
|
|
2580
|
+
function Ct(t, e) {
|
|
2547
2581
|
return e ? `${t} (${e})` : t;
|
|
2548
2582
|
}
|
|
2549
|
-
function
|
|
2583
|
+
function wr({ trust: t, intact: e }) {
|
|
2550
2584
|
if (t.isSealed) {
|
|
2551
2585
|
const n = t.sealedBy || "unknown", r = t.signatures[t.signatures.length - 1]?.role;
|
|
2552
|
-
return /* @__PURE__ */
|
|
2553
|
-
/* @__PURE__ */
|
|
2554
|
-
/* @__PURE__ */
|
|
2555
|
-
/* @__PURE__ */
|
|
2586
|
+
return /* @__PURE__ */ b("div", { className: "docs-trust-banner docs-trust-banner--sealed", role: "status", children: [
|
|
2587
|
+
/* @__PURE__ */ a("span", { className: "docs-trust-banner__icon", children: "🔒" }),
|
|
2588
|
+
/* @__PURE__ */ a("span", { className: "docs-trust-banner__title", children: "Sealed" }),
|
|
2589
|
+
/* @__PURE__ */ b("span", { className: "docs-trust-banner__text", children: [
|
|
2556
2590
|
"signed by ",
|
|
2557
|
-
|
|
2591
|
+
Ct(n, r),
|
|
2558
2592
|
t.sealedAt ? ` on ${t.sealedAt}` : "",
|
|
2559
2593
|
" · read-only"
|
|
2560
2594
|
] }),
|
|
2561
|
-
e === !0 && /* @__PURE__ */
|
|
2562
|
-
e === !1 && /* @__PURE__ */
|
|
2595
|
+
e === !0 && /* @__PURE__ */ a("span", { className: "docs-trust-banner__verify docs-trust-banner__verify--ok", children: "hash verified ✓" }),
|
|
2596
|
+
e === !1 && /* @__PURE__ */ a("span", { className: "docs-trust-banner__verify docs-trust-banner__verify--bad", children: "⚠ hash mismatch — content changed after sealing" })
|
|
2563
2597
|
] });
|
|
2564
2598
|
}
|
|
2565
|
-
return t.signatures.length > 0 ? /* @__PURE__ */
|
|
2566
|
-
/* @__PURE__ */
|
|
2567
|
-
/* @__PURE__ */
|
|
2568
|
-
/* @__PURE__ */
|
|
2599
|
+
return t.signatures.length > 0 ? /* @__PURE__ */ b("div", { className: "docs-trust-banner docs-trust-banner--signed", role: "status", children: [
|
|
2600
|
+
/* @__PURE__ */ a("span", { className: "docs-trust-banner__icon", children: "✍" }),
|
|
2601
|
+
/* @__PURE__ */ a("span", { className: "docs-trust-banner__title", children: "Signed" }),
|
|
2602
|
+
/* @__PURE__ */ b("span", { className: "docs-trust-banner__text", children: [
|
|
2569
2603
|
"by",
|
|
2570
2604
|
" ",
|
|
2571
|
-
t.signatures.map((n) => `${
|
|
2605
|
+
t.signatures.map((n) => `${Ct(n.by, n.role)}${n.at ? ` on ${n.at}` : ""}`).join(" · ")
|
|
2572
2606
|
] })
|
|
2573
|
-
] }) : t.approvals.length > 0 ? /* @__PURE__ */
|
|
2607
|
+
] }) : t.approvals.length > 0 ? /* @__PURE__ */ b(
|
|
2574
2608
|
"div",
|
|
2575
2609
|
{
|
|
2576
2610
|
className: "docs-trust-banner docs-trust-banner--approved",
|
|
2577
2611
|
role: "status",
|
|
2578
2612
|
children: [
|
|
2579
|
-
/* @__PURE__ */
|
|
2580
|
-
/* @__PURE__ */
|
|
2581
|
-
/* @__PURE__ */
|
|
2613
|
+
/* @__PURE__ */ a("span", { className: "docs-trust-banner__icon", children: "✓" }),
|
|
2614
|
+
/* @__PURE__ */ a("span", { className: "docs-trust-banner__title", children: "Approved" }),
|
|
2615
|
+
/* @__PURE__ */ b("span", { className: "docs-trust-banner__text", children: [
|
|
2582
2616
|
"by",
|
|
2583
2617
|
" ",
|
|
2584
|
-
t.approvals.map((n) => `${
|
|
2618
|
+
t.approvals.map((n) => `${Ct(n.by, n.role)}${n.at ? ` on ${n.at}` : ""}`).join(" · ")
|
|
2585
2619
|
] })
|
|
2586
2620
|
]
|
|
2587
2621
|
}
|
|
2588
2622
|
) : null;
|
|
2589
2623
|
}
|
|
2590
|
-
function
|
|
2624
|
+
function vr(t) {
|
|
2591
2625
|
let e;
|
|
2592
2626
|
try {
|
|
2593
|
-
e =
|
|
2627
|
+
e = et(t);
|
|
2594
2628
|
} catch {
|
|
2595
2629
|
return [];
|
|
2596
2630
|
}
|
|
2597
2631
|
const n = [], r = (o, l) => {
|
|
2598
|
-
const
|
|
2599
|
-
|
|
2632
|
+
const c = l == null ? "" : String(l).trim();
|
|
2633
|
+
c && n.push({ key: o, value: c });
|
|
2600
2634
|
};
|
|
2601
2635
|
for (const o of e.blocks)
|
|
2602
2636
|
switch (o.type) {
|
|
2603
2637
|
case "meta":
|
|
2604
|
-
for (const [l,
|
|
2638
|
+
for (const [l, c] of Object.entries(o.properties || {})) r(l, c);
|
|
2605
2639
|
break;
|
|
2606
2640
|
case "track":
|
|
2607
2641
|
r("tracked", o.properties?.id ?? o.content);
|
|
@@ -2635,32 +2669,32 @@ function Sr(t) {
|
|
|
2635
2669
|
}
|
|
2636
2670
|
return n;
|
|
2637
2671
|
}
|
|
2638
|
-
function
|
|
2639
|
-
const [e, n] =
|
|
2672
|
+
function Tr({ source: t }) {
|
|
2673
|
+
const [e, n] = P(!1), r = Y(() => vr(t), [t]);
|
|
2640
2674
|
if (r.length === 0) return null;
|
|
2641
2675
|
const o = r.slice(0, 4).map((l) => `${l.key}: ${l.value}`).join(" · ");
|
|
2642
|
-
return /* @__PURE__ */
|
|
2643
|
-
/* @__PURE__ */
|
|
2676
|
+
return /* @__PURE__ */ b("div", { className: `docs-props-bar${e ? " open" : ""}`, children: [
|
|
2677
|
+
/* @__PURE__ */ b(
|
|
2644
2678
|
"button",
|
|
2645
2679
|
{
|
|
2646
2680
|
className: "docs-props-toggle",
|
|
2647
2681
|
onClick: () => n((l) => !l),
|
|
2648
2682
|
title: e ? "Hide document properties" : "Show document properties",
|
|
2649
2683
|
children: [
|
|
2650
|
-
/* @__PURE__ */
|
|
2684
|
+
/* @__PURE__ */ a("span", { className: "docs-props-caret", children: e ? "▾" : "▸" }),
|
|
2651
2685
|
"Document properties",
|
|
2652
|
-
!e && /* @__PURE__ */
|
|
2686
|
+
!e && /* @__PURE__ */ a("span", { className: "docs-props-summary", children: o })
|
|
2653
2687
|
]
|
|
2654
2688
|
}
|
|
2655
2689
|
),
|
|
2656
|
-
e && /* @__PURE__ */
|
|
2657
|
-
/* @__PURE__ */
|
|
2690
|
+
e && /* @__PURE__ */ a("div", { className: "docs-props-chips", children: r.map((l, c) => /* @__PURE__ */ b("span", { className: "docs-props-chip", children: [
|
|
2691
|
+
/* @__PURE__ */ a("b", { children: l.key }),
|
|
2658
2692
|
" ",
|
|
2659
2693
|
l.value
|
|
2660
|
-
] }, `${l.key}-${
|
|
2694
|
+
] }, `${l.key}-${c}`)) })
|
|
2661
2695
|
] });
|
|
2662
2696
|
}
|
|
2663
|
-
function
|
|
2697
|
+
function z(t, e, n = "") {
|
|
2664
2698
|
const r = t?.properties?.[e];
|
|
2665
2699
|
return r != null ? String(r) : n;
|
|
2666
2700
|
}
|
|
@@ -2678,44 +2712,44 @@ function Vt(t) {
|
|
|
2678
2712
|
amendments: []
|
|
2679
2713
|
};
|
|
2680
2714
|
if (!t) return e;
|
|
2681
|
-
const n = t.blocks, r = n.find((
|
|
2715
|
+
const n = t.blocks, r = n.find((s) => s.type === "track");
|
|
2682
2716
|
r && (e.isTracked = !0, e.lifecycle = "tracked", e.trackBlock = {
|
|
2683
|
-
id:
|
|
2684
|
-
by:
|
|
2685
|
-
at:
|
|
2717
|
+
id: z(r, "id", r.content ?? ""),
|
|
2718
|
+
by: z(r, "by"),
|
|
2719
|
+
at: z(r, "at")
|
|
2686
2720
|
});
|
|
2687
|
-
const o = n.filter((
|
|
2688
|
-
for (const
|
|
2721
|
+
const o = n.filter((s) => s.type === "approve");
|
|
2722
|
+
for (const s of o)
|
|
2689
2723
|
e.approvals.push({
|
|
2690
|
-
by:
|
|
2691
|
-
role:
|
|
2692
|
-
at:
|
|
2693
|
-
note:
|
|
2724
|
+
by: z(s, "by", s.content ?? ""),
|
|
2725
|
+
role: z(s, "role"),
|
|
2726
|
+
at: z(s, "at"),
|
|
2727
|
+
note: z(s, "note") || void 0
|
|
2694
2728
|
});
|
|
2695
2729
|
e.approvals.length > 0 && (e.lifecycle = "approved");
|
|
2696
|
-
const l = n.filter((
|
|
2697
|
-
for (const
|
|
2730
|
+
const l = n.filter((s) => s.type === "sign");
|
|
2731
|
+
for (const s of l)
|
|
2698
2732
|
e.signatures.push({
|
|
2699
|
-
by:
|
|
2700
|
-
role:
|
|
2701
|
-
at:
|
|
2733
|
+
by: z(s, "by", s.content ?? ""),
|
|
2734
|
+
role: z(s, "role"),
|
|
2735
|
+
at: z(s, "at")
|
|
2702
2736
|
});
|
|
2703
2737
|
e.signatures.length > 0 && (e.lifecycle = "signed");
|
|
2704
|
-
const
|
|
2705
|
-
if (
|
|
2738
|
+
const c = n.find((s) => s.type === "freeze");
|
|
2739
|
+
if (c) {
|
|
2706
2740
|
e.isSealed = !0, e.lifecycle = "sealed";
|
|
2707
|
-
const
|
|
2708
|
-
e.sealedBy =
|
|
2741
|
+
const s = e.signatures[e.signatures.length - 1];
|
|
2742
|
+
e.sealedBy = s?.by || z(c, "by", c.content ?? ""), e.sealedAt = z(c, "at") || s?.at || "", e.sealHash = z(c, "hash");
|
|
2709
2743
|
}
|
|
2710
|
-
const
|
|
2711
|
-
for (const
|
|
2744
|
+
const d = n.filter((s) => s.type === "amendment");
|
|
2745
|
+
for (const s of d)
|
|
2712
2746
|
e.amendments.push({
|
|
2713
|
-
section:
|
|
2714
|
-
was:
|
|
2715
|
-
now:
|
|
2716
|
-
by:
|
|
2717
|
-
ref:
|
|
2718
|
-
at:
|
|
2747
|
+
section: z(s, "section", s.content ?? ""),
|
|
2748
|
+
was: z(s, "was"),
|
|
2749
|
+
now: z(s, "now"),
|
|
2750
|
+
by: z(s, "by"),
|
|
2751
|
+
ref: z(s, "ref"),
|
|
2752
|
+
at: z(s, "at")
|
|
2719
2753
|
});
|
|
2720
2754
|
return e;
|
|
2721
2755
|
}
|
|
@@ -2728,13 +2762,13 @@ function Zt(t) {
|
|
|
2728
2762
|
let o;
|
|
2729
2763
|
for (; o = wt.exec(n.text); )
|
|
2730
2764
|
e.push(
|
|
2731
|
-
|
|
2765
|
+
Nt.inline(r + o.index, r + o.index + o[0].length, {
|
|
2732
2766
|
class: "it-doc-var"
|
|
2733
2767
|
})
|
|
2734
2768
|
);
|
|
2735
2769
|
}), St.create(t, e);
|
|
2736
2770
|
}
|
|
2737
|
-
const
|
|
2771
|
+
const xr = vt.create({
|
|
2738
2772
|
name: "templateHighlight",
|
|
2739
2773
|
addProseMirrorPlugins() {
|
|
2740
2774
|
return [
|
|
@@ -2753,7 +2787,7 @@ const vr = vt.create({
|
|
|
2753
2787
|
];
|
|
2754
2788
|
}
|
|
2755
2789
|
});
|
|
2756
|
-
function
|
|
2790
|
+
function qr(t) {
|
|
2757
2791
|
const e = /* @__PURE__ */ new Set(), n = [];
|
|
2758
2792
|
wt.lastIndex = 0;
|
|
2759
2793
|
let r;
|
|
@@ -2763,19 +2797,19 @@ function Yr(t) {
|
|
|
2763
2797
|
}
|
|
2764
2798
|
return n;
|
|
2765
2799
|
}
|
|
2766
|
-
function
|
|
2800
|
+
function Jr(t) {
|
|
2767
2801
|
const e = {};
|
|
2768
2802
|
for (const n of t) {
|
|
2769
2803
|
const r = n.split(".");
|
|
2770
2804
|
let o = e;
|
|
2771
2805
|
for (let l = 0; l < r.length; l++) {
|
|
2772
|
-
const
|
|
2773
|
-
l === r.length - 1 ?
|
|
2806
|
+
const c = r[l];
|
|
2807
|
+
l === r.length - 1 ? c in o || (o[c] = "") : ((!(c in o) || typeof o[c] != "object" || o[c] === null) && (o[c] = {}), o = o[c]);
|
|
2774
2808
|
}
|
|
2775
2809
|
}
|
|
2776
2810
|
return e;
|
|
2777
2811
|
}
|
|
2778
|
-
const
|
|
2812
|
+
const Lr = 28, Ar = {
|
|
2779
2813
|
title: [".it-doc-title"],
|
|
2780
2814
|
summary: [".it-doc-summary"],
|
|
2781
2815
|
section: [".it-doc-section"],
|
|
@@ -2790,22 +2824,22 @@ const Tr = 28, xr = {
|
|
|
2790
2824
|
contact: ['.it-doc-generic[data-keyword="contact"]'],
|
|
2791
2825
|
divider: [".it-doc-divider"]
|
|
2792
2826
|
};
|
|
2793
|
-
function
|
|
2827
|
+
function Cr({
|
|
2794
2828
|
value: t,
|
|
2795
2829
|
onChange: e,
|
|
2796
2830
|
theme: n,
|
|
2797
2831
|
onThemeChange: r,
|
|
2798
2832
|
readOnly: o = !1,
|
|
2799
2833
|
showRibbon: l = !0,
|
|
2800
|
-
showTrustBanner:
|
|
2801
|
-
onTrustAction:
|
|
2834
|
+
showTrustBanner: c = !0,
|
|
2835
|
+
onTrustAction: d
|
|
2802
2836
|
}) {
|
|
2803
|
-
const
|
|
2837
|
+
const s = B(""), f = B(!1), p = B(!0), [h, g] = P([]), k = B(Mt("")), [M, C] = P(1), v = ye({
|
|
2804
2838
|
extensions: [
|
|
2805
|
-
|
|
2839
|
+
mn.configure({
|
|
2806
2840
|
geometry: () => k.current,
|
|
2807
|
-
gap:
|
|
2808
|
-
onPages:
|
|
2841
|
+
gap: Lr,
|
|
2842
|
+
onPages: C
|
|
2809
2843
|
}),
|
|
2810
2844
|
Se.configure({
|
|
2811
2845
|
heading: !1,
|
|
@@ -2815,8 +2849,8 @@ function Ar({
|
|
|
2815
2849
|
// Replaced by ITParagraph (core block props: end/leading/space-…).
|
|
2816
2850
|
paragraph: !1
|
|
2817
2851
|
}),
|
|
2852
|
+
er,
|
|
2818
2853
|
nr,
|
|
2819
|
-
rr,
|
|
2820
2854
|
we.configure({
|
|
2821
2855
|
// Professional behavior: a new empty line shows just the cursor.
|
|
2822
2856
|
// The hint appears only on a completely empty document.
|
|
@@ -2825,14 +2859,15 @@ function Ar({
|
|
|
2825
2859
|
ve,
|
|
2826
2860
|
Te,
|
|
2827
2861
|
xe,
|
|
2828
|
-
|
|
2829
|
-
|
|
2862
|
+
Le.configure({ multicolor: !0 }),
|
|
2863
|
+
Ae.configure({
|
|
2830
2864
|
types: ["paragraph", "itTitle", "itSummary", "itSection", "itSub"]
|
|
2831
2865
|
}),
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
$e,
|
|
2866
|
+
Ce,
|
|
2867
|
+
ln,
|
|
2835
2868
|
Ne,
|
|
2869
|
+
$e,
|
|
2870
|
+
Bn,
|
|
2836
2871
|
In,
|
|
2837
2872
|
On,
|
|
2838
2873
|
Dn,
|
|
@@ -2840,22 +2875,21 @@ function Ar({
|
|
|
2840
2875
|
jn,
|
|
2841
2876
|
Wn,
|
|
2842
2877
|
Gn,
|
|
2878
|
+
Yn,
|
|
2843
2879
|
Un,
|
|
2844
2880
|
Kn,
|
|
2845
|
-
Yn,
|
|
2846
2881
|
qn,
|
|
2847
2882
|
Jn,
|
|
2848
2883
|
Vn,
|
|
2849
2884
|
Qn,
|
|
2850
2885
|
Zn,
|
|
2851
|
-
|
|
2852
|
-
vr
|
|
2886
|
+
xr
|
|
2853
2887
|
],
|
|
2854
2888
|
content: Ut(t),
|
|
2855
2889
|
onUpdate: ({ editor: m }) => {
|
|
2856
2890
|
if (p.current) return;
|
|
2857
|
-
const y = m.getJSON(),
|
|
2858
|
-
|
|
2891
|
+
const y = m.getJSON(), T = zn(y);
|
|
2892
|
+
s.current = T, f.current = !0, g(Nn(y)), e(T);
|
|
2859
2893
|
},
|
|
2860
2894
|
editorProps: {
|
|
2861
2895
|
attributes: {
|
|
@@ -2866,33 +2900,33 @@ function Ar({
|
|
|
2866
2900
|
});
|
|
2867
2901
|
j(() => {
|
|
2868
2902
|
const m = window.setTimeout(() => {
|
|
2869
|
-
p.current = !1,
|
|
2903
|
+
p.current = !1, s.current = t;
|
|
2870
2904
|
}, 0);
|
|
2871
2905
|
return () => window.clearTimeout(m);
|
|
2872
2906
|
}, []), j(() => {
|
|
2873
|
-
if (
|
|
2874
|
-
if (
|
|
2875
|
-
|
|
2907
|
+
if (v) {
|
|
2908
|
+
if (f.current) {
|
|
2909
|
+
f.current = !1;
|
|
2876
2910
|
return;
|
|
2877
2911
|
}
|
|
2878
|
-
if (t !==
|
|
2912
|
+
if (t !== s.current) {
|
|
2879
2913
|
const m = Ut(t);
|
|
2880
|
-
|
|
2914
|
+
v.commands.setContent(m), s.current = t;
|
|
2881
2915
|
}
|
|
2882
2916
|
}
|
|
2883
|
-
}, [t,
|
|
2884
|
-
if (!
|
|
2917
|
+
}, [t, v]), j(() => {
|
|
2918
|
+
if (!v) return;
|
|
2885
2919
|
const m = (y) => {
|
|
2886
|
-
const
|
|
2887
|
-
|
|
2920
|
+
const T = y.detail;
|
|
2921
|
+
T && v.chain().focus().insertContent(T).run();
|
|
2888
2922
|
};
|
|
2889
2923
|
return window.addEventListener("it-insert-text", m), () => window.removeEventListener("it-insert-text", m);
|
|
2890
|
-
}, [
|
|
2891
|
-
const
|
|
2924
|
+
}, [v]);
|
|
2925
|
+
const w = Y(() => Mt(t), [t]);
|
|
2892
2926
|
j(() => {
|
|
2893
|
-
k.current =
|
|
2894
|
-
}, [
|
|
2895
|
-
const
|
|
2927
|
+
k.current = w, v?.view.dispatch(v.state.tr);
|
|
2928
|
+
}, [w, v]);
|
|
2929
|
+
const I = B(null), O = R(() => v ? v.storage.characterCount?.words?.() ?? v.getText().split(/\s+/).filter(Boolean).length : 0, [v]), K = Y(() => {
|
|
2896
2930
|
if (!n) return "";
|
|
2897
2931
|
try {
|
|
2898
2932
|
const m = Re(n);
|
|
@@ -2900,35 +2934,35 @@ function Ar({
|
|
|
2900
2934
|
} catch {
|
|
2901
2935
|
return "";
|
|
2902
2936
|
}
|
|
2903
|
-
}, [n]),
|
|
2937
|
+
}, [n]), q = Y(() => {
|
|
2904
2938
|
try {
|
|
2905
|
-
const m =
|
|
2906
|
-
return { header: y, footer:
|
|
2939
|
+
const m = et(t), y = m.blocks.find((U) => U.type === "header")?.content || "", T = m.blocks.find((U) => U.type === "footer")?.content || "", D = m.blocks.find((U) => U.type === "meta"), Q = String(D?.properties?.dir || "ltr").toLowerCase();
|
|
2940
|
+
return { header: y, footer: T, dir: Q };
|
|
2907
2941
|
} catch {
|
|
2908
2942
|
return { header: "", footer: "", dir: "ltr" };
|
|
2909
2943
|
}
|
|
2910
|
-
}, [t]),
|
|
2944
|
+
}, [t]), W = Y(() => {
|
|
2911
2945
|
try {
|
|
2912
|
-
return Vt(
|
|
2946
|
+
return Vt(et(t));
|
|
2913
2947
|
} catch {
|
|
2914
2948
|
return Vt(null);
|
|
2915
2949
|
}
|
|
2916
|
-
}, [t]), rt =
|
|
2917
|
-
if (!
|
|
2950
|
+
}, [t]), rt = Y(() => {
|
|
2951
|
+
if (!W.isSealed) return null;
|
|
2918
2952
|
try {
|
|
2919
|
-
return
|
|
2953
|
+
return Pe(t).intact;
|
|
2920
2954
|
} catch {
|
|
2921
2955
|
return null;
|
|
2922
2956
|
}
|
|
2923
|
-
}, [t,
|
|
2957
|
+
}, [t, W.isSealed]), N = W.isSealed || o;
|
|
2924
2958
|
j(() => {
|
|
2925
|
-
|
|
2926
|
-
}, [
|
|
2927
|
-
const H =
|
|
2959
|
+
v && v.isEditable !== !N && v.setEditable(!N);
|
|
2960
|
+
}, [v, N]);
|
|
2961
|
+
const H = Y(() => {
|
|
2928
2962
|
try {
|
|
2929
|
-
return
|
|
2930
|
-
|
|
2931
|
-
|
|
2963
|
+
return Be(
|
|
2964
|
+
et(t),
|
|
2965
|
+
Ar,
|
|
2932
2966
|
".docs-page .tiptap "
|
|
2933
2967
|
);
|
|
2934
2968
|
} catch {
|
|
@@ -2942,15 +2976,15 @@ function Ar({
|
|
|
2942
2976
|
m || (m = document.createElement("style"), m.id = "it-doc-style-rules", document.head.appendChild(m)), m.textContent = H;
|
|
2943
2977
|
}, [H]);
|
|
2944
2978
|
const ot = R(() => {
|
|
2945
|
-
if (
|
|
2979
|
+
if (q.dir === "rtl") {
|
|
2946
2980
|
const y = t.split(`
|
|
2947
|
-
`).map((
|
|
2948
|
-
if (/^meta:/i.test(
|
|
2949
|
-
const
|
|
2950
|
-
return
|
|
2981
|
+
`).map((T) => {
|
|
2982
|
+
if (/^meta:/i.test(T.trim())) {
|
|
2983
|
+
const D = T.replace(/\s*\|\s*dir:\s*rtl/gi, "").trim();
|
|
2984
|
+
return D === "meta:" ? null : D;
|
|
2951
2985
|
}
|
|
2952
|
-
return
|
|
2953
|
-
}).filter((
|
|
2986
|
+
return T;
|
|
2987
|
+
}).filter((T) => T !== null).join(`
|
|
2954
2988
|
`);
|
|
2955
2989
|
e(y);
|
|
2956
2990
|
} else {
|
|
@@ -2961,114 +2995,115 @@ meta: | dir: rtl`)
|
|
|
2961
2995
|
) : e(`meta: | dir: rtl
|
|
2962
2996
|
${t}`);
|
|
2963
2997
|
}
|
|
2964
|
-
}, [t, e,
|
|
2998
|
+
}, [t, e, q.dir]);
|
|
2965
2999
|
j(() => {
|
|
2966
3000
|
const m = "it-editor-theme-css";
|
|
2967
3001
|
let y = document.getElementById(m);
|
|
2968
|
-
y || (y = document.createElement("style"), y.id = m, document.head.appendChild(y)), y.textContent =
|
|
2969
|
-
}, [
|
|
2970
|
-
const
|
|
3002
|
+
y || (y = document.createElement("style"), y.id = m, document.head.appendChild(y)), y.textContent = K;
|
|
3003
|
+
}, [K]);
|
|
3004
|
+
const G = B(null), [L, st] = P(1), ut = B(L), V = B(null), pt = R(
|
|
2971
3005
|
(m) => {
|
|
2972
|
-
const y =
|
|
3006
|
+
const y = G.current;
|
|
2973
3007
|
if (!y) return;
|
|
2974
|
-
const
|
|
2975
|
-
|
|
2976
|
-
cx: y.scrollLeft + (m.clientX -
|
|
2977
|
-
cy: y.scrollTop + (m.clientY -
|
|
3008
|
+
const T = y.getBoundingClientRect();
|
|
3009
|
+
V.current = {
|
|
3010
|
+
cx: y.scrollLeft + (m.clientX - T.left),
|
|
3011
|
+
cy: y.scrollTop + (m.clientY - T.top)
|
|
2978
3012
|
};
|
|
2979
3013
|
},
|
|
2980
3014
|
[]
|
|
2981
3015
|
), at = R(() => {
|
|
2982
|
-
const m =
|
|
2983
|
-
m && (
|
|
3016
|
+
const m = G.current;
|
|
3017
|
+
m && (V.current = {
|
|
2984
3018
|
cx: m.scrollLeft + m.clientWidth / 2,
|
|
2985
3019
|
cy: m.scrollTop + m.clientHeight / 2
|
|
2986
3020
|
});
|
|
2987
3021
|
}, []);
|
|
2988
3022
|
return be(() => {
|
|
2989
|
-
const m =
|
|
2990
|
-
if (!m || !y ||
|
|
2991
|
-
const
|
|
3023
|
+
const m = G.current, y = V.current, T = ut.current;
|
|
3024
|
+
if (!m || !y || T === L) return;
|
|
3025
|
+
const D = L / T;
|
|
2992
3026
|
m.getBoundingClientRect();
|
|
2993
|
-
const
|
|
2994
|
-
m.scrollLeft = y.cx *
|
|
2995
|
-
}, [
|
|
3027
|
+
const Q = y.cx - m.scrollLeft, U = y.cy - m.scrollTop;
|
|
3028
|
+
m.scrollLeft = y.cx * D - Q, m.scrollTop = y.cy * D - U, V.current = null, ut.current = L;
|
|
3029
|
+
}, [L]), j(() => {
|
|
2996
3030
|
const m = (y) => {
|
|
2997
|
-
(y.metaKey || y.ctrlKey) && (y.key === "=" || y.key === "+" ? (y.preventDefault(), at(), st((
|
|
3031
|
+
(y.metaKey || y.ctrlKey) && (y.key === "=" || y.key === "+" ? (y.preventDefault(), at(), st((T) => Math.min(2, +(T + 0.1).toFixed(2)))) : y.key === "-" ? (y.preventDefault(), at(), st((T) => Math.max(0.25, +(T - 0.1).toFixed(2)))) : y.key === "0" && (y.preventDefault(), at(), st(1)));
|
|
2998
3032
|
};
|
|
2999
3033
|
return window.addEventListener("keydown", m), () => window.removeEventListener("keydown", m);
|
|
3000
3034
|
}, [at]), j(() => {
|
|
3001
|
-
const m =
|
|
3035
|
+
const m = G.current;
|
|
3002
3036
|
if (!m) return;
|
|
3003
|
-
const y = (
|
|
3004
|
-
if (
|
|
3005
|
-
|
|
3006
|
-
const
|
|
3007
|
-
pt(
|
|
3037
|
+
const y = (T) => {
|
|
3038
|
+
if (T.ctrlKey || T.metaKey) {
|
|
3039
|
+
T.preventDefault();
|
|
3040
|
+
const D = T.deltaY > 0 ? -0.1 : 0.1;
|
|
3041
|
+
pt(T), st((Q) => Math.min(2, Math.max(0.25, +(Q + D).toFixed(2))));
|
|
3008
3042
|
}
|
|
3009
3043
|
};
|
|
3010
3044
|
return m.addEventListener("wheel", y, { passive: !1 }), () => m.removeEventListener("wheel", y);
|
|
3011
|
-
}, [pt]), /* @__PURE__ */
|
|
3012
|
-
l && /* @__PURE__ */
|
|
3013
|
-
|
|
3045
|
+
}, [pt]), /* @__PURE__ */ b("div", { className: "docs-container", children: [
|
|
3046
|
+
l && /* @__PURE__ */ a(
|
|
3047
|
+
br,
|
|
3014
3048
|
{
|
|
3015
|
-
editor:
|
|
3016
|
-
isRtl:
|
|
3049
|
+
editor: v,
|
|
3050
|
+
isRtl: q.dir === "rtl",
|
|
3017
3051
|
onToggleRtl: ot,
|
|
3018
3052
|
content: t,
|
|
3019
3053
|
theme: n,
|
|
3020
3054
|
onThemeChange: r,
|
|
3021
|
-
onTrustAction:
|
|
3055
|
+
onTrustAction: d,
|
|
3022
3056
|
locked: N
|
|
3023
3057
|
}
|
|
3024
3058
|
),
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3059
|
+
c && /* @__PURE__ */ a(wr, { trust: W, intact: rt }),
|
|
3060
|
+
c && /* @__PURE__ */ a(Tr, { source: t }),
|
|
3061
|
+
h.length > 0 && /* @__PURE__ */ b("div", { className: "docs-fidelity-warning", role: "status", children: [
|
|
3028
3062
|
"⚠ Some formatting (",
|
|
3029
|
-
|
|
3063
|
+
h.join(", "),
|
|
3030
3064
|
") can’t be saved to",
|
|
3031
3065
|
" ",
|
|
3032
|
-
/* @__PURE__ */
|
|
3066
|
+
/* @__PURE__ */ a("code", { children: ".it" }),
|
|
3033
3067
|
" and won’t appear when printed through the template — remove it or use the toolbar’s color/size/style controls instead."
|
|
3034
3068
|
] }),
|
|
3035
|
-
/* @__PURE__ */
|
|
3036
|
-
|
|
3069
|
+
/* @__PURE__ */ a(Sr, { geometry: w, zoom: L, scrollEl: G }),
|
|
3070
|
+
/* @__PURE__ */ b("div", { className: "docs-canvas", ref: G, children: [
|
|
3071
|
+
/* @__PURE__ */ a(
|
|
3037
3072
|
"div",
|
|
3038
3073
|
{
|
|
3039
3074
|
className: "docs-page-scaler",
|
|
3040
|
-
style: { width:
|
|
3041
|
-
children: /* @__PURE__ */
|
|
3075
|
+
style: { width: w.width * L },
|
|
3076
|
+
children: /* @__PURE__ */ a(
|
|
3042
3077
|
"div",
|
|
3043
3078
|
{
|
|
3044
3079
|
className: "docs-page-flow",
|
|
3045
|
-
dir:
|
|
3080
|
+
dir: q.dir,
|
|
3046
3081
|
style: {
|
|
3047
|
-
transform:
|
|
3082
|
+
transform: L !== 1 ? `scale(${L})` : void 0,
|
|
3048
3083
|
transformOrigin: "top left"
|
|
3049
3084
|
},
|
|
3050
|
-
children: /* @__PURE__ */
|
|
3085
|
+
children: /* @__PURE__ */ b(
|
|
3051
3086
|
"div",
|
|
3052
3087
|
{
|
|
3053
3088
|
className: "docs-page docs-sheet",
|
|
3054
|
-
ref:
|
|
3089
|
+
ref: I,
|
|
3055
3090
|
style: {
|
|
3056
|
-
width:
|
|
3057
|
-
minHeight:
|
|
3058
|
-
"--page-mx-l": `${
|
|
3059
|
-
"--page-mx-r": `${
|
|
3091
|
+
width: w.width,
|
|
3092
|
+
minHeight: w.autoHeight ? w.width : void 0,
|
|
3093
|
+
"--page-mx-l": `${w.marginLeft}px`,
|
|
3094
|
+
"--page-mx-r": `${w.marginRight}px`
|
|
3060
3095
|
},
|
|
3061
3096
|
children: [
|
|
3062
|
-
/* @__PURE__ */
|
|
3097
|
+
/* @__PURE__ */ a(
|
|
3063
3098
|
"div",
|
|
3064
3099
|
{
|
|
3065
3100
|
className: "docs-sheet-header",
|
|
3066
3101
|
"data-it-spacer": "",
|
|
3067
|
-
style: { height:
|
|
3068
|
-
children: /* @__PURE__ */
|
|
3102
|
+
style: { height: w.autoHeight ? void 0 : w.marginTop },
|
|
3103
|
+
children: /* @__PURE__ */ a("div", { className: "docs-pb-header", children: /* @__PURE__ */ a("span", { className: "docs-pb-text", children: w.autoHeight ? "" : ee(w.header, 1, M) }) })
|
|
3069
3104
|
}
|
|
3070
3105
|
),
|
|
3071
|
-
/* @__PURE__ */
|
|
3106
|
+
/* @__PURE__ */ a(ke, { editor: v })
|
|
3072
3107
|
]
|
|
3073
3108
|
}
|
|
3074
3109
|
)
|
|
@@ -3076,66 +3111,66 @@ ${t}`);
|
|
|
3076
3111
|
)
|
|
3077
3112
|
}
|
|
3078
3113
|
),
|
|
3079
|
-
/* @__PURE__ */
|
|
3080
|
-
|
|
3114
|
+
/* @__PURE__ */ b("div", { className: "docs-page-footer", children: [
|
|
3115
|
+
M,
|
|
3081
3116
|
" ",
|
|
3082
|
-
|
|
3117
|
+
M === 1 ? "page" : "pages",
|
|
3083
3118
|
" ·",
|
|
3084
3119
|
" ",
|
|
3085
|
-
|
|
3120
|
+
O(),
|
|
3086
3121
|
" words",
|
|
3087
|
-
|
|
3122
|
+
L !== 1 && /* @__PURE__ */ b("span", { className: "zoom-indicator", children: [
|
|
3088
3123
|
" ",
|
|
3089
3124
|
"· ",
|
|
3090
|
-
Math.round(
|
|
3125
|
+
Math.round(L * 100),
|
|
3091
3126
|
"%"
|
|
3092
3127
|
] })
|
|
3093
3128
|
] })
|
|
3094
3129
|
] })
|
|
3095
3130
|
] });
|
|
3096
3131
|
}
|
|
3097
|
-
const
|
|
3098
|
-
function
|
|
3132
|
+
const Nr = "corporate";
|
|
3133
|
+
function Vr({
|
|
3099
3134
|
value: t,
|
|
3100
3135
|
onChange: e,
|
|
3101
3136
|
theme: n,
|
|
3102
3137
|
onThemeChange: r,
|
|
3103
3138
|
readOnly: o = !1,
|
|
3104
3139
|
showRibbon: l = !0,
|
|
3105
|
-
showTrustBanner:
|
|
3106
|
-
onTrustAction:
|
|
3140
|
+
showTrustBanner: c = !0,
|
|
3141
|
+
onTrustAction: d
|
|
3107
3142
|
}) {
|
|
3108
|
-
const [
|
|
3109
|
-
(
|
|
3110
|
-
g
|
|
3143
|
+
const [s, f] = P(n ?? Nr), p = n ?? s, h = R(
|
|
3144
|
+
(g) => {
|
|
3145
|
+
f(g), r?.(g);
|
|
3111
3146
|
},
|
|
3112
3147
|
[r]
|
|
3113
3148
|
);
|
|
3114
|
-
return /* @__PURE__ */
|
|
3115
|
-
|
|
3149
|
+
return /* @__PURE__ */ a(
|
|
3150
|
+
Cr,
|
|
3116
3151
|
{
|
|
3117
3152
|
value: t,
|
|
3118
3153
|
onChange: e,
|
|
3119
3154
|
theme: p,
|
|
3120
|
-
onThemeChange:
|
|
3155
|
+
onThemeChange: h,
|
|
3121
3156
|
readOnly: o,
|
|
3122
3157
|
showRibbon: l,
|
|
3123
|
-
showTrustBanner:
|
|
3124
|
-
onTrustAction:
|
|
3158
|
+
showTrustBanner: c,
|
|
3159
|
+
onTrustAction: d
|
|
3125
3160
|
}
|
|
3126
3161
|
);
|
|
3127
3162
|
}
|
|
3128
3163
|
export {
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3164
|
+
Vr as IntentTextEditor,
|
|
3165
|
+
Jr as buildSampleSkeleton,
|
|
3166
|
+
lr as builtinThemes,
|
|
3167
|
+
zn as docToSource,
|
|
3168
|
+
cr as exportDocumentHTML,
|
|
3169
|
+
ar as exportDocumentPDF,
|
|
3170
|
+
qr as extractTemplateVariables,
|
|
3136
3171
|
Vt as extractTrustState,
|
|
3137
|
-
|
|
3138
|
-
|
|
3172
|
+
Mt as getPageGeometry,
|
|
3173
|
+
rr as printHtmlViaIframe,
|
|
3139
3174
|
ee as resolvePageTokens,
|
|
3140
3175
|
Ut as sourceToDoc
|
|
3141
3176
|
};
|