pptx-react-viewer 2.15.3 → 2.16.1

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 (99) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/{AiChatPanel-R7BYGQX5.js → AiChatPanel-OHB6CVLY.js} +22 -22
  3. package/dist/AiChatPanel-OHB6CVLY.js.br +0 -0
  4. package/dist/AiChatPanel-OHB6CVLY.js.gz +0 -0
  5. package/dist/{AiChatPanel-OXAKUVYH.mjs → AiChatPanel-UPNVIENY.mjs} +3 -3
  6. package/dist/AiChatPanel-UPNVIENY.mjs.br +0 -0
  7. package/dist/AiChatPanel-UPNVIENY.mjs.gz +0 -0
  8. package/dist/{Model3DScene-BK7RWDCU.js → Model3DScene-7FKWPESH.js} +2 -2
  9. package/dist/Model3DScene-7FKWPESH.js.br +0 -0
  10. package/dist/Model3DScene-7FKWPESH.js.gz +0 -0
  11. package/dist/{Model3DScene-TPUVF4FY.mjs → Model3DScene-KEUY3M7X.mjs} +1 -1
  12. package/dist/Model3DScene-KEUY3M7X.mjs.br +0 -0
  13. package/dist/Model3DScene-KEUY3M7X.mjs.gz +0 -0
  14. package/dist/{SurfaceChart3DScene-FXJ45DC5.mjs → SurfaceChart3DScene-2MLBPJ63.mjs} +1 -1
  15. package/dist/{SurfaceChart3DScene-FXJ45DC5.mjs.br → SurfaceChart3DScene-2MLBPJ63.mjs.br} +0 -0
  16. package/dist/SurfaceChart3DScene-2MLBPJ63.mjs.gz +0 -0
  17. package/dist/{SurfaceChart3DScene-WOLVZOW3.js → SurfaceChart3DScene-NPJQXIGW.js} +2 -2
  18. package/dist/SurfaceChart3DScene-NPJQXIGW.js.br +0 -0
  19. package/dist/SurfaceChart3DScene-NPJQXIGW.js.gz +0 -0
  20. package/dist/{chunk-YBTRSG74.js → chunk-3NDRTC7T.js} +352 -40
  21. package/dist/chunk-3NDRTC7T.js.br +0 -0
  22. package/dist/{chunk-YBTRSG74.js.gz → chunk-3NDRTC7T.js.gz} +0 -0
  23. package/dist/{chunk-RPGAI65Z.mjs → chunk-6ROCCY4M.mjs} +14 -9
  24. package/dist/chunk-6ROCCY4M.mjs.br +0 -0
  25. package/dist/chunk-6ROCCY4M.mjs.gz +0 -0
  26. package/dist/{chunk-T5IS3MGN.js → chunk-7UBDMCI7.js} +3 -3
  27. package/dist/chunk-7UBDMCI7.js.br +0 -0
  28. package/dist/chunk-7UBDMCI7.js.gz +0 -0
  29. package/dist/{chunk-3XJODTAV.js → chunk-DQTTI6D4.js} +362 -341
  30. package/dist/chunk-DQTTI6D4.js.br +0 -0
  31. package/dist/chunk-DQTTI6D4.js.gz +0 -0
  32. package/dist/{chunk-6M6WP2TK.mjs → chunk-ENOHLGJ2.mjs} +344 -40
  33. package/dist/chunk-ENOHLGJ2.mjs.br +0 -0
  34. package/dist/{chunk-6M6WP2TK.mjs.gz → chunk-ENOHLGJ2.mjs.gz} +0 -0
  35. package/dist/{chunk-FHTEL3Q6.js → chunk-IN7D2T4R.js} +373 -375
  36. package/dist/chunk-IN7D2T4R.js.br +0 -0
  37. package/dist/chunk-IN7D2T4R.js.gz +0 -0
  38. package/dist/{chunk-U2UPBBJV.mjs → chunk-LJZFG6YP.mjs} +1 -1
  39. package/dist/chunk-LJZFG6YP.mjs.br +0 -0
  40. package/dist/chunk-LJZFG6YP.mjs.gz +0 -0
  41. package/dist/{chunk-IEXZ2JSO.js → chunk-N6IE34HX.js} +1060 -1055
  42. package/dist/chunk-N6IE34HX.js.br +0 -0
  43. package/dist/chunk-N6IE34HX.js.gz +0 -0
  44. package/dist/{chunk-OPX74QGH.mjs → chunk-RUK5XZGO.mjs} +31 -10
  45. package/dist/chunk-RUK5XZGO.mjs.br +0 -0
  46. package/dist/chunk-RUK5XZGO.mjs.gz +0 -0
  47. package/dist/{chunk-WJNWCKS7.mjs → chunk-ZOOGEDYG.mjs} +131 -133
  48. package/dist/chunk-ZOOGEDYG.mjs.br +0 -0
  49. package/dist/chunk-ZOOGEDYG.mjs.gz +0 -0
  50. package/dist/index.js +39 -39
  51. package/dist/index.js.br +0 -0
  52. package/dist/index.js.gz +0 -0
  53. package/dist/index.mjs +5 -5
  54. package/dist/index.mjs.br +0 -0
  55. package/dist/index.mjs.gz +0 -0
  56. package/dist/internals.d.ts +16 -0
  57. package/dist/internals.d.ts.map +1 -1
  58. package/dist/internals.js +78 -78
  59. package/dist/internals.js.br +0 -0
  60. package/dist/internals.js.gz +0 -0
  61. package/dist/internals.mjs +3 -3
  62. package/dist/internals.mjs.br +0 -0
  63. package/dist/internals.mjs.gz +0 -0
  64. package/dist/viewer/index.js +26 -26
  65. package/dist/viewer/index.js.br +0 -0
  66. package/dist/viewer/index.js.gz +0 -0
  67. package/dist/viewer/index.mjs +5 -5
  68. package/dist/viewer/index.mjs.br +0 -0
  69. package/dist/viewer/index.mjs.gz +0 -0
  70. package/package.json +1 -1
  71. package/dist/AiChatPanel-OXAKUVYH.mjs.br +0 -0
  72. package/dist/AiChatPanel-OXAKUVYH.mjs.gz +0 -0
  73. package/dist/AiChatPanel-R7BYGQX5.js.br +0 -0
  74. package/dist/AiChatPanel-R7BYGQX5.js.gz +0 -0
  75. package/dist/Model3DScene-BK7RWDCU.js.br +0 -0
  76. package/dist/Model3DScene-BK7RWDCU.js.gz +0 -0
  77. package/dist/Model3DScene-TPUVF4FY.mjs.br +0 -0
  78. package/dist/Model3DScene-TPUVF4FY.mjs.gz +0 -0
  79. package/dist/SurfaceChart3DScene-FXJ45DC5.mjs.gz +0 -0
  80. package/dist/SurfaceChart3DScene-WOLVZOW3.js.br +0 -0
  81. package/dist/SurfaceChart3DScene-WOLVZOW3.js.gz +0 -0
  82. package/dist/chunk-3XJODTAV.js.br +0 -0
  83. package/dist/chunk-3XJODTAV.js.gz +0 -0
  84. package/dist/chunk-6M6WP2TK.mjs.br +0 -0
  85. package/dist/chunk-FHTEL3Q6.js.br +0 -0
  86. package/dist/chunk-FHTEL3Q6.js.gz +0 -0
  87. package/dist/chunk-IEXZ2JSO.js.br +0 -0
  88. package/dist/chunk-IEXZ2JSO.js.gz +0 -0
  89. package/dist/chunk-OPX74QGH.mjs.br +0 -0
  90. package/dist/chunk-OPX74QGH.mjs.gz +0 -0
  91. package/dist/chunk-RPGAI65Z.mjs.br +0 -0
  92. package/dist/chunk-RPGAI65Z.mjs.gz +0 -0
  93. package/dist/chunk-T5IS3MGN.js.br +0 -0
  94. package/dist/chunk-T5IS3MGN.js.gz +0 -0
  95. package/dist/chunk-U2UPBBJV.mjs.br +0 -0
  96. package/dist/chunk-U2UPBBJV.mjs.gz +0 -0
  97. package/dist/chunk-WJNWCKS7.mjs.br +0 -0
  98. package/dist/chunk-WJNWCKS7.mjs.gz +0 -0
  99. package/dist/chunk-YBTRSG74.js.br +0 -0
