pptx-react-viewer 4.37.0 → 4.38.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/CHANGELOG.md +52 -0
  2. package/dist/{chunk-RZIXD6X7.mjs → chunk-3SFBCFHJ.mjs} +11 -5
  3. package/dist/chunk-3SFBCFHJ.mjs.br +0 -0
  4. package/dist/chunk-3SFBCFHJ.mjs.gz +0 -0
  5. package/dist/{chunk-RXN5Q6CJ.mjs → chunk-LLH3I2XY.mjs} +569 -647
  6. package/dist/chunk-LLH3I2XY.mjs.br +0 -0
  7. package/dist/chunk-LLH3I2XY.mjs.gz +0 -0
  8. package/dist/{chunk-L4E5A5DE.js → chunk-Q5WEQ37H.js} +674 -752
  9. package/dist/chunk-Q5WEQ37H.js.br +0 -0
  10. package/dist/chunk-Q5WEQ37H.js.gz +0 -0
  11. package/dist/{chunk-YAODOVJY.js → chunk-TCEDOLGE.js} +10 -4
  12. package/dist/chunk-TCEDOLGE.js.br +0 -0
  13. package/dist/chunk-TCEDOLGE.js.gz +0 -0
  14. package/dist/i18n/de.cjs +84 -1
  15. package/dist/i18n/de.cjs.br +0 -0
  16. package/dist/i18n/de.cjs.gz +0 -0
  17. package/dist/i18n/de.mjs +84 -1
  18. package/dist/i18n/de.mjs.br +0 -0
  19. package/dist/i18n/de.mjs.gz +0 -0
  20. package/dist/i18n/es.cjs +84 -1
  21. package/dist/i18n/es.cjs.br +0 -0
  22. package/dist/i18n/es.cjs.gz +0 -0
  23. package/dist/i18n/es.mjs +84 -1
  24. package/dist/i18n/es.mjs.br +0 -0
  25. package/dist/i18n/es.mjs.gz +0 -0
  26. package/dist/i18n/fr.cjs +84 -1
  27. package/dist/i18n/fr.cjs.br +0 -0
  28. package/dist/i18n/fr.cjs.gz +0 -0
  29. package/dist/i18n/fr.mjs +84 -1
  30. package/dist/i18n/fr.mjs.br +0 -0
  31. package/dist/i18n/fr.mjs.gz +0 -0
  32. package/dist/i18n/zh-CN.cjs +84 -1
  33. package/dist/i18n/zh-CN.cjs.br +0 -0
  34. package/dist/i18n/zh-CN.cjs.gz +0 -0
  35. package/dist/i18n/zh-CN.mjs +84 -1
  36. package/dist/i18n/zh-CN.mjs.br +0 -0
  37. package/dist/i18n/zh-CN.mjs.gz +0 -0
  38. package/dist/index.d.ts +19 -5
  39. package/dist/index.js +22 -22
  40. package/dist/index.js.br +0 -0
  41. package/dist/index.js.gz +0 -0
  42. package/dist/index.mjs +2 -2
  43. package/dist/index.mjs.br +0 -0
  44. package/dist/index.mjs.gz +0 -0
  45. package/dist/internals.d.ts +31 -29
  46. package/dist/internals.js +80 -80
  47. package/dist/internals.js.br +0 -0
  48. package/dist/internals.js.gz +0 -0
  49. package/dist/internals.mjs +1 -1
  50. package/dist/internals.mjs.br +0 -0
  51. package/dist/internals.mjs.gz +0 -0
  52. package/dist/pptx-viewer.css +1 -1
  53. package/dist/pptx-viewer.css.br +0 -0
  54. package/dist/pptx-viewer.css.gz +0 -0
  55. package/dist/viewer/index.d.ts +17 -3
  56. package/dist/viewer/index.js +17 -17
  57. package/dist/viewer/index.js.br +0 -0
  58. package/dist/viewer/index.js.gz +0 -0
  59. package/dist/viewer/index.mjs +2 -2
  60. package/dist/viewer/index.mjs.br +0 -0
  61. package/dist/viewer/index.mjs.gz +0 -0
  62. package/package.json +3 -3
  63. package/dist/chunk-L4E5A5DE.js.br +0 -0
  64. package/dist/chunk-L4E5A5DE.js.gz +0 -0
  65. package/dist/chunk-RXN5Q6CJ.mjs.br +0 -0
  66. package/dist/chunk-RXN5Q6CJ.mjs.gz +0 -0
  67. package/dist/chunk-RZIXD6X7.mjs.br +0 -0
  68. package/dist/chunk-RZIXD6X7.mjs.gz +0 -0
  69. package/dist/chunk-YAODOVJY.js.br +0 -0
  70. package/dist/chunk-YAODOVJY.js.gz +0 -0
@@ -1,11 +1,11 @@
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-RZIXD6X7.mjs';
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 as SHORTCUT_REFERENCE_ITEMS$1, 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, 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, printPropertiesFrameSlides, printPropertiesSlidesPerPage, PASTE_SPECIAL_OPTIONS, findCanvasElementNode, getDensePanelTouchTargetPx, shouldStickyActionRow, customizeOptionsTabs, VIEWER_OPTIONS_TABS, isOptionsPageVisible, DEFAULT_QUICK_ACCESS_COMMAND_IDS, isHeaderFooterDateTextVisible, isHeaderFooterHeaderTextVisible, isHeaderFooterFooterTextVisible, buildJoinCollaborationConfig, buildCreateCollaborationConfig, generateBroadcastRoomId, DEFAULT_BROADCAST_SERVER_URL, buildBroadcastViewerUrl, resolveTransportForServerUrl, getSlideBackgroundStyle, pushRecentColor, mruColorsPatch, shouldClearAutosaveCacheOnClose, canCropElement, cropSessionChanged, cancelCropUpdate, startCropSession, homeLaunchers, attachRibbonOverflow, editorThumbnailWidth, masterViewBackgroundColor, resolvePresentationAction, isPresentationAdvanceClick, toggleBlackboard, PRESENT_TOOLBAR_CLASSES, resolveEditPointsAvailability, isCurrentLayout, observeElementHeight, EXPANDED_MAX_HEIGHT, resolveStatusBarSave, statusBarViewMode, formatVersionTimestamp, formatRelativeTime, scanAvailableFontFamilies, PRESETS, CATEGORIES, convertOmmlToLatex, compileLatexEquation, convertLatexToOmml, EQUATION_TEMPLATES, clampPercent, resolveDefaultPrintSettings, HANDOUT_OPTIONS, TOOLBAR_TABS, SHORTCUT_REFERENCE_ITEMS, resolveViewerAddinRows, availableQuickAccessCommands, addQuickAccessCommand, removeQuickAccessCommand, moveQuickAccessCommand, CUSTOM_FONT_ACCEPT, 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, customizeBackstageNav, 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, clampOptionNumber, QUICK_ACCESS_COMMAND_CATALOG, registerCustomFont, 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, 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, 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';
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-3SFBCFHJ.mjs';
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';
4
4
  export { THEME_CATALOG, defaultCssVars, defaultRadius, defaultThemeColors, resolveThemeCatalogEntry, themeToCssVars, vermilionDarkColors, vermilionDarkTheme, vermilionLightColors, vermilionLightTheme, vermilionRadius } from 'ooxml-ui/pptx';
