pptx-react-viewer 1.22.2 → 1.23.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 (106) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/dist/{Model3DScene-NLUSXHD6.mjs → Model3DScene-4XNBDASE.mjs} +2 -2
  3. package/dist/Model3DScene-4XNBDASE.mjs.br +0 -0
  4. package/dist/Model3DScene-4XNBDASE.mjs.gz +0 -0
  5. package/dist/{Model3DScene-3YB3JAJS.js → Model3DScene-AQS7KDM4.js} +3 -3
  6. package/dist/Model3DScene-AQS7KDM4.js.br +0 -0
  7. package/dist/Model3DScene-AQS7KDM4.js.gz +0 -0
  8. package/dist/{PowerPointViewer-WGVR_u4z.d.ts → PowerPointViewer-DFTatVS4.d.ts} +2 -2
  9. package/dist/{PowerPointViewer-WGVR_u4z.d.ts.map → PowerPointViewer-DFTatVS4.d.ts.map} +1 -1
  10. package/dist/{SurfaceChart3DScene-PUQ5DCO5.js → SurfaceChart3DScene-HA2SD6BY.js} +3 -3
  11. package/dist/SurfaceChart3DScene-HA2SD6BY.js.br +0 -0
  12. package/dist/SurfaceChart3DScene-HA2SD6BY.js.gz +0 -0
  13. package/dist/{SurfaceChart3DScene-YBMJQGH3.mjs → SurfaceChart3DScene-K7ZDXDBL.mjs} +2 -2
  14. package/dist/SurfaceChart3DScene-K7ZDXDBL.mjs.br +0 -0
  15. package/dist/SurfaceChart3DScene-K7ZDXDBL.mjs.gz +0 -0
  16. package/dist/{chunk-VSNXVKJI.js → chunk-2DXNTVFV.js} +159 -62
  17. package/dist/chunk-2DXNTVFV.js.br +0 -0
  18. package/dist/chunk-2DXNTVFV.js.gz +0 -0
  19. package/dist/{chunk-OIAKQGMC.mjs → chunk-36NC56XG.mjs} +306 -290
  20. package/dist/chunk-36NC56XG.mjs.br +0 -0
  21. package/dist/chunk-36NC56XG.mjs.gz +0 -0
  22. package/dist/{chunk-3ZGCM6RC.mjs → chunk-AFWMAFWR.mjs} +1076 -289
  23. package/dist/chunk-AFWMAFWR.mjs.br +0 -0
  24. package/dist/chunk-AFWMAFWR.mjs.gz +0 -0
  25. package/dist/{chunk-KA7ST7IH.js → chunk-H5RREYCO.js} +454 -454
  26. package/dist/chunk-H5RREYCO.js.br +0 -0
  27. package/dist/chunk-H5RREYCO.js.gz +0 -0
  28. package/dist/{chunk-5SBQZEKD.mjs → chunk-I42XL2WU.mjs} +130 -34
  29. package/dist/chunk-I42XL2WU.mjs.br +0 -0
  30. package/dist/chunk-I42XL2WU.mjs.gz +0 -0
  31. package/dist/{chunk-3MZ7IARF.mjs → chunk-LFEVG3ED.mjs} +4 -4
  32. package/dist/chunk-LFEVG3ED.mjs.br +0 -0
  33. package/dist/chunk-LFEVG3ED.mjs.gz +0 -0
  34. package/dist/{chunk-JUFGTL2A.js → chunk-LS2AIX2H.js} +1082 -1066
  35. package/dist/chunk-LS2AIX2H.js.br +0 -0
  36. package/dist/chunk-LS2AIX2H.js.gz +0 -0
  37. package/dist/{chunk-AD3EAEY6.js → chunk-MS6S6YYR.js} +1076 -289
  38. package/dist/chunk-MS6S6YYR.js.br +0 -0
  39. package/dist/chunk-MS6S6YYR.js.gz +0 -0
  40. package/dist/{dist-3YRZ26TL.mjs → dist-5KQQ6GP2.mjs} +1 -1
  41. package/dist/dist-5KQQ6GP2.mjs.br +0 -0
  42. package/dist/dist-5KQQ6GP2.mjs.gz +0 -0
  43. package/dist/{dist-M2P6HBG4.js → dist-CVSSAFDL.js} +560 -560
  44. package/dist/dist-CVSSAFDL.js.br +0 -0
  45. package/dist/dist-CVSSAFDL.js.gz +0 -0
  46. package/dist/hooks-unstable.d.ts +5105 -5243
  47. package/dist/hooks-unstable.js +76 -76
  48. package/dist/hooks-unstable.js.br +0 -0
  49. package/dist/hooks-unstable.js.gz +0 -0
  50. package/dist/hooks-unstable.mjs +3 -3
  51. package/dist/hooks-unstable.mjs.br +0 -0
  52. package/dist/hooks-unstable.mjs.gz +0 -0
  53. package/dist/i18n.d.ts +3 -0
  54. package/dist/{index-SUL_8gq8.d.ts → index-CGKutKk1.d.ts} +4 -1
  55. package/dist/index-CGKutKk1.d.ts.map +1 -0
  56. package/dist/{index-ntF3kHHU.d.ts → index-COgh2UTL.d.ts} +2 -2
  57. package/dist/{index-ntF3kHHU.d.ts.map → index-COgh2UTL.d.ts.map} +1 -1
  58. package/dist/index.d.ts +3328 -3386
  59. package/dist/index.js +30 -30
  60. package/dist/index.js.br +0 -0
  61. package/dist/index.js.gz +0 -0
  62. package/dist/index.mjs +4 -4
  63. package/dist/index.mjs.br +0 -0
  64. package/dist/index.mjs.gz +0 -0
  65. package/dist/pptx-viewer.css +1 -1
  66. package/dist/pptx-viewer.css.br +0 -0
  67. package/dist/pptx-viewer.css.gz +0 -0
  68. package/dist/{types-Cdh0XYcS.d.ts → types-Da1M5VBY.d.ts} +2 -2
  69. package/dist/{types-Cdh0XYcS.d.ts.map → types-Da1M5VBY.d.ts.map} +1 -1
  70. package/dist/viewer/index.d.ts +5118 -5224
  71. package/dist/viewer/index.js +20 -20
  72. package/dist/viewer/index.js.br +0 -0
  73. package/dist/viewer/index.js.gz +0 -0
  74. package/dist/viewer/index.mjs +4 -4
  75. package/dist/viewer/index.mjs.br +0 -0
  76. package/dist/viewer/index.mjs.gz +0 -0
  77. package/package.json +1 -1
  78. package/dist/Model3DScene-3YB3JAJS.js.br +0 -0
  79. package/dist/Model3DScene-3YB3JAJS.js.gz +0 -0
  80. package/dist/Model3DScene-NLUSXHD6.mjs.br +0 -0
  81. package/dist/Model3DScene-NLUSXHD6.mjs.gz +0 -0
  82. package/dist/SurfaceChart3DScene-PUQ5DCO5.js.br +0 -0
  83. package/dist/SurfaceChart3DScene-PUQ5DCO5.js.gz +0 -0
  84. package/dist/SurfaceChart3DScene-YBMJQGH3.mjs.br +0 -0
  85. package/dist/SurfaceChart3DScene-YBMJQGH3.mjs.gz +0 -0
  86. package/dist/chunk-3MZ7IARF.mjs.br +0 -0
  87. package/dist/chunk-3MZ7IARF.mjs.gz +0 -0
  88. package/dist/chunk-3ZGCM6RC.mjs.br +0 -0
  89. package/dist/chunk-3ZGCM6RC.mjs.gz +0 -0
  90. package/dist/chunk-5SBQZEKD.mjs.br +0 -0
  91. package/dist/chunk-5SBQZEKD.mjs.gz +0 -0
  92. package/dist/chunk-AD3EAEY6.js.br +0 -0
  93. package/dist/chunk-AD3EAEY6.js.gz +0 -0
  94. package/dist/chunk-JUFGTL2A.js.br +0 -0
  95. package/dist/chunk-JUFGTL2A.js.gz +0 -0
  96. package/dist/chunk-KA7ST7IH.js.br +0 -0
  97. package/dist/chunk-KA7ST7IH.js.gz +0 -0
  98. package/dist/chunk-OIAKQGMC.mjs.br +0 -0
  99. package/dist/chunk-OIAKQGMC.mjs.gz +0 -0
  100. package/dist/chunk-VSNXVKJI.js.br +0 -0
  101. package/dist/chunk-VSNXVKJI.js.gz +0 -0
  102. package/dist/dist-3YRZ26TL.mjs.br +0 -0
  103. package/dist/dist-3YRZ26TL.mjs.gz +0 -0
  104. package/dist/dist-M2P6HBG4.js.br +0 -0
  105. package/dist/dist-M2P6HBG4.js.gz +0 -0
  106. package/dist/index-SUL_8gq8.d.ts.map +0 -1
