@dotit/editor 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/block-props.d.ts +1 -1
- package/dist/index.cjs +23 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1520 -1400
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +85 -14
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useEditor as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { TextStyle as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import { Extension as
|
|
14
|
-
import { Plugin as
|
|
15
|
-
import { DecorationSet as
|
|
16
|
-
import { parseIntentText as
|
|
17
|
-
import
|
|
18
|
-
import { ChevronDown as
|
|
19
|
-
const
|
|
1
|
+
import { jsxs as h, jsx as o, Fragment as Z } from "react/jsx-runtime";
|
|
2
|
+
import { useState as M, useRef as F, useCallback as _, useEffect as G, useMemo as tt, useLayoutEffect as He } from "react";
|
|
3
|
+
import { useEditor as Re, EditorContent as Pe } from "@tiptap/react";
|
|
4
|
+
import Be from "@tiptap/starter-kit";
|
|
5
|
+
import Ie from "@tiptap/extension-underline";
|
|
6
|
+
import { TextStyle as De } from "@tiptap/extension-text-style";
|
|
7
|
+
import Oe from "@tiptap/extension-color";
|
|
8
|
+
import je from "@tiptap/extension-highlight";
|
|
9
|
+
import Fe from "@tiptap/extension-text-align";
|
|
10
|
+
import Ue from "@tiptap/extension-font-family";
|
|
11
|
+
import Ge from "@tiptap/extension-subscript";
|
|
12
|
+
import We from "@tiptap/extension-superscript";
|
|
13
|
+
import { Extension as Tt, Node as W, mergeAttributes as O } from "@tiptap/core";
|
|
14
|
+
import { Plugin as fe, PluginKey as he, TextSelection as Yt } from "@tiptap/pm/state";
|
|
15
|
+
import { DecorationSet as Lt, Decoration as Rt } from "@tiptap/pm/view";
|
|
16
|
+
import { parseIntentText as ot, listBuiltinThemes as Ye, renderPrint as Ke, cssContentValue as qe, isSealed as Ve, signDocument as Je, sealDocument as Qe, unsealDocument as Xe, verifyDocument as ge, LANGUAGE_REGISTRY as Ze, getBuiltinTheme as tn, generateThemeCSS as en, documentStyleCSS as nn, upsertMetaProperty as rn } from "@dotit/core";
|
|
17
|
+
import sn from "@tiptap/extension-paragraph";
|
|
18
|
+
import { ChevronDown as wt, ShieldCheck as Kt, LockOpen as on, PenTool as $t, FileLock2 as qt, Undo2 as an, Redo2 as cn, Download as ln, Printer as dn, Droplets as un, Minus as pn, Plus as Vt, Bold as fn, Italic as hn, Underline as gn, Strikethrough as mn, Palette as bn, RemoveFormatting as Jt, Highlighter as yn, Code as Sn, AlignLeft as kn, AlignCenter as vn, AlignRight as wn, AlignJustify as Tn, Rows3 as xn, List as Nn, ListOrdered as Ln, AlignHorizontalSpaceBetween as Qt } from "lucide-react";
|
|
19
|
+
const An = Tt.create({
|
|
20
20
|
name: "fontSize",
|
|
21
21
|
addOptions() {
|
|
22
22
|
return { types: ["textStyle"] };
|
|
@@ -41,111 +41,111 @@ const xn = vt.create({
|
|
|
41
41
|
unsetFontSize: () => ({ chain: t }) => t().setMark("textStyle", { fontSize: null }).removeEmptyTextStyle().run()
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
}),
|
|
44
|
+
}), st = 96 / 25.4, Nt = {
|
|
45
45
|
A4: [210, 297],
|
|
46
46
|
A5: [148, 210],
|
|
47
47
|
A3: [297, 420],
|
|
48
48
|
Letter: [215.9, 279.4],
|
|
49
49
|
Legal: [215.9, 355.6],
|
|
50
50
|
Tabloid: [279.4, 431.8]
|
|
51
|
-
},
|
|
51
|
+
}, Cn = {
|
|
52
52
|
A4: "cm",
|
|
53
53
|
A5: "cm",
|
|
54
54
|
A3: "cm",
|
|
55
55
|
LETTER: "in",
|
|
56
56
|
LEGAL: "in",
|
|
57
57
|
TABLOID: "in"
|
|
58
|
-
},
|
|
59
|
-
function
|
|
58
|
+
}, $n = 20, _n = 4, Mn = 120;
|
|
59
|
+
function Pt(t) {
|
|
60
60
|
const e = /^(-?\d+(?:\.\d+)?)\s*(mm|cm|in|px|pt)?$/.exec(t.trim());
|
|
61
61
|
if (!e) return null;
|
|
62
|
-
const
|
|
62
|
+
const r = parseFloat(e[1]);
|
|
63
63
|
switch (e[2] || "mm") {
|
|
64
64
|
case "mm":
|
|
65
|
-
return
|
|
65
|
+
return r * st;
|
|
66
66
|
case "cm":
|
|
67
|
-
return
|
|
67
|
+
return r * 10 * st;
|
|
68
68
|
case "in":
|
|
69
|
-
return
|
|
69
|
+
return r * 96;
|
|
70
70
|
case "pt":
|
|
71
|
-
return
|
|
71
|
+
return r / 72 * 96;
|
|
72
72
|
case "px":
|
|
73
|
-
return
|
|
73
|
+
return r;
|
|
74
74
|
default:
|
|
75
75
|
return null;
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
const
|
|
80
|
-
if (
|
|
78
|
+
function En(t, e) {
|
|
79
|
+
const r = t.trim().split(/\s+/).map(Pt);
|
|
80
|
+
if (r.some((s) => s === null) || r.length === 0)
|
|
81
81
|
return [e, e, e, e];
|
|
82
|
-
const
|
|
83
|
-
return
|
|
82
|
+
const n = r;
|
|
83
|
+
return n.length === 1 ? [n[0], n[0], n[0], n[0]] : n.length === 2 ? [n[0], n[1], n[0], n[1]] : n.length === 3 ? [n[0], n[1], n[2], n[1]] : [n[0], n[1], n[2], n[3]];
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
let e = "A4",
|
|
85
|
+
function Bt(t) {
|
|
86
|
+
let e = "A4", r, n = "", s = "";
|
|
87
87
|
try {
|
|
88
|
-
const
|
|
89
|
-
v.size && (e = String(v.size)),
|
|
88
|
+
const x = ot(t), v = x.blocks.find((R) => R.type === "page")?.properties || {};
|
|
89
|
+
v.size && (e = String(v.size)), r = v.margin ?? v.margins, n = x.blocks.find((R) => R.type === "header")?.content || String(v.header || ""), s = x.blocks.find((R) => R.type === "footer")?.content || String(v.footer || "");
|
|
90
90
|
} catch {
|
|
91
91
|
}
|
|
92
|
-
let c =
|
|
93
|
-
const m =
|
|
92
|
+
let c = Nt.A4[0] * st, i = Nt.A4[1] * st, u = !1, a = "cm";
|
|
93
|
+
const m = Nt[e] || Nt[e.toUpperCase?.()];
|
|
94
94
|
if (m)
|
|
95
|
-
c = m[0] *
|
|
95
|
+
c = m[0] * st, i = m[1] * st, a = Cn[e.toUpperCase()] || "cm";
|
|
96
96
|
else {
|
|
97
|
-
const
|
|
98
|
-
if (
|
|
99
|
-
|
|
97
|
+
const x = e.trim().split(/\s+/), b = x[0] ? Pt(x[0]) : null;
|
|
98
|
+
if (b && (c = b), /(\d)\s*in\b/.test(e) && (a = "in"), x[1] === "auto")
|
|
99
|
+
u = !0, i = 1 / 0;
|
|
100
100
|
else {
|
|
101
|
-
const v =
|
|
102
|
-
v && (
|
|
101
|
+
const v = x[1] ? Pt(x[1]) : null;
|
|
102
|
+
v && (i = v);
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
const
|
|
105
|
+
const d = (c <= Mn * st ? _n : $n) * st, [g, f, y, k] = r ? En(r, d) : [d, d, d, d];
|
|
106
106
|
return {
|
|
107
107
|
width: c,
|
|
108
|
-
height:
|
|
109
|
-
autoHeight:
|
|
110
|
-
marginTop:
|
|
108
|
+
height: i,
|
|
109
|
+
autoHeight: u,
|
|
110
|
+
marginTop: g,
|
|
111
111
|
marginRight: f,
|
|
112
|
-
marginBottom:
|
|
113
|
-
marginLeft:
|
|
114
|
-
contentHeight:
|
|
115
|
-
header:
|
|
116
|
-
footer:
|
|
117
|
-
unit:
|
|
112
|
+
marginBottom: y,
|
|
113
|
+
marginLeft: k,
|
|
114
|
+
contentHeight: u ? 1 / 0 : i - g - y,
|
|
115
|
+
header: n,
|
|
116
|
+
footer: s,
|
|
117
|
+
unit: a
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
|
-
function
|
|
121
|
-
const
|
|
122
|
-
`),
|
|
123
|
-
if (
|
|
124
|
-
let
|
|
125
|
-
return
|
|
120
|
+
function zn(t, e) {
|
|
121
|
+
const r = t.split(`
|
|
122
|
+
`), n = r.findIndex((i) => /^\s*page\s*:/i.test(i));
|
|
123
|
+
if (n >= 0) {
|
|
124
|
+
let i = r[n].replace(/\s*\|\s*margins?\s*:[^|]*/gi, "").replace(/\s+$/, "");
|
|
125
|
+
return i = `${i} | margin: ${e}`, r[n] = i, r.join(`
|
|
126
126
|
`);
|
|
127
127
|
}
|
|
128
|
-
const
|
|
129
|
-
(
|
|
128
|
+
const s = r.findIndex(
|
|
129
|
+
(i) => i.trim() && !/^\s*(meta|title|summary)\s*:/i.test(i)
|
|
130
130
|
), c = `page: A4 | margin: ${e}`;
|
|
131
|
-
return
|
|
132
|
-
${t}` : (
|
|
131
|
+
return s <= 0 ? `${c}
|
|
132
|
+
${t}` : (r.splice(s, 0, c), r.join(`
|
|
133
133
|
`));
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
return t.replace(/\{\{\s*page\s*\}\}/g, String(e)).replace(/\{\{\s*pages\s*\}\}/g, String(
|
|
135
|
+
function me(t, e, r) {
|
|
136
|
+
return t.replace(/\{\{\s*page\s*\}\}/g, String(e)).replace(/\{\{\s*pages\s*\}\}/g, String(r));
|
|
137
137
|
}
|
|
138
|
-
const
|
|
139
|
-
function
|
|
140
|
-
const
|
|
138
|
+
const kt = new he("pagination");
|
|
139
|
+
function _t(t, e, r, n) {
|
|
140
|
+
const s = me(e, r, n);
|
|
141
141
|
return `<div class="docs-pb-${t}">
|
|
142
|
-
<span class="docs-pb-text">${
|
|
142
|
+
<span class="docs-pb-text">${Hn(s)}</span>
|
|
143
143
|
</div>`;
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function Hn(t) {
|
|
146
146
|
return t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
147
147
|
}
|
|
148
|
-
const
|
|
148
|
+
const Rn = Tt.create({
|
|
149
149
|
name: "pagination",
|
|
150
150
|
addOptions() {
|
|
151
151
|
return {
|
|
@@ -168,126 +168,126 @@ const En = vt.create({
|
|
|
168
168
|
addProseMirrorPlugins() {
|
|
169
169
|
const t = this.options;
|
|
170
170
|
return [
|
|
171
|
-
new
|
|
172
|
-
key:
|
|
171
|
+
new fe({
|
|
172
|
+
key: kt,
|
|
173
173
|
state: {
|
|
174
|
-
init: () =>
|
|
175
|
-
apply(e,
|
|
176
|
-
const
|
|
177
|
-
return
|
|
174
|
+
init: () => Lt.empty,
|
|
175
|
+
apply(e, r) {
|
|
176
|
+
const n = e.getMeta(kt);
|
|
177
|
+
return n || r.map(e.mapping, e.doc);
|
|
178
178
|
}
|
|
179
179
|
},
|
|
180
180
|
props: {
|
|
181
181
|
decorations(e) {
|
|
182
|
-
return
|
|
182
|
+
return kt.getState(e);
|
|
183
183
|
}
|
|
184
184
|
},
|
|
185
185
|
view(e) {
|
|
186
|
-
let
|
|
187
|
-
const
|
|
186
|
+
let r = 0, n = "";
|
|
187
|
+
const s = (a, m, d, g) => {
|
|
188
188
|
const f = document.createElement("div");
|
|
189
|
-
return f.className = "docs-page-spacer", f.contentEditable = "false", f.setAttribute("data-it-spacer", ""), f.style.setProperty("--pb-mx-l", `${
|
|
189
|
+
return f.className = "docs-page-spacer", f.contentEditable = "false", f.setAttribute("data-it-spacer", ""), f.style.setProperty("--pb-mx-l", `${a.marginLeft}px`), f.style.setProperty("--pb-mx-r", `${a.marginRight}px`), f.innerHTML = `
|
|
190
190
|
<div class="docs-pb-fill" style="height:${m}px"></div>
|
|
191
|
-
<div class="docs-pb-margin docs-pb-margin-bottom" style="height:${
|
|
192
|
-
${
|
|
191
|
+
<div class="docs-pb-margin docs-pb-margin-bottom" style="height:${a.marginBottom}px">
|
|
192
|
+
${_t("footer", a.footer, d, g)}
|
|
193
193
|
</div>
|
|
194
194
|
<div class="docs-pb-gap" style="height:${t.gap}px"></div>
|
|
195
|
-
<div class="docs-pb-margin docs-pb-margin-top" style="height:${
|
|
196
|
-
${
|
|
195
|
+
<div class="docs-pb-margin docs-pb-margin-top" style="height:${a.marginTop}px">
|
|
196
|
+
${_t("header", a.header, d + 1, g)}
|
|
197
197
|
</div>`, f;
|
|
198
|
-
}, c = (
|
|
198
|
+
}, c = (a, m, d, g) => {
|
|
199
199
|
const f = document.createElement("div");
|
|
200
|
-
return f.className = "docs-page-spacer docs-page-tail", f.contentEditable = "false", f.setAttribute("data-it-spacer", ""), f.style.setProperty("--pb-mx-l", `${
|
|
200
|
+
return f.className = "docs-page-spacer docs-page-tail", f.contentEditable = "false", f.setAttribute("data-it-spacer", ""), f.style.setProperty("--pb-mx-l", `${a.marginLeft}px`), f.style.setProperty("--pb-mx-r", `${a.marginRight}px`), f.innerHTML = `
|
|
201
201
|
<div class="docs-pb-fill" style="height:${m}px"></div>
|
|
202
|
-
<div class="docs-pb-margin docs-pb-margin-bottom" style="height:${
|
|
203
|
-
${
|
|
202
|
+
<div class="docs-pb-margin docs-pb-margin-bottom" style="height:${a.marginBottom}px">
|
|
203
|
+
${_t("footer", a.footer, d, g)}
|
|
204
204
|
</div>`, f;
|
|
205
|
-
},
|
|
206
|
-
const
|
|
207
|
-
if (
|
|
208
|
-
|
|
209
|
-
e.state.tr.setMeta(
|
|
205
|
+
}, i = () => {
|
|
206
|
+
const a = t.geometry(), m = e.dom, d = e.state.doc;
|
|
207
|
+
if (a.autoHeight) {
|
|
208
|
+
n !== "auto" && (n = "auto", e.dispatch(
|
|
209
|
+
e.state.tr.setMeta(kt, Lt.empty)
|
|
210
210
|
), t.onPages?.(1));
|
|
211
211
|
return;
|
|
212
212
|
}
|
|
213
|
-
const
|
|
214
|
-
let
|
|
213
|
+
const g = m.getBoundingClientRect().top, f = Array.from(m.children), y = [];
|
|
214
|
+
let k = 0;
|
|
215
215
|
for (const C of f) {
|
|
216
216
|
if (C.hasAttribute?.("data-it-spacer")) {
|
|
217
|
-
|
|
217
|
+
k += C.offsetHeight;
|
|
218
218
|
continue;
|
|
219
219
|
}
|
|
220
|
-
const
|
|
221
|
-
|
|
222
|
-
natTop:
|
|
223
|
-
natBottom:
|
|
220
|
+
const P = C.getBoundingClientRect();
|
|
221
|
+
y.push({
|
|
222
|
+
natTop: P.top - g - k,
|
|
223
|
+
natBottom: P.bottom - g - k
|
|
224
224
|
});
|
|
225
225
|
}
|
|
226
|
-
const
|
|
227
|
-
let
|
|
228
|
-
for (let C = 0; C <
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
pos:
|
|
233
|
-
rest: Math.max(0,
|
|
234
|
-
}), v =
|
|
226
|
+
const x = [];
|
|
227
|
+
let b = 0, v = y.length ? y[0].natTop : 0, R = v;
|
|
228
|
+
for (let C = 0; C < y.length && C < d.childCount; C++) {
|
|
229
|
+
const P = y[C], X = d.child(C).nodeSize;
|
|
230
|
+
P.natTop > v && // never break before the page's first block
|
|
231
|
+
P.natBottom - v > a.contentHeight && (x.push({
|
|
232
|
+
pos: b,
|
|
233
|
+
rest: Math.max(0, a.contentHeight - (P.natTop - v))
|
|
234
|
+
}), v = P.natTop), R = P.natBottom, b += X;
|
|
235
235
|
}
|
|
236
|
-
const
|
|
236
|
+
const z = x.length + 1, B = Math.max(
|
|
237
237
|
0,
|
|
238
|
-
|
|
239
|
-
),
|
|
240
|
-
if (
|
|
241
|
-
|
|
242
|
-
const
|
|
243
|
-
(C,
|
|
238
|
+
a.contentHeight - (R - v)
|
|
239
|
+
), U = x.map((C) => `${C.pos}:${Math.round(C.rest)}`).join(",") + `|${Math.round(B)}|${z}|${a.header}|${a.footer}|${Math.round(a.contentHeight)}`;
|
|
240
|
+
if (U === n) return;
|
|
241
|
+
n = U;
|
|
242
|
+
const j = x.map(
|
|
243
|
+
(C, P) => Rt.widget(
|
|
244
244
|
C.pos,
|
|
245
|
-
() =>
|
|
246
|
-
{ side: -1, key: `pb-${
|
|
245
|
+
() => s(a, C.rest, P + 1, z),
|
|
246
|
+
{ side: -1, key: `pb-${P + 1}-${Math.round(C.rest)}` }
|
|
247
247
|
)
|
|
248
248
|
);
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
() => c(
|
|
253
|
-
{ side: 1, key: `pb-tail-${
|
|
249
|
+
j.push(
|
|
250
|
+
Rt.widget(
|
|
251
|
+
d.content.size,
|
|
252
|
+
() => c(a, B, z, z),
|
|
253
|
+
{ side: 1, key: `pb-tail-${z}-${Math.round(B)}` }
|
|
254
254
|
)
|
|
255
255
|
);
|
|
256
|
-
const
|
|
257
|
-
e.dispatch(e.state.tr.setMeta(
|
|
258
|
-
},
|
|
259
|
-
cancelAnimationFrame(
|
|
256
|
+
const V = Lt.create(e.state.doc, j);
|
|
257
|
+
e.dispatch(e.state.tr.setMeta(kt, V)), t.onPages?.(z);
|
|
258
|
+
}, u = () => {
|
|
259
|
+
cancelAnimationFrame(r), r = requestAnimationFrame(i);
|
|
260
260
|
};
|
|
261
|
-
return
|
|
262
|
-
update:
|
|
263
|
-
destroy: () => cancelAnimationFrame(
|
|
261
|
+
return u(), {
|
|
262
|
+
update: u,
|
|
263
|
+
destroy: () => cancelAnimationFrame(r)
|
|
264
264
|
};
|
|
265
265
|
}
|
|
266
266
|
})
|
|
267
267
|
];
|
|
268
268
|
}
|
|
269
|
-
}),
|
|
269
|
+
}), Xt = /* @__PURE__ */ new Set(["tip", "info", "warning", "danger", "success"]), Pn = /* @__PURE__ */ new Set([
|
|
270
270
|
"page",
|
|
271
271
|
"meta",
|
|
272
272
|
"font",
|
|
273
273
|
"header",
|
|
274
274
|
"footer",
|
|
275
275
|
"watermark"
|
|
276
|
-
]),
|
|
276
|
+
]), Bn = /* @__PURE__ */ new Set([
|
|
277
277
|
"sign",
|
|
278
278
|
"seal",
|
|
279
279
|
"approve",
|
|
280
280
|
"freeze",
|
|
281
281
|
"amend",
|
|
282
282
|
"amendment"
|
|
283
|
-
]),
|
|
283
|
+
]), Zt = {
|
|
284
284
|
title: "itTitle",
|
|
285
285
|
section: "itSection",
|
|
286
286
|
sub: "itSub"
|
|
287
|
-
},
|
|
287
|
+
}, In = {
|
|
288
288
|
note: "text",
|
|
289
289
|
"body-text": "text"
|
|
290
|
-
},
|
|
290
|
+
}, Dn = /* @__PURE__ */ new Set([
|
|
291
291
|
"weight",
|
|
292
292
|
"italic",
|
|
293
293
|
"underline",
|
|
@@ -303,7 +303,7 @@ const En = vt.create({
|
|
|
303
303
|
"font",
|
|
304
304
|
"bgcolor"
|
|
305
305
|
]);
|
|
306
|
-
function
|
|
306
|
+
function On(t) {
|
|
307
307
|
if (!t || t === "{}") return {};
|
|
308
308
|
try {
|
|
309
309
|
return typeof t == "string" ? JSON.parse(t) : t || {};
|
|
@@ -311,20 +311,20 @@ function Bn(t) {
|
|
|
311
311
|
return {};
|
|
312
312
|
}
|
|
313
313
|
}
|
|
314
|
-
function
|
|
315
|
-
const
|
|
316
|
-
([
|
|
314
|
+
function Q(t, e) {
|
|
315
|
+
const r = Object.entries(t).filter(
|
|
316
|
+
([n, s]) => s !== void 0 && s !== "" && (!e || !e.has(n))
|
|
317
317
|
);
|
|
318
|
-
return
|
|
318
|
+
return r.length === 0 ? "" : " | " + r.map(([n, s]) => `${n}: ${s}`).join(" | ");
|
|
319
319
|
}
|
|
320
|
-
function
|
|
320
|
+
function It(t) {
|
|
321
321
|
if (!t) return [];
|
|
322
|
-
const e = t.split("\\n"),
|
|
323
|
-
return e.forEach((
|
|
324
|
-
|
|
325
|
-
}),
|
|
322
|
+
const e = t.split("\\n"), r = [];
|
|
323
|
+
return e.forEach((n, s) => {
|
|
324
|
+
n && r.push({ type: "text", text: n }), s < e.length - 1 && r.push({ type: "hardBreak" });
|
|
325
|
+
}), r;
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function jn(t) {
|
|
328
328
|
switch (t.type) {
|
|
329
329
|
case "bold":
|
|
330
330
|
return [{ type: "bold" }];
|
|
@@ -337,14 +337,14 @@ function In(t) {
|
|
|
337
337
|
case "highlight":
|
|
338
338
|
return [{ type: "highlight" }];
|
|
339
339
|
case "styled": {
|
|
340
|
-
const e = t.props || {},
|
|
341
|
-
return e.weight && e.weight !== "normal" &&
|
|
340
|
+
const e = t.props || {}, r = [], n = {};
|
|
341
|
+
return e.weight && e.weight !== "normal" && r.push({ type: "bold" }), e.italic === "true" && r.push({ type: "italic" }), e.underline === "true" && r.push({ type: "underline" }), e.strike === "true" && r.push({ type: "strike" }), e.color && (n.color = e.color), e.family && (n.fontFamily = e.family), e.size && (n.fontSize = e.size), Object.keys(n).length && r.push({ type: "textStyle", attrs: n }), e.bg && r.push({ type: "highlight", attrs: { color: e.bg } }), e.valign === "sub" && r.push({ type: "subscript" }), e.valign === "super" && r.push({ type: "superscript" }), r.length ? r : null;
|
|
342
342
|
}
|
|
343
343
|
default:
|
|
344
344
|
return null;
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
|
-
const
|
|
347
|
+
const Fn = /* @__PURE__ */ new Set([
|
|
348
348
|
"text",
|
|
349
349
|
"bold",
|
|
350
350
|
"italic",
|
|
@@ -352,29 +352,29 @@ const Dn = /* @__PURE__ */ new Set([
|
|
|
352
352
|
"highlight",
|
|
353
353
|
"styled"
|
|
354
354
|
]);
|
|
355
|
-
function
|
|
356
|
-
if (!t || t.length === 0 || t.every((
|
|
357
|
-
return
|
|
358
|
-
const
|
|
359
|
-
for (const
|
|
360
|
-
const
|
|
361
|
-
|
|
362
|
-
|
|
355
|
+
function Un(t, e) {
|
|
356
|
+
if (!t || t.length === 0 || t.every((n) => n.type === "text") || !t.every((n) => Fn.has(n.type)))
|
|
357
|
+
return It(e);
|
|
358
|
+
const r = [];
|
|
359
|
+
for (const n of t) {
|
|
360
|
+
const s = jn(n), i = (n.value ?? "").split("\\n");
|
|
361
|
+
i.forEach((u, a) => {
|
|
362
|
+
u && r.push(s ? { type: "text", text: u, marks: s } : { type: "text", text: u }), a < i.length - 1 && r.push({ type: "hardBreak" });
|
|
363
363
|
});
|
|
364
364
|
}
|
|
365
|
-
return
|
|
365
|
+
return r.length ? r : It(e);
|
|
366
366
|
}
|
|
367
|
-
function
|
|
367
|
+
function Gn(t, e) {
|
|
368
368
|
if (!e || t.length === 0) return t;
|
|
369
|
-
const
|
|
370
|
-
return String(
|
|
371
|
-
(
|
|
369
|
+
const r = [], n = {}, s = e, c = s.family ?? s.font, i = s.bg ?? s.bgcolor;
|
|
370
|
+
return String(s.weight || "").toLowerCase() === "bold" && r.push({ type: "bold" }), (String(s.italic || "") === "true" || String(s.style || "").toLowerCase() === "italic") && r.push({ type: "italic" }), String(s.underline || "") === "true" && r.push({ type: "underline" }), String(s.strike || "") === "true" && r.push({ type: "strike" }), String(s.valign || "") === "sub" && r.push({ type: "subscript" }), String(s.valign || "") === "super" && r.push({ type: "superscript" }), s.color && (n.color = String(s.color)), c && (n.fontFamily = String(c)), s.size && (n.fontSize = String(s.size)), i && r.push({ type: "highlight", attrs: { color: String(i) } }), Object.keys(n).length > 0 && r.push({ type: "textStyle", attrs: n }), r.length === 0 ? t : t.map(
|
|
371
|
+
(u) => u.type === "text" ? { ...u, marks: [...u.marks || [], ...r] } : u
|
|
372
372
|
);
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function be(t) {
|
|
375
375
|
const e = {};
|
|
376
|
-
for (const
|
|
377
|
-
switch (
|
|
376
|
+
for (const r of t || [])
|
|
377
|
+
switch (r.type) {
|
|
378
378
|
case "bold":
|
|
379
379
|
e.weight = "bold";
|
|
380
380
|
break;
|
|
@@ -388,10 +388,10 @@ function he(t) {
|
|
|
388
388
|
e.strike = "true";
|
|
389
389
|
break;
|
|
390
390
|
case "textStyle":
|
|
391
|
-
|
|
391
|
+
r.attrs?.color && (e.color = String(r.attrs.color)), r.attrs?.fontFamily && (e.family = String(r.attrs.fontFamily)), r.attrs?.fontSize && (e.size = String(r.attrs.fontSize));
|
|
392
392
|
break;
|
|
393
393
|
case "highlight":
|
|
394
|
-
|
|
394
|
+
r.attrs?.color && (e.bg = String(r.attrs.color));
|
|
395
395
|
break;
|
|
396
396
|
case "subscript":
|
|
397
397
|
e.valign = "sub";
|
|
@@ -402,30 +402,30 @@ function he(t) {
|
|
|
402
402
|
}
|
|
403
403
|
return e;
|
|
404
404
|
}
|
|
405
|
-
function
|
|
405
|
+
function Wn(t) {
|
|
406
406
|
if (t.type === "hardBreak") return "\\n";
|
|
407
|
-
if (t.type !== "text") return
|
|
407
|
+
if (t.type !== "text") return jt(t);
|
|
408
408
|
const e = t.text || "";
|
|
409
409
|
if (!e) return "";
|
|
410
|
-
const
|
|
411
|
-
if (!
|
|
412
|
-
const
|
|
413
|
-
if (
|
|
414
|
-
const c =
|
|
415
|
-
(
|
|
410
|
+
const r = t.marks || [];
|
|
411
|
+
if (!r.length) return e;
|
|
412
|
+
const n = new Set(r.map((g) => g.type)), s = r.find((g) => g.type === "link");
|
|
413
|
+
if (s?.attrs?.href) return `[${e}](${s.attrs.href})`;
|
|
414
|
+
const c = r.find((g) => g.type === "textStyle")?.attrs || {}, i = r.find((g) => g.type === "highlight")?.attrs || {}, u = !!(c.color || c.fontFamily || c.fontSize || i.color), a = ["bold", "italic", "strike", "underline", "code"].filter(
|
|
415
|
+
(g) => n.has(g)
|
|
416
416
|
).length;
|
|
417
|
-
if (!
|
|
418
|
-
if (
|
|
419
|
-
if (
|
|
420
|
-
if (
|
|
421
|
-
if (
|
|
417
|
+
if (!u && a === 1 && !n.has("underline")) {
|
|
418
|
+
if (n.has("bold")) return `*${e}*`;
|
|
419
|
+
if (n.has("italic")) return `_${e}_`;
|
|
420
|
+
if (n.has("strike")) return `~${e}~`;
|
|
421
|
+
if (n.has("code")) return `\`${e}\``;
|
|
422
422
|
}
|
|
423
|
-
if (!
|
|
423
|
+
if (!u && a === 0 && n.has("highlight") && !i.color)
|
|
424
424
|
return `^${e}^`;
|
|
425
|
-
const m =
|
|
426
|
-
return m.color &&
|
|
425
|
+
const m = be(r), d = [];
|
|
426
|
+
return m.color && d.push(`color: ${m.color}`), m.family && d.push(`family: ${m.family}`), m.size && d.push(`size: ${m.size}`), m.weight && d.push(`weight: ${m.weight}`), m.italic === "true" && d.push("italic: true"), m.underline && d.push("underline: true"), m.strike && d.push("strike: true"), m.bg && d.push(`bg: ${m.bg}`), m.valign && d.push(`valign: ${m.valign}`), d.length ? `[${e}]{ ${d.join("; ")} }` : e;
|
|
427
427
|
}
|
|
428
|
-
const
|
|
428
|
+
const Yn = /* @__PURE__ */ new Set([
|
|
429
429
|
"bold",
|
|
430
430
|
"italic",
|
|
431
431
|
"underline",
|
|
@@ -437,255 +437,255 @@ const Un = /* @__PURE__ */ new Set([
|
|
|
437
437
|
"subscript",
|
|
438
438
|
"superscript"
|
|
439
439
|
]);
|
|
440
|
-
function
|
|
441
|
-
const e = /* @__PURE__ */ new Set(),
|
|
442
|
-
for (const
|
|
443
|
-
|
|
444
|
-
for (const
|
|
440
|
+
function Kn(t) {
|
|
441
|
+
const e = /* @__PURE__ */ new Set(), r = (n) => {
|
|
442
|
+
for (const s of n.marks || [])
|
|
443
|
+
Yn.has(s.type) || e.add(s.type);
|
|
444
|
+
for (const s of n.content || []) r(s);
|
|
445
445
|
};
|
|
446
|
-
return
|
|
446
|
+
return r(t), [...e].sort();
|
|
447
447
|
}
|
|
448
|
-
function
|
|
449
|
-
const e = t.content || [],
|
|
448
|
+
function Dt(t) {
|
|
449
|
+
const e = t.content || [], r = t.attrs?.textAlign && t.attrs.textAlign !== "left" ? { align: String(t.attrs.textAlign) } : {};
|
|
450
450
|
return e.length === 1 && e[0].type === "text" ? {
|
|
451
451
|
text: e[0].text || "",
|
|
452
|
-
props: { ...
|
|
453
|
-
} : { text: e.map(
|
|
452
|
+
props: { ...be(e[0].marks), ...r }
|
|
453
|
+
} : { text: e.map(Wn).join(""), props: { ...r } };
|
|
454
454
|
}
|
|
455
|
-
function
|
|
456
|
-
return t.content ? t.content.map((e) => e.type === "text" ? e.text || "" : e.type === "hardBreak" ? "\\n" :
|
|
455
|
+
function jt(t) {
|
|
456
|
+
return t.content ? t.content.map((e) => e.type === "text" ? e.text || "" : e.type === "hardBreak" ? "\\n" : jt(e)).join("") : "";
|
|
457
457
|
}
|
|
458
|
-
function
|
|
459
|
-
const
|
|
460
|
-
for (const
|
|
461
|
-
if (
|
|
462
|
-
return { ...
|
|
458
|
+
function ht(t, e, r) {
|
|
459
|
+
const n = On(t);
|
|
460
|
+
for (const s of Dn) delete n[s];
|
|
461
|
+
if (r) for (const s of r) delete n[s];
|
|
462
|
+
return { ...n, ...e };
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function Ft(t) {
|
|
465
465
|
const e = t.toLowerCase();
|
|
466
|
-
return
|
|
466
|
+
return In[e] || e;
|
|
467
467
|
}
|
|
468
|
-
function
|
|
468
|
+
function te(t) {
|
|
469
469
|
if (t === "---") return "divider";
|
|
470
470
|
const e = t.match(/^([a-zA-Z][\w-]*):/);
|
|
471
|
-
return e ?
|
|
471
|
+
return e ? Ft(e[1]) : null;
|
|
472
472
|
}
|
|
473
|
-
function
|
|
474
|
-
return
|
|
473
|
+
function mt(t) {
|
|
474
|
+
return Ft(t);
|
|
475
475
|
}
|
|
476
|
-
function
|
|
476
|
+
function bt(t, e) {
|
|
477
477
|
return !!(t === e || t === "info" && ["tip", "warning", "danger", "success"].includes(e) || e === "info" && ["tip", "warning", "danger", "success"].includes(t));
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function qn(t) {
|
|
480
480
|
if (!t) return { content: "", properties: {} };
|
|
481
481
|
const e = t.split(" | ");
|
|
482
|
-
let
|
|
483
|
-
const
|
|
484
|
-
for (let
|
|
485
|
-
const c = e[
|
|
486
|
-
if (!
|
|
487
|
-
|
|
482
|
+
let r = e[0] || "";
|
|
483
|
+
const n = {};
|
|
484
|
+
for (let s = 1; s < e.length; s++) {
|
|
485
|
+
const c = e[s], i = c.match(/^([a-zA-Z_][\w-]*)\s*:\s*(.*)$/);
|
|
486
|
+
if (!i) {
|
|
487
|
+
r += ` | ${c}`;
|
|
488
488
|
continue;
|
|
489
489
|
}
|
|
490
|
-
|
|
490
|
+
n[i[1]] = i[2];
|
|
491
491
|
}
|
|
492
|
-
return { content:
|
|
492
|
+
return { content: r, properties: n };
|
|
493
493
|
}
|
|
494
|
-
function
|
|
494
|
+
function ee(t) {
|
|
495
495
|
if (t === "---") return { type: "divider" };
|
|
496
496
|
const e = t.match(/^([a-zA-Z][\w-]*):\s*(.*)$/);
|
|
497
497
|
if (!e) return null;
|
|
498
|
-
const
|
|
499
|
-
let
|
|
498
|
+
const r = Ft(e[1]), n = e[2] || "", { content: s, properties: c } = qn(n);
|
|
499
|
+
let i;
|
|
500
500
|
try {
|
|
501
|
-
|
|
501
|
+
i = ot(`text: ${s}`).blocks[0]?.inline;
|
|
502
502
|
} catch {
|
|
503
|
-
|
|
503
|
+
i = void 0;
|
|
504
504
|
}
|
|
505
|
-
return { type:
|
|
505
|
+
return { type: r, content: s, properties: c, inline: i };
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function ne(t) {
|
|
508
508
|
const e = t.match(/^[-*]\s+(.*)$/);
|
|
509
509
|
if (e) return { ordered: !1, text: e[1] };
|
|
510
|
-
const
|
|
511
|
-
return
|
|
510
|
+
const r = t.match(/^\d+\.\s+(.*)$/);
|
|
511
|
+
return r ? { ordered: !0, text: r[1] } : null;
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function Vn(t) {
|
|
514
514
|
return {
|
|
515
515
|
type: "listItem",
|
|
516
|
-
content: [{ type: "paragraph", content:
|
|
516
|
+
content: [{ type: "paragraph", content: It(t) }]
|
|
517
517
|
};
|
|
518
518
|
}
|
|
519
|
-
function
|
|
519
|
+
function Ot(t) {
|
|
520
520
|
if (!t.trim())
|
|
521
521
|
return {
|
|
522
522
|
type: "doc",
|
|
523
523
|
content: [{ type: "paragraph" }]
|
|
524
524
|
};
|
|
525
|
-
const e =
|
|
526
|
-
for (const
|
|
527
|
-
const
|
|
528
|
-
|
|
525
|
+
const e = ot(t), r = [];
|
|
526
|
+
for (const i of e.blocks) {
|
|
527
|
+
const u = Mt(i);
|
|
528
|
+
u && r.push(u);
|
|
529
529
|
}
|
|
530
|
-
const
|
|
530
|
+
const n = t.split(`
|
|
531
531
|
`);
|
|
532
|
-
let
|
|
532
|
+
let s = 0;
|
|
533
533
|
const c = [];
|
|
534
|
-
for (let
|
|
535
|
-
const
|
|
536
|
-
if (!
|
|
534
|
+
for (let i = 0; i < n.length; i++) {
|
|
535
|
+
const a = n[i].trim();
|
|
536
|
+
if (!a) continue;
|
|
537
537
|
{
|
|
538
|
-
const f =
|
|
539
|
-
if (f &&
|
|
540
|
-
c.push({ type: "itMeta", attrs: { raw:
|
|
541
|
-
const
|
|
542
|
-
|
|
538
|
+
const f = te(a);
|
|
539
|
+
if (f && Pn.has(f)) {
|
|
540
|
+
c.push({ type: "itMeta", attrs: { raw: a } });
|
|
541
|
+
const y = e.blocks[s]?.type;
|
|
542
|
+
y && bt(f, mt(y)) && s++;
|
|
543
543
|
continue;
|
|
544
544
|
}
|
|
545
|
-
if (f &&
|
|
546
|
-
c.push({ type: "itTrust", attrs: { raw:
|
|
547
|
-
const
|
|
548
|
-
|
|
545
|
+
if (f && Bn.has(f)) {
|
|
546
|
+
c.push({ type: "itTrust", attrs: { raw: a, keyword: f } });
|
|
547
|
+
const y = e.blocks[s]?.type;
|
|
548
|
+
y && bt(f, mt(y)) && s++;
|
|
549
549
|
continue;
|
|
550
550
|
}
|
|
551
551
|
if (f === "metric") {
|
|
552
|
-
c.push({ type: "itMetric", attrs: { raw:
|
|
553
|
-
const
|
|
554
|
-
|
|
552
|
+
c.push({ type: "itMetric", attrs: { raw: a } });
|
|
553
|
+
const y = e.blocks[s]?.type;
|
|
554
|
+
y && bt(f, mt(y)) && s++;
|
|
555
555
|
continue;
|
|
556
556
|
}
|
|
557
557
|
if (f === "style") {
|
|
558
|
-
c.push({ type: "itStyleRule", attrs: { raw:
|
|
559
|
-
const
|
|
560
|
-
|
|
558
|
+
c.push({ type: "itStyleRule", attrs: { raw: a } });
|
|
559
|
+
const y = e.blocks[s]?.type;
|
|
560
|
+
y && bt(f, mt(y)) && s++;
|
|
561
561
|
continue;
|
|
562
562
|
}
|
|
563
563
|
}
|
|
564
|
-
const m =
|
|
564
|
+
const m = ne(a);
|
|
565
565
|
if (m) {
|
|
566
|
-
const f = m.ordered,
|
|
567
|
-
let
|
|
568
|
-
for (;
|
|
569
|
-
const
|
|
570
|
-
if (!
|
|
571
|
-
|
|
572
|
-
const v = e.blocks[
|
|
573
|
-
(v === "list-item" || v === "step-item") &&
|
|
566
|
+
const f = m.ordered, y = [];
|
|
567
|
+
let k = i;
|
|
568
|
+
for (; k < n.length; ) {
|
|
569
|
+
const x = n[k].trim(), b = x ? ne(x) : null;
|
|
570
|
+
if (!b || b.ordered !== f) break;
|
|
571
|
+
y.push(Vn(b.text));
|
|
572
|
+
const v = e.blocks[s]?.type;
|
|
573
|
+
(v === "list-item" || v === "step-item") && s++, k++;
|
|
574
574
|
}
|
|
575
575
|
c.push({
|
|
576
576
|
type: f ? "orderedList" : "bulletList",
|
|
577
|
-
content:
|
|
578
|
-
}),
|
|
577
|
+
content: y
|
|
578
|
+
}), i = k - 1;
|
|
579
579
|
continue;
|
|
580
580
|
}
|
|
581
|
-
if (
|
|
581
|
+
if (a.startsWith("|") && a.endsWith("|") && (a.match(/\|/g) || []).length >= 3) {
|
|
582
582
|
const f = [];
|
|
583
|
-
let
|
|
584
|
-
for (;
|
|
585
|
-
const
|
|
586
|
-
if (!(
|
|
583
|
+
let y = i;
|
|
584
|
+
for (; y < n.length; ) {
|
|
585
|
+
const k = n[y].trim();
|
|
586
|
+
if (!(k.startsWith("|") && k.endsWith("|"))) break;
|
|
587
587
|
f.push(
|
|
588
|
-
|
|
589
|
-
),
|
|
588
|
+
k.slice(1, -1).split("|").map((x) => x.trim())
|
|
589
|
+
), y++;
|
|
590
590
|
}
|
|
591
|
-
c.push({ type: "itTable", attrs: { rows: JSON.stringify(f) } }),
|
|
591
|
+
c.push({ type: "itTable", attrs: { rows: JSON.stringify(f) } }), i = y - 1;
|
|
592
592
|
continue;
|
|
593
593
|
}
|
|
594
|
-
if (
|
|
594
|
+
if (a.startsWith("//")) {
|
|
595
595
|
c.push({
|
|
596
596
|
type: "itComment",
|
|
597
|
-
content:
|
|
597
|
+
content: a.slice(2).trim() ? [{ type: "text", text: a.slice(2).trim() }] : []
|
|
598
598
|
});
|
|
599
599
|
continue;
|
|
600
600
|
}
|
|
601
|
-
if (
|
|
602
|
-
const
|
|
603
|
-
if (
|
|
604
|
-
const f =
|
|
601
|
+
if (a.startsWith("```")) continue;
|
|
602
|
+
const d = te(a);
|
|
603
|
+
if (d && (d === "text" || a.includes("{{"))) {
|
|
604
|
+
const f = ee(a);
|
|
605
605
|
if (f) {
|
|
606
|
-
const
|
|
607
|
-
if (
|
|
608
|
-
const
|
|
609
|
-
|
|
606
|
+
const y = Mt(f);
|
|
607
|
+
if (y && c.push(y), s < e.blocks.length) {
|
|
608
|
+
const k = mt(e.blocks[s].type);
|
|
609
|
+
bt(d, k) && s++;
|
|
610
610
|
}
|
|
611
611
|
continue;
|
|
612
612
|
}
|
|
613
613
|
}
|
|
614
|
-
if (
|
|
615
|
-
const f = e.blocks[
|
|
616
|
-
if (
|
|
617
|
-
c.push(
|
|
614
|
+
if (s < r.length && d) {
|
|
615
|
+
const f = e.blocks[s], y = mt(f.type);
|
|
616
|
+
if (bt(d, y)) {
|
|
617
|
+
c.push(r[s]), s++;
|
|
618
618
|
continue;
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
|
-
const
|
|
622
|
-
if (
|
|
623
|
-
const f =
|
|
621
|
+
const g = ee(a);
|
|
622
|
+
if (g) {
|
|
623
|
+
const f = Mt(g);
|
|
624
624
|
f && c.push(f);
|
|
625
625
|
continue;
|
|
626
626
|
}
|
|
627
|
-
|
|
627
|
+
s < r.length && (c.push(r[s]), s++);
|
|
628
628
|
}
|
|
629
|
-
for (;
|
|
630
|
-
c.push(
|
|
629
|
+
for (; s < r.length; )
|
|
630
|
+
c.push(r[s]), s++;
|
|
631
631
|
return {
|
|
632
632
|
type: "doc",
|
|
633
633
|
content: c.length > 0 ? c : [{ type: "paragraph" }]
|
|
634
634
|
};
|
|
635
635
|
}
|
|
636
|
-
function
|
|
637
|
-
const { type: e, content:
|
|
638
|
-
let
|
|
639
|
-
|
|
640
|
-
const
|
|
636
|
+
function Mt(t) {
|
|
637
|
+
const { type: e, content: r, properties: n, inline: s } = t, c = r || "";
|
|
638
|
+
let i = Un(s, c);
|
|
639
|
+
i = Gn(i, n);
|
|
640
|
+
const u = n ? JSON.stringify(
|
|
641
641
|
Object.fromEntries(
|
|
642
|
-
Object.entries(
|
|
642
|
+
Object.entries(n).map(([d, g]) => [d, String(g)])
|
|
643
643
|
)
|
|
644
|
-
) : "{}",
|
|
645
|
-
if (e in
|
|
644
|
+
) : "{}", a = n?.align ? String(n.align) : void 0;
|
|
645
|
+
if (e in Zt)
|
|
646
646
|
return {
|
|
647
|
-
type:
|
|
648
|
-
attrs: { props:
|
|
649
|
-
content:
|
|
647
|
+
type: Zt[e],
|
|
648
|
+
attrs: { props: u, ...a && { textAlign: a } },
|
|
649
|
+
content: i.length ? i : void 0
|
|
650
650
|
};
|
|
651
651
|
if (e === "summary")
|
|
652
652
|
return {
|
|
653
653
|
type: "itSummary",
|
|
654
|
-
attrs: { props:
|
|
655
|
-
content:
|
|
654
|
+
attrs: { props: u, ...a && { textAlign: a } },
|
|
655
|
+
content: i.length ? i : void 0
|
|
656
656
|
};
|
|
657
657
|
if (e === "text" || e === "body-text") {
|
|
658
|
-
const
|
|
659
|
-
return
|
|
658
|
+
const d = {};
|
|
659
|
+
return a && (d.textAlign = a), n?.end && (d.end = String(n.end)), n?.leading && (d.leading = String(n.leading)), n?.["space-before"] && (d.spaceBefore = String(n["space-before"])), n?.["space-after"] && (d.spaceAfter = String(n["space-after"])), n?.dir && (d.dir = String(n.dir)), {
|
|
660
660
|
type: "paragraph",
|
|
661
|
-
...Object.keys(
|
|
662
|
-
content:
|
|
661
|
+
...Object.keys(d).length && { attrs: d },
|
|
662
|
+
content: i.length ? i : void 0
|
|
663
663
|
};
|
|
664
664
|
}
|
|
665
|
-
if (
|
|
666
|
-
const
|
|
665
|
+
if (Xt.has(e)) {
|
|
666
|
+
const d = e === "info" ? String(n?.type || "info").toLowerCase() : e;
|
|
667
667
|
return {
|
|
668
668
|
type: "itCallout",
|
|
669
|
-
attrs: { variant:
|
|
670
|
-
content:
|
|
669
|
+
attrs: { variant: Xt.has(d) ? d : "info", props: u },
|
|
670
|
+
content: i.length ? i : void 0
|
|
671
671
|
};
|
|
672
672
|
}
|
|
673
673
|
if (e === "quote")
|
|
674
674
|
return {
|
|
675
675
|
type: "itQuote",
|
|
676
676
|
attrs: {
|
|
677
|
-
by:
|
|
678
|
-
props:
|
|
679
|
-
...
|
|
677
|
+
by: n?.by ? String(n.by) : "",
|
|
678
|
+
props: u,
|
|
679
|
+
...a && { textAlign: a }
|
|
680
680
|
},
|
|
681
|
-
content:
|
|
681
|
+
content: i.length ? i : void 0
|
|
682
682
|
};
|
|
683
683
|
if (e === "code")
|
|
684
684
|
return {
|
|
685
685
|
type: "itCode",
|
|
686
686
|
attrs: {
|
|
687
|
-
lang:
|
|
688
|
-
props:
|
|
687
|
+
lang: n?.lang ? String(n.lang) : "",
|
|
688
|
+
props: u
|
|
689
689
|
},
|
|
690
690
|
content: c ? [{ type: "text", text: c }] : void 0
|
|
691
691
|
};
|
|
@@ -693,86 +693,92 @@ function _t(t) {
|
|
|
693
693
|
return { type: "itDivider" };
|
|
694
694
|
if (e === "break")
|
|
695
695
|
return { type: "itBreak" };
|
|
696
|
-
const m =
|
|
696
|
+
const m = n ? Object.entries(n).filter(([, d]) => d !== void 0 && d !== "").map(([d, g]) => `${d}: ${g}`).join(" | ") : "";
|
|
697
697
|
return {
|
|
698
698
|
type: "itGenericBlock",
|
|
699
|
-
attrs: { keyword: e, properties: m, props:
|
|
700
|
-
content:
|
|
699
|
+
attrs: { keyword: e, properties: m, props: u },
|
|
700
|
+
content: i.length ? i : void 0
|
|
701
701
|
};
|
|
702
702
|
}
|
|
703
|
-
function
|
|
703
|
+
function ye(t) {
|
|
704
704
|
if (!t.content) return "";
|
|
705
|
-
const e = []
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
705
|
+
const e = [...t.content], r = (s) => (s.type === "paragraph" || s.type === "itGenericBlock") && (!s.content || s.content.length === 0 || s.content.every(
|
|
706
|
+
(c) => c.type === "text" && !(c.text || "").trim()
|
|
707
|
+
)) && // never drop a block carrying real attributes (align/dir/end/spacing)
|
|
708
|
+
!(s.attrs && Object.values(s.attrs).some((c) => c && c !== "{}"));
|
|
709
|
+
for (; e.length > 1 && r(e[e.length - 1]); )
|
|
710
|
+
e.pop();
|
|
711
|
+
const n = [];
|
|
712
|
+
for (const s of e)
|
|
713
|
+
n.push(...Jn(s));
|
|
714
|
+
return n.join(`
|
|
709
715
|
`);
|
|
710
716
|
}
|
|
711
|
-
function
|
|
717
|
+
function Jn(t) {
|
|
712
718
|
if (t.type === "bulletList" && t.content)
|
|
713
|
-
return t.content.flatMap((
|
|
714
|
-
const { text:
|
|
715
|
-
return `- ${
|
|
719
|
+
return t.content.flatMap((r) => r.content ? r.content.map((n) => {
|
|
720
|
+
const { text: s, props: c } = Dt(n);
|
|
721
|
+
return `- ${s}${Q(c)}`;
|
|
716
722
|
}) : []);
|
|
717
723
|
if (t.type === "orderedList" && t.content) {
|
|
718
|
-
let
|
|
719
|
-
return t.content.flatMap((
|
|
720
|
-
const { text: c, props:
|
|
721
|
-
return `${
|
|
724
|
+
let r = 1;
|
|
725
|
+
return t.content.flatMap((n) => n.content ? n.content.map((s) => {
|
|
726
|
+
const { text: c, props: i } = Dt(s);
|
|
727
|
+
return `${r++}. ${c}${Q(i)}`;
|
|
722
728
|
}) : []);
|
|
723
729
|
}
|
|
724
|
-
const e =
|
|
730
|
+
const e = Qn(t);
|
|
725
731
|
return e !== null ? [e] : [];
|
|
726
732
|
}
|
|
727
|
-
function
|
|
728
|
-
const { text: e, props:
|
|
733
|
+
function Qn(t) {
|
|
734
|
+
const { text: e, props: r } = Dt(t);
|
|
729
735
|
switch (t.type) {
|
|
730
736
|
case "itTitle": {
|
|
731
|
-
const
|
|
732
|
-
return `title: ${e}${
|
|
737
|
+
const n = ht(t.attrs?.props, r);
|
|
738
|
+
return `title: ${e}${Q(n)}`;
|
|
733
739
|
}
|
|
734
740
|
case "itSummary": {
|
|
735
|
-
const
|
|
736
|
-
return `summary: ${e}${
|
|
741
|
+
const n = ht(t.attrs?.props, r);
|
|
742
|
+
return `summary: ${e}${Q(n)}`;
|
|
737
743
|
}
|
|
738
744
|
case "itSection": {
|
|
739
|
-
const
|
|
740
|
-
return `section: ${e}${
|
|
745
|
+
const n = ht(t.attrs?.props, r);
|
|
746
|
+
return `section: ${e}${Q(n)}`;
|
|
741
747
|
}
|
|
742
748
|
case "itSub": {
|
|
743
|
-
const
|
|
744
|
-
return `sub: ${e}${
|
|
749
|
+
const n = ht(t.attrs?.props, r);
|
|
750
|
+
return `sub: ${e}${Q(n)}`;
|
|
745
751
|
}
|
|
746
752
|
case "paragraph": {
|
|
747
|
-
const
|
|
748
|
-
return
|
|
753
|
+
const n = t.attrs || {}, s = {};
|
|
754
|
+
return n.end && (s.end = String(n.end)), n.leading && (s.leading = String(n.leading)), n.spaceBefore && (s["space-before"] = String(n.spaceBefore)), n.spaceAfter && (s["space-after"] = String(n.spaceAfter)), n.dir && (s.dir = String(n.dir)), `text: ${e}${Q({ ...s, ...r })}`;
|
|
749
755
|
}
|
|
750
756
|
case "itCallout": {
|
|
751
|
-
const
|
|
757
|
+
const n = t.attrs?.variant || "tip", s = ht(
|
|
752
758
|
t.attrs?.props,
|
|
753
|
-
|
|
759
|
+
r,
|
|
754
760
|
/* @__PURE__ */ new Set(["variant"])
|
|
755
761
|
);
|
|
756
|
-
return
|
|
762
|
+
return n === "info" ? `info: ${e}${Q(s)}` : `info: ${e} | type: ${n}${Q(s, /* @__PURE__ */ new Set(["type"]))}`;
|
|
757
763
|
}
|
|
758
764
|
case "itQuote": {
|
|
759
|
-
const
|
|
760
|
-
return `quote: ${e}${
|
|
765
|
+
const n = t.attrs?.by, s = n ? ` | by: ${n}` : "", c = ht(t.attrs?.props, r, /* @__PURE__ */ new Set(["by"]));
|
|
766
|
+
return `quote: ${e}${s}${Q(c)}`;
|
|
761
767
|
}
|
|
762
768
|
case "itCode":
|
|
763
769
|
return `\`\`\`${t.attrs?.lang || ""}
|
|
764
|
-
${
|
|
770
|
+
${jt(t)}
|
|
765
771
|
\`\`\``;
|
|
766
772
|
case "itDivider":
|
|
767
773
|
return "divider:";
|
|
768
774
|
case "itTable": {
|
|
769
|
-
let
|
|
775
|
+
let n = [];
|
|
770
776
|
try {
|
|
771
|
-
|
|
777
|
+
n = JSON.parse(t.attrs?.rows || "[]");
|
|
772
778
|
} catch {
|
|
773
|
-
|
|
779
|
+
n = [];
|
|
774
780
|
}
|
|
775
|
-
return
|
|
781
|
+
return n.map((s) => `| ${s.join(" | ")} |`).join(`
|
|
776
782
|
`);
|
|
777
783
|
}
|
|
778
784
|
case "itMeta":
|
|
@@ -788,17 +794,17 @@ ${Dt(t)}
|
|
|
788
794
|
case "itComment":
|
|
789
795
|
return e ? `// ${e}` : "//";
|
|
790
796
|
case "itGenericBlock": {
|
|
791
|
-
const
|
|
792
|
-
return `${
|
|
797
|
+
const n = t.attrs?.keyword || "text", s = ht(t.attrs?.props, r);
|
|
798
|
+
return `${n}: ${e}${Q(s)}`;
|
|
793
799
|
}
|
|
794
800
|
default:
|
|
795
|
-
return e ? `text: ${e}${
|
|
801
|
+
return e ? `text: ${e}${Q(r)}` : null;
|
|
796
802
|
}
|
|
797
803
|
}
|
|
798
804
|
function l(t, e) {
|
|
799
805
|
return { property: t, css: e };
|
|
800
806
|
}
|
|
801
|
-
const
|
|
807
|
+
const Xn = [
|
|
802
808
|
l("align", "textAlign"),
|
|
803
809
|
l("color", "color"),
|
|
804
810
|
l("size", "fontSize"),
|
|
@@ -808,14 +814,14 @@ const Jn = [
|
|
|
808
814
|
l("padding", "padding"),
|
|
809
815
|
l("indent", "paddingLeft"),
|
|
810
816
|
l("opacity", "opacity")
|
|
811
|
-
],
|
|
817
|
+
], vt = [
|
|
812
818
|
l("bgcolor", "backgroundColor"),
|
|
813
819
|
l("color", "color"),
|
|
814
820
|
l("border", "borderLeft")
|
|
815
821
|
], $ = [
|
|
816
822
|
l("color", "borderColor"),
|
|
817
823
|
l("bgcolor", "backgroundColor")
|
|
818
|
-
],
|
|
824
|
+
], Zn = {
|
|
819
825
|
// ── Identity ──
|
|
820
826
|
title: [
|
|
821
827
|
l("align", "textAlign"),
|
|
@@ -852,12 +858,12 @@ const Jn = [
|
|
|
852
858
|
l("spacing", "margin")
|
|
853
859
|
],
|
|
854
860
|
// ── Content ──
|
|
855
|
-
text: [...
|
|
856
|
-
tip: [...
|
|
857
|
-
info: [...
|
|
858
|
-
warning: [...
|
|
859
|
-
danger: [...
|
|
860
|
-
success: [...
|
|
861
|
+
text: [...Xn],
|
|
862
|
+
tip: [...vt],
|
|
863
|
+
info: [...vt],
|
|
864
|
+
warning: [...vt],
|
|
865
|
+
danger: [...vt],
|
|
866
|
+
success: [...vt],
|
|
861
867
|
quote: [
|
|
862
868
|
l("align", "textAlign"),
|
|
863
869
|
l("color", "color"),
|
|
@@ -1047,24 +1053,28 @@ const Jn = [
|
|
|
1047
1053
|
],
|
|
1048
1054
|
signline: [l("color", "color"), l("width", "width")]
|
|
1049
1055
|
};
|
|
1050
|
-
function
|
|
1051
|
-
const
|
|
1052
|
-
if (!
|
|
1053
|
-
const
|
|
1054
|
-
for (const
|
|
1055
|
-
const c = e[
|
|
1056
|
-
c && (
|
|
1056
|
+
function tr(t, e) {
|
|
1057
|
+
const r = Zn[t];
|
|
1058
|
+
if (!r) return {};
|
|
1059
|
+
const n = {};
|
|
1060
|
+
for (const s of r) {
|
|
1061
|
+
const c = e[s.property];
|
|
1062
|
+
c && (s.transform ? n[s.css] = s.transform(c) : n[s.css] = c);
|
|
1057
1063
|
}
|
|
1058
|
-
return
|
|
1064
|
+
return n;
|
|
1059
1065
|
}
|
|
1060
|
-
function
|
|
1061
|
-
const
|
|
1062
|
-
return e.leading && (
|
|
1066
|
+
function it(t, e) {
|
|
1067
|
+
const r = tr(t, e);
|
|
1068
|
+
return e.leading && (r.lineHeight = e.leading), e["space-before"] && (r.marginTop = e["space-before"]), e["space-after"] && (r.marginBottom = e["space-after"]), Object.entries(r).map(([n, s]) => `${n.replace(/([A-Z])/g, "-$1").toLowerCase()}:${s}`).join(";");
|
|
1063
1069
|
}
|
|
1064
|
-
function
|
|
1070
|
+
function Ut(t) {
|
|
1065
1071
|
return t.end ? { "data-it-end": t.end } : {};
|
|
1066
1072
|
}
|
|
1067
|
-
|
|
1073
|
+
function ut(t) {
|
|
1074
|
+
const e = t.dir;
|
|
1075
|
+
return e === "rtl" || e === "ltr" || e === "auto" ? { dir: e } : {};
|
|
1076
|
+
}
|
|
1077
|
+
const er = W.create({
|
|
1068
1078
|
name: "itTitle",
|
|
1069
1079
|
group: "block",
|
|
1070
1080
|
content: "inline*",
|
|
@@ -1081,15 +1091,16 @@ const Zn = Y.create({
|
|
|
1081
1091
|
return [{ tag: 'h1[data-it-type="title"]' }];
|
|
1082
1092
|
},
|
|
1083
1093
|
renderHTML({ HTMLAttributes: t, node: e }) {
|
|
1084
|
-
const
|
|
1094
|
+
const r = pt(e.attrs.props), n = O(t, {
|
|
1085
1095
|
"data-it-type": "title",
|
|
1086
1096
|
class: "it-doc-title",
|
|
1087
|
-
style:
|
|
1088
|
-
...
|
|
1097
|
+
style: it("title", r),
|
|
1098
|
+
...Ut(r),
|
|
1099
|
+
...ut(r)
|
|
1089
1100
|
});
|
|
1090
|
-
return
|
|
1101
|
+
return r.end ? ["h1", n, ["span", { class: "it-split-main" }, 0]] : ["h1", n, 0];
|
|
1091
1102
|
}
|
|
1092
|
-
}),
|
|
1103
|
+
}), nr = W.create({
|
|
1093
1104
|
name: "itSummary",
|
|
1094
1105
|
group: "block",
|
|
1095
1106
|
content: "inline*",
|
|
@@ -1103,18 +1114,19 @@ const Zn = Y.create({
|
|
|
1103
1114
|
return [{ tag: 'p[data-it-type="summary"]' }];
|
|
1104
1115
|
},
|
|
1105
1116
|
renderHTML({ HTMLAttributes: t, node: e }) {
|
|
1106
|
-
const
|
|
1117
|
+
const r = pt(e.attrs.props);
|
|
1107
1118
|
return [
|
|
1108
1119
|
"p",
|
|
1109
|
-
|
|
1120
|
+
O(t, {
|
|
1110
1121
|
"data-it-type": "summary",
|
|
1111
1122
|
class: "it-doc-summary",
|
|
1112
|
-
style:
|
|
1123
|
+
style: it("summary", r),
|
|
1124
|
+
...ut(r)
|
|
1113
1125
|
}),
|
|
1114
1126
|
0
|
|
1115
1127
|
];
|
|
1116
1128
|
}
|
|
1117
|
-
}),
|
|
1129
|
+
}), rr = W.create({
|
|
1118
1130
|
name: "itSection",
|
|
1119
1131
|
group: "block",
|
|
1120
1132
|
content: "inline*",
|
|
@@ -1128,15 +1140,16 @@ const Zn = Y.create({
|
|
|
1128
1140
|
return [{ tag: 'h2[data-it-type="section"]' }];
|
|
1129
1141
|
},
|
|
1130
1142
|
renderHTML({ HTMLAttributes: t, node: e }) {
|
|
1131
|
-
const
|
|
1143
|
+
const r = pt(e.attrs.props), n = O(t, {
|
|
1132
1144
|
"data-it-type": "section",
|
|
1133
1145
|
class: "it-doc-section",
|
|
1134
|
-
style:
|
|
1135
|
-
...
|
|
1146
|
+
style: it("section", r),
|
|
1147
|
+
...Ut(r),
|
|
1148
|
+
...ut(r)
|
|
1136
1149
|
});
|
|
1137
|
-
return
|
|
1150
|
+
return r.end ? ["h2", n, ["span", { class: "it-split-main" }, 0]] : ["h2", n, 0];
|
|
1138
1151
|
}
|
|
1139
|
-
}),
|
|
1152
|
+
}), sr = W.create({
|
|
1140
1153
|
name: "itSub",
|
|
1141
1154
|
group: "block",
|
|
1142
1155
|
content: "inline*",
|
|
@@ -1150,15 +1163,16 @@ const Zn = Y.create({
|
|
|
1150
1163
|
return [{ tag: 'h3[data-it-type="sub"]' }];
|
|
1151
1164
|
},
|
|
1152
1165
|
renderHTML({ HTMLAttributes: t, node: e }) {
|
|
1153
|
-
const
|
|
1166
|
+
const r = pt(e.attrs.props), n = O(t, {
|
|
1154
1167
|
"data-it-type": "sub",
|
|
1155
1168
|
class: "it-doc-sub",
|
|
1156
|
-
style:
|
|
1157
|
-
...
|
|
1169
|
+
style: it("sub", r),
|
|
1170
|
+
...Ut(r),
|
|
1171
|
+
...ut(r)
|
|
1158
1172
|
});
|
|
1159
|
-
return
|
|
1173
|
+
return r.end ? ["h3", n, ["span", { class: "it-split-main" }, 0]] : ["h3", n, 0];
|
|
1160
1174
|
}
|
|
1161
|
-
}),
|
|
1175
|
+
}), or = W.create({
|
|
1162
1176
|
name: "itCallout",
|
|
1163
1177
|
group: "block",
|
|
1164
1178
|
content: "inline*",
|
|
@@ -1177,7 +1191,7 @@ const Zn = Y.create({
|
|
|
1177
1191
|
return [{ tag: 'div[data-it-type="callout"]' }];
|
|
1178
1192
|
},
|
|
1179
1193
|
renderHTML({ HTMLAttributes: t, node: e }) {
|
|
1180
|
-
const
|
|
1194
|
+
const r = e.attrs.variant || "tip", n = pt(e.attrs.props), s = {
|
|
1181
1195
|
tip: "tip",
|
|
1182
1196
|
info: "info",
|
|
1183
1197
|
warning: "warning",
|
|
@@ -1186,16 +1200,17 @@ const Zn = Y.create({
|
|
|
1186
1200
|
};
|
|
1187
1201
|
return [
|
|
1188
1202
|
"div",
|
|
1189
|
-
|
|
1203
|
+
O(t, {
|
|
1190
1204
|
"data-it-type": "callout",
|
|
1191
|
-
"data-variant":
|
|
1192
|
-
class: `it-doc-callout it-doc-callout-${
|
|
1193
|
-
style:
|
|
1205
|
+
"data-variant": r,
|
|
1206
|
+
class: `it-doc-callout it-doc-callout-${r}`,
|
|
1207
|
+
style: it(r, n),
|
|
1208
|
+
...ut(n)
|
|
1194
1209
|
}),
|
|
1195
1210
|
[
|
|
1196
1211
|
"span",
|
|
1197
1212
|
{
|
|
1198
|
-
class: `it-doc-callout-icon it-doc-callout-icon-${
|
|
1213
|
+
class: `it-doc-callout-icon it-doc-callout-icon-${s[r] || "tip"}`,
|
|
1199
1214
|
contenteditable: "false"
|
|
1200
1215
|
},
|
|
1201
1216
|
""
|
|
@@ -1203,7 +1218,7 @@ const Zn = Y.create({
|
|
|
1203
1218
|
["span", { class: "it-doc-callout-text" }, 0]
|
|
1204
1219
|
];
|
|
1205
1220
|
}
|
|
1206
|
-
}),
|
|
1221
|
+
}), ir = W.create({
|
|
1207
1222
|
name: "itQuote",
|
|
1208
1223
|
group: "block",
|
|
1209
1224
|
content: "inline*",
|
|
@@ -1218,18 +1233,19 @@ const Zn = Y.create({
|
|
|
1218
1233
|
return [{ tag: 'blockquote[data-it-type="quote"]' }];
|
|
1219
1234
|
},
|
|
1220
1235
|
renderHTML({ HTMLAttributes: t, node: e }) {
|
|
1221
|
-
const
|
|
1236
|
+
const r = pt(e.attrs.props);
|
|
1222
1237
|
return [
|
|
1223
1238
|
"blockquote",
|
|
1224
|
-
|
|
1239
|
+
O(t, {
|
|
1225
1240
|
"data-it-type": "quote",
|
|
1226
1241
|
class: "it-doc-quote",
|
|
1227
|
-
style:
|
|
1242
|
+
style: it("quote", r),
|
|
1243
|
+
...ut(r)
|
|
1228
1244
|
}),
|
|
1229
1245
|
0
|
|
1230
1246
|
];
|
|
1231
1247
|
}
|
|
1232
|
-
}),
|
|
1248
|
+
}), ar = W.create({
|
|
1233
1249
|
name: "itCode",
|
|
1234
1250
|
group: "block",
|
|
1235
1251
|
content: "text*",
|
|
@@ -1246,19 +1262,19 @@ const Zn = Y.create({
|
|
|
1246
1262
|
return [{ tag: "pre" }];
|
|
1247
1263
|
},
|
|
1248
1264
|
renderHTML({ HTMLAttributes: t, node: e }) {
|
|
1249
|
-
const
|
|
1265
|
+
const r = pt(e.attrs.props);
|
|
1250
1266
|
return [
|
|
1251
1267
|
"pre",
|
|
1252
|
-
|
|
1268
|
+
O(t, {
|
|
1253
1269
|
"data-it-type": "code",
|
|
1254
1270
|
class: "it-doc-code",
|
|
1255
1271
|
"data-lang": e.attrs.lang || "",
|
|
1256
|
-
style:
|
|
1272
|
+
style: it("code", r)
|
|
1257
1273
|
}),
|
|
1258
1274
|
["code", 0]
|
|
1259
1275
|
];
|
|
1260
1276
|
}
|
|
1261
|
-
}),
|
|
1277
|
+
}), cr = W.create({
|
|
1262
1278
|
name: "itDivider",
|
|
1263
1279
|
group: "block",
|
|
1264
1280
|
atom: !0,
|
|
@@ -1266,9 +1282,9 @@ const Zn = Y.create({
|
|
|
1266
1282
|
return [{ tag: "hr" }];
|
|
1267
1283
|
},
|
|
1268
1284
|
renderHTML({ HTMLAttributes: t }) {
|
|
1269
|
-
return ["hr",
|
|
1285
|
+
return ["hr", O(t, { class: "it-doc-divider" })];
|
|
1270
1286
|
}
|
|
1271
|
-
}),
|
|
1287
|
+
}), lr = W.create({
|
|
1272
1288
|
name: "itMeta",
|
|
1273
1289
|
group: "block",
|
|
1274
1290
|
atom: !0,
|
|
@@ -1285,15 +1301,15 @@ const Zn = Y.create({
|
|
|
1285
1301
|
return [{ tag: "div[data-it-meta]" }];
|
|
1286
1302
|
},
|
|
1287
1303
|
renderHTML({ HTMLAttributes: t, node: e }) {
|
|
1288
|
-
const
|
|
1304
|
+
const r = String(e.attrs.raw || "").replace(/\s*\|\s*/g, " · ");
|
|
1289
1305
|
return [
|
|
1290
1306
|
"div",
|
|
1291
|
-
|
|
1292
|
-
`⚙ ${
|
|
1307
|
+
O(t, { "data-it-meta": "", class: "it-doc-meta" }),
|
|
1308
|
+
`⚙ ${r}`
|
|
1293
1309
|
];
|
|
1294
1310
|
}
|
|
1295
1311
|
});
|
|
1296
|
-
function
|
|
1312
|
+
function Et(t) {
|
|
1297
1313
|
try {
|
|
1298
1314
|
const e = JSON.parse(t || "[]");
|
|
1299
1315
|
return Array.isArray(e) ? e : [];
|
|
@@ -1301,7 +1317,7 @@ function Mt(t) {
|
|
|
1301
1317
|
return [];
|
|
1302
1318
|
}
|
|
1303
1319
|
}
|
|
1304
|
-
const
|
|
1320
|
+
const dr = W.create({
|
|
1305
1321
|
name: "itTable",
|
|
1306
1322
|
group: "block",
|
|
1307
1323
|
atom: !0,
|
|
@@ -1319,69 +1335,69 @@ const cr = Y.create({
|
|
|
1319
1335
|
return [{ tag: "table[data-it-table]" }];
|
|
1320
1336
|
},
|
|
1321
1337
|
renderHTML({ HTMLAttributes: t, node: e }) {
|
|
1322
|
-
const
|
|
1338
|
+
const r = Et(e.attrs.rows), n = r[0] || [], s = r.slice(1);
|
|
1323
1339
|
return [
|
|
1324
1340
|
"table",
|
|
1325
|
-
|
|
1341
|
+
O(t, {
|
|
1326
1342
|
"data-it-table": "",
|
|
1327
1343
|
class: "it-doc-table"
|
|
1328
1344
|
}),
|
|
1329
1345
|
[
|
|
1330
1346
|
"thead",
|
|
1331
|
-
["tr", ...
|
|
1347
|
+
["tr", ...n.map((c) => ["th", re(c), String(c)])]
|
|
1332
1348
|
],
|
|
1333
1349
|
[
|
|
1334
1350
|
"tbody",
|
|
1335
|
-
...
|
|
1351
|
+
...s.map((c) => [
|
|
1336
1352
|
"tr",
|
|
1337
|
-
...c.map((
|
|
1353
|
+
...c.map((i) => ["td", re(i), String(i)])
|
|
1338
1354
|
])
|
|
1339
1355
|
]
|
|
1340
1356
|
];
|
|
1341
1357
|
},
|
|
1342
1358
|
addNodeView() {
|
|
1343
|
-
return ({ node: t, editor: e, getPos:
|
|
1344
|
-
const
|
|
1345
|
-
|
|
1346
|
-
const
|
|
1347
|
-
|
|
1348
|
-
let
|
|
1349
|
-
const
|
|
1350
|
-
const
|
|
1351
|
-
|
|
1352
|
-
const
|
|
1359
|
+
return ({ node: t, editor: e, getPos: r }) => {
|
|
1360
|
+
const n = document.createElement("table");
|
|
1361
|
+
n.className = "it-doc-table", n.setAttribute("data-it-table", "");
|
|
1362
|
+
const s = document.createElement("thead"), c = document.createElement("tbody");
|
|
1363
|
+
n.append(s, c);
|
|
1364
|
+
let i = Et(t.attrs.rows);
|
|
1365
|
+
const u = () => {
|
|
1366
|
+
const d = [];
|
|
1367
|
+
n.querySelectorAll("tr").forEach((f) => {
|
|
1368
|
+
const y = [];
|
|
1353
1369
|
f.querySelectorAll("th,td").forEach(
|
|
1354
|
-
(
|
|
1355
|
-
),
|
|
1370
|
+
(k) => y.push((k.textContent || "").trim())
|
|
1371
|
+
), d.push(y);
|
|
1356
1372
|
});
|
|
1357
|
-
const
|
|
1358
|
-
if (
|
|
1359
|
-
const f =
|
|
1373
|
+
const g = JSON.stringify(d);
|
|
1374
|
+
if (g !== t.attrs.rows && (i = d, typeof r == "function")) {
|
|
1375
|
+
const f = r();
|
|
1360
1376
|
if (f == null) return;
|
|
1361
|
-
const
|
|
1362
|
-
e.view.dispatch(
|
|
1377
|
+
const y = e.view.state.tr.setNodeAttribute(f, "rows", g);
|
|
1378
|
+
e.view.dispatch(y);
|
|
1363
1379
|
}
|
|
1364
|
-
},
|
|
1365
|
-
const f = document.createElement(
|
|
1366
|
-
f.textContent =
|
|
1367
|
-
const
|
|
1368
|
-
return f.contentEditable =
|
|
1369
|
-
|
|
1380
|
+
}, a = (d, g) => {
|
|
1381
|
+
const f = document.createElement(d);
|
|
1382
|
+
f.textContent = g;
|
|
1383
|
+
const y = e.isEditable;
|
|
1384
|
+
return f.contentEditable = y ? "true" : "false", /\{\{[^}]+\}\}|^each:/.test(String(g).trim()) && (f.className = "it-doc-var-cell"), f.addEventListener("blur", u), f.addEventListener("keydown", (k) => {
|
|
1385
|
+
k.key === "Enter" && (k.preventDefault(), k.target.blur());
|
|
1370
1386
|
}), f;
|
|
1371
|
-
}, m = (
|
|
1372
|
-
|
|
1373
|
-
const
|
|
1374
|
-
|
|
1375
|
-
const
|
|
1376
|
-
|
|
1387
|
+
}, m = (d) => {
|
|
1388
|
+
s.innerHTML = "", c.innerHTML = "";
|
|
1389
|
+
const g = d[0] || [], f = document.createElement("tr");
|
|
1390
|
+
g.forEach((y) => f.appendChild(a("th", String(y)))), s.appendChild(f), d.slice(1).forEach((y) => {
|
|
1391
|
+
const k = document.createElement("tr");
|
|
1392
|
+
y.forEach((x) => k.appendChild(a("td", String(x)))), c.appendChild(k);
|
|
1377
1393
|
});
|
|
1378
1394
|
};
|
|
1379
|
-
return m(
|
|
1380
|
-
dom:
|
|
1395
|
+
return m(i), {
|
|
1396
|
+
dom: n,
|
|
1381
1397
|
// Re-render only when the attr changed from OUTSIDE this view (e.g.
|
|
1382
1398
|
// source-mode edit), not from our own commit, to keep the caret stable.
|
|
1383
|
-
update(
|
|
1384
|
-
return
|
|
1399
|
+
update(d) {
|
|
1400
|
+
return d.type.name !== "itTable" ? !1 : (d.attrs.rows !== JSON.stringify(i) && (i = Et(d.attrs.rows), m(i)), !0);
|
|
1385
1401
|
},
|
|
1386
1402
|
// The cells own the selection while editing; let ProseMirror ignore
|
|
1387
1403
|
// mutations inside the contenteditable cells.
|
|
@@ -1390,18 +1406,18 @@ const cr = Y.create({
|
|
|
1390
1406
|
};
|
|
1391
1407
|
}
|
|
1392
1408
|
});
|
|
1393
|
-
function
|
|
1409
|
+
function re(t) {
|
|
1394
1410
|
return /\{\{[^}]+\}\}|^each:/.test(String(t).trim()) ? { class: "it-doc-var-cell" } : {};
|
|
1395
1411
|
}
|
|
1396
|
-
function
|
|
1397
|
-
const e = t.indexOf(":"),
|
|
1398
|
-
for (const
|
|
1399
|
-
const
|
|
1400
|
-
|
|
1412
|
+
function Gt(t) {
|
|
1413
|
+
const e = t.indexOf(":"), r = (e >= 0 ? t.slice(0, e) : t).trim().toLowerCase(), s = (e >= 0 ? t.slice(e + 1).trim() : "").split("|").map((u) => u.trim()), c = s.shift() || "", i = {};
|
|
1414
|
+
for (const u of s) {
|
|
1415
|
+
const a = u.indexOf(":");
|
|
1416
|
+
a > 0 && (i[u.slice(0, a).trim().toLowerCase()] = u.slice(a + 1).trim());
|
|
1401
1417
|
}
|
|
1402
|
-
return { keyword:
|
|
1418
|
+
return { keyword: r, content: c, props: i };
|
|
1403
1419
|
}
|
|
1404
|
-
const
|
|
1420
|
+
const ur = W.create({
|
|
1405
1421
|
name: "itTrust",
|
|
1406
1422
|
group: "block",
|
|
1407
1423
|
atom: !0,
|
|
@@ -1423,44 +1439,47 @@ const lr = Y.create({
|
|
|
1423
1439
|
return [{ tag: "div[data-it-trust]" }];
|
|
1424
1440
|
},
|
|
1425
1441
|
renderHTML({ HTMLAttributes: t, node: e }) {
|
|
1426
|
-
const { keyword:
|
|
1442
|
+
const { keyword: r, content: n, props: s } = Gt(
|
|
1427
1443
|
String(e.attrs.raw || "")
|
|
1428
|
-
), c =
|
|
1429
|
-
if (
|
|
1430
|
-
const
|
|
1431
|
-
|
|
1444
|
+
), c = s.role || s.title || "", i = (s.at || s.date || s.time || "").slice(0, 10), u = [];
|
|
1445
|
+
if (r === "seal" || r === "freeze") {
|
|
1446
|
+
const a = r === "seal" && n || s.hash || "";
|
|
1447
|
+
u.push(["span", { class: "it-doc-trust__label" }, "Sealed document"]), i && u.push(["span", { class: "it-doc-trust__date" }, i]), a && u.push([
|
|
1432
1448
|
"code",
|
|
1433
1449
|
{ class: "it-doc-trust__hash" },
|
|
1434
|
-
|
|
1450
|
+
a.length > 20 ? a.slice(0, 20) + "..." : a
|
|
1435
1451
|
]);
|
|
1436
|
-
} else if (
|
|
1437
|
-
const
|
|
1438
|
-
|
|
1452
|
+
} else if (r === "approve") {
|
|
1453
|
+
const a = s.by || n, m = s.by ? n : "";
|
|
1454
|
+
u.push(["span", { class: "it-doc-trust__label" }, "Approved"]), m && u.push(["span", { class: "it-doc-trust__what" }, m]), a && u.push([
|
|
1439
1455
|
"span",
|
|
1440
1456
|
{ class: "it-doc-trust__who" },
|
|
1441
|
-
c ? `${
|
|
1442
|
-
]),
|
|
1443
|
-
} else if (
|
|
1444
|
-
|
|
1457
|
+
c ? `${a}, ${c}` : a
|
|
1458
|
+
]), i && u.push(["span", { class: "it-doc-trust__date" }, i]);
|
|
1459
|
+
} else if (r === "amend" || r === "amendment")
|
|
1460
|
+
u.push(["span", { class: "it-doc-trust__label" }, "Amendment"]), n && u.push(["span", { class: "it-doc-trust__what" }, n]), i && u.push(["span", { class: "it-doc-trust__date" }, i]);
|
|
1445
1461
|
else {
|
|
1446
|
-
const
|
|
1447
|
-
|
|
1462
|
+
const a = n || s.by || "", m = !!s.sig && !!s.key, d = [c, i].filter(Boolean).join(" · "), g = [
|
|
1463
|
+
["span", { class: "it-doc-trust__rule" }],
|
|
1464
|
+
["span", { class: "it-doc-trust__name" }, a]
|
|
1465
|
+
];
|
|
1466
|
+
d && g.push(["span", { class: "it-doc-trust__meta" }, d]), u.push(["span", { class: "it-doc-trust__body" }, ...g]), u.push([
|
|
1448
1467
|
"span",
|
|
1449
|
-
{ class: "it-doc-
|
|
1450
|
-
m ? "Signed
|
|
1468
|
+
{ class: "it-doc-trust__badge" },
|
|
1469
|
+
m ? "✓ Signed" : "Signed"
|
|
1451
1470
|
]);
|
|
1452
1471
|
}
|
|
1453
1472
|
return [
|
|
1454
1473
|
"div",
|
|
1455
|
-
|
|
1474
|
+
O(t, {
|
|
1456
1475
|
"data-it-trust": "",
|
|
1457
|
-
"data-trust":
|
|
1458
|
-
class: `it-doc-trust it-doc-trust--${
|
|
1476
|
+
"data-trust": r,
|
|
1477
|
+
class: `it-doc-trust it-doc-trust--${r}`
|
|
1459
1478
|
}),
|
|
1460
|
-
...
|
|
1479
|
+
...u
|
|
1461
1480
|
];
|
|
1462
1481
|
}
|
|
1463
|
-
}),
|
|
1482
|
+
}), pr = W.create({
|
|
1464
1483
|
name: "itMetric",
|
|
1465
1484
|
group: "block",
|
|
1466
1485
|
atom: !0,
|
|
@@ -1477,22 +1496,22 @@ const lr = Y.create({
|
|
|
1477
1496
|
return [{ tag: "div[data-it-metric]" }];
|
|
1478
1497
|
},
|
|
1479
1498
|
renderHTML({ HTMLAttributes: t, node: e }) {
|
|
1480
|
-
const { content:
|
|
1499
|
+
const { content: r, props: n } = Gt(String(e.attrs.raw || "")), s = [n.value, n.unit].filter(Boolean).join(" "), c = /\b(total|balance due|amount due|grand)\b/i.test(r), i = /\{\{[^}]+\}\}/.test(s);
|
|
1481
1500
|
return [
|
|
1482
1501
|
"div",
|
|
1483
|
-
|
|
1502
|
+
O(t, {
|
|
1484
1503
|
"data-it-metric": "",
|
|
1485
1504
|
class: `it-doc-metric${c ? " it-doc-metric--total" : ""}`
|
|
1486
1505
|
}),
|
|
1487
|
-
["span", { class: "it-doc-metric__label" },
|
|
1506
|
+
["span", { class: "it-doc-metric__label" }, r],
|
|
1488
1507
|
[
|
|
1489
1508
|
"span",
|
|
1490
|
-
{ class: `it-doc-metric__value${
|
|
1491
|
-
|
|
1509
|
+
{ class: `it-doc-metric__value${i ? " it-doc-var" : ""}` },
|
|
1510
|
+
s
|
|
1492
1511
|
]
|
|
1493
1512
|
];
|
|
1494
1513
|
}
|
|
1495
|
-
}),
|
|
1514
|
+
}), fr = W.create({
|
|
1496
1515
|
name: "itStyleRule",
|
|
1497
1516
|
group: "block",
|
|
1498
1517
|
atom: !0,
|
|
@@ -1509,19 +1528,19 @@ const lr = Y.create({
|
|
|
1509
1528
|
return [{ tag: "div[data-it-style-rule]" }];
|
|
1510
1529
|
},
|
|
1511
1530
|
renderHTML({ HTMLAttributes: t, node: e }) {
|
|
1512
|
-
const { content:
|
|
1531
|
+
const { content: r, props: n } = Gt(String(e.attrs.raw || "")), s = Object.entries(n).map(([c, i]) => `${c}: ${i}`).join(" · ");
|
|
1513
1532
|
return [
|
|
1514
1533
|
"div",
|
|
1515
|
-
|
|
1534
|
+
O(t, {
|
|
1516
1535
|
"data-it-style-rule": "",
|
|
1517
1536
|
class: "it-doc-stylerule"
|
|
1518
1537
|
}),
|
|
1519
1538
|
["span", { class: "it-doc-stylerule__icon" }, "🎨"],
|
|
1520
|
-
["span", { class: "it-doc-stylerule__target" },
|
|
1521
|
-
["span", { class: "it-doc-stylerule__decl" },
|
|
1539
|
+
["span", { class: "it-doc-stylerule__target" }, r || "?"],
|
|
1540
|
+
["span", { class: "it-doc-stylerule__decl" }, s]
|
|
1522
1541
|
];
|
|
1523
1542
|
}
|
|
1524
|
-
}),
|
|
1543
|
+
}), hr = W.create({
|
|
1525
1544
|
name: "itBreak",
|
|
1526
1545
|
group: "block",
|
|
1527
1546
|
atom: !0,
|
|
@@ -1531,13 +1550,13 @@ const lr = Y.create({
|
|
|
1531
1550
|
renderHTML({ HTMLAttributes: t }) {
|
|
1532
1551
|
return [
|
|
1533
1552
|
"div",
|
|
1534
|
-
|
|
1553
|
+
O(t, {
|
|
1535
1554
|
"data-it-type": "break",
|
|
1536
1555
|
class: "it-doc-break"
|
|
1537
1556
|
})
|
|
1538
1557
|
];
|
|
1539
1558
|
}
|
|
1540
|
-
}),
|
|
1559
|
+
}), gr = W.create({
|
|
1541
1560
|
name: "itGenericBlock",
|
|
1542
1561
|
group: "block",
|
|
1543
1562
|
content: "inline*",
|
|
@@ -1553,22 +1572,23 @@ const lr = Y.create({
|
|
|
1553
1572
|
return [{ tag: '[data-it-type="generic"]' }];
|
|
1554
1573
|
},
|
|
1555
1574
|
renderHTML({ HTMLAttributes: t, node: e }) {
|
|
1556
|
-
const
|
|
1557
|
-
|
|
1575
|
+
const r = e.attrs.keyword, n = pt(e.attrs.props), s = String(
|
|
1576
|
+
n.to || n.url || n.href || n.file || ""
|
|
1558
1577
|
).trim();
|
|
1559
|
-
return (
|
|
1578
|
+
return (r === "link" || r === "ref") && s ? [
|
|
1560
1579
|
"p",
|
|
1561
|
-
|
|
1580
|
+
O(t, {
|
|
1562
1581
|
"data-it-type": "generic",
|
|
1563
|
-
"data-keyword":
|
|
1564
|
-
class: `it-doc-generic it-doc-kw-${
|
|
1565
|
-
style:
|
|
1582
|
+
"data-keyword": r,
|
|
1583
|
+
class: `it-doc-generic it-doc-kw-${r}`,
|
|
1584
|
+
style: it(r, n),
|
|
1585
|
+
...ut(n)
|
|
1566
1586
|
}),
|
|
1567
1587
|
[
|
|
1568
1588
|
"a",
|
|
1569
1589
|
{
|
|
1570
1590
|
class: "it-doc-inline-link",
|
|
1571
|
-
href:
|
|
1591
|
+
href: s,
|
|
1572
1592
|
target: "_blank",
|
|
1573
1593
|
rel: "noopener noreferrer"
|
|
1574
1594
|
},
|
|
@@ -1576,16 +1596,17 @@ const lr = Y.create({
|
|
|
1576
1596
|
]
|
|
1577
1597
|
] : [
|
|
1578
1598
|
"p",
|
|
1579
|
-
|
|
1599
|
+
O(t, {
|
|
1580
1600
|
"data-it-type": "generic",
|
|
1581
|
-
"data-keyword":
|
|
1582
|
-
class: `it-doc-generic it-doc-kw-${
|
|
1583
|
-
style:
|
|
1601
|
+
"data-keyword": r,
|
|
1602
|
+
class: `it-doc-generic it-doc-kw-${r}`,
|
|
1603
|
+
style: it(r, n),
|
|
1604
|
+
...ut(n)
|
|
1584
1605
|
}),
|
|
1585
1606
|
["span", { class: "it-doc-generic-content" }, 0]
|
|
1586
1607
|
];
|
|
1587
1608
|
}
|
|
1588
|
-
}),
|
|
1609
|
+
}), mr = W.create({
|
|
1589
1610
|
name: "itComment",
|
|
1590
1611
|
group: "block",
|
|
1591
1612
|
content: "inline*",
|
|
@@ -1596,7 +1617,7 @@ const lr = Y.create({
|
|
|
1596
1617
|
renderHTML({ HTMLAttributes: t }) {
|
|
1597
1618
|
return [
|
|
1598
1619
|
"p",
|
|
1599
|
-
|
|
1620
|
+
O(t, {
|
|
1600
1621
|
"data-it-type": "comment",
|
|
1601
1622
|
class: "it-doc-comment"
|
|
1602
1623
|
}),
|
|
@@ -1604,19 +1625,20 @@ const lr = Y.create({
|
|
|
1604
1625
|
];
|
|
1605
1626
|
}
|
|
1606
1627
|
});
|
|
1607
|
-
function
|
|
1628
|
+
function pt(t) {
|
|
1608
1629
|
try {
|
|
1609
1630
|
return typeof t == "string" ? JSON.parse(t) : t || {};
|
|
1610
1631
|
} catch {
|
|
1611
1632
|
return {};
|
|
1612
1633
|
}
|
|
1613
1634
|
}
|
|
1614
|
-
const
|
|
1635
|
+
const Se = {
|
|
1615
1636
|
leading: "leading",
|
|
1616
1637
|
"space-before": "spaceBefore",
|
|
1617
1638
|
"space-after": "spaceAfter",
|
|
1618
|
-
end: "end"
|
|
1619
|
-
|
|
1639
|
+
end: "end",
|
|
1640
|
+
dir: "dir"
|
|
1641
|
+
}, br = /* @__PURE__ */ new Set([
|
|
1620
1642
|
"itTitle",
|
|
1621
1643
|
"itSummary",
|
|
1622
1644
|
"itSection",
|
|
@@ -1624,18 +1646,27 @@ const me = {
|
|
|
1624
1646
|
"itQuote",
|
|
1625
1647
|
"itCallout",
|
|
1626
1648
|
"itGenericBlock"
|
|
1627
|
-
]),
|
|
1628
|
-
function
|
|
1649
|
+
]), yr = /* @__PURE__ */ new Set(["itTitle", "itSection", "itSub"]);
|
|
1650
|
+
function ke(t) {
|
|
1629
1651
|
try {
|
|
1630
1652
|
return typeof t == "string" ? JSON.parse(t) : t || {};
|
|
1631
1653
|
} catch {
|
|
1632
1654
|
return {};
|
|
1633
1655
|
}
|
|
1634
1656
|
}
|
|
1635
|
-
|
|
1636
|
-
|
|
1657
|
+
const Sr = /* @__PURE__ */ new Set([
|
|
1658
|
+
"itTitle",
|
|
1659
|
+
"itSummary",
|
|
1660
|
+
"itSection",
|
|
1661
|
+
"itSub",
|
|
1662
|
+
"itQuote",
|
|
1663
|
+
"itCallout",
|
|
1664
|
+
"itGenericBlock"
|
|
1665
|
+
]);
|
|
1666
|
+
function ve(t, e) {
|
|
1667
|
+
return t === "paragraph" ? !0 : e === "end" ? yr.has(t) : e === "dir" ? Sr.has(t) : br.has(t);
|
|
1637
1668
|
}
|
|
1638
|
-
const
|
|
1669
|
+
const kr = sn.extend({
|
|
1639
1670
|
addAttributes() {
|
|
1640
1671
|
return {
|
|
1641
1672
|
...this.parent?.(),
|
|
@@ -1658,62 +1689,70 @@ const br = en.extend({
|
|
|
1658
1689
|
default: null,
|
|
1659
1690
|
parseHTML: (t) => t.getAttribute("data-it-end"),
|
|
1660
1691
|
renderHTML: (t) => t.end ? { "data-it-end": t.end } : {}
|
|
1692
|
+
},
|
|
1693
|
+
// Per-paragraph direction (Word's RTL paragraph button). Rendered as a
|
|
1694
|
+
// real `dir` DOM attribute so the caret + text flow mirror for THIS block
|
|
1695
|
+
// independently, regardless of the document direction.
|
|
1696
|
+
dir: {
|
|
1697
|
+
default: null,
|
|
1698
|
+
parseHTML: (t) => t.getAttribute("dir") || null,
|
|
1699
|
+
renderHTML: (t) => t.dir === "rtl" || t.dir === "ltr" || t.dir === "auto" ? { dir: t.dir } : {}
|
|
1661
1700
|
}
|
|
1662
1701
|
};
|
|
1663
1702
|
},
|
|
1664
1703
|
renderHTML({ node: t, HTMLAttributes: e }) {
|
|
1665
1704
|
return t.attrs.end ? [
|
|
1666
1705
|
"p",
|
|
1667
|
-
|
|
1706
|
+
O(e),
|
|
1668
1707
|
["span", { class: "it-split-main" }, 0]
|
|
1669
|
-
] : ["p",
|
|
1708
|
+
] : ["p", O(e), 0];
|
|
1670
1709
|
}
|
|
1671
|
-
}),
|
|
1710
|
+
}), vr = Tt.create({
|
|
1672
1711
|
name: "blockProps",
|
|
1673
1712
|
addCommands() {
|
|
1674
1713
|
return {
|
|
1675
|
-
setBlockProp: (t, e) => ({ state:
|
|
1676
|
-
const { from: c, to:
|
|
1677
|
-
let
|
|
1678
|
-
return
|
|
1679
|
-
const
|
|
1680
|
-
if (
|
|
1681
|
-
if (!
|
|
1682
|
-
if (
|
|
1683
|
-
|
|
1684
|
-
...
|
|
1685
|
-
[
|
|
1714
|
+
setBlockProp: (t, e) => ({ state: r, tr: n, dispatch: s }) => {
|
|
1715
|
+
const { from: c, to: i } = r.selection;
|
|
1716
|
+
let u = !1;
|
|
1717
|
+
return r.doc.nodesBetween(c, i, (a, m) => {
|
|
1718
|
+
const d = a.type.name;
|
|
1719
|
+
if (d === "bulletList" || d === "orderedList" || !a.isBlock || a.isAtom) return !1;
|
|
1720
|
+
if (!ve(d, t)) return !0;
|
|
1721
|
+
if (d === "paragraph")
|
|
1722
|
+
n.setNodeMarkup(m, void 0, {
|
|
1723
|
+
...a.attrs,
|
|
1724
|
+
[Se[t]]: e
|
|
1686
1725
|
});
|
|
1687
1726
|
else {
|
|
1688
|
-
const
|
|
1689
|
-
e == null || e === "" ? delete
|
|
1690
|
-
...
|
|
1691
|
-
props: JSON.stringify(
|
|
1727
|
+
const g = ke(a.attrs.props);
|
|
1728
|
+
e == null || e === "" ? delete g[t] : g[t] = e, n.setNodeMarkup(m, void 0, {
|
|
1729
|
+
...a.attrs,
|
|
1730
|
+
props: JSON.stringify(g)
|
|
1692
1731
|
});
|
|
1693
1732
|
}
|
|
1694
|
-
return
|
|
1695
|
-
}),
|
|
1733
|
+
return u = !0, !1;
|
|
1734
|
+
}), u && s && s(n), u;
|
|
1696
1735
|
}
|
|
1697
1736
|
};
|
|
1698
1737
|
}
|
|
1699
1738
|
});
|
|
1700
|
-
function
|
|
1739
|
+
function lt(t, e) {
|
|
1701
1740
|
if (!t) return null;
|
|
1702
|
-
const { state:
|
|
1741
|
+
const { state: r } = t, { from: n, to: s } = r.selection;
|
|
1703
1742
|
let c = null;
|
|
1704
|
-
return
|
|
1743
|
+
return r.doc.nodesBetween(n, s, (i) => {
|
|
1705
1744
|
if (c !== null) return !1;
|
|
1706
|
-
const
|
|
1707
|
-
if (!
|
|
1708
|
-
if (
|
|
1709
|
-
const
|
|
1710
|
-
c =
|
|
1745
|
+
const u = i.type.name;
|
|
1746
|
+
if (!ve(u, e)) return !0;
|
|
1747
|
+
if (u === "paragraph") {
|
|
1748
|
+
const a = i.attrs[Se[e]];
|
|
1749
|
+
c = a != null ? String(a) : "";
|
|
1711
1750
|
} else
|
|
1712
|
-
c =
|
|
1751
|
+
c = ke(i.attrs.props)[e] ?? "";
|
|
1713
1752
|
return !1;
|
|
1714
1753
|
}), c;
|
|
1715
1754
|
}
|
|
1716
|
-
const
|
|
1755
|
+
const se = {
|
|
1717
1756
|
identity: { label: "Identity", icon: "ID", color: "#3b82f6" },
|
|
1718
1757
|
content: { label: "Content", icon: "Tx", color: "#6b7280" },
|
|
1719
1758
|
structure: { label: "Structure", icon: "##", color: "#22c55e" },
|
|
@@ -1722,13 +1761,13 @@ const re = {
|
|
|
1722
1761
|
trust: { label: "Trust", icon: "Tr", color: "#eab308" },
|
|
1723
1762
|
layout: { label: "Layout", icon: "Pg", color: "#64748b" }
|
|
1724
1763
|
};
|
|
1725
|
-
function
|
|
1764
|
+
function wr(t) {
|
|
1726
1765
|
const e = document.createElement("iframe");
|
|
1727
1766
|
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);
|
|
1728
|
-
let
|
|
1729
|
-
const
|
|
1730
|
-
if (!
|
|
1731
|
-
|
|
1767
|
+
let r = !1;
|
|
1768
|
+
const n = () => {
|
|
1769
|
+
if (!r) {
|
|
1770
|
+
r = !0;
|
|
1732
1771
|
try {
|
|
1733
1772
|
e.contentWindow.focus(), e.contentWindow.print();
|
|
1734
1773
|
} finally {
|
|
@@ -1736,278 +1775,324 @@ function vr(t) {
|
|
|
1736
1775
|
}
|
|
1737
1776
|
}
|
|
1738
1777
|
};
|
|
1739
|
-
e.onload = () => window.setTimeout(
|
|
1740
|
-
const
|
|
1741
|
-
|
|
1778
|
+
e.onload = () => window.setTimeout(n, 120);
|
|
1779
|
+
const s = e.contentWindow.document;
|
|
1780
|
+
s.open(), s.write(t), s.close(), s.readyState === "complete" && window.setTimeout(n, 250);
|
|
1742
1781
|
}
|
|
1743
|
-
function
|
|
1782
|
+
function Tr(t, e) {
|
|
1744
1783
|
return t.includes("</head>") ? t.replace("</head>", `<style>${e}</style></head>`) : t;
|
|
1745
1784
|
}
|
|
1746
|
-
const
|
|
1747
|
-
function
|
|
1748
|
-
const
|
|
1749
|
-
if (!
|
|
1750
|
-
const
|
|
1751
|
-
|
|
1752
|
-
const
|
|
1785
|
+
const we = ".it-doc-callout{background:none!important;border:1px solid #ccc!important}", oe = qe;
|
|
1786
|
+
function xr(t, e) {
|
|
1787
|
+
const r = document.querySelector(".docs-page .tiptap");
|
|
1788
|
+
if (!r) return null;
|
|
1789
|
+
const n = r.cloneNode(!0);
|
|
1790
|
+
n.querySelectorAll("[data-it-spacer]").forEach((g) => g.remove()), n.querySelectorAll('.it-doc-comment, [data-it-type="comment"]').forEach((g) => g.remove());
|
|
1791
|
+
const s = n.innerHTML, c = Array.from(
|
|
1753
1792
|
document.querySelectorAll('style, link[rel="stylesheet"]')
|
|
1754
|
-
).map((
|
|
1755
|
-
`),
|
|
1756
|
-
let m = `@page{size:${
|
|
1757
|
-
|
|
1758
|
-
const
|
|
1793
|
+
).map((g) => g.outerHTML).join(`
|
|
1794
|
+
`), i = Bt(t), u = i.autoHeight ? `${i.width}px auto` : `${i.width}px ${i.height}px`, a = `${i.marginTop}px ${i.marginRight}px ${i.marginBottom}px ${i.marginLeft}px`;
|
|
1795
|
+
let m = `@page{size:${u};margin:${a};}`;
|
|
1796
|
+
i.header && (m += `@page{@top-center{content:${oe(i.header)};font:10px -apple-system,sans-serif;color:#9aa0a6;}}`), i.footer && (m += `@page{@bottom-center{content:${oe(i.footer)};font:10px -apple-system,sans-serif;color:#9aa0a6;}}`);
|
|
1797
|
+
const d = `
|
|
1759
1798
|
html,body{margin:0;background:#fff;}
|
|
1760
1799
|
.docs-page,.docs-page.docs-sheet{box-shadow:none;border-radius:0;margin:0;width:auto;min-height:0;padding:0;background:#fff;}
|
|
1761
1800
|
.docs-page .tiptap{padding:0;}
|
|
1762
1801
|
[data-it-spacer]{display:none!important;}
|
|
1763
|
-
${e === "minimal-ink" ?
|
|
1802
|
+
${e === "minimal-ink" ? we : ""}
|
|
1764
1803
|
`;
|
|
1765
|
-
return `<!doctype html><html><head><meta charset="utf-8">${c}<style>${m}${
|
|
1804
|
+
return `<!doctype html><html><head><meta charset="utf-8">${c}<style>${m}${d}</style></head><body><div class="docs-page docs-sheet"><div class="tiptap">${s}</div></div></body></html>`;
|
|
1766
1805
|
}
|
|
1767
|
-
function
|
|
1768
|
-
const
|
|
1769
|
-
c.href =
|
|
1806
|
+
function Te(t, e, r) {
|
|
1807
|
+
const n = new Blob([t], { type: r }), s = URL.createObjectURL(n), c = document.createElement("a");
|
|
1808
|
+
c.href = s, c.download = e, c.click(), URL.revokeObjectURL(s);
|
|
1770
1809
|
}
|
|
1771
|
-
function
|
|
1772
|
-
let
|
|
1773
|
-
if (!
|
|
1774
|
-
const
|
|
1775
|
-
|
|
1810
|
+
function xe(t, e, r) {
|
|
1811
|
+
let n = xr(t, r);
|
|
1812
|
+
if (!n) {
|
|
1813
|
+
const s = ot(t);
|
|
1814
|
+
n = Ke(s, { theme: e }), r === "minimal-ink" && (n = Tr(n, we));
|
|
1776
1815
|
}
|
|
1777
|
-
return
|
|
1816
|
+
return n;
|
|
1778
1817
|
}
|
|
1779
|
-
function
|
|
1818
|
+
function Ne(t, e, r = "normal") {
|
|
1780
1819
|
try {
|
|
1781
|
-
|
|
1820
|
+
wr(xe(t, e, r));
|
|
1782
1821
|
} catch {
|
|
1783
1822
|
}
|
|
1784
1823
|
}
|
|
1785
|
-
function
|
|
1824
|
+
function Nr(t, e) {
|
|
1786
1825
|
try {
|
|
1787
|
-
let
|
|
1788
|
-
if (!
|
|
1826
|
+
let r = e;
|
|
1827
|
+
if (!r)
|
|
1789
1828
|
try {
|
|
1790
|
-
const
|
|
1791
|
-
|
|
1829
|
+
const n = ot(t), c = n.blocks.find((a) => a.type === "meta")?.properties?.id, i = n.blocks.find((a) => a.type === "title")?.content || "";
|
|
1830
|
+
r = `${String(c || i || "document").trim().replace(/[^\w\-]+/g, "-").replace(/^-+|-+$/g, "").slice(0, 60) || "document"}.it`;
|
|
1792
1831
|
} catch {
|
|
1793
|
-
|
|
1832
|
+
r = "document.it";
|
|
1794
1833
|
}
|
|
1795
|
-
|
|
1834
|
+
Te(t, r, "text/plain;charset=utf-8");
|
|
1796
1835
|
} catch {
|
|
1797
1836
|
}
|
|
1798
1837
|
}
|
|
1799
|
-
function
|
|
1838
|
+
function hs(t, e, r = "normal") {
|
|
1800
1839
|
try {
|
|
1801
|
-
|
|
1802
|
-
|
|
1840
|
+
Te(
|
|
1841
|
+
xe(t, e, r),
|
|
1803
1842
|
"document.html",
|
|
1804
1843
|
"text/html"
|
|
1805
1844
|
);
|
|
1806
1845
|
} catch {
|
|
1807
1846
|
}
|
|
1808
1847
|
}
|
|
1809
|
-
function
|
|
1810
|
-
return
|
|
1848
|
+
function Lr() {
|
|
1849
|
+
return Ye();
|
|
1850
|
+
}
|
|
1851
|
+
function ie(t) {
|
|
1852
|
+
try {
|
|
1853
|
+
const e = ye(Ot(t));
|
|
1854
|
+
return e.trim() ? e : t;
|
|
1855
|
+
} catch {
|
|
1856
|
+
return t;
|
|
1857
|
+
}
|
|
1811
1858
|
}
|
|
1812
|
-
const
|
|
1813
|
-
function
|
|
1814
|
-
const [
|
|
1815
|
-
() => localStorage.getItem(
|
|
1816
|
-
), [
|
|
1817
|
-
const
|
|
1818
|
-
|
|
1859
|
+
const ae = "dotit.editor.lastSigner", ce = "dotit.editor.lastRole";
|
|
1860
|
+
function Ar({ content: t, onChange: e, trust: r, intact: n }) {
|
|
1861
|
+
const [s, c] = M(!1), [i, u] = M(!1), [a, m] = M(!1), [d, g] = M(
|
|
1862
|
+
() => localStorage.getItem(ae) || ""
|
|
1863
|
+
), [f, y] = M(() => localStorage.getItem(ce) || ""), [k, x] = M(!1), b = F(null), v = F(0), R = _((w) => {
|
|
1864
|
+
const I = Date.now();
|
|
1865
|
+
I - v.current < 400 || (v.current = I, w());
|
|
1819
1866
|
}, []);
|
|
1820
|
-
|
|
1821
|
-
if (!
|
|
1822
|
-
const
|
|
1823
|
-
|
|
1867
|
+
G(() => {
|
|
1868
|
+
if (!s) return;
|
|
1869
|
+
const w = (I) => {
|
|
1870
|
+
b.current && !b.current.contains(I.target) && (c(!1), m(!1));
|
|
1824
1871
|
};
|
|
1825
|
-
return document.addEventListener("mousedown",
|
|
1826
|
-
}, [
|
|
1827
|
-
const
|
|
1828
|
-
const
|
|
1829
|
-
if (
|
|
1830
|
-
|
|
1872
|
+
return document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w);
|
|
1873
|
+
}, [s]);
|
|
1874
|
+
const z = r.isSealed || Ve(t), B = _(() => {
|
|
1875
|
+
const w = d.trim();
|
|
1876
|
+
if (w) {
|
|
1877
|
+
x(!0);
|
|
1831
1878
|
try {
|
|
1832
|
-
const
|
|
1833
|
-
signer:
|
|
1834
|
-
role:
|
|
1879
|
+
const I = ie(t), H = Je(I, {
|
|
1880
|
+
signer: w,
|
|
1881
|
+
role: f.trim() || void 0
|
|
1835
1882
|
});
|
|
1836
|
-
|
|
1883
|
+
H.source && H.source !== t && e(H.source), localStorage.setItem(ae, w), f.trim() && localStorage.setItem(ce, f.trim());
|
|
1837
1884
|
} finally {
|
|
1838
|
-
|
|
1885
|
+
x(!1), m(!1), c(!1);
|
|
1839
1886
|
}
|
|
1840
1887
|
}
|
|
1841
|
-
}, [t, e,
|
|
1842
|
-
const
|
|
1843
|
-
|
|
1888
|
+
}, [t, e, d, f]), U = _(() => {
|
|
1889
|
+
const w = d.trim() || r.signatures[0]?.by || "Document owner";
|
|
1890
|
+
x(!0);
|
|
1844
1891
|
try {
|
|
1845
|
-
const
|
|
1846
|
-
signer:
|
|
1847
|
-
role:
|
|
1892
|
+
const I = Qe(ie(t), {
|
|
1893
|
+
signer: w,
|
|
1894
|
+
role: f.trim() || r.signatures[0]?.role || void 0,
|
|
1895
|
+
skipSign: !0
|
|
1848
1896
|
});
|
|
1849
|
-
|
|
1897
|
+
I.source && I.source !== t && !I.error && e(I.source);
|
|
1850
1898
|
} finally {
|
|
1851
|
-
|
|
1899
|
+
x(!1), c(!1);
|
|
1852
1900
|
}
|
|
1853
|
-
}, [t, e,
|
|
1854
|
-
|
|
1901
|
+
}, [t, e, d, f, r.signatures]), j = _(() => {
|
|
1902
|
+
x(!0);
|
|
1855
1903
|
try {
|
|
1856
|
-
const
|
|
1857
|
-
typeof
|
|
1904
|
+
const w = Xe(t);
|
|
1905
|
+
typeof w == "string" && w !== t && e(w);
|
|
1858
1906
|
} finally {
|
|
1859
|
-
|
|
1907
|
+
x(!1), c(!1);
|
|
1860
1908
|
}
|
|
1861
|
-
}, [t, e]), [
|
|
1909
|
+
}, [t, e]), [V, C] = M(null), P = _(() => {
|
|
1862
1910
|
try {
|
|
1863
|
-
|
|
1911
|
+
C(ge(t));
|
|
1864
1912
|
} catch {
|
|
1865
|
-
|
|
1913
|
+
C(null);
|
|
1866
1914
|
}
|
|
1867
1915
|
}, [t]);
|
|
1868
|
-
let
|
|
1869
|
-
return
|
|
1870
|
-
/* @__PURE__ */
|
|
1916
|
+
let X = /* @__PURE__ */ o($t, { size: 15 }), et = "Draft", Y = "trust-face--draft";
|
|
1917
|
+
return z ? (X = /* @__PURE__ */ o(qt, { size: 15 }), et = n === !1 ? "Sealed · changed!" : "Sealed", Y = n === !1 ? "trust-face--broken" : "trust-face--sealed") : r.signatures.length > 0 && (X = /* @__PURE__ */ o(Kt, { size: 15 }), et = `Signed · ${r.signatures.length}`, Y = "trust-face--signed"), /* @__PURE__ */ h("div", { className: "trust-control", ref: b, children: [
|
|
1918
|
+
/* @__PURE__ */ h(
|
|
1871
1919
|
"button",
|
|
1872
1920
|
{
|
|
1873
|
-
className: `docs-tb-btn trust-face ${
|
|
1921
|
+
className: `docs-tb-btn trust-face ${Y}`,
|
|
1874
1922
|
onClick: () => {
|
|
1875
|
-
c((
|
|
1923
|
+
c((w) => !w), m(!1), z && P();
|
|
1876
1924
|
},
|
|
1877
1925
|
title: "Document trust — sign, seal, verify",
|
|
1878
1926
|
children: [
|
|
1879
|
-
/* @__PURE__ */
|
|
1880
|
-
/* @__PURE__ */
|
|
1881
|
-
|
|
1882
|
-
/* @__PURE__ */
|
|
1927
|
+
/* @__PURE__ */ o("span", { className: "trust-face__icon", children: X }),
|
|
1928
|
+
/* @__PURE__ */ o("span", { className: "ribbon-btn-text", children: et }),
|
|
1929
|
+
z && n === !0 && /* @__PURE__ */ o("span", { className: "trust-face__ok", title: "Hash verified", children: "✓" }),
|
|
1930
|
+
/* @__PURE__ */ o(wt, { size: 12 })
|
|
1883
1931
|
]
|
|
1884
1932
|
}
|
|
1885
1933
|
),
|
|
1886
|
-
|
|
1887
|
-
/* @__PURE__ */
|
|
1888
|
-
/* @__PURE__ */
|
|
1889
|
-
/* @__PURE__ */
|
|
1890
|
-
|
|
1934
|
+
s && /* @__PURE__ */ h("div", { className: "trust-popover", children: [
|
|
1935
|
+
/* @__PURE__ */ o("div", { className: "trust-popover__state", children: z ? /* @__PURE__ */ h(Z, { children: [
|
|
1936
|
+
/* @__PURE__ */ o("strong", { children: "🔒 Sealed — read-only" }),
|
|
1937
|
+
/* @__PURE__ */ h("div", { className: "trust-popover__meta", children: [
|
|
1938
|
+
r.sealedBy && /* @__PURE__ */ h(Z, { children: [
|
|
1891
1939
|
"by ",
|
|
1892
|
-
|
|
1940
|
+
r.sealedBy
|
|
1893
1941
|
] }),
|
|
1894
|
-
|
|
1942
|
+
r.sealedAt && /* @__PURE__ */ h(Z, { children: [
|
|
1895
1943
|
" on ",
|
|
1896
|
-
|
|
1944
|
+
r.sealedAt
|
|
1897
1945
|
] })
|
|
1898
1946
|
] })
|
|
1899
|
-
] }) :
|
|
1900
|
-
/* @__PURE__ */
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
/* @__PURE__ */
|
|
1947
|
+
] }) : r.signatures.length > 0 ? /* @__PURE__ */ h(Z, { children: [
|
|
1948
|
+
/* @__PURE__ */ h("strong", { children: [
|
|
1949
|
+
"Signed · ",
|
|
1950
|
+
r.signatures.length
|
|
1951
|
+
] }),
|
|
1952
|
+
/* @__PURE__ */ o("div", { className: "trust-popover__meta", children: r.signatures.map((w) => w.role ? `${w.by} (${w.role})` : w.by).join(" · ") }),
|
|
1953
|
+
/* @__PURE__ */ h("div", { className: "trust-popover__warn", children: [
|
|
1954
|
+
"⚠ Still editable — editing will break",
|
|
1955
|
+
" ",
|
|
1956
|
+
r.signatures.length,
|
|
1957
|
+
" signature",
|
|
1958
|
+
r.signatures.length === 1 ? "" : "s",
|
|
1959
|
+
". Seal to lock it."
|
|
1960
|
+
] })
|
|
1961
|
+
] }) : /* @__PURE__ */ h(Z, { children: [
|
|
1962
|
+
/* @__PURE__ */ o("strong", { children: "Draft" }),
|
|
1963
|
+
/* @__PURE__ */ o("div", { className: "trust-popover__meta", children: "Not signed or sealed yet." })
|
|
1905
1964
|
] }) }),
|
|
1906
|
-
/* @__PURE__ */
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1965
|
+
/* @__PURE__ */ o(
|
|
1966
|
+
"button",
|
|
1967
|
+
{
|
|
1968
|
+
className: "trust-popover__help-toggle",
|
|
1969
|
+
onClick: () => u((w) => !w),
|
|
1970
|
+
children: "(?) what does this mean"
|
|
1971
|
+
}
|
|
1972
|
+
),
|
|
1973
|
+
i && /* @__PURE__ */ h("div", { className: "trust-popover__help", children: [
|
|
1974
|
+
/* @__PURE__ */ h("p", { children: [
|
|
1975
|
+
/* @__PURE__ */ o("b", { children: "Sign" }),
|
|
1976
|
+
" adds your name to the document. It stays editable — but changing it afterwards invalidates the signatures."
|
|
1977
|
+
] }),
|
|
1978
|
+
/* @__PURE__ */ h("p", { children: [
|
|
1979
|
+
/* @__PURE__ */ o("b", { children: "Seal" }),
|
|
1980
|
+
" freezes the document with a tamper-evident hash and makes it ",
|
|
1981
|
+
/* @__PURE__ */ o("b", { children: "read-only" }),
|
|
1982
|
+
". ",
|
|
1983
|
+
/* @__PURE__ */ o("b", { children: "Unseal" }),
|
|
1984
|
+
" makes it editable again."
|
|
1985
|
+
] }),
|
|
1986
|
+
/* @__PURE__ */ h("p", { children: [
|
|
1987
|
+
/* @__PURE__ */ o("b", { children: "Verify" }),
|
|
1988
|
+
" recomputes the hash and confirms the content still matches the seal."
|
|
1989
|
+
] })
|
|
1990
|
+
] }),
|
|
1991
|
+
/* @__PURE__ */ o("div", { className: "trust-popover__divider" }),
|
|
1992
|
+
z ? /* @__PURE__ */ h(Z, { children: [
|
|
1993
|
+
/* @__PURE__ */ h("div", { className: "trust-popover__verify", children: [
|
|
1994
|
+
V ? V.intact ? /* @__PURE__ */ o("span", { className: "trust-verify--ok", children: "✓ Verified — content matches the seal" }) : /* @__PURE__ */ o("span", { className: "trust-verify--bad", children: "⚠ Hash mismatch — content changed after sealing" }) : null,
|
|
1995
|
+
V?.hash && /* @__PURE__ */ h("details", { className: "trust-popover__hash", children: [
|
|
1996
|
+
/* @__PURE__ */ o("summary", { children: "Show hash" }),
|
|
1997
|
+
/* @__PURE__ */ o("code", { children: V.hash })
|
|
1913
1998
|
] })
|
|
1914
1999
|
] }),
|
|
1915
|
-
/* @__PURE__ */
|
|
2000
|
+
/* @__PURE__ */ h(
|
|
1916
2001
|
"button",
|
|
1917
2002
|
{
|
|
1918
2003
|
className: "trust-popover__action",
|
|
1919
|
-
onClick: () =>
|
|
1920
|
-
disabled:
|
|
2004
|
+
onClick: () => R(P),
|
|
2005
|
+
disabled: k,
|
|
1921
2006
|
children: [
|
|
1922
|
-
/* @__PURE__ */
|
|
2007
|
+
/* @__PURE__ */ o(Kt, { size: 14 }),
|
|
1923
2008
|
" Re-verify"
|
|
1924
2009
|
]
|
|
1925
2010
|
}
|
|
1926
2011
|
),
|
|
1927
|
-
/* @__PURE__ */
|
|
2012
|
+
/* @__PURE__ */ h(
|
|
1928
2013
|
"button",
|
|
1929
2014
|
{
|
|
1930
2015
|
className: "trust-popover__action trust-popover__action--warn",
|
|
1931
|
-
onClick: () =>
|
|
1932
|
-
disabled:
|
|
2016
|
+
onClick: () => R(j),
|
|
2017
|
+
disabled: k,
|
|
1933
2018
|
title: "Remove the freeze lock (keeps signatures) and make the document editable again",
|
|
1934
2019
|
children: [
|
|
1935
|
-
/* @__PURE__ */
|
|
2020
|
+
/* @__PURE__ */ o(on, { size: 14 }),
|
|
1936
2021
|
" Unseal (make editable)"
|
|
1937
2022
|
]
|
|
1938
2023
|
}
|
|
1939
2024
|
)
|
|
1940
|
-
] }) : a ? /* @__PURE__ */
|
|
1941
|
-
/* @__PURE__ */
|
|
2025
|
+
] }) : a ? /* @__PURE__ */ h("div", { className: "trust-sign-form", children: [
|
|
2026
|
+
/* @__PURE__ */ o(
|
|
1942
2027
|
"input",
|
|
1943
2028
|
{
|
|
1944
2029
|
className: "trust-sign-input",
|
|
1945
2030
|
placeholder: "Your name",
|
|
1946
|
-
value:
|
|
2031
|
+
value: d,
|
|
1947
2032
|
autoFocus: !0,
|
|
1948
|
-
onChange: (
|
|
1949
|
-
onKeyDown: (
|
|
1950
|
-
|
|
2033
|
+
onChange: (w) => g(w.target.value),
|
|
2034
|
+
onKeyDown: (w) => {
|
|
2035
|
+
w.key === "Enter" && B(), w.key === "Escape" && m(!1);
|
|
1951
2036
|
}
|
|
1952
2037
|
}
|
|
1953
2038
|
),
|
|
1954
|
-
/* @__PURE__ */
|
|
2039
|
+
/* @__PURE__ */ o(
|
|
1955
2040
|
"input",
|
|
1956
2041
|
{
|
|
1957
2042
|
className: "trust-sign-input",
|
|
1958
2043
|
placeholder: "Role (optional, e.g. CEO)",
|
|
1959
|
-
value:
|
|
1960
|
-
onChange: (
|
|
1961
|
-
onKeyDown: (
|
|
1962
|
-
|
|
2044
|
+
value: f,
|
|
2045
|
+
onChange: (w) => y(w.target.value),
|
|
2046
|
+
onKeyDown: (w) => {
|
|
2047
|
+
w.key === "Enter" && B(), w.key === "Escape" && m(!1);
|
|
1963
2048
|
}
|
|
1964
2049
|
}
|
|
1965
2050
|
),
|
|
1966
|
-
/* @__PURE__ */
|
|
1967
|
-
/* @__PURE__ */
|
|
2051
|
+
/* @__PURE__ */ h("div", { className: "trust-sign-actions", children: [
|
|
2052
|
+
/* @__PURE__ */ h(
|
|
1968
2053
|
"button",
|
|
1969
2054
|
{
|
|
1970
2055
|
className: "trust-popover__action trust-popover__action--primary",
|
|
1971
|
-
onClick:
|
|
1972
|
-
disabled:
|
|
2056
|
+
onClick: B,
|
|
2057
|
+
disabled: k || !d.trim(),
|
|
1973
2058
|
children: [
|
|
1974
|
-
/* @__PURE__ */
|
|
2059
|
+
/* @__PURE__ */ o($t, { size: 14 }),
|
|
1975
2060
|
" Add signature"
|
|
1976
2061
|
]
|
|
1977
2062
|
}
|
|
1978
2063
|
),
|
|
1979
|
-
/* @__PURE__ */
|
|
2064
|
+
/* @__PURE__ */ o(
|
|
1980
2065
|
"button",
|
|
1981
2066
|
{
|
|
1982
2067
|
className: "trust-popover__action",
|
|
1983
|
-
onClick: () =>
|
|
2068
|
+
onClick: () => m(!1),
|
|
1984
2069
|
children: "Cancel"
|
|
1985
2070
|
}
|
|
1986
2071
|
)
|
|
1987
2072
|
] })
|
|
1988
|
-
] }) : /* @__PURE__ */
|
|
1989
|
-
/* @__PURE__ */
|
|
2073
|
+
] }) : /* @__PURE__ */ h(Z, { children: [
|
|
2074
|
+
/* @__PURE__ */ h(
|
|
1990
2075
|
"button",
|
|
1991
2076
|
{
|
|
1992
2077
|
className: "trust-popover__action",
|
|
1993
|
-
onClick: () =>
|
|
1994
|
-
disabled:
|
|
2078
|
+
onClick: () => m(!0),
|
|
2079
|
+
disabled: k,
|
|
1995
2080
|
title: "Add a signature line (does not freeze the document)",
|
|
1996
2081
|
children: [
|
|
1997
|
-
/* @__PURE__ */
|
|
2082
|
+
/* @__PURE__ */ o($t, { size: 14 }),
|
|
1998
2083
|
" Sign"
|
|
1999
2084
|
]
|
|
2000
2085
|
}
|
|
2001
2086
|
),
|
|
2002
|
-
/* @__PURE__ */
|
|
2087
|
+
/* @__PURE__ */ h(
|
|
2003
2088
|
"button",
|
|
2004
2089
|
{
|
|
2005
2090
|
className: "trust-popover__action trust-popover__action--primary",
|
|
2006
|
-
onClick: () =>
|
|
2007
|
-
disabled:
|
|
2091
|
+
onClick: () => R(U),
|
|
2092
|
+
disabled: k,
|
|
2008
2093
|
title: "Freeze the document with a tamper-evident hash. It becomes read-only until unsealed.",
|
|
2009
2094
|
children: [
|
|
2010
|
-
/* @__PURE__ */
|
|
2095
|
+
/* @__PURE__ */ o(qt, { size: 14 }),
|
|
2011
2096
|
" Seal (freeze)"
|
|
2012
2097
|
]
|
|
2013
2098
|
}
|
|
@@ -2016,32 +2101,32 @@ function xr({ content: t, onChange: e, trust: n, intact: r }) {
|
|
|
2016
2101
|
] })
|
|
2017
2102
|
] });
|
|
2018
2103
|
}
|
|
2019
|
-
const
|
|
2104
|
+
const zt = [
|
|
2020
2105
|
{ label: "Normal text", node: "paragraph" },
|
|
2021
2106
|
{ label: "Title", node: "itTitle" },
|
|
2022
2107
|
{ label: "Section", node: "itSection" },
|
|
2023
2108
|
{ label: "Subsection", node: "itSub" },
|
|
2024
2109
|
{ label: "Summary", node: "itSummary" },
|
|
2025
2110
|
{ label: "Quote", node: "itQuote" }
|
|
2026
|
-
],
|
|
2111
|
+
], Cr = /* @__PURE__ */ new Set([
|
|
2027
2112
|
"history",
|
|
2028
2113
|
"revision",
|
|
2029
2114
|
"track",
|
|
2030
2115
|
"freeze"
|
|
2031
|
-
]),
|
|
2116
|
+
]), $r = /* @__PURE__ */ new Set([
|
|
2032
2117
|
"agent",
|
|
2033
2118
|
"model",
|
|
2034
2119
|
"meta",
|
|
2035
2120
|
"context",
|
|
2036
2121
|
"history"
|
|
2037
|
-
]),
|
|
2122
|
+
]), _r = [
|
|
2038
2123
|
"identity",
|
|
2039
2124
|
"structure",
|
|
2040
2125
|
"content",
|
|
2041
2126
|
"data",
|
|
2042
2127
|
"trust",
|
|
2043
2128
|
"layout"
|
|
2044
|
-
],
|
|
2129
|
+
], le = [
|
|
2045
2130
|
{ label: "Default", value: "" },
|
|
2046
2131
|
{ label: "Inter", value: "Inter" },
|
|
2047
2132
|
{ label: "Arial", value: "Arial" },
|
|
@@ -2050,7 +2135,7 @@ const Et = [
|
|
|
2050
2135
|
{ label: "Courier New", value: "Courier New" },
|
|
2051
2136
|
{ label: "Verdana", value: "Verdana" },
|
|
2052
2137
|
{ label: "Trebuchet MS", value: "Trebuchet MS" }
|
|
2053
|
-
],
|
|
2138
|
+
], Mr = ["1", "1.15", "1.5", "2", "2.5", "3"], Er = "12px", zr = [
|
|
2054
2139
|
"#000000",
|
|
2055
2140
|
"#434343",
|
|
2056
2141
|
"#666666",
|
|
@@ -2101,7 +2186,7 @@ const Et = [
|
|
|
2101
2186
|
"#6fa8dc",
|
|
2102
2187
|
"#8e7cc3",
|
|
2103
2188
|
"#c27ba0"
|
|
2104
|
-
],
|
|
2189
|
+
], Hr = [
|
|
2105
2190
|
"#ffffff",
|
|
2106
2191
|
"#cfe2f3",
|
|
2107
2192
|
"#d9ead3",
|
|
@@ -2116,249 +2201,249 @@ const Et = [
|
|
|
2116
2201
|
function E({
|
|
2117
2202
|
onClick: t,
|
|
2118
2203
|
active: e,
|
|
2119
|
-
disabled:
|
|
2120
|
-
title:
|
|
2121
|
-
children:
|
|
2204
|
+
disabled: r,
|
|
2205
|
+
title: n,
|
|
2206
|
+
children: s
|
|
2122
2207
|
}) {
|
|
2123
|
-
return /* @__PURE__ */
|
|
2208
|
+
return /* @__PURE__ */ o(
|
|
2124
2209
|
"button",
|
|
2125
2210
|
{
|
|
2126
2211
|
className: `docs-tb-btn${e ? " active" : ""}`,
|
|
2127
2212
|
onClick: t,
|
|
2128
|
-
disabled:
|
|
2129
|
-
title:
|
|
2130
|
-
children:
|
|
2213
|
+
disabled: r,
|
|
2214
|
+
title: n,
|
|
2215
|
+
children: s
|
|
2131
2216
|
}
|
|
2132
2217
|
);
|
|
2133
2218
|
}
|
|
2134
|
-
function
|
|
2219
|
+
function rt({
|
|
2135
2220
|
label: t,
|
|
2136
2221
|
children: e,
|
|
2137
|
-
className:
|
|
2222
|
+
className: r = ""
|
|
2138
2223
|
}) {
|
|
2139
|
-
return /* @__PURE__ */
|
|
2224
|
+
return /* @__PURE__ */ o(
|
|
2140
2225
|
"div",
|
|
2141
2226
|
{
|
|
2142
|
-
className: `ribbon-group ${
|
|
2227
|
+
className: `ribbon-group ${r}`.trim(),
|
|
2143
2228
|
role: "group",
|
|
2144
2229
|
"aria-label": t,
|
|
2145
2230
|
children: e
|
|
2146
2231
|
}
|
|
2147
2232
|
);
|
|
2148
2233
|
}
|
|
2149
|
-
function
|
|
2150
|
-
return /* @__PURE__ */
|
|
2234
|
+
function dt() {
|
|
2235
|
+
return /* @__PURE__ */ o("div", { className: "ribbon-sep" });
|
|
2151
2236
|
}
|
|
2152
|
-
function
|
|
2237
|
+
function Rr({
|
|
2153
2238
|
editor: t,
|
|
2154
2239
|
isRtl: e = !1,
|
|
2155
|
-
onToggleRtl:
|
|
2156
|
-
content:
|
|
2157
|
-
onChange:
|
|
2240
|
+
onToggleRtl: r,
|
|
2241
|
+
content: n,
|
|
2242
|
+
onChange: s,
|
|
2158
2243
|
theme: c,
|
|
2159
|
-
onThemeChange:
|
|
2160
|
-
onTrustAction:
|
|
2161
|
-
trust:
|
|
2244
|
+
onThemeChange: i,
|
|
2245
|
+
onTrustAction: u,
|
|
2246
|
+
trust: a,
|
|
2162
2247
|
sealIntact: m = null,
|
|
2163
|
-
locked:
|
|
2248
|
+
locked: d = !1
|
|
2164
2249
|
}) {
|
|
2165
|
-
const [
|
|
2166
|
-
|
|
2250
|
+
const [g, f] = M(!1), [y, k] = M(!1), [x, b] = M(!1), [v, R] = M(!1), [z, B] = M(!1), [U, j] = M(!1), [V, C] = M(!1), P = F(null), X = F(null), et = F(null), Y = F(null), w = F(null), I = F(null);
|
|
2251
|
+
G(() => {
|
|
2167
2252
|
const p = (A) => {
|
|
2168
2253
|
const N = A.target;
|
|
2169
|
-
|
|
2254
|
+
P.current && !P.current.contains(N) && f(!1), X.current && !X.current.contains(N) && k(!1), et.current && !et.current.contains(N) && b(!1), Y.current && !Y.current.contains(N) && R(!1), w.current && !w.current.contains(N) && B(!1), I.current && !I.current.contains(N) && j(!1);
|
|
2170
2255
|
};
|
|
2171
2256
|
return document.addEventListener("mousedown", p), () => document.removeEventListener("mousedown", p);
|
|
2172
2257
|
}, []);
|
|
2173
|
-
const
|
|
2174
|
-
f(!1),
|
|
2175
|
-
},
|
|
2258
|
+
const H = () => {
|
|
2259
|
+
f(!1), k(!1), b(!1), R(!1), B(!1), j(!1);
|
|
2260
|
+
}, ft = _(() => {
|
|
2176
2261
|
if (!t) return "Normal text";
|
|
2177
|
-
for (const p of
|
|
2262
|
+
for (const p of zt)
|
|
2178
2263
|
if (p.node === "paragraph" && t.isActive("paragraph")) {
|
|
2179
|
-
if (!
|
|
2264
|
+
if (!zt.some(
|
|
2180
2265
|
(N) => N.node !== "paragraph" && t.isActive(N.node)
|
|
2181
2266
|
)) return p.label;
|
|
2182
2267
|
} else if (t.isActive(p.node))
|
|
2183
2268
|
return p.label;
|
|
2184
2269
|
return "Normal text";
|
|
2185
|
-
}, [t]),
|
|
2270
|
+
}, [t]), yt = _(() => {
|
|
2186
2271
|
if (!t) return "Default";
|
|
2187
2272
|
const p = t.getAttributes("textStyle")?.fontFamily;
|
|
2188
2273
|
if (!p) return "Default";
|
|
2189
|
-
const A =
|
|
2274
|
+
const A = le.find((N) => N.value === p);
|
|
2190
2275
|
return A ? A.label : "Default";
|
|
2191
|
-
}, [t]), [
|
|
2276
|
+
}, [t]), [at, S] = M(11), [, T] = M(0), L = tt(() => {
|
|
2192
2277
|
const p = /* @__PURE__ */ new Map();
|
|
2193
|
-
for (const N of
|
|
2194
|
-
if (N.status !== "stable" ||
|
|
2195
|
-
const
|
|
2196
|
-
|
|
2278
|
+
for (const N of Ze) {
|
|
2279
|
+
if (N.status !== "stable" || $r.has(N.canonical) || N.category === "agent") continue;
|
|
2280
|
+
const ct = N.category, xt = p.get(ct) || [];
|
|
2281
|
+
xt.push({
|
|
2197
2282
|
label: N.canonical,
|
|
2198
2283
|
keyword: N.canonical,
|
|
2199
|
-
category:
|
|
2284
|
+
category: ct,
|
|
2200
2285
|
description: N.description,
|
|
2201
|
-
isReadOnly:
|
|
2202
|
-
}), p.set(
|
|
2286
|
+
isReadOnly: Cr.has(N.canonical)
|
|
2287
|
+
}), p.set(ct, xt);
|
|
2203
2288
|
}
|
|
2204
2289
|
const A = [];
|
|
2205
|
-
for (const N of
|
|
2206
|
-
const
|
|
2207
|
-
!
|
|
2208
|
-
category:
|
|
2209
|
-
items:
|
|
2290
|
+
for (const N of _r) {
|
|
2291
|
+
const ct = p.get(N);
|
|
2292
|
+
!ct || ct.length === 0 || (ct.sort((xt, ze) => xt.keyword.localeCompare(ze.keyword)), A.push({
|
|
2293
|
+
category: se[N]?.label || N,
|
|
2294
|
+
items: ct
|
|
2210
2295
|
}));
|
|
2211
2296
|
}
|
|
2212
2297
|
return A;
|
|
2213
2298
|
}, []);
|
|
2214
|
-
|
|
2299
|
+
G(() => {
|
|
2215
2300
|
if (!t) return;
|
|
2216
2301
|
const p = () => {
|
|
2217
2302
|
const A = t.getAttributes("textStyle");
|
|
2218
2303
|
if (A?.fontSize) {
|
|
2219
2304
|
const N = parseInt(A.fontSize, 10);
|
|
2220
|
-
isNaN(N) ||
|
|
2305
|
+
isNaN(N) || S(N);
|
|
2221
2306
|
}
|
|
2222
|
-
|
|
2307
|
+
T((N) => N + 1);
|
|
2223
2308
|
};
|
|
2224
2309
|
return t.on("selectionUpdate", p), t.on("transaction", p), () => {
|
|
2225
2310
|
t.off("selectionUpdate", p), t.off("transaction", p);
|
|
2226
2311
|
};
|
|
2227
2312
|
}, [t]);
|
|
2228
|
-
const
|
|
2313
|
+
const K = _(
|
|
2229
2314
|
(p) => {
|
|
2230
|
-
t && (p === "paragraph" ? t.chain().focus().setParagraph().run() : p === "itQuote" ? t.chain().focus().setNode("itQuote").run() : t.chain().focus().setNode(p).run(),
|
|
2315
|
+
t && (p === "paragraph" ? t.chain().focus().setParagraph().run() : p === "itQuote" ? t.chain().focus().setNode("itQuote").run() : t.chain().focus().setNode(p).run(), H());
|
|
2231
2316
|
},
|
|
2232
2317
|
[t]
|
|
2233
|
-
),
|
|
2318
|
+
), J = _(
|
|
2234
2319
|
(p) => {
|
|
2235
2320
|
if (!t) return;
|
|
2236
2321
|
const A = t.chain().focus();
|
|
2237
|
-
p === "divider" ? A.setNode("itDivider").run() : p === "break" ? A.setNode("itBreak").run() : p === "code" ? A.setNode("itCode", { lang: "" }).run() : ["tip", "info", "warning", "danger", "success"].includes(p) ? A.setNode("itCallout", { variant: p }).run() : A.setNode("itGenericBlock", { keyword: p, properties: "" }).run(),
|
|
2322
|
+
p === "divider" ? A.setNode("itDivider").run() : p === "break" ? A.setNode("itBreak").run() : p === "code" ? A.setNode("itCode", { lang: "" }).run() : ["tip", "info", "warning", "danger", "success"].includes(p) ? A.setNode("itCallout", { variant: p }).run() : A.setNode("itGenericBlock", { keyword: p, properties: "" }).run(), H();
|
|
2238
2323
|
},
|
|
2239
2324
|
[t]
|
|
2240
|
-
),
|
|
2325
|
+
), nt = _(
|
|
2241
2326
|
(p) => {
|
|
2242
|
-
const A = Math.min(96, Math.max(8,
|
|
2243
|
-
|
|
2327
|
+
const A = Math.min(96, Math.max(8, at + p));
|
|
2328
|
+
S(A), t?.chain().focus().setFontSize(`${A}pt`).run();
|
|
2244
2329
|
},
|
|
2245
|
-
[t,
|
|
2246
|
-
),
|
|
2330
|
+
[t, at]
|
|
2331
|
+
), q = _(
|
|
2247
2332
|
(p) => {
|
|
2248
|
-
t?.chain().focus().setBlockProp("leading", p).run(),
|
|
2333
|
+
t?.chain().focus().setBlockProp("leading", p).run(), H();
|
|
2249
2334
|
},
|
|
2250
2335
|
[t]
|
|
2251
|
-
),
|
|
2336
|
+
), gt = _(
|
|
2252
2337
|
(p) => {
|
|
2253
2338
|
if (!t) return;
|
|
2254
|
-
const A =
|
|
2255
|
-
t.chain().focus().setBlockProp(p, A ? null :
|
|
2339
|
+
const A = lt(t, p);
|
|
2340
|
+
t.chain().focus().setBlockProp(p, A ? null : Er).run(), H();
|
|
2256
2341
|
},
|
|
2257
2342
|
[t]
|
|
2258
|
-
),
|
|
2343
|
+
), St = _(() => {
|
|
2259
2344
|
if (!t) return;
|
|
2260
2345
|
const p = window.prompt(
|
|
2261
2346
|
"Space before block (e.g. 12px, 1em — empty for none):",
|
|
2262
|
-
|
|
2347
|
+
lt(t, "space-before") || ""
|
|
2263
2348
|
);
|
|
2264
2349
|
if (p === null) return;
|
|
2265
2350
|
const A = window.prompt(
|
|
2266
2351
|
"Space after block (e.g. 12px, 1em — empty for none):",
|
|
2267
|
-
|
|
2352
|
+
lt(t, "space-after") || ""
|
|
2268
2353
|
);
|
|
2269
|
-
A !== null && (t.chain().focus().setBlockProp("space-before", p.trim() || null).setBlockProp("space-after", A.trim() || null).run(),
|
|
2270
|
-
}, [t]),
|
|
2354
|
+
A !== null && (t.chain().focus().setBlockProp("space-before", p.trim() || null).setBlockProp("space-after", A.trim() || null).run(), H());
|
|
2355
|
+
}, [t]), Ae = _(() => {
|
|
2271
2356
|
if (!t) return;
|
|
2272
|
-
const p =
|
|
2357
|
+
const p = lt(t, "end"), A = window.prompt(
|
|
2273
2358
|
"Line-end text (shown at the end of the line — empty to remove):",
|
|
2274
2359
|
p || ""
|
|
2275
2360
|
);
|
|
2276
2361
|
A !== null && t.chain().focus().setBlockProp("end", A.trim() || null).run();
|
|
2277
|
-
}, [t]),
|
|
2362
|
+
}, [t]), Ce = _(() => {
|
|
2278
2363
|
t && (t.chain().focus().insertContent({
|
|
2279
2364
|
type: "paragraph",
|
|
2280
2365
|
attrs: { end: "End text" },
|
|
2281
2366
|
content: [{ type: "text", text: "Start text" }]
|
|
2282
|
-
}).run(),
|
|
2283
|
-
}, [t]),
|
|
2284
|
-
() =>
|
|
2285
|
-
[
|
|
2286
|
-
),
|
|
2367
|
+
}).run(), H());
|
|
2368
|
+
}, [t]), $e = tt(() => Lr(), []), Wt = V ? "minimal-ink" : "normal", _e = _(
|
|
2369
|
+
() => Ne(n, c, Wt),
|
|
2370
|
+
[n, c, Wt]
|
|
2371
|
+
), Me = _(() => Nr(n), [n]);
|
|
2287
2372
|
if (!t) return null;
|
|
2288
|
-
const
|
|
2289
|
-
return /* @__PURE__ */
|
|
2290
|
-
/* @__PURE__ */
|
|
2291
|
-
/* @__PURE__ */
|
|
2373
|
+
const Ct = lt(t, "leading"), Ee = !!lt(t, "end");
|
|
2374
|
+
return /* @__PURE__ */ h("div", { className: "docs-toolbar docs-ribbon", children: [
|
|
2375
|
+
/* @__PURE__ */ h(rt, { label: "Edit", children: [
|
|
2376
|
+
/* @__PURE__ */ o(
|
|
2292
2377
|
E,
|
|
2293
2378
|
{
|
|
2294
2379
|
onClick: () => t.chain().focus().undo().run(),
|
|
2295
|
-
disabled:
|
|
2380
|
+
disabled: d || !t.can().undo(),
|
|
2296
2381
|
title: "Undo (⌘Z)",
|
|
2297
|
-
children: /* @__PURE__ */
|
|
2382
|
+
children: /* @__PURE__ */ o(an, { size: 16 })
|
|
2298
2383
|
}
|
|
2299
2384
|
),
|
|
2300
|
-
/* @__PURE__ */
|
|
2385
|
+
/* @__PURE__ */ o(
|
|
2301
2386
|
E,
|
|
2302
2387
|
{
|
|
2303
2388
|
onClick: () => t.chain().focus().redo().run(),
|
|
2304
|
-
disabled:
|
|
2389
|
+
disabled: d || !t.can().redo(),
|
|
2305
2390
|
title: "Redo (⌘⇧Z)",
|
|
2306
|
-
children: /* @__PURE__ */
|
|
2391
|
+
children: /* @__PURE__ */ o(cn, { size: 16 })
|
|
2307
2392
|
}
|
|
2308
2393
|
)
|
|
2309
2394
|
] }),
|
|
2310
|
-
/* @__PURE__ */
|
|
2311
|
-
/* @__PURE__ */
|
|
2312
|
-
/* @__PURE__ */
|
|
2313
|
-
/* @__PURE__ */
|
|
2314
|
-
/* @__PURE__ */
|
|
2395
|
+
/* @__PURE__ */ o(dt, {}),
|
|
2396
|
+
/* @__PURE__ */ h(rt, { label: "File", children: [
|
|
2397
|
+
/* @__PURE__ */ h(E, { onClick: Me, title: "Save / Download the .it file", children: [
|
|
2398
|
+
/* @__PURE__ */ o(ln, { size: 16 }),
|
|
2399
|
+
/* @__PURE__ */ o("span", { className: "ribbon-btn-text", children: "Save" })
|
|
2315
2400
|
] }),
|
|
2316
|
-
/* @__PURE__ */
|
|
2317
|
-
/* @__PURE__ */
|
|
2318
|
-
/* @__PURE__ */
|
|
2401
|
+
/* @__PURE__ */ h(E, { onClick: _e, title: "Export PDF (⌘P) — WYSIWYG", children: [
|
|
2402
|
+
/* @__PURE__ */ o(dn, { size: 16 }),
|
|
2403
|
+
/* @__PURE__ */ o("span", { className: "ribbon-btn-text", children: "PDF" })
|
|
2319
2404
|
] }),
|
|
2320
|
-
/* @__PURE__ */
|
|
2405
|
+
/* @__PURE__ */ o(
|
|
2321
2406
|
E,
|
|
2322
2407
|
{
|
|
2323
2408
|
onClick: () => C((p) => !p),
|
|
2324
|
-
active:
|
|
2409
|
+
active: V,
|
|
2325
2410
|
title: "Minimal ink mode (plain callouts when printing)",
|
|
2326
|
-
children: /* @__PURE__ */
|
|
2411
|
+
children: /* @__PURE__ */ o(un, { size: 16 })
|
|
2327
2412
|
}
|
|
2328
2413
|
),
|
|
2329
|
-
/* @__PURE__ */
|
|
2414
|
+
/* @__PURE__ */ o(
|
|
2330
2415
|
"select",
|
|
2331
2416
|
{
|
|
2332
2417
|
className: "ribbon-theme-select",
|
|
2333
2418
|
value: c,
|
|
2334
|
-
onChange: (p) =>
|
|
2419
|
+
onChange: (p) => i(p.target.value),
|
|
2335
2420
|
title: "Document theme (used everywhere — canvas, print, export)",
|
|
2336
|
-
children:
|
|
2421
|
+
children: $e.map((p) => /* @__PURE__ */ o("option", { value: p, children: p.charAt(0).toUpperCase() + p.slice(1) }, p))
|
|
2337
2422
|
}
|
|
2338
2423
|
)
|
|
2339
2424
|
] }),
|
|
2340
|
-
/* @__PURE__ */
|
|
2341
|
-
/* @__PURE__ */
|
|
2342
|
-
/* @__PURE__ */
|
|
2343
|
-
/* @__PURE__ */
|
|
2425
|
+
/* @__PURE__ */ o(dt, {}),
|
|
2426
|
+
/* @__PURE__ */ h("div", { className: d ? "ribbon-locked" : "ribbon-editing", children: [
|
|
2427
|
+
/* @__PURE__ */ o(rt, { label: "Style", children: /* @__PURE__ */ h("div", { className: "docs-tb-dropdown", ref: P, children: [
|
|
2428
|
+
/* @__PURE__ */ h(
|
|
2344
2429
|
"button",
|
|
2345
2430
|
{
|
|
2346
2431
|
className: "docs-tb-select docs-tb-paragraph-select",
|
|
2347
2432
|
onClick: () => {
|
|
2348
|
-
|
|
2433
|
+
H(), f(!g);
|
|
2349
2434
|
},
|
|
2350
2435
|
children: [
|
|
2351
|
-
/* @__PURE__ */
|
|
2352
|
-
/* @__PURE__ */
|
|
2436
|
+
/* @__PURE__ */ o("span", { className: "docs-tb-select-label", children: ft() }),
|
|
2437
|
+
/* @__PURE__ */ o(wt, { size: 14 })
|
|
2353
2438
|
]
|
|
2354
2439
|
}
|
|
2355
2440
|
),
|
|
2356
|
-
|
|
2441
|
+
g && /* @__PURE__ */ o("div", { className: "docs-tb-dropdown-menu docs-style-menu", children: zt.map((p) => /* @__PURE__ */ o(
|
|
2357
2442
|
"button",
|
|
2358
2443
|
{
|
|
2359
|
-
className: `docs-tb-dropdown-item${
|
|
2360
|
-
onClick: () =>
|
|
2361
|
-
children: /* @__PURE__ */
|
|
2444
|
+
className: `docs-tb-dropdown-item${ft() === p.label ? " active" : ""}`,
|
|
2445
|
+
onClick: () => K(p.node),
|
|
2446
|
+
children: /* @__PURE__ */ o(
|
|
2362
2447
|
"span",
|
|
2363
2448
|
{
|
|
2364
2449
|
className: `docs-style-preview docs-style-${p.node}`,
|
|
@@ -2369,94 +2454,94 @@ function Er({
|
|
|
2369
2454
|
p.node
|
|
2370
2455
|
)) })
|
|
2371
2456
|
] }) }),
|
|
2372
|
-
/* @__PURE__ */
|
|
2373
|
-
/* @__PURE__ */
|
|
2374
|
-
/* @__PURE__ */
|
|
2375
|
-
/* @__PURE__ */
|
|
2457
|
+
/* @__PURE__ */ o(dt, {}),
|
|
2458
|
+
/* @__PURE__ */ h(rt, { label: "Font", children: [
|
|
2459
|
+
/* @__PURE__ */ h("div", { className: "docs-tb-dropdown", ref: et, children: [
|
|
2460
|
+
/* @__PURE__ */ h(
|
|
2376
2461
|
"button",
|
|
2377
2462
|
{
|
|
2378
2463
|
className: "docs-tb-select docs-tb-font-select",
|
|
2379
2464
|
onClick: () => {
|
|
2380
|
-
|
|
2465
|
+
H(), b(!x);
|
|
2381
2466
|
},
|
|
2382
2467
|
children: [
|
|
2383
|
-
/* @__PURE__ */
|
|
2384
|
-
/* @__PURE__ */
|
|
2468
|
+
/* @__PURE__ */ o("span", { className: "docs-tb-select-label", children: yt() }),
|
|
2469
|
+
/* @__PURE__ */ o(wt, { size: 14 })
|
|
2385
2470
|
]
|
|
2386
2471
|
}
|
|
2387
2472
|
),
|
|
2388
|
-
|
|
2473
|
+
x && /* @__PURE__ */ o("div", { className: "docs-tb-dropdown-menu docs-font-menu", children: le.map((p) => /* @__PURE__ */ o(
|
|
2389
2474
|
"button",
|
|
2390
2475
|
{
|
|
2391
|
-
className: `docs-tb-dropdown-item${
|
|
2476
|
+
className: `docs-tb-dropdown-item${yt() === p.label ? " active" : ""}`,
|
|
2392
2477
|
style: { fontFamily: p.value || "inherit" },
|
|
2393
2478
|
onClick: () => {
|
|
2394
|
-
p.value ? t.chain().focus().setFontFamily(p.value).run() : t.chain().focus().unsetFontFamily().run(),
|
|
2479
|
+
p.value ? t.chain().focus().setFontFamily(p.value).run() : t.chain().focus().unsetFontFamily().run(), H();
|
|
2395
2480
|
},
|
|
2396
2481
|
children: p.label
|
|
2397
2482
|
},
|
|
2398
2483
|
p.value || "default"
|
|
2399
2484
|
)) })
|
|
2400
2485
|
] }),
|
|
2401
|
-
/* @__PURE__ */
|
|
2402
|
-
/* @__PURE__ */
|
|
2403
|
-
/* @__PURE__ */
|
|
2486
|
+
/* @__PURE__ */ o(E, { onClick: () => nt(-1), title: "Decrease font size", children: /* @__PURE__ */ o(pn, { size: 14 }) }),
|
|
2487
|
+
/* @__PURE__ */ o("span", { className: "docs-tb-fontsize", children: at }),
|
|
2488
|
+
/* @__PURE__ */ o(E, { onClick: () => nt(1), title: "Increase font size", children: /* @__PURE__ */ o(Vt, { size: 14 }) })
|
|
2404
2489
|
] }),
|
|
2405
|
-
/* @__PURE__ */
|
|
2406
|
-
/* @__PURE__ */
|
|
2407
|
-
/* @__PURE__ */
|
|
2490
|
+
/* @__PURE__ */ o(dt, {}),
|
|
2491
|
+
/* @__PURE__ */ h(rt, { label: "Text", children: [
|
|
2492
|
+
/* @__PURE__ */ o(
|
|
2408
2493
|
E,
|
|
2409
2494
|
{
|
|
2410
2495
|
onClick: () => t.chain().focus().toggleBold().run(),
|
|
2411
2496
|
active: t.isActive("bold"),
|
|
2412
2497
|
title: "Bold (⌘B)",
|
|
2413
|
-
children: /* @__PURE__ */
|
|
2498
|
+
children: /* @__PURE__ */ o(fn, { size: 16 })
|
|
2414
2499
|
}
|
|
2415
2500
|
),
|
|
2416
|
-
/* @__PURE__ */
|
|
2501
|
+
/* @__PURE__ */ o(
|
|
2417
2502
|
E,
|
|
2418
2503
|
{
|
|
2419
2504
|
onClick: () => t.chain().focus().toggleItalic().run(),
|
|
2420
2505
|
active: t.isActive("italic"),
|
|
2421
2506
|
title: "Italic (⌘I)",
|
|
2422
|
-
children: /* @__PURE__ */
|
|
2507
|
+
children: /* @__PURE__ */ o(hn, { size: 16 })
|
|
2423
2508
|
}
|
|
2424
2509
|
),
|
|
2425
|
-
/* @__PURE__ */
|
|
2510
|
+
/* @__PURE__ */ o(
|
|
2426
2511
|
E,
|
|
2427
2512
|
{
|
|
2428
2513
|
onClick: () => t.chain().focus().toggleUnderline().run(),
|
|
2429
2514
|
active: t.isActive("underline"),
|
|
2430
2515
|
title: "Underline (⌘U)",
|
|
2431
|
-
children: /* @__PURE__ */
|
|
2516
|
+
children: /* @__PURE__ */ o(gn, { size: 16 })
|
|
2432
2517
|
}
|
|
2433
2518
|
),
|
|
2434
|
-
/* @__PURE__ */
|
|
2519
|
+
/* @__PURE__ */ o(
|
|
2435
2520
|
E,
|
|
2436
2521
|
{
|
|
2437
2522
|
onClick: () => t.chain().focus().toggleStrike().run(),
|
|
2438
2523
|
active: t.isActive("strike"),
|
|
2439
2524
|
title: "Strikethrough (⌘⇧X)",
|
|
2440
|
-
children: /* @__PURE__ */
|
|
2525
|
+
children: /* @__PURE__ */ o(mn, { size: 16 })
|
|
2441
2526
|
}
|
|
2442
2527
|
),
|
|
2443
|
-
/* @__PURE__ */
|
|
2528
|
+
/* @__PURE__ */ h(
|
|
2444
2529
|
"div",
|
|
2445
2530
|
{
|
|
2446
2531
|
className: "docs-tb-dropdown docs-tb-color-dropdown",
|
|
2447
|
-
ref:
|
|
2532
|
+
ref: Y,
|
|
2448
2533
|
children: [
|
|
2449
|
-
/* @__PURE__ */
|
|
2534
|
+
/* @__PURE__ */ h(
|
|
2450
2535
|
"button",
|
|
2451
2536
|
{
|
|
2452
2537
|
className: "docs-tb-btn docs-tb-color-btn",
|
|
2453
2538
|
onClick: () => {
|
|
2454
|
-
|
|
2539
|
+
H(), R(!v);
|
|
2455
2540
|
},
|
|
2456
2541
|
title: "Text color",
|
|
2457
2542
|
children: [
|
|
2458
|
-
/* @__PURE__ */
|
|
2459
|
-
/* @__PURE__ */
|
|
2543
|
+
/* @__PURE__ */ o(bn, { size: 16 }),
|
|
2544
|
+
/* @__PURE__ */ o(
|
|
2460
2545
|
"span",
|
|
2461
2546
|
{
|
|
2462
2547
|
className: "docs-tb-color-indicator",
|
|
@@ -2468,29 +2553,29 @@ function Er({
|
|
|
2468
2553
|
]
|
|
2469
2554
|
}
|
|
2470
2555
|
),
|
|
2471
|
-
v && /* @__PURE__ */
|
|
2472
|
-
/* @__PURE__ */
|
|
2473
|
-
/* @__PURE__ */
|
|
2556
|
+
v && /* @__PURE__ */ h("div", { className: "docs-tb-dropdown-menu docs-color-grid-menu", children: [
|
|
2557
|
+
/* @__PURE__ */ o("div", { className: "docs-color-grid-label", children: "Text color" }),
|
|
2558
|
+
/* @__PURE__ */ o("div", { className: "docs-color-grid", children: zr.map((p) => /* @__PURE__ */ o(
|
|
2474
2559
|
"button",
|
|
2475
2560
|
{
|
|
2476
2561
|
className: "docs-color-swatch",
|
|
2477
2562
|
style: { background: p },
|
|
2478
2563
|
title: p,
|
|
2479
2564
|
onClick: () => {
|
|
2480
|
-
t.chain().focus().setColor(p).run(),
|
|
2565
|
+
t.chain().focus().setColor(p).run(), H();
|
|
2481
2566
|
}
|
|
2482
2567
|
},
|
|
2483
2568
|
p
|
|
2484
2569
|
)) }),
|
|
2485
|
-
/* @__PURE__ */
|
|
2570
|
+
/* @__PURE__ */ h(
|
|
2486
2571
|
"button",
|
|
2487
2572
|
{
|
|
2488
2573
|
className: "docs-tb-dropdown-item",
|
|
2489
2574
|
onClick: () => {
|
|
2490
|
-
t.chain().focus().unsetColor().run(),
|
|
2575
|
+
t.chain().focus().unsetColor().run(), H();
|
|
2491
2576
|
},
|
|
2492
2577
|
children: [
|
|
2493
|
-
/* @__PURE__ */
|
|
2578
|
+
/* @__PURE__ */ o(Jt, { size: 14 }),
|
|
2494
2579
|
" Reset"
|
|
2495
2580
|
]
|
|
2496
2581
|
}
|
|
@@ -2499,23 +2584,23 @@ function Er({
|
|
|
2499
2584
|
]
|
|
2500
2585
|
}
|
|
2501
2586
|
),
|
|
2502
|
-
/* @__PURE__ */
|
|
2587
|
+
/* @__PURE__ */ h(
|
|
2503
2588
|
"div",
|
|
2504
2589
|
{
|
|
2505
2590
|
className: "docs-tb-dropdown docs-tb-color-dropdown",
|
|
2506
|
-
ref:
|
|
2591
|
+
ref: w,
|
|
2507
2592
|
children: [
|
|
2508
|
-
/* @__PURE__ */
|
|
2593
|
+
/* @__PURE__ */ h(
|
|
2509
2594
|
"button",
|
|
2510
2595
|
{
|
|
2511
2596
|
className: "docs-tb-btn docs-tb-color-btn",
|
|
2512
2597
|
onClick: () => {
|
|
2513
|
-
|
|
2598
|
+
H(), B(!z);
|
|
2514
2599
|
},
|
|
2515
2600
|
title: "Highlight color",
|
|
2516
2601
|
children: [
|
|
2517
|
-
/* @__PURE__ */
|
|
2518
|
-
/* @__PURE__ */
|
|
2602
|
+
/* @__PURE__ */ o(yn, { size: 16 }),
|
|
2603
|
+
/* @__PURE__ */ o(
|
|
2519
2604
|
"span",
|
|
2520
2605
|
{
|
|
2521
2606
|
className: "docs-tb-color-indicator",
|
|
@@ -2527,16 +2612,16 @@ function Er({
|
|
|
2527
2612
|
]
|
|
2528
2613
|
}
|
|
2529
2614
|
),
|
|
2530
|
-
|
|
2531
|
-
/* @__PURE__ */
|
|
2532
|
-
/* @__PURE__ */
|
|
2615
|
+
z && /* @__PURE__ */ h("div", { className: "docs-tb-dropdown-menu docs-color-grid-menu", children: [
|
|
2616
|
+
/* @__PURE__ */ o("div", { className: "docs-color-grid-label", children: "Highlight color" }),
|
|
2617
|
+
/* @__PURE__ */ o("div", { className: "docs-color-grid docs-highlight-grid", children: Hr.map((p) => /* @__PURE__ */ o(
|
|
2533
2618
|
"button",
|
|
2534
2619
|
{
|
|
2535
2620
|
className: "docs-color-swatch",
|
|
2536
2621
|
style: { background: p },
|
|
2537
2622
|
title: p,
|
|
2538
2623
|
onClick: () => {
|
|
2539
|
-
p === "#ffffff" ? t.chain().focus().unsetHighlight().run() : t.chain().focus().toggleHighlight({ color: p }).run(),
|
|
2624
|
+
p === "#ffffff" ? t.chain().focus().unsetHighlight().run() : t.chain().focus().toggleHighlight({ color: p }).run(), H();
|
|
2540
2625
|
}
|
|
2541
2626
|
},
|
|
2542
2627
|
p
|
|
@@ -2545,69 +2630,69 @@ function Er({
|
|
|
2545
2630
|
]
|
|
2546
2631
|
}
|
|
2547
2632
|
),
|
|
2548
|
-
/* @__PURE__ */
|
|
2633
|
+
/* @__PURE__ */ o(
|
|
2549
2634
|
E,
|
|
2550
2635
|
{
|
|
2551
2636
|
onClick: () => t.chain().focus().toggleCode().run(),
|
|
2552
2637
|
active: t.isActive("code"),
|
|
2553
2638
|
title: "Inline code",
|
|
2554
|
-
children: /* @__PURE__ */
|
|
2639
|
+
children: /* @__PURE__ */ o(Sn, { size: 16 })
|
|
2555
2640
|
}
|
|
2556
2641
|
),
|
|
2557
|
-
/* @__PURE__ */
|
|
2642
|
+
/* @__PURE__ */ o(
|
|
2558
2643
|
E,
|
|
2559
2644
|
{
|
|
2560
2645
|
onClick: () => t.chain().focus().unsetAllMarks().clearNodes().run(),
|
|
2561
2646
|
title: "Clear formatting",
|
|
2562
|
-
children: /* @__PURE__ */
|
|
2647
|
+
children: /* @__PURE__ */ o(Jt, { size: 16 })
|
|
2563
2648
|
}
|
|
2564
2649
|
)
|
|
2565
2650
|
] }),
|
|
2566
|
-
/* @__PURE__ */
|
|
2567
|
-
/* @__PURE__ */
|
|
2568
|
-
/* @__PURE__ */
|
|
2651
|
+
/* @__PURE__ */ o(dt, {}),
|
|
2652
|
+
/* @__PURE__ */ h(rt, { label: "Paragraph", children: [
|
|
2653
|
+
/* @__PURE__ */ o(
|
|
2569
2654
|
E,
|
|
2570
2655
|
{
|
|
2571
2656
|
onClick: () => t.chain().focus().setTextAlign("left").run(),
|
|
2572
2657
|
active: t.isActive({ textAlign: "left" }),
|
|
2573
2658
|
title: "Align left",
|
|
2574
|
-
children: /* @__PURE__ */
|
|
2659
|
+
children: /* @__PURE__ */ o(kn, { size: 16 })
|
|
2575
2660
|
}
|
|
2576
2661
|
),
|
|
2577
|
-
/* @__PURE__ */
|
|
2662
|
+
/* @__PURE__ */ o(
|
|
2578
2663
|
E,
|
|
2579
2664
|
{
|
|
2580
2665
|
onClick: () => t.chain().focus().setTextAlign("center").run(),
|
|
2581
2666
|
active: t.isActive({ textAlign: "center" }),
|
|
2582
2667
|
title: "Align center",
|
|
2583
|
-
children: /* @__PURE__ */
|
|
2668
|
+
children: /* @__PURE__ */ o(vn, { size: 16 })
|
|
2584
2669
|
}
|
|
2585
2670
|
),
|
|
2586
|
-
/* @__PURE__ */
|
|
2671
|
+
/* @__PURE__ */ o(
|
|
2587
2672
|
E,
|
|
2588
2673
|
{
|
|
2589
2674
|
onClick: () => t.chain().focus().setTextAlign("right").run(),
|
|
2590
2675
|
active: t.isActive({ textAlign: "right" }),
|
|
2591
2676
|
title: "Align right",
|
|
2592
|
-
children: /* @__PURE__ */
|
|
2677
|
+
children: /* @__PURE__ */ o(wn, { size: 16 })
|
|
2593
2678
|
}
|
|
2594
2679
|
),
|
|
2595
|
-
/* @__PURE__ */
|
|
2680
|
+
/* @__PURE__ */ o(
|
|
2596
2681
|
E,
|
|
2597
2682
|
{
|
|
2598
2683
|
onClick: () => t.chain().focus().setTextAlign("justify").run(),
|
|
2599
2684
|
active: t.isActive({ textAlign: "justify" }),
|
|
2600
2685
|
title: "Justify",
|
|
2601
|
-
children: /* @__PURE__ */
|
|
2686
|
+
children: /* @__PURE__ */ o(Tn, { size: 16 })
|
|
2602
2687
|
}
|
|
2603
2688
|
),
|
|
2604
|
-
/* @__PURE__ */
|
|
2689
|
+
/* @__PURE__ */ o(
|
|
2605
2690
|
E,
|
|
2606
2691
|
{
|
|
2607
|
-
onClick: () =>
|
|
2692
|
+
onClick: () => r?.(),
|
|
2608
2693
|
active: e,
|
|
2609
2694
|
title: e ? "Switch to LTR (left-to-right)" : "Switch to RTL (right-to-left)",
|
|
2610
|
-
children: /* @__PURE__ */
|
|
2695
|
+
children: /* @__PURE__ */ o(
|
|
2611
2696
|
"span",
|
|
2612
2697
|
{
|
|
2613
2698
|
style: {
|
|
@@ -2621,133 +2706,133 @@ function Er({
|
|
|
2621
2706
|
)
|
|
2622
2707
|
}
|
|
2623
2708
|
),
|
|
2624
|
-
/* @__PURE__ */
|
|
2625
|
-
/* @__PURE__ */
|
|
2709
|
+
/* @__PURE__ */ h("div", { className: "docs-tb-dropdown", ref: I, children: [
|
|
2710
|
+
/* @__PURE__ */ h(
|
|
2626
2711
|
"button",
|
|
2627
2712
|
{
|
|
2628
|
-
className: `docs-tb-btn${
|
|
2713
|
+
className: `docs-tb-btn${Ct ? " active" : ""}`,
|
|
2629
2714
|
onClick: () => {
|
|
2630
|
-
|
|
2715
|
+
H(), j(!U);
|
|
2631
2716
|
},
|
|
2632
2717
|
title: "Line & paragraph spacing",
|
|
2633
2718
|
children: [
|
|
2634
|
-
/* @__PURE__ */
|
|
2635
|
-
/* @__PURE__ */
|
|
2719
|
+
/* @__PURE__ */ o(xn, { size: 16 }),
|
|
2720
|
+
/* @__PURE__ */ o(wt, { size: 12 })
|
|
2636
2721
|
]
|
|
2637
2722
|
}
|
|
2638
2723
|
),
|
|
2639
|
-
|
|
2640
|
-
/* @__PURE__ */
|
|
2641
|
-
/* @__PURE__ */
|
|
2724
|
+
U && /* @__PURE__ */ h("div", { className: "docs-tb-dropdown-menu docs-spacing-menu", children: [
|
|
2725
|
+
/* @__PURE__ */ o("div", { className: "docs-insert-category", children: "Line spacing" }),
|
|
2726
|
+
/* @__PURE__ */ o(
|
|
2642
2727
|
"button",
|
|
2643
2728
|
{
|
|
2644
|
-
className: `docs-tb-dropdown-item${
|
|
2645
|
-
onClick: () =>
|
|
2729
|
+
className: `docs-tb-dropdown-item${Ct ? "" : " active"}`,
|
|
2730
|
+
onClick: () => q(null),
|
|
2646
2731
|
children: "Default"
|
|
2647
2732
|
}
|
|
2648
2733
|
),
|
|
2649
|
-
|
|
2734
|
+
Mr.map((p) => /* @__PURE__ */ o(
|
|
2650
2735
|
"button",
|
|
2651
2736
|
{
|
|
2652
|
-
className: `docs-tb-dropdown-item${
|
|
2653
|
-
onClick: () =>
|
|
2737
|
+
className: `docs-tb-dropdown-item${Ct === p ? " active" : ""}`,
|
|
2738
|
+
onClick: () => q(p),
|
|
2654
2739
|
children: p === "1" ? "Single" : p === "2" ? "Double" : p
|
|
2655
2740
|
},
|
|
2656
2741
|
p
|
|
2657
2742
|
)),
|
|
2658
|
-
/* @__PURE__ */
|
|
2659
|
-
/* @__PURE__ */
|
|
2660
|
-
/* @__PURE__ */
|
|
2743
|
+
/* @__PURE__ */ o("div", { className: "docs-insert-divider" }),
|
|
2744
|
+
/* @__PURE__ */ o("div", { className: "docs-insert-category", children: "Paragraph spacing" }),
|
|
2745
|
+
/* @__PURE__ */ o(
|
|
2661
2746
|
"button",
|
|
2662
2747
|
{
|
|
2663
2748
|
className: "docs-tb-dropdown-item",
|
|
2664
|
-
onClick: () =>
|
|
2665
|
-
children:
|
|
2749
|
+
onClick: () => gt("space-before"),
|
|
2750
|
+
children: lt(t, "space-before") ? "Remove space before block" : "Add space before block"
|
|
2666
2751
|
}
|
|
2667
2752
|
),
|
|
2668
|
-
/* @__PURE__ */
|
|
2753
|
+
/* @__PURE__ */ o(
|
|
2669
2754
|
"button",
|
|
2670
2755
|
{
|
|
2671
2756
|
className: "docs-tb-dropdown-item",
|
|
2672
|
-
onClick: () =>
|
|
2673
|
-
children:
|
|
2757
|
+
onClick: () => gt("space-after"),
|
|
2758
|
+
children: lt(t, "space-after") ? "Remove space after block" : "Add space after block"
|
|
2674
2759
|
}
|
|
2675
2760
|
),
|
|
2676
|
-
/* @__PURE__ */
|
|
2761
|
+
/* @__PURE__ */ o(
|
|
2677
2762
|
"button",
|
|
2678
2763
|
{
|
|
2679
2764
|
className: "docs-tb-dropdown-item",
|
|
2680
|
-
onClick:
|
|
2765
|
+
onClick: St,
|
|
2681
2766
|
children: "Custom spacing…"
|
|
2682
2767
|
}
|
|
2683
2768
|
)
|
|
2684
2769
|
] })
|
|
2685
2770
|
] }),
|
|
2686
|
-
/* @__PURE__ */
|
|
2771
|
+
/* @__PURE__ */ o(
|
|
2687
2772
|
E,
|
|
2688
2773
|
{
|
|
2689
2774
|
onClick: () => t.chain().focus().toggleBulletList().run(),
|
|
2690
2775
|
active: t.isActive("bulletList"),
|
|
2691
2776
|
title: "Bullet list",
|
|
2692
|
-
children: /* @__PURE__ */
|
|
2777
|
+
children: /* @__PURE__ */ o(Nn, { size: 16 })
|
|
2693
2778
|
}
|
|
2694
2779
|
),
|
|
2695
|
-
/* @__PURE__ */
|
|
2780
|
+
/* @__PURE__ */ o(
|
|
2696
2781
|
E,
|
|
2697
2782
|
{
|
|
2698
2783
|
onClick: () => t.chain().focus().toggleOrderedList().run(),
|
|
2699
2784
|
active: t.isActive("orderedList"),
|
|
2700
2785
|
title: "Numbered list",
|
|
2701
|
-
children: /* @__PURE__ */
|
|
2786
|
+
children: /* @__PURE__ */ o(Ln, { size: 16 })
|
|
2702
2787
|
}
|
|
2703
2788
|
)
|
|
2704
2789
|
] }),
|
|
2705
|
-
/* @__PURE__ */
|
|
2706
|
-
/* @__PURE__ */
|
|
2707
|
-
/* @__PURE__ */
|
|
2708
|
-
/* @__PURE__ */
|
|
2790
|
+
/* @__PURE__ */ o(dt, {}),
|
|
2791
|
+
/* @__PURE__ */ h(rt, { label: "Insert", children: [
|
|
2792
|
+
/* @__PURE__ */ h("div", { className: "docs-tb-dropdown", ref: X, children: [
|
|
2793
|
+
/* @__PURE__ */ h(
|
|
2709
2794
|
"button",
|
|
2710
2795
|
{
|
|
2711
2796
|
className: "docs-tb-select docs-tb-insert-select",
|
|
2712
2797
|
onClick: () => {
|
|
2713
|
-
|
|
2798
|
+
H(), k(!y);
|
|
2714
2799
|
},
|
|
2715
2800
|
children: [
|
|
2716
|
-
/* @__PURE__ */
|
|
2717
|
-
/* @__PURE__ */
|
|
2718
|
-
/* @__PURE__ */
|
|
2801
|
+
/* @__PURE__ */ o(Vt, { size: 15 }),
|
|
2802
|
+
/* @__PURE__ */ o("span", { children: "Insert" }),
|
|
2803
|
+
/* @__PURE__ */ o(wt, { size: 14 })
|
|
2719
2804
|
]
|
|
2720
2805
|
}
|
|
2721
2806
|
),
|
|
2722
|
-
|
|
2723
|
-
/* @__PURE__ */
|
|
2807
|
+
y && /* @__PURE__ */ h("div", { className: "docs-tb-dropdown-menu docs-insert-menu", children: [
|
|
2808
|
+
/* @__PURE__ */ h(
|
|
2724
2809
|
"button",
|
|
2725
2810
|
{
|
|
2726
2811
|
className: "docs-tb-dropdown-item docs-insert-item",
|
|
2727
|
-
onClick:
|
|
2812
|
+
onClick: Ce,
|
|
2728
2813
|
title: "Two-sided row — content at the line start, value at the line end (text: … | end: …)",
|
|
2729
2814
|
children: [
|
|
2730
|
-
/* @__PURE__ */
|
|
2731
|
-
/* @__PURE__ */
|
|
2732
|
-
/* @__PURE__ */
|
|
2815
|
+
/* @__PURE__ */ o("span", { className: "docs-insert-icon", children: /* @__PURE__ */ o(Qt, { size: 13 }) }),
|
|
2816
|
+
/* @__PURE__ */ o("span", { className: "docs-insert-label", children: "two-sided row" }),
|
|
2817
|
+
/* @__PURE__ */ o("span", { className: "docs-insert-kw", children: "end:" })
|
|
2733
2818
|
]
|
|
2734
2819
|
}
|
|
2735
2820
|
),
|
|
2736
|
-
/* @__PURE__ */
|
|
2737
|
-
L.map((p, A) => /* @__PURE__ */
|
|
2738
|
-
A > 0 && /* @__PURE__ */
|
|
2739
|
-
/* @__PURE__ */
|
|
2740
|
-
p.items.map((N) => /* @__PURE__ */
|
|
2821
|
+
/* @__PURE__ */ o("div", { className: "docs-insert-divider" }),
|
|
2822
|
+
L.map((p, A) => /* @__PURE__ */ h("div", { children: [
|
|
2823
|
+
A > 0 && /* @__PURE__ */ o("div", { className: "docs-insert-divider" }),
|
|
2824
|
+
/* @__PURE__ */ o("div", { className: "docs-insert-category", children: p.category }),
|
|
2825
|
+
p.items.map((N) => /* @__PURE__ */ h(
|
|
2741
2826
|
"button",
|
|
2742
2827
|
{
|
|
2743
2828
|
className: "docs-tb-dropdown-item docs-insert-item",
|
|
2744
|
-
onClick: () =>
|
|
2829
|
+
onClick: () => J(N.keyword),
|
|
2745
2830
|
disabled: N.isReadOnly,
|
|
2746
2831
|
title: N.description,
|
|
2747
2832
|
children: [
|
|
2748
|
-
/* @__PURE__ */
|
|
2749
|
-
/* @__PURE__ */
|
|
2750
|
-
/* @__PURE__ */
|
|
2833
|
+
/* @__PURE__ */ o("span", { className: "docs-insert-icon", children: se[N.category]?.icon || "•" }),
|
|
2834
|
+
/* @__PURE__ */ o("span", { className: "docs-insert-label", children: N.label }),
|
|
2835
|
+
/* @__PURE__ */ o("span", { className: "docs-insert-kw", children: N.isReadOnly ? "locked" : `.${N.keyword}` })
|
|
2751
2836
|
]
|
|
2752
2837
|
},
|
|
2753
2838
|
N.keyword
|
|
@@ -2755,148 +2840,148 @@ function Er({
|
|
|
2755
2840
|
] }, p.category))
|
|
2756
2841
|
] })
|
|
2757
2842
|
] }),
|
|
2758
|
-
/* @__PURE__ */
|
|
2843
|
+
/* @__PURE__ */ o(
|
|
2759
2844
|
E,
|
|
2760
2845
|
{
|
|
2761
|
-
onClick:
|
|
2762
|
-
active:
|
|
2846
|
+
onClick: Ae,
|
|
2847
|
+
active: Ee,
|
|
2763
2848
|
title: "Two-sided row — set the text shown at the END of this line (end: property)",
|
|
2764
|
-
children: /* @__PURE__ */
|
|
2849
|
+
children: /* @__PURE__ */ o(Qt, { size: 16 })
|
|
2765
2850
|
}
|
|
2766
2851
|
)
|
|
2767
2852
|
] })
|
|
2768
2853
|
] }),
|
|
2769
|
-
|
|
2770
|
-
/* @__PURE__ */
|
|
2771
|
-
/* @__PURE__ */
|
|
2772
|
-
|
|
2854
|
+
a && s ? /* @__PURE__ */ h(Z, { children: [
|
|
2855
|
+
/* @__PURE__ */ o(dt, {}),
|
|
2856
|
+
/* @__PURE__ */ o(rt, { label: "Trust", children: /* @__PURE__ */ o(
|
|
2857
|
+
Ar,
|
|
2773
2858
|
{
|
|
2774
|
-
content:
|
|
2775
|
-
onChange:
|
|
2776
|
-
trust:
|
|
2859
|
+
content: n,
|
|
2860
|
+
onChange: s,
|
|
2861
|
+
trust: a,
|
|
2777
2862
|
intact: m
|
|
2778
2863
|
}
|
|
2779
2864
|
) })
|
|
2780
|
-
] }) :
|
|
2781
|
-
/* @__PURE__ */
|
|
2782
|
-
/* @__PURE__ */
|
|
2783
|
-
/* @__PURE__ */
|
|
2865
|
+
] }) : u && /* @__PURE__ */ h(Z, { children: [
|
|
2866
|
+
/* @__PURE__ */ o(dt, {}),
|
|
2867
|
+
/* @__PURE__ */ h(rt, { label: "Trust", children: [
|
|
2868
|
+
/* @__PURE__ */ o(
|
|
2784
2869
|
E,
|
|
2785
2870
|
{
|
|
2786
|
-
onClick: () =>
|
|
2787
|
-
disabled:
|
|
2871
|
+
onClick: () => u("seal"),
|
|
2872
|
+
disabled: d,
|
|
2788
2873
|
title: "Seal — freeze the document with a tamper-evident hash",
|
|
2789
|
-
children: /* @__PURE__ */
|
|
2874
|
+
children: /* @__PURE__ */ o("span", { className: "ribbon-btn-text", children: "Seal" })
|
|
2790
2875
|
}
|
|
2791
2876
|
),
|
|
2792
|
-
/* @__PURE__ */
|
|
2793
|
-
/* @__PURE__ */
|
|
2877
|
+
/* @__PURE__ */ o(E, { onClick: () => u("sign"), title: "Sign", children: /* @__PURE__ */ o("span", { className: "ribbon-btn-text", children: "Sign" }) }),
|
|
2878
|
+
/* @__PURE__ */ o(E, { onClick: () => u("verify"), title: "Verify", children: /* @__PURE__ */ o("span", { className: "ribbon-btn-text", children: "Verify" }) })
|
|
2794
2879
|
] })
|
|
2795
2880
|
] })
|
|
2796
2881
|
] });
|
|
2797
2882
|
}
|
|
2798
|
-
const
|
|
2799
|
-
function
|
|
2800
|
-
const
|
|
2801
|
-
for (let
|
|
2802
|
-
const
|
|
2803
|
-
|
|
2804
|
-
x:
|
|
2805
|
-
kind:
|
|
2806
|
-
label:
|
|
2883
|
+
const Pr = { in: 96, cm: 96 / 2.54 }, Br = { in: 0.25, cm: 0.5 };
|
|
2884
|
+
function Le(t, e) {
|
|
2885
|
+
const r = Pr[e], n = Br[e], s = [], c = t / r;
|
|
2886
|
+
for (let i = 0; i <= c + 1e-6; i += n) {
|
|
2887
|
+
const u = Math.abs(i - Math.round(i)) < 1e-6;
|
|
2888
|
+
s.push({
|
|
2889
|
+
x: i * r,
|
|
2890
|
+
kind: u ? "major" : "minor",
|
|
2891
|
+
label: u && i > 0 ? String(Math.round(i)) : void 0
|
|
2807
2892
|
});
|
|
2808
2893
|
}
|
|
2809
|
-
return
|
|
2894
|
+
return s;
|
|
2810
2895
|
}
|
|
2811
|
-
function
|
|
2896
|
+
function Ir({
|
|
2812
2897
|
geometry: t,
|
|
2813
2898
|
zoom: e,
|
|
2814
|
-
scrollEl:
|
|
2815
|
-
onMargins:
|
|
2816
|
-
locked:
|
|
2899
|
+
scrollEl: r,
|
|
2900
|
+
onMargins: n,
|
|
2901
|
+
locked: s = !1
|
|
2817
2902
|
}) {
|
|
2818
|
-
const [c,
|
|
2819
|
-
|
|
2820
|
-
const
|
|
2821
|
-
if (!
|
|
2822
|
-
const
|
|
2823
|
-
return
|
|
2824
|
-
}, [
|
|
2825
|
-
const
|
|
2826
|
-
() =>
|
|
2903
|
+
const [c, i] = M(0), [u, a] = M(null), m = F(null);
|
|
2904
|
+
G(() => {
|
|
2905
|
+
const k = r.current;
|
|
2906
|
+
if (!k) return;
|
|
2907
|
+
const x = () => i(k.scrollLeft);
|
|
2908
|
+
return x(), k.addEventListener("scroll", x, { passive: !0 }), () => k.removeEventListener("scroll", x);
|
|
2909
|
+
}, [r]);
|
|
2910
|
+
const d = tt(
|
|
2911
|
+
() => Le(t.width, t.unit),
|
|
2827
2912
|
[t.width, t.unit]
|
|
2828
|
-
),
|
|
2829
|
-
(
|
|
2830
|
-
!
|
|
2913
|
+
), g = _(
|
|
2914
|
+
(k) => (x) => {
|
|
2915
|
+
!n || s || (x.preventDefault(), a(k));
|
|
2831
2916
|
},
|
|
2832
|
-
[
|
|
2917
|
+
[n, s]
|
|
2833
2918
|
);
|
|
2834
|
-
|
|
2835
|
-
if (!
|
|
2836
|
-
const
|
|
2919
|
+
G(() => {
|
|
2920
|
+
if (!u || !n) return;
|
|
2921
|
+
const k = (b) => {
|
|
2837
2922
|
const v = m.current;
|
|
2838
2923
|
if (!v) return;
|
|
2839
|
-
const
|
|
2840
|
-
if (
|
|
2841
|
-
const
|
|
2842
|
-
|
|
2924
|
+
const R = v.getBoundingClientRect(), z = (b.clientX - R.left) / e;
|
|
2925
|
+
if (u === "left") {
|
|
2926
|
+
const B = Math.max(0, Math.min(z, t.width / 2));
|
|
2927
|
+
n({ left: B });
|
|
2843
2928
|
} else {
|
|
2844
|
-
const
|
|
2845
|
-
|
|
2929
|
+
const B = Math.max(0, Math.min(t.width - z, t.width / 2));
|
|
2930
|
+
n({ right: B });
|
|
2846
2931
|
}
|
|
2847
|
-
},
|
|
2848
|
-
return window.addEventListener("pointermove",
|
|
2849
|
-
window.removeEventListener("pointermove",
|
|
2932
|
+
}, x = () => a(null);
|
|
2933
|
+
return window.addEventListener("pointermove", k), window.addEventListener("pointerup", x), () => {
|
|
2934
|
+
window.removeEventListener("pointermove", k), window.removeEventListener("pointerup", x);
|
|
2850
2935
|
};
|
|
2851
|
-
}, [
|
|
2852
|
-
const f = t.width * e,
|
|
2853
|
-
return /* @__PURE__ */
|
|
2936
|
+
}, [u, n, e, t.width]);
|
|
2937
|
+
const f = t.width * e, y = !!n && !s;
|
|
2938
|
+
return /* @__PURE__ */ o("div", { className: `docs-ruler${y ? " docs-ruler--draggable" : ""}`, children: /* @__PURE__ */ h(
|
|
2854
2939
|
"div",
|
|
2855
2940
|
{
|
|
2856
2941
|
ref: m,
|
|
2857
2942
|
className: "docs-ruler-track",
|
|
2858
2943
|
style: { width: f, transform: `translateX(${-c}px)` },
|
|
2859
2944
|
children: [
|
|
2860
|
-
/* @__PURE__ */
|
|
2945
|
+
/* @__PURE__ */ o(
|
|
2861
2946
|
"div",
|
|
2862
2947
|
{
|
|
2863
2948
|
className: "docs-ruler-margin",
|
|
2864
2949
|
style: { left: 0, width: t.marginLeft * e }
|
|
2865
2950
|
}
|
|
2866
2951
|
),
|
|
2867
|
-
/* @__PURE__ */
|
|
2952
|
+
/* @__PURE__ */ o(
|
|
2868
2953
|
"div",
|
|
2869
2954
|
{
|
|
2870
2955
|
className: "docs-ruler-margin",
|
|
2871
2956
|
style: { right: 0, width: t.marginRight * e }
|
|
2872
2957
|
}
|
|
2873
2958
|
),
|
|
2874
|
-
|
|
2875
|
-
(
|
|
2959
|
+
d.map(
|
|
2960
|
+
(k, x) => k.label ? /* @__PURE__ */ o("span", { className: "docs-ruler-num", style: { left: k.x * e }, children: k.label }, x) : /* @__PURE__ */ o(
|
|
2876
2961
|
"span",
|
|
2877
2962
|
{
|
|
2878
|
-
className: `docs-ruler-tick docs-ruler-tick--${
|
|
2879
|
-
style: { left:
|
|
2963
|
+
className: `docs-ruler-tick docs-ruler-tick--${k.kind}`,
|
|
2964
|
+
style: { left: k.x * e }
|
|
2880
2965
|
},
|
|
2881
|
-
|
|
2966
|
+
x
|
|
2882
2967
|
)
|
|
2883
2968
|
),
|
|
2884
|
-
|
|
2885
|
-
/* @__PURE__ */
|
|
2969
|
+
y && /* @__PURE__ */ h(Z, { children: [
|
|
2970
|
+
/* @__PURE__ */ o(
|
|
2886
2971
|
"span",
|
|
2887
2972
|
{
|
|
2888
|
-
className: `docs-ruler-stop docs-ruler-stop--h${
|
|
2973
|
+
className: `docs-ruler-stop docs-ruler-stop--h${u === "left" ? " dragging" : ""}`,
|
|
2889
2974
|
style: { left: t.marginLeft * e },
|
|
2890
|
-
onPointerDown:
|
|
2975
|
+
onPointerDown: g("left"),
|
|
2891
2976
|
title: "Drag to set the left margin"
|
|
2892
2977
|
}
|
|
2893
2978
|
),
|
|
2894
|
-
/* @__PURE__ */
|
|
2979
|
+
/* @__PURE__ */ o(
|
|
2895
2980
|
"span",
|
|
2896
2981
|
{
|
|
2897
|
-
className: `docs-ruler-stop docs-ruler-stop--h${
|
|
2982
|
+
className: `docs-ruler-stop docs-ruler-stop--h${u === "right" ? " dragging" : ""}`,
|
|
2898
2983
|
style: { left: (t.width - t.marginRight) * e },
|
|
2899
|
-
onPointerDown:
|
|
2984
|
+
onPointerDown: g("right"),
|
|
2900
2985
|
title: "Drag to set the right margin"
|
|
2901
2986
|
}
|
|
2902
2987
|
)
|
|
@@ -2905,65 +2990,65 @@ function Rr({
|
|
|
2905
2990
|
}
|
|
2906
2991
|
) });
|
|
2907
2992
|
}
|
|
2908
|
-
function
|
|
2993
|
+
function Dr({
|
|
2909
2994
|
geometry: t,
|
|
2910
2995
|
zoom: e,
|
|
2911
|
-
scrollEl:
|
|
2912
|
-
onMargins:
|
|
2913
|
-
locked:
|
|
2996
|
+
scrollEl: r,
|
|
2997
|
+
onMargins: n,
|
|
2998
|
+
locked: s = !1,
|
|
2914
2999
|
/** Extra px between the top of the scroll area and the page sheet top. */
|
|
2915
3000
|
topOffset: c = 0
|
|
2916
3001
|
}) {
|
|
2917
|
-
const [
|
|
2918
|
-
|
|
2919
|
-
const
|
|
2920
|
-
if (!
|
|
2921
|
-
const v = () =>
|
|
2922
|
-
return v(),
|
|
2923
|
-
}, [
|
|
2924
|
-
const
|
|
2925
|
-
() =>
|
|
2926
|
-
[
|
|
2927
|
-
),
|
|
2928
|
-
(
|
|
2929
|
-
!
|
|
3002
|
+
const [i, u] = M(0), [a, m] = M(null), d = F(null);
|
|
3003
|
+
G(() => {
|
|
3004
|
+
const b = r.current;
|
|
3005
|
+
if (!b) return;
|
|
3006
|
+
const v = () => u(b.scrollTop);
|
|
3007
|
+
return v(), b.addEventListener("scroll", v, { passive: !0 }), () => b.removeEventListener("scroll", v);
|
|
3008
|
+
}, [r]);
|
|
3009
|
+
const g = t.autoHeight ? t.width * 1.414 : t.height, f = tt(
|
|
3010
|
+
() => Le(g, t.unit),
|
|
3011
|
+
[g, t.unit]
|
|
3012
|
+
), y = _(
|
|
3013
|
+
(b) => (v) => {
|
|
3014
|
+
!n || s || t.autoHeight || (v.preventDefault(), m(b));
|
|
2930
3015
|
},
|
|
2931
|
-
[
|
|
3016
|
+
[n, s, t.autoHeight]
|
|
2932
3017
|
);
|
|
2933
|
-
|
|
2934
|
-
if (!
|
|
2935
|
-
const
|
|
2936
|
-
const
|
|
2937
|
-
if (!
|
|
2938
|
-
const
|
|
2939
|
-
if (
|
|
2940
|
-
const
|
|
2941
|
-
|
|
3018
|
+
G(() => {
|
|
3019
|
+
if (!a || !n) return;
|
|
3020
|
+
const b = (R) => {
|
|
3021
|
+
const z = d.current;
|
|
3022
|
+
if (!z) return;
|
|
3023
|
+
const B = z.getBoundingClientRect(), U = (R.clientY - B.top) / e;
|
|
3024
|
+
if (a === "top") {
|
|
3025
|
+
const j = Math.max(0, Math.min(U, g / 2));
|
|
3026
|
+
n({ top: j });
|
|
2942
3027
|
} else {
|
|
2943
|
-
const
|
|
2944
|
-
|
|
3028
|
+
const j = Math.max(0, Math.min(g - U, g / 2));
|
|
3029
|
+
n({ bottom: j });
|
|
2945
3030
|
}
|
|
2946
3031
|
}, v = () => m(null);
|
|
2947
|
-
return window.addEventListener("pointermove",
|
|
2948
|
-
window.removeEventListener("pointermove",
|
|
3032
|
+
return window.addEventListener("pointermove", b), window.addEventListener("pointerup", v), () => {
|
|
3033
|
+
window.removeEventListener("pointermove", b), window.removeEventListener("pointerup", v);
|
|
2949
3034
|
};
|
|
2950
|
-
}, [
|
|
2951
|
-
const
|
|
2952
|
-
return /* @__PURE__ */
|
|
3035
|
+
}, [a, n, e, g]);
|
|
3036
|
+
const k = g * e, x = !!n && !s && !t.autoHeight;
|
|
3037
|
+
return /* @__PURE__ */ o("div", { className: "docs-ruler-v", children: /* @__PURE__ */ h(
|
|
2953
3038
|
"div",
|
|
2954
3039
|
{
|
|
2955
|
-
ref:
|
|
3040
|
+
ref: d,
|
|
2956
3041
|
className: "docs-ruler-v-track",
|
|
2957
|
-
style: { height:
|
|
3042
|
+
style: { height: k, transform: `translateY(${c - i}px)` },
|
|
2958
3043
|
children: [
|
|
2959
|
-
/* @__PURE__ */
|
|
3044
|
+
/* @__PURE__ */ o(
|
|
2960
3045
|
"div",
|
|
2961
3046
|
{
|
|
2962
3047
|
className: "docs-ruler-margin docs-ruler-margin--v",
|
|
2963
3048
|
style: { top: 0, height: t.marginTop * e }
|
|
2964
3049
|
}
|
|
2965
3050
|
),
|
|
2966
|
-
/* @__PURE__ */
|
|
3051
|
+
/* @__PURE__ */ o(
|
|
2967
3052
|
"div",
|
|
2968
3053
|
{
|
|
2969
3054
|
className: "docs-ruler-margin docs-ruler-margin--v",
|
|
@@ -2971,31 +3056,31 @@ function Pr({
|
|
|
2971
3056
|
}
|
|
2972
3057
|
),
|
|
2973
3058
|
f.map(
|
|
2974
|
-
(
|
|
3059
|
+
(b, v) => b.label ? /* @__PURE__ */ o("span", { className: "docs-ruler-num docs-ruler-num--v", style: { top: b.x * e }, children: b.label }, v) : /* @__PURE__ */ o(
|
|
2975
3060
|
"span",
|
|
2976
3061
|
{
|
|
2977
|
-
className: `docs-ruler-tick docs-ruler-tick--v docs-ruler-tick--${
|
|
2978
|
-
style: { top:
|
|
3062
|
+
className: `docs-ruler-tick docs-ruler-tick--v docs-ruler-tick--${b.kind}`,
|
|
3063
|
+
style: { top: b.x * e }
|
|
2979
3064
|
},
|
|
2980
3065
|
v
|
|
2981
3066
|
)
|
|
2982
3067
|
),
|
|
2983
|
-
|
|
2984
|
-
/* @__PURE__ */
|
|
3068
|
+
x && /* @__PURE__ */ h(Z, { children: [
|
|
3069
|
+
/* @__PURE__ */ o(
|
|
2985
3070
|
"span",
|
|
2986
3071
|
{
|
|
2987
|
-
className: `docs-ruler-stop docs-ruler-stop--v${
|
|
3072
|
+
className: `docs-ruler-stop docs-ruler-stop--v${a === "top" ? " dragging" : ""}`,
|
|
2988
3073
|
style: { top: t.marginTop * e },
|
|
2989
|
-
onPointerDown:
|
|
3074
|
+
onPointerDown: y("top"),
|
|
2990
3075
|
title: "Drag to set the top margin"
|
|
2991
3076
|
}
|
|
2992
3077
|
),
|
|
2993
|
-
/* @__PURE__ */
|
|
3078
|
+
/* @__PURE__ */ o(
|
|
2994
3079
|
"span",
|
|
2995
3080
|
{
|
|
2996
|
-
className: `docs-ruler-stop docs-ruler-stop--v${
|
|
2997
|
-
style: { top: (
|
|
2998
|
-
onPointerDown:
|
|
3081
|
+
className: `docs-ruler-stop docs-ruler-stop--v${a === "bottom" ? " dragging" : ""}`,
|
|
3082
|
+
style: { top: (g - t.marginBottom) * e },
|
|
3083
|
+
onPointerDown: y("bottom"),
|
|
2999
3084
|
title: "Drag to set the bottom margin"
|
|
3000
3085
|
}
|
|
3001
3086
|
)
|
|
@@ -3004,128 +3089,138 @@ function Pr({
|
|
|
3004
3089
|
}
|
|
3005
3090
|
) });
|
|
3006
3091
|
}
|
|
3007
|
-
function
|
|
3092
|
+
function Ht(t, e) {
|
|
3008
3093
|
return e ? `${t} (${e})` : t;
|
|
3009
3094
|
}
|
|
3010
|
-
function
|
|
3095
|
+
function Or({ trust: t, intact: e }) {
|
|
3011
3096
|
if (t.isSealed) {
|
|
3012
|
-
const
|
|
3013
|
-
return /* @__PURE__ */
|
|
3014
|
-
/* @__PURE__ */
|
|
3015
|
-
/* @__PURE__ */
|
|
3016
|
-
/* @__PURE__ */
|
|
3097
|
+
const r = t.sealedBy || "unknown", n = t.signatures[t.signatures.length - 1]?.role;
|
|
3098
|
+
return /* @__PURE__ */ h("div", { className: "docs-trust-banner docs-trust-banner--sealed", role: "status", children: [
|
|
3099
|
+
/* @__PURE__ */ o("span", { className: "docs-trust-banner__icon", children: "🔒" }),
|
|
3100
|
+
/* @__PURE__ */ o("span", { className: "docs-trust-banner__title", children: "Sealed" }),
|
|
3101
|
+
/* @__PURE__ */ h("span", { className: "docs-trust-banner__text", children: [
|
|
3017
3102
|
"signed by ",
|
|
3018
|
-
|
|
3103
|
+
Ht(r, n),
|
|
3019
3104
|
t.sealedAt ? ` on ${t.sealedAt}` : "",
|
|
3020
3105
|
" · read-only"
|
|
3021
3106
|
] }),
|
|
3022
|
-
e === !0 && /* @__PURE__ */
|
|
3023
|
-
e === !1 && /* @__PURE__ */
|
|
3107
|
+
e === !0 && /* @__PURE__ */ o("span", { className: "docs-trust-banner__verify docs-trust-banner__verify--ok", children: "hash verified ✓" }),
|
|
3108
|
+
e === !1 && /* @__PURE__ */ o("span", { className: "docs-trust-banner__verify docs-trust-banner__verify--bad", children: "⚠ hash mismatch — content changed after sealing" })
|
|
3024
3109
|
] });
|
|
3025
3110
|
}
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
/* @__PURE__ */
|
|
3029
|
-
|
|
3030
|
-
"
|
|
3031
|
-
" ",
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3111
|
+
if (t.signatures.length > 0) {
|
|
3112
|
+
const r = t.signatures.length;
|
|
3113
|
+
return /* @__PURE__ */ h("div", { className: "docs-trust-banner docs-trust-banner--signed", role: "status", children: [
|
|
3114
|
+
/* @__PURE__ */ o("span", { className: "docs-trust-banner__icon", children: "✍" }),
|
|
3115
|
+
/* @__PURE__ */ o("span", { className: "docs-trust-banner__title", children: "Signed" }),
|
|
3116
|
+
/* @__PURE__ */ h("span", { className: "docs-trust-banner__text", children: [
|
|
3117
|
+
"by",
|
|
3118
|
+
" ",
|
|
3119
|
+
t.signatures.map((n) => `${Ht(n.by, n.role)}${n.at ? ` on ${n.at}` : ""}`).join(" · ")
|
|
3120
|
+
] }),
|
|
3121
|
+
/* @__PURE__ */ h("span", { className: "docs-trust-banner__warn", children: [
|
|
3122
|
+
"⚠ Editing will break ",
|
|
3123
|
+
r,
|
|
3124
|
+
" signature",
|
|
3125
|
+
r === 1 ? "" : "s"
|
|
3126
|
+
] })
|
|
3127
|
+
] });
|
|
3128
|
+
}
|
|
3129
|
+
return t.approvals.length > 0 ? /* @__PURE__ */ h(
|
|
3035
3130
|
"div",
|
|
3036
3131
|
{
|
|
3037
3132
|
className: "docs-trust-banner docs-trust-banner--approved",
|
|
3038
3133
|
role: "status",
|
|
3039
3134
|
children: [
|
|
3040
|
-
/* @__PURE__ */
|
|
3041
|
-
/* @__PURE__ */
|
|
3042
|
-
/* @__PURE__ */
|
|
3135
|
+
/* @__PURE__ */ o("span", { className: "docs-trust-banner__icon", children: "✓" }),
|
|
3136
|
+
/* @__PURE__ */ o("span", { className: "docs-trust-banner__title", children: "Approved" }),
|
|
3137
|
+
/* @__PURE__ */ h("span", { className: "docs-trust-banner__text", children: [
|
|
3043
3138
|
"by",
|
|
3044
3139
|
" ",
|
|
3045
|
-
t.approvals.map((
|
|
3140
|
+
t.approvals.map((r) => `${Ht(r.by, r.role)}${r.at ? ` on ${r.at}` : ""}`).join(" · ")
|
|
3046
3141
|
] })
|
|
3047
3142
|
]
|
|
3048
3143
|
}
|
|
3049
3144
|
) : null;
|
|
3050
3145
|
}
|
|
3051
|
-
function
|
|
3146
|
+
function jr(t) {
|
|
3052
3147
|
let e;
|
|
3053
3148
|
try {
|
|
3054
|
-
e =
|
|
3149
|
+
e = ot(t);
|
|
3055
3150
|
} catch {
|
|
3056
3151
|
return [];
|
|
3057
3152
|
}
|
|
3058
|
-
const
|
|
3059
|
-
const
|
|
3060
|
-
|
|
3153
|
+
const r = [], n = (s, c) => {
|
|
3154
|
+
const i = c == null ? "" : String(c).trim();
|
|
3155
|
+
i && r.push({ key: s, value: i });
|
|
3061
3156
|
};
|
|
3062
|
-
for (const
|
|
3063
|
-
switch (
|
|
3157
|
+
for (const s of e.blocks)
|
|
3158
|
+
switch (s.type) {
|
|
3064
3159
|
case "meta":
|
|
3065
|
-
for (const [c,
|
|
3160
|
+
for (const [c, i] of Object.entries(s.properties || {})) n(c, i);
|
|
3066
3161
|
break;
|
|
3067
3162
|
case "track":
|
|
3068
|
-
|
|
3163
|
+
n("tracked", s.properties?.id ?? s.content);
|
|
3069
3164
|
break;
|
|
3070
3165
|
case "page": {
|
|
3071
|
-
const c =
|
|
3072
|
-
|
|
3166
|
+
const c = s.properties?.orientation;
|
|
3167
|
+
n(
|
|
3073
3168
|
"page",
|
|
3074
|
-
[
|
|
3169
|
+
[s.content, c].filter(Boolean).join(" · ")
|
|
3075
3170
|
);
|
|
3076
3171
|
break;
|
|
3077
3172
|
}
|
|
3078
3173
|
case "font":
|
|
3079
|
-
|
|
3174
|
+
n(
|
|
3080
3175
|
"font",
|
|
3081
3176
|
[
|
|
3082
|
-
|
|
3083
|
-
|
|
3177
|
+
s.content || s.properties?.family,
|
|
3178
|
+
s.properties?.size
|
|
3084
3179
|
].filter(Boolean).join(" · ")
|
|
3085
3180
|
);
|
|
3086
3181
|
break;
|
|
3087
3182
|
case "header":
|
|
3088
|
-
|
|
3183
|
+
n("header", s.content);
|
|
3089
3184
|
break;
|
|
3090
3185
|
case "footer":
|
|
3091
|
-
|
|
3186
|
+
n("footer", s.content);
|
|
3092
3187
|
break;
|
|
3093
3188
|
case "watermark":
|
|
3094
|
-
|
|
3189
|
+
n("watermark", s.content);
|
|
3095
3190
|
break;
|
|
3096
3191
|
}
|
|
3097
|
-
return
|
|
3192
|
+
return r;
|
|
3098
3193
|
}
|
|
3099
|
-
function
|
|
3100
|
-
const [e,
|
|
3101
|
-
if (
|
|
3102
|
-
const
|
|
3103
|
-
return /* @__PURE__ */
|
|
3104
|
-
/* @__PURE__ */
|
|
3194
|
+
function Fr({ source: t }) {
|
|
3195
|
+
const [e, r] = M(!1), n = tt(() => jr(t), [t]);
|
|
3196
|
+
if (n.length === 0) return null;
|
|
3197
|
+
const s = n.slice(0, 4).map((c) => `${c.key}: ${c.value}`).join(" · ");
|
|
3198
|
+
return /* @__PURE__ */ h("div", { className: `docs-props-bar${e ? " open" : ""}`, children: [
|
|
3199
|
+
/* @__PURE__ */ h(
|
|
3105
3200
|
"button",
|
|
3106
3201
|
{
|
|
3107
3202
|
className: "docs-props-toggle",
|
|
3108
|
-
onClick: () =>
|
|
3203
|
+
onClick: () => r((c) => !c),
|
|
3109
3204
|
title: e ? "Hide document properties" : "Show document properties",
|
|
3110
3205
|
children: [
|
|
3111
|
-
/* @__PURE__ */
|
|
3206
|
+
/* @__PURE__ */ o("span", { className: "docs-props-caret", children: e ? "▾" : "▸" }),
|
|
3112
3207
|
"Document properties",
|
|
3113
|
-
!e && /* @__PURE__ */
|
|
3208
|
+
!e && /* @__PURE__ */ o("span", { className: "docs-props-summary", children: s })
|
|
3114
3209
|
]
|
|
3115
3210
|
}
|
|
3116
3211
|
),
|
|
3117
|
-
e && /* @__PURE__ */
|
|
3118
|
-
/* @__PURE__ */
|
|
3212
|
+
e && /* @__PURE__ */ o("div", { className: "docs-props-chips", children: n.map((c, i) => /* @__PURE__ */ h("span", { className: "docs-props-chip", children: [
|
|
3213
|
+
/* @__PURE__ */ o("b", { children: c.key }),
|
|
3119
3214
|
" ",
|
|
3120
3215
|
c.value
|
|
3121
|
-
] }, `${c.key}-${
|
|
3216
|
+
] }, `${c.key}-${i}`)) })
|
|
3122
3217
|
] });
|
|
3123
3218
|
}
|
|
3124
|
-
function
|
|
3125
|
-
const
|
|
3126
|
-
return
|
|
3219
|
+
function D(t, e, r = "") {
|
|
3220
|
+
const n = t?.properties?.[e];
|
|
3221
|
+
return n != null ? String(n) : r;
|
|
3127
3222
|
}
|
|
3128
|
-
function
|
|
3223
|
+
function de(t) {
|
|
3129
3224
|
const e = {
|
|
3130
3225
|
lifecycle: "draft",
|
|
3131
3226
|
isTracked: !1,
|
|
@@ -3139,131 +3234,131 @@ function ce(t) {
|
|
|
3139
3234
|
amendments: []
|
|
3140
3235
|
};
|
|
3141
3236
|
if (!t) return e;
|
|
3142
|
-
const
|
|
3143
|
-
|
|
3144
|
-
id:
|
|
3145
|
-
by:
|
|
3146
|
-
at:
|
|
3237
|
+
const r = t.blocks, n = r.find((a) => a.type === "track");
|
|
3238
|
+
n && (e.isTracked = !0, e.lifecycle = "tracked", e.trackBlock = {
|
|
3239
|
+
id: D(n, "id", n.content ?? ""),
|
|
3240
|
+
by: D(n, "by"),
|
|
3241
|
+
at: D(n, "at")
|
|
3147
3242
|
});
|
|
3148
|
-
const
|
|
3149
|
-
for (const
|
|
3243
|
+
const s = r.filter((a) => a.type === "approve");
|
|
3244
|
+
for (const a of s)
|
|
3150
3245
|
e.approvals.push({
|
|
3151
|
-
by:
|
|
3152
|
-
role:
|
|
3153
|
-
at:
|
|
3154
|
-
note:
|
|
3246
|
+
by: D(a, "by", a.content ?? ""),
|
|
3247
|
+
role: D(a, "role"),
|
|
3248
|
+
at: D(a, "at"),
|
|
3249
|
+
note: D(a, "note") || void 0
|
|
3155
3250
|
});
|
|
3156
3251
|
e.approvals.length > 0 && (e.lifecycle = "approved");
|
|
3157
|
-
const c =
|
|
3158
|
-
for (const
|
|
3252
|
+
const c = r.filter((a) => a.type === "sign");
|
|
3253
|
+
for (const a of c)
|
|
3159
3254
|
e.signatures.push({
|
|
3160
|
-
by:
|
|
3161
|
-
role:
|
|
3162
|
-
at:
|
|
3255
|
+
by: D(a, "by", a.content ?? ""),
|
|
3256
|
+
role: D(a, "role"),
|
|
3257
|
+
at: D(a, "at")
|
|
3163
3258
|
});
|
|
3164
3259
|
e.signatures.length > 0 && (e.lifecycle = "signed");
|
|
3165
|
-
const
|
|
3166
|
-
if (
|
|
3260
|
+
const i = r.find((a) => a.type === "freeze");
|
|
3261
|
+
if (i) {
|
|
3167
3262
|
e.isSealed = !0, e.lifecycle = "sealed";
|
|
3168
|
-
const
|
|
3169
|
-
e.sealedBy =
|
|
3263
|
+
const a = e.signatures[e.signatures.length - 1];
|
|
3264
|
+
e.sealedBy = a?.by || D(i, "by", i.content ?? ""), e.sealedAt = D(i, "at") || a?.at || "", e.sealHash = D(i, "hash");
|
|
3170
3265
|
}
|
|
3171
|
-
const
|
|
3172
|
-
for (const
|
|
3266
|
+
const u = r.filter((a) => a.type === "amendment");
|
|
3267
|
+
for (const a of u)
|
|
3173
3268
|
e.amendments.push({
|
|
3174
|
-
section:
|
|
3175
|
-
was:
|
|
3176
|
-
now:
|
|
3177
|
-
by:
|
|
3178
|
-
ref:
|
|
3179
|
-
at:
|
|
3269
|
+
section: D(a, "section", a.content ?? ""),
|
|
3270
|
+
was: D(a, "was"),
|
|
3271
|
+
now: D(a, "now"),
|
|
3272
|
+
by: D(a, "by"),
|
|
3273
|
+
ref: D(a, "ref"),
|
|
3274
|
+
at: D(a, "at")
|
|
3180
3275
|
});
|
|
3181
3276
|
return e;
|
|
3182
3277
|
}
|
|
3183
|
-
const
|
|
3184
|
-
function
|
|
3278
|
+
const ue = new he("template-highlight"), At = /\{\{[^}]+\}\}/g;
|
|
3279
|
+
function pe(t) {
|
|
3185
3280
|
const e = [];
|
|
3186
|
-
return t.descendants((
|
|
3187
|
-
if (!
|
|
3188
|
-
|
|
3189
|
-
let
|
|
3190
|
-
for (;
|
|
3281
|
+
return t.descendants((r, n) => {
|
|
3282
|
+
if (!r.isText || !r.text) return;
|
|
3283
|
+
At.lastIndex = 0;
|
|
3284
|
+
let s;
|
|
3285
|
+
for (; s = At.exec(r.text); )
|
|
3191
3286
|
e.push(
|
|
3192
|
-
|
|
3287
|
+
Rt.inline(n + s.index, n + s.index + s[0].length, {
|
|
3193
3288
|
class: "it-doc-var"
|
|
3194
3289
|
})
|
|
3195
3290
|
);
|
|
3196
|
-
}),
|
|
3291
|
+
}), Lt.create(t, e);
|
|
3197
3292
|
}
|
|
3198
|
-
const
|
|
3293
|
+
const Ur = Tt.create({
|
|
3199
3294
|
name: "templateHighlight",
|
|
3200
3295
|
addProseMirrorPlugins() {
|
|
3201
3296
|
return [
|
|
3202
|
-
new
|
|
3203
|
-
key:
|
|
3297
|
+
new fe({
|
|
3298
|
+
key: ue,
|
|
3204
3299
|
state: {
|
|
3205
|
-
init: (t, e) =>
|
|
3206
|
-
apply: (t, e) => t.docChanged ?
|
|
3300
|
+
init: (t, e) => pe(e.doc),
|
|
3301
|
+
apply: (t, e) => t.docChanged ? pe(t.doc) : e
|
|
3207
3302
|
},
|
|
3208
3303
|
props: {
|
|
3209
3304
|
decorations(t) {
|
|
3210
|
-
return
|
|
3305
|
+
return ue.getState(t);
|
|
3211
3306
|
}
|
|
3212
3307
|
}
|
|
3213
3308
|
})
|
|
3214
3309
|
];
|
|
3215
3310
|
}
|
|
3216
3311
|
});
|
|
3217
|
-
function
|
|
3218
|
-
const e = /* @__PURE__ */ new Set(),
|
|
3219
|
-
|
|
3220
|
-
let
|
|
3221
|
-
for (;
|
|
3222
|
-
const
|
|
3223
|
-
/^(page|pages|date|time|year)$/i.test(
|
|
3312
|
+
function gs(t) {
|
|
3313
|
+
const e = /* @__PURE__ */ new Set(), r = [];
|
|
3314
|
+
At.lastIndex = 0;
|
|
3315
|
+
let n;
|
|
3316
|
+
for (; n = At.exec(t); ) {
|
|
3317
|
+
const s = n[0].slice(2, -2).trim();
|
|
3318
|
+
/^(page|pages|date|time|year)$/i.test(s) || e.has(s) || (e.add(s), r.push(s));
|
|
3224
3319
|
}
|
|
3225
|
-
return
|
|
3320
|
+
return r;
|
|
3226
3321
|
}
|
|
3227
|
-
function
|
|
3322
|
+
function ms(t) {
|
|
3228
3323
|
const e = {};
|
|
3229
|
-
for (const
|
|
3230
|
-
const
|
|
3231
|
-
let
|
|
3232
|
-
for (let c = 0; c <
|
|
3233
|
-
const
|
|
3234
|
-
c ===
|
|
3324
|
+
for (const r of t) {
|
|
3325
|
+
const n = r.split(".");
|
|
3326
|
+
let s = e;
|
|
3327
|
+
for (let c = 0; c < n.length; c++) {
|
|
3328
|
+
const i = n[c];
|
|
3329
|
+
c === n.length - 1 ? i in s || (s[i] = "") : ((!(i in s) || typeof s[i] != "object" || s[i] === null) && (s[i] = {}), s = s[i]);
|
|
3235
3330
|
}
|
|
3236
3331
|
}
|
|
3237
3332
|
return e;
|
|
3238
3333
|
}
|
|
3239
|
-
function
|
|
3240
|
-
const
|
|
3241
|
-
let
|
|
3334
|
+
function Gr(t, e, r) {
|
|
3335
|
+
const n = t.coordsAtPos(e), s = n.top + 1, c = n.bottom - 1, i = r === "start" ? -1 : 1;
|
|
3336
|
+
let u = e, a = e;
|
|
3242
3337
|
for (let m = 0; m < 1e5; m++) {
|
|
3243
|
-
const
|
|
3244
|
-
if (
|
|
3245
|
-
let
|
|
3338
|
+
const d = u + i;
|
|
3339
|
+
if (d < 0 || d > t.state.doc.content.size) break;
|
|
3340
|
+
let g;
|
|
3246
3341
|
try {
|
|
3247
|
-
|
|
3342
|
+
g = t.coordsAtPos(d);
|
|
3248
3343
|
} catch {
|
|
3249
3344
|
break;
|
|
3250
3345
|
}
|
|
3251
|
-
if (
|
|
3252
|
-
|
|
3346
|
+
if (g.bottom <= s || g.top >= c) break;
|
|
3347
|
+
u = d, a = d;
|
|
3253
3348
|
}
|
|
3254
|
-
return
|
|
3349
|
+
return a;
|
|
3255
3350
|
}
|
|
3256
|
-
const
|
|
3351
|
+
const Wr = Tt.create({
|
|
3257
3352
|
name: "lineKeymap",
|
|
3258
3353
|
addKeyboardShortcuts() {
|
|
3259
|
-
const t = (e,
|
|
3260
|
-
const { view:
|
|
3261
|
-
if (
|
|
3354
|
+
const t = (e, r) => {
|
|
3355
|
+
const { view: n } = this.editor, { state: s } = n, { selection: c } = s, i = c.head, u = Gr(n, i, e);
|
|
3356
|
+
if (u == null || u === i)
|
|
3262
3357
|
return !1;
|
|
3263
|
-
const
|
|
3264
|
-
|
|
3358
|
+
const a = s.doc.resolve(u), m = r ? c.anchor : u, d = s.tr.setSelection(
|
|
3359
|
+
r ? Yt.between(s.doc.resolve(m), a) : Yt.near(a)
|
|
3265
3360
|
);
|
|
3266
|
-
return
|
|
3361
|
+
return n.dispatch(d.scrollIntoView()), !0;
|
|
3267
3362
|
};
|
|
3268
3363
|
return {
|
|
3269
3364
|
Home: () => t("start", !1),
|
|
@@ -3272,7 +3367,7 @@ const jr = vt.create({
|
|
|
3272
3367
|
"Shift-End": () => t("end", !0)
|
|
3273
3368
|
};
|
|
3274
3369
|
}
|
|
3275
|
-
}),
|
|
3370
|
+
}), Yr = 28, Kr = {
|
|
3276
3371
|
title: [".it-doc-title"],
|
|
3277
3372
|
summary: [".it-doc-summary"],
|
|
3278
3373
|
section: [".it-doc-section"],
|
|
@@ -3287,24 +3382,24 @@ const jr = vt.create({
|
|
|
3287
3382
|
contact: ['.it-doc-generic[data-keyword="contact"]'],
|
|
3288
3383
|
divider: [".it-doc-divider"]
|
|
3289
3384
|
};
|
|
3290
|
-
function
|
|
3385
|
+
function qr({
|
|
3291
3386
|
value: t,
|
|
3292
3387
|
onChange: e,
|
|
3293
|
-
theme:
|
|
3294
|
-
onThemeChange:
|
|
3295
|
-
readOnly:
|
|
3388
|
+
theme: r,
|
|
3389
|
+
onThemeChange: n,
|
|
3390
|
+
readOnly: s = !1,
|
|
3296
3391
|
showRibbon: c = !0,
|
|
3297
|
-
showTrustBanner:
|
|
3298
|
-
onTrustAction:
|
|
3392
|
+
showTrustBanner: i = !0,
|
|
3393
|
+
onTrustAction: u
|
|
3299
3394
|
}) {
|
|
3300
|
-
const
|
|
3395
|
+
const a = F(""), m = F(!1), d = F(!0), [g, f] = M([]), y = F(Bt("")), [k, x] = M(1), b = Re({
|
|
3301
3396
|
extensions: [
|
|
3302
|
-
|
|
3303
|
-
geometry: () =>
|
|
3304
|
-
gap:
|
|
3305
|
-
onPages:
|
|
3397
|
+
Rn.configure({
|
|
3398
|
+
geometry: () => y.current,
|
|
3399
|
+
gap: Yr,
|
|
3400
|
+
onPages: x
|
|
3306
3401
|
}),
|
|
3307
|
-
|
|
3402
|
+
Be.configure({
|
|
3308
3403
|
heading: !1,
|
|
3309
3404
|
codeBlock: !1,
|
|
3310
3405
|
blockquote: !1,
|
|
@@ -3312,43 +3407,43 @@ function Gr({
|
|
|
3312
3407
|
// Replaced by ITParagraph (core block props: end/leading/space-…).
|
|
3313
3408
|
paragraph: !1
|
|
3314
3409
|
}),
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3410
|
+
kr,
|
|
3411
|
+
vr,
|
|
3412
|
+
Wr,
|
|
3413
|
+
Ie,
|
|
3414
|
+
De,
|
|
3415
|
+
Oe,
|
|
3416
|
+
je.configure({ multicolor: !0 }),
|
|
3417
|
+
Fe.configure({
|
|
3323
3418
|
types: ["paragraph", "itTitle", "itSummary", "itSection", "itSub"]
|
|
3324
3419
|
}),
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
Zn,
|
|
3330
|
-
tr,
|
|
3420
|
+
Ue,
|
|
3421
|
+
An,
|
|
3422
|
+
Ge,
|
|
3423
|
+
We,
|
|
3331
3424
|
er,
|
|
3332
3425
|
nr,
|
|
3333
3426
|
rr,
|
|
3334
|
-
or,
|
|
3335
3427
|
sr,
|
|
3428
|
+
or,
|
|
3336
3429
|
ir,
|
|
3337
|
-
cr,
|
|
3338
3430
|
ar,
|
|
3339
|
-
|
|
3431
|
+
cr,
|
|
3340
3432
|
dr,
|
|
3433
|
+
lr,
|
|
3341
3434
|
ur,
|
|
3342
3435
|
pr,
|
|
3343
3436
|
fr,
|
|
3437
|
+
hr,
|
|
3344
3438
|
gr,
|
|
3345
|
-
|
|
3439
|
+
mr,
|
|
3440
|
+
Ur
|
|
3346
3441
|
],
|
|
3347
|
-
content:
|
|
3348
|
-
onUpdate: ({ editor:
|
|
3349
|
-
if (
|
|
3350
|
-
const
|
|
3351
|
-
|
|
3442
|
+
content: Ot(t),
|
|
3443
|
+
onUpdate: ({ editor: S }) => {
|
|
3444
|
+
if (d.current) return;
|
|
3445
|
+
const T = S.getJSON(), L = ye(T);
|
|
3446
|
+
a.current = L, m.current = !0, f(Kn(T)), e(L);
|
|
3352
3447
|
},
|
|
3353
3448
|
editorProps: {
|
|
3354
3449
|
attributes: {
|
|
@@ -3357,216 +3452,241 @@ function Gr({
|
|
|
3357
3452
|
}
|
|
3358
3453
|
}
|
|
3359
3454
|
});
|
|
3360
|
-
|
|
3361
|
-
const
|
|
3362
|
-
|
|
3455
|
+
G(() => {
|
|
3456
|
+
const S = window.setTimeout(() => {
|
|
3457
|
+
d.current = !1, a.current = t;
|
|
3363
3458
|
}, 0);
|
|
3364
|
-
return () => window.clearTimeout(
|
|
3365
|
-
}, []),
|
|
3366
|
-
if (
|
|
3459
|
+
return () => window.clearTimeout(S);
|
|
3460
|
+
}, []), G(() => {
|
|
3461
|
+
if (b) {
|
|
3367
3462
|
if (m.current) {
|
|
3368
3463
|
m.current = !1;
|
|
3369
3464
|
return;
|
|
3370
3465
|
}
|
|
3371
|
-
if (t !==
|
|
3372
|
-
const
|
|
3373
|
-
|
|
3466
|
+
if (t !== a.current) {
|
|
3467
|
+
const S = Ot(t);
|
|
3468
|
+
b.commands.setContent(S), a.current = t;
|
|
3374
3469
|
}
|
|
3375
3470
|
}
|
|
3376
|
-
}, [t,
|
|
3377
|
-
if (!
|
|
3378
|
-
const
|
|
3379
|
-
const L =
|
|
3380
|
-
L &&
|
|
3471
|
+
}, [t, b]), G(() => {
|
|
3472
|
+
if (!b) return;
|
|
3473
|
+
const S = (T) => {
|
|
3474
|
+
const L = T.detail;
|
|
3475
|
+
L && b.chain().focus().insertContent(L).run();
|
|
3381
3476
|
};
|
|
3382
|
-
return window.addEventListener("it-insert-text",
|
|
3383
|
-
}, [
|
|
3384
|
-
const v =
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
}, [v,
|
|
3388
|
-
const
|
|
3389
|
-
if (!
|
|
3477
|
+
return window.addEventListener("it-insert-text", S), () => window.removeEventListener("it-insert-text", S);
|
|
3478
|
+
}, [b]);
|
|
3479
|
+
const v = tt(() => Bt(t), [t]);
|
|
3480
|
+
G(() => {
|
|
3481
|
+
y.current = v, b?.view.dispatch(b.state.tr);
|
|
3482
|
+
}, [v, b]);
|
|
3483
|
+
const R = F(null), z = _(() => b ? b.storage.characterCount?.words?.() ?? b.getText().split(/\s+/).filter(Boolean).length : 0, [b]), B = tt(() => {
|
|
3484
|
+
if (!r) return "";
|
|
3390
3485
|
try {
|
|
3391
|
-
const
|
|
3392
|
-
return
|
|
3486
|
+
const S = tn(r);
|
|
3487
|
+
return S ? en(S).replace(/:root\{/, ".docs-page{") : "";
|
|
3393
3488
|
} catch {
|
|
3394
3489
|
return "";
|
|
3395
3490
|
}
|
|
3396
|
-
}, [
|
|
3491
|
+
}, [r]), U = tt(() => {
|
|
3397
3492
|
try {
|
|
3398
|
-
const
|
|
3399
|
-
|
|
3493
|
+
const S = ot(t), T = S.blocks.find((q) => q.type === "header")?.content || "", L = S.blocks.find((q) => q.type === "footer")?.content || "", K = S.metadata?.meta, J = String(
|
|
3494
|
+
S.metadata?.language || ""
|
|
3495
|
+
).toLowerCase(), nt = String(
|
|
3496
|
+
K?.dir || (J === "rtl" ? "rtl" : "") || "ltr"
|
|
3497
|
+
).toLowerCase();
|
|
3498
|
+
return { header: T, footer: L, dir: nt };
|
|
3400
3499
|
} catch {
|
|
3401
3500
|
return { header: "", footer: "", dir: "ltr" };
|
|
3402
3501
|
}
|
|
3403
|
-
}, [t]),
|
|
3502
|
+
}, [t]), j = tt(() => {
|
|
3404
3503
|
try {
|
|
3405
|
-
return
|
|
3504
|
+
return de(ot(t));
|
|
3406
3505
|
} catch {
|
|
3407
|
-
return
|
|
3506
|
+
return de(null);
|
|
3408
3507
|
}
|
|
3409
|
-
}, [t]),
|
|
3410
|
-
if (!
|
|
3508
|
+
}, [t]), V = tt(() => {
|
|
3509
|
+
if (!j.isSealed) return null;
|
|
3411
3510
|
try {
|
|
3412
|
-
return
|
|
3511
|
+
return ge(t).intact;
|
|
3413
3512
|
} catch {
|
|
3414
3513
|
return null;
|
|
3415
3514
|
}
|
|
3416
|
-
}, [t,
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
}, [
|
|
3420
|
-
if (!
|
|
3421
|
-
|
|
3422
|
-
}, [
|
|
3423
|
-
const
|
|
3515
|
+
}, [t, j.isSealed]), C = j.isSealed || s;
|
|
3516
|
+
G(() => {
|
|
3517
|
+
b && b.isEditable !== !C && b.setEditable(!C);
|
|
3518
|
+
}, [b, C]), G(() => {
|
|
3519
|
+
if (!b) return;
|
|
3520
|
+
b.view.dom.setAttribute("dir", U.dir === "rtl" ? "rtl" : "ltr");
|
|
3521
|
+
}, [b, U.dir]);
|
|
3522
|
+
const P = tt(() => {
|
|
3424
3523
|
try {
|
|
3425
|
-
return
|
|
3426
|
-
|
|
3427
|
-
|
|
3524
|
+
return nn(
|
|
3525
|
+
ot(t),
|
|
3526
|
+
Kr,
|
|
3428
3527
|
".docs-page .tiptap "
|
|
3429
3528
|
);
|
|
3430
3529
|
} catch {
|
|
3431
3530
|
return "";
|
|
3432
3531
|
}
|
|
3433
3532
|
}, [t]);
|
|
3434
|
-
|
|
3435
|
-
let
|
|
3533
|
+
G(() => {
|
|
3534
|
+
let S = document.getElementById(
|
|
3436
3535
|
"it-doc-style-rules"
|
|
3437
3536
|
);
|
|
3438
|
-
|
|
3439
|
-
}, [
|
|
3440
|
-
const
|
|
3441
|
-
|
|
3442
|
-
|
|
3443
|
-
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3537
|
+
S || (S = document.createElement("style"), S.id = "it-doc-style-rules", document.head.appendChild(S)), S.textContent = P;
|
|
3538
|
+
}, [P]);
|
|
3539
|
+
const X = _(() => {
|
|
3540
|
+
if (b) {
|
|
3541
|
+
const { from: T, to: L } = b.state.selection;
|
|
3542
|
+
let K = 0, J = !1;
|
|
3543
|
+
if (b.state.doc.nodesBetween(T, L, (q) => {
|
|
3544
|
+
if (q.isTextblock) {
|
|
3545
|
+
K++;
|
|
3546
|
+
const gt = q.attrs?.dir, St = (() => {
|
|
3547
|
+
try {
|
|
3548
|
+
return q.attrs?.props ? JSON.parse(q.attrs.props).dir : void 0;
|
|
3549
|
+
} catch {
|
|
3550
|
+
return;
|
|
3551
|
+
}
|
|
3552
|
+
})();
|
|
3553
|
+
return (gt === "rtl" || St === "rtl") && (J = !0), !1;
|
|
3554
|
+
}
|
|
3555
|
+
return !0;
|
|
3556
|
+
}), T !== L && K >= 1) {
|
|
3557
|
+
b.chain().focus().setBlockProp("dir", J ? null : "rtl").run();
|
|
3558
|
+
return;
|
|
3559
|
+
}
|
|
3560
|
+
}
|
|
3561
|
+
const S = U.dir === "rtl";
|
|
3562
|
+
e(rn(t, "dir", S ? null : "rtl"));
|
|
3563
|
+
}, [b, t, e, U.dir]), et = _(
|
|
3564
|
+
(S) => {
|
|
3565
|
+
const T = y.current, L = (St) => Math.max(0, Math.round(St / st * 10) / 10), K = L(S.top ?? T.marginTop), J = L(S.right ?? T.marginRight), nt = L(S.bottom ?? T.marginBottom), q = L(S.left ?? T.marginLeft), gt = `${K}mm ${J}mm ${nt}mm ${q}mm`;
|
|
3566
|
+
e(zn(t, gt));
|
|
3447
3567
|
},
|
|
3448
3568
|
[t, e]
|
|
3449
3569
|
);
|
|
3450
|
-
|
|
3451
|
-
const
|
|
3452
|
-
let
|
|
3453
|
-
|
|
3454
|
-
}, [
|
|
3455
|
-
const
|
|
3456
|
-
(
|
|
3457
|
-
const
|
|
3458
|
-
if (!
|
|
3459
|
-
const L =
|
|
3460
|
-
|
|
3461
|
-
cx:
|
|
3462
|
-
cy:
|
|
3570
|
+
G(() => {
|
|
3571
|
+
const S = "it-editor-theme-css";
|
|
3572
|
+
let T = document.getElementById(S);
|
|
3573
|
+
T || (T = document.createElement("style"), T.id = S, document.head.appendChild(T)), T.textContent = B;
|
|
3574
|
+
}, [B]);
|
|
3575
|
+
const Y = F(null), [w, I] = M(1), H = F(w), ft = F(null), yt = _(
|
|
3576
|
+
(S) => {
|
|
3577
|
+
const T = Y.current;
|
|
3578
|
+
if (!T) return;
|
|
3579
|
+
const L = T.getBoundingClientRect();
|
|
3580
|
+
ft.current = {
|
|
3581
|
+
cx: T.scrollLeft + (S.clientX - L.left),
|
|
3582
|
+
cy: T.scrollTop + (S.clientY - L.top)
|
|
3463
3583
|
};
|
|
3464
3584
|
},
|
|
3465
3585
|
[]
|
|
3466
|
-
),
|
|
3467
|
-
const
|
|
3468
|
-
|
|
3469
|
-
cx:
|
|
3470
|
-
cy:
|
|
3586
|
+
), at = _(() => {
|
|
3587
|
+
const S = Y.current;
|
|
3588
|
+
S && (ft.current = {
|
|
3589
|
+
cx: S.scrollLeft + S.clientWidth / 2,
|
|
3590
|
+
cy: S.scrollTop + S.clientHeight / 2
|
|
3471
3591
|
});
|
|
3472
3592
|
}, []);
|
|
3473
|
-
return
|
|
3474
|
-
const
|
|
3475
|
-
if (!
|
|
3476
|
-
const
|
|
3477
|
-
|
|
3478
|
-
const
|
|
3479
|
-
|
|
3480
|
-
}, [
|
|
3481
|
-
const
|
|
3482
|
-
if (
|
|
3483
|
-
if (
|
|
3484
|
-
|
|
3593
|
+
return He(() => {
|
|
3594
|
+
const S = Y.current, T = ft.current, L = H.current;
|
|
3595
|
+
if (!S || !T || L === w) return;
|
|
3596
|
+
const K = w / L;
|
|
3597
|
+
S.getBoundingClientRect();
|
|
3598
|
+
const J = T.cx - S.scrollLeft, nt = T.cy - S.scrollTop;
|
|
3599
|
+
S.scrollLeft = T.cx * K - J, S.scrollTop = T.cy * K - nt, ft.current = null, H.current = w;
|
|
3600
|
+
}, [w]), G(() => {
|
|
3601
|
+
const S = (T) => {
|
|
3602
|
+
if (T.metaKey || T.ctrlKey) {
|
|
3603
|
+
if (T.key === "p" || T.key === "P") {
|
|
3604
|
+
T.preventDefault(), Ne(t, r);
|
|
3485
3605
|
return;
|
|
3486
3606
|
}
|
|
3487
|
-
|
|
3607
|
+
T.key === "=" || T.key === "+" ? (T.preventDefault(), at(), I((L) => Math.min(2, +(L + 0.1).toFixed(2)))) : T.key === "-" ? (T.preventDefault(), at(), I((L) => Math.max(0.25, +(L - 0.1).toFixed(2)))) : T.key === "0" && (T.preventDefault(), at(), I(1));
|
|
3488
3608
|
}
|
|
3489
3609
|
};
|
|
3490
|
-
return window.addEventListener("keydown",
|
|
3491
|
-
}, [
|
|
3492
|
-
const
|
|
3493
|
-
if (!
|
|
3494
|
-
const
|
|
3610
|
+
return window.addEventListener("keydown", S), () => window.removeEventListener("keydown", S);
|
|
3611
|
+
}, [at, t, r]), G(() => {
|
|
3612
|
+
const S = Y.current;
|
|
3613
|
+
if (!S) return;
|
|
3614
|
+
const T = (L) => {
|
|
3495
3615
|
if (L.ctrlKey || L.metaKey) {
|
|
3496
3616
|
L.preventDefault();
|
|
3497
|
-
const
|
|
3498
|
-
|
|
3617
|
+
const K = L.deltaY > 0 ? -0.1 : 0.1;
|
|
3618
|
+
yt(L), I((J) => Math.min(2, Math.max(0.25, +(J + K).toFixed(2))));
|
|
3499
3619
|
}
|
|
3500
3620
|
};
|
|
3501
|
-
return
|
|
3502
|
-
}, [
|
|
3503
|
-
c && /* @__PURE__ */
|
|
3504
|
-
|
|
3621
|
+
return S.addEventListener("wheel", T, { passive: !1 }), () => S.removeEventListener("wheel", T);
|
|
3622
|
+
}, [yt]), /* @__PURE__ */ h("div", { className: "docs-container", children: [
|
|
3623
|
+
c && /* @__PURE__ */ o(
|
|
3624
|
+
Rr,
|
|
3505
3625
|
{
|
|
3506
|
-
editor:
|
|
3507
|
-
isRtl:
|
|
3508
|
-
onToggleRtl:
|
|
3626
|
+
editor: b,
|
|
3627
|
+
isRtl: U.dir === "rtl",
|
|
3628
|
+
onToggleRtl: X,
|
|
3509
3629
|
content: t,
|
|
3510
3630
|
onChange: e,
|
|
3511
|
-
theme:
|
|
3512
|
-
onThemeChange:
|
|
3513
|
-
onTrustAction:
|
|
3514
|
-
trust:
|
|
3515
|
-
sealIntact:
|
|
3631
|
+
theme: r,
|
|
3632
|
+
onThemeChange: n,
|
|
3633
|
+
onTrustAction: u,
|
|
3634
|
+
trust: j,
|
|
3635
|
+
sealIntact: V,
|
|
3516
3636
|
locked: C
|
|
3517
3637
|
}
|
|
3518
3638
|
),
|
|
3519
|
-
|
|
3520
|
-
|
|
3521
|
-
|
|
3639
|
+
i && /* @__PURE__ */ o(Or, { trust: j, intact: V }),
|
|
3640
|
+
i && /* @__PURE__ */ o(Fr, { source: t }),
|
|
3641
|
+
g.length > 0 && /* @__PURE__ */ h("div", { className: "docs-fidelity-warning", role: "status", children: [
|
|
3522
3642
|
"⚠ Some formatting (",
|
|
3523
|
-
|
|
3643
|
+
g.join(", "),
|
|
3524
3644
|
") can’t be saved to",
|
|
3525
3645
|
" ",
|
|
3526
|
-
/* @__PURE__ */
|
|
3646
|
+
/* @__PURE__ */ o("code", { children: ".it" }),
|
|
3527
3647
|
" and won’t appear when printed through the template — remove it or use the toolbar’s color/size/style controls instead."
|
|
3528
3648
|
] }),
|
|
3529
|
-
/* @__PURE__ */
|
|
3530
|
-
|
|
3649
|
+
/* @__PURE__ */ o(
|
|
3650
|
+
Ir,
|
|
3531
3651
|
{
|
|
3532
3652
|
geometry: v,
|
|
3533
|
-
zoom:
|
|
3534
|
-
scrollEl:
|
|
3535
|
-
onMargins:
|
|
3653
|
+
zoom: w,
|
|
3654
|
+
scrollEl: Y,
|
|
3655
|
+
onMargins: et,
|
|
3536
3656
|
locked: C
|
|
3537
3657
|
}
|
|
3538
3658
|
),
|
|
3539
|
-
/* @__PURE__ */
|
|
3540
|
-
/* @__PURE__ */
|
|
3541
|
-
|
|
3659
|
+
/* @__PURE__ */ h("div", { className: "docs-canvas-row", children: [
|
|
3660
|
+
/* @__PURE__ */ o(
|
|
3661
|
+
Dr,
|
|
3542
3662
|
{
|
|
3543
3663
|
geometry: v,
|
|
3544
|
-
zoom:
|
|
3545
|
-
scrollEl:
|
|
3546
|
-
onMargins:
|
|
3664
|
+
zoom: w,
|
|
3665
|
+
scrollEl: Y,
|
|
3666
|
+
onMargins: et,
|
|
3547
3667
|
locked: C
|
|
3548
3668
|
}
|
|
3549
3669
|
),
|
|
3550
|
-
/* @__PURE__ */
|
|
3551
|
-
/* @__PURE__ */
|
|
3670
|
+
/* @__PURE__ */ h("div", { className: "docs-canvas", ref: Y, children: [
|
|
3671
|
+
/* @__PURE__ */ o(
|
|
3552
3672
|
"div",
|
|
3553
3673
|
{
|
|
3554
3674
|
className: "docs-page-scaler",
|
|
3555
|
-
style: { width: v.width *
|
|
3556
|
-
children: /* @__PURE__ */
|
|
3675
|
+
style: { width: v.width * w },
|
|
3676
|
+
children: /* @__PURE__ */ o(
|
|
3557
3677
|
"div",
|
|
3558
3678
|
{
|
|
3559
3679
|
className: "docs-page-flow",
|
|
3560
|
-
dir:
|
|
3680
|
+
dir: U.dir,
|
|
3561
3681
|
style: {
|
|
3562
|
-
transform:
|
|
3682
|
+
transform: w !== 1 ? `scale(${w})` : void 0,
|
|
3563
3683
|
transformOrigin: "top left"
|
|
3564
3684
|
},
|
|
3565
|
-
children: /* @__PURE__ */
|
|
3685
|
+
children: /* @__PURE__ */ h(
|
|
3566
3686
|
"div",
|
|
3567
3687
|
{
|
|
3568
3688
|
className: "docs-page docs-sheet",
|
|
3569
|
-
ref:
|
|
3689
|
+
ref: R,
|
|
3570
3690
|
style: {
|
|
3571
3691
|
width: v.width,
|
|
3572
3692
|
minHeight: v.autoHeight ? v.width : void 0,
|
|
@@ -3574,16 +3694,16 @@ function Gr({
|
|
|
3574
3694
|
"--page-mx-r": `${v.marginRight}px`
|
|
3575
3695
|
},
|
|
3576
3696
|
children: [
|
|
3577
|
-
/* @__PURE__ */
|
|
3697
|
+
/* @__PURE__ */ o(
|
|
3578
3698
|
"div",
|
|
3579
3699
|
{
|
|
3580
3700
|
className: "docs-sheet-header",
|
|
3581
3701
|
"data-it-spacer": "",
|
|
3582
3702
|
style: { height: v.autoHeight ? void 0 : v.marginTop },
|
|
3583
|
-
children: /* @__PURE__ */
|
|
3703
|
+
children: /* @__PURE__ */ o("div", { className: "docs-pb-header", children: /* @__PURE__ */ o("span", { className: "docs-pb-text", children: v.autoHeight ? "" : me(v.header, 1, k) }) })
|
|
3584
3704
|
}
|
|
3585
3705
|
),
|
|
3586
|
-
/* @__PURE__ */
|
|
3706
|
+
/* @__PURE__ */ o(Pe, { editor: b })
|
|
3587
3707
|
]
|
|
3588
3708
|
}
|
|
3589
3709
|
)
|
|
@@ -3591,18 +3711,18 @@ function Gr({
|
|
|
3591
3711
|
)
|
|
3592
3712
|
}
|
|
3593
3713
|
),
|
|
3594
|
-
/* @__PURE__ */
|
|
3595
|
-
|
|
3714
|
+
/* @__PURE__ */ h("div", { className: "docs-page-footer", children: [
|
|
3715
|
+
k,
|
|
3596
3716
|
" ",
|
|
3597
|
-
|
|
3717
|
+
k === 1 ? "page" : "pages",
|
|
3598
3718
|
" ·",
|
|
3599
3719
|
" ",
|
|
3600
|
-
|
|
3720
|
+
z(),
|
|
3601
3721
|
" words",
|
|
3602
|
-
|
|
3722
|
+
w !== 1 && /* @__PURE__ */ h("span", { className: "zoom-indicator", children: [
|
|
3603
3723
|
" ",
|
|
3604
3724
|
"· ",
|
|
3605
|
-
Math.round(
|
|
3725
|
+
Math.round(w * 100),
|
|
3606
3726
|
"%"
|
|
3607
3727
|
] })
|
|
3608
3728
|
] })
|
|
@@ -3610,50 +3730,50 @@ function Gr({
|
|
|
3610
3730
|
] })
|
|
3611
3731
|
] });
|
|
3612
3732
|
}
|
|
3613
|
-
const
|
|
3614
|
-
function
|
|
3733
|
+
const Vr = "corporate";
|
|
3734
|
+
function bs({
|
|
3615
3735
|
value: t,
|
|
3616
3736
|
onChange: e,
|
|
3617
|
-
theme:
|
|
3618
|
-
onThemeChange:
|
|
3619
|
-
readOnly:
|
|
3737
|
+
theme: r,
|
|
3738
|
+
onThemeChange: n,
|
|
3739
|
+
readOnly: s = !1,
|
|
3620
3740
|
showRibbon: c = !0,
|
|
3621
|
-
showTrustBanner:
|
|
3622
|
-
onTrustAction:
|
|
3741
|
+
showTrustBanner: i = !0,
|
|
3742
|
+
onTrustAction: u
|
|
3623
3743
|
}) {
|
|
3624
|
-
const [
|
|
3744
|
+
const [a, m] = M(r ?? Vr), d = r ?? a, g = _(
|
|
3625
3745
|
(f) => {
|
|
3626
|
-
m(f),
|
|
3746
|
+
m(f), n?.(f);
|
|
3627
3747
|
},
|
|
3628
|
-
[
|
|
3748
|
+
[n]
|
|
3629
3749
|
);
|
|
3630
|
-
return /* @__PURE__ */
|
|
3631
|
-
|
|
3750
|
+
return /* @__PURE__ */ o(
|
|
3751
|
+
qr,
|
|
3632
3752
|
{
|
|
3633
3753
|
value: t,
|
|
3634
3754
|
onChange: e,
|
|
3635
|
-
theme:
|
|
3636
|
-
onThemeChange:
|
|
3637
|
-
readOnly:
|
|
3755
|
+
theme: d,
|
|
3756
|
+
onThemeChange: g,
|
|
3757
|
+
readOnly: s,
|
|
3638
3758
|
showRibbon: c,
|
|
3639
|
-
showTrustBanner:
|
|
3640
|
-
onTrustAction:
|
|
3759
|
+
showTrustBanner: i,
|
|
3760
|
+
onTrustAction: u
|
|
3641
3761
|
}
|
|
3642
3762
|
);
|
|
3643
3763
|
}
|
|
3644
3764
|
export {
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3765
|
+
bs as IntentTextEditor,
|
|
3766
|
+
ms as buildSampleSkeleton,
|
|
3767
|
+
Lr as builtinThemes,
|
|
3768
|
+
ye as docToSource,
|
|
3769
|
+
Nr as downloadItFile,
|
|
3770
|
+
hs as exportDocumentHTML,
|
|
3771
|
+
Ne as exportDocumentPDF,
|
|
3772
|
+
gs as extractTemplateVariables,
|
|
3773
|
+
de as extractTrustState,
|
|
3774
|
+
Bt as getPageGeometry,
|
|
3775
|
+
wr as printHtmlViaIframe,
|
|
3776
|
+
me as resolvePageTokens,
|
|
3777
|
+
Ot as sourceToDoc
|
|
3658
3778
|
};
|
|
3659
3779
|
//# sourceMappingURL=index.mjs.map
|