ooxml-ui 1.9.0 → 1.10.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 (118) hide show
  1. package/dist/{chunk-SNV6YKPC.js → chunk-HZSYGNNB.js} +2 -1
  2. package/dist/{chunk-SKYBYVYH.js → chunk-IXLJNVUD.js} +1 -1
  3. package/dist/{chunk-PH7IBZOZ.js → chunk-WMGMZIMM.js} +1 -1
  4. package/dist/docx/print-border-width.d.ts +2 -0
  5. package/dist/docx/print-table.d.ts +1 -1
  6. package/dist/docx.js +93 -8
  7. package/dist/index.js +3 -3
  8. package/dist/pptx/ai/index.cjs +2 -2
  9. package/dist/pptx/ai/index.mjs +1 -1
  10. package/dist/pptx/{chunk-F7BBPOVJ.mjs → chunk-5AD3V3PA.mjs} +1 -0
  11. package/dist/pptx/{chunk-BPAA5FSB.mjs → chunk-6B3UUVRS.mjs} +1 -1
  12. package/dist/pptx/{chunk-KBCKCW5M.mjs → chunk-6NFW2AQA.mjs} +682 -481
  13. package/dist/pptx/chunk-EYPNQ3FG.cjs +59 -0
  14. package/dist/pptx/chunk-FFIYFHBO.mjs +55 -0
  15. package/dist/pptx/{chunk-HWW2UVUP.cjs → chunk-JRCK6CFI.cjs} +19 -9
  16. package/dist/pptx/{chunk-MKVKISFW.mjs → chunk-OBRLAW6C.mjs} +1 -1
  17. package/dist/pptx/{chunk-BFZDO2DY.cjs → chunk-OCNECNJS.cjs} +785 -550
  18. package/dist/pptx/{chunk-Y4LTLCQP.cjs → chunk-OJFD3SHS.cjs} +26 -47
  19. package/dist/pptx/{chunk-7KPDES3X.mjs → chunk-PMURSMHH.mjs} +6 -35
  20. package/dist/pptx/{chunk-PKDISDDZ.cjs → chunk-TSSWTBJQ.cjs} +2 -2
  21. package/dist/pptx/{chunk-SABFKDRM.mjs → chunk-WFEN6SHA.mjs} +19 -10
  22. package/dist/pptx/{chunk-UEF4BFW4.cjs → chunk-XFQ2RD4I.cjs} +7 -7
  23. package/dist/pptx/{chunk-QVYJB7G2.cjs → chunk-Y7CDPPMZ.cjs} +1 -0
  24. package/dist/pptx/dom/elements/text-shape.d.ts.map +1 -1
  25. package/dist/pptx/dom/index.cjs +228 -218
  26. package/dist/pptx/dom/index.mjs +29 -19
  27. package/dist/pptx/dom/load-presentation.d.ts +1 -0
  28. package/dist/pptx/dom/load-presentation.d.ts.map +1 -1
  29. package/dist/pptx/i18n/index.cjs +6 -6
  30. package/dist/pptx/i18n/index.mjs +1 -1
  31. package/dist/pptx/i18n/translations-en-galleries.d.ts.map +1 -1
  32. package/dist/pptx/index.cjs +2889 -2825
  33. package/dist/pptx/index.mjs +7 -7
  34. package/dist/pptx/render/animation-after-effect-authoring.d.ts +1 -38
  35. package/dist/pptx/render/animation-after-effect-authoring.d.ts.map +1 -1
  36. package/dist/pptx/render/animation-after-effect.d.ts +2 -2
  37. package/dist/pptx/render/animation-after-effect.d.ts.map +1 -1
  38. package/dist/pptx/render/animation-authoring.cjs +39 -39
  39. package/dist/pptx/render/animation-authoring.d.ts +2 -11
  40. package/dist/pptx/render/animation-authoring.d.ts.map +1 -1
  41. package/dist/pptx/render/animation-authoring.mjs +1 -1
  42. package/dist/pptx/render/animation-opacity-playback.d.ts +9 -0
  43. package/dist/pptx/render/animation-opacity-playback.d.ts.map +1 -0
  44. package/dist/pptx/render/animation-opacity-style.d.ts +6 -0
  45. package/dist/pptx/render/animation-opacity-style.d.ts.map +1 -0
  46. package/dist/pptx/render/animation-playback-engine.d.ts +1 -1
  47. package/dist/pptx/render/animation-playback-engine.d.ts.map +1 -1
  48. package/dist/pptx/render/animation-playback-seek.d.ts.map +1 -1
  49. package/dist/pptx/render/animation-playback-steps.d.ts.map +1 -1
  50. package/dist/pptx/render/animation-timeline-engine.d.ts +4 -0
  51. package/dist/pptx/render/animation-timeline-engine.d.ts.map +1 -1
  52. package/dist/pptx/render/animation-timeline-group.d.ts +2 -0
  53. package/dist/pptx/render/animation-timeline-group.d.ts.map +1 -1
  54. package/dist/pptx/render/animation-timeline-regular-step.d.ts.map +1 -1
  55. package/dist/pptx/render/animation-timeline-rows.d.ts.map +1 -1
  56. package/dist/pptx/render/animation-timeline-sequence-builder.d.ts.map +1 -1
  57. package/dist/pptx/render/animation-timeline-step-effect.d.ts +2 -1
  58. package/dist/pptx/render/animation-timeline-step-effect.d.ts.map +1 -1
  59. package/dist/pptx/render/animation-timeline-step.d.ts +3 -1
  60. package/dist/pptx/render/animation-timeline-step.d.ts.map +1 -1
  61. package/dist/pptx/render/background-animation-layers.d.ts +12 -0
  62. package/dist/pptx/render/background-animation-layers.d.ts.map +1 -0
  63. package/dist/pptx/render/customization/customization-resolve-ribbon.d.ts.map +1 -1
  64. package/dist/pptx/render/customization/ribbon-control-catalog-tail.d.ts +6 -0
  65. package/dist/pptx/render/customization/ribbon-control-catalog-tail.d.ts.map +1 -1
  66. package/dist/pptx/render/customization/ribbon-control-catalog.d.ts +6 -0
  67. package/dist/pptx/render/customization/ribbon-control-catalog.d.ts.map +1 -1
  68. package/dist/pptx/render/field-context.d.ts +2 -0
  69. package/dist/pptx/render/field-context.d.ts.map +1 -1
  70. package/dist/pptx/render/font-family-update.d.ts +45 -0
  71. package/dist/pptx/render/font-family-update.d.ts.map +1 -0
  72. package/dist/pptx/render/format-painter.cjs +6 -6
  73. package/dist/pptx/render/format-painter.mjs +3 -3
  74. package/dist/pptx/render/index.d.ts +3 -0
  75. package/dist/pptx/render/index.d.ts.map +1 -1
  76. package/dist/pptx/render/inline-selection-utils.d.ts +2 -1
  77. package/dist/pptx/render/inline-selection-utils.d.ts.map +1 -1
  78. package/dist/pptx/render/inspector-helpers.cjs +17 -13
  79. package/dist/pptx/render/inspector-helpers.d.ts +8 -0
  80. package/dist/pptx/render/inspector-helpers.d.ts.map +1 -1
  81. package/dist/pptx/render/inspector-helpers.mjs +2 -2
  82. package/dist/pptx/render/picture-frame.d.ts +20 -0
  83. package/dist/pptx/render/picture-frame.d.ts.map +1 -1
  84. package/dist/pptx/render/ribbon-animations-state.cjs +6 -6
  85. package/dist/pptx/render/ribbon-animations-state.mjs +2 -2
  86. package/dist/pptx/render/ribbon-galleries/gallery-placements.d.ts +3 -3
  87. package/dist/pptx/render/ribbon-galleries/gallery-placements.d.ts.map +1 -1
  88. package/dist/pptx/render/ribbon-galleries/table-style-tile-svg.d.ts +21 -6
  89. package/dist/pptx/render/ribbon-galleries/table-style-tile-svg.d.ts.map +1 -1
  90. package/dist/pptx/render/ribbon-galleries/table-styles-gallery.d.ts +3 -1
  91. package/dist/pptx/render/ribbon-galleries/table-styles-gallery.d.ts.map +1 -1
  92. package/dist/pptx/render/ribbon-home-crop.d.ts +37 -0
  93. package/dist/pptx/render/ribbon-home-crop.d.ts.map +1 -0
  94. package/dist/pptx/render/ribbon-home-families-objects.d.ts +5 -2
  95. package/dist/pptx/render/ribbon-home-families-objects.d.ts.map +1 -1
  96. package/dist/pptx/render/ribbon-home-spec.d.ts +1 -1
  97. package/dist/pptx/render/ribbon-home-spec.d.ts.map +1 -1
  98. package/dist/pptx/render/ribbon-home-state-extras.d.ts.map +1 -1
  99. package/dist/pptx/render/ribbon-home-state.d.ts +1 -0
  100. package/dist/pptx/render/ribbon-home-state.d.ts.map +1 -1
  101. package/dist/pptx/render/text-block-style.d.ts.map +1 -1
  102. package/dist/pptx/render/text-field-substitution.d.ts +12 -0
  103. package/dist/pptx/render/text-field-substitution.d.ts.map +1 -1
  104. package/dist/pptx/render/text-style-update.d.ts.map +1 -1
  105. package/dist/pptx/render/update-text-segment-style.d.ts +7 -1
  106. package/dist/pptx/render/update-text-segment-style.d.ts.map +1 -1
  107. package/dist/pptx/web-components/index.d.ts.map +1 -1
  108. package/dist/pptx/web-components/ribbon-home-styles.d.ts +1 -1
  109. package/dist/pptx/web-components/ribbon-home-styles.d.ts.map +1 -1
  110. package/dist/pptx/web-components/ribbon-home.d.ts +2 -0
  111. package/dist/pptx/web-components/ribbon-home.d.ts.map +1 -1
  112. package/dist/{presentation-preview-HF3GZ2VD.js → presentation-preview-VIIU7E2S.js} +1 -1
  113. package/dist/teams.js +2 -2
  114. package/dist/xlsx/dialogs/pivot-values.d.ts +10 -0
  115. package/dist/xlsx.js +147 -12
  116. package/package.json +2 -2
  117. package/dist/pptx/chunk-CENGE3TZ.mjs +0 -10
  118. package/dist/pptx/chunk-OGJRSAGH.cjs +0 -12
