pptx-react-viewer 2.4.0 → 2.5.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 (102) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/{AiChatPanel-SXYMXFYS.mjs → AiChatPanel-EMF3UYCE.mjs} +3 -3
  3. package/dist/AiChatPanel-EMF3UYCE.mjs.br +0 -0
  4. package/dist/AiChatPanel-EMF3UYCE.mjs.gz +0 -0
  5. package/dist/{AiChatPanel-HLLGXBZF.js → AiChatPanel-OHSLJNYG.js} +22 -22
  6. package/dist/AiChatPanel-OHSLJNYG.js.br +0 -0
  7. package/dist/AiChatPanel-OHSLJNYG.js.gz +0 -0
  8. package/dist/{Model3DScene-ZQBWLAMC.js → Model3DScene-ULHIJPMU.js} +2 -2
  9. package/dist/Model3DScene-ULHIJPMU.js.br +0 -0
  10. package/dist/Model3DScene-ULHIJPMU.js.gz +0 -0
  11. package/dist/{Model3DScene-IECT4RWT.mjs → Model3DScene-X6QJTWHV.mjs} +1 -1
  12. package/dist/{Model3DScene-IECT4RWT.mjs.br → Model3DScene-X6QJTWHV.mjs.br} +0 -0
  13. package/dist/Model3DScene-X6QJTWHV.mjs.gz +0 -0
  14. package/dist/{SurfaceChart3DScene-4KRMRWW6.js → SurfaceChart3DScene-K7Q5NYZ4.js} +2 -2
  15. package/dist/SurfaceChart3DScene-K7Q5NYZ4.js.br +0 -0
  16. package/dist/SurfaceChart3DScene-K7Q5NYZ4.js.gz +0 -0
  17. package/dist/{SurfaceChart3DScene-52C3IMPQ.mjs → SurfaceChart3DScene-PRCKQJQQ.mjs} +1 -1
  18. package/dist/{SurfaceChart3DScene-52C3IMPQ.mjs.br → SurfaceChart3DScene-PRCKQJQQ.mjs.br} +0 -0
  19. package/dist/SurfaceChart3DScene-PRCKQJQQ.mjs.gz +0 -0
  20. package/dist/{chunk-VEZO33T2.js → chunk-7Q7AEPO7.js} +378 -324
  21. package/dist/chunk-7Q7AEPO7.js.br +0 -0
  22. package/dist/chunk-7Q7AEPO7.js.gz +0 -0
  23. package/dist/{chunk-XSBFV6TL.js → chunk-I4AFCPUC.js} +843 -844
  24. package/dist/chunk-I4AFCPUC.js.br +0 -0
  25. package/dist/chunk-I4AFCPUC.js.gz +0 -0
  26. package/dist/{chunk-KK7FWBGO.mjs → chunk-JSFUU2BB.mjs} +7 -8
  27. package/dist/chunk-JSFUU2BB.mjs.br +0 -0
  28. package/dist/chunk-JSFUU2BB.mjs.gz +0 -0
  29. package/dist/{chunk-LRIXPSVT.mjs → chunk-LIQGO45T.mjs} +72 -18
  30. package/dist/chunk-LIQGO45T.mjs.br +0 -0
  31. package/dist/chunk-LIQGO45T.mjs.gz +0 -0
  32. package/dist/{chunk-WK56SFN7.js → chunk-LTEDT475.js} +392 -68
  33. package/dist/chunk-LTEDT475.js.br +0 -0
  34. package/dist/chunk-LTEDT475.js.gz +0 -0
  35. package/dist/{chunk-5GHLRHBR.js → chunk-MJAEB43A.js} +3 -3
  36. package/dist/chunk-MJAEB43A.js.br +0 -0
  37. package/dist/chunk-MJAEB43A.js.gz +0 -0
  38. package/dist/{chunk-5TPQJWEO.js → chunk-NVH3RIN7.js} +271 -279
  39. package/dist/chunk-NVH3RIN7.js.br +0 -0
  40. package/dist/chunk-NVH3RIN7.js.gz +0 -0
  41. package/dist/{chunk-G6Q3NXRV.mjs → chunk-TGVID6BB.mjs} +40 -48
  42. package/dist/chunk-TGVID6BB.mjs.br +0 -0
  43. package/dist/chunk-TGVID6BB.mjs.gz +0 -0
  44. package/dist/{chunk-QBZA2GMB.mjs → chunk-VOV2N3NY.mjs} +388 -69
  45. package/dist/chunk-VOV2N3NY.mjs.br +0 -0
  46. package/dist/chunk-VOV2N3NY.mjs.gz +0 -0
  47. package/dist/{chunk-Q6FC2552.mjs → chunk-WJKMTDXS.mjs} +1 -1
  48. package/dist/chunk-WJKMTDXS.mjs.br +0 -0
  49. package/dist/chunk-WJKMTDXS.mjs.gz +0 -0
  50. package/dist/index.d.ts +33 -0
  51. package/dist/index.js +34 -34
  52. package/dist/index.js.br +0 -0
  53. package/dist/index.js.gz +0 -0
  54. package/dist/index.mjs +5 -5
  55. package/dist/index.mjs.br +0 -0
  56. package/dist/index.mjs.gz +0 -0
  57. package/dist/internals.d.ts +58 -1
  58. package/dist/internals.d.ts.map +1 -1
  59. package/dist/internals.js +78 -78
  60. package/dist/internals.js.br +0 -0
  61. package/dist/internals.js.gz +0 -0
  62. package/dist/internals.mjs +3 -3
  63. package/dist/internals.mjs.br +0 -0
  64. package/dist/internals.mjs.gz +0 -0
  65. package/dist/viewer/index.d.ts +33 -0
  66. package/dist/viewer/index.js +21 -21
  67. package/dist/viewer/index.js.br +0 -0
  68. package/dist/viewer/index.js.gz +0 -0
  69. package/dist/viewer/index.mjs +5 -5
  70. package/dist/viewer/index.mjs.br +0 -0
  71. package/dist/viewer/index.mjs.gz +0 -0
  72. package/package.json +1 -1
  73. package/dist/AiChatPanel-HLLGXBZF.js.br +0 -0
  74. package/dist/AiChatPanel-HLLGXBZF.js.gz +0 -0
  75. package/dist/AiChatPanel-SXYMXFYS.mjs.br +0 -0
  76. package/dist/AiChatPanel-SXYMXFYS.mjs.gz +0 -0
  77. package/dist/Model3DScene-IECT4RWT.mjs.gz +0 -0
  78. package/dist/Model3DScene-ZQBWLAMC.js.br +0 -0
  79. package/dist/Model3DScene-ZQBWLAMC.js.gz +0 -0
  80. package/dist/SurfaceChart3DScene-4KRMRWW6.js.br +0 -0
  81. package/dist/SurfaceChart3DScene-4KRMRWW6.js.gz +0 -0
  82. package/dist/SurfaceChart3DScene-52C3IMPQ.mjs.gz +0 -0
  83. package/dist/chunk-5GHLRHBR.js.br +0 -0
  84. package/dist/chunk-5GHLRHBR.js.gz +0 -0
  85. package/dist/chunk-5TPQJWEO.js.br +0 -0
  86. package/dist/chunk-5TPQJWEO.js.gz +0 -0
  87. package/dist/chunk-G6Q3NXRV.mjs.br +0 -0
  88. package/dist/chunk-G6Q3NXRV.mjs.gz +0 -0
  89. package/dist/chunk-KK7FWBGO.mjs.br +0 -0
  90. package/dist/chunk-KK7FWBGO.mjs.gz +0 -0
  91. package/dist/chunk-LRIXPSVT.mjs.br +0 -0
  92. package/dist/chunk-LRIXPSVT.mjs.gz +0 -0
  93. package/dist/chunk-Q6FC2552.mjs.br +0 -0
  94. package/dist/chunk-Q6FC2552.mjs.gz +0 -0
  95. package/dist/chunk-QBZA2GMB.mjs.br +0 -0
  96. package/dist/chunk-QBZA2GMB.mjs.gz +0 -0
  97. package/dist/chunk-VEZO33T2.js.br +0 -0
  98. package/dist/chunk-VEZO33T2.js.gz +0 -0
  99. package/dist/chunk-WK56SFN7.js.br +0 -0
  100. package/dist/chunk-WK56SFN7.js.gz +0 -0
  101. package/dist/chunk-XSBFV6TL.js.br +0 -0
  102. package/dist/chunk-XSBFV6TL.js.gz +0 -0
