pptx-react-viewer 4.16.0 → 4.17.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 (134) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/{AiChatPanel-5Z4BYP7S.mjs → AiChatPanel-2VX4EF2E.mjs} +4 -4
  3. package/dist/AiChatPanel-2VX4EF2E.mjs.br +0 -0
  4. package/dist/AiChatPanel-2VX4EF2E.mjs.gz +0 -0
  5. package/dist/{AiChatPanel-DHLJ6LKF.js → AiChatPanel-BVWU7HDV.js} +28 -28
  6. package/dist/AiChatPanel-BVWU7HDV.js.br +0 -0
  7. package/dist/AiChatPanel-BVWU7HDV.js.gz +0 -0
  8. package/dist/{Model3DScene-AXT5KCUX.js → Model3DScene-6FW74F37.js} +2 -2
  9. package/dist/Model3DScene-6FW74F37.js.br +0 -0
  10. package/dist/Model3DScene-6FW74F37.js.gz +0 -0
  11. package/dist/{Model3DScene-N36X5Z2Z.mjs → Model3DScene-PR3MSU7A.mjs} +1 -1
  12. package/dist/Model3DScene-PR3MSU7A.mjs.br +2 -0
  13. package/dist/Model3DScene-PR3MSU7A.mjs.gz +0 -0
  14. package/dist/{chunk-BZNYI5U6.js → chunk-7KKE5JM3.js} +875 -826
  15. package/dist/chunk-7KKE5JM3.js.br +0 -0
  16. package/dist/chunk-7KKE5JM3.js.gz +0 -0
  17. package/dist/{chunk-XZUIS3VB.js → chunk-A56VH5AT.js} +9012 -4299
  18. package/dist/chunk-A56VH5AT.js.br +0 -0
  19. package/dist/chunk-A56VH5AT.js.gz +0 -0
  20. package/dist/{chunk-QLUA63T3.mjs → chunk-AC4V4C43.mjs} +59 -10
  21. package/dist/chunk-AC4V4C43.mjs.br +0 -0
  22. package/dist/chunk-AC4V4C43.mjs.gz +0 -0
  23. package/dist/{chunk-MFGRRONU.mjs → chunk-CRHNHNQL.mjs} +2 -2
  24. package/dist/chunk-CRHNHNQL.mjs.br +0 -0
  25. package/dist/chunk-CRHNHNQL.mjs.gz +0 -0
  26. package/dist/{chunk-CJSIEITL.mjs → chunk-GLLEZR4U.mjs} +11 -0
  27. package/dist/chunk-GLLEZR4U.mjs.br +0 -0
  28. package/dist/{chunk-CJSIEITL.mjs.gz → chunk-GLLEZR4U.mjs.gz} +0 -0
  29. package/dist/{chunk-FVLBN45Z.js → chunk-N5EJL7SU.js} +5 -5
  30. package/dist/chunk-N5EJL7SU.js.br +0 -0
  31. package/dist/chunk-N5EJL7SU.js.gz +0 -0
  32. package/dist/{chunk-MJ6LTUJ3.mjs → chunk-NMYQ4XT2.mjs} +8987 -4277
  33. package/dist/chunk-NMYQ4XT2.mjs.br +0 -0
  34. package/dist/chunk-NMYQ4XT2.mjs.gz +0 -0
  35. package/dist/{chunk-WRQ7K3DG.mjs → chunk-PU6X5LPR.mjs} +1 -1
  36. package/dist/chunk-PU6X5LPR.mjs.br +0 -0
  37. package/dist/chunk-PU6X5LPR.mjs.gz +0 -0
  38. package/dist/{chunk-XEYB25ZT.js → chunk-QWQADOJZ.js} +11 -0
  39. package/dist/chunk-QWQADOJZ.js.br +0 -0
  40. package/dist/{chunk-XEYB25ZT.js.gz → chunk-QWQADOJZ.js.gz} +0 -0
  41. package/dist/{chunk-UVK2WBCU.js → chunk-UN4FCEZI.js} +2824 -4327
  42. package/dist/chunk-UN4FCEZI.js.br +0 -0
  43. package/dist/chunk-UN4FCEZI.js.gz +0 -0
  44. package/dist/{chunk-QAVJDYB2.js → chunk-XUT6KCC4.js} +197 -197
  45. package/dist/chunk-XUT6KCC4.js.br +0 -0
  46. package/dist/chunk-XUT6KCC4.js.gz +0 -0
  47. package/dist/{chunk-BTTAYCGK.mjs → chunk-Y5JCGX5P.mjs} +872 -2375
  48. package/dist/chunk-Y5JCGX5P.mjs.br +0 -0
  49. package/dist/chunk-Y5JCGX5P.mjs.gz +0 -0
  50. package/dist/i18n/de.cjs +12 -1
  51. package/dist/i18n/de.cjs.br +0 -0
  52. package/dist/i18n/de.cjs.gz +0 -0
  53. package/dist/i18n/de.mjs +12 -1
  54. package/dist/i18n/de.mjs.br +0 -0
  55. package/dist/i18n/de.mjs.gz +0 -0
  56. package/dist/i18n/es.cjs +12 -1
  57. package/dist/i18n/es.cjs.br +0 -0
  58. package/dist/i18n/es.cjs.gz +0 -0
  59. package/dist/i18n/es.mjs +12 -1
  60. package/dist/i18n/es.mjs.br +0 -0
  61. package/dist/i18n/es.mjs.gz +0 -0
  62. package/dist/i18n/fr.cjs +12 -1
  63. package/dist/i18n/fr.cjs.br +0 -0
  64. package/dist/i18n/fr.cjs.gz +0 -0
  65. package/dist/i18n/fr.mjs +12 -1
  66. package/dist/i18n/fr.mjs.br +0 -0
  67. package/dist/i18n/fr.mjs.gz +0 -0
  68. package/dist/i18n/zh-CN.cjs +12 -1
  69. package/dist/i18n/zh-CN.cjs.br +0 -0
  70. package/dist/i18n/zh-CN.cjs.gz +0 -0
  71. package/dist/i18n/zh-CN.mjs +12 -1
  72. package/dist/i18n/zh-CN.mjs.br +0 -0
  73. package/dist/i18n/zh-CN.mjs.gz +0 -0
  74. package/dist/i18n.js +4 -4
  75. package/dist/i18n.js.br +0 -0
  76. package/dist/i18n.js.gz +0 -0
  77. package/dist/i18n.mjs +1 -1
  78. package/dist/i18n.mjs.br +0 -0
  79. package/dist/i18n.mjs.gz +0 -0
  80. package/dist/index.d.ts +260 -12185
  81. package/dist/index.js +63 -63
  82. package/dist/index.js.br +0 -0
  83. package/dist/index.js.gz +0 -0
  84. package/dist/index.mjs +6 -6
  85. package/dist/index.mjs.br +0 -0
  86. package/dist/index.mjs.gz +0 -0
  87. package/dist/internals.d.ts +264 -12196
  88. package/dist/internals.js +105 -105
  89. package/dist/internals.js.br +0 -0
  90. package/dist/internals.js.gz +0 -0
  91. package/dist/internals.mjs +4 -4
  92. package/dist/internals.mjs.br +0 -0
  93. package/dist/internals.mjs.gz +0 -0
  94. package/dist/pptx-viewer.css +1 -1
  95. package/dist/pptx-viewer.css.br +0 -0
  96. package/dist/pptx-viewer.css.gz +0 -0
  97. package/dist/viewer/index.d.ts +258 -12183
  98. package/dist/viewer/index.js +27 -27
  99. package/dist/viewer/index.js.br +0 -0
  100. package/dist/viewer/index.js.gz +0 -0
  101. package/dist/viewer/index.mjs +6 -6
  102. package/dist/viewer/index.mjs.br +0 -0
  103. package/dist/viewer/index.mjs.gz +0 -0
  104. package/package.json +1 -1
  105. package/dist/AiChatPanel-5Z4BYP7S.mjs.br +0 -0
  106. package/dist/AiChatPanel-5Z4BYP7S.mjs.gz +0 -0
  107. package/dist/AiChatPanel-DHLJ6LKF.js.br +0 -0
  108. package/dist/AiChatPanel-DHLJ6LKF.js.gz +0 -0
  109. package/dist/Model3DScene-AXT5KCUX.js.br +0 -0
  110. package/dist/Model3DScene-AXT5KCUX.js.gz +0 -0
  111. package/dist/Model3DScene-N36X5Z2Z.mjs.br +0 -0
  112. package/dist/Model3DScene-N36X5Z2Z.mjs.gz +0 -0
  113. package/dist/chunk-BTTAYCGK.mjs.br +0 -0
  114. package/dist/chunk-BTTAYCGK.mjs.gz +0 -0
  115. package/dist/chunk-BZNYI5U6.js.br +0 -0
  116. package/dist/chunk-BZNYI5U6.js.gz +0 -0
  117. package/dist/chunk-CJSIEITL.mjs.br +0 -0
  118. package/dist/chunk-FVLBN45Z.js.br +0 -0
  119. package/dist/chunk-FVLBN45Z.js.gz +0 -0
  120. package/dist/chunk-MFGRRONU.mjs.br +0 -0
  121. package/dist/chunk-MFGRRONU.mjs.gz +0 -0
  122. package/dist/chunk-MJ6LTUJ3.mjs.br +0 -0
  123. package/dist/chunk-MJ6LTUJ3.mjs.gz +0 -0
  124. package/dist/chunk-QAVJDYB2.js.br +0 -0
  125. package/dist/chunk-QAVJDYB2.js.gz +0 -0
  126. package/dist/chunk-QLUA63T3.mjs.br +0 -0
  127. package/dist/chunk-QLUA63T3.mjs.gz +0 -0
  128. package/dist/chunk-UVK2WBCU.js.br +0 -0
  129. package/dist/chunk-UVK2WBCU.js.gz +0 -0
  130. package/dist/chunk-WRQ7K3DG.mjs.br +0 -0
  131. package/dist/chunk-WRQ7K3DG.mjs.gz +0 -0
  132. package/dist/chunk-XEYB25ZT.js.br +0 -0
  133. package/dist/chunk-XZUIS3VB.js.br +0 -0
  134. package/dist/chunk-XZUIS3VB.js.gz +0 -0
