pptx-react-viewer 4.1.6 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/dist/{AiChatPanel-DRCY3T2Z.js → AiChatPanel-7UQA25FA.js} +28 -28
- package/dist/AiChatPanel-7UQA25FA.js.br +0 -0
- package/dist/AiChatPanel-7UQA25FA.js.gz +0 -0
- package/dist/{AiChatPanel-Y2RKSHOO.mjs → AiChatPanel-UCEK3ZTD.mjs} +4 -4
- package/dist/AiChatPanel-UCEK3ZTD.mjs.br +0 -0
- package/dist/AiChatPanel-UCEK3ZTD.mjs.gz +0 -0
- package/dist/{Model3DScene-ITHRMCLT.mjs → Model3DScene-AI2JTBQM.mjs} +1 -1
- package/dist/Model3DScene-AI2JTBQM.mjs.br +0 -0
- package/dist/Model3DScene-AI2JTBQM.mjs.gz +0 -0
- package/dist/{Model3DScene-VJZS726S.js → Model3DScene-X3DS3ELB.js} +2 -2
- package/dist/Model3DScene-X3DS3ELB.js.br +0 -0
- package/dist/Model3DScene-X3DS3ELB.js.gz +0 -0
- package/dist/{chunk-IXS7DALE.js → OrbitControls-4TDJCTBA.js} +1 -0
- package/dist/OrbitControls-4TDJCTBA.js.br +0 -0
- package/dist/OrbitControls-4TDJCTBA.js.gz +0 -0
- package/dist/{chunk-MV2GCDBR.mjs → OrbitControls-WCOIJFFL.mjs} +1 -0
- package/dist/OrbitControls-WCOIJFFL.mjs.br +0 -0
- package/dist/OrbitControls-WCOIJFFL.mjs.gz +0 -0
- package/dist/{chunk-FT3MMIXW.mjs → chunk-3UWJWJCR.mjs} +69243 -56884
- package/dist/chunk-3UWJWJCR.mjs.br +0 -0
- package/dist/chunk-3UWJWJCR.mjs.gz +0 -0
- package/dist/{chunk-LNSYROED.js → chunk-42XEZVUQ.js} +1322 -1216
- package/dist/chunk-42XEZVUQ.js.br +0 -0
- package/dist/chunk-42XEZVUQ.js.gz +0 -0
- package/dist/{chunk-P5LF34BT.js → chunk-E7O4HTS5.js} +195 -187
- package/dist/chunk-E7O4HTS5.js.br +0 -0
- package/dist/chunk-E7O4HTS5.js.gz +0 -0
- package/dist/{chunk-2O66VMWK.js → chunk-KAO5USPE.js} +5 -5
- package/dist/chunk-KAO5USPE.js.br +0 -0
- package/dist/chunk-KAO5USPE.js.gz +0 -0
- package/dist/{chunk-PC7H3C5W.mjs → chunk-OBQ453H6.mjs} +2 -2
- package/dist/chunk-OBQ453H6.mjs.br +0 -0
- package/dist/chunk-OBQ453H6.mjs.gz +0 -0
- package/dist/{chunk-KDTE5JOW.mjs → chunk-PLDG3CXW.mjs} +18 -10
- package/dist/chunk-PLDG3CXW.mjs.br +0 -0
- package/dist/chunk-PLDG3CXW.mjs.gz +0 -0
- package/dist/{chunk-YHTDDCSC.mjs → chunk-RXYLPESV.mjs} +265 -159
- package/dist/chunk-RXYLPESV.mjs.br +0 -0
- package/dist/chunk-RXYLPESV.mjs.gz +0 -0
- package/dist/{chunk-OFSKGB3W.mjs → chunk-SKTZSG7Q.mjs} +531 -748
- package/dist/chunk-SKTZSG7Q.mjs.br +0 -0
- package/dist/chunk-SKTZSG7Q.mjs.gz +0 -0
- package/dist/{chunk-QMSSDBKN.js → chunk-UTI4CLYJ.js} +69255 -56897
- package/dist/chunk-UTI4CLYJ.js.br +0 -0
- package/dist/chunk-UTI4CLYJ.js.gz +0 -0
- package/dist/{chunk-NXGUR2DO.js → chunk-W5KLLGVH.js} +2 -2
- package/dist/chunk-W5KLLGVH.js.br +0 -0
- package/dist/chunk-W5KLLGVH.js.gz +0 -0
- package/dist/{chunk-VWGJXNMR.js → chunk-Y7LI2JIR.js} +1992 -2215
- package/dist/chunk-Y7LI2JIR.js.br +0 -0
- package/dist/chunk-Y7LI2JIR.js.gz +0 -0
- package/dist/{chunk-QEYWSHNE.mjs → chunk-YQJOCGOK.mjs} +1 -1
- package/dist/chunk-YQJOCGOK.mjs.br +0 -0
- package/dist/chunk-YQJOCGOK.mjs.gz +0 -0
- package/dist/i18n/de.cjs +2 -2
- package/dist/i18n/de.cjs.br +0 -0
- package/dist/i18n/de.cjs.gz +0 -0
- package/dist/i18n/de.mjs +2 -2
- package/dist/i18n/de.mjs.br +0 -0
- package/dist/i18n/de.mjs.gz +0 -0
- package/dist/i18n/es.cjs +2 -2
- package/dist/i18n/es.cjs.br +0 -0
- package/dist/i18n/es.cjs.gz +0 -0
- package/dist/i18n/es.mjs +2 -2
- package/dist/i18n/es.mjs.br +0 -0
- package/dist/i18n/es.mjs.gz +0 -0
- package/dist/i18n/fr.cjs +2 -2
- package/dist/i18n/fr.cjs.br +0 -0
- package/dist/i18n/fr.cjs.gz +0 -0
- package/dist/i18n/fr.mjs +2 -2
- package/dist/i18n/fr.mjs.br +0 -0
- package/dist/i18n/fr.mjs.gz +0 -0
- package/dist/i18n/zh-CN.cjs +2 -2
- package/dist/i18n/zh-CN.cjs.br +0 -0
- package/dist/i18n/zh-CN.cjs.gz +0 -0
- package/dist/i18n/zh-CN.mjs +2 -2
- package/dist/i18n/zh-CN.mjs.br +0 -0
- package/dist/i18n/zh-CN.mjs.gz +0 -0
- package/dist/i18n.js +4 -4
- package/dist/i18n.js.br +0 -0
- package/dist/i18n.js.gz +0 -0
- package/dist/i18n.mjs +1 -1
- package/dist/i18n.mjs.br +0 -0
- package/dist/i18n.mjs.gz +0 -0
- package/dist/index.d.ts +310 -22
- package/dist/index.js +49 -49
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +6 -6
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +358 -22
- package/dist/internals.js +105 -105
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +4 -4
- package/dist/internals.mjs.br +0 -0
- package/dist/internals.mjs.gz +0 -0
- package/dist/pptx-viewer.css +1 -1
- package/dist/pptx-viewer.css.br +0 -0
- package/dist/pptx-viewer.css.gz +0 -0
- package/dist/viewer/index.d.ts +278 -3
- package/dist/viewer/index.js +27 -27
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +6 -6
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +1 -1
- package/dist/AiChatPanel-DRCY3T2Z.js.br +0 -0
- package/dist/AiChatPanel-DRCY3T2Z.js.gz +0 -0
- package/dist/AiChatPanel-Y2RKSHOO.mjs.br +0 -0
- package/dist/AiChatPanel-Y2RKSHOO.mjs.gz +0 -0
- package/dist/Area3DChartScene-J4LMNSGM.js +0 -64
- package/dist/Area3DChartScene-J4LMNSGM.js.br +0 -0
- package/dist/Area3DChartScene-J4LMNSGM.js.gz +0 -0
- package/dist/Area3DChartScene-TDACCSOI.mjs +0 -62
- package/dist/Area3DChartScene-TDACCSOI.mjs.br +0 -0
- package/dist/Area3DChartScene-TDACCSOI.mjs.gz +0 -0
- package/dist/Bar3DChartScene-AD72DLBJ.mjs +0 -62
- package/dist/Bar3DChartScene-AD72DLBJ.mjs.br +0 -0
- package/dist/Bar3DChartScene-AD72DLBJ.mjs.gz +0 -0
- package/dist/Bar3DChartScene-T7334CTK.js +0 -64
- package/dist/Bar3DChartScene-T7334CTK.js.br +0 -0
- package/dist/Bar3DChartScene-T7334CTK.js.gz +0 -0
- package/dist/Line3DChartScene-2ZQSCHK3.mjs +0 -62
- package/dist/Line3DChartScene-2ZQSCHK3.mjs.br +0 -0
- package/dist/Line3DChartScene-2ZQSCHK3.mjs.gz +0 -0
- package/dist/Line3DChartScene-ELVKCFJZ.js +0 -64
- package/dist/Line3DChartScene-ELVKCFJZ.js.br +0 -0
- package/dist/Line3DChartScene-ELVKCFJZ.js.gz +0 -0
- package/dist/Model3DScene-ITHRMCLT.mjs.br +0 -0
- package/dist/Model3DScene-ITHRMCLT.mjs.gz +0 -0
- package/dist/Model3DScene-VJZS726S.js.br +0 -0
- package/dist/Model3DScene-VJZS726S.js.gz +0 -0
- package/dist/OrbitControls-2XOMWUVE.mjs +0 -3
- package/dist/OrbitControls-2XOMWUVE.mjs.br +0 -0
- package/dist/OrbitControls-2XOMWUVE.mjs.gz +0 -0
- package/dist/OrbitControls-CGYUF3BY.js +0 -12
- package/dist/OrbitControls-CGYUF3BY.js.br +0 -0
- package/dist/OrbitControls-CGYUF3BY.js.gz +0 -0
- package/dist/PieChart3DScene-N3DM33FW.js +0 -58
- package/dist/PieChart3DScene-N3DM33FW.js.br +0 -0
- package/dist/PieChart3DScene-N3DM33FW.js.gz +0 -0
- package/dist/PieChart3DScene-PYHOA7BO.mjs +0 -56
- package/dist/PieChart3DScene-PYHOA7BO.mjs.br +0 -0
- package/dist/PieChart3DScene-PYHOA7BO.mjs.gz +0 -0
- package/dist/SmartArt3DScene-D4VNNPHS.mjs +0 -500
- package/dist/SmartArt3DScene-D4VNNPHS.mjs.br +0 -0
- package/dist/SmartArt3DScene-D4VNNPHS.mjs.gz +0 -0
- package/dist/SmartArt3DScene-NHD7CZJ5.js +0 -502
- package/dist/SmartArt3DScene-NHD7CZJ5.js.br +0 -0
- package/dist/SmartArt3DScene-NHD7CZJ5.js.gz +0 -0
- package/dist/SurfaceChart3DScene-IFBUOLNB.mjs +0 -62
- package/dist/SurfaceChart3DScene-IFBUOLNB.mjs.br +0 -0
- package/dist/SurfaceChart3DScene-IFBUOLNB.mjs.gz +0 -0
- package/dist/SurfaceChart3DScene-PUWIMT7V.js +0 -64
- package/dist/SurfaceChart3DScene-PUWIMT7V.js.br +0 -0
- package/dist/SurfaceChart3DScene-PUWIMT7V.js.gz +0 -0
- package/dist/chunk-2O66VMWK.js.br +0 -0
- package/dist/chunk-2O66VMWK.js.gz +0 -0
- package/dist/chunk-DNR6CH6I.js +0 -30
- package/dist/chunk-DNR6CH6I.js.br +0 -0
- package/dist/chunk-DNR6CH6I.js.gz +0 -0
- package/dist/chunk-FT3MMIXW.mjs.br +0 -0
- package/dist/chunk-FT3MMIXW.mjs.gz +0 -0
- package/dist/chunk-IXS7DALE.js.br +0 -0
- package/dist/chunk-IXS7DALE.js.gz +0 -0
- package/dist/chunk-KDTE5JOW.mjs.br +0 -0
- package/dist/chunk-KDTE5JOW.mjs.gz +0 -0
- package/dist/chunk-LNSYROED.js.br +0 -0
- package/dist/chunk-LNSYROED.js.gz +0 -0
- package/dist/chunk-MV2GCDBR.mjs.br +0 -0
- package/dist/chunk-MV2GCDBR.mjs.gz +0 -0
- package/dist/chunk-NXGUR2DO.js.br +0 -0
- package/dist/chunk-NXGUR2DO.js.gz +0 -0
- package/dist/chunk-OFSKGB3W.mjs.br +0 -0
- package/dist/chunk-OFSKGB3W.mjs.gz +0 -0
- package/dist/chunk-P5LF34BT.js.br +0 -0
- package/dist/chunk-P5LF34BT.js.gz +0 -0
- package/dist/chunk-PC7H3C5W.mjs.br +0 -0
- package/dist/chunk-PC7H3C5W.mjs.gz +0 -0
- package/dist/chunk-QEYWSHNE.mjs.br +0 -0
- package/dist/chunk-QEYWSHNE.mjs.gz +0 -0
- package/dist/chunk-QMSSDBKN.js.br +0 -0
- package/dist/chunk-QMSSDBKN.js.gz +0 -0
- package/dist/chunk-T6GFCLSM.mjs +0 -27
- package/dist/chunk-T6GFCLSM.mjs.br +0 -4
- package/dist/chunk-T6GFCLSM.mjs.gz +0 -0
- package/dist/chunk-VWGJXNMR.js.br +0 -0
- package/dist/chunk-VWGJXNMR.js.gz +0 -0
- package/dist/chunk-YHTDDCSC.mjs.br +0 -0
- package/dist/chunk-YHTDDCSC.mjs.gz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
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,
|
|
2
|
-
import { GlyphOutlineFontCache, createGlyphOutlineLookup, DEFAULT_VIEWER_OPTIONS, TOOLBAR_TABS, getSelectionControlArtworkStyle, hasShapeProperties, normalizeHexColor, colorWithOpacity, normalizeStrokeDashType, getSvgStrokeDasharray, getCompoundLineOffsets, getCompoundLineWidths, svgLineCap, hasTextProperties, getSelectionOutlineColor, connectorWrapperTransform, getAriaRoleDescription, getAriaLabel, getAriaRole, resolveElementInteractivity, isEditableTextElement, buildTextStyleOverrideCss, isElementRendered, resolveElementAriaAttributes, shouldRenderHitTarget, elementHitTargetStyle, getImageEffectsOpacity, getImageEffectsFilter, inlineElementPointerEvents, isHollowShapeElement, LINK_TOOLTIP_HOST_CLASS, ACTION_BUTTON_PRESETS, mediaTransportVisible, isInkElement, getGroupChildParentFill, getElementLabel, getResizeHandleHitAreaStyle, paintedStrokeWidth, buildCssGradientFromShapeStyle, ensureActionAffordanceStyles, resolveElementActionAffordance, actionAffordanceLabels, paintedElementSize, 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, resolveChartKind, 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, getImageSvgFilters, buildDuotoneCacheKey, getDuotoneCachedResult, applyDuotone, setDuotoneCachedResult, buildCacheKey, DEFAULT_COLOR_CHANGE_TOLERANCE, getCachedResult, applyColorChange, setCachedResult, inlineListBodyText, createInlineListSeed, readListActivationSelection, createInlineListModelObserver, attachCollaborationInlineEditor, bindInlineListParagraph, bindInlineListRun, attachInlineListController, restoreInlineListBodySelection, getInlineEditorSelectionResult, isBulletMarkerSegment, findChartPartTarget, buildSurfaceChart3DDataForElement, buildBarChart3DDataForElement, buildLineChart3DDataForElement, buildAreaChart3DDataForElement, buildPieChart3DDataForElement, withChartTitle, resolveSmartArt3DLayout, buildSmartArt3DModel, collectCoherent3DOffNodeIds, isBrowserOpenableMime, formatBytes, getOleDisplayName, getOleBadgeLabel, openUrlInNewTab, getSubstituteFontFamily, hasGlyphEnvelope, buildGlyphEnvelope, getWarpPath, isWedgeCalloutPresetShape, isElementActionable, centeredSvgTextLines, findSmartArtNodeText, setSmartArtNodeStyle, rebuildDrawingShapesIfCleared, shouldCommitSmartArtNodeText, updateSmartArtNodeText, advanceChartMarkDrag, advanceChartValueDrag, buildChartMarkDragGeometry, beginChartMarkDrag, beginChartValueDrag, groupIntoParagraphs, substituteFieldText, computeInlineEditorRect, withChartPointValue, 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, advanceMainSequence, playGroup, PRESENTATION_HASH, PRESENTATION_NONCE_KEY, PRESENTATION_CHANNEL_NAME, swapPresentationWindows, PRESENTATION_MESSAGE_ORIGIN, clearAudienceContent, buildPresentationAudienceUrl, resolveAudienceScreenPlacement, placeAudienceWindow, storeAudienceContent, isPresentationSessionMessage, endAudienceDisplay, createPresentationKeyBuffer, acceptsPresentationInput, resolveAutoAdvanceDelayMs, hasShowSlideAfter, nextShowSlideIndex, previousShowSlideIndex, createPresenterShowGuard, firstShowSlideIndex, attachPresentationVisibilityPause, presentationEntrySlideIndex, buildMorphTransitionPlan, morphOptionToMode, buildMorphAnimationRules, findInSlides, applyFindReplacements, visibleTemplateElements, createCollaborationLivePatcher, publishLiveInlineText, PptxHandler, 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, copyFormatFromElement, applyFormatToElement, collectReferencedFontFamilies, resolveGoogleWebfontHref, syncGoogleWebfontStylesheet, selectGoogleWebfontFamilies, fetchGoogleWebfontOutlineBytes, mapSlideShowStartKey, mapEditorKey, isEditorTextInputTarget, 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, savedPresentationFileName, downloadBlob, 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, cloneElementUpdates, assertElementUpdateTarget, prepareElementUpdateBatch, createWriteBackScheduler, observeExternalCollaborationReadiness, resolveHistoryDepth, hasCopyableFormat, createBackstagePresentation, buildFieldSubstitutionContext, cloneElementForPaste, 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, rasterResultToPngBlob, rasterizeElementTiles, placeTileOnPage, PDF_SLIDES_PAGE_WIDTH_PT, PDF_SLIDES_PAGE_HEIGHT_PT, canvasToJpegData, createSnapshotTextPositions, isPpactionUrl, parsePpactionUrl, resolvePresentationAction, elementActionToPptxAction, isUrlSafe, buildSmartArtPresetData, classifyMediaType, computeSnapToShape, publishLiveGeometry, getDraggedShapeAdjustments, computeMarqueeHitIds, mergeAdditiveSelection, rasterizeElementTiledToCanvas, borrowExternalCollaborationAwareness, observeExternalCollaborationSession, clampGifDimensions, rasterizeElement, shouldConfirmExternalHyperlink, applyResize, lockResizeAspect, snapBoxToGrid, applyMotionPathPreset, bringForward, sendBackward, bringToFront, sendToBack } from './chunk-FT3MMIXW.mjs';
|
|
3
|
-
import { translationsEn } from './chunk-
|
|
4
|
-
import
|
|
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-PLDG3CXW.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, 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, 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, hasShowSlideAfter, nextShowSlideIndex, previousShowSlideIndex, 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, collectReferencedFontFamilies, resolveGoogleWebfontHref, syncGoogleWebfontStylesheet, selectGoogleWebfontFamilies, fetchGoogleWebfontOutlineBytes, mapSlideShowStartKey, mapEditorKey, isEditorTextInputTarget, textFontSizePtToPx, stepFontSizePt, textFontSizePxToPt, cycleSelectableElement, 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, savedPresentationFileName, downloadBlob, 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, copyFormatFromElement, cloneElementUpdates, assertElementUpdateTarget, prepareElementUpdateBatch, createWriteBackScheduler, observeExternalCollaborationReadiness, resolveHistoryDepth, hasCopyableFormat, createBackstagePresentation, buildFieldSubstitutionContext, cloneElementForPaste, 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, rasterResultToPngBlob, 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, rasterizeElement, shouldConfirmExternalHyperlink, applyResize, lockResizeAspect, snapBoxToGrid, applyMotionPathPreset, bringForward, sendBackward, bringToFront, sendToBack } from './chunk-3UWJWJCR.mjs';
|
|
3
|
+
import { translationsEn } from './chunk-OBQ453H6.mjs';
|
|
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';
|
|
7
7
|
import { flushSync } from 'react-dom';
|
|
@@ -1334,6 +1334,9 @@ function useAnimationPlayback(input) {
|
|
|
1334
1334
|
const activeAnimationGroupRef = useRef(createActiveAnimationGroup());
|
|
1335
1335
|
const seededCompletedRef = useRef(false);
|
|
1336
1336
|
const mediaTimeNodeElementIdsRef = useRef(/* @__PURE__ */ new Map());
|
|
1337
|
+
const mediaBookmarkTimesMsRef = useRef(
|
|
1338
|
+
/* @__PURE__ */ new Map()
|
|
1339
|
+
);
|
|
1337
1340
|
const lastSeedCompletedRef = useRef(false);
|
|
1338
1341
|
const buildPlaybackContext = useCallback(() => {
|
|
1339
1342
|
return {
|
|
@@ -1343,7 +1346,8 @@ function useAnimationPlayback(input) {
|
|
|
1343
1346
|
onPlayActionSound,
|
|
1344
1347
|
playSound: playAnimationSound,
|
|
1345
1348
|
stopSound: stopAnimationSound,
|
|
1346
|
-
mediaTimeNodeElementIds: mediaTimeNodeElementIdsRef.current
|
|
1349
|
+
mediaTimeNodeElementIds: mediaTimeNodeElementIdsRef.current,
|
|
1350
|
+
mediaBookmarkTimesMs: mediaBookmarkTimesMsRef.current
|
|
1347
1351
|
};
|
|
1348
1352
|
}, [onPlayActionSound]);
|
|
1349
1353
|
useEffect(() => {
|
|
@@ -1361,6 +1365,7 @@ function useAnimationPlayback(input) {
|
|
|
1361
1365
|
if (!slide) {
|
|
1362
1366
|
controllerRef.current = null;
|
|
1363
1367
|
mediaTimeNodeElementIdsRef.current = /* @__PURE__ */ new Map();
|
|
1368
|
+
mediaBookmarkTimesMsRef.current = /* @__PURE__ */ new Map();
|
|
1364
1369
|
setPresentationElementStates(/* @__PURE__ */ new Map());
|
|
1365
1370
|
setPresentationKeyframesCss("");
|
|
1366
1371
|
setInteractiveTriggerShapeIds(/* @__PURE__ */ new Set());
|
|
@@ -1377,6 +1382,7 @@ function useAnimationPlayback(input) {
|
|
|
1377
1382
|
mediaTimeNodeElementIdsRef.current = resolveMediaTimeNodeElementIds(
|
|
1378
1383
|
slide.nativeAnimations ?? []
|
|
1379
1384
|
);
|
|
1385
|
+
mediaBookmarkTimesMsRef.current = resolveMediaBookmarkTimesMs(slide.elements);
|
|
1380
1386
|
setPresentationKeyframesCss(controller.keyframesCss);
|
|
1381
1387
|
setInteractiveTriggerShapeIds(controller.interactiveTriggerShapeIds);
|
|
1382
1388
|
setHoverTriggerShapeIds(controller.hoverTriggerShapeIds);
|
|
@@ -3331,7 +3337,7 @@ function useFindReplace({
|
|
|
3331
3337
|
canEdit: mode === "edit",
|
|
3332
3338
|
isTextInputTarget: isEditorTextInputTarget(event.target)
|
|
3333
3339
|
});
|
|
3334
|
-
if (action !== "find") {
|
|
3340
|
+
if (action !== "find" && action !== "findReplace") {
|
|
3335
3341
|
return;
|
|
3336
3342
|
}
|
|
3337
3343
|
event.preventDefault();
|
|
@@ -9803,6 +9809,103 @@ function useCanvasImagePaste(input) {
|
|
|
9803
9809
|
[loading, error, eligible, slideId, width, height]
|
|
9804
9810
|
);
|
|
9805
9811
|
}
|
|
9812
|
+
function formatPatchFor(element, format) {
|
|
9813
|
+
const updated = applyFormatToElement(element, format);
|
|
9814
|
+
const updates = {};
|
|
9815
|
+
if (hasShapeProperties(updated)) {
|
|
9816
|
+
updates.shapeStyle = updated.shapeStyle;
|
|
9817
|
+
}
|
|
9818
|
+
if (hasTextProperties(updated)) {
|
|
9819
|
+
updates.textStyle = updated.textStyle;
|
|
9820
|
+
}
|
|
9821
|
+
return updates;
|
|
9822
|
+
}
|
|
9823
|
+
function useFormatPainterEditing(input) {
|
|
9824
|
+
const {
|
|
9825
|
+
selectedElement,
|
|
9826
|
+
elementLookup,
|
|
9827
|
+
formatPainterActive,
|
|
9828
|
+
setFormatPainterActive,
|
|
9829
|
+
canvasHandlers,
|
|
9830
|
+
ops
|
|
9831
|
+
} = input;
|
|
9832
|
+
const copiedFormatRef = useRef(null);
|
|
9833
|
+
const prevFormatPainterRef = useRef(false);
|
|
9834
|
+
useEffect(() => {
|
|
9835
|
+
if (formatPainterActive && !prevFormatPainterRef.current && selectedElement) {
|
|
9836
|
+
copiedFormatRef.current = copyFormatFromElement(selectedElement);
|
|
9837
|
+
} else if (!formatPainterActive) {
|
|
9838
|
+
copiedFormatRef.current = null;
|
|
9839
|
+
}
|
|
9840
|
+
prevFormatPainterRef.current = formatPainterActive;
|
|
9841
|
+
}, [formatPainterActive, selectedElement]);
|
|
9842
|
+
const copyFormatFromSelection = useCallback(() => {
|
|
9843
|
+
if (selectedElement) {
|
|
9844
|
+
setFormatPainterActive(true);
|
|
9845
|
+
}
|
|
9846
|
+
}, [selectedElement, setFormatPainterActive]);
|
|
9847
|
+
const pasteFormatToSelection = useCallback(
|
|
9848
|
+
(targetIds) => {
|
|
9849
|
+
const format = copiedFormatRef.current;
|
|
9850
|
+
if (!format) {
|
|
9851
|
+
return;
|
|
9852
|
+
}
|
|
9853
|
+
for (const id of targetIds) {
|
|
9854
|
+
const element = elementLookup.get(id);
|
|
9855
|
+
if (element) {
|
|
9856
|
+
ops.updateElementById(id, formatPatchFor(element, format));
|
|
9857
|
+
}
|
|
9858
|
+
}
|
|
9859
|
+
copiedFormatRef.current = null;
|
|
9860
|
+
setFormatPainterActive(false);
|
|
9861
|
+
},
|
|
9862
|
+
[elementLookup, ops, setFormatPainterActive]
|
|
9863
|
+
);
|
|
9864
|
+
useEffect(() => {
|
|
9865
|
+
if (!formatPainterActive) {
|
|
9866
|
+
return;
|
|
9867
|
+
}
|
|
9868
|
+
const onKey = (e) => {
|
|
9869
|
+
if (e.key === "Escape") {
|
|
9870
|
+
setFormatPainterActive(false);
|
|
9871
|
+
}
|
|
9872
|
+
};
|
|
9873
|
+
window.addEventListener("keydown", onKey);
|
|
9874
|
+
return () => window.removeEventListener("keydown", onKey);
|
|
9875
|
+
}, [formatPainterActive, setFormatPainterActive]);
|
|
9876
|
+
const wrappedCanvasHandlers = useMemo(
|
|
9877
|
+
() => ({
|
|
9878
|
+
...canvasHandlers,
|
|
9879
|
+
handleElementClick: (elementId, e) => {
|
|
9880
|
+
if (formatPainterActive && copiedFormatRef.current) {
|
|
9881
|
+
e.stopPropagation();
|
|
9882
|
+
const element = elementLookup.get(elementId);
|
|
9883
|
+
if (element) {
|
|
9884
|
+
ops.updateElementById(elementId, formatPatchFor(element, copiedFormatRef.current));
|
|
9885
|
+
}
|
|
9886
|
+
copiedFormatRef.current = null;
|
|
9887
|
+
setFormatPainterActive(false);
|
|
9888
|
+
ops.applySelection(elementId);
|
|
9889
|
+
return;
|
|
9890
|
+
}
|
|
9891
|
+
canvasHandlers.handleElementClick(elementId, e);
|
|
9892
|
+
},
|
|
9893
|
+
handleCanvasMouseDown: (e) => {
|
|
9894
|
+
if (formatPainterActive) {
|
|
9895
|
+
setFormatPainterActive(false);
|
|
9896
|
+
return;
|
|
9897
|
+
}
|
|
9898
|
+
canvasHandlers.handleCanvasMouseDown(e);
|
|
9899
|
+
}
|
|
9900
|
+
}),
|
|
9901
|
+
[canvasHandlers, ops, formatPainterActive, setFormatPainterActive, elementLookup]
|
|
9902
|
+
);
|
|
9903
|
+
return {
|
|
9904
|
+
canvasHandlers: wrappedCanvasHandlers,
|
|
9905
|
+
copyFormatFromSelection,
|
|
9906
|
+
pasteFormatToSelection
|
|
9907
|
+
};
|
|
9908
|
+
}
|
|
9806
9909
|
|
|
9807
9910
|
// src/viewer/hooks/useEditorOperations.ts
|
|
9808
9911
|
function useEditorOperations(input) {
|
|
@@ -10002,64 +10105,19 @@ function useEditorOperations(input) {
|
|
|
10002
10105
|
}),
|
|
10003
10106
|
[ops, combinedUpdateTextStyle]
|
|
10004
10107
|
);
|
|
10005
|
-
const copiedFormatRef = useRef(null);
|
|
10006
|
-
const prevFormatPainterRef = useRef(false);
|
|
10007
10108
|
const { formatPainterActive, setFormatPainterActive, elementLookup } = state;
|
|
10008
|
-
|
|
10009
|
-
|
|
10010
|
-
|
|
10011
|
-
|
|
10012
|
-
|
|
10013
|
-
|
|
10014
|
-
|
|
10015
|
-
|
|
10016
|
-
|
|
10017
|
-
|
|
10018
|
-
|
|
10019
|
-
|
|
10020
|
-
const onKey = (e) => {
|
|
10021
|
-
if (e.key === "Escape") {
|
|
10022
|
-
setFormatPainterActive(false);
|
|
10023
|
-
}
|
|
10024
|
-
};
|
|
10025
|
-
window.addEventListener("keydown", onKey);
|
|
10026
|
-
return () => window.removeEventListener("keydown", onKey);
|
|
10027
|
-
}, [formatPainterActive, setFormatPainterActive]);
|
|
10028
|
-
const formatPainterCanvasHandlers = useMemo(
|
|
10029
|
-
() => ({
|
|
10030
|
-
...canvasHandlers,
|
|
10031
|
-
handleElementClick: (elementId, e) => {
|
|
10032
|
-
if (formatPainterActive && copiedFormatRef.current) {
|
|
10033
|
-
e.stopPropagation();
|
|
10034
|
-
const element = elementLookup.get(elementId);
|
|
10035
|
-
if (element) {
|
|
10036
|
-
const updated = applyFormatToElement(element, copiedFormatRef.current);
|
|
10037
|
-
const updates = {};
|
|
10038
|
-
if (hasShapeProperties(updated)) {
|
|
10039
|
-
updates.shapeStyle = updated.shapeStyle;
|
|
10040
|
-
}
|
|
10041
|
-
if (hasTextProperties(updated)) {
|
|
10042
|
-
updates.textStyle = updated.textStyle;
|
|
10043
|
-
}
|
|
10044
|
-
ops.updateElementById(elementId, updates);
|
|
10045
|
-
}
|
|
10046
|
-
copiedFormatRef.current = null;
|
|
10047
|
-
setFormatPainterActive(false);
|
|
10048
|
-
ops.applySelection(elementId);
|
|
10049
|
-
return;
|
|
10050
|
-
}
|
|
10051
|
-
canvasHandlers.handleElementClick(elementId, e);
|
|
10052
|
-
},
|
|
10053
|
-
handleCanvasMouseDown: (e) => {
|
|
10054
|
-
if (formatPainterActive) {
|
|
10055
|
-
setFormatPainterActive(false);
|
|
10056
|
-
return;
|
|
10057
|
-
}
|
|
10058
|
-
canvasHandlers.handleCanvasMouseDown(e);
|
|
10059
|
-
}
|
|
10060
|
-
}),
|
|
10061
|
-
[canvasHandlers, ops, formatPainterActive, setFormatPainterActive, elementLookup]
|
|
10062
|
-
);
|
|
10109
|
+
const {
|
|
10110
|
+
canvasHandlers: formatPainterCanvasHandlers,
|
|
10111
|
+
copyFormatFromSelection,
|
|
10112
|
+
pasteFormatToSelection
|
|
10113
|
+
} = useFormatPainterEditing({
|
|
10114
|
+
selectedElement,
|
|
10115
|
+
elementLookup,
|
|
10116
|
+
formatPainterActive,
|
|
10117
|
+
setFormatPainterActive,
|
|
10118
|
+
canvasHandlers,
|
|
10119
|
+
ops
|
|
10120
|
+
});
|
|
10063
10121
|
return {
|
|
10064
10122
|
ops: combinedOps,
|
|
10065
10123
|
sectionOps,
|
|
@@ -10069,7 +10127,9 @@ function useEditorOperations(input) {
|
|
|
10069
10127
|
insertHandlers: { ...insertHandlers, imagePaste },
|
|
10070
10128
|
manipulation,
|
|
10071
10129
|
slideOps,
|
|
10072
|
-
tableOps
|
|
10130
|
+
tableOps,
|
|
10131
|
+
copyFormatFromSelection,
|
|
10132
|
+
pasteFormatToSelection
|
|
10073
10133
|
};
|
|
10074
10134
|
}
|
|
10075
10135
|
|
|
@@ -10542,6 +10602,48 @@ function useKeyboardShortcuts(input) {
|
|
|
10542
10602
|
case "nextSlide":
|
|
10543
10603
|
current.onNextSlide?.();
|
|
10544
10604
|
break;
|
|
10605
|
+
case "alignLeft":
|
|
10606
|
+
current.onAlignLeft?.();
|
|
10607
|
+
break;
|
|
10608
|
+
case "alignCenter":
|
|
10609
|
+
current.onAlignCenter?.();
|
|
10610
|
+
break;
|
|
10611
|
+
case "alignRight":
|
|
10612
|
+
current.onAlignRight?.();
|
|
10613
|
+
break;
|
|
10614
|
+
case "alignJustify":
|
|
10615
|
+
current.onAlignJustify?.();
|
|
10616
|
+
break;
|
|
10617
|
+
case "increaseFontSize":
|
|
10618
|
+
current.onIncreaseFontSize?.();
|
|
10619
|
+
break;
|
|
10620
|
+
case "decreaseFontSize":
|
|
10621
|
+
current.onDecreaseFontSize?.();
|
|
10622
|
+
break;
|
|
10623
|
+
case "copyFormat":
|
|
10624
|
+
current.onCopyFormat?.();
|
|
10625
|
+
break;
|
|
10626
|
+
case "pasteFormat":
|
|
10627
|
+
current.onPasteFormat?.();
|
|
10628
|
+
break;
|
|
10629
|
+
case "newSlide":
|
|
10630
|
+
current.onNewSlide?.();
|
|
10631
|
+
break;
|
|
10632
|
+
case "hyperlink":
|
|
10633
|
+
current.onHyperlink?.();
|
|
10634
|
+
break;
|
|
10635
|
+
case "findReplace":
|
|
10636
|
+
current.onFindReplace?.();
|
|
10637
|
+
break;
|
|
10638
|
+
case "clearFormatting":
|
|
10639
|
+
current.onClearFormatting?.();
|
|
10640
|
+
break;
|
|
10641
|
+
case "cycleSelectionNext":
|
|
10642
|
+
current.onCycleSelectionNext?.();
|
|
10643
|
+
break;
|
|
10644
|
+
case "cycleSelectionPrev":
|
|
10645
|
+
current.onCycleSelectionPrev?.();
|
|
10646
|
+
break;
|
|
10545
10647
|
}
|
|
10546
10648
|
}, []);
|
|
10547
10649
|
useEffect(() => {
|
|
@@ -10553,6 +10655,13 @@ function useKeyboardShortcuts(input) {
|
|
|
10553
10655
|
}
|
|
10554
10656
|
|
|
10555
10657
|
// src/viewer/hooks/useKeyboardShortcutWiring.ts
|
|
10658
|
+
var CLEAR_FORMATTING_PATCH = {
|
|
10659
|
+
bold: false,
|
|
10660
|
+
italic: false,
|
|
10661
|
+
underline: false,
|
|
10662
|
+
strikethrough: false,
|
|
10663
|
+
highlightColor: void 0
|
|
10664
|
+
};
|
|
10556
10665
|
function useKeyboardShortcutWiring(input) {
|
|
10557
10666
|
const {
|
|
10558
10667
|
state,
|
|
@@ -10564,7 +10673,11 @@ function useKeyboardShortcutWiring(input) {
|
|
|
10564
10673
|
manipulation,
|
|
10565
10674
|
history,
|
|
10566
10675
|
onEnterPresentModeFromBeginning,
|
|
10567
|
-
onSetMode
|
|
10676
|
+
onSetMode,
|
|
10677
|
+
handleAddSlide,
|
|
10678
|
+
onOpenHyperlinkDialog,
|
|
10679
|
+
copyFormatFromSelection,
|
|
10680
|
+
pasteFormatToSelection
|
|
10568
10681
|
} = input;
|
|
10569
10682
|
useKeyboardShortcuts({
|
|
10570
10683
|
containerRef: state.containerRef,
|
|
@@ -10638,9 +10751,38 @@ function useKeyboardShortcutWiring(input) {
|
|
|
10638
10751
|
state.setActiveSlideIndex((prev) => Math.min(slides.length - 1, prev + 1));
|
|
10639
10752
|
},
|
|
10640
10753
|
onStartShowFromBeginning: onEnterPresentModeFromBeginning,
|
|
10641
|
-
onStartShowFromCurrent: () => onSetMode("present")
|
|
10754
|
+
onStartShowFromCurrent: () => onSetMode("present"),
|
|
10755
|
+
onAlignLeft: () => ops.updateSelectedTextStyle({ align: "left" }),
|
|
10756
|
+
onAlignCenter: () => ops.updateSelectedTextStyle({ align: "center" }),
|
|
10757
|
+
onAlignRight: () => ops.updateSelectedTextStyle({ align: "right" }),
|
|
10758
|
+
onAlignJustify: () => ops.updateSelectedTextStyle({ align: "justify" }),
|
|
10759
|
+
onIncreaseFontSize: () => stepSelectedFontSize(state, ops, "increase"),
|
|
10760
|
+
onDecreaseFontSize: () => stepSelectedFontSize(state, ops, "decrease"),
|
|
10761
|
+
onCopyFormat: copyFormatFromSelection,
|
|
10762
|
+
onPasteFormat: () => pasteFormatToSelection(state.effectiveSelectedIds),
|
|
10763
|
+
onNewSlide: handleAddSlide,
|
|
10764
|
+
onHyperlink: onOpenHyperlinkDialog,
|
|
10765
|
+
onClearFormatting: () => ops.updateSelectedTextStyle({ ...CLEAR_FORMATTING_PATCH }),
|
|
10766
|
+
onCycleSelectionNext: () => cycleSelection(state, activeSlide, ops, "next"),
|
|
10767
|
+
onCycleSelectionPrev: () => cycleSelection(state, activeSlide, ops, "prev")
|
|
10642
10768
|
});
|
|
10643
10769
|
}
|
|
10770
|
+
function stepSelectedFontSize(state, ops, direction) {
|
|
10771
|
+
const selected = state.selectedElement;
|
|
10772
|
+
const currentPx = (selected && hasTextProperties(selected) ? selected.textStyle?.fontSize : void 0) ?? textFontSizePtToPx(18);
|
|
10773
|
+
const nextPt = stepFontSizePt(textFontSizePxToPt(currentPx), direction);
|
|
10774
|
+
ops.updateSelectedTextStyle({ fontSize: textFontSizePtToPx(nextPt) });
|
|
10775
|
+
}
|
|
10776
|
+
function cycleSelection(state, activeSlide, ops, direction) {
|
|
10777
|
+
if (!activeSlide) {
|
|
10778
|
+
return;
|
|
10779
|
+
}
|
|
10780
|
+
const ids = activeSlide.elements.map((el) => el.id);
|
|
10781
|
+
const nextId = cycleSelectableElement(ids, state.selectedElementId, direction);
|
|
10782
|
+
if (nextId) {
|
|
10783
|
+
ops.applySelection(nextId, [nextId]);
|
|
10784
|
+
}
|
|
10785
|
+
}
|
|
10644
10786
|
function useElementUpdateBatch(input) {
|
|
10645
10787
|
const live = useRef(input);
|
|
10646
10788
|
live.current = input;
|
|
@@ -11037,7 +11179,11 @@ function useViewerIntegration(input) {
|
|
|
11037
11179
|
manipulation: editorOps.manipulation,
|
|
11038
11180
|
history,
|
|
11039
11181
|
onEnterPresentModeFromBeginning: presentation.enterPresentModeFromBeginning,
|
|
11040
|
-
onSetMode: handleSetMode
|
|
11182
|
+
onSetMode: handleSetMode,
|
|
11183
|
+
handleAddSlide: editorOps.slideOps.handleAddSlide,
|
|
11184
|
+
onOpenHyperlinkDialog: () => dialogs.setIsHyperlinkDialogOpen(true),
|
|
11185
|
+
copyFormatFromSelection: editorOps.copyFormatFromSelection,
|
|
11186
|
+
pasteFormatToSelection: editorOps.pasteFormatToSelection
|
|
11041
11187
|
});
|
|
11042
11188
|
return {
|
|
11043
11189
|
exportHandlers,
|
|
@@ -12199,6 +12345,12 @@ function buildToolbarProps(input) {
|
|
|
12199
12345
|
onOpenSettings,
|
|
12200
12346
|
onRunAccessibilityCheck: dialogs.handleRunAccessibilityCheck,
|
|
12201
12347
|
onToggleSlideSorter: () => s.setShowSlideSorter((p) => !p),
|
|
12348
|
+
onGoToNormalView: () => {
|
|
12349
|
+
s.setShowSlideSorter(false);
|
|
12350
|
+
s.setShowReadingView(false);
|
|
12351
|
+
s.setShowOutlineView(false);
|
|
12352
|
+
dialogs.handleCloseMasterView();
|
|
12353
|
+
},
|
|
12202
12354
|
onOpenReadingView: () => s.setShowReadingView(true),
|
|
12203
12355
|
onOpenOutlineView: () => s.setShowOutlineView(true),
|
|
12204
12356
|
onUpdateTextStyle: ops.updateSelectedTextStyle,
|
|
@@ -13238,6 +13390,33 @@ function DuotoneImage({
|
|
|
13238
13390
|
}
|
|
13239
13391
|
);
|
|
13240
13392
|
}
|
|
13393
|
+
function TiledImageLayer({
|
|
13394
|
+
element,
|
|
13395
|
+
src,
|
|
13396
|
+
className,
|
|
13397
|
+
style
|
|
13398
|
+
}) {
|
|
13399
|
+
const [nativeSize, setNativeSize] = useState(() => getCachedNativeImageSize(src));
|
|
13400
|
+
useEffect(() => {
|
|
13401
|
+
const cached = getCachedNativeImageSize(src);
|
|
13402
|
+
if (cached) {
|
|
13403
|
+
setNativeSize(cached);
|
|
13404
|
+
return;
|
|
13405
|
+
}
|
|
13406
|
+
let cancelled = false;
|
|
13407
|
+
probeNativeImageSize(src).then((size) => {
|
|
13408
|
+
if (!cancelled && size) {
|
|
13409
|
+
setNativeSize(size);
|
|
13410
|
+
}
|
|
13411
|
+
return void 0;
|
|
13412
|
+
}).catch(() => {
|
|
13413
|
+
});
|
|
13414
|
+
return () => {
|
|
13415
|
+
cancelled = true;
|
|
13416
|
+
};
|
|
13417
|
+
}, [src]);
|
|
13418
|
+
return /* @__PURE__ */ jsx("div", { className, style: { ...getImageTilingStyle(element, nativeSize), ...style } });
|
|
13419
|
+
}
|
|
13241
13420
|
function renderImageEffectDefinitions(element, excludeDuotone = false) {
|
|
13242
13421
|
return getImageSvgFilters(element).filter((definition) => !excludeDuotone || definition.id !== `duotone-${element.id}`).map((definition) => /* @__PURE__ */ jsx(
|
|
13243
13422
|
"svg",
|
|
@@ -13313,10 +13492,12 @@ function renderImg(el, style, filter, alt, opacity) {
|
|
|
13313
13492
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
13314
13493
|
renderImageEffectDefinitions(el),
|
|
13315
13494
|
/* @__PURE__ */ jsx(
|
|
13316
|
-
|
|
13495
|
+
TiledImageLayer,
|
|
13317
13496
|
{
|
|
13497
|
+
element: el,
|
|
13498
|
+
src: tileSrc,
|
|
13318
13499
|
className: "pointer-events-none select-none w-full h-full",
|
|
13319
|
-
style:
|
|
13500
|
+
style: effectStyles
|
|
13320
13501
|
}
|
|
13321
13502
|
)
|
|
13322
13503
|
] });
|
|
@@ -13426,436 +13607,127 @@ function ChartPartSelectionProvider({
|
|
|
13426
13607
|
function useChartPartSelection() {
|
|
13427
13608
|
return useContext(ChartPartSelectionContext);
|
|
13428
13609
|
}
|
|
13429
|
-
var
|
|
13430
|
-
|
|
13431
|
-
|
|
13432
|
-
|
|
13433
|
-
|
|
13434
|
-
|
|
13435
|
-
|
|
13436
|
-
|
|
13437
|
-
|
|
13438
|
-
|
|
13439
|
-
|
|
13440
|
-
|
|
13441
|
-
|
|
13442
|
-
|
|
13443
|
-
|
|
13444
|
-
|
|
13445
|
-
|
|
13446
|
-
|
|
13447
|
-
|
|
13448
|
-
|
|
13449
|
-
|
|
13450
|
-
|
|
13451
|
-
|
|
13610
|
+
var DEFAULT_RENDERING_3D_FLAGS = {
|
|
13611
|
+
smartArt3D: false,
|
|
13612
|
+
surfaceChart3D: false,
|
|
13613
|
+
barChart3D: false,
|
|
13614
|
+
lineChart3D: false,
|
|
13615
|
+
areaChart3D: false,
|
|
13616
|
+
pieChart3D: false
|
|
13617
|
+
};
|
|
13618
|
+
var Rendering3DFlagsContext = createContext(DEFAULT_RENDERING_3D_FLAGS);
|
|
13619
|
+
defineThreeViewElement();
|
|
13620
|
+
function useThreeViewEvent(ref, type, handler) {
|
|
13621
|
+
useLayoutEffect(() => {
|
|
13622
|
+
const host = ref.current;
|
|
13623
|
+
if (!host) {
|
|
13624
|
+
return void 0;
|
|
13625
|
+
}
|
|
13626
|
+
const listener = (event) => handler(event.detail);
|
|
13627
|
+
host.addEventListener(type, listener);
|
|
13628
|
+
return () => host.removeEventListener(type, listener);
|
|
13629
|
+
}, [ref, type, handler]);
|
|
13630
|
+
}
|
|
13631
|
+
function ThreeView({
|
|
13632
|
+
spec,
|
|
13633
|
+
interactive = true,
|
|
13634
|
+
selectedPart = null,
|
|
13635
|
+
textStyle,
|
|
13636
|
+
className,
|
|
13637
|
+
style,
|
|
13638
|
+
onSelect,
|
|
13639
|
+
onDrag,
|
|
13640
|
+
onStateChange,
|
|
13641
|
+
children
|
|
13642
|
+
}) {
|
|
13643
|
+
const ref = useRef(null);
|
|
13644
|
+
useLayoutEffect(() => {
|
|
13645
|
+
if (ref.current) {
|
|
13646
|
+
ref.current.spec = spec;
|
|
13647
|
+
}
|
|
13648
|
+
}, [spec]);
|
|
13649
|
+
useLayoutEffect(() => {
|
|
13650
|
+
if (ref.current) {
|
|
13651
|
+
ref.current.interactive = interactive;
|
|
13652
|
+
}
|
|
13653
|
+
}, [interactive]);
|
|
13654
|
+
useLayoutEffect(() => {
|
|
13655
|
+
if (ref.current) {
|
|
13656
|
+
ref.current.selectedPart = selectedPart;
|
|
13657
|
+
}
|
|
13658
|
+
}, [selectedPart]);
|
|
13659
|
+
useLayoutEffect(() => {
|
|
13660
|
+
if (ref.current) {
|
|
13661
|
+
ref.current.textStyle = textStyle;
|
|
13452
13662
|
}
|
|
13663
|
+
}, [textStyle]);
|
|
13664
|
+
const handleSelectEvent = useCallback(
|
|
13665
|
+
(detail) => onSelect?.(detail.part),
|
|
13666
|
+
[onSelect]
|
|
13667
|
+
);
|
|
13668
|
+
const handleDragEvent = useCallback((detail) => onDrag?.(detail), [onDrag]);
|
|
13669
|
+
const handleStateEvent = useCallback(
|
|
13670
|
+
(detail) => onStateChange?.(detail.state),
|
|
13671
|
+
[onStateChange]
|
|
13453
13672
|
);
|
|
13673
|
+
useThreeViewEvent(ref, "pptx-three-select", handleSelectEvent);
|
|
13674
|
+
useThreeViewEvent(ref, "pptx-three-drag", handleDragEvent);
|
|
13675
|
+
useThreeViewEvent(ref, "pptx-three-state", handleStateEvent);
|
|
13676
|
+
return /* @__PURE__ */ jsx("pptx-three-view", { ref, className, style, children });
|
|
13454
13677
|
}
|
|
13455
|
-
function
|
|
13456
|
-
|
|
13678
|
+
function useChart3DView({
|
|
13679
|
+
element,
|
|
13680
|
+
flags,
|
|
13681
|
+
canEdit,
|
|
13682
|
+
onUpdateElement,
|
|
13683
|
+
selection,
|
|
13684
|
+
setSelection,
|
|
13685
|
+
setDragValue
|
|
13686
|
+
}) {
|
|
13687
|
+
const spec = useMemo(() => resolveChartThreeViewSpec(element, flags), [element, flags]);
|
|
13688
|
+
const bridge = {
|
|
13689
|
+
elementId: element.id,
|
|
13690
|
+
chartData: element.chartData,
|
|
13691
|
+
canSelect: canEdit,
|
|
13692
|
+
selectedElementId: selection?.elementId ?? null,
|
|
13693
|
+
setSelection,
|
|
13694
|
+
setDragValue,
|
|
13695
|
+
commitChartData: onUpdateElement ? (next) => onUpdateElement({ chartData: next }) : void 0
|
|
13696
|
+
};
|
|
13697
|
+
return {
|
|
13698
|
+
spec,
|
|
13699
|
+
onSelect: (part) => applyChart3DSelect(bridge, part),
|
|
13700
|
+
onDrag: (detail) => applyChart3DDrag(bridge, detail)
|
|
13701
|
+
};
|
|
13457
13702
|
}
|
|
13458
|
-
|
|
13459
|
-
async () => {
|
|
13460
|
-
try {
|
|
13461
|
-
return await import('./Area3DChartScene-TDACCSOI.mjs');
|
|
13462
|
-
} catch {
|
|
13463
|
-
return { default: FailedToLoad };
|
|
13464
|
-
}
|
|
13465
|
-
}
|
|
13466
|
-
);
|
|
13467
|
-
var SceneErrorBoundary = class extends React20.Component {
|
|
13468
|
-
constructor(props) {
|
|
13469
|
-
super(props);
|
|
13470
|
-
this.state = { hasError: false };
|
|
13471
|
-
}
|
|
13472
|
-
static getDerivedStateFromError() {
|
|
13473
|
-
return { hasError: true };
|
|
13474
|
-
}
|
|
13475
|
-
render() {
|
|
13476
|
-
return this.state.hasError ? this.props.fallback : this.props.children;
|
|
13477
|
-
}
|
|
13478
|
-
};
|
|
13479
|
-
function Area3DChartRenderer({
|
|
13703
|
+
function useChartMarkInteraction({
|
|
13480
13704
|
element,
|
|
13481
|
-
|
|
13482
|
-
|
|
13483
|
-
|
|
13705
|
+
canEdit,
|
|
13706
|
+
onUpdateElement,
|
|
13707
|
+
viewModel,
|
|
13708
|
+
wrapperRef,
|
|
13709
|
+
setSelection
|
|
13484
13710
|
}) {
|
|
13485
|
-
const
|
|
13486
|
-
|
|
13487
|
-
|
|
13488
|
-
|
|
13489
|
-
|
|
13490
|
-
|
|
13491
|
-
|
|
13492
|
-
|
|
13493
|
-
|
|
13494
|
-
|
|
13495
|
-
|
|
13496
|
-
|
|
13497
|
-
|
|
13498
|
-
|
|
13499
|
-
|
|
13500
|
-
|
|
13501
|
-
|
|
13502
|
-
|
|
13503
|
-
|
|
13504
|
-
|
|
13505
|
-
);
|
|
13506
|
-
const svgFallback = /* @__PURE__ */ jsx(Fragment, { children: renderChartElement(element) });
|
|
13507
|
-
if (!options || threeAvailable === false) {
|
|
13508
|
-
return svgFallback;
|
|
13509
|
-
}
|
|
13510
|
-
if (threeAvailable === null) {
|
|
13511
|
-
return /* @__PURE__ */ jsx(LoadingState, {});
|
|
13512
|
-
}
|
|
13513
|
-
return /* @__PURE__ */ jsx(SceneErrorBoundary, { fallback: svgFallback, children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(LoadingState, {}), children: /* @__PURE__ */ jsx(
|
|
13514
|
-
LazyArea3DChartScene,
|
|
13515
|
-
{
|
|
13516
|
-
options,
|
|
13517
|
-
interaction,
|
|
13518
|
-
selectedPart,
|
|
13519
|
-
textStyle
|
|
13520
|
-
}
|
|
13521
|
-
) }) });
|
|
13522
|
-
}
|
|
13523
|
-
var BarChart3DContext = createContext(false);
|
|
13524
|
-
function FailedToLoad2() {
|
|
13525
|
-
return null;
|
|
13526
|
-
}
|
|
13527
|
-
var LazyBar3DChartScene = React20.lazy(
|
|
13528
|
-
async () => {
|
|
13529
|
-
try {
|
|
13530
|
-
return await import('./Bar3DChartScene-AD72DLBJ.mjs');
|
|
13531
|
-
} catch {
|
|
13532
|
-
return { default: FailedToLoad2 };
|
|
13533
|
-
}
|
|
13534
|
-
}
|
|
13535
|
-
);
|
|
13536
|
-
var SceneErrorBoundary2 = class extends React20.Component {
|
|
13537
|
-
constructor(props) {
|
|
13538
|
-
super(props);
|
|
13539
|
-
this.state = { hasError: false };
|
|
13540
|
-
}
|
|
13541
|
-
static getDerivedStateFromError() {
|
|
13542
|
-
return { hasError: true };
|
|
13543
|
-
}
|
|
13544
|
-
render() {
|
|
13545
|
-
return this.state.hasError ? this.props.fallback : this.props.children;
|
|
13546
|
-
}
|
|
13547
|
-
};
|
|
13548
|
-
function Bar3DChartRenderer({
|
|
13549
|
-
element,
|
|
13550
|
-
interaction,
|
|
13551
|
-
selectedPart,
|
|
13552
|
-
textStyle
|
|
13553
|
-
}) {
|
|
13554
|
-
const [threeAvailable, setThreeAvailable] = useState(null);
|
|
13555
|
-
useEffect(() => {
|
|
13556
|
-
let cancelled = false;
|
|
13557
|
-
import('./three.module-LGUV2LI6.mjs').then(() => {
|
|
13558
|
-
if (!cancelled) {
|
|
13559
|
-
setThreeAvailable(true);
|
|
13560
|
-
}
|
|
13561
|
-
return void 0;
|
|
13562
|
-
}).catch(() => {
|
|
13563
|
-
if (!cancelled) {
|
|
13564
|
-
setThreeAvailable(false);
|
|
13565
|
-
}
|
|
13566
|
-
});
|
|
13567
|
-
return () => {
|
|
13568
|
-
cancelled = true;
|
|
13569
|
-
};
|
|
13570
|
-
}, []);
|
|
13571
|
-
const options = useMemo(
|
|
13572
|
-
() => buildBarChart3DDataForElement(element, { width: element.width, height: element.height }),
|
|
13573
|
-
[element]
|
|
13574
|
-
);
|
|
13575
|
-
const svgFallback = /* @__PURE__ */ jsx(Fragment, { children: renderChartElement(element) });
|
|
13576
|
-
if (!options || threeAvailable === false) {
|
|
13577
|
-
return svgFallback;
|
|
13578
|
-
}
|
|
13579
|
-
if (threeAvailable === null) {
|
|
13580
|
-
return /* @__PURE__ */ jsx(LoadingState, {});
|
|
13581
|
-
}
|
|
13582
|
-
return /* @__PURE__ */ jsx(SceneErrorBoundary2, { fallback: svgFallback, children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(LoadingState, {}), children: /* @__PURE__ */ jsx(
|
|
13583
|
-
LazyBar3DChartScene,
|
|
13584
|
-
{
|
|
13585
|
-
options,
|
|
13586
|
-
interaction,
|
|
13587
|
-
selectedPart,
|
|
13588
|
-
textStyle
|
|
13589
|
-
}
|
|
13590
|
-
) }) });
|
|
13591
|
-
}
|
|
13592
|
-
|
|
13593
|
-
// src/viewer/components/elements/build-chart3d-part-interaction.ts
|
|
13594
|
-
function buildChart3DPartInteraction({
|
|
13595
|
-
element,
|
|
13596
|
-
canEdit,
|
|
13597
|
-
onUpdateElement,
|
|
13598
|
-
selection,
|
|
13599
|
-
setSelection,
|
|
13600
|
-
setDragValue
|
|
13601
|
-
}) {
|
|
13602
|
-
if (!canEdit) {
|
|
13603
|
-
return void 0;
|
|
13604
|
-
}
|
|
13605
|
-
const onSelect = (part) => {
|
|
13606
|
-
if (part) {
|
|
13607
|
-
setSelection({ elementId: element.id, part });
|
|
13608
|
-
} else if (selection?.elementId === element.id) {
|
|
13609
|
-
setSelection(null);
|
|
13610
|
-
}
|
|
13611
|
-
};
|
|
13612
|
-
const onValueDragPreview = (_part, value) => {
|
|
13613
|
-
setDragValue(value);
|
|
13614
|
-
};
|
|
13615
|
-
const onValueDragCommit = (part, value) => {
|
|
13616
|
-
setDragValue(null);
|
|
13617
|
-
if (!onUpdateElement || !element.chartData || part.pointIndex === void 0) {
|
|
13618
|
-
return;
|
|
13619
|
-
}
|
|
13620
|
-
onUpdateElement({
|
|
13621
|
-
chartData: withChartPointValue(element.chartData, part.seriesIndex, part.pointIndex, value)
|
|
13622
|
-
});
|
|
13623
|
-
};
|
|
13624
|
-
return { onSelect, onValueDragPreview, onValueDragCommit };
|
|
13625
|
-
}
|
|
13626
|
-
var LineChart3DContext = createContext(false);
|
|
13627
|
-
function FailedToLoad3() {
|
|
13628
|
-
return null;
|
|
13629
|
-
}
|
|
13630
|
-
var LazyLine3DChartScene = React20.lazy(
|
|
13631
|
-
async () => {
|
|
13632
|
-
try {
|
|
13633
|
-
return await import('./Line3DChartScene-2ZQSCHK3.mjs');
|
|
13634
|
-
} catch {
|
|
13635
|
-
return { default: FailedToLoad3 };
|
|
13636
|
-
}
|
|
13637
|
-
}
|
|
13638
|
-
);
|
|
13639
|
-
var SceneErrorBoundary3 = class extends React20.Component {
|
|
13640
|
-
constructor(props) {
|
|
13641
|
-
super(props);
|
|
13642
|
-
this.state = { hasError: false };
|
|
13643
|
-
}
|
|
13644
|
-
static getDerivedStateFromError() {
|
|
13645
|
-
return { hasError: true };
|
|
13646
|
-
}
|
|
13647
|
-
render() {
|
|
13648
|
-
return this.state.hasError ? this.props.fallback : this.props.children;
|
|
13649
|
-
}
|
|
13650
|
-
};
|
|
13651
|
-
function Line3DChartRenderer({
|
|
13652
|
-
element,
|
|
13653
|
-
interaction,
|
|
13654
|
-
selectedPart,
|
|
13655
|
-
textStyle
|
|
13656
|
-
}) {
|
|
13657
|
-
const [threeAvailable, setThreeAvailable] = useState(null);
|
|
13658
|
-
useEffect(() => {
|
|
13659
|
-
let cancelled = false;
|
|
13660
|
-
import('./three.module-LGUV2LI6.mjs').then(() => {
|
|
13661
|
-
if (!cancelled) {
|
|
13662
|
-
setThreeAvailable(true);
|
|
13663
|
-
}
|
|
13664
|
-
return void 0;
|
|
13665
|
-
}).catch(() => {
|
|
13666
|
-
if (!cancelled) {
|
|
13667
|
-
setThreeAvailable(false);
|
|
13668
|
-
}
|
|
13669
|
-
});
|
|
13670
|
-
return () => {
|
|
13671
|
-
cancelled = true;
|
|
13672
|
-
};
|
|
13673
|
-
}, []);
|
|
13674
|
-
const options = useMemo(
|
|
13675
|
-
() => buildLineChart3DDataForElement(element, { width: element.width, height: element.height }),
|
|
13676
|
-
[element]
|
|
13677
|
-
);
|
|
13678
|
-
const svgFallback = /* @__PURE__ */ jsx(Fragment, { children: renderChartElement(element) });
|
|
13679
|
-
if (!options || threeAvailable === false) {
|
|
13680
|
-
return svgFallback;
|
|
13681
|
-
}
|
|
13682
|
-
if (threeAvailable === null) {
|
|
13683
|
-
return /* @__PURE__ */ jsx(LoadingState, {});
|
|
13684
|
-
}
|
|
13685
|
-
return /* @__PURE__ */ jsx(SceneErrorBoundary3, { fallback: svgFallback, children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(LoadingState, {}), children: /* @__PURE__ */ jsx(
|
|
13686
|
-
LazyLine3DChartScene,
|
|
13687
|
-
{
|
|
13688
|
-
options,
|
|
13689
|
-
interaction,
|
|
13690
|
-
selectedPart,
|
|
13691
|
-
textStyle
|
|
13692
|
-
}
|
|
13693
|
-
) }) });
|
|
13694
|
-
}
|
|
13695
|
-
var PieChart3DContext = createContext(false);
|
|
13696
|
-
function FailedToLoad4() {
|
|
13697
|
-
return null;
|
|
13698
|
-
}
|
|
13699
|
-
var LazyPieChart3DScene = React20.lazy(
|
|
13700
|
-
async () => {
|
|
13701
|
-
try {
|
|
13702
|
-
return await import('./PieChart3DScene-PYHOA7BO.mjs');
|
|
13703
|
-
} catch {
|
|
13704
|
-
return { default: FailedToLoad4 };
|
|
13705
|
-
}
|
|
13706
|
-
}
|
|
13707
|
-
);
|
|
13708
|
-
var SceneErrorBoundary4 = class extends React20.Component {
|
|
13709
|
-
constructor(props) {
|
|
13710
|
-
super(props);
|
|
13711
|
-
this.state = { hasError: false };
|
|
13712
|
-
}
|
|
13713
|
-
static getDerivedStateFromError() {
|
|
13714
|
-
return { hasError: true };
|
|
13715
|
-
}
|
|
13716
|
-
render() {
|
|
13717
|
-
return this.state.hasError ? this.props.fallback : this.props.children;
|
|
13718
|
-
}
|
|
13719
|
-
};
|
|
13720
|
-
function PieChart3DRenderer({
|
|
13721
|
-
element,
|
|
13722
|
-
interaction,
|
|
13723
|
-
selectedPart
|
|
13724
|
-
}) {
|
|
13725
|
-
const [threeAvailable, setThreeAvailable] = useState(null);
|
|
13726
|
-
useEffect(() => {
|
|
13727
|
-
let cancelled = false;
|
|
13728
|
-
import('./three.module-LGUV2LI6.mjs').then(() => {
|
|
13729
|
-
if (!cancelled) {
|
|
13730
|
-
setThreeAvailable(true);
|
|
13731
|
-
}
|
|
13732
|
-
return void 0;
|
|
13733
|
-
}).catch(() => {
|
|
13734
|
-
if (!cancelled) {
|
|
13735
|
-
setThreeAvailable(false);
|
|
13736
|
-
}
|
|
13737
|
-
});
|
|
13738
|
-
return () => {
|
|
13739
|
-
cancelled = true;
|
|
13740
|
-
};
|
|
13741
|
-
}, []);
|
|
13742
|
-
const options = useMemo(
|
|
13743
|
-
() => buildPieChart3DDataForElement(element, { width: element.width, height: element.height }),
|
|
13744
|
-
[element]
|
|
13745
|
-
);
|
|
13746
|
-
const svgFallback = /* @__PURE__ */ jsx(Fragment, { children: renderChartElement(element) });
|
|
13747
|
-
if (!options || threeAvailable === false) {
|
|
13748
|
-
return svgFallback;
|
|
13749
|
-
}
|
|
13750
|
-
if (threeAvailable === null) {
|
|
13751
|
-
return /* @__PURE__ */ jsx(LoadingState, {});
|
|
13752
|
-
}
|
|
13753
|
-
return /* @__PURE__ */ jsx(SceneErrorBoundary4, { fallback: svgFallback, children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(LoadingState, {}), children: /* @__PURE__ */ jsx(
|
|
13754
|
-
LazyPieChart3DScene,
|
|
13755
|
-
{
|
|
13756
|
-
options,
|
|
13757
|
-
interaction,
|
|
13758
|
-
selectedPart
|
|
13759
|
-
}
|
|
13760
|
-
) }) });
|
|
13761
|
-
}
|
|
13762
|
-
var SurfaceChart3DContext = createContext(false);
|
|
13763
|
-
function FailedToLoad5() {
|
|
13764
|
-
return null;
|
|
13765
|
-
}
|
|
13766
|
-
var LazySurfaceChart3DScene = React20.lazy(
|
|
13767
|
-
async () => {
|
|
13768
|
-
try {
|
|
13769
|
-
return await import('./SurfaceChart3DScene-IFBUOLNB.mjs');
|
|
13770
|
-
} catch {
|
|
13771
|
-
return { default: FailedToLoad5 };
|
|
13772
|
-
}
|
|
13773
|
-
}
|
|
13774
|
-
);
|
|
13775
|
-
var SceneErrorBoundary5 = class extends React20.Component {
|
|
13776
|
-
constructor(props) {
|
|
13777
|
-
super(props);
|
|
13778
|
-
this.state = { hasError: false };
|
|
13779
|
-
}
|
|
13780
|
-
static getDerivedStateFromError() {
|
|
13781
|
-
return { hasError: true };
|
|
13782
|
-
}
|
|
13783
|
-
render() {
|
|
13784
|
-
return this.state.hasError ? this.props.fallback : this.props.children;
|
|
13785
|
-
}
|
|
13786
|
-
};
|
|
13787
|
-
function SurfaceChart3DRenderer({
|
|
13788
|
-
element,
|
|
13789
|
-
interaction,
|
|
13790
|
-
selectedPart,
|
|
13791
|
-
textStyle
|
|
13792
|
-
}) {
|
|
13793
|
-
const [threeAvailable, setThreeAvailable] = useState(null);
|
|
13794
|
-
useEffect(() => {
|
|
13795
|
-
let cancelled = false;
|
|
13796
|
-
import('./three.module-LGUV2LI6.mjs').then(() => {
|
|
13797
|
-
if (!cancelled) {
|
|
13798
|
-
setThreeAvailable(true);
|
|
13799
|
-
}
|
|
13800
|
-
return void 0;
|
|
13801
|
-
}).catch(() => {
|
|
13802
|
-
if (!cancelled) {
|
|
13803
|
-
setThreeAvailable(false);
|
|
13804
|
-
}
|
|
13805
|
-
});
|
|
13806
|
-
return () => {
|
|
13807
|
-
cancelled = true;
|
|
13808
|
-
};
|
|
13809
|
-
}, []);
|
|
13810
|
-
const options = useMemo(
|
|
13811
|
-
() => buildSurfaceChart3DDataForElement(element, { width: element.width, height: element.height }),
|
|
13812
|
-
[element]
|
|
13813
|
-
);
|
|
13814
|
-
const svgFallback = /* @__PURE__ */ jsx(Fragment, { children: renderChartElement(element) });
|
|
13815
|
-
if (!options || threeAvailable === false) {
|
|
13816
|
-
return svgFallback;
|
|
13817
|
-
}
|
|
13818
|
-
if (threeAvailable === null) {
|
|
13819
|
-
return /* @__PURE__ */ jsx(LoadingState, {});
|
|
13820
|
-
}
|
|
13821
|
-
return /* @__PURE__ */ jsx(SceneErrorBoundary5, { fallback: svgFallback, children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(LoadingState, {}), children: /* @__PURE__ */ jsx(
|
|
13822
|
-
LazySurfaceChart3DScene,
|
|
13823
|
-
{
|
|
13824
|
-
options,
|
|
13825
|
-
interaction,
|
|
13826
|
-
selectedPart,
|
|
13827
|
-
textStyle
|
|
13828
|
-
}
|
|
13829
|
-
) }) });
|
|
13830
|
-
}
|
|
13831
|
-
function useChartMarkInteraction({
|
|
13832
|
-
element,
|
|
13833
|
-
canEdit,
|
|
13834
|
-
onUpdateElement,
|
|
13835
|
-
viewModel,
|
|
13836
|
-
wrapperRef,
|
|
13837
|
-
setSelection
|
|
13838
|
-
}) {
|
|
13839
|
-
const dragRef = useRef(null);
|
|
13840
|
-
const markDragRef = useRef(null);
|
|
13841
|
-
const [previewData, setPreviewData] = useState(null);
|
|
13842
|
-
const [dragValue, setDragValue] = useState(null);
|
|
13843
|
-
const endDrag = (commit) => {
|
|
13844
|
-
const active = dragRef.current;
|
|
13845
|
-
const markActive = markDragRef.current;
|
|
13846
|
-
dragRef.current = null;
|
|
13847
|
-
markDragRef.current = null;
|
|
13848
|
-
setPreviewData(null);
|
|
13849
|
-
setDragValue(null);
|
|
13850
|
-
if (!commit || !onUpdateElement) {
|
|
13851
|
-
return;
|
|
13852
|
-
}
|
|
13853
|
-
if (active?.moved && active.lastData) {
|
|
13854
|
-
onUpdateElement({ chartData: active.lastData });
|
|
13855
|
-
} else if (markActive?.moved && markActive.lastData) {
|
|
13856
|
-
onUpdateElement({ chartData: markActive.lastData });
|
|
13857
|
-
}
|
|
13858
|
-
};
|
|
13711
|
+
const dragRef = useRef(null);
|
|
13712
|
+
const markDragRef = useRef(null);
|
|
13713
|
+
const [previewData, setPreviewData] = useState(null);
|
|
13714
|
+
const [dragValue, setDragValue] = useState(null);
|
|
13715
|
+
const endDrag = (commit) => {
|
|
13716
|
+
const active = dragRef.current;
|
|
13717
|
+
const markActive = markDragRef.current;
|
|
13718
|
+
dragRef.current = null;
|
|
13719
|
+
markDragRef.current = null;
|
|
13720
|
+
setPreviewData(null);
|
|
13721
|
+
setDragValue(null);
|
|
13722
|
+
if (!commit || !onUpdateElement) {
|
|
13723
|
+
return;
|
|
13724
|
+
}
|
|
13725
|
+
if (active?.moved && active.lastData) {
|
|
13726
|
+
onUpdateElement({ chartData: active.lastData });
|
|
13727
|
+
} else if (markActive?.moved && markActive.lastData) {
|
|
13728
|
+
onUpdateElement({ chartData: markActive.lastData });
|
|
13729
|
+
}
|
|
13730
|
+
};
|
|
13859
13731
|
useEffect(() => {
|
|
13860
13732
|
if (dragValue === null) {
|
|
13861
13733
|
return;
|
|
@@ -13979,16 +13851,7 @@ function ChartElementView({
|
|
|
13979
13851
|
const [titleDraft, setTitleDraft] = useState(null);
|
|
13980
13852
|
const selectedPart = selection?.elementId === element.id ? selection.part : null;
|
|
13981
13853
|
const canEdit = editable && Boolean(onUpdateElement);
|
|
13982
|
-
const
|
|
13983
|
-
const isSurfaceKind = resolveChartKind(element.chartData?.chartType ?? "bar") === "surface";
|
|
13984
|
-
const use3DBar = useContext(BarChart3DContext);
|
|
13985
|
-
const isBar3DKind = element.chartData?.chartType === "bar3D";
|
|
13986
|
-
const use3DLine = useContext(LineChart3DContext);
|
|
13987
|
-
const isLine3DKind = element.chartData?.chartType === "line3D";
|
|
13988
|
-
const use3DArea = useContext(AreaChart3DContext);
|
|
13989
|
-
const isArea3DKind = element.chartData?.chartType === "area3D";
|
|
13990
|
-
const use3DPie = useContext(PieChart3DContext);
|
|
13991
|
-
const isPie3DKind = element.chartData?.chartType === "pie3D";
|
|
13854
|
+
const rendering3DFlags = useContext(Rendering3DFlagsContext);
|
|
13992
13855
|
const barFacePictureSampleVersion = useSyncExternalStore(
|
|
13993
13856
|
subscribeBarFacePicturePixelSamples,
|
|
13994
13857
|
getBarFacePicturePixelSampleVersion,
|
|
@@ -14024,14 +13887,6 @@ function ChartElementView({
|
|
|
14024
13887
|
wrapperRef,
|
|
14025
13888
|
setSelection
|
|
14026
13889
|
});
|
|
14027
|
-
const chart3DInteraction = buildChart3DPartInteraction({
|
|
14028
|
-
element,
|
|
14029
|
-
canEdit,
|
|
14030
|
-
onUpdateElement,
|
|
14031
|
-
selection,
|
|
14032
|
-
setSelection,
|
|
14033
|
-
setDragValue
|
|
14034
|
-
});
|
|
14035
13890
|
const handleDoubleClick = (e) => {
|
|
14036
13891
|
if (!canEdit || !canDrillDown(element)) {
|
|
14037
13892
|
return;
|
|
@@ -14060,6 +13915,15 @@ function ChartElementView({
|
|
|
14060
13915
|
const baseChartData = previewData ?? element.chartData;
|
|
14061
13916
|
const revealedChartData = baseChartData ? resolveRevealedChartData(baseChartData, animationState) : baseChartData;
|
|
14062
13917
|
const renderedElement = revealedChartData === element.chartData ? element : { ...element, chartData: revealedChartData };
|
|
13918
|
+
const chart3D = useChart3DView({
|
|
13919
|
+
element: renderedElement,
|
|
13920
|
+
flags: rendering3DFlags,
|
|
13921
|
+
canEdit,
|
|
13922
|
+
onUpdateElement,
|
|
13923
|
+
selection,
|
|
13924
|
+
setSelection,
|
|
13925
|
+
setDragValue
|
|
13926
|
+
});
|
|
14063
13927
|
return /* @__PURE__ */ jsxs(
|
|
14064
13928
|
"div",
|
|
14065
13929
|
{
|
|
@@ -14070,44 +13934,16 @@ function ChartElementView({
|
|
|
14070
13934
|
onPointerUp: handlePointerUp,
|
|
14071
13935
|
onDoubleClick: handleDoubleClick,
|
|
14072
13936
|
children: [
|
|
14073
|
-
|
|
14074
|
-
|
|
14075
|
-
{
|
|
14076
|
-
element: renderedElement,
|
|
14077
|
-
interaction: chart3DInteraction,
|
|
14078
|
-
selectedPart,
|
|
14079
|
-
textStyle: animationState?.textStyle
|
|
14080
|
-
}
|
|
14081
|
-
) : use3DBar && isBar3DKind ? /* @__PURE__ */ jsx(
|
|
14082
|
-
Bar3DChartRenderer,
|
|
13937
|
+
chart3D.spec ? /* @__PURE__ */ jsx(
|
|
13938
|
+
ThreeView,
|
|
14083
13939
|
{
|
|
14084
|
-
|
|
14085
|
-
|
|
13940
|
+
spec: chart3D.spec,
|
|
13941
|
+
interactive: canEdit,
|
|
14086
13942
|
selectedPart,
|
|
14087
|
-
textStyle: animationState?.textStyle
|
|
14088
|
-
|
|
14089
|
-
|
|
14090
|
-
|
|
14091
|
-
{
|
|
14092
|
-
element: renderedElement,
|
|
14093
|
-
interaction: chart3DInteraction,
|
|
14094
|
-
selectedPart,
|
|
14095
|
-
textStyle: animationState?.textStyle
|
|
14096
|
-
}
|
|
14097
|
-
) : use3DArea && isArea3DKind ? /* @__PURE__ */ jsx(
|
|
14098
|
-
Area3DChartRenderer,
|
|
14099
|
-
{
|
|
14100
|
-
element: renderedElement,
|
|
14101
|
-
interaction: chart3DInteraction,
|
|
14102
|
-
selectedPart,
|
|
14103
|
-
textStyle: animationState?.textStyle
|
|
14104
|
-
}
|
|
14105
|
-
) : use3DPie && isPie3DKind ? /* @__PURE__ */ jsx(
|
|
14106
|
-
PieChart3DRenderer,
|
|
14107
|
-
{
|
|
14108
|
-
element: renderedElement,
|
|
14109
|
-
interaction: chart3DInteraction,
|
|
14110
|
-
selectedPart
|
|
13943
|
+
textStyle: animationState?.textStyle,
|
|
13944
|
+
onSelect: chart3D.onSelect,
|
|
13945
|
+
onDrag: chart3D.onDrag,
|
|
13946
|
+
children: renderChartElement(renderedElement)
|
|
14111
13947
|
}
|
|
14112
13948
|
) : renderChartElement(renderedElement),
|
|
14113
13949
|
dragValue !== null && /* @__PURE__ */ jsx("div", { className: "absolute top-1 right-1 z-10 rounded bg-primary/90 px-1.5 py-0.5 text-[10px] font-medium text-white pointer-events-none", children: formatAxisValue(dragValue) }),
|
|
@@ -14541,7 +14377,7 @@ function ResizeHandles({
|
|
|
14541
14377
|
))
|
|
14542
14378
|
] });
|
|
14543
14379
|
}
|
|
14544
|
-
var ConnectorElementRenderer =
|
|
14380
|
+
var ConnectorElementRenderer = React17.memo(
|
|
14545
14381
|
// oxlint-disable-next-line prefer-arrow-callback -- named fn gives the memo component its displayName
|
|
14546
14382
|
function ConnectorElementRendererInner({
|
|
14547
14383
|
el,
|
|
@@ -14879,21 +14715,23 @@ function getContainerStyle({
|
|
|
14879
14715
|
);
|
|
14880
14716
|
const overflowValue = has3DExtrusion || blurGrowVisible || isPicture ? "visible" : isImg || el.type === "media" ? "hidden" : void 0;
|
|
14881
14717
|
const painted = paintedElementSize(el);
|
|
14718
|
+
const fs = MEDIA_FULLSCREEN_OVERLAY_STYLE;
|
|
14719
|
+
const heightStyle = isFullscreenMedia ? { height: fs.height } : el.type === "table" ? elementContainerHeightStyle(el, painted.height) : { height: painted.height };
|
|
14882
14720
|
return {
|
|
14883
|
-
left: isFullscreenMedia ?
|
|
14884
|
-
top: isFullscreenMedia ?
|
|
14885
|
-
width: isFullscreenMedia ?
|
|
14886
|
-
|
|
14887
|
-
transform: isFullscreenMedia ?
|
|
14721
|
+
left: isFullscreenMedia ? fs.left : el.x,
|
|
14722
|
+
top: isFullscreenMedia ? fs.top : el.y,
|
|
14723
|
+
width: isFullscreenMedia ? fs.width : painted.width,
|
|
14724
|
+
...heightStyle,
|
|
14725
|
+
transform: isFullscreenMedia ? fs.transform : getElementTransform(el),
|
|
14888
14726
|
transformOrigin: "center",
|
|
14889
14727
|
overflow: overflowValue,
|
|
14890
14728
|
clipPath: isPicture ? void 0 : isImg && !has3DExtrusion ? getCropShapeClipPath(el) : void 0,
|
|
14891
|
-
zIndex: isFullscreenMedia ?
|
|
14729
|
+
zIndex: isFullscreenMedia ? fs.zIndex : zIndex,
|
|
14892
14730
|
visibility: animationState?.visible === false ? "hidden" : "visible",
|
|
14893
14731
|
animation: animationState?.cssAnimation,
|
|
14894
|
-
background: isFullscreenMedia ?
|
|
14895
|
-
transition: isFullscreenMedia ?
|
|
14896
|
-
borderColor: isFullscreenMedia ?
|
|
14732
|
+
background: isFullscreenMedia ? fs.background : void 0,
|
|
14733
|
+
transition: isFullscreenMedia ? fs.transition : void 0,
|
|
14734
|
+
borderColor: isFullscreenMedia ? fs.borderColor : void 0,
|
|
14897
14735
|
...shapeVisualStyle,
|
|
14898
14736
|
...isPicture ? {
|
|
14899
14737
|
backgroundColor: "transparent",
|
|
@@ -14928,7 +14766,7 @@ function shapeParams(element) {
|
|
|
14928
14766
|
const hasFill = style?.fillColor !== void 0 && style.fillColor !== "transparent" || Boolean(buildCssGradientFromShapeStyle(style) || style?.fillGradient) || style?.fillMode === "pattern" && Boolean(style.fillPatternPreset);
|
|
14929
14767
|
return { hf: hasFill, fc: fillColor, sw: strokeWidth, sc: strokeColor };
|
|
14930
14768
|
}
|
|
14931
|
-
var Extrusion3DOverlay =
|
|
14769
|
+
var Extrusion3DOverlay = React17.memo(
|
|
14932
14770
|
// oxlint-disable-next-line prefer-arrow-callback -- named fn gives the memo component its displayName
|
|
14933
14771
|
function Extrusion3DOverlayInner({ data }) {
|
|
14934
14772
|
if (!data.hasExtrusion || data.panels.length === 0) {
|
|
@@ -15162,7 +15000,7 @@ function ShapeEffectOverlay({
|
|
|
15162
15000
|
) : null
|
|
15163
15001
|
] });
|
|
15164
15002
|
}
|
|
15165
|
-
var ElementRenderer =
|
|
15003
|
+
var ElementRenderer = React17.memo(
|
|
15166
15004
|
// oxlint-disable-next-line prefer-arrow-callback -- named fn gives the memo component its displayName
|
|
15167
15005
|
function ElementRendererInner({
|
|
15168
15006
|
element: el,
|
|
@@ -15298,7 +15136,11 @@ var ElementRenderer = React20.memo(
|
|
|
15298
15136
|
const selB = isSelected ? `outline-1 -outline-offset-1 outline-${selClr} ring-2 ring-${selClr}/50` : showHoverBorder ? "outline-1 -outline-offset-1 outline-transparent hover:outline-primary/40" : "";
|
|
15299
15137
|
const cur = effectiveIsInlineEditing ? "cursor-text" : effectiveCanInteract ? !allow.movable ? "cursor-default" : "cursor-move" : hasAction || isZoom ? "cursor-pointer" : "";
|
|
15300
15138
|
const isPresentationPassive = presenting === true;
|
|
15301
|
-
const isFullscreenMedia = el.type === "media" &&
|
|
15139
|
+
const isFullscreenMedia = el.type === "media" && isMediaFullscreenActive({
|
|
15140
|
+
fullScreen: el.fullScreen,
|
|
15141
|
+
presenting: isPresentationPassive,
|
|
15142
|
+
playing: isMediaPlaying
|
|
15143
|
+
});
|
|
15302
15144
|
const hitTargetStyle = shouldRenderHitTarget(effectiveCanInteract, isPresentationPassive) ? elementHitTargetStyle(el) : void 0;
|
|
15303
15145
|
const isFocusable = effectiveCanInteract || isActionable;
|
|
15304
15146
|
const containerStyle = getContainerStyle({
|
|
@@ -15485,30 +15327,48 @@ var ElementRenderer = React20.memo(
|
|
|
15485
15327
|
);
|
|
15486
15328
|
}
|
|
15487
15329
|
);
|
|
15488
|
-
function renderPressureStroke(circles, color, opacity, keyPrefix) {
|
|
15489
|
-
return /* @__PURE__ */ jsx(
|
|
15330
|
+
function renderPressureStroke(circles, color, opacity, blendMode, keyPrefix) {
|
|
15331
|
+
return /* @__PURE__ */ jsx(
|
|
15332
|
+
"g",
|
|
15333
|
+
{
|
|
15334
|
+
opacity,
|
|
15335
|
+
style: blendMode === "multiply" ? { mixBlendMode: "multiply" } : void 0,
|
|
15336
|
+
children: circles.map((c, j) => /* @__PURE__ */ jsx("circle", { cx: c.cx, cy: c.cy, r: c.r, fill: color }, `${keyPrefix}-pc-${j}`))
|
|
15337
|
+
}
|
|
15338
|
+
);
|
|
15490
15339
|
}
|
|
15491
|
-
function renderNibMarkStroke(marks, color, opacity, keyPrefix) {
|
|
15492
|
-
return /* @__PURE__ */ jsx(
|
|
15493
|
-
"
|
|
15340
|
+
function renderNibMarkStroke(marks, color, opacity, blendMode, keyPrefix) {
|
|
15341
|
+
return /* @__PURE__ */ jsx(
|
|
15342
|
+
"g",
|
|
15494
15343
|
{
|
|
15495
|
-
|
|
15496
|
-
|
|
15497
|
-
|
|
15498
|
-
|
|
15499
|
-
|
|
15500
|
-
|
|
15501
|
-
|
|
15502
|
-
|
|
15503
|
-
|
|
15344
|
+
opacity,
|
|
15345
|
+
style: blendMode === "multiply" ? { mixBlendMode: "multiply" } : void 0,
|
|
15346
|
+
children: marks.map((m, j) => /* @__PURE__ */ jsx(
|
|
15347
|
+
"ellipse",
|
|
15348
|
+
{
|
|
15349
|
+
cx: m.cx,
|
|
15350
|
+
cy: m.cy,
|
|
15351
|
+
rx: m.rPerp,
|
|
15352
|
+
ry: m.rTilt,
|
|
15353
|
+
transform: `rotate(${m.rotationDeg} ${m.cx} ${m.cy})`,
|
|
15354
|
+
fill: color
|
|
15355
|
+
},
|
|
15356
|
+
`${keyPrefix}-nib-${j}`
|
|
15357
|
+
))
|
|
15358
|
+
}
|
|
15359
|
+
);
|
|
15504
15360
|
}
|
|
15505
15361
|
function renderStrokeView(view, pressureSensitive, replayStyle, key) {
|
|
15506
15362
|
if (view.nibMarks) {
|
|
15507
|
-
return /* @__PURE__ */ jsx("g", { children: renderNibMarkStroke(view.nibMarks, view.color, view.opacity, key) }, key);
|
|
15363
|
+
return /* @__PURE__ */ jsx("g", { children: renderNibMarkStroke(view.nibMarks, view.color, view.opacity, view.blendMode, key) }, key);
|
|
15508
15364
|
}
|
|
15509
15365
|
if (pressureSensitive && view.circles) {
|
|
15510
|
-
return /* @__PURE__ */ jsx("g", { children: renderPressureStroke(view.circles, view.color, view.opacity, key) }, key);
|
|
15366
|
+
return /* @__PURE__ */ jsx("g", { children: renderPressureStroke(view.circles, view.color, view.opacity, view.blendMode, key) }, key);
|
|
15511
15367
|
}
|
|
15368
|
+
const style = {
|
|
15369
|
+
...replayStyle ? { animation: replayStyle.animation, "--ink-path-length": replayStyle.pathLength } : {},
|
|
15370
|
+
...view.blendMode === "multiply" ? { mixBlendMode: "multiply" } : {}
|
|
15371
|
+
};
|
|
15512
15372
|
return /* @__PURE__ */ jsx(
|
|
15513
15373
|
"path",
|
|
15514
15374
|
{
|
|
@@ -15522,12 +15382,9 @@ function renderStrokeView(view, pressureSensitive, replayStyle, key) {
|
|
|
15522
15382
|
vectorEffect: "non-scaling-stroke",
|
|
15523
15383
|
...replayStyle ? {
|
|
15524
15384
|
strokeDasharray: replayStyle.strokeDasharray,
|
|
15525
|
-
strokeDashoffset: replayStyle.strokeDashoffset
|
|
15526
|
-
|
|
15527
|
-
|
|
15528
|
-
"--ink-path-length": replayStyle.pathLength
|
|
15529
|
-
}
|
|
15530
|
-
} : {}
|
|
15385
|
+
strokeDashoffset: replayStyle.strokeDashoffset
|
|
15386
|
+
} : {},
|
|
15387
|
+
...Object.keys(style).length > 0 ? { style } : {}
|
|
15531
15388
|
},
|
|
15532
15389
|
key
|
|
15533
15390
|
);
|
|
@@ -15607,10 +15464,11 @@ function renderGroup(children, parentGroupFill) {
|
|
|
15607
15464
|
renderGroup(c.children, getGroupChildParentFill(c, parentGroupFill))
|
|
15608
15465
|
) : isI && ("svgData" in c && c.svgData || "imageData" in c && c.imageData) ? /* @__PURE__ */ jsxs("div", { className: "absolute inset-0 pointer-events-none", style: getImageSurfaceStyle(c), children: [
|
|
15609
15466
|
isImageTiled(c) ? /* @__PURE__ */ jsx(
|
|
15610
|
-
|
|
15467
|
+
TiledImageLayer,
|
|
15611
15468
|
{
|
|
15612
|
-
|
|
15613
|
-
|
|
15469
|
+
element: c,
|
|
15470
|
+
src: "svgData" in c && c.svgData ? c.svgData : c.imageData,
|
|
15471
|
+
className: "pointer-events-none select-none w-full h-full"
|
|
15614
15472
|
}
|
|
15615
15473
|
) : /* @__PURE__ */ jsx(
|
|
15616
15474
|
"img",
|
|
@@ -16172,18 +16030,15 @@ function InlineTextEditor({
|
|
|
16172
16030
|
onCommit();
|
|
16173
16031
|
},
|
|
16174
16032
|
onKeyDown: (e) => {
|
|
16175
|
-
|
|
16176
|
-
|
|
16177
|
-
|
|
16178
|
-
|
|
16179
|
-
|
|
16180
|
-
|
|
16181
|
-
|
|
16182
|
-
if (value !== void 0) {
|
|
16183
|
-
onFormatText({ [property]: value });
|
|
16184
|
-
}
|
|
16185
|
-
return;
|
|
16033
|
+
const property = onFormatText ? mapInlineTextFormatKey(e) : null;
|
|
16034
|
+
if (property) {
|
|
16035
|
+
e.preventDefault();
|
|
16036
|
+
e.stopPropagation();
|
|
16037
|
+
const value = nextInlineStyleValue(property);
|
|
16038
|
+
if (value !== void 0) {
|
|
16039
|
+
onFormatText?.({ [property]: value });
|
|
16186
16040
|
}
|
|
16041
|
+
return;
|
|
16187
16042
|
}
|
|
16188
16043
|
if (e.key === "Escape") {
|
|
16189
16044
|
e.preventDefault();
|
|
@@ -16214,15 +16069,15 @@ function InlineTextEditor({
|
|
|
16214
16069
|
list.seed?.paragraphs[0].token ?? "plain"
|
|
16215
16070
|
);
|
|
16216
16071
|
}
|
|
16217
|
-
function
|
|
16072
|
+
function FailedToLoad() {
|
|
16218
16073
|
return null;
|
|
16219
16074
|
}
|
|
16220
|
-
var LazyModel3DScene =
|
|
16075
|
+
var LazyModel3DScene = React17.lazy(
|
|
16221
16076
|
async () => {
|
|
16222
16077
|
try {
|
|
16223
|
-
return await import('./Model3DScene-
|
|
16078
|
+
return await import('./Model3DScene-AI2JTBQM.mjs');
|
|
16224
16079
|
} catch {
|
|
16225
|
-
return { default:
|
|
16080
|
+
return { default: FailedToLoad };
|
|
16226
16081
|
}
|
|
16227
16082
|
}
|
|
16228
16083
|
);
|
|
@@ -16282,7 +16137,7 @@ function PosterFallback({
|
|
|
16282
16137
|
}
|
|
16283
16138
|
);
|
|
16284
16139
|
}
|
|
16285
|
-
var Model3DErrorBoundary = class extends
|
|
16140
|
+
var Model3DErrorBoundary = class extends React17.Component {
|
|
16286
16141
|
constructor(props) {
|
|
16287
16142
|
super(props);
|
|
16288
16143
|
this.state = { hasError: false };
|
|
@@ -16466,21 +16321,6 @@ function OleRenderer({ element: el }) {
|
|
|
16466
16321
|
}
|
|
16467
16322
|
);
|
|
16468
16323
|
}
|
|
16469
|
-
var SmartArt3DContext = createContext(false);
|
|
16470
|
-
|
|
16471
|
-
// src/viewer/utils/smartart-helpers.tsx
|
|
16472
|
-
function resolvePalette2(el) {
|
|
16473
|
-
return el.type === "smartArt" ? resolvePalette(el.smartArtData) : DEFAULT_PALETTE2;
|
|
16474
|
-
}
|
|
16475
|
-
function resolveStyle(el) {
|
|
16476
|
-
if (el.type !== "smartArt" || !el.smartArtData) {
|
|
16477
|
-
return "flat";
|
|
16478
|
-
}
|
|
16479
|
-
return el.smartArtData.style ?? "flat";
|
|
16480
|
-
}
|
|
16481
|
-
function resolveSmartArtDataPalette(data) {
|
|
16482
|
-
return resolvePalette(data);
|
|
16483
|
-
}
|
|
16484
16324
|
var LINE_HEIGHT_RATIO = 1.2;
|
|
16485
16325
|
var DEFAULT_FONT_SIZE = 12;
|
|
16486
16326
|
function SmartArtInlineNodeEditor({
|
|
@@ -16491,10 +16331,10 @@ function SmartArtInlineNodeEditor({
|
|
|
16491
16331
|
onCancel
|
|
16492
16332
|
}) {
|
|
16493
16333
|
const { t } = useTranslation();
|
|
16494
|
-
const ref =
|
|
16495
|
-
const [value, setValue] =
|
|
16496
|
-
const settled =
|
|
16497
|
-
|
|
16334
|
+
const ref = React17.useRef(null);
|
|
16335
|
+
const [value, setValue] = React17.useState(initialText);
|
|
16336
|
+
const settled = React17.useRef(false);
|
|
16337
|
+
React17.useEffect(() => {
|
|
16498
16338
|
const el = ref.current;
|
|
16499
16339
|
if (el) {
|
|
16500
16340
|
el.focus();
|
|
@@ -16587,16 +16427,16 @@ function findNodeIdFromEvent(target) {
|
|
|
16587
16427
|
return null;
|
|
16588
16428
|
}
|
|
16589
16429
|
function useSmartArtHoverState(containerRef, measureNodeRect = measureScreenNodeRect) {
|
|
16590
|
-
const [hoveredNodeId, setHoveredNodeId] =
|
|
16591
|
-
const [hoveredNodeRect, setHoveredNodeRect] =
|
|
16592
|
-
const hideTimeoutRef =
|
|
16593
|
-
const cancelPendingHide =
|
|
16430
|
+
const [hoveredNodeId, setHoveredNodeId] = React17.useState(null);
|
|
16431
|
+
const [hoveredNodeRect, setHoveredNodeRect] = React17.useState(null);
|
|
16432
|
+
const hideTimeoutRef = React17.useRef(null);
|
|
16433
|
+
const cancelPendingHide = React17.useCallback(() => {
|
|
16594
16434
|
if (hideTimeoutRef.current !== null) {
|
|
16595
16435
|
window.clearTimeout(hideTimeoutRef.current);
|
|
16596
16436
|
hideTimeoutRef.current = null;
|
|
16597
16437
|
}
|
|
16598
16438
|
}, []);
|
|
16599
|
-
const handleMouseMove =
|
|
16439
|
+
const handleMouseMove = React17.useCallback(
|
|
16600
16440
|
(e, ignoreRef) => {
|
|
16601
16441
|
const nodeEl = findNodeIdFromEvent(e.target);
|
|
16602
16442
|
const container = containerRef.current;
|
|
@@ -16619,12 +16459,12 @@ function useSmartArtHoverState(containerRef, measureNodeRect = measureScreenNode
|
|
|
16619
16459
|
},
|
|
16620
16460
|
[containerRef, cancelPendingHide, measureNodeRect]
|
|
16621
16461
|
);
|
|
16622
|
-
const clearHover =
|
|
16462
|
+
const clearHover = React17.useCallback(() => {
|
|
16623
16463
|
cancelPendingHide();
|
|
16624
16464
|
setHoveredNodeId(null);
|
|
16625
16465
|
setHoveredNodeRect(null);
|
|
16626
16466
|
}, [cancelPendingHide]);
|
|
16627
|
-
|
|
16467
|
+
React17.useEffect(() => cancelPendingHide, [cancelPendingHide]);
|
|
16628
16468
|
return { hoveredNodeId, hoveredNodeRect, handleMouseMove, clearHover };
|
|
16629
16469
|
}
|
|
16630
16470
|
var EDITOR_PADDING = 4;
|
|
@@ -16640,14 +16480,14 @@ function SmartArtEditableLayer({
|
|
|
16640
16480
|
measureNodeRect = measureScreenNodeRect,
|
|
16641
16481
|
children
|
|
16642
16482
|
}) {
|
|
16643
|
-
const containerRef =
|
|
16644
|
-
const styleBarRef =
|
|
16645
|
-
const [edit, setEdit] =
|
|
16483
|
+
const containerRef = React17.useRef(null);
|
|
16484
|
+
const styleBarRef = React17.useRef(null);
|
|
16485
|
+
const [edit, setEdit] = React17.useState(null);
|
|
16646
16486
|
const { hoveredNodeId, hoveredNodeRect, handleMouseMove, clearHover } = useSmartArtHoverState(
|
|
16647
16487
|
containerRef,
|
|
16648
16488
|
measureNodeRect
|
|
16649
16489
|
);
|
|
16650
|
-
const openEditor =
|
|
16490
|
+
const openEditor = React17.useCallback(
|
|
16651
16491
|
(target) => {
|
|
16652
16492
|
const nodeEl = findNodeIdFromEvent(target);
|
|
16653
16493
|
const container = containerRef.current;
|
|
@@ -16752,6 +16592,20 @@ function SmartArtEditableLayer({
|
|
|
16752
16592
|
}
|
|
16753
16593
|
);
|
|
16754
16594
|
}
|
|
16595
|
+
|
|
16596
|
+
// src/viewer/utils/smartart-helpers.tsx
|
|
16597
|
+
function resolvePalette2(el) {
|
|
16598
|
+
return el.type === "smartArt" ? resolvePalette(el.smartArtData) : DEFAULT_PALETTE2;
|
|
16599
|
+
}
|
|
16600
|
+
function resolveStyle(el) {
|
|
16601
|
+
if (el.type !== "smartArt" || !el.smartArtData) {
|
|
16602
|
+
return "flat";
|
|
16603
|
+
}
|
|
16604
|
+
return el.smartArtData.style ?? "flat";
|
|
16605
|
+
}
|
|
16606
|
+
function resolveSmartArtDataPalette(data) {
|
|
16607
|
+
return resolvePalette(data);
|
|
16608
|
+
}
|
|
16755
16609
|
var LABEL_WIDTH_FRACTION = 0.82;
|
|
16756
16610
|
function smartArtNodeGroupProps(nodeId, shadow, label) {
|
|
16757
16611
|
const props = {
|
|
@@ -17262,97 +17116,32 @@ function sameDiagramReveal(prev, next) {
|
|
|
17262
17116
|
}
|
|
17263
17117
|
return true;
|
|
17264
17118
|
}
|
|
17265
|
-
var SmartArtRenderer =
|
|
17266
|
-
function
|
|
17267
|
-
return null;
|
|
17268
|
-
}
|
|
17269
|
-
var LazySmartArt3DScene = React20.lazy(
|
|
17270
|
-
async () => {
|
|
17271
|
-
try {
|
|
17272
|
-
return await import('./SmartArt3DScene-D4VNNPHS.mjs');
|
|
17273
|
-
} catch {
|
|
17274
|
-
return { default: FailedToLoad7 };
|
|
17275
|
-
}
|
|
17276
|
-
}
|
|
17277
|
-
);
|
|
17278
|
-
var SceneErrorBoundary6 = class extends React20.Component {
|
|
17279
|
-
constructor(props) {
|
|
17280
|
-
super(props);
|
|
17281
|
-
this.state = { hasError: false };
|
|
17282
|
-
}
|
|
17283
|
-
static getDerivedStateFromError() {
|
|
17284
|
-
return { hasError: true };
|
|
17285
|
-
}
|
|
17286
|
-
render() {
|
|
17287
|
-
return this.state.hasError ? this.props.fallback : this.props.children;
|
|
17288
|
-
}
|
|
17289
|
-
};
|
|
17290
|
-
function SmartArt3DRenderer({
|
|
17119
|
+
var SmartArtRenderer = React17.memo(SmartArtRendererImpl, arePropsEqual);
|
|
17120
|
+
function SmartArt3DView({
|
|
17291
17121
|
element,
|
|
17292
17122
|
className,
|
|
17293
|
-
|
|
17123
|
+
smartArt3D,
|
|
17294
17124
|
canEdit,
|
|
17295
17125
|
onUpdateElement,
|
|
17296
17126
|
animationState
|
|
17297
17127
|
}) {
|
|
17298
|
-
const
|
|
17299
|
-
|
|
17300
|
-
|
|
17301
|
-
|
|
17302
|
-
|
|
17303
|
-
|
|
17304
|
-
|
|
17305
|
-
|
|
17306
|
-
|
|
17307
|
-
|
|
17308
|
-
|
|
17128
|
+
const spec = useMemo(
|
|
17129
|
+
() => resolveSmartArtThreeViewSpec(element, smartArt3D),
|
|
17130
|
+
[element, smartArt3D]
|
|
17131
|
+
);
|
|
17132
|
+
if (!spec) {
|
|
17133
|
+
return /* @__PURE__ */ jsx(
|
|
17134
|
+
SmartArtRenderer,
|
|
17135
|
+
{
|
|
17136
|
+
element,
|
|
17137
|
+
className,
|
|
17138
|
+
canEdit,
|
|
17139
|
+
onUpdateElement,
|
|
17140
|
+
animationState
|
|
17309
17141
|
}
|
|
17310
|
-
});
|
|
17311
|
-
return () => {
|
|
17312
|
-
cancelled = true;
|
|
17313
|
-
};
|
|
17314
|
-
}, []);
|
|
17315
|
-
const model = useMemo(() => {
|
|
17316
|
-
if (element.type !== "smartArt" || !element.smartArtData) {
|
|
17317
|
-
return null;
|
|
17318
|
-
}
|
|
17319
|
-
const { nodes, chrome } = element.smartArtData;
|
|
17320
|
-
if (nodes.length === 0) {
|
|
17321
|
-
return null;
|
|
17322
|
-
}
|
|
17323
|
-
const palette = resolvePalette2(element);
|
|
17324
|
-
const style = resolveStyle(element);
|
|
17325
|
-
const layoutResult = resolveSmartArt3DLayout(
|
|
17326
|
-
element.smartArtData,
|
|
17327
|
-
nodes,
|
|
17328
|
-
{ width: element.width, height: element.height },
|
|
17329
|
-
palette,
|
|
17330
|
-
style,
|
|
17331
|
-
element.id
|
|
17332
17142
|
);
|
|
17333
|
-
return buildSmartArt3DModel(layoutResult, {
|
|
17334
|
-
background: chrome?.backgroundColor,
|
|
17335
|
-
spatial: true,
|
|
17336
|
-
coherent3DOffNodeIds: collectCoherent3DOffNodeIds(nodes)
|
|
17337
|
-
});
|
|
17338
|
-
}, [element]);
|
|
17339
|
-
const svgFallback = /* @__PURE__ */ jsx(SmartArtRenderer, { element, className });
|
|
17340
|
-
if (!model || model.meshes.length === 0 || threeAvailable === false) {
|
|
17341
|
-
return svgFallback;
|
|
17342
|
-
}
|
|
17343
|
-
if (threeAvailable === null) {
|
|
17344
|
-
return svgFallback;
|
|
17345
17143
|
}
|
|
17346
|
-
const sceneNode = /* @__PURE__ */ jsx(
|
|
17347
|
-
LazySmartArt3DScene,
|
|
17348
|
-
{
|
|
17349
|
-
model,
|
|
17350
|
-
width: element.width,
|
|
17351
|
-
height: element.height,
|
|
17352
|
-
interactive,
|
|
17353
|
-
textStyle: animationState?.textStyle
|
|
17354
|
-
}
|
|
17355
|
-
) }) });
|
|
17144
|
+
const sceneNode = /* @__PURE__ */ jsx(ThreeView, { spec, interactive: Boolean(canEdit), textStyle: animationState?.textStyle, children: /* @__PURE__ */ jsx(SmartArtRenderer, { element, className }) });
|
|
17356
17145
|
const editEnabled = canEdit && Boolean(onUpdateElement);
|
|
17357
17146
|
const smartArtData = element.type === "smartArt" ? element.smartArtData : void 0;
|
|
17358
17147
|
if (!editEnabled || !smartArtData) {
|
|
@@ -17386,24 +17175,13 @@ function SmartArtElement({
|
|
|
17386
17175
|
onUpdateElement,
|
|
17387
17176
|
animationState
|
|
17388
17177
|
}) {
|
|
17389
|
-
const
|
|
17390
|
-
if (use3D) {
|
|
17391
|
-
return /* @__PURE__ */ jsx(
|
|
17392
|
-
SmartArt3DRenderer,
|
|
17393
|
-
{
|
|
17394
|
-
element,
|
|
17395
|
-
className,
|
|
17396
|
-
canEdit,
|
|
17397
|
-
onUpdateElement,
|
|
17398
|
-
animationState
|
|
17399
|
-
}
|
|
17400
|
-
);
|
|
17401
|
-
}
|
|
17178
|
+
const { smartArt3D } = useContext(Rendering3DFlagsContext);
|
|
17402
17179
|
return /* @__PURE__ */ jsx(
|
|
17403
|
-
|
|
17180
|
+
SmartArt3DView,
|
|
17404
17181
|
{
|
|
17405
17182
|
element,
|
|
17406
17183
|
className,
|
|
17184
|
+
smartArt3D,
|
|
17407
17185
|
canEdit,
|
|
17408
17186
|
onUpdateElement,
|
|
17409
17187
|
animationState
|
|
@@ -17415,7 +17193,12 @@ function groupIntoParagraphs2(element, fieldContext) {
|
|
|
17415
17193
|
element,
|
|
17416
17194
|
fieldContext ? (seg) => {
|
|
17417
17195
|
if (seg.fieldType) {
|
|
17418
|
-
const substituted = substituteFieldText(
|
|
17196
|
+
const substituted = substituteFieldText(
|
|
17197
|
+
seg.text,
|
|
17198
|
+
seg.fieldType,
|
|
17199
|
+
fieldContext,
|
|
17200
|
+
seg.style?.language
|
|
17201
|
+
);
|
|
17419
17202
|
if (substituted !== seg.text) {
|
|
17420
17203
|
return { ...seg, text: substituted };
|
|
17421
17204
|
}
|
|
@@ -17478,7 +17261,7 @@ function EnvelopeGlyph({
|
|
|
17478
17261
|
}
|
|
17479
17262
|
return /* @__PURE__ */ jsx("g", { "data-glyph-slices": glyph.slices.length, children: glyph.slices.map((slice, si) => {
|
|
17480
17263
|
const clipId = `${glyphKey}-s${si}`;
|
|
17481
|
-
return /* @__PURE__ */ jsxs(
|
|
17264
|
+
return /* @__PURE__ */ jsxs(React17.Fragment, { children: [
|
|
17482
17265
|
/* @__PURE__ */ jsx("clipPath", { id: clipId, clipPathUnits: "userSpaceOnUse", children: /* @__PURE__ */ jsx(
|
|
17483
17266
|
"rect",
|
|
17484
17267
|
{
|
|
@@ -17548,6 +17331,22 @@ function WarpedText({
|
|
|
17548
17331
|
const baseFontFamily = textEl.textStyle?.fontFamily ? getSubstituteFontFamily(textEl.textStyle.fontFamily) : DEFAULT_FONT_FAMILY;
|
|
17549
17332
|
const baseFill = normalizeHexColor(textEl.textStyle?.color, fallbackColor);
|
|
17550
17333
|
if (hasGlyphEnvelope(preset)) {
|
|
17334
|
+
const perLine = buildGlyphEnvelopeBlock(
|
|
17335
|
+
preset,
|
|
17336
|
+
paragraphs.map(
|
|
17337
|
+
(para) => para.segments.map((seg, i) => ({
|
|
17338
|
+
text: seg.text,
|
|
17339
|
+
font: resolveSegmentFont(seg, textEl),
|
|
17340
|
+
segmentIndex: i
|
|
17341
|
+
}))
|
|
17342
|
+
),
|
|
17343
|
+
width,
|
|
17344
|
+
height,
|
|
17345
|
+
align,
|
|
17346
|
+
warpAdj,
|
|
17347
|
+
warpAdj2,
|
|
17348
|
+
getGlyphOutline
|
|
17349
|
+
);
|
|
17551
17350
|
return /* @__PURE__ */ jsx(
|
|
17552
17351
|
"svg",
|
|
17553
17352
|
{
|
|
@@ -17558,23 +17357,7 @@ function WarpedText({
|
|
|
17558
17357
|
style: { overflow: "visible", position: "absolute", inset: 0, pointerEvents: "none" },
|
|
17559
17358
|
"aria-hidden": "true",
|
|
17560
17359
|
children: paragraphs.map((para, paraIdx) => {
|
|
17561
|
-
const
|
|
17562
|
-
text: seg.text,
|
|
17563
|
-
font: resolveSegmentFont(seg, textEl),
|
|
17564
|
-
segmentIndex: i
|
|
17565
|
-
}));
|
|
17566
|
-
const glyphs = buildGlyphEnvelope(
|
|
17567
|
-
preset,
|
|
17568
|
-
segsInput,
|
|
17569
|
-
width,
|
|
17570
|
-
height,
|
|
17571
|
-
align,
|
|
17572
|
-
warpAdj,
|
|
17573
|
-
warpAdj2,
|
|
17574
|
-
paraIdx,
|
|
17575
|
-
lineCount,
|
|
17576
|
-
getGlyphOutline
|
|
17577
|
-
);
|
|
17360
|
+
const glyphs = perLine[paraIdx] ?? [];
|
|
17578
17361
|
return /* @__PURE__ */ jsx(
|
|
17579
17362
|
EnvelopeLine,
|
|
17580
17363
|
{
|
|
@@ -18406,7 +18189,7 @@ function StaticElementRendererImpl({
|
|
|
18406
18189
|
}
|
|
18407
18190
|
);
|
|
18408
18191
|
}
|
|
18409
|
-
var StaticElementRenderer =
|
|
18192
|
+
var StaticElementRenderer = React17.memo(StaticElementRendererImpl);
|
|
18410
18193
|
StaticElementRenderer.displayName = "StaticElementRenderer";
|
|
18411
18194
|
function SlideLayer({
|
|
18412
18195
|
slide,
|
|
@@ -18879,4 +18662,4 @@ function useResizablePanels() {
|
|
|
18879
18662
|
};
|
|
18880
18663
|
}
|
|
18881
18664
|
|
|
18882
|
-
export { ACTION_VERB_MAP,
|
|
18665
|
+
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 };
|