Binary file
Binary file
@@ -1,6 +1,6 @@
1
- import { cloneHistorySnapshot, MIN_ELEMENT_SIZE, ZOOM_TO_SELECTION_PADDING, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, partitionTemplateElements, UNGROUPED_SECTION_ID, buildSaveSlides, DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, executeMediaCommand, buildPdfFromImageData, buildNotesPdf, EMU_PER_PX, GRID_SIZE, DEFAULT_TEXT_FONT_SIZE } from './chunk-WJNWCKS7.mjs';
1
+ import { cloneHistorySnapshot, MIN_ELEMENT_SIZE, ZOOM_TO_SELECTION_PADDING, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, partitionTemplateElements, UNGROUPED_SECTION_ID, buildSaveSlides, DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, executeMediaCommand, buildPdfFromImageData, buildNotesPdf, EMU_PER_PX, GRID_SIZE, DEFAULT_TEXT_FONT_SIZE } from './chunk-ZOOGEDYG.mjs';
2
2
  import { translationsEn } from './chunk-5YV26HMJ.mjs';
3
- import { TOOLBAR_TABS, computeVirtualRange, DEFAULT_VIRTUAL_OVERSCAN, createPresenceProjector, BROADCAST_THROTTLE_MS, createSyncGate, clearLocalAwareness, validateRoomId, createDepartureChannel, resolveTransportForServerUrl, isMixedContentBlocked, CONNECTION_TIMEOUT_MS, registerCollaborationTeardown, sanitizeColor, cloneTemplateElementsBySlideId, cloneSlide, createViewerZoomStore, clampZoomScale, PresentationAnimationController, PRESENTATION_HASH, PRESENTATION_NONCE_KEY, PRESENTATION_CHANNEL_NAME, swapPresentationWindows, PRESENTATION_MESSAGE_ORIGIN, clearAudienceContent, buildPresentationAudienceUrl, resolveAudienceScreenPlacement, placeAudienceWindow, storeAudienceContent, isPresentationSessionMessage, endAudienceDisplay, createPresentationKeyBuffer, acceptsPresentationInput, resolveAutoAdvanceDelayMs, hasShowSlideAfter, nextShowSlideIndex, previousShowSlideIndex, createPresenterShowGuard, attachPresentationVisibilityPause, buildMorphTransitionPlan, morphOptionToMode, createCollaborationLivePatcher, publishLiveInlineText, PptxHandler, collectMediaElements, collectImagePaths, buildInitialGuides, EncryptedFileError, saveAutosaveSnapshot, isTemplateElementId, hasShapeProperties, hasTextProperties, getInlineEditorSelection, applyStyleToSelectedSegments, setPendingSelectionRestore, applyCaseTransformToSegments, transformTextCase, addSection, renameSection, deleteSection, moveSectionUp, moveSectionDown, moveSlidesToSection, normalizeColorsForCapture, preprocessCssForCapture, downloadBlob, sanitizeDownloadFilename, slideProgressPercent, slideStatusLabel, EXPORT_ASSEMBLING_PERCENT, EXPORT_DONE_PERCENT, isExportAbortError, recordProgressPercent, applyThemeToData, THEME_PRESETS, themeColorSchemesEqual, comparePresentation, applyAcceptSlide, applyAcceptAllSlides, collectUsedFonts, detectTouchDevice, detectOrientation, isMobileViewport, MOBILE_BREAKPOINT, TABLET_BREAKPOINT, mayLeaveSlideShow, stopAllPersistentAudio, remapTextToSegments, guidePxToEmu, shouldLoopContinuously, applyRehearsalTimings, copyFormatFromElement, applyFormatToElement, mapEditorKey, isEditorTextInputTarget, createViewerOptionsStore, readSlidesFromYDoc, reconcileSlidesInYDoc, LOCAL_SYNC_ORIGIN, observeYDocSlides, shouldAutoFollowBroadcaster, createTouchGestureRecognizer, MAX_ZOOM_SCALE, MIN_ZOOM_SCALE, isKeyboardOpen, openPptxFile, readBackstageRecentFile, isActionHidden, buildElementClipboardPayload, generatePackageReadme, exportDeckJson, groupElements, generateElementId, makeCloneId, alignElements, distributeElements, bringForward, sendBackward, bringToFront, sendToBack, newTableElement, createDefaultChartElement, readViewportMetrics, computeKeyboardInset, mergeShapes, mapPresentationKey, lastShowSlideIndex, firstShowSlideIndex, buildPrintDocument, buildOutlineHtml, buildSlidesHtml, buildNotesHtml, buildHandoutsHtml, createBlankSlide, makeSlideId, buildSlideTemplateSlide, templateSchemeFromTheme, buildThemeColorMap, reResolveSlideColors, computeEntranceAnimationDelay, createPresentationSessionId, resolveTransitionDurationMs, runPresentationAction, createPresenterTimer, createInitialPresentationSnapshot, mergePresentationSnapshot, resetPresenterTimer, presenterElapsed, stepPresenterZoom, togglePresenterTimer, canvasToJpegData, downloadDataUrl, pickSupportedMimeType, WEBM_MIME_CANDIDATES, fpsToFrameIntervalMs, segmentFrameCount, encodeGif, resolveShowSlideIndexes, groupSlidesBySection, hasCopyableFormat, createBackstagePresentation, buildFieldSubstitutionContext, cloneElementForPaste, computeScrollDelta, getPresetShapeClipPath, svgPathToPolygons, polygonsToSvgPath, rerouteConnectorsForMovedElements, applyReroutedConnectors, SvgExporter, buildPrintHtmlDocument, deleteTableColumn, rebuildTableStructureInRawXml, insertTableColumn, deleteTableRow, insertTableRow, updateCellTextStyleInRawXml, updateCellTextInRawXml, splitCell, updateMergeAttrsInRawXml, mergeCells, isPpactionUrl, parsePpactionUrl, safeOpenUrl, ACTION_BUTTON_PRESETS, elementActionToPptxAction, buildSmartArtPresetData, computeSnapToShape, publishLiveGeometry, computeMarqueeHitIds, mergeAdditiveSelection, applyResize, snapBoxToGrid, applyMotionPathPreset } from './chunk-6M6WP2TK.mjs';
3
+ import { TOOLBAR_TABS, computeVirtualRange, DEFAULT_VIRTUAL_OVERSCAN, createPresenceProjector, BROADCAST_THROTTLE_MS, createSyncGate, clearLocalAwareness, validateRoomId, createDepartureChannel, resolveTransportForServerUrl, isMixedContentBlocked, CONNECTION_TIMEOUT_MS, registerCollaborationTeardown, sanitizeColor, cloneTemplateElementsBySlideId, cloneSlide, createWheelStepBuffer, createViewerZoomStore, clampZoomScale, mapEditingWheel, PresentationAnimationController, PRESENTATION_HASH, PRESENTATION_NONCE_KEY, PRESENTATION_CHANNEL_NAME, swapPresentationWindows, PRESENTATION_MESSAGE_ORIGIN, clearAudienceContent, buildPresentationAudienceUrl, resolveAudienceScreenPlacement, placeAudienceWindow, storeAudienceContent, isPresentationSessionMessage, endAudienceDisplay, createPresentationKeyBuffer, acceptsPresentationInput, resolveAutoAdvanceDelayMs, hasShowSlideAfter, nextShowSlideIndex, previousShowSlideIndex, createPresenterShowGuard, attachPresentationVisibilityPause, buildMorphTransitionPlan, morphOptionToMode, buildMorphAnimationRules, createCollaborationLivePatcher, publishLiveInlineText, PptxHandler, collectMediaElements, collectImagePaths, buildInitialGuides, EncryptedFileError, saveAutosaveSnapshot, isTemplateElementId, hasShapeProperties, hasTextProperties, getInlineEditorSelection, applyStyleToSelectedSegments, setPendingSelectionRestore, applyCaseTransformToSegments, transformTextCase, addSection, renameSection, deleteSection, moveSectionUp, moveSectionDown, moveSlidesToSection, normalizeColorsForCapture, preprocessCssForCapture, downloadBlob, sanitizeDownloadFilename, slideProgressPercent, slideStatusLabel, EXPORT_ASSEMBLING_PERCENT, EXPORT_DONE_PERCENT, isExportAbortError, recordProgressPercent, applyThemeToData, THEME_PRESETS, themeColorSchemesEqual, comparePresentation, applyAcceptSlide, applyAcceptAllSlides, collectUsedFonts, detectTouchDevice, detectOrientation, isMobileViewport, MOBILE_BREAKPOINT, TABLET_BREAKPOINT, mayLeaveSlideShow, stopAllPersistentAudio, remapTextToSegments, guidePxToEmu, shouldLoopContinuously, applyRehearsalTimings, copyFormatFromElement, applyFormatToElement, mapEditorKey, isEditorTextInputTarget, createViewerOptionsStore, readSlidesFromYDoc, reconcileSlidesInYDoc, LOCAL_SYNC_ORIGIN, observeYDocSlides, shouldAutoFollowBroadcaster, createTouchGestureRecognizer, MAX_ZOOM_SCALE, MIN_ZOOM_SCALE, isKeyboardOpen, openPptxFile, readBackstageRecentFile, isActionHidden, buildElementClipboardPayload, generatePackageReadme, exportDeckJson, groupElements, generateElementId, makeCloneId, alignElements, distributeElements, bringForward, sendBackward, bringToFront, sendToBack, newTableElement, createDefaultChartElement, readViewportMetrics, computeKeyboardInset, mergeShapes, mapPresentationKey, lastShowSlideIndex, firstShowSlideIndex, mapPresentationWheel, buildPrintDocument, buildOutlineHtml, buildSlidesHtml, buildNotesHtml, buildHandoutsHtml, createBlankSlide, makeSlideId, buildSlideTemplateSlide, templateSchemeFromTheme, buildThemeColorMap, reResolveSlideColors, computeEntranceAnimationDelay, createPresentationSessionId, resolveTransitionDurationMs, runPresentationAction, createPresenterTimer, createInitialPresentationSnapshot, mergePresentationSnapshot, resetPresenterTimer, presenterElapsed, stepPresenterZoom, togglePresenterTimer, canvasToJpegData, downloadDataUrl, pickSupportedMimeType, WEBM_MIME_CANDIDATES, fpsToFrameIntervalMs, segmentFrameCount, encodeGif, resolveShowSlideIndexes, groupSlidesBySection, hasCopyableFormat, createBackstagePresentation, buildFieldSubstitutionContext, cloneElementForPaste, computeScrollDelta, getPresetShapeClipPath, svgPathToPolygons, polygonsToSvgPath, rerouteConnectorsForMovedElements, applyReroutedConnectors, SvgExporter, buildPrintHtmlDocument, deleteTableColumn, rebuildTableStructureInRawXml, insertTableColumn, deleteTableRow, insertTableRow, updateCellTextStyleInRawXml, updateCellTextInRawXml, splitCell, updateMergeAttrsInRawXml, mergeCells, isPpactionUrl, parsePpactionUrl, safeOpenUrl, ACTION_BUTTON_PRESETS, elementActionToPptxAction, buildSmartArtPresetData, computeSnapToShape, publishLiveGeometry, computeMarqueeHitIds, mergeAdditiveSelection, applyResize, snapBoxToGrid, applyMotionPathPreset } from './chunk-ENOHLGJ2.mjs';
4
4
  import { useRef, useState, useEffect, useCallback, useMemo, useLayoutEffect, useSyncExternalStore, useImperativeHandle } from 'react';