@@ -1,12 +1,12 @@
1
- import { computeFocusTargets, deckDataFieldChanged, aiChangeAnimationCss, changeGhostStyle, createChatHistoryStore, collectStoredChats, exportAiChatLogs, applyElementUpdate } from './chunk-WRQ7K3DG.mjs';
2
- 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, ChartPartSelectionProvider, useToolbarVisibility, useKeyboardInsets, useModalDismissDrag, ViewerOptionsStoreContext, ViewerOptionsContext, useViewerOptionsContext, useVirtualizedSlides, useSwipeNavigation, PresentationTransitionOverlay, RemoteSelectionOverlay, CollaborationCursorOverlay, useSheetDismissDrag, detectTargetType, parseEmailUrl, parseSlideFromUrl, ACTION_VERB_MAP, ElementRenderer, InlineCollaborationContext, SmartArtRenderer, playAnimationSound, ResizeHandles, imgSrc, renderStrokeView, useChartPartSelection, resolveSmartArtDataPalette } from './chunk-QLUA63T3.mjs';
3
- import { SHAPE_PRESETS, ANIMATION_PRESET_OPTIONS, cn, SLIDE_NAV_THUMBNAIL_WIDTH, DEFAULT_SECTION_GROUP_ID, SHORTCUT_REFERENCE_ITEMS as SHORTCUT_REFERENCE_ITEMS$1, TOOLBAR_SECTIONS, isConnectorOrLineElement, GRID_SIZE, MIN_ELEMENT_SIZE, CONNECTOR_ARROW_OPTIONS, ARROW_SIZE_OPTIONS, DEFAULT_FILL_COLOR, startMotionPathPreview, startPreviewAnimation, stopPreviewAnimation, DEFAULT_STROKE_COLOR, STROKE_DASH_OPTIONS } from './chunk-MFGRRONU.mjs';
4
- import { FIXED_TAB_GALLERIES, EMPTY_RESOLVED_CUSTOMIZATION, ANIMATION_DIRECTION_LABEL_KEYS, SWITCHABLE_LAYOUT_TYPES, compileEquationTemplateMathMl, buildUserFontFaceStyles, readStoredViewerPrefs, resolveThemeCatalogEntry, THEME_CATALOG, writeStoredViewerPrefs, openPptxFile, readBackstageRecentFile, isFeatureEnabled, isDialogAvailable, resolveAutosaveActivation, buildThemeColorMap, viewerOptionsToPreferences, applyPreferenceToOptions, resolveHistoryDepth, applyAutoCorrect, resolveImageResolutionScale, resolveAutosaveIntervalMs, resolveAutosaveIntervalSeconds, isPanelVisible, shouldShowAutosaveRecoveryPrompt, resolveOptionRootClasses, RIBBON_SCOPE_ATTR, resolve3DRenderingFlags, resolveSlideSizeSelection, RULER_THICKNESS, RULER_FONT_SIZE, editorThumbnailHeight, buildPreviewElements, deriveSlideFieldContext, SLIDE_TRANSITION_OPTIONS, hiddenSlideCue, EDITOR_THUMBNAIL_WIDTH, HIDDEN_SLIDE_SLASH_GRADIENT, HIDDEN_SLIDE_LABEL_KEY, visibleTemplateElements, normalizeHexColor, themeToCssVars, createCustomizationController, resolveEffectiveHiddenActions, listAutosaveSnapshots, resolveExpiredAutosaveSnapshots, deleteAutosaveSnapshot, masterViewCrudActions, applyMasterViewCrudAction, masterViewCrudFailureKey, EDITOR_CHROME_CSS, ribbonCustomizationCss, applyMotionPathPreset, resetSlideLayoutPath, DEFAULT_INSERT_CHART_KIND, hasCopyableFormat, templateSchemeFromTheme, createBackstagePresentation, playFeedbackSound, shouldDiscardAutosaveOnSuccessfulSave, setMasterViewBackgroundColor, canUseClipboard, runProgramNoticeStackStyle, compatToastStackStyle, printPropertiesFrameSlides, printPropertiesSlidesPerPage, PASTE_SPECIAL_OPTIONS, 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, filterCommands, resolveTitleBarStatusKey, TITLE_BAR_CLASSES, TITLE_BAR_DEFAULT_FILE_KEY, editorThumbnailWidth, masterViewBackgroundColor, buildFieldSubstitutionContext, shouldConfirmExternalHyperlink, safeOpenUrl, resolvePresentationAction, isPpactionUrl, parsePpactionUrl, isPresentationAdvanceClick, toggleBlackboard, PRESENT_TOOLBAR_CLASSES, resolveEditPointsAvailability, isCurrentLayout, themeColorSchemesEqual, observeElementHeight, EXPANDED_MAX_HEIGHT, STATUS_BAR_CLASSES, buildBarActions, formatVersionTimestamp, formatRelativeTime, scanAvailableFontFamilies, PRESETS, CATEGORIES, convertOmmlToLatex, compileLatexEquation, convertLatexToOmml, EQUATION_TEMPLATES, clampPercent2, resolveDefaultPrintSettings, HANDOUT_OPTIONS, TOOLBAR_TABS, SHORTCUT_REFERENCE_ITEMS, resolveViewerAddinRows, availableQuickAccessCommands, addQuickAccessCommand, removeQuickAccessCommand, moveQuickAccessCommand, CUSTOM_FONT_ACCEPT, activateModalFocus, buildCollaborationShareUrl, buildActiveSessionUsers, SORTER_MIN_ZOOM, SORTER_ZOOM_STEP, SORTER_MAX_ZOOM, canGoPrevious, formatSlideCounter, READING_VIEW_COUNTER_ATTR, canGoNext, READING_VIEW_ATTR, 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, extraQuickAccessCommands, visibleContextualTabs, resolveActiveRibbonTab, resolveScreenTip, contextualTabLabelKey, RIBBON_CONTEXTUAL_TAB_ATTR, TAB_ROW_ACTION_CLASSES, customizeBackstageNav, BACKSTAGE_NAV, listBackstageRecentFiles, BACKSTAGE_BACK_CLASSES, BACKSTAGE_NAV_CLASSES, hasTextProperties, textFontSizePtToPx, INSERT_CHART_TYPES, ACTION_BUTTON_PRESETS, hasShapeProperties, shapeFillChange, shapeOutlineChange, CONTEXTUAL_TAB_GROUPS, editorThumbnailStep, resolveSlidePaneClick, SLIDE_VIRTUALIZATION_THRESHOLD, buildSlidePaneContextMenuEntries, isEditPointsEnabled, PRESENTATION_HIT_TEST_CSS, PRESENTATION_STAGE_ATTRIBUTE, buildStrokePathD, cursorForTool, annotationOverlayZIndex, presentationInkPath, resolveNotesSchematicBodyFontSizePx, PRESENTER_NAVIGATOR_LABEL_KEYS, subtitleRecognitionLanguage, subtitleSettingsFromOptions, getSpeechRecognitionCtor, mergeCaptionResults, PEN_COLORS, HIGHLIGHTER_COLORS, isBlackboardActive, customizeContextMenuEntries, buildContextMenuEntries, customizeCanvasContextMenuEntries, buildCanvasContextMenuEntries, buildLayoutPreviewGeometry, scaleSlidesForSizeChange, slideSizeToCanvasPx, resolveSelectionPaneRename, themeEditorLabels, resolveNotesSegments, segmentsToEditorHtml, DEBOUNCE_MS, createPlainNotesSegments, parseSegmentsFromRichEditor, segmentsToPlainText, getCurrentParagraphIndex, segmentsToParagraphs, paragraphsToSegments, MAX_INDENT_LEVEL, INDENT_PX, isUrlSafe, buildNotesPrintHtml, MIN_TOUCH_TARGET_PX, toggleSheet, SMARTART_PREVIEW_ELEMENT_HEIGHT, SMARTART_PREVIEW_ELEMENT_WIDTH, buildSmartArtPreviewElement, sanitizeMathMl, computeHandoutLayout, getPrintableArea, generateNoteLineCount, computeAllNotesPages, getNotesPrintableArea, downloadBlob, clampOptionNumber, QUICK_ACCESS_COMMAND_CATALOG, registerCustomFont, openReadingView, applyReadingViewCommand, createPresentationKeyBuffer, readingViewFitScale, READING_VIEW_STAGE_ATTR, buildOutline, applyOutlineEdit, mapOutlineKey, notesSegmentsToSpans, erasePresentationInkAt, movePresenterPointer, appendPresentationInkPoint, PRESENTER_CONSOLE_CONTROLS, 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, resolveDefaultFontFamily, textFontSizePxToPt, buildFontCatalog, COMMON_FONT_SIZES, RIBBON_CONTROL_ATTR, FREEFORM_TOOL_IDS, isDrawingToolVisible, FREEFORM_TOOL_LABEL_KEYS, getSelectionTextStyleFlags, getInlineEditorSelectionResult, selectedParagraphBulletKind, elementBulletKind, selectionBulletKind, TEXT_DECORATION_FLAGS, nextToggleValue, CHARACTER_SPACING_OPTIONS, OFFICE_COLOR_SWATCHES, RIBBON_GROUP_ATTR, RIBBON_SHAPE_SWATCHES, buildRibbonGallery, galleryHasItems, inlineGalleryItems, canGroupSelection, canUngroupSelection, canSetStrokeWidth, strokeWidthOf, readRibbonTransitionDraft, ribbonTransitionUpdates, playSlideTransitionPreview, RIBBON_TRANSITION_PRESETS, transitionSoundOptions, transitionSoundSelectedValue, DEFAULT_MOTION_PATH_PRESET_ID, SLIDE_SHOW_COMMAND_GROUPS, RECORD_COMMAND_GROUPS, HELP_RIBBON_COMMANDS, masterViewPseudoSlide, PRESENTATION_ANIM_TRIGGER_ATTRIBUTE, motionPathFor, setMotionPath, getShapeAdjustmentHandleDescriptors, shouldShowElementHandles, clampFlyoutPosition, computeAnchoredPopupPosition, applyTableStyleDelete, applyTableStyleMapChange, handleReadingViewKey, getLocalStorageUsageSummary, saveViewerProfile, clearAllLocalViewerData, SLIDE_TEMPLATES, buildThemeColorSwatchGrid, themeColorSwatchRows, findSelectedThemeSwatch, themeSwatchCommit, RIBBON_GALLERY_POPUP_ATTR, applyRibbonGalleryItem, galleryItemLabel, RIBBON_GALLERY_ITEM_ATTR, RIBBON_GALLERY_ATTR, MERGE_SHAPES_LABEL_KEY, MERGE_SHAPES_HINT_KEY, MERGE_SHAPES_MENU_ITEMS, CROP_LABEL_KEY, CROP_ASPECT_LABEL_KEY, CROP_ASPECT_GROUP_LABEL_KEYS, CROP_ASPECT_PRESETS, CROP_FILL_LABEL_KEY, CROP_FIT_LABEL_KEY, readSoundFileAsDataUrl, applyTransitionSoundFile, TRANSITION_SOUND_OTHER_VALUE, TRANSITION_SOUND_NONE_VALUE, clearTransitionSound, applyTransitionStockSound, transitionStockSoundId, getEffectSoundAsset, playAnimationRibbonPreview, ENTRANCE_PRESET_VALUES, EMPHASIS_PRESET_VALUES, EXIT_PRESET_VALUES, MOTION_PATH_FAMILIES, motionPathFamilyLabelKey, motionPathPresetsByFamily, motionPathPresetLabelKey, SLIDE_SHOW_OPTIONS, createViewerOptionsStore, subtitleSettingsLabels, attachEditorImagePaste, authorConnectorBetweenSites, findEraserHitElementId, generateTicks, rulerDragToGuidePosition, resolveElementInteractivity, getElementTransformWithoutRotation, getElementTransform, 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, hasMultipleSelectedTableCells, isElementLocked, isImageLikeElement, mergeSlideTransition, getElementLabel, effectiveDirection, TRIGGER_OPTIONS, effectiveTimingCurve, 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, TABLE_STYLE_PRESETS, applyTableStylePreset, tableStyleAssignmentUpdate, evenColumnWidths, redistributeColumnWidth, evenRowHeights, patchChartData, collapseChartTitleRunsForEdit, chartGridlinesState, chartGridlinesPatch, seriesSecondaryAxisPatch, setChartCategoryLabel, setChartCellValue, addChartCategory, removeChartCategory, addChartSeries, removeChartSeries, setDataLabelsRangeCache, setChartAxisLogScale, setChartAxisTitleStyle, setChartAxisGridlineStyle, setChartSeriesMarker, setChartSeriesChartType, setChartDataPointFill, setChartDataPointExplosion, setChartDataPointMarker, setChartDataPointLabel, describeSmartArtBounds, canAddTopLevelNode, classifyExtraConnections, siblingIndex, siblingCount, canRemoveTopLevelNode, canInteractWithElement, buildOleObjectNamePatch, getOleObjectTypeLabel, sanitizeGradientStops, shouldShowAccessibilitySection, pptxActionToElementAction, withFrameSlides, withSlidesPerPage, THEME_COLOR_SCHEME_KEYS, applyThemeOverrideToSlide, COLOR_MAP_ALIAS_KEYS, DEFAULT_COLOR_MAP, schemaLabel, THEME_COLOR_SLOT_LABEL_KEYS, SLIDE_SIZE_PRESETS, TRANSITION_VALID_DIRECTIONS, TRANSITION_ORIENTATION_TYPES, TRANSITION_PATTERN_OPTIONS, TRANSITION_THRUBLK_TYPES, clampTransitionNumber, TRANSITION_SPEED_OPTIONS, TRANSITION_MORPH_OPTIONS, flattenTagCollections, resolveTemplateBackgroundRows, formatCommentTimestamp, commentMentionQuery, matchCommentMentionAuthors, buildAnimationTimelineRows, clearMotionPath, setTrigger, setTriggerBookmark, getEffectSoundState, setEffectSound, setEffectStockSound, setAfterAnimation, setAfterAnimationColor, directionValuesFor, buildAnimationTimelineBars, motionPathPresetIdForPath, EFFECT_SOUND_CATALOGUE, listMediaBookmarkOptions, selectedBookmarkOptionValue, hasTiltData, toElementAxes, dragCropHandle, panCropImage, clientToSlidePoint, EDIT_POINTS_TARGET_ATTR, normalizeTableStyleGuid, describeTableStyleEditor, TABLE_STYLE_EDITOR_PARTS, computeMergeCellRight, computeMergeCellDown, computeSplitCell, updateMergeAttrsInRawXml, resolveDisplayedChartType, CHART_TYPE_OPTIONS, chartDataLabelsTogglePatch, BAR3D_SHAPE_OPTIONS, bar3DShapePatch, RADAR_STYLE_OPTIONS, radarStylePatch, SURFACE_WIREFRAME_OPTIONS, surfaceWireframePatch, isSeriesUsingSecondaryAxis, listChartUserShapeRows, withChartUserShapeAdded, createDefaultChartUserShape, withChartUserShapeRowRemoved, withChartUserShapeRowTextUpdated, SMARTART_COLOR_SCHEME_LABEL_KEYS, SMARTART_STYLE_LABEL_KEYS, addSmartArtNodeAsChild, setSmartArtNodeStyle, removeSmartArtNode, addSiblingAfter, removeEmptyNode, demote, promote, updateSmartArtNodeText, reorder, clampCropValue, DUOTONE_PRESETS, ARTISTIC_EFFECTS, mediaTrimEndSeconds, trimmedMediaDurationMs, mediaTrimEndAbsoluteMs, mediaTrimEndMsFromAbsoluteMs, buildOleEditDialogDescriptor, buildOleContentUpdatePatch, applyOleSheetCellEdit, getOleSheetGrid, applyOleDocumentParagraphEdit, getOleDocumentParagraphs, applyOleNestedDeckElementTextEdit, getOleNestedDeckDetail, replaceOleFile, getNonVisualDescriptionFields, resolveActionType, ELEMENT_ACTION_TYPE_OPTIONS, elementActionToPptxAction, canCommitActionType, slideSizeFromPreset, withSlideSizeOrientation, TRANSITION_DIR_ARROWS, buildDirectionGrid, getSlideTransitionAnimations, SLIDE_TRANSITION_KEYFRAMES, updateTagInCollections, deleteTagFromCollections, addTagToCollections, commentTextSegments, COMMENT_MENTION_CLASS, COMMENT_MENTION_ATTRIBUTE, insertCommentMention, reorderAnimationTimelineRows, applyAnimationTimelineOrder, animationEffectLabel, overlayPointerInput, TABLE_STYLE_BORDER_SIDES, applyTableStyleFieldEdit, createTableStyleEntry, addTableStyleToMap, deleteTableStyleFromMap, LBL, SEL, FILL_MODE_OPTIONS, SECTION_HEADING, NUM, getChartUserShapeGroupTransform, withChartUserShapeGroupChildAdded, createDefaultChartUserShapeGroupChild, withChartUserShapeRowUpdated, getChartUserShapeRowChartBox, withChartUserShapeRowFlipUpdated, withChartUserShapeRowRotationUpdated, withChartUserShapeRowChartBoxUpdated, switchSmartArtLayout, rebuildDrawingShapesIfCleared, mediaTrimEndMsFromSeconds, validateMediaTrimRange, SHAPE_QUICK_STYLES, quickStyleSwatchCss, PATTERN_PRESET_OPTIONS, getPatternSvg, COMPOUND_LINE_OPTIONS, LINE_JOIN_OPTIONS, LINE_CAP_OPTIONS, TEXT_WARP_PRESETS, warpPreviewPath, text3dPtToEmu, text3dEmuToPt, MATERIAL_PRESETS, toSlideIndex, TABLE_STYLE_BORDER_SIDE_LABEL_KEYS, TABLE_STYLE_DASH_PRESETS, GRADIENT_TYPE_OPTIONS, PATTERN_OPTIONS, FILL_PATTERN_LABEL_KEYS, openNativeEyeDropper, toggleText3dExtrusion, BEVEL_PRESETS, cropFit, cropFill, cropToAspectRatio } from './chunk-MJ6LTUJ3.mjs';
5
- import { LOCALE_CATALOG, ALIGNMENT_LABEL_KEYS } from './chunk-CJSIEITL.mjs';
6
- import React6, { createContext, lazy, forwardRef, useEffect, useState, useCallback, useMemo, useRef, useLayoutEffect, useSyncExternalStore, useId, useContext, useDeferredValue, Fragment as Fragment$1, Suspense, useReducer } from 'react';
1
+ import { computeFocusTargets, deckDataFieldChanged, aiChangeAnimationCss, changeGhostStyle, createChatHistoryStore, collectStoredChats, exportAiChatLogs, applyElementUpdate } from './chunk-PU6X5LPR.mjs';
2
+ 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, ChartPartSelectionProvider, useToolbarVisibility, useKeyboardInsets, useModalDismissDrag, ViewerOptionsStoreContext, ViewerOptionsContext, useViewerOptionsContext, useVirtualizedSlides, useSwipeNavigation, PresentationTransitionOverlay, RemoteSelectionOverlay, CollaborationCursorOverlay, useSheetDismissDrag, detectTargetType, parseEmailUrl, parseSlideFromUrl, ACTION_VERB_MAP, ElementRenderer, InlineCollaborationContext, SmartArtRenderer, playAnimationSound, ResizeHandles, imgSrc, renderStrokeView, useChartPartSelection, resolveSmartArtDataPalette } from './chunk-AC4V4C43.mjs';
3
+ import { SHAPE_PRESETS, ANIMATION_PRESET_OPTIONS, cn, SLIDE_NAV_THUMBNAIL_WIDTH, DEFAULT_SECTION_GROUP_ID, SHORTCUT_REFERENCE_ITEMS as SHORTCUT_REFERENCE_ITEMS$1, TOOLBAR_SECTIONS, isConnectorOrLineElement, GRID_SIZE, MIN_ELEMENT_SIZE, CONNECTOR_ARROW_OPTIONS, ARROW_SIZE_OPTIONS, DEFAULT_FILL_COLOR, startMotionPathPreview, startPreviewAnimation, stopPreviewAnimation, DEFAULT_STROKE_COLOR, STROKE_DASH_OPTIONS } from './chunk-CRHNHNQL.mjs';
4
+ import { EMPTY_RESOLVED_CUSTOMIZATION, FIXED_TAB_GALLERIES, editingHomeControls, ANIMATION_DIRECTION_LABEL_KEYS, SWITCHABLE_LAYOUT_TYPES, compileEquationTemplateMathMl, buildUserFontFaceStyles, readStoredViewerPrefs, resolveThemeCatalogEntry, THEME_CATALOG, writeStoredViewerPrefs, openPptxFile, readBackstageRecentFile, isFeatureEnabled, isDialogAvailable, resolveAutosaveActivation, buildThemeColorMap, viewerOptionsToPreferences, applyPreferenceToOptions, resolveHistoryDepth, applyAutoCorrect, resolveImageResolutionScale, resolveAutosaveIntervalMs, resolveAutosaveIntervalSeconds, isPanelVisible, shouldShowAutosaveRecoveryPrompt, resolveOptionRootClasses, RIBBON_SCOPE_ATTR, resolve3DRenderingFlags, resolveSlideSizeSelection, RULER_THICKNESS, RULER_FONT_SIZE, editorThumbnailHeight, buildPreviewElements, deriveSlideFieldContext, SLIDE_TRANSITION_OPTIONS, hiddenSlideCue, EDITOR_THUMBNAIL_WIDTH, HIDDEN_SLIDE_SLASH_GRADIENT, HIDDEN_SLIDE_LABEL_KEY, visibleTemplateElements, normalizeHexColor, themeToCssVars, createCustomizationController, resolveEffectiveHiddenActions, listAutosaveSnapshots, resolveExpiredAutosaveSnapshots, deleteAutosaveSnapshot, masterViewCrudActions, applyMasterViewCrudAction, masterViewCrudFailureKey, EDITOR_CHROME_CSS, ribbonCustomizationCss, applyMotionPathPreset, resetSlideLayoutPath, DEFAULT_INSERT_CHART_KIND, hasCopyableFormat, templateSchemeFromTheme, createBackstagePresentation, playFeedbackSound, shouldDiscardAutosaveOnSuccessfulSave, setMasterViewBackgroundColor, canUseClipboard, runProgramNoticeStackStyle, compatToastStackStyle, printPropertiesFrameSlides, printPropertiesSlidesPerPage, PASTE_SPECIAL_OPTIONS, 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, filterCommands, resolveTitleBarStatusKey, TITLE_BAR_CLASSES, TITLE_BAR_DEFAULT_FILE_KEY, editorThumbnailWidth, masterViewBackgroundColor, buildFieldSubstitutionContext, shouldConfirmExternalHyperlink, safeOpenUrl, resolvePresentationAction, isPpactionUrl, parsePpactionUrl, isPresentationAdvanceClick, toggleBlackboard, PRESENT_TOOLBAR_CLASSES, resolveEditPointsAvailability, isCurrentLayout, themeColorSchemesEqual, observeElementHeight, EXPANDED_MAX_HEIGHT, STATUS_BAR_CLASSES, buildBarActions, formatVersionTimestamp, formatRelativeTime, scanAvailableFontFamilies, PRESETS, CATEGORIES, convertOmmlToLatex, compileLatexEquation, convertLatexToOmml, EQUATION_TEMPLATES, clampPercent2, resolveDefaultPrintSettings, HANDOUT_OPTIONS, TOOLBAR_TABS, SHORTCUT_REFERENCE_ITEMS, resolveViewerAddinRows, availableQuickAccessCommands, addQuickAccessCommand, removeQuickAccessCommand, moveQuickAccessCommand, CUSTOM_FONT_ACCEPT, activateModalFocus, buildCollaborationShareUrl, buildActiveSessionUsers, SORTER_MIN_ZOOM, SORTER_ZOOM_STEP, SORTER_MAX_ZOOM, canGoPrevious, formatSlideCounter, READING_VIEW_COUNTER_ATTR, canGoNext, READING_VIEW_ATTR, 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, extraQuickAccessCommands, visibleContextualTabs, resolveActiveRibbonTab, resolveScreenTip, contextualTabLabelKey, RIBBON_CONTEXTUAL_TAB_ATTR, TAB_ROW_ACTION_CLASSES, customizeBackstageNav, BACKSTAGE_NAV, listBackstageRecentFiles, BACKSTAGE_BACK_CLASSES, BACKSTAGE_NAV_CLASSES, hasTextProperties, textFontSizePtToPx, FREEFORM_TOOL_IDS, isDrawingToolVisible, hasShapeProperties, shapeFillChange, shapeOutlineChange, DESIGN_RIBBON_GROUPS, DESIGN_RIBBON_COMMANDS, designCommandState, CONTEXTUAL_TAB_GROUPS, editorThumbnailStep, resolveSlidePaneClick, SLIDE_VIRTUALIZATION_THRESHOLD, buildSlidePaneContextMenuEntries, isEditPointsEnabled, PRESENTATION_HIT_TEST_CSS, PRESENTATION_STAGE_ATTRIBUTE, buildStrokePathD, cursorForTool, annotationOverlayZIndex, presentationInkPath, resolveNotesSchematicBodyFontSizePx, PRESENTER_NAVIGATOR_LABEL_KEYS, subtitleRecognitionLanguage, subtitleSettingsFromOptions, getSpeechRecognitionCtor, mergeCaptionResults, PEN_COLORS, HIGHLIGHTER_COLORS, isBlackboardActive, customizeContextMenuEntries, buildContextMenuEntries, customizeCanvasContextMenuEntries, buildCanvasContextMenuEntries, buildLayoutPreviewGeometry, scaleSlidesForSizeChange, slideSizeToCanvasPx, resolveSelectionPaneRename, themeEditorLabels, resolveNotesSegments, segmentsToEditorHtml, DEBOUNCE_MS, createPlainNotesSegments, parseSegmentsFromRichEditor, segmentsToPlainText, getCurrentParagraphIndex, segmentsToParagraphs, paragraphsToSegments, MAX_INDENT_LEVEL, INDENT_PX, isUrlSafe, buildNotesPrintHtml, MIN_TOUCH_TARGET_PX, toggleSheet, SMARTART_PREVIEW_ELEMENT_HEIGHT, SMARTART_PREVIEW_ELEMENT_WIDTH, buildSmartArtPreviewElement, sanitizeMathMl, computeHandoutLayout, getPrintableArea, generateNoteLineCount, computeAllNotesPages, getNotesPrintableArea, downloadBlob, clampOptionNumber, QUICK_ACCESS_COMMAND_CATALOG, registerCustomFont, openReadingView, applyReadingViewCommand, createPresentationKeyBuffer, readingViewFitScale, READING_VIEW_STAGE_ATTR, buildOutline, applyOutlineEdit, mapOutlineKey, notesSegmentsToSpans, erasePresentationInkAt, movePresenterPointer, appendPresentationInkPoint, PRESENTER_CONSOLE_CONTROLS, 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, resolveDefaultFontFamily, textFontSizePxToPt, clipboardHomeControls, buildFontCatalog, COMMON_FONT_SIZES, getInlineEditorSelectionResult, selectedParagraphBulletKind, elementBulletKind, selectionBulletKind, fontHomeControls, nextToggleValue, CHARACTER_SPACING_OPTIONS, OFFICE_COLOR_SWATCHES, RIBBON_GROUP_ATTR, paragraphHomeAlign, paragraphHomeControls, paragraphHomeAction, RIBBON_CONTROL_ATTR, RIBBON_SHAPE_SWATCHES, buildRibbonGallery, canGroupSelection, canUngroupSelection, canSetStrokeWidth, strokeWidthOf, readRibbonTransitionDraft, SLIDE_SHOW_COMMAND_GROUPS, RECORD_COMMAND_GROUPS, buildReviewRibbon, HELP_RIBBON_COMMANDS, galleryTextLabel, masterViewPseudoSlide, PRESENTATION_ANIM_TRIGGER_ATTRIBUTE, parentSelection, slideSpaceElement, isGroupMember, motionPathFor, setMotionPath, getShapeAdjustmentHandleDescriptors, shouldShowElementHandles, clampFlyoutPosition, computeAnchoredPopupPosition, applyTableStyleDelete, applyTableStyleMapChange, handleReadingViewKey, getLocalStorageUsageSummary, saveViewerProfile, clearAllLocalViewerData, SLIDE_TEMPLATES, getSelectionTextStyleFlags, TEXT_DECORATION_FLAGS, buildThemeColorSwatchGrid, themeColorSwatchRows, findSelectedThemeSwatch, themeSwatchCommit, applyRibbonGalleryItem, MERGE_SHAPES_LABEL_KEY, MERGE_SHAPES_HINT_KEY, MERGE_SHAPES_MENU_ITEMS, CROP_LABEL_KEY, CROP_ASPECT_LABEL_KEY, CROP_ASPECT_GROUP_LABEL_KEYS, CROP_ASPECT_PRESETS, CROP_FILL_LABEL_KEY, CROP_FIT_LABEL_KEY, ribbonTransitionsDraftPatch, ribbonTransitionUpdates, ribbonTransitionsSoundChange, ribbonTransitionStockSoundUrl, playSlideTransitionPreview, playAnimationRibbonPreview, SLIDE_SHOW_OPTIONS, createViewerOptionsStore, subtitleSettingsLabels, attachEditorImagePaste, authorConnectorBetweenSites, findEraserHitElementId, generateTicks, rulerDragToGuidePosition, resolveElementInteractivity, getElementTransformWithoutRotation, getElementTransform, 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, hasMultipleSelectedTableCells, isElementLocked, isImageLikeElement, mergeSlideTransition, getElementLabel, effectiveDirection, TRIGGER_OPTIONS, effectiveTimingCurve, 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, TABLE_STYLE_PRESETS, applyTableStylePreset, tableStyleAssignmentUpdate, evenColumnWidths, redistributeColumnWidth, evenRowHeights, patchChartData, collapseChartTitleRunsForEdit, chartGridlinesState, chartGridlinesPatch, seriesSecondaryAxisPatch, setChartCategoryLabel, setChartCellValue, addChartCategory, removeChartCategory, addChartSeries, removeChartSeries, setDataLabelsRangeCache, setChartAxisLogScale, setChartAxisTitleStyle, setChartAxisGridlineStyle, setChartSeriesMarker, setChartSeriesChartType, setChartDataPointFill, setChartDataPointExplosion, setChartDataPointMarker, setChartDataPointLabel, describeSmartArtBounds, canAddTopLevelNode, classifyExtraConnections, siblingIndex, siblingCount, canRemoveTopLevelNode, canInteractWithElement, buildOleObjectNamePatch, getOleObjectTypeLabel, sanitizeGradientStops, shouldShowAccessibilitySection, pptxActionToElementAction, withFrameSlides, withSlidesPerPage, THEME_COLOR_SCHEME_KEYS, applyThemeOverrideToSlide, COLOR_MAP_ALIAS_KEYS, DEFAULT_COLOR_MAP, schemaLabel, THEME_COLOR_SLOT_LABEL_KEYS, SLIDE_SIZE_PRESETS, TRANSITION_VALID_DIRECTIONS, TRANSITION_ORIENTATION_TYPES, TRANSITION_PATTERN_OPTIONS, TRANSITION_THRUBLK_TYPES, clampTransitionNumber, TRANSITION_SPEED_OPTIONS, TRANSITION_MORPH_OPTIONS, flattenTagCollections, resolveTemplateBackgroundRows, formatCommentTimestamp, 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, normalizeTableStyleGuid, describeTableStyleEditor, TABLE_STYLE_EDITOR_PARTS, computeMergeCellRight, computeMergeCellDown, computeSplitCell, updateMergeAttrsInRawXml, resolveDisplayedChartType, CHART_TYPE_OPTIONS, chartDataLabelsTogglePatch, BAR3D_SHAPE_OPTIONS, bar3DShapePatch, RADAR_STYLE_OPTIONS, radarStylePatch, SURFACE_WIREFRAME_OPTIONS, surfaceWireframePatch, isSeriesUsingSecondaryAxis, listChartUserShapeRows, withChartUserShapeAdded, createDefaultChartUserShape, withChartUserShapeRowRemoved, withChartUserShapeRowTextUpdated, SMARTART_COLOR_SCHEME_LABEL_KEYS, SMARTART_STYLE_LABEL_KEYS, addSmartArtNodeAsChild, setSmartArtNodeStyle, removeSmartArtNode, addSiblingAfter, removeEmptyNode, demote, promote, updateSmartArtNodeText, reorder, clampCropValue, DUOTONE_PRESETS, ARTISTIC_EFFECTS, mediaTrimEndSeconds, trimmedMediaDurationMs, mediaTrimEndAbsoluteMs, mediaTrimEndMsFromAbsoluteMs, buildOleEditDialogDescriptor, buildOleContentUpdatePatch, applyOleSheetCellEdit, getOleSheetGrid, applyOleDocumentParagraphEdit, getOleDocumentParagraphs, applyOleNestedDeckElementTextEdit, getOleNestedDeckDetail, replaceOleFile, getNonVisualDescriptionFields, resolveActionType, ELEMENT_ACTION_TYPE_OPTIONS, elementActionToPptxAction, canCommitActionType, slideSizeFromPreset, withSlideSizeOrientation, TRANSITION_DIR_ARROWS, buildDirectionGrid, getSlideTransitionAnimations, SLIDE_TRANSITION_KEYFRAMES, updateTagInCollections, deleteTagFromCollections, addTagToCollections, commentTextSegments, COMMENT_MENTION_CLASS, COMMENT_MENTION_ATTRIBUTE, insertCommentMention, reorderAnimationTimelineRows, applyAnimationTimelineOrder, getEffectSoundAsset, animationEffectLabel, overlayPointerInput, TABLE_STYLE_BORDER_SIDES, applyTableStyleFieldEdit, createTableStyleEntry, addTableStyleToMap, deleteTableStyleFromMap, LBL, SEL, FILL_MODE_OPTIONS, SECTION_HEADING, NUM, getChartUserShapeGroupTransform, withChartUserShapeGroupChildAdded, createDefaultChartUserShapeGroupChild, withChartUserShapeRowUpdated, getChartUserShapeRowChartBox, withChartUserShapeRowFlipUpdated, withChartUserShapeRowRotationUpdated, withChartUserShapeRowChartBoxUpdated, switchSmartArtLayout, rebuildDrawingShapesIfCleared, mediaTrimEndMsFromSeconds, validateMediaTrimRange, SHAPE_QUICK_STYLES, quickStyleSwatchCss, PATTERN_PRESET_OPTIONS, getPatternSvg, COMPOUND_LINE_OPTIONS, LINE_JOIN_OPTIONS, LINE_CAP_OPTIONS, TEXT_WARP_PRESETS, warpPreviewPath, text3dPtToEmu, text3dEmuToPt, MATERIAL_PRESETS, toSlideIndex, TABLE_STYLE_BORDER_SIDE_LABEL_KEYS, TABLE_STYLE_DASH_PRESETS, GRADIENT_TYPE_OPTIONS, PATTERN_OPTIONS, FILL_PATTERN_LABEL_KEYS, openNativeEyeDropper, toggleText3dExtrusion, BEVEL_PRESETS, cropFit, cropFill, cropToAspectRatio } from './chunk-NMYQ4XT2.mjs';
5
+ import { LOCALE_CATALOG, ALIGNMENT_LABEL_KEYS } from './chunk-GLLEZR4U.mjs';
6
+ import React95, { createContext, lazy, forwardRef, useEffect, useState, useCallback, useMemo, useRef, useLayoutEffect, useSyncExternalStore, useId, useContext, useDeferredValue, Fragment as Fragment$1, Suspense, useReducer } from 'react';
7
7
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
8
8
  import { useTranslation } from 'react-i18next';
9
- import { LuArrowDown, LuArrowUp, LuArrowRight, LuArrowLeft, LuArrowDownRight, LuArrowDownLeft, LuArrowUpRight, LuArrowUpLeft, LuMessageSquare, LuEyeOff, LuHistory, LuTrash2, LuSettings, LuX, LuCalendarDays, LuClock, LuHash, LuFileText, LuText, LuCast, LuSave, LuUndo, LuRedo, LuSearch, LuShieldCheck, LuPlus, LuPanelLeftClose, LuStickyNote, LuMonitor, LuColumns2, LuPresentation, LuMinus, LuSettings2, LuLayers, LuDownload, LuCheck, LuLock, LuEye, LuType, LuLoader, LuShieldAlert, LuSignature, LuInfo, LuTriangleAlert, LuPrinter, LuPenTool, LuBug, LuChevronUp, LuChevronDown, LuUpload, LuWifi, LuWifiOff, LuUsers, LuCopy, LuChevronLeft, LuChevronRight, LuPlay, LuPause, LuZoomOut, LuZoomIn, LuSpellCheck, LuFileDown, LuMenu, LuSparkles, LuShare2, LuPanelLeft, LuPanelRight, LuFolderOpen, LuSquare, LuImage, LuVideo, LuDatabase, LuAArrowUp, LuAArrowDown, LuRemoveFormatting, LuReplace, LuMousePointer2, LuShapes, LuPaintBucket, LuPenLine, LuPalette, LuPaintbrush, LuPencil, LuCaseSensitive, LuTimer, LuHighlighter, LuEraser, LuGripVertical, LuLoaderCircle, LuBold, LuItalic, LuUnderline, LuStrikethrough, LuList, LuListOrdered, LuIndentIncrease, LuIndentDecrease, LuLink, LuGrid2X2, LuClipboardPaste, LuCopyPlus, LuScan, LuRotateCcw, LuMonitorOff, LuCirclePlay, LuCirclePause, LuCaptions, LuArrowLeftRight, LuClipboardCopy, LuLayoutGrid, LuWand, LuTextCursorInput, LuFile, LuEllipsis, LuUserRound, LuFilePlus2, LuHouse, LuFileJson, LuBox, LuFileImage, LuClock3, LuUser, LuHardDrive, LuLogIn, LuScissors, LuLayoutTemplate, LuFolderPlus, LuSpline, LuMoveRight, LuAlignLeft, LuAlignCenter, LuAlignRight, LuAlignHorizontalSpaceAround, LuAlignVerticalSpaceAround, LuGroup, LuUngroup, LuStar, LuMousePointerClick, LuBookOpen, LuLanguages, LuGlobe, LuGitCompare, LuMessageSquarePlus, LuLockKeyhole, LuPanelTop, LuGrid3X3, LuPipette, LuRuler, LuMaximize2, LuCode, LuMove, LuRadio, LuAlignJustify, LuColumns3, LuCombine, LuCrop, LuFilter, LuLockOpen, LuReply, LuRotateCw, LuBookmark } from 'react-icons/lu';
9
+ import { LuArrowDown, LuArrowUp, LuArrowRight, LuArrowLeft, LuArrowDownRight, LuArrowDownLeft, LuArrowUpRight, LuArrowUpLeft, LuMessageSquare, LuEyeOff, LuHistory, LuTrash2, LuSettings, LuX, LuCalendarDays, LuClock, LuHash, LuFileText, LuText, LuCast, LuSave, LuUndo, LuRedo, LuSearch, LuShieldCheck, LuPlus, LuPanelLeftClose, LuStickyNote, LuMonitor, LuColumns2, LuPresentation, LuMinus, LuSettings2, LuLayers, LuDownload, LuCheck, LuLock, LuEye, LuType, LuLoader, LuShieldAlert, LuSignature, LuInfo, LuTriangleAlert, LuPrinter, LuPenTool, LuBug, LuChevronUp, LuChevronDown, LuUpload, LuWifi, LuWifiOff, LuUsers, LuCopy, LuChevronLeft, LuChevronRight, LuPlay, LuPause, LuZoomOut, LuZoomIn, LuSpellCheck, LuFileDown, LuMenu, LuSparkles, LuShare2, LuPanelLeft, LuPanelRight, LuFolderOpen, LuMousePointer2, LuShapes, LuPaintBucket, LuPenLine, LuPalette, LuPaintbrush, LuCaseSensitive, LuReplace, LuTimer, LuHighlighter, LuEraser, LuGripVertical, LuLoaderCircle, LuBold, LuItalic, LuUnderline, LuStrikethrough, LuList, LuListOrdered, LuIndentIncrease, LuIndentDecrease, LuLink, LuGrid2X2, LuClipboardPaste, LuCopyPlus, LuScan, LuRotateCcw, LuMonitorOff, LuCirclePlay, LuCirclePause, LuCaptions, LuArrowLeftRight, LuClipboardCopy, LuLayoutGrid, LuWand, LuTextCursorInput, LuFile, LuEllipsis, LuUserRound, LuFilePlus2, LuHouse, LuFileJson, LuBox, LuVideo, LuFileImage, LuDatabase, LuClock3, LuUser, LuHardDrive, LuLogIn, LuLayoutTemplate, LuFolderPlus, LuAlignLeft, LuAlignCenter, LuAlignRight, LuAlignHorizontalSpaceAround, LuAlignVerticalSpaceAround, LuGroup, LuUngroup, LuMove, LuRadio, LuImage, LuColumns3, LuCombine, LuCrop, LuFilter, LuLockOpen, LuPencil, LuReply, LuMoveRight, LuRotateCw, LuScissors, LuBookmark, LuPipette } from 'react-icons/lu';
10
10
 
11
11
  var ViewerThemeContext = createContext(void 0);
12
12
  function ViewerThemeProvider({ theme, children }) {
@@ -464,99 +464,57 @@ function SlideTemplateGalleryDialog({
464
464
  )
465
465
  ] });
466
466
  }