@@ -0,0 +1,59 @@
1
+ 'use strict';
2
+
3
+ // src/pptx/render/font-family-update.ts
4
+ var SCRIPT_FACES = [
5
+ { face: "eastAsiaFont", token: "eastAsiaFontThemeToken" },
6
+ { face: "complexScriptFont", token: "complexScriptFontThemeToken" }
7
+ ];
8
+ function fontFamilyStyleUpdates(style, updates, inherited) {
9
+ const family = updates.fontFamily;
10
+ if (typeof family !== "string" || family.length === 0) {
11
+ return updates;
12
+ }
13
+ const next = { ...updates };
14
+ if (!("latinFontThemeToken" in updates) && style?.latinFontThemeToken !== void 0) {
15
+ next.latinFontThemeToken = void 0;
16
+ }
17
+ const ownsLatin = style?.fontFamily !== void 0;
18
+ const latinFace = ownsLatin ? style?.fontFamily : inherited?.fontFamily;
19
+ const latinToken = style?.latinFontThemeToken ?? (ownsLatin ? void 0 : inherited?.latinFontThemeToken);
20
+ for (const { face, token } of SCRIPT_FACES) {
21
+ if (face in updates || token in updates) {
22
+ continue;
23
+ }
24
+ const current = style?.[face];
25
+ const sameConcreteFace = current !== void 0 && current === latinFace;
26
+ const sameThemeFace = style?.[token] !== void 0 && style?.[token] === latinToken;
27
+ if (!sameConcreteFace && !sameThemeFace) {
28
+ continue;
29
+ }
30
+ next[face] = family;
31
+ if (style?.[token] !== void 0) {
32
+ next[token] = void 0;
33
+ }
34
+ }
35
+ return next;
36
+ }
37
+ function mergeTextStyleUpdate(style, updates, inherited) {
38
+ return { ...style, ...fontFamilyStyleUpdates(style, updates, inherited) };
39
+ }
40
+
41
+ // src/pptx/render/update-text-segment-style.ts
42
+ function updateTextSegmentStyle(segment, updates, options = {}) {
43
+ const { inherited } = options;
44
+ return {
45
+ ...segment,
46
+ ...options.updateBodyStyle === false ? {} : { style: mergeTextStyleUpdate(segment.style, updates, inherited) },
47
+ ...segment.paragraphInsertionStyle ? {
48
+ paragraphInsertionStyle: mergeTextStyleUpdate(
49
+ segment.paragraphInsertionStyle,
50
+ updates,
51
+ inherited
52
+ )
53
+ } : {}
54
+ };
55
+ }
56
+
57
+ exports.fontFamilyStyleUpdates = fontFamilyStyleUpdates;
58
+ exports.mergeTextStyleUpdate = mergeTextStyleUpdate;
59
+ exports.updateTextSegmentStyle = updateTextSegmentStyle;
@@ -0,0 +1,55 @@
1
+ // src/pptx/render/font-family-update.ts
2
+ var SCRIPT_FACES = [
3
+ { face: "eastAsiaFont", token: "eastAsiaFontThemeToken" },
4
+ { face: "complexScriptFont", token: "complexScriptFontThemeToken" }
5
+ ];
6
+ function fontFamilyStyleUpdates(style, updates, inherited) {
7
+ const family = updates.fontFamily;
8
+ if (typeof family !== "string" || family.length === 0) {
9
+ return updates;
10
+ }
11
+ const next = { ...updates };
12
+ if (!("latinFontThemeToken" in updates) && style?.latinFontThemeToken !== void 0) {
13
+ next.latinFontThemeToken = void 0;
14
+ }
15
+ const ownsLatin = style?.fontFamily !== void 0;
16
+ const latinFace = ownsLatin ? style?.fontFamily : inherited?.fontFamily;
17
+ const latinToken = style?.latinFontThemeToken ?? (ownsLatin ? void 0 : inherited?.latinFontThemeToken);
18
+ for (const { face, token } of SCRIPT_FACES) {
19
+ if (face in updates || token in updates) {
20
+ continue;
21
+ }
22
+ const current = style?.[face];
23
+ const sameConcreteFace = current !== void 0 && current === latinFace;
24
+ const sameThemeFace = style?.[token] !== void 0 && style?.[token] === latinToken;
25
+ if (!sameConcreteFace && !sameThemeFace) {
26
+ continue;
27
+ }
28
+ next[face] = family;
29
+ if (style?.[token] !== void 0) {
30
+ next[token] = void 0;
31
+ }
32
+ }
33
+ return next;
34
+ }
35
+ function mergeTextStyleUpdate(style, updates, inherited) {
36
+ return { ...style, ...fontFamilyStyleUpdates(style, updates, inherited) };
37
+ }
38
+
39
+ // src/pptx/render/update-text-segment-style.ts
40
+ function updateTextSegmentStyle(segment, updates, options = {}) {
41
+ const { inherited } = options;
42
+ return {
43
+ ...segment,
44
+ ...options.updateBodyStyle === false ? {} : { style: mergeTextStyleUpdate(segment.style, updates, inherited) },
45
+ ...segment.paragraphInsertionStyle ? {
46
+ paragraphInsertionStyle: mergeTextStyleUpdate(
47
+ segment.paragraphInsertionStyle,
48
+ updates,
49
+ inherited
50
+ )
51
+ } : {}
52
+ };
53
+ }
54
+
55
+ export { fontFamilyStyleUpdates, mergeTextStyleUpdate, updateTextSegmentStyle };
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkWB25PCHQ_cjs = require('./chunk-WB25PCHQ.cjs');
4
- var chunkOGJRSAGH_cjs = require('./chunk-OGJRSAGH.cjs');
4
+ var chunkEYPNQ3FG_cjs = require('./chunk-EYPNQ3FG.cjs');
5
5
  var pptx = require('ooxml-core/pptx');
