@silurus/ooxml 0.79.0 → 0.80.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.
Files changed (49) hide show
  1. package/README.md +22 -15
  2. package/dist/assets/render-worker-BSx9_xRC.js +8 -0
  3. package/dist/assets/render-worker-BTp87EaD.js +21 -0
  4. package/dist/assets/render-worker-fdwAjSve.js +7 -0
  5. package/dist/{canvas-viewer-mechanics-D9tsuHnG.js → canvas-viewer-mechanics-D41tGY4d.js} +1 -1
  6. package/dist/{dash-Cyc-sevN.js → dash-CMzZIDz_.js} +87 -49
  7. package/dist/{document-pull-client-YiU8M4LO.js → document-pull-client-D-fnlVGf.js} +2247 -2254
  8. package/dist/{docx-a1UpmRf8.js → docx-CbIqgb1f.js} +108 -106
  9. package/dist/docx.mjs +4 -4
  10. package/dist/docx_parser_bg.wasm +0 -0
  11. package/dist/index.mjs +3 -3
  12. package/dist/line-distribute-DFdgzaLK.js +1002 -0
  13. package/dist/{line-metrics-DjKxiIUD.js → line-metrics-PpgpOvz4.js} +2774 -2524
  14. package/dist/math.mjs +34 -24
  15. package/dist/node.mjs +186 -186
  16. package/dist/{pptx-t5ABdzfd.js → pptx-DwF8olh2.js} +129 -127
  17. package/dist/pptx.mjs +5 -5
  18. package/dist/pptx_parser_bg.wasm +0 -0
  19. package/dist/region-map.mjs +75 -74
  20. package/dist/{render-BjIEuFIG.js → render-BMC4d1CO.js} +1 -1
  21. package/dist/render-worker-host-CcENRoDr.js +9 -0
  22. package/dist/render-worker-host-CzsHtsN_.js +9 -0
  23. package/dist/render-worker-host-DFgTN7hy.js +9 -0
  24. package/dist/renderer-module-contract-BNGz8HvO.js +30 -0
  25. package/dist/{resource-measurement-D8EiTm_E.js → resource-measurement-DvIKHd-9.js} +7 -7
  26. package/dist/{session-Bhe_eY-s.js → session-BzhcJOvj.js} +9 -9
  27. package/dist/{slide-pull-client-BQ8gJPTq.js → slide-pull-client-DLC3nJUt.js} +847 -861
  28. package/dist/three-d.mjs +828 -559
  29. package/dist/types/docx.d.ts +74 -8
  30. package/dist/types/index.d.ts +82 -12
  31. package/dist/types/math.d.ts +1 -1
  32. package/dist/types/node.d.ts +70 -2
  33. package/dist/types/pptx.d.ts +74 -8
  34. package/dist/types/region-map.d.ts +68 -2
  35. package/dist/types/three-d.d.ts +68 -2
  36. package/dist/types/xlsx.d.ts +78 -8
  37. package/dist/{worksheet-pull-client-T0EzdEEQ.js → worksheet-pull-client-DlVk_4Bt.js} +13 -13
  38. package/dist/{xlsx-CsDDMJIK.js → xlsx-C1BUns1R.js} +1387 -1252
  39. package/dist/xlsx.mjs +5 -5
  40. package/dist/xlsx_parser_bg.wasm +0 -0
  41. package/package.json +4 -1
  42. package/dist/line-distribute-pDqovJpT.js +0 -1002
  43. package/dist/render-worker-host-BB320snY.js +0 -27
  44. package/dist/render-worker-host-BjEPZBwf.js +0 -27
  45. package/dist/render-worker-host-hZ0o4OD7.js +0 -27
  46. /package/dist/{highlight-rect-cCvVU-MW.js → highlight-rect-BuX5rWP4.js} +0 -0
  47. /package/dist/{mathjax-Dqo857oC.js → mathjax-DgAl7Yi5.js} +0 -0
  48. /package/dist/{transfer-3QEJrsJa.js → transfer-CKZ79zFw.js} +0 -0
  49. /package/dist/{visible-index-CKvgpUrf.js → visible-index-BjesVGhg.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { on as e } from "./line-metrics-DjKxiIUD.js";
1
+ import { cn as e } from "./line-metrics-PpgpOvz4.js";
2
2
  //#region packages/core/src/errors/cfb-sniff.ts
3
3
  var t = [
4
4
  208,
@@ -332,29 +332,52 @@ function v(e, t, n, r) {
332
332
  }
333
333
  //#endregion
334
334
  //#region packages/core/src/units.ts
335
- var y = 12700, b = 9525, x = 4 / 3, S = 91440, C = 45720, w = "…";
335
+ var y = 12700, b = 9525, x = 4 / 3, S = 91440, C = 45720;
336
+ //#endregion
337
+ //#region packages/core/src/chart/axis-style.ts
338
+ function w(e, t) {
339
+ return e ? Math.max(.5, e / y) * t : 1;
340
+ }
336
341
  function T(e, t, n) {
342
+ return {
343
+ color: e ? `#${e}` : "#aaa",
344
+ width: w(t, n)
345
+ };
346
+ }
347
+ function E(e, t, n) {
348
+ return {
349
+ color: e ? `#${e}` : "#e0e0e0",
350
+ width: t ? w(t, n) : .5
351
+ };
352
+ }
353
+ function D(e) {
354
+ return e.catAxisCrossBetween !== "midCat";
355
+ }
356
+ //#endregion
357
+ //#region packages/core/src/chart/text-elide.ts
358
+ var O = "…";
359
+ function k(e, t, n) {
337
360
  if (t === "" || n <= 0) return "";
338
361
  if (e.measureText(t).width <= n) return t;
339
- if (e.measureText(w).width > n) return "";
362
+ if (e.measureText(O).width > n) return "";
340
363
  let r = 0, i = t.length - 1, a = 0;
341
364
  for (; r <= i;) {
342
365
  let o = r + i >> 1;
343
- e.measureText(t.slice(0, o) + w).width <= n ? (a = o, r = o + 1) : i = o - 1;
366
+ e.measureText(t.slice(0, o) + O).width <= n ? (a = o, r = o + 1) : i = o - 1;
344
367
  }
345
368
  let o = a > 0 ? t.charCodeAt(a - 1) : 0;
346
- return o >= 55296 && o <= 56319 && a--, t.slice(0, a) + w;
369
+ return o >= 55296 && o <= 56319 && a--, t.slice(0, a) + O;
347
370
  }
348
371
  //#endregion
349
372
  //#region packages/core/src/chart/rich-data-label.ts
350
- var E = 4096, D = 4, O = E;
351
- function k(e, t, r, i) {
373
+ var A = 4096, j = 4, M = A;
374
+ function N(e, t, r, i) {
352
375
  let a = [[]], o = 0, s = (e) => {
353
376
  if (!e) return null;
354
377
  let t = e.startsWith("#") ? e.slice(1) : e;
355
378
  return /^[0-9A-Fa-f]{6}([0-9A-Fa-f]{2})?$/.test(t) ? `#${t}` : null;
356
379
  };
357
- outer: for (let c = 0; c < t.runs.length && c < O; c++) {
380
+ outer: for (let c = 0; c < t.runs.length && c < M; c++) {
358
381
  let l = t.runs[c], u = n(l.fontSizeHpt, t.ptToPx) ?? r, d = l.fontFace?.trim().replaceAll("\"", ""), f = d && !d.startsWith("+") ? d : null, p = d && t.fontFamilyForFace ? t.fontFamilyForFace(d) : f ? `"${f}", Calibri, Arial, sans-serif` : t.fontFamily, m = `${l.bold ?? t.fallbackBold ? "bold " : ""}${u}px ${p}`, h = s(l.color) ?? i, g = "", _ = () => {
359
382
  g &&= (e.font = m, a[a.length - 1].push({
360
383
  text: g,
@@ -371,12 +394,12 @@ function k(e, t, r, i) {
371
394
  }
372
395
  v = !1;
373
396
  let t = e === "\r" ? "\n" : e;
374
- if (e === "\r" && (v = !0), o >= E) {
397
+ if (e === "\r" && (v = !0), o >= A) {
375
398
  _();
376
399
  break outer;
377
400
  }
378
401
  if (o++, t === "\n") {
379
- if (_(), a.length >= D) break outer;
402
+ if (_(), a.length >= j) break outer;
380
403
  a.push([]);
381
404
  } else g += t;
382
405
  }
@@ -392,7 +415,7 @@ function k(e, t, r, i) {
392
415
  height: c.reduce((e, t) => e + t, 0)
393
416
  };
394
417
  }
395
- function A(e, t, n, r, i = "center", a = "middle") {
418
+ function P(e, t, n, r, i = "center", a = "middle") {
396
419
  let o = a === "top" ? r : a === "bottom" ? r - t.height : r - t.height / 2;
397
420
  for (let r = 0; r < t.lines.length; r++) {
398
421
  let s = t.lines[r], c = t.lineWidths[r], l = i === "left" ? n : i === "right" ? n - c : n - c / 2, u = a === "top" ? o : a === "bottom" ? o + t.lineHeights[r] : o + t.lineHeights[r] / 2;
@@ -402,20 +425,35 @@ function A(e, t, n, r, i = "center", a = "middle") {
402
425
  }
403
426
  //#endregion
404
427
  //#region packages/core/src/chart/data-label-content.ts
405
- function j(e) {
428
+ function F(e) {
406
429
  if (e.customText) return e.customText;
407
430
  let n = [];
408
- return e.showCategory && e.category && n.push(e.category), e.showSeries && e.seriesName && n.push(e.seriesName), e.showValue && e.sourceValue != null && n.push(t(e.sourceValue, e.formatCode ?? null, e.date1904)), e.showPercent && e.percentRatio != null && n.push(t(e.percentRatio, e.percentFormatCode ?? e.formatCode ?? "0%", e.date1904)), n.filter((e) => e !== "").join(e.separator ?? e.defaultSeparator ?? " ");
431
+ if (e.showCategory && e.category && n.push(e.category), e.showSeries && e.seriesName && n.push(e.seriesName), e.showValue && e.sourceValue != null) {
432
+ let r = e.valueDivisor != null && Number.isFinite(e.valueDivisor) && e.valueDivisor > 0 ? e.valueDivisor : 1;
433
+ n.push(t(e.sourceValue / r, e.formatCode ?? null, e.date1904));
434
+ }
435
+ return e.showPercent && e.percentRatio != null && n.push(t(e.percentRatio, e.percentFormatCode ?? e.formatCode ?? "0%", e.date1904)), n.filter((e) => e !== "").join(e.separator ?? e.defaultSeparator ?? " ");
436
+ }
437
+ //#endregion
438
+ //#region packages/core/src/chart/legend-frame.ts
439
+ function I(e, t, n, r) {
440
+ if (!(!t.legendFillColor && !t.legendLineColor)) {
441
+ if (e.save(), t.legendFillColor && (e.fillStyle = `#${t.legendFillColor}`, e.fillRect(n.x, n.y, n.w, n.h)), t.legendLineColor && n.w > 0 && n.h > 0) {
442
+ let i = w(t.legendLineWidthEmu, r);
443
+ e.strokeStyle = `#${t.legendLineColor}`, e.lineWidth = i, e.lineCap = "butt", e.lineJoin = "miter", e.setLineDash([]), e.strokeRect(n.x + i / 2, n.y + i / 2, Math.max(0, n.w - i), Math.max(0, n.h - i));
444
+ }
445
+ e.restore();
446
+ }
409
447
  }
410
448
  //#endregion
411
449
  //#region packages/core/src/chart/data-label-layout.ts
412
- var M = (e) => [
450
+ var L = (e) => [
413
451
  e.x,
414
452
  e.y,
415
453
  e.w,
416
454
  e.h
417
455
  ].every(Number.isFinite) && e.w > 0 && e.h > 0;
418
- function N(e, t) {
456
+ function R(e, t) {
419
457
  let n = Math.max(e.x, t.x), r = Math.max(e.y, t.y), i = Math.min(e.x + e.w, t.x + t.w), a = Math.min(e.y + e.h, t.y + t.h);
420
458
  return i > n && a > r ? {
421
459
  x: n,
@@ -424,11 +462,11 @@ function N(e, t) {
424
462
  h: a - r
425
463
  } : null;
426
464
  }
427
- function P(e, t, n) {
465
+ function z(e, t, n) {
428
466
  return Math.min(Math.max(e, t), n);
429
467
  }
430
- function F(t, n, r, i, a, o = n) {
431
- if (!M(n) || !M(o) || !Number.isFinite(i) || i <= 0 || ![r.w, r.h].every(Number.isFinite) || r.w < 0 || r.h <= 0) return null;
468
+ function B(t, n, r, i, a, o = n) {
469
+ if (!L(n) || !L(o) || !Number.isFinite(i) || i <= 0 || ![r.w, r.h].every(Number.isFinite) || r.w < 0 || r.h <= 0) return null;
432
470
  let s = i * .5, c = n, l, u, d = !1, f = "center", p = "middle";
433
471
  if (t.kind === "point") {
434
472
  if (![
@@ -461,7 +499,7 @@ function F(t, n, r, i, a, o = n) {
461
499
  t.rect.w,
462
500
  t.rect.h
463
501
  ].every(Number.isFinite) || t.rect.w <= 0 || t.rect.h <= 0) return null;
464
- let e = N(t.rect, n);
502
+ let e = R(t.rect, n);
465
503
  if (!e) return null;
466
504
  let i = t.position ?? "ctr";
467
505
  l = e.x + e.w / 2, u = e.y + e.h / 2, i === "inBase" ? (c = {
@@ -509,7 +547,7 @@ function F(t, n, r, i, a, o = n) {
509
547
  ].every(Number.isFinite) || t.rect.w < 0 || t.rect.h < 0) return null;
510
548
  let e = t.position ?? "outEnd", i = e === "inBase" || e === "inEnd" || e === "ctr";
511
549
  if (d = !i, i) {
512
- let e = N(t.rect, n);
550
+ let e = R(t.rect, n);
513
551
  if (!e) return null;
514
552
  c = e;
515
553
  } else if (t.orientation === "vertical" && t.rect.w <= 0 || t.orientation === "horizontal" && t.rect.h <= 0) return null;
@@ -534,10 +572,10 @@ function F(t, n, r, i, a, o = n) {
534
572
  let t = e(a, o, g);
535
573
  if (!t) return null;
536
574
  g = t, f = "center", p = "middle";
537
- let r = N(t, n);
575
+ let r = R(t, n);
538
576
  if (!r || (c = r, c.w < m || c.h < h)) return null;
539
577
  }
540
- let _ = Math.min(Math.max(m, g.w), c.w), v = Math.min(Math.max(h, g.h), c.h), y = _ / 2, b = v / 2, x = d || a ? g.x + g.w / 2 : P(g.x + g.w / 2, c.x + y, c.x + c.w - y), S = d || a ? g.y + g.h / 2 : P(g.y + g.h / 2, c.y + b, c.y + c.h - b);
578
+ let _ = Math.min(Math.max(m, g.w), c.w), v = Math.min(Math.max(h, g.h), c.h), y = _ / 2, b = v / 2, x = d || a ? g.x + g.w / 2 : z(g.x + g.w / 2, c.x + y, c.x + c.w - y), S = d || a ? g.y + g.h / 2 : z(g.y + g.h / 2, c.y + b, c.y + c.h - b);
541
579
  return [x, S].every(Number.isFinite) ? {
542
580
  x: f === "left" ? x - y : f === "right" ? x + y : x,
543
581
  y: p === "top" ? S - b : p === "bottom" ? S + b : S,
@@ -549,8 +587,8 @@ function F(t, n, r, i, a, o = n) {
549
587
  rect: g
550
588
  } : null;
551
589
  }
552
- var I = 4096, L = 4;
553
- function R(e, t, n) {
590
+ var V = 4096, H = 4;
591
+ function U(e, t, n) {
554
592
  if (n(e) <= t) return e;
555
593
  if (n("…") > t) return "";
556
594
  let r = 0, i = Array.from(e), a = i.length;
@@ -560,10 +598,10 @@ function R(e, t, n) {
560
598
  }
561
599
  return `${i.slice(0, r).join("")}…`;
562
600
  }
563
- function z(e) {
601
+ function W(e) {
564
602
  let t = "", n = 0;
565
603
  for (let r of e) {
566
- if (n >= I) return {
604
+ if (n >= V) return {
567
605
  value: t,
568
606
  truncated: !0
569
607
  };
@@ -574,13 +612,13 @@ function z(e) {
574
612
  truncated: !1
575
613
  };
576
614
  }
577
- function B(e, t, n, r, i) {
615
+ function G(e, t, n, r, i) {
578
616
  if (![
579
617
  t,
580
618
  n,
581
619
  r
582
620
  ].every(Number.isFinite) || t <= 0 || n < r || r <= 0) return [];
583
- let a = Math.max(1, Math.min(L, Math.floor(n / r))), o = z(e), s = o.value.split(/\r?\n/), c = [], l = o.truncated, u = (e) => {
621
+ let a = Math.max(1, Math.min(H, Math.floor(n / r))), o = W(e), s = o.value.split(/\r?\n/), c = [], l = o.truncated, u = (e) => {
584
622
  let n = [], r = "";
585
623
  for (let a of Array.from(e)) {
586
624
  let e = `${r}${a}`;
@@ -611,14 +649,14 @@ function B(e, t, n, r, i) {
611
649
  }
612
650
  l ||= c.length > a;
613
651
  let d = c.slice(0, a);
614
- return l && d.length > 0 && !d[d.length - 1].endsWith("…") && (d[d.length - 1] = R(`${d[d.length - 1]}…`, t, i)), d;
652
+ return l && d.length > 0 && !d[d.length - 1].endsWith("…") && (d[d.length - 1] = U(`${d[d.length - 1]}…`, t, i)), d;
615
653
  }
616
654
  //#endregion
617
655
  //#region packages/core/src/draw/dash.ts
618
- function V(e, t) {
656
+ function K(e, t) {
619
657
  return e.map((e) => e * t);
620
658
  }
621
- var H = {
659
+ var q = {
622
660
  dotted: [1, 2],
623
661
  dashed: [3, 2],
624
662
  dashSmallGap: [3, 1],
@@ -643,11 +681,11 @@ var H = {
643
681
  2
644
682
  ]
645
683
  };
646
- function U(e, t) {
647
- let n = H[e];
648
- return n ? V(n, t) : [];
684
+ function J(e, t) {
685
+ let n = q[e];
686
+ return n ? K(n, t) : [];
649
687
  }
650
- var W = {
688
+ var Y = {
651
689
  hair: [1, 1],
652
690
  dashed: [4, 3],
653
691
  mediumDashed: [4, 3],
@@ -687,11 +725,11 @@ var W = {
687
725
  3
688
726
  ]
689
727
  };
690
- function G(e) {
691
- let t = W[e];
692
- return t ? V(t, 1) : [];
728
+ function X(e) {
729
+ let t = Y[e];
730
+ return t ? K(t, 1) : [];
693
731
  }
694
- var K = {
732
+ var Z = {
695
733
  dash: [6, 3],
696
734
  dot: [1.5, 3],
697
735
  dashDot: [
@@ -732,17 +770,17 @@ var K = {
732
770
  2
733
771
  ]
734
772
  };
735
- function q(e, t) {
736
- let n = K[e];
737
- return n ? V(n, t) : [];
773
+ function Q(e, t) {
774
+ let n = Z[e];
775
+ return n ? K(n, t) : [];
738
776
  }
739
- function J(e, t) {
740
- let n = q(e, t);
777
+ function $(e, t) {
778
+ let n = Q(e, t);
741
779
  if (n.length > 0) return n;
742
780
  let r = e.trim().split(/[\s,]+/).map(Number);
743
- return r.length >= 2 && r.every((e) => Number.isFinite(e) && e >= 0) && r.some((e) => e > 0) ? (r.length % 2 != 0 && r.pop(), V(r, t)) : [];
781
+ return r.length >= 2 && r.every((e) => Number.isFinite(e) && e >= 0) && r.some((e) => e > 0) ? (r.length % 2 != 0 && r.pop(), K(r, t)) : [];
744
782
  }
745
- var Y = {
783
+ var ee = {
746
784
  dotted: [1.5, 3],
747
785
  dottedHeavy: [1.5, 3],
748
786
  dash: [6, 3],
@@ -778,9 +816,9 @@ var Y = {
778
816
  3
779
817
  ]
780
818
  };
781
- function X(e, t) {
782
- let n = Y[e];
783
- return n ? V(n, t) : [];
819
+ function te(e, t) {
820
+ let n = ee[e];
821
+ return n ? K(n, t) : [];
784
822
  }
785
823
  //#endregion
786
- export { i as C, _ as S, g as T, x as _, G as a, r as b, F as c, k as d, T as f, b as g, y as h, J as i, j as l, C as m, q as n, z as o, S as p, X as r, B as s, U as t, A as u, a as v, p as w, v as x, o as y };
824
+ export { g as A, a as C, _ as D, v as E, i as O, x as S, r as T, E as _, X as a, y as b, B as c, P as d, N as f, T as g, D as h, $ as i, p as k, I as l, w as m, Q as n, W as o, k as p, te as r, G as s, J as t, F as u, S as v, o as w, b as x, C as y };