pptx-react-viewer 4.46.0 → 4.47.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.
- package/CHANGELOG.md +44 -0
- package/README.md +3 -0
- package/dist/{AiChatPanel-Z5VHI4WA.mjs → AiChatPanel-6S4LWXGM.mjs} +2 -2
- package/dist/AiChatPanel-6S4LWXGM.mjs.br +0 -0
- package/dist/AiChatPanel-6S4LWXGM.mjs.gz +0 -0
- package/dist/{AiChatPanel-TGZQBH3L.js → AiChatPanel-IEM43TTZ.js} +10 -10
- package/dist/AiChatPanel-IEM43TTZ.js.br +0 -0
- package/dist/AiChatPanel-IEM43TTZ.js.gz +0 -0
- package/dist/{Model3DScene-5HLXSIIK.js → Model3DScene-CCIG67DJ.js} +1 -1
- package/dist/Model3DScene-CCIG67DJ.js.br +0 -0
- package/dist/Model3DScene-CCIG67DJ.js.gz +0 -0
- package/dist/{Model3DScene-MSC4LEKG.mjs → Model3DScene-NUJH2UKM.mjs} +1 -1
- package/dist/Model3DScene-NUJH2UKM.mjs.br +0 -0
- package/dist/Model3DScene-NUJH2UKM.mjs.gz +0 -0
- package/dist/{chunk-CLHUOZSY.mjs → chunk-2I7ZAM4F.mjs} +244 -160
- package/dist/chunk-2I7ZAM4F.mjs.br +0 -0
- package/dist/chunk-2I7ZAM4F.mjs.gz +0 -0
- package/dist/{chunk-UQFIRJGG.mjs → chunk-BL7UYXYD.mjs} +233 -128
- package/dist/chunk-BL7UYXYD.mjs.br +0 -0
- package/dist/chunk-BL7UYXYD.mjs.gz +0 -0
- package/dist/{chunk-FBN7UFW2.mjs → chunk-BVQSH5SS.mjs} +36 -43
- package/dist/chunk-BVQSH5SS.mjs.br +0 -0
- package/dist/chunk-BVQSH5SS.mjs.gz +0 -0
- package/dist/{chunk-VJZJESNT.js → chunk-MA2BI7LX.js} +45 -61
- package/dist/chunk-MA2BI7LX.js.br +0 -0
- package/dist/chunk-MA2BI7LX.js.gz +0 -0
- package/dist/{chunk-W2IMY5SY.js → chunk-PIRHQTI4.js} +0 -2
- package/dist/chunk-PIRHQTI4.js.br +0 -0
- package/dist/chunk-PIRHQTI4.js.gz +0 -0
- package/dist/{chunk-2J3467IB.js → chunk-TANR7L7E.js} +546 -462
- package/dist/chunk-TANR7L7E.js.br +0 -0
- package/dist/chunk-TANR7L7E.js.gz +0 -0
- package/dist/{chunk-Q3DHYOLK.mjs → chunk-UV2HVMKZ.mjs} +1 -2
- package/dist/chunk-UV2HVMKZ.mjs.br +0 -0
- package/dist/chunk-UV2HVMKZ.mjs.gz +0 -0
- package/dist/{chunk-AMXSOQRH.js → chunk-VUVBSQLT.js} +408 -301
- package/dist/chunk-VUVBSQLT.js.br +0 -0
- package/dist/chunk-VUVBSQLT.js.gz +0 -0
- package/dist/i18n.js +1 -1
- package/dist/i18n.js.br +2 -2
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +1 -1
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +42 -5
- package/dist/index.js +25 -25
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +4 -4
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +66 -7
- package/dist/internals.js +82 -82
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +3 -3
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer-canvas.css +2 -0
- package/dist/pptx-viewer-canvas.css.br +0 -0
- package/dist/pptx-viewer-canvas.css.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/{three.module-JPZUM7AI.mjs → three.module-EBJVANGB.mjs} +1 -1
- package/dist/three.module-EBJVANGB.mjs.br +0 -0
- package/dist/three.module-EBJVANGB.mjs.gz +0 -0
- package/dist/{three.module-RIUI7P3J.js → three.module-MBFHAT6M.js} +1 -1
- package/dist/three.module-MBFHAT6M.js.br +0 -0
- package/dist/three.module-MBFHAT6M.js.gz +0 -0
- package/dist/viewer/index.d.ts +44 -9
- package/dist/viewer/index.js +20 -20
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +4 -4
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/dist/{y-webrtc-CCA4HVZZ.mjs → y-webrtc-2H7UYAQD.mjs} +1 -1
- package/dist/y-webrtc-2H7UYAQD.mjs.br +0 -0
- package/dist/y-webrtc-2H7UYAQD.mjs.gz +0 -0
- package/dist/{y-webrtc-MB5ZXFBA.js → y-webrtc-DVPQNFLL.js} +5 -5
- package/dist/y-webrtc-DVPQNFLL.js.br +0 -0
- package/dist/y-webrtc-DVPQNFLL.js.gz +0 -0
- package/dist/{y-websocket-JQQZVAMX.js → y-websocket-TN4OKPXQ.js} +1 -1
- package/dist/y-websocket-TN4OKPXQ.js.br +0 -0
- package/dist/y-websocket-TN4OKPXQ.js.gz +0 -0
- package/dist/{y-websocket-SCLLNICY.mjs → y-websocket-WORVRRQS.mjs} +1 -1
- package/dist/y-websocket-WORVRRQS.mjs.br +0 -0
- package/dist/y-websocket-WORVRRQS.mjs.gz +0 -0
- package/package.json +7 -5
- package/dist/AiChatPanel-TGZQBH3L.js.br +0 -0
- package/dist/AiChatPanel-TGZQBH3L.js.gz +0 -0
- package/dist/AiChatPanel-Z5VHI4WA.mjs.br +0 -0
- package/dist/AiChatPanel-Z5VHI4WA.mjs.gz +0 -0
- package/dist/Model3DScene-5HLXSIIK.js.br +0 -0
- package/dist/Model3DScene-5HLXSIIK.js.gz +0 -0
- package/dist/Model3DScene-MSC4LEKG.mjs.br +0 -0
- package/dist/Model3DScene-MSC4LEKG.mjs.gz +0 -0
- package/dist/chunk-2J3467IB.js.br +0 -0
- package/dist/chunk-2J3467IB.js.gz +0 -0
- package/dist/chunk-AMXSOQRH.js.br +0 -0
- package/dist/chunk-AMXSOQRH.js.gz +0 -0
- package/dist/chunk-CLHUOZSY.mjs.br +0 -0
- package/dist/chunk-CLHUOZSY.mjs.gz +0 -0
- package/dist/chunk-FBN7UFW2.mjs.br +0 -0
- package/dist/chunk-FBN7UFW2.mjs.gz +0 -0
- package/dist/chunk-Q3DHYOLK.mjs.br +0 -0
- package/dist/chunk-Q3DHYOLK.mjs.gz +0 -0
- package/dist/chunk-UQFIRJGG.mjs.br +0 -0
- package/dist/chunk-UQFIRJGG.mjs.gz +0 -0
- package/dist/chunk-VJZJESNT.js.br +0 -0
- package/dist/chunk-VJZJESNT.js.gz +0 -0
- package/dist/chunk-W2IMY5SY.js.br +0 -0
- package/dist/chunk-W2IMY5SY.js.gz +0 -0
- package/dist/three.module-JPZUM7AI.mjs.br +0 -0
- package/dist/three.module-JPZUM7AI.mjs.gz +0 -0
- package/dist/three.module-RIUI7P3J.js.br +0 -0
- package/dist/three.module-RIUI7P3J.js.gz +0 -0
- package/dist/y-webrtc-CCA4HVZZ.mjs.br +0 -0
- package/dist/y-webrtc-CCA4HVZZ.mjs.gz +0 -0
- package/dist/y-webrtc-MB5ZXFBA.js.br +0 -0
- package/dist/y-webrtc-MB5ZXFBA.js.gz +0 -0
- package/dist/y-websocket-JQQZVAMX.js.br +0 -0
- package/dist/y-websocket-JQQZVAMX.js.gz +0 -0
- package/dist/y-websocket-SCLLNICY.mjs.br +0 -0
- package/dist/y-websocket-SCLLNICY.mjs.gz +0 -0
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { GlyphOutlineFontCache, createGlyphOutlineLookup, DEFAULT_VIEWER_OPTIONS, TOOLBAR_TABS, defineThreeViewElement, getSelectionControlArtworkStyle, svgLineCap, getSelectionOutlineColor, screenStrokeWidth, connectorWrapperTransform, resolveElementInteractivity, getBackgroundAnimationState, getShapeEffectLayerPlacement, buildTextStyleOverrideCss, isElementRendered, resolveElementAriaAttributes, isMediaFullscreenActive, shouldRenderHitTarget, elementHitTargetStyle, getShapeEffectAnimationLayerStyle, inlineElementPointerEvents, isHollowShapeElement, LINK_TOOLTIP_HOST_CLASS, mediaTransportVisible, oleActionsVisible, getGroupChildParentFill, getResizeHandleHitAreaStyle, paintedStrokeWidth, ensureActionAffordanceStyles, resolveElementActionAffordance, actionAffordanceLabels, paintedElementSize, MEDIA_FULLSCREEN_OVERLAY_STYLE, elementContainerHeightStyle, getAnimationOpacity, resolveElementHighlightClick, applyHighlightClickStyle, getComputedEffectStyle, getSoftEdgeSvgFilter, getEffectStyleSource, getBevelLightingSvgFilter, buildStrokeOutline, buildHollowHitOutline, buildSubpathFillOverlay, strokeOutlineViewBox, resolveRevealedSmartArtNodes, resolveRevealedDrawingShapes, buildSmartArtA11y, canDrillDown, computeSmartArtElementLayout, flattenNodes, buildSummaryZoomView, getImageColorWashStyle, readEditableText, placeCaretAt, takePendingCaretPoint, getPendingSelectionRestore, restoreSegmentSelection, mapInlineTextFormatKey, mapInlineEditorChord, subscribeBarFacePicturePixelSamples, getBarFacePicturePixelSampleVersion, ensureChartInteractionStyles, applyChartPartHighlight, resolveRevealedChartData, formatAxisValue, chartFormatTargetFromEvent, resolveOleType, getOleAriaLabel, getOleTypeColor, getOleTypeLabel, filterRenderedElements, resolveGroupChildFill, isLinkedTextBox, getOverflowSegments, shouldUseSvgWarp, getTextBodyRotationTransform, placeholderPromptDescriptor, getAriaRoleDescription as getAriaRoleDescription$1, getAriaLabel as getAriaLabel$1, attachRotateHandlePlacement, elementIdSelector, createRotationDrag, ACTION_INDICATOR_CLASS, ACTION_INDICATOR_ICON_PATH, LINK_TOOLTIP_CLASS, LINK_TOOLTIP_PANEL_CLASS, LINK_TOOLTIP_LABEL_CLASS, LINK_TOOLTIP_HINT_CLASS, SMARTART_DEFAULT_PALETTE, resolvePalette as resolvePalette$1, computeDrawingViewBox, projectDrawingShapes, resolveRevealedDrawingShapeNodeIds, styleShadowFilter, buildChromeStyle, measureSvgViewportRect, modelDataToBlobUrl, resolveZoomNavigationTarget, getImageSvgFilters, getCachedNativeImageSize, probeNativeImageSize, buildDuotoneCacheKey, getDuotoneCachedResult, applyDuotone, setDuotoneCachedResult, inlineListBodyText, createInlineListSeed, readListActivationSelection, createInlineListModelObserver, attachCollaborationInlineEditor, bindInlineListParagraph, bindInlineListRun, attachInlineListController, restoreInlineListBodySelection, getInlineEditorSelectionResult, isBulletMarkerSegment, resolveChartThreeViewSpec, applyChart3DDrag, applyChart3DSelect, findChartPartTarget, withChartTitle, resolveSmartArtThreeViewSpec, isBrowserOpenableMime, formatBytes, getOleDisplayName, getOleBadgeLabel, openUrlInNewTab, hasGlyphEnvelope, buildGlyphEnvelopeBlock, getWarpPath, resolveFontItalic, resolveFontWeight, isWedgeCalloutPresetShape, getAriaRole as getAriaRole$1, isElementActionable, centeredSvgTextLines, findSmartArtNodeText, rebuildDrawingShapesIfCleared, shouldCommitSmartArtNodeText, advanceChartMarkDrag, advanceChartValueDrag, resolveChartKind, buildChartMarkDragGeometry, beginChartMarkDrag, beginChartValueDrag, commitSmartArtNodeFill, commitSmartArtNodeText, groupIntoParagraphs as groupIntoParagraphs$1, computeInlineEditorRect, smartArtNodeAtPoint, MIN_TOUCH_TARGET_PX, computeVirtualRange, DEFAULT_VIRTUAL_OVERSCAN, createSyncGate, clearLocalAwareness, validateRoomId, createDepartureChannel, resolveTransportForServerUrl, isMixedContentBlocked, CONNECTION_TIMEOUT_MS, registerCollaborationTeardown, createPresenceProjector, BROADCAST_THROTTLE_MS, sanitizeColor, createWheelStepBuffer, createViewerZoomStore, clampZoomScale, mapEditingWheel, createActiveAnimationGroup, cancelBuildReveal, clearPlaybackTimers, PresentationAnimationController, resolveMediaTimeNodeElementIds, resolveMediaBookmarkTimesMs, advanceMainSequence, playGroup, PRESENTATION_HASH, PRESENTATION_NONCE_KEY, PRESENTATION_CHANNEL_NAME, swapPresentationWindows, PRESENTATION_MESSAGE_ORIGIN, clearAudienceContent, buildPresentationAudienceUrl, resolveAudienceScreenPlacement, placeAudienceWindow, storeAudienceContent, isPresentationSessionMessage, endAudienceDisplay, createPresentationKeyBuffer, acceptsPresentationInput, resolveAutoAdvanceDelayMs, resolveForwardSlideWithZoomReturn, buildZoomTransitionOverride, hasShowSlideAfter, nextShowSlideIndex, previousShowSlideIndex, beginZoomExcursion, createPresenterShowGuard, firstShowSlideIndex, attachPresentationVisibilityPause, presentationEntrySlideIndex, buildMorphTransitionPlan, morphOptionToMode, buildMorphAnimationRules, findInSlides, applyFindReplacements, visibleTemplateElements, createCollaborationLivePatcher, publishLiveInlineText, initialInspectorOpen, createPresentationLoadResources, collectMediaElements, resolveMediaElementSource, collectImagePaths, applyImagePathPatches, resolveTableCellImageUrls, resolveTableStyleImageUrls, resolveTextFillBlipUrls, seedRecentColors, resolveAuthoredCustomShowId, buildInitialGuides, readOnlyRecommendation, compatibilityWarningToasts, resolveInitialSlideIndex, resolveAutosaveIntervalMs, shouldWriteAutosaveSnapshot, saveAutosaveSnapshot, autosaveSnapshotMark, updateMasterViewElement, updateElement, masterViewElements, replaceMasterViewElements, addSection, renameSection, deleteSection, moveSectionUp, moveSectionDown, moveSlidesToSection, canMergeShapes, canInteractWithElement, prepareHtml2CanvasClone, slideProgressPercent, slideStatusLabel, EXPORT_ASSEMBLING_PERCENT, EXPORT_DONE_PERCENT, isExportAbortError, resolveImageResolutionScale, applyAcceptSlide, applyAcceptAllSlides, collectUsedFonts, describeFontEmbedding, isMobileViewport, resolveAuthoredSlideRange, mayLeaveSlideShow, buildDeckSaveOptions, resolveSlideSizeSelection, saveDeckWithPassword, shouldProbeAutosaveRecovery, probeAutosaveRecovery, acceptAutosaveRecovery, acknowledgeAutosaveRecovery, discardAutosaveRecovery, shouldLoopContinuously, applyRehearsalTimings, rasterResultToPngBlob, downloadBlob, elementPictureFilename, canEditElementPoints, selectTrustedEmbeddedFonts, collectReferencedFontFamilies, resolveGoogleWebfontHref, syncGoogleWebfontStylesheet, selectGoogleWebfontFamilies, fetchGoogleWebfontOutlineBytes, isFeatureEnabled, mapSlideShowStartKey, mapCustomizedEditorKey, isEditorControlTarget, isEditorTextInputTarget, parentSelection, textFontSizePtToPx, stepFontSizePt, textFontSizePxToPt, cycleSelectableElement, createCustomizationController, prepareElementForInsertion, slideSpaceElement, createViewerOptionsStore, observeYDocSlides, LOCAL_SYNC_ORIGIN, readSlidesFromYDoc, shouldRoomSlidesReplaceLoad, reconcileSlidesInYDoc, shouldAutoFollowBroadcaster, detectTouchDevice, detectOrientation, deriveViewportBreakpoints, createTouchGestureRecognizer, isKeyboardOpen, scopeLayoutOptionsToSlide, checkModifyPassword, viewerPreferencesFromViewProperties, DEFAULT_VIEWER_PREFERENCES, viewPropertiesPatchFromPreferences, resolveCollaborationConfig, openPptxFile, readBackstageRecentFile, resolveCollaborationShellEditability, resolveCollaborationShellState, deviceStrokeStageStyle, MORPH_CROSSFADE_GROUP_STYLE, MORPH_CROSSFADE_HALF_STYLE, getSlideTransitionAnimations, getFragmentedTransitionDescriptor, SLIDE_TRANSITION_KEYFRAMES, isActionHidden, buildInlineTextCommitPatch, resolveInlineEditAutoFitHeight, resolveInlineEditNormAutofitShrink, setPendingCaretPoint, drillSelectionForDoubleClick, filterInteractableIds, beginShapeAdjustment, buildElementClipboardPayload, contextMenuInspectorAnchor, savedPresentationFileName, exportDeckJson, groupElements, generateElementId, ungroupElements, alignElements, distributeElements, newTableElement, createDefaultChartElement, readViewportMetrics, computeKeyboardInset, planMergeShapes, applyMergeShapesPlan, mapPresentationKey, lastShowSlideIndex, mapPresentationWheel, openPendingPrintWindow, computeColorFilter, filterHiddenSlideIndices, computeSlideIndices, buildPrintDocument, finishPrintWindow, buildPrintHtmlDocument, buildOutlineHtml, buildSlidesHtml, buildNotesHtml, buildHandoutsHtml, createBlankSlide, insertSlidePaste, applySlidePasteTemplates, makeSlideId, buildSlideTemplateSlide, templateSchemeFromTheme, needsOwnedSession, openOwnedCollaboration, resolveViewportFitOptions, editorViewportFitFor, calculateViewportFit, scheduleAutoAdvanceChain, computeEntranceAnimationDelay, createPresentationSessionId, resolveTransitionDurationMs, resolveTransitionSoundAction, runPresentationAction, safeOpenUrl, buildRunProgramNotice, toggleStageElementMedia, resolveOleVerbTarget, downloadDataUrl, createPresenterTimer, createInitialPresentationSnapshot, mergePresentationSnapshot, resetPresenterTimer, presenterElapsed, stepPresenterZoom, togglePresenterTimer, addCommentToList, removeCommentFromList, editCommentInList, toggleCommentResolvedInList, slideSpaceMembers, remapTextToSegments, buildInlineListStylePatch, applyActiveInlineListFormatting, applyListStyleUpdate, setPendingSelectionRestore, applyTextStyleUpdate, toggleSelectionBullets, transformInlineListCase, applyCaseTransformToSegments, transformTextCase, resolveExportCaptureDecision, recordProgressPercent, computeGridSpacingPx as computeGridSpacingPx$1, resolveShowSlideIndexes, groupSlidesBySection, masterViewPseudoSlide, overlayMasterViewInlineSnapshot, overlayInlineTextSnapshot, rasterizeElement, cloneElementForPaste, applyPasteSpecialFormat, buildRasterPictureElement, cloneElementUpdates, assertElementUpdateTarget, prepareElementUpdateBatch, createWriteBackScheduler, writeBackReport, observeExternalCollaborationReadiness, resolveHistoryDepth, createBackstagePresentation, buildFieldSubstitutionContext, isEnterableGroup, memberChainAtPoint, findElementPath, drillSelectionForClick, scrollInspectorSectionIntoView, computeScrollDelta, replyToCommentInList, removeTableElementColumn, insertTableElementColumn, removeTableElementRow, insertTableElementRow, withCellStyle, setCellText, pickSupportedMimeType, WEBM_MIME_CANDIDATES, fpsToFrameIntervalMs, segmentFrameCount, stopCaptureStream, GIF_POST_CAPTURE_MAX_SIDE, encodeGif, rasterizeElementTiles, placeTileOnPage, PDF_SLIDES_PAGE_WIDTH_PT, PDF_SLIDES_PAGE_HEIGHT_PT, createSnapshotTextPositions, resolvePresentationAction, buildSmartArtPresetData, classifyMediaType, publishLiveGeometry, getDraggedShapeAdjustments, computeMarqueeHitIds, mergeAdditiveSelection, rasterizeElementTiledToCanvas, borrowExternalCollaborationAwareness, observeExternalCollaborationSession, clampGifDimensions, rasterResultToPngDataUrl, shouldConfirmExternalHyperlink, applyResize, lockResizeAspect, snapBoxToGrid, applyMotionPathPreset, bringForward, sendBackward, bringToFront, sendToBack } from 'ooxml-ui/pptx';
|
|
1
|
+
import { cloneTemplateElementsBySlideId, cloneSlide, cloneHistorySnapshot, MIN_ELEMENT_SIZE, ZOOM_TO_SELECTION_PADDING, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, partitionTemplateElements, isTemplateElementId, DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, comparePresentation, UNGROUPED_SECTION_ID, DEFAULT_SECTION_GROUP_ID, stopAllPersistentAudio, buildSaveSlides, MAX_ZOOM_SCALE, MIN_ZOOM_SCALE, getImageEffectsOpacity, getImageEffectsFilter, getImageRenderStyle, cn, isEditableTextElement, getShapeVisualStyle, getTextStyleForElement, DEFAULT_TEXT_COLOR, renderVectorShape, isConnectorOrLineElement, build3DExtrusionData, getImageSurfaceStyle, getTextLayoutStyle, renderTableElement, renderMediaElement, shouldRenderFallbackLabel, getElementLabel, normalizeHexColor, makeCloneId, DEFAULT_TEXT_FONT_SIZE, buildPdfFromTiledImageData, GRID_SIZE, copyFormatFromElement, hasCopyableFormat, isImageTiled, getDuotoneColors, DEFAULT_STROKE_COLOR, DEFAULT_FILL_COLOR, buildCssGradientFromShapeStyle, getCropShapeClipPath, getElementTransform, hasDagDuotoneEffect, renderDagDuotoneSvgFilter, getImageSurfaceMaskStyle, getTextWarpStyle, getTextCompensationTransform, renderTextSegments, buildReactChartViewModel, renderChartElement, buildInkGroupStrokes, getInkReplayStyles, INK_REPLAY_KEYFRAMES, buildContentPartStrokes, getContentPartReplayStyles, buildTextBody3DSceneStyle, rerouteConnectorsForMovedElements, applyReroutedConnectors, updateCellTextStyleInRawXml, updateCellTextInRawXml, splitCell, updateMergeAttrsInRawXml, mergeCells, buildNotesPdf, canvasToJpegData, applyFormatToElement, isPpactionUrl, parsePpactionUrl, getImageTilingStyle, buildCacheKey, DEFAULT_COLOR_CHANGE_TOLERANCE, getCachedResult, applyColorChange, setCachedResult, colorWithOpacity, normalizeStrokeDashType, getSvgStrokeDasharray, getCompoundLineOffsets, getCompoundLineWidths, getConnectorPathGeometry, buildLineShadowCss, buildLineGlowFilter, renderConnectorMarker, getAriaRoleDescription as getAriaRoleDescription$1, getAriaLabel as getAriaLabel$1, getAriaRole, DEFAULT_FONT_FAMILY, ACTION_BUTTON_PRESETS, isUrlSafe, computeSnapToShape, safeOpenUrl as safeOpenUrl$1, substituteFieldText, HYPERLINK_COLOR } from './chunk-BVQSH5SS.mjs';
|
|
2
|
+
import { defineThreeViewElement, MIN_TOUCH_TARGET_PX, computeVirtualRange, DEFAULT_VIRTUAL_OVERSCAN, createSyncGate, clearLocalAwareness, validateRoomId, createDepartureChannel, resolveTransportForServerUrl, isMixedContentBlocked, CONNECTION_TIMEOUT_MS, registerCollaborationTeardown, createPresenceProjector, BROADCAST_THROTTLE_MS, sanitizeColor, createWheelStepBuffer, createViewerZoomStore, clampZoomScale, mapEditingWheel, createActiveAnimationGroup, cancelBuildReveal, clearPlaybackTimers, PresentationAnimationController, resolveMediaTimeNodeElementIds, resolveMediaBookmarkTimesMs, advanceMainSequence, playGroup, PRESENTATION_HASH, PRESENTATION_NONCE_KEY, PRESENTATION_CHANNEL_NAME, swapPresentationWindows, PRESENTATION_MESSAGE_ORIGIN, clearAudienceContent, buildPresentationAudienceUrl, resolveAudienceScreenPlacement, placeAudienceWindow, storeAudienceContent, isPresentationSessionMessage, endAudienceDisplay, createPresentationKeyBuffer, acceptsPresentationInput, resolveAutoAdvanceDelayMs, resolveForwardSlideWithZoomReturn, buildZoomTransitionOverride, hasShowSlideAfter, nextShowSlideIndex, previousShowSlideIndex, beginZoomExcursion, createPresenterShowGuard, firstShowSlideIndex, attachPresentationVisibilityPause, presentationEntrySlideIndex, buildMorphTransitionPlan, morphOptionToMode, buildMorphAnimationRules, findInSlides, applyFindReplacements, visibleTemplateElements, createCollaborationLivePatcher, publishLiveInlineText, initialInspectorOpen, createPresentationLoadResources, collectMediaElements, resolveMediaElementSource, collectImagePaths, applyImagePathPatches, resolveTableCellImageUrls, resolveTableStyleImageUrls, resolveTextFillBlipUrls, seedRecentColors, resolveAuthoredCustomShowId, GlyphOutlineFontCache, buildInitialGuides, readOnlyRecommendation, compatibilityWarningToasts, resolveInitialSlideIndex, resolveAutosaveIntervalMs, shouldWriteAutosaveSnapshot, saveAutosaveSnapshot, autosaveSnapshotMark, updateMasterViewElement, updateElement, masterViewElements, replaceMasterViewElements, addSection, renameSection, deleteSection, moveSectionUp, moveSectionDown, moveSlidesToSection, canMergeShapes, canInteractWithElement, prepareHtml2CanvasClone, slideProgressPercent, slideStatusLabel, EXPORT_ASSEMBLING_PERCENT, EXPORT_DONE_PERCENT, isExportAbortError, DEFAULT_VIEWER_OPTIONS, resolveImageResolutionScale, applyAcceptSlide, applyAcceptAllSlides, collectUsedFonts, describeFontEmbedding, isMobileViewport, resolveAuthoredSlideRange, mayLeaveSlideShow, buildDeckSaveOptions, resolveSlideSizeSelection, saveDeckWithPassword, shouldProbeAutosaveRecovery, probeAutosaveRecovery, acceptAutosaveRecovery, acknowledgeAutosaveRecovery, discardAutosaveRecovery, shouldLoopContinuously, applyRehearsalTimings, rasterResultToPngBlob, downloadBlob, elementPictureFilename, canEditElementPoints, selectTrustedEmbeddedFonts, resolveFontWeight, resolveFontItalic, collectReferencedFontFamilies, resolveGoogleWebfontHref, syncGoogleWebfontStylesheet, selectGoogleWebfontFamilies, fetchGoogleWebfontOutlineBytes, isFeatureEnabled, mapSlideShowStartKey, mapCustomizedEditorKey, isEditorControlTarget, isEditorTextInputTarget, parentSelection, textFontSizePtToPx, stepFontSizePt, textFontSizePxToPt, cycleSelectableElement, createCustomizationController, prepareElementForInsertion, slideSpaceElement, autosaveStatusKind, createViewerOptionsStore, observeYDocSlides, LOCAL_SYNC_ORIGIN, readSlidesFromYDoc, shouldRoomSlidesReplaceLoad, reconcileSlidesInYDoc, shouldAutoFollowBroadcaster, detectTouchDevice, detectOrientation, deriveViewportBreakpoints, createTouchGestureRecognizer, isKeyboardOpen, scopeLayoutOptionsToSlide, checkModifyPassword, viewerPreferencesFromViewProperties, DEFAULT_VIEWER_PREFERENCES, viewPropertiesPatchFromPreferences, resolveCollaborationConfig, openPptxFile, readBackstageRecentFile, resolveCollaborationShellEditability, resolveCollaborationShellState, getResizeHandleHitAreaStyle, resolveElementInteractivity, getBackgroundAnimationState, getShapeEffectLayerPlacement, buildTextStyleOverrideCss, isElementRendered, resolveElementAriaAttributes, isMediaFullscreenActive, shouldRenderHitTarget, elementHitTargetStyle, getShapeEffectAnimationLayerStyle, inlineElementPointerEvents, isHollowShapeElement, LINK_TOOLTIP_HOST_CLASS, resolvePalette as resolvePalette$1, mediaTransportVisible, oleActionsVisible, getGroupChildParentFill, deviceStrokeStageStyle, MORPH_CROSSFADE_GROUP_STYLE, MORPH_CROSSFADE_HALF_STYLE, getSlideTransitionAnimations, getFragmentedTransitionDescriptor, SLIDE_TRANSITION_KEYFRAMES, elementIdSelector, createRotationDrag, isActionHidden, buildInlineTextCommitPatch, resolveInlineEditAutoFitHeight, resolveInlineEditNormAutofitShrink, setPendingCaretPoint, drillSelectionForDoubleClick, filterInteractableIds, beginShapeAdjustment, buildElementClipboardPayload, contextMenuInspectorAnchor, savedPresentationFileName, deliverSavedPresentation, exportDeckJson, groupElements, generateElementId, ungroupElements, alignElements, distributeElements, newTableElement, createDefaultChartElement, readViewportMetrics, computeKeyboardInset, planMergeShapes, applyMergeShapesPlan, mapPresentationKey, lastShowSlideIndex, mapPresentationWheel, openPendingPrintWindow, computeColorFilter, filterHiddenSlideIndices, computeSlideIndices, buildPrintDocument, finishPrintWindow, buildPrintHtmlDocument, buildOutlineHtml, buildSlidesHtml, buildNotesHtml, buildHandoutsHtml, createBlankSlide, insertSlidePaste, applySlidePasteTemplates, makeSlideId, buildSlideTemplateSlide, templateSchemeFromTheme, needsOwnedSession, openOwnedCollaboration, resolveViewportFitOptions, editorViewportFitFor, calculateViewportFit, observeViewportClientSize, scheduleAutoAdvanceChain, computeEntranceAnimationDelay, createPresentationSessionId, resolveTransitionDurationMs, resolveTransitionSoundAction, runPresentationAction, safeOpenUrl, buildRunProgramNotice, toggleStageElementMedia, resolveOleVerbTarget, downloadDataUrl, openUrlInNewTab, createPresenterTimer, createInitialPresentationSnapshot, mergePresentationSnapshot, resetPresenterTimer, presenterElapsed, stepPresenterZoom, togglePresenterTimer, addCommentToList, removeCommentFromList, editCommentInList, toggleCommentResolvedInList, slideSpaceMembers, remapTextToSegments, getInlineEditorSelectionResult, buildInlineListStylePatch, applyActiveInlineListFormatting, applyListStyleUpdate, setPendingSelectionRestore, applyTextStyleUpdate, toggleSelectionBullets, transformInlineListCase, applyCaseTransformToSegments, transformTextCase, resolveExportCaptureDecision, recordProgressPercent, computeGridSpacingPx as computeGridSpacingPx$1, resolveShowSlideIndexes, groupSlidesBySection, masterViewPseudoSlide, overlayMasterViewInlineSnapshot, overlayInlineTextSnapshot, rasterizeElement, cloneElementForPaste, applyPasteSpecialFormat, buildRasterPictureElement, cloneElementUpdates, assertElementUpdateTarget, prepareElementUpdateBatch, createWriteBackScheduler, writeBackReport, observeExternalCollaborationReadiness, resolveHistoryDepth, createBackstagePresentation, buildFieldSubstitutionContext, getImageColorWashStyle, attachRotateHandlePlacement, getSelectionControlArtworkStyle, getSelectionOutlineColor, paintedStrokeWidth, ensureActionAffordanceStyles, resolveElementActionAffordance, actionAffordanceLabels, paintedElementSize, MEDIA_FULLSCREEN_OVERLAY_STYLE, elementContainerHeightStyle, getAnimationOpacity, resolveElementHighlightClick, applyHighlightClickStyle, getComputedEffectStyle, getSoftEdgeSvgFilter, getEffectStyleSource, getBevelLightingSvgFilter, buildStrokeOutline, buildHollowHitOutline, buildSubpathFillOverlay, strokeOutlineViewBox, resolveRevealedSmartArtNodes, resolveRevealedDrawingShapes, buildSmartArtA11y, canDrillDown, computeSmartArtElementLayout, flattenNodes, buildSummaryZoomView, readEditableText, placeCaretAt, takePendingCaretPoint, getPendingSelectionRestore, restoreSegmentSelection, mapInlineTextFormatKey, mapInlineEditorChord, subscribeBarFacePicturePixelSamples, getBarFacePicturePixelSampleVersion, ensureChartInteractionStyles, applyChartPartHighlight, resolveRevealedChartData, formatAxisValue, chartFormatTargetFromEvent, resolveOleType, getOleAriaLabel, getOleTypeColor, getOleTypeLabel, filterRenderedElements, resolveGroupChildFill, isLinkedTextBox, getOverflowSegments, shouldUseSvgWarp, getTextBodyRotationTransform, placeholderPromptDescriptor, getAriaRoleDescription, getAriaLabel, TOOLBAR_TABS, isEnterableGroup, memberChainAtPoint, findElementPath, drillSelectionForClick, scrollInspectorSectionIntoView, computeScrollDelta, replyToCommentInList, removeTableElementColumn, insertTableElementColumn, removeTableElementRow, insertTableElementRow, withCellStyle, setCellText, pickSupportedMimeType, WEBM_MIME_CANDIDATES, fpsToFrameIntervalMs, segmentFrameCount, stopCaptureStream, GIF_POST_CAPTURE_MAX_SIDE, encodeGif, rasterizeElementTiles, placeTileOnPage, PDF_SLIDES_PAGE_WIDTH_PT, PDF_SLIDES_PAGE_HEIGHT_PT, createSnapshotTextPositions, resolvePresentationAction, getImageSvgFilters, getCachedNativeImageSize, probeNativeImageSize, buildDuotoneCacheKey, getDuotoneCachedResult, applyDuotone, setDuotoneCachedResult, svgLineCap, screenStrokeWidth, connectorWrapperTransform, ACTION_INDICATOR_CLASS, ACTION_INDICATOR_ICON_PATH, LINK_TOOLTIP_CLASS, LINK_TOOLTIP_PANEL_CLASS, LINK_TOOLTIP_LABEL_CLASS, LINK_TOOLTIP_HINT_CLASS, SMARTART_DEFAULT_PALETTE, computeDrawingViewBox, projectDrawingShapes, resolveRevealedDrawingShapeNodeIds, styleShadowFilter, buildChromeStyle, measureSvgViewportRect, modelDataToBlobUrl, resolveZoomNavigationTarget, inlineListBodyText, createInlineListSeed, readListActivationSelection, createInlineListModelObserver, attachCollaborationInlineEditor, bindInlineListParagraph, bindInlineListRun, attachInlineListController, restoreInlineListBodySelection, isBulletMarkerSegment, resolveChartThreeViewSpec, applyChart3DDrag, applyChart3DSelect, findChartPartTarget, withChartTitle, resolveSmartArtThreeViewSpec, isBrowserOpenableMime, formatBytes, getOleDisplayName, getOleBadgeLabel, hasGlyphEnvelope, buildGlyphEnvelopeBlock, getWarpPath, isWedgeCalloutPresetShape, getAriaRole as getAriaRole$1, isElementActionable, buildSmartArtPresetData, classifyMediaType, publishLiveGeometry, getDraggedShapeAdjustments, computeMarqueeHitIds, mergeAdditiveSelection, rasterizeElementTiledToCanvas, borrowExternalCollaborationAwareness, observeExternalCollaborationSession, clampGifDimensions, rasterResultToPngDataUrl, shouldConfirmExternalHyperlink, centeredSvgTextLines, findSmartArtNodeText, rebuildDrawingShapesIfCleared, shouldCommitSmartArtNodeText, advanceChartMarkDrag, advanceChartValueDrag, resolveChartKind, buildChartMarkDragGeometry, beginChartMarkDrag, beginChartValueDrag, commitSmartArtNodeFill, commitSmartArtNodeText, groupIntoParagraphs as groupIntoParagraphs$1, createGlyphOutlineLookup, applyResize, lockResizeAspect, snapBoxToGrid, applyMotionPathPreset, computeInlineEditorRect, smartArtNodeAtPoint, bringForward, sendBackward, bringToFront, sendToBack } from 'ooxml-ui/pptx';
|
|
3
3
|
export { DUOTONE_PRESETS, MOBILE_BREAKPOINT, SLIDE_TRANSITION_KEYFRAMES, TABLET_BREAKPOINT, clearAudienceContent, computeVirtualRange, downloadBlob, getSlideTransitionAnimations, loadAudienceContent, storeAudienceContent } from 'ooxml-ui/pptx';
|
|
4
|
-
import React17, {
|
|
5
|
-
import {
|
|
4
|
+
import React17, { useRef, useState, useCallback, useEffect, useMemo, useContext, useLayoutEffect, createContext, useImperativeHandle, useSyncExternalStore, Suspense } from 'react';
|
|
5
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
|
+
import { PptxHandler, EncryptedFileError, hasShapeProperties, applyThemeToData, THEME_PRESETS, themeColorSchemesEqual, guidePxToEmu, hasTextProperties, isInkElement, duplicateSlide, buildThemeColorMap, reResolveSlideColors, reResolveElementColors, isImageLikeElement, SvgExporter, reResolveElementFonts, getSubstituteFontFamily, elementActionToPptxAction, setSmartArtNodeStyle, updateSmartArtNodeText } from 'ooxml-core/pptx';
|
|
6
7
|
import { translationsEn } from 'ooxml-ui/pptx/i18n';
|
|
7
8
|
import { useTranslation } from 'react-i18next';
|
|
8
9
|
import { flushSync } from 'react-dom';
|
|
@@ -125,7 +126,7 @@ function useYjsProvider({ config: inputConfig }) {
|
|
|
125
126
|
}
|
|
126
127
|
setStatus("connecting");
|
|
127
128
|
try {
|
|
128
|
-
const [Y, { WebrtcProvider }] = await Promise.all([import('yjs'), import('./y-webrtc-
|
|
129
|
+
const [Y, { WebrtcProvider }] = await Promise.all([import('yjs'), import('./y-webrtc-2H7UYAQD.mjs')]);
|
|
129
130
|
if (generation !== generationRef.current) {
|
|
130
131
|
return;
|
|
131
132
|
}
|
|
@@ -200,7 +201,7 @@ function useYjsProvider({ config: inputConfig }) {
|
|
|
200
201
|
}
|
|
201
202
|
setStatus("connecting");
|
|
202
203
|
try {
|
|
203
|
-
const [Y, { WebsocketProvider }] = await Promise.all([import('yjs'), import('./y-websocket-
|
|
204
|
+
const [Y, { WebsocketProvider }] = await Promise.all([import('yjs'), import('./y-websocket-WORVRRQS.mjs')]);
|
|
204
205
|
if (generation !== generationRef.current) {
|
|
205
206
|
return;
|
|
206
207
|
}
|
|
@@ -596,7 +597,7 @@ function useCollaborativeState({
|
|
|
596
597
|
]
|
|
597
598
|
);
|
|
598
599
|
}
|
|
599
|
-
var CollaborationContext = createContext(null);
|
|
600
|
+
var CollaborationContext = /* @__PURE__ */ createContext(null);
|
|
600
601
|
function useCollaboration() {
|
|
601
602
|
return useContext(CollaborationContext);
|
|
602
603
|
}
|
|
@@ -1081,6 +1082,7 @@ function useViewerStore(store, selector, isEqual = Object.is) {
|
|
|
1081
1082
|
);
|
|
1082
1083
|
return useSyncExternalStore(subscribe2, getSnapshot2, getSnapshot2);
|
|
1083
1084
|
}
|
|
1085
|
+
var useBeforePaintEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
|
|
1084
1086
|
function useViewportFit(canvasSize, viewportRef, options, viewportNode) {
|
|
1085
1087
|
const [editorDimensions, setEditorDimensions] = useState(null);
|
|
1086
1088
|
const { maxFitScale } = resolveViewportFitOptions(options, editorViewportFitFor(Infinity));
|
|
@@ -1093,22 +1095,22 @@ function useViewportFit(canvasSize, viewportRef, options, viewportNode) {
|
|
|
1093
1095
|
canvasHeight: canvasSize.height,
|
|
1094
1096
|
maxFitScale
|
|
1095
1097
|
});
|
|
1096
|
-
|
|
1098
|
+
useBeforePaintEffect(() => {
|
|
1097
1099
|
if (viewportNode === null) {
|
|
1098
1100
|
return;
|
|
1099
1101
|
}
|
|
1100
|
-
let
|
|
1102
|
+
let stopObserving = null;
|
|
1101
1103
|
let raf = 0;
|
|
1102
|
-
const measure = (
|
|
1104
|
+
const measure = (client) => {
|
|
1103
1105
|
const { availableWidth: width, availableHeight: height } = calculateViewportFit({
|
|
1104
|
-
viewportWidth:
|
|
1105
|
-
viewportHeight:
|
|
1106
|
+
viewportWidth: client.width,
|
|
1107
|
+
viewportHeight: client.height,
|
|
1106
1108
|
canvasWidth: canvasSize.width,
|
|
1107
1109
|
canvasHeight: canvasSize.height,
|
|
1108
1110
|
// The host's padding when it gave one, else the width-aware editor default.
|
|
1109
1111
|
...resolveViewportFitOptions(
|
|
1110
1112
|
{ fitPadding: hostPadding },
|
|
1111
|
-
editorViewportFitFor(
|
|
1113
|
+
editorViewportFitFor(client.width)
|
|
1112
1114
|
)
|
|
1113
1115
|
});
|
|
1114
1116
|
if (width > 0 && height > 0) {
|
|
@@ -1121,14 +1123,12 @@ function useViewportFit(canvasSize, viewportRef, options, viewportNode) {
|
|
|
1121
1123
|
raf = requestAnimationFrame(attach);
|
|
1122
1124
|
return;
|
|
1123
1125
|
}
|
|
1124
|
-
|
|
1125
|
-
observer.observe(element);
|
|
1126
|
-
measure(element);
|
|
1126
|
+
stopObserving = observeViewportClientSize(element, measure);
|
|
1127
1127
|
};
|
|
1128
1128
|
attach();
|
|
1129
1129
|
return () => {
|
|
1130
1130
|
cancelAnimationFrame(raf);
|
|
1131
|
-
|
|
1131
|
+
stopObserving?.();
|
|
1132
1132
|
};
|
|
1133
1133
|
}, [viewportRef, viewportNode, canvasSize.width, canvasSize.height, hostPadding]);
|
|
1134
1134
|
return { editorDimensions, setEditorDimensions, effectiveEditorDimensions, fitScale };
|
|
@@ -4532,8 +4532,8 @@ function useViewerState(input) {
|
|
|
4532
4532
|
const crop = useCropSessionState();
|
|
4533
4533
|
return { ...core, ...ui, ...crop };
|
|
4534
4534
|
}
|
|
4535
|
-
var glyphOutlineFontCache = new GlyphOutlineFontCache();
|
|
4536
|
-
var getGlyphOutline = createGlyphOutlineLookup(glyphOutlineFontCache);
|
|
4535
|
+
var glyphOutlineFontCache = /* @__PURE__ */ new GlyphOutlineFontCache();
|
|
4536
|
+
var getGlyphOutline = /* @__PURE__ */ createGlyphOutlineLookup(glyphOutlineFontCache);
|
|
4537
4537
|
|
|
4538
4538
|
// src/viewer/hooks/useLoadContent.ts
|
|
4539
4539
|
function useLoadContent({
|
|
@@ -4596,7 +4596,7 @@ function useLoadContent({
|
|
|
4596
4596
|
}
|
|
4597
4597
|
let cancelled = false;
|
|
4598
4598
|
const token = ++renderTokenRef.current;
|
|
4599
|
-
const handler = new
|
|
4599
|
+
const handler = new PptxHandler();
|
|
4600
4600
|
const resources = createPresentationLoadResources(handler);
|
|
4601
4601
|
const loadBlobUrls = resources.blobUrls;
|
|
4602
4602
|
(async () => {
|
|
@@ -4750,7 +4750,7 @@ function useLoadContent({
|
|
|
4750
4750
|
onContentApplied?.();
|
|
4751
4751
|
} catch (err) {
|
|
4752
4752
|
if (!cancelled && token === renderTokenRef.current) {
|
|
4753
|
-
if (err instanceof
|
|
4753
|
+
if (err instanceof EncryptedFileError) {
|
|
4754
4754
|
setIsEncrypted(true);
|
|
4755
4755
|
} else {
|
|
4756
4756
|
console.error("[pptx] Failed to load presentation content:", err);
|
|
@@ -4789,9 +4789,15 @@ function useAutosave(input) {
|
|
|
4789
4789
|
const isDirtyRef = useRef(isDirty);
|
|
4790
4790
|
const filePathRef = useRef(filePath);
|
|
4791
4791
|
const serializeRef = useRef(serializeSlides);
|
|
4792
|
+
const storageRef = useRef(input.storage);
|
|
4793
|
+
storageRef.current = input.storage;
|
|
4792
4794
|
const isSavingRef = useRef(false);
|
|
4793
4795
|
const changeSourcesRef = useRef(getChangeSources);
|
|
4794
4796
|
const lastSnapshotRef = useRef(void 0);
|
|
4797
|
+
const onSavedRef = useRef(input.onSaved);
|
|
4798
|
+
useEffect(() => {
|
|
4799
|
+
onSavedRef.current = input.onSaved;
|
|
4800
|
+
}, [input.onSaved]);
|
|
4795
4801
|
useEffect(() => {
|
|
4796
4802
|
isDirtyRef.current = isDirty;
|
|
4797
4803
|
}, [isDirty]);
|
|
@@ -4828,9 +4834,10 @@ function useAutosave(input) {
|
|
|
4828
4834
|
isSavingRef.current = false;
|
|
4829
4835
|
return;
|
|
4830
4836
|
}
|
|
4831
|
-
await saveAutosaveSnapshot(path, data);
|
|
4837
|
+
await saveAutosaveSnapshot(path, data, storageRef.current);
|
|
4832
4838
|
lastSnapshotRef.current = autosaveSnapshotMark(path, sources);
|
|
4833
4839
|
setAutosaveStatus({ state: "saved", timestamp: Date.now() });
|
|
4840
|
+
onSavedRef.current?.(data);
|
|
4834
4841
|
} catch (err) {
|
|
4835
4842
|
setAutosaveStatus({
|
|
4836
4843
|
state: "error",
|
|
@@ -4875,7 +4882,7 @@ function useTextElementOperations(input) {
|
|
|
4875
4882
|
updateSelectedElement
|
|
4876
4883
|
} = input;
|
|
4877
4884
|
const liveTextSegments = useCallback(() => {
|
|
4878
|
-
if (!selectedElement || !
|
|
4885
|
+
if (!selectedElement || !hasTextProperties(selectedElement)) {
|
|
4879
4886
|
return void 0;
|
|
4880
4887
|
}
|
|
4881
4888
|
if (selectedElement.id !== inlineEditingElementId) {
|
|
@@ -4893,7 +4900,7 @@ function useTextElementOperations(input) {
|
|
|
4893
4900
|
}, [selectedElement, inlineEditingElementId, inlineEditingText, inlineEditingSnapshotRef]);
|
|
4894
4901
|
const updateSelectedTextStyle = useCallback(
|
|
4895
4902
|
(updates) => {
|
|
4896
|
-
if (!selectedElement || !
|
|
4903
|
+
if (!selectedElement || !hasTextProperties(selectedElement)) {
|
|
4897
4904
|
return;
|
|
4898
4905
|
}
|
|
4899
4906
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
@@ -4971,7 +4978,7 @@ function useTextElementOperations(input) {
|
|
|
4971
4978
|
);
|
|
4972
4979
|
const toggleSelectedBullets = useCallback(
|
|
4973
4980
|
(kind) => {
|
|
4974
|
-
if (!selectedElement || !
|
|
4981
|
+
if (!selectedElement || !hasTextProperties(selectedElement)) {
|
|
4975
4982
|
return;
|
|
4976
4983
|
}
|
|
4977
4984
|
const currentSegments = liveTextSegments();
|
|
@@ -5022,7 +5029,7 @@ function useTextElementOperations(input) {
|
|
|
5022
5029
|
);
|
|
5023
5030
|
const updateSelectedTextCase = useCallback(
|
|
5024
5031
|
(mode) => {
|
|
5025
|
-
if (!selectedElement || !
|
|
5032
|
+
if (!selectedElement || !hasTextProperties(selectedElement)) {
|
|
5026
5033
|
return;
|
|
5027
5034
|
}
|
|
5028
5035
|
const isLiveEditing = selectedElement.id === inlineEditingElementId;
|
|
@@ -5174,7 +5181,7 @@ function useElementOperations(input) {
|
|
|
5174
5181
|
);
|
|
5175
5182
|
const updateSelectedShapeStyle = useCallback(
|
|
5176
5183
|
(updates) => {
|
|
5177
|
-
if (!selectedElement || !
|
|
5184
|
+
if (!selectedElement || !hasShapeProperties(selectedElement)) {
|
|
5178
5185
|
return;
|
|
5179
5186
|
}
|
|
5180
5187
|
updateSelectedElement({
|
|
@@ -5914,7 +5921,7 @@ function useCanvasInteractions(input) {
|
|
|
5914
5921
|
return;
|
|
5915
5922
|
}
|
|
5916
5923
|
const el = elementLookup.get(editId);
|
|
5917
|
-
if (el &&
|
|
5924
|
+
if (el && hasTextProperties(el)) {
|
|
5918
5925
|
const reader = inlineEditingReaderRef?.current;
|
|
5919
5926
|
const read = reader?.elementId === editId ? reader.read() : void 0;
|
|
5920
5927
|
if (read?.kind === "unsupported") {
|
|
@@ -5961,7 +5968,7 @@ function useCanvasInteractions(input) {
|
|
|
5961
5968
|
wasEditable.current = canEdit;
|
|
5962
5969
|
}, [canEdit]);
|
|
5963
5970
|
const openEquationEditorForElement = (el) => {
|
|
5964
|
-
if (!
|
|
5971
|
+
if (!hasTextProperties(el)) {
|
|
5965
5972
|
return false;
|
|
5966
5973
|
}
|
|
5967
5974
|
const eqSeg = el.textSegments?.find((seg) => seg.equationXml);
|
|
@@ -5994,7 +6001,7 @@ function useCanvasInteractions(input) {
|
|
|
5994
6001
|
justInteractedRef.current = false;
|
|
5995
6002
|
} else {
|
|
5996
6003
|
const el = elementLookup.get(elementId);
|
|
5997
|
-
if (el &&
|
|
6004
|
+
if (el && hasTextProperties(el) && canInteractWithElement(el, "textEdit")) {
|
|
5998
6005
|
if (!openEquationEditorForElement(el)) {
|
|
5999
6006
|
setPendingCaretPoint(e);
|
|
6000
6007
|
setInlineEditingElementId(elementId);
|
|
@@ -6020,7 +6027,7 @@ function useCanvasInteractions(input) {
|
|
|
6020
6027
|
if (openEquationEditorForElement(el)) {
|
|
6021
6028
|
return;
|
|
6022
6029
|
}
|
|
6023
|
-
if (
|
|
6030
|
+
if (hasTextProperties(el) && canInteractWithElement(el, "textEdit")) {
|
|
6024
6031
|
setInlineEditingElementId(elementId);
|
|
6025
6032
|
setInlineEditingText(el.text ?? "");
|
|
6026
6033
|
}
|
|
@@ -6535,7 +6542,7 @@ function createStructuredElementHandlers(deps) {
|
|
|
6535
6542
|
if (!preset) {
|
|
6536
6543
|
return;
|
|
6537
6544
|
}
|
|
6538
|
-
const defaultPptxAction =
|
|
6545
|
+
const defaultPptxAction = elementActionToPptxAction({
|
|
6539
6546
|
trigger: "click",
|
|
6540
6547
|
type: preset.defaultAction
|
|
6541
6548
|
});
|
|
@@ -7182,7 +7189,7 @@ function useSlideManagement(input) {
|
|
|
7182
7189
|
if (!src) {
|
|
7183
7190
|
continue;
|
|
7184
7191
|
}
|
|
7185
|
-
const clone = { ...
|
|
7192
|
+
const clone = { ...duplicateSlide(src, next.length + 1), id: makeSlideId() };
|
|
7186
7193
|
next.splice(i + offset + 1, 0, clone);
|
|
7187
7194
|
offset++;
|
|
7188
7195
|
}
|
|
@@ -7294,7 +7301,7 @@ function createTableMergeHandlers(input) {
|
|
|
7294
7301
|
td
|
|
7295
7302
|
);
|
|
7296
7303
|
const updates = { tableData: newTableData };
|
|
7297
|
-
const newRawXml =
|
|
7304
|
+
const newRawXml = updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
7298
7305
|
if (newRawXml) {
|
|
7299
7306
|
updates.rawXml = newRawXml;
|
|
7300
7307
|
}
|
|
@@ -7328,7 +7335,7 @@ function createTableMergeHandlers(input) {
|
|
|
7328
7335
|
td
|
|
7329
7336
|
);
|
|
7330
7337
|
const updates = { tableData: newTableData };
|
|
7331
|
-
const newRawXml =
|
|
7338
|
+
const newRawXml = updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
7332
7339
|
if (newRawXml) {
|
|
7333
7340
|
updates.rawXml = newRawXml;
|
|
7334
7341
|
}
|
|
@@ -7345,7 +7352,7 @@ function createTableMergeHandlers(input) {
|
|
|
7345
7352
|
const td = selectedElement.tableData;
|
|
7346
7353
|
const newTableData = mergeCells(ts.selectedCells, td);
|
|
7347
7354
|
const updates = { tableData: newTableData };
|
|
7348
|
-
const newRawXml =
|
|
7355
|
+
const newRawXml = updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
7349
7356
|
if (newRawXml) {
|
|
7350
7357
|
updates.rawXml = newRawXml;
|
|
7351
7358
|
}
|
|
@@ -7364,7 +7371,7 @@ function createTableMergeHandlers(input) {
|
|
|
7364
7371
|
const td = selectedElement.tableData;
|
|
7365
7372
|
const newTableData = splitCell(rowIndex, columnIndex, td);
|
|
7366
7373
|
const updates = { tableData: newTableData };
|
|
7367
|
-
const newRawXml =
|
|
7374
|
+
const newRawXml = updateMergeAttrsInRawXml(selectedElement, newTableData);
|
|
7368
7375
|
if (newRawXml) {
|
|
7369
7376
|
updates.rawXml = newRawXml;
|
|
7370
7377
|
}
|
|
@@ -7399,7 +7406,7 @@ function createTableStructHandlers(input) {
|
|
|
7399
7406
|
updates.tableData = setCellText(el, rowIndex, colIndex, text).tableData;
|
|
7400
7407
|
}
|
|
7401
7408
|
if (el.rawXml) {
|
|
7402
|
-
const newRawXml =
|
|
7409
|
+
const newRawXml = updateCellTextInRawXml(el, rowIndex, colIndex, text);
|
|
7403
7410
|
if (newRawXml) {
|
|
7404
7411
|
updates.rawXml = newRawXml;
|
|
7405
7412
|
}
|
|
@@ -7423,7 +7430,7 @@ function createTableStructHandlers(input) {
|
|
|
7423
7430
|
const { rowIndex, columnIndex: colIndex } = ts;
|
|
7424
7431
|
const updates = {};
|
|
7425
7432
|
if (selectedElement.rawXml) {
|
|
7426
|
-
const newRawXml =
|
|
7433
|
+
const newRawXml = updateCellTextStyleInRawXml(
|
|
7427
7434
|
selectedElement,
|
|
7428
7435
|
rowIndex,
|
|
7429
7436
|
colIndex,
|
|
@@ -7557,6 +7564,8 @@ function useExportSaveAs(input) {
|
|
|
7557
7564
|
slides,
|
|
7558
7565
|
templateElementsBySlideId,
|
|
7559
7566
|
filePath,
|
|
7567
|
+
storage,
|
|
7568
|
+
onSaveError,
|
|
7560
7569
|
serializeSlides,
|
|
7561
7570
|
headerFooter,
|
|
7562
7571
|
presentationProperties,
|
|
@@ -7572,18 +7581,25 @@ function useExportSaveAs(input) {
|
|
|
7572
7581
|
canvasSize,
|
|
7573
7582
|
slideSizeEmu
|
|
7574
7583
|
} = input;
|
|
7575
|
-
const handleSaveAsFormat = async (format) => {
|
|
7584
|
+
const handleSaveAsFormat = async (format, reason = "saveAs") => {
|
|
7576
7585
|
const downloadName = savedPresentationFileName(filePath, format);
|
|
7577
7586
|
try {
|
|
7578
7587
|
const data = await serializeSlides(format);
|
|
7579
7588
|
if (!data) {
|
|
7580
|
-
return;
|
|
7589
|
+
return false;
|
|
7581
7590
|
}
|
|
7582
|
-
|
|
7583
|
-
|
|
7584
|
-
|
|
7591
|
+
await deliverSavedPresentation({
|
|
7592
|
+
storage,
|
|
7593
|
+
bytes: data,
|
|
7594
|
+
format,
|
|
7595
|
+
fileName: downloadName,
|
|
7596
|
+
reason
|
|
7597
|
+
});
|
|
7598
|
+
return true;
|
|
7585
7599
|
} catch (err) {
|
|
7586
7600
|
console.error(`[PowerPointViewer] Save as .${format} failed:`, err);
|
|
7601
|
+
onSaveError?.(err);
|
|
7602
|
+
return false;
|
|
7587
7603
|
}
|
|
7588
7604
|
};
|
|
7589
7605
|
const handleExportJson = () => {
|
|
@@ -7614,6 +7630,9 @@ function useExportSaveAs(input) {
|
|
|
7614
7630
|
console.error("[PowerPointViewer] JSON export failed:", err);
|
|
7615
7631
|
}
|
|
7616
7632
|
};
|
|
7633
|
+
const handleSave = () => {
|
|
7634
|
+
void handleSaveAsFormat("pptx", "save");
|
|
7635
|
+
};
|
|
7617
7636
|
const handleSaveAsPptx = () => {
|
|
7618
7637
|
void handleSaveAsFormat("pptx");
|
|
7619
7638
|
};
|
|
@@ -7629,6 +7648,7 @@ function useExportSaveAs(input) {
|
|
|
7629
7648
|
return {
|
|
7630
7649
|
handleExportJson,
|
|
7631
7650
|
handleSaveAsFormat,
|
|
7651
|
+
handleSave,
|
|
7632
7652
|
handleSaveAsPptx,
|
|
7633
7653
|
handleSaveAsPpsx,
|
|
7634
7654
|
handleSaveAsPptm,
|
|
@@ -7958,8 +7978,6 @@ async function exportAllSlidesAsGif(slideStageRef, totalSlides, setActiveSlide,
|
|
|
7958
7978
|
new Uint8Array(buf).set(gifBytes);
|
|
7959
7979
|
return new Blob([buf], { type: "image/gif" });
|
|
7960
7980
|
}
|
|
7961
|
-
|
|
7962
|
-
// src/viewer/utils/export-svg.ts
|
|
7963
7981
|
function injectFontFaces(svg, fontFaces) {
|
|
7964
7982
|
if (!fontFaces.length) {
|
|
7965
7983
|
return svg;
|
|
@@ -8006,7 +8024,7 @@ function exportAllSlidesToSvg(data, options = {}) {
|
|
|
8006
8024
|
continue;
|
|
8007
8025
|
}
|
|
8008
8026
|
onProgress?.(processedCount, data.slides.length);
|
|
8009
|
-
let svg =
|
|
8027
|
+
let svg = SvgExporter.exportSlide(slide, data.width, data.height, svgOptions);
|
|
8010
8028
|
if (embedFonts && fontFaces?.length) {
|
|
8011
8029
|
svg = injectFontFaces(svg, fontFaces);
|
|
8012
8030
|
}
|
|
@@ -8236,6 +8254,8 @@ function useExportHandlers(input) {
|
|
|
8236
8254
|
activeSlide,
|
|
8237
8255
|
activeSlideIndex,
|
|
8238
8256
|
filePath,
|
|
8257
|
+
storage,
|
|
8258
|
+
onSaveError,
|
|
8239
8259
|
canvasStageRef,
|
|
8240
8260
|
setActiveSlideIndex,
|
|
8241
8261
|
serializeSlides,
|
|
@@ -8289,6 +8309,7 @@ function useExportHandlers(input) {
|
|
|
8289
8309
|
const {
|
|
8290
8310
|
handleExportJson,
|
|
8291
8311
|
handleSaveAsFormat,
|
|
8312
|
+
handleSave,
|
|
8292
8313
|
handleSaveAsPptx,
|
|
8293
8314
|
handleSaveAsPpsx,
|
|
8294
8315
|
handleSaveAsPptm,
|
|
@@ -8297,6 +8318,8 @@ function useExportHandlers(input) {
|
|
|
8297
8318
|
slides,
|
|
8298
8319
|
templateElementsBySlideId,
|
|
8299
8320
|
filePath,
|
|
8321
|
+
storage,
|
|
8322
|
+
onSaveError,
|
|
8300
8323
|
serializeSlides,
|
|
8301
8324
|
headerFooter,
|
|
8302
8325
|
presentationProperties,
|
|
@@ -8397,6 +8420,7 @@ function useExportHandlers(input) {
|
|
|
8397
8420
|
handleExportGif,
|
|
8398
8421
|
handleExportJson,
|
|
8399
8422
|
handleSaveAsFormat,
|
|
8423
|
+
handleSave,
|
|
8400
8424
|
handleSaveAsPptx,
|
|
8401
8425
|
handleSaveAsPpsx,
|
|
8402
8426
|
handleSaveAsPptm,
|
|
@@ -8408,8 +8432,10 @@ function useExportHandlers(input) {
|
|
|
8408
8432
|
exportStatusMessage
|
|
8409
8433
|
};
|
|
8410
8434
|
}
|
|
8411
|
-
var ViewerOptionsContext = createContext(DEFAULT_VIEWER_OPTIONS);
|
|
8412
|
-
var ViewerOptionsStoreContext = createContext(
|
|
8435
|
+
var ViewerOptionsContext = /* @__PURE__ */ createContext(DEFAULT_VIEWER_OPTIONS);
|
|
8436
|
+
var ViewerOptionsStoreContext = /* @__PURE__ */ createContext(
|
|
8437
|
+
null
|
|
8438
|
+
);
|
|
8413
8439
|
function useViewerOptionsContext() {
|
|
8414
8440
|
return useContext(ViewerOptionsContext);
|
|
8415
8441
|
}
|
|
@@ -8578,8 +8604,6 @@ function usePrintHandlers(input) {
|
|
|
8578
8604
|
setIsPrintDialogOpen
|
|
8579
8605
|
};
|
|
8580
8606
|
}
|
|
8581
|
-
|
|
8582
|
-
// src/viewer/hooks/theme-editor-apply.ts
|
|
8583
8607
|
async function applyThemeEditorEdit(input, { colorScheme, fontScheme, name }) {
|
|
8584
8608
|
const {
|
|
8585
8609
|
handlerRef,
|
|
@@ -8595,10 +8619,10 @@ async function applyThemeEditorEdit(input, { colorScheme, fontScheme, name }) {
|
|
|
8595
8619
|
return;
|
|
8596
8620
|
}
|
|
8597
8621
|
await handler.applyTheme(colorScheme, fontScheme, name);
|
|
8598
|
-
const previousMap = theme?.colorScheme ?
|
|
8622
|
+
const previousMap = theme?.colorScheme ? buildThemeColorMap(theme.colorScheme) : {};
|
|
8599
8623
|
bumpHistory();
|
|
8600
8624
|
setSlides(
|
|
8601
|
-
(slides) =>
|
|
8625
|
+
(slides) => applyThemeToData(
|
|
8602
8626
|
{ slides, theme, themeColorMap: previousMap },
|
|
8603
8627
|
colorScheme,
|
|
8604
8628
|
fontScheme,
|
|
@@ -8609,8 +8633,8 @@ async function applyThemeEditorEdit(input, { colorScheme, fontScheme, name }) {
|
|
|
8609
8633
|
(prev) => Object.fromEntries(
|
|
8610
8634
|
Object.entries(prev).map(([id, elements]) => [
|
|
8611
8635
|
id,
|
|
8612
|
-
|
|
8613
|
-
|
|
8636
|
+
reResolveElementFonts(
|
|
8637
|
+
reResolveElementColors(elements, previousMap, colorScheme),
|
|
8614
8638
|
theme?.fontScheme,
|
|
8615
8639
|
fontScheme
|
|
8616
8640
|
)
|
|
@@ -8668,13 +8692,13 @@ function useThemeHandlers(input) {
|
|
|
8668
8692
|
return;
|
|
8669
8693
|
}
|
|
8670
8694
|
await handler.updateThemeColorScheme(colorScheme);
|
|
8671
|
-
const previousMap = theme?.colorScheme ?
|
|
8672
|
-
setSlides((prev) =>
|
|
8695
|
+
const previousMap = theme?.colorScheme ? buildThemeColorMap(theme.colorScheme) : {};
|
|
8696
|
+
setSlides((prev) => reResolveSlideColors(prev, previousMap, colorScheme));
|
|
8673
8697
|
if (Object.keys(templateElementsBySlideId).length > 0) {
|
|
8674
8698
|
setTemplateElementsBySlideId((prev) => {
|
|
8675
8699
|
const next = {};
|
|
8676
8700
|
for (const [slideId, elements] of Object.entries(prev)) {
|
|
8677
|
-
next[slideId] =
|
|
8701
|
+
next[slideId] = reResolveElementColors(elements, previousMap, colorScheme);
|
|
8678
8702
|
}
|
|
8679
8703
|
return next;
|
|
8680
8704
|
});
|
|
@@ -8785,7 +8809,7 @@ function useThemeSwitching(input) {
|
|
|
8785
8809
|
}
|
|
8786
8810
|
try {
|
|
8787
8811
|
await handler.applyTheme(preset.colorScheme, preset.fontScheme, preset.name);
|
|
8788
|
-
const newData =
|
|
8812
|
+
const newData = applyThemeToData(data, preset.colorScheme, preset.fontScheme, preset.name);
|
|
8789
8813
|
onDataChange(newData);
|
|
8790
8814
|
onThemeChanged?.(preset);
|
|
8791
8815
|
} catch (error) {
|
|
@@ -8802,7 +8826,7 @@ function useThemeSwitching(input) {
|
|
|
8802
8826
|
}
|
|
8803
8827
|
try {
|
|
8804
8828
|
await handler.applyTheme(colorScheme, fontScheme ?? {}, themeName);
|
|
8805
|
-
const newData =
|
|
8829
|
+
const newData = applyThemeToData(data, colorScheme, fontScheme, themeName);
|
|
8806
8830
|
onDataChange(newData);
|
|
8807
8831
|
} catch (error) {
|
|
8808
8832
|
console.error("Failed to switch to custom theme:", error);
|
|
@@ -8814,12 +8838,12 @@ function useThemeSwitching(input) {
|
|
|
8814
8838
|
if (!data?.theme?.colorScheme) {
|
|
8815
8839
|
return void 0;
|
|
8816
8840
|
}
|
|
8817
|
-
return
|
|
8818
|
-
(p) =>
|
|
8841
|
+
return THEME_PRESETS.find(
|
|
8842
|
+
(p) => themeColorSchemesEqual(data.theme?.colorScheme, p.colorScheme)
|
|
8819
8843
|
);
|
|
8820
8844
|
}, [data?.theme?.colorScheme]);
|
|
8821
8845
|
return {
|
|
8822
|
-
presets:
|
|
8846
|
+
presets: THEME_PRESETS,
|
|
8823
8847
|
switchToPreset,
|
|
8824
8848
|
switchToCustom,
|
|
8825
8849
|
currentPreset
|
|
@@ -8840,7 +8864,9 @@ function usePropertyHandlers(input) {
|
|
|
8840
8864
|
setSlides,
|
|
8841
8865
|
setIsDirty,
|
|
8842
8866
|
ops,
|
|
8843
|
-
history
|
|
8867
|
+
history,
|
|
8868
|
+
onPropertiesChange,
|
|
8869
|
+
onNotesUpdate
|
|
8844
8870
|
} = input;
|
|
8845
8871
|
const [isVersionHistoryOpen, setIsVersionHistoryOpen] = useState(false);
|
|
8846
8872
|
const [isComparePanelOpen, setIsComparePanelOpen] = useState(false);
|
|
@@ -8856,6 +8882,7 @@ function usePropertyHandlers(input) {
|
|
|
8856
8882
|
)
|
|
8857
8883
|
);
|
|
8858
8884
|
history.markDirty();
|
|
8885
|
+
onNotesUpdate?.(text);
|
|
8859
8886
|
};
|
|
8860
8887
|
const handleUpdateSlide = (updates) => {
|
|
8861
8888
|
ops.updateSlides(
|
|
@@ -8870,6 +8897,7 @@ function usePropertyHandlers(input) {
|
|
|
8870
8897
|
const handleUpdateCoreProperties = (updates) => {
|
|
8871
8898
|
setCoreProperties((prev) => ({ ...prev, ...updates }));
|
|
8872
8899
|
history.markDirty();
|
|
8900
|
+
onPropertiesChange?.(updates);
|
|
8873
8901
|
};
|
|
8874
8902
|
const handleUpdateAppProperties = (updates) => {
|
|
8875
8903
|
setAppProperties((prev) => ({ ...prev, ...updates }));
|
|
@@ -8896,7 +8924,7 @@ function usePropertyHandlers(input) {
|
|
|
8896
8924
|
}
|
|
8897
8925
|
try {
|
|
8898
8926
|
const ab = await file.arrayBuffer();
|
|
8899
|
-
const h = new
|
|
8927
|
+
const h = new PptxHandler();
|
|
8900
8928
|
const other = await h.load(ab);
|
|
8901
8929
|
if (!other) {
|
|
8902
8930
|
return;
|
|
@@ -9504,7 +9532,7 @@ function overlayPendingInlineEdit(document2, elementId, text, snapshot, transfor
|
|
|
9504
9532
|
(slide) => !elementId ? slide : {
|
|
9505
9533
|
...slide,
|
|
9506
9534
|
elements: slide.elements.map(
|
|
9507
|
-
(element) => element.id === elementId &&
|
|
9535
|
+
(element) => element.id === elementId && hasTextProperties(element) ? {
|
|
9508
9536
|
...element,
|
|
9509
9537
|
text,
|
|
9510
9538
|
textSegments: remapTextToSegments(
|
|
@@ -9593,7 +9621,7 @@ function useSerialize(input) {
|
|
|
9593
9621
|
const pptxGuides = guides.map((g) => ({
|
|
9594
9622
|
id: g.id,
|
|
9595
9623
|
orientation: g.axis === "h" ? "horz" : "vert",
|
|
9596
|
-
positionEmu:
|
|
9624
|
+
positionEmu: guidePxToEmu(g.position)
|
|
9597
9625
|
}));
|
|
9598
9626
|
return {
|
|
9599
9627
|
...slide,
|
|
@@ -9670,6 +9698,12 @@ function useRecoveryDetection(input) {
|
|
|
9670
9698
|
const [prompt, setPrompt] = useState(null);
|
|
9671
9699
|
const [discarding, setDiscarding] = useState(false);
|
|
9672
9700
|
const onRestore = input.onRestore;
|
|
9701
|
+
const storageRef = useRef(input.storage);
|
|
9702
|
+
storageRef.current = input.storage;
|
|
9703
|
+
const onOfferedRef = useRef(input.onOffered);
|
|
9704
|
+
useEffect(() => {
|
|
9705
|
+
onOfferedRef.current = input.onOffered;
|
|
9706
|
+
}, [input.onOffered]);
|
|
9673
9707
|
const openVersionHistory = input.openVersionHistory;
|
|
9674
9708
|
useEffect(() => {
|
|
9675
9709
|
if (!shouldProbeAutosaveRecovery({
|
|
@@ -9684,12 +9718,18 @@ function useRecoveryDetection(input) {
|
|
|
9684
9718
|
}
|
|
9685
9719
|
recoveryCheckedRef.current = true;
|
|
9686
9720
|
void (async () => {
|
|
9687
|
-
const offer = await probeAutosaveRecovery(
|
|
9721
|
+
const offer = await probeAutosaveRecovery(
|
|
9722
|
+
filePath,
|
|
9723
|
+
Date.now(),
|
|
9724
|
+
fileName,
|
|
9725
|
+
storageRef.current
|
|
9726
|
+
);
|
|
9688
9727
|
if (!offer) {
|
|
9689
9728
|
return;
|
|
9690
9729
|
}
|
|
9691
9730
|
recordRef.current = offer.record;
|
|
9692
9731
|
setPrompt(offer.prompt);
|
|
9732
|
+
onOfferedRef.current?.(offer.record);
|
|
9693
9733
|
openVersionHistory?.();
|
|
9694
9734
|
})();
|
|
9695
9735
|
}, [filePath, fileName, loading, error, slideCount, autosaveAllowed, openVersionHistory]);
|
|
@@ -9719,7 +9759,7 @@ function useRecoveryDetection(input) {
|
|
|
9719
9759
|
setDiscarding(true);
|
|
9720
9760
|
void (async () => {
|
|
9721
9761
|
try {
|
|
9722
|
-
await discardAutosaveRecovery(record);
|
|
9762
|
+
await discardAutosaveRecovery(record, storageRef.current);
|
|
9723
9763
|
recordRef.current = null;
|
|
9724
9764
|
setPrompt(null);
|
|
9725
9765
|
} catch {
|
|
@@ -9904,10 +9944,10 @@ function useCanvasImagePaste(input) {
|
|
|
9904
9944
|
function formatPatchFor(element, format) {
|
|
9905
9945
|
const updated = applyFormatToElement(element, format);
|
|
9906
9946
|
const updates = {};
|
|
9907
|
-
if (
|
|
9947
|
+
if (hasShapeProperties(updated)) {
|
|
9908
9948
|
updates.shapeStyle = updated.shapeStyle;
|
|
9909
9949
|
}
|
|
9910
|
-
if (
|
|
9950
|
+
if (hasTextProperties(updated)) {
|
|
9911
9951
|
updates.textStyle = updated.textStyle;
|
|
9912
9952
|
}
|
|
9913
9953
|
return updates;
|
|
@@ -10367,6 +10407,8 @@ function useIOHandlers(input) {
|
|
|
10367
10407
|
activeSlideIndex,
|
|
10368
10408
|
canvasSize,
|
|
10369
10409
|
filePath,
|
|
10410
|
+
storage,
|
|
10411
|
+
onSaveError,
|
|
10370
10412
|
history,
|
|
10371
10413
|
ops,
|
|
10372
10414
|
zoom,
|
|
@@ -10375,6 +10417,8 @@ function useIOHandlers(input) {
|
|
|
10375
10417
|
serializeForRecovery,
|
|
10376
10418
|
setContent,
|
|
10377
10419
|
onContentChange,
|
|
10420
|
+
onPropertiesChange,
|
|
10421
|
+
onNotesUpdate,
|
|
10378
10422
|
imageExportScale,
|
|
10379
10423
|
imageResolutionScale
|
|
10380
10424
|
} = input;
|
|
@@ -10384,6 +10428,8 @@ function useIOHandlers(input) {
|
|
|
10384
10428
|
activeSlide: slides[activeSlideIndex],
|
|
10385
10429
|
activeSlideIndex,
|
|
10386
10430
|
filePath,
|
|
10431
|
+
storage,
|
|
10432
|
+
onSaveError,
|
|
10387
10433
|
canvasStageRef: zoom.canvasStageRef,
|
|
10388
10434
|
setActiveSlideIndex: state.setActiveSlideIndex,
|
|
10389
10435
|
serializeSlides,
|
|
@@ -10438,7 +10484,9 @@ function useIOHandlers(input) {
|
|
|
10438
10484
|
setSlides: state.setSlides,
|
|
10439
10485
|
setIsDirty: state.setIsDirty,
|
|
10440
10486
|
ops,
|
|
10441
|
-
history
|
|
10487
|
+
history,
|
|
10488
|
+
onPropertiesChange,
|
|
10489
|
+
onNotesUpdate
|
|
10442
10490
|
});
|
|
10443
10491
|
return { exportHandlers, printHandlers, themeHandlers, propertyHandlers };
|
|
10444
10492
|
}
|
|
@@ -10606,6 +10654,7 @@ function useContentLifecycle(input) {
|
|
|
10606
10654
|
filePath,
|
|
10607
10655
|
autosaveEnabled = true,
|
|
10608
10656
|
autosaveIntervalMs,
|
|
10657
|
+
storage,
|
|
10609
10658
|
embedFonts = true,
|
|
10610
10659
|
slides,
|
|
10611
10660
|
state,
|
|
@@ -10717,6 +10766,7 @@ function useContentLifecycle(input) {
|
|
|
10717
10766
|
const { autosaveStatus } = useAutosave({
|
|
10718
10767
|
isDirty: state.isDirty,
|
|
10719
10768
|
filePath,
|
|
10769
|
+
storage,
|
|
10720
10770
|
serializeSlides: serializeForRecovery,
|
|
10721
10771
|
enabled: autosaveEnabled,
|
|
10722
10772
|
...autosaveIntervalMs === void 0 ? {} : { intervalMs: autosaveIntervalMs },
|
|
@@ -10724,6 +10774,7 @@ function useContentLifecycle(input) {
|
|
|
10724
10774
|
// so a poll that finds all of them unchanged can skip re-serializing a
|
|
10725
10775
|
// deck it has already snapshotted. The two refs are read by `.current`
|
|
10726
10776
|
// because an inline edit in progress lives there and nowhere else yet.
|
|
10777
|
+
onSaved: input.onAutosave,
|
|
10727
10778
|
getChangeSources: () => [
|
|
10728
10779
|
slides,
|
|
10729
10780
|
state.templateElementsBySlideId,
|
|
@@ -11016,7 +11067,7 @@ function useKeyboardShortcutWiring(input) {
|
|
|
11016
11067
|
}
|
|
11017
11068
|
function stepSelectedFontSize(state, ops, direction) {
|
|
11018
11069
|
const selected = state.selectedElement;
|
|
11019
|
-
const currentPx = (selected &&
|
|
11070
|
+
const currentPx = (selected && hasTextProperties(selected) ? selected.textStyle?.fontSize : void 0) ?? textFontSizePtToPx(18);
|
|
11020
11071
|
const nextPt = stepFontSizePt(textFontSizePxToPt(currentPx), direction);
|
|
11021
11072
|
ops.updateSelectedTextStyle({ fontSize: textFontSizePtToPx(nextPt) });
|
|
11022
11073
|
}
|
|
@@ -11063,6 +11114,20 @@ function useElementUpdateBatch(input) {
|
|
|
11063
11114
|
);
|
|
11064
11115
|
}, []);
|
|
11065
11116
|
}
|
|
11117
|
+
function useReportOnChange(value, report, initial = value) {
|
|
11118
|
+
const last = useRef(initial);
|
|
11119
|
+
const callback = useRef(report);
|
|
11120
|
+
useEffect(() => {
|
|
11121
|
+
callback.current = report;
|
|
11122
|
+
}, [report]);
|
|
11123
|
+
useEffect(() => {
|
|
11124
|
+
if (Object.is(last.current, value)) {
|
|
11125
|
+
return;
|
|
11126
|
+
}
|
|
11127
|
+
last.current = value;
|
|
11128
|
+
callback.current?.(value);
|
|
11129
|
+
}, [value]);
|
|
11130
|
+
}
|
|
11066
11131
|
|
|
11067
11132
|
// src/viewer/hooks/useViewerIntegration.ts
|
|
11068
11133
|
function useViewerIntegration(input) {
|
|
@@ -11079,6 +11144,7 @@ function useViewerIntegration(input) {
|
|
|
11079
11144
|
content,
|
|
11080
11145
|
filePath,
|
|
11081
11146
|
fileName,
|
|
11147
|
+
storage,
|
|
11082
11148
|
autosaveEnabled,
|
|
11083
11149
|
autosaveAllowed = true,
|
|
11084
11150
|
autosaveIntervalMs,
|
|
@@ -11107,7 +11173,13 @@ function useViewerIntegration(input) {
|
|
|
11107
11173
|
onModeChange,
|
|
11108
11174
|
onZoomChange,
|
|
11109
11175
|
onSelectionChange,
|
|
11110
|
-
onSlideCountChange
|
|
11176
|
+
onSlideCountChange,
|
|
11177
|
+
onAutosave,
|
|
11178
|
+
onAutosaveStatus,
|
|
11179
|
+
onAutosaveRecovery,
|
|
11180
|
+
onPropertiesChange,
|
|
11181
|
+
onNotesUpdate,
|
|
11182
|
+
onPresentationChange
|
|
11111
11183
|
} = input;
|
|
11112
11184
|
usePointerHandlers({
|
|
11113
11185
|
editorScale: zoom.editorScale,
|
|
@@ -11145,8 +11217,10 @@ function useViewerIntegration(input) {
|
|
|
11145
11217
|
{
|
|
11146
11218
|
content,
|
|
11147
11219
|
filePath,
|
|
11220
|
+
storage,
|
|
11148
11221
|
autosaveEnabled,
|
|
11149
11222
|
autosaveIntervalMs,
|
|
11223
|
+
onAutosave,
|
|
11150
11224
|
// The File > Fonts toggle, finally reaching a save call.
|
|
11151
11225
|
embedFonts: dialogs.embedFontsEnabled,
|
|
11152
11226
|
slides,
|
|
@@ -11171,6 +11245,8 @@ function useViewerIntegration(input) {
|
|
|
11171
11245
|
activeSlideIndex,
|
|
11172
11246
|
canvasSize,
|
|
11173
11247
|
filePath,
|
|
11248
|
+
storage,
|
|
11249
|
+
onSaveError: input.onSaveError,
|
|
11174
11250
|
history,
|
|
11175
11251
|
ops: editorOps.ops,
|
|
11176
11252
|
zoom,
|
|
@@ -11179,6 +11255,8 @@ function useViewerIntegration(input) {
|
|
|
11179
11255
|
serializeForRecovery,
|
|
11180
11256
|
setContent,
|
|
11181
11257
|
onContentChange,
|
|
11258
|
+
onPropertiesChange,
|
|
11259
|
+
onNotesUpdate,
|
|
11182
11260
|
imageExportScale,
|
|
11183
11261
|
imageResolutionScale
|
|
11184
11262
|
});
|
|
@@ -11205,6 +11283,8 @@ function useViewerIntegration(input) {
|
|
|
11205
11283
|
error,
|
|
11206
11284
|
slideCount: slides.length,
|
|
11207
11285
|
autosaveAllowed,
|
|
11286
|
+
storage,
|
|
11287
|
+
onOffered: onAutosaveRecovery,
|
|
11208
11288
|
onRestore: setContent
|
|
11209
11289
|
});
|
|
11210
11290
|
const updateElements = useElementUpdateBatch(input);
|
|
@@ -11427,6 +11507,8 @@ function useViewerIntegration(input) {
|
|
|
11427
11507
|
onSlideCountChange(slides.length);
|
|
11428
11508
|
}
|
|
11429
11509
|
}, [slides.length, onSlideCountChange]);
|
|
11510
|
+
useReportOnChange(autosaveStatusKind(autosaveStatus), onAutosaveStatus);
|
|
11511
|
+
useReportOnChange(mode === "present", onPresentationChange);
|
|
11430
11512
|
useKeyboardShortcutWiring({
|
|
11431
11513
|
state,
|
|
11432
11514
|
mode,
|
|
@@ -11520,7 +11602,9 @@ function useViewerOptions() {
|
|
|
11520
11602
|
);
|
|
11521
11603
|
return { optionsStore: store, options };
|
|
11522
11604
|
}
|
|
11523
|
-
var KNOWN_TAB_IDS = new Set(
|
|
11605
|
+
var KNOWN_TAB_IDS = /* @__PURE__ */ new Set(
|
|
11606
|
+
/* @__PURE__ */ TOOLBAR_TABS.map((tab) => tab.id)
|
|
11607
|
+
);
|
|
11524
11608
|
function computeToolbarVisibility(hiddenActions, hiddenTabIds = []) {
|
|
11525
11609
|
const isHidden = (id) => isActionHidden(id, hiddenActions);
|
|
11526
11610
|
const userHidden = new Set(hiddenTabIds);
|
|
@@ -12622,6 +12706,7 @@ function buildToolbarProps(input) {
|
|
|
12622
12706
|
s.setIsDirty(true);
|
|
12623
12707
|
},
|
|
12624
12708
|
onOpenShareDialog,
|
|
12709
|
+
onSave: exportHandlers.handleSave,
|
|
12625
12710
|
onSaveAsPptx: exportHandlers.handleSaveAsPptx,
|
|
12626
12711
|
onSaveAsPpsx: exportHandlers.handleSaveAsPpsx,
|
|
12627
12712
|
onSaveAsPptm: exportHandlers.handleSaveAsPptm,
|
|
@@ -13024,7 +13109,7 @@ function useViewerBuildingBlocksCore(input) {
|
|
|
13024
13109
|
documentGridSpacing: state.viewProperties?.gridSpacing
|
|
13025
13110
|
});
|
|
13026
13111
|
const themeColorMap = useMemo(
|
|
13027
|
-
() => state.theme?.colorScheme ?
|
|
13112
|
+
() => state.theme?.colorScheme ? buildThemeColorMap(state.theme.colorScheme) : void 0,
|
|
13028
13113
|
[state.theme?.colorScheme]
|
|
13029
13114
|
);
|
|
13030
13115
|
const { presentation, annotations, actionSoundHandlerRef, setExitModeHandler } = usePresentationSetup({
|
|
@@ -13808,7 +13893,7 @@ function renderImg(el, style, filter, alt, opacity) {
|
|
|
13808
13893
|
] });
|
|
13809
13894
|
}
|
|
13810
13895
|
const colorWash = getImageColorWashStyle(
|
|
13811
|
-
|
|
13896
|
+
isImageLikeElement(el) ? el.imageEffects?.colorWash : void 0
|
|
13812
13897
|
);
|
|
13813
13898
|
const clrChange = "imageEffects" in el ? el.imageEffects?.clrChange : void 0;
|
|
13814
13899
|
const duotoneColors = getDuotoneColors(el);
|
|
@@ -13897,11 +13982,17 @@ function SlideBackgroundImageLayer({
|
|
|
13897
13982
|
}
|
|
13898
13983
|
);
|
|
13899
13984
|
}
|
|
13900
|
-
|
|
13985
|
+
|
|
13986
|
+
// src/viewer/utils/display-name.ts
|
|
13987
|
+
function withDisplayName(component, displayName) {
|
|
13988
|
+
component.displayName = displayName;
|
|
13989
|
+
return component;
|
|
13990
|
+
}
|
|
13991
|
+
var ChartFormatContext = /* @__PURE__ */ createContext(null);
|
|
13901
13992
|
function useChartFormatContext() {
|
|
13902
13993
|
return useContext(ChartFormatContext);
|
|
13903
13994
|
}
|
|
13904
|
-
var ChartPartSelectionContext = createContext({
|
|
13995
|
+
var ChartPartSelectionContext = /* @__PURE__ */ createContext({
|
|
13905
13996
|
selection: null,
|
|
13906
13997
|
setSelection: () => {
|
|
13907
13998
|
}
|
|
@@ -13924,7 +14015,9 @@ var DEFAULT_RENDERING_3D_FLAGS = {
|
|
|
13924
14015
|
areaChart3D: false,
|
|
13925
14016
|
pieChart3D: false
|
|
13926
14017
|
};
|
|
13927
|
-
var Rendering3DFlagsContext = createContext(
|
|
14018
|
+
var Rendering3DFlagsContext = /* @__PURE__ */ createContext(
|
|
14019
|
+
DEFAULT_RENDERING_3D_FLAGS
|
|
14020
|
+
);
|
|
13928
14021
|
defineThreeViewElement();
|
|
13929
14022
|
function useThreeViewEvent(ref, type, handler) {
|
|
13930
14023
|
useLayoutEffect(() => {
|
|
@@ -14446,26 +14539,26 @@ var rotateSize = "var(--pptx-react-rotate-default, 20px)";
|
|
|
14446
14539
|
var RESIZE_DEFAULT_CLASSES = "[--pptx-react-corner-default:12px] max-md:[--pptx-react-corner-default:22px] [--pptx-react-edge-length-default:20px] max-md:[--pptx-react-edge-length-default:32px] [--pptx-react-edge-thickness-default:8px] max-md:[--pptx-react-edge-thickness-default:12px]";
|
|
14447
14540
|
var ROTATE_DEFAULT_CLASSES = "[--pptx-react-rotate-default:20px] max-md:[--pptx-react-rotate-default:28px]";
|
|
14448
14541
|
var RESIZE_ARTWORK = {
|
|
14449
|
-
corner: getSelectionControlArtworkStyle("corner", {
|
|
14542
|
+
corner: /* @__PURE__ */ getSelectionControlArtworkStyle("corner", {
|
|
14450
14543
|
...appearance,
|
|
14451
14544
|
width: cornerSize,
|
|
14452
14545
|
height: cornerSize,
|
|
14453
14546
|
radius: "9999px"
|
|
14454
14547
|
}),
|
|
14455
|
-
horizontal: getSelectionControlArtworkStyle("horizontal-edge", {
|
|
14548
|
+
horizontal: /* @__PURE__ */ getSelectionControlArtworkStyle("horizontal-edge", {
|
|
14456
14549
|
...appearance,
|
|
14457
14550
|
width: edgeLength,
|
|
14458
14551
|
height: edgeThickness,
|
|
14459
14552
|
radius: "var(--radius-sm, 0.25rem)"
|
|
14460
14553
|
}),
|
|
14461
|
-
vertical: getSelectionControlArtworkStyle("vertical-edge", {
|
|
14554
|
+
vertical: /* @__PURE__ */ getSelectionControlArtworkStyle("vertical-edge", {
|
|
14462
14555
|
...appearance,
|
|
14463
14556
|
width: edgeThickness,
|
|
14464
14557
|
height: edgeLength,
|
|
14465
14558
|
radius: "var(--radius-sm, 0.25rem)"
|
|
14466
14559
|
})
|
|
14467
14560
|
};
|
|
14468
|
-
var ROTATE_ARTWORK = getSelectionControlArtworkStyle("rotate", {
|
|
14561
|
+
var ROTATE_ARTWORK = /* @__PURE__ */ getSelectionControlArtworkStyle("rotate", {
|
|
14469
14562
|
...appearance,
|
|
14470
14563
|
width: rotateSize,
|
|
14471
14564
|
height: rotateSize,
|
|
@@ -14707,7 +14800,7 @@ function ResizeHandles({
|
|
|
14707
14800
|
))
|
|
14708
14801
|
] });
|
|
14709
14802
|
}
|
|
14710
|
-
var
|
|
14803
|
+
var ConnectorElementRendererMemo = /* @__PURE__ */ React17.memo(
|
|
14711
14804
|
// oxlint-disable-next-line prefer-arrow-callback -- named fn gives the memo component its displayName
|
|
14712
14805
|
function ConnectorElementRendererInner({
|
|
14713
14806
|
el,
|
|
@@ -14724,7 +14817,7 @@ var ConnectorElementRenderer = React17.memo(
|
|
|
14724
14817
|
animationState,
|
|
14725
14818
|
textStyleOverrideCss
|
|
14726
14819
|
}) {
|
|
14727
|
-
const shapeEl =
|
|
14820
|
+
const shapeEl = hasShapeProperties(el) ? el : void 0;
|
|
14728
14821
|
const viewWidth = Math.max(el.width, 0);
|
|
14729
14822
|
const viewHeight = Math.max(el.height, 0);
|
|
14730
14823
|
const svgWidth = Math.max(el.width, 1);
|
|
@@ -14748,7 +14841,7 @@ var ConnectorElementRenderer = React17.memo(
|
|
|
14748
14841
|
const compoundOffsets = getCompoundLineOffsets(compoundLine, strokeWidth);
|
|
14749
14842
|
const compoundWidths = getCompoundLineWidths(compoundLine, strokeWidth);
|
|
14750
14843
|
const strokeCap = svgLineCap(ss?.lineCap);
|
|
14751
|
-
const textEl =
|
|
14844
|
+
const textEl = hasTextProperties(el) ? el : void 0;
|
|
14752
14845
|
const connectorText = textEl?.text?.trim() ?? "";
|
|
14753
14846
|
const connectorTextSegments = textEl?.textSegments;
|
|
14754
14847
|
const connectorTextStyle = textEl?.textStyle;
|
|
@@ -14769,8 +14862,8 @@ var ConnectorElementRenderer = React17.memo(
|
|
|
14769
14862
|
"data-pptx-element": "true",
|
|
14770
14863
|
"data-element-id": el.id,
|
|
14771
14864
|
role: getAriaRole(el, { actionable: false }),
|
|
14772
|
-
"aria-label": getAriaLabel(el),
|
|
14773
|
-
"aria-roledescription": getAriaRoleDescription(el),
|
|
14865
|
+
"aria-label": getAriaLabel$1(el),
|
|
14866
|
+
"aria-roledescription": getAriaRoleDescription$1(el),
|
|
14774
14867
|
"aria-selected": isSelected ? true : void 0,
|
|
14775
14868
|
className: "absolute",
|
|
14776
14869
|
style: {
|
|
@@ -14951,7 +15044,10 @@ var ConnectorElementRenderer = React17.memo(
|
|
|
14951
15044
|
);
|
|
14952
15045
|
}
|
|
14953
15046
|
);
|
|
14954
|
-
ConnectorElementRenderer
|
|
15047
|
+
var ConnectorElementRenderer = /* @__PURE__ */ withDisplayName(
|
|
15048
|
+
ConnectorElementRendererMemo,
|
|
15049
|
+
"ConnectorElementRenderer"
|
|
15050
|
+
);
|
|
14955
15051
|
function getElementInteractionProps({
|
|
14956
15052
|
element,
|
|
14957
15053
|
isEditableText,
|
|
@@ -15036,7 +15132,7 @@ function getContainerStyle({
|
|
|
15036
15132
|
has3DExtrusion,
|
|
15037
15133
|
templateEditing
|
|
15038
15134
|
}) {
|
|
15039
|
-
const ss =
|
|
15135
|
+
const ss = hasShapeProperties(el) ? el.shapeStyle : void 0;
|
|
15040
15136
|
const isPicture = el.type === "picture" || el.type === "image";
|
|
15041
15137
|
const blurGrowVisible = Boolean(
|
|
15042
15138
|
ss?.blurGrow && typeof ss.blurRadius === "number" && ss.blurRadius > 0
|
|
@@ -15088,14 +15184,14 @@ function getContainerStyle({
|
|
|
15088
15184
|
};
|
|
15089
15185
|
}
|
|
15090
15186
|
function shapeParams(element) {
|
|
15091
|
-
const style =
|
|
15187
|
+
const style = hasShapeProperties(element) ? element.shapeStyle : void 0;
|
|
15092
15188
|
const strokeWidth = paintedStrokeWidth(style);
|
|
15093
15189
|
const strokeColor = normalizeHexColor(style?.strokeColor, DEFAULT_STROKE_COLOR);
|
|
15094
15190
|
const fillColor = normalizeHexColor(style?.fillColor, DEFAULT_FILL_COLOR);
|
|
15095
15191
|
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(buildCssGradientFromShapeStyle(style) || style?.fillGradient) || style?.fillMode === "pattern" && Boolean(style.fillPatternPreset);
|
|
15096
15192
|
return { hf: hasFill, fc: fillColor, sw: strokeWidth, sc: strokeColor };
|
|
15097
15193
|
}
|
|
15098
|
-
var
|
|
15194
|
+
var Extrusion3DOverlayMemo = /* @__PURE__ */ React17.memo(
|
|
15099
15195
|
// oxlint-disable-next-line prefer-arrow-callback -- named fn gives the memo component its displayName
|
|
15100
15196
|
function Extrusion3DOverlayInner({ data }) {
|
|
15101
15197
|
if (!data.hasExtrusion || data.panels.length === 0) {
|
|
@@ -15130,7 +15226,10 @@ var Extrusion3DOverlay = React17.memo(
|
|
|
15130
15226
|
] });
|
|
15131
15227
|
}
|
|
15132
15228
|
);
|
|
15133
|
-
Extrusion3DOverlay
|
|
15229
|
+
var Extrusion3DOverlay = /* @__PURE__ */ withDisplayName(
|
|
15230
|
+
Extrusion3DOverlayMemo,
|
|
15231
|
+
"Extrusion3DOverlay"
|
|
15232
|
+
);
|
|
15134
15233
|
|
|
15135
15234
|
// src/viewer/components/elements/scoped-element-handlers.ts
|
|
15136
15235
|
function getScopedElementHandlers(elementId, options) {
|
|
@@ -15197,7 +15296,7 @@ function ShapeEffectOverlay({
|
|
|
15197
15296
|
const fillOverlayStyle = overlay ? {
|
|
15198
15297
|
position: "absolute",
|
|
15199
15298
|
inset: 0,
|
|
15200
|
-
...
|
|
15299
|
+
...isImageLikeElement(element) ? getImageSurfaceMaskStyle(element) : {},
|
|
15201
15300
|
background: overlay.color,
|
|
15202
15301
|
mixBlendMode: overlay.blendMode,
|
|
15203
15302
|
pointerEvents: "none"
|
|
@@ -15340,7 +15439,7 @@ function ShapeEffectOverlay({
|
|
|
15340
15439
|
) : null
|
|
15341
15440
|
] });
|
|
15342
15441
|
}
|
|
15343
|
-
var ElementRenderer = React17.memo(
|
|
15442
|
+
var ElementRenderer = /* @__PURE__ */ React17.memo(
|
|
15344
15443
|
// oxlint-disable-next-line prefer-arrow-callback -- named fn gives the memo component its displayName
|
|
15345
15444
|
function ElementRendererInner({
|
|
15346
15445
|
element: el,
|
|
@@ -15405,7 +15504,7 @@ var ElementRenderer = React17.memo(
|
|
|
15405
15504
|
const effectPlacement = getShapeEffectLayerPlacement(el);
|
|
15406
15505
|
const visualAnimationState = backgroundAnimationState ?? animationState;
|
|
15407
15506
|
const isTxt = isEditableTextElement(el) && allow.textEditable;
|
|
15408
|
-
const txtSE =
|
|
15507
|
+
const txtSE = hasTextProperties(el) ? el.textStyle : void 0;
|
|
15409
15508
|
const textStyleOverrideCss = buildTextStyleOverrideCss(el.id, visualAnimationState?.textStyle);
|
|
15410
15509
|
const ss = getShapeVisualStyle(
|
|
15411
15510
|
el,
|
|
@@ -15429,7 +15528,7 @@ var ElementRenderer = React17.memo(
|
|
|
15429
15528
|
);
|
|
15430
15529
|
const isModel3D = el.type === "model3d";
|
|
15431
15530
|
const isConn = isConnectorOrLineElement(el);
|
|
15432
|
-
const shapeStyle3d =
|
|
15531
|
+
const shapeStyle3d = hasShapeProperties(el) ? el.shapeStyle : void 0;
|
|
15433
15532
|
const extrusionData = useMemo(
|
|
15434
15533
|
() => build3DExtrusionData(shapeStyle3d?.shape3d, shapeStyle3d?.scene3d, fc, el.width, el.height),
|
|
15435
15534
|
[shapeStyle3d?.shape3d, shapeStyle3d?.scene3d, fc, el.width, el.height]
|
|
@@ -16053,7 +16152,7 @@ function renderOleBadge(oleType) {
|
|
|
16053
16152
|
)
|
|
16054
16153
|
] });
|
|
16055
16154
|
}
|
|
16056
|
-
var InlineCollaborationContext = createContext(void 0);
|
|
16155
|
+
var InlineCollaborationContext = /* @__PURE__ */ createContext(void 0);
|
|
16057
16156
|
|
|
16058
16157
|
// src/viewer/components/elements/useInlineListEditor.tsx
|
|
16059
16158
|
function useInlineListEditor(element, rootRef, onChange, onModelReplacement) {
|
|
@@ -16252,7 +16351,7 @@ function InlineTextEditor({
|
|
|
16252
16351
|
seedRef.current = {
|
|
16253
16352
|
initialText,
|
|
16254
16353
|
hasRichSegments: Boolean(
|
|
16255
|
-
|
|
16354
|
+
hasTextProperties(element) && element.textSegments && element.textSegments.length > 0
|
|
16256
16355
|
)
|
|
16257
16356
|
};
|
|
16258
16357
|
}
|
|
@@ -16330,7 +16429,7 @@ function InlineTextEditor({
|
|
|
16330
16429
|
transformOrigin: warpStyle?.transformOrigin || "center"
|
|
16331
16430
|
};
|
|
16332
16431
|
const nextInlineStyleValue = (property) => {
|
|
16333
|
-
if (!
|
|
16432
|
+
if (!hasTextProperties(element)) {
|
|
16334
16433
|
return true;
|
|
16335
16434
|
}
|
|
16336
16435
|
const result = getInlineEditorSelectionResult(element.textSegments);
|
|
@@ -16415,10 +16514,10 @@ function InlineTextEditor({
|
|
|
16415
16514
|
function FailedToLoad() {
|
|
16416
16515
|
return null;
|
|
16417
16516
|
}
|
|
16418
|
-
var LazyModel3DScene = React17.lazy(
|
|
16517
|
+
var LazyModel3DScene = /* @__PURE__ */ React17.lazy(
|
|
16419
16518
|
async () => {
|
|
16420
16519
|
try {
|
|
16421
|
-
return await import('./Model3DScene-
|
|
16520
|
+
return await import('./Model3DScene-NUJH2UKM.mjs');
|
|
16422
16521
|
} catch {
|
|
16423
16522
|
return { default: FailedToLoad };
|
|
16424
16523
|
}
|
|
@@ -16499,7 +16598,7 @@ function Model3DRenderer({ element, width, height, interactive }) {
|
|
|
16499
16598
|
const [threeAvailable, setThreeAvailable] = useState(null);
|
|
16500
16599
|
useEffect(() => {
|
|
16501
16600
|
let cancelled = false;
|
|
16502
|
-
import('./three.module-
|
|
16601
|
+
import('./three.module-EBJVANGB.mjs').then(() => {
|
|
16503
16602
|
if (!cancelled) {
|
|
16504
16603
|
setThreeAvailable(true);
|
|
16505
16604
|
}
|
|
@@ -17344,7 +17443,7 @@ function SmartArtRendererImpl({
|
|
|
17344
17443
|
if (!onUpdateElement || !shouldCommitSmartArtNodeText(smartArtData, nodeId, text)) {
|
|
17345
17444
|
return;
|
|
17346
17445
|
}
|
|
17347
|
-
const updated =
|
|
17446
|
+
const updated = updateSmartArtNodeText(smartArtData, nodeId, text);
|
|
17348
17447
|
const box = { width: element.width, height: element.height };
|
|
17349
17448
|
const reflowed = rebuildDrawingShapesIfCleared(
|
|
17350
17449
|
updated,
|
|
@@ -17360,7 +17459,7 @@ function SmartArtRendererImpl({
|
|
|
17360
17459
|
if (!onUpdateElement) {
|
|
17361
17460
|
return;
|
|
17362
17461
|
}
|
|
17363
|
-
const next =
|
|
17462
|
+
const next = setSmartArtNodeStyle(smartArtData, nodeId, { fillColor: fill });
|
|
17364
17463
|
if (next !== smartArtData) {
|
|
17365
17464
|
const box = { width: element.width, height: element.height };
|
|
17366
17465
|
const reflowed = rebuildDrawingShapesIfCleared(
|
|
@@ -17470,7 +17569,7 @@ function sameDiagramReveal(prev, next) {
|
|
|
17470
17569
|
}
|
|
17471
17570
|
return true;
|
|
17472
17571
|
}
|
|
17473
|
-
var SmartArtRenderer = React17.memo(SmartArtRendererImpl, arePropsEqual);
|
|
17572
|
+
var SmartArtRenderer = /* @__PURE__ */ React17.memo(SmartArtRendererImpl, arePropsEqual);
|
|
17474
17573
|
function SmartArt3DView({
|
|
17475
17574
|
element,
|
|
17476
17575
|
className,
|
|
@@ -17595,7 +17694,7 @@ function getSegmentTspanProps(segment, element, fallbackColor) {
|
|
|
17595
17694
|
fontSize: s.fontSize ?? element.textStyle?.fontSize ?? DEFAULT_TEXT_FONT_SIZE,
|
|
17596
17695
|
fontWeight: resolveFontWeight(s.fontFamily || element.textStyle?.fontFamily, s.bold),
|
|
17597
17696
|
fontStyle: resolveFontItalic(s.fontFamily || element.textStyle?.fontFamily, s.italic) ? "italic" : void 0,
|
|
17598
|
-
fontFamily: s.fontFamily || element.textStyle?.fontFamily ?
|
|
17697
|
+
fontFamily: s.fontFamily || element.textStyle?.fontFamily ? getSubstituteFontFamily(s.fontFamily || element.textStyle?.fontFamily || "") : DEFAULT_FONT_FAMILY,
|
|
17599
17698
|
textDecoration: decos.length > 0 ? decos.join(" ") : void 0
|
|
17600
17699
|
};
|
|
17601
17700
|
}
|
|
@@ -17603,7 +17702,7 @@ function resolveSegmentFont(segment, element) {
|
|
|
17603
17702
|
const s = segment.style || {};
|
|
17604
17703
|
const family = s.fontFamily || element.textStyle?.fontFamily;
|
|
17605
17704
|
return {
|
|
17606
|
-
fontFamily: family ?
|
|
17705
|
+
fontFamily: family ? getSubstituteFontFamily(family) : DEFAULT_FONT_FAMILY,
|
|
17607
17706
|
fontSizePx: s.fontSize ?? element.textStyle?.fontSize ?? DEFAULT_TEXT_FONT_SIZE,
|
|
17608
17707
|
bold: s.bold ?? element.textStyle?.bold,
|
|
17609
17708
|
italic: s.italic ?? element.textStyle?.italic
|
|
@@ -17670,7 +17769,7 @@ function WarpedText({
|
|
|
17670
17769
|
fallbackColor,
|
|
17671
17770
|
fieldContext
|
|
17672
17771
|
}) {
|
|
17673
|
-
if (!
|
|
17772
|
+
if (!hasTextProperties(element)) {
|
|
17674
17773
|
return null;
|
|
17675
17774
|
}
|
|
17676
17775
|
const textEl = element;
|
|
@@ -17689,7 +17788,7 @@ function WarpedText({
|
|
|
17689
17788
|
const align = textEl.textStyle?.align ?? "center";
|
|
17690
17789
|
const { startOffset, textAnchor } = getAlignmentProps(align);
|
|
17691
17790
|
const baseFontSize = textEl.textStyle?.fontSize ?? DEFAULT_TEXT_FONT_SIZE;
|
|
17692
|
-
const baseFontFamily = textEl.textStyle?.fontFamily ?
|
|
17791
|
+
const baseFontFamily = textEl.textStyle?.fontFamily ? getSubstituteFontFamily(textEl.textStyle.fontFamily) : DEFAULT_FONT_FAMILY;
|
|
17693
17792
|
const baseFill = normalizeHexColor(textEl.textStyle?.color, fallbackColor);
|
|
17694
17793
|
if (hasGlyphEnvelope(preset)) {
|
|
17695
17794
|
const perLine = buildGlyphEnvelopeBlock(
|
|
@@ -17789,11 +17888,15 @@ function WarpedText({
|
|
|
17789
17888
|
}
|
|
17790
17889
|
);
|
|
17791
17890
|
}
|
|
17792
|
-
var GLYPH_BY_SHAPE =
|
|
17793
|
-
|
|
17794
|
-
|
|
17795
|
-
|
|
17796
|
-
|
|
17891
|
+
var GLYPH_BY_SHAPE = /* @__PURE__ */ buildGlyphByShape();
|
|
17892
|
+
function buildGlyphByShape() {
|
|
17893
|
+
const glyphs = Object.fromEntries(
|
|
17894
|
+
ACTION_BUTTON_PRESETS.map((p) => [p.shapeType, p.iconPath])
|
|
17895
|
+
);
|
|
17896
|
+
glyphs["actionButtonForwardOrNext"] = glyphs["actionButtonForwardNext"];
|
|
17897
|
+
glyphs["actionButtonBackOrPrevious"] = glyphs["actionButtonBackPrevious"];
|
|
17898
|
+
return glyphs;
|
|
17899
|
+
}
|
|
17797
17900
|
function isActionButtonShape(shapeType) {
|
|
17798
17901
|
return Boolean(shapeType && shapeType in GLYPH_BY_SHAPE);
|
|
17799
17902
|
}
|
|
@@ -17860,9 +17963,9 @@ function renderTextElementBody(options) {
|
|
|
17860
17963
|
const isLinkedTextBox$1 = isLinkedTextBox(el);
|
|
17861
17964
|
const linkedSegments = getOverflowSegments(el, slideElements);
|
|
17862
17965
|
const useSvgWarp = shouldUseSvgWarp(
|
|
17863
|
-
|
|
17966
|
+
hasTextProperties(el) ? el.textStyle?.textWarpPreset : void 0
|
|
17864
17967
|
);
|
|
17865
|
-
const scene3dStyle =
|
|
17968
|
+
const scene3dStyle = hasTextProperties(el) ? buildTextBody3DSceneStyle(el.textStyle, { width: el.width, height: el.height }) : void 0;
|
|
17866
17969
|
const rotationTransform = getTextBodyRotationTransform(el);
|
|
17867
17970
|
const composedTransform = [rotationTransform, getTextCompensationTransform(el), scene3dStyle?.transform].filter(Boolean).join(" ") || void 0;
|
|
17868
17971
|
const transformStyle = {
|
|
@@ -18329,7 +18432,7 @@ function renderBody(options) {
|
|
|
18329
18432
|
onPlayStateChange: handleMediaPlayStateChange
|
|
18330
18433
|
});
|
|
18331
18434
|
}
|
|
18332
|
-
if (doInk &&
|
|
18435
|
+
if (doInk && isInkElement(el)) {
|
|
18333
18436
|
return renderInk(el, {
|
|
18334
18437
|
replay: isPresentationPassive,
|
|
18335
18438
|
pressureSensitive: true
|
|
@@ -18373,7 +18476,7 @@ function defaultTextColorForFill(fillColor) {
|
|
|
18373
18476
|
return luminance > 0.179 ? DEFAULT_TEXT_COLOR : "#ffffff";
|
|
18374
18477
|
}
|
|
18375
18478
|
function getStaticElementVisualState(element, parentGroupFill) {
|
|
18376
|
-
const style =
|
|
18479
|
+
const style = hasShapeProperties(element) ? element.shapeStyle : void 0;
|
|
18377
18480
|
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(buildCssGradientFromShapeStyle(style) || style?.fillGradient) || style?.fillMode === "pattern" && Boolean(style.fillPatternPreset);
|
|
18378
18481
|
const fill = normalizeHexColor(style?.fillColor, DEFAULT_FILL_COLOR);
|
|
18379
18482
|
const strokeWidth = paintedStrokeWidth(style);
|
|
@@ -18393,8 +18496,8 @@ function getStaticElementVisualState(element, parentGroupFill) {
|
|
|
18393
18496
|
element.type === "shape" && hasFill ? defaultTextColorForFill(fill) : DEFAULT_TEXT_COLOR
|
|
18394
18497
|
);
|
|
18395
18498
|
const isImage = element.type === "picture" || element.type === "image";
|
|
18396
|
-
const letsTextOverflow =
|
|
18397
|
-
const shapeType =
|
|
18499
|
+
const letsTextOverflow = hasTextProperties(element) && element.textStyle?.autoFitMode === "shrink" && (element.type === "text" || element.locks?.txBox === true);
|
|
18500
|
+
const shapeType = hasShapeProperties(element) ? element.shapeType : void 0;
|
|
18398
18501
|
const isCallout = isWedgeCalloutPresetShape(shapeType) || String(shapeType ?? "").toLowerCase().includes("callout");
|
|
18399
18502
|
return {
|
|
18400
18503
|
hasFill,
|
|
@@ -18473,8 +18576,8 @@ function StaticElementRendererImpl({
|
|
|
18473
18576
|
isActionable
|
|
18474
18577
|
),
|
|
18475
18578
|
role: contractRole,
|
|
18476
|
-
"aria-label": exposeElementId ? getAriaLabel
|
|
18477
|
-
"aria-roledescription": exposeElementId ? getAriaRoleDescription
|
|
18579
|
+
"aria-label": exposeElementId ? getAriaLabel(element) : void 0,
|
|
18580
|
+
"aria-roledescription": exposeElementId ? getAriaRoleDescription(element) : void 0,
|
|
18478
18581
|
tabIndex: isActionable ? 0 : void 0,
|
|
18479
18582
|
title: isActionable ? action?.tooltip || action?.url || void 0 : void 0,
|
|
18480
18583
|
onClick: isActionable ? (event) => {
|
|
@@ -18539,7 +18642,7 @@ function StaticElementRendererImpl({
|
|
|
18539
18642
|
isEditing: false,
|
|
18540
18643
|
editText: "",
|
|
18541
18644
|
spellCheck: false,
|
|
18542
|
-
txtSE:
|
|
18645
|
+
txtSE: hasTextProperties(element) ? element.textStyle : void 0,
|
|
18543
18646
|
txtS: textStyle,
|
|
18544
18647
|
vecShape: renderVectorShape(
|
|
18545
18648
|
element,
|
|
@@ -18581,8 +18684,10 @@ function StaticElementRendererImpl({
|
|
|
18581
18684
|
}
|
|
18582
18685
|
);
|
|
18583
18686
|
}
|
|
18584
|
-
var StaticElementRenderer =
|
|
18585
|
-
|
|
18687
|
+
var StaticElementRenderer = /* @__PURE__ */ withDisplayName(
|
|
18688
|
+
/* @__PURE__ */ React17.memo(StaticElementRendererImpl),
|
|
18689
|
+
"StaticElementRenderer"
|
|
18690
|
+
);
|
|
18586
18691
|
function SlideLayer({
|
|
18587
18692
|
slide,
|
|
18588
18693
|
templateElements,
|
|
@@ -19058,4 +19163,4 @@ function useResizablePanels() {
|
|
|
19058
19163
|
};
|
|
19059
19164
|
}
|
|
19060
19165
|
|
|
19061
|
-
export { ACTION_VERB_MAP, ChartFormatContext, ChartPartSelectionProvider, CollaborationCursorOverlay, CollaborationProvider, ElementRenderer, FragmentedTransitionLayer, InlineCollaborationContext, MIN_TOUCH_TARGET, MorphTransitionOverlay, PresentationTransitionOverlay, RemoteSelectionOverlay, RemoteUserCursors, Rendering3DFlagsContext, ResizeHandles, SlideBackgroundImageLayer, SlideLayer, SmartArtRenderer, StaticElementRenderer, ViewerOptionsContext, ViewerOptionsStoreContext, computeToolbarVisibility, createReviewCommentsHost, detectTargetType, imgSrc, isAudienceTab, parseAudienceNonce, parseEmailUrl, parseSlideFromUrl, playAnimationSound, renderStrokeView, renderToCanvas, resolveSmartArtDataPalette, safePrompt, scopeLayoutOptionsToActiveSlide, useAnimationPlayback, useAnnotationHandlers, useAudienceMode, useAutosave, useBroadcastFollower, useCanvasInteractions, useChartFormatContext, useChartPartSelection, useClipboardHandlers, useCollaboration, useCollaborationDocumentSync, useCollaborativeHistory, useCollaborativeState, useComments, useCompatibilityToastsState, useContentLifecycle, useDerivedElementState, useDerivedSlideState, useDialogCustomShows, useEditorHistory, useEditorOperations, useElementManipulation, useElementOperations, useExportHandlers, useExportSaveAs, useFindReplace, useFollowMode, useFontInjection, useGroupAlignLayerHandlers, useIOHandlers, useInsertElements, useIsMobile, useKeyboardInsets, useKeyboardShortcutWiring, useKeyboardShortcuts, useLayoutSwitching, useLoadContent, useMergeShapesHandler, useModalDismissDrag, usePointerHandlers, usePresenceTracking, usePresentationAnnotations, usePresentationKeyboard, usePresentationMode, usePresentationSetup, usePresenterWindow, usePrintHandlers, usePropertyHandlers, useReadOnlyRecommendationState, useRecoveryDetection, useReducedMotion, useRehearsalTimings, useResizablePanels, useSectionOperations, useSerialize, useSheetDismissDrag, useSlideManagement, useSlideNavigation, useSwipeNavigation, useTableOperations, useThemeHandlers, useThemeSwitching, useToolbarVisibility, useTouchGestures, useViewPreferencesSync, useViewerBuildingBlocks, useViewerCoreState, useViewerDialogs, useViewerIntegration, useViewerOptions, useViewerOptionsContext, useViewerState, useViewerUIState, useVirtualizedSlides, useYjsDocumentSync, useYjsProvider, useZoomNavigation, useZoomViewport };
|
|
19166
|
+
export { ACTION_VERB_MAP, ChartFormatContext, ChartPartSelectionProvider, CollaborationCursorOverlay, CollaborationProvider, ElementRenderer, FragmentedTransitionLayer, InlineCollaborationContext, MIN_TOUCH_TARGET, MorphTransitionOverlay, PresentationTransitionOverlay, RemoteSelectionOverlay, RemoteUserCursors, Rendering3DFlagsContext, ResizeHandles, SlideBackgroundImageLayer, SlideLayer, SmartArtRenderer, StaticElementRenderer, ViewerOptionsContext, ViewerOptionsStoreContext, computeToolbarVisibility, createReviewCommentsHost, detectTargetType, imgSrc, isAudienceTab, parseAudienceNonce, parseEmailUrl, parseSlideFromUrl, playAnimationSound, renderStrokeView, renderToCanvas, resolveSmartArtDataPalette, safePrompt, scopeLayoutOptionsToActiveSlide, useAnimationPlayback, useAnnotationHandlers, useAudienceMode, useAutosave, useBroadcastFollower, useCanvasInteractions, useChartFormatContext, useChartPartSelection, useClipboardHandlers, useCollaboration, useCollaborationDocumentSync, useCollaborativeHistory, useCollaborativeState, useComments, useCompatibilityToastsState, useContentLifecycle, useDerivedElementState, useDerivedSlideState, useDialogCustomShows, useEditorHistory, useEditorOperations, useElementManipulation, useElementOperations, useExportHandlers, useExportSaveAs, useFindReplace, useFollowMode, useFontInjection, useGroupAlignLayerHandlers, useIOHandlers, useInsertElements, useIsMobile, useKeyboardInsets, useKeyboardShortcutWiring, useKeyboardShortcuts, useLayoutSwitching, useLoadContent, useMergeShapesHandler, useModalDismissDrag, usePointerHandlers, usePresenceTracking, usePresentationAnnotations, usePresentationKeyboard, usePresentationMode, usePresentationSetup, usePresenterWindow, usePrintHandlers, usePropertyHandlers, useReadOnlyRecommendationState, useRecoveryDetection, useReducedMotion, useRehearsalTimings, useReportOnChange, useResizablePanels, useSectionOperations, useSerialize, useSheetDismissDrag, useSlideManagement, useSlideNavigation, useSwipeNavigation, useTableOperations, useThemeHandlers, useThemeSwitching, useToolbarVisibility, useTouchGestures, useViewPreferencesSync, useViewerBuildingBlocks, useViewerCoreState, useViewerDialogs, useViewerIntegration, useViewerOptions, useViewerOptionsContext, useViewerState, useViewerUIState, useVirtualizedSlides, useYjsDocumentSync, useYjsProvider, useZoomNavigation, useZoomViewport, withDisplayName };
|