ooxml-core 1.40.0 → 1.41.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 (134) hide show
  1. package/dist/{PptxHandler-2WYH66TS.mjs → PptxHandler-3AGIITR7.mjs} +2 -2
  2. package/dist/PptxHandler-EL4E4SPH.mjs +5 -0
  3. package/dist/PptxHandler-OIZ3R3DJ.cjs +14 -0
  4. package/dist/{PresentationBuilder-RTHLLHLE.mjs → PresentationBuilder-5DPKFUXP.mjs} +3 -3
  5. package/dist/{PresentationBuilder-VHDHLGIK.mjs → PresentationBuilder-JNID4B4Z.mjs} +2 -2
  6. package/dist/{PresentationBuilder-BUUVVMNI.cjs → PresentationBuilder-MZBKYOYD.cjs} +6 -6
  7. package/dist/automation/index.cjs +5336 -3452
  8. package/dist/automation/index.mjs +5336 -3452
  9. package/dist/{chunk-U6FMLGWH.cjs → chunk-3BIFRTU4.cjs} +1300 -1269
  10. package/dist/{chunk-HLBIT5H4.mjs → chunk-6LGRRQ3K.mjs} +1 -1
  11. package/dist/{chunk-SEGPDD5W.cjs → chunk-75KBNUKS.cjs} +4932 -3048
  12. package/dist/{chunk-AZNF3IOI.mjs → chunk-DD7COXWR.mjs} +69 -5
  13. package/dist/{chunk-NHV47JOE.mjs → chunk-HTELXT2N.mjs} +36 -5
  14. package/dist/{chunk-OGD5OQK2.mjs → chunk-JXR6YWBW.mjs} +6689 -4805
  15. package/dist/{chunk-3E4GSBC7.mjs → chunk-KKVD3R6O.mjs} +4 -4
  16. package/dist/{chunk-EXSPNK6W.cjs → chunk-LRBWCRQ3.cjs} +3 -3
  17. package/dist/{chunk-6XAAJTA3.mjs → chunk-P3WAKBVS.mjs} +4932 -3048
  18. package/dist/{chunk-5BVSDSJZ.mjs → chunk-UE23HF2N.mjs} +1 -1
  19. package/dist/{chunk-725QJW4K.mjs → chunk-ZYCBJKAE.mjs} +1 -1
  20. package/dist/color/index.cjs +36 -0
  21. package/dist/color/index.d.ts +1 -0
  22. package/dist/color/index.d.ts.map +1 -1
  23. package/dist/color/index.mjs +35 -1
  24. package/dist/color/office-gradient-stops.d.ts +27 -0
  25. package/dist/color/office-gradient-stops.d.ts.map +1 -0
  26. package/dist/diagram/index.cjs +4858 -2934
  27. package/dist/diagram/index.mjs +4858 -2935
  28. package/dist/docx/embedded.cjs +4884 -3000
  29. package/dist/docx/embedded.mjs +4884 -3000
  30. package/dist/docx/index.cjs +4942 -3056
  31. package/dist/docx/index.mjs +4942 -3056
  32. package/dist/docx/layout/index.cjs +4924 -3038
  33. package/dist/docx/layout/index.mjs +4924 -3038
  34. package/dist/docx/load/index.cjs +5021 -3137
  35. package/dist/docx/load/index.mjs +5021 -3137
  36. package/dist/docx/ui/index.cjs +4925 -3041
  37. package/dist/docx/ui/index.mjs +4925 -3041
  38. package/dist/drawingml/index.cjs +76 -16
  39. package/dist/drawingml/index.mjs +76 -17
  40. package/dist/drawingml/path-data.d.ts.map +1 -1
  41. package/dist/drawingml/rect-path-gradient.d.ts +12 -0
  42. package/dist/drawingml/rect-path-gradient.d.ts.map +1 -1
  43. package/dist/geometry/index.cjs +4138 -2253
  44. package/dist/geometry/index.mjs +4138 -2254
  45. package/dist/geometry/ooxml-arc.d.ts +10 -1
  46. package/dist/geometry/ooxml-arc.d.ts.map +1 -1
  47. package/dist/geometry/preset-shape-definitions-action-buttons.d.ts +7 -36
  48. package/dist/geometry/preset-shape-definitions-action-buttons.d.ts.map +1 -1
  49. package/dist/geometry/preset-shape-definitions-connectors-brackets.d.ts.map +1 -1
  50. package/dist/geometry/preset-shape-definitions-exact-action-buttons.d.ts +19 -0
  51. package/dist/geometry/preset-shape-definitions-exact-action-buttons.d.ts.map +1 -0
  52. package/dist/geometry/preset-shape-definitions-exact-arcs.d.ts +14 -0
  53. package/dist/geometry/preset-shape-definitions-exact-arcs.d.ts.map +1 -0
  54. package/dist/geometry/preset-shape-definitions-exact-arrows.d.ts +11 -0
  55. package/dist/geometry/preset-shape-definitions-exact-arrows.d.ts.map +1 -0
  56. package/dist/geometry/preset-shape-definitions-exact-basic.d.ts +12 -0
  57. package/dist/geometry/preset-shape-definitions-exact-basic.d.ts.map +1 -0
  58. package/dist/geometry/preset-shape-definitions-exact-circular.d.ts +18 -0
  59. package/dist/geometry/preset-shape-definitions-exact-circular.d.ts.map +1 -0
  60. package/dist/geometry/preset-shape-definitions-exact-ellipse-ribbons.d.ts +16 -0
  61. package/dist/geometry/preset-shape-definitions-exact-ellipse-ribbons.d.ts.map +1 -0
  62. package/dist/geometry/preset-shape-definitions-exact-funnel.d.ts +13 -0
  63. package/dist/geometry/preset-shape-definitions-exact-funnel.d.ts.map +1 -0
  64. package/dist/geometry/preset-shape-definitions-exact-left-right-ribbon.d.ts +13 -0
  65. package/dist/geometry/preset-shape-definitions-exact-left-right-ribbon.d.ts.map +1 -0
  66. package/dist/geometry/preset-shape-definitions-exact-math.d.ts +14 -0
  67. package/dist/geometry/preset-shape-definitions-exact-math.d.ts.map +1 -0
  68. package/dist/geometry/preset-shape-definitions-exact-misc.d.ts +11 -0
  69. package/dist/geometry/preset-shape-definitions-exact-misc.d.ts.map +1 -0
  70. package/dist/geometry/preset-shape-definitions-exact-ribbons.d.ts +12 -0
  71. package/dist/geometry/preset-shape-definitions-exact-ribbons.d.ts.map +1 -0
  72. package/dist/geometry/preset-shape-definitions-exact-scrolls.d.ts +13 -0
  73. package/dist/geometry/preset-shape-definitions-exact-scrolls.d.ts.map +1 -0
  74. package/dist/geometry/preset-shape-definitions-flowchart.d.ts.map +1 -1
  75. package/dist/geometry/preset-shape-definitions-misc.d.ts.map +1 -1
  76. package/dist/geometry/preset-shape-definitions-table.d.ts.map +1 -1
  77. package/dist/geometry/preset-shape-exact-dsl.d.ts +30 -0
  78. package/dist/geometry/preset-shape-exact-dsl.d.ts.map +1 -0
  79. package/dist/index.cjs +7091 -4867
  80. package/dist/index.mjs +7091 -4867
  81. package/dist/pptx/automation/index.cjs +5419 -3408
  82. package/dist/pptx/automation/index.d.ts +5 -5
  83. package/dist/pptx/automation/index.mjs +5 -5
  84. package/dist/pptx/chunks/{elements-DheCTwi0.d.ts → elements-6BMEOo7i.d.ts} +27 -2
  85. package/dist/pptx/chunks/{elements-DheCTwi0.d.ts.map → elements-6BMEOo7i.d.ts.map} +1 -1
  86. package/dist/pptx/chunks/{index-Jcce8TlI.d.ts → index-BbXLv6As.d.ts} +4 -4
  87. package/dist/pptx/chunks/{index-Jcce8TlI.d.ts.map → index-BbXLv6As.d.ts.map} +1 -1
  88. package/dist/pptx/chunks/{index-B4ofjG6_.d.ts → index-Dija_Wth.d.ts} +3 -3
  89. package/dist/pptx/chunks/{index-B4ofjG6_.d.ts.map → index-Dija_Wth.d.ts.map} +1 -1
  90. package/dist/pptx/chunks/{index-CYukxWbl.d.ts → index-DvN0TkJJ.d.ts} +23 -8
  91. package/dist/pptx/chunks/index-DvN0TkJJ.d.ts.map +1 -0
  92. package/dist/pptx/chunks/{text-operations-CdgEnFuK.d.ts → text-operations-DorONr3h.d.ts} +2 -2
  93. package/dist/pptx/chunks/{text-operations-CdgEnFuK.d.ts.map → text-operations-DorONr3h.d.ts.map} +1 -1
  94. package/dist/pptx/cli/index.cjs +5341 -3330
  95. package/dist/pptx/cli/index.d.ts +1 -1
  96. package/dist/pptx/cli/index.mjs +4 -4
  97. package/dist/pptx/converter/index.cjs +4958 -2978
  98. package/dist/pptx/converter/index.d.ts +1 -1
  99. package/dist/pptx/converter/index.mjs +2 -2
  100. package/dist/pptx/editor/render/custom-show-operations.cjs +2 -2
  101. package/dist/pptx/editor/render/custom-show-operations.mjs +1 -1
  102. package/dist/pptx/editor/render/find-replace.cjs +15 -15
  103. package/dist/pptx/editor/render/find-replace.d.ts +2 -2
  104. package/dist/pptx/editor/render/find-replace.mjs +2 -2
  105. package/dist/pptx/editor/render/slide-operations.cjs +9 -9
  106. package/dist/pptx/editor/render/slide-operations.mjs +3 -3
  107. package/dist/pptx/editor/render/text-runs-style-patch.d.ts +1 -1
  108. package/dist/pptx/editor/render/text-style-scope.d.ts +1 -1
  109. package/dist/pptx/index.cjs +7176 -5125
  110. package/dist/pptx/index.d.ts +6 -6
  111. package/dist/pptx/index.mjs +5 -5
  112. package/dist/pptx/node/index.d.ts +1 -1
  113. package/dist/teams/index.cjs +5287 -3307
  114. package/dist/teams/index.mjs +5287 -3307
  115. package/dist/text/font-metrics/office-font-metrics.generated.d.ts +23 -0
  116. package/dist/text/font-metrics/office-font-metrics.generated.d.ts.map +1 -0
  117. package/dist/text/font-metrics/vertical-metrics.d.ts +35 -0
  118. package/dist/text/font-metrics/vertical-metrics.d.ts.map +1 -0
  119. package/dist/text/index.cjs +260 -0
  120. package/dist/text/index.d.ts +1 -0
  121. package/dist/text/index.d.ts.map +1 -1
  122. package/dist/text/index.mjs +259 -1
  123. package/dist/xlsx/collab/index.cjs +5106 -3222
  124. package/dist/xlsx/collab/index.mjs +5106 -3222
  125. package/dist/xlsx/index.cjs +5272 -3386
  126. package/dist/xlsx/index.mjs +5272 -3386
  127. package/dist/xlsx/load/index.cjs +5125 -3241
  128. package/dist/xlsx/load/index.mjs +5125 -3241
  129. package/dist/xlsx/ui/index.cjs +5279 -3395
  130. package/dist/xlsx/ui/index.mjs +5279 -3395
  131. package/package.json +1 -1
  132. package/dist/PptxHandler-SD6VWF3I.mjs +0 -5
  133. package/dist/PptxHandler-ZHWWOO2X.cjs +0 -14
  134. package/dist/pptx/chunks/index-CYukxWbl.d.ts.map +0 -1