5
5
  import JSZip from 'jszip';
6
6
  import { useTranslation } from 'react-i18next';
@@ -720,6 +720,7 @@ function useZoomViewport({
720
720
  const canvasStageRef = useRef(null);
721
721
  const canvasViewportRef = useRef(null);
722
722
  const renderScaleRef = useRef(1);
723
+ const wheelBufferRef = useRef(createWheelStepBuffer());
723
724
  const storeRef = useRef(null);
724
725
  storeRef.current ??= createViewerZoomStore();
725
726
  const store = storeRef.current;
@@ -858,14 +859,14 @@ function useZoomViewport({
858
859
  ]);
859
860
  const handleWheel = useCallback(
860
861
  (event) => {
861
- if (!event.ctrlKey) {
862
+ const mapped = mapEditingWheel(event, wheelBufferRef.current, true);
863
+ if (mapped.intent !== "zoom") {
862
864
  return;
863
865
  }
864
866
  event.preventDefault();
865
- const delta = event.deltaY * -1e-3;
866
867
  store.dispatch({
867
868
  type: "set-zoom",
868
- zoom: clampZoomScale(store.getState().zoom + delta)
869
+ zoom: clampZoomScale(store.getState().zoom + mapped.deltaScale)
869
870
  });
870
871
  },
871
872
  [store]
@@ -1655,6 +1656,7 @@ function useAudienceMode(input) {
1655
1656
  }, []);
1656
1657
  }
1657
1658
  function usePresentationKeyboard(input) {
1659
+ const wheelBufferRef = useRef(createWheelStepBuffer());
1658
1660
  const {
1659
1661
  mode,
1660
1662
  movePresentationSlide,
@@ -1740,9 +1742,24 @@ function usePresentationKeyboard(input) {
1740
1742
  break;
1741
1743
  }
1742
1744
  };
1745
+ const handleWheel = (event) => {
1746
+ if (mode !== "present" || !acceptsPresentationInput()) {
1747
+ return;
1748
+ }
1749
+ const mapped = mapPresentationWheel(event, wheelBufferRef.current);
1750
+ if (mapped.intent === "next-slide") {
1751
+ event.preventDefault();
1752
+ movePresentationSlide(1);
1753
+ } else if (mapped.intent === "previous-slide") {
1754
+ event.preventDefault();
1755
+ movePresentationSlide(-1);
1756
+ }
1757
+ };
1743
1758
  window.addEventListener("keydown", handleKeyDown);
1759
+ window.addEventListener("wheel", handleWheel, { passive: false });
1744
1760
  return () => {
1745
1761
  window.removeEventListener("keydown", handleKeyDown);
1762
+ window.removeEventListener("wheel", handleWheel);
1746
1763
  };
1747
1764
  }, [
1748
1765
  mode,
@@ -2529,11 +2546,15 @@ function usePresentationMode(input) {
2529
2546
  }
2530
2547
  return merged;
2531
2548
  }, [morphPlan, presentationElementStates]);
2532
- const morphedKeyframesCss = useMemo(
2533
- () => morphPlan ? `${presentationKeyframesCss ?? ""}
2534
- ${morphPlan.keyframesCss}` : presentationKeyframesCss,
2535
- [morphPlan, presentationKeyframesCss]
2536
- );
2549
+ const morphedKeyframesCss = useMemo(() => {
2550
+ if (!morphPlan) {
2551
+ return presentationKeyframesCss;
2552
+ }
2553
+ const imageRules = buildMorphAnimationRules(morphPlan, "", "incoming", "image");
2554
+ return `${presentationKeyframesCss ?? ""}
2555
+ ${morphPlan.keyframesCss}
2556
+ ${imageRules}`;
2557
+ }, [morphPlan, presentationKeyframesCss]);
2537
2558
  return {
2538
2559
  presentationSlideIndex,
2539
2560
  setPresentationSlideIndex,
Binary file
Binary file
@@ -1,11 +1,11 @@
1
1
  import { translationsEn } from './chunk-5YV26HMJ.mjs';
2
- import { SHAPE_PRESET_DEFS, computeValueRangeForChart, VIEWER_SHORTCUT_REFERENCE, getAnimationInitialStyle, cloneHistorySnapshot, hasShapeProperties, isTemplateElement, getImageFitStyle, isImageLikeElement, runMediaCommand, findMediaElementByElementId, mediaPlaybackAttributes, buildTextBlockStyle, hasTextProperties, toCssWritingMode, toCssTextOrientation, toCssVerticalDirection, getKinsokuLineBreakStyles, buildTextBody3DSceneStyle, resolveParagraphRtl, resolveParagraphAlign, resolveCssTextAlign, resolveParagraphStrutFontSize, colorWithOpacity, normalizeHexColor, build3DExtrusionData, isIdentityRectClip, getResolvedShapeClipPath, isStrokeOnlyPresetElement, normalizeStrokeDashType, buildCssGradientFromShapeStyle, buildShadowCssFromShapeStyle, buildInnerShadowCssFromShapeStyle, suppressesCssBorder, buildMultiLayerShadowCss, buildGlowBoxShadow, getCompoundLineBoxShadow, getSoftEdgeFilterId, getEffectDagFilter, buildPatternFillCss, buildReflectionCss, getCssBorderDashStyle, getCompoundLineBorderWidth, getSvgStrokeDasharray, buildSvgGradientDef, isCalloutShape, getCalloutLeaderLineGeometry, buildCalloutLeaderLineSvgPath, getCalloutViewBoxBounds, svgLineCap, getCompoundLineOffsets, getCompoundLineWidths, computeSelectionRect, DEFAULT_FONT_FAMILY, rectToCells, isCellInRect, buildChartViewModel, buildNotesPdfBytes, buildSlidesPdfBytes, buildPreviewAnimation, buildMotionPathPreview, getRoundRectRadiusPx2, registerPersistentAudio, proportionalLineHeight, substituteFieldText, resolveUnderlineDecorationStyle, POWERPOINT_METRIC_TRACKING, resolveAutoFitFontScale, getSubstituteFontFamily, parsePanoseString, hasDistinctScriptFonts, buildTextReflectionCss, getTextAlphaOpacity, buildTextRunFilterChain, buildTextShadowCss, TEXT_BUILD_ID_SEP, buildTextBuildSpec, textBuildSpanStyle, sanitizeGradientStops, getGradientTileFlipCss, getGradientTileRectCss, apply3dEffects, clampUnitInterval, customGeometryPathsToSvgSubpaths, svgGradientFillRef, computeColumnBoundaries, parseDrawingColor, parseDrawingColorOpacity, getCellDiagonalBorders, getPatternSvg, ooxmlDashToCssBorderStyle, cell3DBevelCss, getChartStylePalette, chartAreaFill, 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-6M6WP2TK.mjs';
2
+ import { SHAPE_PRESET_DEFS, computeValueRangeForChart, VIEWER_SHORTCUT_REFERENCE, getAnimationInitialStyle, cloneHistorySnapshot, hasShapeProperties, isTemplateElement, getImageFitStyle, isImageLikeElement, runMediaCommand, findMediaElementByElementId, mediaPlaybackAttributes, buildTextBlockStyle, hasTextProperties, toCssWritingMode, toCssTextOrientation, toCssVerticalDirection, getKinsokuLineBreakStyles, buildTextBody3DSceneStyle, resolveParagraphRtl, resolveParagraphAlign, resolveCssTextAlign, resolveParagraphStrutFontSize, colorWithOpacity, normalizeHexColor, build3DExtrusionData, isIdentityRectClip, getResolvedShapeClipPath, isStrokeOnlyPresetElement, normalizeStrokeDashType, buildCssGradientFromShapeStyle, buildShadowCssFromShapeStyle, buildInnerShadowCssFromShapeStyle, suppressesCssBorder, buildMultiLayerShadowCss, buildGlowBoxShadow, getCompoundLineBoxShadow, getSoftEdgeFilterId, getEffectDagFilter, buildPatternFillCss, buildReflectionCss, getCssBorderDashStyle, getCompoundLineBorderWidth, getSvgStrokeDasharray, buildSvgGradientDef, isCalloutShape, getCalloutLeaderLineGeometry, buildCalloutLeaderLineSvgPath, getCalloutViewBoxBounds, svgLineCap, getCompoundLineOffsets, getCompoundLineWidths, computeSelectionRect, DEFAULT_FONT_FAMILY, rectToCells, isCellInRect, buildChartViewModel, buildNotesPdfBytes, buildSlidesPdfBytes, buildPreviewAnimation, buildMotionPathPreview, getRoundRectRadiusPx2, mediaFallbackVisual, registerPersistentAudio, proportionalLineHeight, substituteFieldText, resolveUnderlineDecorationStyle, resolveAutoFitFontScale, getSubstituteFontFamily, parsePanoseString, hasDistinctScriptFonts, resolveMetricTrackingPx, buildTextReflectionCss, getTextAlphaOpacity, buildTextRunFilterChain, buildTextShadowCss, TEXT_BUILD_ID_SEP, buildTextBuildSpec, textBuildSpanStyle, sanitizeGradientStops, getGradientTileFlipCss, getGradientTileRectCss, apply3dEffects, clampUnitInterval, customGeometryPathsToSvgSubpaths, svgGradientFillRef, computeColumnBoundaries, parseDrawingColor, parseDrawingColorOpacity, getCellDiagonalBorders, getPatternSvg, ooxmlDashToCssBorderStyle, cell3DBevelCss, getChartStylePalette, chartAreaFill, computeLayout, valueToY, formatAxisValue, computeLayoutOptions, splitSeriesByAxis, computeValueRange, getSecondaryValueAxis, seriesColor, paletteColor, resolveRegionCode, normalizeValue, sequentialColorScale, mediaFallbackIcon, mediaFallbackLabelKey, MEDIA_CHROME_ATTRIBUTE, convertOmmlToMathMl, sanitizeMathMl, buildTextFillCss, resolvePictureBullet, computeResizedColumnWidths, computeResizedRowHeight, DEFAULT_ROW_HEIGHT, resolveFontRefIdx, tintColor2, shadeColor2, ooxmlGradientAngleToCssDegrees, segmentByScript, resolveFontForScript, generateLogTicks, formatAxisValueWithUnits, getDisplayUnitLabel, hexToRgbChannels, chartPartToAttrs } from './chunk-ENOHLGJ2.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';
6
6
  import { LuTriangle, LuPlus, LuMoveRight, LuMinus, LuDiamond, LuDatabase, LuCircle, LuSquare } from 'react-icons/lu';
7
- import { useTranslation } from 'react-i18next';
8
7
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
+ import { useTranslation } from 'react-i18next';
9
9
 
10
10
  // src/viewer/utils/animation-effects.ts
11
11
  function getAnimationInitialStyle2(preset, nativeAnimation) {
@@ -544,36 +544,6 @@ function CaptionTrackRenderer({
544
544
  );
545
545
  }) });
546
546
  }