package/CHANGELOG.md CHANGED
@@ -4,6 +4,8 @@ All notable changes to this project are documented here.
4
4
  This file is generated from [Conventional Commits](https://www.conventionalcommits.org)
5
5
  by [git-cliff](https://git-cliff.org); do not edit it by hand.
6
6
 
7
+ ## [1.22.2](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-react-viewer@1.22.2) - 2026-07-18
8
+
7
9
  ## [1.22.1](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-react-viewer@1.22.1) - 2026-07-18
8
10
 
9
11
  ## [1.22.0](https://github.com/ChristopherVR/pptx-viewer/releases/tag/pptx-react-viewer@1.22.0) - 2026-07-17
@@ -1,5 +1,5 @@
1
- import { mountModel3D } from './chunk-5SBQZEKD.mjs';
2
- import './chunk-3ZGCM6RC.mjs';
1
+ import { mountModel3D } from './chunk-I42XL2WU.mjs';
2
+ import './chunk-AFWMAFWR.mjs';
3
3
  import './chunk-6DZX6EAA.mjs';
4
4
  import { useRef, useEffect } from 'react';
5
5
  import { jsx } from 'react/jsx-runtime';
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkVSNXVKJI_js = require('./chunk-VSNXVKJI.js');
4
- require('./chunk-AD3EAEY6.js');
3
+ var chunk2DXNTVFV_js = require('./chunk-2DXNTVFV.js');
4
+ require('./chunk-MS6S6YYR.js');
5
5
  require('./chunk-QGM4M3NI.js');
6
6
  var react = require('react');
7
7
  var jsxRuntime = require('react/jsx-runtime');
@@ -15,7 +15,7 @@ function Model3DScene({ modelUrl, interactive, width, height }) {
15
15
  return;
16
16
  }
17
17
  let disposed = false;
18
- void chunkVSNXVKJI_js.mountModel3D(container, modelUrl, { width, height, interactive }).then((handle) => {
18
+ void chunk2DXNTVFV_js.mountModel3D(container, modelUrl, { width, height, interactive }).then((handle) => {
19
19
  if (disposed) {
20
20
  handle.dispose();
21
21
  } else {
Binary file
Binary file
@@ -1,4 +1,4 @@
1
- import { f as PowerPointViewerHandle, p as PowerPointViewerProps } from "./types-Cdh0XYcS.js";
1
+ import { f as PowerPointViewerHandle, p as PowerPointViewerProps } from "./types-Da1M5VBY.js";
2
2
  import { PptxAnimationPreset, PptxNativeAnimation } from "pptx-viewer-core";
3
3
  import "pptx-viewer-shared";
4
4
  import React from "react";
@@ -18,4 +18,4 @@ declare function getAnimationInitialStyle(preset: PptxAnimationPreset | undefine
18
18
  declare const PowerPointViewer: import("react").ForwardRefExoticComponent<PowerPointViewerProps & import("react").RefAttributes<PowerPointViewerHandle>>;
19
19
  //#endregion
20
20
  export { getAnimationInitialStyle as n, PowerPointViewer as t };
21
- //# sourceMappingURL=PowerPointViewer-WGVR_u4z.d.ts.map
21
+ //# sourceMappingURL=PowerPointViewer-DFTatVS4.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"PowerPointViewer-WGVR_u4z.d.ts","names":[],"sources":["../src/viewer/utils/animation-effects.ts","../src/viewer/PowerPointViewer.tsx"],"mappings":";;;;;iBAmBgB,yBACf,QAAQ,iCACR,kBAAkB,sBAChB,MAAM;;;;;;;;;;;;cC4EI,kCAAgB,0BAAA,wCAAA,cAAA"}
1
+ {"version":3,"file":"PowerPointViewer-DFTatVS4.d.ts","names":[],"sources":["../src/viewer/utils/animation-effects.ts","../src/viewer/PowerPointViewer.tsx"],"mappings":";;;;;iBAmBgB,yBACf,QAAQ,iCACR,kBAAkB,sBAChB,MAAM;;;;;;;;;;;;cC4EI,kCAAgB,0BAAA,wCAAA,cAAA"}
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkVSNXVKJI_js = require('./chunk-VSNXVKJI.js');
4
- require('./chunk-AD3EAEY6.js');
3
+ var chunk2DXNTVFV_js = require('./chunk-2DXNTVFV.js');
4
+ require('./chunk-MS6S6YYR.js');
5
5
  require('./chunk-QGM4M3NI.js');
6
6
  var react = require('react');
7
7
  var jsxRuntime = require('react/jsx-runtime');
@@ -26,7 +26,7 @@ function SurfaceChart3DScene({
26
26
  return;
27
27
  }
28
28
  let disposed = false;
29
- void chunkVSNXVKJI_js.mountSurfaceChart3D(container, {
29
+ void chunk2DXNTVFV_js.mountSurfaceChart3D(container, {
30
30
  cols,
31
31
  rows,
32
32
  heightMap,
@@ -1,5 +1,5 @@
1
- import { mountSurfaceChart3D } from './chunk-5SBQZEKD.mjs';
2
- import './chunk-3ZGCM6RC.mjs';
1
+ import { mountSurfaceChart3D } from './chunk-I42XL2WU.mjs';
2
+ import './chunk-AFWMAFWR.mjs';
3
3
  import './chunk-6DZX6EAA.mjs';
4
4
  import { useRef, useEffect } from 'react';
5
5
  import { jsxs, jsx } from 'react/jsx-runtime';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkAD3EAEY6_js = require('./chunk-AD3EAEY6.js');
3
+ var chunkMS6S6YYR_js = require('./chunk-MS6S6YYR.js');
4
4
  var DOMPurify = require('dompurify');
5
5
 
6
6
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -108,6 +108,10 @@ var COLOR_KEY_TO_CSS = {
108
108
  input: "input",
109
109
  ring: "ring"
110
110
  };
111
+ var DERIVED_COLOR_TOKENS = [
112
+ { source: "primary", cssSuffix: "inspector-active" },
113
+ { source: "border", cssSuffix: "inspector-border" }
114
+ ];
111
115
  function themeToCssVars(theme, omitDefaults = false) {
112
116
  const vars = {};
113
117
  if (!theme) {
@@ -126,6 +130,16 @@ function themeToCssVars(theme, omitDefaults = false) {
126
130
  vars[`--pptx-${cssSuffix}`] = value;
127
131
  vars[`--color-${cssSuffix}`] = value;
128
132
  }
133
+ for (const { source, cssSuffix } of DERIVED_COLOR_TOKENS) {
134
+ const value = colors[source];
135
+ if (value === void 0) {
136
+ continue;
137
+ }
138
+ if (omitDefaults && value === defaultThemeColors[source]) {
139
+ continue;
140
+ }
141
+ vars[`--pptx-${cssSuffix}`] = value;
142
+ }
129
143
  }
130
144
  if (theme.radius !== void 0) {
131
145
  if (!omitDefaults || theme.radius !== defaultRadius) {
@@ -149,6 +163,9 @@ function defaultCssVars() {
149
163
  for (const [key, cssSuffix] of Object.entries(COLOR_KEY_TO_CSS)) {
150
164
  vars[`--pptx-${cssSuffix}`] = defaultThemeColors[key];
151
165
  }
166
+ for (const { source, cssSuffix } of DERIVED_COLOR_TOKENS) {
167
+ vars[`--pptx-${cssSuffix}`] = defaultThemeColors[source];
168
+ }
152
169
  vars["--pptx-radius"] = defaultRadius;
153
170
  return vars;
154
171
  }
@@ -290,7 +307,7 @@ function buildInitialGuides(presentationGuides, firstSlideGuides) {
290
307
  guides.push({
291
308
  id: g.id,
292
309
  axis: g.orientation === "horz" ? "h" : "v",
293
- position: chunkAD3EAEY6_js.guideEmuToPx(g.positionEmu)
310
+ position: chunkMS6S6YYR_js.guideEmuToPx(g.positionEmu)
294
311
  });
295
312
  }
296
313
  }
@@ -299,7 +316,7 @@ function buildInitialGuides(presentationGuides, firstSlideGuides) {
299
316
  guides.push({
300
317
  id: g.id,
301
318
  axis: g.orientation === "horz" ? "h" : "v",
302
- position: chunkAD3EAEY6_js.guideEmuToPx(g.positionEmu)
319
+ position: chunkMS6S6YYR_js.guideEmuToPx(g.positionEmu)
303
320
  });
304
321
  }
305
322
  }
@@ -312,23 +329,23 @@ function getResolvedShapeClipPathFor(shapeType, width, height, adjustments) {
312
329
  return void 0;
313
330
  }
314
331
  if (!Number.isFinite(width) || !Number.isFinite(height) || width <= 0 || height <= 0) {
315
- return chunkAD3EAEY6_js.getShapeClipPath(shapeType);
332
+ return chunkMS6S6YYR_js.getShapeClipPath(shapeType);
316
333
  }
317
334
  if (adjustments && Object.keys(adjustments).length > 0) {
318
- const adjusted = chunkAD3EAEY6_js.getAdjustmentAwareShapeClipPath(shapeType, width, height, adjustments);
335
+ const adjusted = chunkMS6S6YYR_js.getAdjustmentAwareShapeClipPath(shapeType, width, height, adjustments);
319
336
  if (adjusted !== void 0) {
320
337
  return adjusted;
321
338
  }
322
339
  }
323
- const fromPreset = chunkAD3EAEY6_js.getShapeClipPathFromPreset(shapeType, width, height, adjustments);
340
+ const fromPreset = chunkMS6S6YYR_js.getShapeClipPathFromPreset(shapeType, width, height, adjustments);
324
341
  if (fromPreset !== void 0) {
325
342
  return fromPreset;
326
343
  }
327
- const cloud = chunkAD3EAEY6_js.getCloudPathForRendering(shapeType, width, height);
344
+ const cloud = chunkMS6S6YYR_js.getCloudPathForRendering(shapeType, width, height);
328
345
  if (cloud !== void 0) {
329
346
  return cloud;
330
347
  }
331
- return chunkAD3EAEY6_js.getShapeClipPath(shapeType);
348
+ return chunkMS6S6YYR_js.getShapeClipPath(shapeType);
332
349
  }
333
350
  function getResolvedShapeClipPath(element, width, height) {
334
351
  const shapeType = element.shapeType;
@@ -1043,7 +1060,7 @@ var DEFAULT_SCHEME_COLOR_MAP = {
1043
1060
  phclr: "#4472C4"
1044
1061
  };
1045
1062
  function applyDrawingColorTransforms2(baseColor, colorNode) {
1046
- return chunkAD3EAEY6_js.applyDrawingColorTransforms(baseColor, colorNode);
1063
+ return chunkMS6S6YYR_js.applyDrawingColorTransforms(baseColor, colorNode);
1047
1064
  }
1048
1065
  function parseDrawingColorChoice(colorNode, schemeColorOverrides) {
1049
1066
  if (!colorNode) {
@@ -1095,7 +1112,7 @@ function parseDrawingColorChoice(colorNode, schemeColorOverrides) {
1095
1112
  const h = hueRaw / 6e4;
1096
1113
  const s = clampUnitInterval(satRaw / 1e5);
1097
1114
  const l = clampUnitInterval(lumRaw / 1e5);
1098
- const rgb = chunkAD3EAEY6_js.hslToRgb(h, s, l);
1115
+ const rgb = chunkMS6S6YYR_js.hslToRgb(h, s, l);
1099
1116
  const toHex = (value) => Math.min(255, Math.max(0, Math.round(value))).toString(16).padStart(2, "0").toUpperCase();
1100
1117
  const base = `#${toHex(rgb.r)}${toHex(rgb.g)}${toHex(rgb.b)}`;
1101
1118
  return applyDrawingColorTransforms2(base, hslNode);
@@ -1105,7 +1122,7 @@ function parseDrawingColorChoice(colorNode, schemeColorOverrides) {
1105
1122
  const preset = String(
1106
1123
  colorNode["a:prstClr"]?.["@_val"] || ""
1107
1124
  ).toLowerCase();
1108
- const mapped = chunkAD3EAEY6_js.PRESET_COLOR_MAP[preset];
1125
+ const mapped = chunkMS6S6YYR_js.PRESET_COLOR_MAP[preset];
1109
1126
  if (!mapped) {
1110
1127
  return void 0;
1111
1128
  }
@@ -1460,7 +1477,7 @@ function hexToRgbUnit2(hex) {
1460
1477
  };
1461
1478
  }
1462
1479
  function getEffects(element) {
1463
- if (!chunkAD3EAEY6_js.isImageLikeElement(element)) {
1480
+ if (!chunkMS6S6YYR_js.isImageLikeElement(element)) {
1464
1481
  return void 0;
1465
1482
  }
1466
1483
  return element.imageEffects;
@@ -1649,7 +1666,7 @@ function buildDuotoneFilterMarkup(color1, color2) {
1649
1666
  const c2 = hexToRgbUnit2(color2);
1650
1667
  return `<feColorMatrix type="matrix" values="${GRAYSCALE_LUMINANCE_MATRIX}"/><feComponentTransfer><feFuncR type="linear" slope="${c2.r - c1.r}" intercept="${c1.r}"/><feFuncG type="linear" slope="${c2.g - c1.g}" intercept="${c1.g}"/><feFuncB type="linear" slope="${c2.b - c1.b}" intercept="${c1.b}"/></feComponentTransfer>`;
1651
1668
  }
1652
- function getDuotoneImageFilter(element, elementId = chunkAD3EAEY6_js.isImageLikeElement(element) ? element.id : "") {
1669
+ function getDuotoneImageFilter(element, elementId = chunkMS6S6YYR_js.isImageLikeElement(element) ? element.id : "") {
1653
1670
  const effects = getEffects(element);
1654
1671
  if (!effects?.duotone) {
1655
1672
  return void 0;
@@ -1751,7 +1768,7 @@ function buildImageAlphaFilterMarkup(effects) {
1751
1768
  }
1752
1769
  return parts.length > 0 ? parts.join("") : void 0;
1753
1770
  }
1754
- function getImageAlphaFilter(element, elementId = chunkAD3EAEY6_js.isImageLikeElement(element) ? element.id : "") {
1771
+ function getImageAlphaFilter(element, elementId = chunkMS6S6YYR_js.isImageLikeElement(element) ? element.id : "") {
1755
1772
  const effects = getEffects(element);
1756
1773
  if (!effects || !hasAdvancedImageAlphaEffects(element)) {
1757
1774
  return void 0;
@@ -1841,7 +1858,7 @@ function buildArtisticFilterMarkup(effectName, radius) {
1841
1858
  return void 0;
1842
1859
  }
1843
1860
  }
1844
- function getArtisticImageFilter(element, elementId = chunkAD3EAEY6_js.isImageLikeElement(element) ? element.id : "") {
1861
+ function getArtisticImageFilter(element, elementId = chunkMS6S6YYR_js.isImageLikeElement(element) ? element.id : "") {
1845
1862
  const effects = getEffects(element);
1846
1863
  if (!effects?.artisticEffect || !needsSvgArtisticFilter(effects.artisticEffect)) {
1847
1864
  return void 0;
@@ -3052,6 +3069,47 @@ function tokenize(latex) {
3052
3069
  }
3053
3070
  return tokens;
3054
3071
  }
3072
+ function mergesLosslessly(nodes) {
3073
+ const seen = /* @__PURE__ */ new Set();
3074
+ let previous = "";
3075
+ for (const node of nodes) {
3076
+ for (const key of Object.keys(node)) {
3077
+ if (node[key] === void 0) {
3078
+ continue;
3079
+ }
3080
+ if (key !== previous && seen.has(key)) {
3081
+ return false;
3082
+ }
3083
+ seen.add(key);
3084
+ previous = key;
3085
+ }
3086
+ }
3087
+ return true;
3088
+ }
3089
+ function mergeSiblings(nodes) {
3090
+ if (!mergesLosslessly(nodes)) {
3091
+ return { "m:box": nodes.map((node) => ({ "m:e": node })) };
3092
+ }
3093
+ const result = {};
3094
+ for (const node of nodes) {
3095
+ for (const key of Object.keys(node)) {
3096
+ if (node[key] === void 0) {
3097
+ continue;
3098
+ }
3099
+ if (result[key]) {
3100
+ const existing = result[key];
3101
+ if (Array.isArray(existing)) {
3102
+ existing.push(node[key]);
3103
+ } else {
3104
+ result[key] = [existing, node[key]];
3105
+ }
3106
+ } else {
3107
+ result[key] = node[key];
3108
+ }
3109
+ }
3110
+ }
3111
+ return result;
3112
+ }
3055
3113
  function tryParseScripts(ctx, base) {
3056
3114
  let hasSup = false;
3057
3115
  let hasSub = false;
@@ -3233,25 +3291,11 @@ var LatexParser = class {
3233
3291
  "m:sSubSup": nodes[0]["m:sSubSup"],
3234
3292
  "m:nary": nodes[0]["m:nary"],
3235
3293
  "m:d": nodes[0]["m:d"],
3236
- "m:func": nodes[0]["m:func"]
3294
+ "m:func": nodes[0]["m:func"],
3295
+ "m:box": nodes[0]["m:box"]
3237
3296
  };
3238
3297
  }
3239
- const result = {};
3240
- for (const n of nodes) {
3241
- for (const key of Object.keys(n)) {
3242
- if (result[key]) {
3243
- const existing = result[key];
3244
- if (Array.isArray(existing)) {
3245
- existing.push(n[key]);
3246
- } else {
3247
- result[key] = [existing, n[key]];
3248
- }
3249
- } else {
3250
- result[key] = n[key];
3251
- }
3252
- }
3253
- }
3254
- return result;
3298
+ return mergeSiblings(nodes);
3255
3299
  }
3256
3300
  makeRun(text, normal = false) {
3257
3301
  const run = { "m:t": text };
@@ -3398,21 +3442,7 @@ function convertLatexToOmml(latex) {
3398
3442
  if (nodes.length === 0) {
3399
3443
  return {};
3400
3444
  }
3401
- const oMath = {};
3402
- for (const node of nodes) {
3403
- for (const key of Object.keys(node)) {
3404
- if (oMath[key]) {
3405
- const existing = oMath[key];
3406
- if (Array.isArray(existing)) {
3407
- existing.push(node[key]);
3408
- } else {
3409
- oMath[key] = [existing, node[key]];
3410
- }
3411
- } else {
3412
- oMath[key] = node[key];
3413
- }
3414
- }
3415
- }
3445
+ const oMath = mergeSiblings(nodes);
3416
3446
  return {
3417
3447
  "m:oMathPara": {
3418
3448
  "m:oMath": oMath
@@ -3576,6 +3606,10 @@ function ommlElementToLatex(tag, node) {
3576
3606
  const body = ommlChildrenToLatex(childNode(node, "m:e"));
3577
3607
  return `${fName}{${body}}`;
3578
3608
  }
3609
+ case "m:box":
3610
+ case "m:borderBox": {
3611
+ return ensureArr(node["m:e"]).map((e) => ommlChildrenToLatex(e)).join("");
3612
+ }
3579
3613
  case "m:oMath":
3580
3614
  return ommlChildrenToLatex(node);
3581
3615
  default:
@@ -3597,6 +3631,68 @@ function convertOmmlToLatex(omml) {
3597
3631
  }
3598
3632
  return ommlChildrenToLatex(oMath);
3599
3633
  }
3634
+ var EQUATION_TEMPLATES = [
3635
+ {
3636
+ label: "Fraction",
3637
+ latex: "\\frac{a}{b}",
3638
+ i18nKey: "pptx.equation.template.fraction"
3639
+ },
3640
+ {
3641
+ label: "Quadratic",
3642
+ latex: "x=\\frac{-b\\pm\\sqrt{b^{2}-4ac}}{2a}",
3643
+ i18nKey: "pptx.equation.template.quadratic"
3644
+ },
3645
+ {
3646
+ label: "Pythagorean",
3647
+ latex: "a^{2}+b^{2}=c^{2}",
3648
+ i18nKey: "pptx.equation.template.pythagorean"
3649
+ },
3650
+ {
3651
+ label: "Sum",
3652
+ latex: "\\sum_{i=1}^{n}{a_{i}}",
3653
+ i18nKey: "pptx.equation.template.sum"
3654
+ },
3655
+ {
3656
+ label: "Integral",
3657
+ latex: "\\int_{a}^{b}{f(x)}dx",
3658
+ i18nKey: "pptx.equation.template.integral"
3659
+ },
3660
+ {
3661
+ label: "Square Root",
3662
+ latex: "\\sqrt{x^{2}+y^{2}}",
3663
+ i18nKey: "pptx.equation.template.squareRoot"
3664
+ },
3665
+ {
3666
+ label: "Limit",
3667
+ latex: "\\lim_{x\\to\\infty}{f(x)}",
3668
+ i18nKey: "pptx.equation.template.limit"
3669
+ },
3670
+ {
3671
+ label: "Euler's",
3672
+ latex: "e^{i\\pi}+1=0",
3673
+ i18nKey: "pptx.equation.template.euler"
3674
+ },
3675
+ {
3676
+ label: "Matrix 2x2",
3677
+ latex: "\\left[a,b;c,d\\right]",
3678
+ i18nKey: "pptx.equation.template.matrix"
3679
+ },
3680
+ {
3681
+ label: "Binomial",
3682
+ latex: "\\left(a+b\\right)^{n}",
3683
+ i18nKey: "pptx.equation.template.binomial"
3684
+ },
3685
+ {
3686
+ label: "Derivative",
3687
+ latex: "\\frac{dy}{dx}",
3688
+ i18nKey: "pptx.equation.template.derivative"
3689
+ },
3690
+ {
3691
+ label: "Trig Identity",
3692
+ latex: "\\sin^{2}\\theta+\\cos^{2}\\theta=1",
3693
+ i18nKey: "pptx.equation.template.trigIdentity"
3694
+ }
3695
+ ];
3600
3696
  var ACCENT1 = "#4472C4";
3601
3697
  var ACCENT2 = "#ED7D31";
3602
3698
  var ACCENT3 = "#A5A5A5";
@@ -12018,7 +12114,7 @@ function rotateDelta(dx, dy, rotationDeg) {
12018
12114
  }
12019
12115
  function applyResize(box, handle, dxScreen, dyScreen, zoom, opts = {}) {
12020
12116
  const scale = zoom || 1;
12021
- const minSize = opts.minSize ?? chunkAD3EAEY6_js.MIN_ELEMENT_SIZE;
12117
+ const minSize = opts.minSize ?? chunkMS6S6YYR_js.MIN_ELEMENT_SIZE;
12022
12118
  const rotation = rotationOf(box);
12023
12119
  const local = rotateDelta(dxScreen / scale, dyScreen / scale, rotation);
12024
12120
  const dx = local.x;
@@ -12045,7 +12141,7 @@ function applyResize(box, handle, dxScreen, dyScreen, zoom, opts = {}) {
12045
12141
  }
12046
12142
  return { x: newX, y: newY, width: newW, height: newH, rotation };
12047
12143
  }
12048
- function snapBoxToGrid(box, handle, gridSpacingPx, minSize = chunkAD3EAEY6_js.MIN_ELEMENT_SIZE) {
12144
+ function snapBoxToGrid(box, handle, gridSpacingPx, minSize = chunkMS6S6YYR_js.MIN_ELEMENT_SIZE) {
12049
12145
  if (handle === null || gridSpacingPx <= 0) {
12050
12146
  return box;
12051
12147
  }
@@ -12075,7 +12171,7 @@ function snapBoxToGrid(box, handle, gridSpacingPx, minSize = chunkAD3EAEY6_js.MI
12075
12171
  }
12076
12172
  return { x, y, width, height };
12077
12173
  }
12078
- function computeMarqueeHitIds(marquee, elements, minSize = chunkAD3EAEY6_js.MIN_ELEMENT_SIZE) {
12174
+ function computeMarqueeHitIds(marquee, elements, minSize = chunkMS6S6YYR_js.MIN_ELEMENT_SIZE) {
12079
12175
  const minX = Math.min(marquee.startX, marquee.currentX);
12080
12176
  const minY = Math.min(marquee.startY, marquee.currentY);
12081
12177
  const maxX = Math.max(marquee.startX, marquee.currentX);
@@ -13630,7 +13726,7 @@ var THEME_COLOR_LABELS = {
13630
13726
  };
13631
13727
  function buildThemeColorGrid(colorScheme) {
13632
13728
  return THEME_COLOR_TINT_ROWS.map(
13633
- (row) => chunkAD3EAEY6_js.THEME_COLOR_SCHEME_KEYS.map((key) => ({
13729
+ (row) => chunkMS6S6YYR_js.THEME_COLOR_SCHEME_KEYS.map((key) => ({
13634
13730
  hex: row.transform(colorScheme[key]),
13635
13731
  schemeKey: key,
13636
13732
  rowLabel: row.label,
@@ -14106,7 +14202,7 @@ function svgLineCap(lineCap) {
14106
14202
  }
14107
14203
  function copyFormatFromElement(element) {
14108
14204
  const result = {};
14109
- if (chunkAD3EAEY6_js.hasShapeProperties(element) && element.shapeStyle) {
14205
+ if (chunkMS6S6YYR_js.hasShapeProperties(element) && element.shapeStyle) {
14110
14206
  const s = element.shapeStyle;
14111
14207
  result.shapeStyle = {
14112
14208
  fillColor: s.fillColor,
@@ -14135,7 +14231,7 @@ function copyFormatFromElement(element) {
14135
14231
  softEdgeRadius: s.softEdgeRadius
14136
14232
  };
14137
14233
  }
14138
- if (chunkAD3EAEY6_js.hasTextProperties(element) && element.textStyle) {
14234
+ if (chunkMS6S6YYR_js.hasTextProperties(element) && element.textStyle) {
14139
14235
  const t = element.textStyle;
14140
14236
  result.textStyle = {
14141
14237
  fontFamily: t.fontFamily,
@@ -14166,7 +14262,7 @@ function definedEntries(obj) {
14166
14262
  }
14167
14263
  function applyFormatToElement(element, format) {
14168
14264
  let updated = { ...element };
14169
- if (format.shapeStyle && chunkAD3EAEY6_js.hasShapeProperties(updated)) {
14265
+ if (format.shapeStyle && chunkMS6S6YYR_js.hasShapeProperties(updated)) {
14170
14266
  updated = {
14171
14267
  ...updated,
14172
14268
  shapeStyle: {
@@ -14175,7 +14271,7 @@ function applyFormatToElement(element, format) {
14175
14271
  }
14176
14272
  };
14177
14273
  }
14178
- if (format.textStyle && chunkAD3EAEY6_js.hasTextProperties(updated)) {
14274
+ if (format.textStyle && chunkMS6S6YYR_js.hasTextProperties(updated)) {
14179
14275
  updated = {
14180
14276
  ...updated,
14181
14277
  textStyle: {
@@ -14190,7 +14286,7 @@ function hasCopyableFormat(element) {
14190
14286
  if (!element) {
14191
14287
  return false;
14192
14288
  }
14193
- return chunkAD3EAEY6_js.hasShapeProperties(element) || chunkAD3EAEY6_js.hasTextProperties(element);
14289
+ return chunkMS6S6YYR_js.hasShapeProperties(element) || chunkMS6S6YYR_js.hasTextProperties(element);
14194
14290
  }
14195
14291
  function copySegmentMetadata(from, to) {
14196
14292
  if (from.equationXml !== void 0) {
@@ -14327,7 +14423,7 @@ function getRoundRectRadiusPx(element) {
14327
14423
  return Math.min(Math.max(element.width, 1), Math.max(element.height, 1)) * 0.5 * normalizedAdjustment;
14328
14424
  }
14329
14425
  function getShapeAdjustmentHandleDescriptor(element) {
14330
- if (!chunkAD3EAEY6_js.hasShapeProperties(element)) {
14426
+ if (!chunkMS6S6YYR_js.hasShapeProperties(element)) {
14331
14427
  return null;
14332
14428
  }
14333
14429
  const normalizedShapeType = String(element.shapeType || "").toLowerCase();
@@ -15318,7 +15414,7 @@ function createSyncGate(onOpen, graceMs = INITIAL_SYNC_GRACE_MS) {
15318
15414
  var POSITION_THRESHOLD = 2;
15319
15415
  var SIZE_THRESHOLD = 2;
15320
15416
  function getElementText(element) {
15321
- if (!chunkAD3EAEY6_js.hasTextProperties(element)) {
15417
+ if (!chunkMS6S6YYR_js.hasTextProperties(element)) {
15322
15418
  return "";
15323
15419
  }
15324
15420
  if (element.textSegments && element.textSegments.length > 0) {
@@ -18892,7 +18988,7 @@ function getAriaRole(element) {
18892
18988
  case "model3d":
18893
18989
  return "img";
18894
18990
  case "shape": {
18895
- if (chunkAD3EAEY6_js.hasTextProperties(element) && element.text) {
18991
+ if (chunkMS6S6YYR_js.hasTextProperties(element) && element.text) {
18896
18992
  return "group";
18897
18993
  }
18898
18994
  return "img";
@@ -18905,7 +19001,7 @@ function getAriaLabel(element) {
18905
19001
  if ((element.type === "image" || element.type === "picture") && "altText" in element && typeof element.altText === "string" && element.altText.trim()) {
18906
19002
  return element.altText.trim();
18907
19003
  }
18908
- if (chunkAD3EAEY6_js.hasTextProperties(element) && element.text) {
19004
+ if (chunkMS6S6YYR_js.hasTextProperties(element) && element.text) {
18909
19005
  const text = element.text.trim();
18910
19006
  if (text) {
18911
19007
  return text.length > 120 ? `${text.slice(0, 117)}...` : text;
@@ -19312,7 +19408,7 @@ var DEFAULT_CHART_POSITION = { x: 120, y: 120, width: 480, height: 320 };
19312
19408
  var DEFAULT_CATEGORIES = ["Category 1", "Category 2", "Category 3"];
19313
19409
  var DEFAULT_SERIES_VALUES = [4, 3, 5];
19314
19410
  function createDefaultChartElement(chartType = DEFAULT_INSERT_CHART_TYPE, position) {
19315
- return chunkAD3EAEY6_js.createChartElement(
19411
+ return chunkMS6S6YYR_js.createChartElement(
19316
19412
  chartType,
19317
19413
  {
19318
19414
  categories: [...DEFAULT_CATEGORIES],
@@ -20332,7 +20428,7 @@ function computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight,
20332
20428
  };
20333
20429
  }
20334
20430
  function collectFontsFromElement(element, fonts) {
20335
- if (chunkAD3EAEY6_js.hasTextProperties(element)) {
20431
+ if (chunkMS6S6YYR_js.hasTextProperties(element)) {
20336
20432
  if (element.textStyle?.fontFamily) {
20337
20433
  fonts.add(element.textStyle.fontFamily);
20338
20434
  }
@@ -22154,6 +22250,7 @@ exports.DEFAULT_VIEWER_PROFILE = DEFAULT_VIEWER_PROFILE;
22154
22250
  exports.DEFAULT_VIRTUAL_OVERSCAN = DEFAULT_VIRTUAL_OVERSCAN;
22155
22251
  exports.DIRECTIONAL_PRESETS = DIRECTIONAL_PRESETS;
22156
22252
  exports.DUOTONE_PRESETS = DUOTONE_PRESETS;
22253
+ exports.EQUATION_TEMPLATES = EQUATION_TEMPLATES;
22157
22254
  exports.EXPORT_ASSEMBLING_PERCENT = EXPORT_ASSEMBLING_PERCENT;
22158
22255
  exports.EXPORT_DONE_PERCENT = EXPORT_DONE_PERCENT;
22159
22256
  exports.FILL_MODE_OPTIONS = FILL_MODE_OPTIONS;
Binary file
Binary file