pptx-react-viewer 4.38.0 → 4.39.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 +22 -0
- package/dist/{chunk-Q5WEQ37H.js → chunk-2LNWGZPT.js} +1641 -1419
- package/dist/chunk-2LNWGZPT.js.br +0 -0
- package/dist/chunk-2LNWGZPT.js.gz +0 -0
- package/dist/{chunk-3SFBCFHJ.mjs → chunk-5XBS7MCX.mjs} +42 -8
- package/dist/chunk-5XBS7MCX.mjs.br +0 -0
- package/dist/chunk-5XBS7MCX.mjs.gz +0 -0
- package/dist/{chunk-TCEDOLGE.js → chunk-HOKZJLT5.js} +42 -6
- package/dist/chunk-HOKZJLT5.js.br +0 -0
- package/dist/chunk-HOKZJLT5.js.gz +0 -0
- package/dist/{chunk-LLH3I2XY.mjs → chunk-TYULCCA6.mjs} +639 -417
- package/dist/chunk-TYULCCA6.mjs.br +0 -0
- package/dist/chunk-TYULCCA6.mjs.gz +0 -0
- package/dist/i18n/de.cjs +545 -41
- package/dist/i18n/de.cjs.br +0 -0
- package/dist/i18n/de.cjs.gz +0 -0
- package/dist/i18n/de.mjs +545 -41
- package/dist/i18n/de.mjs.br +0 -0
- package/dist/i18n/de.mjs.gz +0 -0
- package/dist/i18n/es.cjs +545 -41
- package/dist/i18n/es.cjs.br +0 -0
- package/dist/i18n/es.cjs.gz +0 -0
- package/dist/i18n/es.mjs +545 -41
- package/dist/i18n/es.mjs.br +0 -0
- package/dist/i18n/es.mjs.gz +0 -0
- package/dist/i18n/fr.cjs +548 -41
- package/dist/i18n/fr.cjs.br +0 -0
- package/dist/i18n/fr.cjs.gz +0 -0
- package/dist/i18n/fr.mjs +548 -41
- package/dist/i18n/fr.mjs.br +0 -0
- package/dist/i18n/fr.mjs.gz +0 -0
- package/dist/i18n/zh-CN.cjs +556 -52
- package/dist/i18n/zh-CN.cjs.br +0 -0
- package/dist/i18n/zh-CN.cjs.gz +0 -0
- package/dist/i18n/zh-CN.mjs +556 -52
- package/dist/i18n/zh-CN.mjs.br +0 -0
- package/dist/i18n/zh-CN.mjs.gz +0 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +22 -22
- package/dist/index.js.br +0 -0
- package/dist/index.js.gz +0 -0
- package/dist/index.mjs +2 -2
- package/dist/index.mjs.br +0 -0
- package/dist/index.mjs.gz +0 -0
- package/dist/internals.d.ts +6 -0
- package/dist/internals.js +80 -80
- package/dist/internals.js.br +0 -0
- package/dist/internals.js.gz +0 -0
- package/dist/internals.mjs +1 -1
- 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.js +17 -17
- package/dist/viewer/index.js.br +0 -0
- package/dist/viewer/index.js.gz +0 -0
- package/dist/viewer/index.mjs +2 -2
- package/dist/viewer/index.mjs.br +0 -0
- package/dist/viewer/index.mjs.gz +0 -0
- package/package.json +3 -3
- package/dist/chunk-3SFBCFHJ.mjs.br +0 -0
- package/dist/chunk-3SFBCFHJ.mjs.gz +0 -0
- package/dist/chunk-LLH3I2XY.mjs.br +0 -0
- package/dist/chunk-LLH3I2XY.mjs.gz +0 -0
- package/dist/chunk-Q5WEQ37H.js.br +0 -0
- package/dist/chunk-Q5WEQ37H.js.gz +0 -0
- package/dist/chunk-TCEDOLGE.js.br +0 -0
- package/dist/chunk-TCEDOLGE.js.gz +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useViewerOptions, useReadOnlyRecommendationState, useCompatibilityToastsState, useReducedMotion, useViewerState, useIsMobile, useResizablePanels, useDerivedSlideState, useZoomViewport, useEditorHistory, usePresentationSetup, useTouchGestures, useViewerDialogs, useEditorOperations, useViewerIntegration, useViewPreferencesSync, useLayoutSwitching, Rendering3DFlagsContext, CollaborationProvider, useCollaboration, useCollaborationDocumentSync, useFollowMode, useBroadcastFollower, SlideBackgroundImageLayer, StaticElementRenderer, safePrompt, scopeLayoutOptionsToActiveSlide, createReviewCommentsHost, ChartPartSelectionProvider, useToolbarVisibility, useKeyboardInsets, useModalDismissDrag, ViewerOptionsStoreContext, ViewerOptionsContext, useViewerOptionsContext, useVirtualizedSlides, useSwipeNavigation, PresentationTransitionOverlay, RemoteSelectionOverlay, CollaborationCursorOverlay, useSheetDismissDrag, detectTargetType, parseEmailUrl, parseSlideFromUrl, ACTION_VERB_MAP, ElementRenderer, InlineCollaborationContext, SmartArtRenderer, downloadBlob, playAnimationSound, ResizeHandles, imgSrc, renderStrokeView, useChartPartSelection, DUOTONE_PRESETS, getSlideTransitionAnimations, SLIDE_TRANSITION_KEYFRAMES, resolveSmartArtDataPalette } from './chunk-
|
|
1
|
+
import { useViewerOptions, useReadOnlyRecommendationState, useCompatibilityToastsState, useReducedMotion, useViewerState, useIsMobile, useResizablePanels, useDerivedSlideState, useZoomViewport, useEditorHistory, usePresentationSetup, useTouchGestures, useViewerDialogs, useEditorOperations, useViewerIntegration, useViewPreferencesSync, useLayoutSwitching, Rendering3DFlagsContext, CollaborationProvider, ChartFormatContext, useCollaboration, useCollaborationDocumentSync, useFollowMode, useBroadcastFollower, SlideBackgroundImageLayer, StaticElementRenderer, safePrompt, scopeLayoutOptionsToActiveSlide, createReviewCommentsHost, ChartPartSelectionProvider, useToolbarVisibility, useKeyboardInsets, useModalDismissDrag, ViewerOptionsStoreContext, ViewerOptionsContext, useViewerOptionsContext, useVirtualizedSlides, useSwipeNavigation, PresentationTransitionOverlay, RemoteSelectionOverlay, CollaborationCursorOverlay, useSheetDismissDrag, detectTargetType, parseEmailUrl, parseSlideFromUrl, ACTION_VERB_MAP, ElementRenderer, InlineCollaborationContext, useChartFormatContext, SmartArtRenderer, downloadBlob, playAnimationSound, ResizeHandles, imgSrc, renderStrokeView, useChartPartSelection, DUOTONE_PRESETS, getSlideTransitionAnimations, SLIDE_TRANSITION_KEYFRAMES, resolveSmartArtDataPalette } from './chunk-5XBS7MCX.mjs';
|
|
2
2
|
import { ANIMATION_PRESET_OPTIONS, dist_exports, cn, SLIDE_NAV_THUMBNAIL_WIDTH, SLIDE_TRANSITION_OPTIONS, normalizeHexColor, hasCopyableFormat, DEFAULT_SECTION_GROUP_ID, safeOpenUrl, isPpactionUrl, parsePpactionUrl, SHORTCUT_REFERENCE_ITEMS, TOOLBAR_SECTIONS, isUrlSafe, computeHandoutLayout, getPrintableArea, generateNoteLineCount, UNGROUPED_SECTION_ID, getShapeAdjustmentHandleDescriptors, isConnectorOrLineElement, GRID_SIZE, getElementTransformWithoutRotation, getElementTransform, MIN_ELEMENT_SIZE, getElementLabel, TABLE_STYLE_PRESETS, SHAPE_PRESETS, sanitizeGradientStops, formatCommentTimestamp, clampCropValue, CONNECTOR_ARROW_OPTIONS, ARROW_SIZE_OPTIONS, DEFAULT_FILL_COLOR, startMotionPathPreview, startPreviewAnimation, stopPreviewAnimation, SHAPE_QUICK_STYLES, getPatternSvg, DEFAULT_STROKE_COLOR, STROKE_DASH_OPTIONS, openNativeEyeDropper } from './chunk-UC2VQORY.mjs';
|
|
3
|
-
import { EMPTY_RESOLVED_CUSTOMIZATION, ANIMATION_DIRECTION_LABEL_KEYS, compileEquationTemplateMathMl, resolveViewerRootOptions, buildUserFontFaceStyles, readStoredViewerPrefs, resolveThemeCatalogEntry, THEME_CATALOG, writeStoredViewerPrefs, openPptxFile, readBackstageRecentFile, isFeatureEnabled, isDialogAvailable, isEditingAllowed, resolveAutosaveActivation, viewerOptionsToPreferences, applyPreferenceToOptions, resolveHistoryDepth, attachViewerHyperlinks, shouldConfirmExternalHyperlink, applyAutoCorrect, resolveImageResolutionScale, resolveAutosaveIntervalMs, resolveAutosaveIntervalSeconds, createSlidePackageClipboard, isPanelVisible, shouldShowAutosaveRecoveryPrompt, resolveOptionRootClasses, RIBBON_SCOPE_ATTR, resolve3DRenderingFlags, resolveSlideSizeSelection, RULER_THICKNESS, RULER_FONT_SIZE, editorThumbnailHeight, buildPreviewElements, deriveSlideFieldContext, deviceStrokeStageStyle, hiddenSlideCue, EDITOR_THUMBNAIL_WIDTH, HIDDEN_SLIDE_SLASH_GRADIENT, HIDDEN_SLIDE_LABEL_KEY, visibleTemplateElements, themeToCssVars, createCustomizationController, resolveEffectiveHiddenActions, listAutosaveSnapshots, resolveExpiredAutosaveSnapshots, deleteAutosaveSnapshot, tableLayoutCells, masterViewCrudActions, applyMasterViewCrudAction, masterViewCrudFailureKey, EDITOR_CHROME_CSS, ribbonCustomizationCss, applyMotionPathPreset, resetSlideLayoutPath, DEFAULT_INSERT_CHART_KIND, templateSchemeFromTheme, createBackstagePresentation, playFeedbackSound, shouldDiscardAutosaveOnSuccessfulSave, buildFieldSubstitutionContext, setMasterViewBackgroundColor, canUseClipboard, runProgramNoticeStackStyle, observeElementHeight, printPropertiesFrameSlides, printPropertiesSlidesPerPage, PASTE_SPECIAL_OPTIONS, findCanvasElementNode, isHeaderFooterDateTextVisible, isHeaderFooterHeaderTextVisible, isHeaderFooterFooterTextVisible, getDensePanelTouchTargetPx, shouldStickyActionRow, buildJoinCollaborationConfig, buildCreateCollaborationConfig, generateBroadcastRoomId, DEFAULT_BROADCAST_SERVER_URL, buildBroadcastViewerUrl, resolveTransportForServerUrl, getSlideBackgroundStyle, pushRecentColor, mruColorsPatch, shouldClearAutosaveCacheOnClose, canCropElement, cropSessionChanged, cancelCropUpdate, startCropSession, homeLaunchers, attachRibbonOverflow, getRegionRenderer, ViewerRegionHost, editorThumbnailWidth, masterViewBackgroundColor, resolvePresentationAction, isPresentationAdvanceClick, toggleBlackboard, PRESENT_TOOLBAR_CLASSES, resolveEditPointsAvailability, isCurrentLayout, EXPANDED_MAX_HEIGHT, resolveStatusBarSave, statusBarViewMode, formatVersionTimestamp, formatRelativeTime, scanAvailableFontFamilies, PRESETS, CATEGORIES, convertOmmlToLatex, compileLatexEquation, convertLatexToOmml, EQUATION_TEMPLATES, clampPercent, resolveDefaultPrintSettings, HANDOUT_OPTIONS, bindPptxOptionsDialog, optionsBlockSlot, optionsPaneSlot, DEFAULT_QUICK_ACCESS_COMMAND_IDS, AI_OPTIONS_CATEGORY, activateModalFocus, buildCollaborationShareUrl, buildActiveSessionUsers, slideClipboardLabels, sorterPasteInsertAt, SORTER_MIN_ZOOM, SORTER_ZOOM_STEP, SORTER_MAX_ZOOM, canGoPrevious, formatSlideCounter, READING_VIEW_COUNTER_ATTR, canGoNext, READING_VIEW_ATTR, listenForOutlineViewDismiss, OUTLINE_LEVEL_ATTR, OUTLINE_SLIDE_ATTR, OUTLINE_ROW_ATTR, OUTLINE_VIEW_ATTR, mobileElapsedSince, nextPresentedSlide, presenterPrevDisabled, presenterNextDisabled, formatMobileElapsed, mobileSlideCounter, presenterPaneAdvancesOnClick, presenterTimerProgress, PRESENTER_CONSOLE_CLASSES, formatElapsed, cropModeKeyAction, buildTitleBarState, resolveScreenTip, visibleContextualTabs, resolveActiveRibbonTab, visibleRibbonAddIns, RIBBON_ADD_IN_TAB_ATTR, contextualTabLabelKey, RIBBON_CONTEXTUAL_TAB_ATTR, buildTabRowActionsState, TAB_ROW_ACTION_CLASSES, tabRowActionsAttributes, backstageNavEntries, BACKSTAGE_NAV, listBackstageRecentFiles, BACKSTAGE_BACK_CLASSES, BACKSTAGE_NAV_CLASSES, FREEFORM_TOOL_IDS, isDrawingToolVisible, textFontSizePtToPx, withHomeGalleries, drawingHomeControls, homeGalleryControls, homeGalleryApply, shapeOutlineChange, shapeFillChange, editingHomeControls, arrangeHomeControls, arrangePainterHomeControls, arrangeAlignAction, DESIGN_RIBBON_GROUPS, DESIGN_RIBBON_COMMANDS, designCommandState, FIXED_TAB_GALLERIES, CONTEXTUAL_TAB_GROUPS, editorThumbnailStep, resolveSlidePaneClick, SLIDE_VIRTUALIZATION_THRESHOLD, buildSectionContextMenuEntries, buildSlidePaneContextMenuEntries, slidePaneViewItems, isEditPointsEnabled, findReplacementAvailability, PRESENTATION_HIT_TEST_CSS, PRESENTATION_STAGE_ATTRIBUTE, buildStrokePathD, cursorForTool, annotationOverlayZIndex, presentationInkPath, resolveNotesSchematicBodyFontSizePx, PRESENTER_NAVIGATOR_LABEL_KEYS, getPresentationContextMenuSections, CONTEXT_MENU_PRESENTATION_LAYER, presentationViewItems, subtitleRecognitionLanguage, subtitleSettingsFromOptions, getSpeechRecognitionCtor, mergeCaptionResults, customizeContextMenuEntries, buildContextMenuEntries, contextMenuViewItems, customizeCanvasContextMenuEntries, buildCanvasContextMenuEntries, buildLayoutPreviewGeometry, scaleSlidesForSizeChange, slideSizeToCanvasPx, resolveSelectionPaneRename, themeEditorLabels, resolveNotesSegments, defaultRichEnabled, segmentsToEditorHtml, DEBOUNCE_MS, createPlainNotesSegments, parseSegmentsFromRichEditor, segmentsToPlainText, getCurrentParagraphIndex, segmentsToParagraphs, paragraphsToSegments, MAX_INDENT_LEVEL, INDENT_PX as INDENT_PX$1, buildNotesPrintHtml, MIN_TOUCH_TARGET_PX, toggleSheet, SMARTART_PREVIEW_ELEMENT_HEIGHT, SMARTART_PREVIEW_ELEMENT_WIDTH, buildSmartArtPreviewElement, sanitizeMathMl, computeAllNotesPages, getNotesPrintableArea, CUSTOM_FONT_ACCEPT, TOOLBAR_TABS, SHORTCUT_REFERENCE_ITEMS as SHORTCUT_REFERENCE_ITEMS$1, availableQuickAccessCommands, addQuickAccessCommand, removeQuickAccessCommand, moveQuickAccessCommand, resolveViewerAddinRows, createSlideSorterState, sorterSelectionIndexes, selectSorterSlide, applySorterAction, sorterGridColumns, sorterMenuContext, buildSlideSorterContextMenuEntries, slideSorterContextMenuLabel, openReadingView, applyReadingViewCommand, createPresentationKeyBuffer, readingViewFitScale, READING_VIEW_STAGE_ATTR, buildOutline, applyOutlineEdit, mapOutlineKey, notesSegmentsToSpans, erasePresentationInkAt, movePresenterPointer, appendPresentationInkPoint, presenterConsoleAction, presenterConsoleViewState, NOTES_FONT_SIZE_DEFAULT, formatTime, NOTES_FONT_SIZE_MIN, clampNotesFontSize, NOTES_FONT_SIZE_STEP, NOTES_FONT_SIZE_MAX, BACKSTAGE_TEMPLATES, formatBackstageDate, formatBackstageSize, customizeBackstageCards, backstageCardsFor, DEFAULT_VIEWER_PROFILE, resolveProfileInitial, AVATAR_COLOR_SWATCHES, clipboardHomeControls, slidesHomeControls, resolveInsertSlideLayout, resolveDefaultFontFamily, textFontSizePxToPt, getInlineEditorSelectionResult, selectedParagraphBulletKind, elementBulletKind, selectionBulletKind, fontPickerHomeControls, fontHomeControls, nextToggleValue, RIBBON_GROUP_ATTR, paragraphHomeAlign, paragraphHomeControls, paragraphHomeAction, arrangeShapeHomeControls, strokeWidthOf, canSetStrokeWidth, canUngroupSelection, canGroupSelection, buildRibbonGallery, readRibbonTransitionDraft, SLIDE_SHOW_COMMAND_GROUPS, RECORD_COMMAND_GROUPS, trackActiveComment, commentCounts, findCommentLocation, buildReviewRibbon, HELP_RIBBON_COMMANDS, galleryTextLabel, pictureSizeHomeControls, sectionAddAfterSlideIndex, masterViewPseudoSlide, PRESENTATION_ANIM_TRIGGER_ATTRIBUTE, parentSelection, slideSpaceElement, isGroupMember, motionPathFor, setMotionPath, shouldShowElementHandles, computeAnchoredPopupPosition, applyTableStyleDelete, applyTableStyleMapChange, registerCustomFont, QUICK_ACCESS_COMMAND_CATALOG, handleReadingViewKey, getLocalStorageUsageSummary, saveViewerProfile, clearAllLocalViewerData, SLIDE_TEMPLATES, getSelectionTextStyleFlags, TEXT_DECORATION_FLAGS, dispatchCropRequest, applyRibbonGalleryItem, ribbonTransitionsDraftPatch, ribbonTransitionUpdates, ribbonTransitionsSoundChange, ribbonTransitionStockSoundUrl, playSlideTransitionPreview, playAnimationRibbonPreview, SLIDE_SHOW_OPTIONS, createViewerOptionsStore, subtitleSettingsLabels, isReviewCommentCommand, runReviewCommentCommand, attachEditorImagePaste, authorConnectorBetweenSites, findEraserHitElementId, generateTicks, rulerDragToGuidePosition, resolveElementInteractivity, buildChartQuickActionsDescriptor, applyChartElementToggle, CHART_QUICK_ACTION_BUTTON_SIZE, applyChartStylePreset, hideChartSeries, restoreFilteredSeries, buildCropOverlay, CROP_HANDLE_ARIA_KEY, getActiveXControlOverlayView, buildCommentMarkers, COMMENT_MARKER_SIZE, collectConnectorSiteCandidates, getConnectorEndpointHandles, findConnectorSiteNear, motionPathToSvgD, motionPathEndPixel, isEditableMotionPath, setMotionPathEnd, canEditElementPoints, MERGE_SHAPES_MENU_ITEMS, hasMultipleSelectedTableCells, isElementLocked, mergeSlideTransition, slideBackgroundClearState, slideBackgroundClearPatch, effectiveDirection, TRIGGER_OPTIONS, effectiveTimingCurve, getAfterAnimationState, mapSlideSorterKey, isEditorTextInputTarget, clampSorterZoom, buildSlideTemplateContent, updateSubtitleSettings, buildFreeformShapeElement, buildLiveInkStrokeView, beginCropDrag, CONNECTOR_SITE_SNAP_PX, resolveConnectorEndpointUpdate, withConnectorEndpointUpdate, getShapeConnectionSites, FreeformToolSession, attachOverlayKeyboard, EditPointsSession, EDIT_POINTS_STYLE, elementLockTogglePatch, buildTableDataGrid, getDenseGridLayoutPlan, appendTableElementRow, removeLastTableElementRow, appendTableElementColumn, removeLastTableElementColumn, removeTableElementColumn, removeTableElementRow, setTableElementCellText, applyTableStylePreset, tableStyleAssignmentUpdate, evenColumnWidths, redistributeColumnWidth, evenRowHeights, inspectorNumber, patchChartData, collapseChartTitleRunsForEdit, chartGridlinesState, chartGridlinesPatch, seriesSecondaryAxisPatch, setChartCategoryLabel, setChartCellValue, addChartCategory, removeChartCategory, addChartSeries, removeChartSeries, setDataLabelsRangeCache, describeSmartArtBounds, canAddTopLevelNode, classifyExtraConnections, siblingIndex, siblingCount, canRemoveTopLevelNode, imageResetPatch, imageResetState, canInteractWithElement, buildOleObjectNamePatch, shouldShowAccessibilitySection, withFrameSlides, withSlidesPerPage, schemaLabel, THEME_COLOR_SLOT_LABEL_KEYS, SLIDE_SIZE_PRESETS, TRANSITION_ORIENTATION_TYPES, clampTransitionNumber, TRANSITION_SPEED_OPTIONS, TRANSITION_MORPH_OPTIONS, flattenTagCollections, resolveTemplateBackgroundRows, commentMentionQuery, matchCommentMentionAuthors, buildAnimationTimelineRows, clearMotionPath, setTrigger, setTriggerBookmark, getEffectSoundState, setEffectSound, setEffectStockSound, setAfterAnimation, setAfterAnimationColor, directionValuesFor, buildAnimationTimelineBars, motionPathPresetIdForPath, MOTION_PATH_FAMILIES, motionPathPresetsByFamily, motionPathPresetLabelKey, motionPathFamilyLabelKey, EFFECT_SOUND_CATALOGUE, listMediaBookmarkOptions, selectedBookmarkOptionValue, hasTiltData, toElementAxes, dragCropHandle, panCropImage, clientToSlidePoint, EDIT_POINTS_TARGET_ATTR, describeTableStyleEditor, TABLE_STYLE_EDITOR_PARTS, computeMergeCellRight, computeMergeCellDown, computeSplitCell, resolveDisplayedChartType, CHART_TYPE_OPTIONS, chartDataLabelsTogglePatch, BAR3D_SHAPE_OPTIONS, bar3DShapePatch, RADAR_STYLE_OPTIONS, radarStylePatch, SURFACE_WIREFRAME_OPTIONS, surfaceWireframePatch, isSeriesUsingSecondaryAxis, seriesColorClearState, listChartUserShapeRows, withChartUserShapeAdded, createDefaultChartUserShape, withChartUserShapeRowRemoved, withChartUserShapeRowTextUpdated, SMARTART_COLOR_SCHEME_LABEL_KEYS, SMARTART_STYLE_LABEL_KEYS, addSiblingAfter, removeEmptyNode, demote, promote, reorder, cropResetState, cropResetPatch, ARTISTIC_EFFECTS, mediaTrimEndSeconds, trimmedMediaDurationMs, mediaTrimEndAbsoluteMs, mediaTrimResetState, mediaTrimEndMsFromAbsoluteMs, mediaTrimResetPatch, buildOleEditDialogDescriptor, buildOleContentUpdatePatch, buildThemeColorSwatchGrid, themeColorSwatchRows, findSelectedThemeSwatch, themeSwatchCommit, getNonVisualDescriptionFields, resolveActionType, ELEMENT_ACTION_TYPE_OPTIONS, canCommitActionType, slideSizeFromPreset, withSlideSizeOrientation, TRANSITION_DIR_ARROWS, buildDirectionGrid, updateTagInCollections, deleteTagFromCollections, addTagToCollections, commentTextSegments, COMMENT_MENTION_CLASS, COMMENT_MENTION_ATTRIBUTE, insertCommentMention, reorderAnimationTimelineRows, applyAnimationTimelineOrder, getEffectSoundAsset, animationEffectLabel, overlayPointerInput, TABLE_STYLE_BORDER_SIDES, applyTableStyleFieldEdit, withCellStyle, LBL as LBL$1, SEL as SEL$1, FILL_MODE_OPTIONS as FILL_MODE_OPTIONS$1, SECTION_HEADING, NUM as NUM$1, getChartUserShapeGroupTransform, withChartUserShapeGroupChildAdded, createDefaultChartUserShapeGroupChild, withChartUserShapeRowUpdated, getChartUserShapeRowChartBox, withChartUserShapeRowFlipUpdated, withChartUserShapeRowRotationUpdated, withChartUserShapeRowChartBoxUpdated, smartArtLayoutSwitchPatch, rebuildDrawingShapesIfCleared, mediaTrimEndMsFromSeconds, validateMediaTrimRange, quickStyleSwatchCss, shapeQuickStyleLabel, OFFICE_COLOR_SWATCHES, officeColorSwatchLabel, PATTERN_PRESET_OPTIONS as PATTERN_PRESET_OPTIONS$1, COMPOUND_LINE_OPTIONS as COMPOUND_LINE_OPTIONS$1, LINE_JOIN_OPTIONS as LINE_JOIN_OPTIONS$1, LINE_CAP_OPTIONS as LINE_CAP_OPTIONS$1, TEXT_WARP_PRESETS, warpPreviewPath, text3dPtToEmu, text3dEmuToPt, MATERIAL_PRESETS, toSlideIndex, TABLE_STYLE_BORDER_SIDE_LABEL_KEYS, TABLE_STYLE_DASH_PRESETS, GRADIENT_TYPE_OPTIONS as GRADIENT_TYPE_OPTIONS$1, PATTERN_OPTIONS, FILL_PATTERN_LABEL_KEYS, toggleText3dExtrusion, BEVEL_PRESETS, cropFit, cropFill, cropToAspectRatio } from 'ooxml-ui/pptx';
|
|
3
|
+
import { EMPTY_RESOLVED_CUSTOMIZATION, ANIMATION_DIRECTION_LABEL_KEYS, compileEquationTemplateMathMl, resolveViewerRootOptions, buildUserFontFaceStyles, readStoredViewerPrefs, resolveThemeCatalogEntry, THEME_CATALOG, writeStoredViewerPrefs, openPptxFile, readBackstageRecentFile, isFeatureEnabled, isDialogAvailable, isEditingAllowed, resolveAutosaveActivation, viewerOptionsToPreferences, applyPreferenceToOptions, resolveHistoryDepth, attachViewerHyperlinks, shouldConfirmExternalHyperlink, applyAutoCorrect, resolveImageResolutionScale, resolveAutosaveIntervalMs, resolveAutosaveIntervalSeconds, createSlidePackageClipboard, isPanelVisible, shouldShowAutosaveRecoveryPrompt, resolveOptionRootClasses, RIBBON_SCOPE_ATTR, resolve3DRenderingFlags, resolveSlideSizeSelection, RULER_THICKNESS, RULER_FONT_SIZE, editorThumbnailHeight, buildPreviewElements, deriveSlideFieldContext, deviceStrokeStageStyle, hiddenSlideCue, EDITOR_THUMBNAIL_WIDTH, HIDDEN_SLIDE_SLASH_GRADIENT, HIDDEN_SLIDE_LABEL_KEY, visibleTemplateElements, themeToCssVars, createCustomizationController, resolveEffectiveHiddenActions, listAutosaveSnapshots, resolveExpiredAutosaveSnapshots, deleteAutosaveSnapshot, tableLayoutCells, resetChartFormatTarget, masterViewCrudActions, applyMasterViewCrudAction, masterViewCrudFailureKey, EDITOR_CHROME_CSS, ribbonCustomizationCss, applyMotionPathPreset, resetSlideLayoutPath, DEFAULT_INSERT_CHART_KIND, templateSchemeFromTheme, createBackstagePresentation, playFeedbackSound, shouldDiscardAutosaveOnSuccessfulSave, buildFieldSubstitutionContext, setMasterViewBackgroundColor, canUseClipboard, runProgramNoticeStackStyle, observeElementHeight, printPropertiesFrameSlides, printPropertiesSlidesPerPage, PASTE_SPECIAL_OPTIONS, findCanvasElementNode, isHeaderFooterDateTextVisible, isHeaderFooterHeaderTextVisible, isHeaderFooterFooterTextVisible, getDensePanelTouchTargetPx, shouldStickyActionRow, buildJoinCollaborationConfig, buildCreateCollaborationConfig, generateBroadcastRoomId, DEFAULT_BROADCAST_SERVER_URL, buildBroadcastViewerUrl, resolveTransportForServerUrl, getSlideBackgroundStyle, pushRecentColor, mruColorsPatch, shouldClearAutosaveCacheOnClose, canCropElement, cropSessionChanged, cancelCropUpdate, startCropSession, homeLaunchers, attachRibbonOverflow, getRegionRenderer, ViewerRegionHost, editorThumbnailWidth, masterViewBackgroundColor, resolvePresentationAction, isPresentationAdvanceClick, toggleBlackboard, PRESENT_TOOLBAR_CLASSES, resolveEditPointsAvailability, isCurrentLayout, EXPANDED_MAX_HEIGHT, resolveStatusBarSave, statusBarViewMode, formatVersionTimestamp, formatRelativeTime, scanAvailableFontFamilies, PRESETS, CATEGORIES, convertOmmlToLatex, compileLatexEquation, convertLatexToOmml, EQUATION_TEMPLATES, clampPercent, resolveDefaultPrintSettings, HANDOUT_OPTIONS, bindPptxOptionsDialog, optionsBlockSlot, optionsPaneSlot, DEFAULT_QUICK_ACCESS_COMMAND_IDS, AI_OPTIONS_CATEGORY, activateModalFocus, buildCollaborationShareUrl, buildActiveSessionUsers, slideClipboardLabels, sorterPasteInsertAt, SORTER_MIN_ZOOM, SORTER_ZOOM_STEP, SORTER_MAX_ZOOM, canGoPrevious, formatSlideCounter, READING_VIEW_COUNTER_ATTR, canGoNext, READING_VIEW_ATTR, listenForOutlineViewDismiss, OUTLINE_LEVEL_ATTR, OUTLINE_SLIDE_ATTR, OUTLINE_ROW_ATTR, OUTLINE_VIEW_ATTR, mobileElapsedSince, nextPresentedSlide, presenterPrevDisabled, presenterNextDisabled, formatMobileElapsed, mobileSlideCounter, presenterPaneAdvancesOnClick, presenterTimerProgress, PRESENTER_CONSOLE_CLASSES, formatElapsed, cropModeKeyAction, buildTitleBarState, resolveScreenTip, visibleContextualTabs, resolveActiveRibbonTab, visibleRibbonAddIns, RIBBON_ADD_IN_TAB_ATTR, contextualTabLabelKey, RIBBON_CONTEXTUAL_TAB_ATTR, buildTabRowActionsState, TAB_ROW_ACTION_CLASSES, tabRowActionsAttributes, backstageNavEntries, BACKSTAGE_NAV, listBackstageRecentFiles, BACKSTAGE_BACK_CLASSES, BACKSTAGE_NAV_CLASSES, FREEFORM_TOOL_IDS, isDrawingToolVisible, textFontSizePtToPx, withHomeGalleries, drawingHomeControls, homeGalleryControls, homeGalleryApply, shapeOutlineChange, shapeFillChange, editingHomeControls, arrangeHomeControls, arrangePainterHomeControls, arrangeAlignAction, DESIGN_RIBBON_GROUPS, FIXED_TAB_GALLERIES, DESIGN_RIBBON_COMMANDS, designCommandState, CONTEXTUAL_TAB_GROUPS, editorThumbnailStep, resolveSlidePaneClick, SLIDE_VIRTUALIZATION_THRESHOLD, buildSectionContextMenuEntries, buildSlidePaneContextMenuEntries, slidePaneViewItems, isEditPointsEnabled, findReplacementAvailability, PRESENTATION_HIT_TEST_CSS, PRESENTATION_STAGE_ATTRIBUTE, buildStrokePathD, cursorForTool, annotationOverlayZIndex, presentationInkPath, resolveNotesSchematicBodyFontSizePx, PRESENTER_NAVIGATOR_LABEL_KEYS, getPresentationContextMenuSections, CONTEXT_MENU_PRESENTATION_LAYER, presentationViewItems, subtitleRecognitionLanguage, subtitleSettingsFromOptions, getSpeechRecognitionCtor, mergeCaptionResults, customizeContextMenuEntries, buildContextMenuEntries, contextMenuViewItems, customizeCanvasContextMenuEntries, buildCanvasContextMenuEntries, buildLayoutPreviewGeometry, scaleSlidesForSizeChange, slideSizeToCanvasPx, resolveSelectionPaneRename, themeEditorLabels, resolveNotesSegments, defaultRichEnabled, segmentsToEditorHtml, DEBOUNCE_MS, createPlainNotesSegments, parseSegmentsFromRichEditor, segmentsToPlainText, getCurrentParagraphIndex, segmentsToParagraphs, paragraphsToSegments, MAX_INDENT_LEVEL, INDENT_PX as INDENT_PX$1, buildNotesPrintHtml, MIN_TOUCH_TARGET_PX, toggleSheet, SMARTART_PREVIEW_ELEMENT_HEIGHT, SMARTART_PREVIEW_ELEMENT_WIDTH, buildSmartArtPreviewElement, sanitizeMathMl, computeAllNotesPages, getNotesPrintableArea, CUSTOM_FONT_ACCEPT, TOOLBAR_TABS, SHORTCUT_REFERENCE_ITEMS as SHORTCUT_REFERENCE_ITEMS$1, availableQuickAccessCommands, addQuickAccessCommand, removeQuickAccessCommand, moveQuickAccessCommand, resolveViewerAddinRows, createSlideSorterState, sorterSelectionIndexes, selectSorterSlide, applySorterAction, sorterGridColumns, sorterMenuContext, buildSlideSorterContextMenuEntries, slideSorterContextMenuLabel, openReadingView, applyReadingViewCommand, createPresentationKeyBuffer, readingViewFitScale, READING_VIEW_STAGE_ATTR, buildOutline, applyOutlineEdit, mapOutlineKey, notesSegmentsToSpans, erasePresentationInkAt, movePresenterPointer, appendPresentationInkPoint, presenterConsoleAction, presenterConsoleViewState, NOTES_FONT_SIZE_DEFAULT, formatTime, NOTES_FONT_SIZE_MIN, clampNotesFontSize, NOTES_FONT_SIZE_STEP, NOTES_FONT_SIZE_MAX, BACKSTAGE_TEMPLATES, formatBackstageDate, formatBackstageSize, customizeBackstageCards, backstageCardsFor, DEFAULT_VIEWER_PROFILE, resolveProfileInitial, AVATAR_COLOR_SWATCHES, clipboardHomeControls, slidesHomeControls, resolveInsertSlideLayout, SLIDE_TEMPLATES, resolveDefaultFontFamily, textFontSizePxToPt, getInlineEditorSelectionResult, selectedParagraphBulletKind, elementBulletKind, selectionBulletKind, fontPickerHomeControls, fontHomeControls, nextToggleValue, RIBBON_GROUP_ATTR, paragraphHomeAlign, paragraphHomeControls, paragraphHomeAction, arrangeShapeHomeControls, strokeWidthOf, canSetStrokeWidth, canUngroupSelection, canGroupSelection, buildRibbonGallery, readRibbonTransitionDraft, SLIDE_SHOW_COMMAND_GROUPS, RECORD_COMMAND_GROUPS, trackActiveComment, commentCounts, findCommentLocation, buildReviewRibbon, HELP_RIBBON_COMMANDS, galleryTextLabel, pictureSizeHomeControls, chartSelectionHomeControls, dispatchChartSelectionRequest, sectionAddAfterSlideIndex, masterViewPseudoSlide, PRESENTATION_ANIM_TRIGGER_ATTRIBUTE, parentSelection, slideSpaceElement, isGroupMember, motionPathFor, setMotionPath, shouldShowElementHandles, computeAnchoredPopupPosition, applyTableStyleDelete, applyTableStyleMapChange, registerCustomFont, QUICK_ACCESS_COMMAND_CATALOG, handleReadingViewKey, getLocalStorageUsageSummary, saveViewerProfile, clearAllLocalViewerData, buildSlideTemplateContent, getSelectionTextStyleFlags, TEXT_DECORATION_FLAGS, dispatchCropRequest, applyRibbonGalleryItem, ribbonTransitionsDraftPatch, ribbonTransitionUpdates, ribbonTransitionsSoundChange, ribbonTransitionStockSoundUrl, playSlideTransitionPreview, playAnimationRibbonPreview, SLIDE_SHOW_OPTIONS, createViewerOptionsStore, subtitleSettingsLabels, isReviewCommentCommand, runReviewCommentCommand, attachEditorImagePaste, authorConnectorBetweenSites, findEraserHitElementId, generateTicks, rulerDragToGuidePosition, resolveElementInteractivity, buildChartQuickActionsDescriptor, applyChartElementToggle, CHART_QUICK_ACTION_BUTTON_SIZE, applyChartStylePreset, hideChartSeries, restoreFilteredSeries, buildCropOverlay, CROP_HANDLE_ARIA_KEY, getActiveXControlOverlayView, buildCommentMarkers, COMMENT_MARKER_SIZE, collectConnectorSiteCandidates, getConnectorEndpointHandles, findConnectorSiteNear, motionPathToSvgD, motionPathEndPixel, isEditableMotionPath, setMotionPathEnd, canEditElementPoints, MERGE_SHAPES_MENU_ITEMS, hasMultipleSelectedTableCells, isElementLocked, mergeSlideTransition, slideBackgroundClearState, slideBackgroundClearPatch, effectiveDirection, TRIGGER_OPTIONS, effectiveTimingCurve, getAfterAnimationState, mapSlideSorterKey, isEditorTextInputTarget, clampSorterZoom, updateSubtitleSettings, buildFreeformShapeElement, buildLiveInkStrokeView, beginCropDrag, CONNECTOR_SITE_SNAP_PX, resolveConnectorEndpointUpdate, withConnectorEndpointUpdate, getShapeConnectionSites, FreeformToolSession, attachOverlayKeyboard, EditPointsSession, EDIT_POINTS_STYLE, elementLockTogglePatch, buildTableDataGrid, getDenseGridLayoutPlan, appendTableElementRow, removeLastTableElementRow, appendTableElementColumn, removeLastTableElementColumn, removeTableElementColumn, removeTableElementRow, setTableElementCellText, applyTableStylePreset, tableStyleAssignmentUpdate, evenColumnWidths, redistributeColumnWidth, evenRowHeights, inspectorNumber, patchChartData, collapseChartTitleRunsForEdit, chartGridlinesState, chartGridlinesPatch, seriesSecondaryAxisPatch, setChartCategoryLabel, setChartCellValue, addChartCategory, removeChartCategory, addChartSeries, removeChartSeries, setDataLabelsRangeCache, describeSmartArtBounds, canAddTopLevelNode, classifyExtraConnections, siblingIndex, siblingCount, canRemoveTopLevelNode, imageResetPatch, imageResetState, canInteractWithElement, buildOleObjectNamePatch, shouldShowAccessibilitySection, withFrameSlides, withSlidesPerPage, schemaLabel, THEME_COLOR_SLOT_LABEL_KEYS, SLIDE_SIZE_PRESETS, TRANSITION_ORIENTATION_TYPES, clampTransitionNumber, TRANSITION_SPEED_OPTIONS, TRANSITION_MORPH_OPTIONS, flattenTagCollections, resolveTemplateBackgroundRows, commentMentionQuery, matchCommentMentionAuthors, buildAnimationTimelineRows, clearMotionPath, setTrigger, setTriggerBookmark, getEffectSoundState, setEffectSound, setEffectStockSound, setAfterAnimation, setAfterAnimationColor, directionValuesFor, buildAnimationTimelineBars, motionPathPresetIdForPath, MOTION_PATH_FAMILIES, motionPathPresetsByFamily, motionPathPresetLabelKey, motionPathFamilyLabelKey, EFFECT_SOUND_CATALOGUE, listMediaBookmarkOptions, selectedBookmarkOptionValue, hasTiltData, toElementAxes, dragCropHandle, panCropImage, clientToSlidePoint, EDIT_POINTS_TARGET_ATTR, describeTableStyleEditor, TABLE_STYLE_EDITOR_PARTS, computeMergeCellRight, computeMergeCellDown, computeSplitCell, resolveDisplayedChartType, CHART_TYPE_OPTIONS, chartDataLabelsTogglePatch, BAR3D_SHAPE_OPTIONS, bar3DShapePatch, RADAR_STYLE_OPTIONS, radarStylePatch, SURFACE_WIREFRAME_OPTIONS, surfaceWireframePatch, isSeriesUsingSecondaryAxis, seriesColorClearState, listChartUserShapeRows, withChartUserShapeAdded, createDefaultChartUserShape, withChartUserShapeRowRemoved, withChartUserShapeRowTextUpdated, SMARTART_COLOR_SCHEME_LABEL_KEYS, SMARTART_STYLE_LABEL_KEYS, addSiblingAfter, removeEmptyNode, demote, promote, reorder, cropResetState, cropResetPatch, ARTISTIC_EFFECTS, mediaTrimEndSeconds, trimmedMediaDurationMs, mediaTrimEndAbsoluteMs, mediaTrimResetState, mediaTrimEndMsFromAbsoluteMs, mediaTrimResetPatch, buildOleEditDialogDescriptor, buildOleContentUpdatePatch, buildThemeColorSwatchGrid, themeColorSwatchRows, findSelectedThemeSwatch, themeSwatchCommit, getNonVisualDescriptionFields, resolveActionType, ELEMENT_ACTION_TYPE_OPTIONS, canCommitActionType, slideSizeFromPreset, withSlideSizeOrientation, TRANSITION_DIR_ARROWS, buildDirectionGrid, updateTagInCollections, deleteTagFromCollections, addTagToCollections, commentTextSegments, COMMENT_MENTION_CLASS, COMMENT_MENTION_ATTRIBUTE, insertCommentMention, reorderAnimationTimelineRows, applyAnimationTimelineOrder, getEffectSoundAsset, animationEffectLabel, overlayPointerInput, TABLE_STYLE_BORDER_SIDES, applyTableStyleFieldEdit, withCellStyle, LBL as LBL$1, SEL as SEL$1, FILL_MODE_OPTIONS as FILL_MODE_OPTIONS$1, SECTION_HEADING, NUM as NUM$1, getChartUserShapeGroupTransform, withChartUserShapeGroupChildAdded, createDefaultChartUserShapeGroupChild, withChartUserShapeRowUpdated, getChartUserShapeRowChartBox, withChartUserShapeRowFlipUpdated, withChartUserShapeRowRotationUpdated, withChartUserShapeRowChartBoxUpdated, smartArtLayoutSwitchPatch, rebuildDrawingShapesIfCleared, mediaTrimEndMsFromSeconds, validateMediaTrimRange, quickStyleSwatchCss, shapeQuickStyleLabel, OFFICE_COLOR_SWATCHES, officeColorSwatchLabel, PATTERN_PRESET_OPTIONS as PATTERN_PRESET_OPTIONS$1, COMPOUND_LINE_OPTIONS as COMPOUND_LINE_OPTIONS$1, LINE_JOIN_OPTIONS as LINE_JOIN_OPTIONS$1, LINE_CAP_OPTIONS as LINE_CAP_OPTIONS$1, TEXT_WARP_PRESETS, warpPreviewPath, text3dPtToEmu, text3dEmuToPt, MATERIAL_PRESETS, toSlideIndex, TABLE_STYLE_BORDER_SIDE_LABEL_KEYS, TABLE_STYLE_DASH_PRESETS, GRADIENT_TYPE_OPTIONS as GRADIENT_TYPE_OPTIONS$1, PATTERN_OPTIONS, FILL_PATTERN_LABEL_KEYS, toggleText3dExtrusion, BEVEL_PRESETS, cropFit, cropFill, cropToAspectRatio } from 'ooxml-ui/pptx';
|
|
4
4
|
export { THEME_CATALOG, defaultCssVars, defaultRadius, defaultThemeColors, resolveThemeCatalogEntry, themeToCssVars, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius } from 'ooxml-ui/pptx';
|
|
5
|
-
import
|
|
5
|
+
import React104, { createContext, lazy, forwardRef, useEffect, useState, useCallback, useMemo, useRef, useLayoutEffect, useSyncExternalStore, useId, useContext, useDeferredValue, Suspense, useReducer, Fragment as Fragment$1 } from 'react';
|
|
6
6
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
7
7
|
import { useTranslation } from 'react-i18next';
|
|
8
8
|
import { LuArrowDown, LuArrowUp, LuArrowRight, LuArrowLeft, LuArrowDownRight, LuArrowDownLeft, LuArrowUpRight, LuArrowUpLeft, LuMessageSquare, LuEyeOff, LuHistory, LuX, LuCalendarDays, LuClock, LuHash, LuFileText, LuText, LuCast, LuShieldCheck, LuPlus, LuPanelLeftClose, LuDownload, LuTrash2, LuCheck, LuLock, LuEye, LuType, LuLoader, LuShieldAlert, LuSignature, LuInfo, LuTriangleAlert, LuPrinter, LuPenTool, LuWifi, LuWifiOff, LuUsers, LuCopy, LuMinus, LuChevronLeft, LuChevronRight, LuPlay, LuPause, LuPanelLeft, LuPanelRight, LuSparkles, LuSettings, LuFolderOpen, LuPalette, LuSearch, LuCaseSensitive, LuChevronUp, LuChevronDown, LuReplace, LuGripVertical, LuLoaderCircle, LuUpload, LuGrid2X2, LuStickyNote, LuList, LuBug, LuClipboardCopy, LuPaintbrush, LuShapes, LuLayoutGrid, LuWand, LuPresentation, LuTextCursorInput, LuFile, LuEllipsis, LuUserRound, LuShare2, LuSave, LuFilePlus2, LuHouse, LuFileJson, LuBox, LuVideo, LuFileImage, LuDatabase, LuClock3, LuUser, LuHardDrive, LuLogIn, LuMove, LuCopyPlus, LuClipboardPaste, LuMonitor, LuRadio, LuCaptions, LuImage, LuFilter, LuLayers, LuSettings2, LuLockOpen, LuPencil, LuReply, LuMoveRight, LuRotateCw, LuScissors, LuBookmark, LuPipette } from 'react-icons/lu';
|
|
@@ -489,57 +489,11 @@ function SlideTemplateGalleryDialog({
|
|
|
489
489
|
)
|
|
490
490
|
] });
|
|
491
491
|
}
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
const disabled = !p.canEdit || p.selectedElement === null;
|
|
498
|
-
const selectedAnimation = useMemo(
|
|
499
|
-
() => p.selectedElement ? (p.activeSlide?.animations ?? []).find((a) => a.elementId === p.selectedElement?.id) : void 0,
|
|
500
|
-
[p.activeSlide?.animations, p.selectedElement]
|
|
501
|
-
);
|
|
502
|
-
useEffect(() => () => clearTimeout(timer.current), []);
|
|
503
|
-
useEffect(() => {
|
|
504
|
-
const host = ref.current;
|
|
505
|
-
if (!host) {
|
|
506
|
-
return;
|
|
507
|
-
}
|
|
508
|
-
host.state = {
|
|
509
|
-
editable: p.canEdit,
|
|
510
|
-
hasSelection: p.selectedElement !== null,
|
|
511
|
-
paneOpen: p.isInspectorPaneOpen,
|
|
512
|
-
previewActive,
|
|
513
|
-
translate: t
|
|
514
|
-
};
|
|
515
|
-
}, [p.canEdit, p.selectedElement, p.isInspectorPaneOpen, previewActive, t]);
|
|
516
|
-
useEffect(() => {
|
|
517
|
-
const host = ref.current;
|
|
518
|
-
if (!host) {
|
|
519
|
-
return;
|
|
520
|
-
}
|
|
521
|
-
const request = (event) => {
|
|
522
|
-
const intent = event.detail;
|
|
523
|
-
if (intent.kind === "add") {
|
|
524
|
-
p.onAddAnimation?.(intent.preset, intent.group);
|
|
525
|
-
} else if (intent.value === "remove") {
|
|
526
|
-
p.onRemoveAnimation?.();
|
|
527
|
-
} else if (intent.value === "preview") {
|
|
528
|
-
if (disabled) {
|
|
529
|
-
return;
|
|
530
|
-
}
|
|
531
|
-
setPreviewActive(true);
|
|
532
|
-
clearTimeout(timer.current);
|
|
533
|
-
timer.current = setTimeout(() => setPreviewActive(false), 1200);
|
|
534
|
-
playAnimationRibbonPreview(document, selectedAnimation);
|
|
535
|
-
} else {
|
|
536
|
-
(p.onOpenAnimationPanel ?? p.onToggleInspector)();
|
|
537
|
-
}
|
|
538
|
-
};
|
|
539
|
-
host.addEventListener("animations-request", request);
|
|
540
|
-
return () => host.removeEventListener("animations-request", request);
|
|
541
|
-
}, [p, disabled, selectedAnimation]);
|
|
542
|
-
return /* @__PURE__ */ jsx("pptx-ui-ribbon-animations", { ref });
|
|
492
|
+
var ViewerCustomizationContext = createContext(
|
|
493
|
+
EMPTY_RESOLVED_CUSTOMIZATION
|
|
494
|
+
);
|
|
495
|
+
function useViewerCustomizationContext() {
|
|
496
|
+
return useContext(ViewerCustomizationContext);
|
|
543
497
|
}
|
|
544
498
|
function useHostEvent(ref, type, handler) {
|
|
545
499
|
useEffect(() => {
|
|
@@ -657,6 +611,412 @@ function WebRadio({
|
|
|
657
611
|
}
|
|
658
612
|
);
|
|
659
613
|
}
|
|
614
|
+
function nowLocalInputValue() {
|
|
615
|
+
const now = /* @__PURE__ */ new Date();
|
|
616
|
+
const pad = (n) => String(n).padStart(2, "0");
|
|
617
|
+
return `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}T${pad(now.getHours())}:${pad(now.getMinutes())}`;
|
|
618
|
+
}
|
|
619
|
+
function DateTimeFieldDialog(p) {
|
|
620
|
+
const { t } = useTranslation();
|
|
621
|
+
const [datePickerValue, setDatePickerValue] = useState(nowLocalInputValue);
|
|
622
|
+
const [dateFormat, setDateFormat] = useState("locale");
|
|
623
|
+
const confirmDatePicker = useCallback(() => {
|
|
624
|
+
const d = new Date(datePickerValue);
|
|
625
|
+
if (isNaN(d.getTime())) {
|
|
626
|
+
return;
|
|
627
|
+
}
|
|
628
|
+
let formatted;
|
|
629
|
+
switch (dateFormat) {
|
|
630
|
+
case "iso":
|
|
631
|
+
formatted = d.toISOString().slice(0, 10);
|
|
632
|
+
break;
|
|
633
|
+
case "long":
|
|
634
|
+
formatted = d.toLocaleDateString(void 0, {
|
|
635
|
+
weekday: "long",
|
|
636
|
+
year: "numeric",
|
|
637
|
+
month: "long",
|
|
638
|
+
day: "numeric"
|
|
639
|
+
});
|
|
640
|
+
break;
|
|
641
|
+
case "short":
|
|
642
|
+
formatted = d.toLocaleDateString(void 0, {
|
|
643
|
+
year: "numeric",
|
|
644
|
+
month: "short",
|
|
645
|
+
day: "numeric"
|
|
646
|
+
});
|
|
647
|
+
break;
|
|
648
|
+
case "time":
|
|
649
|
+
formatted = d.toLocaleString();
|
|
650
|
+
break;
|
|
651
|
+
default:
|
|
652
|
+
formatted = d.toLocaleDateString();
|
|
653
|
+
break;
|
|
654
|
+
}
|
|
655
|
+
p.onInsert(formatted);
|
|
656
|
+
}, [datePickerValue, dateFormat, p]);
|
|
657
|
+
return /* @__PURE__ */ jsx(
|
|
658
|
+
"div",
|
|
659
|
+
{
|
|
660
|
+
className: "fixed inset-0 z-[9999] flex items-center justify-center bg-black/30",
|
|
661
|
+
onMouseDown: (e) => {
|
|
662
|
+
if (e.target === e.currentTarget) {
|
|
663
|
+
p.onClose();
|
|
664
|
+
}
|
|
665
|
+
},
|
|
666
|
+
children: /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-border bg-popover shadow-2xl p-4 w-72 space-y-3", children: [
|
|
667
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm font-medium text-foreground", children: t("pptx.field.dateTime") }),
|
|
668
|
+
/* @__PURE__ */ jsx(
|
|
669
|
+
"input",
|
|
670
|
+
{
|
|
671
|
+
type: "datetime-local",
|
|
672
|
+
className: "w-full text-xs",
|
|
673
|
+
"aria-label": t("pptx.field.format", "Format"),
|
|
674
|
+
value: datePickerValue,
|
|
675
|
+
onChange: (e) => setDatePickerValue(e.target.value)
|
|
676
|
+
}
|
|
677
|
+
),
|
|
678
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
679
|
+
/* @__PURE__ */ jsx("label", { className: "block text-[11px] text-muted-foreground mb-1", children: t("pptx.field.format", "Format") }),
|
|
680
|
+
/* @__PURE__ */ jsxs(
|
|
681
|
+
WebSelect,
|
|
682
|
+
{
|
|
683
|
+
className: "w-full rounded border border-border bg-muted px-2.5 py-1.5 text-xs text-foreground focus:border-primary focus:ring-1 focus:ring-primary outline-none",
|
|
684
|
+
value: dateFormat,
|
|
685
|
+
onChange: (e) => setDateFormat(e.target.value),
|
|
686
|
+
children: [
|
|
687
|
+
/* @__PURE__ */ jsx("option", { value: "locale", children: new Date(datePickerValue || Date.now()).toLocaleDateString() }),
|
|
688
|
+
/* @__PURE__ */ jsx("option", { value: "long", children: new Date(datePickerValue || Date.now()).toLocaleDateString(void 0, {
|
|
689
|
+
weekday: "long",
|
|
690
|
+
year: "numeric",
|
|
691
|
+
month: "long",
|
|
692
|
+
day: "numeric"
|
|
693
|
+
}) }),
|
|
694
|
+
/* @__PURE__ */ jsx("option", { value: "short", children: new Date(datePickerValue || Date.now()).toLocaleDateString(void 0, {
|
|
695
|
+
year: "numeric",
|
|
696
|
+
month: "short",
|
|
697
|
+
day: "numeric"
|
|
698
|
+
}) }),
|
|
699
|
+
/* @__PURE__ */ jsx("option", { value: "iso", children: new Date(datePickerValue || Date.now()).toISOString().slice(0, 10) }),
|
|
700
|
+
/* @__PURE__ */ jsx("option", { value: "time", children: new Date(datePickerValue || Date.now()).toLocaleString() })
|
|
701
|
+
]
|
|
702
|
+
}
|
|
703
|
+
)
|
|
704
|
+
] }),
|
|
705
|
+
/* @__PURE__ */ jsx("div", { className: "flex justify-end gap-2 pt-1", children: /* @__PURE__ */ jsx(
|
|
706
|
+
DialogFooter,
|
|
707
|
+
{
|
|
708
|
+
actions: [
|
|
709
|
+
{ id: "cancel", label: t("pptx.common.cancel", "Cancel") },
|
|
710
|
+
{ id: "insert", label: t("pptx.common.insert", "Insert"), variant: "primary" }
|
|
711
|
+
],
|
|
712
|
+
onAction: (id) => id === "insert" ? confirmDatePicker() : p.onClose()
|
|
713
|
+
}
|
|
714
|
+
) })
|
|
715
|
+
] })
|
|
716
|
+
}
|
|
717
|
+
);
|
|
718
|
+
}
|
|
719
|
+
function InsertSection(p) {
|
|
720
|
+
const { t } = useTranslation();
|
|
721
|
+
const customization = useViewerCustomizationContext();
|
|
722
|
+
const ref = useRef(null);
|
|
723
|
+
const [datePickerOpen, setDatePickerOpen] = useState(false);
|
|
724
|
+
const [templatesOpen, setTemplatesOpen] = useState(false);
|
|
725
|
+
const templatesAvailable = Boolean(p.onInsertSlideFromTemplate) && isDialogAvailable(customization, "slideTemplates");
|
|
726
|
+
const [chartKind, setChartKind] = useState(DEFAULT_INSERT_CHART_KIND);
|
|
727
|
+
useEffect(() => {
|
|
728
|
+
const host = ref.current;
|
|
729
|
+
if (!host) {
|
|
730
|
+
return;
|
|
731
|
+
}
|
|
732
|
+
host.state = {
|
|
733
|
+
editable: p.canEdit,
|
|
734
|
+
hasSelection: p.hasSelection,
|
|
735
|
+
shapeType: p.newShapeType,
|
|
736
|
+
chartKind,
|
|
737
|
+
activeFreeformTool: p.activeFreeformTool ?? null,
|
|
738
|
+
freeformTools: p.onArmFreeformTool ? FREEFORM_TOOL_IDS.filter((tool) => isDrawingToolVisible(customization, tool)) : [],
|
|
739
|
+
chartAvailable: Boolean(p.onAddChart),
|
|
740
|
+
fieldAvailable: Boolean(p.onInsertField),
|
|
741
|
+
headerFooterAvailable: Boolean(p.onOpenHeaderFooter),
|
|
742
|
+
newSlideAvailable: Boolean(p.onInsertSlideFromLayout && p.layoutOptions?.length),
|
|
743
|
+
commentAvailable: Boolean(p.onToggleComments),
|
|
744
|
+
slideTemplatesAvailable: templatesAvailable,
|
|
745
|
+
layouts: p.layoutOptions ?? [],
|
|
746
|
+
...p.currentLayoutPath ? { currentLayoutPath: p.currentLayoutPath } : {},
|
|
747
|
+
translate: t
|
|
748
|
+
};
|
|
749
|
+
}, [p, chartKind, customization, t, templatesAvailable]);
|
|
750
|
+
useEffect(() => {
|
|
751
|
+
const host = ref.current;
|
|
752
|
+
if (!host) {
|
|
753
|
+
return;
|
|
754
|
+
}
|
|
755
|
+
const request = (event) => {
|
|
756
|
+
const intent = event.detail;
|
|
757
|
+
switch (intent.kind) {
|
|
758
|
+
case "command": {
|
|
759
|
+
const commands = {
|
|
760
|
+
textBox: p.onAddTextBox,
|
|
761
|
+
table: p.onAddTable,
|
|
762
|
+
image: p.onOpenImagePicker,
|
|
763
|
+
media: p.onOpenMediaPicker,
|
|
764
|
+
smartArt: p.onAddSmartArt,
|
|
765
|
+
equation: p.onAddEquation,
|
|
766
|
+
link: p.onOpenHyperlinkDialog,
|
|
767
|
+
headerFooter: p.onOpenHeaderFooter,
|
|
768
|
+
// Opening an already open pane would toggle it shut.
|
|
769
|
+
comment: p.isCommentsPanelOpen ? void 0 : p.onToggleComments
|
|
770
|
+
};
|
|
771
|
+
commands[intent.value]?.();
|
|
772
|
+
break;
|
|
773
|
+
}
|
|
774
|
+
case "table":
|
|
775
|
+
p.onAddTable(intent.rows, intent.columns);
|
|
776
|
+
break;
|
|
777
|
+
case "newSlide": {
|
|
778
|
+
const layout = resolveInsertSlideLayout(
|
|
779
|
+
p.layoutOptions ?? [],
|
|
780
|
+
intent.value,
|
|
781
|
+
p.currentLayoutPath
|
|
782
|
+
);
|
|
783
|
+
if (layout) {
|
|
784
|
+
p.onInsertSlideFromLayout?.(layout.path, layout.name);
|
|
785
|
+
}
|
|
786
|
+
break;
|
|
787
|
+
}
|
|
788
|
+
case "slideTemplates":
|
|
789
|
+
setTemplatesOpen(true);
|
|
790
|
+
break;
|
|
791
|
+
case "shapeType":
|
|
792
|
+
p.onSetNewShapeType(intent.value);
|
|
793
|
+
break;
|
|
794
|
+
case "shape":
|
|
795
|
+
p.onAddShape();
|
|
796
|
+
break;
|
|
797
|
+
case "chartType":
|
|
798
|
+
setChartKind(intent.value);
|
|
799
|
+
break;
|
|
800
|
+
case "chart":
|
|
801
|
+
p.onAddChart?.(intent.value);
|
|
802
|
+
break;
|
|
803
|
+
case "freeform":
|
|
804
|
+
p.onArmFreeformTool?.(intent.value);
|
|
805
|
+
break;
|
|
806
|
+
case "actionButton":
|
|
807
|
+
p.onAddActionButton(intent.value);
|
|
808
|
+
break;
|
|
809
|
+
case "field":
|
|
810
|
+
if (intent.value === "datetime") {
|
|
811
|
+
setDatePickerOpen(true);
|
|
812
|
+
} else {
|
|
813
|
+
p.onInsertField?.(intent.value);
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
p.onRequestHandled?.();
|
|
817
|
+
};
|
|
818
|
+
host.addEventListener("insert-request", request);
|
|
819
|
+
return () => host.removeEventListener("insert-request", request);
|
|
820
|
+
}, [p]);
|
|
821
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
822
|
+
p.phone ? /* @__PURE__ */ jsx("pptx-ui-mobile-insert", { ref }) : /* @__PURE__ */ jsx("pptx-ui-ribbon-insert", { ref }),
|
|
823
|
+
templatesAvailable && /* @__PURE__ */ jsx(
|
|
824
|
+
SlideTemplateGalleryDialog,
|
|
825
|
+
{
|
|
826
|
+
isOpen: templatesOpen,
|
|
827
|
+
onClose: () => setTemplatesOpen(false),
|
|
828
|
+
onInsert: (templateId) => p.onInsertSlideFromTemplate?.(templateId),
|
|
829
|
+
scheme: p.templateScheme
|
|
830
|
+
}
|
|
831
|
+
),
|
|
832
|
+
datePickerOpen && p.onInsertField && /* @__PURE__ */ jsx(
|
|
833
|
+
DateTimeFieldDialog,
|
|
834
|
+
{
|
|
835
|
+
onClose: () => setDatePickerOpen(false),
|
|
836
|
+
onInsert: (formatted) => {
|
|
837
|
+
p.onInsertField?.("datetime", formatted);
|
|
838
|
+
setDatePickerOpen(false);
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
)
|
|
842
|
+
] });
|
|
843
|
+
}
|
|
844
|
+
function MobileSheet({
|
|
845
|
+
open,
|
|
846
|
+
onClose,
|
|
847
|
+
title,
|
|
848
|
+
children,
|
|
849
|
+
heightFraction = 0.6,
|
|
850
|
+
fullScreen = false,
|
|
851
|
+
autoHeight = false,
|
|
852
|
+
className,
|
|
853
|
+
headerRight
|
|
854
|
+
}) {
|
|
855
|
+
const sheetRef = useRef(null);
|
|
856
|
+
const { t } = useTranslation();
|
|
857
|
+
const { dragY, dragging, handlers } = useSheetDismissDrag(onClose);
|
|
858
|
+
useModalFocus(open, sheetRef, onClose);
|
|
859
|
+
if (!open) {
|
|
860
|
+
return null;
|
|
861
|
+
}
|
|
862
|
+
const heightStyle = autoHeight ? { maxHeight: "calc(85dvh - env(safe-area-inset-top))" } : fullScreen ? { height: "calc(100dvh - env(safe-area-inset-top))" } : { height: `${Math.round(heightFraction * 100)}dvh` };
|
|
863
|
+
return /* @__PURE__ */ jsxs("div", { className: "fixed inset-x-0 top-0 bottom-14 z-[69] flex flex-col justify-end", children: [
|
|
864
|
+
/* @__PURE__ */ jsx(
|
|
865
|
+
"button",
|
|
866
|
+
{
|
|
867
|
+
type: "button",
|
|
868
|
+
"aria-label": t("pptx.mobileSheet.close"),
|
|
869
|
+
className: "absolute inset-0 bg-black/40 backdrop-blur-[2px] animate-in fade-in duration-150",
|
|
870
|
+
onClick: onClose
|
|
871
|
+
}
|
|
872
|
+
),
|
|
873
|
+
/* @__PURE__ */ jsxs(
|
|
874
|
+
"div",
|
|
875
|
+
{
|
|
876
|
+
ref: sheetRef,
|
|
877
|
+
role: "dialog",
|
|
878
|
+
"aria-modal": "true",
|
|
879
|
+
"aria-label": typeof title === "string" ? title : t("pptx.mobileSheet.ariaLabel"),
|
|
880
|
+
tabIndex: -1,
|
|
881
|
+
className: cn(
|
|
882
|
+
"relative bg-background border-t border-border rounded-t-2xl shadow-2xl flex flex-col overflow-hidden",
|
|
883
|
+
"animate-in slide-in-from-bottom duration-200",
|
|
884
|
+
className
|
|
885
|
+
),
|
|
886
|
+
style: {
|
|
887
|
+
...heightStyle,
|
|
888
|
+
transform: dragY > 0 ? `translateY(${dragY}px)` : void 0,
|
|
889
|
+
transition: dragging ? "none" : "transform 150ms ease-out"
|
|
890
|
+
},
|
|
891
|
+
children: [
|
|
892
|
+
/* @__PURE__ */ jsxs(
|
|
893
|
+
"div",
|
|
894
|
+
{
|
|
895
|
+
className: "cursor-grab active:cursor-grabbing touch-none",
|
|
896
|
+
onPointerDown: handlers.onPointerDown,
|
|
897
|
+
onPointerMove: handlers.onPointerMove,
|
|
898
|
+
onPointerUp: handlers.onPointerUp,
|
|
899
|
+
onPointerCancel: handlers.onPointerCancel,
|
|
900
|
+
children: [
|
|
901
|
+
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-center pt-2 pb-1", children: /* @__PURE__ */ jsx("div", { className: "h-1 w-10 rounded-full bg-muted-foreground/40" }) }),
|
|
902
|
+
(title || headerRight) && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 px-4 pb-2 border-b border-border/60", children: [
|
|
903
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm font-semibold text-foreground truncate", children: title }),
|
|
904
|
+
headerRight,
|
|
905
|
+
/* @__PURE__ */ jsx(
|
|
906
|
+
"button",
|
|
907
|
+
{
|
|
908
|
+
type: "button",
|
|
909
|
+
"aria-label": t("pptx.mobileSheet.close"),
|
|
910
|
+
onPointerDown: (event) => event.stopPropagation(),
|
|
911
|
+
onClick: onClose,
|
|
912
|
+
style: { minWidth: MIN_TOUCH_TARGET_PX, minHeight: MIN_TOUCH_TARGET_PX },
|
|
913
|
+
className: "inline-flex items-center justify-center rounded text-xl text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
914
|
+
children: "\xD7"
|
|
915
|
+
}
|
|
916
|
+
)
|
|
917
|
+
] })
|
|
918
|
+
]
|
|
919
|
+
}
|
|
920
|
+
),
|
|
921
|
+
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto overscroll-contain", children })
|
|
922
|
+
]
|
|
923
|
+
}
|
|
924
|
+
)
|
|
925
|
+
] });
|
|
926
|
+
}
|
|
927
|
+
function MobileInsertSheet(p) {
|
|
928
|
+
const { t } = useTranslation();
|
|
929
|
+
const close = () => p.onCloseMobileInsert?.();
|
|
930
|
+
return /* @__PURE__ */ jsx(
|
|
931
|
+
MobileSheet,
|
|
932
|
+
{
|
|
933
|
+
open: Boolean(p.isMobileInsertOpen) && !p.isThemeEditorOpen,
|
|
934
|
+
onClose: close,
|
|
935
|
+
autoHeight: true,
|
|
936
|
+
title: t("pptx.mobileBar.insert"),
|
|
937
|
+
children: /* @__PURE__ */ jsx("div", { className: "p-3", children: /* @__PURE__ */ jsx(
|
|
938
|
+
InsertSection,
|
|
939
|
+
{
|
|
940
|
+
phone: true,
|
|
941
|
+
onRequestHandled: close,
|
|
942
|
+
canEdit: p.canEdit,
|
|
943
|
+
newShapeType: p.newShapeType,
|
|
944
|
+
onSetNewShapeType: p.onSetNewShapeType,
|
|
945
|
+
onAddTextBox: p.onAddTextBox,
|
|
946
|
+
onAddShape: p.onAddShape,
|
|
947
|
+
onAddTable: p.onAddTable,
|
|
948
|
+
onAddChart: p.onAddChart,
|
|
949
|
+
onAddSmartArt: p.onAddSmartArt,
|
|
950
|
+
onAddEquation: p.onAddEquation,
|
|
951
|
+
onAddActionButton: p.onAddActionButton,
|
|
952
|
+
onInsertField: p.onInsertField,
|
|
953
|
+
onOpenHeaderFooter: p.onOpenHeaderFooter,
|
|
954
|
+
onOpenImagePicker: p.onOpenImagePicker,
|
|
955
|
+
onOpenMediaPicker: p.onOpenMediaPicker,
|
|
956
|
+
hasSelection: Boolean(p.selectedElement),
|
|
957
|
+
onOpenHyperlinkDialog: p.onOpenHyperlinkDialog,
|
|
958
|
+
layoutOptions: p.layoutOptions,
|
|
959
|
+
currentLayoutPath: p.currentLayoutPath,
|
|
960
|
+
onInsertSlideFromLayout: p.onInsertSlideFromLayout,
|
|
961
|
+
onToggleComments: p.onToggleComments,
|
|
962
|
+
isCommentsPanelOpen: p.isCommentsPanelOpen
|
|
963
|
+
}
|
|
964
|
+
) })
|
|
965
|
+
}
|
|
966
|
+
);
|
|
967
|
+
}
|
|
968
|
+
function AnimationsSection(p) {
|
|
969
|
+
const { t } = useTranslation();
|
|
970
|
+
const ref = useRef(null);
|
|
971
|
+
const [previewActive, setPreviewActive] = useState(false);
|
|
972
|
+
const timer = useRef(void 0);
|
|
973
|
+
const disabled = !p.canEdit || p.selectedElement === null;
|
|
974
|
+
const selectedAnimation = useMemo(
|
|
975
|
+
() => p.selectedElement ? (p.activeSlide?.animations ?? []).find((a) => a.elementId === p.selectedElement?.id) : void 0,
|
|
976
|
+
[p.activeSlide?.animations, p.selectedElement]
|
|
977
|
+
);
|
|
978
|
+
useEffect(() => () => clearTimeout(timer.current), []);
|
|
979
|
+
useEffect(() => {
|
|
980
|
+
const host = ref.current;
|
|
981
|
+
if (!host) {
|
|
982
|
+
return;
|
|
983
|
+
}
|
|
984
|
+
host.state = {
|
|
985
|
+
editable: p.canEdit,
|
|
986
|
+
hasSelection: p.selectedElement !== null,
|
|
987
|
+
paneOpen: p.isInspectorPaneOpen,
|
|
988
|
+
previewActive,
|
|
989
|
+
translate: t
|
|
990
|
+
};
|
|
991
|
+
}, [p.canEdit, p.selectedElement, p.isInspectorPaneOpen, previewActive, t]);
|
|
992
|
+
useEffect(() => {
|
|
993
|
+
const host = ref.current;
|
|
994
|
+
if (!host) {
|
|
995
|
+
return;
|
|
996
|
+
}
|
|
997
|
+
const request = (event) => {
|
|
998
|
+
const intent = event.detail;
|
|
999
|
+
if (intent.kind === "add") {
|
|
1000
|
+
p.onAddAnimation?.(intent.preset, intent.group);
|
|
1001
|
+
} else if (intent.value === "remove") {
|
|
1002
|
+
p.onRemoveAnimation?.();
|
|
1003
|
+
} else if (intent.value === "preview") {
|
|
1004
|
+
if (disabled) {
|
|
1005
|
+
return;
|
|
1006
|
+
}
|
|
1007
|
+
setPreviewActive(true);
|
|
1008
|
+
clearTimeout(timer.current);
|
|
1009
|
+
timer.current = setTimeout(() => setPreviewActive(false), 1200);
|
|
1010
|
+
playAnimationRibbonPreview(document, selectedAnimation);
|
|
1011
|
+
} else {
|
|
1012
|
+
(p.onOpenAnimationPanel ?? p.onToggleInspector)();
|
|
1013
|
+
}
|
|
1014
|
+
};
|
|
1015
|
+
host.addEventListener("animations-request", request);
|
|
1016
|
+
return () => host.removeEventListener("animations-request", request);
|
|
1017
|
+
}, [p, disabled, selectedAnimation]);
|
|
1018
|
+
return /* @__PURE__ */ jsx("pptx-ui-ribbon-animations", { ref });
|
|
1019
|
+
}
|
|
660
1020
|
function groupAttr(id) {
|
|
661
1021
|
return id ? { [RIBBON_GROUP_ATTR]: id } : {};
|
|
662
1022
|
}
|
|
@@ -723,7 +1083,7 @@ function WebHomeControls({
|
|
|
723
1083
|
host.addEventListener("home-popup", listener);
|
|
724
1084
|
return () => host.removeEventListener("home-popup", listener);
|
|
725
1085
|
}, [onPopup]);
|
|
726
|
-
return
|
|
1086
|
+
return React104.createElement(`pptx-ui-ribbon-home-${family}`, { ref });
|
|
727
1087
|
}
|
|
728
1088
|
function ShapeArrangeExtras(p) {
|
|
729
1089
|
const commands = useShapeFormatContext();
|
|
@@ -1086,6 +1446,16 @@ function DesignSection(p) {
|
|
|
1086
1446
|
hasBackground: Boolean(p.onToggleInspector)
|
|
1087
1447
|
};
|
|
1088
1448
|
return /* @__PURE__ */ jsx(Fragment, { children: DESIGN_RIBBON_GROUPS.map((group) => /* @__PURE__ */ jsxs(WebRibbonGroup, { groupId: group.id, label: t(group.labelKey), children: [
|
|
1449
|
+
FIXED_TAB_GALLERIES.filter(
|
|
1450
|
+
(placement) => placement.control.startsWith(`${group.id}.`)
|
|
1451
|
+
).map((placement) => /* @__PURE__ */ jsx(
|
|
1452
|
+
RibbonGallery,
|
|
1453
|
+
{
|
|
1454
|
+
placement,
|
|
1455
|
+
icon: placement.gallery === "themeFonts" ? /* @__PURE__ */ jsx(LuType, {}) : /* @__PURE__ */ jsx(LuPalette, {})
|
|
1456
|
+
},
|
|
1457
|
+
placement.control
|
|
1458
|
+
)),
|
|
1089
1459
|
DESIGN_RIBBON_COMMANDS.filter((command) => command.id.startsWith(`${group.id}.`)).map(
|
|
1090
1460
|
(command) => {
|
|
1091
1461
|
const view = designCommandState(command.id, state);
|
|
@@ -1104,17 +1474,7 @@ function DesignSection(p) {
|
|
|
1104
1474
|
command.id
|
|
1105
1475
|
);
|
|
1106
1476
|
}
|
|
1107
|
-
)
|
|
1108
|
-
FIXED_TAB_GALLERIES.filter(
|
|
1109
|
-
(placement) => placement.control.startsWith(`${group.id}.`)
|
|
1110
|
-
).map((placement) => /* @__PURE__ */ jsx(
|
|
1111
|
-
RibbonGallery,
|
|
1112
|
-
{
|
|
1113
|
-
placement,
|
|
1114
|
-
icon: placement.gallery === "themeFonts" ? /* @__PURE__ */ jsx(LuType, {}) : /* @__PURE__ */ jsx(LuPalette, {})
|
|
1115
|
-
},
|
|
1116
|
-
placement.control
|
|
1117
|
-
))
|
|
1477
|
+
)
|
|
1118
1478
|
] }, group.id)) });
|
|
1119
1479
|
}
|
|
1120
1480
|
var DEFAULT_VALUE = {
|
|
@@ -1174,12 +1534,6 @@ function DrawSection(p) {
|
|
|
1174
1534
|
}, [p, pushColor]);
|
|
1175
1535
|
return /* @__PURE__ */ jsx("pptx-ui-ribbon-draw", { ref });
|
|
1176
1536
|
}
|
|
1177
|
-
var ViewerCustomizationContext = createContext(
|
|
1178
|
-
EMPTY_RESOLVED_CUSTOMIZATION
|
|
1179
|
-
);
|
|
1180
|
-
function useViewerCustomizationContext() {
|
|
1181
|
-
return useContext(ViewerCustomizationContext);
|
|
1182
|
-
}
|
|
1183
1537
|
var ViewerRegionBaseContext = createContext(null);
|
|
1184
1538
|
function useRegionRenderer(id) {
|
|
1185
1539
|
const customization = useViewerCustomizationContext();
|
|
@@ -1248,7 +1602,7 @@ function AccountPage() {
|
|
|
1248
1602
|
return void 0;
|
|
1249
1603
|
});
|
|
1250
1604
|
};
|
|
1251
|
-
const version = "4.
|
|
1605
|
+
const version = "4.39.0" ;
|
|
1252
1606
|
return /* @__PURE__ */ jsxs("div", { className: "mt-8 max-w-[700px] space-y-6", children: [
|
|
1253
1607
|
/* @__PURE__ */ jsxs("section", { className: cardClass, children: [
|
|
1254
1608
|
/* @__PURE__ */ jsxs("h2", { className: "flex items-center gap-2 text-sm font-semibold", children: [
|
|
@@ -1983,7 +2337,7 @@ function SlidesGroup(p) {
|
|
|
1983
2337
|
editable: p.canEdit,
|
|
1984
2338
|
hasLayouts: layoutOptions.length > 0,
|
|
1985
2339
|
hasSlides: true,
|
|
1986
|
-
showTemplates: Boolean(p.onInsertSlideFromTemplate),
|
|
2340
|
+
showTemplates: Boolean(p.onInsertSlideFromTemplate) && isDialogAvailable(customization, "slideTemplates"),
|
|
1987
2341
|
newSlideNeedsLayout: true,
|
|
1988
2342
|
resetNeedsSlide: false,
|
|
1989
2343
|
layouts: {
|
|
@@ -1992,7 +2346,14 @@ function SlidesGroup(p) {
|
|
|
1992
2346
|
previews
|
|
1993
2347
|
}
|
|
1994
2348
|
}),
|
|
1995
|
-
[
|
|
2349
|
+
[
|
|
2350
|
+
p.canEdit,
|
|
2351
|
+
layoutOptions,
|
|
2352
|
+
p.onInsertSlideFromTemplate,
|
|
2353
|
+
customization,
|
|
2354
|
+
p.currentLayoutPath,
|
|
2355
|
+
previews
|
|
2356
|
+
]
|
|
1996
2357
|
);
|
|
1997
2358
|
const request = useCallback(
|
|
1998
2359
|
(id, _part, intent) => {
|
|
@@ -2106,220 +2467,6 @@ function HomeSection(p) {
|
|
|
2106
2467
|
)
|
|
2107
2468
|
] });
|
|
2108
2469
|
}
|
|
2109
|
-
function nowLocalInputValue() {
|
|
2110
|
-
const now = /* @__PURE__ */ new Date();
|
|
2111
|
-
const pad = (n) => String(n).padStart(2, "0");
|
|
2112
|
-
return `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}T${pad(now.getHours())}:${pad(now.getMinutes())}`;
|
|
2113
|
-
}
|
|
2114
|
-
function DateTimeFieldDialog(p) {
|
|
2115
|
-
const { t } = useTranslation();
|
|
2116
|
-
const [datePickerValue, setDatePickerValue] = useState(nowLocalInputValue);
|
|
2117
|
-
const [dateFormat, setDateFormat] = useState("locale");
|
|
2118
|
-
const confirmDatePicker = useCallback(() => {
|
|
2119
|
-
const d = new Date(datePickerValue);
|
|
2120
|
-
if (isNaN(d.getTime())) {
|
|
2121
|
-
return;
|
|
2122
|
-
}
|
|
2123
|
-
let formatted;
|
|
2124
|
-
switch (dateFormat) {
|
|
2125
|
-
case "iso":
|
|
2126
|
-
formatted = d.toISOString().slice(0, 10);
|
|
2127
|
-
break;
|
|
2128
|
-
case "long":
|
|
2129
|
-
formatted = d.toLocaleDateString(void 0, {
|
|
2130
|
-
weekday: "long",
|
|
2131
|
-
year: "numeric",
|
|
2132
|
-
month: "long",
|
|
2133
|
-
day: "numeric"
|
|
2134
|
-
});
|
|
2135
|
-
break;
|
|
2136
|
-
case "short":
|
|
2137
|
-
formatted = d.toLocaleDateString(void 0, {
|
|
2138
|
-
year: "numeric",
|
|
2139
|
-
month: "short",
|
|
2140
|
-
day: "numeric"
|
|
2141
|
-
});
|
|
2142
|
-
break;
|
|
2143
|
-
case "time":
|
|
2144
|
-
formatted = d.toLocaleString();
|
|
2145
|
-
break;
|
|
2146
|
-
default:
|
|
2147
|
-
formatted = d.toLocaleDateString();
|
|
2148
|
-
break;
|
|
2149
|
-
}
|
|
2150
|
-
p.onInsert(formatted);
|
|
2151
|
-
}, [datePickerValue, dateFormat, p]);
|
|
2152
|
-
return /* @__PURE__ */ jsx(
|
|
2153
|
-
"div",
|
|
2154
|
-
{
|
|
2155
|
-
className: "fixed inset-0 z-[9999] flex items-center justify-center bg-black/30",
|
|
2156
|
-
onMouseDown: (e) => {
|
|
2157
|
-
if (e.target === e.currentTarget) {
|
|
2158
|
-
p.onClose();
|
|
2159
|
-
}
|
|
2160
|
-
},
|
|
2161
|
-
children: /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-border bg-popover shadow-2xl p-4 w-72 space-y-3", children: [
|
|
2162
|
-
/* @__PURE__ */ jsx("div", { className: "text-sm font-medium text-foreground", children: t("pptx.field.dateTime") }),
|
|
2163
|
-
/* @__PURE__ */ jsx(
|
|
2164
|
-
"input",
|
|
2165
|
-
{
|
|
2166
|
-
type: "datetime-local",
|
|
2167
|
-
className: "w-full text-xs",
|
|
2168
|
-
"aria-label": t("pptx.field.format", "Format"),
|
|
2169
|
-
value: datePickerValue,
|
|
2170
|
-
onChange: (e) => setDatePickerValue(e.target.value)
|
|
2171
|
-
}
|
|
2172
|
-
),
|
|
2173
|
-
/* @__PURE__ */ jsxs("div", { children: [
|
|
2174
|
-
/* @__PURE__ */ jsx("label", { className: "block text-[11px] text-muted-foreground mb-1", children: t("pptx.field.format", "Format") }),
|
|
2175
|
-
/* @__PURE__ */ jsxs(
|
|
2176
|
-
WebSelect,
|
|
2177
|
-
{
|
|
2178
|
-
className: "w-full rounded border border-border bg-muted px-2.5 py-1.5 text-xs text-foreground focus:border-primary focus:ring-1 focus:ring-primary outline-none",
|
|
2179
|
-
value: dateFormat,
|
|
2180
|
-
onChange: (e) => setDateFormat(e.target.value),
|
|
2181
|
-
children: [
|
|
2182
|
-
/* @__PURE__ */ jsx("option", { value: "locale", children: new Date(datePickerValue || Date.now()).toLocaleDateString() }),
|
|
2183
|
-
/* @__PURE__ */ jsx("option", { value: "long", children: new Date(datePickerValue || Date.now()).toLocaleDateString(void 0, {
|
|
2184
|
-
weekday: "long",
|
|
2185
|
-
year: "numeric",
|
|
2186
|
-
month: "long",
|
|
2187
|
-
day: "numeric"
|
|
2188
|
-
}) }),
|
|
2189
|
-
/* @__PURE__ */ jsx("option", { value: "short", children: new Date(datePickerValue || Date.now()).toLocaleDateString(void 0, {
|
|
2190
|
-
year: "numeric",
|
|
2191
|
-
month: "short",
|
|
2192
|
-
day: "numeric"
|
|
2193
|
-
}) }),
|
|
2194
|
-
/* @__PURE__ */ jsx("option", { value: "iso", children: new Date(datePickerValue || Date.now()).toISOString().slice(0, 10) }),
|
|
2195
|
-
/* @__PURE__ */ jsx("option", { value: "time", children: new Date(datePickerValue || Date.now()).toLocaleString() })
|
|
2196
|
-
]
|
|
2197
|
-
}
|
|
2198
|
-
)
|
|
2199
|
-
] }),
|
|
2200
|
-
/* @__PURE__ */ jsx("div", { className: "flex justify-end gap-2 pt-1", children: /* @__PURE__ */ jsx(
|
|
2201
|
-
DialogFooter,
|
|
2202
|
-
{
|
|
2203
|
-
actions: [
|
|
2204
|
-
{ id: "cancel", label: t("pptx.common.cancel", "Cancel") },
|
|
2205
|
-
{ id: "insert", label: t("pptx.common.insert", "Insert"), variant: "primary" }
|
|
2206
|
-
],
|
|
2207
|
-
onAction: (id) => id === "insert" ? confirmDatePicker() : p.onClose()
|
|
2208
|
-
}
|
|
2209
|
-
) })
|
|
2210
|
-
] })
|
|
2211
|
-
}
|
|
2212
|
-
);
|
|
2213
|
-
}
|
|
2214
|
-
function InsertSection(p) {
|
|
2215
|
-
const { t } = useTranslation();
|
|
2216
|
-
const customization = useViewerCustomizationContext();
|
|
2217
|
-
const ref = useRef(null);
|
|
2218
|
-
const [datePickerOpen, setDatePickerOpen] = useState(false);
|
|
2219
|
-
const [chartKind, setChartKind] = useState(DEFAULT_INSERT_CHART_KIND);
|
|
2220
|
-
useEffect(() => {
|
|
2221
|
-
const host = ref.current;
|
|
2222
|
-
if (!host) {
|
|
2223
|
-
return;
|
|
2224
|
-
}
|
|
2225
|
-
host.state = {
|
|
2226
|
-
editable: p.canEdit,
|
|
2227
|
-
hasSelection: p.hasSelection,
|
|
2228
|
-
shapeType: p.newShapeType,
|
|
2229
|
-
chartKind,
|
|
2230
|
-
activeFreeformTool: p.activeFreeformTool ?? null,
|
|
2231
|
-
freeformTools: p.onArmFreeformTool ? FREEFORM_TOOL_IDS.filter((tool) => isDrawingToolVisible(customization, tool)) : [],
|
|
2232
|
-
chartAvailable: Boolean(p.onAddChart),
|
|
2233
|
-
fieldAvailable: Boolean(p.onInsertField),
|
|
2234
|
-
headerFooterAvailable: Boolean(p.onOpenHeaderFooter),
|
|
2235
|
-
newSlideAvailable: Boolean(p.onInsertSlideFromLayout && p.layoutOptions?.length),
|
|
2236
|
-
commentAvailable: Boolean(p.onToggleComments),
|
|
2237
|
-
layouts: p.layoutOptions ?? [],
|
|
2238
|
-
...p.currentLayoutPath ? { currentLayoutPath: p.currentLayoutPath } : {},
|
|
2239
|
-
translate: t
|
|
2240
|
-
};
|
|
2241
|
-
}, [p, chartKind, customization, t]);
|
|
2242
|
-
useEffect(() => {
|
|
2243
|
-
const host = ref.current;
|
|
2244
|
-
if (!host) {
|
|
2245
|
-
return;
|
|
2246
|
-
}
|
|
2247
|
-
const request = (event) => {
|
|
2248
|
-
const intent = event.detail;
|
|
2249
|
-
switch (intent.kind) {
|
|
2250
|
-
case "command": {
|
|
2251
|
-
const commands = {
|
|
2252
|
-
textBox: p.onAddTextBox,
|
|
2253
|
-
table: p.onAddTable,
|
|
2254
|
-
image: p.onOpenImagePicker,
|
|
2255
|
-
media: p.onOpenMediaPicker,
|
|
2256
|
-
smartArt: p.onAddSmartArt,
|
|
2257
|
-
equation: p.onAddEquation,
|
|
2258
|
-
link: p.onOpenHyperlinkDialog,
|
|
2259
|
-
headerFooter: p.onOpenHeaderFooter,
|
|
2260
|
-
// Opening an already open pane would toggle it shut.
|
|
2261
|
-
comment: p.isCommentsPanelOpen ? void 0 : p.onToggleComments
|
|
2262
|
-
};
|
|
2263
|
-
commands[intent.value]?.();
|
|
2264
|
-
break;
|
|
2265
|
-
}
|
|
2266
|
-
case "table":
|
|
2267
|
-
p.onAddTable(intent.rows, intent.columns);
|
|
2268
|
-
break;
|
|
2269
|
-
case "newSlide": {
|
|
2270
|
-
const layout = resolveInsertSlideLayout(
|
|
2271
|
-
p.layoutOptions ?? [],
|
|
2272
|
-
intent.value,
|
|
2273
|
-
p.currentLayoutPath
|
|
2274
|
-
);
|
|
2275
|
-
if (layout) {
|
|
2276
|
-
p.onInsertSlideFromLayout?.(layout.path, layout.name);
|
|
2277
|
-
}
|
|
2278
|
-
break;
|
|
2279
|
-
}
|
|
2280
|
-
case "shapeType":
|
|
2281
|
-
p.onSetNewShapeType(intent.value);
|
|
2282
|
-
break;
|
|
2283
|
-
case "shape":
|
|
2284
|
-
p.onAddShape();
|
|
2285
|
-
break;
|
|
2286
|
-
case "chartType":
|
|
2287
|
-
setChartKind(intent.value);
|
|
2288
|
-
break;
|
|
2289
|
-
case "chart":
|
|
2290
|
-
p.onAddChart?.(intent.value);
|
|
2291
|
-
break;
|
|
2292
|
-
case "freeform":
|
|
2293
|
-
p.onArmFreeformTool?.(intent.value);
|
|
2294
|
-
break;
|
|
2295
|
-
case "actionButton":
|
|
2296
|
-
p.onAddActionButton(intent.value);
|
|
2297
|
-
break;
|
|
2298
|
-
case "field":
|
|
2299
|
-
if (intent.value === "datetime") {
|
|
2300
|
-
setDatePickerOpen(true);
|
|
2301
|
-
} else {
|
|
2302
|
-
p.onInsertField?.(intent.value);
|
|
2303
|
-
}
|
|
2304
|
-
}
|
|
2305
|
-
};
|
|
2306
|
-
host.addEventListener("insert-request", request);
|
|
2307
|
-
return () => host.removeEventListener("insert-request", request);
|
|
2308
|
-
}, [p]);
|
|
2309
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2310
|
-
/* @__PURE__ */ jsx("pptx-ui-ribbon-insert", { ref }),
|
|
2311
|
-
datePickerOpen && p.onInsertField && /* @__PURE__ */ jsx(
|
|
2312
|
-
DateTimeFieldDialog,
|
|
2313
|
-
{
|
|
2314
|
-
onClose: () => setDatePickerOpen(false),
|
|
2315
|
-
onInsert: (formatted) => {
|
|
2316
|
-
p.onInsertField?.("datetime", formatted);
|
|
2317
|
-
setDatePickerOpen(false);
|
|
2318
|
-
}
|
|
2319
|
-
}
|
|
2320
|
-
)
|
|
2321
|
-
] });
|
|
2322
|
-
}
|
|
2323
2470
|
function WebRibbonSection({
|
|
2324
2471
|
groups,
|
|
2325
2472
|
onCommand
|
|
@@ -3072,89 +3219,6 @@ function ViewSection(p) {
|
|
|
3072
3219
|
}, [p]);
|
|
3073
3220
|
return /* @__PURE__ */ jsx("pptx-ui-ribbon-view", { ref });
|
|
3074
3221
|
}
|
|
3075
|
-
function MobileSheet({
|
|
3076
|
-
open,
|
|
3077
|
-
onClose,
|
|
3078
|
-
title,
|
|
3079
|
-
children,
|
|
3080
|
-
heightFraction = 0.6,
|
|
3081
|
-
fullScreen = false,
|
|
3082
|
-
autoHeight = false,
|
|
3083
|
-
className,
|
|
3084
|
-
headerRight
|
|
3085
|
-
}) {
|
|
3086
|
-
const sheetRef = useRef(null);
|
|
3087
|
-
const { t } = useTranslation();
|
|
3088
|
-
const { dragY, dragging, handlers } = useSheetDismissDrag(onClose);
|
|
3089
|
-
useModalFocus(open, sheetRef, onClose);
|
|
3090
|
-
if (!open) {
|
|
3091
|
-
return null;
|
|
3092
|
-
}
|
|
3093
|
-
const heightStyle = autoHeight ? { maxHeight: "calc(85dvh - env(safe-area-inset-top))" } : fullScreen ? { height: "calc(100dvh - env(safe-area-inset-top))" } : { height: `${Math.round(heightFraction * 100)}dvh` };
|
|
3094
|
-
return /* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-50 flex flex-col justify-end", children: [
|
|
3095
|
-
/* @__PURE__ */ jsx(
|
|
3096
|
-
"button",
|
|
3097
|
-
{
|
|
3098
|
-
type: "button",
|
|
3099
|
-
"aria-label": t("pptx.mobileSheet.close"),
|
|
3100
|
-
className: "absolute inset-0 bg-black/40 backdrop-blur-[2px] animate-in fade-in duration-150",
|
|
3101
|
-
onClick: onClose
|
|
3102
|
-
}
|
|
3103
|
-
),
|
|
3104
|
-
/* @__PURE__ */ jsxs(
|
|
3105
|
-
"div",
|
|
3106
|
-
{
|
|
3107
|
-
ref: sheetRef,
|
|
3108
|
-
role: "dialog",
|
|
3109
|
-
"aria-modal": "true",
|
|
3110
|
-
"aria-label": typeof title === "string" ? title : t("pptx.mobileSheet.ariaLabel"),
|
|
3111
|
-
tabIndex: -1,
|
|
3112
|
-
className: cn(
|
|
3113
|
-
"relative bg-background border-t border-border rounded-t-2xl shadow-2xl flex flex-col overflow-hidden",
|
|
3114
|
-
"animate-in slide-in-from-bottom duration-200",
|
|
3115
|
-
className
|
|
3116
|
-
),
|
|
3117
|
-
style: {
|
|
3118
|
-
...heightStyle,
|
|
3119
|
-
transform: dragY > 0 ? `translateY(${dragY}px)` : void 0,
|
|
3120
|
-
transition: dragging ? "none" : "transform 150ms ease-out"
|
|
3121
|
-
},
|
|
3122
|
-
children: [
|
|
3123
|
-
/* @__PURE__ */ jsxs(
|
|
3124
|
-
"div",
|
|
3125
|
-
{
|
|
3126
|
-
className: "cursor-grab active:cursor-grabbing touch-none",
|
|
3127
|
-
onPointerDown: handlers.onPointerDown,
|
|
3128
|
-
onPointerMove: handlers.onPointerMove,
|
|
3129
|
-
onPointerUp: handlers.onPointerUp,
|
|
3130
|
-
onPointerCancel: handlers.onPointerCancel,
|
|
3131
|
-
children: [
|
|
3132
|
-
/* @__PURE__ */ jsx("div", { className: "flex items-center justify-center pt-2 pb-1", children: /* @__PURE__ */ jsx("div", { className: "h-1 w-10 rounded-full bg-muted-foreground/40" }) }),
|
|
3133
|
-
(title || headerRight) && /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 px-4 pb-2 border-b border-border/60", children: [
|
|
3134
|
-
/* @__PURE__ */ jsx("div", { className: "text-sm font-semibold text-foreground truncate", children: title }),
|
|
3135
|
-
headerRight,
|
|
3136
|
-
/* @__PURE__ */ jsx(
|
|
3137
|
-
"button",
|
|
3138
|
-
{
|
|
3139
|
-
type: "button",
|
|
3140
|
-
"aria-label": t("pptx.mobileSheet.close"),
|
|
3141
|
-
onPointerDown: (event) => event.stopPropagation(),
|
|
3142
|
-
onClick: onClose,
|
|
3143
|
-
style: { minWidth: MIN_TOUCH_TARGET_PX, minHeight: MIN_TOUCH_TARGET_PX },
|
|
3144
|
-
className: "inline-flex items-center justify-center rounded text-xl text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
3145
|
-
children: "\xD7"
|
|
3146
|
-
}
|
|
3147
|
-
)
|
|
3148
|
-
] })
|
|
3149
|
-
]
|
|
3150
|
-
}
|
|
3151
|
-
),
|
|
3152
|
-
/* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto overscroll-contain", children })
|
|
3153
|
-
]
|
|
3154
|
-
}
|
|
3155
|
-
)
|
|
3156
|
-
] });
|
|
3157
|
-
}
|
|
3158
3222
|
var MENU_ITEMS = [
|
|
3159
3223
|
{ key: "home", label: "pptx.ribbon.tab.home", icon: LuClipboardCopy },
|
|
3160
3224
|
{ key: "insert", label: "pptx.ribbon.tab.insert", icon: LuPlus },
|
|
@@ -3233,6 +3297,8 @@ function MobileSectionBody({
|
|
|
3233
3297
|
InsertSection,
|
|
3234
3298
|
{
|
|
3235
3299
|
canEdit: p.canEdit,
|
|
3300
|
+
onInsertSlideFromTemplate: p.onInsertSlideFromTemplate,
|
|
3301
|
+
templateScheme: p.templateScheme,
|
|
3236
3302
|
newShapeType: p.newShapeType,
|
|
3237
3303
|
onSetNewShapeType: p.onSetNewShapeType,
|
|
3238
3304
|
onAddTextBox: p.onAddTextBox,
|
|
@@ -3501,9 +3567,39 @@ function MobileToolbar(props) {
|
|
|
3501
3567
|
);
|
|
3502
3568
|
return /* @__PURE__ */ jsxs("div", { className: "relative z-20", children: [
|
|
3503
3569
|
/* @__PURE__ */ jsx("pptx-ui-mobile-toolbar", { ref }),
|
|
3504
|
-
/* @__PURE__ */ jsx(MobileMenuSheet, { open: menuOpen, onClose: () => setMenuOpen(false), ...props })
|
|
3570
|
+
/* @__PURE__ */ jsx(MobileMenuSheet, { open: menuOpen, onClose: () => setMenuOpen(false), ...props }),
|
|
3571
|
+
/* @__PURE__ */ jsx(MobileInsertSheet, { ...props })
|
|
3505
3572
|
] });
|
|
3506
3573
|
}
|
|
3574
|
+
function ChartSelectionStrip() {
|
|
3575
|
+
const { t } = useTranslation();
|
|
3576
|
+
const commands = useChartFormatContext();
|
|
3577
|
+
const chart = commands?.chart;
|
|
3578
|
+
const chartData = chart?.type === "chart" ? chart.chartData : void 0;
|
|
3579
|
+
const controls = useMemo(
|
|
3580
|
+
() => chartSelectionHomeControls({
|
|
3581
|
+
chartData,
|
|
3582
|
+
targetKey: commands?.target,
|
|
3583
|
+
editable: Boolean(commands?.editable),
|
|
3584
|
+
translate: t
|
|
3585
|
+
}),
|
|
3586
|
+
[chartData, commands?.target, commands?.editable, t]
|
|
3587
|
+
);
|
|
3588
|
+
const request = useCallback(
|
|
3589
|
+
(_id, _part, intent) => {
|
|
3590
|
+
if (!commands || !intent) {
|
|
3591
|
+
return;
|
|
3592
|
+
}
|
|
3593
|
+
dispatchChartSelectionRequest(intent, {
|
|
3594
|
+
select: commands.setTarget,
|
|
3595
|
+
formatSelection: () => commands.openPane(),
|
|
3596
|
+
reset: commands.reset
|
|
3597
|
+
});
|
|
3598
|
+
},
|
|
3599
|
+
[commands]
|
|
3600
|
+
);
|
|
3601
|
+
return /* @__PURE__ */ jsx(WebHomeControls, { family: "chart-selection", controls, onRequest: request });
|
|
3602
|
+
}
|
|
3507
3603
|
function PictureSizeStrip({
|
|
3508
3604
|
hiddenActions
|
|
3509
3605
|
}) {
|
|
@@ -3540,7 +3636,8 @@ function ContextualTabSection({
|
|
|
3540
3636
|
label: translateOr(group.labelKey, group.label),
|
|
3541
3637
|
children: [
|
|
3542
3638
|
group.galleries.map((placement) => /* @__PURE__ */ jsx(RibbonGallery, { placement }, placement.control)),
|
|
3543
|
-
group.strip === "picture-size" && /* @__PURE__ */ jsx(PictureSizeStrip, { hiddenActions })
|
|
3639
|
+
group.strip === "picture-size" && /* @__PURE__ */ jsx(PictureSizeStrip, { hiddenActions }),
|
|
3640
|
+
group.strip === "chart-selection" && /* @__PURE__ */ jsx(ChartSelectionStrip, {})
|
|
3544
3641
|
]
|
|
3545
3642
|
},
|
|
3546
3643
|
group.group
|
|
@@ -4640,6 +4737,8 @@ function Toolbar(p) {
|
|
|
4640
4737
|
InsertSection,
|
|
4641
4738
|
{
|
|
4642
4739
|
canEdit: p.canEdit,
|
|
4740
|
+
onInsertSlideFromTemplate: p.onInsertSlideFromTemplate,
|
|
4741
|
+
templateScheme: p.templateScheme,
|
|
4643
4742
|
newShapeType: p.newShapeType,
|
|
4644
4743
|
onSetNewShapeType: p.onSetNewShapeType,
|
|
4645
4744
|
activeFreeformTool: p.activeFreeformTool,
|
|
@@ -5021,7 +5120,7 @@ function ChartQuickActionsOverlay({
|
|
|
5021
5120
|
"data-export-ignore": "true",
|
|
5022
5121
|
style: { position: "absolute", left: 0, top: 0, zIndex: 59 },
|
|
5023
5122
|
onMouseDown: (e) => e.stopPropagation(),
|
|
5024
|
-
children: descriptor.buttons.map((button) => /* @__PURE__ */ jsxs(
|
|
5123
|
+
children: descriptor.buttons.map((button) => /* @__PURE__ */ jsxs(React104.Fragment, { children: [
|
|
5025
5124
|
/* @__PURE__ */ jsx(
|
|
5026
5125
|
"button",
|
|
5027
5126
|
{
|
|
@@ -5041,7 +5140,7 @@ function ChartQuickActionsOverlay({
|
|
|
5041
5140
|
transformOrigin: "top left"
|
|
5042
5141
|
},
|
|
5043
5142
|
className: "flex items-center justify-center rounded bg-white border border-gray-300 shadow-sm hover:bg-gray-100 text-gray-700",
|
|
5044
|
-
children:
|
|
5143
|
+
children: React104.createElement(ICONS3[button.id], { className: "size-3.5" })
|
|
5045
5144
|
}
|
|
5046
5145
|
),
|
|
5047
5146
|
open === button.id && button.id === "elements" && /* @__PURE__ */ jsxs(
|
|
@@ -6187,7 +6286,7 @@ function HorizontalRulerView({ ticks, widthPx, highlight }) {
|
|
|
6187
6286
|
}
|
|
6188
6287
|
);
|
|
6189
6288
|
}
|
|
6190
|
-
var HorizontalRuler =
|
|
6289
|
+
var HorizontalRuler = React104.memo(HorizontalRulerView);
|
|
6191
6290
|
HorizontalRuler.displayName = "HorizontalRuler";
|
|
6192
6291
|
function VerticalRulerView({ ticks, heightPx, highlight }) {
|
|
6193
6292
|
return /* @__PURE__ */ jsxs(
|
|
@@ -6259,7 +6358,7 @@ function VerticalRulerView({ ticks, heightPx, highlight }) {
|
|
|
6259
6358
|
}
|
|
6260
6359
|
);
|
|
6261
6360
|
}
|
|
6262
|
-
var VerticalRuler =
|
|
6361
|
+
var VerticalRuler = React104.memo(VerticalRulerView);
|
|
6263
6362
|
VerticalRuler.displayName = "VerticalRuler";
|
|
6264
6363
|
function Ruler({
|
|
6265
6364
|
canvasSize,
|
|
@@ -8141,7 +8240,7 @@ function slideThumbnailPropsEqual(prev, next) {
|
|
|
8141
8240
|
}
|
|
8142
8241
|
return true;
|
|
8143
8242
|
}
|
|
8144
|
-
var SlideThumbnail =
|
|
8243
|
+
var SlideThumbnail = React104.memo(SlideThumbnailImpl, slideThumbnailPropsEqual);
|
|
8145
8244
|
function tableCell(props) {
|
|
8146
8245
|
const { selectedElement, tableEditorState } = props;
|
|
8147
8246
|
if (selectedElement?.type !== "table" || tableEditorState === null) {
|
|
@@ -8254,10 +8353,21 @@ function ContextMenu(props) {
|
|
|
8254
8353
|
const { t } = useTranslation();
|
|
8255
8354
|
const customization = useViewerCustomizationContext();
|
|
8256
8355
|
const shapeFormat = useShapeFormatContext();
|
|
8356
|
+
const chartFormat = useChartFormatContext();
|
|
8257
8357
|
const open = Boolean(contextMenuState) && mode === "edit";
|
|
8258
|
-
const handlers =
|
|
8358
|
+
const handlers = {
|
|
8359
|
+
...contextMenuHandlers(props, shapeFormat),
|
|
8360
|
+
// "Format Chart Area..." and its siblings open the chart Format pane.
|
|
8361
|
+
"format-chart-element": chartFormat ? () => {
|
|
8362
|
+
chartFormat.openPane();
|
|
8363
|
+
onClose();
|
|
8364
|
+
} : void 0
|
|
8365
|
+
};
|
|
8259
8366
|
const entries = customizeContextMenuEntries(
|
|
8260
|
-
buildContextMenuEntries(
|
|
8367
|
+
buildContextMenuEntries({
|
|
8368
|
+
...contextMenuContext(props, shapeFormat),
|
|
8369
|
+
chartFormatTarget: chartFormat?.target ?? null
|
|
8370
|
+
}),
|
|
8261
8371
|
customization,
|
|
8262
8372
|
{
|
|
8263
8373
|
slideIndex: props.slideIndex ?? 0,
|
|
@@ -8827,7 +8937,7 @@ function LazyThumbnailInner({
|
|
|
8827
8937
|
}
|
|
8828
8938
|
) });
|
|
8829
8939
|
}
|
|
8830
|
-
var LazyThumbnail =
|
|
8940
|
+
var LazyThumbnail = React104.memo(LazyThumbnailInner);
|
|
8831
8941
|
function declaredSectionFacts(groups, sectionId) {
|
|
8832
8942
|
const declared = groups.filter((group) => group.id !== DEFAULT_SECTION_GROUP_ID && group.id !== UNGROUPED_SECTION_ID).map((group) => group.id);
|
|
8833
8943
|
return {
|
|
@@ -8995,7 +9105,7 @@ function SlideItemInner({
|
|
|
8995
9105
|
}
|
|
8996
9106
|
);
|
|
8997
9107
|
}
|
|
8998
|
-
var SlideItem =
|
|
9108
|
+
var SlideItem = React104.memo(SlideItemInner);
|
|
8999
9109
|
function useSlidePaneCallbacks(onMoveSlide, onRenameSection, onToggleSectionCollapse) {
|
|
9000
9110
|
const [collapsedSections, setCollapsedSections] = useState({});
|
|
9001
9111
|
const [renamingSectionId, setRenamingSectionId] = useState(null);
|
|
@@ -10408,7 +10518,7 @@ function arePropsEqual(prev, next) {
|
|
|
10408
10518
|
}
|
|
10409
10519
|
return true;
|
|
10410
10520
|
}
|
|
10411
|
-
var SlideCard =
|
|
10521
|
+
var SlideCard = React104.memo(SlideCardImpl, arePropsEqual);
|
|
10412
10522
|
var ICON_CLASS = "h-3.5 w-3.5 text-muted-foreground";
|
|
10413
10523
|
function SorterContextMenu({
|
|
10414
10524
|
x,
|
|
@@ -10833,7 +10943,7 @@ function SlideSorterOverlay({
|
|
|
10833
10943
|
count: state.selectedSlideIds.length
|
|
10834
10944
|
}) })
|
|
10835
10945
|
] }),
|
|
10836
|
-
|
|
10946
|
+
React104.createElement("pptx-ui-slide-clipboard", {
|
|
10837
10947
|
ref: (node) => {
|
|
10838
10948
|
if (!node) {
|
|
10839
10949
|
return;
|
|
@@ -11749,8 +11859,8 @@ function SlideNotesPanel({
|
|
|
11749
11859
|
onHeightChange
|
|
11750
11860
|
}) {
|
|
11751
11861
|
const { t } = useTranslation();
|
|
11752
|
-
const rootRef =
|
|
11753
|
-
|
|
11862
|
+
const rootRef = React104.useRef(null);
|
|
11863
|
+
React104.useEffect(() => {
|
|
11754
11864
|
const el = rootRef.current;
|
|
11755
11865
|
if (!el || !onHeightChange) {
|
|
11756
11866
|
return void 0;
|
|
@@ -13593,9 +13703,9 @@ function PresentationSubtitleBar({
|
|
|
13593
13703
|
function renderNotesSegments(segments) {
|
|
13594
13704
|
return notesSegmentsToSpans(segments).map((span) => {
|
|
13595
13705
|
if (span.kind === "break") {
|
|
13596
|
-
return
|
|
13706
|
+
return React104.createElement("br", { key: span.key });
|
|
13597
13707
|
}
|
|
13598
|
-
return
|
|
13708
|
+
return React104.createElement(
|
|
13599
13709
|
"span",
|
|
13600
13710
|
{ key: span.key, style: span.style },
|
|
13601
13711
|
span.text
|
|
@@ -13771,7 +13881,7 @@ function scaledSlidePreviewPropsEqual(prev, next) {
|
|
|
13771
13881
|
}
|
|
13772
13882
|
return true;
|
|
13773
13883
|
}
|
|
13774
|
-
var ScaledSlidePreview =
|
|
13884
|
+
var ScaledSlidePreview = React104.memo(ScaledSlidePreviewImpl, scaledSlidePreviewPropsEqual);
|
|
13775
13885
|
function PresenterNotesRail({
|
|
13776
13886
|
slides,
|
|
13777
13887
|
current,
|
|
@@ -15000,7 +15110,7 @@ function EffectSoundRow({
|
|
|
15000
15110
|
onPickStock
|
|
15001
15111
|
}) {
|
|
15002
15112
|
const { t } = useTranslation();
|
|
15003
|
-
const fileInputRef =
|
|
15113
|
+
const fileInputRef = React104.useRef(null);
|
|
15004
15114
|
const selectedValue = soundState.catalogueId ?? (soundState.hasSound ? CURRENT_VALUE : NONE_VALUE);
|
|
15005
15115
|
const handleSelectChange = (event) => {
|
|
15006
15116
|
const value = event.target.value;
|
|
@@ -18571,7 +18681,7 @@ function ConnectorArrowsSection({
|
|
|
18571
18681
|
["Start", "End"].map((end) => {
|
|
18572
18682
|
const widthKey = end === "Start" ? "connectorStartArrowWidth" : "connectorEndArrowWidth";
|
|
18573
18683
|
const lengthKey = end === "Start" ? "connectorStartArrowLength" : "connectorEndArrowLength";
|
|
18574
|
-
return /* @__PURE__ */ jsxs(
|
|
18684
|
+
return /* @__PURE__ */ jsxs(React104.Fragment, { children: [
|
|
18575
18685
|
/* @__PURE__ */ jsxs("label", { className: "flex flex-col gap-1", children: [
|
|
18576
18686
|
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: t(END_LABEL_KEYS[end].width) }),
|
|
18577
18687
|
/* @__PURE__ */ jsx(
|
|
@@ -21499,7 +21609,7 @@ function StrokeEffectsSection({
|
|
|
21499
21609
|
] }),
|
|
21500
21610
|
EFFECT_CONFIGS.map((cfg) => {
|
|
21501
21611
|
const on = cfg.isOn(style);
|
|
21502
|
-
return /* @__PURE__ */ jsxs(
|
|
21612
|
+
return /* @__PURE__ */ jsxs(React104.Fragment, { children: [
|
|
21503
21613
|
/* @__PURE__ */ jsxs("label", { className: `inline-flex items-center gap-2 text-foreground ${COL2}`, children: [
|
|
21504
21614
|
/* @__PURE__ */ jsx(
|
|
21505
21615
|
WebCheckbox,
|
|
@@ -21754,7 +21864,7 @@ function Text3DProperties({
|
|
|
21754
21864
|
});
|
|
21755
21865
|
},
|
|
21756
21866
|
className: INPUT_CLS2,
|
|
21757
|
-
children: MATERIAL_PRESETS.map(({ value,
|
|
21867
|
+
children: MATERIAL_PRESETS.map(({ value, labelKey }) => /* @__PURE__ */ jsx("option", { value, children: t(labelKey) }, value))
|
|
21758
21868
|
}
|
|
21759
21869
|
)
|
|
21760
21870
|
] })
|
|
@@ -21782,7 +21892,7 @@ function BevelSection({
|
|
|
21782
21892
|
value: bevelType ?? "none",
|
|
21783
21893
|
onChange: (e) => onTypeChange(e.target.value),
|
|
21784
21894
|
className: INPUT_CLS2,
|
|
21785
|
-
children: BEVEL_PRESETS.map(({ value,
|
|
21895
|
+
children: BEVEL_PRESETS.map(({ value, labelKey }) => /* @__PURE__ */ jsx("option", { value, children: t(labelKey) }, value))
|
|
21786
21896
|
}
|
|
21787
21897
|
)
|
|
21788
21898
|
] }),
|
|
@@ -22354,7 +22464,7 @@ function TextWarpGallery({
|
|
|
22354
22464
|
onUpdateTextStyle
|
|
22355
22465
|
}) {
|
|
22356
22466
|
const { t } = useTranslation();
|
|
22357
|
-
const [expanded, setExpanded] =
|
|
22467
|
+
const [expanded, setExpanded] = React104.useState(false);
|
|
22358
22468
|
const currentPreset = ts?.textWarpPreset || "textNoShape";
|
|
22359
22469
|
return /* @__PURE__ */ jsxs("div", { className: "mt-2 rounded border border-border bg-card p-2 space-y-2", children: [
|
|
22360
22470
|
/* @__PURE__ */ jsxs(
|
|
@@ -22369,13 +22479,16 @@ function TextWarpGallery({
|
|
|
22369
22479
|
]
|
|
22370
22480
|
}
|
|
22371
22481
|
),
|
|
22372
|
-
!expanded && /* @__PURE__ */ jsx("div", { className: "text-[11px] text-muted-foreground", children:
|
|
22373
|
-
|
|
22482
|
+
!expanded && /* @__PURE__ */ jsx("div", { className: "text-[11px] text-muted-foreground", children: (() => {
|
|
22483
|
+
const current = TEXT_WARP_PRESETS.find((p) => p.value === currentPreset);
|
|
22484
|
+
return current ? t(current.labelKey) : currentPreset;
|
|
22485
|
+
})() }),
|
|
22486
|
+
expanded && /* @__PURE__ */ jsx("div", { className: "grid grid-cols-5 gap-1", children: TEXT_WARP_PRESETS.map(({ value, labelKey }) => /* @__PURE__ */ jsx(
|
|
22374
22487
|
"button",
|
|
22375
22488
|
{
|
|
22376
22489
|
type: "button",
|
|
22377
|
-
title:
|
|
22378
|
-
"aria-label":
|
|
22490
|
+
title: t(labelKey),
|
|
22491
|
+
"aria-label": t(labelKey),
|
|
22379
22492
|
className: `flex items-center justify-center rounded p-1 ${currentPreset === value ? "bg-primary ring-1 ring-primary" : "bg-muted hover:bg-accent"}`,
|
|
22380
22493
|
onClick: () => onUpdateTextStyle({
|
|
22381
22494
|
textWarpPreset: value === "textNoShape" ? void 0 : value
|
|
@@ -22997,7 +23110,7 @@ function SmartArtStyleControls({
|
|
|
22997
23110
|
onChangeStyle
|
|
22998
23111
|
}) {
|
|
22999
23112
|
const { t } = useTranslation();
|
|
23000
|
-
const translate =
|
|
23113
|
+
const translate = React104.useCallback((key) => t(key), [t]);
|
|
23001
23114
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
23002
23115
|
/* @__PURE__ */ jsxs("label", { className: "flex flex-col gap-1 text-[11px]", children: [
|
|
23003
23116
|
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: t("pptx.smartart.colorScheme") }),
|
|
@@ -23052,9 +23165,9 @@ function SmartArtPropertiesPanel({
|
|
|
23052
23165
|
const nodes = smartArtData.nodes ?? [];
|
|
23053
23166
|
const layout = smartArtData.resolvedLayoutType;
|
|
23054
23167
|
const topLevelCount = nodes.filter((n) => !n.parentId).length;
|
|
23055
|
-
const inputRefs =
|
|
23056
|
-
const pendingFocusId =
|
|
23057
|
-
|
|
23168
|
+
const inputRefs = React104.useRef(/* @__PURE__ */ new Map());
|
|
23169
|
+
const pendingFocusId = React104.useRef(null);
|
|
23170
|
+
React104.useEffect(() => {
|
|
23058
23171
|
const id = pendingFocusId.current;
|
|
23059
23172
|
if (id) {
|
|
23060
23173
|
inputRefs.current.get(id)?.focus();
|
|
@@ -24239,8 +24352,8 @@ function TablePropertiesPanel({
|
|
|
24239
24352
|
{
|
|
24240
24353
|
type: "button",
|
|
24241
24354
|
disabled: !canEdit,
|
|
24242
|
-
title: preset.
|
|
24243
|
-
"aria-label": preset.
|
|
24355
|
+
title: t(preset.labelKey),
|
|
24356
|
+
"aria-label": t(preset.labelKey),
|
|
24244
24357
|
className: "rounded border border-border hover:border-primary overflow-hidden h-10 max-md:h-11 transition-colors",
|
|
24245
24358
|
onClick: () => {
|
|
24246
24359
|
updateTableData({ rows: applyTableStylePreset(td, preset) });
|
|
@@ -24660,7 +24773,7 @@ function CommentBody({ text, mentions, className }) {
|
|
|
24660
24773
|
index
|
|
24661
24774
|
) : (
|
|
24662
24775
|
// eslint-disable-next-line react/no-array-index-key -- segments are positional
|
|
24663
|
-
/* @__PURE__ */ jsx(
|
|
24776
|
+
/* @__PURE__ */ jsx(React104.Fragment, { children: segment.text }, index)
|
|
24664
24777
|
)
|
|
24665
24778
|
) });
|
|
24666
24779
|
}
|
|
@@ -26177,7 +26290,7 @@ function PresentationPropertiesPanel({
|
|
|
26177
26290
|
onUpdateTagCollections
|
|
26178
26291
|
}) {
|
|
26179
26292
|
const { t } = useTranslation();
|
|
26180
|
-
const handleTransitionChange =
|
|
26293
|
+
const handleTransitionChange = React104.useCallback(
|
|
26181
26294
|
(updates) => {
|
|
26182
26295
|
onUpdateSlide({
|
|
26183
26296
|
transition: mergeSlideTransition(activeSlide?.transition, updates)
|
|
@@ -29658,7 +29771,7 @@ function ViewerToolbarSection(props) {
|
|
|
29658
29771
|
},
|
|
29659
29772
|
[activeSlide, propertyHandlers]
|
|
29660
29773
|
);
|
|
29661
|
-
const scopedLayoutOptions =
|
|
29774
|
+
const scopedLayoutOptions = React104.useMemo(
|
|
29662
29775
|
() => scopeLayoutOptionsToActiveSlide(s.layoutOptions, activeSlide),
|
|
29663
29776
|
[s.layoutOptions, activeSlide]
|
|
29664
29777
|
);
|
|
@@ -30061,6 +30174,8 @@ function ViewerToolbarSection(props) {
|
|
|
30061
30174
|
}
|
|
30062
30175
|
},
|
|
30063
30176
|
isCommentsPanelOpen: s.isInspectorPaneOpen,
|
|
30177
|
+
isMobileInsertOpen: s.isMobileInsertOpen,
|
|
30178
|
+
onCloseMobileInsert: () => s.setIsMobileInsertOpen(false),
|
|
30064
30179
|
slideCommentCount: activeSlide?.comments?.length ?? 0,
|
|
30065
30180
|
reviewComments: createReviewCommentsHost({
|
|
30066
30181
|
state: s,
|
|
@@ -31725,6 +31840,42 @@ function AiChangeOverlay({ batch, activeSlideIndex }) {
|
|
|
31725
31840
|
))
|
|
31726
31841
|
] });
|
|
31727
31842
|
}
|
|
31843
|
+
function ChartFormatPanel() {
|
|
31844
|
+
const { t } = useTranslation();
|
|
31845
|
+
const commands = useChartFormatContext();
|
|
31846
|
+
const ref = useRef(null);
|
|
31847
|
+
const chart = commands?.chart;
|
|
31848
|
+
const chartData = chart?.type === "chart" ? chart.chartData : void 0;
|
|
31849
|
+
useEffect(() => {
|
|
31850
|
+
const node = ref.current;
|
|
31851
|
+
if (node && commands) {
|
|
31852
|
+
node.translateLabel = t;
|
|
31853
|
+
node.chartData = chartData;
|
|
31854
|
+
node.target = commands.target;
|
|
31855
|
+
node.disabled = !commands.editable;
|
|
31856
|
+
}
|
|
31857
|
+
}, [chartData, commands, t]);
|
|
31858
|
+
useEffect(() => {
|
|
31859
|
+
const node = ref.current;
|
|
31860
|
+
if (!node || !commands) {
|
|
31861
|
+
return;
|
|
31862
|
+
}
|
|
31863
|
+
const change = (event) => commands.applyChartData(event.detail.chartData);
|
|
31864
|
+
const retarget = (event) => commands.setTarget(event.detail.target);
|
|
31865
|
+
node.addEventListener("chart-format-change", change);
|
|
31866
|
+
node.addEventListener("chart-format-target", retarget);
|
|
31867
|
+
node.addEventListener("chart-format-close", commands.closePane);
|
|
31868
|
+
return () => {
|
|
31869
|
+
node.removeEventListener("chart-format-change", change);
|
|
31870
|
+
node.removeEventListener("chart-format-target", retarget);
|
|
31871
|
+
node.removeEventListener("chart-format-close", commands.closePane);
|
|
31872
|
+
};
|
|
31873
|
+
}, [commands]);
|
|
31874
|
+
if (!commands?.paneOpen || !chartData) {
|
|
31875
|
+
return null;
|
|
31876
|
+
}
|
|
31877
|
+
return /* @__PURE__ */ jsx("pptx-ui-chart-format-pane", { ref, "data-testid": "chart-format-pane" });
|
|
31878
|
+
}
|
|
31728
31879
|
function ThemeEditorPanel({ theme, canEdit, onApply, onClose }) {
|
|
31729
31880
|
const { t } = useTranslation();
|
|
31730
31881
|
const ref = useRef(null);
|
|
@@ -32314,6 +32465,7 @@ function ViewerSidePanels(props) {
|
|
|
32314
32465
|
onClose: () => s.setIsThemeEditorOpen(false)
|
|
32315
32466
|
}
|
|
32316
32467
|
),
|
|
32468
|
+
(mode === "edit" || mode === "master") && /* @__PURE__ */ jsx(ChartFormatPanel, {}),
|
|
32317
32469
|
aiPanel?.isOpen && aiConfig && aiBridge && (mode === "edit" || mode === "master") && /* @__PURE__ */ jsx(
|
|
32318
32470
|
AiChatPanelLazy,
|
|
32319
32471
|
{
|
|
@@ -33008,8 +33160,9 @@ function MobileChromeOverlay(props) {
|
|
|
33008
33160
|
slideSectionGroups,
|
|
33009
33161
|
canEdit,
|
|
33010
33162
|
commentCount
|
|
33011
|
-
} = props, { keyboardInset, isKeyboardOpen } = useKeyboardInsets(), activeSheet = s.isSlidesPaneOpen ? "slides" : s.isInspectorPaneOpen ? s.sidebarPanelMode === "comments" ? "comments" : "inspector" : !s.isSlideNotesCollapsed ? "notes" : null, closeAllSheets = () => {
|
|
33163
|
+
} = props, { keyboardInset, isKeyboardOpen } = useKeyboardInsets(), activeSheet = s.isMobileInsertOpen ? "insert" : s.isSlidesPaneOpen ? "slides" : s.isInspectorPaneOpen ? s.sidebarPanelMode === "comments" ? "comments" : "inspector" : !s.isSlideNotesCollapsed ? "notes" : null, closeAllSheets = () => {
|
|
33012
33164
|
s.setIsSlidesPaneOpen(false);
|
|
33165
|
+
s.setIsMobileInsertOpen(false);
|
|
33013
33166
|
s.setIsInspectorPaneOpen(false);
|
|
33014
33167
|
s.setIsSlideNotesCollapsed(true);
|
|
33015
33168
|
}, openSheet = (which) => {
|
|
@@ -33018,6 +33171,9 @@ function MobileChromeOverlay(props) {
|
|
|
33018
33171
|
case "slides":
|
|
33019
33172
|
s.setIsSlidesPaneOpen(true);
|
|
33020
33173
|
break;
|
|
33174
|
+
case "insert":
|
|
33175
|
+
s.setIsMobileInsertOpen(true);
|
|
33176
|
+
break;
|
|
33021
33177
|
case "inspector":
|
|
33022
33178
|
s.setSidebarPanelMode("properties");
|
|
33023
33179
|
s.setIsInspectorPaneOpen(true);
|
|
@@ -33093,9 +33249,7 @@ function MobileChromeOverlay(props) {
|
|
|
33093
33249
|
activeSheet,
|
|
33094
33250
|
commentCount,
|
|
33095
33251
|
onOpenSlides: () => applySheetTap("slides"),
|
|
33096
|
-
onOpenInsert: () =>
|
|
33097
|
-
editorOps.insertHandlers.handleAddTextBox();
|
|
33098
|
-
},
|
|
33252
|
+
onOpenInsert: () => applySheetTap("insert"),
|
|
33099
33253
|
onOpenInspector: () => applySheetTap("inspector"),
|
|
33100
33254
|
onOpenComments: () => applySheetTap("comments"),
|
|
33101
33255
|
onToggleNotes: () => applySheetTap("notes")
|
|
@@ -34122,6 +34276,64 @@ function useAutosaveCacheMaintenance(viewerOptions) {
|
|
|
34122
34276
|
}, [viewerOptions]);
|
|
34123
34277
|
return handleClearOptionsCache;
|
|
34124
34278
|
}
|
|
34279
|
+
function useChartFormatCommands(input) {
|
|
34280
|
+
const { selectedElement, editable, updateElementById } = input;
|
|
34281
|
+
const chart = selectedElement?.type === "chart" ? selectedElement : null;
|
|
34282
|
+
const chartId = chart?.id ?? null;
|
|
34283
|
+
const [picked, setPicked] = useState({
|
|
34284
|
+
chartId: null,
|
|
34285
|
+
target: "chartArea"
|
|
34286
|
+
});
|
|
34287
|
+
const [paneOpen, setPaneOpen] = useState(false);
|
|
34288
|
+
const target = picked.chartId === chartId ? picked.target : "chartArea";
|
|
34289
|
+
useEffect(() => {
|
|
34290
|
+
if (!chartId) {
|
|
34291
|
+
setPaneOpen(false);
|
|
34292
|
+
}
|
|
34293
|
+
}, [chartId]);
|
|
34294
|
+
const setTarget = useCallback(
|
|
34295
|
+
(next, forChartId) => setPicked({ chartId: forChartId ?? chartId, target: next }),
|
|
34296
|
+
[chartId]
|
|
34297
|
+
);
|
|
34298
|
+
const openPane = useCallback(
|
|
34299
|
+
(next) => {
|
|
34300
|
+
if (next) {
|
|
34301
|
+
setTarget(next);
|
|
34302
|
+
}
|
|
34303
|
+
setPaneOpen(true);
|
|
34304
|
+
},
|
|
34305
|
+
[setTarget]
|
|
34306
|
+
);
|
|
34307
|
+
const closePane = useCallback(() => setPaneOpen(false), []);
|
|
34308
|
+
const applyChartData = useCallback(
|
|
34309
|
+
(chartData2) => {
|
|
34310
|
+
if (editable && chartId) {
|
|
34311
|
+
updateElementById(chartId, { chartData: chartData2 });
|
|
34312
|
+
}
|
|
34313
|
+
},
|
|
34314
|
+
[editable, chartId, updateElementById]
|
|
34315
|
+
);
|
|
34316
|
+
const chartData = chart?.type === "chart" ? chart.chartData : void 0;
|
|
34317
|
+
const reset = useCallback(() => {
|
|
34318
|
+
if (chartData) {
|
|
34319
|
+
applyChartData(resetChartFormatTarget(chartData, target));
|
|
34320
|
+
}
|
|
34321
|
+
}, [chartData, target, applyChartData]);
|
|
34322
|
+
return useMemo(
|
|
34323
|
+
() => ({
|
|
34324
|
+
chart,
|
|
34325
|
+
editable,
|
|
34326
|
+
target,
|
|
34327
|
+
paneOpen: paneOpen && Boolean(chart),
|
|
34328
|
+
setTarget,
|
|
34329
|
+
openPane,
|
|
34330
|
+
closePane,
|
|
34331
|
+
applyChartData,
|
|
34332
|
+
reset
|
|
34333
|
+
}),
|
|
34334
|
+
[chart, editable, target, paneOpen, setTarget, openPane, closePane, applyChartData, reset]
|
|
34335
|
+
);
|
|
34336
|
+
}
|
|
34125
34337
|
function useLoadNotifications(input) {
|
|
34126
34338
|
const { loading, error } = input;
|
|
34127
34339
|
const latest = useRef(input);
|
|
@@ -34260,7 +34472,8 @@ function useRibbonGalleryCommands2(input) {
|
|
|
34260
34472
|
tableEditorState,
|
|
34261
34473
|
updateElementById,
|
|
34262
34474
|
updateThemeColorScheme,
|
|
34263
|
-
updateThemeFontScheme
|
|
34475
|
+
updateThemeFontScheme,
|
|
34476
|
+
applyThemeData
|
|
34264
34477
|
} = input;
|
|
34265
34478
|
const handler = handlerRef.current;
|
|
34266
34479
|
const context = useMemo(
|
|
@@ -34282,6 +34495,9 @@ function useRibbonGalleryCommands2(input) {
|
|
|
34282
34495
|
case "element":
|
|
34283
34496
|
updateElementById(result.elementId, result.patch);
|
|
34284
34497
|
return;
|
|
34498
|
+
case "theme":
|
|
34499
|
+
void applyThemeData?.(result.colorScheme, result.fontScheme, result.name);
|
|
34500
|
+
return;
|
|
34285
34501
|
case "themeColorScheme":
|
|
34286
34502
|
void updateThemeColorScheme(result.colorScheme);
|
|
34287
34503
|
return;
|
|
@@ -34289,7 +34505,7 @@ function useRibbonGalleryCommands2(input) {
|
|
|
34289
34505
|
void updateThemeFontScheme(result.fontScheme);
|
|
34290
34506
|
}
|
|
34291
34507
|
},
|
|
34292
|
-
[editable, updateElementById, updateThemeColorScheme, updateThemeFontScheme]
|
|
34508
|
+
[editable, updateElementById, updateThemeColorScheme, updateThemeFontScheme, applyThemeData]
|
|
34293
34509
|
);
|
|
34294
34510
|
return useMemo(() => ({ context, editable, dispatch }), [context, editable, dispatch]);
|
|
34295
34511
|
}
|
|
@@ -35160,7 +35376,13 @@ ${url}`)
|
|
|
35160
35376
|
tableEditorState: state.tableEditorState,
|
|
35161
35377
|
updateElementById: editorOps.ops.updateElementById,
|
|
35162
35378
|
updateThemeColorScheme: themeHandlers.handleUpdateThemeColorScheme,
|
|
35163
|
-
updateThemeFontScheme: themeHandlers.handleUpdateThemeFontScheme
|
|
35379
|
+
updateThemeFontScheme: themeHandlers.handleUpdateThemeFontScheme,
|
|
35380
|
+
applyThemeData: themeHandlers.handleApplyThemeData
|
|
35381
|
+
});
|
|
35382
|
+
const chartFormat = useChartFormatCommands({
|
|
35383
|
+
selectedElement,
|
|
35384
|
+
editable: canEdit && (mode === "edit" || mode === "master"),
|
|
35385
|
+
updateElementById: editorOps.ops.updateElementById
|
|
35164
35386
|
});
|
|
35165
35387
|
const ribbonScope = useRibbonScopeToken();
|
|
35166
35388
|
const viewPreferencesSync = useViewPreferencesSync({
|
|
@@ -35756,7 +35978,7 @@ ${url}`)
|
|
|
35756
35978
|
slideCount: slides.length
|
|
35757
35979
|
}
|
|
35758
35980
|
),
|
|
35759
|
-
/* @__PURE__ */ jsx(ShapeFormatContext.Provider, { value: shapeFormat, children: /* @__PURE__ */ jsx(RibbonGalleryCommandsContext.Provider, { value: ribbonGalleries, children: viewerContent }) })
|
|
35981
|
+
/* @__PURE__ */ jsx(ShapeFormatContext.Provider, { value: shapeFormat, children: /* @__PURE__ */ jsx(RibbonGalleryCommandsContext.Provider, { value: ribbonGalleries, children: /* @__PURE__ */ jsx(ChartFormatContext.Provider, { value: chartFormat, children: viewerContent }) }) })
|
|
35760
35982
|
]
|
|
35761
35983
|
}
|
|
35762
35984
|
) }) }) }) }) }) }) })
|