547
- function MediaNotFoundPlaceholder({
548
- mediaType
549
- }) {
550
- const { t } = useTranslation();
551
- const isVideo = mediaType === "video";
552
- return /* @__PURE__ */ jsxs("div", { className: "w-full h-full flex flex-col items-center justify-center gap-2 pointer-events-none bg-black/30 rounded border border-dashed border-white/20", children: [
553
- /* @__PURE__ */ jsx(
554
- "svg",
555
- {
556
- width: "36",
557
- height: "36",
558
- viewBox: "0 0 24 24",
559
- fill: "none",
560
- stroke: "currentColor",
561
- strokeWidth: "1.5",
562
- className: "text-white/50",
563
- children: isVideo ? /* @__PURE__ */ jsxs(Fragment, { children: [
564
- /* @__PURE__ */ jsx("rect", { x: "2", y: "4", width: "20", height: "16", rx: "2" }),
565
- /* @__PURE__ */ jsx("line", { x1: "2", y1: "4", x2: "22", y2: "20" })
566
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
567
- /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
568
- /* @__PURE__ */ jsx("line", { x1: "4", y1: "4", x2: "20", y2: "20" })
569
- ] })
570
- }
571
- ),
572
- /* @__PURE__ */ jsx("span", { className: "text-[10px] text-white/50", children: t("pptx.media.typeNotFound", {
573
- type: isVideo ? t("pptx.file.video") : t("pptx.file.audio")
574
- }) })
575
- ] });
576
- }
577
547
  function VideoWithMetadata({
578
548
  element,
579
549
  mediaRef,
@@ -896,6 +866,109 @@ function PresentationMediaController({
896
866
  )
897
867
  ] });