6
6
  var bulletToggle = require('ooxml-core/pptx/editor/render/bullet-toggle');
7
7
 
@@ -264,25 +264,34 @@ function textStylePatch(el, changes) {
264
264
  ...paragraphs,
265
265
  ...segments?.some((segment) => segment.paragraphInsertionStyle) ? {
266
266
  textSegments: segments.map(
267
- (segment) => chunkOGJRSAGH_cjs.updateTextSegmentStyle(segment, exclusive, { updateBodyStyle: false })
267
+ (segment) => chunkEYPNQ3FG_cjs.updateTextSegmentStyle(segment, exclusive, {
268
+ updateBodyStyle: false,
269
+ inherited: base
270
+ })
268
271
  )
269
272
  } : {},
270
- textStyle: {
271
- ...base,
272
- ...exclusive
273
- }
273
+ textStyle: chunkEYPNQ3FG_cjs.mergeTextStyleUpdate(base, exclusive)
274
274
  };
275
275
  }
276
- function textFontSizePatch(el, fontSize) {
277
- const patch = textStylePatch(el, { fontSize });
276
+ function textRunsPatch(el, updates) {
277
+ const patch = textStylePatch(el, updates);
278
278
  if (!pptx.hasTextProperties(el) || !el.textSegments) {
279
279
  return patch;
280
280
  }
281
+ const inherited = el.textStyle;
281
282
  return {
282
283
  ...patch,
283
- textSegments: el.textSegments.map((segment) => chunkOGJRSAGH_cjs.updateTextSegmentStyle(segment, { fontSize }))
284
+ textSegments: el.textSegments.map(
285
+ (segment) => chunkEYPNQ3FG_cjs.updateTextSegmentStyle(segment, updates, { inherited })
286
+ )
284
287
  };
285
288
  }
289
+ function textFontSizePatch(el, fontSize) {
290
+ return textRunsPatch(el, { fontSize });
291
+ }
292
+ function textFontFamilyPatch(el, fontFamily) {
293
+ return textRunsPatch(el, { fontFamily });
294
+ }
286
295
 
287
296
  Object.defineProperty(exports, "DEFAULT_AUTONUM_TYPE", {
288
297
  enumerable: true,
@@ -357,6 +366,7 @@ exports.shapeStylePatch = shapeStylePatch;
357
366
  exports.splitTextStyleUpdate = splitTextStyleUpdate;
358
367
  exports.strokeColorOf = strokeColorOf;
359
368
  exports.textColorOf = textColorOf;
369
+ exports.textFontFamilyPatch = textFontFamilyPatch;
360
370
  exports.textFontSizePatch = textFontSizePatch;
361
371
  exports.textStyleFlagsOf = textStyleFlagsOf;
362
372
  exports.textStylePatch = textStylePatch;
@@ -1,4 +1,4 @@
1
- import { textStylePatch } from './chunk-SABFKDRM.mjs';
1
+ import { textStylePatch } from './chunk-WFEN6SHA.mjs';
2
2
  import { hasShapeProperties, hasTextProperties } from 'ooxml-core/pptx';
3
3
 
4
4
  function copyFormatFromElement(element) {