@@ -1,4 +1,4 @@
1
- import { xmlText } from './chunk-6XAAJTA3.mjs';
1
+ import { xmlText } from './chunk-P3WAKBVS.mjs';
2
2
  import { EMU_PER_PX } from './chunk-CA7KCNL3.mjs';
3
3
 
4
4
  // pptx/core/core/runtime/table-structural-helpers.ts
@@ -1,4 +1,4 @@
1
- import { hasTextProperties } from './chunk-OGD5OQK2.mjs';
1
+ import { hasTextProperties } from './chunk-JXR6YWBW.mjs';
2
2
  import { cloneSlide } from './chunk-VDUNZTJC.mjs';
3
3
 
4
4
  // pptx/core/builders/sdk/merge-operations.ts
@@ -601,6 +601,40 @@ function straightAlphaGradientStops(stops) {
601
601
  return out;
602
602
  }
603
603
 
604
+ // color/office-gradient-stops.ts
605
+ var SIGMA_SAMPLE_STEP = 8;
606
+ function round42(value) {
607
+ return Math.round(value * 1e4) / 1e4;
608
+ }
609
+ function officeTwoStopGradientStops(stops) {
610
+ const [from, to] = stops;
611
+ if (stops.length !== 2 || !from || !to || from.position !== 0 || to.position !== 100) {
612
+ return void 0;
613
+ }
614
+ const a = hexToRgbChannels(from.color);
615
+ const b = hexToRgbChannels(to.color);
616
+ if (!a || !b || a.r === b.r && a.g === b.g && a.b === b.b) return void 0;
617
+ const fromAlpha = from.opacity ?? 1;
618
+ const toAlpha = to.opacity ?? 1;
619
+ const last = OFFICE_SIGMA_FACTORS.length - 1;
620
+ const indices = [];
621
+ for (let index = 0; index < last; index += SIGMA_SAMPLE_STEP) indices.push(index);
622
+ indices.push(last);
623
+ return indices.map((index) => {
624
+ const t = index / last;
625
+ const weight = (OFFICE_SIGMA_FACTORS[index] ?? 0) / 65536;
626
+ const mix = (x, y) => toHex(255 * ((x / 255) ** 2.2 * (1 - weight) + (y / 255) ** 2.2 * weight) ** (1 / 2.2));
627
+ return {
628
+ color: `#${mix(a.r, b.r)}${mix(a.g, b.g)}${mix(a.b, b.b)}`,
629
+ position: round42(t * 100),
630
+ ...fromAlpha === 1 && toAlpha === 1 ? {} : { opacity: round42(fromAlpha + (toAlpha - fromAlpha) * t) }
631
+ };
632
+ });
633
+ }
634
+ function officeGradientStops(stops) {
635
+ return officeTwoStopGradientStops(stops) ?? straightAlphaGradientStops(stops);
636
+ }
637
+
604
638
  exports.OFFICE_STANDARD_COLORS = OFFICE_STANDARD_COLORS;
