kindy-editor 3.2.2 → 3.2.3
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-lib/assets/{worker-CHtzL1YW.js → worker-BIFTSRF2.js} +7043 -7021
- package/dist-lib/{browser-BxYyzpLt.js → browser-xuRja-pP.js} +2 -2
- package/dist-lib/builder.js +7 -7
- package/dist-lib/changeAggregator-ymKDXGA8.js +376 -0
- package/dist-lib/{editorApp-N20nk5uQ.js → editorApp-zIpjgEaZ.js} +7281 -7230
- package/dist-lib/events.js +119 -43
- package/dist-lib/export.js +1739 -1732
- package/dist-lib/generate-toc.js +5 -5
- package/dist-lib/import.js +2 -2
- package/dist-lib/{kindy-editor-D4xSNtvA.js → kindy-editor-DuN692fi.js} +5 -5
- package/dist-lib/kindy-editor.js +9 -6
- package/dist-lib/{lists-DpmgbDyt.js → lists-BVCy5dMa.js} +2 -2
- package/dist-lib/measure.js +3 -3
- package/dist-lib/{measureHost-C2NOdNkI.js → measureHost-y37gLU6M.js} +2 -2
- package/dist-lib/{metrics-DHgtBP-R.js → metrics-CdfHD-8y.js} +3 -3
- package/dist-lib/{paintStyle-Cjk9egel.js → paintStyle-Cb7IGKPW.js} +51 -51
- package/dist-lib/{parse-JE_w0NNt.js → parse-DJZd-2A7.js} +20 -20
- package/dist-lib/{pipeline-CgbvBwNe.js → pipeline-DKgBMmw1.js} +301 -301
- package/dist-lib/recalc-docx.js +2 -2
- package/dist-lib/{recalcToc-DKJK9f5X.js → recalcToc-DCykIt4o.js} +80 -80
- package/dist-lib/{styleProps-OePkgWnD.js → styleProps-Dg3Wf-ZJ.js} +3 -3
- package/dist-lib/{stylesheet-COz2MSt6.js → stylesheet-EQFx9l5c.js} +3 -3
- package/dist-lib/{toc-C6XLbDEA.js → toc-BIj8uQ-W.js} +48 -48
- package/dist-lib/{webmcp-DrpPKUeh.js → webmcp-QA5rVg1F.js} +2 -2
- package/docs/http-event-sink.md +7 -0
- package/docs/public-events.md +102 -0
- package/docs/track-changes-events.md +551 -0
- package/package.json +2 -2
- package/types/events.d.ts +67 -1
- package/types/kindy-editor.d.ts +4 -0
- package/dist-lib/eventHub-CZFpTVqe.js +0 -71
- package/dist-lib/events-D_WEQDa6.js +0 -104
- package/docs/.vitepress/cache/deps/@theme_index.js +0 -275
- package/docs/.vitepress/cache/deps/@theme_index.js.map +0 -7
- package/docs/.vitepress/cache/deps/_metadata.json +0 -40
- package/docs/.vitepress/cache/deps/chunk-FNDFPMRQ.js +0 -13131
- package/docs/.vitepress/cache/deps/chunk-FNDFPMRQ.js.map +0 -7
- package/docs/.vitepress/cache/deps/chunk-IOFLAFGL.js +0 -9719
- package/docs/.vitepress/cache/deps/chunk-IOFLAFGL.js.map +0 -7
- package/docs/.vitepress/cache/deps/package.json +0 -3
- package/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js +0 -4483
- package/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js.map +0 -7
- package/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js +0 -583
- package/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js.map +0 -7
- package/docs/.vitepress/cache/deps/vue.js +0 -347
- package/docs/.vitepress/cache/deps/vue.js.map +0 -7
- package/docs/.vitepress/config.ts +0 -32
package/dist-lib/recalc-docx.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { u,
|
|
1
|
+
import { u, s as f, a as m, z as g } from "./browser-xuRja-pP.js";
|
|
2
2
|
import { f as h } from "./contentTypes-ChqPfcVI.js";
|
|
3
|
-
import { p as b, c as k } from "./recalcToc-
|
|
3
|
+
import { p as b, c as k } from "./recalcToc-DCykIt4o.js";
|
|
4
4
|
function w(s, r) {
|
|
5
5
|
const n = b(r), a = {};
|
|
6
6
|
for (const [o, i] of Object.entries(s.bookmarks ?? {})) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { m as he, f as Ue, c as le } from "./metrics-
|
|
4
|
-
import {
|
|
1
|
+
import { o as Ln, q as Ls, t as Os, s as Ps } from "./toc-BIj8uQ-W.js";
|
|
2
|
+
import { c as Is, f as Ze } from "./lists-BVCy5dMa.js";
|
|
3
|
+
import { m as he, f as Ue, c as le } from "./metrics-CdfHD-8y.js";
|
|
4
|
+
import { c as vs, f as On, M as nt, g as Rs, P as Mt, w as Ws, s as Ts } from "./paintStyle-Cb7IGKPW.js";
|
|
5
5
|
const Gs = [
|
|
6
6
|
"BN",
|
|
7
7
|
"BN",
|
|
@@ -1117,9 +1117,9 @@ function Ys(e) {
|
|
|
1117
1117
|
const t = e && e.length > 0 ? e : void 0;
|
|
1118
1118
|
Ft !== t && (Ft = t, He = null);
|
|
1119
1119
|
}
|
|
1120
|
-
const
|
|
1120
|
+
const Qs = /\p{Script=Arabic}/u, ke = /\p{M}/u, kt = /\p{Nd}/u;
|
|
1121
1121
|
function Jt(e) {
|
|
1122
|
-
return
|
|
1122
|
+
return Qs.test(e);
|
|
1123
1123
|
}
|
|
1124
1124
|
function Yt(e) {
|
|
1125
1125
|
return e >= 19968 && e <= 40959 || e >= 13312 && e <= 19903 || e >= 131072 && e <= 173791 || e >= 173824 && e <= 177983 || e >= 177984 && e <= 178207 || e >= 178208 && e <= 183983 || e >= 183984 && e <= 191471 || e >= 191472 && e <= 192093 || e >= 194560 && e <= 195103 || e >= 196608 && e <= 201551 || e >= 201552 && e <= 205743 || e >= 205744 && e <= 210041 || e >= 63744 && e <= 64255 || e >= 12288 && e <= 12351 || e >= 12352 && e <= 12447 || e >= 12448 && e <= 12543 || e >= 12592 && e <= 12687 || e >= 44032 && e <= 55215 || e >= 65280 && e <= 65519;
|
|
@@ -1144,7 +1144,7 @@ function fe(e) {
|
|
|
1144
1144
|
}
|
|
1145
1145
|
return !1;
|
|
1146
1146
|
}
|
|
1147
|
-
function
|
|
1147
|
+
function Vs(e) {
|
|
1148
1148
|
const t = qe(e);
|
|
1149
1149
|
return t !== null && (Bt.has(t) || Le.has(t));
|
|
1150
1150
|
}
|
|
@@ -1168,7 +1168,7 @@ function tr(e) {
|
|
|
1168
1168
|
return t !== null && Zs.has(t);
|
|
1169
1169
|
}
|
|
1170
1170
|
function In(e, t) {
|
|
1171
|
-
return er(e) ? !1 : t ? !(
|
|
1171
|
+
return er(e) ? !1 : t ? !(Vs(e) || tr(e)) : !0;
|
|
1172
1172
|
}
|
|
1173
1173
|
const Bt = /* @__PURE__ */ new Set([
|
|
1174
1174
|
",",
|
|
@@ -1454,7 +1454,7 @@ function dr(e) {
|
|
|
1454
1454
|
function pr(e, t, n) {
|
|
1455
1455
|
return n === "text" && !t && e.length === 1 && e !== "-" && e !== "—" ? e : null;
|
|
1456
1456
|
}
|
|
1457
|
-
function
|
|
1457
|
+
function Qt(e, t, n, s) {
|
|
1458
1458
|
const i = t[s], r = e[s];
|
|
1459
1459
|
if (i == null)
|
|
1460
1460
|
return r;
|
|
@@ -1464,7 +1464,7 @@ function Vt(e, t, n, s) {
|
|
|
1464
1464
|
const x = i.repeat(o);
|
|
1465
1465
|
return e[s] = x, x;
|
|
1466
1466
|
}
|
|
1467
|
-
function
|
|
1467
|
+
function Vt(e, t) {
|
|
1468
1468
|
return e && t !== null && nr.has(t);
|
|
1469
1469
|
}
|
|
1470
1470
|
function gr(e) {
|
|
@@ -1813,15 +1813,15 @@ function Gr(e, t, n) {
|
|
|
1813
1813
|
for (const C of Ar(A.segment, A.isWordLike ?? !1, A.index, n)) {
|
|
1814
1814
|
let P = function() {
|
|
1815
1815
|
c[B] !== null && (o[B] = [
|
|
1816
|
-
|
|
1817
|
-
], c[B] = null), o[B].push(C.text), x[B] = x[B] || C.isWordLike, h[B] = h[B] || ee, u[B] = u[B] || v, E[B] = y, p[B] = $, S[B] =
|
|
1816
|
+
Qt(r, c, a, B)
|
|
1817
|
+
], c[B] = null), o[B].push(C.text), x[B] = x[B] || C.isWordLike, h[B] = h[B] || ee, u[B] = u[B] || v, E[B] = y, p[B] = $, S[B] = Vt(u[B], H);
|
|
1818
1818
|
};
|
|
1819
1819
|
const _ = C.kind === "text", O = pr(C.text, C.isWordLike, C.kind), ee = fe(C.text), v = Jt(C.text), H = qe(C.text), y = mt(C.text), $ = gr(C.text), B = i - 1;
|
|
1820
|
-
t.carryCJKAfterClosingQuote && _ && i > 0 && l[B] === "text" && ee && h[B] && E[B] || _ && i > 0 && l[B] === "text" && or(C.text) && h[B] || _ && i > 0 && l[B] === "text" && p[B] ? P() : _ && i > 0 && l[B] === "text" && C.isWordLike && v && S[B] ? (P(), x[B] = !0) : O !== null && i > 0 && l[B] === "text" && c[B] === O ? a[B] = (a[B] ?? 1) + 1 : _ && !C.isWordLike && i > 0 && l[B] === "text" && !h[B] && (ir(C.text) || C.text === "-" && x[B]) ? P() : (r[i] = C.text, o[i] = [C.text], x[i] = C.isWordLike, l[i] = C.kind, d[i] = C.start, c[i] = O, a[i] = O === null ? 0 : 1, h[i] = ee, u[i] = v, E[i] = y, p[i] = $, S[i] =
|
|
1820
|
+
t.carryCJKAfterClosingQuote && _ && i > 0 && l[B] === "text" && ee && h[B] && E[B] || _ && i > 0 && l[B] === "text" && or(C.text) && h[B] || _ && i > 0 && l[B] === "text" && p[B] ? P() : _ && i > 0 && l[B] === "text" && C.isWordLike && v && S[B] ? (P(), x[B] = !0) : O !== null && i > 0 && l[B] === "text" && c[B] === O ? a[B] = (a[B] ?? 1) + 1 : _ && !C.isWordLike && i > 0 && l[B] === "text" && !h[B] && (ir(C.text) || C.text === "-" && x[B]) ? P() : (r[i] = C.text, o[i] = [C.text], x[i] = C.isWordLike, l[i] = C.kind, d[i] = C.start, c[i] = O, a[i] = O === null ? 0 : 1, h[i] = ee, u[i] = v, E[i] = y, p[i] = $, S[i] = Vt(v, H), i++);
|
|
1821
1821
|
}
|
|
1822
1822
|
for (let A = 0; A < i; A++) {
|
|
1823
1823
|
if (c[A] !== null) {
|
|
1824
|
-
r[A] =
|
|
1824
|
+
r[A] = Qt(r, c, a, A);
|
|
1825
1825
|
continue;
|
|
1826
1826
|
}
|
|
1827
1827
|
r[A] = de(o[A]);
|
|
@@ -2006,7 +2006,7 @@ function Jr(e) {
|
|
|
2006
2006
|
function Yr(e) {
|
|
2007
2007
|
return Kr.test(e);
|
|
2008
2008
|
}
|
|
2009
|
-
function
|
|
2009
|
+
function Qr(e, t) {
|
|
2010
2010
|
let n = en.get(e);
|
|
2011
2011
|
if (n !== void 0)
|
|
2012
2012
|
return n;
|
|
@@ -2021,7 +2021,7 @@ function Vr(e, t) {
|
|
|
2021
2021
|
}
|
|
2022
2022
|
return en.set(e, n), n;
|
|
2023
2023
|
}
|
|
2024
|
-
function
|
|
2024
|
+
function Vr(e) {
|
|
2025
2025
|
let t = 0;
|
|
2026
2026
|
const n = Wn();
|
|
2027
2027
|
for (const s of n.segment(e))
|
|
@@ -2029,7 +2029,7 @@ function Qr(e) {
|
|
|
2029
2029
|
return t;
|
|
2030
2030
|
}
|
|
2031
2031
|
function Xr(e, t) {
|
|
2032
|
-
return t.emojiCount === void 0 && (t.emojiCount =
|
|
2032
|
+
return t.emojiCount === void 0 && (t.emojiCount = Vr(e)), t.emojiCount;
|
|
2033
2033
|
}
|
|
2034
2034
|
function Ce(e, t, n) {
|
|
2035
2035
|
return n === 0 ? t.width : t.width - Xr(e, t) * n;
|
|
@@ -2078,7 +2078,7 @@ function Zr(e, t, n, s, i) {
|
|
|
2078
2078
|
function ei(e, t) {
|
|
2079
2079
|
const n = yt();
|
|
2080
2080
|
n.font = e;
|
|
2081
|
-
const s = qr(e), i = $r(e), r = t ?
|
|
2081
|
+
const s = qr(e), i = $r(e), r = t ? Qr(e, i) : 0;
|
|
2082
2082
|
return { cache: s, fontSize: i, emojiCorrection: r };
|
|
2083
2083
|
}
|
|
2084
2084
|
function ti(e) {
|
|
@@ -2894,12 +2894,12 @@ function ye(e, t, n) {
|
|
|
2894
2894
|
rules: []
|
|
2895
2895
|
};
|
|
2896
2896
|
}
|
|
2897
|
-
const
|
|
2897
|
+
const Qi = new Set("=≠<>≤≥≈≡∈∉⊂⊆⊃⊇→←↔⇒⇐⇔∼≅∝".split("")), Vi = new Set("+−-±∓×÷·∗⋅∪∩∨∧⊕⊗∖".split("")), Xi = new Set(",;".split("")), Zi = new Set("([{⟨".split("")), e0 = new Set(")]}⟩".split(""));
|
|
2898
2898
|
function un(e) {
|
|
2899
2899
|
if (e.type === "op") {
|
|
2900
2900
|
const t = e.text;
|
|
2901
|
-
if (
|
|
2902
|
-
if (
|
|
2901
|
+
if (Qi.has(t)) return "rel";
|
|
2902
|
+
if (Vi.has(t)) return "bin";
|
|
2903
2903
|
if (Xi.has(t)) return "punct";
|
|
2904
2904
|
if (Zi.has(t)) return "open";
|
|
2905
2905
|
if (e0.has(t)) return "close";
|
|
@@ -3300,7 +3300,7 @@ function O0(e) {
|
|
|
3300
3300
|
}
|
|
3301
3301
|
return n;
|
|
3302
3302
|
}
|
|
3303
|
-
function
|
|
3303
|
+
function Qn(e) {
|
|
3304
3304
|
const t = b0(O0(e));
|
|
3305
3305
|
return { prepared: Ii(y0(t), { whiteSpace: "pre-wrap" }), runs: t };
|
|
3306
3306
|
}
|
|
@@ -3309,7 +3309,7 @@ class At {
|
|
|
3309
3309
|
get(t) {
|
|
3310
3310
|
const n = this.map.get(t.id);
|
|
3311
3311
|
if (n && n.revision === t.revision) return n.segments;
|
|
3312
|
-
const s = C0(t.runs).map((i) => ({ ...
|
|
3312
|
+
const s = C0(t.runs).map((i) => ({ ...Qn(i.runs), startOffset: i.startOffset }));
|
|
3313
3313
|
return this.map.set(t.id, { revision: t.revision, segments: s }), s;
|
|
3314
3314
|
}
|
|
3315
3315
|
evict(t) {
|
|
@@ -3327,7 +3327,7 @@ class At {
|
|
|
3327
3327
|
for (const n of this.map.keys()) t.has(n) || this.map.delete(n);
|
|
3328
3328
|
}
|
|
3329
3329
|
}
|
|
3330
|
-
function
|
|
3330
|
+
function Vn(e) {
|
|
3331
3331
|
return e === "rtl" ? 1 : 0;
|
|
3332
3332
|
}
|
|
3333
3333
|
const P0 = /[-ࣿיִ-﷿ﹰ-]/;
|
|
@@ -3406,7 +3406,7 @@ function T0(e, t) {
|
|
|
3406
3406
|
return D === void 0 && (D = ++u, h.set(w, D)), D;
|
|
3407
3407
|
}, p = /* @__PURE__ */ new WeakMap(), S = (w) => {
|
|
3408
3408
|
let D = p.get(w);
|
|
3409
|
-
return D === void 0 && (D =
|
|
3409
|
+
return D === void 0 && (D = Q0(w).some((A) => /\{(date|time)\}/.test(A)), p.set(w, D)), D;
|
|
3410
3410
|
}, m = /* @__PURE__ */ new Map();
|
|
3411
3411
|
let W = null;
|
|
3412
3412
|
const L = (w, D, A, C, _, O, ee) => {
|
|
@@ -3613,7 +3613,7 @@ function K0(e, t, n, s, i) {
|
|
|
3613
3613
|
B && y === "right" ? P = H.posPx - $ : B && y === "center" ? P = H.posPx - $ / 2 : B && y === "decimal" && (P = H.posPx - U0(w.runs)), P < p && (P = p), (H.leader ?? "none") !== "none" && P > p + 1 && c && u.push({ x1: p, x2: P, kind: H.leader ?? "none", color: c.color, fontSizePx: c.fontSizePx }), E.push({ x1: p, x2: Math.max(P, p) }), p = P, W = !0;
|
|
3614
3614
|
}
|
|
3615
3615
|
if (w.runs.length === 0) return;
|
|
3616
|
-
const A =
|
|
3616
|
+
const A = Qn(w.runs), C = { prepared: A.prepared, runs: A.runs, startOffset: w.start }, _ = Pt(A.runs, w.start), O = A.runs.map(() => 0);
|
|
3617
3617
|
let ee, v = !0;
|
|
3618
3618
|
for (; ; ) {
|
|
3619
3619
|
const H = Math.max(24, s - (v ? p : 0)), y = vt(e, C, H, ee, _, O);
|
|
@@ -3636,7 +3636,7 @@ function rs(e, t) {
|
|
|
3636
3636
|
r.hadGap && (i += s), r.frag.x += i, r.spaces > 0 && (r.frag.wordSpacingPx = s, r.frag.width += r.spaces * s, i += r.spaces * s);
|
|
3637
3637
|
}
|
|
3638
3638
|
function is(e) {
|
|
3639
|
-
const t =
|
|
3639
|
+
const t = Vn(e.style.direction);
|
|
3640
3640
|
let n = "";
|
|
3641
3641
|
const s = [];
|
|
3642
3642
|
for (const r of e.runs) {
|
|
@@ -3748,7 +3748,7 @@ function ls(e, t, n) {
|
|
|
3748
3748
|
const E = d[u];
|
|
3749
3749
|
E !== void 0 && (u === s.length - 1 ? x[E].paragraphEnd = !0 : x[E].lineBreak = !0);
|
|
3750
3750
|
}
|
|
3751
|
-
const c = Xn(e.style.align, o), a =
|
|
3751
|
+
const c = Xn(e.style.align, o), a = Vn(o) === 1;
|
|
3752
3752
|
let h = 0;
|
|
3753
3753
|
for (const u of x) {
|
|
3754
3754
|
if (u.tabbed) {
|
|
@@ -3817,21 +3817,21 @@ function J0(e, t, n, s, i = Te, r = je) {
|
|
|
3817
3817
|
const M = [f.header, f.headerFirst, f.headerEven].filter((G) => !!G), N = [f.footer, f.footerFirst, f.footerEven].filter((G) => !!G);
|
|
3818
3818
|
if (M.length > 0 || N.length > 0) {
|
|
3819
3819
|
l ??= new At();
|
|
3820
|
-
const G = f.pageWidthPx - f.marginPx.left - f.marginPx.right, j = f.marginPx.left, R = (
|
|
3821
|
-
const
|
|
3822
|
-
for (const te of
|
|
3823
|
-
if (!!te.table || !!te.image || !!te.equation || te.lines.some((oe) => oe.fragments.some((X) => X.text.trim().length > 0 || !!X.equation))) return
|
|
3820
|
+
const G = f.pageWidthPx - f.marginPx.left - f.marginPx.right, j = f.marginPx.left, R = (V) => je(V, G, j, 999, 999, l, !1).height, Z = (V) => {
|
|
3821
|
+
const Q = je(V, G, j, 999, 999, l, !1);
|
|
3822
|
+
for (const te of Q.placed)
|
|
3823
|
+
if (!!te.table || !!te.image || !!te.equation || te.lines.some((oe) => oe.fragments.some((X) => X.text.trim().length > 0 || !!X.equation))) return Q.height - te.y;
|
|
3824
3824
|
return 0;
|
|
3825
|
-
}, J = M.reduce((
|
|
3825
|
+
}, J = M.reduce((V, Q) => Math.max(V, R(Q)), 0);
|
|
3826
3826
|
if (J > 0) {
|
|
3827
|
-
const
|
|
3828
|
-
F = Math.max(F,
|
|
3827
|
+
const V = bn(f, J);
|
|
3828
|
+
F = Math.max(F, V + J + 6);
|
|
3829
3829
|
}
|
|
3830
|
-
const z = N.reduce((
|
|
3830
|
+
const z = N.reduce((V, Q) => Math.max(V, R(Q)), 0);
|
|
3831
3831
|
if (z > 0)
|
|
3832
3832
|
if (f.footerDistancePx !== void 0) {
|
|
3833
|
-
const
|
|
3834
|
-
k = Math.min(k,
|
|
3833
|
+
const V = f.pageHeightPx - f.footerDistancePx, Q = N.reduce((te, ie) => Math.max(te, Z(ie)), 0);
|
|
3834
|
+
k = Math.min(k, V - Q);
|
|
3835
3835
|
} else
|
|
3836
3836
|
k = Math.min(k, Cn(f, z) - 6);
|
|
3837
3837
|
k = Math.max(k, F + 24);
|
|
@@ -3943,16 +3943,16 @@ function J0(e, t, n, s, i = Te, r = je) {
|
|
|
3943
3943
|
return k;
|
|
3944
3944
|
};
|
|
3945
3945
|
let Oe = 0, Ye = 0;
|
|
3946
|
-
const ue = () => W[Oe]?.x ?? h, ae = () => q.blocks.length > Ye,
|
|
3946
|
+
const ue = () => W[Oe]?.x ?? h, ae = () => q.blocks.length > Ye, Qe = () => {
|
|
3947
3947
|
Oe = 0, Ye = 0, q = Y(), K.push(q), Ge.push([]), Je.push(0), Be = 0, T = u, Se = [];
|
|
3948
3948
|
}, xe = () => {
|
|
3949
|
-
Oe + 1 < S ? (Oe++, Ye = q.blocks.length, T = u, Se = []) :
|
|
3949
|
+
Oe + 1 < S ? (Oe++, Ye = q.blocks.length, T = u, Se = []) : Qe();
|
|
3950
3950
|
}, Fs = () => {
|
|
3951
3951
|
q.widthPx = a.pageWidthPx, q.heightPx = a.pageHeightPx, q.marginPx = a.marginPx, q.contentTopPx = u, q.contentBottomPx = E, a.pageColorHex !== void 0 ? q.pageColorHex = a.pageColorHex : delete q.pageColorHex, a.pageBorders !== void 0 ? q.pageBorders = a.pageBorders : delete q.pageBorders, L.length ? q.columnSeparatorsX = L.slice() : delete q.columnSeparatorsX, I[q.index] = a, Oe = 0, Ye = 0, T = u, Se = [];
|
|
3952
3952
|
}, ms = (f) => {
|
|
3953
|
-
if (q.blocks.length === 0 ? Fs() :
|
|
3953
|
+
if (q.blocks.length === 0 ? Fs() : Qe(), f === "evenPage" || f === "oddPage") {
|
|
3954
3954
|
const g = f === "evenPage";
|
|
3955
|
-
q.number % 2 === 0 !== g &&
|
|
3955
|
+
q.number % 2 === 0 !== g && Qe();
|
|
3956
3956
|
}
|
|
3957
3957
|
}, Ns = (f, g, F, k) => {
|
|
3958
3958
|
if (f.style.direction !== "rtl") return g - k.hangingPx;
|
|
@@ -4132,26 +4132,26 @@ function J0(e, t, n, s, i = Te, r = je) {
|
|
|
4132
4132
|
}, j = (R, Z, J, z) => {
|
|
4133
4133
|
if (b === null) {
|
|
4134
4134
|
b = { blockId: f.id, x: ue() + _(f), y: T, firstLineIndex: N, lines: [] };
|
|
4135
|
-
const
|
|
4136
|
-
if (
|
|
4135
|
+
const Q = N === 0 ? H.get(f.id) : void 0;
|
|
4136
|
+
if (Q) {
|
|
4137
4137
|
let te;
|
|
4138
4138
|
if (f.style.direction === "rtl") {
|
|
4139
4139
|
let ie = 0;
|
|
4140
4140
|
for (const X of R) ie = Math.max(ie, X.frag.x + X.frag.width);
|
|
4141
|
-
const oe = he(
|
|
4142
|
-
te = b.x + ie + Math.max(0,
|
|
4141
|
+
const oe = he(Q.text, le(Q.style));
|
|
4142
|
+
te = b.x + ie + Math.max(0, Q.hangingPx - oe);
|
|
4143
4143
|
} else
|
|
4144
|
-
te = b.x + (R[0]?.frag.x ?? 0) -
|
|
4145
|
-
b.marker = { text:
|
|
4144
|
+
te = b.x + (R[0]?.frag.x ?? 0) - Q.hangingPx;
|
|
4145
|
+
b.marker = { text: Q.text, style: Q.style, x: te };
|
|
4146
4146
|
}
|
|
4147
4147
|
q.blocks.push(b);
|
|
4148
4148
|
}
|
|
4149
|
-
const
|
|
4150
|
-
z !== void 0 && (
|
|
4149
|
+
const V = { y: T - b.y, height: Z, ascent: J, fragments: R.map((Q) => Q.frag) };
|
|
4150
|
+
z !== void 0 && (V.emptyOffset = z), b.lines.push(V), T += Z, N++;
|
|
4151
4151
|
};
|
|
4152
4152
|
for (const R of g) {
|
|
4153
4153
|
const Z = Pt(R.runs, R.startOffset), J = R.runs.map(() => 0);
|
|
4154
|
-
let z,
|
|
4154
|
+
let z, V = !1, Q = null;
|
|
4155
4155
|
for (; ; ) {
|
|
4156
4156
|
const te = J.slice(), ie = Bs(T), oe = M ? f.style.indentFirstLinePx : 0, X = vt(
|
|
4157
4157
|
f,
|
|
@@ -4175,9 +4175,9 @@ function J0(e, t, n, s, i = Te, r = je) {
|
|
|
4175
4175
|
let ft = ie.x0 - ue() + oe;
|
|
4176
4176
|
k === "center" ? ft += xt / 2 : k === "right" && (ft += xt);
|
|
4177
4177
|
for (const Ne of X.frags) Ne.frag.x += ft;
|
|
4178
|
-
k === "justify" && (
|
|
4178
|
+
k === "justify" && (Q && rs(Q.frags, Q.slack), Q = { frags: X.frags, slack: xt }), j(X.frags, X.height, X.ascent), z = X.end, M = !1, V = !0;
|
|
4179
4179
|
}
|
|
4180
|
-
if (!
|
|
4180
|
+
if (!V) {
|
|
4181
4181
|
const te = ns(f);
|
|
4182
4182
|
T + te.height > re() && ae() && (G(), xe(), b = null), j([], te.height, te.ascent, R.startOffset), M = !1;
|
|
4183
4183
|
}
|
|
@@ -4204,9 +4204,9 @@ function J0(e, t, n, s, i = Te, r = je) {
|
|
|
4204
4204
|
}
|
|
4205
4205
|
let J = [], z = 0;
|
|
4206
4206
|
for (; ; ) {
|
|
4207
|
-
const
|
|
4208
|
-
if (
|
|
4209
|
-
const { H: te, measures: ie } = Ht(
|
|
4207
|
+
const Q = Es(f.block.rows.slice(b, b + R));
|
|
4208
|
+
if (Q.length === 0) break;
|
|
4209
|
+
const { H: te, measures: ie } = Ht(Q);
|
|
4210
4210
|
if (ie.length === 0) break;
|
|
4211
4211
|
let oe = j;
|
|
4212
4212
|
for (let X = b; X < b + R; X++) oe += f.rows[X].height;
|
|
@@ -4221,10 +4221,10 @@ function J0(e, t, n, s, i = Te, r = je) {
|
|
|
4221
4221
|
continue;
|
|
4222
4222
|
}
|
|
4223
4223
|
J.length > 0 && _t(J, z), G && (q.blocks.push(Ke(f.block, M, f.colWidths, ue() + f.xOffset, T, f.tableWidth, 0, B)), T += N);
|
|
4224
|
-
const
|
|
4225
|
-
q.blocks.push(Ke(f.block,
|
|
4224
|
+
const V = f.rows.slice(b, b + R);
|
|
4225
|
+
q.blocks.push(Ke(f.block, V, f.colWidths, ue() + f.xOffset, T, f.tableWidth, b, B)), T += V.reduce((Q, te) => Q + te.height, 0), b += R, b < f.rows.length && xe();
|
|
4226
4226
|
}
|
|
4227
|
-
},
|
|
4227
|
+
}, Ve = (f, g) => f?.kind === "para" && g?.kind === "para" && f.block.style.contextualSpacing === !0 && f.block.style.namedStyle === g.block.style.namedStyle;
|
|
4228
4228
|
for (let f = 0; f < P.length; f++) {
|
|
4229
4229
|
if (f > c[U].endBlock) {
|
|
4230
4230
|
for (; f > c[U].endBlock; ) w(c[++U].props);
|
|
@@ -4252,8 +4252,8 @@ function J0(e, t, n, s, i = Te, r = je) {
|
|
|
4252
4252
|
continue;
|
|
4253
4253
|
}
|
|
4254
4254
|
const { block: N, lines: b } = g;
|
|
4255
|
-
N.style.pageBreakBefore === !0 && (q.blocks.length > 0 || Oe > 0) ?
|
|
4256
|
-
const G =
|
|
4255
|
+
N.style.pageBreakBefore === !0 && (q.blocks.length > 0 || Oe > 0) ? Qe() : N.style.columnBreakBefore === !0 && ae() && xe();
|
|
4256
|
+
const G = Ve(g, P[f - 1]), j = Ve(g, P[f + 1]);
|
|
4257
4257
|
if (G || (T += N.style.spaceBeforePx), T >= re() && ae() && xe(), bs(T)) {
|
|
4258
4258
|
T += Sn(N.style), ws(N), T += An(N.style), j || (T += N.style.spaceAfterPx);
|
|
4259
4259
|
continue;
|
|
@@ -4268,15 +4268,15 @@ function J0(e, t, n, s, i = Te, r = je) {
|
|
|
4268
4268
|
R + be + X > re() && (Z = !1);
|
|
4269
4269
|
break;
|
|
4270
4270
|
}
|
|
4271
|
-
|
|
4272
|
-
const
|
|
4273
|
-
if (
|
|
4271
|
+
Ve(z, P[J - 1]) || (R += z.block.style.spaceBeforePx);
|
|
4272
|
+
const V = Ve(z, P[J + 1]) ? 0 : z.block.style.spaceAfterPx, Q = z.block.style.keepWithNext === !0 && P[J + 1] !== void 0;
|
|
4273
|
+
if (Q || z.block.style.keepLinesTogether === !0) {
|
|
4274
4274
|
const X = me(z.lines);
|
|
4275
4275
|
if (R + X > re()) {
|
|
4276
4276
|
Z = !1;
|
|
4277
4277
|
break;
|
|
4278
4278
|
}
|
|
4279
|
-
if (R += X +
|
|
4279
|
+
if (R += X + V, !Q) break;
|
|
4280
4280
|
continue;
|
|
4281
4281
|
}
|
|
4282
4282
|
if (P[J + 1] !== void 0 && z.block.runs.every((X) => X.text.trim().length === 0)) {
|
|
@@ -4285,7 +4285,7 @@ function J0(e, t, n, s, i = Te, r = je) {
|
|
|
4285
4285
|
Z = !1;
|
|
4286
4286
|
break;
|
|
4287
4287
|
}
|
|
4288
|
-
R += X +
|
|
4288
|
+
R += X + V;
|
|
4289
4289
|
continue;
|
|
4290
4290
|
}
|
|
4291
4291
|
let te = 0, ie = R;
|
|
@@ -4313,13 +4313,13 @@ function J0(e, t, n, s, i = Te, r = je) {
|
|
|
4313
4313
|
const Z = M.marginPx.left - (b.distancePx ?? z0), J = [];
|
|
4314
4314
|
for (const z of M.blocks)
|
|
4315
4315
|
if (!(z.lines.length === 0 || z.image || z.table || z.equation))
|
|
4316
|
-
for (const
|
|
4316
|
+
for (const V of z.lines) {
|
|
4317
4317
|
if (g % j === 0) {
|
|
4318
|
-
const
|
|
4318
|
+
const Q = String(g);
|
|
4319
4319
|
J.push({
|
|
4320
|
-
x: Z - he(
|
|
4321
|
-
baseline: z.y +
|
|
4322
|
-
text:
|
|
4320
|
+
x: Z - he(Q, f),
|
|
4321
|
+
baseline: z.y + V.y + V.ascent,
|
|
4322
|
+
text: Q,
|
|
4323
4323
|
style: Mn
|
|
4324
4324
|
});
|
|
4325
4325
|
}
|
|
@@ -4386,20 +4386,20 @@ function J0(e, t, n, s, i = Te, r = je) {
|
|
|
4386
4386
|
for (const J of at[j]) {
|
|
4387
4387
|
const z = t(J, k);
|
|
4388
4388
|
G + J.style.spaceBeforePx + me(z) > N.contentBottomPx && N.blocks.length > 0 && (b(), G = N.contentTopPx), G += J.style.spaceBeforePx;
|
|
4389
|
-
const
|
|
4389
|
+
const V = {
|
|
4390
4390
|
blockId: J.id,
|
|
4391
4391
|
x: M + ge,
|
|
4392
4392
|
y: G,
|
|
4393
4393
|
firstLineIndex: 0,
|
|
4394
4394
|
lines: z
|
|
4395
4395
|
};
|
|
4396
|
-
Z && J.runs[0] && (
|
|
4397
|
-
const
|
|
4396
|
+
Z && J.runs[0] && (V.marker = { text: `${R}.`, style: J.runs[0].style, x: M }, Z = !1);
|
|
4397
|
+
const Q = we(
|
|
4398
4398
|
J.style,
|
|
4399
4399
|
p - ge - J.style.indentLeftPx - (J.style.indentRightPx ?? 0),
|
|
4400
4400
|
me(z)
|
|
4401
4401
|
);
|
|
4402
|
-
|
|
4402
|
+
Q && (V.paraDecor = Q), N.blocks.push(V), G += me(z) + J.style.spaceAfterPx;
|
|
4403
4403
|
}
|
|
4404
4404
|
}
|
|
4405
4405
|
}
|
|
@@ -4489,12 +4489,12 @@ function J0(e, t, n, s, i = Te, r = je) {
|
|
|
4489
4489
|
const F = I[g.index], k = F.pageWidthPx - F.marginPx.left - F.marginPx.right, M = F.marginPx.left, N = g.index === 0 || I[g.index - 1] !== F, b = Xe[g.index], G = b % 2 === 0, j = qt(F, "header", N, G);
|
|
4490
4490
|
if (j) {
|
|
4491
4491
|
const Z = s === "header", J = r(j.blocks, k, M, b, K.length, f, Z), z = bn(F, J.height);
|
|
4492
|
-
g.header = J.placed.map((
|
|
4492
|
+
g.header = J.placed.map((V) => Et(V, z)), g.headerSource = j.source;
|
|
4493
4493
|
}
|
|
4494
4494
|
const R = qt(F, "footer", N, G);
|
|
4495
4495
|
if (R) {
|
|
4496
4496
|
const Z = s === "footer", J = r(R.blocks, k, M, b, K.length, f, Z), z = Cn(F, J.height);
|
|
4497
|
-
g.footer = J.placed.map((
|
|
4497
|
+
g.footer = J.placed.map((V) => Et(V, z)), g.footerSource = R.source;
|
|
4498
4498
|
}
|
|
4499
4499
|
}
|
|
4500
4500
|
}
|
|
@@ -4522,7 +4522,7 @@ function Y0(e, t) {
|
|
|
4522
4522
|
function us(e, t, n) {
|
|
4523
4523
|
return e.replace(/\{page(?::(roman|Roman|alpha|Alpha))?\}/g, (s, i) => Y0(t, i)).replace(/\{pages\}/g, String(n)).replace(/\{date\}/g, () => (/* @__PURE__ */ new Date()).toLocaleDateString()).replace(/\{time\}/g, () => (/* @__PURE__ */ new Date()).toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" }));
|
|
4524
4524
|
}
|
|
4525
|
-
function
|
|
4525
|
+
function Q0(e) {
|
|
4526
4526
|
const t = [], n = (s) => {
|
|
4527
4527
|
for (const i of s)
|
|
4528
4528
|
if (i.kind === "paragraph") for (const r of i.runs) t.push(r.text);
|
|
@@ -4530,7 +4530,7 @@ function V0(e) {
|
|
|
4530
4530
|
};
|
|
4531
4531
|
return n(e), t;
|
|
4532
4532
|
}
|
|
4533
|
-
function
|
|
4533
|
+
function V0(e, t, n) {
|
|
4534
4534
|
const s = (i) => i.runs.some((r) => r.text.includes("{")) ? {
|
|
4535
4535
|
...i,
|
|
4536
4536
|
id: `${i.id}@p${t}`,
|
|
@@ -4551,7 +4551,7 @@ function je(e, t, n, s, i, r, o) {
|
|
|
4551
4551
|
const x = (c, a) => ls(c, a, r), l = [];
|
|
4552
4552
|
let d = 0;
|
|
4553
4553
|
for (const c of e) {
|
|
4554
|
-
const a = o ? c :
|
|
4554
|
+
const a = o ? c : V0(c, s, i);
|
|
4555
4555
|
if (a.kind === "paragraph") {
|
|
4556
4556
|
d += a.style.spaceBeforePx;
|
|
4557
4557
|
const h = x(a, t), u = { blockId: a.id, x: n + a.style.indentLeftPx, y: d, firstLineIndex: 0, lines: h }, E = we(a.style, t - a.style.indentLeftPx - (a.style.indentRightPx ?? 0), Ee(h));
|
|
@@ -138,13 +138,13 @@ function y(i) {
|
|
|
138
138
|
return e("w:style", { "w:type": "table", "w:styleId": i.id }, r);
|
|
139
139
|
}
|
|
140
140
|
export {
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
a,
|
|
142
|
+
u as b,
|
|
143
143
|
R as c,
|
|
144
144
|
C as d,
|
|
145
145
|
k as e,
|
|
146
146
|
d as h,
|
|
147
|
-
|
|
147
|
+
M as p,
|
|
148
148
|
T as r,
|
|
149
149
|
y as t
|
|
150
150
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { p as u } from "./toc-BIj8uQ-W.js";
|
|
2
2
|
function p(e) {
|
|
3
3
|
return e.type ?? "paragraph";
|
|
4
4
|
}
|
|
@@ -134,13 +134,13 @@ function v() {
|
|
|
134
134
|
}
|
|
135
135
|
export {
|
|
136
136
|
p as a,
|
|
137
|
-
|
|
137
|
+
O as b,
|
|
138
138
|
x as c,
|
|
139
139
|
v as d,
|
|
140
140
|
y as e,
|
|
141
141
|
b as m,
|
|
142
142
|
P as p,
|
|
143
|
-
|
|
143
|
+
g as r,
|
|
144
144
|
c as s,
|
|
145
145
|
S as w
|
|
146
146
|
};
|
|
@@ -1168,58 +1168,58 @@ function ot(t, e = {}) {
|
|
|
1168
1168
|
return i.splice(n, 1, ...s), { doc: { ...t, blocks: i }, generated: r, headings: r };
|
|
1169
1169
|
}
|
|
1170
1170
|
export {
|
|
1171
|
-
|
|
1172
|
-
|
|
1171
|
+
et as $,
|
|
1172
|
+
Qe as A,
|
|
1173
1173
|
S as B,
|
|
1174
|
-
|
|
1174
|
+
M as C,
|
|
1175
1175
|
re as D,
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1176
|
+
te as E,
|
|
1177
|
+
Pe as F,
|
|
1178
|
+
Ke as G,
|
|
1179
|
+
Ge as H,
|
|
1180
|
+
We as I,
|
|
1181
|
+
He as J,
|
|
1182
|
+
Y as K,
|
|
1183
|
+
Xe as L,
|
|
1184
|
+
Ue as M,
|
|
1185
|
+
y as N,
|
|
1186
|
+
oe as O,
|
|
1187
|
+
qe as P,
|
|
1188
|
+
ze as Q,
|
|
1189
|
+
Ye as R,
|
|
1190
|
+
Ne as S,
|
|
1191
|
+
le as T,
|
|
1192
|
+
Le as U,
|
|
1193
|
+
Ae as V,
|
|
1194
|
+
je as W,
|
|
1195
|
+
_e as X,
|
|
1196
|
+
q as Y,
|
|
1197
|
+
se as Z,
|
|
1198
|
+
H as _,
|
|
1199
|
+
Be as a,
|
|
1200
|
+
Fe as b,
|
|
1201
|
+
de as c,
|
|
1202
1202
|
Re as d,
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1203
|
+
$e as e,
|
|
1204
|
+
ie as f,
|
|
1205
|
+
Se as g,
|
|
1206
|
+
Ve as h,
|
|
1207
1207
|
st as i,
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1208
|
+
nt as j,
|
|
1209
|
+
ot as k,
|
|
1210
|
+
J as l,
|
|
1211
|
+
rt as m,
|
|
1212
|
+
x as n,
|
|
1213
|
+
W as o,
|
|
1214
|
+
ce as p,
|
|
1215
|
+
ne as q,
|
|
1216
|
+
Ze as r,
|
|
1217
1217
|
ue as s,
|
|
1218
1218
|
F as t,
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1219
|
+
De as u,
|
|
1220
|
+
Je as v,
|
|
1221
|
+
Me as w,
|
|
1222
|
+
D as x,
|
|
1223
|
+
tt as y,
|
|
1224
|
+
k as z
|
|
1225
1225
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { p as j, c as _, e as F, t as k, D as L } from "./toc-BIj8uQ-W.js";
|
|
2
2
|
const s = (e) => Math.round(e * 100) / 100;
|
|
3
3
|
function A(e) {
|
|
4
4
|
const o = { font: e.fontFamily, sizePx: e.fontSizePx };
|
|
@@ -332,7 +332,7 @@ function H(e, o = {}, r = {}) {
|
|
|
332
332
|
if (i && e.search(i).total === 0)
|
|
333
333
|
return e.searchClear(), f(`text not found: ${i}`);
|
|
334
334
|
if (!e.getSelection()) return f("no selection (pass 'find' or select_range first)");
|
|
335
|
-
const { insertText: d } = await import("./editorApp-
|
|
335
|
+
const { insertText: d } = await import("./editorApp-zIpjgEaZ.js").then((m) => m.c);
|
|
336
336
|
return e.dispatch(d(t)), i && e.searchClear(), g("inserted");
|
|
337
337
|
}
|
|
338
338
|
}), a({
|
package/docs/http-event-sink.md
CHANGED
|
@@ -13,6 +13,13 @@ const sink = createHttpEventSink({
|
|
|
13
13
|
headers: async () => ({
|
|
14
14
|
Authorization: `Bearer ${await session.accessToken()}`,
|
|
15
15
|
}),
|
|
16
|
+
// Transmit ONLY clean semantic committed events + review/export lifecycle:
|
|
17
|
+
eventTypes: [
|
|
18
|
+
"document.change.committed",
|
|
19
|
+
"document.export.completed",
|
|
20
|
+
"review.comment.added",
|
|
21
|
+
"review.comment.deleted",
|
|
22
|
+
],
|
|
16
23
|
batchSize: 25,
|
|
17
24
|
flushIntervalMs: 1000,
|
|
18
25
|
maxAttempts: 4,
|