pptx-react-viewer 3.5.4 → 3.6.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 (159) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/{AiChatPanel-LPZWDNVU.js → AiChatPanel-LEOEDIW2.js} +25 -25
  3. package/dist/AiChatPanel-LEOEDIW2.js.br +0 -0
  4. package/dist/AiChatPanel-LEOEDIW2.js.gz +0 -0
  5. package/dist/{AiChatPanel-CCJNQGER.mjs → AiChatPanel-WRQGJJVD.mjs} +4 -4
  6. package/dist/AiChatPanel-WRQGJJVD.mjs.br +0 -0
  7. package/dist/AiChatPanel-WRQGJJVD.mjs.gz +0 -0
  8. package/dist/{Area3DChartScene-LJCWBNQ3.js → Area3DChartScene-3TJ2GTGI.js} +2 -2
  9. package/dist/Area3DChartScene-3TJ2GTGI.js.br +0 -0
  10. package/dist/Area3DChartScene-3TJ2GTGI.js.gz +0 -0
  11. package/dist/{Area3DChartScene-P6YM6ZL7.mjs → Area3DChartScene-SJC2ZB6R.mjs} +1 -1
  12. package/dist/Area3DChartScene-SJC2ZB6R.mjs.br +2 -0
  13. package/dist/Area3DChartScene-SJC2ZB6R.mjs.gz +0 -0
  14. package/dist/{Bar3DChartScene-7DNQ4X5T.js → Bar3DChartScene-2ZGOMOZO.js} +2 -2
  15. package/dist/Bar3DChartScene-2ZGOMOZO.js.br +0 -0
  16. package/dist/Bar3DChartScene-2ZGOMOZO.js.gz +0 -0
  17. package/dist/{Bar3DChartScene-DIVOJURZ.mjs → Bar3DChartScene-SPER4LQA.mjs} +1 -1
  18. package/dist/Bar3DChartScene-SPER4LQA.mjs.br +0 -0
  19. package/dist/Bar3DChartScene-SPER4LQA.mjs.gz +0 -0
  20. package/dist/{Line3DChartScene-UF6DHP36.js → Line3DChartScene-42FYFGLU.js} +2 -2
  21. package/dist/Line3DChartScene-42FYFGLU.js.br +0 -0
  22. package/dist/Line3DChartScene-42FYFGLU.js.gz +0 -0
  23. package/dist/{Line3DChartScene-ZZVNUKIJ.mjs → Line3DChartScene-FH3YHPXE.mjs} +1 -1
  24. package/dist/Line3DChartScene-FH3YHPXE.mjs.br +2 -0
  25. package/dist/Line3DChartScene-FH3YHPXE.mjs.gz +0 -0
  26. package/dist/{Model3DScene-XXMAAKBR.mjs → Model3DScene-2BCR2YYD.mjs} +1 -1
  27. package/dist/Model3DScene-2BCR2YYD.mjs.br +0 -0
  28. package/dist/Model3DScene-2BCR2YYD.mjs.gz +0 -0
  29. package/dist/{Model3DScene-C7MZ22DH.js → Model3DScene-EIU2GVUZ.js} +2 -2
  30. package/dist/Model3DScene-EIU2GVUZ.js.br +0 -0
  31. package/dist/Model3DScene-EIU2GVUZ.js.gz +0 -0
  32. package/dist/{PieChart3DScene-7LX3IL2Q.mjs → PieChart3DScene-QFQUJFDP.mjs} +1 -1
  33. package/dist/PieChart3DScene-QFQUJFDP.mjs.br +0 -0
  34. package/dist/PieChart3DScene-QFQUJFDP.mjs.gz +0 -0
  35. package/dist/{PieChart3DScene-N2Y25VG5.js → PieChart3DScene-VQOHZPHI.js} +2 -2
  36. package/dist/{PieChart3DScene-N2Y25VG5.js.br → PieChart3DScene-VQOHZPHI.js.br} +0 -0
  37. package/dist/PieChart3DScene-VQOHZPHI.js.gz +0 -0
  38. package/dist/{SurfaceChart3DScene-ADA7NUIW.mjs → SurfaceChart3DScene-CGXMRBCL.mjs} +1 -1
  39. package/dist/SurfaceChart3DScene-CGXMRBCL.mjs.br +0 -0
  40. package/dist/SurfaceChart3DScene-CGXMRBCL.mjs.gz +0 -0
  41. package/dist/{SurfaceChart3DScene-WXJHYOGJ.js → SurfaceChart3DScene-FTVXZN6O.js} +2 -2
  42. package/dist/{SurfaceChart3DScene-WXJHYOGJ.js.br → SurfaceChart3DScene-FTVXZN6O.js.br} +0 -0
  43. package/dist/SurfaceChart3DScene-FTVXZN6O.js.gz +0 -0
  44. package/dist/{chunk-UTMTXJGM.js → chunk-7VPDHSWF.js} +330 -349
  45. package/dist/chunk-7VPDHSWF.js.br +0 -0
  46. package/dist/chunk-7VPDHSWF.js.gz +0 -0
  47. package/dist/{chunk-YQOK4E2A.js → chunk-AL2KLPOJ.js} +32381 -22178
  48. package/dist/chunk-AL2KLPOJ.js.br +0 -0
  49. package/dist/chunk-AL2KLPOJ.js.gz +0 -0
  50. package/dist/{chunk-IWQSAKPM.mjs → chunk-FG5VQFWP.mjs} +193 -71
  51. package/dist/chunk-FG5VQFWP.mjs.br +0 -0
  52. package/dist/chunk-FG5VQFWP.mjs.gz +0 -0
  53. package/dist/{chunk-UTIMT5CZ.js → chunk-MZI4DG3S.js} +12 -0
  54. package/dist/chunk-MZI4DG3S.js.br +0 -0
  55. package/dist/{chunk-UTIMT5CZ.js.gz → chunk-MZI4DG3S.js.gz} +0 -0
  56. package/dist/{chunk-HHJZK26I.js → chunk-NFOOONND.js} +1359 -1237
  57. package/dist/chunk-NFOOONND.js.br +0 -0
  58. package/dist/chunk-NFOOONND.js.gz +0 -0
  59. package/dist/{chunk-IVPT3U5C.mjs → chunk-T3V5FBXJ.mjs} +29 -1
  60. package/dist/chunk-T3V5FBXJ.mjs.br +0 -0
  61. package/dist/chunk-T3V5FBXJ.mjs.gz +0 -0
  62. package/dist/{chunk-JCJ3EPG6.mjs → chunk-TGCSZXOG.mjs} +12 -0
  63. package/dist/chunk-TGCSZXOG.mjs.br +0 -0
  64. package/dist/{chunk-JCJ3EPG6.mjs.gz → chunk-TGCSZXOG.mjs.gz} +0 -0
  65. package/dist/{chunk-EVVWCF2M.mjs → chunk-VYNICQ4O.mjs} +58 -37
  66. package/dist/chunk-VYNICQ4O.mjs.br +0 -0
  67. package/dist/chunk-VYNICQ4O.mjs.gz +0 -0
  68. package/dist/{chunk-U52MKWVA.mjs → chunk-WX7AFFBZ.mjs} +142 -161
  69. package/dist/chunk-WX7AFFBZ.mjs.br +0 -0
  70. package/dist/chunk-WX7AFFBZ.mjs.gz +0 -0
  71. package/dist/{chunk-2FMQ7M3L.js → chunk-ZHSBMG37.js} +490 -469
  72. package/dist/chunk-ZHSBMG37.js.br +0 -0
  73. package/dist/chunk-ZHSBMG37.js.gz +0 -0
  74. package/dist/{chunk-NM652EZS.mjs → chunk-ZUSYUWOV.mjs} +32358 -22178
  75. package/dist/chunk-ZUSYUWOV.mjs.br +0 -0
  76. package/dist/chunk-ZUSYUWOV.mjs.gz +0 -0
  77. package/dist/{chunk-UOMFINNJ.js → chunk-ZWPHUPL4.js} +33 -5
  78. package/dist/chunk-ZWPHUPL4.js.br +0 -0
  79. package/dist/chunk-ZWPHUPL4.js.gz +0 -0
  80. package/dist/i18n.js +4 -4
  81. package/dist/i18n.js.br +0 -0
  82. package/dist/i18n.js.gz +0 -0
  83. package/dist/i18n.mjs +1 -1
  84. package/dist/i18n.mjs.br +0 -0
  85. package/dist/i18n.mjs.gz +0 -0
  86. package/dist/index.d.ts +599 -33
  87. package/dist/index.js +47 -47
  88. package/dist/index.js.br +0 -0
  89. package/dist/index.js.gz +0 -0
  90. package/dist/index.mjs +6 -6
  91. package/dist/index.mjs.br +0 -0
  92. package/dist/index.mjs.gz +0 -0
  93. package/dist/internals.d.ts +610 -33
  94. package/dist/internals.d.ts.map +1 -1
  95. package/dist/internals.js +79 -79
  96. package/dist/internals.js.br +0 -0
  97. package/dist/internals.js.gz +0 -0
  98. package/dist/internals.mjs +4 -4
  99. package/dist/internals.mjs.br +0 -0
  100. package/dist/internals.mjs.gz +0 -0
  101. package/dist/{useViewerBuildingBlocks-f6oNGKMX.d.ts → useViewerBuildingBlocks-C8F_4Pzb.d.ts} +3 -1
  102. package/dist/useViewerBuildingBlocks-C8F_4Pzb.d.ts.map +1 -0
  103. package/dist/viewer/index.d.ts +552 -33
  104. package/dist/viewer/index.js +27 -27
  105. package/dist/viewer/index.js.br +0 -0
  106. package/dist/viewer/index.js.gz +0 -0
  107. package/dist/viewer/index.mjs +6 -6
  108. package/dist/viewer/index.mjs.br +0 -0
  109. package/dist/viewer/index.mjs.gz +0 -0
  110. package/package.json +1 -1
  111. package/dist/AiChatPanel-CCJNQGER.mjs.br +0 -0
  112. package/dist/AiChatPanel-CCJNQGER.mjs.gz +0 -0
  113. package/dist/AiChatPanel-LPZWDNVU.js.br +0 -0
  114. package/dist/AiChatPanel-LPZWDNVU.js.gz +0 -0
  115. package/dist/Area3DChartScene-LJCWBNQ3.js.br +0 -0
  116. package/dist/Area3DChartScene-LJCWBNQ3.js.gz +0 -0
  117. package/dist/Area3DChartScene-P6YM6ZL7.mjs.br +0 -0
  118. package/dist/Area3DChartScene-P6YM6ZL7.mjs.gz +0 -0
  119. package/dist/Bar3DChartScene-7DNQ4X5T.js.br +0 -1
  120. package/dist/Bar3DChartScene-7DNQ4X5T.js.gz +0 -0
  121. package/dist/Bar3DChartScene-DIVOJURZ.mjs.br +0 -0
  122. package/dist/Bar3DChartScene-DIVOJURZ.mjs.gz +0 -0
  123. package/dist/Line3DChartScene-UF6DHP36.js.br +0 -0
  124. package/dist/Line3DChartScene-UF6DHP36.js.gz +0 -0
  125. package/dist/Line3DChartScene-ZZVNUKIJ.mjs.br +0 -0
  126. package/dist/Line3DChartScene-ZZVNUKIJ.mjs.gz +0 -0
  127. package/dist/Model3DScene-C7MZ22DH.js.br +0 -0
  128. package/dist/Model3DScene-C7MZ22DH.js.gz +0 -0
  129. package/dist/Model3DScene-XXMAAKBR.mjs.br +0 -0
  130. package/dist/Model3DScene-XXMAAKBR.mjs.gz +0 -0
  131. package/dist/PieChart3DScene-7LX3IL2Q.mjs.br +0 -0
  132. package/dist/PieChart3DScene-7LX3IL2Q.mjs.gz +0 -0
  133. package/dist/PieChart3DScene-N2Y25VG5.js.gz +0 -0
  134. package/dist/SurfaceChart3DScene-ADA7NUIW.mjs.br +0 -0
  135. package/dist/SurfaceChart3DScene-ADA7NUIW.mjs.gz +0 -0
  136. package/dist/SurfaceChart3DScene-WXJHYOGJ.js.gz +0 -0
  137. package/dist/chunk-2FMQ7M3L.js.br +0 -0
  138. package/dist/chunk-2FMQ7M3L.js.gz +0 -0
  139. package/dist/chunk-EVVWCF2M.mjs.br +0 -0
  140. package/dist/chunk-EVVWCF2M.mjs.gz +0 -0
  141. package/dist/chunk-HHJZK26I.js.br +0 -0
  142. package/dist/chunk-HHJZK26I.js.gz +0 -0
  143. package/dist/chunk-IVPT3U5C.mjs.br +0 -0
  144. package/dist/chunk-IVPT3U5C.mjs.gz +0 -0
  145. package/dist/chunk-IWQSAKPM.mjs.br +0 -0
  146. package/dist/chunk-IWQSAKPM.mjs.gz +0 -0
  147. package/dist/chunk-JCJ3EPG6.mjs.br +0 -0
  148. package/dist/chunk-NM652EZS.mjs.br +0 -0
  149. package/dist/chunk-NM652EZS.mjs.gz +0 -0
  150. package/dist/chunk-U52MKWVA.mjs.br +0 -0
  151. package/dist/chunk-U52MKWVA.mjs.gz +0 -0
  152. package/dist/chunk-UOMFINNJ.js.br +0 -0
  153. package/dist/chunk-UOMFINNJ.js.gz +0 -0
  154. package/dist/chunk-UTIMT5CZ.js.br +0 -0
  155. package/dist/chunk-UTMTXJGM.js.br +0 -0
  156. package/dist/chunk-UTMTXJGM.js.gz +0 -0
  157. package/dist/chunk-YQOK4E2A.js.br +0 -0
  158. package/dist/chunk-YQOK4E2A.js.gz +0 -0
  159. package/dist/useViewerBuildingBlocks-f6oNGKMX.d.ts.map +0 -1