Binary file
Binary file
@@ -1,5 +1,5 @@
1
1
  import { translationsEn } from './chunk-Z6HIZWIQ.mjs';
2
- import { SHAPE_PRESET_DEFS, computeValueRangeForChart, getAnimationInitialStyle, cloneHistorySnapshot, hasShapeProperties, isTemplateElement, isImageLikeElement, clampCropValue, parseMediaCommand, hasTextProperties, normalizeHexColor, toCssWritingMode, toCssTextOrientation, toCssVerticalDirection, computeAutoFitTextStyle, resolveLineHeight, getKinsokuLineBreakStyles, buildTextBody3DSceneStyle, resolveParagraphRtl, resolveParagraphAlign, resolveCssTextAlign, colorWithOpacity, build3DExtrusionData, getResolvedShapeClipPath, normalizeStrokeDashType, buildCssGradientFromShapeStyle, buildShadowCssFromShapeStyle, buildInnerShadowCssFromShapeStyle, buildMultiLayerShadowCss, buildGlowBoxShadow, getCompoundLineBoxShadow, getSoftEdgeFilterId, getEffectDagFilter, buildPatternFillCss, buildReflectionCss, getCssBorderDashStyle, getCompoundLineBorderWidth, getSvgStrokeDasharray, isCalloutShape, getCalloutLeaderLineGeometry, buildCalloutLeaderLineSvgPath, getCalloutViewBoxBounds, svgLineCap, getCompoundLineOffsets, getCompoundLineWidths, computeSelectionRect, rectToCells, isCellInRect, buildChartViewModel, buildNotesPdfBytes, buildSlidesPdfBytes, buildPreviewAnimation, getRoundRectRadiusPx, substituteFieldText, resolveUnderlineDecorationStyle, getSubstituteFontFamily, hasDistinctScriptFonts, buildTextReflectionCss, getTextAlphaOpacity, buildTextRunFilterChain, buildTextShadowCss, TEXT_BUILD_ID_SEP, evaluatePresetShape, apply3dEffects, clampUnitInterval, customGeometryPathsToSvgSubpaths, computeColumnBoundaries, parseDrawingColor, parseDrawingColorOpacity, getCellDiagonalBorders, getPatternSvg, ooxmlDashToCssBorderStyle, cell3DBevelCss, getChartStylePalette, computeLayout, valueToY, formatAxisValue, computeLayoutOptions, splitSeriesByAxis, computeValueRange, getSecondaryValueAxis, seriesColor, paletteColor, resolveRegionCode, normalizeValue, sequentialColorScale, convertOmmlToMathMl, sanitizeMathMl, buildTextFillCss, resolvePictureBullet, computeResizedColumnWidths, computeResizedRowHeight, DEFAULT_ROW_HEIGHT, resolveFontRefIdx, tintColor2, shadeColor2, ooxmlGradientAngleToCssDegrees, segmentByScript, resolveFontForScript, generateLogTicks, formatAxisValueWithUnits, getDisplayUnitLabel, hexToRgbChannels, chartPartToAttrs } from './chunk-QBZA2GMB.mjs';
2
+ import { SHAPE_PRESET_DEFS, computeValueRangeForChart, getAnimationInitialStyle, cloneHistorySnapshot, hasShapeProperties, isTemplateElement, isImageLikeElement, clampCropValue, parseMediaCommand, hasTextProperties, normalizeHexColor, toCssWritingMode, toCssTextOrientation, toCssVerticalDirection, computeAutoFitTextStyle, resolveLineHeight, getKinsokuLineBreakStyles, buildTextBody3DSceneStyle, resolveParagraphRtl, resolveParagraphAlign, resolveCssTextAlign, colorWithOpacity, build3DExtrusionData, getResolvedShapeClipPath, normalizeStrokeDashType, buildCssGradientFromShapeStyle, buildShadowCssFromShapeStyle, buildInnerShadowCssFromShapeStyle, buildMultiLayerShadowCss, buildGlowBoxShadow, getCompoundLineBoxShadow, getSoftEdgeFilterId, getEffectDagFilter, buildPatternFillCss, buildReflectionCss, getCssBorderDashStyle, getCompoundLineBorderWidth, getSvgStrokeDasharray, isCalloutShape, getCalloutLeaderLineGeometry, buildCalloutLeaderLineSvgPath, getCalloutViewBoxBounds, svgLineCap, getCompoundLineOffsets, getCompoundLineWidths, computeSelectionRect, rectToCells, isCellInRect, buildChartViewModel, buildNotesPdfBytes, buildSlidesPdfBytes, buildPreviewAnimation, getRoundRectRadiusPx, substituteFieldText, resolveUnderlineDecorationStyle, getSubstituteFontFamily, hasDistinctScriptFonts, buildTextReflectionCss, getTextAlphaOpacity, buildTextRunFilterChain, buildTextShadowCss, TEXT_BUILD_ID_SEP, buildTextBuildSpec, textBuildSpanStyle, evaluatePresetShape, apply3dEffects, clampUnitInterval, customGeometryPathsToSvgSubpaths, computeColumnBoundaries, parseDrawingColor, parseDrawingColorOpacity, getCellDiagonalBorders, getPatternSvg, ooxmlDashToCssBorderStyle, cell3DBevelCss, getChartStylePalette, computeLayout, valueToY, formatAxisValue, computeLayoutOptions, splitSeriesByAxis, computeValueRange, getSecondaryValueAxis, seriesColor, paletteColor, resolveRegionCode, normalizeValue, sequentialColorScale, convertOmmlToMathMl, sanitizeMathMl, buildTextFillCss, resolvePictureBullet, computeResizedColumnWidths, computeResizedRowHeight, DEFAULT_ROW_HEIGHT, resolveFontRefIdx, tintColor2, shadeColor2, ooxmlGradientAngleToCssDegrees, segmentByScript, resolveFontForScript, generateLogTicks, formatAxisValueWithUnits, getDisplayUnitLabel, hexToRgbChannels, chartPartToAttrs } from './chunk-VOV2N3NY.mjs';
3
3
  import { clsx } from 'clsx';