898
868
  }
869
+ function label(key) {
870
+ return key === void 0 ? void 0 : translationsEn[key];
871
+ }
872
+ function FallbackIcon({
873
+ paths,
874
+ size,
875
+ className
876
+ }) {
877
+ if (paths.length === 0) {
878
+ return null;
879
+ }
880
+ return /* @__PURE__ */ jsx(
881
+ "svg",
882
+ {
883
+ width: size,
884
+ height: size,
885
+ viewBox: "0 0 24 24",
886
+ fill: "none",
887
+ stroke: "currentColor",
888
+ strokeWidth: "1.5",
889
+ className,
890
+ children: paths.map((d) => /* @__PURE__ */ jsx("path", { d }, d))
891
+ }
892
+ );
893
+ }
894
+ function Badge({
895
+ visual,
896
+ element
897
+ }) {
898
+ if (visual.badge === "none") {
899
+ return null;
900
+ }
901
+ const isMissing = visual.badge === "missing";
902
+ return /* @__PURE__ */ jsxs(
903
+ "div",
904
+ {
905
+ className: `absolute inset-0 flex flex-col items-center justify-center ${isMissing ? "gap-1" : ""}`,
906
+ ...{ [MEDIA_CHROME_ATTRIBUTE]: visual.badge },
907
+ children: [
908
+ /* @__PURE__ */ jsx(
909
+ FallbackIcon,
910
+ {
911
+ paths: mediaFallbackIcon(visual, element.mediaType),
912
+ size: isMissing ? 32 : 48,
913
+ className: isMissing ? "text-white/60" : "text-white/80 drop-shadow-md"
914
+ }
915
+ ),
916
+ isMissing && /* @__PURE__ */ jsx("span", { className: "text-[10px] text-white/60", children: label(mediaFallbackLabelKey(visual, element.mediaType)) })
917
+ ]
918
+ }
919
+ );
920
+ }
921
+ function Placeholder({
922
+ visual,
923
+ element
924
+ }) {
925
+ if (visual.placeholder === "none") {
926
+ return null;
927
+ }
928
+ const isMissing = visual.placeholder === "missing";
929
+ return /* @__PURE__ */ jsxs(
930
+ "div",
931
+ {
932
+ className: `w-full h-full flex flex-col items-center justify-center gap-1 pointer-events-none rounded ${isMissing ? "bg-black/30 border border-dashed border-white/20" : element.mediaType === "audio" ? "bg-black/10" : "bg-black/20"}`,
933
+ ...{ [MEDIA_CHROME_ATTRIBUTE]: visual.placeholder },
934
+ children: [
935
+ /* @__PURE__ */ jsx(
936
+ FallbackIcon,
937
+ {
938
+ paths: mediaFallbackIcon(visual, element.mediaType),
939
+ size: isMissing ? 36 : element.mediaType === "audio" ? 24 : 32,
940
+ className: isMissing ? "text-white/50" : "text-white/70"
941
+ }
942
+ ),
943
+ /* @__PURE__ */ jsx("span", { className: `text-[10px] ${isMissing ? "text-white/50" : "text-white/70"}`, children: label(mediaFallbackLabelKey(visual, element.mediaType)) })
944
+ ]
945
+ }
946
+ );
947
+ }
948
+ function renderMediaFallback({
949
+ element,
950
+ posterUrl,
951
+ surface
952
+ }) {
953
+ const visual = mediaFallbackVisual(surface, {
954
+ hasPoster: Boolean(posterUrl),
955
+ missing: element.mediaMissing === true
956
+ });
957
+ if (visual.poster && posterUrl) {
958
+ return /* @__PURE__ */ jsxs("div", { className: "w-full h-full relative pointer-events-none", children: [
959
+ /* @__PURE__ */ jsx(
960
+ "img",
961
+ {
962
+ src: posterUrl,
963
+ alt: visual.dimPoster ? translationsEn["pptx.media.posterAlt"] : translationsEn["pptx.media.videoPosterAlt"],
964
+ className: `w-full h-full object-contain${visual.dimPoster ? " opacity-50" : ""}`
965
+ }
966
+ ),
967
+ /* @__PURE__ */ jsx(Badge, { visual, element })
968
+ ] });
969
+ }
970
+ return /* @__PURE__ */ jsx(Placeholder, { visual, element });
971
+ }
899
972
  function renderMediaElement(element, mediaDataUrls, options) {
900
973
  if (element.type !== "media") {
901
974
  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.media.title"] });
@@ -911,39 +984,12 @@ function renderMediaElement(element, mediaDataUrls, options) {
911
984
  const isFullScreen = options?.fullScreen === true;
912
985
  const isPresentationMode = options?.isPresentationMode === true;
913
986
  const showTransport = options?.showTransport ?? !isPresentationMode;
987
+ const surface = {
988
+ presenting: isPresentationMode,
989
+ preview: options?.preview === true
990
+ };
914
991
  if (element.mediaMissing) {
915
- if (posterUrl) {
916
- return /* @__PURE__ */ jsxs("div", { className: "w-full h-full relative pointer-events-none", children: [
917
- /* @__PURE__ */ jsx(
918
- "img",
919
- {
920
- src: posterUrl,
921
- alt: translationsEn["pptx.media.posterAlt"],
922
- className: "w-full h-full object-contain opacity-50"
923
- }
924
- ),
925
- /* @__PURE__ */ jsxs("div", { className: "absolute inset-0 flex flex-col items-center justify-center gap-1", children: [
926
- /* @__PURE__ */ jsxs(
927
- "svg",
928
- {
929
- width: "32",
930
- height: "32",
931
- viewBox: "0 0 24 24",
932
- fill: "none",
933
- stroke: "currentColor",
934
- strokeWidth: "1.5",
935
- className: "text-white/60",
936
- children: [
937
- /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "10" }),
938
- /* @__PURE__ */ jsx("line", { x1: "4", y1: "4", x2: "20", y2: "20" })
939
- ]
940
- }
941
- ),
942
- /* @__PURE__ */ jsx("span", { className: "text-[10px] text-white/60", children: translationsEn["pptx.media.notFound"] })
943
- ] })
944
- ] });
945
- }
946
- return /* @__PURE__ */ jsx(MediaNotFoundPlaceholder, { mediaType: mediaType ?? "video" });
992
+ return renderMediaFallback({ element, posterUrl, surface });
947
993
  }
948
994
  if (mediaType === "video") {
949
995
  if (dataUrl) {
@@ -976,47 +1022,7 @@ function renderMediaElement(element, mediaDataUrls, options) {
976
1022
  }
977
1023
  );
978
1024
  }
979
- if (posterUrl) {
980
- return /* @__PURE__ */ jsxs("div", { className: "w-full h-full relative pointer-events-none", children: [
981
- /* @__PURE__ */ jsx(
982
- "img",
983
- {
984
- src: posterUrl,
985
- alt: translationsEn["pptx.media.videoPosterAlt"],
986
- className: "w-full h-full object-contain"
987
- }
988
- ),
989
- /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ jsx(
990
- "svg",
991
- {
992
- width: "48",
993
- height: "48",
994
- viewBox: "0 0 24 24",
995
- fill: "none",
996
- stroke: "currentColor",
997
- strokeWidth: "1.5",
998
- className: "text-white/80 drop-shadow-md",
999
- children: /* @__PURE__ */ jsx("polygon", { points: "5 3 19 12 5 21 5 3" })
1000
- }
1001
- ) })
1002
- ] });
1003
- }
1004
- return /* @__PURE__ */ jsxs("div", { className: "w-full h-full flex flex-col items-center justify-center gap-1 pointer-events-none bg-black/20 rounded", children: [
1005
- /* @__PURE__ */ jsx(
1006
- "svg",
1007
- {
1008
- width: "32",
1009
- height: "32",
1010
- viewBox: "0 0 24 24",
1011
- fill: "none",
1012
- stroke: "currentColor",
1013
- strokeWidth: "1.5",
1014
- className: "text-white/70",
1015
- children: /* @__PURE__ */ jsx("polygon", { points: "5 3 19 12 5 21 5 3" })
1016
- }
1017
- ),
1018
- /* @__PURE__ */ jsx("span", { className: "text-[10px] text-white/70", children: "Video" })
1019
- ] });
1025
+ return renderMediaFallback({ element, posterUrl, surface });
1020
1026
  }