467
- var CATEGORIES2 = [
468
- {
469
- group: "entrance",
470
- labelKey: "pptx.animation.entrance",
471
- tone: "text-emerald-500",
472
- presets: ENTRANCE_PRESET_VALUES
473
- },
474
- {
475
- group: "emphasis",
476
- labelKey: "pptx.animation.emphasis",
477
- tone: "text-amber-500",
478
- presets: EMPHASIS_PRESET_VALUES
479
- },
480
- {
481
- group: "exit",
482
- labelKey: "pptx.animation.exit",
483
- tone: "text-red-500",
484
- presets: EXIT_PRESET_VALUES
485
- }
486
- ];
487
- function AnimationPresetGallery({
488
- disabled,
489
- onAddAnimation
490
- }) {
467
+ function AnimationsSection(p) {
491
468
  const { t } = useTranslation();
492
- return /* @__PURE__ */ jsx(
493
- "div",
494
- {
495
- className: "flex max-h-[62px] items-start gap-2 overflow-y-auto rounded-sm border border-border/60 bg-muted/30 px-1.5 py-1",
496
- "aria-label": t("pptx.animations.galleryAria"),
497
- children: CATEGORIES2.map((category) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5", children: [
498
- /* @__PURE__ */ jsx("span", { className: "text-[9px] font-semibold leading-3 text-muted-foreground", children: t(category.labelKey) }),
499
- /* @__PURE__ */ jsx("div", { className: "flex max-w-[150px] flex-wrap gap-0.5", children: category.presets.map((preset) => {
500
- const label = t(`pptx.animation.preset.${preset}`);
501
- return /* @__PURE__ */ jsxs(
502
- "button",
503
- {
504
- type: "button",
505
- disabled,
506
- onClick: () => onAddAnimation?.(preset, category.group),
507
- title: label,
508
- className: "inline-flex items-center gap-0.5 rounded-sm px-1 py-0.5 text-[9px] leading-3 text-foreground transition-colors hover:bg-accent disabled:opacity-35",
509
- children: [
510
- /* @__PURE__ */ jsx(
511
- LuStar,
512
- {
513
- className: `h-2.5 w-2.5 fill-current ${category.tone}`,
514
- "aria-hidden": "true"
515
- }
516
- ),
517
- /* @__PURE__ */ jsx("span", { className: "whitespace-nowrap", children: label })
518
- ]
519
- },
520
- preset
521
- );
522
- }) })
523
- ] }, category.group))
524
- }
469
+ const ref = useRef(null);
470
+ const [previewActive, setPreviewActive] = useState(false);
471
+ const timer = useRef(void 0);
472
+ const disabled = !p.canEdit || p.selectedElement === null;
473
+ const selectedAnimation = useMemo(
474
+ () => p.selectedElement ? (p.activeSlide?.animations ?? []).find((a) => a.elementId === p.selectedElement?.id) : void 0,
475
+ [p.activeSlide?.animations, p.selectedElement]
525
476
  );
526
- }
527
- function MotionPathGallery({
528
- disabled,
529
- onApplyMotionPath
530
- }) {
531
- const { t } = useTranslation();
532
- return /* @__PURE__ */ jsx(
533
- "div",
534
- {
535
- className: "flex max-h-[62px] items-start gap-2 overflow-y-auto rounded-sm border border-border/60 bg-muted/30 px-1.5 py-1",
536
- "aria-label": t("pptx.animations.motionPathGalleryAria"),
537
- children: MOTION_PATH_FAMILIES.map((family) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5", children: [
538
- /* @__PURE__ */ jsx("span", { className: "text-[9px] font-semibold leading-3 text-muted-foreground", children: t(motionPathFamilyLabelKey(family)) }),
539
- /* @__PURE__ */ jsx("div", { className: "flex max-w-[150px] flex-wrap gap-0.5", children: motionPathPresetsByFamily(family).map((preset) => {
540
- const label = t(motionPathPresetLabelKey(preset.id));
541
- return /* @__PURE__ */ jsxs(
542
- "button",
543
- {
544
- type: "button",
545
- disabled,
546
- onClick: () => onApplyMotionPath?.(preset.id),
547
- title: label,
548
- className: "inline-flex items-center gap-0.5 rounded-sm px-1 py-0.5 text-[9px] leading-3 text-foreground transition-colors hover:bg-accent disabled:opacity-35",
549
- children: [
550
- /* @__PURE__ */ jsx(LuMoveRight, { className: "h-2.5 w-2.5 text-sky-500", "aria-hidden": "true" }),
551
- /* @__PURE__ */ jsx("span", { className: "whitespace-nowrap", children: label })
552
- ]
553
- },
554
- preset.id
555
- );
556
- }) })
557
- ] }, family))
477
+ useEffect(() => () => clearTimeout(timer.current), []);
478
+ useEffect(() => {
479
+ const host = ref.current;
480
+ if (!host) {
481
+ return;
558
482
  }
559
- );
483
+ host.state = {
484
+ editable: p.canEdit,
485
+ hasSelection: p.selectedElement !== null,
486
+ paneOpen: p.isInspectorPaneOpen,
487
+ previewActive,
488
+ translate: t
489
+ };
490
+ }, [p.canEdit, p.selectedElement, p.isInspectorPaneOpen, previewActive, t]);
491
+ useEffect(() => {
492
+ const host = ref.current;
493
+ if (!host) {
494
+ return;
495
+ }
496
+ const request = (event) => {
497
+ const intent = event.detail;
498
+ if (intent.kind === "add") {
499
+ p.onAddAnimation?.(intent.preset, intent.group);
500
+ } else if (intent.value === "remove") {
501
+ p.onRemoveAnimation?.();
502
+ } else if (intent.value === "preview") {
503
+ if (disabled) {
504
+ return;
505
+ }
506
+ setPreviewActive(true);
507
+ clearTimeout(timer.current);
508
+ timer.current = setTimeout(() => setPreviewActive(false), 1200);
509
+ playAnimationRibbonPreview(document, selectedAnimation);
510
+ } else {
511
+ (p.onOpenAnimationPanel ?? p.onToggleInspector)();
512
+ }
513
+ };
514
+ host.addEventListener("animations-request", request);
515
+ return () => host.removeEventListener("animations-request", request);
516
+ }, [p, disabled, selectedAnimation]);
517
+ return /* @__PURE__ */ jsx("pptx-ui-ribbon-animations", { ref });
560
518
  }
561
519
  function controlAttr(id) {
562
520
  return id ? { [RIBBON_CONTROL_ATTR]: id } : {};
@@ -570,291 +528,6 @@ function RibbonGroupScope({
570
528
  }) {
571
529
  return /* @__PURE__ */ jsx("div", { className: "contents", ...groupAttr(id), children });
572
530
  }
573
- function RibbonGroup({
574
- label,
575
- children,
576
- className,
577
- groupId
578
- }) {
579
- return /* @__PURE__ */ jsxs(
580
- "section",
581
- {
582
- ...groupAttr(groupId),
583
- className: cn(
584
- "relative flex min-h-[78px] self-stretch shrink-0 items-start gap-1 border-r border-border/60 px-2 pb-4 pt-1 last:border-r-0",
585
- className
586
- ),
587
- "aria-label": label,
588
- children: [
589
- children,
590
- /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute inset-x-1 bottom-0.5 truncate text-center text-[9px] leading-3 text-muted-foreground", children: label })
591
- ]
592
- }
593
- );
594
- }
595
- function RibbonCommand({
596
- label,
597
- icon,
598
- onClick,
599
- disabled,
600
- active,
601
- compact = false,
602
- title,
603
- pressed,
604
- controlId
605
- }) {
606
- return /* @__PURE__ */ jsxs(
607
- "button",
608
- {
609
- type: "button",
610
- ...controlAttr(controlId),
611
- onClick,
612
- disabled,
613
- title: title ?? label,
614
- "aria-pressed": pressed,
615
- className: cn(
616
- "inline-flex rounded-sm text-foreground transition-colors hover:bg-accent disabled:cursor-not-allowed disabled:opacity-35",
617
- active && "bg-primary/15 text-primary ring-1 ring-primary/35",
618
- compact ? "h-[26px] min-w-[88px] items-center gap-1.5 px-1.5 text-left text-[10px] leading-3" : "h-[58px] min-w-[54px] max-w-[72px] flex-col items-center justify-start gap-0.5 px-1 py-1 text-center text-[9px] leading-[11px]"
619
- ),
620
- children: [
621
- /* @__PURE__ */ jsx(
622
- "span",
623
- {
624
- className: cn(
625
- "grid shrink-0 place-items-center text-primary",
626
- compact ? "h-4 w-4 [&>svg]:h-4 [&>svg]:w-4" : "h-7 w-7 [&>svg]:h-6 [&>svg]:w-6"
627
- ),
628
- "aria-hidden": "true",
629
- children: icon
630
- }
631
- ),
632
- /* @__PURE__ */ jsx("span", { children: label })
633
- ]
634
- }
635
- );
636
- }
637
- function RibbonCommandStack({
638
- children
639
- }) {
640
- return /* @__PURE__ */ jsx("div", { className: "flex flex-col justify-start gap-0.5", children });
641
- }
642
- function RibbonToggle({
643
- label,
644
- checked,
645
- onChange,
646
- disabled,
647
- title,
648
- controlId
649
- }) {
650
- return /* @__PURE__ */ jsxs(
651
- "label",
652
- {
653
- ...controlAttr(controlId),
654
- title,
655
- className: cn(
656
- "flex h-[19px] items-center gap-1 whitespace-nowrap rounded-sm px-1 text-[10px] text-foreground",
657
- checked && "bg-primary/15 text-primary"
658
- ),
659
- children: [
660
- /* @__PURE__ */ jsx(
661
- "input",
662
- {
663
- type: "checkbox",
664
- checked,
665
- disabled,
666
- onChange: (event) => onChange?.(event.target.checked),
667
- className: "h-3 w-3 accent-primary disabled:opacity-35"
668
- }
669
- ),
670
- label
671
- ]
672
- }
673
- );
674
- }
675
- function AnimationsSection(p) {
676
- const { t } = useTranslation();
677
- const [previewActive, setPreviewActive] = useState(false);
678
- const disabled = !p.canEdit || p.selectedElement === null;
679
- const selectedAnimation = useMemo(
680
- () => p.selectedElement ? (p.activeSlide?.animations ?? []).find((a) => a.elementId === p.selectedElement?.id) : void 0,
681
- [p.activeSlide?.animations, p.selectedElement]
682
- );
683
- const preview = () => {
684
- if (disabled) {
685
- return;
686
- }
687
- setPreviewActive(true);
688
- setTimeout(() => setPreviewActive(false), 1200);
689
- playAnimationRibbonPreview(document, selectedAnimation);
690
- };
691
- return /* @__PURE__ */ jsxs(Fragment, { children: [
692
- /* @__PURE__ */ jsx(RibbonGroup, { label: t("pptx.animations.preview"), groupId: "animations.preview", children: /* @__PURE__ */ jsx(
693
- RibbonCommand,
694
- {
695
- controlId: "animations.preview.preview",
696
- label: t("pptx.animations.preview"),
697
- icon: /* @__PURE__ */ jsx(LuPlay, {}),
698
- onClick: preview,
699
- disabled,
700
- active: previewActive,
701
- title: t("pptx.animations.previewTooltip")
702
- }
703
- ) }),
704
- /* @__PURE__ */ jsx(
705
- RibbonGroup,
706
- {
707
- label: t("pptx.animations.animation", { defaultValue: "Animation" }),
708
- className: "max-w-[500px] overflow-hidden",
709
- groupId: "animations.animation",
710
- children: /* @__PURE__ */ jsx("div", { className: "contents", ...controlAttr("animations.animation.gallery"), children: /* @__PURE__ */ jsx(AnimationPresetGallery, { disabled, onAddAnimation: p.onAddAnimation }) })
711
- }
712
- ),
713
- /* @__PURE__ */ jsx(
714
- RibbonGroup,
715
- {
716
- label: t("pptx.animation.motionPath"),
717
- className: "max-w-[420px] overflow-hidden",
718
- groupId: "animations.motionPath",
719
- children: /* @__PURE__ */ jsx("div", { className: "contents", ...controlAttr("animations.motionPath.gallery"), children: /* @__PURE__ */ jsx(
720
- MotionPathGallery,
721
- {
722
- disabled,
723
- onApplyMotionPath: (presetId) => p.onAddAnimation?.(presetId, "motionPath")
724
- }
725
- ) })
726
- }
727
- ),
728
- /* @__PURE__ */ jsxs(
729
- RibbonGroup,
730
- {
731
- label: t("pptx.animations.advanced", { defaultValue: "Advanced Animation" }),
732
- groupId: "animations.advancedAnimation",
733
- children: [
734
- /* @__PURE__ */ jsx(
735
- RibbonCommand,
736
- {
737
- label: t("pptx.animations.exitEffects", { defaultValue: "Exit Effects" }),
738
- icon: /* @__PURE__ */ jsx(LuStar, { className: "text-red-500" }),
739
- onClick: () => p.onAddAnimation?.("fadeOut", "exit"),
740
- disabled
741
- }
742
- ),
743
- /* @__PURE__ */ jsx(
744
- RibbonCommand,
745
- {
746
- label: t("pptx.animations.pathAnimation", { defaultValue: "Path Animation" }),
747
- icon: /* @__PURE__ */ jsx(LuMoveRight, {}),
748
- onClick: () => p.onAddAnimation?.(DEFAULT_MOTION_PATH_PRESET_ID, "motionPath"),
749
- disabled
750
- }
751
- ),
752
- /* @__PURE__ */ jsxs(RibbonCommandStack, { children: [
753
- /* @__PURE__ */ jsx(
754
- RibbonCommand,
755
- {
756
- compact: true,
757
- controlId: "animations.animation.effectOptions",
758
- label: t("pptx.animations.effectOptions", { defaultValue: "Effect Options" }),
759
- icon: /* @__PURE__ */ jsx(LuSparkles, {}),
760
- onClick: p.onOpenAnimationPanel ?? p.onToggleInspector,
761
- disabled
762
- }
763
- ),
764
- /* @__PURE__ */ jsx(
765
- RibbonCommand,
766
- {
767
- compact: true,
768
- controlId: "animations.advancedAnimation.animationPane",
769
- label: t("pptx.animations.animationPanel"),
770
- icon: /* @__PURE__ */ jsx(LuPanelRight, {}),
771
- onClick: p.onOpenAnimationPanel ?? p.onToggleInspector,
772
- active: p.isInspectorPaneOpen,
773
- title: t("pptx.animations.openPanelTooltip")
774
- }
775
- )
776
- ] }),
777
- /* @__PURE__ */ jsxs(RibbonCommandStack, { children: [
778
- /* @__PURE__ */ jsx(
779
- RibbonCommand,
780
- {
781
- compact: true,
782
- controlId: "animations.advancedAnimation.trigger",
783
- label: t("pptx.animations.trigger", { defaultValue: "Trigger" }),
784
- icon: /* @__PURE__ */ jsx(LuMousePointerClick, {}),
785
- onClick: p.onOpenAnimationPanel ?? p.onToggleInspector,
786
- disabled
787
- }
788
- ),
789
- /* @__PURE__ */ jsx(
790
- RibbonCommand,
791
- {
792
- compact: true,
793
- controlId: "animations.advancedAnimation.animationPainter",
794
- label: t("pptx.animations.painter", { defaultValue: "Animation Painter" }),
795
- icon: /* @__PURE__ */ jsx(LuPaintbrush, {}),
796
- disabled: true
797
- }
798
- )
799
- ] }),
800
- /* @__PURE__ */ jsx(
801
- RibbonCommand,
802
- {
803
- controlId: "animations.advancedAnimation.remove",
804
- label: t("pptx.animations.remove"),
805
- icon: /* @__PURE__ */ jsx(LuTrash2, {}),
806
- onClick: p.onRemoveAnimation,
807
- disabled,
808
- title: t("pptx.animations.removeTooltip")
809
- }
810
- )
811
- ]
812
- }
813
- ),
814
- /* @__PURE__ */ jsx(
815
- RibbonGroup,
816
- {
817
- label: t("pptx.animations.timing", { defaultValue: "Timing" }),
818
- groupId: "animations.timing",
819
- children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-[48px_82px] items-center gap-x-1 gap-y-1 text-[10px]", children: [
820
- /* @__PURE__ */ jsx("label", { htmlFor: "pptx-animation-start", children: t("pptx.animations.start", { defaultValue: "Start" }) }),
821
- /* @__PURE__ */ jsxs(
822
- "select",
823
- {
824
- id: "pptx-animation-start",
825
- ...controlAttr("animations.timing.start"),
826
- disabled: true,
827
- className: "h-6 rounded-sm border border-border bg-muted px-1 text-[10px]",
828
- children: [
829
- /* @__PURE__ */ jsx("option", { children: t("pptx.animations.onClick", { defaultValue: "On Click" }) }),
830
- /* @__PURE__ */ jsx("option", { children: t("pptx.animations.withPrevious", { defaultValue: "With Previous" }) }),
831
- /* @__PURE__ */ jsx("option", { children: t("pptx.animations.afterPrevious", { defaultValue: "After Previous" }) })
832
- ]
833
- }
834
- ),
835
- /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-1", children: [
836
- /* @__PURE__ */ jsx(LuClock3, {}),
837
- " ",
838
- t("pptx.animations.duration", { defaultValue: "Duration" })
839
- ] }),
840
- /* @__PURE__ */ jsx(
841
- "input",
842
- {
843
- type: "number",
844
- min: "0",
845
- step: "0.1",
846
- defaultValue: "0.5",
847
- disabled: true,
848
- "aria-label": t("pptx.animations.duration", { defaultValue: "Duration" }),
849
- ...controlAttr("animations.timing.duration"),
850
- className: "h-6 rounded-sm border border-border bg-muted px-1 text-[10px]"
851
- }
852
- )
853
- ] })
854
- }
855
- )
856
- ] });
857
- }
858
531
  var ShapeFormatContext = createContext(null);