4
4
  import { twMerge } from 'tailwind-merge';
5
5
  import React6, { useState, useEffect, useMemo, Suspense, useRef, useCallback, useLayoutEffect } from 'react';
@@ -1509,7 +1509,7 @@ function buildAnimStyle(state) {
1509
1509
  }
1510
1510
  return Object.keys(style).length > 0 ? style : void 0;
1511
1511
  }
1512
- function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, paraSegments, subElementAnimStates) {
1512
+ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, paraSegments, subElementAnimStates, renderPiece) {
1513
1513
  if (!subElementAnimStates || subElementAnimStates.size === 0) {
1514
1514
  return renderedSegments;
1515
1515
  }
@@ -1519,53 +1519,30 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
1519
1519
  const style = buildAnimStyle(paraState);
1520
1520
  return /* @__PURE__ */ jsx("span", { "data-anim-id": paraKey, style: { display: "inline", ...style }, children: renderedSegments }, paraKey);
1521
1521
  }
1522
- const firstWordKey = `${elementId}${TEXT_BUILD_ID_SEP}w${paraIndex}-0`;
1523
- if (subElementAnimStates.has(firstWordKey)) {
1524
- return wrapByWord(elementId, paraIndex, paraSegments, subElementAnimStates);
1525
- }
1526
- const firstCharKey = `${elementId}${TEXT_BUILD_ID_SEP}c${paraIndex}-0`;
1527
- if (subElementAnimStates.has(firstCharKey)) {
1528
- return wrapByChar(elementId, paraIndex, paraSegments, subElementAnimStates);
1522
+ const spec = buildTextBuildSpec(
1523
+ elementId,
1524
+ paraIndex,
1525
+ paraSegments.map((entry) => ({ text: entry.segment.text, style: entry })),
1526
+ subElementAnimStates
1527
+ );
1528
+ if (!spec?.spans) {
1529
+ return renderedSegments;
1529
1530
  }
1530
- return renderedSegments;
1531
- }
1532
- function wrapByWord(elementId, paraIndex, paraSegments, states) {
1533
- const fullText = paraSegments.map((e) => e.segment.text).join("");
1534
- const words = fullText.split(/(\s+)/);
1535
- let wordIdx = 0;
1536
- const nodes = [];
1537
- for (let i = 0; i < words.length; i++) {
1538
- const w = words[i];
1539
- if (!w) {
1540
- continue;
1541
- }
1542
- const isWhitespace = /^\s+$/.test(w);
1543
- if (isWhitespace) {
1544
- nodes.push(/* @__PURE__ */ jsx(React6.Fragment, { children: w }, `ws-${i}`));
1545
- continue;
1531
+ return spec.spans.map((span, index) => {
1532
+ const content = span.style && renderPiece ? renderPiece(span.style, span.text) : span.text;
1533
+ if (!span.animId) {
1534
+ return /* @__PURE__ */ jsx(React6.Fragment, { children: content }, `ws-${index}`);
1546
1535
  }
1547
- const key = `${elementId}${TEXT_BUILD_ID_SEP}w${paraIndex}-${wordIdx}`;
1548
- const state = states.get(key);
1549
- const style = buildAnimStyle(state);
1550
- nodes.push(
1551
- /* @__PURE__ */ jsx("span", { "data-anim-id": key, style: { display: "inline", ...style }, children: w }, key)
1552
- );
1553
- wordIdx++;
1554
- }
1555
- return nodes;
1556
- }
1557
- function wrapByChar(elementId, paraIndex, paraSegments, states) {
1558
- const fullText = paraSegments.map((e) => e.segment.text).join("");
1559
- const nodes = [];
1560
- for (let i = 0; i < fullText.length; i++) {
1561
- const key = `${elementId}${TEXT_BUILD_ID_SEP}c${paraIndex}-${i}`;
1562
- const state = states.get(key);
1563
- const style = buildAnimStyle(state);
1564
- nodes.push(
1565
- /* @__PURE__ */ jsx("span", { "data-anim-id": key, style: { display: "inline", ...style }, children: fullText[i] }, key)
1536
+ return /* @__PURE__ */ jsx(
1537
+ "span",
1538
+ {
1539
+ "data-anim-id": span.animId,
1540
+ style: textBuildSpanStyle(span),
1541
+ children: content
1542
+ },
1543
+ span.animId
1566
1544
  );
1567
- }
1568
- return nodes;
1545
+ });
1569
1546
  }
1570
1547
  var EPS = 0.01;
1571
1548
  var FALLBACK_STEP_PX = 48;
@@ -2213,7 +2190,22 @@ function renderTextSegments(element, fallbackColor, emptyFallback, findHighlight
2213
2190
  paraIndex,
2214
2191
  renderedSegments,
2215
2192
  paraSegments,
2216
- subElementAnimStates
2193
+ subElementAnimStates,
2194
+ // A staged build splits the paragraph but must not flatten it: each
2195
+ // piece is re-rendered through the SAME segment renderer, so it keeps
2196
+ // its run's font, size, colour and decoration while it animates.
2197
+ ({ segment, globalIndex }, text) => renderSingleSegment(
2198
+ element,
2199
+ { ...segment, text },
2200
+ globalIndex,
2201
+ fallbackColor,
2202
+ findHighlights,
2203
+ void 0,
2204
+ onHyperlinkClick,
2205
+ fieldContext,
2206
+ paraRtl,
2207
+ requireCtrlClick
2208
+ )
2217
2209
  );
2218
2210
  if (!needsWrapper) {
2219
2211
  return /* @__PURE__ */ jsxs(React6.Fragment, { children: [
@@ -6265,7 +6257,7 @@ function FailedToLoad() {
6265
6257
  var LazySurfaceChart3DScene = React6.lazy(
6266
6258
  async () => {
6267
6259
  try {
6268
- return await import('./SurfaceChart3DScene-52C3IMPQ.mjs');
6260
+ return await import('./SurfaceChart3DScene-PRCKQJQQ.mjs');
6269
6261
  } catch {
6270
6262
  return { default: FailedToLoad };
6271
6263
  }
Binary file
Binary file