@silurus/ooxml 0.84.1 → 0.85.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.
Files changed (68) hide show
  1. package/README.md +44 -18
  2. package/dist/assets/render-worker-BRKOyWVH.js +24 -0
  3. package/dist/assets/render-worker-CtLMFj9r.js +10 -0
  4. package/dist/assets/render-worker-NZPOUOTU.js +11 -0
  5. package/dist/{canvas-viewer-mechanics-CIfhCgYA.js → canvas-viewer-mechanics-CfRzOhz5.js} +308 -234
  6. package/dist/chart-ex.mjs +270 -270
  7. package/dist/{comment-ui-runtime-CdMMApEN.js → comment-ui-runtime-CAbpuWi_.js} +4 -4
  8. package/dist/{comment-ui-runtime-C5qimVMD.js → comment-ui-runtime-DAKBCpsM.js} +5 -5
  9. package/dist/comment-ui-runtime-DTaaZdXC.js +2 -0
  10. package/dist/{comments-BAlAyIhb.js → comments-Brfxa3hQ.js} +1 -1
  11. package/dist/{document-pull-client-BXw6AAhY.js → document-pull-client-BkHHIdR4.js} +4661 -4357
  12. package/dist/{docx-BA1vB0V-.js → docx-_uelcAui.js} +338 -304
  13. package/dist/docx.mjs +7 -6
  14. package/dist/docx_parser_bg.wasm +0 -0
  15. package/dist/{dom-interaction-boundary-DS6BVyHA.js → dom-interaction-boundary-CMDDgICk.js} +1 -1
  16. package/dist/index.mjs +3 -3
  17. package/dist/line-distribute-CiKeWjBF.js +1023 -0
  18. package/dist/{line-metrics-CXyjyYd5.js → line-metrics-u87yCAfV.js} +2182 -705
  19. package/dist/math.mjs +2 -2
  20. package/dist/node.mjs +404 -394
  21. package/dist/pixel-budget-Dgjw269h.js +37 -0
  22. package/dist/{plot-area-frame-DuXZzovH.js → plot-area-frame-D5hEOgkJ.js} +691 -1418
  23. package/dist/{pptx-C17oBD8Z.js → pptx-WpBbS0mq.js} +255 -222
  24. package/dist/pptx.mjs +7 -6
  25. package/dist/pptx_parser_bg.wasm +0 -0
  26. package/dist/raster-target-whZhvVMt.js +87 -0
  27. package/dist/region-map.mjs +5 -5
  28. package/dist/{render-CVeGktZG.js → render-DrAAZWwH.js} +9 -6
  29. package/dist/{render-worker-host-BbhwA24Y.js → render-worker-host-CBVe8aeD.js} +1 -1
  30. package/dist/{render-worker-host-BWdhjVH_.js → render-worker-host-CHlwYJdK.js} +1 -1
  31. package/dist/{render-worker-host-CbaQivE7.js → render-worker-host-XDMsyVsv.js} +1 -1
  32. package/dist/{renderer-Bmky2yBc.js → renderer-XFSCOT6m.js} +1937 -1936
  33. package/dist/resource-measurement-6uR3Huao.js +150 -0
  34. package/dist/{session-Cl0RVnMs.js → session-DoPwA4gv.js} +79 -79
  35. package/dist/{slide-pull-client-BS0EeZo2.js → slide-pull-client-8i8C4VyD.js} +1054 -824
  36. package/dist/{three-d-B7LsKeOS.js → three-d-YYghQndN.js} +109 -110
  37. package/dist/three-d.mjs +726 -726
  38. package/dist/tiff.mjs +664 -78
  39. package/dist/types/chart-ex.d.ts +2 -2
  40. package/dist/types/docx.d.ts +31 -13
  41. package/dist/types/index.d.ts +46 -21
  42. package/dist/types/math.d.ts +1 -1
  43. package/dist/types/node.d.ts +11 -7
  44. package/dist/types/pptx.d.ts +35 -15
  45. package/dist/types/region-map.d.ts +2 -2
  46. package/dist/types/three-d.d.ts +2 -2
  47. package/dist/types/tiff.d.ts +13 -3
  48. package/dist/types/xlsx.d.ts +30 -13
  49. package/dist/{worksheet-pull-client-B0zfEVau.js → worksheet-pull-client-Btydoxto.js} +47 -47
  50. package/dist/{xlsx-FyKAiNo-.js → xlsx-Bd16V4Xx.js} +1395 -1196
  51. package/dist/xlsx.mjs +7 -6
  52. package/package.json +2 -2
  53. package/dist/assets/render-worker-BWPpayBu.js +0 -10
  54. package/dist/assets/render-worker-CiEWCh_T.js +0 -11
  55. package/dist/assets/render-worker-Cpmy3GDF.js +0 -24
  56. package/dist/comment-ui-runtime-aPzHfV_A.js +0 -2
  57. package/dist/line-distribute-MqInuujx.js +0 -1003
  58. package/dist/resource-measurement-esyGbzAF.js +0 -120
  59. package/dist/tiff-contract-Xjn3qXqK.js +0 -69
  60. /package/dist/{comment-occurrence-C34fWs_F.js → comment-occurrence-tj54AXXB.js} +0 -0
  61. /package/dist/{highlight-rect-MaCt0om0.js → highlight-rect-DBcYVJDv.js} +0 -0
  62. /package/dist/{mathjax-DPEX346v.js → mathjax-DS69BmJd.js} +0 -0
  63. /package/dist/{read-only-comment-decoration-BYCXoSdC.js → read-only-comment-decoration-Mv_SAiHy.js} +0 -0
  64. /package/dist/{read-only-comment-margin-C7b3l0ro.js → read-only-comment-margin-Cqu-Ir0C.js} +0 -0
  65. /package/dist/{renderer-module-contract-C6sYZvTV.js → renderer-module-contract-Cu-GKuPd.js} +0 -0
  66. /package/dist/{source-key-DORuuFb-.js → source-key-BkBB3X82.js} +0 -0
  67. /package/dist/{transfer-vNOFQuvv.js → transfer-mIj7E7NB.js} +0 -0
  68. /package/dist/{visible-index-DwJzuGmJ.js → visible-index-DPoQYSDt.js} +0 -0
