ooxml-core 1.41.0 → 1.43.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 (166) hide show
  1. package/README.md +4 -0
  2. package/dist/{PptxHandler-3AGIITR7.mjs → PptxHandler-3VAVJDFB.mjs} +2 -2
  3. package/dist/PptxHandler-V23RDNEX.cjs +14 -0
  4. package/dist/PptxHandler-WB3KL2WH.mjs +5 -0
  5. package/dist/{PresentationBuilder-JNID4B4Z.mjs → PresentationBuilder-7LJMTRJ6.mjs} +2 -2
  6. package/dist/{PresentationBuilder-MZBKYOYD.cjs → PresentationBuilder-KHL6GONR.cjs} +6 -6
  7. package/dist/{PresentationBuilder-5DPKFUXP.mjs → PresentationBuilder-PY2GB4IG.mjs} +3 -3
  8. package/dist/automation/index.cjs +79 -91
  9. package/dist/automation/index.mjs +79 -91
  10. package/dist/chart/index.cjs +12 -9
  11. package/dist/chart/index.mjs +12 -9
  12. package/dist/{chunk-ZYCBJKAE.mjs → chunk-243ZYX2B.mjs} +1 -1
  13. package/dist/{chunk-LRBWCRQ3.cjs → chunk-3J6VIKLP.cjs} +3 -3
  14. package/dist/{chunk-DD7COXWR.mjs → chunk-4LEVL6ZW.mjs} +30 -13
  15. package/dist/chunk-CODMW5KF.cjs +110 -0
  16. package/dist/{chunk-HTELXT2N.mjs → chunk-HLYOHD2Z.mjs} +30 -12
  17. package/dist/{chunk-P3WAKBVS.mjs → chunk-IPV3J3I5.mjs} +82 -90
  18. package/dist/{chunk-6LGRRQ3K.mjs → chunk-JHYU7HGG.mjs} +1 -1
  19. package/dist/{chunk-JXR6YWBW.mjs → chunk-KCDLTVUI.mjs} +125 -126
  20. package/dist/chunk-O3YGBYGZ.mjs +104 -0
  21. package/dist/{chunk-75KBNUKS.cjs → chunk-QZPOPUI5.cjs} +82 -89
  22. package/dist/{chunk-3BIFRTU4.cjs → chunk-RNZQ2OU4.cjs} +1294 -1276
  23. package/dist/{chunk-UE23HF2N.mjs → chunk-VKFKEVHK.mjs} +1 -1
  24. package/dist/{chunk-KKVD3R6O.mjs → chunk-WEAWSXUX.mjs} +4 -4
  25. package/dist/diagram/index.cjs +499 -370
  26. package/dist/diagram/index.d.ts +1 -0
  27. package/dist/diagram/index.d.ts.map +1 -1
  28. package/dist/diagram/index.mjs +495 -371
  29. package/dist/docx/embedded.cjs +67 -89
  30. package/dist/docx/embedded.mjs +67 -89
  31. package/dist/docx/index.cjs +125 -110
  32. package/dist/docx/index.mjs +125 -110
  33. package/dist/docx/layout/index.cjs +257 -110
  34. package/dist/docx/layout/index.d.ts +1 -0
  35. package/dist/docx/layout/index.d.ts.map +1 -1
  36. package/dist/docx/layout/index.mjs +257 -111
  37. package/dist/docx/layout/webfont-runs.d.ts +5 -0
  38. package/dist/docx/layout/webfont-runs.d.ts.map +1 -0
  39. package/dist/docx/load/index.cjs +67 -89
  40. package/dist/docx/load/index.mjs +67 -89
  41. package/dist/docx/shape-svg.d.ts.map +1 -1
  42. package/dist/docx/ui/index.cjs +79 -98
  43. package/dist/docx/ui/index.mjs +79 -98
  44. package/dist/drawingml/dash-pattern.d.ts +61 -0
  45. package/dist/drawingml/dash-pattern.d.ts.map +1 -0
  46. package/dist/drawingml/index.cjs +249 -43
  47. package/dist/drawingml/index.d.ts +3 -0
  48. package/dist/drawingml/index.d.ts.map +1 -1
  49. package/dist/drawingml/index.mjs +241 -44
  50. package/dist/drawingml/rect-path-gradient.d.ts +5 -0
  51. package/dist/drawingml/rect-path-gradient.d.ts.map +1 -1
  52. package/dist/drawingml/shape-path-gradient.d.ts +57 -0
  53. package/dist/drawingml/shape-path-gradient.d.ts.map +1 -0
  54. package/dist/geometry/index.cjs +68 -90
  55. package/dist/geometry/index.mjs +68 -90
  56. package/dist/geometry/preset-shape-definitions-exact-action-buttons.d.ts +2 -2
  57. package/dist/geometry/preset-shape-definitions-exact-action-buttons.d.ts.map +1 -1
  58. package/dist/geometry/preset-shape-definitions-exact-arrows.d.ts.map +1 -1
  59. package/dist/geometry/preset-shape-definitions-exact-scrolls.d.ts.map +1 -1
  60. package/dist/index.cjs +2937 -493
  61. package/dist/index.mjs +2937 -493
  62. package/dist/pptx/automation/index.cjs +366 -197
  63. package/dist/pptx/automation/index.d.ts +11 -17
  64. package/dist/pptx/automation/index.d.ts.map +1 -1
  65. package/dist/pptx/automation/index.mjs +156 -71
  66. package/dist/pptx/chunks/{elements-6BMEOo7i.d.ts → elements-PBugbKtv.d.ts} +3 -873
  67. package/dist/pptx/chunks/elements-PBugbKtv.d.ts.map +1 -0
  68. package/dist/pptx/chunks/{index-BbXLv6As.d.ts → index-Bj-hur0D.d.ts} +4 -4
  69. package/dist/pptx/chunks/{index-BbXLv6As.d.ts.map → index-Bj-hur0D.d.ts.map} +1 -1
  70. package/dist/pptx/chunks/{index-DvN0TkJJ.d.ts → index-CCJiD-Bm.d.ts} +14 -10
  71. package/dist/pptx/chunks/index-CCJiD-Bm.d.ts.map +1 -0
  72. package/dist/pptx/chunks/{index-Dija_Wth.d.ts → index-CGNb1TV9.d.ts} +22 -4
  73. package/dist/pptx/chunks/index-CGNb1TV9.d.ts.map +1 -0
  74. package/dist/pptx/chunks/table-C7ITXL3Y.d.ts +875 -0
  75. package/dist/pptx/chunks/table-C7ITXL3Y.d.ts.map +1 -0
  76. package/dist/pptx/chunks/{text-operations-DorONr3h.d.ts → text-operations-BNJr7aGa.d.ts} +3 -2
  77. package/dist/pptx/chunks/text-operations-BNJr7aGa.d.ts.map +1 -0
  78. package/dist/pptx/cli/index.cjs +180 -102
  79. package/dist/pptx/cli/index.d.ts +1 -1
  80. package/dist/pptx/cli/index.mjs +4 -4
  81. package/dist/pptx/converter/index.cjs +69 -91
  82. package/dist/pptx/converter/index.d.ts +1 -1
  83. package/dist/pptx/converter/index.mjs +2 -2
  84. package/dist/pptx/editor/render/custom-show-operations.cjs +2 -2
  85. package/dist/pptx/editor/render/custom-show-operations.mjs +1 -1
  86. package/dist/pptx/editor/render/find-replace.cjs +15 -15
  87. package/dist/pptx/editor/render/find-replace.d.ts +2 -2
  88. package/dist/pptx/editor/render/find-replace.mjs +2 -2
  89. package/dist/pptx/editor/render/slide-operations.cjs +9 -9
  90. package/dist/pptx/editor/render/slide-operations.mjs +3 -3
  91. package/dist/pptx/editor/render/table-data-grid-ops.cjs +5 -5
  92. package/dist/pptx/editor/render/table-data-grid-ops.mjs +1 -1
  93. package/dist/pptx/editor/render/table-layout.cjs +6 -6
  94. package/dist/pptx/editor/render/table-layout.d.ts +8 -37
  95. package/dist/pptx/editor/render/table-layout.d.ts.map +1 -1
  96. package/dist/pptx/editor/render/table-layout.mjs +1 -1
  97. package/dist/pptx/editor/render/text-runs-style-patch.d.ts +1 -1
  98. package/dist/pptx/editor/render/text-style-scope.d.ts +1 -1
  99. package/dist/pptx/index.cjs +225 -135
  100. package/dist/pptx/index.d.ts +6 -5
  101. package/dist/pptx/index.mjs +5 -5
  102. package/dist/pptx/node/index.d.ts +1 -1
  103. package/dist/teams/index.cjs +136 -91
  104. package/dist/teams/index.mjs +136 -91
  105. package/dist/text/css-font-family.d.ts.map +1 -1
  106. package/dist/text/font-metrics/design-advances.generated.d.ts +3 -1
  107. package/dist/text/font-metrics/design-advances.generated.d.ts.map +1 -1
  108. package/dist/text/index.cjs +2252 -0
  109. package/dist/text/index.d.ts +1 -0
  110. package/dist/text/index.d.ts.map +1 -1
  111. package/dist/text/index.mjs +2231 -1
  112. package/dist/text/metric-font-family.d.ts.map +1 -1
  113. package/dist/text/webfonts/font-weight-names.d.ts +66 -0
  114. package/dist/text/webfonts/font-weight-names.d.ts.map +1 -0
  115. package/dist/text/webfonts/google-fonts-catalogue.d.ts +14 -0
  116. package/dist/text/webfonts/google-fonts-catalogue.d.ts.map +1 -0
  117. package/dist/text/webfonts/google-fonts-lookup.d.ts +7 -0
  118. package/dist/text/webfonts/google-fonts-lookup.d.ts.map +1 -0
  119. package/dist/text/webfonts/google-fonts-request.d.ts +57 -0
  120. package/dist/text/webfonts/google-fonts-request.d.ts.map +1 -0
  121. package/dist/text/webfonts/index.d.ts +12 -0
  122. package/dist/text/webfonts/index.d.ts.map +1 -0
  123. package/dist/text/webfonts/metric-clones.d.ts +17 -0
  124. package/dist/text/webfonts/metric-clones.d.ts.map +1 -0
  125. package/dist/text/webfonts/webfont-faces.d.ts +24 -0
  126. package/dist/text/webfonts/webfont-faces.d.ts.map +1 -0
  127. package/dist/visio/index.cjs +64 -0
  128. package/dist/visio/index.d.ts +1 -0
  129. package/dist/visio/index.d.ts.map +1 -1
  130. package/dist/visio/index.mjs +64 -1
  131. package/dist/visio/ui/index.cjs +8 -0
  132. package/dist/visio/ui/index.mjs +8 -0
  133. package/dist/visio/webfont-runs.d.ts +27 -0
  134. package/dist/visio/webfont-runs.d.ts.map +1 -0
  135. package/dist/xlsx/collab/index.cjs +67 -89
  136. package/dist/xlsx/collab/index.mjs +67 -89
  137. package/dist/xlsx/index.cjs +2253 -118
  138. package/dist/xlsx/index.mjs +2249 -119
  139. package/dist/xlsx/layout/font-stack.d.ts +8 -0
  140. package/dist/xlsx/layout/font-stack.d.ts.map +1 -0
  141. package/dist/xlsx/layout/index.d.ts +3 -1
  142. package/dist/xlsx/layout/index.d.ts.map +1 -1
  143. package/dist/xlsx/layout/shape-paint.d.ts.map +1 -1
  144. package/dist/xlsx/layout/shape-view.d.ts.map +1 -1
  145. package/dist/xlsx/layout/style-view.d.ts +2 -0
  146. package/dist/xlsx/layout/style-view.d.ts.map +1 -1
  147. package/dist/xlsx/layout/webfont-runs.d.ts +11 -0
  148. package/dist/xlsx/layout/webfont-runs.d.ts.map +1 -0
  149. package/dist/xlsx/load/index.cjs +67 -89
  150. package/dist/xlsx/load/index.mjs +67 -89
  151. package/dist/xlsx/ui/commands/util.d.ts.map +1 -1
  152. package/dist/xlsx/ui/context.d.ts +5 -0
  153. package/dist/xlsx/ui/context.d.ts.map +1 -1
  154. package/dist/xlsx/ui/grid/cell-paint.d.ts +3 -2
  155. package/dist/xlsx/ui/grid/cell-paint.d.ts.map +1 -1
  156. package/dist/xlsx/ui/index.cjs +2093 -102
  157. package/dist/xlsx/ui/index.mjs +2093 -103
  158. package/package.json +1 -1
  159. package/dist/PptxHandler-EL4E4SPH.mjs +0 -5
  160. package/dist/PptxHandler-OIZ3R3DJ.cjs +0 -14
  161. package/dist/chunk-3IT6ZD7K.mjs +0 -213
  162. package/dist/chunk-FRUB573B.cjs +0 -219
  163. package/dist/pptx/chunks/elements-6BMEOo7i.d.ts.map +0 -1
  164. package/dist/pptx/chunks/index-Dija_Wth.d.ts.map +0 -1
  165. package/dist/pptx/chunks/index-DvN0TkJJ.d.ts.map +0 -1
  166. package/dist/pptx/chunks/text-operations-DorONr3h.d.ts.map +0 -1
