pptx-react-viewer 4.6.0 → 4.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/{AiChatPanel-3C7GM6ZF.js → AiChatPanel-3YILWCBX.js} +28 -28
  3. package/dist/AiChatPanel-3YILWCBX.js.br +0 -0
  4. package/dist/AiChatPanel-3YILWCBX.js.gz +0 -0
  5. package/dist/{AiChatPanel-L7DBCWE3.mjs → AiChatPanel-X2MVL5UP.mjs} +4 -4
  6. package/dist/AiChatPanel-X2MVL5UP.mjs.br +0 -0
  7. package/dist/AiChatPanel-X2MVL5UP.mjs.gz +0 -0
  8. package/dist/{Model3DScene-USKNPWWH.js → Model3DScene-G7P6ZAIO.js} +2 -2
  9. package/dist/{Model3DScene-USKNPWWH.js.br → Model3DScene-G7P6ZAIO.js.br} +0 -0
  10. package/dist/Model3DScene-G7P6ZAIO.js.gz +0 -0
  11. package/dist/{Model3DScene-IJ7YYTYU.mjs → Model3DScene-QFWI5CEE.mjs} +1 -1
  12. package/dist/Model3DScene-QFWI5CEE.mjs.br +0 -0
  13. package/dist/Model3DScene-QFWI5CEE.mjs.gz +0 -0
  14. package/dist/{chunk-5V5SMT5A.js → chunk-2BM4GBFZ.js} +5 -5
  15. package/dist/chunk-2BM4GBFZ.js.br +0 -0
  16. package/dist/chunk-2BM4GBFZ.js.gz +0 -0
  17. package/dist/{chunk-K6QHGABT.mjs → chunk-5J6NW3YS.mjs} +55 -28
  18. package/dist/chunk-5J6NW3YS.mjs.br +0 -0
  19. package/dist/chunk-5J6NW3YS.mjs.gz +0 -0
  20. package/dist/{chunk-FZSYLXJT.js → chunk-AQIXKTAT.js} +13118 -8704
  21. package/dist/chunk-AQIXKTAT.js.br +0 -0
  22. package/dist/chunk-AQIXKTAT.js.gz +0 -0
  23. package/dist/{chunk-VCAQSSGD.mjs → chunk-E5OIDWHO.mjs} +1 -1
  24. package/dist/chunk-E5OIDWHO.mjs.br +0 -0
  25. package/dist/chunk-E5OIDWHO.mjs.gz +0 -0
  26. package/dist/{chunk-Y4QUVWZC.js → chunk-FYAOOACZ.js} +241 -214
  27. package/dist/chunk-FYAOOACZ.js.br +0 -0
  28. package/dist/chunk-FYAOOACZ.js.gz +0 -0
  29. package/dist/{chunk-INX3E37P.mjs → chunk-OECUSL2B.mjs} +80 -283
  30. package/dist/chunk-OECUSL2B.mjs.br +0 -0
  31. package/dist/chunk-OECUSL2B.mjs.gz +0 -0
  32. package/dist/{chunk-ICEZL4TM.mjs → chunk-QLDHUKH2.mjs} +13074 -8701
  33. package/dist/chunk-QLDHUKH2.mjs.br +0 -0
  34. package/dist/chunk-QLDHUKH2.mjs.gz +0 -0
  35. package/dist/{chunk-IBHIXBC5.js → chunk-SR7ETIBF.js} +889 -1091
  36. package/dist/chunk-SR7ETIBF.js.br +0 -0
  37. package/dist/chunk-SR7ETIBF.js.gz +0 -0
  38. package/dist/{chunk-ZAQFTO4P.mjs → chunk-UBYFLXAU.mjs} +1174 -148
  39. package/dist/chunk-UBYFLXAU.mjs.br +0 -0
  40. package/dist/chunk-UBYFLXAU.mjs.gz +0 -0
  41. package/dist/{chunk-3JUZOKFI.js → chunk-UIAU3NR2.js} +44 -0
  42. package/dist/chunk-UIAU3NR2.js.br +0 -0
  43. package/dist/chunk-UIAU3NR2.js.gz +0 -0
  44. package/dist/{chunk-DFSWCVRW.js → chunk-VF4RA27Q.js} +3082 -2056
  45. package/dist/chunk-VF4RA27Q.js.br +0 -0
  46. package/dist/chunk-VF4RA27Q.js.gz +0 -0
  47. package/dist/{chunk-OOO4JL2N.mjs → chunk-WIEBQGQI.mjs} +44 -0
  48. package/dist/chunk-WIEBQGQI.mjs.br +0 -0
  49. package/dist/chunk-WIEBQGQI.mjs.gz +0 -0
  50. package/dist/i18n/de.cjs +70 -21
  51. package/dist/i18n/de.cjs.br +0 -0
  52. package/dist/i18n/de.cjs.gz +0 -0
  53. package/dist/i18n/de.mjs +70 -21
  54. package/dist/i18n/de.mjs.br +0 -0
  55. package/dist/i18n/de.mjs.gz +0 -0
  56. package/dist/i18n/es.cjs +70 -21
  57. package/dist/i18n/es.cjs.br +0 -0
  58. package/dist/i18n/es.cjs.gz +0 -0
  59. package/dist/i18n/es.mjs +70 -21
  60. package/dist/i18n/es.mjs.br +0 -0
  61. package/dist/i18n/es.mjs.gz +0 -0
  62. package/dist/i18n/fr.cjs +70 -21
  63. package/dist/i18n/fr.cjs.br +0 -0
  64. package/dist/i18n/fr.cjs.gz +0 -0
  65. package/dist/i18n/fr.mjs +70 -21
  66. package/dist/i18n/fr.mjs.br +0 -0
  67. package/dist/i18n/fr.mjs.gz +0 -0
  68. package/dist/i18n/zh-CN.cjs +48 -4
  69. package/dist/i18n/zh-CN.cjs.br +0 -0
  70. package/dist/i18n/zh-CN.cjs.gz +0 -0
  71. package/dist/i18n/zh-CN.mjs +48 -4
  72. package/dist/i18n/zh-CN.mjs.br +0 -0
  73. package/dist/i18n/zh-CN.mjs.gz +0 -0
  74. package/dist/i18n.js +4 -4
  75. package/dist/i18n.js.br +0 -0
  76. package/dist/i18n.js.gz +0 -0
  77. package/dist/i18n.mjs +1 -1
  78. package/dist/i18n.mjs.br +0 -0
  79. package/dist/i18n.mjs.gz +0 -0
  80. package/dist/index.d.ts +177 -15
  81. package/dist/index.js +63 -63
  82. package/dist/index.js.br +0 -0
  83. package/dist/index.js.gz +0 -0
  84. package/dist/index.mjs +6 -6
  85. package/dist/index.mjs.br +0 -0
  86. package/dist/index.mjs.gz +0 -0
  87. package/dist/internals.d.ts +230 -15
  88. package/dist/internals.js +105 -105
  89. package/dist/internals.js.br +0 -0
  90. package/dist/internals.js.gz +0 -0
  91. package/dist/internals.mjs +4 -4
  92. package/dist/internals.mjs.br +0 -0
  93. package/dist/internals.mjs.gz +0 -0
  94. package/dist/pptx-viewer.css +1 -1
  95. package/dist/pptx-viewer.css.br +0 -0
  96. package/dist/pptx-viewer.css.gz +0 -0
  97. package/dist/viewer/index.d.ts +149 -13
  98. package/dist/viewer/index.js +27 -27
  99. package/dist/viewer/index.js.br +0 -0
  100. package/dist/viewer/index.js.gz +0 -0
  101. package/dist/viewer/index.mjs +6 -6
  102. package/dist/viewer/index.mjs.br +3 -3
  103. package/dist/viewer/index.mjs.gz +0 -0
  104. package/package.json +1 -1
  105. package/dist/AiChatPanel-3C7GM6ZF.js.br +0 -0
  106. package/dist/AiChatPanel-3C7GM6ZF.js.gz +0 -0
  107. package/dist/AiChatPanel-L7DBCWE3.mjs.br +0 -0
  108. package/dist/AiChatPanel-L7DBCWE3.mjs.gz +0 -0
  109. package/dist/Model3DScene-IJ7YYTYU.mjs.br +0 -0
  110. package/dist/Model3DScene-IJ7YYTYU.mjs.gz +0 -0
  111. package/dist/Model3DScene-USKNPWWH.js.gz +0 -0
  112. package/dist/chunk-3JUZOKFI.js.br +0 -0
  113. package/dist/chunk-3JUZOKFI.js.gz +0 -0
  114. package/dist/chunk-5V5SMT5A.js.br +0 -0
  115. package/dist/chunk-5V5SMT5A.js.gz +0 -0
  116. package/dist/chunk-DFSWCVRW.js.br +0 -0
  117. package/dist/chunk-DFSWCVRW.js.gz +0 -0
  118. package/dist/chunk-FZSYLXJT.js.br +0 -0
  119. package/dist/chunk-FZSYLXJT.js.gz +0 -0
  120. package/dist/chunk-IBHIXBC5.js.br +0 -0
  121. package/dist/chunk-IBHIXBC5.js.gz +0 -0
  122. package/dist/chunk-ICEZL4TM.mjs.br +0 -0
  123. package/dist/chunk-ICEZL4TM.mjs.gz +0 -0
  124. package/dist/chunk-INX3E37P.mjs.br +0 -0
  125. package/dist/chunk-INX3E37P.mjs.gz +0 -0
  126. package/dist/chunk-K6QHGABT.mjs.br +0 -0
  127. package/dist/chunk-K6QHGABT.mjs.gz +0 -0
  128. package/dist/chunk-OOO4JL2N.mjs.br +0 -0
  129. package/dist/chunk-OOO4JL2N.mjs.gz +0 -0
  130. package/dist/chunk-VCAQSSGD.mjs.br +0 -0
  131. package/dist/chunk-VCAQSSGD.mjs.gz +0 -0
  132. package/dist/chunk-Y4QUVWZC.js.br +0 -0
  133. package/dist/chunk-Y4QUVWZC.js.gz +0 -0
  134. package/dist/chunk-ZAQFTO4P.mjs.br +0 -0
  135. package/dist/chunk-ZAQFTO4P.mjs.gz +0 -0