1021
1027
  if (mediaType === "audio") {
1022
1028
  if (dataUrl) {
@@ -1046,28 +1052,12 @@ function renderMediaElement(element, mediaDataUrls, options) {
1046
1052
  }
1047
1053
  );
1048
1054
  }
1049
- return /* @__PURE__ */ jsxs("div", { className: "w-full h-full flex flex-col items-center justify-center gap-1 pointer-events-none bg-black/10 rounded", children: [
1050
- /* @__PURE__ */ jsxs(
1051
- "svg",
1052
- {
1053
- width: "24",
1054
- height: "24",
1055
- viewBox: "0 0 24 24",
1056
- fill: "none",
1057
- stroke: "currentColor",
1058
- strokeWidth: "1.5",
1059
- className: "text-white/70",
1060
- children: [
1061
- /* @__PURE__ */ jsx("path", { d: "M9 18V5l12-2v13" }),
1062
- /* @__PURE__ */ jsx("circle", { cx: "6", cy: "18", r: "3" }),
1063
- /* @__PURE__ */ jsx("circle", { cx: "18", cy: "16", r: "3" })
1064
- ]
1065
- }
1066
- ),
1067
- /* @__PURE__ */ jsx("span", { className: "text-[10px] text-white/70", children: "Audio" })
1068
- ] });
1055
+ return renderMediaFallback({ element, posterUrl, surface });
1056
+ }
1057
+ if (surface.presenting || surface.preview) {
1058
+ return null;
1069
1059
  }