@@ -2455,7 +2455,7 @@ function lerpStops(a, b, t) {
2455
2455
  opacity: oa + (ob - oa) * t
2456
2456
  };
2457
2457
  }
2458
- function colorAt(stops, position) {
2458
+ function gradientColorAt(stops, position) {
2459
2459
  const first3 = stops[0];
2460
2460
  const last = stops[stops.length - 1];
2461
2461
  if (position <= first3.position) {
@@ -2510,7 +2510,7 @@ function buildRectPathGradientSvg(stops, focalPoint, fillToRect, options2) {
2510
2510
  if (!Number.isInteger(bands) || bands < 1) throw new RangeError("Invalid gradient band count");
2511
2511
  for (let i = bands; i >= 0; i -= 1) {
2512
2512
  const t = i / bands;
2513
- const { color, opacity } = colorAt(sorted, t * 100);
2513
+ const { color, opacity } = gradientColorAt(sorted, t * 100);
2514
2514
  const left = lerpEdge(inner.left, 0, t);
2515
2515
  const top = lerpEdge(inner.top, 0, t);
2516
2516
  const right = lerpEdge(inner.right, 100, t);
@@ -2638,6 +2638,48 @@ function drawingPathData(path, width, height) {
2638
2638
  return out.join(" ");
2639
2639
  }
2640
2640
 
2641
+ // drawingml/dash-pattern.ts
2642
+ var PRESET_PATTERNS = {
2643
+ dash: [4, 3],
2644
+ dot: [1, 3],
2645
+ lgDash: [8, 3],
2646
+ dashDot: [4, 3, 1, 3],
2647
+ lgDashDot: [8, 3, 1, 3],
2648
+ lgDashDotDot: [8, 3, 1, 3, 1, 3],
2649
+ sysDash: [3, 1],
2650
+ sysDot: [1, 1],
2651
+ sysDashDot: [3, 1, 1, 1],
2652
+ sysDashDotDot: [3, 1, 1, 1, 1, 1]
2653
+ };
2654
+ var CUSTOM_DASH_UNIT = 1e5;
2655
+ var FALLBACK_CUSTOM_PATTERN = [3, 2];
2656
+ function dashPenWidth(strokeWidth) {
2657
+ if (!Number.isFinite(strokeWidth) || strokeWidth <= 1) return 1;
2658
+ return Math.max(1, Math.ceil(strokeWidth - 0.5));
2659
+ }
2660
+ function dashPatternUnits(dashType, customSegments) {
2661
+ if (!dashType || dashType === "solid") return void 0;
2662
+ if (dashType === "custom") {
2663
+ const pattern = ([]).flatMap((seg) => [
2664
+ Math.max(0, seg.dash) / CUSTOM_DASH_UNIT,
2665
+ Math.max(0, seg.space) / CUSTOM_DASH_UNIT
2666
+ ]);
2667
+ return pattern.some((n2) => n2 > 0) ? pattern : FALLBACK_CUSTOM_PATTERN;
2668
+ }
2669
+ return PRESET_PATTERNS[dashType];
2670
+ }
2671
+ function capCompensatedDashArray(pattern, strokeWidth, lineCap) {
2672
+ const pen = dashPenWidth(strokeWidth);
2673
+ const out = [];
2674
+ for (let i = 0; i < pattern.length; i += 1) {
2675
+ const len = (pattern[i] ?? 0) * pen;
2676
+ {
2677
+ out.push(len);
2678
+ }
2679
+ }
2680
+ return out.map((n2) => Number(n2.toFixed(4))).join(" ");
2681
+ }
2682
+
2641
2683
  // geometry/preset-shape-exact-dsl.ts
2642
2684
  function g(line4) {
2643
2685
  const [name2, ...rest] = line4.trim().split(/\s+/);
@@ -2768,84 +2810,22 @@ var triangle = (g2, dir) => g2.poly([
2768
2810
  [D * dir, 0],
2769
2811
  [-D * dir, D]
2770
2812
  ]);
2771
- var QUESTION = [
2772
- [-4.8, -33.7],
2773
- [-6.3, -31.5],
2774
- [-7.8, -31.5],
2775
- [-12.3, -28.5],
2776
- [-14.5, -28.5],
2777
- [-15.3, -27.7],
2778
- [-15.3, -25.5],
2779
- [-18.3, -21],
2780
- [-19, -17.2],
2781
- [-20.5, -16.5],
2782
- [-20.5, -12.7],
2783
- [-19, -12.7],
2784
- [-18.3, -14.2],
2785
- [-10.8, -14.2],
2786
- [-10, -13.5],
2787
- [-8.5, -13.5],
2788
- [-9.3, -17.2],
2789
- [-7.8, -19.5],
2790
- [-4, -22.5],
2791
- [-3.3, -21.7],
2792
- [-1.8, -21.7],
2793
- [-1, -23.2],
2794
- [0.5, -23.2],
2795
- [1.2, -21.7],
2796
- [2.7, -21.7],
2797
- [3.5, -22.5],
2798
- [8, -18.7],
2799
- [8.7, -17.2],
2800
- [8, -16.5],
2801
- [8, -15],
2802
- [9.5, -14.2],
2803
- [9.5, -13.5],
2804
- [8, -12.7],
2805
- [8.7, -9.7],
2806
- [5, -6],
2807
- [2, -6],
2808
- [-2.5, -2.2],
2809
- [-3.3, 0.8],
2810
- [-5.5, 2.3],
2811
- [-4.8, 6.8],
2812
- [-6.3, 7.5],
2813
- [-6.3, 18],
2814
- [-4.8, 18],
2815
- [-4, 17.3],
2816
- [4.2, 17.3],
2817
- [4.2, 6.8],
2818
- [6.5, 5.3],
2819
- [6.5, 3.8],
2820
- [8, 3],
2821
- [8, 1.5],
2822
- [8.7, 0.8],
2823
- [13.2, 0],
2824
- [17, -4.5],
2825
- [18.5, -4.5],
2826
- [18.5, -6],
2827
- [17.7, -6.7],
2828
- [18.5, -8.2],
2829
- [18.5, -15],
2830
- [20, -15.7],
2831
- [20, -18],
2832
- [17.7, -19.5],
2833
- [17.7, -21],
2834
- [15.5, -24.7],
2835
- [15.5, -27],
2836
- [14, -27],
2837
- [13.2, -27.7],
2838
- [13.2, -29.2],
2839
- [9.5, -30],
2840
- [8.7, -30.7],
2841
- [8.7, -32.2],
2842
- [5.7, -31.5],
2843
- [4.2, -33.7],
2844
- [2.7, -33.7],
2845
- [2, -32.2],
2846
- [-2.5, -32.2],
2847
- [-3.3, -33.7]
2848
- ];
2813
+ var U = 90;
2814
+ var question = (g2) => {
2815
+ const x = (v) => g2.x(v * U);
2816
+ const y = (v) => g2.y(v * U);
2817
+ const r = (v) => g2.len(v * U);
2818
+ return [
2819
+ `M ${x(-0.214)} ${y(-0.162)} A ${r(0.214)} ${r(0.2125)} 10800000 10800000`,
2820
+ `A ${r(0.108)} ${r(0.162)} 0 5400000`,
2821
+ `A ${r(0.053)} ${r(0.085)} 16200000 -5400000`,
2822
+ `L ${x(0.053)} ${y(0.187)} L ${x(-0.053)} ${y(0.187)} L ${x(-0.053)} ${y(0.08)}`,
2823
+ `A ${r(0.108)} ${r(0.16)} 10800000 5400000`,
2824
+ `A ${r(0.052)} ${r(0.082)} 5400000 -5400000`,
2825
+ `A ${r(0.107)} ${r(0.1065)} 0 -10800000`,
2826
+ `L ${x(-0.214)} ${y(-0.162)} Z`
2827
+ ].join(" ");
2828
+ };
2849
2829
  var MOVIE = [
2850
2830
  [-33.75, -16.5],
2851
2831
  [-33.75, -3],
@@ -2952,8 +2932,8 @@ var buttons = {
2952
2932
  )
2953
2933
  ]),
2954
2934
  actionButtonHelp: build("actionButtonHelp", (g2) => [
2955
- darken(g2.poly(QUESTION)),
2956
- darken(g2.circle(-0.2, 27.4, 7))
2935
+ darken(question(g2)),
2936
+ darken(g2.circle(0, 0.295 * U, 0.08 * U))
2957
2937
  ]),
2958
2938
  actionButtonInformation: build("actionButtonInformation", (g2) => [
2959
2939
  darken(g2.circle(0, 0.4, 34)),
@@ -6276,12 +6256,46 @@ var leftRightUpArrow2 = exactDef(
6276
6256
  )
6277
6257
  ]
6278
6258
  );
6259
+ var swooshArrow3 = exactDef(
6260
+ "swooshArrow",
6261
+ { adj1: 25e3, adj2: 16667 },
6262
+ [
6263
+ "a1 pin 1 adj1 75000",
6264
+ "maxAdj2 */ 70000 w ss",
6265
+ "a2 pin 0 adj2 maxAdj2",
6266
+ "ad1 */ h a1 100000",
6267
+ "ad2 */ ss a2 100000",
6268
+ "xB +- r 0 ad2",
6269
+ "yB +- t ssd8 0",
6270
+ "alfa */ cd4 1 14",
6271
+ "dx0 tan ssd8 alfa",
6272
+ "xC +- xB 0 dx0",
6273
+ "dx1 tan ad1 alfa",
6274
+ "yF +- yB ad1 0",
6275
+ "xF +- xB dx1 0",
6276
+ "xE +- xF dx0 0",
6277
+ "yE +- yF ssd8 0",
6278
+ "dy2 +- yE 0 t",
6279
+ "dy22 */ dy2 1 2",
6280
+ "dy3 */ h 1 20",
6281
+ "yD +- dy22 0 dy3",
6282
+ "dy4 */ hd6 1 1",
6283
+ "yP1 +- hd6 dy4 0",
6284
+ "xP1 val wd6",
6285
+ "dy5 */ hd6 1 2",
6286
+ "yP2 +- yF dy5 0",
6287
+ "xP2 val wd4"
6288
+ ],
6289
+ "l t r b",
6290
+ [p("M l b Q xP1 yP1 xB yB L xC t L r yD L xE yE L xF yF Q xP2 yP2 l b Z")]
6291
+ );
6279
6292
  var EXACT_ARROW_PRESET_DEFINITIONS = {
6280
6293
  leftRightArrow: leftRightArrow2,
6281
6294
  upDownArrow: upDownArrow2,
6282
6295
  quadArrow: quadArrow2,
6283
6296
  leftUpArrow: leftUpArrow2,
6284
- leftRightUpArrow: leftRightUpArrow2
6297
+ leftRightUpArrow: leftRightUpArrow2,
6298
+ swooshArrow: swooshArrow3
6285
6299
  };
6286
6300
 
6287
6301
  // geometry/preset-shape-definitions-exact-circular.ts
@@ -7087,10 +7101,13 @@ var verticalScroll = exactDef(
7087
7101
  p(
7088
7102
  "M ch ch2 A ch2 ch2 10800000 5400000 L x6 t A ch2 ch2 16200000 10800000 L x4 ch L x4 y4 A ch2 ch2 0 5400000 L ch2 b A ch2 ch2 5400000 10800000 L ch y3 Z"
7089
7103
  ),
7090
- p("M l y4 A ch2 ch2 10800000 21600000 Z M xsw cy3 A ch4 ch4 0 21600000 Z", {
7091
- fill: "darkenLess",
7092
- stroke: false
7093
- }),
7104
+ p(
7105
+ "M ch y4 A ch2 ch2 0 5400000 A ch2 ch2 5400000 10800000 A ch4 ch4 16200000 10800000 Z M x3b ch2 A ch2 ch2 0 5400000 A ch4 ch4 5400000 10800000 Z",
7106
+ {
7107
+ fill: "darkenLess",
7108
+ stroke: false
7109
+ }
7110
+ ),
7094
7111
  p(
7095
7112
  "M x3 t A ch2 ch2 16200000 10800000 L x4 ch M ch2 y4 L ch y4 M x3b ch2 L x3 ch2 A ch4 ch4 16200000 -10800000",
7096
7113
  { fill: "none" }
@@ -7106,10 +7123,13 @@ var horizontalScroll = exactDef(
7106
7123
  p(
7107
7124
  "M ch2 ch A ch2 ch2 16200000 -5400000 L l x6 A ch2 ch2 10800000 -10800000 L ch x4 L y4 x4 A ch2 ch2 5400000 -5400000 L r ch2 A ch2 ch2 0 -10800000 L y3 ch Z"
7108
7125
  ),
7109
- p("M y4 t A ch2 ch2 16200000 21600000 Z M ch cyw A ch4 ch4 0 21600000 Z", {
7110
- fill: "darkenLess",
7111
- stroke: false
7112
- }),
7126
+ p(
7127
+ "M y4 ch A ch2 ch2 5400000 -5400000 A ch2 ch2 0 -10800000 A ch4 ch4 10800000 -10800000 Z M ch2 x3b A ch2 ch2 5400000 -5400000 A ch4 ch4 0 -10800000 Z",
7128
+ {
7129
+ fill: "darkenLess",
7130
+ stroke: false
7131
+ }
7132
+ ),
7113
7133
  p(
7114
7134
  "M l x3 A ch2 ch2 10800000 -10800000 L ch x4 M y4 ch2 L y4 ch M ch2 x3b L ch2 x3 A ch4 ch4 10800000 10800000",
7115
7135
  { fill: "none" }
@@ -16064,10 +16084,13 @@ var FALLBACKS = {
16064
16084
  calibri: '"Calibri", "Carlito", "Segoe UI", Arial, sans-serif',
16065
16085
  "calibri light": '"Calibri Light", "Calibri", "Carlito", "Segoe UI", Arial, sans-serif',
16066
16086
  cambria: '"Cambria", "Caladea", Georgia, serif',
16067
- arial: 'Arial, "Liberation Sans", Helvetica, sans-serif',
16068
- "times new roman": '"Times New Roman", "Liberation Serif", Times, serif',
16069
- "courier new": '"Courier New", "Liberation Mono", monospace',
16070
- aptos: '"Aptos", "Calibri", "Carlito", "Segoe UI", sans-serif'
16087
+ arial: 'Arial, "Arimo", "Liberation Sans", Helvetica, sans-serif',
16088
+ "times new roman": '"Times New Roman", "Tinos", "Liberation Serif", Times, serif',
16089
+ "courier new": '"Courier New", "Cousine", "Liberation Mono", monospace',
16090
+ georgia: '"Georgia", "Gelasio", serif',
16091
+ aptos: '"Aptos", "Calibri", "Carlito", "Segoe UI", sans-serif',
16092
+ "aptos narrow": '"Aptos Narrow", "Aptos", "Calibri", "Carlito", "Segoe UI", sans-serif',
16093
+ "aptos display": '"Aptos Display", "Aptos", "Calibri", "Carlito", "Segoe UI", sans-serif'
16071
16094
  };
16072
16095
  function cssFontFamily(name2) {
16073
16096
  const known = FALLBACKS[name2.toLowerCase()];
@@ -19844,7 +19867,7 @@ function radarSvg(model, area) {
19844
19867
  }
19845
19868
 
19846
19869
  // chart/render/chart-svg-hierarchy.ts
19847
- var colorAt2 = (model, index) => {
19870
+ var colorAt = (model, index) => {
19848
19871
  const first3 = model.series[0];
19849
19872
  const colors = first3?.pointColors;
19850
19873
  return (colors && colors.length > 0 ? colors[index % colors.length] : void 0) ?? first3?.color ?? "#4472C4";
@@ -19873,7 +19896,7 @@ function treemapSvg(model, area) {
19873
19896
  }
19874
19897
  out.push(`<g data-chart-series="${cell.seriesIndex}" data-chart-point="${cell.pointIndex}">`);
19875
19898
  out.push(
19876
- rect2(cell.x, cell.y, cell.w, cell.h, colorAt2(model, cell.colorIndex)).replace(
19899
+ rect2(cell.x, cell.y, cell.w, cell.h, colorAt(model, cell.colorIndex)).replace(
19877
19900
  "/>",
19878
19901
  ' rx="2"/>'
19879
19902
  )
@@ -19912,7 +19935,7 @@ function sunburstSvg(model, area) {
19912
19935
  );
19913
19936
  for (const arc3 of arcs)
19914
19937
  out.push(
19915
- `<path d="${arc3.d}" fill="${colorAt2(model, arc3.colorIndex)}" stroke="#FFFFFF" stroke-width="1.5"${arc3.pointIndex === void 0 ? "" : ` data-chart-series="0" data-chart-point="${arc3.pointIndex}"`}/>`
19938
+ `<path d="${arc3.d}" fill="${colorAt(model, arc3.colorIndex)}" stroke="#FFFFFF" stroke-width="1.5"${arc3.pointIndex === void 0 ? "" : ` data-chart-series="0" data-chart-point="${arc3.pointIndex}"`}/>`
19916
19939
  );
19917
19940
  const flatLabels = levels.length > 1 || model.series.length !== 1 ? void 0 : model.categories;
19918
19941
  for (const arc3 of model.hierarchy?.labels === false ? [] : arcs) {
@@ -21426,6 +21449,18 @@ function diagramColorTheme(theme) {
21426
21449
  }
21427
21450
 
21428
21451
  // docx/document-paragraphs.ts
21452
+ function documentBlockLists(model) {
21453
+ return [
21454
+ model.blocks,
21455
+ ...(model.sections ?? []).flatMap(
21456
+ (section) => [section.headers, section.footers].flatMap(
21457
+ (slots) => Object.values(slots ?? {}).flatMap((content) => content ? [content.blocks] : [])
21458
+ )
21459
+ ),
21460
+ ...Object.values(model.footnoteSeparators ?? {}).map((note) => note.blocks),
21461
+ ...[...model.footnotes ?? [], ...model.endnotes ?? []].map((note) => note.blocks)
21462
+ ];
21463
+ }
21429
21464
  function mapBlockParagraphs(blocks, map) {
21430
21465
  return blocks.map(
21431
21466
  (block) => block.type === "paragraph" ? map(block) : {
@@ -21837,16 +21872,6 @@ var DEFAULT_SHAPE_LINE_EMU = 12700;
21837
21872
  var isLinePreset = (preset) => /^(line|straightConnector1|bentConnector\d|curvedConnector\d)$/.test(preset);
21838
21873
 
21839
21874
  // docx/shape-svg.ts
21840
- var DASHES2 = {
21841
- dash: "4 3",
21842
- sysDash: "3 1",
21843
- dot: "1 2",
21844
- sysDot: "1 1",
21845
- dashDot: "4 3 1 3",
21846
- lgDash: "8 3",
21847
- lgDashDot: "8 3 1 3",
21848
- sysDashDot: "3 1 1 1"
21849
- };
21850
21875
  var escapeXml = (text2) => text2.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
21851
21876
  var round = (value) => Math.round(value * 100) / 100;
21852
21877
  function shapeColorCss(color, theme) {
@@ -21867,11 +21892,13 @@ function fillPaint(fill, theme) {
21867
21892
  }
21868
21893
  function shapeAppearance(spec, theme) {
21869
21894
  const line4 = spec.line;
21895
+ const strokeWidthPx = round((line4?.widthEmu ?? DEFAULT_SHAPE_LINE_EMU) / EMU_PER_PIXEL);
21896
+ const dashUnits = dashPatternUnits(line4?.dash);
21870
21897
  return {
21871
21898
  fill: isLinePreset(spec.preset) ? "none" : fillPaint(spec.fill, theme),
21872
21899
  stroke: linePaint(line4?.fill, theme),
21873
- strokeWidthPx: round((line4?.widthEmu ?? DEFAULT_SHAPE_LINE_EMU) / EMU_PER_PIXEL),
21874
- ...line4?.dash && DASHES2[line4.dash] ? { dash: DASHES2[line4.dash] } : {}
21900
+ strokeWidthPx,
21901
+ ...dashUnits ? { dash: capCompensatedDashArray(dashUnits, strokeWidthPx) } : {}
21875
21902
  };
21876
21903
  }
21877
21904
  var luminance = (css) => {
@@ -27536,6 +27563,12 @@ var METRIC_FONT_SUBSTITUTES = {
27536
27563
  calibri: { fallbacks: ["Carlito"], generic: "sans-serif" },
27537
27564
  "calibri light": { fallbacks: ["Carlito"], generic: "sans-serif" },
27538
27565
  cambria: { fallbacks: ["Caladea"], generic: "serif" },
27566
+ // Aptos, the Microsoft 365 default, has Calibri-close metrics; Carlito is the closest measured
27567
+ // clone (see `webfonts/metric-clones.ts`, which requests the same family).
27568
+ aptos: { fallbacks: ["Carlito"], generic: "sans-serif" },
27569
+ "aptos display": { fallbacks: ["Carlito"], generic: "sans-serif" },
27570
+ "aptos narrow": { fallbacks: ["Carlito"], generic: "sans-serif" },
27571
+ "aptos serif": { fallbacks: ["Caladea"], generic: "serif" },
27539
27572
  arial: { fallbacks: ["Arimo", "Liberation Sans"], generic: "sans-serif" },
27540
27573
  helvetica: { fallbacks: ["Arimo", "Liberation Sans"], generic: "sans-serif" },
27541
27574
  "times new roman": { fallbacks: ["Tinos", "Liberation Serif"], generic: "serif" },
@@ -27556,6 +27589,119 @@ function cssFontStack(family) {
27556
27589
  return metricFontFamily(family?.trim() || DEFAULT_FONT_FAMILY);
27557
27590
  }
27558
27591
 
27592
+ // docx/layout/webfont-runs.ts
27593
+ function collectDocxWebfontRuns(model) {
27594
+ const runs = [];
27595
+ const theme = model.theme;
27596
+ const labels = computeListLabels(model);
27597
+ const push = (run) => {
27598
+ if (run.text !== "") runs.push(run);
27599
+ };
27600
+ const familyOf = (formatting) => {
27601
+ const role = formatting.fontTheme?.ascii ?? formatting.fontTheme?.hAnsi;
27602
+ return formatting.fontFamily ?? (role && theme ? theme.fonts[role]?.latin : void 0);
27603
+ };
27604
+ const emptyRun = (formatting) => {
27605
+ runs.push({
27606
+ family: familyOf(formatting) ?? DEFAULT_FONT_FAMILY,
27607
+ bold: formatting.bold === true,
27608
+ italic: formatting.italic === true,
27609
+ text: ""
27610
+ });
27611
+ };
27612
+ const emit = (text2, formatting, family) => {
27613
+ const latin = family || DEFAULT_FONT_FAMILY;
27614
+ const eaRole = formatting.fontTheme?.eastAsia;
27615
+ const csRole = formatting.fontTheme?.cs;
27616
+ const bold = formatting.bold === true;
27617
+ const italic = formatting.italic === true;
27618
+ const fonts = {
27619
+ latin,
27620
+ eastAsia: formatting.fontFamilyEastAsia || eaRole && theme?.fonts[eaRole]?.eastAsia || latin,
27621
+ complexScript: formatting.fontFamilyComplexScript || csRole && theme?.fonts[csRole]?.complexScript || latin,
27622
+ symbol: latin
27623
+ };
27624
+ for (const piece of segmentByFont(text2, fonts))
27625
+ push({ family: piece.fontFamily, bold, italic, text: piece.text });
27626
+ };
27627
+ const paragraphRuns = (paragraph, tableStyleRun) => {
27628
+ const context = {
27629
+ runCatalog: model.characterStyles,
27630
+ paragraphCatalog: model.paragraphStyles,
27631
+ paragraphStyleId: paragraph.style,
27632
+ ...tableStyleRun ? { tableStyleRun } : {}
27633
+ };
27634
+ const label = labels.get(paragraph.id);
27635
+ const firstFormatting = resolveRunFormatting(paragraph.runs[0] ?? { text: "" }, context);
27636
+ if (label && !label.picture) {
27637
+ const marker = label.markerFormat;
27638
+ push({
27639
+ family: marker?.fontFamily ?? familyOf(firstFormatting) ?? DEFAULT_FONT_FAMILY,
27640
+ bold: marker?.bold ?? firstFormatting.bold === true,
27641
+ italic: marker?.italic ?? firstFormatting.italic === true,
27642
+ text: label.text
27643
+ });
27644
+ }
27645
+ if (paragraph.runs.every((run) => !run.text)) emptyRun(firstFormatting);
27646
+ for (const source of paragraph.runs) {
27647
+ for (const run of symbolSegments(source)) {
27648
+ const formatting = resolveRunFormatting(run, context);
27649
+ if (formatting.vanish) continue;
27650
+ const textBox = run.image?.textBoxText;
27651
+ if (textBox) emit(textBox.join("\n"), {}, DEFAULT_FONT_FAMILY);
27652
+ if (!run.text || run.image) continue;
27653
+ const family = symbolOnly(run) && run.symbol?.font || familyOf(formatting);
27654
+ emit(formatting.caps ? run.text.toUpperCase() : run.text, formatting, family);
27655
+ }
27656
+ }
27657
+ };
27658
+ const tableRuns = (table) => {
27659
+ const rowCount = table.rows.length;
27660
+ const columnCount = Math.max(
27661
+ 0,
27662
+ ...table.rows.map((row2) => row2.reduce((sum, cell) => sum + (cell.gridSpan ?? 1), 0))
27663
+ );
27664
+ table.rows.forEach((row2, rowIndex) => {
27665
+ let column = 0;
27666
+ for (const cell of row2) {
27667
+ const tableStyleRun = table.style ? resolveTableStyleFormatting(
27668
+ table.style,
27669
+ model.tableStyles,
27670
+ table.look,
27671
+ rowIndex,
27672
+ rowCount,
27673
+ column,
27674
+ columnCount
27675
+ ).run : void 0;
27676
+ for (const paragraph of cell.paragraphs) paragraphRuns(paragraph, tableStyleRun);
27677
+ const nestedBlocks = (cell.sourceBlocks ?? []).filter(
27678
+ (block) => block.type === "table"
27679
+ );
27680
+ for (const block of nestedBlocks) tableRuns(block);
27681
+ if (nestedBlocks.length === 0)
27682
+ for (const nested of cell.nestedTables ?? [])
27683
+ for (const nestedRow of nested.rows)
27684
+ for (const nestedCell of nestedRow) emit(nestedCell.text, {}, DEFAULT_FONT_FAMILY);
27685
+ column += cell.gridSpan ?? 1;
27686
+ }
27687
+ });
27688
+ };
27689
+ const blockRuns = (blocks) => {
27690
+ for (const block of blocks) {
27691
+ if (block.type === "paragraph") paragraphRuns(block);
27692
+ else tableRuns(block);
27693
+ }
27694
+ };
27695
+ for (const blocks of documentBlockLists(model)) blockRuns(blocks);
27696
+ emptyRun(
27697
+ resolveRunFormatting(
27698
+ { text: "" },
27699
+ { runCatalog: model.characterStyles, paragraphCatalog: model.paragraphStyles }
27700
+ )
27701
+ );
27702
+ return runs;
27703
+ }
27704
+
27559
27705
  // docx/layout/incremental-layout.ts
27560
27706
  var LOOKAHEAD_BLOCKS = 66;
27561
27707
  function paragraphBoxes(page) {
@@ -27724,4 +27870,4 @@ function createLayoutSession(measurer, options2 = {}) {
27724
27870
  };
27725
27871
  }
27726
27872
 
27727
- export { DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE_PT, DEFAULT_TAB_STOP_PX, FLOAT_WRAP_NOTE, NO_TWIPS, PageCursor, SINGLE_LINE_SPACING_UNITS, adaptDocumentModel, adjustForWidowOrphan, appendBreakMarker, cellVerticalOffset, createFakeMeasurer, createLayoutSession, cssFontStack, fieldDisplayText, floatOrigin, floatPosition, fontMetrics, headerFooterForPage, headerFooterSlotForPage, isEastAsianChar, layoutDocument, layoutDocumentModel, layoutParagraph, layoutRow, layoutSections, ligatureCss, pageNumberValues, pageNumbers, pageStyleRefs, paragraphFloats, placeParagraph, placeTab, placeTable, positionFloats, ptToPx, pxToTwips, reviewSourceLength, sectionPageCounts, splitRowAtHeight, suppressesSpacing, tokenizeRun, twipsToPx, widowControlEnabled };
27873
+ export { DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE_PT, DEFAULT_TAB_STOP_PX, FLOAT_WRAP_NOTE, NO_TWIPS, PageCursor, SINGLE_LINE_SPACING_UNITS, adaptDocumentModel, adjustForWidowOrphan, appendBreakMarker, cellVerticalOffset, collectDocxWebfontRuns, createFakeMeasurer, createLayoutSession, cssFontStack, fieldDisplayText, floatOrigin, floatPosition, fontMetrics, headerFooterForPage, headerFooterSlotForPage, isEastAsianChar, layoutDocument, layoutDocumentModel, layoutParagraph, layoutRow, layoutSections, ligatureCss, pageNumberValues, pageNumbers, pageStyleRefs, paragraphFloats, placeParagraph, placeTab, placeTable, positionFloats, ptToPx, pxToTwips, reviewSourceLength, sectionPageCounts, splitRowAtHeight, suppressesSpacing, tokenizeRun, twipsToPx, widowControlEnabled };
@@ -0,0 +1,5 @@
1
+ import type { WebfontRun } from '../../text/webfonts/index.js';
2
+ import type { DocumentModel } from '../model.js';
3
+ /** Every run of `model` as a `WebfontRun` (family, emphasis and the characters drawn). */
4
+ export declare function collectDocxWebfontRuns(model: DocumentModel): WebfontRun[];
5
+ //# sourceMappingURL=webfont-runs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webfont-runs.d.ts","sourceRoot":"","sources":["../../../docx/layout/webfont-runs.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEtD,OAAO,KAAK,EAAS,aAAa,EAAoB,MAAM,UAAU,CAAC;AAUvE,0FAA0F;AAC1F,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,aAAa,GAAG,UAAU,EAAE,CA6HzE"}