@silurus/ooxml 0.89.6 → 0.89.8
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/assets/render-worker-Ck21oePL.js +16 -0
- package/dist/assets/render-worker-DJiGqgi0.js +15 -0
- package/dist/assets/render-worker-hPLJ82d2.js +35 -0
- package/dist/{bounded-raw-part-cache-B8t03tSP.js → bounded-raw-part-cache-B5a6cGKO.js} +1713 -1515
- package/dist/{canvas-viewer-mechanics-DI38gHNV.js → canvas-viewer-mechanics-BsqaoYgK.js} +2 -2
- package/dist/{cfb-guard-BIaHdonq.js → cfb-guard-DzYlucez.js} +1 -1
- package/dist/chart-ex.mjs +367 -367
- package/dist/{comment-overlay-controller-Crm5Syhx.js → comment-overlay-controller-B7AoyoDK.js} +18 -18
- package/dist/{comment-ui-runtime-hfewTmVJ.js → comment-ui-runtime-C5eWtZSW.js} +3 -3
- package/dist/{comment-ui-runtime-BfEPgl5r.js → comment-ui-runtime-CV0I9faV.js} +3 -3
- package/dist/{document-model-source-BUTSwkyP.js → document-model-source-90ext13g.js} +37 -37
- package/dist/{document-pull-client-C_D779tO.js → document-pull-client-DSYpUET2.js} +17525 -13847
- package/dist/{document-pull-worker-Bkewz-So.js → document-pull-worker-hMKJ5RdB.js} +14 -14
- package/dist/{docx-BfLZeiwa.js → docx-DCCDnwrG.js} +593 -593
- package/dist/{docx-BC2HQtjg.js → docx-G7pt7ajR.js} +33 -33
- package/dist/{docx-model-source-IjrOZgnl.js → docx-model-source-Beon3BD5.js} +6 -6
- package/dist/docx.mjs +4 -4
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/{drawingml-shape-BcXkRayC.js → drawingml-shape-B1_kg4BV.js} +55 -55
- package/dist/{duotone-BI7CoghW.js → duotone-GK4Hqn7f.js} +1 -1
- package/dist/{emf-DgUBx9BU.js → emf--QWY-UlT.js} +50 -50
- package/dist/{font-preload-demand-B6HPFxDp.js → font-preload-demand-NqcVKIpX.js} +2 -2
- package/dist/{grid-geometry-CqTDvpDr.js → grid-geometry-DpMAiSZb.js} +1 -1
- package/dist/{host-layout-measure-DJvccDI3.js → host-layout-measure-Z2fIsmDw.js} +1 -1
- package/dist/index.mjs +3 -3
- package/dist/internal-companion.mjs +2 -2
- package/dist/{line-distribute-DR9Qwd3u.js → line-distribute-CwtditQo.js} +31 -25
- package/dist/{model-source-DcI3vC00.js → model-source-Cch44xsb.js} +2 -2
- package/dist/{model-source-session-BlQWNyj2.js → model-source-session-ClNCRDOg.js} +21 -21
- package/dist/{model-source-session-D0LF49Ve.js → model-source-session-DRcqFGfM.js} +2 -2
- package/dist/{model-source-session-BCteVilS.js → model-source-session-DSABX94B.js} +2 -2
- package/dist/node.mjs +5 -5
- package/dist/{plot-area-frame-D3JtHvov.js → plot-area-frame-DNYMd9Pf.js} +1914 -1890
- package/dist/{pptx-SmjDGyub.js → pptx-C1CiFW1D.js} +35 -33
- package/dist/{pptx-CfCiVlNB.js → pptx-Ci1Y9SS_.js} +261 -259
- package/dist/{pptx-model-source-B2Irk68a.js → pptx-model-source-C9TuBisH.js} +18 -12
- package/dist/pptx-parsed-slides-BMGr4khe.js +8 -0
- package/dist/pptx.mjs +5 -5
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{presentation-model-source-DL6duh5l.js → presentation-model-source-3N7xLtmI.js} +6 -6
- package/dist/region-map.mjs +39 -39
- package/dist/{render-CMUEAeHp.js → render-Bf_Gywxw.js} +32 -30
- package/dist/{render-worker-host-CtlBbau5.js → render-worker-host-BZoh-wqR.js} +1 -1
- package/dist/{render-worker-host-D_0g-TQ2.js → render-worker-host-BmVeB_mR.js} +1 -1
- package/dist/{render-worker-host-DjBotZNL.js → render-worker-host-CVr53kg0.js} +1 -1
- package/dist/{renderer-IFuBkPvF.js → renderer-CCA_bQB8.js} +777 -707
- package/dist/renderer-DpTePxGq.js +5887 -0
- package/dist/{resource-measurement-D2bu0Qfx.js → resource-measurement-CfJtbwiR.js} +129 -129
- package/dist/{session-KIWcCCP2.js → session-DPXK_lpI.js} +64 -64
- package/dist/{slide-pull-client-BUuJQQVE.js → slide-pull-client-3g6TxaKa.js} +1421 -1421
- package/dist/{three-d-ByHGsYrX.js → three-d-BfMZVR0w.js} +98 -98
- package/dist/three-d.mjs +678 -678
- package/dist/types/chart-ex.d.ts +5 -2
- package/dist/types/docx.d.ts +29 -7
- package/dist/types/index.d.ts +34 -11
- package/dist/types/node.d.ts +27 -5
- package/dist/types/pptx.d.ts +11 -7
- package/dist/types/region-map.d.ts +5 -2
- package/dist/types/three-d.d.ts +5 -2
- package/dist/types/xlsx.d.ts +10 -7
- package/dist/{wasm-runtime-generation-BLweKv8r.js → wasm-runtime-generation-D97yoAXz.js} +17 -17
- package/dist/{workbook-model-source-DBfVsWj7.js → workbook-model-source-BHR8shXr.js} +6 -6
- package/dist/{worksheet-pull-client-Du0MuIro.js → worksheet-pull-client-BudfclVl.js} +84 -84
- package/dist/{xlsx-CD1VeDIg.js → xlsx-7aY3Pbvh.js} +44 -44
- package/dist/{xlsx-CCMRAxPB.js → xlsx-DTtDjzFq.js} +299 -299
- package/dist/{xlsx-model-source-udh7Q4WB.js → xlsx-model-source-DXKvb90T.js} +36 -36
- package/dist/xlsx.mjs +5 -5
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/assets/render-worker-B5HWxkbU.js +0 -16
- package/dist/assets/render-worker-Ba4LYMJd.js +0 -15
- package/dist/assets/render-worker-DkqinUC6.js +0 -35
- package/dist/renderer-xdugdcMd.js +0 -5769
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as e } from "./chunk-D5OxutzX.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { a as d, c as f, g as p, i as m, l as h, r as g } from "./document-pull-client-
|
|
2
|
+
import { wo as t } from "./plot-area-frame-DNYMd9Pf.js";
|
|
3
|
+
import { G as n, I as r, K as i, P as a, R as o, U as s, Xt as c, ft as l, lt as u } from "./bounded-raw-part-cache-B5a6cGKO.js";
|
|
4
|
+
import { a as d, c as f, g as p, i as m, l as h, r as g } from "./document-pull-client-DSYpUET2.js";
|
|
5
5
|
import { n as _, t as ee } from "./abort-JztSoyw2.js";
|
|
6
6
|
import { n as v, r as te, t as y } from "./wasm-loader-KAOyLXzf.js";
|
|
7
|
-
import { t as b } from "./wasm-runtime-generation-
|
|
7
|
+
import { t as b } from "./wasm-runtime-generation-D97yoAXz.js";
|
|
8
8
|
import { t as x } from "./in-process-pull-transport-BPJ7M0uC.js";
|
|
9
|
-
import { n as S, r as ne, t as re } from "./document-pull-worker-
|
|
10
|
-
import { a as ie } from "./render-
|
|
9
|
+
import { n as S, r as ne, t as re } from "./document-pull-worker-hMKJ5RdB.js";
|
|
10
|
+
import { a as ie } from "./render-Bf_Gywxw.js";
|
|
11
11
|
var C = /* @__PURE__ */ e({
|
|
12
12
|
DocxArchive: () => w,
|
|
13
13
|
default: () => q,
|
|
@@ -267,8 +267,8 @@ async function ce(e) {
|
|
|
267
267
|
return W = void 0, A = null, N = null, q(e);
|
|
268
268
|
}
|
|
269
269
|
var J = "DOCX document session was aborted", le = b(C, "DOCX");
|
|
270
|
-
async function Y(e, t, n,
|
|
271
|
-
let c =
|
|
270
|
+
async function Y(e, t, n, s) {
|
|
271
|
+
let c = r(n), l = new a({
|
|
272
272
|
enabled: c.debug || c.onResourceMetrics !== void 0,
|
|
273
273
|
format: "docx",
|
|
274
274
|
mode: "node",
|
|
@@ -281,8 +281,8 @@ async function Y(e, t, n, i) {
|
|
|
281
281
|
let u, d, f;
|
|
282
282
|
try {
|
|
283
283
|
_(n.signal, J);
|
|
284
|
-
let [
|
|
285
|
-
u = await le(t).open(() => new p(e,
|
|
284
|
+
let [r, i, a] = o(c.policy), p = w;
|
|
285
|
+
u = await le(t).open(() => new p(e, r, i, a), {
|
|
286
286
|
signal: n.signal,
|
|
287
287
|
abortError: () => ee(J),
|
|
288
288
|
disposeOnAbort: (e) => e.free()
|
|
@@ -295,7 +295,7 @@ async function Y(e, t, n, i) {
|
|
|
295
295
|
generation: 1
|
|
296
296
|
};
|
|
297
297
|
d.open(h), f = new x((e, t) => d?.dispatch(e, t), () => void 0);
|
|
298
|
-
let g, v = await
|
|
298
|
+
let g, v = await s(f, h, {
|
|
299
299
|
signal: n.signal,
|
|
300
300
|
onUsage: (e) => {
|
|
301
301
|
g = e, l.observeUsage(e);
|
|
@@ -313,7 +313,7 @@ async function Y(e, t, n, i) {
|
|
|
313
313
|
try {
|
|
314
314
|
u?.close((e) => e.free());
|
|
315
315
|
} catch {}
|
|
316
|
-
let t =
|
|
316
|
+
let t = i(e) ?? ne(e);
|
|
317
317
|
throw l.fail(t), t;
|
|
318
318
|
}
|
|
319
319
|
}
|
|
@@ -321,29 +321,29 @@ var X = "DOCX document session was aborted", Z = y(() => v(import.meta.url, "doc
|
|
|
321
321
|
async function ue(e, t) {
|
|
322
322
|
if (!t?.factory) throw TypeError("openDocxDocument requires a canvas factory");
|
|
323
323
|
if (t.legacyDoc !== void 0) {
|
|
324
|
-
let { openDocxSource: n } = await import("./docx-model-source-
|
|
324
|
+
let { openDocxSource: n } = await import("./docx-model-source-Beon3BD5.js");
|
|
325
325
|
return n(e, t, Z);
|
|
326
326
|
}
|
|
327
|
-
let
|
|
327
|
+
let r = c(t.cjkFallback), i = await Y($(e), Z(), t, (e, t, n) => g(e, t, n));
|
|
328
328
|
try {
|
|
329
329
|
_(t.signal, X);
|
|
330
|
-
let e = t.factory.createCanvas(1, 1),
|
|
331
|
-
cjkFallback:
|
|
330
|
+
let e = t.factory.createCanvas(1, 1), n = h(i.result, {
|
|
331
|
+
cjkFallback: r,
|
|
332
332
|
measureContext: e.getContext("2d"),
|
|
333
333
|
allowFootnoteContinuation: t.allowFootnoteContinuation !== !1
|
|
334
|
-
}), a = fe(t.currentDate), o = d(
|
|
335
|
-
return
|
|
334
|
+
}), a = fe(t.currentDate), o = d(i.result, n, a).layoutVariants.defaultLayout, s = new Q(i.closeArchive, i.archive, i.result, n, o, t.factory, a, i.usage, i.metrics, t.signal);
|
|
335
|
+
return i.metrics.observeUsage(s.resourceUsage), i.metrics.checkpoint("pagination ready"), s;
|
|
336
336
|
} catch (e) {
|
|
337
337
|
try {
|
|
338
|
-
|
|
338
|
+
i.closeArchive();
|
|
339
339
|
} catch {}
|
|
340
|
-
let t =
|
|
341
|
-
throw
|
|
340
|
+
let t = n(e) ?? e;
|
|
341
|
+
throw i.metrics.fail(t), t;
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
344
|
async function de(e, t = {}) {
|
|
345
345
|
if (t.legacyDoc !== void 0) {
|
|
346
|
-
let { materializeDocxSource: n } = await import("./docx-model-source-
|
|
346
|
+
let { materializeDocxSource: n } = await import("./docx-model-source-Beon3BD5.js");
|
|
347
347
|
return n(e, t, Z);
|
|
348
348
|
}
|
|
349
349
|
return te(async () => {
|
|
@@ -404,7 +404,7 @@ var Q = class {
|
|
|
404
404
|
}
|
|
405
405
|
refreshResourceUsage() {
|
|
406
406
|
try {
|
|
407
|
-
this.lastResourceUsage =
|
|
407
|
+
this.lastResourceUsage = s(this.archive.resource_usage()), this.metrics.observeUsage(this.lastResourceUsage);
|
|
408
408
|
} catch {}
|
|
409
409
|
return this.lastResourceUsage;
|
|
410
410
|
}
|
|
@@ -416,20 +416,20 @@ var Q = class {
|
|
|
416
416
|
[Symbol.asyncIterator]() {
|
|
417
417
|
return this.pages();
|
|
418
418
|
}
|
|
419
|
-
renderPage(e,
|
|
419
|
+
renderPage(e, r = {}) {
|
|
420
420
|
return this.closed ? Promise.reject(/* @__PURE__ */ Error("DOCX document session is closed")) : this.resourceFailure ? Promise.reject(this.resourceFailure) : (this.pageSize(e), this.enqueueRender(async () => {
|
|
421
421
|
_(this.signal, X);
|
|
422
|
-
let t = this.requireState(),
|
|
423
|
-
return await ie(this.factory, () => f(t.source,
|
|
424
|
-
...
|
|
422
|
+
let t = this.requireState(), n = this.factory.createCanvas(1, 1);
|
|
423
|
+
return await ie(this.factory, () => f(t.source, n, e, {
|
|
424
|
+
...r,
|
|
425
425
|
currentDate: this.defaultCurrentDateMs,
|
|
426
426
|
defaultCurrentDateMs: this.defaultCurrentDateMs,
|
|
427
427
|
layoutServices: t.services,
|
|
428
428
|
fetchImage: this.fetchImage
|
|
429
|
-
})), _(this.signal, X),
|
|
429
|
+
})), _(this.signal, X), n;
|
|
430
430
|
}).catch((e) => {
|
|
431
|
-
let
|
|
432
|
-
throw
|
|
431
|
+
let r = n(e) ?? e;
|
|
432
|
+
throw r instanceof t && (this.resourceFailure ??= r), this.metrics.fail(r), r;
|
|
433
433
|
}));
|
|
434
434
|
}
|
|
435
435
|
async *pages(e = {}) {
|
|
@@ -447,7 +447,7 @@ var Q = class {
|
|
|
447
447
|
};
|
|
448
448
|
}
|
|
449
449
|
} catch (e) {
|
|
450
|
-
throw t =
|
|
450
|
+
throw t = n(e) ?? e, t;
|
|
451
451
|
} finally {
|
|
452
452
|
try {
|
|
453
453
|
await this.close();
|
|
@@ -464,11 +464,11 @@ var Q = class {
|
|
|
464
464
|
return this.renderTail = t.then(() => void 0, () => void 0), t;
|
|
465
465
|
}
|
|
466
466
|
async release() {
|
|
467
|
-
await this.renderTail,
|
|
467
|
+
await this.renderTail, l(this.fetchImage), u(this.fetchImage), this.state = null;
|
|
468
468
|
try {
|
|
469
469
|
this.closeArchive();
|
|
470
470
|
} catch (e) {
|
|
471
|
-
let t =
|
|
471
|
+
let t = n(e) ?? e;
|
|
472
472
|
throw this.metrics.fail(t), t;
|
|
473
473
|
}
|
|
474
474
|
this.metrics.checkpoint("document session closed", this.lastResourceUsage), this.metrics.succeed({ pages: this.pageCount });
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as r, g as i, i as a, j as o, l as s, r as c } from "./document-pull-client-
|
|
1
|
+
import { G as e, K as t, Xt as n } from "./bounded-raw-part-cache-B5a6cGKO.js";
|
|
2
|
+
import { a as r, g as i, i as a, j as o, l as s, r as c } from "./document-pull-client-DSYpUET2.js";
|
|
3
3
|
import { r as l } from "./wasm-loader-KAOyLXzf.js";
|
|
4
|
-
import { r as u } from "./document-pull-worker-
|
|
5
|
-
import { i as d, t as f } from "./docx-
|
|
6
|
-
import { t as p } from "./model-source-
|
|
4
|
+
import { r as u } from "./document-pull-worker-hMKJ5RdB.js";
|
|
5
|
+
import { i as d, t as f } from "./docx-G7pt7ajR.js";
|
|
6
|
+
import { t as p } from "./model-source-Cch44xsb.js";
|
|
7
7
|
var m = class extends f {
|
|
8
8
|
constructor(...e) {
|
|
9
9
|
super(...e);
|
|
@@ -67,7 +67,7 @@ function _(e) {
|
|
|
67
67
|
return t;
|
|
68
68
|
}
|
|
69
69
|
async function v(e, n, r, i) {
|
|
70
|
-
let { acquireDocxSessionFromArchive: a, validateDocxModelSourceArchive: o, validateDocxModelSourceViewDefaults: s } = await import("./model-source-session-
|
|
70
|
+
let { acquireDocxSessionFromArchive: a, validateDocxModelSourceArchive: o, validateDocxModelSourceViewDefaults: s } = await import("./model-source-session-DSABX94B.js"), c = await p(e, "docx", {
|
|
71
71
|
...n,
|
|
72
72
|
source: n.legacyDoc
|
|
73
73
|
}, o, (e) => t(e) ?? u(e));
|
package/dist/docx.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as r, c as i, d as a, f as o, i as s, n as c, o as l, p as u, r as d, s as f } from "./docx-
|
|
1
|
+
import { Co as e, wo as t } from "./plot-area-frame-DNYMd9Pf.js";
|
|
2
|
+
import { p as n } from "./bounded-raw-part-cache-B5a6cGKO.js";
|
|
3
|
+
import { a as r, c as i, d as a, f as o, i as s, n as c, o as l, p as u, r as d, s as f } from "./docx-DCCDnwrG.js";
|
|
4
4
|
import { f as p, u as m } from "./pixel-budget-DI82Hn3R.js";
|
|
5
5
|
import { i as h, t as g } from "./tiff-contract-DEd8CGuz.js";
|
|
6
|
-
import { D as _ } from "./canvas-viewer-mechanics-
|
|
6
|
+
import { D as _ } from "./canvas-viewer-mechanics-BsqaoYgK.js";
|
|
7
7
|
export { i as DocxDocument, d as DocxScrollViewer, s as DocxViewer, m as OoxmlDecodedImageLimitError, e as OoxmlError, t as OoxmlResourceLimitError, g as TiffDecodeError, _ as autoResize, l as buildDocxHighlightLayer, f as buildDocxTextLayer, p as isOoxmlDecodedImageLimitError, h as isTiffDecodeError, c as noteText, n as openExternalHyperlink, r as readDocxTextSelectionContext, o as resolveCommentAnchorRuns, u as resolveDocxCommentThreads, a as resolveRevisionAnchorRuns };
|
package/dist/docx_parser_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ar as e, cr as t, fr as n, hr as r, or as i, pr as a, tr as o, vr as s } from "./plot-area-frame-
|
|
2
|
-
import { At as c,
|
|
1
|
+
import { ar as e, cr as t, fr as n, hr as r, or as i, pr as a, tr as o, vr as s } from "./plot-area-frame-DNYMd9Pf.js";
|
|
2
|
+
import { At as c, Et as l, Ft as u, Gt as d, Ht as f, Kt as p, Mt as m, Nt as h, Pt as g, Rt as _, Tt as v, Ut as y, Wt as b, jt as x, qt as S, zt as C } from "./bounded-raw-part-cache-B5a6cGKO.js";
|
|
3
3
|
var w = new Set([
|
|
4
4
|
"line",
|
|
5
5
|
"straightconnector1",
|
|
@@ -38,31 +38,31 @@ function D(e) {
|
|
|
38
38
|
var O = 1;
|
|
39
39
|
function k(e, t, n = Infinity) {
|
|
40
40
|
let r = 0;
|
|
41
|
-
if (!(n === Infinity || Number.isSafeInteger(n) && n > 0)) throw new
|
|
41
|
+
if (!(n === Infinity || Number.isSafeInteger(n) && n > 0)) throw new f("Invalid DrawingML geometry budget");
|
|
42
42
|
let i = (e) => {
|
|
43
|
-
if (r += e, !Number.isSafeInteger(r) || r > n) throw new
|
|
44
|
-
}, { x: a, y: o, w: l, h:
|
|
43
|
+
if (r += e, !Number.isSafeInteger(r) || r > n) throw new f("DrawingML geometry work budget exceeded");
|
|
44
|
+
}, { x: a, y: o, w: l, h: _ } = e.rect;
|
|
45
45
|
if (![
|
|
46
46
|
t,
|
|
47
47
|
e.rect.x,
|
|
48
48
|
e.rect.y,
|
|
49
49
|
l,
|
|
50
|
-
|
|
50
|
+
_,
|
|
51
51
|
e.transform.rotationDeg
|
|
52
|
-
].every(Number.isFinite) || t < 0 || l < 0 ||
|
|
52
|
+
].every(Number.isFinite) || t < 0 || l < 0 || _ < 0) throw RangeError("Invalid DrawingML geometry frame");
|
|
53
53
|
i(1);
|
|
54
|
-
let
|
|
55
|
-
if (i(
|
|
56
|
-
let
|
|
57
|
-
|
|
54
|
+
let v = e.stroke;
|
|
55
|
+
if (i(v?.customDash?.length ?? 0), e.geometry.kind === "preset" && e.geometry.adjustments.some((e) => e !== null && !Number.isFinite(e))) throw RangeError("Non-finite DrawingML adjustment");
|
|
56
|
+
let y = v ? s(v, t) : null, b = [], k = [], A = (e, t, n, r = "nonzero") => {
|
|
57
|
+
b.push(Object.freeze({
|
|
58
58
|
path: e,
|
|
59
59
|
fill: t,
|
|
60
60
|
stroke: n,
|
|
61
61
|
fillRule: r
|
|
62
62
|
}));
|
|
63
63
|
}, j = (e, n, r, a) => {
|
|
64
|
-
if (!a || !
|
|
65
|
-
let o =
|
|
64
|
+
if (!a || !v) return;
|
|
65
|
+
let o = x(a, v, t, O, i);
|
|
66
66
|
if (o) {
|
|
67
67
|
if (![
|
|
68
68
|
e,
|
|
@@ -77,65 +77,65 @@ function k(e, t, n = Infinity) {
|
|
|
77
77
|
geometry: o
|
|
78
78
|
}));
|
|
79
79
|
}
|
|
80
|
-
}, M =
|
|
81
|
-
if (!(r > 0 || a > 0) || !
|
|
82
|
-
A(e, t,
|
|
80
|
+
}, M = v?.headEnd ? c(v.headEnd, v, t, O) : 0, N = v?.tailEnd ? c(v.tailEnd, v, t, O) : 0, P = (e, t, n, r, a) => {
|
|
81
|
+
if (!(r > 0 || a > 0) || !y) {
|
|
82
|
+
A(e, t, y, n);
|
|
83
83
|
return;
|
|
84
84
|
}
|
|
85
|
-
let o =
|
|
86
|
-
i(o.reduce((e, t) => e + 1 + t.args.length, 0)), t !== "none" && A(e, t, null, n), A(o, "none",
|
|
87
|
-
}, F =
|
|
85
|
+
let o = m(e, r, a);
|
|
86
|
+
i(o.reduce((e, t) => e + 1 + t.args.length, 0)), t !== "none" && A(e, t, null, n), A(o, "none", y, n);
|
|
87
|
+
}, F = d(i);
|
|
88
88
|
if (e.geometry.kind === "preset") {
|
|
89
89
|
i(e.geometry.adjustments.length);
|
|
90
|
-
let t = e.geometry.name.toLowerCase(), n = [...e.geometry.adjustments], r = E(t) && !!(
|
|
91
|
-
if (
|
|
92
|
-
let n = t ===
|
|
93
|
-
s && n && e.stroke ? P(e.path, e.fill, "nonzero", M, N) : A(e.path, e.fill, e.stroke && !(r && n) ?
|
|
90
|
+
let t = e.geometry.name.toLowerCase(), n = [...e.geometry.adjustments], r = E(t) && !!(v?.headEnd || v?.tailEnd), s = t.startsWith("curvedconnector"), c = C(t, l, _, n, i, a, o);
|
|
91
|
+
if (c) c.forEach((e, t) => {
|
|
92
|
+
let n = t === c.length - 1 && (e.fill === "none" || e.fill == null);
|
|
93
|
+
s && n && e.stroke ? P(e.path, e.fill, "nonzero", M, N) : A(e.path, e.fill, e.stroke && !(r && n) ? y : null);
|
|
94
94
|
});
|
|
95
95
|
else {
|
|
96
|
-
let e =
|
|
97
|
-
|
|
96
|
+
let e = d(i);
|
|
97
|
+
h(e.sink, t, a, o, l, _, n[0], n[1], n[2], n[3]), A(Object.freeze(e.commands), null, y, "nonzero");
|
|
98
98
|
}
|
|
99
|
-
if (
|
|
100
|
-
let e =
|
|
99
|
+
if (g(F.sink, e.geometry.name, a, o, l, _, n) || h(F.sink, e.geometry.name, a, o, l, _, n[0], n[1], n[2], n[3]), v && (w.has(t) || T.has(t))) {
|
|
100
|
+
let e = u(t, a, o, l, _, n);
|
|
101
101
|
if (e) {
|
|
102
102
|
if (r && e.vertices.length >= 2) {
|
|
103
|
-
let t =
|
|
103
|
+
let t = d(i), n = e.vertices;
|
|
104
104
|
t.sink.moveTo(n[0].x, n[0].y);
|
|
105
105
|
for (let e = 1; e < n.length; e++) t.sink.lineTo(n[e].x, n[e].y);
|
|
106
|
-
let r =
|
|
107
|
-
r.length >= 2 && A(r, "none",
|
|
106
|
+
let r = m(Object.freeze(t.commands), M, N);
|
|
107
|
+
r.length >= 2 && A(r, "none", y);
|
|
108
108
|
}
|
|
109
|
-
j(e.end.x, e.end.y, e.end.angle,
|
|
109
|
+
j(e.end.x, e.end.y, e.end.angle, v.tailEnd), j(e.start.x, e.start.y, e.start.angle, v.headEnd);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
} else {
|
|
113
113
|
let { subpaths: t } = e.geometry;
|
|
114
114
|
for (let e of t) i(e.length + 1);
|
|
115
|
-
let n = e.geometry.paint?.length === t.length ? e.geometry.paint : null, r =
|
|
115
|
+
let n = e.geometry.paint?.length === t.length ? e.geometry.paint : null, r = v && (M > 0 || N > 0) ? p(t) : null, s = r?.start ? M : 0, c = r?.end ? N : 0;
|
|
116
116
|
if (n) t.forEach((e, r) => {
|
|
117
|
-
let
|
|
118
|
-
|
|
119
|
-
let f = Object.freeze(
|
|
120
|
-
n[r].stroke === !1 ? A(f,
|
|
117
|
+
let u = d(i);
|
|
118
|
+
S(u.sink, [e], a, o, l, _);
|
|
119
|
+
let f = Object.freeze(u.commands), p = n[r].fill ?? null;
|
|
120
|
+
n[r].stroke === !1 ? A(f, p, null, n[r].fillRule) : P(f, p, n[r].fillRule ?? "nonzero", r === 0 ? s : 0, r === t.length - 1 ? c : 0);
|
|
121
121
|
});
|
|
122
122
|
else {
|
|
123
|
-
let e =
|
|
124
|
-
|
|
123
|
+
let e = d(i);
|
|
124
|
+
S(e.sink, t, a, o, l, _), P(Object.freeze(e.commands), null, "nonzero", s, c);
|
|
125
125
|
}
|
|
126
|
-
if (
|
|
127
|
-
let e =
|
|
128
|
-
e.start && j(a + e.start.x * l, o + e.start.y *
|
|
126
|
+
if (S(F.sink, n ? t.filter((e, t) => n[t].fill !== "none") : t, a, o, l, _), v) {
|
|
127
|
+
let e = p(t);
|
|
128
|
+
e.start && j(a + e.start.x * l, o + e.start.y * _, Math.atan2(e.start.dy * _, e.start.dx * l), v.headEnd), e.end && j(a + e.end.x * l, o + e.end.y * _, Math.atan2(e.end.dy * _, e.end.dx * l), v.tailEnd);
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
return Object.freeze({
|
|
132
132
|
width: l,
|
|
133
|
-
height:
|
|
133
|
+
height: _,
|
|
134
134
|
scale: t,
|
|
135
135
|
originX: a,
|
|
136
136
|
originY: o,
|
|
137
137
|
sourceKey: D(e),
|
|
138
|
-
paths: Object.freeze(
|
|
138
|
+
paths: Object.freeze(b),
|
|
139
139
|
arrows: Object.freeze(k),
|
|
140
140
|
fillSilhouette: Object.freeze(F.commands),
|
|
141
141
|
workUnits: r
|
|
@@ -154,9 +154,9 @@ function A(e, t) {
|
|
|
154
154
|
if (!n || n.width !== e.rect.w || n.height !== e.rect.h || n.scale !== t || n.sourceKey !== D(e)) throw RangeError("Missing or stale retained DrawingML geometry");
|
|
155
155
|
if (![n.originX, n.originY].every(Number.isFinite)) throw RangeError("Invalid retained DrawingML origin");
|
|
156
156
|
if (!Number.isSafeInteger(n.workUnits) || n.workUnits < 1 || !Array.isArray(n.paths) || !Array.isArray(n.arrows)) throw RangeError("Invalid retained DrawingML work/scheduling");
|
|
157
|
-
if (n.paths.length + n.arrows.length > n.workUnits) throw new
|
|
157
|
+
if (n.paths.length + n.arrows.length > n.workUnits) throw new f("Retained geometry scheduling exceeds its acquired work");
|
|
158
158
|
let r = 0, i = (e) => {
|
|
159
|
-
if (r += e, r > n.workUnits) throw new
|
|
159
|
+
if (r += e, r > n.workUnits) throw new f("Retained geometry paths exceed their acquired work");
|
|
160
160
|
}, a = (e) => {
|
|
161
161
|
if (!Number.isFinite(e.lineWidth) || e.lineWidth < 0 || !Number.isFinite(e.miterLimit) || e.miterLimit <= 0 || ![
|
|
162
162
|
"butt",
|
|
@@ -169,7 +169,7 @@ function A(e, t) {
|
|
|
169
169
|
].includes(e.lineJoin) || !Array.isArray(e.dash) || e.dash.length > n.workUnits || !e.dash.every((e) => Number.isFinite(e) && e >= 0)) throw RangeError("Invalid retained stroke geometry");
|
|
170
170
|
};
|
|
171
171
|
for (let e of n.paths) {
|
|
172
|
-
if (
|
|
172
|
+
if (b(e.path, i), e.fill !== null && ![
|
|
173
173
|
"norm",
|
|
174
174
|
"none",
|
|
175
175
|
"lighten",
|
|
@@ -180,14 +180,14 @@ function A(e, t) {
|
|
|
180
180
|
if (e.fillRule !== "nonzero" && e.fillRule !== "evenodd") throw RangeError("Invalid retained fill rule");
|
|
181
181
|
e.stroke && a(e.stroke);
|
|
182
182
|
}
|
|
183
|
-
|
|
183
|
+
b(n.fillSilhouette, i);
|
|
184
184
|
for (let e of n.arrows) {
|
|
185
185
|
if (![
|
|
186
186
|
e.tipX,
|
|
187
187
|
e.tipY,
|
|
188
188
|
e.angle
|
|
189
189
|
].every(Number.isFinite) || !["fill", "stroke"].includes(e.geometry.paint)) throw RangeError("Invalid retained arrow frame");
|
|
190
|
-
|
|
190
|
+
b(e.geometry.path, i), a(e.geometry.stroke);
|
|
191
191
|
}
|
|
192
192
|
return n;
|
|
193
193
|
}
|
|
@@ -263,7 +263,7 @@ function L(e, t, n) {
|
|
|
263
263
|
function R(e, t, n, r, i, a) {
|
|
264
264
|
let o = t.resolvedGeometry ? A(t, t.resolvedGeometry.scale) : k(t, 1);
|
|
265
265
|
if (i !== o.width || a !== o.height) throw RangeError("Retained DrawingML silhouette frame mismatch");
|
|
266
|
-
|
|
266
|
+
y(e, o.fillSilhouette, n - o.originX, r - o.originY);
|
|
267
267
|
}
|
|
268
268
|
function z(e, t) {
|
|
269
269
|
let { x: n, y: r, w: i, h: a } = t.rect;
|
|
@@ -281,15 +281,15 @@ function V(e, n, r) {
|
|
|
281
281
|
resolvedGeometry: o
|
|
282
282
|
};
|
|
283
283
|
t(n.stroke?.fill) && (e = a(e));
|
|
284
|
-
let { x: c, y:
|
|
284
|
+
let { x: c, y: u, w: d, h: f } = n.rect;
|
|
285
285
|
L(e, n, () => {
|
|
286
|
-
let t = i(n.fill, e, c,
|
|
286
|
+
let t = i(n.fill, e, c, u, d, f, n.transform.rotationDeg, I, void 0, (e, t, n, r, i) => R(e, s, t, n, r, i)), a = n.stroke;
|
|
287
287
|
for (let r of o.paths) {
|
|
288
|
-
if (e.beginPath(),
|
|
288
|
+
if (e.beginPath(), y(e, r.path, c - o.originX, u - o.originY), t && r.fill !== "none") {
|
|
289
289
|
e.save();
|
|
290
290
|
try {
|
|
291
291
|
e.fillStyle = t, r.fillRule === "evenodd" ? e.fill("evenodd") : e.fill();
|
|
292
|
-
let n =
|
|
292
|
+
let n = _(r.fill);
|
|
293
293
|
n && (e.fillStyle = n, r.fillRule === "evenodd" ? e.fill("evenodd") : e.fill());
|
|
294
294
|
} finally {
|
|
295
295
|
e.restore();
|
|
@@ -298,8 +298,8 @@ function V(e, n, r) {
|
|
|
298
298
|
a && r.stroke && (B(e, a, r.stroke, n.rect, n.transform.rotationDeg), e.stroke());
|
|
299
299
|
}
|
|
300
300
|
if (a) for (let t of o.arrows) {
|
|
301
|
-
let i = c - o.originX + t.tipX, s =
|
|
302
|
-
|
|
301
|
+
let i = c - o.originX + t.tipX, s = u - o.originY + t.tipY;
|
|
302
|
+
v(e, i, s, t.angle, t.geometry, a, l(e, a, r, I, i, s, t.angle, t.end, n.rect, n.transform.rotationDeg, I));
|
|
303
303
|
}
|
|
304
304
|
});
|
|
305
305
|
}
|