Binary file
Binary file
@@ -1,6 +1,6 @@
1
- import { DEFAULT_STROKE_COLOR, getConnectorPathGeometry, buildLineShadowCss, buildLineGlowFilter, renderConnectorMarker, getShapeVisualStyle, getTextStyleForElement, DEFAULT_TEXT_COLOR, renderVectorShape, isConnectorOrLineElement, build3DExtrusionData, getImageRenderStyle, cn, getImageSurfaceStyle, getTextLayoutStyle, renderTableElement, renderMediaElement, shouldRenderFallbackLabel, DEFAULT_FILL_COLOR, getCropShapeClipPath, hasDagDuotoneEffect, renderDagDuotoneSvgFilter, getImageSurfaceMaskStyle, getDuotoneColors, getTextWarpStyle, renderTextSegments, buildReactChartViewModel, renderChartElement, MIN_ELEMENT_SIZE, buildTextBody3DSceneStyle, getImageTilingStyle, DEFAULT_TEXT_FONT_SIZE, DEFAULT_FONT_FAMILY, HYPERLINK_COLOR, cloneHistorySnapshot, ZOOM_TO_SELECTION_PADDING, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, UNGROUPED_SECTION_ID, DEFAULT_SECTION_GROUP_ID, DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, buildPdfFromTiledImageData, GRID_SIZE, buildNotesPdf } from './chunk-K6QHGABT.mjs';
2
- import { GlyphOutlineFontCache, createGlyphOutlineLookup, DEFAULT_VIEWER_OPTIONS, TOOLBAR_TABS, defineThreeViewElement, getSelectionControlArtworkStyle, hasShapeProperties, normalizeHexColor, colorWithOpacity, normalizeStrokeDashType, getSvgStrokeDasharray, getCompoundLineOffsets, getCompoundLineWidths, svgLineCap, hasTextProperties, getSelectionOutlineColor, connectorWrapperTransform, getAriaRoleDescription, getAriaLabel, getAriaRole, resolveElementInteractivity, isEditableTextElement, buildTextStyleOverrideCss, isElementRendered, resolveElementAriaAttributes, isMediaFullscreenActive, shouldRenderHitTarget, elementHitTargetStyle, getImageEffectsOpacity, getImageEffectsFilter, inlineElementPointerEvents, isHollowShapeElement, LINK_TOOLTIP_HOST_CLASS, ACTION_BUTTON_PRESETS, mediaTransportVisible, isInkElement, oleActionsVisible, getGroupChildParentFill, getElementLabel, getResizeHandleHitAreaStyle, paintedStrokeWidth, buildCssGradientFromShapeStyle, ensureActionAffordanceStyles, resolveElementActionAffordance, actionAffordanceLabels, paintedElementSize, MEDIA_FULLSCREEN_OVERLAY_STYLE, elementContainerHeightStyle, getElementTransform, resolveElementHighlightClick, applyHighlightClickStyle, getComputedEffectStyle, getSoftEdgeSvgFilter, getEffectStyleSource, getBevelLightingSvgFilter, buildStrokeOutline, buildHollowHitOutline, buildSubpathFillOverlay, isImageLikeElement, strokeOutlineViewBox, resolveRevealedSmartArtNodes, resolveRevealedDrawingShapes, buildSmartArtA11y, canDrillDown, computeSmartArtElementLayout, flattenNodes, buildSummaryZoomView, isImageTiled, getImageColorWashStyle, readEditableText, placeCaretAtEnd, getPendingSelectionRestore, restoreSegmentSelection, getTextCompensationTransform, mapInlineTextFormatKey, subscribeBarFacePicturePixelSamples, getBarFacePicturePixelSampleVersion, ensureChartInteractionStyles, applyChartPartHighlight, resolveRevealedChartData, formatAxisValue, buildInkGroupStrokes, getInkReplayStyles, INK_REPLAY_KEYFRAMES, buildContentPartStrokes, getContentPartReplayStyles, resolveOleType, getOleAriaLabel, getOleTypeColor, getOleTypeLabel, filterRenderedElements, resolveGroupChildFill, isLinkedTextBox, getOverflowSegments, shouldUseSvgWarp, getTextBodyRotationTransform, placeholderPromptDescriptor, 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, DEFAULT_PALETTE2, resolvePalette, computeDrawingViewBox, projectDrawingShapes, resolveRevealedDrawingShapeNodeIds, styleShadowFilter, buildChromeStyle, measureSvgViewportRect, modelDataToBlobUrl, resolveZoomNavigationTarget, getImageSvgFilters, getCachedNativeImageSize, probeNativeImageSize, buildDuotoneCacheKey, getDuotoneCachedResult, applyDuotone, setDuotoneCachedResult, buildCacheKey, DEFAULT_COLOR_CHANGE_TOLERANCE, getCachedResult, applyColorChange, setCachedResult, inlineListBodyText, createInlineListSeed, readListActivationSelection, createInlineListModelObserver, attachCollaborationInlineEditor, bindInlineListParagraph, bindInlineListRun, attachInlineListController, restoreInlineListBodySelection, getInlineEditorSelectionResult, isBulletMarkerSegment, resolveChartThreeViewSpec, applyChart3DDrag, applyChart3DSelect, findChartPartTarget, withChartTitle, resolveSmartArtThreeViewSpec, isBrowserOpenableMime, formatBytes, getOleDisplayName, getOleBadgeLabel, openUrlInNewTab, getSubstituteFontFamily, hasGlyphEnvelope, buildGlyphEnvelopeBlock, getWarpPath, isWedgeCalloutPresetShape, isElementActionable, centeredSvgTextLines, findSmartArtNodeText, setSmartArtNodeStyle, rebuildDrawingShapesIfCleared, shouldCommitSmartArtNodeText, updateSmartArtNodeText, advanceChartMarkDrag, advanceChartValueDrag, resolveChartKind, buildChartMarkDragGeometry, beginChartMarkDrag, beginChartValueDrag, groupIntoParagraphs, substituteFieldText, computeInlineEditorRect, MIN_TOUCH_TARGET_PX, computeVirtualRange, DEFAULT_VIRTUAL_OVERSCAN, createSyncGate, clearLocalAwareness, validateRoomId, createDepartureChannel, resolveTransportForServerUrl, isMixedContentBlocked, CONNECTION_TIMEOUT_MS, registerCollaborationTeardown, createPresenceProjector, BROADCAST_THROTTLE_MS, sanitizeColor, cloneTemplateElementsBySlideId, cloneSlide, 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, PptxHandler, createPresentationLoadResources, collectMediaElements, resolveMediaElementSource, collectImagePaths, applyImagePathPatches, resolveTableCellImageUrls, resolveTableStyleImageUrls, partitionTemplateElements, seedRecentColors, resolveAuthoredCustomShowId, buildInitialGuides, readOnlyRecommendation, compatibilityWarningToasts, EncryptedFileError, resolveAutosaveIntervalMs, shouldWriteAutosaveSnapshot, saveAutosaveSnapshot, autosaveSnapshotMark, updateMasterViewElement, isTemplateElementId, updateElement, masterViewElements, replaceMasterViewElements, addSection, renameSection, deleteSection, moveSectionUp, moveSectionDown, moveSlidesToSection, canInteractWithElement, prepareExportClone, normalizeColorsForCapture, preprocessCssForCapture, slideProgressPercent, slideStatusLabel, EXPORT_ASSEMBLING_PERCENT, EXPORT_DONE_PERCENT, isExportAbortError, resolveImageResolutionScale, applyThemeToData, THEME_PRESETS, themeColorSchemesEqual, comparePresentation, applyAcceptSlide, applyAcceptAllSlides, collectUsedFonts, describeFontEmbedding, isMobileViewport, resolveAuthoredSlideRange, mayLeaveSlideShow, stopAllPersistentAudio, guidePxToEmu, buildSaveSlides, buildDeckSaveOptions, resolveSlideSizeSelection, saveDeckWithPassword, shouldProbeAutosaveRecovery, probeAutosaveRecovery, acceptAutosaveRecovery, acknowledgeAutosaveRecovery, discardAutosaveRecovery, shouldLoopContinuously, applyRehearsalTimings, rasterResultToPngBlob, downloadBlob, elementPictureFilename, collectReferencedFontFamilies, resolveGoogleWebfontHref, syncGoogleWebfontStylesheet, selectGoogleWebfontFamilies, fetchGoogleWebfontOutlineBytes, isFeatureEnabled, mapSlideShowStartKey, mapCustomizedEditorKey, isEditorControlTarget, isEditorTextInputTarget, textFontSizePtToPx, stepFontSizePt, textFontSizePxToPt, cycleSelectableElement, createCustomizationController, prepareElementForInsertion, createViewerOptionsStore, observeYDocSlides, LOCAL_SYNC_ORIGIN, readSlidesFromYDoc, shouldRoomSlidesReplaceLoad, reconcileSlidesInYDoc, shouldAutoFollowBroadcaster, detectTouchDevice, detectOrientation, deriveViewportBreakpoints, createTouchGestureRecognizer, MAX_ZOOM_SCALE, MIN_ZOOM_SCALE, isKeyboardOpen, scopeLayoutOptionsToSlide, checkModifyPassword, viewerPreferencesFromViewProperties, DEFAULT_VIEWER_PREFERENCES, viewPropertiesPatchFromPreferences, openPptxFile, readBackstageRecentFile, resolveCollaborationShellEditability, resolveCollaborationShellState, MORPH_CROSSFADE_GROUP_STYLE, MORPH_CROSSFADE_HALF_STYLE, getSlideTransitionAnimations, getFragmentedTransitionDescriptor, SLIDE_TRANSITION_KEYFRAMES, isActionHidden, buildInlineTextCommitPatch, resolveInlineEditAutoFitHeight, resolveInlineEditNormAutofitShrink, filterInteractableIds, beginShapeAdjustment, buildElementClipboardPayload, contextMenuInspectorAnchor, savedPresentationFileName, exportDeckJson, groupElements, generateElementId, makeCloneId, ungroupElements, alignElements, distributeElements, newTableElement, createDefaultChartElement, readViewportMetrics, computeKeyboardInset, mergeShapes, mapPresentationKey, lastShowSlideIndex, mapPresentationWheel, openPendingPrintWindow, computeColorFilter, filterHiddenSlideIndices, computeSlideIndices, buildPrintDocument, finishPrintWindow, buildPrintHtmlDocument, buildOutlineHtml, buildSlidesHtml, buildNotesHtml, buildHandoutsHtml, createBlankSlide, makeSlideId, buildSlideTemplateSlide, templateSchemeFromTheme, buildThemeColorMap, reResolveSlideColors, reResolveElementColors, resolveViewportFitOptions, calculateViewportFit, scheduleAutoAdvanceChain, computeEntranceAnimationDelay, createPresentationSessionId, resolveTransitionDurationMs, resolveTransitionSoundAction, runPresentationAction, safeOpenUrl, buildRunProgramNotice, toggleStageElementMedia, resolveOleVerbTarget, downloadDataUrl, createPresenterTimer, createInitialPresentationSnapshot, mergePresentationSnapshot, resetPresenterTimer, presenterElapsed, stepPresenterZoom, togglePresenterTimer, addCommentToList, removeCommentFromList, editCommentInList, toggleCommentResolvedInList, remapTextToSegments, buildInlineListStylePatch, applyActiveInlineListFormatting, applyListStyleUpdate, setPendingSelectionRestore, applyTextStyleUpdate, toggleSelectionBullets, transformInlineListCase, applyCaseTransformToSegments, transformTextCase, resolveExportCaptureDecision, recordProgressPercent, computeGridSpacingPx, resolveShowSlideIndexes, groupSlidesBySection, masterViewPseudoSlide, overlayMasterViewInlineSnapshot, overlayInlineTextSnapshot, rasterizeElement, cloneElementForPaste, applyPasteSpecialFormat, buildRasterPictureElement, copyFormatFromElement, cloneElementUpdates, assertElementUpdateTarget, prepareElementUpdateBatch, createWriteBackScheduler, observeExternalCollaborationReadiness, resolveHistoryDepth, hasCopyableFormat, createBackstagePresentation, buildFieldSubstitutionContext, scrollInspectorSectionIntoView, computeScrollDelta, getPresetShapeClipPath, svgPathToPolygons, polygonsToSvgPath, rerouteConnectorsForMovedElements, applyReroutedConnectors, SvgExporter, replyToCommentInList, removeTableElementColumn, insertTableElementColumn, removeTableElementRow, insertTableElementRow, updateCellTextStyleInRawXml, setCellText, updateCellTextInRawXml, splitCell, updateMergeAttrsInRawXml, mergeCells, 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, canvasToJpegData, applyFormatToElement, createSnapshotTextPositions, isPpactionUrl, parsePpactionUrl, resolvePresentationAction, elementActionToPptxAction, isUrlSafe, buildSmartArtPresetData, classifyMediaType, computeSnapToShape, publishLiveGeometry, getDraggedShapeAdjustments, computeMarqueeHitIds, mergeAdditiveSelection, rasterizeElementTiledToCanvas, borrowExternalCollaborationAwareness, observeExternalCollaborationSession, clampGifDimensions, rasterResultToPngDataUrl, shouldConfirmExternalHyperlink, applyResize, lockResizeAspect, snapBoxToGrid, applyMotionPathPreset, bringForward, sendBackward, bringToFront, sendToBack } from './chunk-ICEZL4TM.mjs';
3
- import { translationsEn } from './chunk-OOO4JL2N.mjs';
1
+ import { DEFAULT_STROKE_COLOR, getConnectorPathGeometry, buildLineShadowCss, buildLineGlowFilter, renderConnectorMarker, getShapeVisualStyle, getTextStyleForElement, DEFAULT_TEXT_COLOR, renderVectorShape, isConnectorOrLineElement, build3DExtrusionData, getImageRenderStyle, cn, getImageSurfaceStyle, getTextLayoutStyle, renderTableElement, renderMediaElement, shouldRenderFallbackLabel, DEFAULT_FILL_COLOR, getCropShapeClipPath, hasDagDuotoneEffect, renderDagDuotoneSvgFilter, getImageSurfaceMaskStyle, getDuotoneColors, getTextWarpStyle, renderTextSegments, buildReactChartViewModel, renderChartElement, MIN_ELEMENT_SIZE, buildTextBody3DSceneStyle, getImageTilingStyle, DEFAULT_TEXT_FONT_SIZE, DEFAULT_FONT_FAMILY, HYPERLINK_COLOR, cloneHistorySnapshot, ZOOM_TO_SELECTION_PADDING, DEFAULT_CANVAS_HEIGHT, DEFAULT_CANVAS_WIDTH, UNGROUPED_SECTION_ID, DEFAULT_SECTION_GROUP_ID, DEFAULT_TABLE_ROWS, DEFAULT_TABLE_COLUMNS, buildPdfFromTiledImageData, GRID_SIZE, buildNotesPdf } from './chunk-5J6NW3YS.mjs';
2
+ import { GlyphOutlineFontCache, createGlyphOutlineLookup, DEFAULT_VIEWER_OPTIONS, TOOLBAR_TABS, defineThreeViewElement, getSelectionControlArtworkStyle, hasShapeProperties, normalizeHexColor, colorWithOpacity, normalizeStrokeDashType, getSvgStrokeDasharray, getCompoundLineOffsets, getCompoundLineWidths, svgLineCap, hasTextProperties, getSelectionOutlineColor, connectorWrapperTransform, getAriaRoleDescription, getAriaLabel, getAriaRole, resolveElementInteractivity, isEditableTextElement, buildTextStyleOverrideCss, isElementRendered, resolveElementAriaAttributes, isMediaFullscreenActive, shouldRenderHitTarget, elementHitTargetStyle, getImageEffectsOpacity, getImageEffectsFilter, inlineElementPointerEvents, isHollowShapeElement, LINK_TOOLTIP_HOST_CLASS, ACTION_BUTTON_PRESETS, mediaTransportVisible, isInkElement, oleActionsVisible, getGroupChildParentFill, getElementLabel, getResizeHandleHitAreaStyle, paintedStrokeWidth, buildCssGradientFromShapeStyle, ensureActionAffordanceStyles, resolveElementActionAffordance, actionAffordanceLabels, paintedElementSize, MEDIA_FULLSCREEN_OVERLAY_STYLE, elementContainerHeightStyle, getElementTransform, resolveElementHighlightClick, applyHighlightClickStyle, getComputedEffectStyle, getSoftEdgeSvgFilter, getEffectStyleSource, getBevelLightingSvgFilter, buildStrokeOutline, buildHollowHitOutline, buildSubpathFillOverlay, isImageLikeElement, strokeOutlineViewBox, resolveRevealedSmartArtNodes, resolveRevealedDrawingShapes, buildSmartArtA11y, canDrillDown, computeSmartArtElementLayout, flattenNodes, buildSummaryZoomView, isImageTiled, getImageColorWashStyle, readEditableText, placeCaretAtEnd, getPendingSelectionRestore, restoreSegmentSelection, getTextCompensationTransform, mapInlineTextFormatKey, subscribeBarFacePicturePixelSamples, getBarFacePicturePixelSampleVersion, ensureChartInteractionStyles, applyChartPartHighlight, resolveRevealedChartData, formatAxisValue, buildInkGroupStrokes, getInkReplayStyles, INK_REPLAY_KEYFRAMES, buildContentPartStrokes, getContentPartReplayStyles, resolveOleType, getOleAriaLabel, getOleTypeColor, getOleTypeLabel, filterRenderedElements, resolveGroupChildFill, isLinkedTextBox, getOverflowSegments, shouldUseSvgWarp, getTextBodyRotationTransform, placeholderPromptDescriptor, 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, DEFAULT_PALETTE2, resolvePalette, computeDrawingViewBox, projectDrawingShapes, resolveRevealedDrawingShapeNodeIds, styleShadowFilter, buildChromeStyle, measureSvgViewportRect, modelDataToBlobUrl, resolveZoomNavigationTarget, getImageSvgFilters, getCachedNativeImageSize, probeNativeImageSize, buildDuotoneCacheKey, getDuotoneCachedResult, applyDuotone, setDuotoneCachedResult, buildCacheKey, DEFAULT_COLOR_CHANGE_TOLERANCE, getCachedResult, applyColorChange, setCachedResult, inlineListBodyText, createInlineListSeed, readListActivationSelection, createInlineListModelObserver, attachCollaborationInlineEditor, bindInlineListParagraph, bindInlineListRun, attachInlineListController, restoreInlineListBodySelection, getInlineEditorSelectionResult, isBulletMarkerSegment, resolveChartThreeViewSpec, applyChart3DDrag, applyChart3DSelect, findChartPartTarget, withChartTitle, resolveSmartArtThreeViewSpec, isBrowserOpenableMime, formatBytes, getOleDisplayName, getOleBadgeLabel, openUrlInNewTab, getSubstituteFontFamily, hasGlyphEnvelope, buildGlyphEnvelopeBlock, getWarpPath, isWedgeCalloutPresetShape, isElementActionable, centeredSvgTextLines, findSmartArtNodeText, setSmartArtNodeStyle, rebuildDrawingShapesIfCleared, shouldCommitSmartArtNodeText, updateSmartArtNodeText, advanceChartMarkDrag, advanceChartValueDrag, resolveChartKind, buildChartMarkDragGeometry, beginChartMarkDrag, beginChartValueDrag, groupIntoParagraphs, substituteFieldText, computeInlineEditorRect, MIN_TOUCH_TARGET_PX, computeVirtualRange, DEFAULT_VIRTUAL_OVERSCAN, createSyncGate, clearLocalAwareness, validateRoomId, createDepartureChannel, resolveTransportForServerUrl, isMixedContentBlocked, CONNECTION_TIMEOUT_MS, registerCollaborationTeardown, createPresenceProjector, BROADCAST_THROTTLE_MS, sanitizeColor, cloneTemplateElementsBySlideId, cloneSlide, 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, PptxHandler, createPresentationLoadResources, collectMediaElements, resolveMediaElementSource, collectImagePaths, applyImagePathPatches, resolveTableCellImageUrls, resolveTableStyleImageUrls, resolveTextFillBlipUrls, partitionTemplateElements, seedRecentColors, resolveAuthoredCustomShowId, buildInitialGuides, readOnlyRecommendation, compatibilityWarningToasts, EncryptedFileError, resolveAutosaveIntervalMs, shouldWriteAutosaveSnapshot, saveAutosaveSnapshot, autosaveSnapshotMark, updateMasterViewElement, isTemplateElementId, updateElement, masterViewElements, replaceMasterViewElements, addSection, renameSection, deleteSection, moveSectionUp, moveSectionDown, moveSlidesToSection, canMergeShapes, canInteractWithElement, prepareExportClone, normalizeColorsForCapture, preprocessCssForCapture, slideProgressPercent, slideStatusLabel, EXPORT_ASSEMBLING_PERCENT, EXPORT_DONE_PERCENT, isExportAbortError, resolveImageResolutionScale, applyThemeToData, THEME_PRESETS, themeColorSchemesEqual, comparePresentation, applyAcceptSlide, applyAcceptAllSlides, collectUsedFonts, describeFontEmbedding, isMobileViewport, resolveAuthoredSlideRange, mayLeaveSlideShow, stopAllPersistentAudio, guidePxToEmu, buildSaveSlides, buildDeckSaveOptions, resolveSlideSizeSelection, saveDeckWithPassword, shouldProbeAutosaveRecovery, probeAutosaveRecovery, acceptAutosaveRecovery, acknowledgeAutosaveRecovery, discardAutosaveRecovery, shouldLoopContinuously, applyRehearsalTimings, rasterResultToPngBlob, downloadBlob, elementPictureFilename, canEditElementPoints, collectReferencedFontFamilies, resolveGoogleWebfontHref, syncGoogleWebfontStylesheet, selectGoogleWebfontFamilies, fetchGoogleWebfontOutlineBytes, isFeatureEnabled, mapSlideShowStartKey, mapCustomizedEditorKey, isEditorControlTarget, isEditorTextInputTarget, textFontSizePtToPx, stepFontSizePt, textFontSizePxToPt, cycleSelectableElement, createCustomizationController, prepareElementForInsertion, createViewerOptionsStore, observeYDocSlides, LOCAL_SYNC_ORIGIN, readSlidesFromYDoc, shouldRoomSlidesReplaceLoad, reconcileSlidesInYDoc, shouldAutoFollowBroadcaster, detectTouchDevice, detectOrientation, deriveViewportBreakpoints, createTouchGestureRecognizer, MAX_ZOOM_SCALE, MIN_ZOOM_SCALE, isKeyboardOpen, scopeLayoutOptionsToSlide, checkModifyPassword, viewerPreferencesFromViewProperties, DEFAULT_VIEWER_PREFERENCES, viewPropertiesPatchFromPreferences, openPptxFile, readBackstageRecentFile, resolveCollaborationShellEditability, resolveCollaborationShellState, MORPH_CROSSFADE_GROUP_STYLE, MORPH_CROSSFADE_HALF_STYLE, getSlideTransitionAnimations, getFragmentedTransitionDescriptor, SLIDE_TRANSITION_KEYFRAMES, isActionHidden, buildInlineTextCommitPatch, resolveInlineEditAutoFitHeight, resolveInlineEditNormAutofitShrink, filterInteractableIds, beginShapeAdjustment, buildElementClipboardPayload, contextMenuInspectorAnchor, savedPresentationFileName, exportDeckJson, groupElements, generateElementId, makeCloneId, ungroupElements, alignElements, distributeElements, newTableElement, createDefaultChartElement, readViewportMetrics, computeKeyboardInset, planMergeShapes, applyMergeShapesPlan, mapPresentationKey, lastShowSlideIndex, mapPresentationWheel, openPendingPrintWindow, computeColorFilter, filterHiddenSlideIndices, computeSlideIndices, buildPrintDocument, finishPrintWindow, buildPrintHtmlDocument, buildOutlineHtml, buildSlidesHtml, buildNotesHtml, buildHandoutsHtml, createBlankSlide, makeSlideId, buildSlideTemplateSlide, templateSchemeFromTheme, buildThemeColorMap, reResolveSlideColors, reResolveElementColors, resolveViewportFitOptions, calculateViewportFit, scheduleAutoAdvanceChain, computeEntranceAnimationDelay, createPresentationSessionId, resolveTransitionDurationMs, resolveTransitionSoundAction, runPresentationAction, safeOpenUrl, buildRunProgramNotice, toggleStageElementMedia, resolveOleVerbTarget, downloadDataUrl, createPresenterTimer, createInitialPresentationSnapshot, mergePresentationSnapshot, resetPresenterTimer, presenterElapsed, stepPresenterZoom, togglePresenterTimer, addCommentToList, removeCommentFromList, editCommentInList, toggleCommentResolvedInList, remapTextToSegments, buildInlineListStylePatch, applyActiveInlineListFormatting, applyListStyleUpdate, setPendingSelectionRestore, applyTextStyleUpdate, toggleSelectionBullets, transformInlineListCase, applyCaseTransformToSegments, transformTextCase, resolveExportCaptureDecision, recordProgressPercent, computeGridSpacingPx, resolveShowSlideIndexes, groupSlidesBySection, masterViewPseudoSlide, overlayMasterViewInlineSnapshot, overlayInlineTextSnapshot, rasterizeElement, cloneElementForPaste, applyPasteSpecialFormat, buildRasterPictureElement, copyFormatFromElement, cloneElementUpdates, assertElementUpdateTarget, prepareElementUpdateBatch, createWriteBackScheduler, observeExternalCollaborationReadiness, resolveHistoryDepth, hasCopyableFormat, createBackstagePresentation, buildFieldSubstitutionContext, scrollInspectorSectionIntoView, computeScrollDelta, rerouteConnectorsForMovedElements, applyReroutedConnectors, SvgExporter, replyToCommentInList, removeTableElementColumn, insertTableElementColumn, removeTableElementRow, insertTableElementRow, updateCellTextStyleInRawXml, setCellText, updateCellTextInRawXml, splitCell, updateMergeAttrsInRawXml, mergeCells, 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, canvasToJpegData, applyFormatToElement, createSnapshotTextPositions, isPpactionUrl, parsePpactionUrl, resolvePresentationAction, elementActionToPptxAction, isUrlSafe, buildSmartArtPresetData, classifyMediaType, computeSnapToShape, publishLiveGeometry, getDraggedShapeAdjustments, computeMarqueeHitIds, mergeAdditiveSelection, rasterizeElementTiledToCanvas, borrowExternalCollaborationAwareness, observeExternalCollaborationSession, clampGifDimensions, rasterResultToPngDataUrl, shouldConfirmExternalHyperlink, applyResize, lockResizeAspect, snapBoxToGrid, applyMotionPathPreset, bringForward, sendBackward, bringToFront, sendToBack } from './chunk-QLDHUKH2.mjs';
3
+ import { translationsEn } from './chunk-WIEBQGQI.mjs';
4
4
  import React17, { createContext, useMemo, useState, useCallback, useEffect, Suspense, useRef, useLayoutEffect, useContext, useSyncExternalStore, useImperativeHandle } from 'react';