605
639
  exports.OFFICE_THEME_PALETTE_COLORS = OFFICE_THEME_PALETTE_COLORS;
606
640
  exports.THEME_PALETTE_COLUMN_NAMES = THEME_PALETTE_COLUMN_NAMES;
@@ -617,6 +651,8 @@ exports.hslToRgb = hslToRgb;
617
651
  exports.linearToSrgb255 = linearToSrgb255;
618
652
  exports.normalizeHexColor = normalizeHexColor;
619
653
  exports.normalizePaletteHex = normalizePaletteHex;
654
+ exports.officeGradientStops = officeGradientStops;
655
+ exports.officeTwoStopGradientStops = officeTwoStopGradientStops;
620
656
  exports.parseArgbHex = parseArgbHex;
621
657
  exports.parseDrawingFraction = parseDrawingFraction;
622
658
  exports.parseDrawingHueDegrees = parseDrawingHueDegrees;
@@ -6,4 +6,5 @@ export * from './sigma-gradient-stops.js';
6
6
  export * from './hex-rgb.js';
7
7
  export * from './theme-palette.js';
8
8
  export * from './straight-alpha-stops.js';
9
+ export * from './office-gradient-stops.js';
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../color/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../color/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC"}
@@ -599,4 +599,38 @@ function straightAlphaGradientStops(stops) {
599
599
  return out;
600
600
  }