1070
- return /* @__PURE__ */ jsx("div", { className: "w-full h-full flex items-center justify-center text-[11px] text-white/80 pointer-events-none", children: "Media" });
1060
+ 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.media.title"] });
1071
1061
  }
1072
1062
 
1073
1063
  // src/viewer/utils/text-utils.tsx
@@ -1726,7 +1716,7 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
1726
1716
  const rawBaseline = typeof segmentStyle.baseline === "number" ? segmentStyle.baseline : 0;
1727
1717
  const baselineFraction = rawBaseline === 0 ? 0 : Math.abs(rawBaseline) >= 1e3 ? rawBaseline / 1e5 : rawBaseline / 100;
1728
1718
  const baselineFontScale = baselineFraction !== 0 ? 0.65 : 1;
1729
- const letterSpacing = typeof segmentStyle.characterSpacing === "number" && segmentStyle.characterSpacing !== 0 ? `calc(${segmentStyle.characterSpacing / 100 * (96 / 72)}px + ${POWERPOINT_METRIC_TRACKING})` : POWERPOINT_METRIC_TRACKING;
1719
+ const authoredLetterSpacing = typeof segmentStyle.characterSpacing === "number" && segmentStyle.characterSpacing !== 0 ? segmentStyle.characterSpacing / 100 * (96 / 72) : 0;
1730
1720
  const textFillStyles = buildTextFillCss2(segmentStyle);