5
5
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
6
6
  import { useTranslation } from 'react-i18next';
@@ -3985,6 +3985,28 @@ function useDerivedElementState(input) {
3985
3985
  handoutMasterElements
3986
3986
  };
3987
3987
  }
3988
+ function useEditPointsState() {
3989
+ const [editPointsElementId, setEditPointsElementId] = useState(null);
3990
+ const [activeFreeformTool, setActiveFreeformTool] = useState(null);
3991
+ const enterEditPoints = useCallback((id) => {
3992
+ setEditPointsElementId(id);
3993
+ if (id) {
3994
+ setActiveFreeformTool(null);
3995
+ }
3996
+ }, []);
3997
+ const armFreeformTool = useCallback((tool) => {
3998
+ setActiveFreeformTool(tool);
3999
+ if (tool) {
4000
+ setEditPointsElementId(null);
4001
+ }
4002
+ }, []);
4003
+ return {
4004
+ editPointsElementId,
4005
+ setEditPointsElementId: enterEditPoints,
4006
+ activeFreeformTool,
4007
+ setActiveFreeformTool: armFreeformTool
4008
+ };
4009
+ }
3988
4010
  function useInlineEditingState(onTextChange) {
3989
4011
  const inlineEditingElementIdRef = useRef(null);
3990
4012
  const inlineEditingTextRef = useRef("");
@@ -4086,6 +4108,7 @@ function useViewerCoreState(_input) {
4086
4108
  [livePatcher, slidesRef]
4087
4109
  );
4088
4110
  const inlineEditing = useInlineEditingState(publishInlineText);
4111
+ const editPointsMode = useEditPointsState();
4089
4112
  const [editTemplateMode, setEditTemplateMode] = useState(false);
4090
4113
  const [newShapeType, setNewShapeType] = useState("rect");
4091
4114
  const [clipboardPayload, setClipboardPayload] = useState(null);
@@ -4141,6 +4164,7 @@ function useViewerCoreState(_input) {
4141
4164
  mediaInputRef,
4142
4165
  activeSlideIndexRef,
4143
4166
  ...inlineEditing,
4167
+ ...editPointsMode,
4144
4168
  dragStateRef,
4145
4169
  resizeStateRef,
4146
4170
  shapeAdjustmentDragStateRef,
@@ -4361,12 +4385,22 @@ function useViewerUIState() {
4361
4385
  setEyedropperActive
4362
4386
  };
4363
4387
  }
4388
+ function useCropSessionState() {
4389
+ const [cropSession, setCropSession] = useState(null);
4390
+ const cropSessionRef = useRef(null);
4391
+ const updateCropSession = useCallback((session) => {
4392
+ cropSessionRef.current = session;
4393
+ setCropSession(session);
4394
+ }, []);
4395
+ return { cropSession, cropSessionRef, setCropSession: updateCropSession };
4396
+ }
4364
4397
 
4365
4398
  // src/viewer/hooks/useViewerState.ts
4366
4399
  function useViewerState(input) {
4367
4400
  const core = useViewerCoreState();
4368
4401
  const ui = useViewerUIState();
4369
- return { ...core, ...ui };
4402
+ const crop = useCropSessionState();
4403
+ return { ...core, ...ui, ...crop };
4370
4404
  }
4371
4405
 
4372
4406
  // src/viewer/utils/glyph-outline-cache.ts
@@ -4496,6 +4530,10 @@ function useLoadContent({
4496
4530
  parsed.tableStyleMap,
4497
4531
  (path) => handler.getImageData(path)
4498
4532
  );
4533
+ nextSlides = await resolveTextFillBlipUrls(
4534
+ nextSlides,
4535
+ (path) => handler.getImageData(path)
4536
+ );
4499
4537
  if (cancelled || token !== renderTokenRef.current) {
4500
4538
  return;
4501
4539
  }
@@ -6560,283 +6598,31 @@ function useClipboardHandlers(input) {
6560
6598
  }
6561
6599
 
6562
6600
  // src/viewer/hooks/useMergeShapesHandler.ts
6563
- function isShapeLike(el) {
6564
- return el.type === "shape" || el.type === "image" || el.type === "picture";
6565
- }
6566
- function resolveShapePath(el) {
6567
- if ("pathData" in el && typeof el.pathData === "string" && el.pathData) {
6568
- return el.pathData;
6569
- }
6570
- if ("shapeType" in el && typeof el.shapeType === "string") {
6571
- const clipPath = getPresetShapeClipPath(el.shapeType);
6572
- if (clipPath) {
6573
- const svgPath = clipPathToSvgPath(clipPath, el.width, el.height);
6574
- if (svgPath) {
6575
- return svgPath;
6576
- }
6577
- }
6578
- }
6579
- return `M 0 0 L ${el.width} 0 L ${el.width} ${el.height} L 0 ${el.height} Z`;
6580
- }
6581
- function clipPathToSvgPath(clipPath, width, height) {
6582
- const match = clipPath.match(/polygon\((?<points>[^)]+)\)/iu);
6583
- if (!match?.groups) {
6584
- return null;
6585
- }
6586
- const pairs = match.groups.points.split(",").map((s) => s.trim());
6587
- const points = [];
6588
- for (const pair of pairs) {
6589
- const parts2 = pair.split(/\s+/u);
6590
- if (parts2.length < 2) {
6591
- continue;
6592
- }
6593
- const xStr = parts2[0];
6594
- const yStr = parts2[1];
6595
- let x;
6596
- let y;
6597
- if (xStr.endsWith("%")) {
6598
- x = parseFloat(xStr) / 100 * width;
6599
- } else {
6600
- x = parseFloat(xStr);
6601
- }
6602
- if (yStr.endsWith("%")) {
6603
- y = parseFloat(yStr) / 100 * height;
6604
- } else {
6605
- y = parseFloat(yStr);
6606
- }
6607
- if (!isNaN(x) && !isNaN(y)) {
6608
- points.push({ x, y });
6609
- }
6610
- }
6611
- if (points.length < 3) {
6612
- return null;
6613
- }
6614
- const parts = [`M ${points[0].x} ${points[0].y}`];
6615
- for (let i = 1; i < points.length; i++) {
6616
- parts.push(`L ${points[i].x} ${points[i].y}`);
6617
- }
6618
- parts.push("Z");
6619
- return parts.join(" ");
6620
- }
6621
- function transformPathToGlobal(pathData, el) {
6622
- const polys = svgPathToPolygons(pathData);
6623
- if (polys.length === 0) {
6624
- return pathData;
6625
- }
6626
- let pathW = el.width;
6627
- let pathH = el.height;
6628
- if ("pathWidth" in el && typeof el.pathWidth === "number") {
6629
- pathW = el.pathWidth;
6630
- }
6631
- if ("pathHeight" in el && typeof el.pathHeight === "number") {
6632
- pathH = el.pathHeight;
6633
- }
6634
- const scaleX = pathW > 0 ? el.width / pathW : 1;
6635
- const scaleY = pathH > 0 ? el.height / pathH : 1;
6636
- const transformed = polys.map(
6637
- (poly) => poly.map((pt) => ({
6638
- x: pt.x * scaleX + el.x,
6639
- y: pt.y * scaleY + el.y
6640
- }))
6641
- );
6642
- return polygonsToSvgPath(transformed);
6643
- }
6644
- function transformPathToLocal(pathData, x, y, _width, _height) {
6645
- const polys = svgPathToPolygons(pathData);
6646
- if (polys.length === 0) {
6647
- return pathData;
6648
- }
6649
- const transformed = polys.map(
6650
- (poly) => poly.map((pt) => ({
6651
- x: pt.x - x,
6652
- y: pt.y - y
6653
- }))
6654
- );
6655
- return polygonsToSvgPath(transformed);
6656
- }
6657
- function pathBounds(pathData) {
6658
- const polys = svgPathToPolygons(pathData);
6659
- let minX = Infinity;
6660
- let minY = Infinity;
6661
- let maxX = -Infinity;
6662
- let maxY = -Infinity;
6663
- for (const poly of polys) {
6664
- for (const pt of poly) {
6665
- if (pt.x < minX) {
6666
- minX = pt.x;
6667
- }
6668
- if (pt.y < minY) {
6669
- minY = pt.y;
6670
- }
6671
- if (pt.x > maxX) {
6672
- maxX = pt.x;
6673
- }
6674
- if (pt.y > maxY) {
6675
- maxY = pt.y;
6676
- }
6677
- }
6678
- }
6679
- if (!isFinite(minX)) {
6680
- return { x: 0, y: 0, width: 0, height: 0 };
6681
- }
6682
- return {
6683
- x: minX,
6684
- y: minY,
6685
- width: maxX - minX,
6686
- height: maxY - minY
6687
- };
6688
- }
6689
6601
  function useMergeShapesHandler(input) {
6690
- const {
6691
- activeSlide,
6692
- activeSlideIndex,
6693
- selectedElements,
6694
- effectiveSelectedIds,
6695
- setSelectedElementIds,
6696
- ops,
6697
- history
6698
- } = input;
6699
- const shapeLikeElements = selectedElements.filter(isShapeLike);
6700
- const canMergeShapes = shapeLikeElements.length >= 2;
6602
+ const { activeSlide, activeSlideIndex, selectedElements, ops, history } = input;
6603
+ const canMergeShapes2 = canMergeShapes(selectedElements);
6701
6604
  const handleMergeShapes = (operation) => {
6702
- if (!canMergeShapes || !activeSlide) {
6605
+ if (!activeSlide) {
6703
6606
  return;
6704
6607
  }
6705
- const targets = shapeLikeElements;
6706
- if (targets.length < 2) {
6608
+ const plan = planMergeShapes(operation, selectedElements);
6609
+ if (!plan) {
6707
6610
  return;
6708
6611
  }
6709
- const globalPaths = targets.map((el) => {
6710
- const localPath = resolveShapePath(el);
6711
- return transformPathToGlobal(localPath, el);
6712
- });
6713
- if (operation === "fragment") {
6714
- let allFragments = [];
6715
- let remaining = globalPaths[0];
6716
- for (let i = 1; i < globalPaths.length; i++) {
6717
- const frags = mergeShapes("fragment", remaining, globalPaths[i]);
6718
- if (Array.isArray(frags)) {
6719
- allFragments = frags;
6720
- }
6721
- if (i < globalPaths.length - 1 && allFragments.length > 0) {
6722
- remaining = allFragments[0];
6723
- }
6724
- }
6725
- if (allFragments.length === 0) {
6726
- return;
6727
- }
6728
- const idSet = new Set(effectiveSelectedIds);
6729
- const newElements = [];
6730
- for (const frag of allFragments) {
6731
- if (!frag) {
6732
- continue;
6733
- }
6734
- const bounds = pathBounds(frag);
6735
- if (bounds.width <= 0 || bounds.height <= 0) {
6736
- continue;
6737
- }
6738
- const localPath = transformPathToLocal(
6739
- frag,
6740
- bounds.x,
6741
- bounds.y,
6742
- bounds.width,
6743
- bounds.height
6744
- );
6745
- const newEl = {
6746
- id: generateElementId(),
6747
- type: "shape",
6748
- x: bounds.x,
6749
- y: bounds.y,
6750
- width: bounds.width,
6751
- height: bounds.height,
6752
- rotation: 0,
6753
- flipHorizontal: false,
6754
- flipVertical: false,
6755
- hidden: false,
6756
- opacity: targets[0].opacity ?? 1,
6757
- rawXml: {},
6758
- shapeStyle: {
6759
- ...targets[0].shapeStyle
6760
- },
6761
- shapeType: "custGeom",
6762
- pathData: localPath,
6763
- pathWidth: bounds.width,
6764
- pathHeight: bounds.height
6765
- };
6766
- newElements.push(newEl);
6767
- }
6768
- if (newElements.length === 0) {
6769
- return;
6770
- }
6771
- ops.updateSlides(
6772
- (prev) => prev.map(
6773
- (s, i) => i === activeSlideIndex ? {
6774
- ...s,
6775
- elements: [...s.elements.filter((el) => !idSet.has(el.id)), ...newElements]
6776
- } : s
6777
- )
6778
- );
6779
- setSelectedElementIds(newElements.map((el) => el.id));
6780
- history.markDirty();
6781
- } else {
6782
- let resultPath = globalPaths[0];
6783
- for (let i = 1; i < globalPaths.length; i++) {
6784
- const result = mergeShapes(operation, resultPath, globalPaths[i]);
6785
- if (typeof result === "string") {
6786
- resultPath = result;
6787
- }
6788
- }
6789
- if (!resultPath) {
6790
- return;
6791
- }
6792
- const bounds = pathBounds(resultPath);
6793
- if (bounds.width <= 0 || bounds.height <= 0) {
6794
- return;
6795
- }
6796
- const localPath = transformPathToLocal(
6797
- resultPath,
6798
- bounds.x,
6799
- bounds.y,
6800
- bounds.width,
6801
- bounds.height
6802
- );
6803
- const primary = targets[0];
6804
- const newEl = {
6805
- id: generateElementId(),
6806
- type: "shape",
6807
- x: bounds.x,
6808
- y: bounds.y,
6809
- width: bounds.width,
6810
- height: bounds.height,
6811
- rotation: 0,
6812
- flipHorizontal: false,
6813
- flipVertical: false,
6814
- hidden: false,
6815
- opacity: primary.opacity ?? 1,
6816
- rawXml: {},
6817
- shapeStyle: { ...primary.shapeStyle },
6818
- shapeType: "custGeom",
6819
- pathData: localPath,
6820
- pathWidth: bounds.width,
6821
- pathHeight: bounds.height
6822
- };
6823
- const idSet = new Set(effectiveSelectedIds);
6824
- ops.updateSlides(
6825
- (prev) => prev.map(
6826
- (s, i) => i === activeSlideIndex ? {
6827
- ...s,
6828
- elements: [...s.elements.filter((el) => !idSet.has(el.id)), newEl]
6829
- } : s
6830
- )
6831
- );
6832
- ops.applySelection(newEl.id);
6833
- history.markDirty();
6612
+ const onSlide = new Set(activeSlide.elements.map((el) => el.id));
6613
+ if (!plan.removedIds.every((id) => onSlide.has(id))) {
6614
+ return;
6834
6615
  }
6616
+ ops.updateSlides(
6617
+ (prev) => prev.map(
6618
+ (slide, i) => i === activeSlideIndex ? { ...slide, elements: applyMergeShapesPlan(slide.elements, plan) } : slide
6619
+ )
6620
+ );
6621
+ const createdIds = plan.created.map((el) => el.id);
6622
+ ops.applySelection(createdIds[0] ?? null, createdIds.length > 1 ? createdIds : []);
6623
+ history.markDirty();
6835
6624
  };
6836
- return {
6837
- handleMergeShapes,
6838
- canMergeShapes
6839
- };
6625
+ return { handleMergeShapes, canMergeShapes: canMergeShapes2 };
6840
6626
  }
6841
6627
 
6842
6628
  // src/viewer/hooks/useGroupAlignLayerHandlers.ts
@@ -6979,12 +6765,10 @@ function useGroupAlignLayerHandlers(input) {
6979
6765
  );
6980
6766
  history.markDirty();
6981
6767
  };
6982
- const { handleMergeShapes, canMergeShapes } = useMergeShapesHandler({
6768
+ const { handleMergeShapes, canMergeShapes: canMergeShapes2 } = useMergeShapesHandler({
6983
6769
  activeSlide,
6984
6770
  activeSlideIndex,
6985
6771
  selectedElements,
6986
- effectiveSelectedIds,
6987
- setSelectedElementIds,
6988
6772
  ops,
6989
6773
  history
6990
6774
  });
@@ -6999,7 +6783,7 @@ function useGroupAlignLayerHandlers(input) {
6999
6783
  handleMoveLayer,
7000
6784
  handleMoveLayerToEdge,
7001
6785
  handleMergeShapes,
7002
- canMergeShapes
6786
+ canMergeShapes: canMergeShapes2
7003
6787
  };
7004
6788
  }
7005
6789
 
@@ -7021,6 +6805,7 @@ function useElementManipulation(input) {
7021
6805
  setSidebarPanelMode,
7022
6806
  onOpenHyperlinkDialog,
7023
6807
  onEditText,
6808
+ onEditPoints,
7024
6809
  onSaveElementAsPicture
7025
6810
  } = input;
7026
6811
  const { handleCopy, handleCut, handlePaste, handleDuplicate, handleDelete } = useClipboardHandlers(input);
@@ -7035,7 +6820,7 @@ function useElementManipulation(input) {
7035
6820
  handleMoveLayer,
7036
6821
  handleMoveLayerToEdge,
7037
6822
  handleMergeShapes,
7038
- canMergeShapes
6823
+ canMergeShapes: canMergeShapes2
7039
6824
  } = useGroupAlignLayerHandlers(input);
7040
6825
  const handleContextMenuAction = (action) => {
7041
6826
  switch (action) {
@@ -7089,6 +6874,12 @@ function useElementManipulation(input) {
7089
6874
  onEditText?.(selectedElement.id);
7090
6875
  }
7091
6876
  break;
6877
+ case "edit-points":
6878
+ case "editPoints":
6879
+ if (selectedElement) {
6880
+ onEditPoints?.(selectedElement.id);
6881
+ }
6882
+ break;
7092
6883
  case "save-as-picture":
7093
6884
  if (selectedElement) {
7094
6885
  onSaveElementAsPicture?.(selectedElement.id);
@@ -7133,7 +6924,7 @@ function useElementManipulation(input) {
7133
6924
  handleMoveLayer,
7134
6925
  handleMoveLayerToEdge,
7135
6926
  handleMergeShapes,
7136
- canMergeShapes,
6927
+ canMergeShapes: canMergeShapes2,
7137
6928
  handleContextMenuAction
7138
6929
  };
7139
6930
  }
@@ -10303,6 +10094,11 @@ function useEditorOperations(input) {
10303
10094
  history,
10304
10095
  onOpenHyperlinkDialog: () => dialogs.setIsHyperlinkDialogOpen(true),
10305
10096
  onEditText: handleEditTextFromContextMenu,
10097
+ onEditPoints: (elementId) => {
10098
+ if (canEditElementPoints(state.elementLookup.get(elementId))) {
10099
+ state.setEditPointsElementId(elementId);
10100
+ }
10101
+ },
10306
10102
  onSaveElementAsPicture: handleSaveElementAsPicture,
10307
10103
  onPasted: pasteSpecial.notePastedElement
10308
10104
  });
@@ -12929,14 +12725,15 @@ function useViewerBuildingBlocksCore(input) {
12929
12725
  } = state;
12930
12726
  const hasActivePointerInteraction = useCallback(
12931
12727
  () => Boolean(
12932
- state.dragStateRef.current || state.resizeStateRef.current || state.marqueeStateRef.current || state.shapeAdjustmentDragStateRef.current || state.isDrawingRef.current
12728
+ state.dragStateRef.current || state.resizeStateRef.current || state.marqueeStateRef.current || state.shapeAdjustmentDragStateRef.current || state.isDrawingRef.current || state.cropSessionRef.current
12933
12729
  ),
12934
12730
  [
12935
12731
  state.dragStateRef,
12936
12732
  state.resizeStateRef,
12937
12733
  state.marqueeStateRef,
12938
12734
  state.shapeAdjustmentDragStateRef,
12939
- state.isDrawingRef
12735
+ state.isDrawingRef,
12736
+ state.cropSessionRef
12940
12737
  ]
12941
12738
  );
12942
12739
  const zoom = useZoomViewport({
@@ -16335,7 +16132,7 @@ function FailedToLoad() {
16335
16132
  var LazyModel3DScene = React17.lazy(
16336
16133
  async () => {
16337
16134
  try {
16338
- return await import('./Model3DScene-IJ7YYTYU.mjs');
16135
+ return await import('./Model3DScene-QFWI5CEE.mjs');
16339
16136
  } catch {
16340
16137
  return { default: FailedToLoad };
16341
16138
  }
@@ -18960,4 +18757,4 @@ function useResizablePanels() {
18960
18757
  };
18961
18758
  }
18962
18759
 
18963
- export { ACTION_VERB_MAP, ChartPartSelectionProvider, CollaborationCursorOverlay, CollaborationProvider, ElementRenderer, FragmentedTransitionLayer, InlineCollaborationContext, MIN_TOUCH_TARGET, MorphTransitionOverlay, PresentationTransitionOverlay, RemoteSelectionOverlay, RemoteUserCursors, Rendering3DFlagsContext, ResizeHandles, SlideBackgroundImageLayer, SlideLayer, SmartArtRenderer, StaticElementRenderer, ViewerOptionsContext, computeToolbarVisibility, detectTargetType, isAudienceTab, parseAudienceNonce, parseEmailUrl, parseSlideFromUrl, playAnimationSound, renderStrokeView, renderToCanvas, resolveSmartArtDataPalette, safePrompt, scopeLayoutOptionsToActiveSlide, useAnimationPlayback, useAnnotationHandlers, useAudienceMode, useAutosave, useBroadcastFollower, useCanvasInteractions, 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 };
18760
+ export { ACTION_VERB_MAP, ChartPartSelectionProvider, CollaborationCursorOverlay, CollaborationProvider, ElementRenderer, FragmentedTransitionLayer, InlineCollaborationContext, MIN_TOUCH_TARGET, MorphTransitionOverlay, PresentationTransitionOverlay, RemoteSelectionOverlay, RemoteUserCursors, Rendering3DFlagsContext, ResizeHandles, SlideBackgroundImageLayer, SlideLayer, SmartArtRenderer, StaticElementRenderer, ViewerOptionsContext, computeToolbarVisibility, detectTargetType, imgSrc, isAudienceTab, parseAudienceNonce, parseEmailUrl, parseSlideFromUrl, playAnimationSound, renderStrokeView, renderToCanvas, resolveSmartArtDataPalette, safePrompt, scopeLayoutOptionsToActiveSlide, useAnimationPlayback, useAnnotationHandlers, useAudienceMode, useAutosave, useBroadcastFollower, useCanvasInteractions, 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 };
Binary file
Binary file