601
601
 
602
- export { OFFICE_STANDARD_COLORS, OFFICE_THEME_PALETTE_COLORS, THEME_PALETTE_COLUMN_NAMES, applyThemePaletteVariant, blendColorOntoWhite, buildThemePalette, clampUnitInterval, colorWithOpacity, contrastTextColor, describeThemePaletteSwatch, hexToRgbChannels, hexToRgbUnit, hslToRgb, linearToSrgb255, normalizeHexColor, normalizePaletteHex, parseArgbHex, parseDrawingFraction, parseDrawingHueDegrees, parseDrawingPercent, parseHex, parseOoxmlPercent, pushRecentColor, rgbToHsl, rgbToUpperHex, scrgbLinearToSrgb8, sigmaGradientStops, srgb255ToLinear, straightAlphaGradientStops, themePaletteVariantLuminance, themePaletteVariantsForLuminance, toHex };
602
+ // color/office-gradient-stops.ts
603
+ var SIGMA_SAMPLE_STEP = 8;
604
+ function round42(value) {
605
+ return Math.round(value * 1e4) / 1e4;
606
+ }
607
+ function officeTwoStopGradientStops(stops) {
608
+ const [from, to] = stops;
609
+ if (stops.length !== 2 || !from || !to || from.position !== 0 || to.position !== 100) {
610
+ return void 0;
611
+ }
612
+ const a = hexToRgbChannels(from.color);
613
+ const b = hexToRgbChannels(to.color);
614
+ if (!a || !b || a.r === b.r && a.g === b.g && a.b === b.b) return void 0;
615
+ const fromAlpha = from.opacity ?? 1;
616
+ const toAlpha = to.opacity ?? 1;
617
+ const last = OFFICE_SIGMA_FACTORS.length - 1;
618
+ const indices = [];
619
+ for (let index = 0; index < last; index += SIGMA_SAMPLE_STEP) indices.push(index);
620
+ indices.push(last);
621
+ return indices.map((index) => {
622
+ const t = index / last;
623
+ const weight = (OFFICE_SIGMA_FACTORS[index] ?? 0) / 65536;
624
+ const mix = (x, y) => toHex(255 * ((x / 255) ** 2.2 * (1 - weight) + (y / 255) ** 2.2 * weight) ** (1 / 2.2));
625
+ return {
626
+ color: `#${mix(a.r, b.r)}${mix(a.g, b.g)}${mix(a.b, b.b)}`,
627
+ position: round42(t * 100),
628
+ ...fromAlpha === 1 && toAlpha === 1 ? {} : { opacity: round42(fromAlpha + (toAlpha - fromAlpha) * t) }
629
+ };
630
+ });
631
+ }
632
+ function officeGradientStops(stops) {
633
+ return officeTwoStopGradientStops(stops) ?? straightAlphaGradientStops(stops);
634
+ }
635
+
636
+ export { OFFICE_STANDARD_COLORS, OFFICE_THEME_PALETTE_COLORS, THEME_PALETTE_COLUMN_NAMES, applyThemePaletteVariant, blendColorOntoWhite, buildThemePalette, clampUnitInterval, colorWithOpacity, contrastTextColor, describeThemePaletteSwatch, hexToRgbChannels, hexToRgbUnit, hslToRgb, linearToSrgb255, normalizeHexColor, normalizePaletteHex, officeGradientStops, officeTwoStopGradientStops, parseArgbHex, parseDrawingFraction, parseDrawingHueDegrees, parseDrawingPercent, parseHex, parseOoxmlPercent, pushRecentColor, rgbToHsl, rgbToUpperHex, scrgbLinearToSrgb8, sigmaGradientStops, srgb255ToLinear, straightAlphaGradientStops, themePaletteVariantLuminance, themePaletteVariantsForLuminance, toHex };
@@ -0,0 +1,27 @@
1
+ import { type StraightAlphaStop } from './straight-alpha-stops.js';
2
+ /**
3
+ * Office's paint for a two-stop gradient whose stops sit at 0% and 100%, as
4
+ * stops a plain sRGB interpolator can reproduce.
5
+ *
6
+ * Measured in PowerPoint 16 (COM `Slide.Export`): such a gradient is not a
7
+ * linear sRGB blend. The colour weight follows the GDI+ sigma bell curve
8
+ * (`OFFICE_SIGMA_FACTORS`) and the blend happens in gamma 2.2 light, so a
9
+ * white to black ramp is already 186 (not 128) at the midpoint and 236 (not
10
+ * 189) a quarter in. The same holds for linear (scaled or not), circle, rect
11
+ * and shape paths, with or without alpha; alpha itself stays a straight linear
12
+ * ramp. Gradients with three or more stops, or two stops that do not span the
13
+ * full range, are blended plainly in sRGB per segment.
14
+ *
15
+ * Returns `undefined` when the stops are not such a pair, or when the colour
16
+ * does not change (only alpha varies, which a plain interpolator already draws
17
+ * correctly).
18
+ */
19
+ export declare function officeTwoStopGradientStops(stops: readonly StraightAlphaStop[]): StraightAlphaStop[] | undefined;
20
+ /**
21
+ * Stops that make a CSS gradient (premultiplied, plain sRGB) paint what Office
22
+ * paints: the two-stop sigma profile when it applies, else the straight-alpha
23
+ * re-sampling. The sigma samples are dense enough that premultiplied blending
24
+ * between neighbours stays within a level of the straight ramp.
25
+ */
26
+ export declare function officeGradientStops(stops: readonly StraightAlphaStop[]): StraightAlphaStop[];
27
+ //# sourceMappingURL=office-gradient-stops.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"office-gradient-stops.d.ts","sourceRoot":"","sources":["../../color/office-gradient-stops.ts"],"names":[],"mappings":"AAEA,OAAO,EAA8B,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAS5F;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,0BAA0B,CACzC,KAAK,EAAE,SAAS,iBAAiB,EAAE,GACjC,iBAAiB,EAAE,GAAG,SAAS,CA2BjC;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,iBAAiB,EAAE,GAAG,iBAAiB,EAAE,CAE5F"}