@@ -1,8 +1,8 @@
1
- import { SHAPE_PRESET_DEFS, VIEWER_SHORTCUT_REFERENCE, STROKE_DASH_OPTIONS, getAnimationInitialStyle, cloneHistorySnapshot, hasShapeProperties, getImageFitStyle, getComputedFillStyle, isImageLikeElement, getCropShapeClipPath, getImageTilingStyle, mediaPlaybackAttributes, buildTextBlockStyle, hasTextProperties, toCssWritingMode, toCssTextOrientation, toCssVerticalDirection, buildTextBodyLayoutStyle, buildTextBody3DSceneStyle, buildParagraphs, colorWithOpacity, normalizeHexColor, hexToRgbUnit, build3DExtrusionData, getComputedEffectStyle, getComputedStrokeStyle, getAnimationColorBaseStyle, isStrokeOnlyPresetElement, resolveShapeGeometry, normalizeStrokeDashType, getSvgStrokeDasharray, buildSvgGradientDef, buildStrokeOutline, getPresetShapeVectorGeometry, isWedgeCalloutPresetShape, svgGradientFillRef, isCalloutShape, getCalloutLeaderLineGeometry, buildCalloutLeaderLineSvgPath, getCalloutViewBoxBounds, svgLineCap, getCompoundLineOffsets, getCompoundLineWidths, computeSelectionRect, DEFAULT_FONT_FAMILY, cellStyleToCss, rectToCells, isCellInRect, tableContainerCss, buildChartViewModel, resolveChartKind, chartPreserveAspectRatio, buildNotesPdfBytes, buildSlidesPdfBytes, buildPreviewAnimation, buildMotionPathPreview, mediaFallbackVisual, registerCrossSlideAudio, resolveAutoFitFontScale, resolveFontKerning, getSubstituteFontFamily, parsePanoseString, resolveScriptFontSet, hasDistinctScriptFonts, nestedTextDecorationStyle, pieceLetterSpacing, resolveMetricTrackingPx, hollowTextFillStyle, buildTabContext, TEXT_BUILD_ID_SEP, buildTextBuildSpec, textBuildSpanStyle, apply3dEffects, clampUnitInterval, customGeometryPathsToSvgSubpaths, buildSubpathPaints, computeColumnBoundaries, getTableCellBandStyle, parseDrawingColor, parseDrawingColorOpacity, getCellDiagonalBorders, cellRunStyle, getChartStylePalette, computeChartLegendLayout, mediaFallbackIcon, mediaFallbackLabelKey, MEDIA_CHROME_ATTRIBUTE, convertOmmlToMathMl, sanitizeMathMl, tableCellCss, computeResizedColumnWidths, computeResizedRowHeight, DEFAULT_ROW_HEIGHT, ooxmlGradientAngleToCssDegrees, buildRectPathGradient, buildRunTabLines, chartPartToAttrs, splitRunForMetrics, splitRunByScriptFont } from './chunk-NM652EZS.mjs';
2
- import { translationsEn } from './chunk-JCJ3EPG6.mjs';
1
+ import { SHAPE_PRESET_DEFS, VIEWER_SHORTCUT_REFERENCE, STROKE_DASH_OPTIONS, getAnimationInitialStyle, cloneHistorySnapshot, hasShapeProperties, getImageFitStyle, getComputedFillStyle, isImageLikeElement, getCropShapeClipPath, getImageTilingStyle, mediaPlaybackAttributes, buildTextBlockStyle, hasTextProperties, toCssWritingMode, toCssTextOrientation, toCssVerticalDirection, buildTextBodyLayoutStyle, buildTextBody3DSceneStyle, buildParagraphs, colorWithOpacity, normalizeHexColor, hexToRgbUnit, build3DExtrusionData, getComputedEffectStyle, getComputedStrokeStyle, getAnimationColorBaseStyle, isStrokeOnlyPresetElement, resolveShapeGeometry, normalizeStrokeDashType, getSvgStrokeDasharray, buildSvgGradientDef, buildStrokeOutline, getPresetShapeVectorGeometry, isWedgeCalloutPresetShape, svgGradientFillRef, isCalloutShape, getCalloutLeaderLineGeometry, buildCalloutLeaderLineSvgPath, getCalloutViewBoxBounds, svgLineCap, getCompoundLineOffsets, getCompoundLineWidths, canDrillDown, computeSelectionRect, DEFAULT_FONT_FAMILY, cellStyleToCss, rectToCells, isCellInRect, tableContainerCss, buildChartViewModel, resolveChartKind, chartPreserveAspectRatio, buildNotesPdfBytes, buildSlidesPdfBytes, buildPreviewAnimation, buildMotionPathPreview, mediaFallbackVisual, scheduleMediaTrimAndFade, registerCrossSlideAudio, resolveAutoFitFontScale, resolveFontKerning, getSubstituteFontFamily, parsePanoseString, resolveScriptFontSet, hasDistinctScriptFonts, nestedTextDecorationStyle, pieceLetterSpacing, resolveMetricTrackingPx, hollowTextFillStyle, stripUnderlineDecoration, buildTabContext, TEXT_BUILD_ID_SEP, buildTextBuildSpec, textBuildSpanStyle, apply3dEffects, clampUnitInterval, customGeometryPathsToSvgSubpaths, buildSubpathPaints, computeColumnBoundaries, getTableCellBandStyle, parseDrawingColor, parseDrawingColorOpacity, getCellDiagonalBorders, cellRunStyle, getChartStylePalette, computeChartLegendLayout, mediaFallbackIcon, mediaFallbackLabelKey, MEDIA_CHROME_ATTRIBUTE, convertOmmlToMathMl, sanitizeMathMl, tableCellCss, computeResizedColumnWidths, computeResizedRowHeight, DEFAULT_ROW_HEIGHT, ooxmlGradientAngleToCssDegrees, buildRectPathGradient, buildRunTabLines, chartPartToAttrs, splitWordsForUnderline, splitRunForMetrics, splitRunByScriptFont } from './chunk-ZUSYUWOV.mjs';
2
+ import { translationsEn } from './chunk-TGCSZXOG.mjs';
3
3
  import { clsx } from 'clsx';