package/dist/pptx.mjs CHANGED
@@ -1,6 +1,7 @@
1
- import { u as e } from "./slide-pull-client-BS0EeZo2.js";
2
- import { Qt as t, Zt as n, a as r } from "./line-metrics-CXyjyYd5.js";
3
- import { w as i } from "./canvas-viewer-mechanics-CIfhCgYA.js";
4
- import { o as a, s as o } from "./tiff-contract-Xjn3qXqK.js";
5
- import { a as s, i as c, n as l, o as u, r as d, s as f } from "./pptx-C17oBD8Z.js";
6
- export { a as OoxmlDecodedImageLimitError, n as OoxmlError, t 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 };
1
+ import { u as e } from "./slide-pull-client-8i8C4VyD.js";
2
+ import { a as t, on as n, sn as r } from "./line-metrics-u87yCAfV.js";
3
+ import { T as i } from "./canvas-viewer-mechanics-CfRzOhz5.js";
4
+ import { l as a, s as o } from "./pixel-budget-Dgjw269h.js";
5
+ import { i as s, s as c } from "./raster-target-whZhvVMt.js";
6
+ import { a as l, i as u, n as d, o as f, r as p, s as m } from "./pptx-WpBbS0mq.js";
7
+ export { o as OoxmlDecodedImageLimitError, n as OoxmlError, r as OoxmlResourceLimitError, l as PptxPresentation, d as PptxScrollViewer, p as PptxViewer, s as TiffDecodeError, i as autoResize, f as buildPptxHighlightLayer, m as buildPptxTextLayer, a as isOoxmlDecodedImageLimitError, c as isTiffDecodeError, t as openExternalHyperlink, u as readPptxTextSelectionContext, e as renderSlide };
Binary file
@@ -0,0 +1,87 @@
1
+ //#region packages/core/src/image/tiff-contract.ts
2
+ var e = class e extends Error {
3
+ code = "ooxml-tiff-decode";
4
+ constructor(t, n) {
5
+ super(t, n), this.name = "TiffDecodeError", Object.setPrototypeOf(this, e.prototype);
6
+ }
7
+ };
8
+ function t(e) {
9
+ if (!(typeof e != "object" || !e)) try {
10
+ let t = e, n = t.code, r = t.message;
11
+ return n === "ooxml-tiff-decode" && typeof r == "string" ? { message: r } : void 0;
12
+ } catch {
13
+ return;
14
+ }
15
+ }
16
+ function n(e) {
17
+ if (!t(e)) return !1;
18
+ try {
19
+ return typeof e.name == "string";
20
+ } catch {
21
+ return !1;
22
+ }
23
+ }
24
+ function r(e) {
25
+ if (e.length < 4) return !1;
26
+ let t = e[0] === 73 && e[1] === 73, n = e[0] === 77 && e[1] === 77;
27
+ return !t && !n ? !1 : new DataView(e.buffer, e.byteOffset, e.byteLength).getUint16(2, t) === 42;
28
+ }
29
+ function i(e) {
30
+ if (!r(e) || e.length < 8) return null;
31
+ let t = e[0] === 73, n = new DataView(e.buffer, e.byteOffset, e.byteLength), i = (e, t) => Number.isSafeInteger(e) && e >= 0 && t >= 0 && e <= n.byteLength - t, a = n.getUint32(4, t);
32
+ if (!i(a, 2)) return null;
33
+ let o = n.getUint16(a, t);
34
+ if (!i(a + 2, o * 12 + 4)) return null;
35
+ let s, c;
36
+ for (let e = 0; e < o; e++) {
37
+ let r = a + 2 + e * 12, i = n.getUint16(r, t);
38
+ if (i !== 256 && i !== 257) continue;
39
+ let o = n.getUint16(r + 2, t);
40
+ if (n.getUint32(r + 4, t) !== 1 || o !== 1 && o !== 3 && o !== 4) return null;
41
+ let l = o === 1 ? n.getUint8(r + 8) : o === 3 ? n.getUint16(r + 8, t) : n.getUint32(r + 8, t);
42
+ i === 256 ? s = l : c = l;
43
+ }
44
+ return s === void 0 || c === void 0 ? null : {
45
+ width: s,
46
+ height: c
47
+ };
48
+ }
49
+ //#endregion
50
+ //#region packages/core/src/image/raster-target.ts
51
+ function a(e) {
52
+ return typeof e == "number" && Number.isFinite(e) && e > 0 ? e : void 0;
53
+ }
54
+ function o(e, t, n, r = !1) {
55
+ if (!Number.isFinite(e.width) || !Number.isFinite(e.height) || !(e.width > 0) || !(e.height > 0)) return null;
56
+ let i = a(t), o = a(n);
57
+ if ((r ? i === void 0 && o === void 0 : i === void 0 || o === void 0) || i !== void 0 && !(i < e.width) || o !== void 0 && !(o < e.height)) return null;
58
+ let s = i === void 0 ? 0 : i / e.width, c = o === void 0 ? 0 : o / e.height, l, u;
59
+ if (i !== void 0 && s >= c) l = Math.max(1, Math.ceil(i)), u = Math.max(1, Math.ceil(e.height * l / e.width));
60
+ else if (o !== void 0) u = Math.max(1, Math.ceil(o)), l = Math.max(1, Math.ceil(e.width * u / e.height));
61
+ else return null;
62
+ return l < e.width && u < e.height ? {
63
+ width: l,
64
+ height: u
65
+ } : null;
66
+ }
67
+ function s(e, t, n, r = !1) {
68
+ let i = o(e, t, n, r);
69
+ if (!i) return null;
70
+ let a = i.width;
71
+ return {
72
+ width: a,
73
+ height: Math.min(e.height, Math.max(1, Math.ceil(e.height * a / e.width)))
74
+ };
75
+ }
76
+ function c(e, t, n, r) {
77
+ let i = s({
78
+ width: e,
79
+ height: t
80
+ }, n, r, !0);
81
+ return i ? {
82
+ resizeWidth: i.width,
83
+ resizeQuality: "high"
84
+ } : void 0;
85
+ }
86
+ //#endregion
87
+ export { t as a, i as c, e as i, s as n, r as o, c as r, n as s, o as t };
@@ -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-DuXZzovH.js";
2
- import { t as a } from "./renderer-module-contract-C6sYZvTV.js";
1
+ import { Kt as e, Ut as t, a as n, n as r, t as i } from "./plot-area-frame-D5hEOgkJ.js";
2
+ import { t as a } from "./renderer-module-contract-Cu-GKuPd.js";
3
3
  //#region packages/core/src/chart/region-map-natural-earth.generated.ts
