pptx-react-viewer 2.16.9 → 2.17.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 +4 -0
- package/dist/{AiChatPanel-EPMBL6EA.js → AiChatPanel-HCHCVQN2.js} +24 -24
- package/dist/AiChatPanel-HCHCVQN2.js.br +0 -0
- package/dist/AiChatPanel-HCHCVQN2.js.gz +0 -0
- package/dist/{AiChatPanel-XHKYPYPH.mjs → AiChatPanel-RZ4A7P4H.mjs} +4 -4
- package/dist/AiChatPanel-RZ4A7P4H.mjs.br +0 -0
- package/dist/AiChatPanel-RZ4A7P4H.mjs.gz +0 -0
- package/dist/{Model3DScene-YMIAGRPG.mjs → Model3DScene-I7FR74AD.mjs} +1 -1
- package/dist/Model3DScene-I7FR74AD.mjs.br +0 -0
- package/dist/Model3DScene-I7FR74AD.mjs.gz +0 -0
- package/dist/{Model3DScene-DUJOZA2B.js → Model3DScene-LK7LSQNH.js} +2 -2
- package/dist/Model3DScene-LK7LSQNH.js.br +0 -0
- package/dist/Model3DScene-LK7LSQNH.js.gz +0 -0
- package/dist/PowerPointViewer-Du7u4INi.d.ts.map +1 -1
- package/dist/{SurfaceChart3DScene-Q47OEJXS.mjs → SurfaceChart3DScene-DEQP5O3U.mjs} +1 -1
- package/dist/SurfaceChart3DScene-DEQP5O3U.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-DEQP5O3U.mjs.gz +0 -0
- package/dist/{SurfaceChart3DScene-TNCHWQAK.js → SurfaceChart3DScene-ODQY77SZ.js} +2 -2
- package/dist/SurfaceChart3DScene-ODQY77SZ.js.br +0 -0
- package/dist/SurfaceChart3DScene-ODQY77SZ.js.gz +0 -0
- package/dist/{chunk-3KIKPDAJ.mjs → chunk-422DF424.mjs} +742 -2294
- package/dist/chunk-422DF424.mjs.br +0 -0
- package/dist/chunk-422DF424.mjs.gz +0 -0
- package/dist/{chunk-WK22Z7PK.js → chunk-5BXATG54.js} +520 -868
- package/dist/chunk-5BXATG54.js.br +0 -0
- package/dist/chunk-5BXATG54.js.gz +0 -0
- package/dist/{chunk-Y2KIB3QH.js → chunk-7JPLVECA.js} +44829 -39322
- package/dist/chunk-7JPLVECA.js.br +0 -0
- package/dist/chunk-7JPLVECA.js.gz +0 -0
- package/dist/{chunk-DVZF4ARG.js → chunk-AONFHTTJ.js} +22 -0
- package/dist/chunk-AONFHTTJ.js.br +0 -0
- package/dist/chunk-AONFHTTJ.js.gz +0 -0
- package/dist/{chunk-PI5SFTDC.js → chunk-ATOUVRRQ.js} +3 -3
- package/dist/chunk-ATOUVRRQ.js.br +0 -0
- package/dist/chunk-ATOUVRRQ.js.gz +0 -0
- package/dist/{chunk-EL2YF26P.mjs → chunk-FXJOTEPO.mjs} +1 -1
- package/dist/chunk-FXJOTEPO.mjs.br +0 -0
- package/dist/chunk-FXJOTEPO.mjs.gz +0 -0
- package/dist/{chunk-YWKUIUQX.mjs → chunk-K2QU73KB.mjs} +44784 -39286
- package/dist/chunk-K2QU73KB.mjs.br +0 -0
- package/dist/chunk-K2QU73KB.mjs.gz +0 -0
- package/dist/{chunk-VHME5BE6.mjs → chunk-MQHC5TXI.mjs} +318 -665
- package/dist/chunk-MQHC5TXI.mjs.br +0 -0
- package/dist/chunk-MQHC5TXI.mjs.gz +0 -0
- package/dist/{chunk-VL7ZT3ID.js → chunk-NQJPPIVH.js} +1681 -3233
- package/dist/chunk-NQJPPIVH.js.br +0 -0
- package/dist/chunk-NQJPPIVH.js.gz +0 -0
- package/dist/{chunk-5IUEPQTK.mjs → chunk-S64T7C4V.mjs} +22 -0
- package/dist/chunk-S64T7C4V.mjs.br +0 -0
- package/dist/chunk-S64T7C4V.mjs.gz +0 -0
- package/dist/{chunk-FSVE6WUY.js → chunk-TCGXGD6E.js} +550 -463
- package/dist/chunk-TCGXGD6E.js.br +0 -0
- package/dist/chunk-TCGXGD6E.js.gz +0 -0
- package/dist/{chunk-J7EFC3GS.mjs → chunk-ZA5JONCW.mjs} +210 -123
- package/dist/chunk-ZA5JONCW.mjs.br +0 -0
- package/dist/chunk-ZA5JONCW.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 +205 -21
- package/dist/index.js +41 -41
- 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 +380 -22
- 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/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/{useViewerBuildingBlocks-Xddn6SFj.d.ts → useViewerBuildingBlocks-C9-prKYB.d.ts} +32 -6
- package/dist/useViewerBuildingBlocks-C9-prKYB.d.ts.map +1 -0
- package/dist/viewer/index.d.ts +166 -17
- 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 +1 -1
- package/dist/AiChatPanel-EPMBL6EA.js.br +0 -0
- package/dist/AiChatPanel-EPMBL6EA.js.gz +0 -0
- package/dist/AiChatPanel-XHKYPYPH.mjs.br +0 -0
- package/dist/AiChatPanel-XHKYPYPH.mjs.gz +0 -0
- package/dist/Model3DScene-DUJOZA2B.js.br +0 -0
- package/dist/Model3DScene-DUJOZA2B.js.gz +0 -0
- package/dist/Model3DScene-YMIAGRPG.mjs.br +0 -0
- package/dist/Model3DScene-YMIAGRPG.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-Q47OEJXS.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-Q47OEJXS.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-TNCHWQAK.js.br +0 -0
- package/dist/SurfaceChart3DScene-TNCHWQAK.js.gz +0 -0
- package/dist/chunk-3KIKPDAJ.mjs.br +0 -0
- package/dist/chunk-3KIKPDAJ.mjs.gz +0 -0
- package/dist/chunk-5IUEPQTK.mjs.br +0 -0
- package/dist/chunk-5IUEPQTK.mjs.gz +0 -0
- package/dist/chunk-DVZF4ARG.js.br +0 -0
- package/dist/chunk-DVZF4ARG.js.gz +0 -0
- package/dist/chunk-EL2YF26P.mjs.br +0 -0
- package/dist/chunk-EL2YF26P.mjs.gz +0 -0
- package/dist/chunk-FSVE6WUY.js.br +0 -0
- package/dist/chunk-FSVE6WUY.js.gz +0 -0
- package/dist/chunk-J7EFC3GS.mjs.br +0 -0
- package/dist/chunk-J7EFC3GS.mjs.gz +0 -0
- package/dist/chunk-PI5SFTDC.js.br +0 -0
- package/dist/chunk-PI5SFTDC.js.gz +0 -0
- package/dist/chunk-VHME5BE6.mjs.br +0 -0
- package/dist/chunk-VHME5BE6.mjs.gz +0 -0
- package/dist/chunk-VL7ZT3ID.js.br +0 -0
- package/dist/chunk-VL7ZT3ID.js.gz +0 -0
- package/dist/chunk-WK22Z7PK.js.br +0 -0
- package/dist/chunk-WK22Z7PK.js.gz +0 -0
- package/dist/chunk-Y2KIB3QH.js.br +0 -0
- package/dist/chunk-Y2KIB3QH.js.gz +0 -0
- package/dist/chunk-YWKUIUQX.mjs.br +0 -0
- package/dist/chunk-YWKUIUQX.mjs.gz +0 -0
- package/dist/useViewerBuildingBlocks-Xddn6SFj.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_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, executeMediaCommand, buildPdfFromImageData, buildNotesPdf, EMU_PER_PX, GRID_SIZE, DEFAULT_TEXT_FONT_SIZE } from './chunk-
|
|
2
|
-
import { translationsEn } from './chunk-
|
|
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, findInSlides, applyFindReplacements, createCollaborationLivePatcher, publishLiveInlineText, PptxHandler, collectMediaElements, collectImagePaths, partitionTemplateElements, 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, buildSaveSlides, 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-
|
|
1
|
+
import { cloneHistorySnapshot, MIN_ELEMENT_SIZE, ZOOM_TO_SELECTION_PADDING, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, UNGROUPED_SECTION_ID, DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, executeMediaCommand, buildPdfFromImageData, buildNotesPdf, EMU_PER_PX, GRID_SIZE, DEFAULT_TEXT_FONT_SIZE } from './chunk-MQHC5TXI.mjs';
|
|
2
|
+
import { translationsEn } from './chunk-S64T7C4V.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, findInSlides, applyFindReplacements, createCollaborationLivePatcher, publishLiveInlineText, PptxHandler, collectMediaElements, collectImagePaths, partitionTemplateElements, buildInitialGuides, EncryptedFileError, saveAutosaveSnapshot, updateMasterViewElement, isTemplateElementId, hasShapeProperties, hasTextProperties, getInlineEditorSelection, applyStyleToSelectedSegments, setPendingSelectionRestore, applyCaseTransformToSegments, transformTextCase, masterViewElements, replaceMasterViewElements, 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, describeFontEmbedding, mayLeaveSlideShow, stopAllPersistentAudio, remapTextToSegments, guidePxToEmu, buildSaveSlides, embeddedFontSaveOptions, saveDeckWithPassword, shouldLoopContinuously, applyRehearsalTimings, copyFormatFromElement, applyFormatToElement, mapEditorKey, isEditorTextInputTarget, createViewerOptionsStore, readSlidesFromYDoc, reconcileSlidesInYDoc, LOCAL_SYNC_ORIGIN, observeYDocSlides, shouldAutoFollowBroadcaster, createTouchGestureRecognizer, MAX_ZOOM_SCALE, MIN_ZOOM_SCALE, isKeyboardOpen, scopeLayoutOptionsToSlide, openPptxFile, readBackstageRecentFile, isActionHidden, canInteractWithElement, filterInteractableIds, buildElementClipboardPayload, generatePackageReadme, exportDeckJson, groupElements, generateElementId, makeCloneId, ungroupElements, 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, masterViewPseudoSlide, 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, getDraggedShapeAdjustmentValue, computeMarqueeHitIds, mergeAdditiveSelection, applyResize, snapBoxToGrid, applyMotionPathPreset } from './chunk-K2QU73KB.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';
|
|
@@ -484,6 +484,7 @@ function useEditorHistory(input) {
|
|
|
484
484
|
maxHistoryEntries = DEFAULT_MAX_HISTORY_ENTRIES,
|
|
485
485
|
hasActivePointerInteraction,
|
|
486
486
|
pointerCommitNonce,
|
|
487
|
+
onDirty,
|
|
487
488
|
setSlides,
|
|
488
489
|
setCanvasSize,
|
|
489
490
|
setActiveSlideIndex,
|
|
@@ -556,8 +557,13 @@ function useEditorHistory(input) {
|
|
|
556
557
|
isApplyingHistoryRef.current = false;
|
|
557
558
|
}, 0);
|
|
558
559
|
}, []);
|
|
560
|
+
const onDirtyRef = useRef(onDirty);
|
|
561
|
+
useEffect(() => {
|
|
562
|
+
onDirtyRef.current = onDirty;
|
|
563
|
+
}, [onDirty]);
|
|
559
564
|
const markDirty = useCallback(() => {
|
|
560
565
|
setEditCommitNonce((previous) => previous + 1);
|
|
566
|
+
onDirtyRef.current?.();
|
|
561
567
|
}, []);
|
|
562
568
|
const handleUndo = useCallback(() => {
|
|
563
569
|
const previousSnapshot = historyPastRef.current.pop();
|
|
@@ -655,6 +661,7 @@ function useEditorHistory(input) {
|
|
|
655
661
|
updateHistoryAvailability();
|
|
656
662
|
return;
|
|
657
663
|
}
|
|
664
|
+
onDirtyRef.current?.();
|
|
658
665
|
historyPastRef.current.push(cloneHistorySnapshot(previousSnapshot));
|
|
659
666
|
while (historyPastRef.current.length > Math.max(1, maxHistoryEntries)) {
|
|
660
667
|
historyPastRef.current.shift();
|
|
@@ -3372,7 +3379,7 @@ function useDerivedElementState(input) {
|
|
|
3372
3379
|
() => resolveActiveLayout(activeMaster, activeLayoutIndex),
|
|
3373
3380
|
[activeMaster, activeLayoutIndex]
|
|
3374
3381
|
);
|
|
3375
|
-
const
|
|
3382
|
+
const masterViewElements2 = useMemo(
|
|
3376
3383
|
() => computeMasterViewElements(activeMaster, activeLayout),
|
|
3377
3384
|
[activeMaster, activeLayout]
|
|
3378
3385
|
);
|
|
@@ -3388,7 +3395,7 @@ function useDerivedElementState(input) {
|
|
|
3388
3395
|
selectedElements,
|
|
3389
3396
|
activeMaster,
|
|
3390
3397
|
activeLayout,
|
|
3391
|
-
masterViewElements,
|
|
3398
|
+
masterViewElements: masterViewElements2,
|
|
3392
3399
|
notesMasterElements,
|
|
3393
3400
|
handoutMasterElements
|
|
3394
3401
|
};
|
|
@@ -4039,6 +4046,7 @@ function useElementOperations(input) {
|
|
|
4039
4046
|
selectedElementId,
|
|
4040
4047
|
editTemplateMode,
|
|
4041
4048
|
templateElements,
|
|
4049
|
+
masterView,
|
|
4042
4050
|
history,
|
|
4043
4051
|
setSlides,
|
|
4044
4052
|
setTemplateElementsBySlideId,
|
|
@@ -4059,8 +4067,33 @@ function useElementOperations(input) {
|
|
|
4059
4067
|
setInlineEditingElementId(null);
|
|
4060
4068
|
setContextMenuState(null);
|
|
4061
4069
|
}, [applySelection, setInlineEditingElementId, setContextMenuState]);
|
|
4070
|
+
const applyMasterViewWrite = useCallback(
|
|
4071
|
+
(write) => {
|
|
4072
|
+
if (!write || !masterView) {
|
|
4073
|
+
return false;
|
|
4074
|
+
}
|
|
4075
|
+
if (write.slideMasters) {
|
|
4076
|
+
masterView.setSlideMasters(write.slideMasters);
|
|
4077
|
+
}
|
|
4078
|
+
if (write.notesMaster) {
|
|
4079
|
+
masterView.setNotesMaster(write.notesMaster);
|
|
4080
|
+
}
|
|
4081
|
+
if (write.handoutMaster) {
|
|
4082
|
+
masterView.setHandoutMaster(write.handoutMaster);
|
|
4083
|
+
}
|
|
4084
|
+
history.markDirty();
|
|
4085
|
+
return true;
|
|
4086
|
+
},
|
|
4087
|
+
[history, masterView]
|
|
4088
|
+
);
|
|
4062
4089
|
const updateElementById = useCallback(
|
|
4063
4090
|
(elementId, updates) => {
|
|
4091
|
+
if (masterView?.target) {
|
|
4092
|
+
applyMasterViewWrite(
|
|
4093
|
+
updateMasterViewElement(masterView, masterView.target, elementId, updates)
|
|
4094
|
+
);
|
|
4095
|
+
return;
|
|
4096
|
+
}
|
|
4064
4097
|
if (isTemplateElementId(elementId)) {
|
|
4065
4098
|
const slideId = activeSlide?.id;
|
|
4066
4099
|
if (slideId) {
|
|
@@ -4088,7 +4121,15 @@ function useElementOperations(input) {
|
|
|
4088
4121
|
}
|
|
4089
4122
|
history.markDirty();
|
|
4090
4123
|
},
|
|
4091
|
-
[
|
|
4124
|
+
[
|
|
4125
|
+
activeSlide?.id,
|
|
4126
|
+
activeSlideIndex,
|
|
4127
|
+
applyMasterViewWrite,
|
|
4128
|
+
history,
|
|
4129
|
+
masterView,
|
|
4130
|
+
setSlides,
|
|
4131
|
+
setTemplateElementsBySlideId
|
|
4132
|
+
]
|
|
4092
4133
|
);
|
|
4093
4134
|
const updateSelectedElement = useCallback(
|
|
4094
4135
|
(updates) => {
|
|
@@ -4176,9 +4217,20 @@ function useElementOperations(input) {
|
|
|
4176
4217
|
},
|
|
4177
4218
|
[setSlides]
|
|
4178
4219
|
);
|
|
4179
|
-
const
|
|
4220
|
+
const masterViewTarget = masterView?.target ?? null;
|
|
4221
|
+
const activeElements = masterViewTarget ? masterViewElements(masterView, masterViewTarget) : editTemplateMode ? templateElements : activeSlide?.elements ?? [];
|
|
4180
4222
|
const updateActiveElements = useCallback(
|
|
4181
4223
|
(updater) => {
|
|
4224
|
+
if (masterView?.target) {
|
|
4225
|
+
applyMasterViewWrite(
|
|
4226
|
+
replaceMasterViewElements(
|
|
4227
|
+
masterView,
|
|
4228
|
+
masterView.target,
|
|
4229
|
+
updater(masterViewElements(masterView, masterView.target))
|
|
4230
|
+
)
|
|
4231
|
+
);
|
|
4232
|
+
return;
|
|
4233
|
+
}
|
|
4182
4234
|
if (editTemplateMode) {
|
|
4183
4235
|
const slideId = activeSlide?.id;
|
|
4184
4236
|
if (!slideId) {
|
|
@@ -4196,7 +4248,15 @@ function useElementOperations(input) {
|
|
|
4196
4248
|
);
|
|
4197
4249
|
}
|
|
4198
4250
|
},
|
|
4199
|
-
[
|
|
4251
|
+
[
|
|
4252
|
+
applyMasterViewWrite,
|
|
4253
|
+
editTemplateMode,
|
|
4254
|
+
masterView,
|
|
4255
|
+
activeSlide?.id,
|
|
4256
|
+
activeSlideIndex,
|
|
4257
|
+
setSlides,
|
|
4258
|
+
setTemplateElementsBySlideId
|
|
4259
|
+
]
|
|
4200
4260
|
);
|
|
4201
4261
|
const serializeSlides = useCallback(async () => {
|
|
4202
4262
|
return null;
|
|
@@ -4293,11 +4353,6 @@ function computeResizeGeometry(handle, startX, startY, startWidth, startHeight,
|
|
|
4293
4353
|
}
|
|
4294
4354
|
return snapBoxToGrid(box, handle, gridSpacingPx, MIN_ELEMENT_SIZE);
|
|
4295
4355
|
}
|
|
4296
|
-
function computeAdjustmentValue(startAdjustment, dx, startWidth) {
|
|
4297
|
-
const range = startWidth || 200;
|
|
4298
|
-
const delta = dx / range;
|
|
4299
|
-
return Math.max(0, Math.min(1, startAdjustment + delta));
|
|
4300
|
-
}
|
|
4301
4356
|
function resolveLiveTarget(input) {
|
|
4302
4357
|
const { livePatcher, editTemplateMode, activeSlide } = input;
|
|
4303
4358
|
if (!livePatcher || editTemplateMode || !livePatcher.isActive()) {
|
|
@@ -4496,7 +4551,7 @@ function processResizeMove(e, rs, editorScale, snapToGrid, gridSpacingPx, live)
|
|
|
4496
4551
|
}
|
|
4497
4552
|
function processAdjustmentMove(e, adj, editorScale, updateElementById) {
|
|
4498
4553
|
const dx = (e.clientX - adj.startClientX) / editorScale;
|
|
4499
|
-
const newValue =
|
|
4554
|
+
const newValue = getDraggedShapeAdjustmentValue(adj, dx);
|
|
4500
4555
|
if (!adj.moved && Math.abs(dx) > 2) {
|
|
4501
4556
|
adj.moved = true;
|
|
4502
4557
|
}
|
|
@@ -4828,7 +4883,7 @@ function useCanvasInteractions(input) {
|
|
|
4828
4883
|
justInteractedRef.current = false;
|
|
4829
4884
|
} else {
|
|
4830
4885
|
const el = elementLookup.get(elementId);
|
|
4831
|
-
if (el && hasTextProperties(el) &&
|
|
4886
|
+
if (el && hasTextProperties(el) && canInteractWithElement(el, "textEdit")) {
|
|
4832
4887
|
if (!openEquationEditorForElement(el)) {
|
|
4833
4888
|
setInlineEditingElementId(elementId);
|
|
4834
4889
|
setInlineEditingText(el.text ?? "");
|
|
@@ -4847,7 +4902,7 @@ function useCanvasInteractions(input) {
|
|
|
4847
4902
|
if (openEquationEditorForElement(el)) {
|
|
4848
4903
|
return;
|
|
4849
4904
|
}
|
|
4850
|
-
if (hasTextProperties(el)) {
|
|
4905
|
+
if (hasTextProperties(el) && canInteractWithElement(el, "textEdit")) {
|
|
4851
4906
|
setInlineEditingElementId(elementId);
|
|
4852
4907
|
setInlineEditingText(el.text ?? "");
|
|
4853
4908
|
}
|
|
@@ -4870,9 +4925,13 @@ function useCanvasInteractions(input) {
|
|
|
4870
4925
|
justSelectedRef.current = false;
|
|
4871
4926
|
}
|
|
4872
4927
|
const ids = !wasSelected ? [elementId] : effectiveSelectedIds.length ? effectiveSelectedIds : [elementId];
|
|
4928
|
+
const movableIds = filterInteractableIds(ids, (id) => elementLookup.get(id), "move");
|
|
4929
|
+
if (movableIds.length === 0) {
|
|
4930
|
+
return;
|
|
4931
|
+
}
|
|
4873
4932
|
const startPositions = {};
|
|
4874
4933
|
const domEls = /* @__PURE__ */ new Map();
|
|
4875
|
-
for (const id of
|
|
4934
|
+
for (const id of movableIds) {
|
|
4876
4935
|
const el = elementLookup.get(id);
|
|
4877
4936
|
if (el) {
|
|
4878
4937
|
startPositions[id] = { x: el.x, y: el.y };
|
|
@@ -4936,7 +4995,7 @@ function useCanvasInteractions(input) {
|
|
|
4936
4995
|
const handleResizePointerDown = (elementId, e, handle) => {
|
|
4937
4996
|
e.stopPropagation();
|
|
4938
4997
|
const el = elementLookup.get(elementId);
|
|
4939
|
-
if (!el) {
|
|
4998
|
+
if (!el || !canInteractWithElement(el, "resize")) {
|
|
4940
4999
|
return;
|
|
4941
5000
|
}
|
|
4942
5001
|
resizeStateRef.current = {
|
|
@@ -4958,7 +5017,7 @@ function useCanvasInteractions(input) {
|
|
|
4958
5017
|
};
|
|
4959
5018
|
const handleRotate = (elementId, rotationDeg) => {
|
|
4960
5019
|
const el = elementLookup.get(elementId);
|
|
4961
|
-
if (!el || el
|
|
5020
|
+
if (!el || !canInteractWithElement(el, "rotate")) {
|
|
4962
5021
|
return;
|
|
4963
5022
|
}
|
|
4964
5023
|
ops.updateElementById(elementId, { rotation: rotationDeg });
|
|
@@ -4981,6 +5040,9 @@ function useCanvasInteractions(input) {
|
|
|
4981
5040
|
if (!el || !("shapeType" in el) || !("shapeAdjustments" in el)) {
|
|
4982
5041
|
return;
|
|
4983
5042
|
}
|
|
5043
|
+
if (!canInteractWithElement(el, "adjustHandle")) {
|
|
5044
|
+
return;
|
|
5045
|
+
}
|
|
4984
5046
|
const adjEntries = Object.entries(
|
|
4985
5047
|
el.shapeAdjustments ?? {}
|
|
4986
5048
|
);
|
|
@@ -5906,16 +5968,20 @@ function useGroupAlignLayerHandlers(input) {
|
|
|
5906
5968
|
}
|
|
5907
5969
|
const group = selectedElement;
|
|
5908
5970
|
const intoTemplate = isTemplateElementId(group.id);
|
|
5909
|
-
const
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5971
|
+
const childIds = group.children.map(
|
|
5972
|
+
(child) => intoTemplate ? makeCloneId(true, child.id || group.id) : child.id || generateElementId()
|
|
5973
|
+
);
|
|
5974
|
+
const { elements, childIds: usedIds } = ungroupElements(
|
|
5975
|
+
ops.activeElements,
|
|
5976
|
+
group.id,
|
|
5977
|
+
childIds,
|
|
5978
|
+
{ intoTemplate }
|
|
5979
|
+
);
|
|
5980
|
+
if (usedIds.length === 0) {
|
|
5981
|
+
return;
|
|
5982
|
+
}
|
|
5983
|
+
ops.updateActiveElements(() => elements);
|
|
5984
|
+
setSelectedElementIds(usedIds);
|
|
5919
5985
|
history.markDirty();
|
|
5920
5986
|
};
|
|
5921
5987
|
const handleFlip = (direction) => {
|
|
@@ -7012,14 +7078,7 @@ function useExportSaveAs(input) {
|
|
|
7012
7078
|
handoutMaster,
|
|
7013
7079
|
outputFormat: format
|
|
7014
7080
|
};
|
|
7015
|
-
|
|
7016
|
-
return handler.saveEncrypted(
|
|
7017
|
-
slidesToSave,
|
|
7018
|
-
password,
|
|
7019
|
-
saveOptions
|
|
7020
|
-
);
|
|
7021
|
-
}
|
|
7022
|
-
return handler.save(slidesToSave, saveOptions);
|
|
7081
|
+
return saveDeckWithPassword(handler, slidesToSave, saveOptions, password);
|
|
7023
7082
|
};
|
|
7024
7083
|
const handleExportJson = () => {
|
|
7025
7084
|
const sourceName = filePath ? filePath.replace(/\\/gu, "/").split("/").pop() : void 0;
|
|
@@ -8097,7 +8156,8 @@ function useViewerDialogs(input) {
|
|
|
8097
8156
|
preMasterMode,
|
|
8098
8157
|
hasDigitalSignatures,
|
|
8099
8158
|
isDirty,
|
|
8100
|
-
history
|
|
8159
|
+
history,
|
|
8160
|
+
embeddedFontFamilies
|
|
8101
8161
|
} = input;
|
|
8102
8162
|
const [isSmartArtDialogOpen, setIsSmartArtDialogOpen] = useState(false);
|
|
8103
8163
|
const [isEquationDialogOpen, setIsEquationDialogOpen] = useState(false);
|
|
@@ -8115,7 +8175,15 @@ function useViewerDialogs(input) {
|
|
|
8115
8175
|
const [editingEquationOmml, setEditingEquationOmml] = useState(
|
|
8116
8176
|
null
|
|
8117
8177
|
);
|
|
8118
|
-
const
|
|
8178
|
+
const embeddedFontKey = (embeddedFontFamilies ?? []).join("\0");
|
|
8179
|
+
const fontEmbedding = useMemo(
|
|
8180
|
+
() => describeFontEmbedding(embeddedFontKey ? embeddedFontKey.split("\0") : []),
|
|
8181
|
+
[embeddedFontKey]
|
|
8182
|
+
);
|
|
8183
|
+
const [embedFontsEnabled, setEmbedFontsEnabled] = useState(fontEmbedding.initialEnabled);
|
|
8184
|
+
useEffect(() => {
|
|
8185
|
+
setEmbedFontsEnabled(fontEmbedding.initialEnabled);
|
|
8186
|
+
}, [fontEmbedding]);
|
|
8119
8187
|
const [isNarrowViewport, setIsNarrowViewport] = useState(
|
|
8120
8188
|
() => typeof window !== "undefined" ? isMobileViewport(window.innerWidth, window.innerHeight, viewportIsTouch()) : false
|
|
8121
8189
|
);
|
|
@@ -8282,6 +8350,7 @@ function useViewerDialogs(input) {
|
|
|
8282
8350
|
setEditingEquationOmml,
|
|
8283
8351
|
embedFontsEnabled,
|
|
8284
8352
|
setEmbedFontsEnabled,
|
|
8353
|
+
fontEmbedding,
|
|
8285
8354
|
isNarrowViewport,
|
|
8286
8355
|
handleEnterMasterView,
|
|
8287
8356
|
handleCloseMasterView,
|
|
@@ -8319,30 +8388,15 @@ function computeSlideSectionGroups(slides, sections) {
|
|
|
8319
8388
|
}));
|
|
8320
8389
|
}
|
|
8321
8390
|
function computeMasterPseudoSlide(mode, activeLayout, activeMaster) {
|
|
8322
|
-
if (mode !== "master") {
|
|
8391
|
+
if (mode !== "master" || !activeMaster) {
|
|
8323
8392
|
return void 0;
|
|
8324
8393
|
}
|
|
8325
|
-
|
|
8326
|
-
|
|
8327
|
-
|
|
8328
|
-
|
|
8329
|
-
|
|
8330
|
-
|
|
8331
|
-
backgroundColor: activeLayout.backgroundColor ?? activeMaster?.backgroundColor,
|
|
8332
|
-
backgroundImage: activeLayout.backgroundImage ?? activeMaster?.backgroundImage
|
|
8333
|
-
};
|
|
8334
|
-
}
|
|
8335
|
-
if (activeMaster) {
|
|
8336
|
-
return {
|
|
8337
|
-
id: activeMaster.path,
|
|
8338
|
-
rId: "",
|
|
8339
|
-
slideNumber: 0,
|
|
8340
|
-
elements: activeMaster.elements ?? [],
|
|
8341
|
-
backgroundColor: activeMaster.backgroundColor,
|
|
8342
|
-
backgroundImage: activeMaster.backgroundImage
|
|
8343
|
-
};
|
|
8344
|
-
}
|
|
8345
|
-
return void 0;
|
|
8394
|
+
const document2 = activeLayout ? { slideMasters: [{ ...activeMaster, layouts: [activeLayout] }] } : { slideMasters: [activeMaster] };
|
|
8395
|
+
return masterViewPseudoSlide(document2, {
|
|
8396
|
+
tab: "slides",
|
|
8397
|
+
masterIndex: 0,
|
|
8398
|
+
layoutIndex: activeLayout ? 0 : null
|
|
8399
|
+
});
|
|
8346
8400
|
}
|
|
8347
8401
|
function useDerivedSlideState(input) {
|
|
8348
8402
|
const { t } = useTranslation();
|
|
@@ -8537,7 +8591,9 @@ function useSerialize(input) {
|
|
|
8537
8591
|
handlerRef,
|
|
8538
8592
|
inlineEditingElementIdRef,
|
|
8539
8593
|
inlineEditingTextRef,
|
|
8540
|
-
password
|
|
8594
|
+
password,
|
|
8595
|
+
embedFonts = true,
|
|
8596
|
+
purpose
|
|
8541
8597
|
} = input;
|
|
8542
8598
|
return useCallback(async () => {
|
|
8543
8599
|
const handler = handlerRef.current;
|
|
@@ -8587,12 +8643,10 @@ function useSerialize(input) {
|
|
|
8587
8643
|
customProperties: customProperties.length > 0 ? customProperties : void 0,
|
|
8588
8644
|
tags: tagCollections.length > 0 ? tagCollections : void 0,
|
|
8589
8645
|
notesMaster,
|
|
8590
|
-
handoutMaster
|
|
8646
|
+
handoutMaster,
|
|
8647
|
+
...embeddedFontSaveOptions(embedFonts)
|
|
8591
8648
|
};
|
|
8592
|
-
|
|
8593
|
-
return handler.saveEncrypted(slidesToSave, password, saveOptions);
|
|
8594
|
-
}
|
|
8595
|
-
return handler.save(slidesToSave, saveOptions);
|
|
8649
|
+
return saveDeckWithPassword(handler, slidesToSave, saveOptions, { password, purpose });
|
|
8596
8650
|
}, [
|
|
8597
8651
|
slides,
|
|
8598
8652
|
templateElementsBySlideId,
|
|
@@ -8611,7 +8665,9 @@ function useSerialize(input) {
|
|
|
8611
8665
|
handlerRef,
|
|
8612
8666
|
inlineEditingElementIdRef,
|
|
8613
8667
|
inlineEditingTextRef,
|
|
8614
|
-
password
|
|
8668
|
+
password,
|
|
8669
|
+
embedFonts,
|
|
8670
|
+
purpose
|
|
8615
8671
|
]);
|
|
8616
8672
|
}
|
|
8617
8673
|
|
|
@@ -8837,6 +8893,33 @@ function useEditorOperations(input) {
|
|
|
8837
8893
|
handlerRef,
|
|
8838
8894
|
transformCommittedText
|
|
8839
8895
|
} = input;
|
|
8896
|
+
const masterView = useMemo(
|
|
8897
|
+
() => ({
|
|
8898
|
+
target: mode === "master" ? {
|
|
8899
|
+
tab: state.masterViewTab,
|
|
8900
|
+
masterIndex: state.activeMasterIndex,
|
|
8901
|
+
layoutIndex: state.activeLayoutIndex
|
|
8902
|
+
} : null,
|
|
8903
|
+
slideMasters: state.slideMasters,
|
|
8904
|
+
notesMaster: state.notesMaster,
|
|
8905
|
+
handoutMaster: state.handoutMaster,
|
|
8906
|
+
setSlideMasters: state.setSlideMasters,
|
|
8907
|
+
setNotesMaster: state.setNotesMaster,
|
|
8908
|
+
setHandoutMaster: state.setHandoutMaster
|
|
8909
|
+
}),
|
|
8910
|
+
[
|
|
8911
|
+
mode,
|
|
8912
|
+
state.masterViewTab,
|
|
8913
|
+
state.activeMasterIndex,
|
|
8914
|
+
state.activeLayoutIndex,
|
|
8915
|
+
state.slideMasters,
|
|
8916
|
+
state.notesMaster,
|
|
8917
|
+
state.handoutMaster,
|
|
8918
|
+
state.setSlideMasters,
|
|
8919
|
+
state.setNotesMaster,
|
|
8920
|
+
state.setHandoutMaster
|
|
8921
|
+
]
|
|
8922
|
+
);
|
|
8840
8923
|
const ops = useElementOperations({
|
|
8841
8924
|
activeSlide,
|
|
8842
8925
|
activeSlideIndex,
|
|
@@ -8844,6 +8927,7 @@ function useEditorOperations(input) {
|
|
|
8844
8927
|
selectedElementId,
|
|
8845
8928
|
editTemplateMode: state.editTemplateMode,
|
|
8846
8929
|
templateElements: state.templateElements,
|
|
8930
|
+
masterView,
|
|
8847
8931
|
history,
|
|
8848
8932
|
setSlides: state.setSlides,
|
|
8849
8933
|
setTemplateElementsBySlideId: state.setTemplateElementsBySlideId,
|
|
@@ -9054,6 +9138,7 @@ function useIOHandlers(input) {
|
|
|
9054
9138
|
zoom,
|
|
9055
9139
|
handlerRef,
|
|
9056
9140
|
serializeSlides,
|
|
9141
|
+
serializeForRecovery,
|
|
9057
9142
|
setContent,
|
|
9058
9143
|
onContentChange,
|
|
9059
9144
|
password
|
|
@@ -9092,7 +9177,9 @@ function useIOHandlers(input) {
|
|
|
9092
9177
|
});
|
|
9093
9178
|
const themeHandlers = useThemeHandlers({
|
|
9094
9179
|
handlerRef,
|
|
9095
|
-
|
|
9180
|
+
// Theme apply re-serialises and re-parses through `setContent`, so these
|
|
9181
|
+
// bytes go back into our own loader: plaintext, never the protected save.
|
|
9182
|
+
serializeSlides: serializeForRecovery,
|
|
9096
9183
|
setContent,
|
|
9097
9184
|
onContentChange,
|
|
9098
9185
|
setTheme: state.setTheme,
|
|
@@ -9285,6 +9372,8 @@ function useContentLifecycle(input) {
|
|
|
9285
9372
|
content,
|
|
9286
9373
|
filePath,
|
|
9287
9374
|
autosaveEnabled = true,
|
|
9375
|
+
autosaveIntervalSeconds,
|
|
9376
|
+
embedFonts = true,
|
|
9288
9377
|
slides,
|
|
9289
9378
|
state,
|
|
9290
9379
|
history,
|
|
@@ -9334,7 +9423,7 @@ function useContentLifecycle(input) {
|
|
|
9334
9423
|
actionSoundHandlerRef.current = handlerRef.current;
|
|
9335
9424
|
}, [handlerRef, actionSoundHandlerRef, state.loading]);
|
|
9336
9425
|
useFontInjection({ embeddedFonts: state.embeddedFonts, slides });
|
|
9337
|
-
const
|
|
9426
|
+
const serializeInput = {
|
|
9338
9427
|
slides,
|
|
9339
9428
|
templateElementsBySlideId: state.templateElementsBySlideId,
|
|
9340
9429
|
activeSlideIndex: state.activeSlideIndex,
|
|
@@ -9352,15 +9441,19 @@ function useContentLifecycle(input) {
|
|
|
9352
9441
|
handlerRef,
|
|
9353
9442
|
inlineEditingElementIdRef: state.inlineEditingElementIdRef,
|
|
9354
9443
|
inlineEditingTextRef: state.inlineEditingTextRef,
|
|
9355
|
-
password
|
|
9356
|
-
|
|
9444
|
+
password,
|
|
9445
|
+
embedFonts
|
|
9446
|
+
};
|
|
9447
|
+
const serializeSlides = useSerialize(serializeInput);
|
|
9448
|
+
const serializeForRecovery = useSerialize({ ...serializeInput, purpose: "recovery-snapshot" });
|
|
9357
9449
|
const { autosaveStatus } = useAutosave({
|
|
9358
9450
|
isDirty: state.isDirty,
|
|
9359
9451
|
filePath,
|
|
9360
|
-
serializeSlides,
|
|
9361
|
-
enabled: autosaveEnabled
|
|
9452
|
+
serializeSlides: serializeForRecovery,
|
|
9453
|
+
enabled: autosaveEnabled,
|
|
9454
|
+
...autosaveIntervalSeconds === void 0 ? {} : { intervalSeconds: autosaveIntervalSeconds }
|
|
9362
9455
|
});
|
|
9363
|
-
return { handlerRef, serializeSlides, autosaveStatus };
|
|
9456
|
+
return { handlerRef, serializeSlides, serializeForRecovery, autosaveStatus };
|
|
9364
9457
|
}
|
|
9365
9458
|
function useKeyboardShortcuts(input) {
|
|
9366
9459
|
const inputRef = useRef(input);
|
|
@@ -9524,6 +9617,7 @@ function useViewerIntegration(input) {
|
|
|
9524
9617
|
content,
|
|
9525
9618
|
filePath,
|
|
9526
9619
|
autosaveEnabled,
|
|
9620
|
+
autosaveIntervalSeconds,
|
|
9527
9621
|
canEdit,
|
|
9528
9622
|
mode,
|
|
9529
9623
|
slides,
|
|
@@ -9574,19 +9668,24 @@ function useViewerIntegration(input) {
|
|
|
9574
9668
|
});
|
|
9575
9669
|
const [isEncryptedDialogOpen, setIsEncryptedDialogOpen] = useState(false);
|
|
9576
9670
|
const [loadVersion, setLoadVersion] = useState(0);
|
|
9577
|
-
const { handlerRef, serializeSlides, autosaveStatus } = useContentLifecycle(
|
|
9578
|
-
|
|
9579
|
-
|
|
9580
|
-
|
|
9581
|
-
|
|
9582
|
-
|
|
9583
|
-
|
|
9584
|
-
|
|
9585
|
-
|
|
9586
|
-
|
|
9587
|
-
|
|
9588
|
-
|
|
9589
|
-
|
|
9671
|
+
const { handlerRef, serializeSlides, serializeForRecovery, autosaveStatus } = useContentLifecycle(
|
|
9672
|
+
{
|
|
9673
|
+
content,
|
|
9674
|
+
filePath,
|
|
9675
|
+
autosaveEnabled,
|
|
9676
|
+
autosaveIntervalSeconds,
|
|
9677
|
+
// The File > Fonts toggle, finally reaching a save call.
|
|
9678
|
+
embedFonts: dialogs.embedFontsEnabled,
|
|
9679
|
+
slides,
|
|
9680
|
+
state,
|
|
9681
|
+
history,
|
|
9682
|
+
ops: editorOps.ops,
|
|
9683
|
+
actionSoundHandlerRef,
|
|
9684
|
+
setIsEncryptedDialogOpen,
|
|
9685
|
+
password: dialogs.presentationPassword ?? void 0,
|
|
9686
|
+
onContentApplied: () => setLoadVersion((v) => v + 1)
|
|
9687
|
+
}
|
|
9688
|
+
);
|
|
9590
9689
|
const { exportHandlers, printHandlers, themeHandlers, propertyHandlers } = useIOHandlers({
|
|
9591
9690
|
state,
|
|
9592
9691
|
slides,
|
|
@@ -9598,6 +9697,7 @@ function useViewerIntegration(input) {
|
|
|
9598
9697
|
zoom,
|
|
9599
9698
|
handlerRef,
|
|
9600
9699
|
serializeSlides,
|
|
9700
|
+
serializeForRecovery,
|
|
9601
9701
|
setContent,
|
|
9602
9702
|
onContentChange,
|
|
9603
9703
|
password: dialogs.presentationPassword ?? void 0
|
|
@@ -10236,11 +10336,16 @@ function useLayoutSwitching(input) {
|
|
|
10236
10336
|
},
|
|
10237
10337
|
[handler, activeSlideIndex, ops, history, onTemplateElementsChanged]
|
|
10238
10338
|
);
|
|
10339
|
+
const loadLayoutPreviews = useCallback(
|
|
10340
|
+
async () => handler ? handler.getLayoutPreviews() : [],
|
|
10341
|
+
[handler]
|
|
10342
|
+
);
|
|
10239
10343
|
return {
|
|
10240
10344
|
availableLayouts,
|
|
10241
10345
|
isLoading,
|
|
10242
10346
|
loadAvailableLayouts,
|
|
10243
10347
|
applyLayout,
|
|
10348
|
+
loadLayoutPreviews,
|
|
10244
10349
|
currentLayoutPath
|
|
10245
10350
|
};
|
|
10246
10351
|
}
|
|
@@ -10499,41 +10604,7 @@ function buildCanvasProps(input) {
|
|
|
10499
10604
|
|
|
10500
10605
|
// src/viewer/hooks/useScopedLayoutOptions.ts
|
|
10501
10606
|
function scopeLayoutOptionsToActiveSlide(options, activeSlide) {
|
|
10502
|
-
|
|
10503
|
-
return options;
|
|
10504
|
-
}
|
|
10505
|
-
const hasAnyMasterInfo = options.some((o) => o.masterPath);
|
|
10506
|
-
if (!hasAnyMasterInfo) {
|
|
10507
|
-
return options;
|
|
10508
|
-
}
|
|
10509
|
-
const activeOption = options.find((o) => o.path === activeSlide.layoutPath);
|
|
10510
|
-
const activeMaster = activeOption?.masterPath;
|
|
10511
|
-
if (!activeMaster) {
|
|
10512
|
-
return options;
|
|
10513
|
-
}
|
|
10514
|
-
const scoped = options.filter((o) => o.masterPath === activeMaster);
|
|
10515
|
-
const seen = /* @__PURE__ */ new Map();
|
|
10516
|
-
for (const opt of scoped) {
|
|
10517
|
-
const isActive = opt.path === activeSlide.layoutPath;
|
|
10518
|
-
const existing = seen.get(opt.name);
|
|
10519
|
-
if (!existing || isActive) {
|
|
10520
|
-
seen.set(opt.name, opt);
|
|
10521
|
-
}
|
|
10522
|
-
}
|
|
10523
|
-
const chosen = new Set(Array.from(seen.values()).map((o) => o.path));
|
|
10524
|
-
const result = [];
|
|
10525
|
-
const usedNames = /* @__PURE__ */ new Set();
|
|
10526
|
-
for (const opt of scoped) {
|
|
10527
|
-
if (!chosen.has(opt.path)) {
|
|
10528
|
-
continue;
|
|
10529
|
-
}
|
|
10530
|
-
if (usedNames.has(opt.name)) {
|
|
10531
|
-
continue;
|
|
10532
|
-
}
|
|
10533
|
-
usedNames.add(opt.name);
|
|
10534
|
-
result.push(opt);
|
|
10535
|
-
}
|
|
10536
|
-
return result;
|
|
10607
|
+
return scopeLayoutOptionsToSlide(options, activeSlide?.layoutPath);
|
|
10537
10608
|
}
|
|
10538
10609
|
|
|
10539
10610
|
// src/viewer/hooks/useViewerBuildingBlocks-toolbar-handlers.ts
|
|
@@ -10766,6 +10837,8 @@ function buildToolbarProps(input) {
|
|
|
10766
10837
|
isOverflowMenuOpen: s.isOverflowMenuOpen,
|
|
10767
10838
|
onSetOverflowMenuOpen: s.setIsOverflowMenuOpen,
|
|
10768
10839
|
layoutOptions: scopedLayoutOptions,
|
|
10840
|
+
currentLayoutPath: activeSlide?.layoutPath,
|
|
10841
|
+
loadLayoutPreviews: input.loadLayoutPreviews,
|
|
10769
10842
|
onInsertSlideFromLayout: slideOps.handleInsertSlideFromLayout,
|
|
10770
10843
|
onInsertSlideFromTemplate: slideOps.handleInsertSlideFromTemplate,
|
|
10771
10844
|
templateScheme: templateSchemeFromTheme(s.theme?.colorScheme),
|
|
@@ -10817,6 +10890,20 @@ function buildToolbarProps(input) {
|
|
|
10817
10890
|
activeSlide,
|
|
10818
10891
|
onTransitionChange: handleTransitionChange,
|
|
10819
10892
|
onApplyTransitionToAll: handleApplyTransitionToAll,
|
|
10893
|
+
// No `onResetSlide` here: this building-blocks surface supplies no
|
|
10894
|
+
// `onApplyLayout` either, so there is no layout to reset to. The mounted
|
|
10895
|
+
// viewer (`ViewerToolbarSection`) wires both.
|
|
10896
|
+
onSelectAll: () => {
|
|
10897
|
+
const allIds = activeSlide?.elements.map((element) => element.id) ?? [];
|
|
10898
|
+
if (allIds.length > 0) {
|
|
10899
|
+
ops.applySelection(allIds[0], allIds);
|
|
10900
|
+
}
|
|
10901
|
+
},
|
|
10902
|
+
presentationProperties: s.presentationProperties,
|
|
10903
|
+
onPresentationPropertiesChange: (updates) => {
|
|
10904
|
+
s.setPresentationProperties((prev) => ({ ...prev, ...updates }));
|
|
10905
|
+
history.markDirty();
|
|
10906
|
+
},
|
|
10820
10907
|
hiddenActions
|
|
10821
10908
|
};
|
|
10822
10909
|
}
|
|
Binary file
|
|
Binary file
|
package/dist/i18n.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkAONFHTTJ_js = require('./chunk-AONFHTTJ.js');
|
|
4
4
|
require('./chunk-4VNS5WPM.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
Object.defineProperty(exports, "LOCALE_CATALOG", {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return chunkAONFHTTJ_js.LOCALE_CATALOG; }
|
|
11
11
|
});
|
|
12
12
|
Object.defineProperty(exports, "keyToLabel", {
|
|
13
13
|
enumerable: true,
|
|
14
|
-
get: function () { return
|
|
14
|
+
get: function () { return chunkAONFHTTJ_js.keyToLabel; }
|
|
15
15
|
});
|
|
16
16
|
Object.defineProperty(exports, "translationsEn", {
|
|
17
17
|
enumerable: true,
|
|
18
|
-
get: function () { return
|
|
18
|
+
get: function () { return chunkAONFHTTJ_js.translationsEn; }
|
|
19
19
|
});
|
package/dist/i18n.js.br
CHANGED
|
Binary file
|
package/dist/i18n.js.gz
CHANGED
|
Binary file
|