4
4
  import { twMerge } from 'tailwind-merge';
5
- import React6, { useRef, useState, useEffect, useCallback, useMemo, useLayoutEffect } from 'react';
5
+ import React7, { useRef, useState, useEffect, useCallback, useMemo, useLayoutEffect } from 'react';
6
6
  import { LuTriangle, LuPlus, LuMoveRight, LuMinus, LuDiamond, LuDatabase, LuCircle, LuSquare } from 'react-icons/lu';
7
7
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
8
  import { useTranslation } from 'react-i18next';
@@ -104,7 +104,7 @@ var SHAPE_PRESETS = SHAPE_PRESET_DEFS.map(
104
104
  type: def.type,
105
105
  label: def.label,
106
106
  i18nKey: def.i18nKey,
107
- icon: React6.createElement(GLYPH_COMPONENTS[def.glyph], {
107
+ icon: React7.createElement(GLYPH_COMPONENTS[def.glyph], {
108
108
  className: def.glyphClass ? `w-3.5 h-3.5 ${def.glyphClass}` : "w-3.5 h-3.5"
109
109
  })
110
110
  })
@@ -330,20 +330,10 @@ function ensureArrayValue(value) {
330
330
  // src/viewer/utils/media-persistent-audio.tsx
331
331
  function buildTrimFragment(element) {
332
332
  const start = element.trimStartMs;
333
- const end = element.trimEndMs;
334
- if (start === void 0 && end === void 0) {
333
+ if (start === void 0 || start <= 0) {
335
334
  return "";
336
335
  }
337
- const parts = [];
338
- if (start !== void 0 && start > 0) {
339
- parts.push((start / 1e3).toFixed(3));
340
- } else {
341
- parts.push("");
342
- }
343
- if (end !== void 0 && end > 0) {
344
- parts.push((end / 1e3).toFixed(3));
345
- }
346
- return parts.length > 0 ? `#t=${parts.join(",")}` : "";
336
+ return `#t=${(start / 1e3).toFixed(3)}`;
347
337
  }
348
338
  function useMediaMetadataExtraction(mediaRef, element) {
349
339
  const [metadata, setMetadata] = useState(element.metadata);
@@ -484,25 +474,9 @@ function PresentationMediaController({
484
474
  }) {
485
475
  const { t } = useTranslation();
486
476
  const mediaRef = useRef(null);
487
- const fadeTimerRef = useRef(null);
488
- const trimTimerRef = useRef(null);
489
477
  const [isMediaPlaying, setIsMediaPlaying] = useState(false);
490
- const volume = element.volume ?? 1;
491
- const fadeIn = element.fadeInDuration ?? 0;
492
- const fadeOut = element.fadeOutDuration ?? 0;
493
478
  const trimStartSec = element.trimStartMs !== void 0 ? element.trimStartMs / 1e3 : 0;
494
- const trimEndSec = element.trimEndMs !== void 0 && element.trimEndMs > 0 ? element.trimEndMs / 1e3 : 0;
495
479
  const hideWhenNotPlaying = isPresentationMode && element.hideWhenNotPlaying === true;
496
- useEffect(() => {
497
- return () => {
498
- if (fadeTimerRef.current !== null) {
499
- cancelAnimationFrame(fadeTimerRef.current);
500
- }
501
- if (trimTimerRef.current !== null) {
502
- window.clearTimeout(trimTimerRef.current);
503
- }
504
- };
505
- }, []);
506
480
  const { volume: playbackVolume, playbackRate } = mediaPlaybackAttributes({
507
481
  loop: element.loop,
508
482
  volume: element.volume,
@@ -525,7 +499,7 @@ function PresentationMediaController({
525
499
  if (!el) {
526
500
  return;
527
501
  }
528
- const handlePlay2 = () => {
502
+ const handlePlay = () => {
529
503
  setIsMediaPlaying(true);
530
504
  onPlayStateChange?.(true);
531
505
  };
@@ -537,101 +511,35 @@ function PresentationMediaController({
537
511
  setIsMediaPlaying(false);
538
512
  onPlayStateChange?.(false);
539
513
  };
540
- el.addEventListener("play", handlePlay2);
514
+ el.addEventListener("play", handlePlay);
541
515
  el.addEventListener("pause", handlePause);
542
516
  el.addEventListener("ended", handleEnded);
543
517
  return () => {
544
- el.removeEventListener("play", handlePlay2);
518
+ el.removeEventListener("play", handlePlay);
545
519
  el.removeEventListener("pause", handlePause);
546
520
  el.removeEventListener("ended", handleEnded);
547
521
  };
548
522
  }, [onPlayStateChange]);
549
- const applyFadeIn = useCallback(() => {
550
- const el = mediaRef.current;
551
- if (!el || fadeIn <= 0) {
552
- return;
553
- }
554
- const startTime = performance.now();
555
- const durationMs = fadeIn * 1e3;
556
- el.volume = 0;
557
- const tick = () => {
558
- const elapsed = performance.now() - startTime;
559
- const progress = Math.min(1, elapsed / durationMs);
560
- el.volume = progress * volume;
561
- if (progress < 1) {
562
- fadeTimerRef.current = requestAnimationFrame(tick);
563
- }
564
- };
565
- fadeTimerRef.current = requestAnimationFrame(tick);
566
- }, [fadeIn, volume]);
567
- const handlePlay = useCallback(() => {
523
+ useEffect(() => {
568
524
  const el = mediaRef.current;
569
525
  if (!el || !isPresentationMode) {
570
526
  return;
571
527
  }
572
- if (trimStartSec > 0 && el.currentTime < trimStartSec) {
573
- el.currentTime = trimStartSec;
574
- }
575
- if (fadeIn > 0) {
576
- applyFadeIn();
577
- }
578
- if (trimEndSec > 0) {
579
- const remaining = trimEndSec - el.currentTime;
580
- if (remaining > 0) {
581
- const fadeOutStart = Math.max(0, (remaining - fadeOut) * 1e3);
582
- if (fadeOut > 0) {
583
- trimTimerRef.current = window.setTimeout(() => {
584
- const fadeStartTime = performance.now();
585
- const fadeMs = fadeOut * 1e3;
586
- const startVol = el.volume;
587
- const fadeOutTick = () => {
588
- const elapsed = performance.now() - fadeStartTime;
589
- const progress = Math.min(1, elapsed / fadeMs);
590
- el.volume = startVol * (1 - progress);
591
- if (progress < 1 && !el.paused) {
592
- fadeTimerRef.current = requestAnimationFrame(fadeOutTick);
593
- }
594
- };
595
- fadeTimerRef.current = requestAnimationFrame(fadeOutTick);
596
- }, fadeOutStart);
597
- }
598
- const stopTimer = window.setTimeout(() => {
599
- if (!el.paused) {
600
- el.pause();
601
- el.currentTime = trimEndSec;
602
- }
603
- }, remaining * 1e3);
604
- const prevTimer = trimTimerRef.current;
605
- trimTimerRef.current = stopTimer;
606
- if (prevTimer !== null) {
607
- window.clearTimeout(prevTimer);
608
- }
609
- }
610
- } else if (fadeOut > 0) {
611
- const handleTimeUpdate = () => {
612
- if (!Number.isFinite(el.duration)) {
613
- return;
614
- }
615
- const timeLeft = el.duration - el.currentTime;
616
- if (timeLeft <= fadeOut && timeLeft > 0) {
617
- el.removeEventListener("timeupdate", handleTimeUpdate);
618
- const fadeStartTime = performance.now();
619
- const fadeMs = timeLeft * 1e3;
620
- const startVol = el.volume;
621
- const fadeOutTick = () => {
622
- const elapsed = performance.now() - fadeStartTime;
623
- const progress = Math.min(1, elapsed / fadeMs);
624
- el.volume = startVol * (1 - progress);
625
- if (progress < 1 && !el.paused) {
626
- fadeTimerRef.current = requestAnimationFrame(fadeOutTick);
627
- }
628
- };
629
- fadeTimerRef.current = requestAnimationFrame(fadeOutTick);
630
- }
631
- };
632
- el.addEventListener("timeupdate", handleTimeUpdate);
633
- }
634
- }, [applyFadeIn, fadeIn, fadeOut, isPresentationMode, trimEndSec, trimStartSec]);
528
+ return scheduleMediaTrimAndFade(el, {
529
+ trimStartMs: element.trimStartMs,
530
+ trimEndMs: element.trimEndMs,
531
+ fadeInDuration: element.fadeInDuration,
532
+ fadeOutDuration: element.fadeOutDuration,
533
+ volume: playbackVolume
534
+ });
535
+ }, [
536
+ isPresentationMode,
537
+ element.trimStartMs,
538
+ element.trimEndMs,
539
+ element.fadeInDuration,
540
+ element.fadeOutDuration,
541
+ playbackVolume
542
+ ]);
635
543
  useEffect(() => {
636
544
  if (!isPresentationMode || !shouldAutoPlay) {
637
545
  return;
@@ -666,8 +574,10 @@ function PresentationMediaController({
666
574
  el.pause();
667
575
  }
668
576
  }, []);
577
+ const noopOnPlay = useCallback(() => {
578
+ }, []);
669
579
  return /* @__PURE__ */ jsxs("div", { className: "w-full h-full", style: wrapperStyle, children: [
670
- children({ mediaRef, onPlay: handlePlay, isMediaPlaying }),
580
+ children({ mediaRef, onPlay: noopOnPlay, isMediaPlaying }),
671
581
  isFullScreen && isPresentationMode && isMediaPlaying && /* @__PURE__ */ jsx(
672
582
  "button",
673
583
  {
@@ -1130,7 +1040,7 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
1130
1040
  return spec.spans.map((span, index) => {
1131
1041
  const content = span.style && renderPiece ? renderPiece(span.style, span.text, String(index)) : span.text;
1132
1042
  if (!span.animId) {
1133
- return /* @__PURE__ */ jsx(React6.Fragment, { children: content }, `ws-${index}`);
1043
+ return /* @__PURE__ */ jsx(React7.Fragment, { children: content }, `ws-${index}`);
1134
1044
  }
1135
1045
  return /* @__PURE__ */ jsx(
1136
1046
  "span",
@@ -1143,11 +1053,53 @@ function wrapWithTextBuildAnimation(elementId, paraIndex, renderedSegments, para
1143
1053
  );
1144
1054
  });
1145
1055
  }
1056
+ function renderUnderlineWords(text, isUnderlineWords, wordDecoration, metric, keyPrefix, inner) {
1057
+ if (!isUnderlineWords || !text) {
1058
+ return inner(text, keyPrefix, metric);
1059
+ }
1060
+ const pieces = splitWordsForUnderline(text);
1061
+ if (pieces.length === 0) {
1062
+ return inner(text, keyPrefix, metric);
1063
+ }
1064
+ const gapMetric = metric ? {
1065
+ ...metric,
1066
+ nestedStyle: metric.nestedStyle ? stripUnderlineDecoration(metric.nestedStyle) : void 0
1067
+ } : void 0;
1068
+ return pieces.map((piece, i) => {
1069
+ const key = `${keyPrefix}-u${i}`;
1070
+ if (!piece.underline) {
1071
+ return /* @__PURE__ */ jsx(React7.Fragment, { children: inner(piece.text, key, gapMetric) }, key);
1072
+ }
1073
+ return /* @__PURE__ */ jsx("span", { style: wordDecoration, children: inner(piece.text, key, metric) }, key);
1074
+ });
1075
+ }
1076
+ function makeSegmentPieceRenderer(needsScriptFonts, scriptFonts, baseFontFamily, isUnderlineWords, wordDecoration, metric) {
1077
+ return (text, key) => renderUnderlineWords(
1078
+ text,
1079
+ isUnderlineWords,
1080
+ wordDecoration,
1081
+ metric,
1082
+ key,
1083
+ (subText, subKey, subMetric) => renderMetricPieces(
1084
+ subText,
1085
+ subMetric,
1086
+ subKey,
1087
+ (pieceText, pieceKey) => renderScriptAwareText(
1088
+ pieceText,
1089
+ needsScriptFonts,
1090
+ scriptFonts,
1091
+ baseFontFamily,
1092
+ pieceKey,
1093
+ subMetric?.nestedStyle
1094
+ )
1095
+ )
1096
+ );
1097
+ }
1146
1098
  function renderTabbedLine(line, ctx, keyPrefix, renderPiece, nestedStyle) {
1147
1099
  const [lineLayout] = buildRunTabLines(line, ctx, nestedStyle);
1148
1100
  return /* @__PURE__ */ jsx("span", { style: { display: "inline-block", whiteSpace: "nowrap" }, children: lineLayout.pieces.map((piece, i) => {
1149
1101
  const key = `${keyPrefix}-tab-${i}`;
1150
- return /* @__PURE__ */ jsxs(React6.Fragment, { children: [
1102
+ return /* @__PURE__ */ jsxs(React7.Fragment, { children: [
1151
1103
  piece.leaderStyle ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", style: piece.leaderStyle, children: piece.leaderText }) : null,
1152
1104
  /* @__PURE__ */ jsx("span", { style: piece.style, children: renderPiece(piece.text, key) })
1153
1105
  ] }, key);
@@ -1167,7 +1119,7 @@ function renderScriptAwareText(text, needsScriptFonts, scriptFonts, baseFontFami
1167
1119
  return text;
1168
1120
  }
1169
1121
  return pieces.map(
1170
- (piece, i) => piece.style ? /* @__PURE__ */ jsx("span", { style: piece.style, children: piece.text }, `${keyPrefix}-r${i}`) : /* @__PURE__ */ jsx(React6.Fragment, { children: piece.text }, `${keyPrefix}-r${i}`)
1122
+ (piece, i) => piece.style ? /* @__PURE__ */ jsx("span", { style: piece.style, children: piece.text }, `${keyPrefix}-r${i}`) : /* @__PURE__ */ jsx(React7.Fragment, { children: piece.text }, `${keyPrefix}-r${i}`)
1171
1123
  );
1172
1124
  }
1173
1125
  function renderMetricPieces(text, metric, keyPrefix, inner) {
@@ -1190,26 +1142,21 @@ function renderMetricPieces(text, metric, keyPrefix, inner) {
1190
1142
  `${keyPrefix}-w${i}`
1191
1143
  ));
1192
1144
  }
1193
- function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsScriptFonts, scriptFonts, baseFontFamily, findHighlights, tabContext, metric) {
1145
+ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsScriptFonts, scriptFonts, baseFontFamily, findHighlights, tabContext, metric, isUnderlineWords = false, wordDecoration) {
1194
1146
  const segHl = findHighlights?.get(segmentIndex);
1147
+ const renderLeaf = makeSegmentPieceRenderer(
1148
+ needsScriptFonts,
1149
+ scriptFonts,
1150
+ baseFontFamily,
1151
+ isUnderlineWords,
1152
+ wordDecoration,
1153
+ metric
1154
+ );
1195
1155
  if (!segHl || segHl.length === 0) {
1196
1156
  return lines.map((line, lineIndex) => {
1197
1157
  const lineKey = `${elementId}-seg-${segmentIndex}-line-${lineIndex}`;
1198
- const renderPiece = (text, key) => renderMetricPieces(
1199
- text,
1200
- metric,
1201
- key,
1202
- (pieceText, pieceKey) => renderScriptAwareText(
1203
- pieceText,
1204
- needsScriptFonts,
1205
- scriptFonts,
1206
- baseFontFamily,
1207
- pieceKey,
1208
- metric?.nestedStyle
1209
- )
1210
- );
1211
- return /* @__PURE__ */ jsxs(React6.Fragment, { children: [
1212
- tabContext && line.includes(" ") ? renderTabbedLine(line, tabContext, lineKey, renderPiece, metric?.nestedStyle) : renderPiece(line, lineKey),
1158
+ return /* @__PURE__ */ jsxs(React7.Fragment, { children: [
1159
+ tabContext && line.includes(" ") ? renderTabbedLine(line, tabContext, lineKey, renderLeaf, metric?.nestedStyle) : renderLeaf(line, lineKey),
1213
1160
  lineIndex < lines.length - 1 ? /* @__PURE__ */ jsx("br", {}) : null
1214
1161
  ] }, lineKey);
1215
1162
  });
@@ -1239,19 +1186,6 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
1239
1186
  isCurrent: false
1240
1187
  });
1241
1188
  }
1242
- const renderChunk = (text, key) => renderMetricPieces(
1243
- text,
1244
- metric,
1245
- key,
1246
- (pieceText, pieceKey) => renderScriptAwareText(
1247
- pieceText,
1248
- needsScriptFonts,
1249
- scriptFonts,
1250
- baseFontFamily,
1251
- pieceKey,
1252
- metric?.nestedStyle
1253
- )
1254
- );
1255
1189
  return chunks.map((chunk, ci) => {
1256
1190
  const chunkKey = `${elementId}-seg-${segmentIndex}-hl-${ci}`;
1257
1191
  return chunk.highlighted ? /* @__PURE__ */ jsx(
@@ -1263,10 +1197,10 @@ function renderSegmentContent(elementId, segmentIndex, textValue, lines, needsSc
1263
1197
  color: "inherit",
1264
1198
  borderRadius: 2
1265
1199
  },
1266
- children: renderChunk(chunk.text, chunkKey)
1200
+ children: renderLeaf(chunk.text, chunkKey)
1267
1201
  },
1268
1202
  chunkKey
1269
- ) : /* @__PURE__ */ jsx(React6.Fragment, { children: renderChunk(chunk.text, chunkKey) }, chunkKey);
1203
+ ) : /* @__PURE__ */ jsx(React7.Fragment, { children: renderLeaf(chunk.text, chunkKey) }, chunkKey);
1270
1204
  });
1271
1205
  }
1272
1206
  function renderEquationSegment(elementId, segmentIndex, equationXml, equationNumber) {
@@ -1328,11 +1262,12 @@ function renderHyperlink(run, spanNode, key, ctx) {
1328
1262
  }
1329
1263
  const requireCtrlClick = ctx.requireCtrlClick;
1330
1264
  const displayUrl = url.startsWith("ppaction://") ? url.replace(/^ppaction:\/\//u, "").split("?")[0] : url;
1265
+ const targetFrame = run.hyperlink?.target;
1331
1266
  const follow = (modified) => {
1332
1267
  if (requireCtrlClick && !modified) {
1333
1268
  return false;
1334
1269
  }
1335
- onHyperlinkClick(url);
1270
+ onHyperlinkClick(url, targetFrame);
1336
1271
  return true;
1337
1272
  };
1338
1273
  return /* @__PURE__ */ jsxs(
@@ -1448,6 +1383,16 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
1448
1383
  spanStyle.direction = runRtl ? "rtl" : "ltr";
1449
1384
  spanStyle.unicodeBidi = runRtl !== ctx.paragraphRtl ? "bidi-override" : "embed";
1450
1385
  }
1386
+ const isUnderlineWords = Boolean(segmentStyle.underline) && segmentStyle.underlineStyle === "words";
1387
+ const wordDecoration = isUnderlineWords ? nestedStyle : void 0;
1388
+ if (isUnderlineWords) {
1389
+ const stripped = stripUnderlineDecoration(spanStyle);
1390
+ spanStyle.textDecoration = stripped.textDecoration;
1391
+ delete spanStyle.textDecorationStyle;
1392
+ delete spanStyle.textDecorationThickness;
1393
+ delete spanStyle.textUnderlineOffset;
1394
+ delete spanStyle.textDecorationColor;
1395
+ }
1451
1396
  const baseContent = renderSegmentContent(
1452
1397
  element.id,
1453
1398
  segmentIndex,
@@ -1465,7 +1410,9 @@ function renderParagraphRun(run, segment, ctx, keySuffix = "") {
1465
1410
  Boolean(segmentStyle.bold),
1466
1411
  Boolean(segmentStyle.italic)
1467
1412
  ),
1468
- metricContext
1413
+ metricContext,
1414
+ isUnderlineWords,
1415
+ wordDecoration
1469
1416
  );
1470
1417
  const spanNode = /* @__PURE__ */ jsx("span", { "data-seg-idx": segmentIndex, style: spanStyle, children: renderRubyOrText(run, baseContent) }, key);
1471
1418
  const reflectedNode = wrapWithTextReflection(run, key, spanNode, spanStyle, baseContent);
@@ -1570,7 +1517,7 @@ function renderParagraph(para, paraIndex, paraCount, segments, ctx, subElementAn
1570
1517
  );
1571
1518
  const needsWrapper = Object.keys(paraStyle).length > 0 || marker !== null;
1572
1519
  if (!needsWrapper) {
1573
- return /* @__PURE__ */ jsxs(React6.Fragment, { children: [
1520
+ return /* @__PURE__ */ jsxs(React7.Fragment, { children: [
1574
1521
  wrappedContent,
1575
1522
  paraIndex < paraCount - 1 ? /* @__PURE__ */ jsx("br", {}) : null
1576
1523
  ] }, `${element.id}-para-${paraIndex}`);
@@ -3143,7 +3090,7 @@ function renderTableFromTableData(element, textStyle, options) {
3143
3090
  const rowCount = tableData.rows.length;
3144
3091
  const columnCount = tableData.columnWidths.length;
3145
3092
  const selectedCell = options?.selectedCell || null;
3146
- const isEditable = Boolean(options?.editable);
3093
+ const isEditable = Boolean(options?.editable) && canDrillDown(element);
3147
3094
  const hasCellSelectionHandler = typeof options?.onSelectCell === "function";
3148
3095
  const sharedCtx = {
3149
3096
  tableStyleMap: options?.styleCtx?.tableStyleMap,
@@ -3308,7 +3255,7 @@ function renderTableElement(element, textStyle, options) {
3308
3255
  return /* @__PURE__ */ jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: translationsEn["pptx.table.title"] });
3309
3256
  }
3310
3257
  const selectedCell = options?.selectedCell || null;
3311
- const isEditable = Boolean(options?.editable);
3258
+ const isEditable = Boolean(options?.editable) && canDrillDown(element);
3312
3259
  const hasCellSelectionHandler = typeof options?.onSelectCell === "function";
3313
3260
  const tableEl = element;
3314
3261
  const xmlSelectionRect = (() => {
@@ -3664,16 +3611,50 @@ function renderChartViewModel(elementId, vm, preserveAspectRatio = "none") {
3664
3611
  viewBox: `0 0 ${vm.svgWidth} ${vm.svgHeight}`,
3665
3612
  preserveAspectRatio,
3666
3613
  children: [
3667
- vm.areaFill && /* @__PURE__ */ jsx("rect", { x: 0, y: 0, width: vm.svgWidth, height: vm.svgHeight, fill: vm.areaFill }),
3614
+ vm.defs && vm.defs.length > 0 && /* @__PURE__ */ jsx("defs", { children: vm.defs.map((def, i) => /* @__PURE__ */ jsx(
3615
+ "pattern",
3616
+ {
3617
+ id: def.id,
3618
+ patternUnits: def.patternUnits,
3619
+ x: def.x,
3620
+ y: def.y,
3621
+ width: def.width,
3622
+ height: def.height,
3623
+ children: /* @__PURE__ */ jsx(
3624
+ "image",
3625
+ {
3626
+ href: def.href,
3627
+ x: 0,
3628
+ y: 0,
3629
+ width: def.width,
3630
+ height: def.height,
3631
+ preserveAspectRatio: def.preserveAspectRatio
3632
+ }
3633
+ )
3634
+ },
3635
+ `${elementId}-def-${i}`
3636
+ )) }),
3637
+ vm.areaFill && /* @__PURE__ */ jsx(
3638
+ "rect",
3639
+ {
3640
+ x: 0,
3641
+ y: 0,
3642
+ width: vm.svgWidth,
3643
+ height: vm.svgHeight,
3644
+ rx: vm.areaRadius,
3645
+ fill: vm.areaFill
3646
+ }
3647
+ ),
3668
3648
  vm.title && /* @__PURE__ */ jsx(
3669
3649
  "text",
3670
3650
  {
3671
3651
  x: vm.titleX,
3672
3652
  y: vm.titleY,
3673
3653
  textAnchor: "middle",
3674
- fontSize: 12,
3675
- fontWeight: 600,
3676
- fill: "#1e293b",
3654
+ fontSize: vm.titleStyle?.fontSize ?? 12,
3655
+ fontWeight: vm.titleStyle?.fontWeight ?? 600,
3656
+ fontFamily: vm.titleStyle?.fontFamily,
3657
+ fill: vm.titleStyle?.fill ?? "#1e293b",
3677
3658
  "data-chart-part": "title",
3678
3659
  children: vm.title
3679
3660
  }
Binary file
Binary file