pptx-react-viewer 3.5.4 → 3.7.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.
- package/CHANGELOG.md +25 -0
- package/dist/{AiChatPanel-CCJNQGER.mjs → AiChatPanel-L5QGWVZK.mjs} +4 -4
- package/dist/AiChatPanel-L5QGWVZK.mjs.br +0 -0
- package/dist/AiChatPanel-L5QGWVZK.mjs.gz +0 -0
- package/dist/{AiChatPanel-LPZWDNVU.js → AiChatPanel-M3AHKYPS.js} +25 -25
- package/dist/AiChatPanel-M3AHKYPS.js.br +0 -0
- package/dist/AiChatPanel-M3AHKYPS.js.gz +0 -0
- package/dist/{Area3DChartScene-P6YM6ZL7.mjs → Area3DChartScene-AE2XYKDW.mjs} +1 -1
- package/dist/Area3DChartScene-AE2XYKDW.mjs.br +1 -0
- package/dist/Area3DChartScene-AE2XYKDW.mjs.gz +0 -0
- package/dist/{Area3DChartScene-LJCWBNQ3.js → Area3DChartScene-ZQLQK6L4.js} +2 -2
- package/dist/Area3DChartScene-ZQLQK6L4.js.br +0 -0
- package/dist/Area3DChartScene-ZQLQK6L4.js.gz +0 -0
- package/dist/{Bar3DChartScene-DIVOJURZ.mjs → Bar3DChartScene-FQV62XOI.mjs} +1 -1
- package/dist/Bar3DChartScene-FQV62XOI.mjs.br +2 -0
- package/dist/Bar3DChartScene-FQV62XOI.mjs.gz +0 -0
- package/dist/{Bar3DChartScene-7DNQ4X5T.js → Bar3DChartScene-TZ6ADFBS.js} +2 -2
- package/dist/Bar3DChartScene-TZ6ADFBS.js.br +0 -0
- package/dist/Bar3DChartScene-TZ6ADFBS.js.gz +0 -0
- package/dist/{Line3DChartScene-UF6DHP36.js → Line3DChartScene-5CKPAX63.js} +2 -2
- package/dist/Line3DChartScene-5CKPAX63.js.br +0 -0
- package/dist/Line3DChartScene-5CKPAX63.js.gz +0 -0
- package/dist/{Line3DChartScene-ZZVNUKIJ.mjs → Line3DChartScene-FEUY3PCE.mjs} +1 -1
- package/dist/Line3DChartScene-FEUY3PCE.mjs.br +1 -0
- package/dist/Line3DChartScene-FEUY3PCE.mjs.gz +0 -0
- package/dist/{Model3DScene-C7MZ22DH.js → Model3DScene-BLXEALM6.js} +2 -2
- package/dist/Model3DScene-BLXEALM6.js.br +0 -0
- package/dist/Model3DScene-BLXEALM6.js.gz +0 -0
- package/dist/{Model3DScene-XXMAAKBR.mjs → Model3DScene-V3DHIISV.mjs} +1 -1
- package/dist/Model3DScene-V3DHIISV.mjs.br +0 -0
- package/dist/Model3DScene-V3DHIISV.mjs.gz +0 -0
- package/dist/{PieChart3DScene-N2Y25VG5.js → PieChart3DScene-GHHT3PDV.js} +2 -2
- package/dist/PieChart3DScene-GHHT3PDV.js.br +0 -0
- package/dist/PieChart3DScene-GHHT3PDV.js.gz +0 -0
- package/dist/{PieChart3DScene-7LX3IL2Q.mjs → PieChart3DScene-VZI2VARG.mjs} +1 -1
- package/dist/{PieChart3DScene-7LX3IL2Q.mjs.br → PieChart3DScene-VZI2VARG.mjs.br} +0 -0
- package/dist/PieChart3DScene-VZI2VARG.mjs.gz +0 -0
- package/dist/PowerPointViewer-Cl6jBPNw.d.ts.map +1 -1
- package/dist/{SurfaceChart3DScene-ADA7NUIW.mjs → SurfaceChart3DScene-T36E2HBA.mjs} +1 -1
- package/dist/SurfaceChart3DScene-T36E2HBA.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-T36E2HBA.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-WXJHYOGJ.js → SurfaceChart3DScene-WWIMQ65D.js} +2 -2
- package/dist/SurfaceChart3DScene-WWIMQ65D.js.br +0 -0
- package/dist/SurfaceChart3DScene-WWIMQ65D.js.gz +0 -0
- package/dist/{chunk-UOMFINNJ.js → chunk-3EJFZ7TE.js} +33 -5
- package/dist/chunk-3EJFZ7TE.js.br +0 -0
- package/dist/chunk-3EJFZ7TE.js.gz +0 -0
- package/dist/{chunk-YQOK4E2A.js → chunk-DCNHUEWQ.js} +35917 -23497
- package/dist/chunk-DCNHUEWQ.js.br +0 -0
- package/dist/chunk-DCNHUEWQ.js.gz +0 -0
- package/dist/{chunk-JCJ3EPG6.mjs → chunk-FGTMS7LR.mjs} +14 -23
- package/dist/chunk-FGTMS7LR.mjs.br +0 -0
- package/dist/chunk-FGTMS7LR.mjs.gz +0 -0
- package/dist/{chunk-U52MKWVA.mjs → chunk-JANUSAEK.mjs} +189 -225
- package/dist/chunk-JANUSAEK.mjs.br +0 -0
- package/dist/chunk-JANUSAEK.mjs.gz +0 -0
- package/dist/{chunk-NM652EZS.mjs → chunk-NV55GU5V.mjs} +35881 -23494
- package/dist/chunk-NV55GU5V.mjs.br +0 -0
- package/dist/chunk-NV55GU5V.mjs.gz +0 -0
- package/dist/{chunk-2FMQ7M3L.js → chunk-OBE4TB76.js} +494 -575
- package/dist/chunk-OBE4TB76.js.br +0 -0
- package/dist/chunk-OBE4TB76.js.gz +0 -0
- package/dist/{chunk-EVVWCF2M.mjs → chunk-PC62KGU3.mjs} +67 -148
- package/dist/chunk-PC62KGU3.mjs.br +0 -0
- package/dist/chunk-PC62KGU3.mjs.gz +0 -0
- package/dist/{chunk-HHJZK26I.js → chunk-TUSALM3A.js} +1603 -1310
- package/dist/chunk-TUSALM3A.js.br +0 -0
- package/dist/chunk-TUSALM3A.js.gz +0 -0
- package/dist/{chunk-IWQSAKPM.mjs → chunk-TXY2E7VQ.mjs} +445 -152
- package/dist/chunk-TXY2E7VQ.mjs.br +0 -0
- package/dist/chunk-TXY2E7VQ.mjs.gz +0 -0
- package/dist/{chunk-UTMTXJGM.js → chunk-VIFDZIVX.js} +375 -412
- package/dist/chunk-VIFDZIVX.js.br +0 -0
- package/dist/chunk-VIFDZIVX.js.gz +0 -0
- package/dist/{chunk-UTIMT5CZ.js → chunk-W24OJ7H5.js} +14 -23
- package/dist/chunk-W24OJ7H5.js.br +0 -0
- package/dist/chunk-W24OJ7H5.js.gz +0 -0
- package/dist/{chunk-IVPT3U5C.mjs → chunk-WKODF5ZU.mjs} +29 -1
- package/dist/chunk-WKODF5ZU.mjs.br +0 -0
- package/dist/chunk-WKODF5ZU.mjs.gz +0 -0
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +1012 -45
- package/dist/index.js +47 -47
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +1023 -45
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +79 -79
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +4 -4
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/{useViewerBuildingBlocks-f6oNGKMX.d.ts → useViewerBuildingBlocks-C8F_4Pzb.d.ts} +3 -1
- package/dist/useViewerBuildingBlocks-C8F_4Pzb.d.ts.map +1 -0
- package/dist/viewer/index.d.ts +933 -45
- package/dist/viewer/index.js +27 -27
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +6 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +2 -2
- package/dist/AiChatPanel-CCJNQGER.mjs.br +0 -0
- package/dist/AiChatPanel-CCJNQGER.mjs.gz +0 -0
- package/dist/AiChatPanel-LPZWDNVU.js.br +0 -0
- package/dist/AiChatPanel-LPZWDNVU.js.gz +0 -0
- package/dist/Area3DChartScene-LJCWBNQ3.js.br +0 -0
- package/dist/Area3DChartScene-LJCWBNQ3.js.gz +0 -0
- package/dist/Area3DChartScene-P6YM6ZL7.mjs.br +0 -0
- package/dist/Area3DChartScene-P6YM6ZL7.mjs.gz +0 -0
- package/dist/Bar3DChartScene-7DNQ4X5T.js.br +0 -1
- package/dist/Bar3DChartScene-7DNQ4X5T.js.gz +0 -0
- package/dist/Bar3DChartScene-DIVOJURZ.mjs.br +0 -0
- package/dist/Bar3DChartScene-DIVOJURZ.mjs.gz +0 -0
- package/dist/Line3DChartScene-UF6DHP36.js.br +0 -0
- package/dist/Line3DChartScene-UF6DHP36.js.gz +0 -0
- package/dist/Line3DChartScene-ZZVNUKIJ.mjs.br +0 -0
- package/dist/Line3DChartScene-ZZVNUKIJ.mjs.gz +0 -0
- package/dist/Model3DScene-C7MZ22DH.js.br +0 -0
- package/dist/Model3DScene-C7MZ22DH.js.gz +0 -0
- package/dist/Model3DScene-XXMAAKBR.mjs.br +0 -0
- package/dist/Model3DScene-XXMAAKBR.mjs.gz +0 -0
- package/dist/PieChart3DScene-7LX3IL2Q.mjs.gz +0 -0
- package/dist/PieChart3DScene-N2Y25VG5.js.br +0 -0
- package/dist/PieChart3DScene-N2Y25VG5.js.gz +0 -0
- package/dist/SurfaceChart3DScene-ADA7NUIW.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-ADA7NUIW.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-WXJHYOGJ.js.br +0 -0
- package/dist/SurfaceChart3DScene-WXJHYOGJ.js.gz +0 -0
- package/dist/chunk-2FMQ7M3L.js.br +0 -0
- package/dist/chunk-2FMQ7M3L.js.gz +0 -0
- package/dist/chunk-EVVWCF2M.mjs.br +0 -0
- package/dist/chunk-EVVWCF2M.mjs.gz +0 -0
- package/dist/chunk-HHJZK26I.js.br +0 -0
- package/dist/chunk-HHJZK26I.js.gz +0 -0
- package/dist/chunk-IVPT3U5C.mjs.br +0 -0
- package/dist/chunk-IVPT3U5C.mjs.gz +0 -0
- package/dist/chunk-IWQSAKPM.mjs.br +0 -0
- package/dist/chunk-IWQSAKPM.mjs.gz +0 -0
- package/dist/chunk-JCJ3EPG6.mjs.br +0 -0
- package/dist/chunk-JCJ3EPG6.mjs.gz +0 -0
- package/dist/chunk-NM652EZS.mjs.br +0 -0
- package/dist/chunk-NM652EZS.mjs.gz +0 -0
- package/dist/chunk-U52MKWVA.mjs.br +0 -0
- package/dist/chunk-U52MKWVA.mjs.gz +0 -0
- package/dist/chunk-UOMFINNJ.js.br +0 -0
- package/dist/chunk-UOMFINNJ.js.gz +0 -0
- package/dist/chunk-UTIMT5CZ.js.br +0 -0
- package/dist/chunk-UTIMT5CZ.js.gz +0 -0
- package/dist/chunk-UTMTXJGM.js.br +0 -0
- package/dist/chunk-UTMTXJGM.js.gz +0 -0
- package/dist/chunk-YQOK4E2A.js.br +0 -0
- package/dist/chunk-YQOK4E2A.js.gz +0 -0
- package/dist/useViewerBuildingBlocks-f6oNGKMX.d.ts.map +0 -1
|
Binary file
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { cloneHistorySnapshot, MIN_ELEMENT_SIZE, ZOOM_TO_SELECTION_PADDING, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, UNGROUPED_SECTION_ID, DEFAULT_SECTION_GROUP_ID, DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, buildPdfFromImageData, buildNotesPdf, GRID_SIZE, DEFAULT_TEXT_FONT_SIZE } from './chunk-
|
|
2
|
-
import { DEFAULT_VIEWER_OPTIONS, 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, cancelBuildReveal, PresentationAnimationController,
|
|
3
|
-
import { translationsEn } from './chunk-
|
|
1
|
+
import { cloneHistorySnapshot, MIN_ELEMENT_SIZE, ZOOM_TO_SELECTION_PADDING, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, UNGROUPED_SECTION_ID, DEFAULT_SECTION_GROUP_ID, DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, buildPdfFromImageData, buildNotesPdf, GRID_SIZE, DEFAULT_TEXT_FONT_SIZE } from './chunk-JANUSAEK.mjs';
|
|
2
|
+
import { DEFAULT_VIEWER_OPTIONS, 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, createActiveAnimationGroup, cancelBuildReveal, clearPlaybackTimers, PresentationAnimationController, resolveMediaTimeNodeElementIds, advanceMainSequence, playGroup, 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, firstShowSlideIndex, attachPresentationVisibilityPause, presentationEntrySlideIndex, buildMorphTransitionPlan, morphOptionToMode, buildMorphAnimationRules, findInSlides, applyFindReplacements, visibleTemplateElements, createCollaborationLivePatcher, publishLiveInlineText, PptxHandler, collectMediaElements, resolveMediaElementSource, collectImagePaths, applyImagePathPatches, resolveTableCellImageUrls, resolveTableStyleImageUrls, partitionTemplateElements, seedRecentColors, resolveAuthoredCustomShowId, buildInitialGuides, readOnlyRecommendation, compatibilityWarningToasts, EncryptedFileError, resolveAutosaveIntervalMs, shouldWriteAutosaveSnapshot, saveAutosaveSnapshot, autosaveSnapshotMark, hasTextProperties, remapTextToSegments, updateMasterViewElement, isTemplateElementId, updateElement, hasShapeProperties, getInlineEditorSelection, applyStyleToSelectedSegments, setPendingSelectionRestore, applyCaseTransformToSegments, transformTextCase, masterViewElements, replaceMasterViewElements, addSection, renameSection, deleteSection, moveSectionUp, moveSectionDown, moveSlidesToSection, canInteractWithElement, normalizeColorsForCapture, preprocessCssForCapture, slideProgressPercent, slideStatusLabel, EXPORT_ASSEMBLING_PERCENT, EXPORT_DONE_PERCENT, isExportAbortError, recordProgressPercent, downloadBlob, resolveImageResolutionScale, applyThemeToData, THEME_PRESETS, themeColorSchemesEqual, comparePresentation, applyAcceptSlide, applyAcceptAllSlides, collectUsedFonts, describeFontEmbedding, isMobileViewport, resolveAuthoredSlideRange, mayLeaveSlideShow, stopAllPersistentAudio, guidePxToEmu, buildSaveSlides, embeddedFontSaveOptions, resolveSlideSizeSelection, saveDeckWithPassword, shouldProbeAutosaveRecovery, probeAutosaveRecovery, acceptAutosaveRecovery, discardAutosaveRecovery, shouldLoopContinuously, applyRehearsalTimings, copyFormatFromElement, applyFormatToElement, collectReferencedFontFamilies, resolveGoogleWebfontHref, mapSlideShowStartKey, mapEditorKey, isEditorTextInputTarget, createViewerOptionsStore, readSlidesFromYDoc, shouldRoomSlidesReplaceLoad, reconcileSlidesInYDoc, LOCAL_SYNC_ORIGIN, observeYDocSlides, shouldAutoFollowBroadcaster, detectTouchDevice, detectOrientation, deriveViewportBreakpoints, createTouchGestureRecognizer, MAX_ZOOM_SCALE, MIN_ZOOM_SCALE, isKeyboardOpen, scopeLayoutOptionsToSlide, viewerPreferencesFromViewProperties, DEFAULT_VIEWER_PREFERENCES, viewPropertiesPatchFromPreferences, openPptxFile, readBackstageRecentFile, isActionHidden, resolveInlineEditAutoFitHeight, resolveInlineEditNormAutofitShrink, filterInteractableIds, beginShapeAdjustment, buildElementClipboardPayload, savedPresentationFileName, exportDeckJson, groupElements, generateElementId, makeCloneId, ungroupElements, alignElements, distributeElements, bringForward, sendBackward, bringToFront, sendToBack, newTableElement, createDefaultChartElement, readViewportMetrics, computeKeyboardInset, mergeShapes, mapPresentationKey, lastShowSlideIndex, mapPresentationWheel, openPendingPrintWindow, computeColorFilter, filterHiddenSlideIndices, computeSlideIndices, buildPrintDocument, finishPrintWindow, buildPrintHtmlDocument, buildOutlineHtml, buildSlidesHtml, buildNotesHtml, buildHandoutsHtml, createBlankSlide, makeSlideId, buildSlideTemplateSlide, templateSchemeFromTheme, buildThemeColorMap, reResolveSlideColors, reResolveElementColors, scheduleAutoAdvanceChain, computeEntranceAnimationDelay, createPresentationSessionId, resolveTransitionDurationMs, resolveTransitionSoundAction, runPresentationAction, safeOpenUrl, toggleStageElementMedia, resolveOleVerbTarget, openUrlInNewTab, createPresenterTimer, createInitialPresentationSnapshot, mergePresentationSnapshot, resetPresenterTimer, presenterElapsed, stepPresenterZoom, togglePresenterTimer, addCommentToList, removeCommentFromList, editCommentInList, toggleCommentResolvedInList, canvasToJpegData, downloadDataUrl, pickSupportedMimeType, WEBM_MIME_CANDIDATES, fpsToFrameIntervalMs, segmentFrameCount, encodeGif, computeGridSpacingPx, resolveShowSlideIndexes, groupSlidesBySection, masterViewPseudoSlide, resolveHistoryDepth, hasCopyableFormat, createBackstagePresentation, buildFieldSubstitutionContext, cloneElementForPaste, computeScrollDelta, getPresetShapeClipPath, svgPathToPolygons, polygonsToSvgPath, rerouteConnectorsForMovedElements, applyReroutedConnectors, SvgExporter, replyToCommentInList, deleteTableColumn, rebuildTableStructureInRawXml, insertTableColumn, deleteTableRow, insertTableRow, updateCellTextStyleInRawXml, setCellText, updateCellTextInRawXml, splitCell, updateMergeAttrsInRawXml, mergeCells, isPpactionUrl, parsePpactionUrl, resolvePresentationAction, ACTION_BUTTON_PRESETS, elementActionToPptxAction, isUrlSafe, buildSmartArtPresetData, classifyMediaType, computeSnapToShape, publishLiveGeometry, getDraggedShapeAdjustments, computeMarqueeHitIds, mergeAdditiveSelection, shouldConfirmExternalHyperlink, applyResize, lockResizeAspect, snapBoxToGrid, applyMotionPathPreset } from './chunk-NV55GU5V.mjs';
|
|
3
|
+
import { translationsEn } from './chunk-FGTMS7LR.mjs';
|
|
4
4
|
import { createContext, useRef, useState, useEffect, useCallback, useMemo, useLayoutEffect, useContext, useImperativeHandle, useSyncExternalStore } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
|
|
@@ -968,79 +968,6 @@ function stopAnimationSound() {
|
|
|
968
968
|
}
|
|
969
969
|
}
|
|
970
970
|
|
|
971
|
-
// src/viewer/hooks/presentation-mode/animation-helpers.ts
|
|
972
|
-
function shouldSeekAnimationGroup(group, endAtMs, nowMs) {
|
|
973
|
-
return group?.seqNextAction === "seek" && nowMs < endAtMs;
|
|
974
|
-
}
|
|
975
|
-
function finishDomAnimationsForGroup(group, root = document) {
|
|
976
|
-
const targetIds = new Set(
|
|
977
|
-
group.steps.filter((step) => !step.command).map((step) => step.elementId)
|
|
978
|
-
);
|
|
979
|
-
if (targetIds.size === 0) {
|
|
980
|
-
return 0;
|
|
981
|
-
}
|
|
982
|
-
const activeAnimations = /* @__PURE__ */ new Set();
|
|
983
|
-
const candidates = root.querySelectorAll(
|
|
984
|
-
'[data-element-id], [data-anim-id], [data-pptx-animation-layer="background"]'
|
|
985
|
-
);
|
|
986
|
-
for (const element of candidates) {
|
|
987
|
-
let animationElementId = element.dataset.animId ?? element.dataset.elementId;
|
|
988
|
-
if (element.dataset.pptxAnimationLayer === "background") {
|
|
989
|
-
const hostId = element.closest("[data-element-id]")?.dataset.elementId;
|
|
990
|
-
animationElementId = hostId ? `${hostId}::pptx-bg` : void 0;
|
|
991
|
-
}
|
|
992
|
-
if (!animationElementId || !targetIds.has(animationElementId)) {
|
|
993
|
-
continue;
|
|
994
|
-
}
|
|
995
|
-
if (typeof element.getAnimations !== "function") {
|
|
996
|
-
continue;
|
|
997
|
-
}
|
|
998
|
-
for (const animation of element.getAnimations()) {
|
|
999
|
-
activeAnimations.add(animation);
|
|
1000
|
-
}
|
|
1001
|
-
}
|
|
1002
|
-
let finishedCount = 0;
|
|
1003
|
-
for (const animation of activeAnimations) {
|
|
1004
|
-
const iterations = animation.effect?.getTiming().iterations;
|
|
1005
|
-
if (animation.playState === "finished" || animation.playState === "idle") {
|
|
1006
|
-
continue;
|
|
1007
|
-
}
|
|
1008
|
-
if (iterations === Infinity) {
|
|
1009
|
-
continue;
|
|
1010
|
-
}
|
|
1011
|
-
try {
|
|
1012
|
-
animation.finish();
|
|
1013
|
-
finishedCount += 1;
|
|
1014
|
-
} catch {
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
1017
|
-
return finishedCount;
|
|
1018
|
-
}
|
|
1019
|
-
function finishAnimationGroupSteps(group, setPresentationElementStates, completedStates) {
|
|
1020
|
-
setPresentationElementStates((previousStates) => {
|
|
1021
|
-
const nextStates = new Map(previousStates);
|
|
1022
|
-
for (const step of group.steps) {
|
|
1023
|
-
if (step.command) {
|
|
1024
|
-
continue;
|
|
1025
|
-
}
|
|
1026
|
-
const currentState = nextStates.get(step.elementId) ?? {
|
|
1027
|
-
visible: true,
|
|
1028
|
-
cssAnimation: void 0
|
|
1029
|
-
};
|
|
1030
|
-
const holdsAnimatedPaint = step.holdEndState && step.colorTargets !== void 0 && step.colorTargets.length > 0;
|
|
1031
|
-
nextStates.set(step.elementId, {
|
|
1032
|
-
...currentState,
|
|
1033
|
-
visible: step.presetClass !== "exit" && !step.hideAfterEffect,
|
|
1034
|
-
cssAnimation: step.holdEndState ? step.cssAnimation : void 0,
|
|
1035
|
-
build: completedStates?.get(step.elementId)?.build ?? currentState.build,
|
|
1036
|
-
animatesFill: holdsAnimatedPaint && step.colorTargets?.includes("fill") ? true : void 0,
|
|
1037
|
-
animatesStroke: holdsAnimatedPaint && step.colorTargets?.includes("stroke") ? true : void 0
|
|
1038
|
-
});
|
|
1039
|
-
}
|
|
1040
|
-
return nextStates;
|
|
1041
|
-
});
|
|
1042
|
-
}
|
|
1043
|
-
|
|
1044
971
|
// src/viewer/hooks/presentation-mode/entrance-animation-timers.ts
|
|
1045
972
|
function scheduleOpeningAutoPlayGroup(controller, ctx) {
|
|
1046
973
|
if (!controller.hasMoreSteps()) {
|
|
@@ -1101,9 +1028,9 @@ function useAnimationPlayback(input) {
|
|
|
1101
1028
|
const presentationTimersRef = useRef([]);
|
|
1102
1029
|
const controllerRef = useRef(null);
|
|
1103
1030
|
const buildRafRef = useRef(null);
|
|
1104
|
-
const activeAnimationGroupRef = useRef(
|
|
1105
|
-
const activeAnimationEndAtRef = useRef(0);
|
|
1031
|
+
const activeAnimationGroupRef = useRef(createActiveAnimationGroup());
|
|
1106
1032
|
const seededCompletedRef = useRef(false);
|
|
1033
|
+
const mediaTimeNodeElementIdsRef = useRef(/* @__PURE__ */ new Map());
|
|
1107
1034
|
const lastSeedCompletedRef = useRef(false);
|
|
1108
1035
|
const buildPlaybackContext = useCallback(() => {
|
|
1109
1036
|
return {
|
|
@@ -1112,7 +1039,8 @@ function useAnimationPlayback(input) {
|
|
|
1112
1039
|
buildHandle: buildRafRef,
|
|
1113
1040
|
onPlayActionSound,
|
|
1114
1041
|
playSound: playAnimationSound,
|
|
1115
|
-
stopSound: stopAnimationSound
|
|
1042
|
+
stopSound: stopAnimationSound,
|
|
1043
|
+
mediaTimeNodeElementIds: mediaTimeNodeElementIdsRef.current
|
|
1116
1044
|
};
|
|
1117
1045
|
}, [onPlayActionSound]);
|
|
1118
1046
|
useEffect(() => {
|
|
@@ -1121,24 +1049,15 @@ function useAnimationPlayback(input) {
|
|
|
1121
1049
|
};
|
|
1122
1050
|
}, []);
|
|
1123
1051
|
const clearPresentationTimers = useCallback(() => {
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
});
|
|
1127
|
-
presentationTimersRef.current = [];
|
|
1128
|
-
cancelBuildReveal(buildRafRef);
|
|
1129
|
-
activeAnimationGroupRef.current = null;
|
|
1130
|
-
activeAnimationEndAtRef.current = 0;
|
|
1131
|
-
}, []);
|
|
1132
|
-
const markAnimationGroupActive = useCallback((group) => {
|
|
1133
|
-
activeAnimationGroupRef.current = group;
|
|
1134
|
-
activeAnimationEndAtRef.current = performance.now() + Math.max(0, group.totalDurationMs);
|
|
1135
|
-
}, []);
|
|
1052
|
+
clearPlaybackTimers(buildPlaybackContext(), activeAnimationGroupRef.current);
|
|
1053
|
+
}, [buildPlaybackContext]);
|
|
1136
1054
|
const resetSlideTimeline = useCallback(
|
|
1137
1055
|
(slideIndex) => {
|
|
1138
1056
|
cancelBuildReveal(buildRafRef);
|
|
1139
1057
|
const slide = slides[slideIndex];
|
|
1140
1058
|
if (!slide) {
|
|
1141
1059
|
controllerRef.current = null;
|
|
1060
|
+
mediaTimeNodeElementIdsRef.current = /* @__PURE__ */ new Map();
|
|
1142
1061
|
setPresentationElementStates(/* @__PURE__ */ new Map());
|
|
1143
1062
|
setPresentationKeyframesCss("");
|
|
1144
1063
|
setInteractiveTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
@@ -1147,6 +1066,9 @@ function useAnimationPlayback(input) {
|
|
|
1147
1066
|
}
|
|
1148
1067
|
const controller = PresentationAnimationController.fromSlide(slide);
|
|
1149
1068
|
controllerRef.current = controller;
|
|
1069
|
+
mediaTimeNodeElementIdsRef.current = resolveMediaTimeNodeElementIds(
|
|
1070
|
+
slide.nativeAnimations ?? []
|
|
1071
|
+
);
|
|
1150
1072
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1151
1073
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
1152
1074
|
setHoverTriggerShapeIds(controller.hoverTriggerShapeIds);
|
|
@@ -1158,30 +1080,12 @@ function useAnimationPlayback(input) {
|
|
|
1158
1080
|
if (!animationsEnabled) {
|
|
1159
1081
|
return false;
|
|
1160
1082
|
}
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
clearPresentationTimers();
|
|
1168
|
-
finishAnimationGroupSteps(activeGroup, setPresentationElementStates, completedStates);
|
|
1169
|
-
scheduleAutoAdvanceChain(controller, buildPlaybackContext());
|
|
1170
|
-
return true;
|
|
1171
|
-
}
|
|
1172
|
-
if (!controller || !controller.hasMoreSteps()) {
|
|
1173
|
-
return false;
|
|
1174
|
-
}
|
|
1175
|
-
const group = controller.advance();
|
|
1176
|
-
if (!group) {
|
|
1177
|
-
return false;
|
|
1178
|
-
}
|
|
1179
|
-
const ctx = buildPlaybackContext();
|
|
1180
|
-
playGroup(controller, group, ctx);
|
|
1181
|
-
markAnimationGroupActive(group);
|
|
1182
|
-
scheduleAutoAdvanceChain(controller, ctx);
|
|
1183
|
-
return true;
|
|
1184
|
-
}, [animationsEnabled, buildPlaybackContext, clearPresentationTimers, markAnimationGroupActive]);
|
|
1083
|
+
return advanceMainSequence(
|
|
1084
|
+
controllerRef.current,
|
|
1085
|
+
buildPlaybackContext(),
|
|
1086
|
+
activeAnimationGroupRef.current
|
|
1087
|
+
);
|
|
1088
|
+
}, [animationsEnabled, buildPlaybackContext]);
|
|
1185
1089
|
const handleInteractiveShapeClick = useCallback(
|
|
1186
1090
|
(shapeId) => {
|
|
1187
1091
|
const controller = controllerRef.current;
|
|
@@ -1865,10 +1769,13 @@ function executeSlideTransition(nextSlideIndex, deps) {
|
|
|
1865
1769
|
deps.onSetActiveSlideIndex(nextSlideIndex);
|
|
1866
1770
|
deps.setPresentationSlideVisible(true);
|
|
1867
1771
|
deps.seedSlideAnimations(nextSlideIndex, { completed: deps.seedCompleted });
|
|
1772
|
+
const soundAction = resolveTransitionSoundAction(transition);
|
|
1773
|
+
if (soundAction.kind === "play" && deps.onPlayActionSound) {
|
|
1774
|
+
deps.onPlayActionSound(soundAction.soundPath, { loop: soundAction.loop });
|
|
1775
|
+
} else if (soundAction.kind === "stop" && deps.onStopActionSound) {
|
|
1776
|
+
deps.onStopActionSound();
|
|
1777
|
+
}
|
|
1868
1778
|
if (durationMs > 0 && transition) {
|
|
1869
|
-
if (transition.soundPath && deps.onPlayActionSound) {
|
|
1870
|
-
deps.onPlayActionSound(transition.soundPath, { loop: transition.soundLoop === true });
|
|
1871
|
-
}
|
|
1872
1779
|
deps.setTransitionOverlay({
|
|
1873
1780
|
outgoingSlideIndex: deps.currentSlideIndex,
|
|
1874
1781
|
incomingSlideIndex: nextSlideIndex,
|
|
@@ -1902,6 +1809,7 @@ function useSlideNavigation(input) {
|
|
|
1902
1809
|
onSetMode,
|
|
1903
1810
|
onSetActiveSlideIndex,
|
|
1904
1811
|
onPlayActionSound,
|
|
1812
|
+
onStopActionSound,
|
|
1905
1813
|
loopContinuously,
|
|
1906
1814
|
useTimings,
|
|
1907
1815
|
onAdvancePastLastSlide,
|
|
@@ -1978,6 +1886,7 @@ function useSlideNavigation(input) {
|
|
|
1978
1886
|
slides,
|
|
1979
1887
|
currentSlideIndex: presentationSlideIndex,
|
|
1980
1888
|
onPlayActionSound,
|
|
1889
|
+
onStopActionSound,
|
|
1981
1890
|
setPresentationSlideVisible,
|
|
1982
1891
|
clearPresentationTimers,
|
|
1983
1892
|
setPresentationSlideIndex,
|
|
@@ -2001,6 +1910,7 @@ function useSlideNavigation(input) {
|
|
|
2001
1910
|
loopContinuously,
|
|
2002
1911
|
onAdvancePastLastSlide,
|
|
2003
1912
|
onPlayActionSound,
|
|
1913
|
+
onStopActionSound,
|
|
2004
1914
|
onSetActiveSlideIndex,
|
|
2005
1915
|
onSetMode,
|
|
2006
1916
|
playNextAnimationGroup,
|
|
@@ -2032,6 +1942,7 @@ function useSlideNavigation(input) {
|
|
|
2032
1942
|
slides,
|
|
2033
1943
|
currentSlideIndex: presentationSlideIndex,
|
|
2034
1944
|
onPlayActionSound,
|
|
1945
|
+
onStopActionSound,
|
|
2035
1946
|
setPresentationSlideVisible,
|
|
2036
1947
|
clearPresentationTimers,
|
|
2037
1948
|
setPresentationSlideIndex,
|
|
@@ -2054,6 +1965,7 @@ function useSlideNavigation(input) {
|
|
|
2054
1965
|
[
|
|
2055
1966
|
clearPresentationTimers,
|
|
2056
1967
|
onPlayActionSound,
|
|
1968
|
+
onStopActionSound,
|
|
2057
1969
|
onSetActiveSlideIndex,
|
|
2058
1970
|
presentationSlideIndex,
|
|
2059
1971
|
presentationTimersRef,
|
|
@@ -2327,6 +2239,7 @@ function usePresentationMode(input) {
|
|
|
2327
2239
|
onSetMode,
|
|
2328
2240
|
onSetActiveSlideIndex,
|
|
2329
2241
|
onPlayActionSound,
|
|
2242
|
+
onStopActionSound,
|
|
2330
2243
|
onSetPointerTool,
|
|
2331
2244
|
onEraseAnnotations,
|
|
2332
2245
|
onToggleInkMarkup,
|
|
@@ -2420,6 +2333,7 @@ function usePresentationMode(input) {
|
|
|
2420
2333
|
onSetMode,
|
|
2421
2334
|
onSetActiveSlideIndex,
|
|
2422
2335
|
onPlayActionSound,
|
|
2336
|
+
onStopActionSound,
|
|
2423
2337
|
loopContinuously,
|
|
2424
2338
|
useTimings,
|
|
2425
2339
|
onAdvancePastLastSlide: actionExtensions.handleAdvancePastLastSlide,
|
|
@@ -4087,34 +4001,14 @@ function useLoadContent({
|
|
|
4087
4001
|
mediaDataUrls.clear();
|
|
4088
4002
|
await Promise.all(
|
|
4089
4003
|
mediaElements.map(async (mediaElement) => {
|
|
4090
|
-
const
|
|
4091
|
-
if (!mediaPath) {
|
|
4004
|
+
const resolved = await resolveMediaElementSource(mediaElement, handler);
|
|
4005
|
+
if (resolved.missing || !resolved.mediaPath || !resolved.url) {
|
|
4092
4006
|
mediaElement.mediaMissing = true;
|
|
4093
4007
|
return;
|
|
4094
4008
|
}
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
const arrayBuffer = await handler.getMediaArrayBuffer(mediaPath);
|
|
4099
|
-
if (arrayBuffer) {
|
|
4100
|
-
const mimeType = mediaElement.mediaMimeType || "application/octet-stream";
|
|
4101
|
-
const blob = new Blob([arrayBuffer], { type: mimeType });
|
|
4102
|
-
const blobUrl = URL.createObjectURL(blob);
|
|
4103
|
-
loadBlobUrls.push(blobUrl);
|
|
4104
|
-
mediaDataUrls.set(mediaPath, blobUrl);
|
|
4105
|
-
} else {
|
|
4106
|
-
mediaElement.mediaMissing = true;
|
|
4107
|
-
}
|
|
4108
|
-
} else {
|
|
4109
|
-
const dataUrl = await handler.getImageData(mediaPath);
|
|
4110
|
-
if (dataUrl) {
|
|
4111
|
-
mediaDataUrls.set(mediaPath, dataUrl);
|
|
4112
|
-
} else {
|
|
4113
|
-
mediaElement.mediaMissing = true;
|
|
4114
|
-
}
|
|
4115
|
-
}
|
|
4116
|
-
} catch {
|
|
4117
|
-
mediaElement.mediaMissing = true;
|
|
4009
|
+
mediaDataUrls.set(resolved.mediaPath, resolved.url);
|
|
4010
|
+
if (resolved.isBlobUrl) {
|
|
4011
|
+
loadBlobUrls.push(resolved.url);
|
|
4118
4012
|
}
|
|
4119
4013
|
})
|
|
4120
4014
|
);
|
|
@@ -5199,10 +5093,18 @@ function useCanvasInteractions(input) {
|
|
|
5199
5093
|
const newSegments = remapTextToSegments(committedText, el.textSegments, el.textStyle);
|
|
5200
5094
|
const editorEl = document.querySelector("[data-inline-editor]");
|
|
5201
5095
|
const newHeight = resolveInlineEditAutoFitHeight(el.textStyle, el.height, editorEl);
|
|
5096
|
+
const shrink = resolveInlineEditNormAutofitShrink(el.textStyle, el.height, editorEl);
|
|
5202
5097
|
ops.updateElementById(editId, {
|
|
5203
5098
|
text: committedText,
|
|
5204
5099
|
textSegments: newSegments,
|
|
5205
|
-
...newHeight !== void 0 ? { height: newHeight } : {}
|
|
5100
|
+
...newHeight !== void 0 ? { height: newHeight } : {},
|
|
5101
|
+
...shrink !== "unchanged" ? {
|
|
5102
|
+
textStyle: {
|
|
5103
|
+
...el.textStyle,
|
|
5104
|
+
autoFitFontScale: shrink.fontScale,
|
|
5105
|
+
autoFitLineSpacingReduction: shrink.lnSpcReduction
|
|
5106
|
+
}
|
|
5107
|
+
} : {}
|
|
5206
5108
|
});
|
|
5207
5109
|
history.markDirty();
|
|
5208
5110
|
}
|
|
@@ -6299,6 +6201,9 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6299
6201
|
if (ids.length < 2 || !activeSlide) {
|
|
6300
6202
|
return;
|
|
6301
6203
|
}
|
|
6204
|
+
if (!selectedElements.every((el) => canInteractWithElement(el, "group"))) {
|
|
6205
|
+
return;
|
|
6206
|
+
}
|
|
6302
6207
|
const { elements, groupId } = groupElements(ops.activeElements, ids, generateElementId());
|
|
6303
6208
|
if (groupId === null) {
|
|
6304
6209
|
return;
|
|
@@ -6311,6 +6216,9 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6311
6216
|
if (!selectedElement || selectedElement.type !== "group" || !activeSlide) {
|
|
6312
6217
|
return;
|
|
6313
6218
|
}
|
|
6219
|
+
if (!canInteractWithElement(selectedElement, "group")) {
|
|
6220
|
+
return;
|
|
6221
|
+
}
|
|
6314
6222
|
const group = selectedElement;
|
|
6315
6223
|
const intoTemplate = isTemplateElementId(group.id);
|
|
6316
6224
|
const childIds = group.children.map(
|
|
@@ -6374,6 +6282,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6374
6282
|
history.markDirty();
|
|
6375
6283
|
};
|
|
6376
6284
|
const canDistribute = selectedElements.length >= 3;
|
|
6285
|
+
const selectionGroupable = selectedElements.every((el) => canInteractWithElement(el, "group"));
|
|
6377
6286
|
const handleMoveLayer = (direction) => {
|
|
6378
6287
|
if (!selectedElement || !activeSlide) {
|
|
6379
6288
|
return;
|
|
@@ -6410,6 +6319,7 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
6410
6319
|
handleAlignElements,
|
|
6411
6320
|
handleDistributeElements,
|
|
6412
6321
|
canDistribute,
|
|
6322
|
+
selectionGroupable,
|
|
6413
6323
|
handleMoveLayer,
|
|
6414
6324
|
handleMoveLayerToEdge,
|
|
6415
6325
|
handleMergeShapes,
|
|
@@ -6428,6 +6338,7 @@ function useElementManipulation(input) {
|
|
|
6428
6338
|
handleAlignElements,
|
|
6429
6339
|
handleDistributeElements,
|
|
6430
6340
|
canDistribute,
|
|
6341
|
+
selectionGroupable,
|
|
6431
6342
|
handleMoveLayer,
|
|
6432
6343
|
handleMoveLayerToEdge,
|
|
6433
6344
|
handleMergeShapes,
|
|
@@ -6494,6 +6405,7 @@ function useElementManipulation(input) {
|
|
|
6494
6405
|
handleAlignElements,
|
|
6495
6406
|
handleDistributeElements,
|
|
6496
6407
|
canDistribute,
|
|
6408
|
+
selectionGroupable,
|
|
6497
6409
|
handleMoveLayer,
|
|
6498
6410
|
handleMoveLayerToEdge,
|
|
6499
6411
|
handleMergeShapes,
|
|
@@ -8941,6 +8853,12 @@ function usePresentationSetup(input) {
|
|
|
8941
8853
|
setMode(nextMode);
|
|
8942
8854
|
},
|
|
8943
8855
|
onSetActiveSlideIndex: setActiveSlideIndex,
|
|
8856
|
+
// `p:sndAc/p:endSnd` ("Stop Previous Sound"): silences whatever transition
|
|
8857
|
+
// sound is currently looping. A non-looping transition sound plays through
|
|
8858
|
+
// its own ad hoc `Audio` below rather than this singleton (it finishes on
|
|
8859
|
+
// its own in a few seconds either way), so only the loop case is stoppable
|
|
8860
|
+
// here - matching the common "Loop Until Next Sound... then Stop" pairing.
|
|
8861
|
+
onStopActionSound: () => stopAnimationSound(),
|
|
8944
8862
|
onPlayActionSound: (soundPath, options) => {
|
|
8945
8863
|
void (async () => {
|
|
8946
8864
|
if (!soundPath) {
|
|
@@ -10779,11 +10697,11 @@ function buildCanvasProps(input) {
|
|
|
10779
10697
|
slide: activeSlide
|
|
10780
10698
|
});
|
|
10781
10699
|
const tableStyleContext = s.theme || s.tableStyleMap ? { theme: s.theme, tableStyleMap: s.tableStyleMap } : void 0;
|
|
10782
|
-
const openExternalUrl = (url) => {
|
|
10700
|
+
const openExternalUrl = (url, target) => {
|
|
10783
10701
|
if (shouldConfirmExternalHyperlink(viewerOptions, url) && !window.confirm(buildHyperlinkConfirmMessage(url))) {
|
|
10784
10702
|
return;
|
|
10785
10703
|
}
|
|
10786
|
-
safeOpenUrl(url);
|
|
10704
|
+
safeOpenUrl(url, target);
|
|
10787
10705
|
};
|
|
10788
10706
|
const handleActionClick = (elementId, action) => {
|
|
10789
10707
|
if (mode === "present") {
|
|
@@ -10797,7 +10715,7 @@ function buildCanvasProps(input) {
|
|
|
10797
10715
|
openExternalUrl(action.url);
|
|
10798
10716
|
}
|
|
10799
10717
|
};
|
|
10800
|
-
const handleHyperlinkClick = (url) => {
|
|
10718
|
+
const handleHyperlinkClick = (url, target) => {
|
|
10801
10719
|
if (isPpactionUrl(url)) {
|
|
10802
10720
|
if (mode === "present") {
|
|
10803
10721
|
const parsed = parsePpactionUrl(url);
|
|
@@ -10810,7 +10728,7 @@ function buildCanvasProps(input) {
|
|
|
10810
10728
|
}
|
|
10811
10729
|
return;
|
|
10812
10730
|
}
|
|
10813
|
-
openExternalUrl(url);
|
|
10731
|
+
openExternalUrl(url, target);
|
|
10814
10732
|
};
|
|
10815
10733
|
return {
|
|
10816
10734
|
activeSlide: effectiveSlide,
|
|
@@ -11103,6 +11021,7 @@ function buildToolbarProps(input) {
|
|
|
11103
11021
|
onUngroupElement: manipulation.handleUngroupElement,
|
|
11104
11022
|
onUpdateElementStyle: ops.updateSelectedShapeStyle,
|
|
11105
11023
|
selectedCount: s.selectedElementIds.length > 0 ? s.selectedElementIds.length : selectionSize,
|
|
11024
|
+
selectionGroupable: manipulation.selectionGroupable,
|
|
11106
11025
|
onOpenHyperlinkDialog: () => dialogs.setIsHyperlinkDialogOpen(true),
|
|
11107
11026
|
onDuplicate: manipulation.handleDuplicate,
|
|
11108
11027
|
onDelete: manipulation.handleDelete,
|
|
Binary file
|
|
Binary file
|