kindy-editor 3.1.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -2
- package/dist-lib/builder.js +4 -4
- package/dist-lib/{editorApp-F48A7I6z.js → editorApp-CtrnSSsP.js} +9620 -8998
- package/dist-lib/events.js +1 -1
- package/dist-lib/export.js +6 -6
- package/dist-lib/generate-toc.js +3 -3
- package/dist-lib/import.js +2 -2
- package/dist-lib/{kindy-editor-DnWvHijW.js → kindy-editor-CoeqFYYG.js} +100 -85
- package/dist-lib/kindy-editor.js +1 -1
- package/dist-lib/measure.js +3 -3
- package/dist-lib/{measureHost-Ca_gM01T.js → measureHost-mtLj644m.js} +2 -2
- package/dist-lib/{metrics-BFTHu_jF.js → metrics-DHgtBP-R.js} +1 -1
- package/dist-lib/{paintStyle-GQFOpJKx.js → paintStyle-Cjk9egel.js} +10 -9
- package/dist-lib/{parse-DmTwoFz6.js → parse-D3V5Abci.js} +11 -11
- package/dist-lib/{pipeline-BTemNJdx.js → pipeline-JfHxzjns.js} +1 -1
- package/dist-lib/recalc-docx.js +1 -1
- package/dist-lib/{recalcToc-c9kIMGbk.js → recalcToc-MRszlj8g.js} +80 -80
- package/dist-lib/{stylesheet-BcU1Q_JI.js → stylesheet-E5bu1xch.js} +1 -1
- package/dist-lib/{toc-mgkp-28Y.js → toc-DSwkNKls.js} +15 -15
- package/dist-lib/{webmcp-BLC_QALL.js → webmcp-Dr3n_xAO.js} +2 -2
- package/docs/.vitepress/cache/deps/_metadata.json +7 -7
- package/docs/.vitepress/config.ts +4 -0
- package/docs/.vitepress/dist/404.html +2 -2
- package/docs/.vitepress/dist/assets/{app.DYJtoZwO.js → app.rXBVdtfQ.js} +1 -1
- package/docs/.vitepress/dist/assets/chunks/framework.D9_ZvfG7.js +19 -0
- package/docs/.vitepress/dist/assets/chunks/{theme.BTGY7hKU.js → theme.CFP3sGN8.js} +1 -1
- package/docs/.vitepress/dist/assets/fonts.md.W87hfQua.js +75 -0
- package/docs/.vitepress/dist/assets/fonts.md.W87hfQua.lean.js +1 -0
- package/docs/.vitepress/dist/assets/{http-event-sink.md.BViKRVhd.js → http-event-sink.md.D7mTerle.js} +1 -1
- package/docs/.vitepress/dist/assets/{http-event-sink.md.BViKRVhd.lean.js → http-event-sink.md.D7mTerle.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{index.md.Bc6V9_E3.js → index.md.DN1JXJhG.js} +1 -1
- package/docs/.vitepress/dist/assets/{index.md.Bc6V9_E3.lean.js → index.md.DN1JXJhG.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{public-events.md.CMTD1Y84.js → public-events.md.Rj44CdBr.js} +1 -1
- package/docs/.vitepress/dist/assets/{public-events.md.CMTD1Y84.lean.js → public-events.md.Rj44CdBr.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/{review-comments.md.19jCC2Pi.js → review-comments.md.466PcTcC.js} +1 -1
- package/docs/.vitepress/dist/assets/{review-comments.md.19jCC2Pi.lean.js → review-comments.md.466PcTcC.lean.js} +1 -1
- package/docs/.vitepress/dist/assets/table-editing.md.Bso_sgTE.js +28 -0
- package/docs/.vitepress/dist/assets/table-editing.md.Bso_sgTE.lean.js +1 -0
- package/docs/.vitepress/dist/fonts.html +99 -0
- package/docs/.vitepress/dist/hashmap.json +1 -1
- package/docs/.vitepress/dist/http-event-sink.html +6 -6
- package/docs/.vitepress/dist/index.html +6 -6
- package/docs/.vitepress/dist/public-events.html +7 -7
- package/docs/.vitepress/dist/review-comments.html +6 -6
- package/docs/.vitepress/dist/table-editing.html +52 -0
- package/docs/fonts.md +139 -0
- package/docs/table-editing.md +102 -0
- package/package.json +4 -1
- package/types/kindy-editor.d.ts +65 -1
- package/docs/.vitepress/dist/assets/chunks/framework.DCJ5T8RY.js +0 -19
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Y as Gn, H as Us, t as zs, s as Ks } from "./toc-DSwkNKls.js";
|
|
2
2
|
import { e as qs, f as tt } from "./lists-DpmgbDyt.js";
|
|
3
|
-
import { m as ge, f as qe, c as fe } from "./metrics-
|
|
4
|
-
import { B as $s, V as Hn, M as lt,
|
|
5
|
-
const
|
|
3
|
+
import { m as ge, f as qe, c as fe } from "./metrics-DHgtBP-R.js";
|
|
4
|
+
import { B as $s, V as Hn, M as lt, a2 as Ys, a3 as wt, w as Js, o as Vs } from "./paintStyle-Cjk9egel.js";
|
|
5
|
+
const Qs = [
|
|
6
6
|
"BN",
|
|
7
7
|
"BN",
|
|
8
8
|
"BN",
|
|
@@ -975,9 +975,9 @@ const Xs = [
|
|
|
975
975
|
[1048574, 1048575, "BN"],
|
|
976
976
|
[1114110, 1114111, "BN"]
|
|
977
977
|
];
|
|
978
|
-
function
|
|
978
|
+
function Xs(e) {
|
|
979
979
|
if (e <= 255)
|
|
980
|
-
return
|
|
980
|
+
return Qs[e];
|
|
981
981
|
let t = 0, n = en.length - 1;
|
|
982
982
|
for (; t <= n; ) {
|
|
983
983
|
const s = t + n >> 1, r = en[s];
|
|
@@ -1006,7 +1006,7 @@ function Zs(e, t) {
|
|
|
1006
1006
|
const p = e.charCodeAt(l + 1);
|
|
1007
1007
|
p >= 56320 && p <= 57343 && (h = (a - 55296 << 10) + (p - 56320) + 65536, f = 2);
|
|
1008
1008
|
}
|
|
1009
|
-
const N =
|
|
1009
|
+
const N = Xs(h);
|
|
1010
1010
|
(N === "R" || N === "AL" || N === "AN") && (r = !0);
|
|
1011
1011
|
for (let p = 0; p < f; p++)
|
|
1012
1012
|
s[l + p] = N;
|
|
@@ -1805,7 +1805,7 @@ function Vi(e) {
|
|
|
1805
1805
|
starts: r
|
|
1806
1806
|
};
|
|
1807
1807
|
}
|
|
1808
|
-
function
|
|
1808
|
+
function Qi(e, t, n) {
|
|
1809
1809
|
const s = ri();
|
|
1810
1810
|
let r = 0;
|
|
1811
1811
|
const i = [], o = [], x = [], c = [], d = [], l = [], a = [], h = [], f = [], N = [], p = [], S = [];
|
|
@@ -1864,7 +1864,7 @@ function Xi(e, t, n) {
|
|
|
1864
1864
|
}
|
|
1865
1865
|
return O;
|
|
1866
1866
|
}
|
|
1867
|
-
function
|
|
1867
|
+
function Xi(e, t) {
|
|
1868
1868
|
if (e.len === 0)
|
|
1869
1869
|
return [];
|
|
1870
1870
|
if (!t.preserveHardBreaks)
|
|
@@ -1940,10 +1940,10 @@ function er(e, t, n = "normal", s = "normal") {
|
|
|
1940
1940
|
kinds: [],
|
|
1941
1941
|
starts: []
|
|
1942
1942
|
};
|
|
1943
|
-
const o =
|
|
1943
|
+
const o = Qi(i, t, r), x = s === "keep-all" ? Zi(i, o, t.breakKeepAllAfterPunctuation) : o;
|
|
1944
1944
|
return {
|
|
1945
1945
|
normalized: i,
|
|
1946
|
-
chunks:
|
|
1946
|
+
chunks: Xi(x, r),
|
|
1947
1947
|
...x
|
|
1948
1948
|
};
|
|
1949
1949
|
}
|
|
@@ -2153,7 +2153,7 @@ function pr(e, t, n, s, r) {
|
|
|
2153
2153
|
}
|
|
2154
2154
|
return 0;
|
|
2155
2155
|
}
|
|
2156
|
-
function
|
|
2156
|
+
function Qn(e, t, n, s, r, i) {
|
|
2157
2157
|
return t + pr(e, n, s, r, i);
|
|
2158
2158
|
}
|
|
2159
2159
|
function gr(e, t) {
|
|
@@ -2268,7 +2268,7 @@ function Nr(e, t, n) {
|
|
|
2268
2268
|
return E === "soft-hyphen" && I === m && R === 0 ? O : f;
|
|
2269
2269
|
}
|
|
2270
2270
|
function b(B = m, W = R, M) {
|
|
2271
|
-
h++, n !== void 0 && n(
|
|
2271
|
+
h++, n !== void 0 && n(Qn(e, M ?? j(), p, S, B, W), p, S, B, W), f = 0, N = !1, D();
|
|
2272
2272
|
}
|
|
2273
2273
|
function z(B, W) {
|
|
2274
2274
|
N = !0, p = B, S = 0, m = B + 1, R = 0, f = W;
|
|
@@ -2378,7 +2378,7 @@ function Ar(e, t, n, s) {
|
|
|
2378
2378
|
return E === "soft-hyphen" && I === m && R === 0 ? O : p;
|
|
2379
2379
|
}
|
|
2380
2380
|
function j(k = m, B = R, W = D()) {
|
|
2381
|
-
return S ? (t.segmentIndex = k, t.graphemeIndex = B,
|
|
2381
|
+
return S ? (t.segmentIndex = k, t.graphemeIndex = B, Qn(e, W, f, N, k, B)) : null;
|
|
2382
2382
|
}
|
|
2383
2383
|
function b(k, B) {
|
|
2384
2384
|
S = !0, m = k + 1, R = 0, p = B;
|
|
@@ -2975,7 +2975,7 @@ function Te(e, t = "left") {
|
|
|
2975
2975
|
n.push(...c.glyphs), s.push(...c.rules), r = Math.max(r, c.ascent), i = Math.max(i, c.descent), o = Math.max(o, c.width), x = c.italicCorrection;
|
|
2976
2976
|
return { width: o, ascent: r, descent: i, glyphs: n, rules: s, italicCorrection: x };
|
|
2977
2977
|
}
|
|
2978
|
-
function
|
|
2978
|
+
function Xn(e, t, n) {
|
|
2979
2979
|
const s = -n - t, r = -n;
|
|
2980
2980
|
return {
|
|
2981
2981
|
width: e,
|
|
@@ -3007,7 +3007,7 @@ const qr = (e) => ({
|
|
|
3007
3007
|
"sans-serif-italic": 120328,
|
|
3008
3008
|
"sans-serif-bold-italic": 120380,
|
|
3009
3009
|
monospace: 120432
|
|
3010
|
-
},
|
|
3010
|
+
}, Qr = {
|
|
3011
3011
|
italic: { h: 8462 },
|
|
3012
3012
|
script: {
|
|
3013
3013
|
B: 8492,
|
|
@@ -3024,7 +3024,7 @@ const qr = (e) => ({
|
|
|
3024
3024
|
},
|
|
3025
3025
|
fraktur: { C: 8493, H: 8460, I: 8465, R: 8476, Z: 8488 },
|
|
3026
3026
|
"double-struck": { C: 8450, H: 8461, N: 8469, P: 8473, Q: 8474, R: 8477, Z: 8484 }
|
|
3027
|
-
}, At = 913, Sn = 945,
|
|
3027
|
+
}, At = 913, Sn = 945, Xr = 969, Zr = {
|
|
3028
3028
|
italic: { upper: 120546, lower: 120572 },
|
|
3029
3029
|
"bold-italic": { upper: 120604, lower: 120630 },
|
|
3030
3030
|
bold: { upper: 120488, lower: 120514 }
|
|
@@ -3033,7 +3033,7 @@ function eo(e, t) {
|
|
|
3033
3033
|
const n = e.codePointAt(0) ?? 0, s = t ?? "italic";
|
|
3034
3034
|
if (s === "normal") return n;
|
|
3035
3035
|
if (mn(n) || Jr(n)) {
|
|
3036
|
-
const i =
|
|
3036
|
+
const i = Qr[s]?.[e];
|
|
3037
3037
|
if (i) return i;
|
|
3038
3038
|
const o = Vr[s];
|
|
3039
3039
|
return o === void 0 ? n : mn(n) ? o + (n - Zn) : o + 26 + (n - es);
|
|
@@ -3041,7 +3041,7 @@ function eo(e, t) {
|
|
|
3041
3041
|
const r = Zr[s];
|
|
3042
3042
|
if (r) {
|
|
3043
3043
|
if (n >= At && n <= At + 24) return r.upper + (n - At);
|
|
3044
|
-
if (n >= Sn && n <=
|
|
3044
|
+
if (n >= Sn && n <= Xr) return r.lower + (n - Sn);
|
|
3045
3045
|
}
|
|
3046
3046
|
return n;
|
|
3047
3047
|
}
|
|
@@ -3196,7 +3196,7 @@ function ho(e, t, n, s, r) {
|
|
|
3196
3196
|
i.fracDenShiftDown,
|
|
3197
3197
|
-(d - c / 2) + i.fracDenGapMin + x.ascent
|
|
3198
3198
|
), f = Be(We(o, l), 0, a), N = Be(We(x, l), 0, h), p = [f, N];
|
|
3199
|
-
return c > 0 && p.push(
|
|
3199
|
+
return c > 0 && p.push(Xn(l, c, d - c / 2)), { ...Te(p, "left"), width: l, italicCorrection: 0 };
|
|
3200
3200
|
}
|
|
3201
3201
|
function We(e, t) {
|
|
3202
3202
|
return Le(e, (t - e.width) / 2);
|
|
@@ -3209,7 +3209,7 @@ function po(e, t, n) {
|
|
|
3209
3209
|
italicCorrection: 0,
|
|
3210
3210
|
glyphs: [{ x: 0, y: 0, text: "√", sizePx: Math.max(n.style.sizePx, c * 0.9), italic: !1, bold: !1 }],
|
|
3211
3211
|
rules: []
|
|
3212
|
-
}, a = Le(r, d.width), h = Le(
|
|
3212
|
+
}, a = Le(r, d.width), h = Le(Xn(r.width, i, r.ascent + o), d.width), N = { ...Te([l, a, h], "left"), width: d.width + r.width };
|
|
3213
3213
|
if (!t) return N;
|
|
3214
3214
|
const p = ie(t, $e($e(n))), S = s.radicalDegreeRaise * c, m = Be(p, 0, -S), R = Le(N, p.width);
|
|
3215
3215
|
return { ...Te([m, R], "left"), width: p.width + N.width };
|
|
@@ -3771,12 +3771,12 @@ function Vo(e, t, n) {
|
|
|
3771
3771
|
let r = (Math.floor(e / s) + 1) * s;
|
|
3772
3772
|
return r <= e && (r = e + s), { posPx: Math.min(r, Math.max(e + 1, n)), align: "left", leader: "none" };
|
|
3773
3773
|
}
|
|
3774
|
-
function
|
|
3774
|
+
function Qo(e) {
|
|
3775
3775
|
const t = e.map((r) => r.text).join(""), n = fe(e[0]?.style ?? ps);
|
|
3776
3776
|
let s = t.indexOf(".");
|
|
3777
3777
|
return s < 0 && (s = t.indexOf(",")), ge(s < 0 ? t : t.slice(0, s + 1), n);
|
|
3778
3778
|
}
|
|
3779
|
-
const ps = { fontFamily: "Georgia, serif", fontSizePx: 16 }, Ln = { fontFamily: "Georgia, serif", fontSizePx: 12, color: "#9aa0a6" },
|
|
3779
|
+
const ps = { fontFamily: "Georgia, serif", fontSizePx: 16 }, Ln = { fontFamily: "Georgia, serif", fontSizePx: 12, color: "#9aa0a6" }, Xo = 18;
|
|
3780
3780
|
function Zo(e, t, n, s, r) {
|
|
3781
3781
|
const i = [];
|
|
3782
3782
|
let o = [], x = n, c = n;
|
|
@@ -3819,7 +3819,7 @@ function Zo(e, t, n, s, r) {
|
|
|
3819
3819
|
if (O > 0) {
|
|
3820
3820
|
const T = Vo(p, d, s), L = T.align ?? "left", Y = ge(w.runs.map((W) => W.text).join(""), fe(w.runs[0]?.style ?? l ?? ps)), k = p + Y <= s;
|
|
3821
3821
|
let B = T.posPx;
|
|
3822
|
-
k && L === "right" ? B = T.posPx - Y : k && L === "center" ? B = T.posPx - Y / 2 : k && L === "decimal" && (B = T.posPx -
|
|
3822
|
+
k && L === "right" ? B = T.posPx - Y : k && L === "center" ? B = T.posPx - Y / 2 : k && L === "decimal" && (B = T.posPx - Qo(w.runs)), B < p && (B = p), (T.leader ?? "none") !== "none" && B > p + 1 && l && f.push({ x1: p, x2: B, kind: T.leader ?? "none", color: l.color, fontSizePx: l.fontSizePx }), N.push({ x1: p, x2: Math.max(B, p) }), p = B, R = !0;
|
|
3823
3823
|
}
|
|
3824
3824
|
if (w.runs.length === 0) return;
|
|
3825
3825
|
const E = cs(w.runs), D = { prepared: E.prepared, runs: E.runs, startOffset: w.start }, j = Ht(E.runs, w.start), b = E.runs.map(() => 0);
|
|
@@ -4026,21 +4026,21 @@ function n0(e, t, n, s, r = He, i = Ke) {
|
|
|
4026
4026
|
const C = [u.header, u.headerFirst, u.headerEven].filter((_) => !!_), A = [u.footer, u.footerFirst, u.footerEven].filter((_) => !!_);
|
|
4027
4027
|
if (C.length > 0 || A.length > 0) {
|
|
4028
4028
|
c ??= new Ct();
|
|
4029
|
-
const _ = u.pageWidthPx - u.marginPx.left - u.marginPx.right, $ = u.marginPx.left, H = (
|
|
4030
|
-
const
|
|
4031
|
-
for (const te of
|
|
4032
|
-
if (!!te.table || !!te.image || !!te.equation || te.lines.some((le) => le.fragments.some((Z) => Z.text.trim().length > 0 || !!Z.equation))) return
|
|
4029
|
+
const _ = u.pageWidthPx - u.marginPx.left - u.marginPx.right, $ = u.marginPx.left, H = (X) => Ke(X, _, $, 999, 999, c, !1).height, ee = (X) => {
|
|
4030
|
+
const Q = Ke(X, _, $, 999, 999, c, !1);
|
|
4031
|
+
for (const te of Q.placed)
|
|
4032
|
+
if (!!te.table || !!te.image || !!te.equation || te.lines.some((le) => le.fragments.some((Z) => Z.text.trim().length > 0 || !!Z.equation))) return Q.height - te.y;
|
|
4033
4033
|
return 0;
|
|
4034
|
-
}, V = C.reduce((
|
|
4034
|
+
}, V = C.reduce((X, Q) => Math.max(X, H(Q)), 0);
|
|
4035
4035
|
if (V > 0) {
|
|
4036
|
-
const
|
|
4037
|
-
F = Math.max(F,
|
|
4036
|
+
const X = In(u, V);
|
|
4037
|
+
F = Math.max(F, X + V + 6);
|
|
4038
4038
|
}
|
|
4039
|
-
const J = A.reduce((
|
|
4039
|
+
const J = A.reduce((X, Q) => Math.max(X, H(Q)), 0);
|
|
4040
4040
|
if (J > 0)
|
|
4041
4041
|
if (u.footerDistancePx !== void 0) {
|
|
4042
|
-
const
|
|
4043
|
-
y = Math.min(y,
|
|
4042
|
+
const X = u.pageHeightPx - u.footerDistancePx, Q = A.reduce((te, oe) => Math.max(te, ee(oe)), 0);
|
|
4043
|
+
y = Math.min(y, X - Q);
|
|
4044
4044
|
} else
|
|
4045
4045
|
y = Math.min(y, vn(u, J) - 6);
|
|
4046
4046
|
y = Math.max(y, F + 24);
|
|
@@ -4151,17 +4151,17 @@ function n0(e, t, n, s, r = He, i = Ke) {
|
|
|
4151
4151
|
}
|
|
4152
4152
|
return y;
|
|
4153
4153
|
};
|
|
4154
|
-
let Oe = 0,
|
|
4155
|
-
const pe = () => R[Oe]?.x ?? h, ue = () => U.blocks.length >
|
|
4156
|
-
Oe = 0,
|
|
4154
|
+
let Oe = 0, Qe = 0;
|
|
4155
|
+
const pe = () => R[Oe]?.x ?? h, ue = () => U.blocks.length > Qe, Xe = () => {
|
|
4156
|
+
Oe = 0, Qe = 0, U = K(), q.push(U), je.push([]), Ve.push(0), me = 0, G = f, Ee = [];
|
|
4157
4157
|
}, he = () => {
|
|
4158
|
-
Oe + 1 < S ? (Oe++,
|
|
4158
|
+
Oe + 1 < S ? (Oe++, Qe = U.blocks.length, G = f, Ee = []) : Xe();
|
|
4159
4159
|
}, ws = () => {
|
|
4160
|
-
U.widthPx = a.pageWidthPx, U.heightPx = a.pageHeightPx, U.marginPx = a.marginPx, U.contentTopPx = f, U.contentBottomPx = N, a.pageColorHex !== void 0 ? U.pageColorHex = a.pageColorHex : delete U.pageColorHex, a.pageBorders !== void 0 ? U.pageBorders = a.pageBorders : delete U.pageBorders, I.length ? U.columnSeparatorsX = I.slice() : delete U.columnSeparatorsX, M[U.index] = a, Oe = 0,
|
|
4160
|
+
U.widthPx = a.pageWidthPx, U.heightPx = a.pageHeightPx, U.marginPx = a.marginPx, U.contentTopPx = f, U.contentBottomPx = N, a.pageColorHex !== void 0 ? U.pageColorHex = a.pageColorHex : delete U.pageColorHex, a.pageBorders !== void 0 ? U.pageBorders = a.pageBorders : delete U.pageBorders, I.length ? U.columnSeparatorsX = I.slice() : delete U.columnSeparatorsX, M[U.index] = a, Oe = 0, Qe = 0, G = f, Ee = [];
|
|
4161
4161
|
}, Ds = (u) => {
|
|
4162
|
-
if (U.blocks.length === 0 ? ws() :
|
|
4162
|
+
if (U.blocks.length === 0 ? ws() : Xe(), u === "evenPage" || u === "oddPage") {
|
|
4163
4163
|
const g = u === "evenPage";
|
|
4164
|
-
U.number % 2 === 0 !== g &&
|
|
4164
|
+
U.number % 2 === 0 !== g && Xe();
|
|
4165
4165
|
}
|
|
4166
4166
|
}, Ls = (u, g, F, y) => {
|
|
4167
4167
|
if (u.style.direction !== "rtl") return g - y.hangingPx;
|
|
@@ -4342,26 +4342,26 @@ function n0(e, t, n, s, r = He, i = Ke) {
|
|
|
4342
4342
|
}, $ = (H, ee, V, J) => {
|
|
4343
4343
|
if (P === null) {
|
|
4344
4344
|
P = { blockId: u.id, x: pe() + j(u), y: G, firstLineIndex: A, lines: [] };
|
|
4345
|
-
const
|
|
4346
|
-
if (
|
|
4345
|
+
const Q = A === 0 ? T.get(u.id) : void 0;
|
|
4346
|
+
if (Q) {
|
|
4347
4347
|
let te;
|
|
4348
4348
|
if (u.style.direction === "rtl") {
|
|
4349
4349
|
let oe = 0;
|
|
4350
4350
|
for (const Z of H) oe = Math.max(oe, Z.frag.x + Z.frag.width);
|
|
4351
|
-
const le = ge(
|
|
4352
|
-
te = P.x + oe + Math.max(0,
|
|
4351
|
+
const le = ge(Q.text, fe(Q.style));
|
|
4352
|
+
te = P.x + oe + Math.max(0, Q.hangingPx - le);
|
|
4353
4353
|
} else
|
|
4354
|
-
te = P.x + (H[0]?.frag.x ?? 0) -
|
|
4355
|
-
P.marker = { text:
|
|
4354
|
+
te = P.x + (H[0]?.frag.x ?? 0) - Q.hangingPx;
|
|
4355
|
+
P.marker = { text: Q.text, style: Q.style, x: te };
|
|
4356
4356
|
}
|
|
4357
4357
|
U.blocks.push(P);
|
|
4358
4358
|
}
|
|
4359
|
-
const
|
|
4360
|
-
J !== void 0 && (
|
|
4359
|
+
const X = { y: G - P.y, height: ee, ascent: V, fragments: H.map((Q) => Q.frag) };
|
|
4360
|
+
J !== void 0 && (X.emptyOffset = J), P.lines.push(X), G += ee, A++;
|
|
4361
4361
|
};
|
|
4362
4362
|
for (const H of g) {
|
|
4363
4363
|
const ee = Ht(H.runs, H.startOffset), V = H.runs.map(() => 0);
|
|
4364
|
-
let J,
|
|
4364
|
+
let J, X = !1, Q = null;
|
|
4365
4365
|
for (; ; ) {
|
|
4366
4366
|
const te = V.slice(), oe = Rs(G), le = C ? u.style.indentFirstLinePx : 0, Z = jt(
|
|
4367
4367
|
u,
|
|
@@ -4385,9 +4385,9 @@ function n0(e, t, n, s, r = He, i = Ke) {
|
|
|
4385
4385
|
let gt = oe.x0 - pe() + le;
|
|
4386
4386
|
y === "center" ? gt += pt / 2 : y === "right" && (gt += pt);
|
|
4387
4387
|
for (const Ae of Z.frags) Ae.frag.x += gt;
|
|
4388
|
-
y === "justify" && (
|
|
4388
|
+
y === "justify" && (Q && gs(Q.frags, Q.slack), Q = { frags: Z.frags, slack: pt }), $(Z.frags, Z.height, Z.ascent), J = Z.end, C = !1, X = !0;
|
|
4389
4389
|
}
|
|
4390
|
-
if (!
|
|
4390
|
+
if (!X) {
|
|
4391
4391
|
const te = ds(u);
|
|
4392
4392
|
G + te.height > re() && ue() && (_(), he(), P = null), $([], te.height, te.ascent, H.startOffset), C = !1;
|
|
4393
4393
|
}
|
|
@@ -4414,9 +4414,9 @@ function n0(e, t, n, s, r = He, i = Ke) {
|
|
|
4414
4414
|
}
|
|
4415
4415
|
let V = [], J = 0;
|
|
4416
4416
|
for (; ; ) {
|
|
4417
|
-
const
|
|
4418
|
-
if (
|
|
4419
|
-
const { H: te, measures: oe } = $t(
|
|
4417
|
+
const Q = Is(u.block.rows.slice(P, P + H));
|
|
4418
|
+
if (Q.length === 0) break;
|
|
4419
|
+
const { H: te, measures: oe } = $t(Q);
|
|
4420
4420
|
if (oe.length === 0) break;
|
|
4421
4421
|
let le = $;
|
|
4422
4422
|
for (let Z = P; Z < P + H; Z++) le += u.rows[Z].height;
|
|
@@ -4431,8 +4431,8 @@ function n0(e, t, n, s, r = He, i = Ke) {
|
|
|
4431
4431
|
continue;
|
|
4432
4432
|
}
|
|
4433
4433
|
V.length > 0 && Yt(V, J), _ && (U.blocks.push(Ye(u.block, C, u.colWidths, pe() + u.xOffset, G, u.tableWidth, 0, k)), G += A);
|
|
4434
|
-
const
|
|
4435
|
-
U.blocks.push(Ye(u.block,
|
|
4434
|
+
const X = u.rows.slice(P, P + H);
|
|
4435
|
+
U.blocks.push(Ye(u.block, X, u.colWidths, pe() + u.xOffset, G, u.tableWidth, P, k)), G += X.reduce((Q, te) => Q + te.height, 0), P += H, P < u.rows.length && he();
|
|
4436
4436
|
}
|
|
4437
4437
|
}, Ze = (u, g) => u?.kind === "para" && g?.kind === "para" && u.block.style.contextualSpacing === !0 && u.block.style.namedStyle === g.block.style.namedStyle;
|
|
4438
4438
|
for (let u = 0; u < B.length; u++) {
|
|
@@ -4462,7 +4462,7 @@ function n0(e, t, n, s, r = He, i = Ke) {
|
|
|
4462
4462
|
continue;
|
|
4463
4463
|
}
|
|
4464
4464
|
const { block: A, lines: P } = g;
|
|
4465
|
-
A.style.pageBreakBefore === !0 && (U.blocks.length > 0 || Oe > 0) ?
|
|
4465
|
+
A.style.pageBreakBefore === !0 && (U.blocks.length > 0 || Oe > 0) ? Xe() : A.style.columnBreakBefore === !0 && ue() && he();
|
|
4466
4466
|
const _ = Ze(g, B[u - 1]), $ = Ze(g, B[u + 1]);
|
|
4467
4467
|
if (_ || (G += A.style.spaceBeforePx), G >= re() && ue() && he(), Ts(G)) {
|
|
4468
4468
|
G += yn(A.style), _s(A), G += wn(A.style), $ || (G += A.style.spaceAfterPx);
|
|
@@ -4479,14 +4479,14 @@ function n0(e, t, n, s, r = He, i = Ke) {
|
|
|
4479
4479
|
break;
|
|
4480
4480
|
}
|
|
4481
4481
|
Ze(J, B[V - 1]) || (H += J.block.style.spaceBeforePx);
|
|
4482
|
-
const
|
|
4483
|
-
if (
|
|
4482
|
+
const X = Ze(J, B[V + 1]) ? 0 : J.block.style.spaceAfterPx, Q = J.block.style.keepWithNext === !0 && B[V + 1] !== void 0;
|
|
4483
|
+
if (Q || J.block.style.keepLinesTogether === !0) {
|
|
4484
4484
|
const Z = Se(J.lines);
|
|
4485
4485
|
if (H + Z > re()) {
|
|
4486
4486
|
ee = !1;
|
|
4487
4487
|
break;
|
|
4488
4488
|
}
|
|
4489
|
-
if (H += Z +
|
|
4489
|
+
if (H += Z + X, !Q) break;
|
|
4490
4490
|
continue;
|
|
4491
4491
|
}
|
|
4492
4492
|
if (B[V + 1] !== void 0 && J.block.runs.every((Z) => Z.text.trim().length === 0)) {
|
|
@@ -4495,7 +4495,7 @@ function n0(e, t, n, s, r = He, i = Ke) {
|
|
|
4495
4495
|
ee = !1;
|
|
4496
4496
|
break;
|
|
4497
4497
|
}
|
|
4498
|
-
H += Z +
|
|
4498
|
+
H += Z + X;
|
|
4499
4499
|
continue;
|
|
4500
4500
|
}
|
|
4501
4501
|
let te = 0, oe = H;
|
|
@@ -4520,16 +4520,16 @@ function n0(e, t, n, s, r = He, i = Ke) {
|
|
|
4520
4520
|
}
|
|
4521
4521
|
const _ = P.start ?? 1, $ = Math.max(1, Math.round(P.countBy ?? 1)), H = P.restart ?? "newPage";
|
|
4522
4522
|
H === "newPage" ? g = _ : H === "newSection" ? A !== y && (g = _) : F || (g = _), F = !0;
|
|
4523
|
-
const ee = C.marginPx.left - (P.distancePx ??
|
|
4523
|
+
const ee = C.marginPx.left - (P.distancePx ?? Xo), V = [];
|
|
4524
4524
|
for (const J of C.blocks)
|
|
4525
4525
|
if (!(J.lines.length === 0 || J.image || J.table || J.equation))
|
|
4526
|
-
for (const
|
|
4526
|
+
for (const X of J.lines) {
|
|
4527
4527
|
if (g % $ === 0) {
|
|
4528
|
-
const
|
|
4528
|
+
const Q = String(g);
|
|
4529
4529
|
V.push({
|
|
4530
|
-
x: ee - ge(
|
|
4531
|
-
baseline: J.y +
|
|
4532
|
-
text:
|
|
4530
|
+
x: ee - ge(Q, u),
|
|
4531
|
+
baseline: J.y + X.y + X.ascent,
|
|
4532
|
+
text: Q,
|
|
4533
4533
|
style: Ln
|
|
4534
4534
|
});
|
|
4535
4535
|
}
|
|
@@ -4596,27 +4596,27 @@ function n0(e, t, n, s, r = He, i = Ke) {
|
|
|
4596
4596
|
for (const V of dt[$]) {
|
|
4597
4597
|
const J = t(V, y);
|
|
4598
4598
|
_ + V.style.spaceBeforePx + Se(J) > A.contentBottomPx && A.blocks.length > 0 && (P(), _ = A.contentTopPx), _ += V.style.spaceBeforePx;
|
|
4599
|
-
const
|
|
4599
|
+
const X = {
|
|
4600
4600
|
blockId: V.id,
|
|
4601
4601
|
x: C + ae,
|
|
4602
4602
|
y: _,
|
|
4603
4603
|
firstLineIndex: 0,
|
|
4604
4604
|
lines: J
|
|
4605
4605
|
};
|
|
4606
|
-
ee && V.runs[0] && (
|
|
4607
|
-
const
|
|
4606
|
+
ee && V.runs[0] && (X.marker = { text: `${H}.`, style: V.runs[0].style, x: C }, ee = !1);
|
|
4607
|
+
const Q = De(
|
|
4608
4608
|
V.style,
|
|
4609
4609
|
p - ae - V.style.indentLeftPx - (V.style.indentRightPx ?? 0),
|
|
4610
4610
|
Se(J)
|
|
4611
4611
|
);
|
|
4612
|
-
|
|
4612
|
+
Q && (X.paraDecor = Q), A.blocks.push(X), _ += Se(J) + V.style.spaceAfterPx;
|
|
4613
4613
|
}
|
|
4614
4614
|
}
|
|
4615
4615
|
}
|
|
4616
4616
|
}
|
|
4617
|
-
const
|
|
4617
|
+
const Qt = (u) => {
|
|
4618
4618
|
for (const F of u)
|
|
4619
|
-
if (F.table) for (const y of F.table.rows) for (const C of y.cells) C.blocks =
|
|
4619
|
+
if (F.table) for (const y of F.table.rows) for (const C of y.cells) C.blocks = Qt(C.blocks);
|
|
4620
4620
|
if (!u.some((F) => F.image?.behind || F.image?.front)) return u;
|
|
4621
4621
|
const g = (F) => F.image?.behind ? 0 : F.image?.front ? 2 : 1;
|
|
4622
4622
|
return u.map((F, y) => ({ b: F, i: y })).sort((F, y) => {
|
|
@@ -4629,7 +4629,7 @@ function n0(e, t, n, s, r = He, i = Ke) {
|
|
|
4629
4629
|
return F.i - y.i;
|
|
4630
4630
|
}).map((F) => F.b);
|
|
4631
4631
|
};
|
|
4632
|
-
for (const u of q) u.blocks =
|
|
4632
|
+
for (const u of q) u.blocks = Qt(u.blocks);
|
|
4633
4633
|
const et = [];
|
|
4634
4634
|
{
|
|
4635
4635
|
let u = 0;
|
|
@@ -4638,11 +4638,11 @@ function n0(e, t, n, s, r = He, i = Ke) {
|
|
|
4638
4638
|
(g === 0 || M[g - 1] !== F) && F.pageNumberStart !== void 0 ? u = F.pageNumberStart : u++, et.push(u), q[g].number = u;
|
|
4639
4639
|
}
|
|
4640
4640
|
}
|
|
4641
|
-
const
|
|
4642
|
-
if (
|
|
4641
|
+
const Xt = e.fields;
|
|
4642
|
+
if (Xt) {
|
|
4643
4643
|
const u = (C) => {
|
|
4644
4644
|
if (C === void 0) return !1;
|
|
4645
|
-
const A =
|
|
4645
|
+
const A = Xt[C], P = A && A.kind === "builtin" ? A.spec?.type : void 0;
|
|
4646
4646
|
return P === "PAGE" || P === "NUMPAGES";
|
|
4647
4647
|
}, g = (C, A) => {
|
|
4648
4648
|
let P = 0;
|
|
@@ -4699,12 +4699,12 @@ function n0(e, t, n, s, r = He, i = Ke) {
|
|
|
4699
4699
|
const F = M[g.index], y = F.pageWidthPx - F.marginPx.left - F.marginPx.right, C = F.marginPx.left, A = g.index === 0 || M[g.index - 1] !== F, P = et[g.index], _ = P % 2 === 0, $ = Zt(F, "header", A, _);
|
|
4700
4700
|
if ($) {
|
|
4701
4701
|
const ee = s === "header", V = i($.blocks, y, C, P, q.length, u, ee), J = In(F, V.height);
|
|
4702
|
-
g.header = V.placed.map((
|
|
4702
|
+
g.header = V.placed.map((X) => yt(X, J)), g.headerSource = $.source;
|
|
4703
4703
|
}
|
|
4704
4704
|
const H = Zt(F, "footer", A, _);
|
|
4705
4705
|
if (H) {
|
|
4706
4706
|
const ee = s === "footer", V = i(H.blocks, y, C, P, q.length, u, ee), J = vn(F, V.height);
|
|
4707
|
-
g.footer = V.placed.map((
|
|
4707
|
+
g.footer = V.placed.map((X) => yt(X, J)), g.footerSource = H.source;
|
|
4708
4708
|
}
|
|
4709
4709
|
}
|
|
4710
4710
|
}
|
|
@@ -1162,29 +1162,29 @@ export {
|
|
|
1162
1162
|
je as T,
|
|
1163
1163
|
_e as U,
|
|
1164
1164
|
q as V,
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1165
|
+
se as W,
|
|
1166
|
+
H as X,
|
|
1167
|
+
$ as Y,
|
|
1168
|
+
et as Z,
|
|
1169
1169
|
ie as _,
|
|
1170
1170
|
ae as a,
|
|
1171
1171
|
nt as b,
|
|
1172
1172
|
Fe as c,
|
|
1173
1173
|
Re as d,
|
|
1174
|
-
|
|
1175
|
-
|
|
1174
|
+
Se as e,
|
|
1175
|
+
Ke as f,
|
|
1176
1176
|
rt as g,
|
|
1177
|
-
|
|
1177
|
+
We as h,
|
|
1178
1178
|
st as i,
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1179
|
+
de as j,
|
|
1180
|
+
Qe as k,
|
|
1181
|
+
Me as l,
|
|
1182
|
+
W as m,
|
|
1183
|
+
tt as n,
|
|
1184
|
+
k as o,
|
|
1185
1185
|
Be as p,
|
|
1186
|
-
|
|
1187
|
-
|
|
1186
|
+
Ze as q,
|
|
1187
|
+
M as r,
|
|
1188
1188
|
ue as s,
|
|
1189
1189
|
F as t,
|
|
1190
1190
|
Pe as u,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as j,
|
|
1
|
+
import { a as j, j as _, A as F, t as k, D as L } from "./toc-DSwkNKls.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-CtrnSSsP.js").then((m) => m.c);
|
|
336
336
|
return e.dispatch(d(t)), i && e.searchClear(), g("inserted");
|
|
337
337
|
}
|
|
338
338
|
}), a({
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
{
|
|
2
|
-
"hash": "
|
|
2
|
+
"hash": "77e47724",
|
|
3
3
|
"configHash": "05722ec4",
|
|
4
|
-
"lockfileHash": "
|
|
5
|
-
"browserHash": "
|
|
4
|
+
"lockfileHash": "f49518e8",
|
|
5
|
+
"browserHash": "e45feddb",
|
|
6
6
|
"optimized": {
|
|
7
7
|
"vue": {
|
|
8
8
|
"src": "../../../../../../node_modules/vue/dist/vue.runtime.esm-bundler.js",
|
|
9
9
|
"file": "vue.js",
|
|
10
|
-
"fileHash": "
|
|
10
|
+
"fileHash": "51d0aeed",
|
|
11
11
|
"needsInterop": false
|
|
12
12
|
},
|
|
13
13
|
"vitepress > @vue/devtools-api": {
|
|
14
14
|
"src": "../../../../../../node_modules/@vue/devtools-api/dist/index.js",
|
|
15
15
|
"file": "vitepress___@vue_devtools-api.js",
|
|
16
|
-
"fileHash": "
|
|
16
|
+
"fileHash": "3bf9be70",
|
|
17
17
|
"needsInterop": false
|
|
18
18
|
},
|
|
19
19
|
"vitepress > @vueuse/core": {
|
|
20
20
|
"src": "../../../../../../node_modules/@vueuse/core/index.mjs",
|
|
21
21
|
"file": "vitepress___@vueuse_core.js",
|
|
22
|
-
"fileHash": "
|
|
22
|
+
"fileHash": "565aef4a",
|
|
23
23
|
"needsInterop": false
|
|
24
24
|
},
|
|
25
25
|
"@theme/index": {
|
|
26
26
|
"src": "../../../../../../node_modules/vitepress/dist/client/theme-default/index.js",
|
|
27
27
|
"file": "@theme_index.js",
|
|
28
|
-
"fileHash": "
|
|
28
|
+
"fileHash": "282fbadc",
|
|
29
29
|
"needsInterop": false
|
|
30
30
|
}
|
|
31
31
|
},
|
|
@@ -6,6 +6,8 @@ export default defineConfig({
|
|
|
6
6
|
themeConfig: {
|
|
7
7
|
nav: [
|
|
8
8
|
{ text: 'Home', link: '/' },
|
|
9
|
+
{ text: 'Fonts & CDN', link: '/fonts' },
|
|
10
|
+
{ text: 'Table editing', link: '/table-editing' },
|
|
9
11
|
{ text: 'Public Events', link: '/public-events' },
|
|
10
12
|
{ text: 'HTTP Event Sink', link: '/http-event-sink' },
|
|
11
13
|
],
|
|
@@ -14,6 +16,8 @@ export default defineConfig({
|
|
|
14
16
|
text: 'Integration & Events',
|
|
15
17
|
items: [
|
|
16
18
|
{ text: 'Overview', link: '/' },
|
|
19
|
+
{ text: 'Fonts & CDN', link: '/fonts' },
|
|
20
|
+
{ text: 'Table editing', link: '/table-editing' },
|
|
17
21
|
{ text: 'Public Events API', link: '/public-events' },
|
|
18
22
|
{ text: 'HTTP Event Sink', link: '/http-event-sink' },
|
|
19
23
|
]
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
<link rel="preload stylesheet" href="/assets/style.D6g4bpRC.css" as="style">
|
|
10
10
|
<link rel="preload stylesheet" href="/vp-icons.css" as="style">
|
|
11
11
|
|
|
12
|
-
<script type="module" src="/assets/app.
|
|
12
|
+
<script type="module" src="/assets/app.rXBVdtfQ.js"></script>
|
|
13
13
|
<link rel="preload" href="/assets/inter-roman-latin.Di8DUHzh.woff2" as="font" type="font/woff2" crossorigin="">
|
|
14
14
|
<script id="check-dark-mode">(()=>{const e=localStorage.getItem("vitepress-theme-appearance")||"auto",a=window.matchMedia("(prefers-color-scheme: dark)").matches;(!e||e==="auto"?a:e==="dark")&&document.documentElement.classList.add("dark")})();</script>
|
|
15
15
|
<script id="check-mac-os">document.documentElement.classList.toggle("mac",/Mac|iPhone|iPod|iPad/i.test(navigator.platform));</script>
|
|
16
16
|
</head>
|
|
17
17
|
<body>
|
|
18
18
|
<div id="app"></div>
|
|
19
|
-
<script>window.__VP_HASH_MAP__=JSON.parse("{\"http-event-sink.md\":\"
|
|
19
|
+
<script>window.__VP_HASH_MAP__=JSON.parse("{\"fonts.md\":\"W87hfQua\",\"http-event-sink.md\":\"D7mTerle\",\"index.md\":\"DN1JXJhG\",\"public-events.md\":\"Rj44CdBr\",\"review-comments.md\":\"466PcTcC\",\"table-editing.md\":\"Bso_sgTE\"}");window.__VP_SITE_DATA__=JSON.parse("{\"lang\":\"en-US\",\"dir\":\"ltr\",\"title\":\"Kindy Editor\",\"description\":\"Canvas-based Word Document Editor Documentation\",\"base\":\"/\",\"head\":[],\"router\":{\"prefetchLinks\":true},\"appearance\":true,\"themeConfig\":{\"nav\":[{\"text\":\"Home\",\"link\":\"/\"},{\"text\":\"Fonts & CDN\",\"link\":\"/fonts\"},{\"text\":\"Table editing\",\"link\":\"/table-editing\"},{\"text\":\"Public Events\",\"link\":\"/public-events\"},{\"text\":\"HTTP Event Sink\",\"link\":\"/http-event-sink\"}],\"sidebar\":[{\"text\":\"Integration & Events\",\"items\":[{\"text\":\"Overview\",\"link\":\"/\"},{\"text\":\"Fonts & CDN\",\"link\":\"/fonts\"},{\"text\":\"Table editing\",\"link\":\"/table-editing\"},{\"text\":\"Public Events API\",\"link\":\"/public-events\"},{\"text\":\"HTTP Event Sink\",\"link\":\"/http-event-sink\"}]}],\"socialLinks\":[{\"icon\":\"github\",\"link\":\"https://github.com/hotienky/editor\"}]},\"locales\":{},\"scrollOffset\":134,\"cleanUrls\":false}");</script>
|
|
20
20
|
|
|
21
21
|
</body>
|
|
22
22
|
</html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as p}from"./chunks/theme.
|
|
1
|
+
import{t as p}from"./chunks/theme.CFP3sGN8.js";import{R as s,a0 as i,a1 as u,a2 as c,a3 as l,a4 as f,a5 as d,a6 as m,a7 as h,a8 as g,a9 as A,d as v,u as y,v as C,s as P,aa as b,ab as w,ac as R,ad as E}from"./chunks/framework.D9_ZvfG7.js";function r(e){if(e.extends){const a=r(e.extends);return{...a,...e,async enhanceApp(t){a.enhanceApp&&await a.enhanceApp(t),e.enhanceApp&&await e.enhanceApp(t)}}}return e}const n=r(p),S=v({name:"VitePressApp",setup(){const{site:e,lang:a,dir:t}=y();return C(()=>{P(()=>{document.documentElement.lang=a.value,document.documentElement.dir=t.value})}),e.value.router.prefetchLinks&&b(),w(),R(),n.setup&&n.setup(),()=>E(n.Layout)}});async function T(){globalThis.__VITEPRESS__=!0;const e=_(),a=D();a.provide(u,e);const t=c(e.route);return a.provide(l,t),a.component("Content",f),a.component("ClientOnly",d),Object.defineProperties(a.config.globalProperties,{$frontmatter:{get(){return t.frontmatter.value}},$params:{get(){return t.page.value.params}}}),n.enhanceApp&&await n.enhanceApp({app:a,router:e,siteData:m}),{app:a,router:e,data:t}}function D(){return A(S)}function _(){let e=s;return h(a=>{let t=g(a),o=null;return t&&(e&&(t=t.replace(/\.js$/,".lean.js")),o=import(t)),s&&(e=!1),o},n.NotFound)}s&&T().then(({app:e,router:a,data:t})=>{a.go().then(()=>{i(a.route,t.site),e.mount("#app")})});export{T as createApp};
|