1731
1721
  const rawFontSize = segmentStyle.fontSize || element.textStyle?.fontSize || DEFAULT_TEXT_FONT_SIZE;
1732
1722
  const autoFitScale = resolveAutoFitFontScale(element.textStyle);
@@ -1756,6 +1746,14 @@ function renderSingleSegment(element, segment, segmentIndex, fallbackColor, find
1756
1746
  )
1757
1747
  };
1758
1748
  const needsScriptFonts = hasDistinctScriptFonts(scriptFonts);
1749
+ const metricTracking = resolveMetricTrackingPx(textValue, {
1750
+ fontFamily: baseFontFamily,
1751
+ fontSizePx: baseFontSize * baselineFontScale,
1752
+ bold: Boolean(segmentStyle.bold),
1753
+ italic: Boolean(segmentStyle.italic)
1754
+ });
1755
+ const totalLetterSpacing = authoredLetterSpacing + metricTracking;
1756
+ const letterSpacing = totalLetterSpacing === 0 ? void 0 : `${totalLetterSpacing}px`;
1759
1757
  const spanStyle = {
1760
1758
  color: resolvedSegmentColor,
1761
1759
  fontSize: baseFontSize * baselineFontScale,
@@ -6162,7 +6160,7 @@ function FailedToLoad() {
6162
6160
  var LazySurfaceChart3DScene = React6.lazy(
6163
6161
  async () => {
6164
6162
  try {
6165
- return await import('./SurfaceChart3DScene-FXJ45DC5.mjs');
6163
+ return await import('./SurfaceChart3DScene-2MLBPJ63.mjs');
6166
6164
  } catch {
6167
6165
  return { default: FailedToLoad };
6168
6166
  }
@@ -6494,7 +6492,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
6494
6492
  `${element.id}-tm-${item.index}`
6495
6493
  )
6496
6494
  );
6497
- const label = categoryLabels[item.index] ?? `${item.index + 1}`;
6495
+ const label2 = categoryLabels[item.index] ?? `${item.index + 1}`;
6498
6496
  if (w > 30 && h > 14) {
6499
6497
  rects.push(
6500
6498
  /* @__PURE__ */ jsx(
@@ -6506,7 +6504,7 @@ function renderTreemapChart(element, chartData, categoryLabels) {
6506
6504
  fontSize: Math.min(10, h * 0.3),
6507
6505
  fill: "#fff",
6508
6506
  fontWeight: 600,
6509
- children: label
6507
+ children: label2
6510
6508
  },
6511
6509
  `${element.id}-tm-lbl-${item.index}`
6512
6510
  )
@@ -6973,14 +6971,14 @@ function layoutToCategory(layout) {
6973
6971
  };
6974
6972
  return map[layout] ?? "list";
6975
6973
  }
6976
- function smartArtNodeGroupProps(nodeId, shadow, label) {
6974
+ function smartArtNodeGroupProps(nodeId, shadow, label2) {
6977
6975
  const props = {
6978
6976
  "data-smartart-node-id": nodeId,
6979
6977
  style: { filter: shadow, pointerEvents: "auto" }
6980
6978
  };
6981
- if (label) {
6979
+ if (label2) {
6982
6980
  props.role = "img";
6983
- props["aria-label"] = label;
6981
+ props["aria-label"] = label2;
6984
6982
  }
6985
6983
  return props;
6986
6984
  }
Binary file
Binary file