5
5
  import React103, { 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
- import { LuArrowDown, LuArrowUp, LuArrowRight, LuArrowLeft, LuArrowDownRight, LuArrowDownLeft, LuArrowUpRight, LuArrowUpLeft, LuMessageSquare, LuEyeOff, LuHistory, LuSettings, LuX, LuCalendarDays, LuClock, LuHash, LuFileText, LuText, LuCast, LuShieldCheck, LuPlus, LuPanelLeftClose, LuDownload, LuTrash2, LuCheck, LuLock, LuEye, LuType, LuLoader, LuShieldAlert, LuSignature, LuInfo, LuTriangleAlert, LuPrinter, LuPenTool, LuBug, LuChevronUp, LuChevronDown, LuUpload, LuWifi, LuWifiOff, LuUsers, LuCopy, LuMinus, LuChevronLeft, LuChevronRight, LuPlay, LuPause, LuPanelLeft, LuPanelRight, LuSparkles, LuFolderOpen, LuPalette, LuSearch, LuCaseSensitive, LuReplace, LuGripVertical, LuLoaderCircle, LuGrid2X2, LuStickyNote, LuList, 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';
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';
9
9
  import { createPortal } from 'react-dom';
10
10
  import { LOCALE_CATALOG } from 'ooxml-ui/pptx/i18n';
11
11
  import { computeFocusTargets, deckDataFieldChanged, aiChangeAnimationCss, changeGhostStyle, createChatHistoryStore, collectStoredChats, exportAiChatLogs as exportAiChatLogs$1, applyElementUpdate } from 'ooxml-ui/pptx/ai';
@@ -1180,6 +1180,44 @@ var ViewerCustomizationContext = createContext(
1180
1180
  function useViewerCustomizationContext() {
1181
1181
  return useContext(ViewerCustomizationContext);
1182
1182
  }
1183
+ var ViewerRegionBaseContext = createContext(null);
1184
+ function useRegionRenderer(id) {
1185
+ const customization = useViewerCustomizationContext();
1186
+ const base = useContext(ViewerRegionBaseContext);
1187
+ return base ? getRegionRenderer(customization, id) : void 0;
1188
+ }
1189
+ var FILL = { width: "100%", height: "100%" };
1190
+ var NOOP = () => {
1191
+ };
1192
+ function ViewerRegion(props) {
1193
+ const { region, renderer, close = NOOP, extra, className, style } = props;
1194
+ const base = useContext(ViewerRegionBaseContext);
1195
+ const containerRef = useRef(null);
1196
+ const hostRef = useRef(null);
1197
+ useLayoutEffect(() => {
1198
+ const host = new ViewerRegionHost(containerRef.current);
1199
+ hostRef.current = host;
1200
+ return () => {
1201
+ host.destroy();
1202
+ hostRef.current = null;
1203
+ };
1204
+ }, []);
1205
+ useLayoutEffect(() => {
1206
+ if (!base) {
1207
+ return;
1208
+ }
1209
+ const context = { ...base, ...extra, region, close };
1210
+ hostRef.current?.render(renderer, context);
1211
+ });
1212
+ return /* @__PURE__ */ jsx(
1213
+ "div",
1214
+ {
1215
+ ref: containerRef,
1216
+ className: className ? `pptx-region-host ${className}` : "pptx-region-host",
1217
+ style: style ?? FILL
1218
+ }
1219
+ );
1220
+ }
1183
1221
  var AccountAuthContext = createContext(void 0);
1184
1222
  var cardClass = "border border-border bg-card p-6 text-card-foreground";
1185
1223
  function AccountPage() {
@@ -1210,7 +1248,7 @@ function AccountPage() {
1210
1248
  return void 0;
1211
1249
  });
1212
1250
  };
1213
- const version = "4.37.0" ;
1251
+ const version = "4.38.0" ;
1214
1252
  return /* @__PURE__ */ jsxs("div", { className: "mt-8 max-w-[700px] space-y-6", children: [
1215
1253
  /* @__PURE__ */ jsxs("section", { className: cardClass, children: [
1216
1254
  /* @__PURE__ */ jsxs("h2", { className: "flex items-center gap-2 text-sm font-semibold", children: [
@@ -1468,7 +1506,8 @@ function BackstageNavIcon({ page }) {
1468
1506
  function FileSection(p) {
1469
1507
  const { t } = useTranslation();
1470
1508
  const [requestedPage, setRequestedPage] = useState("home");
1471
- const nav = customizeBackstageNav(BACKSTAGE_NAV, useViewerCustomizationContext());
1509
+ const customization = useViewerCustomizationContext();
1510
+ const nav = backstageNavEntries(BACKSTAGE_NAV, customization);
1472
1511
  const offered = (id) => nav.some((item) => item.id === id);
1473
1512
  const page = offered(requestedPage) ? requestedPage : offered("home") ? "home" : nav.find((item) => item.id !== "save" && item.id !== "close")?.id ?? "home";
1474
1513
  const [query, setQuery] = useState("");
@@ -1489,7 +1528,12 @@ function FileSection(p) {
1489
1528
  }
1490
1529
  };
1491
1530
  const current = nav.find((item) => item.id === page);
1492
- const title = current ? t(current.labelKey, { defaultValue: current.label }) : t("pptx.backstage.nav.home");
1531
+ const hostPage = current?.host;
1532
+ const builtInPage = hostPage ? void 0 : page;
1533
+ const title = current ? current.labelKey ? t(current.labelKey, { defaultValue: current.label }) : current.label : t("pptx.backstage.nav.home");
1534
+ const regionId = hostPage ? `backstage.host.${hostPage.id}` : `backstage.${page}`;
1535
+ const builtInRegionRenderer = useRegionRenderer(regionId);
1536
+ const regionRenderer = hostPage ? hostPage.render : builtInRegionRenderer;
1493
1537
  return /* @__PURE__ */ jsxs(
1494
1538
  "div",
1495
1539
  {
@@ -1510,7 +1554,7 @@ function FileSection(p) {
1510
1554
  }
1511
1555
  ) }),
1512
1556
  /* @__PURE__ */ jsxs("nav", { className: "flex min-h-0 flex-1 flex-col overflow-y-auto pb-2 max-md:flex-row max-md:items-center max-md:overflow-y-visible max-md:pb-0", children: [
1513
- nav.filter((item) => !item.group && !(item.id === "export" && exportHidden)).map((item) => /* @__PURE__ */ jsxs(
1557
+ nav.filter((item) => item.group !== "footer" && !(item.id === "export" && exportHidden)).map((item) => /* @__PURE__ */ jsxs(
1514
1558
  "button",
1515
1559
  {
1516
1560
  type: "button",
@@ -1519,14 +1563,14 @@ function FileSection(p) {
1519
1563
  onClick: () => item.id === "close" ? p.onClose() : item.id === "save" ? run(p.onSaveAsPptx) : setRequestedPage(item.id),
1520
1564
  className: `${BACKSTAGE_NAV_CLASSES.row} ${page === item.id ? BACKSTAGE_NAV_CLASSES.active : BACKSTAGE_NAV_CLASSES.inactive}`,
1521
1565
  children: [
1522
- /* @__PURE__ */ jsx(BackstageNavIcon, { page: item.id }),
1523
- t(item.labelKey, { defaultValue: item.label })
1566
+ !item.host && /* @__PURE__ */ jsx(BackstageNavIcon, { page: item.id }),
1567
+ item.labelKey ? t(item.labelKey, { defaultValue: item.label }) : item.label
1524
1568
  ]
1525
1569
  },
1526
1570
  item.id
1527
1571
  )),
1528
1572
  /* @__PURE__ */ jsx("div", { className: "flex-1 max-md:hidden" }),
1529
- nav.filter((item) => item.group).map((item) => /* @__PURE__ */ jsxs(
1573
+ nav.filter((item) => item.group === "footer").map((item) => /* @__PURE__ */ jsxs(
1530
1574
  "button",
1531
1575
  {
1532
1576
  type: "button",
@@ -1535,8 +1579,8 @@ function FileSection(p) {
1535
1579
  onClick: () => item.id === "options" && p.onOpenSettings ? run(p.onOpenSettings) : setRequestedPage(item.id),
1536
1580
  className: `${BACKSTAGE_NAV_CLASSES.row} ${page === item.id ? BACKSTAGE_NAV_CLASSES.active : BACKSTAGE_NAV_CLASSES.inactive}`,
1537
1581
  children: [
1538
- /* @__PURE__ */ jsx(BackstageNavIcon, { page: item.id }),
1539
- t(item.labelKey, { defaultValue: item.label })
1582
+ !item.host && /* @__PURE__ */ jsx(BackstageNavIcon, { page: item.id }),
1583
+ item.labelKey ? t(item.labelKey, { defaultValue: item.label }) : item.label
1540
1584
  ]
1541
1585
  },
1542
1586
  item.id
@@ -1545,63 +1589,76 @@ function FileSection(p) {
1545
1589
  ] }),
1546
1590
  /* @__PURE__ */ jsxs("main", { className: "min-w-0 flex-1 overflow-y-auto bg-background px-[clamp(32px,4vw,72px)] py-5 max-md:px-4 max-md:py-4", children: [
1547
1591
  /* @__PURE__ */ jsx("h1", { className: "text-[24px] font-semibold", children: page === "home" ? t("pptx.backstage.greeting") : title }),
1548
- (page === "home" || page === "new") && /* @__PURE__ */ jsx(
1549
- BackstageNewGallery,
1550
- {
1551
- onCreate: (templateId) => run(() => p.onCreatePresentation(templateId))
1552
- }
1553
- ),
1554
- (page === "home" || page === "open") && /* @__PURE__ */ jsxs(Fragment, { children: [
1555
- /* @__PURE__ */ jsx(
1556
- WebSearch,
1592
+ regionRenderer ? (
1593
+ // The nav, title and back button stay the viewer's; the host fills the page body.
1594
+ /* @__PURE__ */ jsx("div", { className: "mt-6", children: /* @__PURE__ */ jsx(
1595
+ ViewerRegion,
1557
1596
  {
1558
- "data-pptx-search-surface": true,
1559
- "data-pptx-search-input": true,
1560
- className: "mt-8 w-full max-w-[540px]",
1561
- value: query,
1562
- onInput: (event) => setQuery(event.currentTarget.value),
1563
- placeholder: t("pptx.backstage.searchPlaceholder"),
1564
- "aria-label": t("pptx.backstage.searchPlaceholder")
1597
+ region: regionId,
1598
+ renderer: regionRenderer,
1599
+ close: p.onClose,
1600
+ style: { width: "100%", minHeight: "12rem" }
1565
1601
  }
1566
- ),
1567
- page === "open" && /* @__PURE__ */ jsxs(
1568
- "button",
1602
+ ) })
1603
+ ) : builtInPage ? /* @__PURE__ */ jsxs(Fragment, { children: [
1604
+ (page === "home" || page === "new") && /* @__PURE__ */ jsx(
1605
+ BackstageNewGallery,
1569
1606
  {
1570
- type: "button",
1571
- className: "mt-4 inline-flex items-center gap-2 bg-primary px-5 py-2.5 text-sm font-semibold text-primary-foreground hover:opacity-90",
1572
- onClick: () => run(p.onOpenFile),
1573
- children: [
1574
- /* @__PURE__ */ jsx(LuFolderOpen, {}),
1575
- " ",
1576
- t("pptx.backstage.browseDevice")
1577
- ]
1607
+ onCreate: (templateId) => run(() => p.onCreatePresentation(templateId))
1578
1608
  }
1579
1609
  ),
1580
- /* @__PURE__ */ jsx("h2", { className: "mt-6 text-[16px] font-semibold", children: t("pptx.backstage.recentHeading") }),
1581
- /* @__PURE__ */ jsx(
1582
- BackstageRecentList,
1583
- {
1584
- files: visibleRecent,
1585
- onOpen: (key) => run(() => p.onOpenRecentFile?.(key))
1586
- }
1587
- )
1588
- ] }),
1589
- !(page === "export" && exportHidden) && /* @__PURE__ */ jsx(BackstageCards, { page, props: p, run }),
1590
- page === "account" && /* @__PURE__ */ jsx(AccountPage, {}),
1591
- page === "options" && /* @__PURE__ */ jsxs("div", { className: "mt-8 max-w-[760px] border border-border bg-card p-7 text-card-foreground", children: [
1592
- /* @__PURE__ */ jsx(LuSettings, { className: "text-3xl text-primary" }),
1593
- /* @__PURE__ */ jsx("h2", { className: "mt-4 text-lg font-semibold", children: t("pptx.backstage.optionsTitle") }),
1594
- /* @__PURE__ */ jsx("p", { className: "mt-2 text-sm text-muted-foreground", children: t("pptx.backstage.optionsBody") }),
1595
- /* @__PURE__ */ jsx(
1596
- "button",
1597
- {
1598
- type: "button",
1599
- className: "mt-6 bg-primary px-5 py-2.5 text-sm font-semibold text-primary-foreground hover:opacity-90",
1600
- onClick: () => run(p.onOpenSettings),
1601
- children: t("pptx.backstage.openOptions")
1602
- }
1603
- )
1604
- ] }),
1610
+ (page === "home" || page === "open") && /* @__PURE__ */ jsxs(Fragment, { children: [
1611
+ /* @__PURE__ */ jsx(
1612
+ WebSearch,
1613
+ {
1614
+ "data-pptx-search-surface": true,
1615
+ "data-pptx-search-input": true,
1616
+ className: "mt-8 w-full max-w-[540px]",
1617
+ value: query,
1618
+ onInput: (event) => setQuery(event.currentTarget.value),
1619
+ placeholder: t("pptx.backstage.searchPlaceholder"),
1620
+ "aria-label": t("pptx.backstage.searchPlaceholder")
1621
+ }
1622
+ ),
1623
+ page === "open" && /* @__PURE__ */ jsxs(
1624
+ "button",
1625
+ {
1626
+ type: "button",
1627
+ className: "mt-4 inline-flex items-center gap-2 bg-primary px-5 py-2.5 text-sm font-semibold text-primary-foreground hover:opacity-90",
1628
+ onClick: () => run(p.onOpenFile),
1629
+ children: [
1630
+ /* @__PURE__ */ jsx(LuFolderOpen, {}),
1631
+ " ",
1632
+ t("pptx.backstage.browseDevice")
1633
+ ]
1634
+ }
1635
+ ),
1636
+ /* @__PURE__ */ jsx("h2", { className: "mt-6 text-[16px] font-semibold", children: t("pptx.backstage.recentHeading") }),
1637
+ /* @__PURE__ */ jsx(
1638
+ BackstageRecentList,
1639
+ {
1640
+ files: visibleRecent,
1641
+ onOpen: (key) => run(() => p.onOpenRecentFile?.(key))
1642
+ }
1643
+ )
1644
+ ] }),
1645
+ !(page === "export" && exportHidden) && /* @__PURE__ */ jsx(BackstageCards, { page, props: p, run }),
1646
+ page === "account" && /* @__PURE__ */ jsx(AccountPage, {}),
1647
+ page === "options" && /* @__PURE__ */ jsxs("div", { className: "mt-8 max-w-[760px] border border-border bg-card p-7 text-card-foreground", children: [
1648
+ /* @__PURE__ */ jsx(LuSettings, { className: "text-3xl text-primary" }),
1649
+ /* @__PURE__ */ jsx("h2", { className: "mt-4 text-lg font-semibold", children: t("pptx.backstage.optionsTitle") }),
1650
+ /* @__PURE__ */ jsx("p", { className: "mt-2 text-sm text-muted-foreground", children: t("pptx.backstage.optionsBody") }),
1651
+ /* @__PURE__ */ jsx(
1652
+ "button",
1653
+ {
1654
+ type: "button",
1655
+ className: "mt-6 bg-primary px-5 py-2.5 text-sm font-semibold text-primary-foreground hover:opacity-90",
1656
+ onClick: () => run(p.onOpenSettings),
1657
+ children: t("pptx.backstage.openOptions")
1658
+ }
1659
+ )
1660
+ ] })
1661
+ ] }) : null,
1605
1662
  /* @__PURE__ */ jsxs("p", { className: "mt-12 text-[11px] text-muted-foreground", children: [
1606
1663
  p.fileName || t("pptx.backstage.untitled"),
1607
1664
  " \xB7 ",
@@ -1915,6 +1972,7 @@ var OV = [
1915
1972
  ];
1916
1973
  var nextTile = 0;
1917
1974
  function SlidesGroup(p) {
1975
+ const customization = useViewerCustomizationContext();
1918
1976
  const [templateGalleryOpen, setTemplateGalleryOpen] = useState(false);
1919
1977
  const [galleryOpen, setGalleryOpen] = useState(false);
1920
1978
  const [tiles, setTiles] = useState([]);
@@ -2002,7 +2060,7 @@ function SlidesGroup(p) {
2002
2060
  )
2003
2061
  ),
2004
2062
  sep,
2005
- p.onInsertSlideFromTemplate && /* @__PURE__ */ jsx(
2063
+ p.onInsertSlideFromTemplate && isDialogAvailable(customization, "slideTemplates") && /* @__PURE__ */ jsx(
2006
2064
  SlideTemplateGalleryDialog,
2007
2065
  {
2008
2066
  isOpen: templateGalleryOpen,
@@ -2174,6 +2232,10 @@ function InsertSection(p) {
2174
2232
  chartAvailable: Boolean(p.onAddChart),
2175
2233
  fieldAvailable: Boolean(p.onInsertField),
2176
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 } : {},
2177
2239
  translate: t
2178
2240
  };
2179
2241
  }, [p, chartKind, customization, t]);
@@ -2194,11 +2256,27 @@ function InsertSection(p) {
2194
2256
  smartArt: p.onAddSmartArt,
2195
2257
  equation: p.onAddEquation,
2196
2258
  link: p.onOpenHyperlinkDialog,
2197
- headerFooter: p.onOpenHeaderFooter
2259
+ headerFooter: p.onOpenHeaderFooter,
2260
+ // Opening an already open pane would toggle it shut.
2261
+ comment: p.isCommentsPanelOpen ? void 0 : p.onToggleComments
2198
2262
  };
2199
2263
  commands[intent.value]?.();
2200
2264
  break;
2201
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
+ }
2202
2280
  case "shapeType":
2203
2281
  p.onSetNewShapeType(intent.value);
2204
2282
  break;
@@ -3168,7 +3246,12 @@ function MobileSectionBody({
3168
3246
  onOpenImagePicker: p.onOpenImagePicker,
3169
3247
  onOpenMediaPicker: p.onOpenMediaPicker,
3170
3248
  hasSelection: Boolean(p.selectedElement),
3171
- onOpenHyperlinkDialog: p.onOpenHyperlinkDialog
3249
+ onOpenHyperlinkDialog: p.onOpenHyperlinkDialog,
3250
+ layoutOptions: p.layoutOptions,
3251
+ currentLayoutPath: p.currentLayoutPath,
3252
+ onInsertSlideFromLayout: p.onInsertSlideFromLayout,
3253
+ onToggleComments: p.onToggleComments,
3254
+ isCommentsPanelOpen: p.isCommentsPanelOpen
3172
3255
  }
3173
3256
  ) });
3174
3257
  case "text":
@@ -4573,7 +4656,12 @@ function Toolbar(p) {
4573
4656
  onOpenImagePicker: p.onOpenImagePicker,
4574
4657
  onOpenMediaPicker: p.onOpenMediaPicker,
4575
4658
  hasSelection: Boolean(p.selectedElement),
4576
- onOpenHyperlinkDialog: p.onOpenHyperlinkDialog
4659
+ onOpenHyperlinkDialog: p.onOpenHyperlinkDialog,
4660
+ layoutOptions: p.layoutOptions,
4661
+ currentLayoutPath: p.currentLayoutPath,
4662
+ onInsertSlideFromLayout: p.onInsertSlideFromLayout,
4663
+ onToggleComments: p.onToggleComments,
4664
+ isCommentsPanelOpen: p.isCommentsPanelOpen
4577
4665
  }
4578
4666
  ),
4579
4667
  sTxt && /* @__PURE__ */ jsx(
@@ -7672,7 +7760,7 @@ function ShortcutPanel({ isOpen, onClose }) {
7672
7760
  }
7673
7761
  )
7674
7762
  ] }),
7675
- /* @__PURE__ */ jsx("div", { className: "max-h-64 overflow-y-auto p-2 space-y-1", children: SHORTCUT_REFERENCE_ITEMS$1.map((shortcut) => /* @__PURE__ */ jsxs(
7763
+ /* @__PURE__ */ jsx("div", { className: "max-h-64 overflow-y-auto p-2 space-y-1", children: SHORTCUT_REFERENCE_ITEMS.map((shortcut) => /* @__PURE__ */ jsxs(
7676
7764
  "div",
7677
7765
  {
7678
7766
  className: "flex items-center justify-between gap-3 rounded bg-muted/80 px-2 py-1.5",
@@ -16476,7 +16564,7 @@ function ChartDataGrid({
16476
16564
  "input",
16477
16565
  {
16478
16566
  type: "number",
16479
- "aria-label": `${s.name} value ${ci + 1}`,
16567
+ "aria-label": t("pptx.chart.seriesValueCell", { name: s.name, number: ci + 1 }),
16480
16568
  disabled: !canEdit,
16481
16569
  ref: isValueHighlight(si, ci) ? highlightRef : null,
16482
16570
  className: `${CELL_INPUT}${isValueHighlight(si, ci) ? highlightClass : ""}`,
@@ -27509,6 +27597,7 @@ function PrintDialog({
27509
27597
  defaultFrameSlides
27510
27598
  }) {
27511
27599
  const { t } = useTranslation();
27600
+ const regionRenderer = useRegionRenderer("dialog.print");
27512
27601
  const { panelStyle, handlers: dragHandlers } = useModalDismissDrag(onClose);
27513
27602
  const { viewportWidth } = useIsMobile();
27514
27603
  const touchTargetPx = getDensePanelTouchTargetPx(viewportWidth);
@@ -27638,68 +27727,81 @@ function PrintDialog({
27638
27727
  ]
27639
27728
  }
27640
27729
  ),
27641
- /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto px-5 py-4 flex gap-5 max-md:flex-col", children: [
27642
- /* @__PURE__ */ jsx(
27643
- PrintSettingsPanel,
27730
+ regionRenderer ? (
27731
+ // The frame (backdrop, title bar, close, dismiss) stays the viewer's; the host replaces the body.
27732
+ /* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", children: /* @__PURE__ */ jsx(
27733
+ ViewerRegion,
27644
27734
  {
27645
- printWhat,
27646
- onPrintWhatChange: setPrintWhat,
27647
- orientation,
27648
- onOrientationChange: setOrientation,
27649
- colorMode,
27650
- onColorModeChange: setColorMode,
27651
- frameSlides,
27652
- onFrameSlidesChange: setFrameSlides,
27653
- slidesPerPage,
27654
- onSlidesPerPageChange: setSlidesPerPage,
27655
- slideRange,
27656
- onSlideRangeChange: setSlideRange,
27657
- customFrom,
27658
- onCustomFromChange: setCustomFrom,
27659
- customTo,
27660
- onCustomToChange: setCustomTo,
27661
- totalSlides: slides.length,
27662
- activeSlideIndex
27663
- }
27664
- ),
27665
- printWhat === "handouts" && /* @__PURE__ */ jsx("div", { className: "w-[230px] shrink-0 border-l border-border pl-4 overflow-y-auto max-md:w-full max-md:border-l-0 max-md:border-t max-md:pl-0 max-md:pt-3", children: /* @__PURE__ */ jsx(
27666
- PrintPreview,
27667
- {
27668
- slideIndices: previewSlideIndices,
27669
- slidesPerPage,
27670
- orientation: effectiveOrientation,
27671
- frameSlides
27672
- }
27673
- ) }),
27674
- printWhat === "notes" && /* @__PURE__ */ jsx("div", { className: "w-[230px] shrink-0 border-l border-border pl-4 overflow-y-auto max-md:w-full max-md:border-l-0 max-md:border-t max-md:pl-0 max-md:pt-3", children: /* @__PURE__ */ jsx(
27675
- NotesPagePreview,
27676
- {
27677
- slideIndices: previewSlideIndices,
27678
- slides,
27679
- frameSlides
27680
- }
27681
- ) })
27682
- ] }),
27683
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-5 py-3 border-t border-border", children: [
27684
- /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: t("pptx.print.pageEstimate", {
27685
- pages: pageCount,
27686
- slides: slideCount
27687
- }) }),
27688
- /* @__PURE__ */ jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ jsx(
27689
- DialogFooter,
27690
- {
27691
- actions: [
27692
- { id: "cancel", label: t("pptx.common.cancel") },
27693
- {
27694
- id: "print",
27695
- label: t("pptx.print.printButton"),
27696
- variant: "primary",
27697
- icon: "print"
27698
- }
27699
- ],
27700
- onAction: (id) => id === "print" ? handlePrint() : onClose()
27735
+ region: "dialog.print",
27736
+ renderer: regionRenderer,
27737
+ close: onClose,
27738
+ style: { width: "100%", minHeight: "8rem" }
27701
27739
  }
27702
27740
  ) })
27741
+ ) : /* @__PURE__ */ jsxs(Fragment, { children: [
27742
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 overflow-y-auto px-5 py-4 flex gap-5 max-md:flex-col", children: [
27743
+ /* @__PURE__ */ jsx(
27744
+ PrintSettingsPanel,
27745
+ {
27746
+ printWhat,
27747
+ onPrintWhatChange: setPrintWhat,
27748
+ orientation,
27749
+ onOrientationChange: setOrientation,
27750
+ colorMode,
27751
+ onColorModeChange: setColorMode,
27752
+ frameSlides,
27753
+ onFrameSlidesChange: setFrameSlides,
27754
+ slidesPerPage,
27755
+ onSlidesPerPageChange: setSlidesPerPage,
27756
+ slideRange,
27757
+ onSlideRangeChange: setSlideRange,
27758
+ customFrom,
27759
+ onCustomFromChange: setCustomFrom,
27760
+ customTo,
27761
+ onCustomToChange: setCustomTo,
27762
+ totalSlides: slides.length,
27763
+ activeSlideIndex
27764
+ }
27765
+ ),
27766
+ printWhat === "handouts" && /* @__PURE__ */ jsx("div", { className: "w-[230px] shrink-0 border-l border-border pl-4 overflow-y-auto max-md:w-full max-md:border-l-0 max-md:border-t max-md:pl-0 max-md:pt-3", children: /* @__PURE__ */ jsx(
27767
+ PrintPreview,
27768
+ {
27769
+ slideIndices: previewSlideIndices,
27770
+ slidesPerPage,
27771
+ orientation: effectiveOrientation,
27772
+ frameSlides
27773
+ }
27774
+ ) }),
27775
+ printWhat === "notes" && /* @__PURE__ */ jsx("div", { className: "w-[230px] shrink-0 border-l border-border pl-4 overflow-y-auto max-md:w-full max-md:border-l-0 max-md:border-t max-md:pl-0 max-md:pt-3", children: /* @__PURE__ */ jsx(
27776
+ NotesPagePreview,
27777
+ {
27778
+ slideIndices: previewSlideIndices,
27779
+ slides,
27780
+ frameSlides
27781
+ }
27782
+ ) })
27783
+ ] }),
27784
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between px-5 py-3 border-t border-border", children: [
27785
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: t("pptx.print.pageEstimate", {
27786
+ pages: pageCount,
27787
+ slides: slideCount
27788
+ }) }),
27789
+ /* @__PURE__ */ jsx("div", { className: "flex gap-2", children: /* @__PURE__ */ jsx(
27790
+ DialogFooter,
27791
+ {
27792
+ actions: [
27793
+ { id: "cancel", label: t("pptx.common.cancel") },
27794
+ {
27795
+ id: "print",
27796
+ label: t("pptx.print.printButton"),
27797
+ variant: "primary",
27798
+ icon: "print"
27799
+ }
27800
+ ],
27801
+ onAction: (id) => id === "print" ? handlePrint() : onClose()
27802
+ }
27803
+ ) })
27804
+ ] })
27703
27805
  ] })
27704
27806
  ]
27705
27807
  }
@@ -28016,6 +28118,7 @@ function BroadcastDialog({
28016
28118
  defaultServerUrl
28017
28119
  }) {
28018
28120
  const { t } = useTranslation();
28121
+ const regionRenderer = useRegionRenderer("dialog.broadcast");
28019
28122
  const collab = useCollaboration();
28020
28123
  const isBroadcasting = collab !== null && collab.status !== "disconnected" && collab.status !== "error" && collab.config.role === "owner";
28021
28124
  const [roomId, setRoomId] = useState("");
@@ -28119,41 +28222,54 @@ function BroadcastDialog({
28119
28222
  ]
28120
28223
  }
28121
28224
  ),
28122
- /* @__PURE__ */ jsx("div", { className: "px-5 py-4", children: isBroadcasting ? /* @__PURE__ */ jsx(
28123
- ActiveBroadcastView,
28124
- {
28125
- collab,
28126
- broadcastUrl,
28127
- copied,
28128
- onCopyUrl: handleCopyUrl,
28129
- onStopBroadcast: handleStopBroadcast
28130
- }
28131
- ) : /* @__PURE__ */ jsx(
28132
- StartBroadcastForm,
28133
- {
28134
- roomId,
28135
- userName,
28136
- serverUrl,
28137
- onRoomIdChange: setRoomId,
28138
- onUserNameChange: setUserName,
28139
- onServerUrlChange: setServerUrl
28140
- }
28141
- ) }),
28142
- !isBroadcasting && /* @__PURE__ */ jsx("div", { className: "flex justify-end gap-2 px-5 py-3 border-t border-border", children: /* @__PURE__ */ jsx(
28143
- DialogFooter,
28144
- {
28145
- actions: [
28146
- { id: "close", label: t("pptx.common.close") },
28147
- {
28148
- id: "start",
28149
- label: t("pptx.broadcast.startBroadcast"),
28150
- variant: "primary",
28151
- disabled: !canStart
28152
- }
28153
- ],
28154
- onAction: (id) => id === "start" ? handleStartBroadcast() : onClose()
28155
- }
28156
- ) })
28225
+ regionRenderer ? (
28226
+ // The frame (backdrop, title bar, close, dismiss) stays the viewer's; the host replaces the body.
28227
+ /* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", children: /* @__PURE__ */ jsx(
28228
+ ViewerRegion,
28229
+ {
28230
+ region: "dialog.broadcast",
28231
+ renderer: regionRenderer,
28232
+ close: onClose,
28233
+ style: { width: "100%", minHeight: "8rem" }
28234
+ }
28235
+ ) })
28236
+ ) : /* @__PURE__ */ jsxs(Fragment, { children: [
28237
+ /* @__PURE__ */ jsx("div", { className: "px-5 py-4", children: isBroadcasting ? /* @__PURE__ */ jsx(
28238
+ ActiveBroadcastView,
28239
+ {
28240
+ collab,
28241
+ broadcastUrl,
28242
+ copied,
28243
+ onCopyUrl: handleCopyUrl,
28244
+ onStopBroadcast: handleStopBroadcast
28245
+ }
28246
+ ) : /* @__PURE__ */ jsx(
28247
+ StartBroadcastForm,
28248
+ {
28249
+ roomId,
28250
+ userName,
28251
+ serverUrl,
28252
+ onRoomIdChange: setRoomId,
28253
+ onUserNameChange: setUserName,
28254
+ onServerUrlChange: setServerUrl
28255
+ }
28256
+ ) }),
28257
+ !isBroadcasting && /* @__PURE__ */ jsx("div", { className: "flex justify-end gap-2 px-5 py-3 border-t border-border", children: /* @__PURE__ */ jsx(
28258
+ DialogFooter,
28259
+ {
28260
+ actions: [
28261
+ { id: "close", label: t("pptx.common.close") },
28262
+ {
28263
+ id: "start",
28264
+ label: t("pptx.broadcast.startBroadcast"),
28265
+ variant: "primary",
28266
+ disabled: !canStart
28267
+ }
28268
+ ],
28269
+ onAction: (id) => id === "start" ? handleStartBroadcast() : onClose()
28270
+ }
28271
+ ) })
28272
+ ] })
28157
28273
  ]
28158
28274
  }
28159
28275
  )
@@ -28562,6 +28678,7 @@ function ShareDialog({
28562
28678
  const collab = useCollaboration();
28563
28679
  const isActive = collab !== null && collab.status !== "disconnected" && collab.status !== "error";
28564
28680
  const { t } = useTranslation();
28681
+ const regionRenderer = useRegionRenderer("dialog.share");
28565
28682
  const [roomId, setRoomId] = useState(defaultRoomId ?? "");
28566
28683
  const [userName, setUserName] = useState(defaultUserName ?? "");
28567
28684
  const [serverUrl, setServerUrl] = useState(defaultServerUrl ?? "");
@@ -28648,58 +28765,74 @@ function ShareDialog({
28648
28765
  ]
28649
28766
  }
28650
28767
  ),
28651
- /* @__PURE__ */ jsx("div", { className: "px-5 py-4", children: isActive ? /* @__PURE__ */ jsx(
28652
- ActiveSessionView,
28653
- {
28654
- collab,
28655
- activeCollaboration,
28656
- copied,
28657
- onCopyRoomId: handleCopyRoomId,
28658
- onStopCollaboration
28659
- }
28660
- ) : /* @__PURE__ */ jsx(
28661
- StartSessionForm,
28662
- {
28663
- mode,
28664
- invitation,
28665
- roomId,
28666
- userName,
28667
- serverUrl,
28668
- onRoomIdChange: setRoomId,
28669
- onUserNameChange: setUserName,
28670
- onServerUrlChange: setServerUrl,
28671
- onModeChange: setMode,
28672
- onInvitationChange: setInvitation,
28673
- preconfigured,
28674
- connectionFailed: collab?.status === "error",
28675
- onRetry: collab?.retry
28676
- }
28677
- ) }),
28678
- /* @__PURE__ */ jsx(
28679
- "div",
28680
- {
28681
- className: `flex justify-end gap-2 px-5 py-3 border-t border-border ${stickyFooterClass}`,
28682
- children: /* @__PURE__ */ jsx(
28683
- DialogFooter,
28684
- {
28685
- actions: [
28686
- { id: "cancel", label: isActive ? t("pptx.share.close") : t("pptx.share.cancel") },
28687
- ...isActive ? [] : [
28768
+ regionRenderer ? (
28769
+ // The frame (backdrop, title bar, close, dismiss) stays the viewer's; the host replaces the body.
28770
+ /* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 overflow-y-auto", children: /* @__PURE__ */ jsx(
28771
+ ViewerRegion,
28772
+ {
28773
+ region: "dialog.share",
28774
+ renderer: regionRenderer,
28775
+ close: onClose,
28776
+ style: { width: "100%", minHeight: "8rem" }
28777
+ }
28778
+ ) })
28779
+ ) : /* @__PURE__ */ jsxs(Fragment, { children: [
28780
+ /* @__PURE__ */ jsx("div", { className: "px-5 py-4", children: isActive ? /* @__PURE__ */ jsx(
28781
+ ActiveSessionView,
28782
+ {
28783
+ collab,
28784
+ activeCollaboration,
28785
+ copied,
28786
+ onCopyRoomId: handleCopyRoomId,
28787
+ onStopCollaboration
28788
+ }
28789
+ ) : /* @__PURE__ */ jsx(
28790
+ StartSessionForm,
28791
+ {
28792
+ mode,
28793
+ invitation,
28794
+ roomId,
28795
+ userName,
28796
+ serverUrl,
28797
+ onRoomIdChange: setRoomId,
28798
+ onUserNameChange: setUserName,
28799
+ onServerUrlChange: setServerUrl,
28800
+ onModeChange: setMode,
28801
+ onInvitationChange: setInvitation,
28802
+ preconfigured,
28803
+ connectionFailed: collab?.status === "error",
28804
+ onRetry: collab?.retry
28805
+ }
28806
+ ) }),
28807
+ /* @__PURE__ */ jsx(
28808
+ "div",
28809
+ {
28810
+ className: `flex justify-end gap-2 px-5 py-3 border-t border-border ${stickyFooterClass}`,
28811
+ children: /* @__PURE__ */ jsx(
28812
+ DialogFooter,
28813
+ {
28814
+ actions: [
28688
28815
  {
28689
- id: "start",
28690
- label: t(
28691
- mode === "join" ? "pptx.share.joinSession" : "pptx.share.startSharing"
28692
- ),
28693
- variant: "primary",
28694
- disabled: !canStart
28695
- }
28696
- ]
28697
- ],
28698
- onAction: (id) => id === "start" ? handleStartSharing() : onClose()
28699
- }
28700
- )
28701
- }
28702
- )
28816
+ id: "cancel",
28817
+ label: isActive ? t("pptx.share.close") : t("pptx.share.cancel")
28818
+ },
28819
+ ...isActive ? [] : [
28820
+ {
28821
+ id: "start",
28822
+ label: t(
28823
+ mode === "join" ? "pptx.share.joinSession" : "pptx.share.startSharing"
28824
+ ),
28825
+ variant: "primary",
28826
+ disabled: !canStart
28827
+ }
28828
+ ]
28829
+ ],
28830
+ onAction: (id) => id === "start" ? handleStartSharing() : onClose()
28831
+ }
28832
+ )
28833
+ }
28834
+ )
28835
+ ] })
28703
28836
  ]
28704
28837
  }
28705
28838
  )
@@ -29049,13 +29182,14 @@ function ViewerOverlays({
29049
29182
  reducedMotion,
29050
29183
  onToggleReducedMotion
29051
29184
  }) {
29185
+ const customization = useViewerCustomizationContext();
29052
29186
  const hasOverlay = isShortcutHelpOpen || isAccessibilityPanelOpen || showSlideSorter || showReadingView || showOutlineView;
29053
29187
  if (!hasOverlay) {
29054
29188
  return null;
29055
29189
  }
29056
29190
  return /* @__PURE__ */ jsxs(Fragment, { children: [
29057
29191
  isShortcutHelpOpen && /* @__PURE__ */ jsx(ShortcutPanel, { isOpen: isShortcutHelpOpen, onClose: onCloseShortcuts }),
29058
- isAccessibilityPanelOpen && /* @__PURE__ */ jsx(
29192
+ isAccessibilityPanelOpen && isPanelVisible(customization, "accessibilityPane") && /* @__PURE__ */ jsx(
29059
29193
  AccessibilityPanel,
29060
29194
  {
29061
29195
  isOpen: isAccessibilityPanelOpen,
@@ -29138,9 +29272,38 @@ function ViewerBottomPanels({
29138
29272
  const { isHidden } = useToolbarVisibility(hiddenActions);
29139
29273
  const customization = useViewerCustomizationContext();
29140
29274
  const showNotes = isPanelVisible(customization, "notes");
29275
+ const notesRenderer = useRegionRenderer("notes");
29276
+ const statusBarRenderer = useRegionRenderer("statusBar");
29277
+ const [notesSlot, setNotesSlot] = useState(null);
29278
+ const reportsNotesHeight = Boolean(showNotes && notesRenderer);
29279
+ useEffect(() => {
29280
+ if (!notesSlot || !reportsNotesHeight || !onNotesHeightChange) {
29281
+ return void 0;
29282
+ }
29283
+ const stop2 = observeElementHeight(notesSlot, onNotesHeightChange);
29284
+ return () => {
29285
+ stop2();
29286
+ onNotesHeightChange(0);
29287
+ };
29288
+ }, [notesSlot, reportsNotesHeight, onNotesHeightChange]);
29141
29289
  return /* @__PURE__ */ jsxs(Fragment, { children: [
29142
29290
  showNotes && onResizeBottom && !isSlideNotesCollapsed && /* @__PURE__ */ jsx(ResizeHandle, { direction: "vertical", onResize: onResizeBottom }),
29143
- showNotes && /* @__PURE__ */ jsx(
29291
+ showNotes && notesRenderer && // The slot (height, resize handle, collapse) stays the viewer's; a
29292
+ // collapsed strip is hidden, not unmounted, so the host keeps its state.
29293
+ /* @__PURE__ */ jsx(
29294
+ "div",
29295
+ {
29296
+ ref: setNotesSlot,
29297
+ "data-pptx-chrome": "notes",
29298
+ className: "flex-shrink-0 overflow-hidden border-t border-border/60 bg-background",
29299
+ style: {
29300
+ height: notesPanelHeight ?? 120,
29301
+ display: isSlideNotesCollapsed ? "none" : void 0
29302
+ },
29303
+ children: /* @__PURE__ */ jsx(ViewerRegion, { region: "notes", renderer: notesRenderer })
29304
+ }
29305
+ ),
29306
+ showNotes && !notesRenderer && /* @__PURE__ */ jsx(
29144
29307
  SlideNotesPanel,
29145
29308
  {
29146
29309
  activeSlide,
@@ -29154,7 +29317,8 @@ function ViewerBottomPanels({
29154
29317
  onHeightChange: onNotesHeightChange
29155
29318
  }
29156
29319
  ),
29157
- !hideStatusBar && isPanelVisible(customization, "statusBar") && /* @__PURE__ */ jsx(
29320
+ !hideStatusBar && isPanelVisible(customization, "statusBar") && statusBarRenderer && /* @__PURE__ */ jsx("div", { "data-pptx-chrome": "status-bar", className: "flex-shrink-0", children: /* @__PURE__ */ jsx(ViewerRegion, { region: "statusBar", renderer: statusBarRenderer }) }),
29321
+ !hideStatusBar && isPanelVisible(customization, "statusBar") && !statusBarRenderer && /* @__PURE__ */ jsx(
29158
29322
  StatusBar,
29159
29323
  {
29160
29324
  slideCount,
@@ -29233,9 +29397,23 @@ function ViewerInspector({
29233
29397
  panelWidth
29234
29398
  }) {
29235
29399
  const { t } = useTranslation();
29400
+ const regionRenderer = useRegionRenderer("inspector");
29236
29401
  if (!isOpen) {
29237
29402
  return null;
29238
29403
  }
29404
+ if (regionRenderer) {
29405
+ return /* @__PURE__ */ jsx(
29406
+ "div",
29407
+ {
29408
+ "data-pptx-inspector": true,
29409
+ role: "complementary",
29410
+ "aria-label": t("pptx.inspector.properties"),
29411
+ className: "h-full flex-shrink-0 max-md:absolute max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:z-30",
29412
+ style: panelWidth ? { width: panelWidth } : void 0,
29413
+ children: /* @__PURE__ */ jsx(ViewerRegion, { region: "inspector", renderer: regionRenderer, close: onClose })
29414
+ }
29415
+ );
29416
+ }
29239
29417
  const slideId = activeSlide?.id ?? "";
29240
29418
  const commentDraft = comments.commentDraftBySlideId[slideId] ?? "";
29241
29419
  const editingCommentId = comments.editingCommentIdBySlideId[slideId] ?? null;
@@ -30350,7 +30528,8 @@ function ViewerDialogGroup(props) {
30350
30528
  onKeepAnnotations,
30351
30529
  onDiscardAnnotations
30352
30530
  } = props;
30353
- const printAvailable = isDialogAvailable(useViewerCustomizationContext(), "print");
30531
+ const customization = useViewerCustomizationContext();
30532
+ const printAvailable = isDialogAvailable(customization, "print");
30354
30533
  return /* @__PURE__ */ jsxs(Fragment, { children: [
30355
30534
  /* @__PURE__ */ jsx(
30356
30535
  VersionHistoryPanel,
@@ -30364,7 +30543,7 @@ function ViewerDialogGroup(props) {
30364
30543
  /* @__PURE__ */ jsx(
30365
30544
  ComparePanel,
30366
30545
  {
30367
- isOpen: propertyHandlers.isComparePanelOpen,
30546
+ isOpen: propertyHandlers.isComparePanelOpen && isPanelVisible(customization, "comparePane"),
30368
30547
  compareResult: propertyHandlers.compareResult,
30369
30548
  canvasSize,
30370
30549
  onClose: () => propertyHandlers.setIsComparePanelOpen(false),
@@ -30376,7 +30555,7 @@ function ViewerDialogGroup(props) {
30376
30555
  /* @__PURE__ */ jsx(
30377
30556
  PasswordProtectionDialog,
30378
30557
  {
30379
- isOpen: dialogs.isPasswordDialogOpen,
30558
+ isOpen: dialogs.isPasswordDialogOpen && isDialogAvailable(customization, "passwordProtection"),
30380
30559
  isCurrentlyProtected: dialogs.isPasswordProtected,
30381
30560
  onClose: () => dialogs.setIsPasswordDialogOpen(false),
30382
30561
  onSetPassword: dialogs.handleSetPassword,
@@ -30416,7 +30595,7 @@ function ViewerDialogGroup(props) {
30416
30595
  /* @__PURE__ */ jsx(
30417
30596
  DigitalSignaturesDialog,
30418
30597
  {
30419
- isOpen: dialogs.isDigitalSigDialogOpen,
30598
+ isOpen: dialogs.isDigitalSigDialogOpen && isDialogAvailable(customization, "signatures"),
30420
30599
  onClose: () => dialogs.setIsDigitalSigDialogOpen(false),
30421
30600
  hasSignatures: hasDigitalSignatures,
30422
30601
  signatureCount: digitalSignatureCount
@@ -30449,7 +30628,7 @@ function ViewerDialogGroup(props) {
30449
30628
  /* @__PURE__ */ jsx(
30450
30629
  EquationEditorDialog,
30451
30630
  {
30452
- isOpen: dialogs.isEquationDialogOpen,
30631
+ isOpen: dialogs.isEquationDialogOpen && isDialogAvailable(customization, "equation"),
30453
30632
  onClose: () => dialogs.setIsEquationDialogOpen(false),
30454
30633
  onInsert: dialogs.editingEquationOmml ? insertHandlers.handleUpdateEquation : insertHandlers.handleInsertEquation,
30455
30634
  existingOmml: dialogs.editingEquationOmml
@@ -30458,7 +30637,7 @@ function ViewerDialogGroup(props) {
30458
30637
  /* @__PURE__ */ jsx(
30459
30638
  HyperlinkEditDialog,
30460
30639
  {
30461
- open: dialogs.isHyperlinkDialogOpen,
30640
+ open: dialogs.isHyperlinkDialogOpen && isDialogAvailable(customization, "hyperlink"),
30462
30641
  initialUrl: selectedElements[0]?.actionClick?.url,
30463
30642
  initialTooltip: selectedElements[0]?.actionClick?.tooltip,
30464
30643
  initialAction: selectedElements[0]?.actionClick?.action,
@@ -30918,6 +31097,7 @@ function PresentationContextMenu(p) {
30918
31097
  );
30919
31098
  }
30920
31099
  function ViewerCanvasArea(props) {
31100
+ const customization = useViewerCustomizationContext();
30921
31101
  const {
30922
31102
  mode,
30923
31103
  canEdit,
@@ -31110,7 +31290,7 @@ ${url}`)) {
31110
31290
  onTouchEnd: swipe.onTouchEnd,
31111
31291
  onContextMenu: mode === "present" ? handlePresentationContextMenu : void 0,
31112
31292
  children: [
31113
- findReplace.findReplaceOpen && /* @__PURE__ */ jsx(
31293
+ findReplace.findReplaceOpen && isPanelVisible(customization, "findReplace") && /* @__PURE__ */ jsx(
31114
31294
  FindReplacePanel,
31115
31295
  {
31116
31296
  findQuery: findReplace.findQuery,
@@ -32100,7 +32280,7 @@ function ViewerSidePanels(props) {
32100
32280
  panelWidth
32101
32281
  }
32102
32282
  ),
32103
- s.isSelectionPaneOpen && (mode === "edit" || mode === "master") && /* @__PURE__ */ jsx(
32283
+ s.isSelectionPaneOpen && isPanelVisible(customization, "selectionPane") && (mode === "edit" || mode === "master") && /* @__PURE__ */ jsx(
32104
32284
  MobileDismissSheet,
32105
32285
  {
32106
32286
  onClose: () => s.setIsSelectionPaneOpen(false),
@@ -32295,6 +32475,7 @@ function ViewerMainContent(props) {
32295
32475
  onApplyLayout,
32296
32476
  loadLayoutPreviews
32297
32477
  } = props;
32478
+ const slidesPaneRenderer = useRegionRenderer("slidesPane");
32298
32479
  const {
32299
32480
  ops,
32300
32481
  sectionOps,
@@ -32324,7 +32505,22 @@ function ViewerMainContent(props) {
32324
32505
  const layoutGalleryPreviews = useLayoutPreviews(loadLayoutPreviews, layoutGalleryAnchor !== null);
32325
32506
  return /* @__PURE__ */ jsx(ChartPartSelectionProvider, { children: /* @__PURE__ */ jsxs("div", { "data-pptx-chrome": "body", className: "relative z-10 flex flex-1 min-h-0", children: [
32326
32507
  showSlidesPane && /* @__PURE__ */ jsxs(Fragment, { children: [
32327
- /* @__PURE__ */ jsx(
32508
+ slidesPaneRenderer ? (
32509
+ // The rail's slot (width, collapse, resize handle) stays the viewer's.
32510
+ /* @__PURE__ */ jsx(
32511
+ "div",
32512
+ {
32513
+ "data-pptx-chrome": "slides",
32514
+ className: "h-full flex-shrink-0 overflow-hidden border-r border-border bg-secondary/30",
32515
+ style: {
32516
+ width: leftPanelWidth ?? 220,
32517
+ // Same collapse rule as the built-in rail; hidden, not unmounted.
32518
+ display: state.isSlidesPaneOpen ? void 0 : "none"
32519
+ },
32520
+ children: /* @__PURE__ */ jsx(ViewerRegion, { region: "slidesPane", renderer: slidesPaneRenderer })
32521
+ }
32522
+ )
32523
+ ) : /* @__PURE__ */ jsx(
32328
32524
  SlidesPaneSidebar,
32329
32525
  {
32330
32526
  slides,
@@ -33070,157 +33266,6 @@ function OptionsAddInsPane({ addinStatus }) {
33070
33266
  ] })
33071
33267
  ] });
33072
33268
  }
33073
- function readValue(options, control) {
33074
- const group = options[control.group];
33075
- const value = group[control.key];
33076
- return typeof value === "boolean" || typeof value === "number" || typeof value === "string" ? value : void 0;
33077
- }
33078
- function InfoTip({ text }) {
33079
- return /* @__PURE__ */ jsx("span", { title: text, className: "inline-flex cursor-help align-middle", children: /* @__PURE__ */ jsx(LuInfo, { className: "ml-1 h-3.5 w-3.5 text-primary/70", "aria-label": text }) });
33080
- }
33081
- var IGNORE_CHANGE = () => void 0;
33082
- function ControlRow({
33083
- control,
33084
- options,
33085
- onOptionChange: emitChange
33086
- }) {
33087
- const { t } = useTranslation();
33088
- const { viewportWidth } = useIsMobile();
33089
- const fieldMinHeight = getDensePanelTouchTargetPx(viewportWidth);
33090
- const value = readValue(options, control);
33091
- const label = t(control.labelKey);
33092
- const info = control.infoKey ? /* @__PURE__ */ jsx(InfoTip, { text: t(control.infoKey) }) : null;
33093
- const rowClass = cn("flex items-center justify-between gap-3 py-1.5", control.indent && "pl-6");
33094
- const rowStyle = { minHeight: fieldMinHeight };
33095
- const locked = control.readOnly === true;
33096
- const lockedTitle = locked ? t("pptx.options.lockedByHost") : void 0;
33097
- const onOptionChange = locked ? IGNORE_CHANGE : emitChange;
33098
- if (control.kind === "toggle") {
33099
- return /* @__PURE__ */ jsxs("label", { className: cn(rowClass, "cursor-pointer select-none"), style: rowStyle, children: [
33100
- /* @__PURE__ */ jsxs("span", { className: "text-sm text-foreground", children: [
33101
- label,
33102
- info
33103
- ] }),
33104
- /* @__PURE__ */ jsx(
33105
- WebCheckbox,
33106
- {
33107
- checked: value === true,
33108
- "aria-label": label,
33109
- disabled: locked,
33110
- title: lockedTitle,
33111
- onChange: (event) => onOptionChange(
33112
- control.group,
33113
- control.key,
33114
- event.currentTarget.checked
33115
- )
33116
- }
33117
- )
33118
- ] });
33119
- }
33120
- if (control.kind === "select") {
33121
- return /* @__PURE__ */ jsxs("div", { className: rowClass, style: rowStyle, children: [
33122
- /* @__PURE__ */ jsxs("span", { className: "text-sm text-foreground", children: [
33123
- label,
33124
- info
33125
- ] }),
33126
- /* @__PURE__ */ jsx(
33127
- WebSelect,
33128
- {
33129
- "aria-label": label,
33130
- disabled: locked,
33131
- title: lockedTitle,
33132
- style: { minHeight: fieldMinHeight },
33133
- value: typeof value === "string" ? value : "",
33134
- onChange: (event) => onOptionChange(
33135
- control.group,
33136
- control.key,
33137
- event.currentTarget.value
33138
- ),
33139
- children: control.choices.map((choice) => /* @__PURE__ */ jsx("option", { value: choice.value, children: t(choice.labelKey) }, choice.value))
33140
- }
33141
- )
33142
- ] });
33143
- }
33144
- if (control.kind === "number") {
33145
- return /* @__PURE__ */ jsxs("div", { className: rowClass, style: rowStyle, children: [
33146
- /* @__PURE__ */ jsxs("span", { className: "text-sm text-foreground", children: [
33147
- label,
33148
- info
33149
- ] }),
33150
- /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1.5", children: [
33151
- /* @__PURE__ */ jsx(
33152
- "input",
33153
- {
33154
- type: "number",
33155
- "aria-label": label,
33156
- disabled: locked,
33157
- title: lockedTitle,
33158
- style: { minHeight: fieldMinHeight },
33159
- className: "w-20 rounded border border-border bg-background px-2 py-1 text-right text-xs text-foreground",
33160
- min: control.min,
33161
- max: control.max,
33162
- step: control.step ?? 1,
33163
- value: typeof value === "number" ? value : control.min,
33164
- onChange: (event) => {
33165
- const clamped = clampOptionNumber(event.target.value, control.min, control.max);
33166
- if (clamped !== void 0) {
33167
- onOptionChange(control.group, control.key, clamped);
33168
- }
33169
- }
33170
- }
33171
- ),
33172
- control.unitKey && /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: t(control.unitKey) })
33173
- ] })
33174
- ] });
33175
- }
33176
- return /* @__PURE__ */ jsxs("div", { className: rowClass, style: rowStyle, children: [
33177
- /* @__PURE__ */ jsxs("span", { className: "text-sm text-foreground", children: [
33178
- label,
33179
- info
33180
- ] }),
33181
- /* @__PURE__ */ jsx(
33182
- "input",
33183
- {
33184
- type: "text",
33185
- "aria-label": label,
33186
- disabled: locked,
33187
- title: lockedTitle,
33188
- style: { minHeight: fieldMinHeight },
33189
- className: "w-48 max-w-[55%] rounded border border-border bg-background px-2 py-1 text-xs text-foreground",
33190
- maxLength: control.maxLength,
33191
- value: typeof value === "string" ? value : "",
33192
- onChange: (event) => onOptionChange(control.group, control.key, event.target.value)
33193
- }
33194
- )
33195
- ] });
33196
- }
33197
- function OptionsPane({
33198
- tab,
33199
- options,
33200
- onOptionChange,
33201
- renderSpecial,
33202
- children
33203
- }) {
33204
- const { t } = useTranslation();
33205
- return /* @__PURE__ */ jsxs("div", { className: "space-y-5", children: [
33206
- /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-foreground", children: t(tab.descriptionKey) }),
33207
- tab.sections.map((section) => /* @__PURE__ */ jsxs("section", { children: [
33208
- /* @__PURE__ */ jsx("h3", { className: "mb-1 border-b border-border/60 pb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: t(section.titleKey) }),
33209
- section.descriptionKey && /* @__PURE__ */ jsx("p", { className: "mb-2 text-xs text-muted-foreground", children: t(section.descriptionKey) }),
33210
- /* @__PURE__ */ jsx("div", { className: "space-y-0.5", children: section.controls.map((control) => /* @__PURE__ */ jsx(
33211
- ControlRow,
33212
- {
33213
- control,
33214
- options,
33215
- onOptionChange
33216
- },
33217
- `${control.group}.${control.key}.${section.id}`
33218
- )) }),
33219
- section.special && renderSpecial?.(section)
33220
- ] }, section.id)),
33221
- children
33222
- ] });
33223
- }
33224
33269
  function CommandList({
33225
33270
  title,
33226
33271
  commandIds,
@@ -33423,7 +33468,7 @@ function OptionsRibbonPane({
33423
33468
  ] }),
33424
33469
  /* @__PURE__ */ jsxs("section", { children: [
33425
33470
  /* @__PURE__ */ jsx("h3", { className: "mb-1 border-b border-border/60 pb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: t("pptx.settings.keyboardShortcuts") }),
33426
- /* @__PURE__ */ jsx("div", { className: "space-y-0.5", children: SHORTCUT_REFERENCE_ITEMS.map((shortcut, i) => /* @__PURE__ */ jsxs(
33471
+ /* @__PURE__ */ jsx("div", { className: "space-y-0.5", children: SHORTCUT_REFERENCE_ITEMS$1.map((shortcut, i) => /* @__PURE__ */ jsxs(
33427
33472
  "div",
33428
33473
  {
33429
33474
  className: cn(
@@ -33665,10 +33710,11 @@ function SettingsLanguageTab({
33665
33710
  );
33666
33711
  }) });
33667
33712
  }
33668
- var AI_TAB_ID = "ai";
33669
33713
  var NO_CUSTOM_FONT_FAMILIES = [];
33670
- function SettingsDialog({
33671
- isOpen,
33714
+ function SettingsDialog(props) {
33715
+ return props.isOpen ? /* @__PURE__ */ jsx(OpenSettingsDialog, { ...props }) : null;
33716
+ }
33717
+ function OpenSettingsDialog({
33672
33718
  onClose,
33673
33719
  options,
33674
33720
  onOptionChange,
@@ -33689,272 +33735,98 @@ function SettingsDialog({
33689
33735
  customFontFamilies = NO_CUSTOM_FONT_FAMILIES,
33690
33736
  onCustomFontRegistered
33691
33737
  }) {
33692
- const [activeTabId, setActiveTabId] = useState("general");
33693
33738
  const { t } = useTranslation();
33694
33739
  const customization = useViewerCustomizationContext();
33695
- const { panelStyle, handlers: dragHandlers } = useModalDismissDrag(onClose);
33696
- const { viewportWidth, viewportHeight } = useIsMobile();
33697
- const touchTargetPx = getDensePanelTouchTargetPx(viewportWidth);
33698
- const navBtnStyle = { minHeight: touchTargetPx, minWidth: touchTargetPx };
33699
- const closeBtnStyle = { minWidth: touchTargetPx, minHeight: touchTargetPx };
33700
- const footerBtnStyle = { minHeight: touchTargetPx };
33701
- const stickyFooterClass = shouldStickyActionRow(viewportWidth, viewportHeight) ? "sticky bottom-0 bg-popover" : "";
33702
- const snapshotRef = useRef(null);
33703
- const wasOpenRef = useRef(false);
33704
- useEffect(() => {
33705
- if (isOpen && !wasOpenRef.current) {
33706
- snapshotRef.current = options;
33707
- }
33708
- wasOpenRef.current = isOpen;
33709
- }, [isOpen, options]);
33710
- const handleCancel = useCallback(() => {
33711
- if (snapshotRef.current) {
33712
- onRestoreOptions(snapshotRef.current);
33713
- }
33714
- onClose();
33715
- }, [onClose, onRestoreOptions]);
33716
- const handleKeyDown = useCallback(
33717
- (e) => {
33718
- if (e.key === "Escape") {
33719
- onClose();
33720
- }
33721
- },
33722
- [onClose]
33740
+ const regionBase = useContext(ViewerRegionBaseContext);
33741
+ const regionContext = useMemo(
33742
+ () => regionBase ? { ...regionBase, region: "dialog.options", close: onClose } : null,
33743
+ [regionBase, onClose]
33723
33744
  );
33724
- useEffect(() => {
33725
- if (isOpen) {
33726
- document.addEventListener("keydown", handleKeyDown);
33727
- return () => document.removeEventListener("keydown", handleKeyDown);
33728
- }
33729
- }, [isOpen, handleKeyDown]);
33730
- if (!isOpen) {
33731
- return null;
33732
- }
33733
- const tabs = customizeOptionsTabs(VIEWER_OPTIONS_TABS, customization);
33734
- const showAiTab = Boolean(aiEnabled) && isOptionsPageVisible(customization, AI_TAB_ID);
33735
- const activeTab = tabs.find((tab) => tab.id === activeTabId) ?? tabs[0];
33736
- const aiActive = activeTabId === AI_TAB_ID && showAiTab;
33737
- if (!activeTab) {
33738
- return null;
33739
- }
33740
- const currentTabId = aiActive ? AI_TAB_ID : activeTab.id;
33741
- return /* @__PURE__ */ jsxs(Fragment, { children: [
33742
- /* @__PURE__ */ jsx(
33743
- "button",
33745
+ const dialogRef = useRef(null);
33746
+ const bindingRef = useRef(null);
33747
+ const [category, setCategory] = useState("general");
33748
+ const latest = useRef({ onClose, onOptionChange, onRestoreOptions, onResetOptions });
33749
+ latest.current = { onClose, onOptionChange, onRestoreOptions, onResetOptions };
33750
+ useLayoutEffect(() => {
33751
+ const binding = bindPptxOptionsDialog(dialogRef.current, {
33752
+ setOption: (group, key, value) => latest.current.onOptionChange(group, key, value),
33753
+ restoreOptions: (snapshot) => latest.current.onRestoreOptions(snapshot),
33754
+ resetOptions: () => latest.current.onResetOptions(),
33755
+ close: () => latest.current.onClose(),
33756
+ categoryChanged: setCategory
33757
+ });
33758
+ bindingRef.current = binding;
33759
+ return () => {
33760
+ binding.dispose();
33761
+ bindingRef.current = null;
33762
+ };
33763
+ }, []);
33764
+ useLayoutEffect(() => {
33765
+ bindingRef.current?.sync({
33766
+ options,
33767
+ t,
33768
+ customization,
33769
+ aiEnabled: Boolean(aiEnabled),
33770
+ regionContext
33771
+ });
33772
+ }, [options, t, customization, aiEnabled, regionContext]);
33773
+ return /* @__PURE__ */ jsxs("pptx-ui-options-dialog", { ref: dialogRef, children: [
33774
+ category === "general" && /* @__PURE__ */ jsxs(Fragment, { children: [
33775
+ /* @__PURE__ */ jsx("div", { slot: optionsBlockSlot("themePicker"), className: "mt-2", children: /* @__PURE__ */ jsx(
33776
+ SettingsAppearanceTab,
33777
+ {
33778
+ activeThemeKey: themeKey,
33779
+ themes: availableThemes,
33780
+ onSelectTheme
33781
+ }
33782
+ ) }),
33783
+ /* @__PURE__ */ jsx("div", { slot: optionsBlockSlot("customFonts"), children: /* @__PURE__ */ jsx(
33784
+ SettingsCustomFontsSection,
33785
+ {
33786
+ enabled: options.general.enableCustomFontUpload,
33787
+ families: customFontFamilies,
33788
+ onRegistered: (family) => onCustomFontRegistered?.(family)
33789
+ }
33790
+ ) })
33791
+ ] }),
33792
+ category === "save" && /* @__PURE__ */ jsxs("div", { slot: optionsBlockSlot("clearCache"), className: "mt-2", children: [
33793
+ /* @__PURE__ */ jsx("p", { className: "mb-2 text-xs text-muted-foreground", children: t("pptx.options.save.clearCacheDescription") }),
33794
+ /* @__PURE__ */ jsx(
33795
+ "button",
33796
+ {
33797
+ type: "button",
33798
+ onClick: onClearCache,
33799
+ className: "rounded border border-border px-3 py-1.5 text-xs text-foreground transition-colors hover:bg-accent",
33800
+ children: t("pptx.options.save.clearCacheNow")
33801
+ }
33802
+ )
33803
+ ] }),
33804
+ category === "language" && /* @__PURE__ */ jsx("div", { slot: optionsBlockSlot("language"), children: /* @__PURE__ */ jsx(
33805
+ SettingsLanguageTab,
33744
33806
  {
33745
- type: "button",
33746
- style: { zIndex: 1200 },
33747
- className: "fixed inset-0 bg-black/60",
33748
- "aria-label": t("pptx.settings.closeSettings"),
33749
- onClick: onClose
33807
+ activeLocale: localeCode,
33808
+ locales: availableLocales,
33809
+ onSelectLocale
33750
33810
  }
33751
- ),
33752
- /* @__PURE__ */ jsx(
33753
- "div",
33811
+ ) }),
33812
+ category === "ribbon" && /* @__PURE__ */ jsx("div", { slot: optionsPaneSlot("ribbon"), children: /* @__PURE__ */ jsx(
33813
+ OptionsRibbonPane,
33754
33814
  {
33755
- style: { zIndex: 1201 },
33756
- className: "fixed inset-0 flex items-center justify-center pointer-events-none",
33757
- children: /* @__PURE__ */ jsxs(
33758
- "div",
33759
- {
33760
- style: panelStyle,
33761
- role: "dialog",
33762
- "aria-modal": "true",
33763
- "aria-label": t("pptx.options.title"),
33764
- className: "pointer-events-auto flex max-h-[85vh] w-[min(56rem,calc(100%-2rem))] flex-col rounded-xl border border-border bg-popover shadow-2xl backdrop-blur-xl max-md:fixed max-md:inset-x-0 max-md:bottom-0 max-md:top-auto max-md:max-h-[88dvh] max-md:w-full max-md:rounded-t-2xl max-md:rounded-b-none max-md:border-x-0 max-md:border-b-0 max-md:pb-[max(env(safe-area-inset-bottom),0px)]",
33765
- children: [
33766
- /* @__PURE__ */ jsxs(
33767
- "div",
33768
- {
33769
- ...dragHandlers,
33770
- className: "flex items-center justify-between border-b border-border/60 px-5 py-4 touch-none",
33771
- children: [
33772
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
33773
- /* @__PURE__ */ jsx(LuSettings, { className: "h-5 w-5 text-primary" }),
33774
- /* @__PURE__ */ jsx("h2", { className: "text-sm font-semibold text-foreground", children: t("pptx.options.title") })
33775
- ] }),
33776
- /* @__PURE__ */ jsx(
33777
- "button",
33778
- {
33779
- type: "button",
33780
- onClick: onClose,
33781
- style: closeBtnStyle,
33782
- className: "rounded p-1 transition-colors hover:bg-accent inline-flex items-center justify-center",
33783
- "aria-label": t("pptx.settings.close"),
33784
- children: /* @__PURE__ */ jsx(LuX, { className: "h-4 w-4 text-muted-foreground" })
33785
- }
33786
- )
33787
- ]
33788
- }
33789
- ),
33790
- /* @__PURE__ */ jsxs("div", { className: "flex min-h-0 flex-1 max-md:flex-col", children: [
33791
- /* @__PURE__ */ jsxs(
33792
- "nav",
33793
- {
33794
- "aria-label": t("pptx.options.title"),
33795
- className: "w-44 shrink-0 space-y-0.5 overflow-y-auto border-r border-border/60 p-2 max-md:flex max-md:w-full max-md:space-y-0 max-md:gap-1 max-md:overflow-x-auto max-md:border-b max-md:border-r-0",
33796
- children: [
33797
- tabs.map((tab) => /* @__PURE__ */ jsx(
33798
- "button",
33799
- {
33800
- type: "button",
33801
- onClick: () => setActiveTabId(tab.id),
33802
- "aria-current": currentTabId === tab.id,
33803
- style: navBtnStyle,
33804
- className: cn(
33805
- "flex w-full items-center whitespace-nowrap rounded px-3 py-2 text-left text-sm transition-colors max-md:w-auto",
33806
- currentTabId === tab.id ? "bg-primary/10 font-medium text-primary" : "text-foreground hover:bg-accent"
33807
- ),
33808
- children: t(tab.labelKey)
33809
- },
33810
- tab.id
33811
- )),
33812
- showAiTab && /* @__PURE__ */ jsx(
33813
- "button",
33814
- {
33815
- type: "button",
33816
- onClick: () => setActiveTabId(AI_TAB_ID),
33817
- "aria-current": aiActive,
33818
- style: navBtnStyle,
33819
- className: cn(
33820
- "flex w-full items-center whitespace-nowrap rounded px-3 py-2 text-left text-sm transition-colors max-md:w-auto",
33821
- aiActive ? "bg-primary/10 font-medium text-primary" : "text-foreground hover:bg-accent"
33822
- ),
33823
- children: t("pptx.ai.settingsSectionTitle")
33824
- }
33825
- )
33826
- ]
33827
- }
33828
- ),
33829
- /* @__PURE__ */ jsx("div", { className: "min-h-0 flex-1 overflow-y-auto px-5 py-4", children: aiActive ? /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
33830
- /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-foreground", children: t("pptx.ai.settingsSectionTitle") }),
33831
- /* @__PURE__ */ jsx(SettingsAiTab, { store: chatStore })
33832
- ] }) : activeTab.custom === "language" ? /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
33833
- /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-foreground", children: t(activeTab.descriptionKey) }),
33834
- /* @__PURE__ */ jsxs("section", { children: [
33835
- /* @__PURE__ */ jsx("h3", { className: "mb-1 border-b border-border/60 pb-1 text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: t("pptx.options.language.displayLanguage") }),
33836
- /* @__PURE__ */ jsx("p", { className: "mb-2 text-xs text-muted-foreground", children: t("pptx.options.language.displayLanguageDescription") }),
33837
- /* @__PURE__ */ jsx(
33838
- SettingsLanguageTab,
33839
- {
33840
- activeLocale: localeCode,
33841
- locales: availableLocales,
33842
- onSelectLocale
33843
- }
33844
- )
33845
- ] })
33846
- ] }) : activeTab.custom === "ribbon" ? /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
33847
- /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-foreground", children: t(activeTab.descriptionKey) }),
33848
- /* @__PURE__ */ jsx(
33849
- OptionsRibbonPane,
33850
- {
33851
- options,
33852
- onRibbonTabHiddenChange,
33853
- onResetRibbon: () => onResetOptions("ribbon")
33854
- }
33855
- )
33856
- ] }) : activeTab.custom === "addIns" ? /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
33857
- /* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-foreground", children: t(activeTab.descriptionKey) }),
33858
- /* @__PURE__ */ jsx(OptionsAddInsPane, { addinStatus })
33859
- ] }) : /* @__PURE__ */ jsx(
33860
- OptionsPane,
33861
- {
33862
- tab: activeTab,
33863
- options,
33864
- onOptionChange,
33865
- renderSpecial: (section) => {
33866
- if (section.special === "themePicker") {
33867
- return /* @__PURE__ */ jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsx(
33868
- SettingsAppearanceTab,
33869
- {
33870
- activeThemeKey: themeKey,
33871
- themes: availableThemes,
33872
- onSelectTheme
33873
- }
33874
- ) });
33875
- }
33876
- if (section.special === "customFonts") {
33877
- return /* @__PURE__ */ jsx(
33878
- SettingsCustomFontsSection,
33879
- {
33880
- enabled: options.general.enableCustomFontUpload,
33881
- families: customFontFamilies,
33882
- onRegistered: (family) => onCustomFontRegistered?.(family)
33883
- }
33884
- );
33885
- }
33886
- if (section.special === "clearCache") {
33887
- return /* @__PURE__ */ jsxs("div", { className: "mt-2", children: [
33888
- /* @__PURE__ */ jsx("p", { className: "mb-2 text-xs text-muted-foreground", children: t("pptx.options.save.clearCacheDescription") }),
33889
- /* @__PURE__ */ jsx(
33890
- "button",
33891
- {
33892
- type: "button",
33893
- onClick: onClearCache,
33894
- className: "rounded border border-border px-3 py-1.5 text-xs text-foreground transition-colors hover:bg-accent",
33895
- children: t("pptx.options.save.clearCacheNow")
33896
- }
33897
- )
33898
- ] });
33899
- }
33900
- return null;
33901
- },
33902
- children: activeTab.custom === "quickAccess" && /* @__PURE__ */ jsx(
33903
- OptionsQuickAccessPane,
33904
- {
33905
- options,
33906
- onQuickAccessCommandsChange,
33907
- onResetQuickAccess: () => onQuickAccessCommandsChange([...DEFAULT_QUICK_ACCESS_COMMAND_IDS])
33908
- }
33909
- )
33910
- }
33911
- ) })
33912
- ] }),
33913
- /* @__PURE__ */ jsxs(
33914
- "div",
33915
- {
33916
- className: `flex items-center justify-between gap-2 border-t border-border/60 px-5 py-3 ${stickyFooterClass}`,
33917
- children: [
33918
- /* @__PURE__ */ jsx(
33919
- "button",
33920
- {
33921
- type: "button",
33922
- onClick: () => onResetOptions(),
33923
- style: footerBtnStyle,
33924
- className: "rounded border border-border px-3 py-1.5 text-xs text-muted-foreground transition-colors hover:bg-accent hover:text-foreground",
33925
- children: t("pptx.options.resetAll")
33926
- }
33927
- ),
33928
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
33929
- /* @__PURE__ */ jsx(
33930
- "button",
33931
- {
33932
- type: "button",
33933
- onClick: handleCancel,
33934
- style: footerBtnStyle,
33935
- className: "rounded border border-border px-4 py-1.5 text-xs text-foreground transition-colors hover:bg-accent",
33936
- children: t("pptx.common.cancel")
33937
- }
33938
- ),
33939
- /* @__PURE__ */ jsx(
33940
- "button",
33941
- {
33942
- type: "button",
33943
- onClick: onClose,
33944
- style: footerBtnStyle,
33945
- className: "rounded bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground transition-colors hover:bg-primary/90",
33946
- children: t("pptx.common.ok")
33947
- }
33948
- )
33949
- ] })
33950
- ]
33951
- }
33952
- )
33953
- ]
33954
- }
33955
- )
33815
+ options,
33816
+ onRibbonTabHiddenChange,
33817
+ onResetRibbon: () => onResetOptions("ribbon")
33956
33818
  }
33957
- )
33819
+ ) }),
33820
+ category === "quickAccess" && /* @__PURE__ */ jsx("div", { slot: optionsPaneSlot("quickAccess"), children: /* @__PURE__ */ jsx(
33821
+ OptionsQuickAccessPane,
33822
+ {
33823
+ options,
33824
+ onQuickAccessCommandsChange,
33825
+ onResetQuickAccess: () => onQuickAccessCommandsChange([...DEFAULT_QUICK_ACCESS_COMMAND_IDS])
33826
+ }
33827
+ ) }),
33828
+ category === "addIns" && /* @__PURE__ */ jsx("div", { slot: optionsPaneSlot("addIns"), children: /* @__PURE__ */ jsx(OptionsAddInsPane, { addinStatus }) }),
33829
+ category === AI_OPTIONS_CATEGORY && /* @__PURE__ */ jsx("div", { slot: optionsPaneSlot(AI_OPTIONS_CATEGORY), children: /* @__PURE__ */ jsx(SettingsAiTab, { store: chatStore }) })
33958
33830
  ] });
33959
33831
  }
33960
33832
  function ViewerOptionsProvider({
@@ -34250,6 +34122,31 @@ function useAutosaveCacheMaintenance(viewerOptions) {
34250
34122
  }, [viewerOptions]);
34251
34123
  return handleClearOptionsCache;
34252
34124
  }
34125
+ function useLoadNotifications(input) {
34126
+ const { loading, error } = input;
34127
+ const latest = useRef(input);
34128
+ latest.current = input;
34129
+ const wasLoading = useRef(loading);
34130
+ const announcedError = useRef(null);
34131
+ useEffect(() => {
34132
+ const finished = wasLoading.current && !loading;
34133
+ wasLoading.current = loading;
34134
+ if (finished && !latest.current.error) {
34135
+ latest.current.onLoad?.({
34136
+ slideCount: latest.current.slideCount,
34137
+ canvasSize: latest.current.canvasSize
34138
+ });
34139
+ }
34140
+ }, [loading]);
34141
+ useEffect(() => {
34142
+ if (error && error !== announcedError.current) {
34143
+ announcedError.current = error;
34144
+ latest.current.onError?.(error);
34145
+ } else if (!error) {
34146
+ announcedError.current = null;
34147
+ }
34148
+ }, [error]);
34149
+ }
34253
34150
  function useMasterViewCrud(input) {
34254
34151
  const {
34255
34152
  handlerRef,
@@ -34623,6 +34520,8 @@ var PowerPointViewer = forwardRef(
34623
34520
  onZoomChange,
34624
34521
  onSelectionChange,
34625
34522
  onSlideCountChange,
34523
+ onLoad,
34524
+ onError,
34626
34525
  onOpenFile: hostOpenFile,
34627
34526
  theme,
34628
34527
  defaultThemeKey,
@@ -34765,7 +34664,7 @@ var PowerPointViewer = forwardRef(
34765
34664
  const [notesBarHeight, setNotesBarHeight] = useState(0);
34766
34665
  const runProgramNoticesState = useRunProgramNoticesState();
34767
34666
  const [collaborationReadOnly, setCollaborationReadOnly] = useState(Boolean(collaboration));
34768
- const canEdit = hostCanEdit && !collaborationReadOnly && !isProtectedView && !readOnlyRec.locked;
34667
+ const canEdit = hostCanEdit && isEditingAllowed(customizationResolved) && !collaborationReadOnly && !isProtectedView && !readOnlyRec.locked;
34769
34668
  const [isSettingsOpen, setIsSettingsOpen] = useState(false);
34770
34669
  const [isHeaderFooterOpen, setIsHeaderFooterOpen] = useState(false);
34771
34670
  const [autosaveEnabled, setAutosaveEnabled] = useState(true);
@@ -34797,6 +34696,14 @@ var PowerPointViewer = forwardRef(
34797
34696
  activeSlide,
34798
34697
  selectedElement
34799
34698
  } = state;
34699
+ useLoadNotifications({
34700
+ loading,
34701
+ error,
34702
+ slideCount: slides.length,
34703
+ canvasSize,
34704
+ onLoad,
34705
+ onError
34706
+ });
34800
34707
  const { pushColor } = useRecentColorsSync({
34801
34708
  setRecentColors: state.setRecentColors,
34802
34709
  setPresentationProperties: state.setPresentationProperties
@@ -35150,6 +35057,7 @@ ${url}`)
35150
35057
  isEncryptedDialogOpen,
35151
35058
  setIsEncryptedDialogOpen,
35152
35059
  handlerRef,
35060
+ viewerApi,
35153
35061
  loadVersion
35154
35062
  } = useViewerIntegration({
35155
35063
  transformCommittedText: (text) => applyAutoCorrect(text, viewerOptions.proofing),
@@ -35381,6 +35289,20 @@ ${url}`)
35381
35289
  collaboration: Boolean(collaboration),
35382
35290
  locales: resolvedLocales.length > 1
35383
35291
  };
35292
+ const selectionKey = state.effectiveSelectedIds.join("\0");
35293
+ const regionBase = useMemo(
35294
+ () => ({
35295
+ viewer: viewerApi,
35296
+ mode,
35297
+ canEdit,
35298
+ activeSlideIndex,
35299
+ slideCount: slides.length,
35300
+ selectedElementIds: [...state.effectiveSelectedIds],
35301
+ locale: localeCode
35302
+ }),
35303
+ // oxlint-disable-next-line react-hooks/exhaustive-deps -- selectionKey stands for the ids
35304
+ [viewerApi, mode, canEdit, activeSlideIndex, slides.length, selectionKey, localeCode]
35305
+ );
35384
35306
  const viewerContent = /* @__PURE__ */ jsxs(
35385
35307
  "div",
35386
35308
  {
@@ -35451,7 +35373,7 @@ ${url}`)
35451
35373
  isAiPanelOpen: aiPanel.isOpen,
35452
35374
  onToggleAiPanel: aiPanel.toggle,
35453
35375
  isProtectedView,
35454
- onEnableEditing: hostCanEdit ? handleEnableEditing : void 0,
35376
+ onEnableEditing: hostCanEdit && isEditingAllowed(customizationResolved) ? handleEnableEditing : void 0,
35455
35377
  onSetSnapToGrid: viewPreferencesSync.handleSetSnapToGrid,
35456
35378
  onSetSnapToShape: viewPreferencesSync.handleSetSnapToShape,
35457
35379
  onSetShowGuides: viewPreferencesSync.handleSetShowGuides
@@ -35615,7 +35537,7 @@ ${url}`)
35615
35537
  /* @__PURE__ */ jsx(
35616
35538
  PasteSpecialDialog,
35617
35539
  {
35618
- isOpen: editorOps.pasteSpecial.isPasteSpecialDialogOpen,
35540
+ isOpen: editorOps.pasteSpecial.isPasteSpecialDialogOpen && isDialogAvailable(customizationResolved, "pasteSpecial"),
35619
35541
  onCancel: editorOps.pasteSpecial.closePasteSpecialDialog,
35620
35542
  onConfirm: (format) => {
35621
35543
  void editorOps.pasteSpecial.pasteWithFormat(format);
@@ -35784,7 +35706,7 @@ ${url}`)
35784
35706
  // Nothing previously provided it, so every one of those consumers was
35785
35707
  // silently reading `DEFAULT_VIEWER_OPTIONS` forever, no matter what
35786
35708
  // the user changed in the Options dialog.
35787
- /* @__PURE__ */ jsx(ViewerOptionsProvider, { options: viewerOptions, store: optionsStore, children: /* @__PURE__ */ jsx(ViewerCustomizationContext.Provider, { value: customizationResolved, children: /* @__PURE__ */ jsx(RibbonAddInsContext.Provider, { value: ribbonAddIns ?? NO_RIBBON_ADD_INS, children: /* @__PURE__ */ jsx(AccountAuthContext.Provider, { value: accountAuth, children: /* @__PURE__ */ jsx(Rendering3DFlagsContext.Provider, { value: effective3D, children: /* @__PURE__ */ jsx(ViewerThemeProvider, { theme: effectiveTheme, children: /* @__PURE__ */ jsxs(
35709
+ /* @__PURE__ */ jsx(ViewerOptionsProvider, { options: viewerOptions, store: optionsStore, children: /* @__PURE__ */ jsx(ViewerCustomizationContext.Provider, { value: customizationResolved, children: /* @__PURE__ */ jsx(ViewerRegionBaseContext.Provider, { value: regionBase, children: /* @__PURE__ */ jsx(RibbonAddInsContext.Provider, { value: ribbonAddIns ?? NO_RIBBON_ADD_INS, children: /* @__PURE__ */ jsx(AccountAuthContext.Provider, { value: accountAuth, children: /* @__PURE__ */ jsx(Rendering3DFlagsContext.Provider, { value: effective3D, children: /* @__PURE__ */ jsx(ViewerThemeProvider, { theme: effectiveTheme, children: /* @__PURE__ */ jsxs(
35788
35710
  CollaborationProvider,
35789
35711
  {
35790
35712
  config: collaboration,
@@ -35837,7 +35759,7 @@ ${url}`)
35837
35759
  /* @__PURE__ */ jsx(ShapeFormatContext.Provider, { value: shapeFormat, children: /* @__PURE__ */ jsx(RibbonGalleryCommandsContext.Provider, { value: ribbonGalleries, children: viewerContent }) })
35838
35760
  ]
35839
35761
  }
35840
- ) }) }) }) }) }) })
35762
+ ) }) }) }) }) }) }) })
35841
35763
  );
35842
35764
  }
35843
35765
  );