859
532
  function useShapeFormatContext() {
860
533
  return useContext(ShapeFormatContext);
@@ -915,38 +588,6 @@ var DISTRIBUTE_BTNS = [
915
588
  { k: "horizontal", el: /* @__PURE__ */ jsx(LuAlignHorizontalSpaceAround, { className: ic }) },
916
589
  { k: "vertical", el: /* @__PURE__ */ jsx(LuAlignVerticalSpaceAround, { className: ic }) }
917
590
  ];
918
- var DRAW_TOOLS = [
919
- {
920
- id: "select",
921
- icon: /* @__PURE__ */ jsx(LuMoveRight, { className: ic }),
922
- labelKey: "pptx.ribbon.tool.select",
923
- ac: "bg-primary text-white"
924
- },
925
- {
926
- id: "pen",
927
- icon: /* @__PURE__ */ jsx(LuPencil, { className: ic }),
928
- labelKey: "pptx.ribbon.tool.pen",
929
- ac: "bg-primary text-white"
930
- },
931
- {
932
- id: "highlighter",
933
- icon: /* @__PURE__ */ jsx(LuType, { className: ic }),
934
- labelKey: "pptx.ribbon.tool.highlighter",
935
- ac: "bg-yellow-600 text-white"
936
- },
937
- {
938
- id: "eraser",
939
- icon: /* @__PURE__ */ jsx(LuMinus, { className: ic }),
940
- labelKey: "pptx.ribbon.tool.eraser",
941
- ac: "bg-red-600 text-white"
942
- },
943
- {
944
- id: "freeform",
945
- icon: /* @__PURE__ */ jsx(LuSpline, { className: ic }),
946
- labelKey: "pptx.ribbon.tool.freeform",
947
- ac: "bg-primary text-white"
948
- }
949
- ];
950
591
  var OV = [
951
592
  {
952
593
  k: "png",
@@ -1038,22 +679,6 @@ var OV = [
1038
679
  i: /* @__PURE__ */ jsx(LuShieldAlert, { className: `${ics} text-muted-foreground` })
1039
680
  }
1040
681
  ];
1041
- var FMT = [
1042
- { id: "bold", i: /* @__PURE__ */ jsx(LuBold, { className: ic }), labelKey: "pptx.textPanel.bold" },
1043
- { id: "italic", i: /* @__PURE__ */ jsx(LuItalic, { className: ic }), labelKey: "pptx.textPanel.italic" },
1044
- { id: "underline", i: /* @__PURE__ */ jsx(LuUnderline, { className: ic }), labelKey: "pptx.textPanel.underline" },
1045
- {
1046
- id: "strikethrough",
1047
- i: /* @__PURE__ */ jsx(LuStrikethrough, { className: ic }),
1048
- labelKey: "pptx.textPanel.strikethrough"
1049
- }
1050
- ];
1051
- var ATXT = [
1052
- { id: "left", i: /* @__PURE__ */ jsx(LuAlignLeft, { className: ic }), labelKey: "pptx.ribbon.alignLeft" },
1053
- { id: "center", i: /* @__PURE__ */ jsx(LuAlignCenter, { className: ic }), labelKey: "pptx.ribbon.alignCenter" },
1054
- { id: "right", i: /* @__PURE__ */ jsx(LuAlignRight, { className: ic }), labelKey: "pptx.ribbon.alignRight" },
1055
- { id: "justify", i: /* @__PURE__ */ jsx(LuAlignJustify, { className: ic }), labelKey: "pptx.ribbon.justify" }
1056
- ];
1057
682
  function useRibbonDropdown() {
1058
683
  const [open, setOpen] = useState(false);
1059
684
  const ref = useRef(null);
@@ -1459,691 +1084,340 @@ var RibbonGalleryCommandsContext = createContext(null);
1459
1084
  function useRibbonGalleryCommands() {
1460
1085
  return useContext(RibbonGalleryCommandsContext);
1461
1086
  }
1462
- function useTranslateOr() {
1463
- const { t } = useTranslation();
1464
- return (key, fallback) => {
1465
- if (!key) {
1466
- return fallback;
1467
- }
1468
- const translated = t(key);
1469
- return translated && translated !== key ? translated : fallback;
1470
- };
1471
- }
1472
- function RibbonGalleryTile({
1473
- item,
1474
- disabled,
1475
- inStrip,
1476
- onPick
1087
+ function RibbonGallery({
1088
+ placement,
1089
+ chevronOnly = false,
1090
+ tagControl = true
1477
1091
  }) {
1478
1092
  const { t } = useTranslation();
1479
- const label = galleryItemLabel(item, (key, params) => t(key, params ?? {}));
1093
+ const ref = useRef(null);
1094
+ const commands = useRibbonGalleryCommands();
1095
+ const context = commands?.context;
1096
+ const descriptor = useMemo(
1097
+ () => buildRibbonGallery(placement.gallery, context ?? { element: null }),
1098
+ [placement.gallery, context]
1099
+ );
1100
+ useEffect(() => {
1101
+ const host = ref.current;
1102
+ if (host) {
1103
+ host.descriptor = descriptor;
1104
+ host.translateLabel = t;
1105
+ host.disabled = !commands?.editable;
1106
+ }
1107
+ }, [descriptor, t, commands?.editable]);
1108
+ useEffect(() => {
1109
+ const host = ref.current;
1110
+ if (!host) {
1111
+ return;
1112
+ }
1113
+ const pick = (event) => {
1114
+ if (!commands?.editable) {
1115
+ return;
1116
+ }
1117
+ const result = applyRibbonGalleryItem(
1118
+ placement.gallery,
1119
+ event.detail.itemId,
1120
+ commands.context
1121
+ );
1122
+ if (result) {
1123
+ commands.dispatch(result);
1124
+ }
1125
+ };
1126
+ host.addEventListener("gallery-pick", pick);
1127
+ return () => host.removeEventListener("gallery-pick", pick);
1128
+ }, [commands, placement.gallery]);
1480
1129
  return /* @__PURE__ */ jsx(
1481
- "button",
1130
+ "pptx-ui-ribbon-gallery",
1482
1131
  {
1483
- type: "button",
1484
- ...{ [RIBBON_GALLERY_ITEM_ATTR]: item.id },
1485
- "aria-pressed": item.applied,
1486
- "aria-label": label,
1487
- title: label,
1488
- disabled,
1489
- onMouseDown: (event) => event.preventDefault(),
1490
- onClick: () => onPick(item),
1491
- className: cn(
1492
- "grid shrink-0 place-items-center rounded-sm border border-transparent p-0.5 transition-colors hover:border-primary/60 hover:bg-accent disabled:cursor-not-allowed disabled:opacity-40",
1493
- item.applied && "border-primary ring-1 ring-primary/40",
1494
- inStrip && "[&>svg]:h-[40px] [&>svg]:w-auto"
1495
- ),
1496
- dangerouslySetInnerHTML: { __html: item.previewSvg }
1132
+ ref,
1133
+ label: descriptor.label,
1134
+ mode: placement.mode,
1135
+ "chevron-only": chevronOnly || void 0,
1136
+ "data-ribbon-control": tagControl ? placement.control : void 0
1497
1137
  }
1498
1138
  );
1499
1139
  }
1500
- function GallerySection({
1501
- section,
1502
- onPick
1140
+ function useIntent(ref, type, callback) {
1141
+ useEffect(() => {
1142
+ const host = ref.current;
1143
+ if (!host || !callback) {
1144
+ return;
1145
+ }
1146
+ host.addEventListener(type, callback);
1147
+ return () => host.removeEventListener(type, callback);
1148
+ }, [ref, type, callback]);
1149
+ }
1150
+ function WebRibbonGroup({
1151
+ label,
1152
+ groupId,
1153
+ children
1503
1154
  }) {
1504
- const translateOr = useTranslateOr();
1505
- if (section.items.length === 0) {
1506
- return null;
1507
- }
1508
- const heading = section.titleKey || section.title ? translateOr(section.titleKey, section.title ?? "") : "";
1509
- return /* @__PURE__ */ jsxs("div", { className: "px-2 py-1", children: [
1510
- heading && /* @__PURE__ */ jsx("div", { className: "pb-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground", children: heading }),
1511
- /* @__PURE__ */ jsx(
1512
- "div",
1513
- {
1514
- className: "grid gap-1",
1515
- style: { gridTemplateColumns: `repeat(${Math.max(1, section.columns)}, max-content)` },
1516
- children: section.items.map((item) => /* @__PURE__ */ jsx(RibbonGalleryTile, { item, onPick }, item.id))
1517
- }
1518
- )
1519
- ] });
1155
+ return /* @__PURE__ */ jsx("pptx-ui-ribbon-group", { label, "data-ribbon-group": groupId, children });
1520
1156
  }
1521
- function RibbonGalleryPopup({
1522
- descriptor,
1523
- anchorRef,
1157
+ function WebRibbonCommand({
1524
1158
  label,
1525
- onPick
1159
+ icon,
1160
+ controlId,
1161
+ title,
1162
+ disabled,
1163
+ active,
1164
+ pressed,
1165
+ expanded,
1166
+ compact,
1167
+ onCommand
1526
1168
  }) {
1527
- return /* @__PURE__ */ jsx(RibbonMenu, { anchorRef, className: "pt-1", children: /* @__PURE__ */ jsx(
1528
- "div",
1169
+ const ref = useRef(null);
1170
+ useIntent(
1171
+ ref,
1172
+ "command-request",
1173
+ onCommand ? (event) => onCommand(event.detail.id) : void 0
1174
+ );
1175
+ return /* @__PURE__ */ jsx(
1176
+ "pptx-ui-ribbon-command",
1529
1177
  {
1530
- ...{ [RIBBON_GALLERY_POPUP_ATTR]: descriptor.id },
1531
- role: "group",
1532
- "aria-label": label,
1533
- className: "max-h-[70vh] overflow-y-auto rounded-lg border border-border bg-popover py-1 shadow-2xl backdrop-blur-lg",
1534
- children: descriptor.sections.map((section) => /* @__PURE__ */ jsx(GallerySection, { section, onPick }, section.id))
1178
+ ref,
1179
+ label,
1180
+ icon,
1181
+ "data-ribbon-control": controlId,
1182
+ title,
1183
+ disabled: disabled || void 0,
1184
+ active: active || void 0,
1185
+ pressed: pressed === void 0 ? void 0 : String(pressed),
1186
+ expanded: expanded === void 0 ? void 0 : String(expanded),
1187
+ compact: compact || void 0
1535
1188
  }
1536
- ) });
1189
+ );
1537
1190
  }
1538
- var EMPTY_CONTEXT = { element: null };
1539
- function RibbonGallery({
1540
- placement,
1541
- icon,
1542
- chevronOnly = false,
1543
- tagControl = true
1191
+ function WebRibbonToggle({
1192
+ label,
1193
+ controlId,
1194
+ checked,
1195
+ title,
1196
+ onToggle
1544
1197
  }) {
1545
- const { t } = useTranslation();
1546
- const translateOr = useTranslateOr();
1547
- const commands = useRibbonGalleryCommands();
1548
- const ctx = commands?.context ?? EMPTY_CONTEXT;
1549
- const { gallery, control, mode } = placement;
1550
- const descriptor = useMemo(() => buildRibbonGallery(gallery, ctx), [gallery, ctx]);
1551
- const dropdown = useRibbonDropdown();
1552
- const title = translateOr(descriptor.labelKey, descriptor.label);
1553
- const disabled = !commands?.editable || descriptor.disabled || !galleryHasItems(descriptor);
1554
- const open = dropdown.open && !disabled;
1555
- const pick = (item) => {
1556
- const result = applyRibbonGalleryItem(gallery, item.id, ctx);
1557
- if (result) {
1558
- commands?.dispatch(result);
1559
- }
1560
- dropdown.setOpen(false);
1561
- };
1562
- const controlAttrs = tagControl ? { [RIBBON_CONTROL_ATTR]: control } : {};
1563
- const galleryAttrs = { [RIBBON_GALLERY_ATTR]: gallery };
1564
- const popup = open && /* @__PURE__ */ jsx(
1565
- RibbonGalleryPopup,
1198
+ const ref = useRef(null);
1199
+ useIntent(
1200
+ ref,
1201
+ "toggle-request",
1202
+ onToggle ? (event) => onToggle(event.detail.checked) : void 0
1203
+ );
1204
+ return /* @__PURE__ */ jsx(
1205
+ "pptx-ui-ribbon-toggle",
1566
1206
  {
1567
- descriptor,
1568
- anchorRef: dropdown.ref,
1569
- label: title,
1570
- onPick: pick
1207
+ ref,
1208
+ label,
1209
+ "data-ribbon-control": controlId,
1210
+ checked: checked || void 0,
1211
+ title
1571
1212
  }
1572
1213
  );
1573
- if (mode === "inline") {
1574
- const moreLabel = t("pptx.gallery.more", { name: title });
1575
- return /* @__PURE__ */ jsxs(
1576
- "div",
1577
- {
1578
- ref: dropdown.ref,
1579
- ...controlAttrs,
1580
- className: "relative inline-flex items-stretch rounded border border-border/60 bg-background/40",
1581
- children: [
1582
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-0.5 p-0.5", children: inlineGalleryItems(descriptor).map((item) => /* @__PURE__ */ jsx(
1583
- RibbonGalleryTile,
1584
- {
1585
- item,
1586
- disabled,
1587
- inStrip: true,
1588
- onPick: pick
1589
- },
1590
- item.id
1591
- )) }),
1592
- /* @__PURE__ */ jsx(
1593
- "button",
1594
- {
1595
- type: "button",
1596
- ...galleryAttrs,
1597
- "aria-label": moreLabel,
1598
- "aria-haspopup": "true",
1599
- "aria-expanded": open,
1600
- title: moreLabel,
1601
- disabled,
1602
- onClick: () => dropdown.setOpen((v) => !v),
1603
- className: "inline-flex items-center border-l border-border/60 px-0.5 hover:bg-accent disabled:cursor-not-allowed disabled:opacity-40",
1604
- children: /* @__PURE__ */ jsx(LuChevronDown, { className: "h-3 w-3" })
1214
+ }
1215
+ function TransitionsSection(p) {
1216
+ const { t } = useTranslation();
1217
+ const ref = useRef(null);
1218
+ const draft = useMemo(() => readRibbonTransitionDraft(p.activeSlide), [p.activeSlide]);
1219
+ const transition = p.activeSlide?.transition;
1220
+ const editable = p.canEdit !== false;
1221
+ useEffect(() => {
1222
+ const host = ref.current;
1223
+ if (host) {
1224
+ host.state = {
1225
+ draft,
1226
+ transition,
1227
+ editable,
1228
+ inspectorOpen: p.isInspectorPaneOpen,
1229
+ translate: t
1230
+ };
1231
+ }
1232
+ }, [draft, transition, editable, p.isInspectorPaneOpen, t]);
1233
+ useEffect(() => {
1234
+ const host = ref.current;
1235
+ if (!host) {
1236
+ return;
1237
+ }
1238
+ const request = (event) => {
1239
+ const intent = event.detail;
1240
+ const patch = ribbonTransitionsDraftPatch(intent);
1241
+ if (patch) {
1242
+ p.onTransitionChange(ribbonTransitionUpdates({ ...draft, ...patch }));
1243
+ return;
1244
+ }
1245
+ switch (intent.kind) {
1246
+ case "preview":
1247
+ playSlideTransitionPreview(transition, document);
1248
+ break;
1249
+ case "applyToAll":
1250
+ p.onApplyTransitionToAll();
1251
+ break;
1252
+ case "inspector":
1253
+ p.onToggleInspector();
1254
+ break;
1255
+ case "soundPreview": {
1256
+ const url = ribbonTransitionStockSoundUrl(transition);
1257
+ if (url) {
1258
+ playAnimationSound(url);
1259
+ }
1260
+ break;
1261
+ }
1262
+ default:
1263
+ void ribbonTransitionsSoundChange(intent).then((change) => {
1264
+ if (change) {
1265
+ p.onTransitionChange(change);
1605
1266
  }
1606
- ),
1607
- popup
1608
- ]
1267
+ return void 0;
1268
+ });
1609
1269
  }
1610
- );
1611
- }
1612
- return /* @__PURE__ */ jsxs("div", { ref: dropdown.ref, ...controlAttrs, className: "relative inline-flex items-center", children: [
1613
- /* @__PURE__ */ jsxs(
1614
- "button",
1615
- {
1616
- type: "button",
1617
- "data-pptx-chrome": chevronOnly ? "gallery-caret" : void 0,
1618
- ...galleryAttrs,
1619
- "aria-haspopup": "true",
1620
- "aria-expanded": open,
1621
- "aria-label": title,
1622
- title,
1623
- disabled,
1624
- onMouseDown: (event) => event.preventDefault(),
1625
- onClick: () => dropdown.setOpen((v) => !v),
1626
- className: chevronOnly ? "inline-flex items-center self-stretch px-0.5 hover:bg-accent disabled:cursor-not-allowed disabled:opacity-40" : pill,
1627
- children: [
1628
- !chevronOnly && icon,
1629
- !chevronOnly && /* @__PURE__ */ jsx("span", { className: "whitespace-nowrap", children: title }),
1630
- /* @__PURE__ */ jsx(LuChevronDown, { className: "h-3 w-3" })
1631
- ]
1270
+ };
1271
+ host.addEventListener("transitions-request", request);
1272
+ return () => host.removeEventListener("transitions-request", request);
1273
+ }, [draft, transition, p]);
1274
+ return /* @__PURE__ */ jsx("pptx-ui-ribbon-transitions", { ref });
1275
+ }
1276
+ function DesignSection(p) {
1277
+ const { t } = useTranslation();
1278
+ const actions = {
1279
+ "design.themes.browseThemes": p.onToggleThemeGallery,
1280
+ "design.themes.editTheme": p.onToggleThemeEditor,
1281
+ "design.customize.slideSize": p.onOpenSlideSize ?? p.onOpenDocumentProperties,
1282
+ "design.customize.formatBackground": p.onToggleInspector
1283
+ };
1284
+ const state = {
1285
+ editable: p.canEdit,
1286
+ galleryOpen: p.isThemeGalleryOpen,
1287
+ editorOpen: p.isThemeEditorOpen,
1288
+ backgroundOpen: p.isInspectorPaneOpen,
1289
+ hasSlideSize: Boolean(actions["design.customize.slideSize"]),
1290
+ hasBackground: Boolean(p.onToggleInspector)
1291
+ };
1292
+ return /* @__PURE__ */ jsx(Fragment, { children: DESIGN_RIBBON_GROUPS.map((group) => /* @__PURE__ */ jsxs(WebRibbonGroup, { groupId: group.id, label: t(group.labelKey), children: [
1293
+ DESIGN_RIBBON_COMMANDS.filter((command) => command.id.startsWith(`${group.id}.`)).map(
1294
+ (command) => {
1295
+ const view = designCommandState(command.id, state);
1296
+ return view.hidden ? null : /* @__PURE__ */ jsx(
1297
+ WebRibbonCommand,
1298
+ {
1299
+ controlId: command.id,
1300
+ label: t(command.labelKey),
1301
+ title: t(command.titleKey),
1302
+ icon: command.icon,
1303
+ compact: true,
1304
+ disabled: view.disabled,
1305
+ active: view.active,
1306
+ expanded: view.expanded,
1307
+ onCommand: () => actions[command.id]?.()
1308
+ },
1309
+ command.id
1310
+ );
1632
1311
  }
1633
1312
  ),
1634
- popup
1635
- ] });
1313
+ FIXED_TAB_GALLERIES.filter(
1314
+ (placement) => placement.control.startsWith(`${group.id}.`)
1315
+ ).map((placement) => /* @__PURE__ */ jsx(
1316
+ RibbonGallery,
1317
+ {
1318
+ placement,
1319
+ icon: placement.gallery === "themeFonts" ? /* @__PURE__ */ jsx(LuType, {}) : /* @__PURE__ */ jsx(LuPalette, {})
1320
+ },
1321
+ placement.control
1322
+ ))
1323
+ ] }, group.id)) });
1636
1324
  }
1637
- function useTransitionSoundPicker(activeSlide, onTransitionChange) {
1638
- const soundFileInputRef = React6.useRef(null);
1639
- const handleSoundFilePicked = React6.useCallback(
1640
- (file) => {
1641
- void readSoundFileAsDataUrl(file).then((dataUrl) => {
1642
- if (dataUrl) {
1643
- onTransitionChange(applyTransitionSoundFile({ name: file.name, dataUrl }));
1644
- }
1645
- return void 0;
1646
- });
1647
- },
1648
- [onTransitionChange]
1649
- );
1650
- const handleSoundSelectChange = React6.useCallback(
1651
- (event) => {
1652
- const value = event.target.value;
1653
- if (value === TRANSITION_SOUND_OTHER_VALUE) {
1654
- soundFileInputRef.current?.click();
1655
- event.target.value = transitionSoundSelectedValue(activeSlide?.transition);
1656
- return;
1657
- }
1658
- if (value === TRANSITION_SOUND_NONE_VALUE) {
1659
- onTransitionChange(clearTransitionSound());
1325
+ var DEFAULT_VALUE = {
1326
+ recentColors: [],
1327
+ pushColor: () => {
1328
+ }
1329
+ };
1330
+ var RecentColorsContext = createContext(DEFAULT_VALUE);
1331
+ var RecentColorsProvider = RecentColorsContext.Provider;
1332
+ function useRecentColors() {
1333
+ return useContext(RecentColorsContext);
1334
+ }
1335
+ function DrawSection(p) {
1336
+ const { t } = useTranslation();
1337
+ const { pushColor, recentColors } = useRecentColors();
1338
+ const ref = useRef(null);
1339
+ useEffect(() => {
1340
+ const host = ref.current;
1341
+ if (!host) {
1342
+ return;
1343
+ }
1344
+ host.state = {
1345
+ tool: p.activeTool,
1346
+ color: p.drawingColor,
1347
+ width: p.drawingWidth,
1348
+ editable: p.canEdit !== false,
1349
+ recentColors,
1350
+ translate: t
1351
+ };
1352
+ }, [p, recentColors, t]);
1353
+ useEffect(() => {
1354
+ const host = ref.current;
1355
+ if (!host) {
1356
+ return;
1357
+ }
1358
+ const request = (event) => {
1359
+ if (p.canEdit === false) {
1660
1360
  return;
1661
1361
  }
1662
- const patch = applyTransitionStockSound(value);
1663
- if (patch) {
1664
- onTransitionChange(patch);
1665
- }
1666
- },
1667
- [activeSlide, onTransitionChange]
1668
- );
1669
- const handleSoundFileChange = React6.useCallback(
1670
- (event) => {
1671
- const file = event.target.files?.[0];
1672
- if (file) {
1673
- handleSoundFilePicked(file);
1362
+ const intent = event.detail;
1363
+ switch (intent.kind) {
1364
+ case "tool":
1365
+ p.onSetActiveTool(intent.value);
1366
+ break;
1367
+ case "width":
1368
+ p.onSetDrawingWidth(intent.value);
1369
+ break;
1370
+ case "color":
1371
+ p.onSetDrawingColor(intent.value);
1372
+ if (intent.committed) {
1373
+ pushColor(intent.value);
1374
+ }
1674
1375
  }
1675
- event.target.value = "";
1676
- },
1677
- [handleSoundFilePicked]
1678
- );
1679
- const stockSoundId = transitionStockSoundId(activeSlide?.transition);
1680
- const handleSoundPreview = React6.useCallback(() => {
1681
- if (!stockSoundId) {
1376
+ };
1377
+ host.addEventListener("draw-request", request);
1378
+ return () => host.removeEventListener("draw-request", request);
1379
+ }, [p, pushColor]);
1380
+ return /* @__PURE__ */ jsx("pptx-ui-ribbon-draw", { ref });
1381
+ }
1382
+ var ViewerCustomizationContext = createContext(
1383
+ EMPTY_RESOLVED_CUSTOMIZATION
1384
+ );
1385
+ function useViewerCustomizationContext() {
1386
+ return useContext(ViewerCustomizationContext);
1387
+ }
1388
+ function useHostEvent(ref, type, handler) {
1389
+ useEffect(() => {
1390
+ const host = ref.current;
1391
+ if (!host || !handler) {
1682
1392
  return;
1683
1393
  }
1684
- const asset = getEffectSoundAsset(stockSoundId);
1685
- if (asset) {
1686
- playAnimationSound(asset.dataUrl);
1394
+ host.addEventListener(type, handler);
1395
+ return () => host.removeEventListener(type, handler);
1396
+ }, [ref, type, handler]);
1397
+ }
1398
+ function WebSearch({
1399
+ value,
1400
+ disabled = false,
1401
+ onInput,
1402
+ onChange,
1403
+ onFocus,
1404
+ onBlur,
1405
+ onKeyDown,
1406
+ ...rest
1407
+ }) {
1408
+ const ref = useRef(null);
1409
+ useLayoutEffect(() => {
1410
+ if (ref.current) {
1411
+ ref.current.value = value;
1412
+ ref.current.disabled = disabled;
1687
1413
  }
1688
- }, [stockSoundId]);
1689
- return {
1690
- soundFileInputRef,
1691
- stockSoundId,
1692
- handleSoundSelectChange,
1693
- handleSoundFileChange,
1694
- handleSoundPreview
1695
- };
1696
- }
1697
- function TransitionsSection(p) {
1698
- const { t } = useTranslation();
1699
- const canEdit = p.canEdit !== false;
1700
- const draft = React6.useMemo(() => readRibbonTransitionDraft(p.activeSlide), [p.activeSlide]);
1701
- const [durationBuffer, setDurationBuffer] = React6.useState(null);
1702
- const [advanceBuffer, setAdvanceBuffer] = React6.useState(null);
1703
- const commit = React6.useCallback(
1704
- (changes) => {
1705
- p.onTransitionChange(ribbonTransitionUpdates({ ...draft, ...changes }));
1706
- },
1707
- [draft, p]
1708
- );
1709
- const {
1710
- soundFileInputRef,
1711
- stockSoundId,
1712
- handleSoundSelectChange,
1713
- handleSoundFileChange,
1714
- handleSoundPreview
1715
- } = useTransitionSoundPicker(p.activeSlide, p.onTransitionChange);
1716
- return /* @__PURE__ */ jsxs(Fragment, { children: [
1717
- /* @__PURE__ */ jsx(RibbonGroupScope, { id: "transitions.preview", children: /* @__PURE__ */ jsxs(
1718
- "button",
1719
- {
1720
- type: "button",
1721
- className: pill,
1722
- title: t("pptx.ribbon.previewTransition"),
1723
- onClick: () => playSlideTransitionPreview(p.activeSlide?.transition, document),
1724
- ...controlAttr("transitions.preview.preview"),
1725
- children: [
1726
- /* @__PURE__ */ jsx(LuPlay, { className: ics }),
1727
- t("pptx.ribbon.preview")
1728
- ]
1729
- }
1730
- ) }),
1731
- sep,
1732
- /* @__PURE__ */ jsx(RibbonGroupScope, { id: "transitions.transitionToThisSlide", children: /* @__PURE__ */ jsx(
1733
- "div",
1734
- {
1735
- className: "inline-flex items-center gap-0.5 overflow-x-auto max-w-[420px]",
1736
- ...controlAttr("transitions.transitionToThisSlide.gallery"),
1737
- children: RIBBON_TRANSITION_PRESETS.map((preset) => /* @__PURE__ */ jsx(
1738
- "button",
1739
- {
1740
- type: "button",
1741
- disabled: !canEdit,
1742
- onClick: () => commit({ type: preset.type }),
1743
- className: cn(
1744
- "flex-shrink-0 px-2 py-1 max-md:min-h-[44px] rounded border text-[11px] leading-tight transition-colors",
1745
- draft.type === preset.type ? "border-primary bg-primary/10 text-primary font-medium" : "border-border bg-muted hover:bg-accent text-foreground"
1746
- ),
1747
- title: t("pptx.ribbon.transitionTitle", { name: t(preset.labelKey) }),
1748
- children: t(preset.labelKey)
1749
- },
1750
- preset.type
1751
- ))
1752
- }
1753
- ) }),
1754
- sep,
1755
- /* @__PURE__ */ jsxs(RibbonGroupScope, { id: "transitions.timing", children: [
1756
- /* @__PURE__ */ jsxs(
1757
- "label",
1758
- {
1759
- className: "inline-flex items-center gap-1.5 text-xs text-muted-foreground",
1760
- ...controlAttr("transitions.timing.duration"),
1761
- children: [
1762
- /* @__PURE__ */ jsx("span", { className: "whitespace-nowrap", children: t("pptx.ribbon.duration") }),
1763
- /* @__PURE__ */ jsx(
1764
- "input",
1765
- {
1766
- type: "number",
1767
- min: 0,
1768
- max: 20,
1769
- step: 0.25,
1770
- disabled: !canEdit,
1771
- value: durationBuffer ?? String(draft.durationSec),
1772
- onChange: (e) => {
1773
- setDurationBuffer(e.target.value);
1774
- const seconds = Number(e.target.value);
1775
- if (Number.isFinite(seconds) && e.target.value !== "") {
1776
- commit({ durationSec: seconds });
1777
- }
1778
- },
1779
- onBlur: () => setDurationBuffer(null),
1780
- className: "w-16 px-1.5 py-1 rounded border border-border bg-muted text-xs text-foreground text-center",
1781
- title: t("pptx.ribbon.transitionDurationTitle")
1782
- }
1783
- )
1784
- ]
1785
- }
1786
- ),
1787
- sep,
1788
- /* @__PURE__ */ jsxs(
1789
- "label",
1790
- {
1791
- className: "inline-flex items-center gap-1.5 text-xs text-muted-foreground",
1792
- ...controlAttr("transitions.timing.sound"),
1793
- children: [
1794
- /* @__PURE__ */ jsx("span", { className: "whitespace-nowrap", children: t("pptx.ribbon.sound") }),
1795
- /* @__PURE__ */ jsx(
1796
- "select",
1797
- {
1798
- "aria-label": t("pptx.ribbon.sound"),
1799
- className: "w-24 px-1.5 py-1 rounded border border-border bg-muted text-xs text-foreground disabled:opacity-50",
1800
- disabled: !canEdit,
1801
- value: transitionSoundSelectedValue(p.activeSlide?.transition),
1802
- onChange: handleSoundSelectChange,
1803
- children: transitionSoundOptions(p.activeSlide?.transition).map((option) => /* @__PURE__ */ jsx("option", { value: option.value, children: option.i18nKey ? t(option.i18nKey) : option.label }, option.value))
1804
- }
1805
- ),
1806
- /* @__PURE__ */ jsx(
1807
- "button",
1808
- {
1809
- type: "button",
1810
- "aria-label": t("pptx.animation.sound.preview"),
1811
- onClick: handleSoundPreview,
1812
- disabled: !stockSoundId,
1813
- className: "shrink-0 rounded border border-border bg-muted p-1 disabled:opacity-40",
1814
- children: /* @__PURE__ */ jsx(LuPlay, { className: "h-3 w-3" })
1815
- }
1816
- ),
1817
- /* @__PURE__ */ jsx(
1818
- "input",
1819
- {
1820
- ref: soundFileInputRef,
1821
- type: "file",
1822
- accept: "audio/*",
1823
- className: "hidden",
1824
- onChange: handleSoundFileChange
1825
- }
1826
- )
1827
- ]
1828
- }
1829
- ),
1830
- sep,
1831
- /* @__PURE__ */ jsxs(
1832
- "button",
1833
- {
1834
- type: "button",
1835
- disabled: !canEdit,
1836
- className: pill,
1837
- title: t("pptx.ribbon.applyTransitionToAll"),
1838
- ...controlAttr("transitions.timing.applyToAll"),
1839
- onClick: p.onApplyTransitionToAll,
1840
- children: [
1841
- /* @__PURE__ */ jsx(LuCopy, { className: ics }),
1842
- t("pptx.headerFooter.applyToAll")
1843
- ]
1844
- }
1845
- ),
1846
- sep,
1847
- /* @__PURE__ */ jsxs("div", { className: "inline-flex flex-col gap-1 text-xs text-muted-foreground", children: [
1848
- /* @__PURE__ */ jsx("span", { className: "text-[10px] font-medium text-foreground", children: t("pptx.ribbon.advanceSlide") }),
1849
- /* @__PURE__ */ jsxs(
1850
- "label",
1851
- {
1852
- className: "inline-flex items-center gap-1.5 cursor-pointer",
1853
- ...controlAttr("transitions.timing.advanceOnClick"),
1854
- children: [
1855
- /* @__PURE__ */ jsx(
1856
- "input",
1857
- {
1858
- type: "checkbox",
1859
- disabled: !canEdit,
1860
- checked: draft.advanceOnClick,
1861
- onChange: (e) => commit({ advanceOnClick: e.target.checked }),
1862
- className: "accent-primary h-3 w-3"
1863
- }
1864
- ),
1865
- /* @__PURE__ */ jsx("span", { className: "whitespace-nowrap", children: t("pptx.ribbon.onMouseClick") })
1866
- ]
1867
- }
1868
- ),
1869
- /* @__PURE__ */ jsxs(
1870
- "label",
1871
- {
1872
- className: "inline-flex items-center gap-1.5 cursor-pointer",
1873
- ...controlAttr("transitions.timing.advanceAfter"),
1874
- children: [
1875
- /* @__PURE__ */ jsx(
1876
- "input",
1877
- {
1878
- type: "checkbox",
1879
- "aria-label": t("pptx.ribbon.afterDuration"),
1880
- disabled: !canEdit,
1881
- checked: draft.advanceAfter,
1882
- onChange: (e) => commit({ advanceAfter: e.target.checked }),
1883
- className: "accent-primary h-3 w-3"
1884
- }
1885
- ),
1886
- /* @__PURE__ */ jsx("span", { className: "whitespace-nowrap", children: t("pptx.ribbon.afterDuration") }),
1887
- /* @__PURE__ */ jsx(
1888
- "input",
1889
- {
1890
- type: "text",
1891
- "aria-label": t("pptx.ribbon.advanceAfterSeconds"),
1892
- value: advanceBuffer ?? draft.advanceAfterText,
1893
- onChange: (e) => {
1894
- setAdvanceBuffer(e.target.value);
1895
- commit({ advanceAfter: true, advanceAfterText: e.target.value });
1896
- },
1897
- onBlur: () => setAdvanceBuffer(null),
1898
- disabled: !canEdit || !draft.advanceAfter,
1899
- className: "w-16 px-1 py-0.5 rounded border border-border bg-muted text-xs text-foreground text-center disabled:opacity-50",
1900
- title: t("pptx.ribbon.advanceAfterSeconds")
1901
- }
1902
- )
1903
- ]
1904
- }
1905
- )
1906
- ] })
1907
- ] }),
1908
- sep,
1909
- /* @__PURE__ */ jsxs(
1910
- "button",
1911
- {
1912
- type: "button",
1913
- onClick: p.onToggleInspector,
1914
- className: cn(
1915
- pill,
1916
- p.isInspectorPaneOpen ? "bg-primary hover:bg-primary/80 text-white" : ""
1917
- ),
1918
- title: t("pptx.ribbon.openInspectorTransitions"),
1919
- children: [
1920
- /* @__PURE__ */ jsx(LuPanelRight, { className: ic }),
1921
- t("pptx.ribbon.inspector")
1922
- ]
1923
- }
1924
- )
1925
- ] });
1926
- }
1927
- var DESIGN_VARIANT_GALLERIES = FIXED_TAB_GALLERIES.filter(
1928
- (placement) => placement.control.startsWith("design.variants.")
1929
- );
1930
- function DesignSection(p) {
1931
- const { t } = useTranslation();
1932
- return /* @__PURE__ */ jsxs(Fragment, { children: [
1933
- /* @__PURE__ */ jsxs(RibbonGroupScope, { id: "design.themes", children: [
1934
- /* @__PURE__ */ jsxs(
1935
- "button",
1936
- {
1937
- onClick: p.onToggleThemeGallery,
1938
- disabled: !p.canEdit,
1939
- className: cn(
1940
- pill,
1941
- p.isThemeGalleryOpen ? "bg-primary hover:bg-primary/80 text-white" : ""
1942
- ),
1943
- title: t("pptx.ribbon.browseThemesTitle"),
1944
- ...controlAttr("design.themes.browseThemes"),
1945
- children: [
1946
- /* @__PURE__ */ jsx(LuPalette, { className: ics }),
1947
- t("pptx.ribbon.browseThemes")
1948
- ]
1949
- }
1950
- ),
1951
- /* @__PURE__ */ jsxs(
1952
- "button",
1953
- {
1954
- onClick: p.onToggleThemeEditor,
1955
- disabled: !p.canEdit,
1956
- className: cn(
1957
- pill,
1958
- p.isThemeEditorOpen ? "bg-primary hover:bg-primary/80 text-white" : ""
1959
- ),
1960
- title: t("pptx.ribbon.editThemeTitle"),
1961
- ...controlAttr("design.themes.editTheme"),
1962
- children: [
1963
- /* @__PURE__ */ jsx(LuPencil, { className: ics }),
1964
- t("pptx.ribbon.editTheme")
1965
- ]
1966
- }
1967
- )
1968
- ] }),
1969
- sep,
1970
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-0.5", ...groupAttr("design.variants"), children: [
1971
- /* @__PURE__ */ jsx("div", { className: "flex items-center gap-1", children: DESIGN_VARIANT_GALLERIES.map((placement) => /* @__PURE__ */ jsx(
1972
- RibbonGallery,
1973
- {
1974
- placement,
1975
- icon: placement.gallery === "themeFonts" ? /* @__PURE__ */ jsx(LuType, { className: ics }) : /* @__PURE__ */ jsx(LuPalette, { className: ics })
1976
- },
1977
- placement.control
1978
- )) }),
1979
- /* @__PURE__ */ jsx("span", { className: "text-[9px] text-muted-foreground leading-none", children: t("pptx.ribbon.groupVariants") })
1980
- ] }),
1981
- sep,
1982
- /* @__PURE__ */ jsxs(RibbonGroupScope, { id: "design.customize", children: [
1983
- (p.onOpenSlideSize ?? p.onOpenDocumentProperties) && /* @__PURE__ */ jsxs(
1984
- "button",
1985
- {
1986
- onClick: p.onOpenSlideSize ?? p.onOpenDocumentProperties,
1987
- className: pill,
1988
- title: t("pptx.ribbon.slideSizeTitle"),
1989
- ...controlAttr("design.customize.slideSize"),
1990
- children: [
1991
- /* @__PURE__ */ jsx(LuMonitor, { className: ics }),
1992
- t("pptx.ribbon.slideSize")
1993
- ]
1994
- }
1995
- ),
1996
- p.onToggleInspector && /* @__PURE__ */ jsxs(
1997
- "button",
1998
- {
1999
- onClick: p.onToggleInspector,
2000
- className: cn(
2001
- pill,
2002
- p.isInspectorPaneOpen ? "bg-primary hover:bg-primary/80 text-white" : ""
2003
- ),
2004
- title: t("pptx.ribbon.formatBackgroundTitle"),
2005
- ...controlAttr("design.customize.formatBackground"),
2006
- children: [
2007
- /* @__PURE__ */ jsx(LuPaintBucket, { className: ics }),
2008
- t("pptx.ribbon.formatBackground")
2009
- ]
2010
- }
2011
- )
2012
- ] })
2013
- ] });
2014
- }
2015
- var DEFAULT_VALUE = {
2016
- recentColors: [],
2017
- pushColor: () => {
2018
- }
2019
- };
2020
- var RecentColorsContext = createContext(DEFAULT_VALUE);
2021
- var RecentColorsProvider = RecentColorsContext.Provider;
2022
- function useRecentColors() {
2023
- return useContext(RecentColorsContext);
2024
- }
2025
- var DRAW_TOOL_CONTROL = {
2026
- select: "draw.tools.select",
2027
- pen: "draw.tools.pen",
2028
- highlighter: "draw.tools.highlighter",
2029
- eraser: "draw.tools.eraser"
2030
- };
2031
- function DrawSection(p) {
2032
- const { t } = useTranslation();
2033
- const { pushColor } = useRecentColors();
2034
- const colorRef = useRef(null);
2035
- useEffect(() => {
2036
- const el = colorRef.current;
2037
- if (!el) {
2038
- return;
2039
- }
2040
- const handler = () => pushColor(el.value);
2041
- el.addEventListener("change", handler);
2042
- return () => el.removeEventListener("change", handler);
2043
- }, [pushColor]);
2044
- return /* @__PURE__ */ jsxs(RibbonGroupScope, { id: "draw.tools", children: [
2045
- /* @__PURE__ */ jsx("div", { className: grp, children: DRAW_TOOLS.map((tool, i, a) => /* @__PURE__ */ jsx(
2046
- "button",
2047
- {
2048
- type: "button",
2049
- onClick: () => p.onSetActiveTool(tool.id),
2050
- className: cn(
2051
- i < a.length - 1 ? gB : gL,
2052
- p.activeTool === tool.id ? tool.ac ?? "bg-accent text-foreground" : ""
2053
- ),
2054
- title: t(tool.labelKey),
2055
- ...controlAttr(DRAW_TOOL_CONTROL[tool.id]),
2056
- children: tool.icon
2057
- },
2058
- tool.id
2059
- )) }),
2060
- /* @__PURE__ */ jsxs("div", { className: "inline-flex items-center gap-2 text-xs", children: [
2061
- /* @__PURE__ */ jsxs(
2062
- "label",
2063
- {
2064
- className: "inline-flex items-center gap-1 text-muted-foreground",
2065
- title: t("pptx.ribbon.penColour"),
2066
- ...controlAttr("draw.tools.penColor"),
2067
- children: [
2068
- t("pptx.ribbon.colour"),
2069
- /* @__PURE__ */ jsx(
2070
- "input",
2071
- {
2072
- ref: colorRef,
2073
- type: "color",
2074
- value: p.drawingColor,
2075
- onChange: (e) => p.onSetDrawingColor(e.target.value),
2076
- className: "w-6 h-6 rounded border border-border bg-transparent cursor-pointer"
2077
- }
2078
- )
2079
- ]
2080
- }
2081
- ),
2082
- /* @__PURE__ */ jsxs(
2083
- "label",
2084
- {
2085
- className: "inline-flex items-center gap-1 text-muted-foreground",
2086
- title: t("pptx.ribbon.strokeWidth"),
2087
- ...controlAttr("draw.tools.penWidth"),
2088
- children: [
2089
- t("pptx.ribbon.width"),
2090
- /* @__PURE__ */ jsx(
2091
- "input",
2092
- {
2093
- type: "range",
2094
- min: 1,
2095
- max: 12,
2096
- value: p.drawingWidth,
2097
- onChange: (e) => p.onSetDrawingWidth(Number(e.target.value)),
2098
- className: "w-16 h-1 accent-primary"
2099
- }
2100
- ),
2101
- /* @__PURE__ */ jsx("span", { className: "text-foreground w-4 text-right", children: p.drawingWidth })
2102
- ]
2103
- }
2104
- )
2105
- ] })
2106
- ] });
2107
- }
2108
- var ViewerCustomizationContext = createContext(
2109
- EMPTY_RESOLVED_CUSTOMIZATION
2110
- );
2111
- function useViewerCustomizationContext() {
2112
- return useContext(ViewerCustomizationContext);
2113
- }
2114
- function useHostEvent(ref, type, handler) {
2115
- useEffect(() => {
2116
- const host = ref.current;
2117
- if (!host || !handler) {
2118
- return;
2119
- }
2120
- host.addEventListener(type, handler);
2121
- return () => host.removeEventListener(type, handler);
2122
- }, [ref, type, handler]);
2123
- }
2124
- function WebSearch({
2125
- value,
2126
- disabled = false,
2127
- onInput,
2128
- onChange,
2129
- onFocus,
2130
- onBlur,
2131
- onKeyDown,
2132
- ...rest
2133
- }) {
2134
- const ref = useRef(null);
2135
- useLayoutEffect(() => {
2136
- if (ref.current) {
2137
- ref.current.value = value;
2138
- ref.current.disabled = disabled;
2139
- }
2140
- }, [value, disabled]);
2141
- useHostEvent(ref, "input", onInput);
2142
- useHostEvent(ref, "change", onChange);
2143
- useHostEvent(ref, "focusin", onFocus);
2144
- useHostEvent(ref, "focusout", onBlur);
2145
- useHostEvent(ref, "keydown", onKeyDown);
2146
- return /* @__PURE__ */ jsx("pptx-ui-search", { ref, value, disabled: disabled || void 0, ...rest });
1414
+ }, [value, disabled]);
1415
+ useHostEvent(ref, "input", onInput);
1416
+ useHostEvent(ref, "change", onChange);
1417
+ useHostEvent(ref, "focusin", onFocus);
1418
+ useHostEvent(ref, "focusout", onBlur);
1419
+ useHostEvent(ref, "keydown", onKeyDown);
1420
+ return /* @__PURE__ */ jsx("pptx-ui-search", { ref, value, disabled: disabled || void 0, ...rest });
2147
1421
  }
2148
1422
  function WebSelect({
2149
1423
  value,
@@ -2225,7 +1499,7 @@ function AccountPage() {
2225
1499
  return void 0;
2226
1500
  });
2227
1501
  };
2228
- const version = "4.15.0" ;
1502
+ const version = "4.16.1" ;
2229
1503
  return /* @__PURE__ */ jsxs("div", { className: "mt-8 max-w-[700px] space-y-6", children: [
2230
1504
  /* @__PURE__ */ jsxs("section", { className: cardClass, children: [
2231
1505
  /* @__PURE__ */ jsxs("h2", { className: "flex items-center gap-2 text-sm font-semibold", children: [
@@ -2627,76 +1901,69 @@ function FileSection(p) {
2627
1901
  }
2628
1902
  );
2629
1903
  }
2630
- function ClipboardGroup(p) {
1904
+ function WebHomeControls({
1905
+ family,
1906
+ controls,
1907
+ onRequest
1908
+ }) {
2631
1909
  const { t } = useTranslation();
2632
- const [copiedFeedback, setCopiedFeedback] = useState(false);
2633
- const [cutFeedback, setCutFeedback] = useState(false);
2634
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-0.5", ...groupAttr("home.clipboard"), children: [
2635
- /* @__PURE__ */ jsxs("div", { className: grp, children: [
2636
- /* @__PURE__ */ jsx(
2637
- "button",
2638
- {
2639
- type: "button",
2640
- onClick: p.onPaste,
2641
- disabled: !p.canPaste || !p.canEdit,
2642
- className: gB,
2643
- title: t("pptx.arrange.paste"),
2644
- ...controlAttr("home.clipboard.paste"),
2645
- children: /* @__PURE__ */ jsx(LuClipboardPaste, { className: ic })
2646
- }
2647
- ),
2648
- /* @__PURE__ */ jsx(
2649
- "button",
2650
- {
2651
- type: "button",
2652
- onClick: () => {
2653
- p.onCut();
2654
- setCutFeedback(true);
2655
- setTimeout(() => setCutFeedback(false), 600);
2656
- },
2657
- disabled: !p.canEdit || !p.hasSelection,
2658
- className: cn(gB, cutFeedback && "bg-green-600/20 text-green-400"),
2659
- title: t("pptx.arrange.cut"),
2660
- ...controlAttr("home.clipboard.cut"),
2661
- children: /* @__PURE__ */ jsx(LuScissors, { className: ic })
2662
- }
2663
- ),
2664
- /* @__PURE__ */ jsx(
2665
- "button",
2666
- {
2667
- type: "button",
2668
- onClick: () => {
2669
- p.onCopy();
2670
- setCopiedFeedback(true);
2671
- setTimeout(() => setCopiedFeedback(false), 600);
2672
- },
2673
- disabled: !p.hasSelection,
2674
- className: cn(gB, copiedFeedback && "bg-green-600/20 text-green-400"),
2675
- title: t("pptx.arrange.copy"),
2676
- ...controlAttr("home.clipboard.copy"),
2677
- children: /* @__PURE__ */ jsx(LuCopy, { className: ic })
2678
- }
2679
- ),
2680
- p.onToggleFormatPainter && /* @__PURE__ */ jsx(
2681
- "button",
2682
- {
2683
- type: "button",
2684
- onClick: p.onToggleFormatPainter,
2685
- disabled: !p.canEdit || p.canActivateFormatPainter === false && !p.formatPainterActive,
2686
- "data-testid": "format-painter-toggle",
2687
- "data-active": p.formatPainterActive ? "true" : "false",
2688
- className: cn(
2689
- gL,
2690
- p.formatPainterActive ? "bg-amber-600 hover:bg-amber-500 text-amber-50" : ""
2691
- ),
2692
- title: t("pptx.arrange.formatPainter"),
2693
- ...controlAttr("home.clipboard.formatPainter"),
2694
- children: /* @__PURE__ */ jsx(LuPaintbrush, { className: ic })
2695
- }
2696
- )
2697
- ] }),
2698
- /* @__PURE__ */ jsx("span", { className: "text-[9px] text-muted-foreground leading-none", children: t("pptx.ribbon.clipboard") })
2699
- ] });
1910
+ const ref = useRef(null);
1911
+ useEffect(() => {
1912
+ if (ref.current) {
1913
+ ref.current.state = { controls, translate: t };
1914
+ }
1915
+ }, [controls, t]);
1916
+ useEffect(() => {
1917
+ const host = ref.current;
1918
+ if (!host) {
1919
+ return;
1920
+ }
1921
+ const listener = (event) => onRequest(event.detail.id);
1922
+ host.addEventListener("home-request", listener);
1923
+ return () => host.removeEventListener("home-request", listener);
1924
+ }, [onRequest]);
1925
+ return React95.createElement(`pptx-ui-ribbon-home-${family}`, { ref });
1926
+ }
1927
+ function ClipboardGroup(p) {
1928
+ const { canEdit, hasSelection, canPaste: canPaste2, formatPainterActive, canActivateFormatPainter } = p;
1929
+ const { onPaste, onCut, onCopy, onToggleFormatPainter } = p;
1930
+ const controls = useMemo(
1931
+ () => clipboardHomeControls({
1932
+ editable: canEdit,
1933
+ hasSelection,
1934
+ hasClipboard: canPaste2,
1935
+ formatPainterActive: Boolean(formatPainterActive),
1936
+ canFormatPaint: canActivateFormatPainter !== false,
1937
+ showFormatPainter: Boolean(onToggleFormatPainter)
1938
+ }),
1939
+ [
1940
+ canEdit,
1941
+ hasSelection,
1942
+ canPaste2,
1943
+ formatPainterActive,
1944
+ canActivateFormatPainter,
1945
+ onToggleFormatPainter
1946
+ ]
1947
+ );
1948
+ const request = useCallback(
1949
+ (id) => {
1950
+ switch (id) {
1951
+ case "home.clipboard.paste":
1952
+ onPaste();
1953
+ break;
1954
+ case "home.clipboard.cut":
1955
+ onCut();
1956
+ break;
1957
+ case "home.clipboard.copy":
1958
+ onCopy();
1959
+ break;
1960
+ case "home.clipboard.formatPainter":
1961
+ onToggleFormatPainter?.();
1962
+ }
1963
+ },
1964
+ [onPaste, onCut, onCopy, onToggleFormatPainter]
1965
+ );
1966
+ return /* @__PURE__ */ jsx(WebHomeControls, { family: "clipboard", controls, onRequest: request });
2700
1967
  }
2701
1968
  function FontPickers(p) {
2702
1969
  const { t } = useTranslation();
@@ -3239,425 +2506,83 @@ function DateTimeFieldDialog(p) {
3239
2506
  }
3240
2507
  );
3241
2508
  }
3242
- var ICONS3 = {
3243
- freeformShape: LuPenTool,
3244
- curve: LuSpline
3245
- };
3246
- function FreeformToolButtons({
3247
- canEdit,
3248
- activeTool,
3249
- onArm
3250
- }) {
3251
- const { t } = useTranslation();
3252
- const customization = useViewerCustomizationContext();
3253
- const tools = FREEFORM_TOOL_IDS.filter((tool) => isDrawingToolVisible(customization, tool));
3254
- if (tools.length === 0) {
3255
- return null;
3256
- }
3257
- return /* @__PURE__ */ jsx(Fragment, { children: tools.map((tool) => {
3258
- const Icon = ICONS3[tool];
3259
- const active = activeTool === tool;
3260
- return /* @__PURE__ */ jsxs(
3261
- "button",
3262
- {
3263
- type: "button",
3264
- disabled: !canEdit,
3265
- "aria-pressed": active,
3266
- "data-pptx-drawing-tool": tool,
3267
- className: cn(pill, active && "bg-primary/15 text-primary"),
3268
- title: t(FREEFORM_TOOL_LABEL_KEYS[tool]),
3269
- onClick: () => onArm(active ? null : tool),
3270
- children: [
3271
- /* @__PURE__ */ jsx(Icon, { className: ic }),
3272
- t(FREEFORM_TOOL_LABEL_KEYS[tool])
3273
- ]
3274
- },
3275
- tool
3276
- );
3277
- }) });
3278
- }
3279
- function InsertHyperlinkButton(p) {
3280
- const { t } = useTranslation();
3281
- return /* @__PURE__ */ jsxs(
3282
- "button",
3283
- {
3284
- type: "button",
3285
- onClick: p.onOpenHyperlinkDialog,
3286
- disabled: !p.hasSelection,
3287
- className: pill,
3288
- title: t("pptx.hyperlinkDialog.title"),
3289
- ...controlAttr("insert.links.link"),
3290
- children: [
3291
- /* @__PURE__ */ jsx(LuLink, { className: ic }),
3292
- t("pptx.hyperlinkDialog.title")
3293
- ]
3294
- }
3295
- );
3296
- }
3297
2509
  function InsertSection(p) {
3298
2510
  const { t } = useTranslation();
3299
- const { canEdit } = p;
2511
+ const customization = useViewerCustomizationContext();
2512
+ const ref = useRef(null);
3300
2513
  const [datePickerOpen, setDatePickerOpen] = useState(false);
3301
- const [newChartKind, setNewChartKind] = useState(DEFAULT_INSERT_CHART_KIND);
3302
- const actionMenuRef = useRef(null);
3303
- const fieldMenuRef = useRef(null);
3304
- const openDatePicker = () => setDatePickerOpen(true);
3305
- return /* @__PURE__ */ jsxs(Fragment, { children: [
3306
- /* @__PURE__ */ jsx(RibbonGroupScope, { id: "insert.text", children: /* @__PURE__ */ jsxs(
3307
- "button",
3308
- {
3309
- onClick: p.onAddTextBox,
3310
- disabled: !canEdit,
3311
- className: pill,
3312
- title: t("pptx.insert.addTextBox"),
3313
- ...controlAttr("insert.text.textBox"),
3314
- children: [
3315
- /* @__PURE__ */ jsx(LuType, { className: ic }),
3316
- t("pptx.ribbon.textBox")
3317
- ]
3318
- }
3319
- ) }),
3320
- /* @__PURE__ */ jsxs(RibbonGroupScope, { id: "insert.illustrations", children: [
3321
- /* @__PURE__ */ jsxs("div", { className: grp, ...controlAttr("insert.illustrations.shapes"), children: [
3322
- /* @__PURE__ */ jsx(
3323
- "select",
3324
- {
3325
- value: p.newShapeType,
3326
- onChange: (e) => p.onSetNewShapeType(e.target.value),
3327
- className: "bg-transparent py-1.5 pl-2 pr-1 outline-none text-xs",
3328
- title: t("pptx.insert.shapeType"),
3329
- children: SHAPE_PRESETS.map((sp) => /* @__PURE__ */ jsx("option", { value: sp.type, className: "bg-background", children: t(sp.i18nKey) }, sp.type))
3330
- }
3331
- ),
3332
- /* @__PURE__ */ jsxs(
3333
- "button",
3334
- {
3335
- onClick: p.onAddShape,
3336
- disabled: !canEdit,
3337
- className: "inline-flex items-center gap-1.5 px-2.5 py-1.5 border-l border-border hover:bg-accent transition-colors text-xs",
3338
- title: t("pptx.insert.addShape"),
3339
- children: [
3340
- SHAPE_PRESETS.find((sp) => sp.type === p.newShapeType)?.icon || /* @__PURE__ */ jsx(LuSquare, { className: ic }),
3341
- t("pptx.insert.shape")
3342
- ]
3343
- }
3344
- )
3345
- ] }),
3346
- p.onArmFreeformTool && /* @__PURE__ */ jsx(
3347
- FreeformToolButtons,
3348
- {
3349
- canEdit,
3350
- activeTool: p.activeFreeformTool,
3351
- onArm: p.onArmFreeformTool
2514
+ const [chartKind, setChartKind] = useState(DEFAULT_INSERT_CHART_KIND);
2515
+ useEffect(() => {
2516
+ const host = ref.current;
2517
+ if (!host) {
2518
+ return;
2519
+ }
2520
+ host.state = {
2521
+ editable: p.canEdit,
2522
+ hasSelection: p.hasSelection,
2523
+ shapeType: p.newShapeType,
2524
+ chartKind,
2525
+ activeFreeformTool: p.activeFreeformTool ?? null,
2526
+ freeformTools: p.onArmFreeformTool ? FREEFORM_TOOL_IDS.filter((tool) => isDrawingToolVisible(customization, tool)) : [],
2527
+ chartAvailable: Boolean(p.onAddChart),
2528
+ fieldAvailable: Boolean(p.onInsertField),
2529
+ headerFooterAvailable: Boolean(p.onOpenHeaderFooter),
2530
+ translate: t
2531
+ };
2532
+ }, [p, chartKind, customization, t]);
2533
+ useEffect(() => {
2534
+ const host = ref.current;
2535
+ if (!host) {
2536
+ return;
2537
+ }
2538
+ const request = (event) => {
2539
+ const intent = event.detail;
2540
+ switch (intent.kind) {
2541
+ case "command": {
2542
+ const commands = {
2543
+ textBox: p.onAddTextBox,
2544
+ table: p.onAddTable,
2545
+ image: p.onOpenImagePicker,
2546
+ media: p.onOpenMediaPicker,
2547
+ smartArt: p.onAddSmartArt,
2548
+ equation: p.onAddEquation,
2549
+ link: p.onOpenHyperlinkDialog,
2550
+ headerFooter: p.onOpenHeaderFooter
2551
+ };
2552
+ commands[intent.value]?.();
2553
+ break;
3352
2554
  }
3353
- )
3354
- ] }),
3355
- /* @__PURE__ */ jsx(RibbonGroupScope, { id: "insert.images", children: /* @__PURE__ */ jsxs(
3356
- "button",
3357
- {
3358
- onClick: p.onOpenImagePicker,
3359
- disabled: !canEdit,
3360
- className: pill,
3361
- title: t("pptx.ribbon.insertImage"),
3362
- ...controlAttr("insert.images.pictures"),
3363
- children: [
3364
- /* @__PURE__ */ jsx(LuImage, { className: ic }),
3365
- t("pptx.ribbon.image")
3366
- ]
3367
- }
3368
- ) }),
3369
- /* @__PURE__ */ jsx(RibbonGroupScope, { id: "insert.media", children: /* @__PURE__ */ jsxs(
3370
- "button",
3371
- {
3372
- onClick: p.onOpenMediaPicker,
3373
- disabled: !canEdit,
3374
- className: pill,
3375
- title: t("pptx.ribbon.insertMedia"),
3376
- ...controlAttr("insert.media.media"),
3377
- children: [
3378
- /* @__PURE__ */ jsx(LuVideo, { className: ic }),
3379
- t("pptx.ribbon.media")
3380
- ]
3381
- }
3382
- ) }),
3383
- /* @__PURE__ */ jsx(RibbonGroupScope, { id: "insert.tables", children: /* @__PURE__ */ jsxs(
3384
- "button",
3385
- {
3386
- onClick: p.onAddTable,
3387
- disabled: !canEdit,
3388
- className: pill,
3389
- title: t("pptx.insert.insertTable"),
3390
- ...controlAttr("insert.tables.table"),
3391
- children: [
3392
- /* @__PURE__ */ jsx(LuDatabase, { className: ic }),
3393
- t("pptx.ribbon.table")
3394
- ]
3395
- }
3396
- ) }),
3397
- /* @__PURE__ */ jsxs(RibbonGroupScope, { id: "insert.illustrations", children: [
3398
- p.onAddChart && /* @__PURE__ */ jsxs("div", { className: grp, ...controlAttr("insert.illustrations.chart"), children: [
3399
- /* @__PURE__ */ jsx(
3400
- "select",
3401
- {
3402
- value: newChartKind,
3403
- onChange: (e) => {
3404
- const kind = INSERT_CHART_TYPES.find((ct) => ct.id === e.target.value)?.id;
3405
- setNewChartKind(kind ?? DEFAULT_INSERT_CHART_KIND);
3406
- },
3407
- className: "bg-transparent py-1.5 pl-2 pr-1 outline-none text-xs",
3408
- title: t("pptx.ribbon.chartType"),
3409
- children: INSERT_CHART_TYPES.map((ct) => /* @__PURE__ */ jsx("option", { value: ct.id, className: "bg-background", children: t(ct.labelKey) }, ct.id))
3410
- }
3411
- ),
3412
- /* @__PURE__ */ jsxs(
3413
- "button",
3414
- {
3415
- onClick: () => p.onAddChart(newChartKind),
3416
- disabled: !canEdit,
3417
- className: "inline-flex items-center gap-1.5 px-2.5 py-1.5 border-l border-border hover:bg-accent transition-colors text-xs",
3418
- title: t("pptx.ribbon.insertChart"),
3419
- children: [
3420
- /* @__PURE__ */ jsxs(
3421
- "svg",
3422
- {
3423
- className: ic,
3424
- viewBox: "0 0 24 24",
3425
- fill: "none",
3426
- stroke: "currentColor",
3427
- strokeWidth: "2",
3428
- strokeLinecap: "round",
3429
- strokeLinejoin: "round",
3430
- children: [
3431
- /* @__PURE__ */ jsx("path", { d: "M3 3v18h18" }),
3432
- /* @__PURE__ */ jsx("rect", { x: "7", y: "11", width: "3", height: "6" }),
3433
- /* @__PURE__ */ jsx("rect", { x: "12", y: "7", width: "3", height: "10" }),
3434
- /* @__PURE__ */ jsx("rect", { x: "17", y: "13", width: "3", height: "4" })
3435
- ]
3436
- }
3437
- ),
3438
- t("pptx.ribbon.chart")
3439
- ]
2555
+ case "shapeType":
2556
+ p.onSetNewShapeType(intent.value);
2557
+ break;
2558
+ case "shape":
2559
+ p.onAddShape();
2560
+ break;
2561
+ case "chartType":
2562
+ setChartKind(intent.value);
2563
+ break;
2564
+ case "chart":
2565
+ p.onAddChart?.(intent.value);
2566
+ break;
2567
+ case "freeform":
2568
+ p.onArmFreeformTool?.(intent.value);
2569
+ break;
2570
+ case "actionButton":
2571
+ p.onAddActionButton(intent.value);
2572
+ break;
2573
+ case "field":
2574
+ if (intent.value === "datetime") {
2575
+ setDatePickerOpen(true);
2576
+ } else {
2577
+ p.onInsertField?.(intent.value);
3440
2578
  }
3441
- )
3442
- ] }),
3443
- /* @__PURE__ */ jsxs(
3444
- "button",
3445
- {
3446
- onClick: p.onAddSmartArt,
3447
- disabled: !canEdit,
3448
- className: pill,
3449
- title: t("pptx.insert.insertSmartArt"),
3450
- ...controlAttr("insert.illustrations.smartArt"),
3451
- children: [
3452
- /* @__PURE__ */ jsx(LuLayers, { className: ic }),
3453
- t("pptx.ribbon.smartArt")
3454
- ]
3455
- }
3456
- )
3457
- ] }),
3458
- /* @__PURE__ */ jsx(RibbonGroupScope, { id: "insert.symbols", children: /* @__PURE__ */ jsxs(
3459
- "button",
3460
- {
3461
- onClick: p.onAddEquation,
3462
- disabled: !canEdit,
3463
- className: pill,
3464
- title: t("pptx.insert.insertEquation"),
3465
- ...controlAttr("insert.symbols.equation"),
3466
- children: [
3467
- /* @__PURE__ */ jsx(
3468
- "svg",
3469
- {
3470
- className: ic,
3471
- viewBox: "0 0 24 24",
3472
- fill: "none",
3473
- stroke: "currentColor",
3474
- strokeWidth: "2",
3475
- strokeLinecap: "round",
3476
- strokeLinejoin: "round",
3477
- children: /* @__PURE__ */ jsx("path", { d: "M4 17h6M7 14v6M14 7l4.5 10M15.5 14h5" })
3478
- }
3479
- ),
3480
- t("pptx.ribbon.equation")
3481
- ]
3482
- }
3483
- ) }),
3484
- /* @__PURE__ */ jsx(RibbonGroupScope, { id: "insert.links", children: /* @__PURE__ */ jsxs(
3485
- "div",
3486
- {
3487
- className: "relative group inline-flex items-center",
3488
- ref: actionMenuRef,
3489
- ...controlAttr("insert.links.action"),
3490
- children: [
3491
- /* @__PURE__ */ jsxs(
3492
- "button",
3493
- {
3494
- type: "button",
3495
- disabled: !canEdit,
3496
- className: pill,
3497
- title: t("pptx.ribbon.insertActionButton"),
3498
- children: [
3499
- /* @__PURE__ */ jsxs(
3500
- "svg",
3501
- {
3502
- className: ic,
3503
- viewBox: "0 0 24 24",
3504
- fill: "none",
3505
- stroke: "currentColor",
3506
- strokeWidth: "2",
3507
- strokeLinecap: "round",
3508
- strokeLinejoin: "round",
3509
- children: [
3510
- /* @__PURE__ */ jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2" }),
3511
- /* @__PURE__ */ jsx("path", { d: "M13 7l4 5-4 5" })
3512
- ]
3513
- }
3514
- ),
3515
- t("pptx.ribbon.action"),
3516
- /* @__PURE__ */ jsx(LuChevronDown, { className: "w-3 h-3" })
3517
- ]
3518
- }
3519
- ),
3520
- /* @__PURE__ */ jsx(
3521
- RibbonMenu,
3522
- {
3523
- anchorRef: actionMenuRef,
3524
- className: "hidden group-hover:flex flex-col w-40 pt-1",
3525
- children: /* @__PURE__ */ jsx("div", { className: "rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1", children: ACTION_BUTTON_PRESETS.map((preset) => /* @__PURE__ */ jsxs(
3526
- "button",
3527
- {
3528
- type: "button",
3529
- disabled: !canEdit,
3530
- className: "flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",
3531
- onClick: () => p.onAddActionButton(preset.shapeType),
3532
- children: [
3533
- /* @__PURE__ */ jsx(
3534
- "svg",
3535
- {
3536
- className: "w-4 h-4 flex-shrink-0",
3537
- viewBox: "0 0 24 24",
3538
- fill: "none",
3539
- stroke: "currentColor",
3540
- strokeWidth: "2",
3541
- strokeLinecap: "round",
3542
- strokeLinejoin: "round",
3543
- children: /* @__PURE__ */ jsx("path", { d: preset.iconPath })
3544
- }
3545
- ),
3546
- preset.label
3547
- ]
3548
- },
3549
- preset.shapeType
3550
- )) })
3551
- }
3552
- )
3553
- ]
3554
- }
3555
- ) }),
3556
- /* @__PURE__ */ jsx(RibbonGroupScope, { id: "insert.text", children: p.onInsertField && /* @__PURE__ */ jsxs(
3557
- "div",
3558
- {
3559
- className: "relative group inline-flex items-center",
3560
- ref: fieldMenuRef,
3561
- ...controlAttr("insert.text.field"),
3562
- children: [
3563
- /* @__PURE__ */ jsxs(
3564
- "button",
3565
- {
3566
- type: "button",
3567
- disabled: !canEdit,
3568
- className: pill,
3569
- title: t("pptx.field.insertField"),
3570
- children: [
3571
- /* @__PURE__ */ jsxs(
3572
- "svg",
3573
- {
3574
- className: ic,
3575
- viewBox: "0 0 24 24",
3576
- fill: "none",
3577
- stroke: "currentColor",
3578
- strokeWidth: "2",
3579
- strokeLinecap: "round",
3580
- strokeLinejoin: "round",
3581
- children: [
3582
- /* @__PURE__ */ jsx("path", { d: "M4 7h16M4 12h10M4 17h12" }),
3583
- /* @__PURE__ */ jsx("circle", { cx: "19", cy: "15", r: "3" })
3584
- ]
3585
- }
3586
- ),
3587
- t("pptx.field.field"),
3588
- /* @__PURE__ */ jsx(LuChevronDown, { className: "w-3 h-3" })
3589
- ]
3590
- }
3591
- ),
3592
- /* @__PURE__ */ jsx(
3593
- RibbonMenu,
3594
- {
3595
- anchorRef: fieldMenuRef,
3596
- className: "hidden group-hover:flex flex-col w-44 pt-1",
3597
- children: /* @__PURE__ */ jsxs("div", { className: "rounded-lg border border-border bg-popover backdrop-blur-lg shadow-2xl py-1", children: [
3598
- /* @__PURE__ */ jsx(
3599
- "button",
3600
- {
3601
- type: "button",
3602
- disabled: !canEdit,
3603
- className: "flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",
3604
- onClick: () => p.onInsertField("slidenum"),
3605
- children: t("pptx.field.slideNumber")
3606
- }
3607
- ),
3608
- /* @__PURE__ */ jsx(
3609
- "button",
3610
- {
3611
- type: "button",
3612
- disabled: !canEdit,
3613
- className: "flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",
3614
- onClick: openDatePicker,
3615
- children: t("pptx.field.dateTime")
3616
- }
3617
- ),
3618
- /* @__PURE__ */ jsx(
3619
- "button",
3620
- {
3621
- type: "button",
3622
- disabled: !canEdit,
3623
- className: "flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",
3624
- onClick: () => p.onInsertField("header"),
3625
- children: t("pptx.field.header")
3626
- }
3627
- ),
3628
- /* @__PURE__ */ jsx(
3629
- "button",
3630
- {
3631
- type: "button",
3632
- disabled: !canEdit,
3633
- className: "flex items-center gap-2 w-full px-3 py-1.5 text-xs text-foreground hover:bg-muted transition-colors",
3634
- onClick: () => p.onInsertField("footer"),
3635
- children: t("pptx.field.footer")
3636
- }
3637
- )
3638
- ] })
3639
- }
3640
- )
3641
- ]
3642
2579
  }
3643
- ) }),
3644
- /* @__PURE__ */ jsx(RibbonGroupScope, { id: "insert.links", children: /* @__PURE__ */ jsx(
3645
- InsertHyperlinkButton,
3646
- {
3647
- hasSelection: p.hasSelection,
3648
- onOpenHyperlinkDialog: p.onOpenHyperlinkDialog
3649
- }
3650
- ) }),
3651
- /* @__PURE__ */ jsx(RibbonGroupScope, { id: "insert.text", children: p.onOpenHeaderFooter && /* @__PURE__ */ jsx(
3652
- "button",
3653
- {
3654
- type: "button",
3655
- disabled: !canEdit,
3656
- className: cn(pill, "whitespace-nowrap"),
3657
- onClick: p.onOpenHeaderFooter,
3658
- children: t("pptx.headerFooter.title")
3659
- }
3660
- ) }),
2580
+ };
2581
+ host.addEventListener("insert-request", request);
2582
+ return () => host.removeEventListener("insert-request", request);
2583
+ }, [p]);
2584
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
2585
+ /* @__PURE__ */ jsx("pptx-ui-ribbon-insert", { ref }),
3661
2586
  datePickerOpen && p.onInsertField && /* @__PURE__ */ jsx(
3662
2587
  DateTimeFieldDialog,
3663
2588
  {
@@ -3670,200 +2595,62 @@ function InsertSection(p) {
3670
2595
  )
3671
2596
  ] });
3672
2597
  }
2598
+ function WebRibbonSection({
2599
+ groups,
2600
+ onCommand
2601
+ }) {
2602
+ const ref = useRef(null);
2603
+ useEffect(() => {
2604
+ if (ref.current) {
2605
+ ref.current.groups = groups;
2606
+ }
2607
+ }, [groups]);
2608
+ useEffect(() => {
2609
+ const host = ref.current;
2610
+ if (!host) {
2611
+ return;
2612
+ }
2613
+ const request = (event) => onCommand(event.detail.id);
2614
+ host.addEventListener("command-request", request);
2615
+ return () => host.removeEventListener("command-request", request);
2616
+ }, [onCommand]);
2617
+ return /* @__PURE__ */ jsx("pptx-ui-ribbon-section", { ref });
2618
+ }
3673
2619
  function ReviewSection(p) {
3674
2620
  const { t } = useTranslation();
3675
- return /* @__PURE__ */ jsxs(Fragment, { children: [
3676
- /* @__PURE__ */ jsxs(
3677
- RibbonGroup,
3678
- {
3679
- label: t("pptx.review.proofing", { defaultValue: "Proofing" }),
3680
- groupId: "review.proofing",
3681
- children: [
3682
- /* @__PURE__ */ jsx(
3683
- RibbonCommand,
3684
- {
3685
- controlId: "review.proofing.spelling",
3686
- label: t("pptx.review.spelling"),
3687
- icon: /* @__PURE__ */ jsx(LuSpellCheck, {}),
3688
- onClick: () => p.onSetSpellCheckEnabled(!p.spellCheckEnabled),
3689
- active: p.spellCheckEnabled,
3690
- title: t("pptx.review.toggleSpellCheck")
3691
- }
3692
- ),
3693
- /* @__PURE__ */ jsx(
3694
- RibbonCommand,
3695
- {
3696
- controlId: "review.proofing.thesaurus",
3697
- label: t("pptx.review.thesaurus", { defaultValue: "Thesaurus" }),
3698
- icon: /* @__PURE__ */ jsx(LuBookOpen, {}),
3699
- disabled: true
3700
- }
3701
- )
3702
- ]
3703
- }
3704
- ),
3705
- /* @__PURE__ */ jsx(
3706
- RibbonGroup,
3707
- {
3708
- label: t("pptx.review.accessibility", { defaultValue: "Accessibility" }),
3709
- groupId: "review.accessibility",
3710
- children: /* @__PURE__ */ jsx(
3711
- RibbonCommand,
3712
- {
3713
- controlId: "review.accessibility.check",
3714
- label: t("pptx.review.accessibilityCheck"),
3715
- icon: /* @__PURE__ */ jsx(LuShieldCheck, {}),
3716
- onClick: p.onOpenAccessibilityCheck
3717
- }
3718
- )
3719
- }
3720
- ),
3721
- /* @__PURE__ */ jsxs(RibbonGroup, { label: t("pptx.review.language"), groupId: "review.language", children: [
3722
- /* @__PURE__ */ jsx(
3723
- RibbonCommand,
3724
- {
3725
- controlId: "review.language.translate",
3726
- label: t("pptx.review.translate", { defaultValue: "Translate" }),
3727
- icon: /* @__PURE__ */ jsx(LuLanguages, {}),
3728
- disabled: true
3729
- }
3730
- ),
3731
- /* @__PURE__ */ jsx(
3732
- RibbonCommand,
3733
- {
3734
- label: t("pptx.review.language"),
3735
- icon: /* @__PURE__ */ jsx(LuGlobe, {}),
3736
- disabled: !p.onSetLanguage,
3737
- onClick: p.onSetLanguage
2621
+ const groups = buildReviewRibbon(t, {
2622
+ editable: p.canEdit,
2623
+ spellCheck: p.spellCheckEnabled,
2624
+ canAccessibility: Boolean(p.onOpenAccessibilityCheck),
2625
+ canLanguage: Boolean(p.onSetLanguage),
2626
+ canCompare: Boolean(p.onCompare),
2627
+ canComments: Boolean(p.onToggleComments),
2628
+ commentsOpen: p.isCommentsPanelOpen,
2629
+ commentCount: p.slideCommentCount
2630
+ });
2631
+ const request = (id) => {
2632
+ switch (id) {
2633
+ case "review.proofing.spelling":
2634
+ p.onSetSpellCheckEnabled(!p.spellCheckEnabled);
2635
+ break;
2636
+ case "review.accessibility.check":
2637
+ p.onOpenAccessibilityCheck?.();
2638
+ break;
2639
+ case "review.language.language":
2640
+ p.onSetLanguage?.();
2641
+ break;
2642
+ case "review.compare.compare":
2643
+ if (p.canEdit) {
2644
+ p.onCompare?.();
3738
2645
  }
3739
- )
3740
- ] }),
3741
- /* @__PURE__ */ jsxs(
3742
- RibbonGroup,
3743
- {
3744
- label: t("pptx.review.changes", { defaultValue: "Changes" }),
3745
- groupId: "review.compare",
3746
- children: [
3747
- /* @__PURE__ */ jsx(
3748
- RibbonCommand,
3749
- {
3750
- controlId: "review.compare.markAllRead",
3751
- label: t("pptx.review.markAllRead", { defaultValue: "Mark All as Read" }),
3752
- icon: /* @__PURE__ */ jsx(LuCopy, {}),
3753
- disabled: true
3754
- }
3755
- ),
3756
- p.onCompare && /* @__PURE__ */ jsx(
3757
- RibbonCommand,
3758
- {
3759
- controlId: "review.compare.compare",
3760
- label: t("pptx.ribbon.compare"),
3761
- icon: /* @__PURE__ */ jsx(LuGitCompare, {}),
3762
- onClick: p.onCompare,
3763
- disabled: !p.canEdit,
3764
- title: t("pptx.ribbon.compareTitle")
3765
- }
3766
- )
3767
- ]
3768
- }
3769
- ),
3770
- /* @__PURE__ */ jsxs(RibbonGroup, { label: t("pptx.toolbar.comments"), groupId: "review.comments", children: [
3771
- p.onToggleComments && /* @__PURE__ */ jsxs("div", { className: "relative", children: [
3772
- /* @__PURE__ */ jsx(
3773
- RibbonCommand,
3774
- {
3775
- controlId: "review.comments.newComment",
3776
- label: t("pptx.toolbar.comments"),
3777
- icon: /* @__PURE__ */ jsx(LuMessageSquarePlus, {}),
3778
- onClick: p.onToggleComments,
3779
- active: p.isCommentsPanelOpen,
3780
- title: t("pptx.review.toggleComments")
3781
- }
3782
- ),
3783
- Boolean(p.slideCommentCount) && /* @__PURE__ */ jsx("span", { className: "absolute right-0 top-0 rounded-full bg-primary px-1 text-[9px] text-white", children: p.slideCommentCount })
3784
- ] }),
3785
- /* @__PURE__ */ jsxs(RibbonCommandStack, { children: [
3786
- /* @__PURE__ */ jsx(
3787
- RibbonCommand,
3788
- {
3789
- compact: true,
3790
- controlId: "review.comments.delete",
3791
- label: t("pptx.common.delete", { defaultValue: "Delete" }),
3792
- icon: /* @__PURE__ */ jsx(LuTrash2, {}),
3793
- disabled: true
3794
- }
3795
- ),
3796
- /* @__PURE__ */ jsx(
3797
- RibbonCommand,
3798
- {
3799
- compact: true,
3800
- controlId: "review.comments.previous",
3801
- label: t("pptx.common.previous", { defaultValue: "Previous" }),
3802
- icon: /* @__PURE__ */ jsx(LuChevronLeft, {}),
3803
- disabled: true
3804
- }
3805
- )
3806
- ] }),
3807
- /* @__PURE__ */ jsxs(RibbonCommandStack, { children: [
3808
- /* @__PURE__ */ jsx(
3809
- RibbonCommand,
3810
- {
3811
- compact: true,
3812
- controlId: "review.comments.next",
3813
- label: t("pptx.common.next", { defaultValue: "Next" }),
3814
- icon: /* @__PURE__ */ jsx(LuChevronRight, {}),
3815
- disabled: true
3816
- }
3817
- ),
3818
- /* @__PURE__ */ jsx(
3819
- RibbonCommand,
3820
- {
3821
- compact: true,
3822
- controlId: "review.comments.showComments",
3823
- label: t("pptx.review.showComments", { defaultValue: "Show Comments" }),
3824
- icon: /* @__PURE__ */ jsx(LuMessageSquare, {}),
3825
- onClick: p.onToggleComments
3826
- }
3827
- )
3828
- ] })
3829
- ] }),
3830
- /* @__PURE__ */ jsxs(
3831
- RibbonGroup,
3832
- {
3833
- label: t("pptx.review.protect", { defaultValue: "Protect" }),
3834
- groupId: "review.protect",
3835
- children: [
3836
- /* @__PURE__ */ jsx(
3837
- RibbonCommand,
3838
- {
3839
- controlId: "review.protect.readOnly",
3840
- label: t("pptx.review.readOnly", { defaultValue: "Always Open Read-only" }),
3841
- icon: /* @__PURE__ */ jsx(LuLockKeyhole, {}),
3842
- disabled: true
3843
- }
3844
- ),
3845
- /* @__PURE__ */ jsx(
3846
- RibbonCommand,
3847
- {
3848
- controlId: "review.protect.restrictPermission",
3849
- label: t("pptx.review.restrictPermission", { defaultValue: "Restrict Permission" }),
3850
- icon: /* @__PURE__ */ jsx(LuShieldCheck, {}),
3851
- disabled: true
3852
- }
3853
- ),
3854
- /* @__PURE__ */ jsx(
3855
- RibbonCommand,
3856
- {
3857
- controlId: "review.ink.hideInk",
3858
- label: t("pptx.review.hideInk", { defaultValue: "Hide Ink" }),
3859
- icon: /* @__PURE__ */ jsx(LuEyeOff, {}),
3860
- disabled: true
3861
- }
3862
- )
3863
- ]
3864
- }
3865
- )
3866
- ] });
2646
+ break;
2647
+ case "review.comments.newComment":
2648
+ case "review.comments.showComments":
2649
+ p.onToggleComments?.();
2650
+ break;
2651
+ }
2652
+ };
2653
+ return /* @__PURE__ */ jsx(WebRibbonSection, { groups, onCommand: request });
3867
2654
  }
3868
2655
  function CustomShowsControls({
3869
2656
  customShows,
@@ -4018,81 +2805,6 @@ function SubtitleSettingsControl() {
4018
2805
  }
4019
2806
  );
4020
2807
  }
4021
- function useIntent(ref, type, callback) {
4022
- useEffect(() => {
4023
- const host = ref.current;
4024
- if (!host || !callback) {
4025
- return;
4026
- }
4027
- host.addEventListener(type, callback);
4028
- return () => host.removeEventListener(type, callback);
4029
- }, [ref, type, callback]);
4030
- }
4031
- function WebRibbonGroup({
4032
- label,
4033
- groupId,
4034
- children
4035
- }) {
4036
- return /* @__PURE__ */ jsx("pptx-ui-ribbon-group", { label, "data-ribbon-group": groupId, children });
4037
- }
4038
- function WebRibbonCommand({
4039
- label,
4040
- icon,
4041
- controlId,
4042
- title,
4043
- disabled,
4044
- active,
4045
- pressed,
4046
- expanded,
4047
- compact,
4048
- onCommand
4049
- }) {
4050
- const ref = useRef(null);
4051
- useIntent(
4052
- ref,
4053
- "command-request",
4054
- onCommand ? (event) => onCommand(event.detail.id) : void 0
4055
- );
4056
- return /* @__PURE__ */ jsx(
4057
- "pptx-ui-ribbon-command",
4058
- {
4059
- ref,
4060
- label,
4061
- icon,
4062
- "data-ribbon-control": controlId,
4063
- title,
4064
- disabled: disabled || void 0,
4065
- active: active || void 0,
4066
- pressed: pressed === void 0 ? void 0 : String(pressed),
4067
- expanded: expanded === void 0 ? void 0 : String(expanded),
4068
- compact: compact || void 0
4069
- }
4070
- );
4071
- }
4072
- function WebRibbonToggle({
4073
- label,
4074
- controlId,
4075
- checked,
4076
- title,
4077
- onToggle
4078
- }) {
4079
- const ref = useRef(null);
4080
- useIntent(
4081
- ref,
4082
- "toggle-request",
4083
- onToggle ? (event) => onToggle(event.detail.checked) : void 0
4084
- );
4085
- return /* @__PURE__ */ jsx(
4086
- "pptx-ui-ribbon-toggle",
4087
- {
4088
- ref,
4089
- label,
4090
- "data-ribbon-control": controlId,
4091
- checked: checked || void 0,
4092
- title
4093
- }
4094
- );
4095
- }
4096
2808
  function SlideShowSection(p) {
4097
2809
  const { t } = useTranslation();
4098
2810
  const { isHidden } = useToolbarVisibility(p.hiddenActions);
@@ -4170,6 +2882,124 @@ function SlideShowSection(p) {
4170
2882
  ) })
4171
2883
  ] });
4172
2884
  }
2885
+
2886
+ // src/viewer/components/toolbar/text-section-state.ts
2887
+ function getEffectiveTextStyle(element, tableEditorState) {
2888
+ if (!element) {
2889
+ return void 0;
2890
+ }
2891
+ if (hasTextProperties(element)) {
2892
+ return element.textStyle;
2893
+ }
2894
+ if (element.type === "table" && tableEditorState && element.tableData) {
2895
+ const cell = element.tableData.rows[tableEditorState.rowIndex]?.cells[tableEditorState.columnIndex];
2896
+ return cell?.style;
2897
+ }
2898
+ return void 0;
2899
+ }
2900
+ function isTextDecorationFlag(id) {
2901
+ return TEXT_DECORATION_FLAGS.includes(id);
2902
+ }
2903
+ function textSectionFlags(element, tableEditorState, readSelection) {
2904
+ if (element && hasTextProperties(element)) {
2905
+ const result = readSelection ? getInlineEditorSelectionResult(element.textSegments) : null;
2906
+ const current = result?.kind === "supported" && (!result.snapshot || result.snapshot.elementId === element.id) ? result : null;
2907
+ return getSelectionTextStyleFlags(
2908
+ current?.snapshot?.textSegments ?? element.textSegments,
2909
+ current?.selection ?? null,
2910
+ element.textStyle
2911
+ );
2912
+ }
2913
+ return getSelectionTextStyleFlags(
2914
+ void 0,
2915
+ null,
2916
+ getEffectiveTextStyle(element, tableEditorState)
2917
+ );
2918
+ }
2919
+ function textSectionBulletKind(element, tableEditorState) {
2920
+ if (element && hasTextProperties(element)) {
2921
+ const result = getInlineEditorSelectionResult(element.textSegments, { preserveCaret: true });
2922
+ return result.kind === "supported" && (!result.snapshot || result.snapshot.elementId === element.id) ? selectionBulletKind(element, result.selection, result.snapshot?.textSegments) : elementBulletKind(element);
2923
+ }
2924
+ return getEffectiveTextStyle(element, tableEditorState)?.listType ?? "none";
2925
+ }
2926
+ var TEXT_SHADOW_ON = {
2927
+ textShadowColor: "#000000",
2928
+ textShadowBlur: 2,
2929
+ textShadowOffsetX: 1,
2930
+ textShadowOffsetY: 1,
2931
+ textShadowOpacity: 0.5
2932
+ };
2933
+ var TEXT_SHADOW_OFF = {
2934
+ textShadowColor: void 0,
2935
+ textShadowBlur: void 0,
2936
+ textShadowOffsetX: void 0,
2937
+ textShadowOffsetY: void 0
2938
+ };
2939
+ function FontFormatGroup(p) {
2940
+ const { canMut, canFormat, isTextEl, selectedElement, tableEditorState, effectiveTs } = p;
2941
+ const { onUpdateTextStyle } = p;
2942
+ const flags = textSectionFlags(selectedElement, tableEditorState, false);
2943
+ const shadow = Boolean(effectiveTs?.textShadowColor);
2944
+ const controls = useMemo(
2945
+ () => fontHomeControls({
2946
+ enabled: canMut && canFormat,
2947
+ bold: flags.bold === "on",
2948
+ italic: flags.italic === "on",
2949
+ underline: flags.underline === "on",
2950
+ strikethrough: flags.strikethrough === "on",
2951
+ shadow
2952
+ }),
2953
+ [canMut, canFormat, flags.bold, flags.italic, flags.underline, flags.strikethrough, shadow]
2954
+ );
2955
+ const request = useCallback(
2956
+ (id) => {
2957
+ if (!canFormat || !selectedElement) {
2958
+ return;
2959
+ }
2960
+ const flag = id.replace("home.font.", "");
2961
+ if (isTextDecorationFlag(flag)) {
2962
+ const current2 = textSectionFlags(selectedElement, tableEditorState, true);
2963
+ onUpdateTextStyle({ [flag]: nextToggleValue(current2[flag]) });
2964
+ return;
2965
+ }
2966
+ const textual = isTextEl;
2967
+ const current = effectiveTs?.fontSize ?? (textual ? textFontSizePtToPx(18) : 18);
2968
+ const delta = textual ? textFontSizePtToPx(2) : 2;
2969
+ switch (id) {
2970
+ case "home.font.shadow":
2971
+ onUpdateTextStyle(shadow ? TEXT_SHADOW_OFF : TEXT_SHADOW_ON);
2972
+ break;
2973
+ case "home.font.increaseFontSize":
2974
+ onUpdateTextStyle({ fontSize: current + delta });
2975
+ break;
2976
+ case "home.font.decreaseFontSize":
2977
+ onUpdateTextStyle({
2978
+ fontSize: Math.max(textual ? textFontSizePtToPx(1) : 1, current - delta)
2979
+ });
2980
+ break;
2981
+ case "home.font.clearFormatting":
2982
+ onUpdateTextStyle({
2983
+ bold: false,
2984
+ italic: false,
2985
+ underline: false,
2986
+ strikethrough: false,
2987
+ highlightColor: void 0
2988
+ });
2989
+ }
2990
+ },
2991
+ [
2992
+ canFormat,
2993
+ selectedElement,
2994
+ tableEditorState,
2995
+ isTextEl,
2996
+ effectiveTs,
2997
+ shadow,
2998
+ onUpdateTextStyle
2999
+ ]
3000
+ );
3001
+ return /* @__PURE__ */ jsx(WebHomeControls, { family: "font", controls, onRequest: request });
3002
+ }
4173
3003
  var LINE_SPACING_OPTIONS = [
4174
3004
  { label: "1.0", value: 1 },
4175
3005
  { label: "1.15", value: 1.15 },
@@ -4330,12 +3160,6 @@ function ColumnsDropdown(p) {
4330
3160
  ] });
4331
3161
  }
4332
3162
  var ON = "bg-primary/20 ring-1 ring-primary";
4333
- var ALIGN_CONTROL = {
4334
- left: "home.paragraph.alignLeft",
4335
- center: "home.paragraph.alignCenter",
4336
- right: "home.paragraph.alignRight",
4337
- justify: "home.paragraph.justify"
4338
- };
4339
3163
  function fixedGallery(control) {
4340
3164
  return FIXED_TAB_GALLERIES.find((placement) => placement.control === control);
4341
3165
  }
@@ -4343,14 +3167,27 @@ var BULLETS_GALLERY = fixedGallery("home.paragraph.bullets");
4343
3167
  var NUMBERING_GALLERY = fixedGallery("home.paragraph.numbering");
4344
3168
  function ParagraphGroup(p) {
4345
3169
  const { t } = useTranslation();
4346
- const { canMut, canFormat } = p;
4347
- const indent = (delta) => {
4348
- if (!canFormat) {
4349
- return;
4350
- }
4351
- const current = p.effectiveTs?.paragraphMarginLeft ?? 0;
4352
- p.onUpdateTextStyle({ paragraphMarginLeft: Math.max(0, current + delta) });
4353
- };
3170
+ const { canMut, canFormat, effectiveTs, onUpdateTextStyle } = p;
3171
+ const align = paragraphHomeAlign(effectiveTs?.align);
3172
+ const paragraphControls = useMemo(
3173
+ () => paragraphHomeControls({ enabled: canMut && canFormat, align }),
3174
+ [canMut, canFormat, align]
3175
+ );
3176
+ const requestParagraph = useCallback(
3177
+ (id) => {
3178
+ const action = paragraphHomeAction(id);
3179
+ if (!canFormat || !action) {
3180
+ return;
3181
+ }
3182
+ if (action.kind === "indent") {
3183
+ const current = effectiveTs?.paragraphMarginLeft ?? 0;
3184
+ onUpdateTextStyle({ paragraphMarginLeft: Math.max(0, current + action.delta) });
3185
+ } else {
3186
+ onUpdateTextStyle({ align: action.align });
3187
+ }
3188
+ },
3189
+ [canFormat, effectiveTs, onUpdateTextStyle]
3190
+ );
4354
3191
  const listToggle = (kind, placement, title, icon) => /* @__PURE__ */ jsxs("div", { className: grp, ...controlAttr(placement?.control), children: [
4355
3192
  /* @__PURE__ */ jsx(
4356
3193
  "button",
@@ -4381,52 +3218,14 @@ function ParagraphGroup(p) {
4381
3218
  t("pptx.text.numberedList"),
4382
3219
  /* @__PURE__ */ jsx(LuListOrdered, { className: ic })
4383
3220
  ),
4384
- /* @__PURE__ */ jsxs("div", { className: grp, children: [
4385
- /* @__PURE__ */ jsx(
4386
- "button",
4387
- {
4388
- type: "button",
4389
- disabled: !canMut,
4390
- onMouseDown: (e) => e.preventDefault(),
4391
- onClick: () => indent(-24),
4392
- className: gB,
4393
- title: t("pptx.text.decreaseIndent"),
4394
- ...controlAttr("home.paragraph.decreaseIndent"),
4395
- children: /* @__PURE__ */ jsx(LuIndentDecrease, { className: ic })
4396
- }
4397
- ),
4398
- /* @__PURE__ */ jsx(
4399
- "button",
4400
- {
4401
- type: "button",
4402
- disabled: !canMut,
4403
- onMouseDown: (e) => e.preventDefault(),
4404
- onClick: () => indent(24),
4405
- className: gL,
4406
- title: t("pptx.text.increaseIndent"),
4407
- ...controlAttr("home.paragraph.increaseIndent"),
4408
- children: /* @__PURE__ */ jsx(LuIndentIncrease, { className: ic })
4409
- }
4410
- )
4411
- ] }),
4412
- /* @__PURE__ */ jsx("div", { className: grp, children: ATXT.map((b, i, a) => /* @__PURE__ */ jsx(
4413
- "button",
3221
+ /* @__PURE__ */ jsx(
3222
+ WebHomeControls,
4414
3223
  {
4415
- type: "button",
4416
- disabled: !canMut,
4417
- onMouseDown: (e) => e.preventDefault(),
4418
- onClick: () => {
4419
- if (canFormat) {
4420
- p.onUpdateTextStyle({ align: b.id });
4421
- }
4422
- },
4423
- className: i < a.length - 1 ? gB : gL,
4424
- title: t(b.labelKey),
4425
- ...controlAttr(ALIGN_CONTROL[b.id]),
4426
- children: b.i
4427
- },
4428
- b.id
4429
- )) }),
3224
+ family: "paragraph",
3225
+ controls: paragraphControls,
3226
+ onRequest: requestParagraph
3227
+ }
3228
+ ),
4430
3229
  /* @__PURE__ */ jsx(
4431
3230
  LineSpacingDropdown,
4432
3231
  {
@@ -4456,47 +3255,6 @@ function ParagraphGroup(p) {
4456
3255
  /* @__PURE__ */ jsx("span", { className: "text-[9px] text-muted-foreground leading-none", children: t("pptx.ribbon.paragraph") })
4457
3256
  ] });
4458
3257
  }
4459
-
4460
- // src/viewer/components/toolbar/text-section-state.ts
4461
- function getEffectiveTextStyle(element, tableEditorState) {
4462
- if (!element) {
4463
- return void 0;
4464
- }
4465
- if (hasTextProperties(element)) {
4466
- return element.textStyle;
4467
- }
4468
- if (element.type === "table" && tableEditorState && element.tableData) {
4469
- const cell = element.tableData.rows[tableEditorState.rowIndex]?.cells[tableEditorState.columnIndex];
4470
- return cell?.style;
4471
- }
4472
- return void 0;
4473
- }
4474
- function isTextDecorationFlag(id) {
4475
- return TEXT_DECORATION_FLAGS.includes(id);
4476
- }
4477
- function textSectionFlags(element, tableEditorState, readSelection) {
4478
- if (element && hasTextProperties(element)) {
4479
- const result = readSelection ? getInlineEditorSelectionResult(element.textSegments) : null;
4480
- const current = result?.kind === "supported" && (!result.snapshot || result.snapshot.elementId === element.id) ? result : null;
4481
- return getSelectionTextStyleFlags(
4482
- current?.snapshot?.textSegments ?? element.textSegments,
4483
- current?.selection ?? null,
4484
- element.textStyle
4485
- );
4486
- }
4487
- return getSelectionTextStyleFlags(
4488
- void 0,
4489
- null,
4490
- getEffectiveTextStyle(element, tableEditorState)
4491
- );
4492
- }
4493
- function textSectionBulletKind(element, tableEditorState) {
4494
- if (element && hasTextProperties(element)) {
4495
- const result = getInlineEditorSelectionResult(element.textSegments, { preserveCaret: true });
4496
- return result.kind === "supported" && (!result.snapshot || result.snapshot.elementId === element.id) ? selectionBulletKind(element, result.selection, result.snapshot?.textSegments) : elementBulletKind(element);
4497
- }
4498
- return getEffectiveTextStyle(element, tableEditorState)?.listType ?? "none";
4499
- }
4500
3258
  function RecentColorsRow({
4501
3259
  prefix,
4502
3260
  disabled,
@@ -4894,13 +3652,6 @@ function useParagraphListKind(element) {
4894
3652
  const readServer = useCallback(() => element ? elementBulletKind(element) : "none", [element]);
4895
3653
  return useSyncExternalStore(subscribe, read, readServer);
4896
3654
  }
4897
- var ON2 = "bg-primary/20 ring-1 ring-primary";
4898
- var FONT_TOGGLE_CONTROL = {
4899
- bold: "home.font.bold",
4900
- italic: "home.font.italic",
4901
- underline: "home.font.underline",
4902
- strikethrough: "home.font.strikethrough"
4903
- };
4904
3655
  function TextSection(p) {
4905
3656
  const { t } = useTranslation();
4906
3657
  const hasSel = Boolean(p.selectedElement);
@@ -4909,7 +3660,6 @@ function TextSection(p) {
4909
3660
  const isTable = hasSel && p.selectedElement?.type === "table";
4910
3661
  const canFormat = isTextEl || isTable;
4911
3662
  const effectiveTs = getEffectiveTextStyle(p.selectedElement, p.tableEditorState);
4912
- const pressedFlags = textSectionFlags(p.selectedElement, p.tableEditorState, false);
4913
3663
  const selectedListKind = useParagraphListKind(p.selectedElement);
4914
3664
  const bulletKind = isTextEl ? selectedListKind : textSectionBulletKind(p.selectedElement, p.tableEditorState);
4915
3665
  const toggleBullets = (kind) => {
@@ -4949,158 +3699,18 @@ function TextSection(p) {
4949
3699
  return /* @__PURE__ */ jsxs(Fragment, { children: [
4950
3700
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-0.5", ...groupAttr("home.font"), children: [
4951
3701
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", "data-pptx-chrome": "font-controls", children: [
4952
- /* @__PURE__ */ jsx("div", { className: grp, "data-pptx-chrome": "control-cluster", children: FMT.map((b, i, a) => {
4953
- const flag = isTextDecorationFlag(b.id) ? b.id : void 0;
4954
- const handleClick = () => {
4955
- if (!canFormat || !p.selectedElement || !flag) {
4956
- return;
4957
- }
4958
- const flags = textSectionFlags(p.selectedElement, p.tableEditorState, true);
4959
- p.onUpdateTextStyle({ [flag]: nextToggleValue(flags[flag]) });
4960
- };
4961
- const pressed = flag !== void 0 && pressedFlags[flag] === "on";
4962
- return /* @__PURE__ */ jsx(
4963
- "button",
4964
- {
4965
- type: "button",
4966
- disabled: !canMut,
4967
- "aria-pressed": pressed,
4968
- onMouseDown: (e) => e.preventDefault(),
4969
- onClick: handleClick,
4970
- className: `${i < a.length - 1 ? gB : gL}${pressed ? ` ${ON2}` : ""}`,
4971
- title: t(b.labelKey),
4972
- ...controlAttr(FONT_TOGGLE_CONTROL[b.id]),
4973
- children: b.i
4974
- },
4975
- b.id
4976
- );
4977
- }) }),
4978
3702
  /* @__PURE__ */ jsx(
4979
- "button",
3703
+ FontFormatGroup,
4980
3704
  {
4981
- type: "button",
4982
- disabled: !canMut,
4983
- onMouseDown: (e) => e.preventDefault(),
4984
- onClick: () => {
4985
- if (!canFormat) {
4986
- return;
4987
- }
4988
- const hasShadow = Boolean(effectiveTs?.textShadowColor);
4989
- p.onUpdateTextStyle(
4990
- hasShadow ? {
4991
- textShadowColor: void 0,
4992
- textShadowBlur: void 0,
4993
- textShadowOffsetX: void 0,
4994
- textShadowOffsetY: void 0
4995
- } : {
4996
- textShadowColor: "#000000",
4997
- textShadowBlur: 2,
4998
- textShadowOffsetX: 1,
4999
- textShadowOffsetY: 1,
5000
- textShadowOpacity: 0.5
5001
- }
5002
- );
5003
- },
5004
- className: pill,
5005
- title: t("pptx.textEffects.shadow"),
5006
- "aria-label": t("pptx.textEffects.shadow"),
5007
- ...controlAttr("home.font.shadow"),
5008
- children: /* @__PURE__ */ jsxs(
5009
- "svg",
5010
- {
5011
- className: ic,
5012
- viewBox: "0 0 24 24",
5013
- fill: "none",
5014
- stroke: "currentColor",
5015
- strokeWidth: "2",
5016
- children: [
5017
- /* @__PURE__ */ jsx("text", { x: "6", y: "17", fontSize: "16", fontWeight: "bold", fill: "currentColor", stroke: "none", children: "S" }),
5018
- /* @__PURE__ */ jsx(
5019
- "text",
5020
- {
5021
- x: "7.5",
5022
- y: "18.5",
5023
- fontSize: "16",
5024
- fontWeight: "bold",
5025
- fill: "none",
5026
- stroke: "currentColor",
5027
- strokeWidth: "0.5",
5028
- opacity: "0.4",
5029
- children: "S"
5030
- }
5031
- )
5032
- ]
5033
- }
5034
- )
3705
+ canMut,
3706
+ canFormat,
3707
+ isTextEl,
3708
+ selectedElement: p.selectedElement,
3709
+ tableEditorState: p.tableEditorState,
3710
+ effectiveTs,
3711
+ onUpdateTextStyle: p.onUpdateTextStyle
5035
3712
  }
5036
3713
  ),
5037
- /* @__PURE__ */ jsxs("div", { className: grp, "data-pptx-chrome": "control-cluster", children: [
5038
- /* @__PURE__ */ jsx(
5039
- "button",
5040
- {
5041
- type: "button",
5042
- disabled: !canMut,
5043
- onMouseDown: (e) => e.preventDefault(),
5044
- onClick: () => {
5045
- if (!canFormat || !p.selectedElement) {
5046
- return;
5047
- }
5048
- const current = effectiveTs?.fontSize ?? (isTextEl ? textFontSizePtToPx(18) : 18);
5049
- const delta = isTextEl ? textFontSizePtToPx(2) : 2;
5050
- p.onUpdateTextStyle({ fontSize: current + delta });
5051
- },
5052
- className: gB,
5053
- title: t("pptx.text.increaseFontSize"),
5054
- ...controlAttr("home.font.increaseFontSize"),
5055
- children: /* @__PURE__ */ jsx(LuAArrowUp, { className: ic })
5056
- }
5057
- ),
5058
- /* @__PURE__ */ jsx(
5059
- "button",
5060
- {
5061
- type: "button",
5062
- disabled: !canMut,
5063
- onMouseDown: (e) => e.preventDefault(),
5064
- onClick: () => {
5065
- if (!canFormat || !p.selectedElement) {
5066
- return;
5067
- }
5068
- const current = effectiveTs?.fontSize ?? (isTextEl ? textFontSizePtToPx(18) : 18);
5069
- const delta = isTextEl ? textFontSizePtToPx(2) : 2;
5070
- const minimum = isTextEl ? textFontSizePtToPx(1) : 1;
5071
- p.onUpdateTextStyle({ fontSize: Math.max(minimum, current - delta) });
5072
- },
5073
- className: gB,
5074
- title: t("pptx.text.decreaseFontSize"),
5075
- ...controlAttr("home.font.decreaseFontSize"),
5076
- children: /* @__PURE__ */ jsx(LuAArrowDown, { className: ic })
5077
- }
5078
- ),
5079
- /* @__PURE__ */ jsx(
5080
- "button",
5081
- {
5082
- type: "button",
5083
- disabled: !canMut,
5084
- onMouseDown: (e) => e.preventDefault(),
5085
- onClick: () => {
5086
- if (!canFormat) {
5087
- return;
5088
- }
5089
- p.onUpdateTextStyle({
5090
- bold: false,
5091
- italic: false,
5092
- underline: false,
5093
- strikethrough: false,
5094
- highlightColor: void 0
5095
- });
5096
- },
5097
- className: gL,
5098
- title: t("pptx.text.clearFormatting"),
5099
- ...controlAttr("home.font.clearFormatting"),
5100
- children: /* @__PURE__ */ jsx(LuRemoveFormatting, { className: ic })
5101
- }
5102
- )
5103
- ] }),
5104
3714
  /* @__PURE__ */ jsx(
5105
3715
  TextSpacingCaseMenus,
5106
3716
  {
@@ -5141,228 +3751,62 @@ function TextSection(p) {
5141
3751
  }
5142
3752
  function ViewSection(p) {
5143
3753
  const { t } = useTranslation();
5144
- return /* @__PURE__ */ jsxs(Fragment, { children: [
5145
- /* @__PURE__ */ jsxs(RibbonGroup, { label: t("pptx.view.presentationViews"), groupId: "view.presentationViews", children: [
5146
- /* @__PURE__ */ jsx(
5147
- RibbonCommand,
5148
- {
5149
- controlId: "view.presentationViews.normal",
5150
- label: t("pptx.view.normal"),
5151
- icon: /* @__PURE__ */ jsx(LuPanelTop, {}),
5152
- onClick: p.onGoToNormalView,
5153
- title: t("pptx.statusBar.normalView")
5154
- }
5155
- ),
5156
- /* @__PURE__ */ jsx(
5157
- RibbonCommand,
5158
- {
5159
- controlId: "view.presentationViews.slideSorter",
5160
- label: t("pptx.slideSorter.title"),
5161
- icon: /* @__PURE__ */ jsx(LuLayoutGrid, {}),
5162
- onClick: p.onToggleSlideSorter,
5163
- title: t("pptx.view.slideSorterTooltip")
5164
- }
5165
- ),
5166
- /* @__PURE__ */ jsx(
5167
- RibbonCommand,
5168
- {
5169
- controlId: "view.presentationViews.outline",
5170
- label: t("pptx.view.outlineView"),
5171
- icon: /* @__PURE__ */ jsx(LuIndentIncrease, {}),
5172
- onClick: p.onOpenOutlineView,
5173
- title: t("pptx.view.outlineViewTooltip")
5174
- }
5175
- ),
5176
- /* @__PURE__ */ jsx(
5177
- RibbonCommand,
5178
- {
5179
- controlId: "view.presentationViews.readingView",
5180
- label: t("pptx.view.readingView"),
5181
- icon: /* @__PURE__ */ jsx(LuBookOpen, {}),
5182
- onClick: p.onOpenReadingView,
5183
- title: t("pptx.view.readingView")
5184
- }
5185
- )
5186
- ] }),
5187
- /* @__PURE__ */ jsxs(RibbonGroup, { label: t("pptx.view.masterViews"), groupId: "view.masterViews", children: [
5188
- /* @__PURE__ */ jsx(
5189
- RibbonCommand,
5190
- {
5191
- controlId: "view.masterViews.slideMaster",
5192
- label: t("pptx.master.title"),
5193
- icon: /* @__PURE__ */ jsx(LuPresentation, {}),
5194
- onClick: p.onEnterMasterView,
5195
- disabled: !p.canEdit,
5196
- title: t("pptx.view.slideMasterTooltip")
5197
- }
5198
- ),
5199
- /* @__PURE__ */ jsx(
5200
- RibbonCommand,
5201
- {
5202
- controlId: "view.masterViews.handoutMaster",
5203
- label: t("pptx.master.handoutMasterTitle", { defaultValue: "Handout Master" }),
5204
- icon: /* @__PURE__ */ jsx(LuGrid3X3, {}),
5205
- disabled: true
5206
- }
5207
- ),
5208
- /* @__PURE__ */ jsx(
5209
- RibbonCommand,
5210
- {
5211
- controlId: "view.masterViews.notesMaster",
5212
- label: t("pptx.master.notesMasterTitle", { defaultValue: "Notes Master" }),
5213
- icon: /* @__PURE__ */ jsx(LuStickyNote, {}),
5214
- disabled: true
5215
- }
5216
- )
5217
- ] }),
5218
- /* @__PURE__ */ jsxs(RibbonGroup, { label: t("pptx.view.show", { defaultValue: "Show" }), groupId: "view.show", children: [
5219
- /* @__PURE__ */ jsxs(RibbonCommandStack, { children: [
5220
- /* @__PURE__ */ jsx(
5221
- RibbonToggle,
5222
- {
5223
- controlId: "view.show.ruler",
5224
- label: t("pptx.ruler.rulers"),
5225
- checked: p.showRulers,
5226
- onChange: p.onSetShowRulers
5227
- }
5228
- ),
5229
- /* @__PURE__ */ jsx(
5230
- RibbonToggle,
5231
- {
5232
- controlId: "view.show.gridlines",
5233
- label: t("pptx.grid.grid"),
5234
- checked: p.showGrid,
5235
- onChange: p.onSetShowGrid,
5236
- title: t("pptx.grid.toggleGrid")
5237
- }
5238
- ),
5239
- /* @__PURE__ */ jsx(
5240
- RibbonToggle,
5241
- {
5242
- controlId: "view.show.guides",
5243
- label: t("pptx.view.guides", { defaultValue: "Guides" }),
5244
- checked: p.showGuides,
5245
- onChange: p.onSetShowGuides,
5246
- title: t("pptx.ribbon.toggleGuides")
5247
- }
5248
- ),
5249
- /* @__PURE__ */ jsx(
5250
- RibbonToggle,
5251
- {
5252
- controlId: "view.show.snapToGrid",
5253
- label: t("pptx.settings.snapToGrid"),
5254
- checked: p.snapToGrid,
5255
- onChange: p.onSetSnapToGrid
5256
- }
5257
- )
5258
- ] }),
5259
- /* @__PURE__ */ jsxs(RibbonCommandStack, { children: [
5260
- /* @__PURE__ */ jsx(
5261
- RibbonCommand,
5262
- {
5263
- compact: true,
5264
- controlId: "view.show.selectionPane",
5265
- label: t("pptx.view.selection"),
5266
- icon: /* @__PURE__ */ jsx(LuList, {}),
5267
- onClick: p.onToggleSelectionPane,
5268
- active: p.isSelectionPaneOpen,
5269
- title: t("pptx.selectionPane.title")
5270
- }
5271
- ),
5272
- /* @__PURE__ */ jsx(
5273
- RibbonCommand,
5274
- {
5275
- compact: true,
5276
- controlId: "view.show.eyedropper",
5277
- label: t("pptx.ribbon.eyedropper"),
5278
- icon: /* @__PURE__ */ jsx(LuPipette, {}),
5279
- onClick: p.onToggleEyedropper,
5280
- active: p.eyedropperActive,
5281
- disabled: !p.canEdit
5282
- }
5283
- ),
5284
- /* @__PURE__ */ jsx(
5285
- RibbonCommand,
5286
- {
5287
- compact: true,
5288
- controlId: "view.show.snapToShape",
5289
- label: t("pptx.view.snapToShape"),
5290
- icon: /* @__PURE__ */ jsx(LuGrid3X3, {}),
5291
- onClick: () => p.onSetSnapToShape(!p.snapToShape),
5292
- active: p.snapToShape,
5293
- title: t("pptx.view.snapToShape")
5294
- }
5295
- ),
5296
- /* @__PURE__ */ jsx(
5297
- RibbonCommand,
5298
- {
5299
- compact: true,
5300
- controlId: "view.show.addGuide",
5301
- label: t("pptx.view.hGuide"),
5302
- icon: /* @__PURE__ */ jsx(LuRuler, {}),
5303
- onClick: () => p.onAddGuide("h"),
5304
- title: t("pptx.view.addHorizontalGuide")
5305
- }
5306
- ),
5307
- /* @__PURE__ */ jsx(
5308
- RibbonCommand,
5309
- {
5310
- compact: true,
5311
- controlId: "view.show.addGuide",
5312
- label: t("pptx.view.vGuide"),
5313
- icon: /* @__PURE__ */ jsx(LuRuler, {}),
5314
- onClick: () => p.onAddGuide("v"),
5315
- title: t("pptx.view.addVerticalGuide")
5316
- }
5317
- )
5318
- ] })
5319
- ] }),
5320
- /* @__PURE__ */ jsxs(RibbonGroup, { label: t("pptx.slideSorter.zoom"), groupId: "view.zoom", children: [
5321
- /* @__PURE__ */ jsx(
5322
- RibbonCommand,
5323
- {
5324
- controlId: "view.zoom.zoom",
5325
- label: t("pptx.slideSorter.zoom"),
5326
- icon: /* @__PURE__ */ jsx(LuZoomIn, {}),
5327
- disabled: true
5328
- }
5329
- ),
5330
- /* @__PURE__ */ jsx(
5331
- RibbonCommand,
5332
- {
5333
- controlId: "view.zoom.fitToWindow",
5334
- label: t("pptx.view.zoomToFit"),
5335
- icon: /* @__PURE__ */ jsx(LuMaximize2, {}),
5336
- onClick: p.onZoomToFit
5337
- }
5338
- )
5339
- ] }),
5340
- /* @__PURE__ */ jsxs(RibbonGroup, { label: t("pptx.view.window", { defaultValue: "Window" }), groupId: "view.window", children: [
5341
- /* @__PURE__ */ jsx(
5342
- RibbonCommand,
5343
- {
5344
- controlId: "view.window.templateEditing",
5345
- label: t(p.editTemplateMode ? "pptx.ribbon.templatesOn" : "pptx.ribbon.templatesOff"),
5346
- icon: /* @__PURE__ */ jsx(LuRuler, {}),
5347
- onClick: () => p.onSetEditTemplateMode(!p.editTemplateMode),
5348
- active: p.editTemplateMode,
5349
- disabled: !p.canEdit,
5350
- title: t("pptx.view.templateEditingTooltip", {
5351
- defaultValue: "Toggle template/master element editing"
5352
- })
5353
- }
5354
- ),
5355
- /* @__PURE__ */ jsx(
5356
- RibbonCommand,
5357
- {
5358
- controlId: "view.window.macros",
5359
- label: t("pptx.view.macros", { defaultValue: "Macros" }),
5360
- icon: /* @__PURE__ */ jsx(LuCode, {}),
5361
- disabled: true
5362
- }
5363
- )
5364
- ] })
5365
- ] });
3754
+ const ref = useRef(null);
3755
+ useEffect(() => {
3756
+ const host = ref.current;
3757
+ if (!host) {
3758
+ return;
3759
+ }
3760
+ host.state = {
3761
+ editable: p.canEdit,
3762
+ showRulers: p.showRulers,
3763
+ showGrid: p.showGrid,
3764
+ showGuides: p.showGuides,
3765
+ snapToGrid: p.snapToGrid,
3766
+ snapToShape: p.snapToShape,
3767
+ templateEditing: p.editTemplateMode,
3768
+ selectionPaneOpen: p.isSelectionPaneOpen,
3769
+ eyedropperActive: p.eyedropperActive,
3770
+ translate: t
3771
+ };
3772
+ }, [p, t]);
3773
+ useEffect(() => {
3774
+ const host = ref.current;
3775
+ if (!host) {
3776
+ return;
3777
+ }
3778
+ const request = (event) => {
3779
+ const intent = event.detail;
3780
+ if (intent.kind === "guide") {
3781
+ p.onAddGuide(intent.axis);
3782
+ } else if (intent.kind === "option") {
3783
+ const setters = {
3784
+ showRulers: p.onSetShowRulers,
3785
+ showGrid: p.onSetShowGrid,
3786
+ showGuides: p.onSetShowGuides,
3787
+ snapToGrid: p.onSetSnapToGrid,
3788
+ snapToShape: p.onSetSnapToShape,
3789
+ templateEditing: p.onSetEditTemplateMode
3790
+ };
3791
+ setters[intent.value](intent.enabled);
3792
+ } else {
3793
+ const commands = {
3794
+ normal: p.onGoToNormalView,
3795
+ slideSorter: p.onToggleSlideSorter,
3796
+ outline: p.onOpenOutlineView,
3797
+ readingView: p.onOpenReadingView,
3798
+ slideMaster: p.onEnterMasterView,
3799
+ selectionPane: p.onToggleSelectionPane,
3800
+ eyedropper: p.onToggleEyedropper,
3801
+ zoomToFit: p.onZoomToFit
3802
+ };
3803
+ commands[intent.value]?.();
3804
+ }
3805
+ };
3806
+ host.addEventListener("view-request", request);
3807
+ return () => host.removeEventListener("view-request", request);
3808
+ }, [p]);
3809
+ return /* @__PURE__ */ jsx("pptx-ui-ribbon-view", { ref });
5366
3810
  }
5367
3811
  function MobileSheet({
5368
3812
  open,
@@ -5559,6 +4003,7 @@ function MobileSectionBody({
5559
4003
  return /* @__PURE__ */ jsx("div", { className: wrap, children: /* @__PURE__ */ jsx(
5560
4004
  DrawSection,
5561
4005
  {
4006
+ canEdit: p.canEdit,
5562
4007
  activeTool: p.activeTool,
5563
4008
  drawingColor: p.drawingColor,
5564
4009
  drawingWidth: p.drawingWidth,
@@ -5839,22 +4284,18 @@ function MobileToolbar(props) {
5839
4284
  }
5840
4285
  );
5841
4286
  }
4287
+ function useTranslateOr() {
4288
+ const { t } = useTranslation();
4289
+ return (key, fallback) => galleryTextLabel(t, key, fallback);
4290
+ }
5842
4291
  function ContextualTabSection({ tab }) {
5843
4292
  const translateOr = useTranslateOr();
5844
4293
  return /* @__PURE__ */ jsx(Fragment, { children: CONTEXTUAL_TAB_GROUPS[tab].map((group) => /* @__PURE__ */ jsx(
5845
- RibbonGroup,
4294
+ WebRibbonGroup,
5846
4295
  {
5847
4296
  groupId: group.group,
5848
4297
  label: translateOr(group.labelKey, group.label),
5849
- className: "items-center",
5850
- children: group.galleries.map((placement) => /* @__PURE__ */ jsx(
5851
- RibbonGallery,
5852
- {
5853
- placement,
5854
- icon: /* @__PURE__ */ jsx(LuSparkles, { className: ics })
5855
- },
5856
- placement.control
5857
- ))
4298
+ children: group.galleries.map((placement) => /* @__PURE__ */ jsx(RibbonGallery, { placement }, placement.control))
5858
4299
  },
5859
4300
  group.group
5860
4301
  )) });
@@ -6097,6 +4538,7 @@ function DrawingGroup(p) {
6097
4538
  sep
6098
4539
  ] });
6099
4540
  }
4541
+ var editingControls = editingHomeControls();
6100
4542
  function EditingSection(p) {
6101
4543
  const { t } = useTranslation();
6102
4544
  const [selectMenuOpen, setSelectMenuOpen] = useState(false);
@@ -6117,32 +4559,14 @@ function EditingSection(p) {
6117
4559
  sep,
6118
4560
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-0.5", ...groupAttr("home.editing"), children: [
6119
4561
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1", children: [
6120
- /* @__PURE__ */ jsxs("div", { className: grp, children: [
6121
- /* @__PURE__ */ jsx(
6122
- "button",
6123
- {
6124
- type: "button",
6125
- onMouseDown: (e) => e.preventDefault(),
6126
- onClick: p.onToggleFindReplace,
6127
- className: gB,
6128
- title: t("pptx.editing.find"),
6129
- ...controlAttr("home.editing.find"),
6130
- children: /* @__PURE__ */ jsx(LuSearch, { className: ic })
6131
- }
6132
- ),
6133
- /* @__PURE__ */ jsx(
6134
- "button",
6135
- {
6136
- type: "button",
6137
- onMouseDown: (e) => e.preventDefault(),
6138
- onClick: p.onToggleFindReplace,
6139
- className: gL,
6140
- title: t("pptx.ribbon.replace"),
6141
- ...controlAttr("home.editing.replace"),
6142
- children: /* @__PURE__ */ jsx(LuReplace, { className: ic })
6143
- }
6144
- )
6145
- ] }),
4562
+ /* @__PURE__ */ jsx(
4563
+ WebHomeControls,
4564
+ {
4565
+ family: "editing",
4566
+ controls: editingControls,
4567
+ onRequest: p.onToggleFindReplace
4568
+ }
4569
+ ),
6146
4570
  /* @__PURE__ */ jsxs("div", { className: "relative", ref: menuRef, ...controlAttr("home.editing.select"), children: [
6147
4571
  /* @__PURE__ */ jsx(
6148
4572
  "button",
@@ -7111,6 +5535,7 @@ function Toolbar(p) {
7111
5535
  sDrw && /* @__PURE__ */ jsx(
7112
5536
  DrawSection,
7113
5537
  {
5538
+ canEdit: p.canEdit,
7114
5539
  activeTool: p.activeTool,
7115
5540
  drawingColor: p.drawingColor,
7116
5541
  drawingWidth: p.drawingWidth,
@@ -7382,7 +5807,7 @@ var EXPLOSION_SUPPORTED_TYPES = /* @__PURE__ */ new Set([
7382
5807
  "doughnut",
7383
5808
  "ofPie"
7384
5809
  ]);
7385
- var ICONS4 = {
5810
+ var ICONS3 = {
7386
5811
  elements: LuPlus,
7387
5812
  styles: LuPaintbrush,
7388
5813
  filters: LuFilter
@@ -7425,7 +5850,7 @@ function ChartQuickActionsOverlay({
7425
5850
  "data-export-ignore": "true",
7426
5851
  style: { position: "absolute", left: 0, top: 0, zIndex: 59 },
7427
5852
  onMouseDown: (e) => e.stopPropagation(),
7428
- children: descriptor.buttons.map((button) => /* @__PURE__ */ jsxs(React6.Fragment, { children: [
5853
+ children: descriptor.buttons.map((button) => /* @__PURE__ */ jsxs(React95.Fragment, { children: [
7429
5854
  /* @__PURE__ */ jsx(
7430
5855
  "button",
7431
5856
  {
@@ -7445,7 +5870,7 @@ function ChartQuickActionsOverlay({
7445
5870
  transformOrigin: "top left"
7446
5871
  },
7447
5872
  className: "flex items-center justify-center rounded bg-white border border-gray-300 shadow-sm hover:bg-gray-100 text-gray-700",
7448
- children: React6.createElement(ICONS4[button.id], { className: "size-3.5" })
5873
+ children: React95.createElement(ICONS3[button.id], { className: "size-3.5" })
7449
5874
  }
7450
5875
  ),
7451
5876
  open === button.id && button.id === "elements" && /* @__PURE__ */ jsxs(
@@ -8595,7 +7020,7 @@ function HorizontalRulerView({ ticks, widthPx, highlight }) {
8595
7020
  }
8596
7021
  );
8597
7022
  }
8598
- var HorizontalRuler = React6.memo(HorizontalRulerView);
7023
+ var HorizontalRuler = React95.memo(HorizontalRulerView);
8599
7024
  HorizontalRuler.displayName = "HorizontalRuler";
8600
7025
  function VerticalRulerView({ ticks, heightPx, highlight }) {
8601
7026
  return /* @__PURE__ */ jsxs(
@@ -8667,7 +7092,7 @@ function VerticalRulerView({ ticks, heightPx, highlight }) {
8667
7092
  }
8668
7093
  );
8669
7094
  }
8670
- var VerticalRuler = React6.memo(VerticalRulerView);
7095
+ var VerticalRuler = React95.memo(VerticalRulerView);
8671
7096
  VerticalRuler.displayName = "VerticalRuler";
8672
7097
  function Ruler({
8673
7098
  canvasSize,
@@ -9546,6 +7971,9 @@ function ActiveXControlOverlay({
9546
7971
  }) });
9547
7972
  }
9548
7973
  var EMPTY_ADJUSTMENT_HANDLES = [];
7974
+ function cssAttr(id) {
7975
+ return id.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
7976
+ }
9549
7977
  function SlideCanvas(props) {
9550
7978
  const latest = useRef(props);
9551
7979
  latest.current = props;
@@ -9710,6 +8138,22 @@ function SlideCanvasContent({
9710
8138
  zoom,
9711
8139
  onMoveGuide
9712
8140
  });
8141
+ const slideElements = activeSlide?.elements;
8142
+ const enteredGroup = useMemo(() => {
8143
+ if (!slideElements || !selectedElement) {
8144
+ return null;
8145
+ }
8146
+ const parentId = parentSelection(slideElements, selectedElement.id);
8147
+ return parentId ? slideSpaceElement(slideElements, parentId) : null;
8148
+ }, [slideElements, selectedElement]);
8149
+ const editingMember = useMemo(() => {
8150
+ if (!slideElements || !inlineEditingElementId || !isGroupMember(slideElements, inlineEditingElementId)) {
8151
+ return null;
8152
+ }
8153
+ const member = slideSpaceElement(slideElements, inlineEditingElementId);
8154
+ const parentId = parentSelection(slideElements, inlineEditingElementId);
8155
+ return member && parentId ? { member, parentId } : null;
8156
+ }, [slideElements, inlineEditingElementId]);
9713
8157
  const selectedMotionPath = selectedElement ? motionPathFor(activeSlide?.animations ?? [], selectedElement.id) : void 0;
9714
8158
  const handleMotionPathChange = useCallback(
9715
8159
  (path) => {
@@ -9921,6 +8365,59 @@ function SlideCanvasContent({
9921
8365
  },
9922
8366
  element.id
9923
8367
  )),
8368
+ enteredGroup && /* @__PURE__ */ jsx(
8369
+ "div",
8370
+ {
8371
+ "data-pptx-entered-group": true,
8372
+ "aria-hidden": true,
8373
+ className: "absolute pointer-events-none outline outline-1 outline-dashed outline-blue-500/70",
8374
+ style: {
8375
+ left: enteredGroup.x,
8376
+ top: enteredGroup.y,
8377
+ width: enteredGroup.width,
8378
+ height: enteredGroup.height,
8379
+ zIndex: templateElements.length + (activeSlide?.elements.length ?? 0) + 1
8380
+ }
8381
+ }
8382
+ ),
8383
+ editingMember && /* @__PURE__ */ jsxs(Fragment, { children: [
8384
+ /* @__PURE__ */ jsx("style", { children: `[data-element-id="${cssAttr(editingMember.parentId)}"] [data-element-id="${cssAttr(editingMember.member.id)}"]{visibility:hidden}` }),
8385
+ /* @__PURE__ */ jsx(
8386
+ ElementRenderer,
8387
+ {
8388
+ element: editingMember.member,
8389
+ activeSlide,
8390
+ isSelected: true,
8391
+ isInlineEditing: true,
8392
+ inlineEditingText,
8393
+ canInteract: isEditableCanvas,
8394
+ spellCheckEnabled,
8395
+ mediaDataUrls,
8396
+ selectionColorClass: "blue-500",
8397
+ showHoverBorder: false,
8398
+ zIndex: templateElements.length + (activeSlide?.elements.length ?? 0) + 2,
8399
+ imageAltText: "Slide element",
8400
+ showResizeHandles: false,
8401
+ renderInk: true,
8402
+ renderGroups: true,
8403
+ adjustmentHandles: EMPTY_ADJUSTMENT_HANDLES,
8404
+ onResizePointerDown: stableResizePointerDown,
8405
+ onAdjustmentPointerDown: stableAdjustmentPointerDown,
8406
+ onRotate: stableRotate,
8407
+ onInlineEditChange: stableInlineEditChange,
8408
+ onInlineEditCommit: stableInlineEditCommit,
8409
+ onInlineEditCancel: stableInlineEditCancel,
8410
+ onUpdateSmartArtElement: stableUpdateSmartArtElement,
8411
+ onFormatText: stableFormatText,
8412
+ onHyperlinkClick,
8413
+ allSlides,
8414
+ sourceSlideIndex,
8415
+ fieldContext,
8416
+ tableStyleContext
8417
+ },
8418
+ `group-member-edit-${editingMember.member.id}`
8419
+ )
8420
+ ] }),
9924
8421
  selectedElement && selectedElement.id !== cropElement?.id && shouldShowElementHandles(isEditableCanvas, true, selectedElementIdSet.size) && !isConnectorOrLineElement(selectedElement) && outlineAuthoring?.editPointsElementId !== selectedElement.id && /* @__PURE__ */ jsx(
9925
8422
  SelectionHandleOverlay,
9926
8423
  {
@@ -10593,7 +9090,7 @@ function slideThumbnailPropsEqual(prev, next) {
10593
9090
  }
10594
9091
  return true;
10595
9092
  }
10596
- var SlideThumbnail = React6.memo(SlideThumbnailImpl, slideThumbnailPropsEqual);
9093
+ var SlideThumbnail = React95.memo(SlideThumbnailImpl, slideThumbnailPropsEqual);
10597
9094
 
10598
9095
  // src/viewer/components/context-menu-dispatch.ts
10599
9096
  function tableCell(props) {
@@ -11354,7 +9851,7 @@ function LazyThumbnailInner({
11354
9851
  }
11355
9852
  ) });
11356
9853
  }
11357
- var LazyThumbnail = React6.memo(LazyThumbnailInner);
9854
+ var LazyThumbnail = React95.memo(LazyThumbnailInner);
11358
9855
 
11359
9856
  // src/viewer/components/slides-pane/utils.ts
11360
9857
  function formatTimingMs(ms) {
@@ -11516,7 +10013,7 @@ function SlideItemInner({
11516
10013
  }
11517
10014
  );
11518
10015
  }
11519
- var SlideItem = React6.memo(SlideItemInner);
10016
+ var SlideItem = React95.memo(SlideItemInner);
11520
10017
  function useSlidePaneCallbacks(onMoveSlide, onRenameSection, onToggleSectionCollapse) {
11521
10018
  const [collapsedSections, setCollapsedSections] = useState({});
11522
10019
  const [renamingSectionId, setRenamingSectionId] = useState(null);
@@ -12925,7 +11422,7 @@ function arePropsEqual(prev, next) {
12925
11422
  }
12926
11423
  return true;
12927
11424
  }
12928
- var SlideCard = React6.memo(SlideCardImpl, arePropsEqual);
11425
+ var SlideCard = React95.memo(SlideCardImpl, arePropsEqual);
12929
11426
  function SorterContextMenu({
12930
11427
  x,
12931
11428
  y,
@@ -14484,8 +12981,8 @@ function SlideNotesPanel({
14484
12981
  onHeightChange
14485
12982
  }) {
14486
12983
  const { t } = useTranslation();
14487
- const rootRef = React6.useRef(null);
14488
- React6.useEffect(() => {
12984
+ const rootRef = React95.useRef(null);
12985
+ React95.useEffect(() => {
14489
12986
  const el = rootRef.current;
14490
12987
  if (!el || !onHeightChange) {
14491
12988
  return void 0;
@@ -16377,9 +14874,9 @@ function PresentationSubtitleBar({
16377
14874
  function renderNotesSegments(segments) {
16378
14875
  return notesSegmentsToSpans(segments).map((span) => {
16379
14876
  if (span.kind === "break") {
16380
- return React6.createElement("br", { key: span.key });
14877
+ return React95.createElement("br", { key: span.key });
16381
14878
  }
16382
- return React6.createElement(
14879
+ return React95.createElement(
16383
14880
  "span",
16384
14881
  { key: span.key, style: span.style },
16385
14882
  span.text
@@ -16611,7 +15108,7 @@ function scaledSlidePreviewPropsEqual(prev, next) {
16611
15108
  }
16612
15109
  return true;
16613
15110
  }
16614
- var ScaledSlidePreview = React6.memo(ScaledSlidePreviewImpl, scaledSlidePreviewPropsEqual);
15111
+ var ScaledSlidePreview = React95.memo(ScaledSlidePreviewImpl, scaledSlidePreviewPropsEqual);
16615
15112
  function PresenterNotesRail({
16616
15113
  slides,
16617
15114
  current,
@@ -17849,7 +16346,7 @@ function EffectSoundRow({
17849
16346
  onPickStock
17850
16347
  }) {
17851
16348
  const { t } = useTranslation();
17852
- const fileInputRef = React6.useRef(null);
16349
+ const fileInputRef = React95.useRef(null);
17853
16350
  const selectedValue = soundState.catalogueId ?? (soundState.hasSound ? CURRENT_VALUE : NONE_VALUE);
17854
16351
  const handleSelectChange = (event) => {
17855
16352
  const value = event.target.value;
@@ -21435,7 +19932,7 @@ function ConnectorArrowsSection({
21435
19932
  ["Start", "End"].map((end) => {
21436
19933
  const widthKey = end === "Start" ? "connectorStartArrowWidth" : "connectorEndArrowWidth";
21437
19934
  const lengthKey = end === "Start" ? "connectorStartArrowLength" : "connectorEndArrowLength";
21438
- return /* @__PURE__ */ jsxs(React6.Fragment, { children: [
19935
+ return /* @__PURE__ */ jsxs(React95.Fragment, { children: [
21439
19936
  /* @__PURE__ */ jsxs("label", { className: "flex flex-col gap-1", children: [
21440
19937
  /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: t(END_LABEL_KEYS[end].width) }),
21441
19938
  /* @__PURE__ */ jsx(
@@ -24312,7 +22809,7 @@ function StrokeEffectsSection({
24312
22809
  ] }),
24313
22810
  EFFECT_CONFIGS.map((cfg) => {
24314
22811
  const on = cfg.isOn(style);
24315
- return /* @__PURE__ */ jsxs(React6.Fragment, { children: [
22812
+ return /* @__PURE__ */ jsxs(React95.Fragment, { children: [
24316
22813
  /* @__PURE__ */ jsxs("label", { className: `inline-flex items-center gap-2 text-foreground ${COL2}`, children: [
24317
22814
  /* @__PURE__ */ jsx(
24318
22815
  WebCheckbox,
@@ -25180,7 +23677,7 @@ function TextWarpGallery({
25180
23677
  onUpdateTextStyle
25181
23678
  }) {
25182
23679
  const { t } = useTranslation();
25183
- const [expanded, setExpanded] = React6.useState(false);
23680
+ const [expanded, setExpanded] = React95.useState(false);
25184
23681
  const currentPreset = ts?.textWarpPreset || "textNoShape";
25185
23682
  return /* @__PURE__ */ jsxs("div", { className: "mt-2 rounded border border-border bg-card p-2 space-y-2", children: [
25186
23683
  /* @__PURE__ */ jsxs(
@@ -25831,7 +24328,7 @@ function SmartArtStyleControls({
25831
24328
  onChangeStyle
25832
24329
  }) {
25833
24330
  const { t } = useTranslation();
25834
- const translate = React6.useCallback((key) => t(key), [t]);
24331
+ const translate = React95.useCallback((key) => t(key), [t]);
25835
24332
  return /* @__PURE__ */ jsxs(Fragment, { children: [
25836
24333
  /* @__PURE__ */ jsxs("label", { className: "flex flex-col gap-1 text-[11px]", children: [
25837
24334
  /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: t("pptx.smartart.colorScheme") }),
@@ -25886,9 +24383,9 @@ function SmartArtPropertiesPanel({
25886
24383
  const nodes = smartArtData.nodes ?? [];
25887
24384
  const layout = smartArtData.resolvedLayoutType;
25888
24385
  const topLevelCount = nodes.filter((n) => !n.parentId).length;
25889
- const inputRefs = React6.useRef(/* @__PURE__ */ new Map());
25890
- const pendingFocusId = React6.useRef(null);
25891
- React6.useEffect(() => {
24386
+ const inputRefs = React95.useRef(/* @__PURE__ */ new Map());
24387
+ const pendingFocusId = React95.useRef(null);
24388
+ React95.useEffect(() => {
25892
24389
  const id = pendingFocusId.current;
25893
24390
  if (id) {
25894
24391
  inputRefs.current.get(id)?.focus();
@@ -27502,7 +25999,7 @@ function CommentBody({ text, mentions, className }) {
27502
25999
  index
27503
26000
  ) : (
27504
26001
  // eslint-disable-next-line react/no-array-index-key -- segments are positional
27505
- /* @__PURE__ */ jsx(React6.Fragment, { children: segment.text }, index)
26002
+ /* @__PURE__ */ jsx(React95.Fragment, { children: segment.text }, index)
27506
26003
  )
27507
26004
  ) });
27508
26005
  }
@@ -29021,7 +27518,7 @@ function PresentationPropertiesPanel({
29021
27518
  onUpdateTagCollections
29022
27519
  }) {
29023
27520
  const { t } = useTranslation();
29024
- const handleTransitionChange = React6.useCallback(
27521
+ const handleTransitionChange = React95.useCallback(
29025
27522
  (updates) => {
29026
27523
  onUpdateSlide({
29027
27524
  transition: mergeSlideTransition(activeSlide?.transition, updates)
@@ -32940,7 +31437,7 @@ function ViewerToolbarSection(props) {
32940
31437
  },
32941
31438
  [activeSlide, propertyHandlers]
32942
31439
  );
32943
- const scopedLayoutOptions = React6.useMemo(
31440
+ const scopedLayoutOptions = React95.useMemo(
32944
31441
  () => scopeLayoutOptionsToActiveSlide(s.layoutOptions, activeSlide),
32945
31442
  [s.layoutOptions, activeSlide]
32946
31443
  );
@@ -34912,7 +33409,7 @@ function useTableStyleMapHandlers(input) {
34912
33409
  var AiChatPanel = lazy(async () => {
34913
33410
  const [{ useChat }, { default: Panel }] = await Promise.all([
34914
33411
  import('@ai-sdk/react'),
34915
- import('./AiChatPanel-5Z4BYP7S.mjs')
33412
+ import('./AiChatPanel-2VX4EF2E.mjs')
34916
33413
  ]);
34917
33414
  function BoundAiChatPanel(props) {
34918
33415
  return /* @__PURE__ */ jsx(Panel, { ...props, useChat });