4
4
  var o = [
5
5
  {
@@ -12651,19 +12651,19 @@ function N(n, a, s, c, l = 0) {
12651
12651
  if (f.geography?.cachePresent) return M(n, s, c, "(region map cache is unavailable offline)"), !0;
12652
12652
  let p = f.geography?.viewedRegionType;
12653
12653
  if (p != null && p !== "world") return M(n, s, c, "(region map detail is unavailable offline)"), !0;
12654
- let m = k(f), h = O([...m.values()], f.colors, a.chartexAccents?.[0]), g = e(a, s.h, c, .02, .015);
12654
+ let m = k(f), h = O([...m.values()], f.colors, a.chartexAccents?.[0]), g = t(a, s.h, c, .02, .015);
12655
12655
  A(n, a, s, g.fontPx, g.topPad);
12656
12656
  let _ = a.showLegend ? Math.max(32, s.h * .16) : 0, y = a.showLegend ? {
12657
12657
  x: s.x,
12658
12658
  y: s.y + g.bandH,
12659
12659
  w: s.w,
12660
12660
  h: _
12661
- } : null, b = y && a.legendManualLayout ? t(a.legendManualLayout, s, y) ?? y : y, x = a.legendOverlay === !0 ? 0 : _, S = s.w * .03, C = s.h * .035, w = {
12661
+ } : null, b = y && a.legendManualLayout ? e(a.legendManualLayout, s, y) ?? y : y, x = a.legendOverlay === !0 ? 0 : _, S = s.w * .03, C = s.h * .035, w = {
12662
12662
  x: s.x + S,
12663
12663
  y: s.y + g.bandH + x,
12664
12664
  w: Math.max(1, s.w - S * 2),
12665
12665
  h: Math.max(1, s.h - g.bandH - x - C)
12666
- }, T = a.plotAreaManualLayout ? t(a.plotAreaManualLayout, s, w) ?? w : w;
12666
+ }, T = a.plotAreaManualLayout ? e(a.plotAreaManualLayout, s, w) ?? w : w;
12667
12667
  i(n, a, T.x, T.y, T.w, T.h, c, l), b && (r(n, a, b, c, l), j(n, a, h, b.x, b.y, b.w, b.h, c));
12668
12668
  let E = f.geography?.projectionType, D = Infinity, N = Infinity, P = -Infinity, F = -Infinity;
12669
12669
  for (let e of o) for (let t of e.g) for (let e of t) for (let t of e) {
@@ -20,13 +20,16 @@ function r(e) {
20
20
  }
21
21
  function i(e) {
22
22
  let t = globalThis, n = t.createImageBitmap;
23
- return t.createImageBitmap = async (t) => {
23
+ return t.createImageBitmap = async (t, n) => {
24
24
  if (t && typeof t.getContext == "function") return t;
25
- let n;
26
- if (t instanceof Uint8Array || t instanceof ArrayBuffer) n = t;
27
- else if (typeof t.arrayBuffer == "function") n = await t.arrayBuffer();
25
+ let r;
26
+ if (t instanceof Uint8Array || t instanceof ArrayBuffer) r = t;
27
+ else if (typeof t.arrayBuffer == "function") r = await t.arrayBuffer();
28
28
  else throw Error("createImageBitmap shim: unsupported source type");
29
- return e.loadImage(n);
29
+ let i = n?.resizeWidth, a = n?.resizeHeight, o = typeof i == "number" && i > 0 ? { width: i } : typeof a == "number" && a > 0 ? { height: a } : void 0, s = await e.loadImage(r, o);
30
+ if (!o || o.width !== void 0 && s.width === o.width || o.height !== void 0 && s.height === o.height) return s;
31
+ let c = o.width === void 0 ? typeof o.height == "number" ? o.height / s.height : 1 : o.width / s.width, l = Math.max(1, Math.round(s.width * c)), u = Math.max(1, Math.round(s.height * c)), d = e.createCanvas(l, u), f = d.getContext("2d");
32
+ return typeof f.drawImage == "function" ? (f.drawImage(s, 0, 0, l, u), s.close?.(), d) : s;
30
33
  }, () => {
31
34
  t.createImageBitmap = n;
32
35
  };
@@ -43,7 +46,7 @@ function a(e, t) {
43
46
  return n = o.then(() => void 0, () => void 0), o;
44
47
  }
45
48
  async function o(e, t, n, r = {}) {
46
- let { renderSlide: i } = await import("./session-Cl0RVnMs.js").then((e) => e.t), o = t.slides[n];
49
+ let { renderSlide: i } = await import("./session-DoPwA4gv.js").then((e) => e.t), o = t.slides[n];
47
50
  if (!o) throw Error(`Slide index ${n} out of range`);
48
51
  let s = r.width ?? 960, c = r.dpr ?? 2, l = r.fetchImage ?? (async () => new Blob([])), u = async () => {
49
52
  await i(e, o, t.slideWidth, t.slideHeight, {
@@ -1,5 +1,5 @@
1
1
  //#region packages/docx/src/render-worker.ts?worker&url
2
- var e = "" + new URL("assets/render-worker-BWPpayBu.js", import.meta.url).href;
2
+ var e = "" + new URL("assets/render-worker-CtLMFj9r.js", import.meta.url).href;
3
3
  //#endregion
4
4
  //#region packages/docx/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-Cpmy3GDF.js", import.meta.url).href;
2
+ var e = "" + new URL("assets/render-worker-BRKOyWVH.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/pptx/src/render-worker.ts?worker&url
2
- var e = "" + new URL("assets/render-worker-CiEWCh_T.js", import.meta.url).href;
2
+ var e = "" + new URL("assets/render-worker-NZPOUOTU.js", import.meta.url).href;
3
3
  //#endregion
4
4
  //#region packages/pptx/src/render-worker-host.ts
5
5
  function t() {