@silurus/ooxml 0.81.0 → 0.82.1
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 +4 -8
- package/dist/assets/render-worker-Cy-QsDge.js +10 -0
- package/dist/assets/{render-worker-DtU8oQZ7.js → render-worker-Dw_wQRIh.js} +1 -1
- package/dist/assets/{render-worker-C2ACcLes.js → render-worker-aHayzR7v.js} +4 -4
- package/dist/{canvas-viewer-mechanics-CqxKRGCp.js → canvas-viewer-mechanics-CS_qbr6T.js} +1 -1
- package/dist/chart-ex.mjs +4 -4
- package/dist/comment-occurrence-C34fWs_F.js +6 -0
- package/dist/comment-ui-runtime-C1RV_3iu.js +112 -0
- package/dist/comment-ui-runtime-DTGN3Vyy.js +2 -0
- package/dist/comment-ui-runtime-DgCZpPR0.js +171 -0
- package/dist/comments-Cf9W7r3M.js +241 -0
- package/dist/{document-pull-client-Ux4a_ax8.js → document-pull-client-B1WOjA0z.js} +2206 -2193
- package/dist/{docx-SEyQ4gS-.js → docx-HoZXZUPA.js} +674 -249
- package/dist/docx.mjs +6 -5
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/dom-interaction-boundary-C8F6HO5x.js +119 -0
- package/dist/highlight-rect-MaCt0om0.js +13 -0
- package/dist/index.mjs +3 -3
- package/dist/{line-distribute-BBGvvwLt.js → line-distribute-iXsUCIH-.js} +2 -2
- package/dist/{line-metrics-Baz31mML.js → line-metrics-B3syvDn2.js} +52 -52
- package/dist/math.mjs +2 -2
- package/dist/node.mjs +10 -10
- package/dist/{plot-area-frame-Dg1VIpUU.js → plot-area-frame-DHV02PJU.js} +591 -590
- package/dist/{pptx-5lQrMvMR.js → pptx-DEUP4Yq5.js} +537 -243
- package/dist/pptx.mjs +6 -6
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/read-only-comment-decoration-DcFevX_Q.js +96 -0
- package/dist/read-only-comment-margin-DrUX-YrP.js +189 -0
- package/dist/region-map.mjs +2 -2
- package/dist/{render-DEHjijQD.js → render-BC8p7vZQ.js} +1 -1
- package/dist/{render-worker-host-B1nbV_k7.js → render-worker-host-BNnXCtAu.js} +1 -1
- package/dist/{render-worker-host-Bze5M6k5.js → render-worker-host-CmPBviYJ.js} +1 -1
- package/dist/{render-worker-host-Dg_74V64.js → render-worker-host-DhnkTyjj.js} +1 -1
- package/dist/{renderer-DuopJE1K.js → renderer-CYr9YTXM.js} +436 -435
- package/dist/{resource-measurement-DRLp4nFt.js → resource-measurement-CsW4_eYt.js} +2 -2
- package/dist/{session-CNVc3VJ4.js → session-Da7LEQUB.js} +3 -3
- package/dist/{slide-pull-client-CzutXnGc.js → slide-pull-client-Bg9DusLX.js} +413 -300
- package/dist/source-key-BklvnEyQ.js +42 -0
- package/dist/{three-d-BYiWCNlz.js → three-d-7MaVzQuZ.js} +48 -47
- package/dist/three-d.mjs +324 -323
- package/dist/types/chart-ex.d.ts +2 -2
- package/dist/types/docx.d.ts +183 -19
- package/dist/types/index.d.ts +343 -26
- package/dist/types/math.d.ts +1 -1
- package/dist/types/node.d.ts +428 -348
- package/dist/types/pptx.d.ts +132 -11
- package/dist/types/region-map.d.ts +2 -2
- package/dist/types/three-d.d.ts +2 -2
- package/dist/types/xlsx.d.ts +78 -10
- package/dist/units-BzZ0gAxs.js +4 -0
- package/dist/{worksheet-pull-client-Cxj3Ej0s.js → worksheet-pull-client-CYtwXP5D.js} +3 -3
- package/dist/{xlsx-Bl3TIEVu.js → xlsx-DMWeXT-c.js} +429 -218
- package/dist/xlsx.mjs +6 -6
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +2 -1
- package/dist/assets/render-worker-Cx5uR77k.js +0 -10
- package/dist/highlight-rect-BqcZMHUE.js +0 -48
- /package/dist/{mathjax-DJa-Q93p.js → mathjax-DwIrafQ6.js} +0 -0
- /package/dist/{renderer-module-contract-0bO_5SC0.js → renderer-module-contract-DLbb7zY0.js} +0 -0
- /package/dist/{transfer-D0U6Uhn4.js → transfer-R6NjgBKD.js} +0 -0
- /package/dist/{visible-index-DbDuGMCE.js → visible-index-BFE3PWiY.js} +0 -0
package/dist/pptx.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { c as e } from "./slide-pull-client-
|
|
2
|
-
import { Jt as t, Yt as n, a as r } from "./line-metrics-
|
|
3
|
-
import { w as i } from "./canvas-viewer-mechanics-
|
|
4
|
-
import {
|
|
5
|
-
import { a as s, i as c, n as l, o as u, r as d, s as f } from "./pptx-
|
|
6
|
-
export {
|
|
1
|
+
import { c as e } from "./slide-pull-client-Bg9DusLX.js";
|
|
2
|
+
import { Jt as t, Yt as n, a as r } from "./line-metrics-B3syvDn2.js";
|
|
3
|
+
import { w as i } from "./canvas-viewer-mechanics-CS_qbr6T.js";
|
|
4
|
+
import { cn as a, ln as o } from "./plot-area-frame-DHV02PJU.js";
|
|
5
|
+
import { a as s, i as c, n as l, o as u, r as d, s as f } from "./pptx-DEUP4Yq5.js";
|
|
6
|
+
export { a as OoxmlDecodedImageLimitError, t as OoxmlError, n as OoxmlResourceLimitError, s as PptxPresentation, l as PptxScrollViewer, d as PptxViewer, i as autoResize, u as buildPptxHighlightLayer, f as buildPptxTextLayer, o as isOoxmlDecodedImageLimitError, r as openExternalHyperlink, c as readPptxTextSelectionContext, e as renderSlide };
|
package/dist/pptx_parser_bg.wasm
CHANGED
|
Binary file
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
//#region packages/core/src/internal/dom-geometry.ts
|
|
2
|
+
function e(e, t) {
|
|
3
|
+
let n = Math.max(e.x, t.x), r = Math.max(e.y, t.y), i = Math.min(e.x + e.width, t.x + t.width), a = Math.min(e.y + e.height, t.y + t.height);
|
|
4
|
+
if (!(i <= n || a <= r)) return Object.freeze({
|
|
5
|
+
x: n,
|
|
6
|
+
y: r,
|
|
7
|
+
width: i - n,
|
|
8
|
+
height: a - r
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function t(e, t) {
|
|
12
|
+
let n = e.getBoundingClientRect(), r = t.getBoundingClientRect();
|
|
13
|
+
if ([
|
|
14
|
+
n.left,
|
|
15
|
+
n.top,
|
|
16
|
+
n.width,
|
|
17
|
+
n.height,
|
|
18
|
+
r.left,
|
|
19
|
+
r.top
|
|
20
|
+
].every(Number.isFinite) && !(n.width <= 0 || n.height <= 0)) return Object.freeze({
|
|
21
|
+
x: n.left - r.left,
|
|
22
|
+
y: n.top - r.top,
|
|
23
|
+
width: n.width,
|
|
24
|
+
height: n.height
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
//#region packages/core/src/internal/read-only-comment-decoration.ts
|
|
29
|
+
function n(t, n) {
|
|
30
|
+
let r = t.scrollTop - n;
|
|
31
|
+
return Object.freeze(t.threads.map((n) => {
|
|
32
|
+
if (!n.cardRect) return n;
|
|
33
|
+
let i = Object.freeze({
|
|
34
|
+
...n.cardRect,
|
|
35
|
+
y: n.cardRect.y + r
|
|
36
|
+
}), a = t.cardClipBounds ? e(i, t.cardClipBounds) : i, { cardRect: o, ...s } = n;
|
|
37
|
+
return Object.freeze({
|
|
38
|
+
...s,
|
|
39
|
+
...a ? { cardRect: a } : {}
|
|
40
|
+
});
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
var r = "http://www.w3.org/2000/svg", i = /* @__PURE__ */ new WeakMap();
|
|
44
|
+
function a(e) {
|
|
45
|
+
let t = Math.round(e * 1e3) / 1e3;
|
|
46
|
+
return Object.is(t, -0) ? "0" : String(t);
|
|
47
|
+
}
|
|
48
|
+
function o(e, t) {
|
|
49
|
+
let n = (t.x - e.x) * .5;
|
|
50
|
+
return [{
|
|
51
|
+
x: e.x + n,
|
|
52
|
+
y: e.y
|
|
53
|
+
}, {
|
|
54
|
+
x: t.x - n,
|
|
55
|
+
y: t.y
|
|
56
|
+
}];
|
|
57
|
+
}
|
|
58
|
+
function s(e, t, n) {
|
|
59
|
+
let r = e.x + (t.x - e.x) * .55;
|
|
60
|
+
if (n === "orthogonal") return `M ${a(e.x)} ${a(e.y)} H ${a(r)} V ${a(t.y)} H ${a(t.x)}`;
|
|
61
|
+
let [i, s] = o(e, t);
|
|
62
|
+
return `M ${a(e.x)} ${a(e.y)} C ${a(i.x)} ${a(i.y)}, ${a(s.x)} ${a(s.y)}, ${a(t.x)} ${a(t.y)}`;
|
|
63
|
+
}
|
|
64
|
+
function c(e) {
|
|
65
|
+
i.delete(e), e.replaceChildren();
|
|
66
|
+
}
|
|
67
|
+
function l(e, t, n) {
|
|
68
|
+
e.dataset.ooxmlCommentConnectors = "";
|
|
69
|
+
let a = i.get(e);
|
|
70
|
+
if (!a) {
|
|
71
|
+
let t = e.ownerDocument.createElementNS(r, "svg");
|
|
72
|
+
t.setAttribute("aria-hidden", "true"), t.style.cssText = "position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;", a = {
|
|
73
|
+
svg: t,
|
|
74
|
+
paths: /* @__PURE__ */ new Map()
|
|
75
|
+
}, i.set(e, a), e.replaceChildren(t);
|
|
76
|
+
}
|
|
77
|
+
a.svg.setAttribute("viewBox", `${t.surfaceBounds.x} ${t.surfaceBounds.y} ${t.surfaceBounds.width} ${t.surfaceBounds.height}`);
|
|
78
|
+
let o = [], c = /* @__PURE__ */ new Set();
|
|
79
|
+
for (let i of t.threads) {
|
|
80
|
+
let l = i.anchorRects.at(-1), u = i.cardRect;
|
|
81
|
+
if (!l || !u) continue;
|
|
82
|
+
c.add(i.occurrenceKey);
|
|
83
|
+
let d = t.side === "left" ? l.x : l.x + l.width, f = l.y + l.height / 2, p = t.side === "left" ? u.x + u.width : u.x, m = u.y + Math.min(u.height / 2, 25), h = a.paths.get(i.occurrenceKey);
|
|
84
|
+
h || (h = e.ownerDocument.createElementNS(r, "path"), a.paths.set(i.occurrenceKey, h)), h.dataset.ooxmlCommentConnector = i.occurrenceKey, h.dataset.active = String(i.active), h.setAttribute("d", s({
|
|
85
|
+
x: d,
|
|
86
|
+
y: f
|
|
87
|
+
}, {
|
|
88
|
+
x: p,
|
|
89
|
+
y: m
|
|
90
|
+
}, n.route)), h.style.cssText = `fill:none;vector-effect:non-scaling-stroke;stroke:${i.active ? n.activeColor ?? n.color ?? "#2563eb" : n.color ?? "#94a3b8"};stroke-width:${i.active ? "1.5px" : "1px"};stroke-dasharray:${n.stroke === "dashed" ? "4 4" : "none"};opacity:${i.active ? ".9" : ".45"};`, o.push(h);
|
|
91
|
+
}
|
|
92
|
+
for (let [e, t] of [...a.paths]) c.has(e) || (a.paths.delete(e), t.remove());
|
|
93
|
+
(o.length !== a.svg.children.length || o.some((e, t) => a.svg.children[t] !== e)) && a.svg.replaceChildren(...o);
|
|
94
|
+
}
|
|
95
|
+
//#endregion
|
|
96
|
+
export { t as i, c as n, n as r, l as t };
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
//#region packages/core/src/internal/read-only-comment-margin.ts
|
|
2
|
+
var e = 1, t = "\n:where(.ooxml-comment-marker) {\n padding: 0;\n border: 0;\n cursor: pointer;\n pointer-events: auto;\n background: transparent;\n box-shadow: none;\n color: var(--ooxml-comment-marker-color, var(--ooxml-comment-author-accent));\n}\n:where([data-ooxml-comment-highlight]) {\n position: absolute;\n pointer-events: none;\n background: var(--ooxml-comment-highlight, color-mix(in srgb, var(--ooxml-comment-author-accent) 18%, transparent));\n transform-origin: top left;\n}\n:where([data-ooxml-comment-highlight][data-active=\"true\"]) {\n background: var(--ooxml-comment-highlight-active, color-mix(in srgb, var(--ooxml-comment-author-accent) 34%, transparent));\n}\n:where([data-ooxml-comment-target]) {\n position: absolute;\n box-sizing: border-box;\n pointer-events: none;\n border-style: solid;\n border-color: var(--ooxml-comment-target-border, #2563eb);\n background: var(--ooxml-comment-target-background, rgba(37, 99, 235, .06));\n transform-origin: center;\n}\n:where(.ooxml-comment-card) {\n position: relative;\n display: block;\n width: 100%;\n margin: 0 0 var(--ooxml-comment-card-gap, .42em);\n box-sizing: border-box;\n padding: var(--ooxml-comment-card-padding, .56em .68em);\n border: 0;\n border-radius: var(--ooxml-comment-card-radius, .3em);\n text-align: start;\n cursor: default;\n font: inherit;\n outline: none;\n background: var(--ooxml-comment-card-background, #fff);\n box-shadow: var(--ooxml-comment-card-shadow, none);\n}\n:where(button.ooxml-comment-card) {\n cursor: pointer;\n}\n:where(.ooxml-comment-card[data-standalone=\"true\"]) {\n position: absolute;\n width: max-content;\n max-width: 100%;\n margin: 0;\n z-index: 3;\n pointer-events: none;\n overflow: hidden;\n font-size: 13px;\n}\n:where(.ooxml-comment-card[data-active=\"true\"]) {\n background: var(--ooxml-comment-card-active-background, #eff6ff);\n box-shadow: var(--ooxml-comment-card-active-shadow, none);\n}\n:where(.ooxml-comment-card[data-focused=\"true\"]) {\n box-shadow: var(--ooxml-comment-card-focus-shadow, 0 0 0 .12em rgba(37, 99, 235, .65));\n}\n:where(.ooxml-comment-card [data-ooxml-comment-part=\"content\"]) {\n min-width: 0;\n flex: 1;\n}\n:where(.ooxml-comment-card [data-ooxml-comment-part=\"identity\"]) {\n display: flex;\n align-items: baseline;\n gap: .48em;\n min-width: 0;\n}\n:where(.ooxml-comment-card__author) {\n min-width: 0;\n font: 700 .84em/1.3 var(--ooxml-comment-font-family, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif);\n color: var(--ooxml-comment-author-color, #0f172a);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n:where(.ooxml-comment-card__date) {\n font: 500 .66em/1.35 var(--ooxml-comment-date-font-family, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);\n color: var(--ooxml-comment-muted-color, #64748b);\n white-space: nowrap;\n}\n:where(.ooxml-comment-card__body) {\n margin-top: .28em;\n font: 400 .84em/1.45 var(--ooxml-comment-font-family, system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", sans-serif);\n color: var(--ooxml-comment-body-color, #334155);\n white-space: pre-wrap;\n overflow-wrap: anywhere;\n}\n:where(.ooxml-comment-card__reply) {\n margin: .55em 0 0 .45em;\n padding: .08em 0 0 .65em;\n border-left: .08em solid var(--ooxml-comment-reply-border, rgba(100, 116, 139, .24));\n}\n:where(.ooxml-comment-card [data-ooxml-comment-part=\"frame\"]) {\n position: absolute;\n inset: 0;\n box-sizing: border-box;\n pointer-events: none;\n border-radius: inherit;\n border: var(--ooxml-comment-card-border, 1px solid rgba(148, 163, 184, .34));\n border-left: var(--ooxml-comment-card-border-left, .14em solid var(--ooxml-comment-author-accent));\n border-right: var(--ooxml-comment-card-border-right, var(--ooxml-comment-card-border, 1px solid rgba(148, 163, 184, .34)));\n}\n:where(.ooxml-comment-card[data-active=\"true\"] [data-ooxml-comment-part=\"frame\"]) {\n border: var(--ooxml-comment-card-active-border, 1px solid rgba(37, 99, 235, .5));\n border-left: var(--ooxml-comment-card-border-left, .14em solid var(--ooxml-comment-author-accent));\n border-right: var(--ooxml-comment-card-border-right, var(--ooxml-comment-card-active-border, 1px solid rgba(37, 99, 235, .5)));\n}\n:where([data-ooxml-comment-ui=\"margin\"] > [data-ooxml-comment-item]) {\n position: absolute;\n left: 0;\n padding: 0 .14em;\n box-sizing: border-box;\n transform-origin: 0 0;\n}\n:where([data-ooxml-comment-ui=\"margin\"] > [data-ooxml-comment-item]:last-child > .ooxml-comment-card) {\n margin-bottom: 0;\n}\n";
|
|
3
|
+
function n(e) {
|
|
4
|
+
let n = e.head;
|
|
5
|
+
if (!n || n.querySelector("style[data-ooxml-comment-styles]")) return;
|
|
6
|
+
let r = e.createElement("style");
|
|
7
|
+
r.dataset.ooxmlCommentStyles = "", r.textContent = t, n.appendChild(r);
|
|
8
|
+
}
|
|
9
|
+
function r(e) {
|
|
10
|
+
if (!e) return "#2563eb";
|
|
11
|
+
let t = 2166136261;
|
|
12
|
+
for (let n of e.normalize("NFKC")) t ^= n.codePointAt(0) ?? 0, t = Math.imul(t, 16777619);
|
|
13
|
+
return `hsl(${(t >>> 0) % 360} 68% 42%)`;
|
|
14
|
+
}
|
|
15
|
+
function i(e, t) {
|
|
16
|
+
n(e);
|
|
17
|
+
let i = e.createElement("button");
|
|
18
|
+
return i.type = "button", i.setAttribute("class", "ooxml-comment-marker"), i.dataset.ooxmlCommentId = t.occurrenceKey, i.dataset.ooxmlCommentMarker = "", i.dataset.active = String(t.active), i.setAttribute("aria-label", `Comment ${t.visibleIndex + 1}`), i.setAttribute("aria-pressed", String(t.active)), i.style.cssText = `--ooxml-comment-author-accent:${r(t.author)};position:absolute;transform:translate(-50%,-50%);width:${24 * t.zoom}px;height:${24 * t.zoom}px;`, i.innerHTML = "<svg viewBox=\"0 0 24 24\" width=\"100%\" height=\"100%\" aria-hidden=\"true\"><path fill=\"currentColor\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M18 4C18.7956 4 19.5587 4.31607 20.1213 4.87868C20.6839 5.44129 21 6.20435 21 7V15C21 15.7956 20.6839 16.5587 20.1213 17.1213C19.5587 17.6839 18.7956 18 18 18H13L8 21V18H6C5.20435 18 4.44129 17.6839 3.87868 17.1213C3.31607 16.5587 3 15.7956 3 15V7C3 6.20435 3.31607 5.44129 3.87868 4.87868C4.44129 4.31607 5.20435 4 6 4H18Z\"/></svg>", i.addEventListener("click", () => t.onSetActive(t.occurrenceKey, !t.active)), i;
|
|
19
|
+
}
|
|
20
|
+
var a = /* @__PURE__ */ new WeakMap();
|
|
21
|
+
function o(e, t) {
|
|
22
|
+
t && typeof t.unobserve == "function" && t.unobserve(e.card), e.card.removeEventListener("click", e.onClick), e.card.removeEventListener("focus", e.onFocus), e.card.removeEventListener("blur", e.onBlur), e.item.remove();
|
|
23
|
+
}
|
|
24
|
+
function s(e) {
|
|
25
|
+
let t = a.get(e);
|
|
26
|
+
a.delete(e);
|
|
27
|
+
for (let e of t?.cards.values() ?? []) o(e, t?.resizeObserver);
|
|
28
|
+
t?.cards.clear(), t && e.removeEventListener("scroll", t.onScroll), t?.resizeObserver?.disconnect(), e.replaceChildren();
|
|
29
|
+
}
|
|
30
|
+
function c(e, t) {
|
|
31
|
+
let n = a.get(e);
|
|
32
|
+
if (!n || n.cards.size === 0 || !Number.isFinite(t) || t <= 0) return !1;
|
|
33
|
+
let r = Number.parseFloat(e.dataset.ooxmlCommentZoom ?? ""), i = Number.isFinite(r) && r > 0 ? r : n.zoom * t;
|
|
34
|
+
for (let e of n.cards.values()) e.item.style.top = `${e.committedTop * i}px`, e.item.style.transform = `scale(${i})`;
|
|
35
|
+
return !0;
|
|
36
|
+
}
|
|
37
|
+
function l(e, t = "") {
|
|
38
|
+
let n = e.createElement("div");
|
|
39
|
+
return n.style.cssText = t, n;
|
|
40
|
+
}
|
|
41
|
+
function u(e) {
|
|
42
|
+
if (!e) return;
|
|
43
|
+
let t = new Date(e);
|
|
44
|
+
return Number.isFinite(t.getTime()) ? new Intl.DateTimeFormat(void 0, {
|
|
45
|
+
dateStyle: "medium",
|
|
46
|
+
timeStyle: "short"
|
|
47
|
+
}).format(t) : e;
|
|
48
|
+
}
|
|
49
|
+
function d(e, t) {
|
|
50
|
+
return e.messageKey === t.messageKey && e.sourceId === t.sourceId && e.author === t.author && e.date === t.date && e.text === t.text && e.status === t.status;
|
|
51
|
+
}
|
|
52
|
+
function f(e, t) {
|
|
53
|
+
return e.occurrenceKey === t.occurrenceKey && d(e.root, t.root) && e.replies.length === t.replies.length && e.replies.every((e, n) => d(e, t.replies[n]));
|
|
54
|
+
}
|
|
55
|
+
function p(e, t, n) {
|
|
56
|
+
let r = e.map((e, t) => ({
|
|
57
|
+
...e,
|
|
58
|
+
index: t
|
|
59
|
+
})).sort((e, t) => e.preferredTop - t.preferredTop || e.index - t.index), i = Math.max(0, n), a = r.reduce((e, t) => e + Math.max(0, t.height), 0) + i * Math.max(0, r.length - 1);
|
|
60
|
+
if (t <= 0 || a > t) {
|
|
61
|
+
let e = 0;
|
|
62
|
+
return new Map(r.map((t) => {
|
|
63
|
+
let n = [t.occurrenceKey, e];
|
|
64
|
+
return e += Math.max(0, t.height) + i, n;
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
let o = r.map((e) => Math.max(0, Math.min(e.preferredTop, t - e.height)));
|
|
68
|
+
for (let e = 1; e < r.length; e++) {
|
|
69
|
+
let t = o[e - 1] + r[e - 1].height + i;
|
|
70
|
+
o[e] = Math.max(o[e], t);
|
|
71
|
+
}
|
|
72
|
+
if (r.length > 0) {
|
|
73
|
+
let e = r.length - 1;
|
|
74
|
+
o[e] = Math.min(o[e], t - r[e].height);
|
|
75
|
+
for (let t = e - 1; t >= 0; t--) o[t] = Math.min(o[t], o[t + 1] - i - r[t].height);
|
|
76
|
+
if (o[0] < 0) {
|
|
77
|
+
let e = -o[0];
|
|
78
|
+
for (let t = 0; t < o.length; t++) o[t] += e;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return new Map(r.map((e, t) => [e.occurrenceKey, o[t]]));
|
|
82
|
+
}
|
|
83
|
+
function m(e, t, n) {
|
|
84
|
+
let r = e.ownerDocument, i = l(r);
|
|
85
|
+
n && i.setAttribute("class", "ooxml-comment-card__reply"), i.dataset.ooxmlCommentPart = n ? "reply" : "comment";
|
|
86
|
+
let a = l(r);
|
|
87
|
+
a.dataset.ooxmlCommentPart = "content";
|
|
88
|
+
let o = l(r);
|
|
89
|
+
o.dataset.ooxmlCommentPart = "identity";
|
|
90
|
+
let s = l(r);
|
|
91
|
+
s.setAttribute("class", "ooxml-comment-card__author"), s.dataset.ooxmlCommentPart = "author", s.textContent = t.author || "Comment", o.appendChild(s);
|
|
92
|
+
let c = u(t.date);
|
|
93
|
+
if (c) {
|
|
94
|
+
let e = l(r);
|
|
95
|
+
e.setAttribute("class", "ooxml-comment-card__date"), e.dataset.ooxmlCommentPart = "date", e.textContent = c, e.setAttribute("title", t.date), o.appendChild(e);
|
|
96
|
+
}
|
|
97
|
+
let d = l(r);
|
|
98
|
+
d.setAttribute("class", "ooxml-comment-card__body"), d.dataset.ooxmlCommentPart = "body", d.textContent = t.text, a.appendChild(o), a.appendChild(d), i.appendChild(a), e.appendChild(i);
|
|
99
|
+
}
|
|
100
|
+
function h(e, t, i = {}) {
|
|
101
|
+
n(e.ownerDocument);
|
|
102
|
+
let a = i.active ?? !1, o = i.focused ?? !1, s = i.interactive ?? e.tagName === "BUTTON", c = r(t.root.author);
|
|
103
|
+
e.setAttribute("class", "ooxml-comment-card"), e.dataset.ooxmlCommentId = t.occurrenceKey, e.dataset.active = String(a), e.dataset.focused = String(o), e.dataset.standalone = String(i.standalone ?? !1), e.dataset.ooxmlCommentCard = "", s ? e.setAttribute("aria-pressed", String(a)) : e.removeAttribute("aria-pressed"), e.style.cssText = `--ooxml-comment-author-accent:${c};`, e.replaceChildren(), m(e, t.root, !1);
|
|
104
|
+
for (let n of t.replies) m(e, n, !0);
|
|
105
|
+
let u = l(e.ownerDocument);
|
|
106
|
+
u.dataset.ooxmlCommentPart = "frame", u.setAttribute("aria-hidden", "true"), e.appendChild(u);
|
|
107
|
+
}
|
|
108
|
+
function g(t, n, r) {
|
|
109
|
+
t.setAttribute("role", "list"), t.setAttribute("aria-label", "Comments"), t.dataset.ooxmlCommentUi = "margin", t.dataset.ooxmlCommentZoom = String(r.zoom);
|
|
110
|
+
let i = a.get(t);
|
|
111
|
+
if (!i) {
|
|
112
|
+
let e = {
|
|
113
|
+
cards: /* @__PURE__ */ new Map(),
|
|
114
|
+
onScroll: () => e.onScrollGeometryChange?.(),
|
|
115
|
+
zoom: r.zoom,
|
|
116
|
+
onGeometryChange: r.onGeometryChange,
|
|
117
|
+
onScrollGeometryChange: r.onScrollGeometryChange
|
|
118
|
+
};
|
|
119
|
+
if ((r.onGeometryChange || r.onScrollGeometryChange) && t.addEventListener("scroll", e.onScroll, { passive: !0 }), r.onGeometryChange) {
|
|
120
|
+
let n = t.ownerDocument.defaultView?.ResizeObserver ?? globalThis.ResizeObserver;
|
|
121
|
+
n && (e.resizeObserver = new n(() => e.onGeometryChange?.()));
|
|
122
|
+
}
|
|
123
|
+
i = e, a.set(t, i);
|
|
124
|
+
}
|
|
125
|
+
i.zoom = r.zoom, i.onGeometryChange = r.onGeometryChange, i.onScrollGeometryChange = r.onScrollGeometryChange;
|
|
126
|
+
let s = /* @__PURE__ */ new Set();
|
|
127
|
+
for (let e of n) {
|
|
128
|
+
if (s.has(e.occurrenceKey)) throw Error(`Duplicate comment occurrence key: ${e.occurrenceKey}`);
|
|
129
|
+
s.add(e.occurrenceKey);
|
|
130
|
+
}
|
|
131
|
+
for (let [e, t] of [...i.cards]) s.has(e) || (i.cards.delete(e), o(t, i.resizeObserver));
|
|
132
|
+
for (let a of n) {
|
|
133
|
+
let n = i.cards.get(a.occurrenceKey);
|
|
134
|
+
if (!n) {
|
|
135
|
+
let o = l(t.ownerDocument);
|
|
136
|
+
o.setAttribute("role", "listitem"), o.dataset.ooxmlCommentItem = "";
|
|
137
|
+
let s = t.ownerDocument.createElement("button");
|
|
138
|
+
s.type = "button", s.id = `ooxml-comment-card-${e++}`, s.dataset.ooxmlCommentCard = "";
|
|
139
|
+
let c = {
|
|
140
|
+
item: o,
|
|
141
|
+
card: s,
|
|
142
|
+
thread: a,
|
|
143
|
+
painted: !1,
|
|
144
|
+
focused: !1,
|
|
145
|
+
active: !1,
|
|
146
|
+
committedTop: 0,
|
|
147
|
+
onSetActive: r.onSetActive,
|
|
148
|
+
onClick: () => c.onSetActive(a.occurrenceKey, !c.active),
|
|
149
|
+
onFocus: () => {
|
|
150
|
+
c.focused = !0, c.card.dataset.focused = "true";
|
|
151
|
+
},
|
|
152
|
+
onBlur: () => {
|
|
153
|
+
c.focused = !1, c.card.dataset.focused = "false";
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
s.addEventListener("click", c.onClick), s.addEventListener("focus", c.onFocus), s.addEventListener("blur", c.onBlur), o.appendChild(s), i.cards.set(a.occurrenceKey, c), i.resizeObserver?.observe(s), n = c;
|
|
157
|
+
}
|
|
158
|
+
let o = r.activeId === a.occurrenceKey;
|
|
159
|
+
n.onSetActive = r.onSetActive, (!n.painted || n.active !== o || !f(n.thread, a)) && h(n.card, a, {
|
|
160
|
+
active: o,
|
|
161
|
+
focused: n.focused,
|
|
162
|
+
interactive: !0
|
|
163
|
+
}), n.painted = !0, n.active = o, n.thread = a;
|
|
164
|
+
}
|
|
165
|
+
let c = n.map((e, t) => ({
|
|
166
|
+
thread: e,
|
|
167
|
+
index: t
|
|
168
|
+
})).sort((e, t) => (r.preferredTopById?.get(e.thread.occurrenceKey) ?? 0) - (r.preferredTopById?.get(t.thread.occurrenceKey) ?? 0) || e.index - t.index).map(({ thread: e }) => e).flatMap((e) => {
|
|
169
|
+
let t = i.cards.get(e.occurrenceKey);
|
|
170
|
+
return t ? [t.item] : [];
|
|
171
|
+
});
|
|
172
|
+
(c.length !== t.children.length || c.some((e, n) => t.children[n] !== e)) && t.replaceChildren(...c);
|
|
173
|
+
for (let e of i.cards.values()) e.item.style.cssText = `width:${r.logicalWidth}px;top:${e.committedTop * r.zoom}px;`;
|
|
174
|
+
let u = c[0]?.children[0], d = u && t.ownerDocument.defaultView?.getComputedStyle ? Number.parseFloat(t.ownerDocument.defaultView.getComputedStyle(u).marginBottom) : 0, m = p(n.map((e) => {
|
|
175
|
+
let t = i.cards.get(e.occurrenceKey);
|
|
176
|
+
return {
|
|
177
|
+
occurrenceKey: e.occurrenceKey,
|
|
178
|
+
preferredTop: (r.preferredTopById?.get(e.occurrenceKey) ?? 0) / r.zoom,
|
|
179
|
+
height: t?.card.getBoundingClientRect().height ?? 0
|
|
180
|
+
};
|
|
181
|
+
}), t.clientHeight / r.zoom, Number.isFinite(d) ? d : 0);
|
|
182
|
+
for (let e of i.cards.values()) e.committedTop = m.get(e.thread.occurrenceKey) ?? 0, e.item.style.top = `${e.committedTop * r.zoom}px`, e.item.style.transform = `scale(${r.zoom})`;
|
|
183
|
+
return new Map(n.flatMap((e) => {
|
|
184
|
+
let t = i.cards.get(e.occurrenceKey);
|
|
185
|
+
return t ? [[e.occurrenceKey, t.card]] : [];
|
|
186
|
+
}));
|
|
187
|
+
}
|
|
188
|
+
//#endregion
|
|
189
|
+
export { h as a, n as i, i as n, c as o, s as r, r as s, g as t };
|
package/dist/region-map.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Vt as e, Wt as t, a as n, n as r, t as i } from "./plot-area-frame-
|
|
2
|
-
import { t as a } from "./renderer-module-contract-
|
|
1
|
+
import { Vt as e, Wt as t, a as n, n as r, t as i } from "./plot-area-frame-DHV02PJU.js";
|
|
2
|
+
import { t as a } from "./renderer-module-contract-DLbb7zY0.js";
|
|
3
3
|
//#region packages/core/src/chart/region-map-natural-earth.generated.ts
|
|
4
4
|
var o = [
|
|
5
5
|
{
|
|
@@ -43,7 +43,7 @@ function a(e, t) {
|
|
|
43
43
|
return n = o.then(() => void 0, () => void 0), o;
|
|
44
44
|
}
|
|
45
45
|
async function o(e, t, n, r = {}) {
|
|
46
|
-
let { renderSlide: i } = await import("./session-
|
|
46
|
+
let { renderSlide: i } = await import("./session-Da7LEQUB.js").then((e) => e.t), o = t.slides[n];
|
|
47
47
|
if (!o) throw Error(`Slide index ${n} out of range`);
|
|
48
48
|
let s = r.width ?? 960, c = r.dpr ?? 2, l = r.fetchImage ?? (async () => new Blob([])), u = async () => {
|
|
49
49
|
await i(e, o, t.slideWidth, t.slideHeight, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region packages/pptx/src/render-worker.ts?worker&url
|
|
2
|
-
var e = "" + new URL("assets/render-worker-
|
|
2
|
+
var e = "" + new URL("assets/render-worker-aHayzR7v.js", import.meta.url).href;
|
|
3
3
|
//#endregion
|
|
4
4
|
//#region packages/pptx/src/render-worker-host.ts
|
|
5
5
|
function t() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region packages/xlsx/src/render-worker.ts?worker&url
|
|
2
|
-
var e = "" + new URL("assets/render-worker-
|
|
2
|
+
var e = "" + new URL("assets/render-worker-Dw_wQRIh.js", import.meta.url).href;
|
|
3
3
|
//#endregion
|
|
4
4
|
//#region packages/xlsx/src/render-worker-host.ts
|
|
5
5
|
function t() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region packages/docx/src/render-worker.ts?worker&url
|
|
2
|
-
var e = "" + new URL("assets/render-worker-
|
|
2
|
+
var e = "" + new URL("assets/render-worker-Cy-QsDge.js", import.meta.url).href;
|
|
3
3
|
//#endregion
|
|
4
4
|
//#region packages/docx/src/render-worker-host.ts
|
|
5
5
|
function t() {
|