@pptx-editor.dev/vue 0.0.0-stage → 0.1.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.
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts","../src/components.ts","../src/composables.ts","../src/notes-target.ts","../src/popups.ts","../src/PageSetupDialog.ts","../src/chrome.tsx","../src/slot-override.ts","../src/dialog-parts.ts","../src/color-mode.ts","../src/ImageAltTextDialog.ts","../src/ImagePropertiesDialog.ts","../src/BackgroundDialog.tsx","../src/ColorSwatches.tsx","../src/ShapeControls.tsx","../src/slot.ts","../src/ParagraphDialog.tsx","../src/dialog-form.tsx","../src/form-draft.ts","../src/FontDialog.tsx","../src/dialog-color.tsx","../src/BulletsAndNumberingDialog.tsx","../src/ColumnsDialog.tsx","../src/pane-state.ts","../src/Slideshow.tsx","../src/FindBar.tsx","../src/headless-hooks.ts","../src/HyperlinkPopup.tsx","../src/HyperLink.tsx","../src/useHyperlinkPopup.ts","../src/CanvasContextMenu.tsx","../src/context-menu-parts.tsx","../src/ContextMenu.tsx","../src/menu-row.tsx","../src/menu-rows.tsx","../src/SlideControls.tsx","../src/TableControls.tsx","../src/menu-parts.tsx","../src/SlideSorter.tsx","../src/panes.tsx","../src/RailContextMenu.tsx","../src/rail-parts.tsx","../src/toolbar-parts.ts","../src/FontFamilyControl.tsx","../src/toolbar.ts","../src/toolbar-controls.tsx","../src/toolbar-size.tsx","../src/toolbar-file-controls.tsx","../src/ShapeFormatControls.tsx","../src/PictureControls.tsx","../src/toolbar-bar.tsx","../src/toolbar-measure.ts","../src/slide-drag.ts","../src/RailSections.tsx","../src/SidePanel.tsx","../src/EditNotice.tsx","../src/ChromeTooltip.tsx","../src/loading.ts","../src/NotesPane.tsx","../src/NotesView.tsx","../src/OpenFailure.tsx","../src/FontNotice.tsx","../src/ribbon.ts","../src/status-bar.ts","../src/customization-hooks.ts","../src/usePptxSource.ts","../src/useFonts.ts","../src/useFontFamily.ts"],"sourcesContent":["// @pptx-editor.dev/vue: the Vue 3 adapter. Provider-first, like the React adapter and DOCX\n// Editor's Vue adapter: `PptxEditorRoot` owns the instance, `PptxEditorViewport` is the\n// styling scope, `PptxEditorContent` attaches the canvas, and all chrome reads the editor\n// through composables. `scripts/parity/parity.contract.json` lists which React members Vue\n// pairs and which it defers.\n\nimport {\n defineComponent,\n getCurrentInstance,\n h,\n mergeProps,\n shallowRef,\n type ExtractPublicPropTypes,\n type PropType,\n type SlotsType,\n type VNodeChild,\n} from 'vue';\nimport {\n createEditorRefApi,\n warnOpenFailureActions,\n type ColorMode,\n type EditorFontError,\n type EditorFontsOption,\n type EditorMode,\n type EditorModule,\n type PptxEditorInstance,\n} from '@pptx-editor.dev/core/editor';\nimport type { LocaleCatalog } from '@pptx-editor.dev/i18n';\nimport {\n PptxEditorContent,\n PptxEditorRoot,\n PptxEditorViewport,\n type PptxEditorRef,\n} from './components.ts';\nimport { PptxEditorToolbar } from './toolbar-parts.ts';\nimport { PptxEditorLoading } from './loading.ts';\nimport type { PptxEditorPopups } from './popups.ts';\nimport { DefaultWorkspace } from './SlideSorter.tsx';\nimport { PptxEditorSlideRail } from './panes.tsx';\nimport { PptxEditorNotesPane } from './NotesPane.tsx';\nimport { PptxEditorFindBar } from './FindBar.tsx';\nimport { PptxEditorEditNotice } from './EditNotice.tsx';\nimport {\n PptxEditorOpenFailure,\n type OpenFailureContext,\n type PptxEditorOpenFailureProps,\n} from './OpenFailure.tsx';\nimport { PptxEditorFontNotice } from './FontNotice.tsx';\nimport { PptxEditorSlideshow } from './Slideshow.tsx';\nimport { PptxEditorSlideSorter } from './SlideSorter.tsx';\nimport { PptxEditorSidePanel, PptxEditorZoomPill } from './panes.tsx';\nimport { PptxEditorMenu, type MenuProps } from './menu-parts.tsx';\nimport { PptxEditorContextMenu, type PptxEditorContextMenuProps } from './context-menu-parts.tsx';\nimport type { ToolbarProps } from './toolbar.ts';\nimport type { SlideRailProps } from './panes.tsx';\nimport type { NotesPaneProps } from './NotesPane.tsx';\nimport { PptxEditorRibbon } from './ribbon.ts';\nimport { PptxEditorStatusBar } from './status-bar.ts';\nimport { ToolbarControl } from './toolbar.ts';\nimport { PageSetupDialog } from './PageSetupDialog.ts';\nimport { ImageAltTextDialog } from './ImageAltTextDialog.ts';\nimport { ImagePropertiesDialog } from './ImagePropertiesDialog.ts';\nimport { BackgroundDialog } from './BackgroundDialog.tsx';\nimport { ParagraphDialog } from './ParagraphDialog.tsx';\nimport { FontDialog } from './FontDialog.tsx';\nimport { BulletsAndNumberingDialog } from './BulletsAndNumberingDialog.tsx';\nimport { ColumnsDialog } from './ColumnsDialog.tsx';\n\nexport {\n pptxEditorKey,\n pptxTranslationKey,\n useBulletFormat,\n useEditorCommand,\n useEditorValueCommand,\n useEditorState,\n useFontFormat,\n useParagraphFormat,\n usePptxEditor,\n useSlideLayouts,\n useTranslation,\n type UseBulletFormatReturn,\n type UseEditorCommandReturn,\n type UseEditorValueCommandReturn,\n type UseEditorStateReturn,\n type UseFontFormatReturn,\n type UseParagraphFormatReturn,\n type UsePptxEditorReturn,\n type UseSlideLayoutsReturn,\n type UseTranslationReturn,\n} from './composables.ts';\n// The composable's value types, next to it, as DOCX Editor exports them with `useParagraphFormat`.\nexport type {\n BulletFormat,\n BulletFormatRead,\n FontFormatCommand,\n FontFormatRead,\n ParagraphFormatCommand,\n ParagraphFormatRead,\n} from '@pptx-editor.dev/core/editor';\nexport { useEditorColorMode, type UseEditorColorModeReturn } from './color-mode.ts';\nexport {\n useEditorEvent,\n useEditorSnapshot,\n useScopeClassName,\n useZoom,\n type UseScopeClassNameReturn,\n type UseEditorEventReturn,\n type UseEditorSnapshotReturn,\n type UseZoomReturn,\n} from './customization-hooks.ts';\nexport {\n useChromeTranslate,\n useDocumentSearch,\n useEditorCaret,\n useHistoryGroup,\n useToolbarContext,\n useToolbarLabel,\n useToolbarLabelFor,\n type UseChromeTranslateReturn,\n type UseDocumentSearchReturn,\n type UseEditorCaretReturn,\n type UseHistoryGroupReturn,\n type UseToolbarContextReturn,\n type UseToolbarLabelForReturn,\n type UseToolbarLabelReturn,\n} from './headless-hooks.ts';\nexport type {\n ChromeTranslate,\n DocumentSearchFindOptions,\n DocumentSearchState,\n EditorCaret,\n HistoryGroupBindingOptions,\n} from '@pptx-editor.dev/core/editor';\nexport type { PptxEditorEvents } from '@pptx-editor.dev/core/editor';\nexport type { ColorMode, ResolvedColorMode } from '@pptx-editor.dev/core/editor';\nexport {\n PptxEditorContent,\n PptxEditorRoot,\n PptxEditorViewport,\n type PptxEditorContentProps,\n type PptxEditorRef,\n type PptxEditorRootProps,\n type PptxEditorViewportProps,\n} from './components.ts';\nexport {\n definePopup,\n type DefinePopupOptions,\n useEditorDialog,\n type PptxEditorDialogKey,\n type PptxEditorDialogSessionProps,\n type PptxEditorPopup,\n type PptxEditorPopups,\n type UseEditorDialogReturn,\n} from './popups.ts';\n// The overlays: the find bar, the notices, the link popup, and the slide show.\nexport {\n PptxEditorFindBar,\n requestFindBar,\n type FindPopupProps,\n type FindBarProps,\n} from './FindBar.tsx';\nexport { PptxEditorEditNotice, rejectionMessage, type EditNoticeProps } from './EditNotice.tsx';\nexport {\n PptxEditorOpenFailure,\n useOpenFailure,\n type OpenFailureContext,\n type PptxEditorOpenFailureProps,\n type UseOpenFailureOptions,\n type UseOpenFailureReturn,\n} from './OpenFailure.tsx';\nexport { PptxEditorFontNotice, type FontNoticeProps } from './FontNotice.tsx';\nexport {\n useHyperlinkPopup,\n useHyperlinkPopupInstance,\n type UseHyperlinkPopupInstanceReturn,\n type UseHyperlinkPopupReturn,\n} from './useHyperlinkPopup.ts';\nexport type {\n HyperlinkPopupActions,\n HyperlinkPopupLink,\n HyperlinkPopupMode,\n HyperlinkPopupState,\n} from '@pptx-editor.dev/core/editor';\nexport {\n useEditorHostDocument,\n usePptxSource,\n type UseEditorHostDocumentReturn,\n type UsePptxSourceReturn,\n} from './usePptxSource.ts';\nexport type {\n PptxFontOrigin,\n PptxFontsInput,\n PptxFontsSource,\n PptxSource,\n UsePptxSourceOptions,\n} from '@pptx-editor.dev/core/editor';\nexport { HyperlinkPopup, type HyperlinkPopupProps } from './HyperlinkPopup.tsx';\nexport {\n PptxEditorHyperLink,\n type HyperLinkActionProps,\n type HyperLinkPartProps,\n type HyperLinkProps,\n} from './HyperLink.tsx';\nexport {\n PptxEditorSlideshow,\n pptxSlideshowKey,\n useSlideshow,\n type UseSlideshowReturn,\n} from './Slideshow.tsx';\nexport {\n PageSetupDialog,\n usePageSetupDialog,\n type PageSetupDialogFieldName,\n type PageSetupDialogFields,\n type PageSetupDialogProps,\n type UsePageSetupDialogReturn,\n} from './PageSetupDialog.ts';\nexport {\n ImageAltTextDialog,\n useImageAltTextDialog,\n type ImageAltTextDialogFieldName,\n type ImageAltTextDialogFields,\n type ImageAltTextDialogProps,\n type UseImageAltTextDialogReturn,\n} from './ImageAltTextDialog.ts';\nexport {\n ImagePropertiesDialog,\n useImagePropertiesDialog,\n type ImagePropertiesDialogFieldName,\n type ImagePropertiesDialogFields,\n type ImagePropertiesDialogProps,\n type UseImagePropertiesDialogReturn,\n} from './ImagePropertiesDialog.ts';\nexport {\n BackgroundDialog,\n useBackgroundDialog,\n type BackgroundDialogFieldName,\n type BackgroundDialogFields,\n type BackgroundDialogProps,\n type UseBackgroundDialogReturn,\n} from './BackgroundDialog.tsx';\nexport {\n ParagraphDialog,\n useParagraphDialog,\n type ParagraphDialogFieldName,\n type ParagraphDialogProps,\n type UseParagraphDialogReturn,\n} from './ParagraphDialog.tsx';\nexport {\n FontDialog,\n useFontDialog,\n type FontDialogFieldName,\n type FontDialogProps,\n type UseFontDialogReturn,\n} from './FontDialog.tsx';\nexport {\n BulletsAndNumberingDialog,\n useBulletsAndNumberingDialog,\n type BulletsAndNumberingDialogFieldName,\n type BulletsAndNumberingDialogProps,\n type UseBulletsAndNumberingDialogReturn,\n} from './BulletsAndNumberingDialog.tsx';\nexport {\n ColumnsDialog,\n useColumnsDialog,\n type ColumnsDialogFieldName,\n type ColumnsDialogProps,\n type UseColumnsDialogReturn,\n} from './ColumnsDialog.tsx';\nexport type { DialogCustomizationProps, DialogPartProps, UseDialogReturn } from './dialog-parts.ts';\nexport {\n Icon,\n MenuItem,\n Popover,\n ToolButton,\n keepFocus,\n type IconProps,\n type MenuItemProps,\n type PopoverProps,\n type ToolButtonProps,\n} from './chrome.tsx';\nexport {\n MenuRow,\n MenuSeparator,\n MenuSubmenu,\n type MenuRowProps,\n type MenuSubmenuProps,\n} from './menu-row.tsx';\nexport { ContextMenu, type ContextMenuPoint, type ContextMenuProps } from './ContextMenu.tsx';\nexport {\n MenuEntry,\n MenuGroup,\n MenuSlotItem,\n PptxEditorMenu,\n type MenuEntryProps,\n type MenuGroupProps,\n type MenuNamespace,\n type MenuPartComponent,\n type MenuProps,\n type MenuSlotItemProps,\n type MenuNamedRows,\n type MenuRowPartComponent,\n type MenuRowPartProps,\n} from './menu-parts.tsx';\nexport type {\n ContextMenuPartName,\n MenuNamedRow,\n MenuRowPartName,\n} from '@pptx-editor.dev/core/editor';\nexport {\n PptxEditorContextMenu,\n useContextMenuRequest,\n useContextMenuTarget,\n type ContextMenuNamedRows,\n type ContextMenuNamespace,\n type ContextMenuRequest,\n type PptxEditorContextMenuProps,\n type UseContextMenuRequestReturn,\n type UseContextMenuTargetReturn,\n} from './context-menu-parts.tsx';\nexport {\n RailContextMenu,\n SectionContextMenu,\n type RailContextMenuProps,\n type RailMenuState,\n type SectionContextMenuProps,\n type SectionMenuState,\n} from './RailContextMenu.tsx';\nexport { useNotesPane, type UseNotesPaneReturn } from './pane-state.ts';\nexport {\n SlideRailAddSlide,\n SlideRailChooseLayout,\n SlideRailCollapse,\n SlideRailExpand,\n SlideRailDelete,\n SlideRailDuplicate,\n SlideRailMoveEarlier,\n SlideRailMoveLater,\n type SlideRailPartProps,\n} from './rail-parts.tsx';\nexport {\n PptxEditorSlideRail,\n PptxEditorSidePanel,\n PptxEditorZoomPill,\n type PaneProps,\n type SidePanelProps,\n type SlideRailProps,\n type ZoomPillProps,\n} from './panes.tsx';\nexport { PptxEditorNotesPane, type NotesPaneProps } from './NotesPane.tsx';\nexport { PptxEditorSlideSorter, type SlideSorterProps } from './SlideSorter.tsx';\nexport { requestSectionRename } from './RailSections.tsx';\nexport {\n PptxEditorLoading,\n PptxEditorLoadingSpinner,\n type LoadingProps,\n type LoadingSpinnerProps,\n} from './loading.ts';\nexport { PptxEditorRibbon, RibbonTab, type RibbonProps, type RibbonTabProps } from './ribbon.ts';\nexport {\n PptxEditorStatusBar,\n StatusBarNotes,\n StatusBarSlideNumber,\n StatusBarViews,\n StatusBarZoom,\n type StatusBarNotesProps,\n type StatusBarPartProps,\n type StatusBarProps,\n} from './status-bar.ts';\nexport {\n ToolbarControl,\n ToolbarGroup,\n ToolbarSlot,\n type ToolbarGroupProps,\n type ToolbarProps,\n type ToolbarSlotProps,\n} from './toolbar.ts';\nexport type { ToolbarControlProps } from './toolbar-controls.tsx';\nexport {\n PptxEditorToolbar,\n ToolbarAction,\n ToolbarSeparator,\n type PptxEditorToolbarNamespace,\n type ToolbarActionProps,\n type ToolbarPartComponent,\n type ToolbarPartProps,\n type ToolbarSeparatorProps,\n type ToolbarColorSplitComponent,\n type ToolbarColorSplitProps,\n type ToolbarSlotPartComponent,\n type ToolbarSlotPartProps,\n type FontFamilyNamespace,\n type FontFamilyProps,\n} from './toolbar-parts.ts';\nexport type { FontFamilyItemProps, FontFamilyPartProps } from './FontFamilyControl.tsx';\n\nexport { useFonts, type FontsInput, type UseFontsReturn } from './useFonts.ts';\nexport { useFontFamily, type UseFontFamilyReturn } from './useFontFamily.ts';\nexport {\n FillControl,\n GradientDialog,\n LineGlyph,\n LineMenuControl,\n ShapeGalleryControl,\n ShapeGrid,\n ShapeIcon,\n type FillControlProps,\n type GradientDialogProps,\n type LineGlyphProps,\n type LineMenuControlProps,\n type ShapeGalleryControlProps,\n type ShapeGridProps,\n type ShapeIconProps,\n} from './ShapeControls.tsx';\nexport { ShapeStyleGallery, type ShapeStyleGalleryProps } from './ShapeFormatControls.tsx';\nexport { MenuTableGrid, type MenuTableGridProps } from './TableControls.tsx';\nexport {\n LayoutControl,\n LayoutGallery,\n NewSlideControl,\n type LayoutControlProps,\n type LayoutGalleryProps,\n type NewSlideControlProps,\n} from './SlideControls.tsx';\nexport { EditorFontError } from '@pptx-editor.dev/core/editor';\nexport type {\n EditorFontErrorCode,\n FontConfiguration,\n FontFaceRequest,\n FontSource,\n FontSourceSubstitution,\n} from '@pptx-editor.dev/core/contracts';\n// The font-composition surface, re-exported as DOCX Editor's adapters do, so the common path\n// (a fonts package and an adapter) never needs a core import.\nexport {\n MAX_RESOLVER_FAMILIES,\n DEFAULT_FONT,\n composeFontConfiguration,\n composeFontOrigins,\n createFontSource,\n deferFonts,\n defineFontResolver,\n isFontResolver,\n loadFonts,\n type FontConfigurationBase,\n type FontConfigurationFragment,\n type FontLoadFailure,\n type FontLoadFailureReason,\n type FontOrigin,\n type FontResolutionRequest,\n type FontResolver,\n type FontResolverMark,\n type MarkedFontResolver,\n type FontUrlSource,\n type LoadFontsRequest,\n type LoadFontsResult,\n} from '@pptx-editor.dev/core/editor';\n// The core types that the adapter's own props, hooks, and parts use, re-exported as DOCX\n// Editor's adapters re-export `Editor`, `EditorCommand`, and `EditorSnapshot`, so a host types\n// its handlers with an import from this package only.\nexport type {\n BulletsDialogFields,\n CanvasMenuKind,\n ChromeControl,\n ChromeGroupId,\n ChromeMenuId,\n ChromeSlotId,\n ColumnsDialogFields,\n CommandResult,\n DocumentOpenFailure,\n EditorCommand,\n EditorExecOptions,\n EditorFontsOption,\n EditorMode,\n EditorModule,\n EditorRejection,\n EditorRemoval,\n EditorSnapshot,\n FontDialogFields,\n FontPickerGroup,\n FontPickerGroupId,\n FontPickerRow,\n GradientFill,\n ParagraphDialogFields,\n PptxEditorInstance,\n RibbonTabId,\n ShapeStyleChoice,\n ShapeStyleValue,\n SlideBackground,\n SlideLayoutSummary,\n SlideRailOrientation,\n SlideSection,\n SlideshowController,\n ToolbarShownValue,\n ToolbarValueMap,\n} from '@pptx-editor.dev/core/editor';\n\nconst pptxEditorProps = {\n /** `.pptx` bytes. Identity change loads the new document. */\n document: { type: Uint8Array as PropType<Uint8Array>, default: undefined },\n /** `'edit'` (default) or `'view'`. Changes apply without a reload. */\n mode: { type: String as PropType<EditorMode>, default: 'edit' },\n /** UI locale catalog, as on `PptxEditorRoot`. English when omitted. */\n locale: { type: Object as PropType<LocaleCatalog>, default: undefined },\n /** Families the font picker offers, as on `PptxEditorRoot`. A change applies in place. */\n fontFamilies: { type: Array as PropType<readonly string[]>, default: undefined },\n /** Capability modules (`@pptx-editor.dev/pro`), as on `PptxEditorRoot`. Read at mount. */\n modules: { type: Array as PropType<readonly EditorModule[]>, default: undefined },\n /** Customize the dialogs the editor mounts, as on `PptxEditorRoot`. */\n popups: { type: Object as PropType<PptxEditorPopups>, default: undefined },\n /** The chrome color mode, as on `PptxEditorRoot`. */\n colorMode: { type: String as PropType<ColorMode>, default: undefined },\n /** Font bytes for the host's faces, as on `PptxEditorRoot`. */\n fonts: { type: [Object, Function] as PropType<EditorFontsOption>, default: undefined },\n /**\n * The notice for a file that does not open (`PptxEditorOpenFailure`). An object is\n * `PptxEditorOpenFailureProps`, passed straight through. `false` removes the notice, for a\n * host that reports the failure itself through `useOpenFailure`. For your own buttons, use\n * the `openFailureActions` slot: it replaces `openFailure.actions`, and with `false` it\n * renders nothing. Both cases print a development warning. Default `true`.\n */\n openFailure: {\n type: [Boolean, Object] as PropType<boolean | PptxEditorOpenFailureProps>,\n default: true,\n },\n /**\n * The toolbar (`PptxEditorToolbar`). An object is `ToolbarProps`, passed straight through.\n * `false` removes it. Default `true`.\n */\n toolbar: { type: [Boolean, Object] as PropType<boolean | ToolbarProps>, default: true },\n /**\n * The menu bar (`PptxEditorMenu`), above the toolbar. An object is `MenuProps`, passed\n * straight through, as DOCX Editor's `menu`. Default `false`: the packaged editor shows the\n * toolbar only.\n */\n menu: { type: [Boolean, Object] as PropType<boolean | MenuProps>, default: false },\n /**\n * The slide canvas's context menu. An object is `PptxEditorContextMenuProps`, passed straight\n * through. `false` shows no menu. It sets `popups.contextMenu`, and a `popups.contextMenu`\n * entry wins over it. Default `true`.\n */\n contextMenu: {\n type: [Boolean, Object] as PropType<boolean | PptxEditorContextMenuProps>,\n default: true,\n },\n /**\n * The packaged link popup. `false` removes it, as `popups.hyperlink: false` does: a host\n * panel that reads `useHyperlinkPopup()` then opens for the link controls. Default `true`.\n */\n hyperlinkPopup: { type: Boolean, default: true },\n /**\n * The slide rail (`PptxEditorSlideRail`), as DOCX Editor's `navigation`. An object is\n * `SlideRailProps`, passed straight through. `false` removes it. Default `true`.\n */\n slideRail: { type: [Boolean, Object] as PropType<boolean | SlideRailProps>, default: true },\n /**\n * The speaker notes pane (`PptxEditorNotesPane`). An object is `NotesPaneProps`, passed\n * straight through. `false` removes it. Default `true`.\n */\n notesPane: { type: [Boolean, Object] as PropType<boolean | NotesPaneProps>, default: true },\n} as const;\n\n/** The props an object value gives, or none for `true`. */\nconst partProps = <P extends object>(value: boolean | P | undefined): P | null =>\n typeof value === 'object' ? value : null;\n\n/**\n * The `popups` the sugar passes to the root: the host's entries, with `contextMenu` and\n * `hyperlinkPopup` mapped onto the same entries, as React's sugar. A host entry wins.\n */\nfunction sugarPopups(\n popups: PptxEditorPopups | undefined,\n hyperlinkPopup: boolean,\n contextMenu: boolean | PptxEditorContextMenuProps\n): PptxEditorPopups | undefined {\n const linkOff = !hyperlinkPopup && popups?.hyperlink === undefined;\n const menuEntry =\n popups?.contextMenu !== undefined || contextMenu === true\n ? undefined\n : contextMenu === false\n ? (false as const)\n : (props: PptxEditorContextMenuProps) =>\n h(PptxEditorContextMenu, { ...props, ...contextMenu });\n if (!linkOff && menuEntry === undefined) return popups;\n return {\n ...popups,\n ...(linkOff ? { hyperlink: false as const } : {}),\n ...(menuEntry !== undefined ? { contextMenu: menuEntry } : {}),\n };\n}\n\n/**\n * Props of the `PptxEditor` sugar component, the twin of React's `PptxEditorProps`. Derived\n * from the component's runtime props, so the two cannot drift. @public\n */\nexport type PptxEditorProps = ExtractPublicPropTypes<typeof pptxEditorProps>;\n\nconst OPEN_FAILURE_ACTION_NAMES = {\n actions: 'The #openFailureActions slot',\n off: ':open-failure=\"false\"',\n} as const;\n\n/**\n * The complete default editor: toolbar, slide rail, canvas, speaker notes, zoom pill, and the\n * slide show (F5), the twin of React's `PptxEditor`. Sugar over the same primitives a custom\n * layout composes. Emits `ready` with the instance. A template ref reads a `PptxEditorRef`.\n * @public\n */\nconst PptxEditorDefault = defineComponent({\n name: 'PptxEditor',\n // The root renders no element, so the host's attributes (`class`, `style`, `id`, `data-*`)\n // go onto the viewport, as React's `className` does.\n inheritAttrs: false,\n props: pptxEditorProps,\n emits: {\n ready: (_editor: PptxEditorInstance) => true,\n /** After every change of editor state, as on `PptxEditorRoot`. */\n change: (_editor: PptxEditorInstance) => true,\n /** A font failure, as on `PptxEditorRoot`. */\n fontError: (_error: EditorFontError) => true,\n },\n slots: Object as SlotsType<{\n /** Extra content inside the viewport, after the slide show. */\n default?: () => VNodeChild;\n /** Your own buttons in the open-failure notice, before **Close**. */\n openFailureActions?: (context: OpenFailureContext) => VNodeChild;\n }>,\n setup(props, { attrs, emit, expose, slots }) {\n // Read at render, not once: a parent re-render can add or remove the listener.\n const instance = getCurrentInstance();\n // The same members as the root's handle, read through the root at each call.\n const root = shallowRef<PptxEditorRef | null>(null);\n expose(createEditorRefApi(() => root.value?.getEditor() ?? null) satisfies PptxEditorRef);\n return () => {\n warnOpenFailureActions(\n props.openFailure,\n slots.openFailureActions !== undefined,\n OPEN_FAILURE_ACTION_NAMES\n );\n const popups = sugarPopups(props.popups, props.hyperlinkPopup, props.contextMenu);\n const dock =\n props.menu === false && props.toolbar === false\n ? null\n : h('div', { class: 'pptx-default__dock' }, [\n props.menu === false ? null : h(PptxEditorMenu, partProps(props.menu)),\n props.toolbar === false ? null : h(PptxEditorToolbar, partProps(props.toolbar)),\n ]);\n return h(\n PptxEditorRoot,\n {\n ref: root,\n ...(props.document ? { document: props.document } : {}),\n ...(props.locale ? { locale: props.locale } : {}),\n ...(props.fontFamilies ? { fontFamilies: props.fontFamilies } : {}),\n ...(popups ? { popups } : {}),\n ...(props.colorMode ? { colorMode: props.colorMode } : {}),\n ...(props.fonts ? { fonts: props.fonts } : {}),\n ...(props.modules ? { modules: props.modules } : {}),\n // Forwarded only with a listener, so the root still warns when nobody listens.\n ...(instance?.vnode.props?.onFontError\n ? { onFontError: (error: EditorFontError) => emit('fontError', error) }\n : {}),\n mode: props.mode,\n onReady: (editor: PptxEditorInstance) => emit('ready', editor),\n onChange: (editor: PptxEditorInstance) => emit('change', editor),\n },\n {\n default: () =>\n h(PptxEditorViewport, mergeProps(attrs, { class: 'pptx-default' }), () => [\n dock,\n h(DefaultWorkspace, null, {\n overlay: () =>\n props.openFailure === false\n ? null\n : h(\n PptxEditorOpenFailure,\n typeof props.openFailure === 'object' ? props.openFailure : null,\n slots.openFailureActions ? { actions: slots.openFailureActions } : undefined\n ),\n normal: () =>\n h('div', { class: 'pptx-default__workspace' }, [\n props.slideRail === false\n ? null\n : h(PptxEditorSlideRail, partProps(props.slideRail)),\n h('div', { class: 'pptx-default__main' }, [\n h(PptxEditorContent),\n h(PptxEditorFindBar),\n h(PptxEditorEditNotice),\n h(PptxEditorLoading, { overlay: true }),\n h(PptxEditorFontNotice),\n props.notesPane === false\n ? null\n : h(PptxEditorNotesPane, partProps(props.notesPane)),\n ]),\n ]),\n }),\n h(PptxEditorSlideshow),\n slots.default?.(),\n ]),\n }\n );\n };\n },\n});\n\n/**\n * The default editor, with every part on it, the twin of React's `PptxEditor` namespace and of\n * DOCX Editor's Vue `DocxEditor`: `PptxEditor.Root`, `PptxEditor.Toolbar`, `PptxEditor.Menu`,\n * and the rest name the same parts as their `PptxEditor<Part>` exports. @public\n */\nexport const PptxEditor = Object.assign(PptxEditorDefault, {\n Root: PptxEditorRoot,\n Viewport: PptxEditorViewport,\n Content: PptxEditorContent,\n Toolbar: PptxEditorToolbar,\n ToolbarControl,\n SlideRail: PptxEditorSlideRail,\n SlideSorter: PptxEditorSlideSorter,\n NotesPane: PptxEditorNotesPane,\n ZoomPill: PptxEditorZoomPill,\n SidePanel: PptxEditorSidePanel,\n FontNotice: PptxEditorFontNotice,\n EditNotice: PptxEditorEditNotice,\n OpenFailure: PptxEditorOpenFailure,\n Loading: PptxEditorLoading,\n PageSetupDialog,\n BackgroundDialog,\n ImageAltTextDialog,\n ImagePropertiesDialog,\n ParagraphDialog,\n FontDialog,\n BulletsAndNumberingDialog,\n ColumnsDialog,\n Slideshow: PptxEditorSlideshow,\n FindBar: PptxEditorFindBar,\n Menu: PptxEditorMenu,\n ContextMenu: PptxEditorContextMenu,\n Ribbon: PptxEditorRibbon,\n StatusBar: PptxEditorStatusBar,\n});\n","// Provider-first host for the editor facade: the Vue twin of the React adapter's\n// `PptxEditor.Root` / `.Viewport` / `.Content` (packages/react/src/PptxEditorRoot.tsx), after\n// DOCX Editor's Vue adapter (docx-editor/packages/vue/src/editor/DocxEditorRoot.ts).\n//\n// `PptxEditorRoot` renders no DOM of its own: it creates the instance on mount, provides it,\n// and lets `PptxEditorContent` attach the surface wherever the host's template puts it. Props\n// are declared once as a const; the public props type derives from it, so the two cannot\n// drift (the parity check reads the runtime props).\n\nimport {\n defineComponent,\n getCurrentInstance,\n h,\n mergeProps,\n onMounted,\n onUnmounted,\n provide,\n shallowRef,\n watch,\n type ExtractPublicPropTypes,\n type PropType,\n} from 'vue';\nimport {\n createEditorRefApi,\n createPptxEditor,\n localeContentKey,\n repaintSurfaceOf,\n reportFontError,\n translateKeyOrText,\n warnModulesChanged,\n type ColorMode,\n type CommandResult,\n type EditorCommand,\n type EditorExecOptions,\n type EditorSnapshot,\n type EditorFontError,\n type EditorFontsOption,\n type EditorMode,\n type EditorModule,\n type PptxEditorInstance,\n} from '@pptx-editor.dev/core/editor';\nimport { createTranslator, type LocaleCatalog, type Translate } from '@pptx-editor.dev/i18n';\nimport { providePptxEditor, pptxTranslationKey, usePptxEditor } from './composables.ts';\nimport { ActiveDialog, provideDialogHost, type PptxEditorPopups } from './popups.ts';\nimport { provideChromeDark, provideScopedByAncestor, useChromeDark } from './color-mode.ts';\nimport { providePaneState } from './pane-state.ts';\nimport { provideSlideshow } from './Slideshow.tsx';\nimport { provideFindBars } from './FindBar.tsx';\nimport { LinkPopupHost } from './HyperlinkPopup.tsx';\nimport { provideHyperlinkPopup } from './useHyperlinkPopup.ts';\nimport { useCanvasContextMenu } from './CanvasContextMenu.tsx';\nimport { SlideSorterWatch } from './SlideSorter.tsx';\nimport { ChromeTooltip } from './ChromeTooltip.tsx';\n\nconst pptxEditorRootProps = {\n /** `.pptx` bytes. Identity change loads the new document. */\n document: { type: Uint8Array as PropType<Uint8Array>, default: undefined },\n /** `'edit'` (default) or `'view'`. Changes apply without a reload. */\n mode: { type: String as PropType<EditorMode>, default: 'edit' },\n /** UI locale catalog; English when omitted. */\n locale: { type: Object as PropType<LocaleCatalog>, default: undefined },\n /**\n * Font bytes for the host's faces, as DOCX Editor's `fonts` prop: a `FontConfiguration`, a\n * fragment, or a `FontResolver` such as `packagedFonts()`. Use `useFonts(...)` for a stable\n * value. A change replaces the fonts in place (`setFonts`).\n */\n fonts: { type: [Object, Function] as PropType<EditorFontsOption>, default: undefined },\n /**\n * Families the font picker offers besides the standard ones and the deck's own. A change\n * updates the picker in place (`setFontFamilies`); the document and the undo history stay.\n */\n fontFamilies: { type: Array as PropType<readonly string[]>, default: undefined },\n /**\n * Capability modules, as DOCX Editor's `modules` prop: the review and collaboration modules\n * of `@pptx-editor.dev/pro`. Read once, when the editor is created: a later change has no\n * effect and prints a development warning. Create the list once, outside the component.\n */\n modules: { type: Array as PropType<readonly EditorModule[]>, default: undefined },\n /** Customize the dialogs the editor mounts. Set an entry to `false` to turn one off. */\n popups: { type: Object as PropType<PptxEditorPopups>, default: undefined },\n /** The chrome color mode: `'light'` (default), `'dark'`, or `'system'`. */\n colorMode: { type: String as PropType<ColorMode>, default: undefined },\n} as const;\n\n/** Props of `PptxEditorRoot`, the twin of React's `PptxEditorRootProps`. @public */\nexport type PptxEditorRootProps = ExtractPublicPropTypes<typeof pptxEditorRootProps>;\n\n/**\n * The imperative handle of `PptxEditor` and `PptxEditorRoot`, the twin of React's\n * `PptxEditorRef` and of DOCX Editor's `DocxEditorRef`: a template ref on either component\n * reads these members (`expose`). Every member forwards to the editor instance and is safe to\n * call before the editor mounts: `load` and `exec` refuse with `disabled.noEditor`, `save` and\n * `getEditor` return `null`, `focus` does nothing, and `snapshot` returns an empty snapshot.\n * Everything else is on the instance that `getEditor` returns. @public\n */\nexport interface PptxEditorRef {\n /** Open `.pptx` bytes. Resolves when the presentation is open, or with the refusal. */\n load(bytes: Uint8Array): Promise<CommandResult>;\n /**\n * The presentation as `.pptx` bytes, or `null` when no presentation is open. The bytes own an\n * `ArrayBuffer`, so `new Blob([bytes])` takes them as they are.\n */\n save(): Uint8Array<ArrayBuffer> | null;\n /** The editor instance, or `null` before it mounts. */\n getEditor(): PptxEditorInstance | null;\n /** Give the keyboard back to the slide: the text caret, else the slide surface. */\n focus(): void;\n /** Run a command, as `editor.exec`. */\n exec(command: EditorCommand, options?: EditorExecOptions): CommandResult;\n /** The current editor state, as `editor.snapshot()`. */\n snapshot(): EditorSnapshot;\n}\n\n/** True for an element node from any window (an iframe or a pop-out has its own `HTMLElement`). */\nfunction isElement(value: unknown): value is HTMLElement {\n return typeof value === 'object' && value !== null && (value as Node).nodeType === 1;\n}\n\n/**\n * Owns the editor instance, as React's `PptxEditor.Root`. Only `document` identity reloads\n * the document; `mode` and `locale` apply without a reload. Emits `ready` once per instance\n * and `change` after every change of editor state. @public\n */\nexport const PptxEditorRoot = defineComponent({\n name: 'PptxEditorRoot',\n props: pptxEditorRootProps,\n emits: {\n ready: (_editor: PptxEditorInstance) => true,\n change: (_editor: PptxEditorInstance) => true,\n /** A font failure: a failed origin, a refused face, or a failed resolution. */\n fontError: (_error: EditorFontError) => true,\n },\n setup(props, { emit, expose, slots }) {\n // With no `fontError` listener, the failure prints one warning instead of going nowhere.\n // The listener is read when the error occurs: a parent re-render can add or remove it.\n const instance = getCurrentInstance();\n const onFontError = (error: EditorFontError): void =>\n reportFontError(\n error,\n instance?.vnode.props?.onFontError\n ? (e: EditorFontError) => emit('fontError', e)\n : undefined\n );\n // The fonts the instance was created with: only a later change reaches `setFonts`.\n let createdFonts: EditorFontsOption | undefined;\n // The same for `fontFamilies` and `setFontFamilies`.\n let createdFamilies: readonly string[] | undefined;\n // The modules the instance was created with: modules register at creation only.\n let createdModules: readonly EditorModule[] | undefined;\n const editor = shallowRef<PptxEditorInstance | null>(null);\n const t = shallowRef<Translate>(createTranslator(props.locale));\n providePptxEditor(editor);\n provide(pptxTranslationKey, t);\n // The ref members read the live instance at each call, as React's `useImperativeHandle`.\n expose(createEditorRefApi(() => editor.value) satisfies PptxEditorRef);\n // The catalog's content, not its identity: an inline locale object makes a new value on\n // each parent render and must not retranslate or repaint, as React's root.\n watch(\n () => localeContentKey(props.locale),\n () => {\n t.value = createTranslator(props.locale);\n // The canvas repaints once with the new placeholder prompts and frame labels, and\n // emits no `change`, so a host whose `change` handler sets state does not loop.\n if (editor.value) repaintSurfaceOf(editor.value);\n }\n );\n\n let off: (() => void) | null = null;\n onMounted(() => {\n const instance = createPptxEditor({\n mode: props.mode,\n ...(props.fontFamilies ? { fontFamilies: props.fontFamilies } : {}),\n ...(props.fonts ? { fonts: props.fonts } : {}),\n ...(props.modules ? { modules: props.modules } : {}),\n onFontError,\n translate: (key, params) => translateKeyOrText(t.value, key, params),\n });\n createdFonts = props.fonts;\n createdFamilies = props.fontFamilies;\n createdModules = props.modules;\n editor.value = instance;\n emit('ready', instance);\n off = instance.subscribe(() => emit('change', instance));\n if (props.document) void instance.load(props.document);\n });\n // After the children unmounted, as DOCX Editor's root: Content detaches first.\n onUnmounted(() => {\n off?.();\n off = null;\n const instance = editor.value;\n editor.value = null;\n instance?.destroy();\n });\n watch(\n () => props.document,\n (bytes) => {\n if (editor.value && bytes) void editor.value.load(bytes);\n }\n );\n watch(\n () => props.mode,\n (mode) => editor.value?.setMode(mode)\n );\n // A `modules` change after creation has no effect: say so in development, as React's root.\n // The check is by the identity of each module, so a new array of the same modules does not\n // warn.\n watch(\n () => props.modules,\n (modules) => {\n if (editor.value) warnModulesChanged(createdModules, modules, 'PptxEditorRoot');\n }\n );\n // A new `fonts` value replaces the instance's fonts in place, as DOCX Editor's root.\n watch(\n () => [editor.value, props.fonts] as const,\n ([instance, fonts]) => {\n if (!instance || createdFonts === fonts) return;\n createdFonts = fonts;\n // Rejects only after destroy; font failures report through `fontError`.\n instance.setFonts(fonts).catch(() => {});\n },\n { flush: 'post' }\n );\n // A new `fontFamilies` list updates the font picker in place. The instance compares by\n // content, so an inline array made on each render changes nothing.\n watch(\n () => [editor.value, props.fontFamilies] as const,\n ([instance, families]) => {\n if (!instance || createdFamilies === families) return;\n createdFamilies = families;\n instance.setFontFamilies(families ?? []);\n },\n { flush: 'post' }\n );\n // The slide show and the find bar count, as React's root publishes them; the action host\n // starts the show and opens find and the link popup through them.\n const slideshow = provideSlideshow(editor);\n const findBars = provideFindBars();\n // The root's one link popup state, which the packaged popup and `useHyperlinkPopup` share.\n const link = provideHyperlinkPopup();\n const host = provideDialogHost(editor, () => props.popups, {\n slideshow,\n findBars,\n linkViews: link.views,\n });\n provideChromeDark(() => props.colorMode);\n // The notes pane's open state, which the pane and host chrome share (`useNotesPane`).\n providePaneState();\n // The root hosts the link popup, so Ctrl/Cmd+K and Insert > Link work with no toolbar.\n return () => [\n slots.default?.(),\n h(SlideSorterWatch),\n h(ActiveDialog, { host }),\n h(LinkPopupHost, { store: link.store, views: link.views.value }),\n h(ChromeTooltip),\n ];\n },\n});\n\nconst pptxEditorViewportProps = {\n /** A class name added to the viewport, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n} as const;\n\n/** The props of `PptxEditorViewport`, the twin of React's `PptxEditorViewportProps`. @public */\nexport type PptxEditorViewportProps = ExtractPublicPropTypes<typeof pptxEditorViewportProps>;\n\n/**\n * The editor's scroll and styling scope: carries the `.pptx-editor` class, and `dark` with it\n * when the root's `colorMode` resolves to dark. @public\n */\nexport const PptxEditorViewport = defineComponent({\n name: 'PptxEditorViewport',\n props: pptxEditorViewportProps,\n setup(props, { slots }) {\n const dark = useChromeDark();\n provideScopedByAncestor();\n // The host's `class` attribute merges onto this element through attribute fallthrough.\n return () =>\n h(\n 'div',\n { class: ['pptx-editor', dark.value ? 'dark' : null, props.className] },\n slots.default?.()\n );\n },\n});\n\nconst pptxEditorContentProps = {\n /** A class name added to the canvas, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n} as const;\n\n/** The props of `PptxEditorContent`, the twin of React's `PptxEditorContentProps`. @public */\nexport type PptxEditorContentProps = ExtractPublicPropTypes<typeof pptxEditorContentProps>;\n\n/**\n * The slide canvas: attaches the engine surface while it is mounted. Right-click, Shift+F10, and\n * the Menu key open its context menu. @public\n */\nexport const PptxEditorContent = defineComponent({\n name: 'PptxEditorContent',\n // The canvas renders next to its context menu layer, so the host's attributes go on the canvas.\n inheritAttrs: false,\n props: pptxEditorContentProps,\n setup(props, { attrs }) {\n const editorRef = usePptxEditor();\n // Right-click, Shift+F10, and the Menu key open the canvas context menu, as React's content.\n const menu = useCanvasContextMenu();\n const host = shallowRef<HTMLElement | null>(null);\n let attached: PptxEditorInstance | null = null;\n const sync = (): void => {\n const editor = editorRef.value;\n const el = host.value;\n if (attached && (attached !== editor || !el)) {\n attached.detach();\n attached = null;\n }\n if (editor && el && attached !== editor) {\n editor.attach(el);\n attached = editor;\n }\n };\n onMounted(sync);\n watch(editorRef, sync);\n onUnmounted(() => {\n attached?.detach();\n attached = null;\n });\n return () => [\n // `mergeProps` keeps a host's own `@contextmenu` and `@keydown` next to the menu's.\n h(\n 'div',\n mergeProps(attrs, {\n ref: (el: unknown) => {\n host.value = isElement(el) ? el : null;\n },\n class: ['pptx-canvas', props.className],\n 'data-pptx-canvas': '',\n onContextmenu: menu.onContextmenu,\n onKeydown: menu.onKeydown,\n })\n ),\n menu.layer(),\n ];\n },\n});\n","// Injection keys and composables: the Vue twin of the React adapter's context and hooks\n// (packages/react/src/context.ts). The state each composable derives comes from the shared\n// adapter support in core (`editorCommandFor`, `EMPTY_EDITOR_SNAPSHOT`,\n// `platformShortcuts`), so React and Vue report the same thing. After DOCX Editor's Vue\n// adapter (docx-editor/packages/vue/src/editor/context.ts, useDocxEditorRoot.ts,\n// useEditorState.ts, useEditorCommand.ts): the root holds ONE editor subscription and\n// publishes a change tick, and every composable reads the tick, so a toolbar of fifty controls\n// costs one subscription, not fifty. Every composable annotates a named `Use<Name>Return`\n// type, so core's internal types do not leak into the API snapshot.\n\nimport {\n computed,\n getCurrentScope,\n inject,\n onScopeDispose,\n provide,\n shallowRef,\n toValue,\n watch,\n type ComputedRef,\n type InjectionKey,\n type MaybeRefOrGetter,\n type ShallowRef,\n} from 'vue';\nimport { createTranslator, type Translate } from '@pptx-editor.dev/i18n';\nimport {\n EMPTY_EDITOR_SNAPSHOT,\n chromeCommandState,\n editorCommandFor,\n platformShortcuts,\n runToolbarCommand,\n sameBulletFormat,\n sameChromeCommandState,\n sameFontFormat,\n sameParagraphFormat,\n valueSlotOptions,\n valueSlotShown,\n type BulletFormat,\n type BulletFormatRead,\n type ChromeActionHost,\n type ChromeCommandState,\n type ChromeSlotId,\n type CommandResult,\n type EditorExecOptions,\n type ToolbarShownValue,\n type ToolbarSlotValue,\n type ToolbarValueMap,\n type EditorSnapshot,\n type FontFormatCommand,\n type FontFormatRead,\n type ParagraphFormatCommand,\n type ParagraphFormatRead,\n type SlideLayoutSummary,\n type PptxEditorInstance,\n warnOutsideRoot,\n} from '@pptx-editor.dev/core/editor';\nimport { NOTES_SLOTS, useNotesTarget } from './notes-target.ts';\n\n/** The editor instance published by `PptxEditorRoot`. @public */\nexport const pptxEditorKey: InjectionKey<ShallowRef<PptxEditorInstance | null>> =\n Symbol('pptxEditor');\n\n/** The translator published by `PptxEditorRoot` from its `locale` prop. @public */\nexport const pptxTranslationKey: InjectionKey<ShallowRef<Translate>> = Symbol('pptxTranslation');\n\n/** A counter the root bumps on every editor change: one subscription for all composables. */\nconst pptxEditorTickKey: InjectionKey<ShallowRef<number>> = Symbol('pptxEditorTick');\n\nconst nullEditor = shallowRef<PptxEditorInstance | null>(null);\nconst englishTranslator = shallowRef<Translate>(createTranslator());\n\nlet activeSubscriptions = 0;\n\n/** Live editor subscriptions the adapter holds. Tests check cleanup with it. @internal */\nexport function editorStateActiveSubscriptionCount(): number {\n return activeSubscriptions;\n}\n\n/** Subscribe to `editor`, counting the subscription. Returns the unsubscribe function. */\nfunction subscribe(editor: PptxEditorInstance, listener: () => void): () => void {\n activeSubscriptions += 1;\n const off = editor.subscribe(listener);\n let live = true;\n return () => {\n if (!live) return;\n live = false;\n off();\n activeSubscriptions -= 1;\n };\n}\n\n/**\n * Publish `editor` and one shared change tick to the components below. `PptxEditorRoot`\n * calls it; a host that owns the instance can call it in its own `setup`. @internal\n */\nexport function providePptxEditor(editor: ShallowRef<PptxEditorInstance | null>): void {\n provide(pptxEditorKey, editor);\n const tick = shallowRef(0);\n provide(pptxEditorTickKey, tick);\n let off: (() => void) | null = null;\n watch(\n editor,\n (next) => {\n off?.();\n off = next ? subscribe(next, () => (tick.value += 1)) : null;\n tick.value += 1;\n },\n { immediate: true }\n );\n onScopeDispose(() => {\n off?.();\n off = null;\n });\n}\n\n/** What `usePptxEditor` returns: the editor, or null before `PptxEditorRoot` mounts it. @public */\nexport type UsePptxEditorReturn = Readonly<ShallowRef<PptxEditorInstance | null>>;\n\n/**\n * The editor instance, or null before it mounts. Outside `PptxEditorRoot` it is always null,\n * and a development warning says so, as for the other parts. @public\n */\nexport function usePptxEditor(): UsePptxEditorReturn {\n const editor = inject(pptxEditorKey, nullEditor);\n if (editor === nullEditor) warnOutsideRoot('usePptxEditor');\n return editor;\n}\n\n/** What `useTranslation` returns. @public */\nexport interface UseTranslationReturn {\n /** Translate a key, with shortcut text for this platform. Reactive to the `locale` prop. */\n readonly t: Translate;\n}\n\n/** The translator, with shortcut text for this platform. @public */\nexport function useTranslation(): UseTranslationReturn {\n const base = inject(pptxTranslationKey, englishTranslator);\n return { t: (key, params) => platformShortcuts(base.value(key, params)) };\n}\n\n/** What `useEditorState` returns: the selected slice, updated when it changes. @public */\nexport type UseEditorStateReturn<T> = Readonly<ShallowRef<T>>;\n\n/** `useEditorState`, plus a source whose change re-reads the slice (the command's slot). */\nfunction useSlice<T>(\n selector: (snapshot: EditorSnapshot) => T,\n isEqual: (a: T, b: T) => boolean,\n deps?: () => unknown\n): UseEditorStateReturn<T> {\n const editorRef = usePptxEditor();\n const tick = inject(pptxEditorTickKey, null);\n // DOCX Editor's memo: `snapshot()` returns the same object until the state changes, so a\n // change with an unchanged snapshot skips the selector. A selector that builds a new array on\n // each call (`ribbonTabs(s)`) then updates the ref only when the state changed. A new editor\n // or a changed `deps` source always re-reads the slice.\n let seen: EditorSnapshot | null = null;\n const current = (): EditorSnapshot => {\n const editor = editorRef.value;\n return editor ? editor.snapshot() : EMPTY_EDITOR_SNAPSHOT;\n };\n const read = (): T => {\n seen = current();\n return selector(seen);\n };\n const out = shallowRef(read()) as ShallowRef<T>;\n const update = (): void => {\n const next = read();\n if (!isEqual(out.value, next)) out.value = next;\n };\n const onChange = (): void => {\n if (current() !== seen) update();\n };\n if (!getCurrentScope()) return out;\n if (deps) watch(deps, update);\n if (tick) {\n watch(editorRef, update);\n watch(tick, onChange);\n return out;\n }\n // No root above (a host that provides only the editor): subscribe directly.\n let off: (() => void) | null = null;\n watch(\n editorRef,\n (editor) => {\n off?.();\n off = editor ? subscribe(editor, onChange) : null;\n update();\n },\n { immediate: true }\n );\n onScopeDispose(() => off?.());\n return out;\n}\n\n/**\n * Subscribe to a slice of editor state. The ref updates only when `isEqual` says the slice\n * changed (default `Object.is`), as React's `useEditorState`. @public\n */\nexport function useEditorState<T>(\n selector: (snapshot: EditorSnapshot) => T,\n isEqual: (a: T, b: T) => boolean = Object.is\n): UseEditorStateReturn<T> {\n return useSlice(selector, isEqual);\n}\n\n/** What `useSlideLayouts` returns: the deck's slide layouts. @public */\nexport type UseSlideLayoutsReturn = UseEditorStateReturn<readonly SlideLayoutSummary[]>;\n\nconst NO_LAYOUTS: readonly SlideLayoutSummary[] = [];\n\n/**\n * The deck's slide layouts (`EditorSnapshot.layouts`), in the order the galleries list them, as\n * React's `useSlideLayouts`. For a host's own layout picker. @public\n */\nexport function useSlideLayouts(): UseSlideLayoutsReturn {\n return useSlice((s) => s.layouts ?? NO_LAYOUTS, Object.is);\n}\n\n/** What `useEditorCommand` returns: one source of enabled state, and the runner. @public */\nexport interface UseEditorCommandReturn {\n /**\n * Run the slot's command, with a value for value controls: the picked option's value, a\n * number of points for `font.size`, or `{ step: 1 }` / `{ step: -1 }` for its Increase and\n * Decrease Font Size buttons (`commandForSlotValue`). Returns true when the engine ran it and\n * false on a refusal, as in DOCX Editor.\n */\n readonly execute: (value?: unknown) => boolean;\n /** Whether the command can run now. */\n readonly isEnabled: ComputedRef<boolean>;\n /** Whether a toggle control shows as pressed. */\n readonly isActive: ComputedRef<boolean>;\n /** A translation key, or the engine's own text, when the control is disabled. */\n readonly disabledReason: ComputedRef<string | null>;\n /** The value a value control shows (a font size, a family), when it has one. */\n readonly value: ComputedRef<string | number | undefined>;\n}\n\n/** The root's `ChromeActionHost`, provided with its dialog host. @internal */\nexport const chromeActionHostKey: InjectionKey<ChromeActionHost> = Symbol('pptxChromeActionHost');\n\n/**\n * State and execution for one `ChromeSlotId`, as React's `useEditorCommand`. The slot may be\n * a ref or a getter, as in DOCX Editor's Vue adapter: the state follows it. @public\n */\nexport function useEditorCommand(slot: MaybeRefOrGetter<ChromeSlotId>): UseEditorCommandReturn {\n const editorRef = usePptxEditor();\n // The root's action host opens its dialogs, the find bar, the link popup, and the slide\n // show, and picks pictures, as React's. Outside a root there is no host: those slots show as\n // disabled with the reason.\n const host = inject(chromeActionHostKey, null);\n const read = (): ChromeCommandState =>\n editorCommandFor(editorRef.value, toValue(slot), host, 'disabled.noRoot').state;\n // The deps read the slot and the root's `popups` (through the host), so a host that changes\n // `popups` at runtime turns the control on or off at once, not at the next editor change.\n const state = useSlice<ChromeCommandState>(read, sameChromeCommandState, () => [\n toValue(slot),\n read(),\n ]);\n // While a speaker notes field has focus, bold, italic, underline, and strikethrough format\n // the notes text, as in React (`NOTES_SLOTS`).\n const notes = useNotesTarget(editorRef);\n const notesFormat = computed(() => {\n const target = notes.value;\n const format = NOTES_SLOTS[toValue(slot)];\n return target && format ? { target, format } : null;\n });\n return {\n execute: (value?: unknown) => {\n const n = notesFormat.value;\n if (n) return n.target.apply(n.format);\n return editorCommandFor(editorRef.value, toValue(slot), host, 'disabled.noRoot').execute(\n value\n );\n },\n isEnabled: computed(() => {\n const n = notesFormat.value;\n return n ? !n.target.readOnly && n.target.canFormat : state.value.isEnabled;\n }),\n isActive: computed(() => {\n const n = notesFormat.value;\n return n ? n.target.formats[n.format] : state.value.isActive;\n }),\n disabledReason: computed(() => {\n const n = notesFormat.value;\n if (!n) return state.value.disabledReason;\n if (n.target.readOnly) return 'disabled.viewing';\n return n.target.canFormat ? null : 'disabled.selectNotesText';\n }),\n value: computed(() => state.value.value),\n };\n}\n\n/** What `useParagraphFormat` returns. @public */\nexport interface UseParagraphFormatReturn {\n /** The selected paragraphs' formatting, or null when no text is selected. */\n readonly format: UseEditorStateReturn<ParagraphFormatRead | null>;\n /** Whether the engine can write paragraph formatting now (text or a shape with text selected, editable). */\n readonly isEnabled: ComputedRef<boolean>;\n /** Write the given fields as ONE undo step. Returns whether the engine accepted them. */\n readonly apply: (update: ParagraphFormatCommand) => boolean;\n}\n\n/**\n * The selection's paragraph formatting, and the command to change it, as React's\n * `useParagraphFormat` and DOCX Editor's Vue composable of the same name. @public\n */\nexport function useParagraphFormat(): UseParagraphFormatReturn {\n const editorRef = usePptxEditor();\n const format = useEditorState((s) => s.format?.paragraph ?? null, sameParagraphFormat);\n // The engine's answer, not the dialog slot's: Vue has no dialog host, and hiding a dialog\n // never turns off the operation.\n const enabled = useSlice<boolean>(\n () => chromeCommandState(editorRef.value, 'paragraph.dialog').isEnabled,\n Object.is\n );\n return {\n format,\n isEnabled: computed(() => enabled.value),\n apply: (update) => {\n const editor = editorRef.value;\n return editor !== null && editor.exec({ ...update, type: 'setParagraphFormat' }).ok;\n },\n };\n}\n\n/** What `useFontFormat` returns. @public */\nexport interface UseFontFormatReturn {\n /** The font of the selected text, or of every run of the selected shapes; null with none. */\n readonly format: UseEditorStateReturn<FontFormatRead | null>;\n /** Whether the engine can write font formatting now (text or a shape with text selected, editable). */\n readonly isEnabled: ComputedRef<boolean>;\n /** Write the given fields as ONE undo step. Returns whether the engine accepted them. */\n readonly apply: (update: FontFormatCommand) => boolean;\n}\n\n/**\n * The font of the selected text (or of every run of the selected shapes), and the command to\n * change it, as React's `useFontFormat`. @public\n */\nexport function useFontFormat(): UseFontFormatReturn {\n const editorRef = usePptxEditor();\n const format = useEditorState((s) => s.format?.font ?? null, sameFontFormat);\n // The engine's answer, not the dialog slot's: Vue has no dialog host, and hiding a dialog\n // never turns off the operation.\n const enabled = useSlice<boolean>(\n () => chromeCommandState(editorRef.value, 'text.dialog').isEnabled,\n Object.is\n );\n return {\n format,\n isEnabled: computed(() => enabled.value),\n apply: (update) => {\n const editor = editorRef.value;\n return editor !== null && editor.exec({ ...update, type: 'setFontFormat' }).ok;\n },\n };\n}\n\n/** What `useBulletFormat` returns. @public */\nexport interface UseBulletFormatReturn {\n /**\n * The bullet format of the selected paragraphs: null when they have no list, undefined when\n * they differ or nothing with text is selected.\n */\n readonly format: UseEditorStateReturn<BulletFormatRead | null | undefined>;\n /** Whether the engine can write a bullet format now (text or a shape with text selected, editable). */\n readonly isEnabled: ComputedRef<boolean>;\n /**\n * Write a bullet format (null turns the list off) as ONE undo step. An omitted field keeps\n * each paragraph's value; with no `kind`, the size and color change and each paragraph keeps\n * its own bullet or number. Returns whether the engine accepted it.\n */\n readonly apply: (format: BulletFormat | null) => boolean;\n}\n\n/** The bullet format of the selected paragraphs, and the command to change it, as React's `useBulletFormat`. @public */\nexport function useBulletFormat(): UseBulletFormatReturn {\n const editorRef = usePptxEditor();\n const format = useEditorState((s) => s.format?.bulletFormat, sameBulletFormat);\n const { isEnabled } = useEditorCommand('list.bulletStyle');\n return {\n format,\n isEnabled,\n apply: (next) => {\n const editor = editorRef.value;\n return editor !== null && editor.exec({ type: 'setBulletFormat', format: next }).ok;\n },\n };\n}\n\n/** What `useEditorValueCommand` returns, as React's `UseEditorValueCommandReturn`. @public */\nexport interface UseEditorValueCommandReturn<V, S = V> {\n /**\n * Run the slot's command with a value of its `ToolbarValueMap` type. The result says why the\n * engine refused it (`disabled.invalidValue`, `disabled.noEffectChange`). Pass\n * `{ historyGroup }` to make the values of one gesture (a slider drag) one undo step.\n */\n readonly execute: (value: V, options?: EditorExecOptions) => CommandResult;\n /** The value the slot shows (`ToolbarShownValue`), or null when it is mixed or unavailable. */\n readonly value: ComputedRef<S | null>;\n /**\n * The slot's fixed choices, from the registry (the Rotate, Align, line width, or Shape Effects\n * rows); none for a slot with a free value (`font.size`, `shape.fill`, `shape.styles`).\n */\n readonly options: ComputedRef<readonly V[]>;\n /** Whether the command can run now. */\n readonly isEnabled: ComputedRef<boolean>;\n /** Why the command cannot run: a catalog key, or the engine's own text. */\n readonly disabledReason: ComputedRef<string | null>;\n}\n\n/**\n * State and execution for one typed value slot, as React's `useEditorValueCommand`: `execute`\n * takes the slot's `ToolbarValueMap` type and returns the engine's result. @public\n */\nexport function useEditorValueCommand<K extends keyof ToolbarValueMap>(\n slot: MaybeRefOrGetter<K>\n): UseEditorValueCommandReturn<ToolbarValueMap[K], ToolbarShownValue<K>> {\n const editorRef = usePptxEditor();\n const cmd = useEditorCommand(slot);\n return {\n execute: (value: ToolbarValueMap[K], options?: EditorExecOptions): CommandResult =>\n runToolbarCommand(editorRef.value, toValue(slot), value as ToolbarSlotValue<K>, options),\n value: computed(() => valueSlotShown(toValue(slot), cmd.value.value)),\n options: computed(() => valueSlotOptions(toValue(slot))),\n isEnabled: cmd.isEnabled,\n disabledReason: cmd.disabledReason,\n };\n}\n","// The speaker notes field that has focus, per editor: the Vue twin of the React adapter's\n// `notes-target.ts`. While it has focus, the toolbar's bold, italic, underline, and\n// strikethrough format the notes text. The registry lives in core (`chrome-forms.ts`), so a\n// notes field in either adapter reaches the same toolbar rule.\n\nimport {\n getCurrentScope,\n onScopeDispose,\n shallowRef,\n toValue,\n watch,\n type MaybeRefOrGetter,\n type ShallowRef,\n} from 'vue';\nimport {\n NOTES_SLOTS,\n notesTargetOf,\n setNotesTarget,\n subscribeNotesTargets,\n type NotesTarget,\n type PptxEditorInstance,\n} from '@pptx-editor.dev/core/editor';\n\nexport { NOTES_SLOTS, setNotesTarget, type NotesTarget };\n\n/** What `useNotesTarget` returns: the focused notes field, or null. @internal */\nexport type UseNotesTargetReturn = Readonly<ShallowRef<NotesTarget | null>>;\n\n/** The focused notes field of `editor`, or null. @internal */\nexport function useNotesTarget(\n editor: MaybeRefOrGetter<PptxEditorInstance | null>\n): UseNotesTargetReturn {\n const target = shallowRef<NotesTarget | null>(notesTargetOf(toValue(editor)));\n const read = (): void => {\n target.value = notesTargetOf(toValue(editor));\n };\n if (!getCurrentScope()) return target;\n watch(() => toValue(editor), read);\n onScopeDispose(subscribeNotesTargets(read));\n return target;\n}\n","// The popups registry: the Vue twin of the React adapter's `popups.tsx`, after DOCX Editor's\n// Vue adapter (docx-editor/packages/vue/src/editor/popup-config.ts, dialog-host.ts).\n// `PptxEditorRoot` mounts the editor's dialogs; a host changes one through `popups`: a render\n// callback replaces the packaged dialog, and `false` turns off automatic rendering. Every\n// opener calls `useEditorDialog(key).open()`, focus returns to the opener on close, and a\n// dialog closes when the editor opens another document.\n\nimport { markReadingPopup } from '@pptx-editor.dev/core/editor';\nimport {\n computed,\n defineComponent,\n h,\n inject,\n provide,\n shallowRef,\n watch,\n type AllowedComponentProps,\n type Component,\n type ComponentCustomProps,\n type ComputedRef,\n type FunctionalComponent,\n type InjectionKey,\n type PropType,\n type Ref,\n type ShallowRef,\n type VNodeChild,\n type VNodeProps,\n} from 'vue';\nimport {\n SLOT_POPUP_KEYS,\n chromeControlForSlot,\n dispatchFindRequest,\n pickImageInto,\n requestLinkPopup,\n warnDialogNeedsRenderer,\n type ChromeActionHost,\n type PptxEditorInstance,\n} from '@pptx-editor.dev/core/editor';\nimport { chromeActionHostKey } from './composables.ts';\nimport { PageSetupDialog, type PageSetupDialogProps } from './PageSetupDialog.ts';\nimport { ImageAltTextDialog, type ImageAltTextDialogProps } from './ImageAltTextDialog.ts';\nimport { ImagePropertiesDialog, type ImagePropertiesDialogProps } from './ImagePropertiesDialog.ts';\nimport { BackgroundDialog, type BackgroundDialogProps } from './BackgroundDialog.tsx';\nimport { ParagraphDialog, type ParagraphDialogProps } from './ParagraphDialog.tsx';\nimport { FontDialog, type FontDialogProps } from './FontDialog.tsx';\nimport {\n BulletsAndNumberingDialog,\n type BulletsAndNumberingDialogProps,\n} from './BulletsAndNumberingDialog.tsx';\nimport { ColumnsDialog, type ColumnsDialogProps } from './ColumnsDialog.tsx';\nimport type { PptxEditorContextMenuProps } from './context-menu-parts.tsx';\nimport type { RailContextMenuProps, SectionContextMenuProps } from './RailContextMenu.tsx';\nimport type { HyperlinkPopupProps } from './HyperlinkPopup.tsx';\nimport type { FindPopupProps } from './FindBar.tsx';\nimport type { UseSlideshowReturn } from './Slideshow.tsx';\n\n/** A render callback for an automatic popup. `false` disables automatic rendering. @public */\nexport type PptxEditorPopup<Props extends object> = false | ((props: Props) => VNodeChild);\n\n/**\n * Register an ordinary component in the `popups` map while keeping its props and state, as\n * React's `definePopup` and DOCX Editor's Vue `definePopup`: the component's required and\n * narrowed props stay checked against the entry; Vue's own attributes do not constrain it.\n * @public\n */\nexport function definePopup<C extends Component | FunctionalComponent<never>>(\n component: C,\n options?: DefinePopupOptions\n): (\n props: C extends new (...args: never[]) => { $props: infer P }\n ? Omit<\n P,\n {\n [K in keyof P]-?: K extends keyof (VNodeProps &\n AllowedComponentProps &\n ComponentCustomProps)\n ? {} extends Pick<P, K>\n ? (VNodeProps & AllowedComponentProps & ComponentCustomProps)[K] extends P[K]\n ? K\n : never\n : never\n : never;\n }[keyof P]\n >\n : C extends (props: infer P, ...args: never[]) => unknown\n ? P\n : never\n) => VNodeChild {\n const render = (props: object): VNodeChild =>\n h(component as Component, props as Record<string, unknown>);\n return options?.reading ? markReadingPopup(render) : render;\n}\n\n/** Options of `definePopup`, the twin of React's `DefinePopupOptions`. @public */\nexport interface DefinePopupOptions {\n /**\n * For `popups.hyperlink`: the renderer shows reading mode too, so a click into linked text\n * opens it with `mode: 'reading'`. Without it a renderer opens for the URL field alone.\n */\n readonly reading?: boolean;\n}\n\n/** The props a registry dialog receives: it shows, and how to close it. @public */\nexport interface PptxEditorDialogSessionProps {\n /** Always true while the registry renders the dialog. */\n readonly open: boolean;\n /** Close the dialog: the registry stops rendering it and focus returns to the opener. */\n readonly onClose: () => void;\n}\n\n/**\n * Render overrides for the dialogs the editor mounts. A render callback replaces the packaged\n * dialog; `false` disables one. @public\n */\nexport interface PptxEditorPopups {\n /** File > Page setup: slide size, appearance, and fonts. */\n pageSetup?: PptxEditorPopup<PageSetupDialogProps>;\n /**\n * The link popup (Ctrl/Cmd+K, the link control, Insert > Link). `PptxEditorRoot` hosts it, so\n * it opens with no toolbar on the page. `false` turns links off in the chrome; `setLink` keeps\n * working from the API.\n */\n hyperlink?: PptxEditorPopup<HyperlinkPopupProps>;\n /**\n * The find and replace bar (Ctrl/Cmd+F, Ctrl/Cmd+H), rendered where `PptxEditorFindBar`\n * stands. `false` turns it off; `editor.find` keeps working from the API.\n */\n find?: PptxEditorPopup<FindPopupProps>;\n /**\n * The slide canvas's context menu. A callback usually renders `PptxEditorContextMenu` with\n * host rows; `false` shows no menu. A `PptxEditorContextMenu` placed in the root or the\n * viewport gives the same entry, and this entry wins over it.\n */\n contextMenu?: PptxEditorPopup<PptxEditorContextMenuProps>;\n /**\n * The context menu of a slide in the slide rail and of a tile in the slide sorter. A callback\n * renders the host's menu, or `RailContextMenu` with its own options; `false` shows no menu.\n */\n railContextMenu?: PptxEditorPopup<RailContextMenuProps>;\n /**\n * The menu of a section header in the slide rail and in the slide sorter. A callback renders\n * the host's menu, or `SectionContextMenu` with its own options; `false` shows no menu.\n */\n sectionContextMenu?: PptxEditorPopup<SectionContextMenuProps>;\n /** Format background: slide background fill. */\n background?: PptxEditorPopup<BackgroundDialogProps>;\n /** The Alt Text dialog of the selected element, as DOCX Editor's `imageAltText`. */\n imageAltText?: PptxEditorPopup<ImageAltTextDialogProps>;\n /** The Format Picture dialog of the selected picture, as DOCX Editor's `imageProperties`. */\n imageProperties?: PptxEditorPopup<ImagePropertiesDialogProps>;\n /** Format > Paragraph: alignment, indents, spacing before and after, and line spacing. */\n paragraph?: PptxEditorPopup<ParagraphDialogProps>;\n /** Format > Font: font, effects, offset, character spacing, and kerning. */\n font?: PptxEditorPopup<FontDialogProps>;\n /** Format > Bullets and Numbering: bullet or number style, size, color, and start number. */\n bulletsAndNumbering?: PptxEditorPopup<BulletsAndNumberingDialogProps>;\n /** Home > Columns > More Columns: the number of text columns and the spacing between them. */\n columns?: PptxEditorPopup<ColumnsDialogProps>;\n}\n\n/** The `popups` entries that are menus, not dialogs: their parts read them (`usePopupEntry`). */\ntype MenuPopupKey = 'contextMenu' | 'railContextMenu' | 'sectionContextMenu';\n\n/** The `popups` entries of the overlays: their parts read them (`usePopupEntry`). */\ntype OverlayPopupKey = 'hyperlink' | 'find';\n\n/** The dialogs the registry mounts. @public */\nexport type PptxEditorDialogKey = Exclude<keyof PptxEditorPopups, MenuPopupKey | OverlayPopupKey>;\n\n/** What `useEditorDialog` returns, the twin of React's `UseEditorDialogReturn`. @public */\nexport interface UseEditorDialogReturn {\n /** Show the dialog. Focus returns to `returnFocusTo`, or the element with focus now. */\n open(returnFocusTo?: HTMLElement | null): void;\n /** Hide the dialog. */\n close(): void;\n /** Whether the dialog shows now. */\n readonly isOpen: ComputedRef<boolean>;\n /** False when the dialog cannot show: hide or disable the control that opens it. */\n readonly isAvailable: ComputedRef<boolean>;\n}\n\n/** The canvas menu entry that a `PptxEditorContextMenu` placed in the root gives. */\ntype CanvasMenuEntry = PptxEditorPopup<PptxEditorContextMenuProps>;\n\n/**\n * The `PptxEditorContextMenu` placed in the root or the viewport: it gives the canvas its menu\n * entry, as a `popups.contextMenu` entry does. The last one placed counts. React's twin is\n * `CanvasMenuRegistry`. @internal\n */\nexport interface CanvasMenuRegistry {\n get(): CanvasMenuEntry | undefined;\n place(token: object, entry: () => CanvasMenuEntry): void;\n remove(token: object): void;\n}\n\nfunction createCanvasMenuRegistry(): CanvasMenuRegistry {\n const current = shallowRef<{ readonly token: object; readonly entry: () => CanvasMenuEntry }>();\n return {\n get: () => current.value?.entry(),\n place(token, entry) {\n current.value = { token, entry };\n },\n remove(token) {\n if (current.value?.token === token) current.value = undefined;\n },\n };\n}\n\ninterface DialogHost {\n readonly active: ShallowRef<PptxEditorDialogKey | null>;\n readonly popups: () => PptxEditorPopups | undefined;\n readonly canvasMenus: CanvasMenuRegistry;\n open(key: PptxEditorDialogKey, returnFocusTo?: HTMLElement | null): void;\n close(): void;\n}\n\nconst dialogHostKey: InjectionKey<DialogHost> = Symbol('pptxDialogHost');\n\n/** The packaged dialog of each registry key, which `ActiveDialog` renders without a host renderer. */\nconst PACKAGED: Readonly<Partial<Record<PptxEditorDialogKey, Component>>> = {\n pageSetup: PageSetupDialog,\n background: BackgroundDialog,\n imageAltText: ImageAltTextDialog,\n imageProperties: ImagePropertiesDialog,\n paragraph: ParagraphDialog,\n font: FontDialog,\n bulletsAndNumbering: BulletsAndNumberingDialog,\n columns: ColumnsDialog,\n};\n\n/** Whether the registry can show `key`: no `false` entry, and a renderer to show it. */\nfunction available(popups: PptxEditorPopups | undefined, key: PptxEditorDialogKey): boolean {\n const entry = popups?.[key];\n if (entry === false) return false;\n // Every registry dialog is packaged in Vue, as in React; a host renderer replaces it.\n return key in PACKAGED || typeof entry === 'function';\n}\n\n/**\n * The overlays of one root: its slide show, and how many find bars it has mounted. The root\n * passes them, so the action host starts the show, opens find, and opens the link popup.\n * @internal\n */\nexport interface OverlayHost {\n readonly slideshow: UseSlideshowReturn;\n readonly findBars: Readonly<Ref<number>>;\n /** How many host panels show the link popup state (`useHyperlinkPopup`). */\n readonly linkViews?: Readonly<Ref<number>>;\n}\n\n/** Why an overlay slot (find, the link popup) cannot run now, as React's root says, or null. */\nfunction overlayReason(\n popups: PptxEditorPopups | undefined,\n editor: PptxEditorInstance | null,\n overlays: OverlayHost,\n slot: Parameters<NonNullable<ChromeActionHost['unavailable']>>[0]\n): string | null {\n const key = SLOT_POPUP_KEYS[slot];\n // With `hyperlink: false`, a host panel that reads `useHyperlinkPopup()` still opens.\n if (key === 'hyperlink')\n return popups?.hyperlink === false && !overlays.linkViews?.value ? 'link.unavailable' : null;\n if (key !== 'find') return null;\n if (popups?.find === false) return 'find.unavailable';\n // Find shows its matches on the slide canvas, which the slide sorter does not show.\n if (editor?.snapshot().presentationView === 'slideSorter') return 'disabled.findSorter';\n // Find needs a find bar to open: nothing answers the request without one.\n return overlays.findBars.value === 0 ? 'find.noBar' : null;\n}\n\n/**\n * The root's `ChromeActionHost`: it opens the dialogs the root renders, starts the slide show,\n * opens the find bar and the link popup, picks pictures, and says why a slot cannot run (a\n * `false` popups entry, a dialog with no renderer, no find bar). Core's `runChromeRow` and\n * `chromeRowState` use it.\n */\nfunction actionHost(\n dialogs: DialogHost,\n editorRef: Readonly<Ref<PptxEditorInstance | null>>,\n overlays: OverlayHost\n): ChromeActionHost {\n return {\n openDialog: (key) => dialogs.open(key as PptxEditorDialogKey),\n startSlideshow: (from) => overlays.slideshow.start(from),\n openFind: (replace) => {\n dispatchFindRequest(editorRef.value, replace);\n },\n openLink: () => {\n requestLinkPopup(editorRef.value);\n },\n pickImage: (target) => {\n if (editorRef.value && typeof document !== 'undefined')\n pickImageInto(editorRef.value, document, target);\n },\n unavailable: (slot, dialog) => {\n const state = chromeControlForSlot(slot)?.state;\n const reason = overlayReason(dialogs.popups(), editorRef.value, overlays, slot);\n if (reason) return reason;\n const key = (dialog ?? (state?.kind === 'dialog' ? state.dialog : undefined)) as\n PptxEditorDialogKey | undefined;\n if (key === undefined || available(dialogs.popups(), key)) return null;\n return 'dialog.unavailable';\n },\n };\n}\n\n/** The element that should take focus back, or null when it is gone or is the page itself. */\nfunction focusTarget(el: Element | null | undefined): HTMLElement | null {\n if (!el || el.nodeType !== 1 || el === el.ownerDocument.body) return null;\n return el as HTMLElement;\n}\n\n/**\n * Provide the registry for one root and return the host. The root passes its editor: an\n * `inject` in the providing component would read the parent's value, not its own. @internal\n */\nexport function provideDialogHost(\n editorRef: Readonly<Ref<PptxEditorInstance | null>>,\n popups: () => PptxEditorPopups | undefined,\n overlays: OverlayHost\n): DialogHost {\n const active = shallowRef<PptxEditorDialogKey | null>(null);\n let opener: HTMLElement | null = null;\n const host: DialogHost = {\n active,\n popups,\n canvasMenus: createCanvasMenuRegistry(),\n open(key, returnFocusTo) {\n if (!available(popups(), key)) {\n // A `false` entry turns the dialog off on purpose; no renderer is a host mistake.\n if (popups()?.[key] !== false) warnDialogNeedsRenderer('Vue', key);\n return;\n }\n opener =\n returnFocusTo === undefined\n ? focusTarget(typeof document === 'undefined' ? null : document.activeElement)\n : returnFocusTo;\n active.value = key;\n },\n close() {\n active.value = null;\n },\n };\n // Focus returns to the opener after the dialog closes. `post`: after the dialog unmounts and\n // leaves its modal state, so the page is no longer inert and the opener can take focus.\n watch(\n active,\n (key) => {\n if (key !== null) return;\n const target = opener;\n opener = null;\n if (target?.isConnected) target.focus({ preventScroll: true });\n },\n { flush: 'post' }\n );\n // A dialog belongs to the document it opened on: close it when another document opens.\n watch(\n editorRef,\n (editor, _old, onCleanup) => {\n if (!editor) return;\n let session = editor.session;\n const off = editor.subscribe(() => {\n if (editor.session === session) return;\n session = editor.session;\n active.value = null;\n });\n onCleanup(off);\n },\n { immediate: true }\n );\n // A popup entry that becomes `false` closes its open dialog.\n watch(popups, (next) => {\n if (active.value !== null && !available(next, active.value)) active.value = null;\n });\n provide(dialogHostKey, host);\n provide(chromeActionHostKey, actionHost(host, editorRef, overlays));\n return host;\n}\n\n/** Renders the dialog that is open. Placed by `PptxEditorRoot`. @internal */\nexport const ActiveDialog = defineComponent({\n name: 'PptxActiveDialog',\n props: {\n host: { type: Object as PropType<DialogHost>, required: true },\n },\n setup(props) {\n return () => {\n const key = props.host.active.value;\n if (key === null) return null;\n const session = { open: true, onClose: () => props.host.close() };\n const entry = props.host.popups()?.[key];\n if (entry === false) return null;\n if (typeof entry === 'function') return (entry as (p: typeof session) => VNodeChild)(session);\n const packaged = PACKAGED[key];\n return packaged ? h(packaged, session) : null;\n };\n },\n});\n\n/**\n * Open, close, and read one of the editor's dialogs, as React's `useEditorDialog`. Outside\n * `PptxEditorRoot` it reports the dialog as unavailable. @public\n */\nexport function useEditorDialog(key: PptxEditorDialogKey): UseEditorDialogReturn {\n const host = inject(dialogHostKey, null);\n return {\n open: (returnFocusTo?: HTMLElement | null) => host?.open(key, returnFocusTo),\n close: () => host?.close(),\n isOpen: computed(() => host?.active.value === key),\n isAvailable: computed(() => host !== null && available(host.popups(), key)),\n };\n}\n\n/**\n * The registry entry for `key` in the enclosing `PptxEditorRoot`, read at call time: a renderer,\n * `false`, or undefined for the packaged part. The parts that own a menu popup (the canvas, the\n * rail, a section header) read it, as React's `usePopupEntry`. @internal\n */\nexport function usePopupEntry<K extends keyof PptxEditorPopups>(\n key: K\n): () => PptxEditorPopups[K] | undefined {\n const host = inject(dialogHostKey, null);\n return () => host?.popups()?.[key];\n}\n\n/**\n * The canvas menu entry of the enclosing `PptxEditorRoot`, read at call time: its\n * `popups.contextMenu` entry, else the entry of a `PptxEditorContextMenu` placed in the root,\n * else undefined for the packaged menu. An explicit `popups.contextMenu` entry wins, as in\n * React's `useCanvasMenuEntry`. @internal\n */\nexport function useCanvasMenuEntry(): () => CanvasMenuEntry | undefined {\n const host = inject(dialogHostKey, null);\n return () => {\n const explicit = host?.popups()?.contextMenu;\n return explicit !== undefined ? explicit : host?.canvasMenus.get();\n };\n}\n\n/** Where a `PptxEditorContextMenu` placed in the root registers, or null outside a root. @internal */\nexport function useCanvasMenuRegistry(): CanvasMenuRegistry | null {\n return inject(dialogHostKey, null)?.canvasMenus ?? null;\n}\n","// The Page setup dialog: the Vue twin of the React adapter's `PageSetupDialog`, on the same\n// dialog parts and the same core helpers, so both show the same fields and apply the same\n// draft. The host owns visibility (`open`, `onClose`).\n\nimport {\n Fragment,\n computed,\n defineComponent,\n h,\n type CSSProperties,\n type ExtractPublicPropTypes,\n type PropType,\n type VNodeArrayChildren,\n} from 'vue';\nimport {\n pageSetupSizeName,\n radioGroupStep,\n slideSizeInches,\n translateDialogErrors,\n} from '@pptx-editor.dev/core/editor';\nimport { ToolButton } from './chrome.tsx';\nimport { useEditorState, useTranslation } from './composables.ts';\nimport {\n DialogFrame,\n applyOnEnter,\n createDialogParts,\n useCloseOnNewDocument,\n useDialogDraft,\n type UseDialogReturn,\n} from './dialog-parts.ts';\n\n/** The draft of the Page setup dialog. @public */\nexport interface PageSetupDialogFields {\n /** The chrome theme the appearance choice shows. */\n readonly theme: 'light' | 'dark';\n}\n\n/** The Page setup draft and its actions. @public */\nexport type UsePageSetupDialogReturn = UseDialogReturn<PageSetupDialogFields>;\n\n/** The field names of the Page setup dialog, for `PageSetupDialogField`. @public */\nexport type PageSetupDialogFieldName = 'slideSize' | 'theme' | 'fonts' | 'substitutes';\n\nconst parts = createDialogParts<UsePageSetupDialogReturn, PageSetupDialogFieldName>(\n 'PageSetupDialog'\n);\nconst THEMES = ['light', 'dark'] as const;\n\nconst pageSetupDialogProps = {\n /** Whether the dialog is shown. The host owns this state. */\n open: { type: Boolean, required: true as const },\n /** Called on Cancel, Escape, a click on the backdrop, and after OK. */\n onClose: { type: Function as PropType<() => void>, required: true as const },\n /** The chrome theme; the appearance choice shows only with `onThemeChange`. */\n theme: { type: String as PropType<'light' | 'dark'>, default: 'light' },\n /** Called by OK when the appearance choice changed. */\n onThemeChange: {\n type: Function as PropType<(theme: 'light' | 'dark') => void>,\n default: undefined,\n },\n /** `false`: only the default slot, with no default arrangement. */\n preset: { type: Boolean, default: true },\n /** A class name added to the dialog surface, as React's `className` (`class` works too). */\n className: { type: String, default: undefined },\n /** Styles added to the dialog surface. */\n style: { type: Object as PropType<CSSProperties>, default: undefined },\n} as const;\n\n/** Props of `PageSetupDialog`, the twin of React's `PageSetupDialogProps`. @public */\nexport type PageSetupDialogProps = ExtractPublicPropTypes<typeof pageSetupDialogProps>;\n\nconst PageSetupDialogOpen = defineComponent({\n name: 'PageSetupDialogOpen',\n inheritAttrs: false,\n props: pageSetupDialogProps,\n setup(props, { attrs, slots }) {\n const { t } = useTranslation();\n const width = useEditorState((s) => s.slideWidth);\n const height = useEditorState((s) => s.slideHeight);\n const embedded = useEditorState((s) => s.embeddedFontFaces);\n const substituted = useEditorState((s) => s.substitutedFonts);\n const opening = props.theme;\n const draft = useDialogDraft<PageSetupDialogFields>({\n initial: { theme: opening },\n // As the React twin: a change from the opening choice, reported to the latest callback.\n commit: (values) => {\n if (values.theme !== opening) props.onThemeChange?.(values.theme);\n return { ok: true };\n },\n });\n useCloseOnNewDocument(() => props.onClose());\n const state: UsePageSetupDialogReturn = {\n values: draft.values,\n errors: computed(() => translateDialogErrors(t, draft.errors.value)),\n isEnabled: computed(() => true),\n setValue: draft.setValue,\n apply: () => {\n if (draft.apply()) props.onClose();\n },\n cancel: () => props.onClose(),\n };\n const render = parts.provideParts(state);\n const section = (field: PageSetupDialogFieldName, label: string, body: VNodeArrayChildren) =>\n h(\n 'section',\n { 'data-pptx-part': 'field', 'data-pptx-field': field, class: 'pptx-dialog__section' },\n [h('h3', { class: 'pptx-dialog__label' }, label), ...body]\n );\n return () => {\n const size = slideSizeInches(width.value, height.value);\n const defaults = h(Fragment, [\n h('div', { 'data-pptx-part': 'header', class: 'pptx-dialog__header' }, [\n h('h2', { 'data-pptx-part': 'title', class: 'pptx-dialog__title' }, t('pageSetup.title')),\n h(ToolButton, { label: t('pageSetup.close'), icon: 'close', onClick: props.onClose }),\n ]),\n h('div', { 'data-pptx-part': 'body', class: 'pptx-dialog__body' }, [\n section('slideSize', t('pageSetup.slideSize'), [\n h('p', { class: 'pptx-dialog__value' }, [\n t(`pageSetup.slideSizeName.${pageSetupSizeName(width.value, height.value)}`),\n h('span', { class: 'pptx-dialog__muted' }, t('pageSetup.slideSizeValue', size)),\n ]),\n ]),\n props.onThemeChange\n ? section('theme', t('pageSetup.appearance'), [\n h(\n 'div',\n {\n class: 'pptx-segmented',\n role: 'radiogroup',\n 'aria-label': t('pageSetup.appearance'),\n onKeydown: (event: KeyboardEvent) => {\n const next = radioGroupStep(THEMES, draft.values.value.theme, event.key);\n if (!next) return;\n event.preventDefault();\n draft.setValue('theme', next);\n (event.currentTarget as HTMLElement)\n .querySelector<HTMLElement>(`[data-value=\"${next}\"]`)\n ?.focus();\n },\n },\n THEMES.map((m) =>\n h(\n 'button',\n {\n key: m,\n type: 'button',\n role: 'radio',\n 'data-value': m,\n 'aria-checked': draft.values.value.theme === m,\n tabindex: draft.values.value.theme === m ? 0 : -1,\n onClick: () => draft.setValue('theme', m),\n },\n t(`pageSetup.${m}`)\n )\n )\n ),\n ])\n : null,\n section('fonts', t('pageSetup.fonts'), [\n h(\n 'p',\n { class: 'pptx-dialog__value' },\n embedded.value\n ? t('pageSetup.fontsEmbedded', { count: embedded.value })\n : t('pageSetup.fontsNone')\n ),\n // No substitutes: one line here, and no empty Substituted fonts section.\n substituted.value.length === 0\n ? h('p', { class: 'pptx-dialog__value' }, t('pageSetup.substitutesNone'))\n : null,\n ]),\n substituted.value.length === 0\n ? null\n : section('substitutes', t('pageSetup.substitutes'), [\n h(\n 'ul',\n { class: 'pptx-dialog__list' },\n substituted.value.map((f) =>\n h('li', { key: f.family }, [\n t('pageSetup.substitution', { family: f.family, substitute: f.substitute }),\n f.metricCompatible\n ? h(\n 'span',\n { class: 'pptx-chip pptx-chip--quiet' },\n t('pageSetup.metricCompatible')\n )\n : null,\n ])\n )\n ),\n ]),\n ]),\n h('div', { 'data-pptx-part': 'footer', class: 'pptx-dialog__footer' }, [\n h(\n 'span',\n { 'data-pptx-part': 'error', role: 'alert', class: 'pptx-dialog__error' },\n state.errors.value.form ?? ''\n ),\n h(\n 'button',\n {\n type: 'button',\n 'data-pptx-part': 'cancel',\n class: 'pptx-button',\n onClick: state.cancel,\n },\n t('dialog.cancel')\n ),\n h(\n 'button',\n {\n type: 'button',\n 'data-pptx-part': 'apply',\n class: 'pptx-button pptx-button--primary',\n onClick: state.apply,\n },\n t('dialog.ok')\n ),\n ]),\n ]);\n return h(\n DialogFrame,\n {\n ...attrs,\n class: [attrs.class, props.className],\n style: [attrs.style, props.style],\n kind: 'pageSetup',\n label: t('pageSetup.title'),\n onClose: props.onClose,\n onKeydown: (event: KeyboardEvent) => applyOnEnter(event, true, state.apply),\n },\n () => render(defaults, slots.default?.(), props.preset)\n );\n };\n },\n});\n\n/**\n * Page setup: slide size, appearance, and fonts, with replaceable parts (`Header`, `Title`,\n * `Body`, `Footer`, `Field`, `Error`, `Apply`, `Cancel`), as React's `PageSetupDialog`.\n * Renders nothing while `open` is false. @public\n */\nexport const PageSetupDialog = Object.assign(\n defineComponent({\n name: 'PageSetupDialog',\n inheritAttrs: false,\n props: pageSetupDialogProps,\n setup(props, { attrs, slots }) {\n return () => (props.open ? h(PageSetupDialogOpen, { ...attrs, ...props }, slots) : null);\n },\n }),\n {\n Header: parts.Header,\n Title: parts.Title,\n Body: parts.Body,\n Footer: parts.Footer,\n Field: parts.Field,\n Error: parts.Error,\n Apply: parts.Apply,\n Cancel: parts.Cancel,\n }\n);\n\n/**\n * Read the draft of the enclosing Page setup dialog, for a host's own field inside it. It does\n * not open the dialog: `useEditorDialog('pageSetup').open()` does. @public\n */\nexport function usePageSetupDialog(): UsePageSetupDialogReturn {\n return parts.useState();\n}\n","/** @jsxImportSource vue */\n// Chrome building blocks: icons, buttons, and popover menus shared by the toolbar, rail, notes,\n// panel, and zoom pill. The Vue twin of the React adapter's `chrome.tsx`: the same markup,\n// classes, ARIA, and keys, with the behavior in core (`chrome-popover.ts`), so the two cannot\n// drift. Every mousedown on chrome is prevented (except form fields) so it never steals the\n// slide selection or the text caret.\n\nimport {\n Teleport,\n computed,\n defineComponent,\n normalizeClass,\n onMounted,\n onUnmounted,\n ref,\n shallowRef,\n toValue,\n useId,\n watch,\n type ComputedRef,\n type MaybeRefOrGetter,\n type PropType,\n type VNode,\n type ExtractPublicPropTypes,\n} from 'vue';\nimport {\n ICON_PATHS,\n chromeKeepsFocus,\n tooltipAttributes,\n focusMenuRowAtPointer,\n focusPopoverOnOpen,\n focusTextAfterChrome,\n listenPopoverDismiss,\n popoverKeyDown,\n popoverScope,\n positionPopover,\n restorePopoverFocus,\n warnUnknownIcon,\n warnUnsupportedOverride,\n type PopoverAnchorRect,\n type PopoverPlacement,\n} from '@pptx-editor.dev/core/editor';\nimport { buttonRoleProps, renderAsChild, slotPartNames, useSlotOverride } from './slot-override.ts';\n\n/**\n * Prevent chrome mousedown from moving focus (inputs keep their behavior). Chrome building\n * block, not a stable API. @internal\n */\nexport function keepFocus(e: MouseEvent): void {\n if (chromeKeepsFocus(e.target)) e.preventDefault();\n}\n\n/**\n * Give the caret back to the slide text after a toolbar field or picker is done, as React's\n * `focusText`. Chrome building block. @internal\n */\nexport function focusText(editor: { focus(): void } | null, from?: Element | null): void {\n focusTextAfterChrome(editor, from);\n}\n\nconst iconProps = {\n /** A Material Symbol name from `ICON_PATHS`. */\n name: { type: String, default: undefined },\n /** SVG path data, in place of `name`. */\n paths: { type: Array as PropType<readonly string[] | null>, default: undefined },\n className: { type: String, default: 'pptx-icon' },\n} as const;\n\n/** The props of `Icon`, the twin of React's `IconProps`. @public */\nexport type IconProps = ExtractPublicPropTypes<typeof iconProps>;\n\n/** An inline Material Symbol. @public */\nexport const Icon = defineComponent({\n name: 'Icon',\n props: iconProps,\n setup(props) {\n return () => {\n const known = props.name ? ICON_PATHS[props.name] : undefined;\n if (props.name && !props.paths && !known) warnUnknownIcon(props.name);\n const d = props.paths ?? known ?? [];\n return (\n <svg class={props.className} viewBox=\"0 -960 960 960\" aria-hidden=\"true\">\n {d.map((p, i) => (\n <path key={i} d={p} />\n ))}\n </svg>\n );\n };\n },\n});\n\n/** What `useAriaDisabled` returns. @internal */\nexport interface UseAriaDisabledReturn {\n /** The attributes for the trigger element. */\n readonly attrs: ComputedRef<{\n 'aria-disabled'?: true;\n 'aria-describedby'?: string;\n onClickCapture?: (e: Event) => void;\n }>;\n /** The spoken reason, to render beside the element. */\n readonly note: () => VNode | null;\n}\n\n/**\n * `aria-disabled` and the spoken reason for a raw toolbar trigger (a picker, a field), the same\n * rule as `ToolButton`: it stays a Tab and arrow stop, ignores clicks,\n * and names its reason through `aria-describedby`. Render `note()` beside the element.\n * @internal\n */\nexport function useAriaDisabled(\n disabled: MaybeRefOrGetter<boolean>,\n reason: MaybeRefOrGetter<string | null | undefined>\n): UseAriaDisabledReturn {\n const id = useId();\n const said = computed(() => (toValue(disabled) && toValue(reason) ? toValue(reason)! : null));\n return {\n attrs: computed(() =>\n toValue(disabled)\n ? {\n 'aria-disabled': true as const,\n ...(said.value ? { 'aria-describedby': id } : {}),\n onClickCapture: (e: Event) => (e.preventDefault(), e.stopPropagation()),\n }\n : {}\n ),\n note: () =>\n said.value ? (\n <span id={id} class=\"pptx-sr-only\" hidden>\n {said.value}\n </span>\n ) : null,\n };\n}\n\nconst toolButtonProps = {\n label: { type: String, required: true as const },\n paths: { type: Array as PropType<readonly string[] | null>, default: undefined },\n icon: { type: String, default: undefined },\n onClick: { type: Function as PropType<() => void>, default: undefined },\n disabled: { type: Boolean, default: false },\n disabledReason: { type: String as PropType<string | null>, default: undefined },\n pressed: { type: Boolean, default: undefined },\n /** For a button that shows or hides a region: whether it is shown (`aria-expanded`). */\n expanded: { type: Boolean, default: undefined },\n /** The id of the region the button shows or hides (`aria-controls`). */\n controls: { type: String, default: undefined },\n className: { type: String, default: undefined },\n /** The chrome slot this button drives, as `data-slot` for hosts and tests. */\n slot: { type: String, default: undefined },\n /** The popup this button opens (`aria-haspopup`); `expanded` says whether it is open. */\n hasPopup: { type: String as PropType<'menu' | 'grid' | 'dialog'>, default: undefined },\n /** False for the main half of a color split: a host element cannot stand in for it. */\n asChild: { type: Boolean, default: undefined },\n /** A host element that renders the button, from a part's own `asChild` (no slot override). */\n host: { type: Object as PropType<VNode | null>, default: null },\n} as const;\n\n/** The props of `ToolButton`, the twin of React's `ToolButtonProps`. @internal */\nexport type ToolButtonProps = ExtractPublicPropTypes<typeof toolButtonProps>;\n\n/**\n * A toolbar icon button with tooltip and disabled reason. The default slot adds content after\n * the icon. Not a stable API. @internal\n */\nexport const ToolButton = defineComponent({\n name: 'ToolButton',\n // Two root nodes (the button and its reason text): a host `class` and other attributes go on\n // the button, with `className`, as React's.\n inheritAttrs: false,\n props: toolButtonProps,\n setup(props, { slots, attrs }) {\n // `ToolbarSlot` overrides for this slot: a host icon, a class name, or a host element.\n const override = useSlotOverride(props.slot);\n const reasonId = useId();\n if (override?.asChild && props.asChild === false)\n warnUnsupportedOverride(props.slot ?? '', 'asChild', slotPartNames(override));\n return () => {\n // A disabled control stays focusable (`aria-disabled`), so a keyboard user reaches it in\n // the toolbar and hears its reason through `aria-describedby`. The reason text is\n // `hidden`: a description still reads it, and the tree shows it once, on the button.\n const reason = props.disabled && props.disabledReason ? props.disabledReason : null;\n const onClick = props.disabled ? undefined : props.onClick;\n const icon =\n override?.icon !== undefined ? (\n override.icon\n ) : props.paths || props.icon ? (\n <Icon paths={props.paths} name={props.icon} />\n ) : null;\n const { class: hostClass, ...hostAttrs } = attrs;\n const attributes = {\n ...hostAttrs,\n class: normalizeClass([\n 'pptx-toolbar__button',\n hostClass,\n props.className,\n override?.className,\n ]),\n 'aria-label': props.label,\n ...tooltipAttributes(props.label, props.disabled, props.disabledReason),\n 'data-slot': props.slot,\n // State as data attributes, the first step of the customization ladder.\n 'data-active': props.pressed ? '' : undefined,\n 'data-disabled': props.disabled ? '' : undefined,\n 'aria-pressed': props.pressed === undefined ? undefined : props.pressed,\n 'aria-haspopup': props.hasPopup,\n 'aria-expanded': props.hasPopup ? !!props.expanded : props.expanded,\n 'aria-controls': props.controls,\n 'aria-disabled': props.disabled ? true : undefined,\n 'aria-describedby': reason ? reasonId : undefined,\n onMousedown: keepFocus,\n };\n const described = reason ? (\n <span id={reasonId} class=\"pptx-sr-only\" hidden>\n {reason}\n </span>\n ) : null;\n const hostElement =\n props.host ?? (override?.asChild && props.asChild !== false ? override.asChild : null);\n if (hostElement) {\n // The host element renders the control, as React's `renderAsChild`: a host element that\n // is not a button gets `role=\"button\"`, a tab stop, and Enter and Space.\n const isButton = hostElement.type === 'button';\n return [\n renderAsChild(hostElement, {\n ...attributes,\n ...(isButton ? { type: 'button' } : buttonRoleProps(onClick)),\n onClick,\n }),\n described,\n ];\n }\n return [\n <button type=\"button\" {...attributes} onClick={onClick}>\n {icon}\n {slots.default?.()}\n </button>,\n described,\n ];\n };\n },\n});\n\nconst popoverProps = {\n // No runtime type check: an element from another window (an iframe) is not `Object`.\n anchor: { type: null as unknown as PropType<HTMLElement | null>, default: null },\n onClose: { type: Function as PropType<() => void>, required: true as const },\n align: { type: String as PropType<'start' | 'end'>, default: 'start' },\n /** The accessible name; defaults to the trigger's `aria-label`. */\n label: { type: String, default: undefined },\n role: { type: String as PropType<'menu' | 'dialog'>, default: 'menu' },\n /** The element id, for the trigger's `aria-controls`. */\n id: { type: String, default: undefined },\n /**\n * A dialog panel opened from the keyboard takes focus at its first control (a menu always\n * does), and Tab past its first or last control closes it and returns to the trigger.\n */\n focusFirst: { type: Boolean, default: false },\n /** A dialog with a field to type in: its field takes focus when it opens. */\n field: { type: Boolean, default: false },\n /** A panel that takes no focus when it opens: the keys stay in the slide text. */\n passive: { type: Boolean, default: false },\n /** A class name added to the panel. */\n className: { type: String, default: undefined },\n /**\n * A box in client pixels to open at instead of the anchor's own box (the link popup at the\n * selected text). Focus and dismissal still use `anchor`.\n */\n anchorRect: { type: Object as PropType<PopoverAnchorRect | null>, default: null },\n} as const;\n\n/** The props of `Popover`, the twin of React's `PopoverProps`. @internal */\nexport type PopoverProps = ExtractPublicPropTypes<typeof popoverProps>;\n\n/**\n * A popover anchored under an element, closed on outside click, Escape, or Tab, as React's\n * `Popover`. As a `menu` (the default) it follows the WAI-ARIA menu pattern; as a `dialog` it\n * holds a form or controls. It renders in the anchor's editor scope, so the tokens apply.\n * @internal\n */\nexport const Popover = defineComponent({\n name: 'Popover',\n // The root is a teleport: a host `class` and other attributes go on the panel, with\n // `className`, as React's.\n inheritAttrs: false,\n props: popoverProps,\n setup(props, { slots, attrs }) {\n const panel = ref<HTMLDivElement | null>(null);\n const pos = shallowRef<PopoverPlacement | null>(null);\n // Whether focus was inside the popover, so closing it gives focus back to the trigger.\n let focusInside = false;\n const close = (): void => props.onClose();\n const place = (): void => {\n if (props.anchor)\n pos.value = positionPopover(panel.value, props.anchor, props.align, props.anchorRect);\n };\n let stopListening: (() => void) | null = null;\n const listen = (anchor: HTMLElement | null): void => {\n stopListening?.();\n stopListening = listenPopoverDismiss({\n panel: () => panel.value,\n anchor,\n focusInside: () => focusInside,\n onClose: close,\n });\n };\n // The element that had focus before a pointer open: closing gives focus back to it.\n let back: HTMLElement | null = null;\n onMounted(() => {\n // Placed before focus moves in: a browser does not focus into a hidden panel.\n place();\n back = focusPopoverOnOpen(panel.value, props.anchor, props);\n listen(props.anchor);\n });\n watch(\n () => [props.anchor, props.align, props.anchorRect] as const,\n ([anchor], [old]) => {\n place();\n if (anchor === old) return;\n restorePopoverFocus(old, focusInside, back);\n back = focusPopoverOnOpen(panel.value, anchor, props);\n listen(anchor);\n },\n { flush: 'post' }\n );\n // After the panel left the DOM, as React's effect cleanup: focus inside it has dropped to\n // `<body>`, and goes back to where it was before a pointer open, else to the trigger.\n onUnmounted(() => {\n stopListening?.();\n restorePopoverFocus(props.anchor, focusInside, back);\n });\n return () => {\n const p = pos.value;\n return (\n <Teleport to={popoverScope(props.anchor)}>\n <div\n {...attrs}\n ref={panel}\n id={props.id}\n class={normalizeClass(['pptx-menu', attrs.class, props.className])}\n role={props.role}\n aria-label={props.label ?? props.anchor?.getAttribute('aria-label') ?? undefined}\n tabindex={-1}\n style={\n p\n ? {\n left: `${p.left}px`,\n top: `${p.top}px`,\n maxHeight: `${p.maxHeight}px`,\n overflowY: p.scroll ? 'auto' : undefined,\n }\n : { visibility: 'hidden', left: '0px', top: '0px' }\n }\n onMousedown={keepFocus}\n // In a menu the pointer moves the focused row, so one row looks active.\n onMousemove={\n props.role === 'menu'\n ? (e: MouseEvent) => focusMenuRowAtPointer(panel.value, e)\n : undefined\n }\n onFocusin={() => {\n focusInside = true;\n }}\n onKeydown={(e: KeyboardEvent) =>\n popoverKeyDown(panel.value, props.anchor, e, { ...props, onClose: close })\n }\n >\n {slots.default?.()}\n </div>\n </Teleport>\n );\n };\n },\n});\n\nconst menuItemProps = {\n onSelect: { type: Function as PropType<() => void>, required: true as const },\n checked: { type: Boolean, default: undefined },\n disabled: { type: Boolean, default: false },\n /**\n * Why a disabled row cannot run. The row then stays focusable (`aria-disabled`) and names\n * the reason, so a keyboard or screen-reader user meets it too; it still does not run.\n */\n reason: { type: String, default: undefined },\n title: { type: String, default: undefined },\n /** A row of a `listbox` (the font list) instead of a menu. */\n option: { type: Boolean, default: false },\n /** An on/off setting: `menuitemcheckbox`. */\n checkbox: { type: Boolean, default: false },\n /**\n * A hint read after the row's name (`aria-description`), so the name stays the label alone:\n * mark a visible hint in the row `aria-hidden`.\n */\n description: { type: String, default: undefined },\n} as const;\n\n/** The props of `MenuItem`, the twin of React's `MenuItemProps`. @internal */\nexport type MenuItemProps = ExtractPublicPropTypes<typeof menuItemProps>;\n\n/**\n * A menu row: `menuitem`, or `menuitemradio` when `checked` is given (`menuitemcheckbox` with\n * `checkbox`), or `option` in a list box. Rows are `tabindex=-1`: the arrow keys move between\n * them. The default slot is the row's content. @internal\n */\nexport const MenuItem = defineComponent({\n name: 'MenuItem',\n props: menuItemProps,\n setup(props, { slots }) {\n return () => {\n const state = props.option\n ? { role: 'option', 'aria-selected': props.checked ?? false }\n : props.checked === undefined\n ? { role: 'menuitem' }\n : {\n role: props.checkbox ? 'menuitemcheckbox' : 'menuitemradio',\n 'aria-checked': props.checked,\n };\n return (\n <button\n type=\"button\"\n {...state}\n tabindex={-1}\n class=\"pptx-menu__item\"\n // A disabled row stays focusable, so the arrow keys reach it and a keyboard or\n // screen-reader user can read why; a `reason` is spoken and shown.\n aria-disabled={props.disabled || undefined}\n {...(props.disabled && props.reason\n ? { 'aria-description': props.reason, 'data-pptx-tooltip': props.reason }\n : props.title\n ? { 'data-pptx-tooltip': props.title }\n : {})}\n {...(props.description && !(props.disabled && props.reason)\n ? { 'aria-description': props.description }\n : {})}\n onClick={props.disabled ? undefined : props.onSelect}\n >\n {slots.default?.()}\n {/* The checked row of a menu shows a check mark. */}\n {props.checked && !props.option ? (\n <Icon name=\"check\" className=\"pptx-icon pptx-menu__check\" />\n ) : null}\n </button>\n );\n };\n },\n});\n","// A part-level injection for one toolbar slot's host overrides (`ToolbarSlot`): the icon, the\n// class name, and an `asChild` element. The Vue twin of the React adapter's `slot-override.ts`:\n// every control reads it for its own slot, so a customization reaches the control without new\n// props, as in DOCX Editor's toolbar parts.\n\nimport { cloneVNode, inject, type InjectionKey, type VNode, type VNodeChild } from 'vue';\nimport { warnUnsupportedOverride, type ToolbarPartNames } from '@pptx-editor.dev/core/editor';\n\n/** The overrides one `ToolbarSlot` passes to the control it wraps. @internal */\nexport interface SlotOverride {\n readonly slotId: string;\n /** Icon content in place of the registry icon. */\n readonly icon?: VNodeChild;\n readonly className?: string;\n /** With `asChild`, the host element that the control renders as. */\n readonly asChild?: VNode;\n /** The named part the override came from, for warning text. */\n readonly part?: string;\n}\n\n/** Provided by a `ToolbarSlot` that overrides its control. @internal */\nexport const slotOverrideKey: InjectionKey<SlotOverride | null> = Symbol('pptxSlotOverride');\n\n/** The overrides for `slot`, or null when the nearest override names another slot. @internal */\nexport function useSlotOverride(slot: string | undefined): SlotOverride | null {\n const override = inject(slotOverrideKey, null);\n return override && slot !== undefined && override.slotId === slot ? override : null;\n}\n\n/** The names warnings use for a slot: the named part when there is one. @internal */\nexport function slotPartNames(override: SlotOverride | null): ToolbarPartNames | undefined {\n return override?.part ? { slot: override.part, group: 'ToolbarGroup' } : undefined;\n}\n\n/** State and class attributes for a control's trigger element. @internal */\nexport interface TriggerAttributes {\n readonly class: string;\n readonly 'data-active'?: '';\n readonly 'data-disabled'?: '';\n}\n\n/**\n * The class and state attributes for a control that renders a picker trigger, not a\n * `ToolButton`: `icon` and `asChild` are refused with a development warning, as in React.\n * @internal\n */\nexport function useTriggerAttributes(\n slot: string,\n base: string,\n state: () => { readonly disabled?: boolean; readonly active?: boolean }\n): () => TriggerAttributes {\n const override = useSlotOverride(slot);\n if (override?.icon !== undefined) warnUnsupportedOverride(slot, 'icon', slotPartNames(override));\n if (override?.asChild) warnUnsupportedOverride(slot, 'asChild', slotPartNames(override));\n return () => {\n const now = state();\n return {\n class: [base, override?.className].filter(Boolean).join(' '),\n ...(now.active ? { 'data-active': '' as const } : {}),\n ...(now.disabled ? { 'data-disabled': '' as const } : {}),\n };\n };\n}\n\n/**\n * The props that make a host element that is not a `<button>` act as one (WCAG 2.1.1): the\n * button role, a tab stop, and Enter and Space to activate. A link keeps its own Enter.\n * @internal\n */\nexport function buttonRoleProps(\n activate: ((target: Element) => void) | undefined\n): Record<string, unknown> {\n return {\n role: 'button',\n tabindex: 0,\n onKeydown: (event: KeyboardEvent) => {\n const target = event.currentTarget as Element;\n const link = target instanceof HTMLAnchorElement && target.href;\n if (event.key !== ' ' && (event.key !== 'Enter' || link)) return;\n event.preventDefault();\n activate?.(target);\n },\n };\n}\n\nfunction composeHandlers(childHandler: unknown, slotHandler: unknown): unknown {\n if (typeof slotHandler !== 'function') return childHandler;\n if (typeof childHandler !== 'function') return slotHandler;\n return (event: { defaultPrevented: boolean }) => {\n childHandler(event);\n if (!event.defaultPrevented) slotHandler(event);\n };\n}\n\n/**\n * Render `child` with the control's props merged in, as React's `renderAsChild`: classes join,\n * styles merge (child wins per property), handlers run child-first (the control's handler is\n * skipped when the child called `preventDefault()`), and other props keep the child's value.\n * @internal\n */\nexport function renderAsChild(child: VNode, slotProps: Record<string, unknown>): VNode {\n const childProps = (child.props ?? {}) as Record<string, unknown>;\n const merged: Record<string, unknown> = { ...slotProps, ...childProps };\n for (const key of Object.keys(slotProps)) {\n if (/^on[A-Z]/.test(key)) merged[key] = composeHandlers(childProps[key], slotProps[key]);\n else if (key === 'class') merged[key] = [slotProps[key], childProps[key]];\n else if (key === 'style') merged[key] = [slotProps[key], childProps[key]];\n }\n // `cloneVNode` without merge: `merged` already holds the child's own props.\n return cloneVNode({ ...child, props: null } as VNode, merged);\n}\n","// Ported from DOCX Editor packages/vue/src/editor/dialog-parts.ts at 27720ad5\n// (`createDialogComposition`, `NativeDialog`). PPTX changes:\n// the names follow the React twin (`createDialogParts`, `DialogFrame`), and the draft lives in\n// core.\n//\n// Dialog named parts over a draft controller: the Vue twin of the React adapter's\n// `dialog-parts.tsx`. A packaged dialog renders its default\n// arrangement with each element marked `data-pptx-part`; a host part with the same name\n// replaces it in place, keeps its wiring, and adds the host's class, style, and attributes.\n// The draft lives in core (`createDialogDraft`), so both adapters apply the same way.\n\nimport {\n Fragment,\n cloneVNode,\n defineComponent,\n h,\n inject,\n isVNode,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n shallowRef,\n watch,\n type CSSProperties,\n type DefineComponent,\n type InjectionKey,\n type PropType,\n type Ref,\n type ShallowRef,\n type VNode,\n type VNodeArrayChildren,\n} from 'vue';\nimport {\n DIALOG_FIELD_ATTRIBUTE,\n DIALOG_PART_ATTRIBUTE,\n createDialogDraft,\n dialogInitialFocus,\n dialogPartKey,\n dialogPartLabel,\n fromNestedDialog,\n isDialogBackdropPoint,\n returnAppliesFrom,\n trapTabWithin,\n warnDialogPart,\n type DialogDraftOptions,\n type DialogErrors,\n} from '@pptx-editor.dev/core/editor';\nimport { usePptxEditor } from './composables.ts';\nimport { useChromeDark } from './color-mode.ts';\n\n/** A dialog's draft and actions, as its parts and a host's own fields read them. @public */\nexport interface UseDialogReturn<Fields extends object> {\n /** The draft values. */\n readonly values: Readonly<Ref<Fields>>;\n /** Translated messages per field, and `form` for the whole draft. */\n readonly errors: Readonly<\n Ref<Readonly<Partial<Record<Extract<keyof Fields, string> | 'form', string>>>>\n >;\n /** False when the dialog cannot apply now (no document, viewing mode). */\n readonly isEnabled: Readonly<Ref<boolean>>;\n /** Change one field of the draft. */\n setValue<K extends keyof Fields>(name: K, value: Fields[K]): void;\n /** Validate and commit the draft. The dialog closes when the document took it. */\n apply(): void;\n /** Discard the draft and close. */\n cancel(): void;\n}\n\n/** A draft as Vue refs, re-read on every change. @internal */\nexport function useDialogDraft<Fields extends object>(\n options: DialogDraftOptions<Fields>\n): {\n readonly values: ShallowRef<Fields>;\n readonly errors: ShallowRef<DialogErrors<Fields>>;\n setValue<K extends keyof Fields>(name: K, value: Fields[K]): void;\n apply(): boolean;\n reset(): void;\n} {\n const draft = createDialogDraft(options);\n const values = shallowRef(draft.values) as ShallowRef<Fields>;\n const errors = shallowRef(draft.errors) as ShallowRef<DialogErrors<Fields>>;\n const off = draft.subscribe(() => {\n values.value = draft.values;\n errors.value = draft.errors;\n });\n onBeforeUnmount(off);\n return {\n values,\n errors,\n setValue: draft.setValue,\n apply: draft.apply,\n reset: draft.reset,\n };\n}\n\n/**\n * Presentation props of a dialog part, the twin of React's `DialogPartProps`. Other attributes\n * (`id`, `aria-*`, `data-*`) reach the rendered element; the part's own wiring wins every\n * collision. @public\n */\nexport interface DialogPartProps {\n /** A class name added to the part (`class` works too). */\n readonly className?: string;\n /** Styles added to the part. */\n readonly style?: CSSProperties;\n /** Remove the part from the arrangement. */\n readonly hidden?: boolean;\n /** Apply the part's wiring to the single child element. */\n readonly asChild?: boolean;\n /** The id of the part's element. */\n readonly id?: string;\n /** The tooltip of the part's element. */\n readonly title?: string;\n /** The accessible name of the part's element. */\n readonly 'aria-label'?: string;\n /** `data-*` attributes, passed to the part's element. */\n readonly [attribute: `data-${string}`]: unknown;\n}\n\n/**\n * Layout customization for a packaged dialog, the twin of React's `DialogCustomizationProps`\n * and DOCX Editor's Vue one. Vue passes children through the default slot, not a prop. @public\n */\nexport interface DialogCustomizationProps {\n /** A class name added to the dialog surface (`class` works too). */\n readonly className?: string;\n /** Styles added to the dialog surface. */\n readonly style?: CSSProperties;\n /** `true` (default): the default arrangement with host parts in place. `false`: only the slot. */\n readonly preset?: boolean;\n}\n\n/** The parts a `createDialogParts` call returns. @internal */\nexport interface DialogParts<State, Name extends string> {\n readonly Header: DefineComponent<DialogPartProps>;\n readonly Title: DefineComponent<DialogPartProps>;\n readonly Body: DefineComponent<DialogPartProps>;\n readonly Footer: DefineComponent<DialogPartProps>;\n readonly Apply: DefineComponent<DialogPartProps>;\n readonly Cancel: DefineComponent<DialogPartProps>;\n readonly Reset: DefineComponent<DialogPartProps>;\n readonly Error: DefineComponent<DialogPartProps>;\n /** One field of the dialog, by its field name. */\n readonly Field: DefineComponent<DialogPartProps & { readonly name: Name }>;\n /** The dialog's draft, for a child of the dialog. Throws outside it. */\n readonly useState: () => State;\n /** A dialog-specific part, matched to the default element with this `data-pptx-part`. */\n readonly part: (name: string) => DefineComponent<DialogPartProps>;\n /** Provide the state; returns the renderer of the default arrangement with host parts. */\n readonly provideParts: (\n state: State\n ) => (\n defaults: VNode,\n children: VNodeArrayChildren | undefined,\n preset: boolean\n ) => VNodeArrayChildren;\n}\n\nconst partProps = {\n /** A class name added to the part. */\n className: { type: String, default: undefined },\n /** Styles added to the part. */\n style: { type: Object as PropType<CSSProperties>, default: undefined },\n /** Remove the part from the arrangement. */\n hidden: { type: Boolean, default: false },\n /** Apply the part's wiring to the single child element. */\n asChild: { type: Boolean, default: false },\n} as const;\n\ninterface Composition {\n readonly defaults: ShallowRef<Map<string, VNode>>;\n readonly overrides: Map<string, VNode>;\n}\n\n/** The top-level vnodes of `children`, with fragments opened. */\nfunction flatten(children: VNodeArrayChildren | undefined, out: VNode[] = []): VNode[] {\n for (const child of children ?? []) {\n if (Array.isArray(child)) flatten(child, out);\n else if (isVNode(child)) {\n if (child.type === Fragment && Array.isArray(child.children))\n flatten(child.children as VNodeArrayChildren, out);\n else out.push(child);\n }\n }\n return out;\n}\n\n/** A vnode's part key, read from its markers. */\nconst markerOf = (node: VNode): string | null =>\n dialogPartKey(node.props?.[DIALOG_PART_ATTRIBUTE], node.props?.[DIALOG_FIELD_ATTRIBUTE]);\n\n/** The part a host component stands for, read from its static marker. */\nconst partOf = (node: VNode): string | null => {\n const part = (node.type as { pptxDialogPart?: string } | null)?.pptxDialogPart;\n return part === undefined ? null : dialogPartKey(part, node.props?.name);\n};\n\n/**\n * Build the named parts of one dialog: `Header`, `Title`, `Body`, `Footer`, `Apply`, `Cancel`,\n * `Reset`, `Error`, and `Field` (by its `name`). The dialog calls `provideParts(state)` in its\n * setup and renders through the function it returns. @internal\n */\nexport function createDialogParts<State, Name extends string = string>(\n dialogName: string\n): DialogParts<State, Name> {\n const stateKey: InjectionKey<State> = Symbol(dialogName);\n const compositionKey: InjectionKey<Composition> = Symbol(`${dialogName}.parts`);\n const label = (key: string): string => dialogPartLabel(dialogName, key);\n function useState(): State {\n const state = inject(stateKey, null);\n if (!state) throw new Error(`${dialogName} parts must be rendered inside ${dialogName}.`);\n return state;\n }\n function makePart(part: string): DefineComponent<DialogPartProps> {\n const component = Object.assign(\n defineComponent({\n name: `${dialogName}${part[0]!.toUpperCase()}${part.slice(1)}`,\n inheritAttrs: false,\n props: {\n ...partProps,\n /** The field this part stands for. `Field` parts only. */\n name: { type: String, default: undefined },\n },\n setup(props, { attrs, slots }) {\n const composition = inject(compositionKey, null);\n return () => {\n const key = dialogPartKey(part, props.name) ?? '';\n if (!composition) {\n warnDialogPart(label(key), 'outside');\n return null;\n }\n if (props.hidden) return null;\n const children = slots.default?.();\n const original = composition.defaults.value.get(key);\n if (!original) {\n warnDialogPart(label(key), children?.length ? 'childrenOnly' : 'unknown');\n return children ?? null;\n }\n // The part's own wiring outranks the host's attributes, so a stray `onClick` or\n // `data-pptx-part` cannot detach the control from the dialog. The React twin\n // applies the same order.\n // A default element's `undefined` (a `title` set only when disabled) leaves the\n // host's value in place, as the React twin.\n const wiring: Record<string, unknown> = {\n ...attrs,\n ...Object.fromEntries(\n Object.entries(original.props ?? {}).filter(([, value]) => value !== undefined)\n ),\n };\n // `asChild` needs exactly one element: text and comments have symbol types.\n const only = props.asChild ? flatten(children) : [];\n const child =\n only.length === 1 && typeof only[0]!.type !== 'symbol' ? only[0] : undefined;\n if (props.asChild && !child) warnDialogPart(label(key), 'asChild');\n if (child) {\n // The host owns the look: no packaged `pptx-dialog__*` classes or styles.\n delete wiring.class;\n delete wiring.style;\n return cloneVNode(child, {\n ...wiring,\n class: [attrs.class, props.className],\n style: props.style,\n });\n }\n const merged = {\n ...wiring,\n class: [original.props?.class, attrs.class, props.className],\n style: [original.props?.style, props.style],\n };\n // A misused `asChild` falls back to the packaged part with its packaged content.\n const content = props.asChild ? undefined : children;\n return h(\n original.type as string,\n merged,\n content ?? (original.children as VNodeArrayChildren | string | null) ?? undefined\n );\n };\n },\n }),\n { pptxDialogPart: part }\n );\n return component as unknown as DefineComponent<DialogPartProps>;\n }\n /**\n * Provide the dialog's state to its parts. Returns the renderer: the default arrangement with\n * host parts in place (`preset`), or only the host's children.\n */\n function provideParts(state: State) {\n provide(stateKey, state);\n const composition: Composition = { defaults: shallowRef(new Map()), overrides: new Map() };\n provide(compositionKey, composition);\n return (\n defaults: VNode,\n children: VNodeArrayChildren | undefined,\n preset: boolean\n ): VNodeArrayChildren => {\n composition.overrides.clear();\n const extras: VNode[] = [];\n for (const child of flatten(children)) {\n const key = partOf(child);\n if (!key) {\n extras.push(child);\n // Every level down, as the React twin.\n const scan = (node: VNode): void => {\n if (!Array.isArray(node.children)) return;\n for (const inner of flatten(node.children as VNodeArrayChildren)) {\n const nested = partOf(inner);\n if (nested) warnDialogPart(label(nested), 'nested');\n scan(inner);\n }\n };\n if (preset) scan(child);\n } else {\n if (composition.overrides.has(key)) warnDialogPart(label(key), 'duplicate');\n composition.overrides.set(key, child);\n }\n }\n const map = new Map<string, VNode>();\n // Text children stay as they are: a row such as \"Widescreen <span>13.33 × 7.50 in</span>\"\n // keeps its text beside its elements.\n const visitChildren = (children: VNodeArrayChildren): VNodeArrayChildren =>\n children.map((child) =>\n Array.isArray(child) ? visitChildren(child) : isVNode(child) ? visit(child) : child\n );\n const visit = (node: VNode): VNode => {\n const copy = cloneVNode(node);\n if (Array.isArray(node.children))\n copy.children = visitChildren(node.children as VNodeArrayChildren);\n const key = markerOf(node);\n if (key) {\n map.set(key, copy);\n if (preset && composition.overrides.has(key)) return composition.overrides.get(key)!;\n }\n return copy;\n };\n const rendered = visit(defaults);\n // A part with no default in place is never rendered, so it says so here.\n if (preset)\n for (const [key, node] of composition.overrides)\n if (!map.has(key) && [undefined, false].includes(node.props?.hidden))\n warnDialogPart(label(key), 'unknown');\n // A part whose default sits inside another part that brings its own children is dropped\n // with that default, as in the React twin.\n if (preset)\n for (const [key, node] of composition.overrides) {\n if (node.children == null) continue;\n // As the React twin: a misused `asChild` falls back to the packaged part.\n const asChild = node.props?.asChild ?? node.props?.['as-child'];\n if (asChild !== undefined && asChild !== false) {\n // The part's own test: exactly one node, and it is an element.\n const slot = (node.children as { default?: () => VNodeArrayChildren }).default;\n const nodes = flatten(slot?.() ?? []);\n if (nodes.length !== 1 || typeof nodes[0]!.type === 'symbol') continue;\n }\n const scan = (inner: VNode): void => {\n if (!Array.isArray(inner.children)) return;\n for (const child of flatten(inner.children as VNodeArrayChildren)) {\n // The copy already holds the override in place of the nested default.\n const nested = markerOf(child) ?? partOf(child);\n if (nested && nested !== key && composition.overrides.has(nested))\n warnDialogPart(label(nested), 'shadowed', label(key));\n scan(child);\n }\n };\n const owner = map.get(key);\n if (owner) scan(owner);\n }\n composition.defaults.value = map;\n return preset ? [rendered, ...extras] : (children ?? []);\n };\n }\n return {\n Header: makePart('header'),\n Title: makePart('title'),\n Body: makePart('body'),\n Footer: makePart('footer'),\n Apply: makePart('apply'),\n Cancel: makePart('cancel'),\n Reset: makePart('reset'),\n Error: makePart('error'),\n Field: makePart('field') as unknown as DefineComponent<\n DialogPartProps & { readonly name: Name }\n >,\n useState,\n part: (name) => makePart(name),\n provideParts,\n };\n}\n\n/**\n * The native modal every packaged dialog renders in, the twin of React's `DialogFrame`: it\n * opens as a modal on mount and closes on unmount, focuses its first control, keeps Tab inside,\n * closes on Escape and on a click on the backdrop, and gives focus back. Outside an editor\n * scope it carries the scope itself, so the tokens apply. @internal\n */\nexport const DialogFrame = defineComponent({\n name: 'PptxDialogFrame',\n props: {\n kind: { type: String, required: true },\n label: { type: String, required: true },\n onClose: { type: Function as PropType<() => void>, required: true },\n onKeydown: { type: Function as PropType<(event: KeyboardEvent) => void>, default: undefined },\n },\n setup(props, { slots }) {\n const panel = ref<HTMLDialogElement | null>(null);\n const ownScope = ref(false);\n const dark = useChromeDark();\n let opener: HTMLElement | null = null;\n // A press inside the panel that is released over the backdrop is a drag, not a dismissal.\n let pressedOutside = false;\n onMounted(() => {\n const el = panel.value;\n if (!el) return;\n ownScope.value = !el.parentElement?.closest('.pptx-editor');\n opener = el.ownerDocument.activeElement as HTMLElement | null;\n if (typeof el.showModal === 'function' && !el.open) el.showModal();\n else el.setAttribute('open', '');\n dialogInitialFocus(el)?.focus({ preventScroll: true });\n });\n onBeforeUnmount(() => {\n const el = panel.value;\n if (el && typeof el.close === 'function' && el.open) el.close();\n if (opener?.isConnected) opener.focus({ preventScroll: true });\n });\n return () =>\n h(\n 'dialog',\n {\n ref: panel,\n 'aria-modal': 'true',\n 'aria-label': props.label,\n class: [\n 'pptx-dialog',\n ownScope.value ? 'pptx-editor' : null,\n ownScope.value && dark.value ? 'dark' : null,\n ],\n 'data-pptx-dialog': props.kind,\n onCancel: (event: Event) => {\n // A nested dialog's own Escape closes only that dialog, as in the React twin.\n if (fromNestedDialog(event.currentTarget as Element, event.target)) return;\n event.preventDefault();\n props.onClose();\n },\n onMousedown: (event: MouseEvent) => {\n pressedOutside = isDialogBackdropPoint(event.currentTarget as HTMLElement, event);\n event.stopPropagation();\n },\n onClick: (event: MouseEvent) => {\n // As DOCX Editor and the React twin: a press and a release outside the dialog's box.\n if (pressedOutside && isDialogBackdropPoint(event.currentTarget as HTMLElement, event))\n props.onClose();\n pressedOutside = false;\n event.stopPropagation();\n },\n onKeydown: (event: KeyboardEvent) => {\n // A dialog opened inside this one handles its own keys; they still stop here.\n if (fromNestedDialog(event.currentTarget as Element, event.target)) {\n event.stopPropagation();\n return;\n }\n if (event.key === 'Escape' && !event.isComposing) {\n event.preventDefault();\n props.onClose();\n } else if (trapTabWithin(event.currentTarget as HTMLElement, event))\n event.preventDefault();\n else if (!event.isComposing && !event.defaultPrevented) props.onKeydown?.(event);\n event.stopPropagation();\n },\n },\n slots.default?.()\n );\n },\n});\n\n/**\n * Return in a field applies the draft, as the React twin: from any input but a file input,\n * and from a radio of a radio group. @internal\n */\nexport function applyOnEnter(event: KeyboardEvent, enabled: boolean, apply: () => void): void {\n if (event.key !== 'Enter' || !enabled || !returnAppliesFrom(event.target)) return;\n event.preventDefault();\n apply();\n}\n\n/**\n * Close a dialog when its editor opens another document, the twin of React's\n * `useCloseOnNewDocument` (DOCX Editor's `useDialogGeneration`). @internal\n */\nexport function useCloseOnNewDocument(onClose: () => void): void {\n const editor = usePptxEditor();\n watch(\n editor,\n (current, _old, onCleanup) => {\n if (!current) return;\n let session = current.session;\n // Once per new document; `destroy()` leaves no session and closes nothing.\n onCleanup(\n current.subscribe(() => {\n if (current.session === session) return;\n session = current.session;\n if (session) onClose();\n })\n );\n },\n { immediate: true }\n );\n}\n","// The chrome color mode a `PptxEditorRoot` declares (`colorMode`): the Vue twin of the React\n// adapter's `color-mode.ts`. The viewport adds `dark` beside `.pptx-editor`, and a dialog\n// outside the viewport puts the scope classes on its own element.\n\nimport {\n computed,\n inject,\n onMounted,\n onScopeDispose,\n provide,\n shallowRef,\n watch,\n type ComputedRef,\n type InjectionKey,\n} from 'vue';\nimport {\n resolveDarkChrome,\n subscribeSystemDark,\n systemPrefersDark,\n type ColorMode,\n type ResolvedColorMode,\n} from '@pptx-editor.dev/core/editor';\n\nconst chromeDarkKey: InjectionKey<ComputedRef<boolean>> = Symbol('pptxChromeDark');\n\n/** True inside `PptxEditorViewport`: an ancestor element already carries `.pptx-editor`. */\nconst scopedByAncestorKey: InjectionKey<boolean> = Symbol('pptxScopedByAncestor');\n\n/** Mark the components below as inside the viewport's scope. @internal */\nexport function provideScopedByAncestor(): void {\n provide(scopedByAncestorKey, true);\n}\n\n/** Whether an ancestor element already carries `.pptx-editor`. @internal */\nexport function useScopedByAncestor(): boolean {\n return inject(scopedByAncestorKey, false);\n}\nconst lightChrome = computed(() => false);\n\n/** Resolve and provide the chrome color mode for one root. @internal */\nexport function provideChromeDark(mode: () => ColorMode | undefined): void {\n const systemDark = shallowRef(false);\n let off: (() => void) | null = null;\n const follow = (next: ColorMode | undefined): void => {\n off?.();\n off = null;\n if (next !== 'system') return;\n systemDark.value = systemPrefersDark();\n off = subscribeSystemDark(() => (systemDark.value = systemPrefersDark()));\n };\n // The operating system is read after mount, as DOCX Editor's Vue adapter does: a server\n // render and the hydrating client then start from the same light chrome.\n onMounted(() => follow(mode()));\n watch(mode, follow);\n onScopeDispose(() => off?.());\n provide(\n chromeDarkKey,\n computed(() => resolveDarkChrome(mode(), systemDark.value))\n );\n}\n\n/** Whether the enclosing root resolved a dark chrome. @internal */\nexport function useChromeDark(): ComputedRef<boolean> {\n return inject(chromeDarkKey, lightChrome);\n}\n\n/** What `useEditorColorMode` returns. @public */\nexport interface UseEditorColorModeReturn {\n /** The resolved theme: `'dark'` or `'light'`. Updates when `colorMode` or the OS setting changes. */\n readonly colorMode: ComputedRef<ResolvedColorMode>;\n}\n\n/**\n * The theme the enclosing `PptxEditorRoot` resolved from its `colorMode`, as React's\n * `useEditorColorMode` and DOCX Editor's. Outside a root, or without `colorMode`, it is\n * `'light'`. Call it in `setup`. @public\n */\nexport function useEditorColorMode(): UseEditorColorModeReturn {\n const dark = useChromeDark();\n return { colorMode: computed(() => (dark.value ? 'dark' : 'light')) };\n}\n","// The Alt Text dialog: the Vue twin of the React adapter's `ImageAltTextDialog`, on the same\n// dialog parts and the same core rules (`picture-fields.ts`), so both show the same fields and\n// apply the same `setAltText` command. The host owns visibility (`open`, `onClose`).\n\nimport {\n Fragment,\n computed,\n defineComponent,\n h,\n useId,\n watch,\n type CSSProperties,\n type ExtractPublicPropTypes,\n type PropType,\n} from 'vue';\nimport {\n MAX_ALT_TEXT,\n altTextDraftCommand,\n altTextDraftFrom,\n commitDialogCommand,\n translateDialogErrors,\n translateKeyOrText,\n validateAltTextDraft,\n} from '@pptx-editor.dev/core/editor';\nimport { useEditorState, usePptxEditor, useTranslation } from './composables.ts';\nimport { ToolButton } from './chrome.tsx';\nimport {\n DialogFrame,\n applyOnEnter,\n createDialogParts,\n useCloseOnNewDocument,\n useDialogDraft,\n type UseDialogReturn,\n} from './dialog-parts.ts';\n\n/** The draft of the Alt Text dialog. @public */\nexport interface ImageAltTextDialogFields {\n /** The description a screen reader reads (`p:cNvPr/@descr`). */\n readonly description: string;\n /** The title (`p:cNvPr/@title`). */\n readonly title: string;\n /** Mark as decorative: a screen reader skips the element, and the description is dropped. */\n readonly decorative: boolean;\n}\n\n/** The Alt Text draft and its actions. @public */\nexport type UseImageAltTextDialogReturn = UseDialogReturn<ImageAltTextDialogFields>;\n\n/** The field names of the Alt Text dialog, for `ImageAltTextDialog.Field`. @public */\nexport type ImageAltTextDialogFieldName = 'description' | 'title' | 'decorative';\n\nconst parts = createDialogParts<UseImageAltTextDialogReturn, ImageAltTextDialogFieldName>(\n 'ImageAltTextDialog'\n);\n\nconst imageAltTextDialogProps = {\n /** Whether the dialog is shown. The host owns this state. */\n open: { type: Boolean, required: true as const },\n /** Called on Cancel, Escape, a click on the backdrop, and after OK. */\n onClose: { type: Function as PropType<() => void>, required: true as const },\n /** `false`: only the default slot, with no default arrangement. */\n preset: { type: Boolean, default: true },\n /** A class name added to the dialog surface, as React's `className` (`class` works too). */\n className: { type: String, default: undefined },\n /** Styles added to the dialog surface. */\n style: { type: Object as PropType<CSSProperties>, default: undefined },\n} as const;\n\n/** Props of `ImageAltTextDialog`, the twin of React's `ImageAltTextDialogProps`. @public */\nexport type ImageAltTextDialogProps = ExtractPublicPropTypes<typeof imageAltTextDialogProps>;\n\nconst ImageAltTextDialogOpen = defineComponent({\n name: 'ImageAltTextDialogOpen',\n inheritAttrs: false,\n props: imageAltTextDialogProps,\n setup(props, { attrs, slots }) {\n const { t } = useTranslation();\n const editorRef = usePptxEditor();\n const id = useId();\n const current = useEditorState((s) => s.geometry?.altText);\n const enabled = useEditorState(\n (s) => s.status === 'ready' && s.mode === 'edit' && s.geometry !== null\n );\n const initial = altTextDraftFrom(current.value);\n // As the React twin: the draft belongs to the object the dialog opened on, so another\n // selection, the object's removal, or a new document closes the dialog.\n const nodeId = useEditorState((s) => s.geometry?.nodeId ?? null);\n const openedOn = nodeId.value;\n watch(nodeId, (now) => {\n if (now !== openedOn) props.onClose();\n });\n useCloseOnNewDocument(() => props.onClose());\n const draft = useDialogDraft<ImageAltTextDialogFields>({\n initial,\n validate: validateAltTextDraft,\n commit: (values) =>\n commitDialogCommand(editorRef.value, altTextDraftCommand(values, initial)),\n });\n const state: UseImageAltTextDialogReturn = {\n values: draft.values,\n // The state gives messages; the raw keys stay inside, for focus.\n errors: computed(() => translateDialogErrors(t, draft.errors.value)),\n isEnabled: computed(() => enabled.value),\n setValue: draft.setValue,\n apply: () => {\n if (draft.apply()) return props.onClose();\n // Focus the field with the error (WCAG 3.3.1), as Format Picture does.\n const errors = validateAltTextDraft(draft.values.value);\n const bad = (['description', 'title'] as const).find((f) => errors[f]);\n if (bad) document.getElementById(`${id}-${bad}`)?.focus();\n },\n cancel: () => props.onClose(),\n };\n const render = parts.provideParts(state);\n return () => {\n const { description, title, decorative } = draft.values.value;\n const errors = draft.errors.value;\n // The first error, with the name of its field.\n const bad = errors.description ? 'description' : errors.title ? 'title' : null;\n const error = bad\n ? t('imageAltText.fieldError', {\n field: t(\n bad === 'description' ? 'imageAltText.description' : 'imageAltText.titleLabel'\n ),\n message: translateKeyOrText(t, errors[bad]!),\n })\n : errors.form\n ? translateKeyOrText(t, errors.form)\n : '';\n const field = (name: ImageAltTextDialogFieldName, extra: string, children: unknown[]) =>\n h(\n 'section',\n {\n 'data-pptx-part': 'field',\n 'data-pptx-field': name,\n class: `pptx-dialog__section${extra}`,\n },\n children as never\n );\n const defaults = h(Fragment, [\n h('div', { 'data-pptx-part': 'header', class: 'pptx-dialog__header' }, [\n h(\n 'h2',\n { 'data-pptx-part': 'title', class: 'pptx-dialog__title' },\n t('imageAltText.title')\n ),\n h(ToolButton, { label: t('imageAltText.close'), icon: 'close', onClick: props.onClose }),\n ]),\n h('div', { 'data-pptx-part': 'body', class: 'pptx-dialog__body' }, [\n field('description', '', [\n h(\n 'label',\n { class: 'pptx-dialog__label', for: `${id}-description` },\n t('imageAltText.description')\n ),\n h(\n 'p',\n { class: 'pptx-dialog__muted', id: `${id}-help` },\n t('imageAltText.descriptionHelp')\n ),\n h('textarea', {\n id: `${id}-description`,\n class: 'pptx-dialog__textarea',\n rows: 5,\n value: description,\n disabled: decorative,\n 'aria-invalid': errors.description ? 'true' : 'false',\n 'aria-describedby': [\n `${id}-help`,\n `${id}-count`,\n decorative ? `${id}-decorative-reason` : null,\n bad === 'description' ? `${id}-error` : null,\n ]\n .filter(Boolean)\n .join(' '),\n onInput: (e: Event) =>\n draft.setValue('description', (e.target as HTMLTextAreaElement).value),\n }),\n decorative\n ? h(\n 'span',\n { class: 'pptx-sr-only', id: `${id}-decorative-reason` },\n t('imageAltText.decorativeReason')\n )\n : null,\n h(\n 'span',\n { class: 'pptx-dialog__muted', id: `${id}-count` },\n t('imageAltText.count', { count: description.length, max: MAX_ALT_TEXT })\n ),\n ]),\n field('title', ' pptx-field', [\n h(\n 'label',\n { class: 'pptx-dialog__label', for: `${id}-title` },\n t('imageAltText.titleLabel')\n ),\n h('input', {\n id: `${id}-title`,\n type: 'text',\n value: title,\n 'aria-invalid': errors.title ? 'true' : 'false',\n 'aria-describedby': bad === 'title' ? `${id}-error` : undefined,\n onInput: (e: Event) => draft.setValue('title', (e.target as HTMLInputElement).value),\n }),\n ]),\n field('decorative', '', [\n h('label', { class: 'pptx-radio' }, [\n h('input', {\n type: 'checkbox',\n checked: decorative,\n 'aria-describedby': `${id}-decorative-help`,\n onChange: (e: Event) =>\n draft.setValue('decorative', (e.target as HTMLInputElement).checked),\n }),\n t('imageAltText.decorative'),\n ]),\n h(\n 'p',\n { class: 'pptx-dialog__muted', id: `${id}-decorative-help` },\n t('imageAltText.decorativeHelp')\n ),\n ]),\n ]),\n h('div', { 'data-pptx-part': 'footer', class: 'pptx-dialog__footer' }, [\n h(\n 'span',\n {\n id: `${id}-error`,\n 'data-pptx-part': 'error',\n role: 'alert',\n class: 'pptx-dialog__error',\n },\n error\n ),\n h(\n 'button',\n {\n type: 'button',\n 'data-pptx-part': 'cancel',\n class: 'pptx-button',\n onClick: state.cancel,\n },\n t('dialog.cancel')\n ),\n h(\n 'button',\n {\n type: 'button',\n 'data-pptx-part': 'apply',\n class: 'pptx-button pptx-button--primary',\n disabled: !enabled.value,\n onClick: state.apply,\n },\n t('dialog.ok')\n ),\n ]),\n ]);\n return h(\n DialogFrame,\n {\n ...attrs,\n class: [attrs.class, props.className],\n style: [attrs.style, props.style],\n kind: 'imageAltText',\n label: t('imageAltText.title'),\n onClose: props.onClose,\n // Enter in the title applies, as in the other dialogs; the description takes newlines.\n onKeydown: (event: KeyboardEvent) => applyOnEnter(event, enabled.value, state.apply),\n },\n () => render(defaults, slots.default?.(), props.preset)\n );\n };\n },\n});\n\n/**\n * Alt text of the selected element: description, title, and \"Mark as decorative\", with\n * replaceable parts (`Header`, `Title`, `Body`, `Footer`, `Field`, `Error`, `Apply`, `Cancel`),\n * as React's `ImageAltTextDialog`. Renders nothing while `open` is false. @public\n */\nexport const ImageAltTextDialog = Object.assign(\n defineComponent({\n name: 'ImageAltTextDialog',\n inheritAttrs: false,\n props: imageAltTextDialogProps,\n setup(props, { attrs, slots }) {\n return () => (props.open ? h(ImageAltTextDialogOpen, { ...attrs, ...props }, slots) : null);\n },\n }),\n {\n Header: parts.Header,\n Title: parts.Title,\n Body: parts.Body,\n Footer: parts.Footer,\n Field: parts.Field,\n Error: parts.Error,\n Apply: parts.Apply,\n Cancel: parts.Cancel,\n }\n);\n\n/**\n * Read the draft of the enclosing Alt Text dialog, for a host's own field inside it. It does\n * not open the dialog: `useEditorDialog('imageAltText').open()` does. @public\n */\nexport function useImageAltTextDialog(): UseImageAltTextDialogReturn {\n return parts.useState();\n}\n","// The Format Picture dialog: the Vue twin of the React adapter's `ImagePropertiesDialog`, on\n// the same dialog parts and the same core rules (`picture-fields.ts`), so both show the same\n// fields and apply the same `setImageProperties` command. The host owns visibility (`open`,\n// `onClose`).\n\nimport {\n Fragment,\n computed,\n defineComponent,\n h,\n reactive,\n useId,\n watch,\n type CSSProperties,\n type ExtractPublicPropTypes,\n type PropType,\n type VNode,\n} from 'vue';\nimport {\n commitDialogCommand,\n picturePropertiesDraftCommand,\n picturePropertiesDraftFrom,\n picturePropertiesWithValue,\n translateDialogErrors,\n translateKeyOrText,\n validatePicturePropertiesDraft,\n} from '@pptx-editor.dev/core/editor';\nimport type { TranslationKey } from '@pptx-editor.dev/i18n';\nimport { useEditorState, usePptxEditor, useTranslation } from './composables.ts';\nimport { ToolButton } from './chrome.tsx';\nimport {\n DialogFrame,\n applyOnEnter,\n createDialogParts,\n useCloseOnNewDocument,\n useDialogDraft,\n type UseDialogReturn,\n} from './dialog-parts.ts';\n\n/** The draft of the Format Picture dialog, in inches, degrees, and percent. @public */\nexport interface ImagePropertiesDialogFields {\n /** Width in inches, on the slide (`SelectedImageState.widthEmu`). */\n readonly width: number;\n /** Height in inches, on the slide (`SelectedImageState.heightEmu`). */\n readonly height: number;\n /** Lock aspect ratio: a width change scales the height, and the other way round. */\n readonly lockAspect: boolean;\n /** Rotation in degrees, clockwise. */\n readonly rotation: number;\n /** Crop of the left edge, in percent of the image; a negative value adds space. */\n readonly cropLeft: number;\n /** Crop of the top edge, in percent of the image. */\n readonly cropTop: number;\n /** Crop of the right edge, in percent of the image. */\n readonly cropRight: number;\n /** Crop of the bottom edge, in percent of the image. */\n readonly cropBottom: number;\n}\n\n/** The Format Picture draft and its actions. @public */\nexport type UseImagePropertiesDialogReturn = UseDialogReturn<ImagePropertiesDialogFields>;\n\n/** The field names of the Format Picture dialog, for `ImagePropertiesDialog.Field`. @public */\nexport type ImagePropertiesDialogFieldName = 'size' | 'rotation' | 'crop';\n\ntype NumberField = Exclude<keyof ImagePropertiesDialogFields, 'lockAspect'>;\n/** The number fields in screen order (Height before Width), for errors and focus. */\nconst NUMBER_FIELDS: readonly NumberField[] = [\n 'height',\n 'width',\n 'rotation',\n 'cropLeft',\n 'cropTop',\n 'cropRight',\n 'cropBottom',\n];\n\n/** The label of each number field, to name the field an error is about. */\nconst FIELD_LABELS: Record<NumberField, TranslationKey> = {\n width: 'imageProperties.width',\n height: 'imageProperties.height',\n rotation: 'imageProperties.rotation',\n cropLeft: 'imageProperties.cropLeft',\n cropTop: 'imageProperties.cropTop',\n cropRight: 'imageProperties.cropRight',\n cropBottom: 'imageProperties.cropBottom',\n};\n\nconst parts = createDialogParts<UseImagePropertiesDialogReturn, ImagePropertiesDialogFieldName>(\n 'ImagePropertiesDialog'\n);\n\nconst imagePropertiesDialogProps = {\n /** Whether the dialog is shown. The host owns this state. */\n open: { type: Boolean, required: true as const },\n /** Called on Cancel, Escape, a click on the backdrop, and after OK. */\n onClose: { type: Function as PropType<() => void>, required: true as const },\n /** `false`: only the default slot, with no default arrangement. */\n preset: { type: Boolean, default: true },\n /** A class name added to the dialog surface, as React's `className` (`class` works too). */\n className: { type: String, default: undefined },\n /** Styles added to the dialog surface. */\n style: { type: Object as PropType<CSSProperties>, default: undefined },\n} as const;\n\n/** Props of `ImagePropertiesDialog`, the twin of React's `ImagePropertiesDialogProps`. @public */\nexport type ImagePropertiesDialogProps = ExtractPublicPropTypes<typeof imagePropertiesDialogProps>;\n\nconst ImagePropertiesDialogOpen = defineComponent({\n name: 'ImagePropertiesDialogOpen',\n inheritAttrs: false,\n props: imagePropertiesDialogProps,\n setup(props, { attrs, slots }) {\n const { t } = useTranslation();\n const editorRef = usePptxEditor();\n const id = useId();\n const picture = useEditorState((s) => s.image ?? null);\n // Format Picture edits one picture.\n const enabled = useEditorState(\n (s) => s.status === 'ready' && s.mode === 'edit' && s.image?.count === 1\n );\n const initial = picturePropertiesDraftFrom(picture.value);\n const exactCrop = picture.value?.crop;\n // As the React twin: the draft belongs to the picture the dialog opened on, so another\n // selection, the picture's removal, or a new document closes the dialog.\n const openedOn = picture.value?.nodeId ?? null;\n watch(\n () => picture.value?.nodeId ?? null,\n (now) => {\n if (now !== openedOn) props.onClose();\n }\n );\n useCloseOnNewDocument(() => props.onClose());\n const draft = useDialogDraft<ImagePropertiesDialogFields>({\n initial,\n validate: (values) => validatePicturePropertiesDraft(values, initial),\n commit: (values) =>\n commitDialogCommand(\n editorRef.value,\n picturePropertiesDraftCommand(values, initial, exactCrop)\n ),\n });\n const state: UseImagePropertiesDialogReturn = {\n values: draft.values,\n // The state gives messages; the raw keys stay inside, for focus.\n errors: computed(() => translateDialogErrors(t, draft.errors.value)),\n isEnabled: computed(() => enabled.value),\n // A host part's setValue takes the packaged fields' rules: Lock aspect ratio and the shown text.\n setValue: (name, value) => {\n if (name !== 'lockAspect' && typeof value === 'number') set(name, String(value));\n else draft.setValue(name, value);\n },\n apply: () => {\n if (draft.apply()) return props.onClose();\n // Focus the first field with an error (WCAG 3.3.1).\n const errors = validatePicturePropertiesDraft(draft.values.value, initial);\n const bad = NUMBER_FIELDS.find((f) => errors[f]);\n if (bad) document.getElementById(`${id}-${bad}`)?.focus();\n },\n cancel: () => props.onClose(),\n };\n // The text of each field as typed; the draft holds the numbers.\n const texts = reactive(\n Object.fromEntries(NUMBER_FIELDS.map((f) => [f, String(initial[f])])) as Record<\n NumberField,\n string\n >\n );\n const set = (field: NumberField, text: string): void => {\n const value = text.trim() === '' ? NaN : Number(text);\n texts[field] = text;\n if (field !== 'width' && field !== 'height') {\n draft.setValue(field, value);\n return;\n }\n const values = draft.values.value;\n const next = picturePropertiesWithValue(values, field, value, initial);\n const other = field === 'width' ? 'height' : 'width';\n draft.setValue('width', next.width);\n draft.setValue('height', next.height);\n if (next[other] !== values[other]) texts[other] = String(next[other]);\n };\n const render = parts.provideParts(state);\n return () => {\n const errors = draft.errors.value;\n // The first error, with the name of its field.\n const bad = NUMBER_FIELDS.find((f) => errors[f]);\n const error = bad\n ? t('imageProperties.fieldError', {\n field: t(FIELD_LABELS[bad]),\n message: translateKeyOrText(t, errors[bad]!),\n })\n : errors.form\n ? translateKeyOrText(t, errors.form)\n : '';\n // A picture locked against cropping (`noCrop`), resizing (`noResize`), or rotation\n // (`noRot`) keeps it, as in DOCX Editor: the fields are off, and one note says why.\n const cropLocked = picture.value?.canCrop === false;\n const sizeLocked = picture.value?.canResize === false;\n const rotationLocked = picture.value?.canRotate === false;\n const lockNote = (field: NumberField): string | null =>\n field.startsWith('crop')\n ? cropLocked\n ? `${id}-crop-locked`\n : null\n : field === 'rotation'\n ? rotationLocked\n ? `${id}-rotation-locked`\n : null\n : sizeLocked\n ? `${id}-size-locked`\n : null;\n const note = (\n locked: boolean,\n field: 'size' | 'crop' | 'rotation',\n key: 'disabled.sizeLocked' | 'disabled.cropLocked' | 'disabled.rotationLocked'\n ) =>\n locked\n ? h('p', { id: `${id}-${field}-locked`, class: 'pptx-dialog__muted' }, t(key))\n : null;\n const number = (field: NumberField, label: string, unit: string): VNode =>\n h('label', { class: 'pptx-field', for: `${id}-${field}` }, [\n label,\n h('span', { class: 'pptx-field__control' }, [\n h('input', {\n id: `${id}-${field}`,\n type: 'number',\n step: field === 'width' || field === 'height' ? 0.1 : 1,\n disabled: lockNote(field) !== null,\n 'aria-invalid': errors[field] ? 'true' : 'false',\n 'aria-describedby':\n [lockNote(field), errors[field] ? `${id}-error` : null].filter(Boolean).join(' ') ||\n undefined,\n value: texts[field],\n onInput: (e: Event) => set(field, (e.target as HTMLInputElement).value),\n }),\n h('span', { class: 'pptx-field__unit' }, unit),\n ]),\n ]);\n // A section with a heading is a labelled group, so a screen reader names its fields.\n const section = (\n field: ImagePropertiesDialogFieldName,\n children: (VNode | null)[],\n labelled = false\n ) =>\n h(\n 'section',\n {\n 'data-pptx-part': 'field',\n 'data-pptx-field': field,\n class: 'pptx-dialog__section',\n ...(labelled ? { role: 'group', 'aria-labelledby': `${id}-${field}` } : {}),\n },\n children\n );\n const inches = t('imageProperties.inches');\n const percent = t('imageProperties.percent');\n const defaults = h(Fragment, [\n h('div', { 'data-pptx-part': 'header', class: 'pptx-dialog__header' }, [\n h(\n 'h2',\n { 'data-pptx-part': 'title', class: 'pptx-dialog__title' },\n t('imageProperties.title')\n ),\n h(ToolButton, {\n label: t('imageProperties.close'),\n icon: 'close',\n onClick: props.onClose,\n }),\n ]),\n h('div', { 'data-pptx-part': 'body', class: 'pptx-dialog__body' }, [\n section(\n 'size',\n [\n h('h3', { id: `${id}-size`, class: 'pptx-dialog__label' }, t('imageProperties.size')),\n note(sizeLocked, 'size', 'disabled.sizeLocked'),\n h('div', { class: 'pptx-panel__grid' }, [\n number('height', t('imageProperties.height'), inches),\n number('width', t('imageProperties.width'), inches),\n ]),\n h('label', { class: 'pptx-radio' }, [\n h('input', {\n type: 'checkbox',\n checked: draft.values.value.lockAspect,\n disabled: sizeLocked,\n 'aria-describedby': sizeLocked ? `${id}-size-locked` : undefined,\n onChange: (e: Event) =>\n draft.setValue('lockAspect', (e.target as HTMLInputElement).checked),\n }),\n t('imageProperties.lockAspect'),\n ]),\n ],\n true\n ),\n section('rotation', [\n note(rotationLocked, 'rotation', 'disabled.rotationLocked'),\n h('div', { class: 'pptx-panel__grid' }, [\n number('rotation', t('imageProperties.rotation'), t('imageProperties.degrees')),\n ]),\n ]),\n section(\n 'crop',\n [\n h('h3', { id: `${id}-crop`, class: 'pptx-dialog__label' }, t('imageProperties.crop')),\n note(cropLocked, 'crop', 'disabled.cropLocked'),\n h('div', { class: 'pptx-panel__grid' }, [\n number('cropLeft', t('imageProperties.cropLeft'), percent),\n number('cropTop', t('imageProperties.cropTop'), percent),\n number('cropRight', t('imageProperties.cropRight'), percent),\n number('cropBottom', t('imageProperties.cropBottom'), percent),\n ]),\n ],\n true\n ),\n ]),\n h('div', { 'data-pptx-part': 'footer', class: 'pptx-dialog__footer' }, [\n h(\n 'span',\n {\n id: `${id}-error`,\n 'data-pptx-part': 'error',\n role: 'alert',\n class: 'pptx-dialog__error',\n },\n error\n ),\n h(\n 'button',\n {\n type: 'button',\n 'data-pptx-part': 'cancel',\n class: 'pptx-button',\n onClick: state.cancel,\n },\n t('dialog.cancel')\n ),\n h(\n 'button',\n {\n type: 'button',\n 'data-pptx-part': 'apply',\n class: 'pptx-button pptx-button--primary',\n disabled: !enabled.value,\n onClick: state.apply,\n },\n t('dialog.ok')\n ),\n ]),\n ]);\n return h(\n DialogFrame,\n {\n ...attrs,\n class: [attrs.class, props.className],\n style: [attrs.style, props.style],\n kind: 'imageProperties',\n label: t('imageProperties.title'),\n onClose: props.onClose,\n onKeydown: (event: KeyboardEvent) => applyOnEnter(event, enabled.value, state.apply),\n },\n () => render(defaults, slots.default?.(), props.preset)\n );\n };\n },\n});\n\n/**\n * Format Picture: size, rotation, and crop position of the selected picture, with replaceable\n * parts (`Header`, `Title`, `Body`, `Footer`, `Field`, `Error`, `Apply`, `Cancel`), as React's\n * `ImagePropertiesDialog`. Renders nothing while `open` is false. @public\n */\nexport const ImagePropertiesDialog = Object.assign(\n defineComponent({\n name: 'ImagePropertiesDialog',\n inheritAttrs: false,\n props: imagePropertiesDialogProps,\n setup(props, { attrs, slots }) {\n return () =>\n props.open ? h(ImagePropertiesDialogOpen, { ...attrs, ...props }, slots) : null;\n },\n }),\n {\n Header: parts.Header,\n Title: parts.Title,\n Body: parts.Body,\n Footer: parts.Footer,\n Field: parts.Field,\n Error: parts.Error,\n Apply: parts.Apply,\n Cancel: parts.Cancel,\n }\n);\n\n/**\n * Read the draft of the enclosing Format Picture dialog, for a host's own field inside it. It\n * does not open the dialog: `useEditorDialog('imageProperties').open()` does. @public\n */\nexport function useImagePropertiesDialog(): UseImagePropertiesDialogReturn {\n return parts.useState();\n}\n","/** @jsxImportSource vue */\n// The Format Background dialog (Format → Slide Background…): the Vue twin of the React\n// adapter's `BackgroundDialog`. A color, a gradient, or a picture for the current slide or\n// every slide, or back to the layout's background. Built on the dialog parts\n// (`dialog-parts.ts`): the choices write a draft, OK applies it as one undo step, and Cancel\n// discards it. The draft rules live in core (`dialog-fields.ts`, `form-dialog-support.ts`), so\n// both adapters apply the same command. The host owns visibility (`open`, `onClose`).\n\nimport {\n computed,\n defineComponent,\n h,\n ref,\n shallowRef,\n useId,\n type CSSProperties,\n type ExtractPublicPropTypes,\n type PropType,\n type VNode,\n} from 'vue';\nimport {\n BACKGROUND_GRADIENT_FALLBACK,\n backgroundDraftColor,\n backgroundDraftCommand,\n backgroundDraftFrom,\n backgroundPresetGradient,\n backgroundStatusKey,\n commitDialogCommand,\n gradientCss,\n sameBackground,\n translateDialogErrors,\n validateBackgroundDraft,\n type GradientFill,\n type SlideBackground,\n} from '@pptx-editor.dev/core/editor';\nimport { useEditorState, usePptxEditor, useTranslation } from './composables.ts';\nimport { ToolButton } from './chrome.tsx';\nimport { ColorSwatches, Swatch, SwatchGroup, useThemeBases } from './ColorSwatches.tsx';\nimport { GradientDialog } from './ShapeControls.tsx';\nimport {\n DialogFrame,\n applyOnEnter,\n createDialogParts,\n useCloseOnNewDocument,\n useDialogDraft,\n type UseDialogReturn,\n} from './dialog-parts.ts';\n\n/**\n * The draft of the Background dialog. `background` is the fill OK applies: a fill, `null` for\n * the layout's background, or `undefined` to keep the slide's own fill. @public\n */\nexport interface BackgroundDialogFields {\n /** The fill OK applies: a fill, `null` for the layout's background, `undefined` to keep the slide's own. */\n readonly background: SlideBackground | null | undefined;\n /** Apply the fill to every slide. */\n readonly allSlides: boolean;\n}\n\n/** The Background draft and its actions. @public */\nexport interface UseBackgroundDialogReturn extends UseDialogReturn<BackgroundDialogFields> {\n /** Pick the layout's background in the draft. */\n reset(): void;\n}\n\n/**\n * The field names of the Background dialog, for `BackgroundDialog.Field`: one per fill kind\n * (`SlideBackground['kind']`), and Apply to all slides. @public\n */\nexport type BackgroundDialogFieldName = 'solid' | 'gradient' | 'picture' | 'allSlides';\n\nconst IMAGE_TYPES = ['image/png', 'image/jpeg', 'image/gif'];\n\nconst parts = createDialogParts<UseBackgroundDialogReturn, BackgroundDialogFieldName>(\n 'BackgroundDialog'\n);\n\nconst backgroundDialogProps = {\n /** Whether the dialog is shown. The host owns this state. */\n open: { type: Boolean, required: true as const },\n /** Called on Cancel, Escape, a click on the backdrop, and after OK. */\n onClose: { type: Function as PropType<() => void>, required: true as const },\n /** `false`: only the default slot, with no default arrangement. */\n preset: { type: Boolean, default: true },\n /** A class name added to the dialog surface, as React's `className` (`class` works too). */\n className: { type: String, default: undefined },\n /** Styles added to the dialog surface. */\n style: { type: Object as PropType<CSSProperties>, default: undefined },\n} as const;\n\n/** Props of `BackgroundDialog`, the twin of React's `BackgroundDialogProps`. @public */\nexport type BackgroundDialogProps = ExtractPublicPropTypes<typeof backgroundDialogProps>;\n\nconst BackgroundDialogOpen = defineComponent({\n name: 'BackgroundDialogOpen',\n inheritAttrs: false,\n props: backgroundDialogProps,\n setup(props, { attrs, slots }) {\n const { t } = useTranslation();\n const editor = usePptxEditor();\n const file = ref<HTMLInputElement | null>(null);\n const current = useEditorState((s) => s.slideBackground);\n // Why OK cannot apply now, or null when it can.\n const refusal = useEditorState((s) =>\n s.status !== 'ready' ? 'disabled.noEditor' : s.mode !== 'edit' ? 'disabled.viewing' : null\n );\n const initial = backgroundDraftFrom(current.value);\n const custom = shallowRef<GradientFill | null>(null);\n // Every pick and picture read counts up, so a picture that finishes reading after a later\n // pick is dropped. `picked` turns on with a real pick (Reset too), so OK applies even a value\n // equal to the opening one; setting the opening value itself back (by identity) turns it off.\n let picks = 0;\n let picked = false;\n const draft: ReturnType<typeof useDialogDraft<BackgroundDialogFields>> = useDialogDraft({\n initial,\n validate: (values) => validateBackgroundDraft(values, initial, picked),\n resetValues: (): BackgroundDialogFields => ({\n background: null,\n allSlides: draft.values.value.allSlides,\n }),\n commit: (values) =>\n commitDialogCommand(editor.value, backgroundDraftCommand(values, initial, picked)),\n });\n const close = (): void => props.onClose();\n const state: UseBackgroundDialogReturn = {\n values: draft.values,\n errors: computed(() => translateDialogErrors(t, draft.errors.value)),\n isEnabled: computed(() => refusal.value === null),\n setValue: (name, value) => {\n // Setting the value it already has is no pick, and going back to the opening value\n // undoes the pick: OK must not write the opening snapshot.\n if (name === 'background' && !Object.is(draft.values.value.background, value)) {\n picks += 1;\n picked = !Object.is(value, initial.background);\n }\n draft.setValue(name, value);\n },\n apply: () => {\n if (draft.apply()) close();\n },\n cancel: close,\n reset: () => {\n picks += 1;\n picked = true;\n draft.reset();\n },\n };\n const render = parts.provideParts(state);\n const pick = (background: SlideBackground): void => state.setValue('background', background);\n const onFile = async (f: File | undefined): Promise<void> => {\n if (!f || !IMAGE_TYPES.includes(f.type)) return;\n const at = ++picks;\n let bytes: Uint8Array;\n try {\n bytes = new Uint8Array(await f.arrayBuffer());\n } catch {\n return; // An unreadable file picks nothing.\n }\n if (at === picks) pick({ kind: 'picture', bytes, mime: f.type });\n };\n const bases = useThemeBases();\n const errorId = useId();\n useCloseOnNewDocument(close);\n return () => {\n const values = draft.values.value;\n const errors = state.errors.value;\n const enabled = state.isEnabled.value;\n const why = refusal.value ? t(refusal.value) : undefined;\n const chosen = values.background;\n const error = errors.allSlides ?? errors.background ?? errors.form;\n const presets = bases.value.map((b) => ({\n base: b,\n gradient: backgroundPresetGradient(b.color),\n }));\n // What the draft holds, for the status line a screen reader announces. A swatch pick\n // shows as its pressed swatch instead.\n const statusKey = backgroundStatusKey(\n chosen,\n initial.background,\n presets.map((p) => p.gradient)\n );\n const defaults = (\n <>\n <div data-pptx-part=\"header\" class=\"pptx-dialog__header\">\n <h2 data-pptx-part=\"title\" class=\"pptx-dialog__title\">\n {t('background.title')}\n </h2>\n <ToolButton label={t('background.close')} icon=\"close\" onClick={close} />\n </div>\n <div data-pptx-part=\"body\" class=\"pptx-dialog__body\">\n <section data-pptx-part=\"field\" data-pptx-field=\"solid\" class=\"pptx-dialog__section\">\n <h3 class=\"pptx-dialog__label\">{t('background.color')}</h3>\n <ColorSwatches\n menu={false}\n selected={backgroundDraftColor(values)}\n onPick={(color) => pick({ kind: 'solid', color })}\n />\n </section>\n <section data-pptx-part=\"field\" data-pptx-field=\"gradient\" class=\"pptx-dialog__section\">\n <h3 class=\"pptx-dialog__label\">{t('background.gradient')}</h3>\n {presets.length ? (\n <SwatchGroup label={t('toolbar.gradients')} roving>\n {{\n default: () => (\n <>\n {presets.map(({ base: b, gradient: g }) => (\n <Swatch\n key={b.name}\n color={b.color}\n background={gradientCss(g)}\n name={t('toolbar.gradientPreset', { color: b.name })}\n menu={false}\n pressed={sameBackground(chosen, { kind: 'gradient', gradient: g })}\n onPick={() => pick({ kind: 'gradient', gradient: g })}\n />\n ))}\n </>\n ),\n }}\n </SwatchGroup>\n ) : null}\n <div class=\"pptx-gradient__row\">\n <button\n type=\"button\"\n class=\"pptx-button\"\n onClick={() => {\n custom.value =\n chosen?.kind === 'gradient'\n ? chosen.gradient\n : (current.value.gradient ??\n backgroundPresetGradient(\n bases.value[4]?.color ?? BACKGROUND_GRADIENT_FALLBACK\n ));\n }}\n >\n {t('toolbar.gradientCustom')}\n </button>\n </div>\n </section>\n <section data-pptx-part=\"field\" data-pptx-field=\"picture\" class=\"pptx-dialog__section\">\n <h3 class=\"pptx-dialog__label\">{t('background.image')}</h3>\n <div class=\"pptx-gradient__row\">\n <button type=\"button\" class=\"pptx-button\" onClick={() => file.value?.click()}>\n {t('background.chooseImage')}\n </button>\n <input\n ref={file}\n type=\"file\"\n accept={IMAGE_TYPES.join(',')}\n hidden\n onChange={(e: Event) => {\n const input = e.target as HTMLInputElement;\n void onFile(input.files?.[0]);\n input.value = '';\n }}\n />\n </div>\n </section>\n <p role=\"status\" class=\"pptx-dialog__muted pptx-dialog__status\">\n {statusKey ? t(statusKey) : ''}\n </p>\n <label data-pptx-part=\"field\" data-pptx-field=\"allSlides\" class=\"pptx-radio\">\n <input\n type=\"checkbox\"\n aria-invalid={errors.allSlides ? true : undefined}\n aria-describedby={errors.allSlides ? errorId : undefined}\n checked={values.allSlides}\n onChange={(e: Event) =>\n draft.setValue('allSlides', (e.target as HTMLInputElement).checked)\n }\n />\n {t('background.allSlides')}\n </label>\n </div>\n <div data-pptx-part=\"footer\" class=\"pptx-dialog__footer\">\n <span id={errorId} data-pptx-part=\"error\" role=\"alert\" class=\"pptx-dialog__error\">\n {error ?? null}\n </span>\n <button\n type=\"button\"\n data-pptx-part=\"reset\"\n class=\"pptx-button pptx-dialog__reset\"\n disabled={!enabled}\n title={why}\n onClick={state.reset}\n >\n {t('background.reset')}\n </button>\n <button\n type=\"button\"\n data-pptx-part=\"cancel\"\n class=\"pptx-button\"\n onClick={state.cancel}\n >\n {t('dialog.cancel')}\n </button>\n <button\n type=\"button\"\n data-pptx-part=\"apply\"\n class=\"pptx-button pptx-button--primary\"\n disabled={!enabled}\n title={why}\n onClick={state.apply}\n >\n {t('dialog.ok')}\n </button>\n </div>\n </>\n ) as VNode;\n return (\n <DialogFrame\n {...attrs}\n class={[attrs.class, props.className]}\n style={[attrs.style as CSSProperties, props.style]}\n kind=\"background\"\n label={t('background.title')}\n onClose={close}\n onKeydown={(event: KeyboardEvent) => applyOnEnter(event, enabled, state.apply)}\n >\n {{\n default: () => [\n ...render(defaults, slots.default?.(), props.preset),\n <GradientDialog\n open={custom.value !== null}\n initial={custom.value}\n onClose={() => {\n custom.value = null;\n }}\n onApply={(g: GradientFill) => {\n pick({ kind: 'gradient', gradient: g });\n custom.value = null;\n }}\n />,\n ],\n }}\n </DialogFrame>\n );\n };\n },\n});\n\n/**\n * Change the slide background, with replaceable parts (`Header`, `Title`, `Body`, `Footer`,\n * `Field`, `Error`, `Reset`, `Apply`, `Cancel`), as React's `BackgroundDialog`. Renders nothing\n * while `open` is false. @public\n */\nexport const BackgroundDialog = Object.assign(\n defineComponent({\n name: 'BackgroundDialog',\n inheritAttrs: false,\n props: backgroundDialogProps,\n setup(props, { attrs, slots }) {\n return () => (props.open ? h(BackgroundDialogOpen, { ...attrs, ...props }, slots) : null);\n },\n }),\n {\n Header: parts.Header,\n Title: parts.Title,\n Body: parts.Body,\n Footer: parts.Footer,\n Field: parts.Field,\n Error: parts.Error,\n Reset: parts.Reset,\n Apply: parts.Apply,\n Cancel: parts.Cancel,\n }\n);\n\n/**\n * Read the draft of the enclosing Background dialog, for a host's own field inside it. It does\n * not open the dialog: `useEditorDialog('background').open()` does. @public\n */\nexport function useBackgroundDialog(): UseBackgroundDialogReturn {\n return parts.useState();\n}\n","/** @jsxImportSource vue */\n// The swatch sections of every color menu and the background dialog: the deck's theme colors\n// (ten columns, each with its lighter and darker variants), the Standard Colors row, and a\n// custom color (a hex field and the browser's color selector). The Vue twin of the React\n// adapter's `ColorSwatches.tsx`, on the same core rules (`chrome-forms.ts`, `color-fields.ts`).\n\nimport {\n computed,\n defineComponent,\n onMounted,\n onUpdated,\n ref,\n shallowRef,\n type ComputedRef,\n type PropType,\n} from 'vue';\nimport {\n STANDARD_COLORS,\n customHexColor,\n customHexCurrent,\n customHexDraft,\n customHexSeed,\n swatchGridKeyDown,\n swatchName,\n swatchSelection,\n syncSwatchTabStops,\n themeBaseSwatches,\n themeSwatchChoice,\n type ColorChoice,\n} from '@pptx-editor.dev/core/editor';\nimport { useEditorState, useTranslation } from './composables.ts';\n\n/** One named swatch. In a menu it is a `menuitem`; in a dialog, a button that shows its state. @internal */\nexport const Swatch = defineComponent({\n name: 'PptxSwatch',\n props: {\n color: { type: String, required: true as const },\n name: { type: String, required: true as const },\n menu: { type: Boolean, required: true as const },\n pressed: { type: Boolean, default: undefined },\n /** CSS background when it is not the color itself (a gradient preview). */\n background: { type: String, default: undefined },\n onPick: { type: Function as PropType<() => void>, required: true as const },\n },\n setup(props) {\n return () => (\n <button\n type=\"button\"\n class=\"pptx-swatch\"\n style={{ background: props.background ?? props.color }}\n aria-label={props.name}\n data-pptx-tooltip={props.name}\n // In a menu the current color is marked with `aria-current`; in a dialog it is pressed.\n {...(props.menu\n ? { role: 'menuitem', tabindex: -1, ...(props.pressed ? { 'aria-current': true } : {}) }\n : { 'aria-pressed': !!props.pressed })}\n onClick={props.onPick}\n />\n );\n },\n});\n\n/**\n * A labelled swatch section; `columns` lets the menu's arrow keys move by row. With `roving`\n * (a dialog), the section is one Tab stop, on the chosen swatch or the first, and the arrow\n * keys move by column and row, as a WAI-ARIA grid of buttons does. @internal\n */\nexport const SwatchGroup = defineComponent({\n name: 'PptxSwatchGroup',\n props: {\n label: { type: String, required: true as const },\n columns: { type: Number, default: 10 },\n className: { type: String, default: undefined },\n roving: { type: Boolean, default: false },\n },\n setup(props, { slots }) {\n const grid = ref<HTMLDivElement | null>(null);\n // After each render: the focused swatch keeps the stop, else the chosen one, else the first.\n const sync = (): void => {\n if (props.roving) syncSwatchTabStops(grid.value);\n };\n onMounted(sync);\n onUpdated(sync);\n return () => (\n <div role=\"group\" aria-label={props.label} class=\"pptx-swatches__section\">\n <p class=\"pptx-swatches__title\" aria-hidden=\"true\">\n {props.label}\n </p>\n <div\n ref={grid}\n class={`pptx-swatches${props.className ? ` ${props.className}` : ''}`}\n data-columns={props.columns}\n onKeydown={(e: KeyboardEvent) => {\n if (props.roving) swatchGridKeyDown(grid.value, e, props.columns);\n }}\n >\n {slots.default?.()}\n </div>\n </div>\n );\n },\n});\n\n/**\n * The Custom Color section, as React's `CustomColor`: a hex field with Apply, and the browser's\n * color selector, which applies when it closes. In a menu, the fields join the arrow keys\n * (`data-menu-field`) and Apply is a row. @internal\n */\nexport const CustomColor = defineComponent({\n name: 'PptxCustomColor',\n props: {\n onPick: { type: Function as PropType<(color: string) => void>, required: true as const },\n menu: { type: Boolean, required: true as const },\n selected: {\n type: [String, Object] as PropType<ColorChoice | null>,\n default: undefined,\n },\n },\n setup(props) {\n const { t } = useTranslation();\n const draft = shallowRef(customHexSeed(props.selected));\n // An empty field shows the current color: as its placeholder and in the selector.\n const rows = useEditorState((s) => s.themeColors);\n const apply = (): void => {\n const color = customHexColor(draft.value);\n if (color) props.onPick(color);\n };\n return () => {\n const color = customHexColor(draft.value);\n const current = customHexCurrent(props.selected, rows.value);\n const label = t('colors.customColor');\n return (\n <div role=\"group\" aria-label={label} class=\"pptx-swatches__section\">\n <p class=\"pptx-swatches__title\" aria-hidden=\"true\">\n {label}\n </p>\n <div class=\"pptx-custom-color\">\n <input\n type=\"color\"\n class=\"pptx-custom-color__picker\"\n aria-label={t('colors.customPicker')}\n data-menu-field=\"\"\n tabindex={props.menu ? -1 : undefined}\n value={(color ?? `#${current}`).toLowerCase()}\n // `input` follows the selector while it moves; `change` applies the color it closed on.\n onInput={(e: Event) => {\n draft.value = customHexDraft((e.target as HTMLInputElement).value);\n }}\n onChange={(e: Event) => {\n const picked = customHexColor((e.target as HTMLInputElement).value);\n if (picked) props.onPick(picked);\n }}\n />\n <span class=\"pptx-custom-color__hash\" aria-hidden=\"true\">\n #\n </span>\n <input\n type=\"text\"\n class=\"pptx-custom-color__hex\"\n aria-label={t('colors.customHex')}\n data-menu-field=\"\"\n tabindex={props.menu ? -1 : undefined}\n placeholder={current}\n maxlength={6}\n spellcheck={false}\n autocomplete=\"off\"\n value={draft.value}\n onInput={(e: Event) => {\n const el = e.target as HTMLInputElement;\n draft.value = customHexDraft(el.value);\n // Keep the field to what the draft holds, as React's controlled field does.\n el.value = draft.value;\n }}\n onKeydown={(e: KeyboardEvent) => {\n if (e.key !== 'Enter') return;\n // The Enter that applies is this field's: a dialog does not apply on it too.\n e.preventDefault();\n e.stopPropagation();\n apply();\n }}\n />\n <button\n type=\"button\"\n class=\"pptx-button pptx-custom-color__apply\"\n {...(props.menu ? { role: 'menuitem', tabindex: -1 } : {})}\n disabled={!color}\n onClick={apply}\n >\n {t('colors.customApply')}\n </button>\n </div>\n </div>\n );\n };\n },\n});\n\n/**\n * The theme colors and the standard colors. A theme swatch picks a theme color, which the\n * engine writes as `a:schemeClr`; a standard swatch and a custom color pick their `#RRGGBB`.\n * `onPick` also gets the color as rendered. `selected` marks the current color. @internal\n */\nexport const ColorSwatches = defineComponent({\n name: 'PptxColorSwatches',\n props: {\n onPick: {\n type: Function as PropType<(choice: ColorChoice, color: string) => void>,\n required: true as const,\n },\n menu: { type: Boolean, default: true },\n selected: {\n type: [String, Object] as PropType<ColorChoice | null>,\n default: undefined,\n },\n },\n setup(props) {\n const { t } = useTranslation();\n const rows = useEditorState((s) => s.themeColors);\n return () => {\n const isSelected = swatchSelection(props.selected, rows.value);\n return [\n rows.value.length ? (\n <SwatchGroup\n label={t('colors.themeColors')}\n className=\"pptx-swatches--theme\"\n roving={!props.menu}\n >\n {{\n default: () =>\n rows.value.flatMap((row, r) =>\n row.map((s, c) => (\n <Swatch\n key={`${r}-${c}`}\n color={s.color}\n name={swatchName(t, s)}\n menu={props.menu}\n pressed={isSelected(s.color, s.slot, s.shift)}\n onPick={() => props.onPick(themeSwatchChoice(s), s.color)}\n />\n ))\n ),\n }}\n </SwatchGroup>\n ) : null,\n <SwatchGroup label={t('colors.standardColors')} roving={!props.menu}>\n {{\n default: () =>\n STANDARD_COLORS.map((s) => (\n <Swatch\n key={s.name}\n color={s.color}\n name={t(`colors.standard.${s.name}`)}\n menu={props.menu}\n pressed={isSelected(s.color)}\n onPick={() => props.onPick(s.color, s.color)}\n />\n )),\n }}\n </SwatchGroup>,\n <CustomColor\n menu={props.menu}\n selected={props.selected}\n onPick={(color: string) => props.onPick(color, color)}\n />,\n ];\n };\n },\n});\n\n/** What `useThemeBases` returns: the ten theme colors with their names. @internal */\nexport type UseThemeBasesReturn = ComputedRef<readonly { color: string; name: string }[]>;\n\n/** The ten theme colors (the grid's first row), for gradient presets. @internal */\nexport function useThemeBases(): UseThemeBasesReturn {\n const { t } = useTranslation();\n const first = useEditorState((s) => s.themeColors[0]);\n return computed(() => themeBaseSwatches(t, first.value));\n}\n","/** @jsxImportSource vue */\n// Shape controls: the insert-shape gallery (previews drawn by the engine's own geometry), the\n// fill menu (theme colors and gradients), the custom gradient dialog, and the line menus. The Vue\n// twin of the React adapter's `ShapeControls.tsx`: the same markup, classes, ARIA, and keys, on\n// the same core rules (`insert-controls.ts`, `shape-gallery.ts`, `palette.ts`).\n\nimport {\n computed,\n defineComponent,\n onMounted,\n ref,\n shallowRef,\n watch,\n type ExtractPublicPropTypes,\n type PropType,\n} from 'vue';\nimport {\n dialogInitialFocus,\n colorMenuSelection,\n SHAPE_GALLERY,\n CROP_SHAPE_GALLERY,\n LINE_GLYPH_STROKE,\n defaultFillChoice,\n gradientAddStop,\n gradientAngleFrom,\n gradientCss,\n gradientDialogStart,\n gradientHandleKey,\n gradientPosAt,\n gradientRemoveStop,\n gradientSetStop,\n lineGlyphParts,\n lineGlyphTransform,\n lineSlotEnd,\n presetGradient,\n shapePreview,\n translateKeyOrText,\n type ChromeControl,\n type ChromeSlotId,\n type ColorChoice,\n type GradientFill,\n} from '@pptx-editor.dev/core/editor';\nimport type { TranslationKey } from '@pptx-editor.dev/i18n';\nimport {\n Icon,\n MenuItem,\n Popover,\n ToolButton,\n focusText,\n keepFocus,\n useAriaDisabled,\n} from './chrome.tsx';\nimport { useEditorState, usePptxEditor, useTranslation } from './composables.ts';\nimport { useSlot } from './slot.ts';\nimport { useTriggerAttributes } from './slot-override.ts';\nimport { ColorSwatches, Swatch, SwatchGroup, useThemeBases } from './ColorSwatches.tsx';\n\n/** The props every slot renderer takes: the slot id and its registry entry. */\nconst slotPartProps = {\n slot: { type: String as PropType<ChromeSlotId>, required: true as const },\n control: { type: Object as PropType<ChromeControl>, required: true as const },\n} as const;\n\nconst shapeIconProps = { preset: { type: String, required: true as const } } as const;\n\n/** The props of `ShapeIcon`, the twin of React's `ShapeIconProps`. @public */\nexport type ShapeIconProps = ExtractPublicPropTypes<typeof shapeIconProps>;\n\n/** A preset's preview, drawn from its spec geometry. @public */\nexport const ShapeIcon = defineComponent({\n name: 'ShapeIcon',\n props: shapeIconProps,\n setup(props) {\n return () => {\n const preview = shapePreview(props.preset);\n if (!preview) return null;\n return (\n <svg viewBox={preview.viewBox} class=\"pptx-shape-icon\" aria-hidden=\"true\">\n {preview.paths.map((p, i) => (\n <path\n key={i}\n d={p.d}\n class={p.fill ? 'pptx-shape-icon__fill' : undefined}\n fill={p.fill ? undefined : 'none'}\n stroke={p.stroke ? 'currentColor' : 'none'}\n vector-effect=\"non-scaling-stroke\"\n />\n ))}\n </svg>\n );\n };\n },\n});\n\nconst shapeGridProps = {\n presets: { type: Array as PropType<readonly string[]>, required: true as const },\n /** Called with the picked preset, as React's `onPick`. */\n onPick: { type: Function as PropType<(preset: string) => void>, required: true as const },\n} as const;\n\n/** The props of `ShapeGrid`, the twin of React's `ShapeGridProps`. @public */\nexport type ShapeGridProps = ExtractPublicPropTypes<typeof shapeGridProps>;\n\n/**\n * One gallery category's presets as a grid of previews drawn from their spec geometry. Each\n * preview is a `menuitem`; the arrow keys move by grid rows (`data-columns`). A pick calls\n * `onPick` with the preset. @public\n */\nexport const ShapeGrid = defineComponent({\n name: 'ShapeGrid',\n props: shapeGridProps,\n setup(props) {\n const { t } = useTranslation();\n return () => (\n <div class=\"pptx-shape-gallery__grid\" data-columns={8}>\n {props.presets.map((preset) => {\n const name = translateKeyOrText(t, `shapes.${preset}`);\n return (\n <button\n key={preset}\n type=\"button\"\n role=\"menuitem\"\n tabindex={-1}\n class=\"pptx-shape-gallery__item\"\n aria-label={name}\n data-pptx-tooltip={name}\n onClick={() => props.onPick(preset)}\n >\n <ShapeIcon preset={preset} />\n </button>\n );\n })}\n </div>\n );\n },\n});\n\n/** The props of `ShapeGalleryControl`, the twin of React's `ShapeGalleryControlProps`. @public */\nexport type ShapeGalleryControlProps = ExtractPublicPropTypes<typeof slotPartProps>;\n\n/** The insert-shape gallery: every category, every preset as its own preview. @public */\nexport const ShapeGalleryControl = defineComponent({\n name: 'ShapeGalleryControl',\n props: slotPartProps,\n setup(props) {\n const { cmd, label, reason, tip } = useSlot(\n () => props.slot,\n () => props.control\n );\n const off = useAriaDisabled(() => !cmd.isEnabled.value, reason);\n const { t } = useTranslation();\n const anchor = ref<HTMLButtonElement | null>(null);\n const open = ref(false);\n const trigger = useTriggerAttributes(\n props.slot,\n 'pptx-toolbar__button pptx-toolbar__button--wide',\n () => ({ disabled: !cmd.isEnabled.value })\n );\n return () => [\n <button\n ref={anchor}\n type=\"button\"\n {...trigger()}\n data-slot={props.slot}\n aria-label={label.value}\n aria-haspopup=\"menu\"\n aria-expanded={open.value}\n {...tip.value}\n {...off.attrs.value}\n onMousedown={keepFocus}\n onClick={() => (open.value = !open.value)}\n >\n <Icon paths={props.control.paths} />\n <Icon name=\"arrow_drop_down\" className=\"pptx-icon pptx-toolbar__caret\" />\n </button>,\n off.note(),\n open.value ? (\n <Popover anchor={anchor.value} onClose={() => (open.value = false)}>\n {{\n default: () => (\n <>\n <div class=\"pptx-shape-gallery\">\n {/* A picture is cropped to shapes with an inside: lines are left out (core). */}\n {(props.slot === 'image.cropToShape' ? CROP_SHAPE_GALLERY : SHAPE_GALLERY).map(\n (category) => (\n <section\n key={category.id}\n class=\"pptx-shape-gallery__section\"\n role=\"group\"\n aria-label={t(category.labelKey as TranslationKey)}\n >\n <h3 class=\"pptx-shape-gallery__title\" aria-hidden=\"true\">\n {t(category.labelKey as TranslationKey)}\n </h3>\n <ShapeGrid\n presets={category.presets}\n onPick={(preset: string) => {\n cmd.execute(preset);\n open.value = false;\n }}\n />\n </section>\n )\n )}\n </div>\n </>\n ),\n }}\n </Popover>\n ) : null,\n ];\n },\n});\n\n/** The props of `FillControl`, the twin of React's `FillControlProps`. @public */\nexport type FillControlProps = ExtractPublicPropTypes<typeof slotPartProps>;\n\n/**\n * Fill color: one menu with the theme and standard colors, Transparent, gradient presets from\n * the theme colors, and a custom gradient dialog. @public\n */\nexport const FillControl = defineComponent({\n name: 'FillControl',\n props: slotPartProps,\n setup(props) {\n const { cmd, label, reason, tip } = useSlot(\n () => props.slot,\n () => props.control\n );\n const off = useAriaDisabled(() => !cmd.isEnabled.value, reason);\n const editor = usePptxEditor();\n const { t } = useTranslation();\n const current = useEditorState((s) => s.geometry?.gradient);\n // The solid fill of the selection, marked in the menu.\n const selected = useEditorState((s) => colorMenuSelection(props.slot, s));\n const bases = useThemeBases();\n const anchor = ref<HTMLButtonElement | null>(null);\n const open = ref(false);\n const picked = shallowRef<{ choice: ColorChoice; color: string } | null>(null);\n // Before a pick, the button applies the theme's Accent 1, the default fill of a new shape.\n const last = computed<{ choice: ColorChoice; color: string }>(\n () => picked.value ?? defaultFillChoice(bases.value[4]?.color)\n );\n const dialog = shallowRef<GradientFill | null>(null);\n const applyGradient = (g: GradientFill): void => {\n editor.value?.exec({ type: 'setShapeGradient', gradient: g });\n };\n const done = (): void => {\n focusText(editor.value, anchor.value);\n open.value = false;\n };\n return () => (\n <span class=\"pptx-toolbar__group\">\n <ToolButton\n slot={props.slot}\n label={label.value}\n paths={props.control.paths}\n disabled={!cmd.isEnabled.value}\n disabledReason={reason.value}\n onClick={() => cmd.execute(last.value.choice)}\n >\n {{\n default: () => (\n <>\n <span class=\"pptx-toolbar__swatch\" style={{ background: last.value.color }} />\n </>\n ),\n }}\n </ToolButton>\n <button\n ref={anchor}\n type=\"button\"\n class=\"pptx-toolbar__button pptx-toolbar__step\"\n aria-label={label.value}\n aria-haspopup=\"menu\"\n aria-expanded={open.value}\n {...tip.value}\n {...off.attrs.value}\n onMousedown={keepFocus}\n onClick={() => (open.value = !open.value)}\n >\n <Icon name=\"arrow_drop_down\" className=\"pptx-icon pptx-toolbar__caret\" />\n </button>\n {off.note()}\n {open.value ? (\n <Popover anchor={anchor.value} label={label.value} onClose={() => (open.value = false)}>\n {{\n default: () => (\n <>\n <ColorSwatches\n selected={selected.value}\n onPick={(choice: ColorChoice, color: string) => {\n picked.value = { choice, color };\n cmd.execute(choice);\n done();\n }}\n />\n <MenuItem onSelect={() => (cmd.execute(null), done())}>\n {{ default: () => t('toolbar.transparent') }}\n </MenuItem>\n <div class=\"pptx-menu__sep\" />\n {bases.value.length ? (\n <SwatchGroup label={t('toolbar.gradients')}>\n {{\n default: () => (\n <>\n {bases.value.map((b) => {\n const g = presetGradient(b.color, 0.35, 0.35);\n return (\n <Swatch\n key={b.name}\n color={b.color}\n background={gradientCss(g)}\n name={t('toolbar.gradientPreset', { color: b.name })}\n menu\n onPick={() => (applyGradient(g), done())}\n />\n );\n })}\n </>\n ),\n }}\n </SwatchGroup>\n ) : null}\n <MenuItem\n onSelect={() => {\n dialog.value = current.value ?? presetGradient(last.value.color, 0.35, 0.35);\n open.value = false;\n }}\n >\n {{\n default: () => (\n <>\n <Icon name=\"add\" />\n {t('toolbar.gradientCustom')}\n </>\n ),\n }}\n </MenuItem>\n </>\n ),\n }}\n </Popover>\n ) : null}\n <GradientDialog\n open={dialog.value !== null}\n initial={dialog.value}\n onClose={() => (dialog.value = null)}\n onApply={(g: GradientFill) => {\n applyGradient(g);\n dialog.value = null;\n }}\n />\n </span>\n );\n },\n});\n\nconst gradientDialogProps = {\n /** Whether the dialog is shown. The host owns this state. */\n open: { type: Boolean, required: true as const },\n /** The gradient the dialog starts from. */\n initial: { type: Object as PropType<GradientFill | null>, default: null },\n /** Called on Cancel, Escape, and a click on the backdrop. */\n onClose: { type: Function as PropType<() => void>, required: true as const },\n /** Called by OK with the gradient. */\n onApply: {\n type: Function as PropType<(gradient: GradientFill) => void>,\n required: true as const,\n },\n} as const;\n\n/** Props of `GradientDialog`, the twin of React's `GradientDialogProps`. @public */\nexport type GradientDialogProps = ExtractPublicPropTypes<typeof gradientDialogProps>;\n\n/**\n * The custom gradient dialog: type, angle, stops, rotation, and a preview. Calls `onClose`,\n * and `onApply` with the gradient. @public\n */\nexport const GradientDialog = defineComponent({\n name: 'GradientDialog',\n props: gradientDialogProps,\n setup(props) {\n const { t } = useTranslation();\n const dialogEl = ref<HTMLDialogElement | null>(null);\n const bar = ref<HTMLDivElement | null>(null);\n const g = shallowRef<GradientFill>(gradientDialogStart(props.initial));\n const selected = ref(0);\n let dragging: number | null = null;\n const onClose = (): void => props.onClose();\n // Open and close the modal with `open`, after the element is in the document.\n const sync = (): void => {\n const el = dialogEl.value;\n if (!el) return;\n if (props.open) {\n g.value = gradientDialogStart(props.initial);\n selected.value = 0;\n if (!el.open) el.showModal();\n // The first field takes focus, as in every dialog, not the Close button.\n dialogInitialFocus(el)?.focus({ preventScroll: true });\n } else if (el.open) el.close();\n };\n onMounted(sync);\n watch(() => [props.open, props.initial] as const, sync, { flush: 'post' });\n const setStop = (i: number, patch: Partial<{ pos: number; color: string }>): void => {\n g.value = gradientSetStop(g.value, i, patch);\n };\n const add = (): void => {\n const next = gradientAddStop(g.value, selected.value);\n g.value = next.gradient;\n selected.value = next.selected;\n };\n const remove = (): void => {\n const next = gradientRemoveStop(g.value, selected.value);\n g.value = next.gradient;\n selected.value = next.selected;\n };\n const body = () => {\n const cur = g.value;\n const stop = cur.stops[Math.min(selected.value, cur.stops.length - 1)]!;\n return [\n <div class=\"pptx-dialog__header\">\n <h2 id=\"pptx-gradient-title\" class=\"pptx-dialog__title\">\n {t('gradient.title')}\n </h2>\n <ToolButton label={t('gradient.close')} icon=\"close\" onClick={onClose} />\n </div>,\n <div class=\"pptx-dialog__body\">\n <div class=\"pptx-gradient__top\">\n <div class=\"pptx-gradient__fields\">\n <div class=\"pptx-gradient__row\">\n <label class=\"pptx-field\">\n {t('gradient.type')}\n <select\n value={cur.kind}\n onChange={(e: Event) => {\n const v = (e.target as HTMLSelectElement).value;\n g.value = { ...g.value, kind: v === 'radial' ? 'radial' : 'linear' };\n }}\n >\n <option value=\"linear\">{t('gradient.linear')}</option>\n <option value=\"radial\">{t('gradient.radial')}</option>\n </select>\n </label>\n <label class=\"pptx-field\">\n {t('gradient.angle')}\n <span class=\"pptx-field__control\">\n <input\n type=\"number\"\n min={0}\n max={359}\n step={1}\n value={Math.round(cur.angle)}\n disabled={cur.kind === 'radial'}\n onInput={(e: Event) => {\n const angle = gradientAngleFrom((e.target as HTMLInputElement).value);\n if (angle !== null) g.value = { ...g.value, angle };\n }}\n />\n <span class=\"pptx-field__unit\">°</span>\n </span>\n </label>\n </div>\n <div class=\"pptx-dialog__section\">\n <h3 class=\"pptx-dialog__label\">{t('gradient.stops')}</h3>\n <div class=\"pptx-gradient__row\">\n <button type=\"button\" class=\"pptx-button\" onClick={add}>\n {t('gradient.add')}\n </button>\n <button\n type=\"button\"\n class=\"pptx-button\"\n onClick={remove}\n disabled={cur.stops.length <= 2}\n >\n {t('gradient.remove')}\n </button>\n <input\n type=\"color\"\n class=\"pptx-gradient__color\"\n aria-label={t('gradient.stopColor')}\n value={stop.color.toLowerCase()}\n onInput={(e: Event) =>\n setStop(selected.value, {\n color: (e.target as HTMLInputElement).value.toUpperCase(),\n })\n }\n />\n </div>\n </div>\n <label class=\"pptx-radio\">\n <input\n type=\"checkbox\"\n checked={cur.rotWithShape}\n onChange={(e: Event) => {\n g.value = { ...g.value, rotWithShape: (e.target as HTMLInputElement).checked };\n }}\n />\n {t('gradient.rotate')}\n </label>\n </div>\n <div class=\"pptx-dialog__section\">\n <h3 class=\"pptx-dialog__label\">{t('gradient.preview')}</h3>\n <div class=\"pptx-gradient__preview\" style={{ background: gradientCss(cur) }} />\n </div>\n </div>\n <div\n ref={bar}\n class=\"pptx-gradient__bar\"\n style={{ background: gradientCss({ ...cur, kind: 'linear', angle: 0 }) }}\n >\n {cur.stops.map((s, i) => (\n <button\n key={i}\n type=\"button\"\n class=\"pptx-gradient__handle\"\n aria-label={t('gradient.stopHandle', { percent: Math.round(s.pos * 100) })}\n aria-pressed={i === selected.value}\n style={{ left: `${s.pos * 100}%`, background: s.color }}\n onPointerdown={(e: PointerEvent) => {\n selected.value = i;\n dragging = i;\n (e.currentTarget as Element).setPointerCapture(e.pointerId);\n }}\n onPointermove={(e: PointerEvent) => {\n if (dragging !== null)\n setStop(dragging, {\n pos: gradientPosAt(bar.value?.getBoundingClientRect(), e.clientX),\n });\n }}\n onPointerup={() => (dragging = null)}\n onKeydown={(e: KeyboardEvent) => {\n const pos = gradientHandleKey(e.key, e.shiftKey, s.pos);\n if (pos !== null) setStop(i, { pos });\n }}\n />\n ))}\n </div>\n </div>,\n <div class=\"pptx-dialog__footer\">\n <button type=\"button\" class=\"pptx-button\" onClick={onClose}>\n {t('gradient.cancel')}\n </button>\n <button\n type=\"button\"\n class=\"pptx-button pptx-button--primary\"\n onClick={() => props.onApply(g.value)}\n >\n {t('gradient.ok')}\n </button>\n </div>,\n ];\n };\n return () => (\n <dialog\n ref={dialogEl}\n class=\"pptx-dialog pptx-gradient\"\n data-pptx-dialog=\"gradient\"\n aria-labelledby=\"pptx-gradient-title\"\n onCancel={(e: Event) => {\n e.preventDefault();\n onClose();\n }}\n onClick={(e: MouseEvent) => {\n if (e.target === e.currentTarget) onClose();\n }}\n >\n {props.open ? body() : null}\n </dialog>\n );\n },\n});\n\nconst lineGlyphProps = {\n value: { type: String, required: true as const },\n start: { type: Boolean, default: undefined },\n} as const;\n\n/** The props of `LineGlyph`, the twin of React's `LineGlyphProps`. @public */\nexport type LineGlyphProps = ExtractPublicPropTypes<typeof lineGlyphProps>;\n\n/** Glyphs for line kinds and line ends, drawn at the right of a 48×24 box. @public */\nexport const LineGlyph = defineComponent({\n name: 'LineGlyph',\n props: lineGlyphProps,\n setup(props) {\n const stroke = {\n fill: LINE_GLYPH_STROKE.fill,\n stroke: LINE_GLYPH_STROKE.stroke,\n 'stroke-width': LINE_GLYPH_STROKE.strokeWidth,\n 'stroke-linecap': LINE_GLYPH_STROKE.strokeLinecap,\n };\n const solid = { fill: 'currentColor', stroke: 'none' };\n return () => (\n <svg class=\"pptx-line-glyph\" viewBox=\"0 0 48 24\" aria-hidden=\"true\">\n <g transform={lineGlyphTransform(props.start)}>\n {lineGlyphParts(props.value, props.start).map((p, i) =>\n p.kind === 'dot' ? (\n <circle key={i} cx={p.cx} cy={p.cy} r={p.r} {...solid} />\n ) : p.kind === 'solid' ? (\n <path key={i} d={p.d} {...solid} />\n ) : (\n <path\n key={i}\n d={p.d}\n {...stroke}\n {...(p.join ? { 'stroke-linejoin': 'round' } : {})}\n />\n )\n )}\n </g>\n </svg>\n );\n },\n});\n\n/** The props of `LineMenuControl`, the twin of React's `LineMenuControlProps`. @public */\nexport type LineMenuControlProps = ExtractPublicPropTypes<typeof slotPartProps>;\n\n/** The line tool and the line start and end menus, with each option drawn. @public */\nexport const LineMenuControl = defineComponent({\n name: 'LineMenuControl',\n props: slotPartProps,\n setup(props) {\n const { cmd, label, reason, tip } = useSlot(\n () => props.slot,\n () => props.control\n );\n const off = useAriaDisabled(() => !cmd.isEnabled.value, reason);\n const editor = usePptxEditor();\n const { t } = useTranslation();\n const anchor = ref<HTMLButtonElement | null>(null);\n const open = ref(false);\n const isLine = useEditorState((s) => s.geometry?.lineHead !== undefined);\n const trigger = useTriggerAttributes(\n props.slot,\n 'pptx-toolbar__button pptx-toolbar__button--wide',\n () => ({ disabled: !cmd.isEnabled.value })\n );\n return () => {\n // Line ends draw on the side they belong to; the line tool shows its kinds.\n const start = lineSlotEnd(props.slot);\n const shown = String(cmd.value.value ?? (start === undefined ? 'line' : 'none'));\n // Line ends are contextual: they show only while a line is selected.\n if (start !== undefined && !isLine.value) return null;\n const end = start !== undefined ? { start } : {};\n return [\n <button\n ref={anchor}\n type=\"button\"\n {...trigger()}\n data-slot={props.slot}\n aria-label={label.value}\n aria-haspopup=\"menu\"\n aria-expanded={open.value}\n {...tip.value}\n {...off.attrs.value}\n onMousedown={keepFocus}\n onClick={() => (open.value = !open.value)}\n >\n <LineGlyph value={shown} {...end} />\n <Icon name=\"arrow_drop_down\" className=\"pptx-icon pptx-toolbar__caret\" />\n </button>,\n off.note(),\n open.value ? (\n <Popover anchor={anchor.value} onClose={() => (open.value = false)}>\n {{\n default: () => (\n <>\n {props.control.options?.map((o) => (\n <MenuItem\n key={o.value}\n // Line ends are a choice with a current value; the line tool inserts a kind.\n {...(props.control.toggle === 'choice'\n ? { checked: o.value === cmd.value.value }\n : {})}\n onSelect={() => {\n cmd.execute(o.value);\n focusText(editor.value, anchor.value);\n open.value = false;\n }}\n >\n {{\n default: () => (\n <>\n <LineGlyph value={o.value} {...end} />\n {t(o.labelKey as TranslationKey)}\n </>\n ),\n }}\n </MenuItem>\n ))}\n </>\n ),\n }}\n </Popover>\n ) : null,\n ];\n };\n },\n});\n","// One chrome slot as a control sees it: the engine's command state, the registry's label, and\n// the tooltip that names the engine's reason when the control is disabled. The Vue twin of the\n// React adapter's `slot.ts`.\n\nimport { computed, toValue, type ComputedRef, type MaybeRefOrGetter } from 'vue';\nimport {\n tooltipAttributes,\n translateKeyOrText,\n type ChromeControl,\n type ChromeSlotId,\n type ChromeTooltipAttributes,\n} from '@pptx-editor.dev/core/editor';\nimport { useEditorCommand, useTranslation, type UseEditorCommandReturn } from './composables.ts';\n\n/** Props of every slot part: the slot id and its registry entry. @internal */\nexport interface SlotPartProps {\n readonly slot: ChromeSlotId;\n readonly control: ChromeControl;\n}\n\n/** What `useSlot` returns. @internal */\nexport interface UseSlotReturn {\n readonly cmd: UseEditorCommandReturn;\n readonly label: ComputedRef<string>;\n readonly reason: ComputedRef<string | null>;\n readonly tip: ComputedRef<ChromeTooltipAttributes>;\n}\n\n/** A slot's command, its translated label, and its tooltip attributes (with the reason when disabled). @internal */\nexport function useSlot(\n slot: MaybeRefOrGetter<ChromeSlotId>,\n control: MaybeRefOrGetter<ChromeControl>\n): UseSlotReturn {\n const cmd = useEditorCommand(slot);\n const { t } = useTranslation();\n const label = computed(() => t(toValue(control).labelKey));\n const reason = computed(() =>\n cmd.disabledReason.value ? translateKeyOrText(t, cmd.disabledReason.value) : null\n );\n const tip = computed(() => tooltipAttributes(label.value, !cmd.isEnabled.value, reason.value));\n return { cmd, label, reason, tip };\n}\n","/** @jsxImportSource vue */\n// The Paragraph dialog (Format > Paragraph…, Line Spacing Options…, or the text context menu):\n// the Vue twin of the React adapter's `ParagraphDialog`. Alignment, indentation before text\n// with a first-line or hanging indent, spacing before and after, and line spacing. The fields\n// seed from the selection when the dialog opens; a field the selected paragraphs disagree about\n// opens blank. OK sends only the fields that changed as ONE `setParagraphFormat` command, so the\n// dialog is one undo step. The form model is core's (`paragraph-dialog-fields.ts`). The host\n// owns visibility (`open`, `onClose`).\n\nimport {\n defineComponent,\n h,\n type CSSProperties,\n type ExtractPublicPropTypes,\n type PropType,\n} from 'vue';\nimport {\n lineAtFor,\n paragraphCommandOf,\n paragraphDialogError,\n paragraphFieldError,\n seedParagraphFields,\n specialByFor,\n withSpaceUnit,\n type LineRule,\n type ParagraphAlignment,\n type ParagraphDialogFields,\n type SpacingUnit,\n type SpecialIndent,\n} from '@pptx-editor.dev/core/editor';\nimport { useEditorState, useTranslation } from './composables.ts';\nimport { createDialogParts, type UseDialogReturn } from './dialog-parts.ts';\nimport {\n FormDialog,\n FormSection,\n NumberField,\n SelectField,\n fieldPart,\n formDialogState,\n type FormDialogParts,\n} from './dialog-form.tsx';\nimport { useFormDraft } from './form-draft.ts';\n\n/**\n * The field names of the Paragraph dialog, for `ParagraphDialog.Field`: a section (`general`,\n * `indentation`, `spacing`) or one field in it, named as its `ParagraphDialogFields` key. A\n * spacing field holds its unit list. @public\n */\nexport type ParagraphDialogFieldName =\n | 'general'\n | 'indentation'\n | 'spacing'\n | 'alignment'\n | 'indentLeft'\n | 'special'\n | 'specialBy'\n | 'spaceBefore'\n | 'spaceAfter'\n | 'lineRule'\n | 'lineAt';\n\n/** The Paragraph draft and its actions, for a host's own field inside the dialog. @public */\nexport type UseParagraphDialogReturn = UseDialogReturn<ParagraphDialogFields>;\n\nconst parts: FormDialogParts<ParagraphDialogFieldName, ParagraphDialogFields> = createDialogParts<\n UseParagraphDialogReturn,\n ParagraphDialogFieldName\n>('ParagraphDialog');\n\nconst ALIGNMENTS: readonly ParagraphAlignment[] = [\n 'left',\n 'center',\n 'right',\n 'justify',\n 'distributed',\n];\nconst SPECIALS: readonly SpecialIndent[] = ['none', 'firstLine', 'hanging'];\nconst LINE_RULES: readonly LineRule[] = ['single', 'onePointFive', 'double', 'exact', 'multiple'];\n\nconst paragraphDialogProps = {\n /** Whether the dialog is shown. The host owns this state. */\n open: { type: Boolean, required: true as const },\n /** Called on Cancel, Escape, a click on the backdrop, and after OK applies. */\n onClose: { type: Function as PropType<() => void>, required: true as const },\n /** `false`: only the default slot, with no default arrangement. */\n preset: { type: Boolean, default: true },\n /** A class name added to the dialog surface, as React's `className` (`class` works too). */\n className: { type: String, default: undefined },\n /** Styles added to the dialog surface. */\n style: { type: Object as PropType<CSSProperties>, default: undefined },\n} as const;\n\n/** Props of `ParagraphDialog`, the twin of React's `ParagraphDialogProps`. @public */\nexport type ParagraphDialogProps = ExtractPublicPropTypes<typeof paragraphDialogProps>;\n\nconst ParagraphDialogOpen = defineComponent({\n name: 'ParagraphDialogOpen',\n inheritAttrs: false,\n props: paragraphDialogProps,\n setup(props, { attrs, slots }) {\n const { t } = useTranslation();\n const current = useEditorState((s) => s.format?.paragraph ?? null);\n const editable = useEditorState((s) => s.status === 'ready' && s.mode === 'edit');\n const seed = seedParagraphFields(current.value);\n const draft = useFormDraft<ParagraphDialogFields>({\n seed,\n problem: (values) => {\n const problem = paragraphFieldError(seed, values);\n return problem ? paragraphDialogError(t, problem) : null;\n },\n command: (values) => {\n const command = paragraphCommandOf(seed, values);\n return command ? { type: 'setParagraphFormat', ...command } : null;\n },\n });\n const state = formDialogState({ draft, isEnabled: editable, onClose: () => props.onClose() });\n const set = draft.setValue;\n const spacing = (side: 'Before' | 'After', d: ParagraphDialogFields, mixed: string) => {\n const key = `space${side}` as const;\n const unitKey = `space${side}Unit` as const;\n return (\n <div {...fieldPart(key)} class=\"pptx-field__pair\">\n <NumberField\n name={key}\n label={t(`paragraphDialog.fields.${key}`)}\n unit=\"\"\n step={d[unitKey] === 'pt' ? '6' : '0.1'}\n min=\"0\"\n placeholder={seed[key] === '' ? mixed : undefined}\n value={d[key]}\n onChange={(v: string) => set(key, v)}\n />\n <SelectField\n name={unitKey}\n label={t('paragraphDialog.unitOf', { field: t(`paragraphDialog.fields.${key}`) })}\n hideLabel\n value={d[unitKey]}\n options={(['pt', 'lines'] as const).map(\n (u) => [u, t(`paragraphDialog.units.${u}`)] as const\n )}\n onChange={(u: SpacingUnit) => draft.update((cur) => withSpaceUnit(cur, seed, key, u))}\n />\n </div>\n );\n };\n return () => {\n const d = draft.values.value;\n const mixed = t('paragraphDialog.mixed');\n const inch = t('paragraphDialog.units.in');\n return (\n <FormDialog\n {...attrs}\n name=\"paragraph\"\n className={props.className}\n style={props.style}\n preset={props.preset}\n parts={parts}\n state={state as UseDialogReturn<object>}\n title={t('paragraphDialog.title')}\n okLabel={t('paragraphDialog.ok')}\n cancelLabel={t('paragraphDialog.cancel')}\n closeLabel={t('paragraphDialog.close')}\n >\n {{\n default: () => [\n <FormSection {...fieldPart('general')} title={t('paragraphDialog.general')}>\n {{\n default: () => (\n <>\n <SelectField\n {...fieldPart('alignment')}\n name=\"alignment\"\n label={t('paragraphDialog.fields.alignment')}\n mixed={mixed}\n value={d.alignment}\n options={ALIGNMENTS.map(\n (a) => [a, t(`paragraphDialog.align.${a}`)] as const\n )}\n onChange={(v: ParagraphDialogFields['alignment']) => set('alignment', v)}\n />\n </>\n ),\n }}\n </FormSection>,\n <FormSection {...fieldPart('indentation')} title={t('paragraphDialog.indentation')}>\n {{\n default: () => (\n <>\n <div class=\"pptx-dialog__grid\">\n <NumberField\n {...fieldPart('indentLeft')}\n name=\"indentLeft\"\n label={t('paragraphDialog.fields.indentLeft')}\n unit={inch}\n step=\"0.1\"\n min=\"0\"\n placeholder={seed.indentLeft === '' ? mixed : undefined}\n value={d.indentLeft}\n onChange={(v: string) => set('indentLeft', v)}\n />\n <SelectField\n {...fieldPart('special')}\n name=\"special\"\n label={t('paragraphDialog.fields.special')}\n mixed={mixed}\n value={d.special}\n options={SPECIALS.map(\n (s) => [s, t(`paragraphDialog.specials.${s}`)] as const\n )}\n onChange={(v: SpecialIndent) =>\n draft.update((cur) => ({\n ...cur,\n special: v,\n specialBy: specialByFor(v, cur),\n }))\n }\n />\n <NumberField\n {...fieldPart('specialBy')}\n name=\"specialBy\"\n label={t('paragraphDialog.fields.specialBy')}\n unit={inch}\n step=\"0.1\"\n min=\"0\"\n placeholder={seed.specialBy === '' ? mixed : undefined}\n disabled={d.special === 'none' || d.special === ''}\n value={d.specialBy}\n onChange={(v: string) => set('specialBy', v)}\n />\n </div>\n </>\n ),\n }}\n </FormSection>,\n <FormSection {...fieldPart('spacing')} title={t('paragraphDialog.spacing')}>\n {{\n default: () => (\n <>\n <div class=\"pptx-dialog__rows\">\n {spacing('Before', d, mixed)}\n {spacing('After', d, mixed)}\n <div class=\"pptx-field__pair\">\n <SelectField\n {...fieldPart('lineRule')}\n name=\"lineRule\"\n label={t('paragraphDialog.fields.lineRule')}\n mixed={mixed}\n value={d.lineRule}\n options={LINE_RULES.map(\n (r) => [r, t(`paragraphDialog.lineRules.${r}`)] as const\n )}\n onChange={(rule: LineRule) =>\n draft.update((cur) => ({\n ...cur,\n lineRule: rule,\n lineAt: lineAtFor(rule, cur),\n }))\n }\n />\n <NumberField\n {...fieldPart('lineAt')}\n name=\"lineAt\"\n label={t('paragraphDialog.fields.lineAt')}\n unit={d.lineRule === 'exact' ? t('paragraphDialog.units.pt') : ''}\n step={d.lineRule === 'exact' ? '1' : '0.1'}\n min=\"0\"\n placeholder={seed.lineAt === '' ? mixed : undefined}\n disabled={d.lineRule !== 'exact' && d.lineRule !== 'multiple'}\n value={d.lineAt}\n onChange={(v: string) => set('lineAt', v)}\n />\n </div>\n </div>\n </>\n ),\n }}\n </FormSection>,\n ],\n host: () => slots.default?.(),\n }}\n </FormDialog>\n );\n };\n },\n});\n\n/**\n * Format > Paragraph: alignment, indents, spacing, and line spacing of the selected paragraphs,\n * applied as one undo step, with replaceable parts (`Header`, `Title`, `Body`, `Footer`,\n * `Field`, `Error`, `Apply`, `Cancel`), as React's `ParagraphDialog`. Renders nothing while\n * `open` is false. @public\n */\nexport const ParagraphDialog = Object.assign(\n defineComponent({\n name: 'ParagraphDialog',\n inheritAttrs: false,\n props: paragraphDialogProps,\n setup(props, { attrs, slots }) {\n return () => (props.open ? h(ParagraphDialogOpen, { ...attrs, ...props }, slots) : null);\n },\n }),\n {\n Header: parts.Header,\n Title: parts.Title,\n Body: parts.Body,\n Footer: parts.Footer,\n Field: parts.Field,\n Error: parts.Error,\n Apply: parts.Apply,\n Cancel: parts.Cancel,\n }\n);\n\n/**\n * Read the draft of the enclosing Paragraph dialog, for a host's own field inside it. It does\n * not open the dialog: `useEditorDialog('paragraph').open()` does. @public\n */\nexport function useParagraphDialog(): UseParagraphDialogReturn {\n return parts.useState();\n}\n","/** @jsxImportSource vue */\n// Shared parts of the form dialogs (Paragraph, Font, Bullets, and Columns): the Vue twin of the\n// React adapter's `dialog-form.tsx`. The modal frame with OK and Cancel sits on the dialog named\n// parts (`dialog-parts.ts`), the draft is core's (`useDialogDraft` over `createDialogDraft`),\n// and the number, text, select, and check fields carry a unit, a \"Mixed\" blank, and an error\n// state, with the same markup and classes as React. Internal: each dialog exports its own parts.\n//\n// A form dialog renders its open component only while open (as `PageSetupDialog` does), so the\n// draft seeds once when the dialog opens and never while it is open.\n\nimport {\n computed,\n defineComponent,\n onMounted,\n ref,\n toValue,\n useId,\n watch,\n watchEffect,\n type CSSProperties,\n type MaybeRefOrGetter,\n type PropType,\n type VNode,\n} from 'vue';\nimport {\n cssFontFamily,\n fieldPart as coreFieldPart,\n formPanelId,\n formTabId,\n formTabStep,\n markDialogError,\n translateDialogErrors,\n type DialogError,\n} from '@pptx-editor.dev/core/editor';\nimport { ToolButton } from './chrome.tsx';\nimport { useEditorState, useTranslation } from './composables.ts';\nimport {\n DialogFrame,\n applyOnEnter,\n useCloseOnNewDocument,\n useDialogDraft,\n type DialogParts,\n type UseDialogReturn,\n} from './dialog-parts.ts';\n\nexport type { DialogError };\n\n/** The named parts a form dialog exposes: `createDialogParts` over its draft. @internal */\nexport type FormDialogParts<Name extends string, D extends object> = DialogParts<\n UseDialogReturn<D>,\n Name\n>;\n\n/**\n * The draft and actions a form dialog hands to its parts, in the shape of DOCX Editor's\n * `UseDialogReturn`: core's draft as refs, its errors translated, and Apply that closes the\n * dialog when the document took the draft. Call it in the open dialog's setup. @internal\n */\nexport function formDialogState<D extends object>(args: {\n readonly draft: ReturnType<typeof useDialogDraft<D>>;\n readonly isEnabled: MaybeRefOrGetter<boolean>;\n readonly onClose: () => void;\n}): UseDialogReturn<D> {\n const { t } = useTranslation();\n const { draft } = args;\n // A dialog closes when its editor opens another document, as the React twin's do.\n useCloseOnNewDocument(() => args.onClose());\n return {\n values: draft.values,\n errors: computed(() => translateDialogErrors(t, draft.errors.value)),\n isEnabled: computed(() => toValue(args.isEnabled)),\n setValue: draft.setValue,\n apply: () => {\n if (draft.apply()) args.onClose();\n },\n cancel: () => args.onClose(),\n };\n}\n\n/** The first error a form dialog shows: a field's, else the form's. @internal */\nfunction firstError(errors: Readonly<Record<string, string | undefined>>): DialogError | null {\n for (const [field, message] of Object.entries(errors))\n if (typeof message === 'string' && field !== 'form') return { message, field };\n return typeof errors.form === 'string' ? { message: errors.form } : null;\n}\n\n/**\n * The modal frame of a form dialog on the dialog named parts (`dialog-parts.ts`): `Header`,\n * `Title`, `Body`, `Footer`, `Field` (each section with a `name`), `Error`, `Apply`, and\n * `Cancel`, each replaceable by a host child, as in DOCX Editor. The default slot holds the\n * dialog's fields; the `host` slot holds the host's named parts and extra content. @internal\n */\nexport const FormDialog = defineComponent({\n name: 'PptxFormDialog',\n props: {\n /** `data-pptx-dialog`: the registry key. */\n name: { type: String, required: true as const },\n /** A host class, after `pptx-dialog`. */\n className: { type: String, default: undefined },\n style: { type: Object as PropType<CSSProperties>, default: undefined },\n title: { type: String, required: true as const },\n okLabel: { type: String, required: true as const },\n cancelLabel: { type: String, required: true as const },\n /** The accessible name of the header's close button. */\n closeLabel: { type: String, required: true as const },\n /** The dialog's parts, and the draft they read. */\n parts: {\n // Any dialog's parts: each names its own fields and draft.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type: Object as PropType<Pick<FormDialogParts<string, any>, 'provideParts'>>,\n required: true as const,\n },\n state: { type: Object as PropType<UseDialogReturn<object>>, required: true as const },\n /** `false`: only the host's content (`preset` of `DialogCustomizationProps`). */\n preset: { type: Boolean, default: true },\n },\n setup(props, { attrs, slots }) {\n const { t } = useTranslation();\n const viewing = useEditorState((s) => s.mode === 'view');\n const errorId = useId();\n const anchor = ref<HTMLElement | null>(null);\n const render = props.parts.provideParts(props.state);\n const error = computed(() => firstError(props.state.errors.value));\n // Mark the field the error names, tie it to the message, and move focus there. The dialog\n // carries `data-invalid` while an error shows, for host styles.\n watch(error, (now) => markDialogError(anchor.value?.closest('dialog'), now, errorId), {\n flush: 'post',\n });\n return () => {\n const { state } = props;\n const enabled = state.isEnabled.value;\n const defaults: VNode = (\n <>\n <div data-pptx-part=\"header\" class=\"pptx-dialog__header\">\n <h2 data-pptx-part=\"title\" class=\"pptx-dialog__title\">\n {props.title}\n </h2>\n <ToolButton label={props.closeLabel} icon=\"close\" onClick={state.cancel} />\n </div>\n <div data-pptx-part=\"body\" class=\"pptx-dialog__body\">\n {slots.default?.()}\n </div>\n <div data-pptx-part=\"footer\" class=\"pptx-dialog__footer\">\n <span id={errorId} data-pptx-part=\"error\" role=\"alert\" class=\"pptx-dialog__error\">\n {error.value?.message ?? null}\n </span>\n <button\n type=\"button\"\n data-pptx-part=\"cancel\"\n class=\"pptx-button\"\n onClick={state.cancel}\n >\n {props.cancelLabel}\n </button>\n <button\n type=\"button\"\n data-pptx-part=\"apply\"\n class=\"pptx-button pptx-button--primary\"\n disabled={!enabled}\n // A disabled OK says why, as every disabled control does.\n title={\n enabled ? undefined : t(viewing.value ? 'disabled.viewing' : 'disabled.noEditor')\n }\n onClick={state.apply}\n >\n {props.okLabel}\n </button>\n </div>\n </>\n ) as VNode;\n return (\n <DialogFrame\n {...attrs}\n class={[attrs.class, props.className]}\n style={[attrs.style as CSSProperties, props.style]}\n kind={props.name}\n label={props.title}\n onClose={state.cancel}\n onKeydown={(event: KeyboardEvent) => applyOnEnter(event, enabled, state.apply)}\n >\n {{\n default: () => [\n <span ref={anchor} hidden />,\n ...render(defaults, slots.host?.(), props.preset),\n ],\n }}\n </DialogFrame>\n );\n };\n },\n});\n\n/**\n * The markers that make a `FormSection` or one field the dialog's `Field` part of `name`. They\n * go on the element itself, where the dialog parts find them. @internal\n */\nexport const fieldPart = coreFieldPart;\n\n/**\n * A titled group of fields: a fieldset with its legend. With `fieldPart(name)`, it is the\n * dialog's `Field` part of that name. Other attributes (`data-*`, `style`) reach the fieldset.\n * @internal\n */\nexport const FormSection = defineComponent({\n name: 'PptxFormSection',\n props: {\n title: { type: String, required: true as const },\n className: { type: String, default: undefined },\n },\n setup(props, { slots }) {\n return () => (\n <fieldset class={['pptx-dialog__section', props.className].filter(Boolean).join(' ')}>\n <legend class=\"pptx-dialog__label\">{props.title}</legend>\n {slots.default?.()}\n </fieldset>\n );\n },\n});\n\n/**\n * Mark a field component as a dialog control: its `Field` part has no single element to give\n * `asChild` to, so a host's own content replaces the whole field. @internal\n */\nexport function dialogControl<T extends object>(component: T): T {\n return Object.assign(component, { dialogControl: true });\n}\n\nconst fieldClass = (base: string, className: string | undefined): string =>\n [base, className].filter(Boolean).join(' ');\n\n/** Focus `input` on mount when `autoFocus` is set, as React's `autoFocus`. */\nfunction useAutoFocus(input: { value: HTMLElement | null }, autoFocus: () => boolean): void {\n onMounted(() => {\n if (autoFocus()) input.value?.focus();\n });\n}\n\n/**\n * A number field with its unit inside the box. An empty value shows `placeholder`. Other\n * attributes (`data-*`, `aria-*`, `style`, `id`, `title`) reach the outer label. @internal\n */\nexport const NumberField = dialogControl(\n defineComponent({\n name: 'PptxNumberField',\n props: {\n name: { type: String, required: true as const },\n label: { type: String, required: true as const },\n unit: { type: String, required: true as const },\n step: { type: String, required: true as const },\n min: { type: String, default: undefined },\n max: { type: String, default: undefined },\n value: { type: String, required: true as const },\n placeholder: { type: String, default: undefined },\n disabled: { type: Boolean, default: false },\n autoFocus: { type: Boolean, default: false },\n className: { type: String, default: undefined },\n onChange: { type: Function as PropType<(value: string) => void>, required: true as const },\n },\n setup(props) {\n const input = ref<HTMLInputElement | null>(null);\n useAutoFocus(input, () => props.autoFocus);\n return () => (\n <label class={fieldClass('pptx-field', props.className)}>\n {props.label}\n {props.unit ? <span class=\"pptx-visually-hidden\"> ({props.unit})</span> : null}\n <span class=\"pptx-field__control\">\n <input\n ref={input}\n name={props.name}\n type=\"number\"\n inputmode=\"decimal\"\n step={props.step}\n min={props.min}\n max={props.max}\n // A disabled field shows no number and no placeholder.\n placeholder={props.disabled ? undefined : props.placeholder}\n disabled={props.disabled}\n autofocus={props.autoFocus || undefined}\n value={props.disabled ? '' : props.value}\n onInput={(e: Event) => props.onChange((e.target as HTMLInputElement).value)}\n />\n {props.unit ? (\n <span class=\"pptx-field__unit\" aria-hidden=\"true\">\n {props.unit}\n </span>\n ) : null}\n </span>\n </label>\n );\n },\n })\n);\n\n/** A one-line text field with its label. @internal */\nexport const TextField = defineComponent({\n name: 'PptxTextField',\n props: {\n name: { type: String, required: true as const },\n label: { type: String, required: true as const },\n value: { type: String, required: true as const },\n disabled: { type: Boolean, default: false },\n /** Show the text in this font (a bullet character in its bullet font). */\n font: { type: String, default: undefined },\n /**\n * What the text shows as, inside the box at its end: a symbol font's character as its\n * Unicode twin, which reads the same where the symbol font is not installed.\n */\n preview: { type: String, default: undefined },\n className: { type: String, default: undefined },\n onChange: { type: Function as PropType<(value: string) => void>, required: true as const },\n },\n setup(props) {\n return () => (\n <label class={fieldClass('pptx-field', props.className)}>\n {props.label}\n <span class=\"pptx-field__control\">\n <input\n name={props.name}\n type=\"text\"\n spellcheck={false}\n disabled={props.disabled}\n value={props.value}\n style={props.font ? { fontFamily: cssFontFamily(props.font) } : undefined}\n onInput={(e: Event) => props.onChange((e.target as HTMLInputElement).value)}\n />\n {props.preview && !props.disabled ? (\n <span class=\"pptx-field__unit\" aria-hidden=\"true\" data-preview=\"\">\n {props.preview}\n </span>\n ) : null}\n </span>\n </label>\n );\n },\n});\n\n/**\n * A select with its label. `options` are value and label pairs. With `mixed`, an empty value\n * shows as that label (the selection disagrees and nothing is chosen yet). @internal\n */\nexport const SelectField = dialogControl(\n defineComponent({\n name: 'PptxSelectField',\n props: {\n name: { type: String, required: true as const },\n label: { type: String, required: true as const },\n /** Keep the label for screen readers only (a unit list beside its number). */\n hideLabel: { type: Boolean, default: false },\n value: { type: String, required: true as const },\n options: {\n type: Array as PropType<readonly (readonly [string, string])[]>,\n required: true as const,\n },\n mixed: { type: String, default: undefined },\n disabled: { type: Boolean, default: false },\n autoFocus: { type: Boolean, default: false },\n className: { type: String, default: undefined },\n // The value type is the caller's: Vue has no generic components over runtime props.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange: { type: Function as PropType<(value: any) => void>, required: true as const },\n },\n setup(props) {\n const select = ref<HTMLSelectElement | null>(null);\n useAutoFocus(select, () => props.autoFocus);\n return () => (\n <label class={fieldClass('pptx-field', props.className)}>\n {props.hideLabel ? <span class=\"pptx-visually-hidden\">{props.label}</span> : props.label}\n <select\n ref={select}\n name={props.name}\n value={props.value}\n disabled={props.disabled}\n autofocus={props.autoFocus || undefined}\n onChange={(e: Event) => props.onChange((e.target as HTMLSelectElement).value)}\n >\n {props.value === '' && props.mixed !== undefined ? (\n <option value=\"\" disabled>\n {props.mixed}\n </option>\n ) : null}\n {props.options.map(([value, label]) => (\n <option key={value} value={value}>\n {label}\n </option>\n ))}\n </select>\n </label>\n );\n },\n })\n);\n\n/**\n * The tabs of a form dialog, with the ARIA tabs pattern: a labelled tab list, one tab in the Tab\n * order, the arrow keys, Home, and End to move, and each tab tied to its panel. @internal\n */\nexport const FormTabs = defineComponent({\n name: 'PptxFormTabs',\n props: {\n label: { type: String, required: true as const },\n /** Prefix for the tab and panel ids (`useId()`). */\n idBase: { type: String, required: true as const },\n tabs: {\n type: Array as PropType<readonly (readonly [string, string])[]>,\n required: true as const,\n },\n value: { type: String, required: true as const },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange: { type: Function as PropType<(tab: any) => void>, required: true as const },\n },\n setup(props) {\n const move = (e: KeyboardEvent): void => {\n const ids = props.tabs.map(([id]) => id);\n const next = formTabStep(e.key, ids.indexOf(props.value), ids.length);\n if (next < 0) return;\n e.preventDefault();\n const tab = ids[next]!;\n props.onChange(tab);\n (e.currentTarget as HTMLElement).querySelector<HTMLElement>(`[data-tab=\"${tab}\"]`)?.focus();\n };\n return () => (\n <div class=\"pptx-segmented\" role=\"tablist\" aria-label={props.label} onKeydown={move}>\n {props.tabs.map(([id, label]) => (\n <button\n key={id}\n id={formTabId(props.idBase, id)}\n type=\"button\"\n role=\"tab\"\n aria-selected={props.value === id}\n aria-controls={formPanelId(props.idBase, id)}\n tabindex={props.value === id ? 0 : -1}\n data-tab={id}\n onClick={() => props.onChange(id)}\n >\n {label}\n </button>\n ))}\n </div>\n );\n },\n});\n\n/** The panel of the selected tab. @internal */\nexport const FormTabPanel = defineComponent({\n name: 'PptxFormTabPanel',\n props: {\n idBase: { type: String, required: true as const },\n tab: { type: String, required: true as const },\n /** A tab that is not shown: it keeps its space (`.pptx-dialog__panels`) but is hidden. */\n inactive: { type: Boolean, default: false },\n },\n setup(props, { slots }) {\n return () => (\n <div\n role=\"tabpanel\"\n id={formPanelId(props.idBase, props.tab)}\n aria-labelledby={formTabId(props.idBase, props.tab)}\n class=\"pptx-dialog__rows\"\n {...(props.inactive ? { 'data-inactive': '', 'aria-hidden': true } : {})}\n >\n {slots.default?.()}\n </div>\n );\n },\n});\n\n/** A checkbox with a mixed state (the selected text disagrees), shown as indeterminate. @internal */\nexport const CheckField = dialogControl(\n defineComponent({\n name: 'PptxCheckField',\n props: {\n name: { type: String, required: true as const },\n label: { type: String, required: true as const },\n value: { type: [Boolean, String] as PropType<boolean | 'mixed'>, required: true as const },\n className: { type: String, default: undefined },\n onChange: { type: Function as PropType<(on: boolean) => void>, required: true as const },\n },\n setup(props) {\n const input = ref<HTMLInputElement | null>(null);\n watchEffect(\n () => {\n if (input.value) input.value.indeterminate = props.value === 'mixed';\n },\n { flush: 'post' }\n );\n return () => (\n <label class={fieldClass('pptx-radio', props.className)}>\n <input\n ref={input}\n type=\"checkbox\"\n name={props.name}\n checked={props.value === true}\n onChange={(e: Event) => props.onChange((e.target as HTMLInputElement).checked)}\n />\n {props.label}\n </label>\n );\n },\n })\n);\n","// The draft of the Paragraph, Font, Bullets and Numbering, and Columns dialogs: the Vue twin of\n// the React adapter's form `useDialogDraft` (`dialog-form.tsx`). It seeds once, when the\n// dialog's open component mounts, on core's draft (`createDialogDraft`), and it behaves as the\n// React draft: any edit clears the error, a field problem names the field to mark, and a\n// refused command keeps the dialog open with the engine's reason. Internal.\n\nimport { shallowRef, type ShallowRef } from 'vue';\nimport {\n formCommandRejection,\n type DialogError,\n type DialogErrors,\n type EditorCommand,\n} from '@pptx-editor.dev/core/editor';\nimport { usePptxEditor, useTranslation } from './composables.ts';\nimport { useDialogDraft } from './dialog-parts.ts';\n\n/** A form dialog's draft over its seed, with the React draft's error rules. @internal */\nexport interface FormDraft<D extends object> {\n /** The values the dialog opened with. */\n readonly seed: D;\n readonly values: ShallowRef<D>;\n /** The error shown, per field `name` (`form` for the whole draft). */\n readonly errors: ShallowRef<DialogErrors<D>>;\n setValue<K extends keyof D>(name: K, value: D[K]): void;\n /** Change several fields at once (a pair of controls over one value). */\n update(change: (draft: D) => D): void;\n /** Hide the error (a tab change), as React's `setError(null)`. */\n clearErrors(): void;\n apply(): boolean;\n reset(): void;\n}\n\n/**\n * The draft of a form dialog. `problem` is the first field OK cannot apply, or null; `command`\n * is what OK sends, or null when nothing changed (OK then only closes). @internal\n */\nexport function useFormDraft<D extends object>(options: {\n readonly seed: D;\n readonly problem: (values: D) => DialogError | null;\n readonly command: (values: D) => EditorCommand | null;\n}): FormDraft<D> {\n const { t } = useTranslation();\n const editor = usePptxEditor();\n const base = useDialogDraft<D>({\n initial: options.seed,\n commit: (values) => {\n const command = options.command(values);\n if (!command) return { ok: true };\n const refused = formCommandRejection(t, editor.value?.exec(command));\n return refused === null ? { ok: true } : { ok: false, reason: refused };\n },\n });\n const none = {} as DialogErrors<D>;\n // The errors of the last OK; any edit clears them, as in the React twin.\n const errors = shallowRef<DialogErrors<D>>(none);\n const clearErrors = (): void => {\n if (errors.value !== none) errors.value = none;\n };\n return {\n seed: options.seed,\n values: base.values,\n errors,\n setValue(name, value) {\n base.setValue(name, value);\n clearErrors();\n },\n update(change) {\n const now = base.values.value;\n const next = change(now);\n for (const key of Object.keys(next) as (keyof D)[])\n if (!Object.is(now[key], next[key])) base.setValue(key, next[key]);\n clearErrors();\n },\n clearErrors,\n apply() {\n const problem = options.problem(base.values.value);\n if (problem) {\n errors.value = { [problem.field ?? 'form']: problem.message } as DialogErrors<D>;\n return false;\n }\n const ok = base.apply();\n errors.value = ok ? none : base.errors.value;\n return ok;\n },\n reset() {\n base.reset();\n clearErrors();\n },\n };\n}\n","/** @jsxImportSource vue */\n// The Font dialog (Format > Font…, the text context menu's Font…, or Character Spacing > More\n// Spacing…): the Vue twin of the React adapter's `FontDialog`. The Font tab (Latin font, style,\n// size; font color, underline style and underline color; effects with the offset) and the\n// Character Spacing tab (spacing and kerning). The fields seed from the selected text when the\n// dialog opens; a field the selected runs disagree about opens blank, and a checkbox opens\n// mixed. OK sends only the fields that changed as ONE `setFontFormat` command, so the dialog is\n// one undo step. The form model is core's (`font-dialog-fields.ts`). The host owns visibility\n// (`open`, `onClose`).\n\nimport {\n defineComponent,\n h,\n ref,\n useId,\n type CSSProperties,\n type ExtractPublicPropTypes,\n type PropType,\n} from 'vue';\nimport {\n UNDERLINE_STYLES,\n fontCommandOf,\n fontDialogError,\n fontDialogFamilies,\n fontFieldError,\n seedFontFields,\n takeDialogSection,\n withExclusive,\n withScript,\n withSpacing,\n type ColorPick,\n type FontDialogFields,\n type FontDialogTab,\n type FontStyleChoice,\n type SpacingChoice,\n} from '@pptx-editor.dev/core/editor';\nimport { useEditorState, usePptxEditor, useTranslation } from './composables.ts';\nimport { createDialogParts, type UseDialogReturn } from './dialog-parts.ts';\nimport { ColorField } from './dialog-color.tsx';\nimport {\n CheckField,\n FormDialog,\n FormSection,\n FormTabPanel,\n FormTabs,\n NumberField,\n SelectField,\n fieldPart,\n formDialogState,\n type FormDialogParts,\n} from './dialog-form.tsx';\nimport { useFormDraft } from './form-draft.ts';\n\n/**\n * The field names of the Font dialog, for `FontDialog.Field`: a section of the Font tab\n * (`allText`, `effects`) or one field, named as its `FontDialogFields` key, on either tab.\n * @public\n */\nexport type FontDialogFieldName =\n | 'allText'\n | 'effects'\n | 'fontFamily'\n | 'style'\n | 'size'\n | 'color'\n | 'underline'\n | 'underlineColor'\n | 'strike'\n | 'doubleStrike'\n | 'superscript'\n | 'offset'\n | 'subscript'\n | 'smallCaps'\n | 'allCaps'\n | 'spacing'\n | 'by'\n | 'kerning'\n | 'kerningAt';\n\n/** The Font draft and its actions, for a host's own field inside the dialog. @public */\nexport type UseFontDialogReturn = UseDialogReturn<FontDialogFields>;\n\nconst parts: FormDialogParts<FontDialogFieldName, FontDialogFields> = createDialogParts<\n UseFontDialogReturn,\n FontDialogFieldName\n>('FontDialog');\n\nconst STYLES: readonly FontStyleChoice[] = ['regular', 'italic', 'bold', 'boldItalic'];\nconst SPACINGS: readonly SpacingChoice[] = ['normal', 'expanded', 'condensed'];\n\nconst fontDialogProps = {\n /** Whether the dialog is shown. The host owns this state. */\n open: { type: Boolean, required: true as const },\n /** Called on Cancel, Escape, a click on the backdrop, and after OK applies. */\n onClose: { type: Function as PropType<() => void>, required: true as const },\n /** `false`: only the default slot, with no default arrangement. */\n preset: { type: Boolean, default: true },\n /** A class name added to the dialog surface, as React's `className` (`class` works too). */\n className: { type: String, default: undefined },\n /** Styles added to the dialog surface. */\n style: { type: Object as PropType<CSSProperties>, default: undefined },\n} as const;\n\n/** Props of `FontDialog`, the twin of React's `FontDialogProps`. @public */\nexport type FontDialogProps = ExtractPublicPropTypes<typeof fontDialogProps>;\n\nconst FontDialogOpen = defineComponent({\n name: 'FontDialogOpen',\n inheritAttrs: false,\n props: fontDialogProps,\n setup(props, { attrs, slots }) {\n const { t } = useTranslation();\n const editor = usePptxEditor();\n const idBase = useId();\n const current = useEditorState((s) => s.format?.font ?? null);\n const textColor = useEditorState((s) => s.format?.color ?? null);\n const editable = useEditorState((s) => s.status === 'ready' && s.mode === 'edit');\n // Character Spacing > More Spacing… opens the dialog on its spacing tab.\n const tab = ref<FontDialogTab>(\n takeDialogSection(editor.value, 'font') === 'spacing' ? 'spacing' : 'font'\n );\n const seed = seedFontFields(current.value);\n const draft = useFormDraft<FontDialogFields>({\n seed,\n problem: (values) => {\n const problem = fontFieldError(seed, values);\n if (!problem) return null;\n // Show the field's tab first, so the error can mark and focus the field.\n tab.value = problem.tab;\n return fontDialogError(t, problem);\n },\n command: (values) => {\n const command = fontCommandOf(seed, values);\n return command ? { ...command, type: 'setFontFormat' } : null;\n },\n });\n const state = formDialogState({ draft, isEnabled: editable, onClose: () => props.onClose() });\n const set = draft.setValue;\n return () => {\n const d = draft.values.value;\n const mixed = t('fontDialog.mixed');\n const pt = t('fontDialog.points');\n const families = fontDialogFamilies(d.fontFamily, editor.value?.fontFamilies() ?? []);\n const blank = (k: 'size' | 'offset' | 'by' | 'kerningAt') =>\n seed[k] === '' ? mixed : undefined;\n return (\n <FormDialog\n {...attrs}\n name=\"font\"\n className={props.className}\n style={props.style}\n preset={props.preset}\n parts={parts}\n state={state as UseDialogReturn<object>}\n title={t('fontDialog.title')}\n okLabel={t('fontDialog.ok')}\n cancelLabel={t('fontDialog.cancel')}\n closeLabel={t('fontDialog.close')}\n >\n {{\n default: () => [\n <FormTabs\n label={t('fontDialog.title')}\n idBase={idBase}\n tabs={(['font', 'spacing'] as const).map(\n (id) => [id, t(`fontDialog.tabs.${id}`)] as const\n )}\n value={tab.value}\n onChange={(next: FontDialogTab) => {\n tab.value = next;\n draft.clearErrors();\n }}\n />,\n // Both tabs share one cell, so the dialog keeps its size when the tab changes.\n <div class=\"pptx-dialog__panels\">\n <FormTabPanel idBase={idBase} tab=\"font\" inactive={tab.value !== 'font'}>\n {{\n default: () => (\n <>\n <div class=\"pptx-dialog__grid\">\n <SelectField\n {...fieldPart('fontFamily')}\n name=\"fontFamily\"\n label={t('fontDialog.fields.fontFamily')}\n autoFocus\n mixed={mixed}\n value={d.fontFamily}\n options={families.map((f) => [f, f] as const)}\n onChange={(v: string) => set('fontFamily', v)}\n />\n <SelectField\n {...fieldPart('style')}\n name=\"style\"\n label={t('fontDialog.fields.style')}\n mixed={mixed}\n value={d.style}\n options={STYLES.map((s) => [s, t(`fontDialog.styles.${s}`)] as const)}\n onChange={(v: FontDialogFields['style']) => set('style', v)}\n />\n <NumberField\n {...fieldPart('size')}\n name=\"size\"\n label={t('fontDialog.fields.size')}\n unit={pt}\n step=\"1\"\n min=\"1\"\n placeholder={blank('size')}\n value={d.size}\n onChange={(v: string) => set('size', v)}\n />\n </div>\n <FormSection {...fieldPart('allText')} title={t('fontDialog.allText')}>\n {{\n default: () => (\n <>\n <div class=\"pptx-dialog__grid\">\n <ColorField\n {...fieldPart('color')}\n name=\"color\"\n label={t('fontDialog.fields.color')}\n value={d.color}\n seed={seed.color}\n current={textColor.value}\n onChange={(v: ColorPick) => set('color', v)}\n />\n <SelectField\n {...fieldPart('underline')}\n name=\"underline\"\n label={t('fontDialog.fields.underline')}\n mixed={mixed}\n value={d.underline}\n options={UNDERLINE_STYLES.map(\n (u) => [u, t(`fontDialog.underlines.${u}`)] as const\n )}\n onChange={(v: FontDialogFields['underline']) =>\n set('underline', v)\n }\n />\n <ColorField\n {...fieldPart('underlineColor')}\n name=\"underlineColor\"\n label={t('fontDialog.fields.underlineColor')}\n value={d.underline === 'none' ? 'auto' : d.underlineColor}\n seed={seed.underlineColor}\n disabled={d.underline === 'none'}\n onChange={(v: ColorPick) => set('underlineColor', v)}\n />\n </div>\n </>\n ),\n }}\n </FormSection>\n <FormSection {...fieldPart('effects')} title={t('fontDialog.effects')}>\n {{\n default: () => (\n <>\n {/* Two columns: the strike and script pairs, then the caps pair. */}\n <div class=\"pptx-dialog__columns\">\n <div class=\"pptx-dialog__rows\">\n <CheckField\n {...fieldPart('strike')}\n name=\"strike\"\n label={t('fontDialog.strikethrough')}\n value={d.strike}\n onChange={(on: boolean) =>\n draft.update((cur) => withExclusive(cur, 'strike', on))\n }\n />\n <CheckField\n {...fieldPart('doubleStrike')}\n name=\"doubleStrike\"\n label={t('fontDialog.doubleStrikethrough')}\n value={d.doubleStrike}\n onChange={(on: boolean) =>\n draft.update((cur) =>\n withExclusive(cur, 'doubleStrike', on)\n )\n }\n />\n <CheckField\n {...fieldPart('superscript')}\n name=\"superscript\"\n label={t('fontDialog.superscript')}\n value={d.superscript}\n onChange={(on: boolean) =>\n draft.update((cur) => withScript(cur, 'superscript', on))\n }\n />\n <CheckField\n {...fieldPart('subscript')}\n name=\"subscript\"\n label={t('fontDialog.subscript')}\n value={d.subscript}\n onChange={(on: boolean) =>\n draft.update((cur) => withScript(cur, 'subscript', on))\n }\n />\n {/* The offset of either script: after both checkboxes, not between them. */}\n <NumberField\n {...fieldPart('offset')}\n name=\"offset\"\n label={t('fontDialog.fields.offset')}\n unit={t('fontDialog.percent')}\n step=\"1\"\n min=\"0\"\n placeholder={blank('offset')}\n disabled={d.superscript !== true && d.subscript !== true}\n value={d.offset}\n onChange={(v: string) => set('offset', v)}\n />\n </div>\n <div class=\"pptx-dialog__rows\">\n <CheckField\n {...fieldPart('smallCaps')}\n name=\"smallCaps\"\n label={t('fontDialog.smallCaps')}\n value={d.smallCaps}\n onChange={(on: boolean) =>\n draft.update((cur) => withExclusive(cur, 'smallCaps', on))\n }\n />\n <CheckField\n {...fieldPart('allCaps')}\n name=\"allCaps\"\n label={t('fontDialog.allCaps')}\n value={d.allCaps}\n onChange={(on: boolean) =>\n draft.update((cur) => withExclusive(cur, 'allCaps', on))\n }\n />\n </div>\n </div>\n </>\n ),\n }}\n </FormSection>\n </>\n ),\n }}\n </FormTabPanel>\n <FormTabPanel idBase={idBase} tab=\"spacing\" inactive={tab.value !== 'spacing'}>\n {{\n default: () => (\n <>\n <div class=\"pptx-dialog__inline\">\n <SelectField\n {...fieldPart('spacing')}\n name=\"spacing\"\n label={t('fontDialog.fields.spacing')}\n autoFocus\n mixed={mixed}\n value={d.spacing}\n options={SPACINGS.map(\n (s) => [s, t(`fontDialog.spacings.${s}`)] as const\n )}\n onChange={(v: SpacingChoice) =>\n draft.update((cur) => withSpacing(cur, v))\n }\n />\n <NumberField\n {...fieldPart('by')}\n name=\"by\"\n label={t('fontDialog.fields.by')}\n unit={pt}\n step=\"0.1\"\n min=\"0\"\n placeholder={blank('by')}\n disabled={d.spacing === 'normal' || d.spacing === ''}\n value={d.by}\n onChange={(v: string) => set('by', v)}\n />\n </div>\n <div class=\"pptx-dialog__inline\">\n <CheckField\n {...fieldPart('kerning')}\n name=\"kerning\"\n label={t('fontDialog.kerning')}\n value={d.kerning}\n onChange={(on: boolean) => set('kerning', on)}\n />\n <NumberField\n {...fieldPart('kerningAt')}\n name=\"kerningAt\"\n label={t('fontDialog.fields.kerningAt')}\n unit={pt}\n step=\"1\"\n placeholder={blank('kerningAt')}\n disabled={d.kerning !== true}\n value={d.kerningAt}\n onChange={(v: string) => set('kerningAt', v)}\n />\n </div>\n </>\n ),\n }}\n </FormTabPanel>\n </div>,\n ],\n host: () => slots.default?.(),\n }}\n </FormDialog>\n );\n };\n },\n});\n\n/**\n * Format > Font: the font, style, size, underline, effects, character spacing, and kerning of\n * the selected text, applied as one undo step, with replaceable parts (`Header`, `Title`,\n * `Body`, `Footer`, `Field`, `Error`, `Apply`, `Cancel`), as React's `FontDialog`. Renders\n * nothing while `open` is false. @public\n */\nexport const FontDialog = Object.assign(\n defineComponent({\n name: 'FontDialog',\n inheritAttrs: false,\n props: fontDialogProps,\n setup(props, { attrs, slots }) {\n return () => (props.open ? h(FontDialogOpen, { ...attrs, ...props }, slots) : null);\n },\n }),\n {\n Header: parts.Header,\n Title: parts.Title,\n Body: parts.Body,\n Footer: parts.Footer,\n Field: parts.Field,\n Error: parts.Error,\n Apply: parts.Apply,\n Cancel: parts.Cancel,\n }\n);\n\n/**\n * Read the draft of the enclosing Font dialog, for a host's own field inside it. It does not\n * open the dialog: `useEditorDialog('font').open()` does. @public\n */\nexport function useFontDialog(): UseFontDialogReturn {\n return parts.useState();\n}\n","/** @jsxImportSource vue */\n// The color field of the form dialogs (Font color, Underline color, the bullet color): the Vue\n// twin of the React adapter's `dialog-color.tsx`. A list of the inherited color, \"no change\",\n// and the theme colors, and beside it a swatch button that shows the current color and opens\n// the color grid. The picks, labels, and the color OK sends live in core (`color-fields.ts`,\n// `chrome-forms.ts`).\n\nimport { defineComponent, ref, watch, type PropType } from 'vue';\nimport {\n colorChoiceOf,\n colorPickLabel,\n colorPickOf,\n colorPicks,\n renderedColorOf,\n type ColorPick,\n} from '@pptx-editor.dev/core/editor';\nimport { ColorSwatches } from './ColorSwatches.tsx';\nimport { useEditorState, useTranslation } from './composables.ts';\nimport { SelectField, dialogControl } from './dialog-form.tsx';\n\n/**\n * A color field: the list of picks and the swatch grid beside it. Other attributes (`class`,\n * `style`, `data-*`) reach the outer element. @internal\n */\nexport const ColorField = dialogControl(\n defineComponent({\n name: 'PptxColorField',\n props: {\n name: { type: String, required: true as const },\n label: { type: String, required: true as const },\n value: { type: String as PropType<ColorPick>, required: true as const },\n /** The value the field opened with: `keep` and `mixed` are offered only then. */\n seed: { type: String as PropType<ColorPick>, default: undefined },\n /** The color the selection has now (`#RRGGBB`): the swatch of \"Current color\" shows it. */\n current: { type: String as PropType<string | null>, default: null },\n disabled: { type: Boolean, default: false },\n className: { type: String, default: undefined },\n onChange: { type: Function as PropType<(pick: ColorPick) => void>, required: true as const },\n },\n setup(props) {\n const { t } = useTranslation();\n const rows = useEditorState((s) => s.themeColors);\n const open = ref(false);\n const panel = ref<HTMLDivElement | null>(null);\n const button = ref<HTMLButtonElement | null>(null);\n // The grid closes on a pick, on Escape (which does not close the dialog), and on a press\n // outside it.\n const away = (e: PointerEvent): void => {\n const target = e.target as Node;\n if (!panel.value?.contains(target) && !button.value?.contains(target)) open.value = false;\n };\n watch(\n open,\n (now, _old, onCleanup) => {\n if (!now) return;\n document.addEventListener('pointerdown', away, true);\n panel.value?.querySelector<HTMLElement>('button')?.focus();\n onCleanup(() => document.removeEventListener('pointerdown', away, true));\n },\n { flush: 'post' }\n );\n const closeGrid = (): void => {\n open.value = false;\n button.value?.focus();\n };\n return () => {\n const rendered = renderedColorOf(props.value, rows.value, props.current);\n const moreLabel = t('colors.moreColors', { field: props.label });\n return (\n <div class={['pptx-color-field', props.className].filter(Boolean).join(' ')}>\n <SelectField\n name={props.name}\n label={props.label}\n disabled={props.disabled}\n value={props.value}\n options={colorPicks(props.seed, props.value).map(\n (p) => [p, colorPickLabel(t, p)] as const\n )}\n onChange={props.onChange}\n />\n <button\n ref={button}\n type=\"button\"\n class=\"pptx-swatch pptx-color-field__button\"\n aria-label={moreLabel}\n aria-haspopup=\"true\"\n aria-expanded={open.value}\n disabled={props.disabled}\n data-color={rendered ?? undefined}\n style={rendered ? { background: rendered } : undefined}\n onClick={() => {\n open.value = !open.value;\n }}\n />\n {open.value ? (\n <div\n ref={panel}\n role=\"group\"\n aria-label={moreLabel}\n class=\"pptx-color-field__panel\"\n onKeydown={(e: KeyboardEvent) => {\n if (e.key !== 'Escape') return;\n e.preventDefault();\n e.stopPropagation();\n closeGrid();\n }}\n >\n <ColorSwatches\n menu={false}\n selected={colorChoiceOf(props.value)}\n onPick={(choice) => {\n props.onChange(colorPickOf(choice));\n closeGrid();\n }}\n />\n </div>\n ) : null}\n </div>\n );\n };\n },\n })\n);\n","/** @jsxImportSource vue */\n// The Bullets and Numbering dialog (Format > Bullets and Numbering…, or the last row of the\n// Bullets and Numbering galleries): the Vue twin of the React adapter's\n// `BulletsAndNumberingDialog`. A Bulleted and a Numbered tab with the gallery, the size as a\n// percentage of the text, the color, and the start number. OK sends one `setBulletFormat`\n// command with only what changed, so the dialog is one undo step and a size or color change\n// keeps each paragraph's own bullet. The Bulleted tab also takes any character in any font. The\n// form model is core's (`bullets-dialog-fields.ts`). The host owns visibility.\n\nimport {\n defineComponent,\n h,\n useId,\n type CSSProperties,\n type ExtractPublicPropTypes,\n type PropType,\n type VNode,\n} from 'vue';\nimport {\n BULLET_TEXT_FONT,\n bulletCommandOf,\n bulletFieldsEnabled,\n bulletFontMixed,\n bulletFontOptions,\n bulletStyleOptions,\n bulletsDialogError,\n bulletsFieldError,\n customBulletPreview,\n editBulletGlyph,\n pickBulletStyle,\n seedBulletFields,\n takeDialogSection,\n type BulletsDialogFields,\n type BulletsDialogTab,\n type ColorPick,\n} from '@pptx-editor.dev/core/editor';\nimport { useEditorState, usePptxEditor, useTranslation } from './composables.ts';\nimport { createDialogParts, type UseDialogReturn } from './dialog-parts.ts';\nimport { ColorField } from './dialog-color.tsx';\nimport {\n FormDialog,\n FormTabPanel,\n FormTabs,\n NumberField,\n SelectField,\n TextField,\n fieldPart,\n formDialogState,\n type FormDialogParts,\n} from './dialog-form.tsx';\nimport { useFormDraft } from './form-draft.ts';\n\n/**\n * The field names of the Bullets and Numbering dialog, for `BulletsAndNumberingDialog.Field`:\n * the fields of a whole tab (`bullet`, `number`), or one field, named as its input: `style`,\n * `char`, `font`, `sizePercent`, and `color` on the Bulleted tab; `numberStyle`,\n * `numberSizePercent`, `numberColor`, and `startAt` on the Numbered tab. @public\n */\nexport type BulletsAndNumberingDialogFieldName =\n | 'bullet'\n | 'number'\n | 'style'\n | 'char'\n | 'font'\n | 'sizePercent'\n | 'color'\n | 'numberStyle'\n | 'numberSizePercent'\n | 'numberColor'\n | 'startAt';\n\n/** The Bullets and Numbering draft and its actions, for a host's own field. @public */\nexport type UseBulletsAndNumberingDialogReturn = UseDialogReturn<BulletsDialogFields>;\n\nconst parts: FormDialogParts<BulletsAndNumberingDialogFieldName, BulletsDialogFields> =\n createDialogParts<UseBulletsAndNumberingDialogReturn, BulletsAndNumberingDialogFieldName>(\n 'BulletsAndNumberingDialog'\n );\n\nconst TABS = ['bullet', 'number'] as const satisfies readonly BulletsDialogTab[];\n\nconst bulletsAndNumberingDialogProps = {\n /** Whether the dialog is shown. The host owns this state. */\n open: { type: Boolean, required: true as const },\n /** Called on Cancel, Escape, a click on the backdrop, and after OK applies. */\n onClose: { type: Function as PropType<() => void>, required: true as const },\n /** `false`: only the default slot, with no default arrangement. */\n preset: { type: Boolean, default: true },\n /** A class name added to the dialog surface, as React's `className` (`class` works too). */\n className: { type: String, default: undefined },\n /** Styles added to the dialog surface. */\n style: { type: Object as PropType<CSSProperties>, default: undefined },\n} as const;\n\n/**\n * Props of `BulletsAndNumberingDialog`, the twin of React's `BulletsAndNumberingDialogProps`.\n * @public\n */\nexport type BulletsAndNumberingDialogProps = ExtractPublicPropTypes<\n typeof bulletsAndNumberingDialogProps\n>;\n\nconst BulletsAndNumberingDialogOpen = defineComponent({\n name: 'BulletsAndNumberingDialogOpen',\n inheritAttrs: false,\n props: bulletsAndNumberingDialogProps,\n setup(props, { attrs, slots }) {\n const { t } = useTranslation();\n const editor = usePptxEditor();\n const idBase = useId();\n // Undefined: the selected paragraphs differ; null: they have no list.\n const current = useEditorState((s) => s.format?.bulletFormat);\n const editable = useEditorState((s) => s.status === 'ready' && s.mode === 'edit');\n const opened = current.value;\n const section = takeDialogSection(editor.value, 'bulletsAndNumbering');\n const seed = seedBulletFields(\n opened,\n section === 'bullet' || section === 'number' ? section : undefined\n );\n const draft = useFormDraft<BulletsDialogFields>({\n seed,\n problem: (values) => {\n const problem = bulletsFieldError(seed, values);\n return problem ? bulletsDialogError(t, problem, values.kind) : null;\n },\n command: (values) => {\n const format = bulletCommandOf(seed, values);\n return format === undefined ? null : { type: 'setBulletFormat', format };\n },\n });\n const state = formDialogState({ draft, isEnabled: editable, onClose: () => props.onClose() });\n const set = draft.setValue;\n const fields = (kind: BulletsDialogTab, d: BulletsDialogFields, mixed: string): VNode => {\n // While a tab's style is None, its size, color, and start are dimmed.\n const off = !bulletFieldsEnabled({ ...d, kind });\n const fontMixed = bulletFontMixed(seed, d);\n return (\n <div class=\"pptx-dialog__grid\" {...fieldPart(kind)}>\n <SelectField\n {...fieldPart(kind === 'bullet' ? 'style' : 'numberStyle')}\n name={kind === 'bullet' ? 'style' : 'numberStyle'}\n label={t('bulletsAndNumberingDialog.style')}\n autoFocus\n mixed={mixed}\n value={d[kind]}\n options={bulletStyleOptions(t, kind, seed, d, opened)}\n onChange={(v: string) =>\n kind === 'bullet' ? draft.update((cur) => pickBulletStyle(cur, v)) : set(kind, v)\n }\n />\n {kind === 'bullet'\n ? [\n <TextField\n {...fieldPart('char')}\n name=\"char\"\n label={t('bulletsAndNumberingDialog.character')}\n disabled={off}\n value={d.char}\n font={d.font}\n // A symbol font's character also shows as its Unicode twin.\n preview={\n d.char && customBulletPreview(d) !== d.char ? customBulletPreview(d) : undefined\n }\n onChange={(v: string) =>\n draft.update((cur) => editBulletGlyph(cur, 'char', v, seed))\n }\n />,\n <SelectField\n {...fieldPart('font')}\n name=\"font\"\n label={t('bulletsAndNumberingDialog.font')}\n disabled={off}\n value={d.font || (fontMixed ? '' : BULLET_TEXT_FONT)}\n mixed={fontMixed ? mixed : undefined}\n options={bulletFontOptions(t, seed, editor.value?.fontFamilies() ?? [])}\n onChange={(v: string) =>\n draft.update((cur) =>\n editBulletGlyph(cur, 'font', v === BULLET_TEXT_FONT ? '' : v, seed)\n )\n }\n />,\n ]\n : null}\n <NumberField\n {...fieldPart(kind === 'bullet' ? 'sizePercent' : 'numberSizePercent')}\n name={kind === 'bullet' ? 'sizePercent' : 'numberSizePercent'}\n label={t('bulletsAndNumberingDialog.size')}\n unit={t('bulletsAndNumberingDialog.ofText')}\n step=\"5\"\n min=\"25\"\n max=\"400\"\n disabled={off}\n placeholder={seed.sizePercent === '' ? mixed : undefined}\n value={d.sizePercent}\n onChange={(v: string) => set('sizePercent', v)}\n />\n <ColorField\n {...fieldPart(kind === 'bullet' ? 'color' : 'numberColor')}\n name={kind === 'bullet' ? 'color' : 'numberColor'}\n label={t('bulletsAndNumberingDialog.color')}\n disabled={off}\n value={d.color}\n seed={seed.color}\n onChange={(v: ColorPick) => set('color', v)}\n />\n {kind === 'number' ? (\n <NumberField\n {...fieldPart('startAt')}\n name=\"startAt\"\n label={t('bulletsAndNumberingDialog.startAt')}\n unit=\"\"\n step=\"1\"\n min=\"1\"\n max=\"32767\"\n disabled={off}\n placeholder={seed.startAt === '' ? mixed : undefined}\n value={d.startAt}\n onChange={(v: string) => set('startAt', v)}\n />\n ) : null}\n </div>\n ) as VNode;\n };\n return () => {\n const d = draft.values.value;\n const mixed = t('bulletsAndNumberingDialog.mixed');\n return (\n <FormDialog\n {...attrs}\n name=\"bulletsAndNumbering\"\n className={props.className}\n style={props.style}\n preset={props.preset}\n parts={parts}\n state={state as UseDialogReturn<object>}\n title={t('bulletsAndNumberingDialog.title')}\n okLabel={t('bulletsAndNumberingDialog.ok')}\n cancelLabel={t('bulletsAndNumberingDialog.cancel')}\n closeLabel={t('bulletsAndNumberingDialog.close')}\n >\n {{\n default: () => [\n <FormTabs\n label={t('bulletsAndNumberingDialog.title')}\n idBase={idBase}\n tabs={TABS.map((id) => [id, t(`bulletsAndNumberingDialog.tabs.${id}`)] as const)}\n value={d.kind}\n onChange={(kind: BulletsDialogTab) => set('kind', kind)}\n />,\n // Both tabs share one cell, so the dialog keeps its size when the tab changes.\n <div class=\"pptx-dialog__panels\">\n {TABS.map((kind) => (\n <FormTabPanel key={kind} idBase={idBase} tab={kind} inactive={d.kind !== kind}>\n {{ default: () => <>{fields(kind, d, mixed)}</> }}\n </FormTabPanel>\n ))}\n </div>,\n ],\n host: () => slots.default?.(),\n }}\n </FormDialog>\n );\n };\n },\n});\n\n/**\n * Format > Bullets and Numbering: the bullet or numbering style, size, color, and start number\n * of the selected paragraphs, applied as one undo step, with replaceable parts (`Header`,\n * `Title`, `Body`, `Footer`, `Field`, `Error`, `Apply`, `Cancel`), as React's\n * `BulletsAndNumberingDialog`. Renders nothing while `open` is false. @public\n */\nexport const BulletsAndNumberingDialog = Object.assign(\n defineComponent({\n name: 'BulletsAndNumberingDialog',\n inheritAttrs: false,\n props: bulletsAndNumberingDialogProps,\n setup(props, { attrs, slots }) {\n return () =>\n props.open ? h(BulletsAndNumberingDialogOpen, { ...attrs, ...props }, slots) : null;\n },\n }),\n {\n Header: parts.Header,\n Title: parts.Title,\n Body: parts.Body,\n Footer: parts.Footer,\n Field: parts.Field,\n Error: parts.Error,\n Apply: parts.Apply,\n Cancel: parts.Cancel,\n }\n);\n\n/**\n * Read the draft of the enclosing Bullets and Numbering dialog, for a host's own field inside\n * it. It does not open the dialog: `useEditorDialog('bulletsAndNumbering').open()` does.\n * @public\n */\nexport function useBulletsAndNumberingDialog(): UseBulletsAndNumberingDialogReturn {\n return parts.useState();\n}\n","/** @jsxImportSource vue */\n// The Columns dialog (Home > Columns > More Columns…): the Vue twin of the React adapter's\n// `ColumnsDialog`. The number of columns and the spacing between them, in inches. OK sends one\n// `setColumns` command, so the dialog is one undo step. The form model is core's\n// (`columns-dialog-fields.ts`), so both adapters show the same fields and send the same command.\n// The host owns visibility (`open`, `onClose`).\n\nimport {\n defineComponent,\n h,\n type CSSProperties,\n type ExtractPublicPropTypes,\n type PropType,\n} from 'vue';\nimport {\n columnsCommandOf,\n columnsDialogError,\n columnsFieldError,\n seedColumnsFields,\n type ColumnsDialogFields,\n} from '@pptx-editor.dev/core/editor';\nimport { useEditorState, useTranslation } from './composables.ts';\nimport { createDialogParts, type UseDialogReturn } from './dialog-parts.ts';\nimport {\n FormDialog,\n NumberField,\n fieldPart,\n formDialogState,\n type FormDialogParts,\n} from './dialog-form.tsx';\nimport { useFormDraft } from './form-draft.ts';\n\n/**\n * The field names of the Columns dialog, for `ColumnsDialog.Field`: both fields (`columns`), or\n * one of them, named as its `ColumnsDialogFields` key. @public\n */\nexport type ColumnsDialogFieldName = 'columns' | 'count' | 'spacing';\n\n/** The Columns draft and its actions, for a host's own field inside the dialog. @public */\nexport type UseColumnsDialogReturn = UseDialogReturn<ColumnsDialogFields>;\n\nconst parts: FormDialogParts<ColumnsDialogFieldName, ColumnsDialogFields> = createDialogParts<\n UseColumnsDialogReturn,\n ColumnsDialogFieldName\n>('ColumnsDialog');\n\nconst columnsDialogProps = {\n /** Whether the dialog is shown. The host owns this state. */\n open: { type: Boolean, required: true as const },\n /** Called on Cancel, Escape, a click on the backdrop, and after OK applies. */\n onClose: { type: Function as PropType<() => void>, required: true as const },\n /** `false`: only the default slot, with no default arrangement. */\n preset: { type: Boolean, default: true },\n /** A class name added to the dialog surface, as React's `className` (`class` works too). */\n className: { type: String, default: undefined },\n /** Styles added to the dialog surface. */\n style: { type: Object as PropType<CSSProperties>, default: undefined },\n} as const;\n\n/** Props of `ColumnsDialog`, the twin of React's `ColumnsDialogProps`. @public */\nexport type ColumnsDialogProps = ExtractPublicPropTypes<typeof columnsDialogProps>;\n\nconst ColumnsDialogOpen = defineComponent({\n name: 'ColumnsDialogOpen',\n inheritAttrs: false,\n props: columnsDialogProps,\n setup(props, { attrs, slots }) {\n const { t } = useTranslation();\n // Undefined when the selected shapes differ: the fields open blank.\n const current = useEditorState((s) => s.format?.columns);\n const editable = useEditorState((s) => s.status === 'ready' && s.mode === 'edit');\n const seed = seedColumnsFields(current.value);\n const draft = useFormDraft<ColumnsDialogFields>({\n seed,\n problem: (values) => {\n const problem = columnsFieldError(seed, values);\n return problem ? columnsDialogError(t, problem) : null;\n },\n command: (values) => columnsCommandOf(seed, values),\n });\n const state = formDialogState({ draft, isEnabled: editable, onClose: () => props.onClose() });\n return () => {\n const values = draft.values.value;\n const mixed = t('columnsDialog.mixed');\n return (\n <FormDialog\n {...attrs}\n name=\"columns\"\n className={props.className}\n style={props.style}\n preset={props.preset}\n parts={parts}\n state={state as UseDialogReturn<object>}\n title={t('columnsDialog.title')}\n okLabel={t('columnsDialog.ok')}\n cancelLabel={t('columnsDialog.cancel')}\n closeLabel={t('columnsDialog.close')}\n >\n {{\n default: () => (\n <div class=\"pptx-dialog__grid\" {...fieldPart('columns')}>\n <NumberField\n {...fieldPart('count')}\n name=\"count\"\n label={t('columnsDialog.number')}\n unit=\"\"\n step=\"1\"\n min=\"1\"\n max=\"16\"\n placeholder={seed.count === '' ? mixed : undefined}\n autoFocus\n value={values.count}\n onChange={(v: string) => draft.setValue('count', v)}\n />\n <NumberField\n {...fieldPart('spacing')}\n name=\"spacing\"\n label={t('columnsDialog.spacing')}\n unit={t('columnsDialog.inches')}\n step=\"0.1\"\n min=\"0\"\n placeholder={seed.spacing === '' ? mixed : undefined}\n value={values.spacing}\n onChange={(v: string) => draft.setValue('spacing', v)}\n />\n </div>\n ),\n host: () => slots.default?.(),\n }}\n </FormDialog>\n );\n };\n },\n});\n\n/**\n * Home > Columns > More Columns: the number of text columns of the selected shapes and the\n * spacing between them, applied as one undo step, with replaceable parts (`Header`, `Title`,\n * `Body`, `Footer`, `Field`, `Error`, `Apply`, `Cancel`), as React's `ColumnsDialog`. Renders\n * nothing while `open` is false. @public\n */\nexport const ColumnsDialog = Object.assign(\n defineComponent({\n name: 'ColumnsDialog',\n inheritAttrs: false,\n props: columnsDialogProps,\n setup(props, { attrs, slots }) {\n return () => (props.open ? h(ColumnsDialogOpen, { ...attrs, ...props }, slots) : null);\n },\n }),\n {\n Header: parts.Header,\n Title: parts.Title,\n Body: parts.Body,\n Footer: parts.Footer,\n Field: parts.Field,\n Error: parts.Error,\n Apply: parts.Apply,\n Cancel: parts.Cancel,\n }\n);\n\n/**\n * Read the draft of the enclosing Columns dialog, for a host's own field inside it. It does not\n * open the dialog: `useEditorDialog('columns').open()` does. @public\n */\nexport function useColumnsDialog(): UseColumnsDialogReturn {\n return parts.useState();\n}\n","// The open state of the speaker notes, which the notes pane draws and host chrome (a View menu\n// row, a Notes button) can toggle: the Vue twin of the React adapter's `pane-state.ts`.\n// `PptxEditorRoot` provides it, so they agree without the host wiring them. A notes pane given\n// `open` is controlled by the host instead, as DOCX Editor's `Navigation` is: it mirrors that\n// value into the root, and a toggle from the composable goes to its `update:open` handler.\n\nimport {\n computed,\n inject,\n provide,\n shallowRef,\n type ComputedRef,\n type InjectionKey,\n type ShallowRef,\n} from 'vue';\nimport { warnOutsideRoot } from '@pptx-editor.dev/core/editor';\n\n/** The shared pane state. @internal */\nexport interface PaneState {\n /** Undefined until a notes pane or the host sets it. */\n readonly notesOpen: ShallowRef<boolean | undefined>;\n setNotesOpen(open: boolean): void;\n /** The mounted notes pane's handler: a controlled pane sends a change to its host. */\n readonly notesRequest: { current: ((open: boolean) => void) | null };\n}\n\n/** Provided by `PptxEditorRoot`. @internal */\nexport const paneStateKey: InjectionKey<PaneState> = Symbol('pptxPaneState');\n\n/** Create and provide the root's pane state. @internal */\nexport function providePaneState(): PaneState {\n const notesOpen = shallowRef<boolean | undefined>(undefined);\n const state: PaneState = {\n notesOpen,\n setNotesOpen: (open) => {\n notesOpen.value = open;\n },\n notesRequest: { current: null },\n };\n provide(paneStateKey, state);\n return state;\n}\n\n/** The root's pane state, or null outside a root. @internal */\nexport function usePaneState(): PaneState | null {\n return inject(paneStateKey, null);\n}\n\n/** What `useNotesPane` returns. @public */\nexport interface UseNotesPaneReturn {\n /** Whether the notes pane shows its text. */\n readonly open: ComputedRef<boolean>;\n /** Show or hide the notes text. A controlled pane gets the change through its handler. */\n readonly setOpen: (open: boolean) => void;\n /** Show the notes text when hidden, and hide it when shown. */\n readonly toggle: () => void;\n}\n\n/**\n * The open state of the speaker notes that the notes pane shows, as React's `useNotesPane` and\n * DOCX Editor's `useNavigationPane`. Use it to build a notes toggle of your own. Outside\n * `PptxEditorRoot` it warns and does nothing. @public\n */\nexport function useNotesPane(): UseNotesPaneReturn {\n const state = usePaneState();\n if (!state) warnOutsideRoot('useNotesPane');\n const open = computed(() => state?.notesOpen.value ?? true);\n const setOpen = (next: boolean): void => {\n if (!state) return;\n if (state.notesRequest.current) state.notesRequest.current(next);\n // Only an uncontrolled root takes the value at once; a host may refuse a pane's change.\n else state.setNotesOpen(next);\n };\n // Reads the value at call time: the root's ref changes at once, so two toggles in one tick\n // show and hide again, as the React twin's do.\n const toggle = (): void => setOpen(!open.value);\n return { open, setOpen, toggle };\n}\n","/** @jsxImportSource vue */\n// The slide show: the Vue twin of the React adapter's `Slideshow.tsx`. Full screen (the\n// Fullscreen API, or a window-covering overlay when the browser refuses), one slide painted by\n// the engine's `paintSlide`, the usual show keys, and an auto-hiding control bar. Navigation\n// state is the engine's `SlideshowController`; full screen, the start keys, the show keys, the\n// screen size, and links are core's (`slideshow-screen.ts`), so the two adapters cannot drift.\n\nimport {\n computed,\n defineComponent,\n inject,\n onBeforeUnmount,\n onMounted,\n onUnmounted,\n provide,\n ref,\n shallowRef,\n watch,\n watchPostEffect,\n type InjectionKey,\n type PropType,\n type Ref,\n type ShallowRef,\n} from 'vue';\nimport {\n SLIDESHOW_IDLE_MS,\n enterSlideshowScreen,\n fitSlideToScreen,\n listenSlideshowKeys,\n listenSlideshowStartKeys,\n observeSlideshowScreen,\n openSlideshowLink,\n paintSlideshowSlide,\n slideshowLinkUnder,\n startSlideshowController,\n translateKeyOrText,\n type PptxEditorInstance,\n type SlideshowController,\n type SlideshowScreenSize,\n type SlideshowState,\n} from '@pptx-editor.dev/core/editor';\nimport { Icon } from './chrome.tsx';\nimport { useEditorState, usePptxEditor, useTranslation } from './composables.ts';\n\n/**\n * The slide show of the editor in `PptxEditorRoot`, the twin of React's `UseSlideshowReturn`. The\n * running show is a ref, so a template reads it reactively. @public\n */\nexport interface UseSlideshowReturn {\n /** The running show, or null. `PptxEditorSlideshow` paints it. */\n readonly controller: Readonly<ShallowRef<SlideshowController | null>>;\n /**\n * Start the show from the first shown slide or from the current slide. Does nothing without\n * an open document with slides. Viewing mode can present.\n */\n start(from: 'start' | 'current'): void;\n /** Close the show. */\n stop(): void;\n}\n\n/** The slide show published by `PptxEditorRoot`, the twin of React's `SlideshowContext`. @public */\nexport const pptxSlideshowKey: InjectionKey<UseSlideshowReturn> = Symbol('pptxSlideshow');\n\nconst noShow: UseSlideshowReturn = {\n controller: shallowRef(null),\n start: () => undefined,\n stop: () => undefined,\n};\n\n/**\n * Provide the slide show of one root and return it. The root passes its editor: an `inject` in\n * the providing component would read the parent's value. @internal\n */\nexport function provideSlideshow(\n editorRef: Readonly<Ref<PptxEditorInstance | null>>\n): UseSlideshowReturn {\n const controller = shallowRef<SlideshowController | null>(null);\n const handle: UseSlideshowReturn = {\n controller,\n start(from) {\n const next = startSlideshowController(editorRef.value, from);\n if (next) controller.value = next;\n },\n stop: () => {\n controller.value = null;\n },\n };\n provide(pptxSlideshowKey, handle);\n return handle;\n}\n\n/** The slide show of the editor in `PptxEditorRoot`, as React's `useSlideshow`. @public */\nexport function useSlideshow(): UseSlideshowReturn {\n return inject(pptxSlideshowKey, noShow);\n}\n\n/**\n * One key per show and editor, so a new show, or a new editor under a running show, mounts a\n * new screen (full screen, focus, keys, and the deck subscription).\n */\nconst showKeys = new WeakMap<object, number>();\nlet nextShowKey = 0;\nfunction keyOf(value: object): number {\n let key = showKeys.get(value);\n if (key === undefined) showKeys.set(value, (key = ++nextShowKey));\n return key;\n}\nfunction showKey(controller: SlideshowController, editor: PptxEditorInstance): string {\n return `${keyOf(controller)}:${keyOf(editor)}`;\n}\n\n/** A CSS length as React writes a number: unitless zero, pixels otherwise. */\nconst px = (n: number): string => (n === 0 ? '0' : `${n}px`);\n\nconst SlideshowScreen = defineComponent({\n name: 'PptxSlideshowScreen',\n props: {\n editor: { type: Object as PropType<PptxEditorInstance>, required: true as const },\n controller: { type: Object as PropType<SlideshowController>, required: true as const },\n onClose: { type: Function as PropType<() => void>, required: true as const },\n },\n setup(props) {\n const { t } = useTranslation();\n const { editor, controller } = props;\n const root = ref<HTMLDivElement | null>(null);\n const slide = ref<HTMLDivElement | null>(null);\n const state = shallowRef<SlideshowState>(controller.state);\n const offState = controller.subscribe(() => {\n state.value = controller.state;\n });\n const width = useEditorState((s) => s.slideWidth);\n const height = useEditorState((s) => s.slideHeight);\n const slides = useEditorState((s) => s.slides);\n const renderKey = computed(() => slides.value[state.value.index]?.key ?? '');\n const size = shallowRef<SlideshowScreenSize>({ w: 0, h: 0, dpr: 1 });\n const bar = ref(false);\n const link = ref(false);\n let idle: ReturnType<typeof setTimeout> | null = null;\n let overBar = false;\n\n // The deck can change under a running show (fonts load, a collaborator edits).\n const offDeck = editor.subscribe(() => controller.update(editor.snapshot().slides));\n\n // The show ended: the editor returns to the slide shown last.\n watch(\n () => [state.value.done, state.value.index] as const,\n ([done, index]) => {\n if (!done) return;\n editor.goToSlide(index);\n props.onClose();\n },\n { immediate: true }\n );\n\n // Full screen, the show keys, and the screen size (core's `slideshow-screen.ts`). They\n // leave before the show leaves the DOM, so focus returns in the same update and a start key\n // pressed right after the show ends is not swallowed.\n let stops: (() => void)[] = [];\n onMounted(() => {\n const el = root.value;\n if (!el) return;\n stops = [\n enterSlideshowScreen(el),\n listenSlideshowKeys(controller, () => root.value),\n observeSlideshowScreen(el, (next) => {\n size.value = next;\n }),\n ];\n });\n onBeforeUnmount(() => {\n for (const stop of stops) stop();\n stops = [];\n });\n onUnmounted(() => {\n offState();\n offDeck();\n if (idle) clearTimeout(idle);\n });\n\n // Paint the slide on show with the editor's own painter.\n watchPostEffect(() => {\n const el = slide.value;\n const { index, screen } = state.value;\n void renderKey.value;\n const label = (kind: string): string =>\n t('canvas.placeholderObject', { kind: translateKeyOrText(t, `canvas.kinds.${kind}`) });\n // Read the translator now, so a locale change repaints the frame labels.\n void t('slideshow.ariaLabel');\n const session = editor.session;\n if (!el) return;\n if (!session || screen === 'end') {\n el.replaceChildren();\n return;\n }\n const svg = paintSlideshowSlide(el.ownerDocument, session, index, { frameLabel: label });\n el.replaceChildren(...(svg ? [svg] : []));\n });\n\n const linkAt = (e: MouseEvent): string | null =>\n slideshowLinkUnder(\n editor.session,\n state.value,\n slide.value,\n width.value,\n height.value,\n e.clientX,\n e.clientY\n );\n\n const onMove = (e: MouseEvent): void => {\n bar.value = true;\n link.value = !!linkAt(e);\n if (idle) clearTimeout(idle);\n idle = setTimeout(() => {\n if (!overBar) bar.value = false;\n }, SLIDESHOW_IDLE_MS);\n };\n\n const onClick = (e: MouseEvent): void => {\n if (e.button !== 0) return;\n const href = linkAt(e);\n const doc = (e.currentTarget as Element | null)?.ownerDocument ?? document;\n if (href) openSlideshowLink(doc, href);\n else controller.next();\n };\n\n return () => {\n const s = state.value;\n const fit = fitSlideToScreen(\n size.value.w,\n size.value.h,\n width.value,\n height.value,\n size.value.dpr\n );\n const position = t('slideshow.position', { current: s.index + 1, total: s.slideCount });\n return (\n <div\n ref={root}\n class=\"pptx-show\"\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={t('slideshow.ariaLabel')}\n tabindex={-1}\n data-screen={s.screen}\n data-idle={String(!bar.value)}\n data-link={String(link.value)}\n onMousemove={onMove}\n onClick={onClick}\n >\n <div\n ref={slide}\n class=\"pptx-show__slide\"\n data-slide-index={s.index}\n style={{\n left: px(fit.left),\n top: px(fit.top),\n width: px(fit.width),\n height: px(fit.height),\n }}\n />\n {s.screen === 'black' || s.screen === 'white' ? (\n <div class=\"pptx-show__blank\" data-color={s.screen} />\n ) : null}\n {s.screen === 'end' ? <div class=\"pptx-show__end\">{t('slideshow.end')}</div> : null}\n {s.typed ? (\n <div class=\"pptx-show__goto\" role=\"status\">\n {t('slideshow.goTo', { number: s.typed })}\n </div>\n ) : null}\n <div\n class=\"pptx-show__bar\"\n role=\"toolbar\"\n aria-label={t('slideshow.controls')}\n data-visible={String(bar.value)}\n onClick={(e: MouseEvent) => e.stopPropagation()}\n onMouseenter={() => {\n overBar = true;\n }}\n onMouseleave={() => {\n overBar = false;\n }}\n >\n <button\n type=\"button\"\n class=\"pptx-show__button\"\n aria-label={t('slideshow.previous')}\n title={t('slideshow.previous')}\n onClick={() => controller.previous()}\n >\n <Icon name=\"keyboard_arrow_left\" className=\"\" />\n </button>\n <span class=\"pptx-show__position\" aria-live=\"polite\">\n {position}\n </span>\n <button\n type=\"button\"\n class=\"pptx-show__button\"\n aria-label={t('slideshow.next')}\n title={t('slideshow.next')}\n onClick={() => controller.next()}\n >\n <Icon name=\"keyboard_arrow_right\" className=\"\" />\n </button>\n <button\n type=\"button\"\n class=\"pptx-show__button\"\n aria-label={t('slideshow.exit')}\n title={t('slideshow.exit')}\n onClick={() => controller.exit()}\n >\n <Icon name=\"close\" className=\"\" />\n </button>\n </div>\n </div>\n );\n };\n },\n});\n\n/**\n * The slide show of the editor in `PptxEditorRoot`, the twin of React's `PptxEditor.Slideshow`.\n * Mount it once inside the viewport. It shows nothing until a show starts:\n * `useSlideshow().start(...)`, or the keys F5 (from the start) and Shift+F5 or Ctrl/Cmd+Enter\n * (from the current slide). @public\n */\nexport const PptxEditorSlideshow = defineComponent({\n name: 'PptxEditorSlideshow',\n setup() {\n const editor = usePptxEditor();\n const show = useSlideshow();\n const anchor = ref<HTMLSpanElement | null>(null);\n // The show start keys, while focus is in this editor (or on nothing). The listener stays\n // registered while a show runs and reads the live state, so a start key pressed right after\n // a show ends is never lost.\n watch(\n editor,\n (instance, _old, onCleanup) => {\n if (!instance) return;\n onCleanup(\n listenSlideshowStartKeys(\n () => anchor.value,\n () => show.controller.value !== null,\n (from) => show.start(from)\n )\n );\n },\n { immediate: true }\n );\n return () => {\n const instance = editor.value;\n const controller = show.controller.value;\n if (!instance || !controller) return <span ref={anchor} hidden />;\n return (\n <SlideshowScreen\n key={showKey(controller, instance)}\n editor={instance}\n controller={controller}\n onClose={show.stop}\n />\n );\n };\n },\n});\n","/** @jsxImportSource vue */\n// The find bar: the Vue twin of the React adapter's `FindBar.tsx`. Find and replace over the\n// engine's `editor.find`. Ctrl/Cmd+F opens it to find and Ctrl/Cmd+H to replace. Enter and\n// Shift+Enter step through the matches; Escape closes it and returns the focus.\n//\n// The toolbar's `find` group and a host's menu open it with `requestFindBar`: an event that\n// names the editor, so a bar answers only its own editor. The requests, keys, counter, actions,\n// and focus rules are core's (`overlays.ts`), so the two adapters cannot drift.\n\nimport {\n defineComponent,\n inject,\n onScopeDispose,\n provide,\n ref,\n shallowRef,\n watch,\n type InjectionKey,\n type Ref,\n type ExtractPublicPropTypes,\n} from 'vue';\nimport {\n dispatchFindRequest,\n findAsYouType,\n findBarOpener,\n findBarView,\n findFieldTakesFocus,\n focusAfterFindBar,\n listenFindRequests,\n onFindShown,\n onNewDocument,\n reserveFindBarSpace,\n runFindBarAction,\n type FindBarAction,\n type FindOptions,\n type PptxEditorInstance,\n} from '@pptx-editor.dev/core/editor';\nimport { ToolButton } from './chrome.tsx';\nimport { useEditorState, usePptxEditor } from './composables.ts';\nimport { chromeTranslateProp, useChromeTranslateScope } from './headless-hooks.ts';\nimport { usePopupEntry } from './popups.ts';\n\n/** What a replacement find bar receives, as React's `FindPopupProps`. @public */\nexport interface FindPopupProps {\n /** Opened to replace (Ctrl/Cmd+H), not only to find. */\n readonly replace: boolean;\n /** Close the bar. Run `editor.find` and `editor.replace` for the search itself. */\n readonly onClose: () => void;\n}\n\n/** Open the find bar of `editor`: to find, or with the replace row when `replace`. @public */\nexport function requestFindBar(editor: PptxEditorInstance | null, replace = false): void {\n dispatchFindRequest(editor, replace);\n}\n\n/** How many find bars a root has mounted, so Find shows as disabled while there is none. */\nconst findBarsKey: InjectionKey<Ref<number>> = Symbol('pptxFindBars');\n\n/** Provide the find bar count of one root and return it. @internal */\nexport function provideFindBars(): Readonly<Ref<number>> {\n const count = ref(0);\n provide(findBarsKey, count);\n return count;\n}\n\n/** Count this find bar in its root while it is mounted. */\nfunction useRegisterFindBar(): void {\n const count = inject(findBarsKey, null);\n if (!count) return;\n count.value += 1;\n onScopeDispose(() => {\n count.value -= 1;\n });\n}\n\nconst pptxEditorFindBarProps = {\n ...chromeTranslateProp,\n /** A class name added to the find bar, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n} as const;\n\n/** The props of `PptxEditorFindBar`, the same name as React's `FindBarProps`. @public */\nexport type FindBarProps = ExtractPublicPropTypes<typeof pptxEditorFindBarProps>;\n\n/**\n * The find and replace bar, the twin of React's `PptxEditor.FindBar`. Render one inside the\n * editor's viewport, over the canvas. A host `class` goes on the bar. @public\n */\nexport const PptxEditorFindBar = defineComponent({\n name: 'PptxEditorFindBar',\n inheritAttrs: false,\n props: pptxEditorFindBarProps,\n setup(props, { attrs }) {\n const editorRef = usePptxEditor();\n const { t } = useChromeTranslateScope(() => props.t);\n // Find rows and controls are on only while a find bar can answer them.\n useRegisterFindBar();\n // `popups.find`: a renderer replaces the packaged bar here; `false` turns find off.\n const entry = usePopupEntry('find');\n const root = ref<HTMLDivElement | null>(null);\n // Finds the editor scope when a host renderer replaces the packaged bar.\n const anchor = ref<HTMLSpanElement | null>(null);\n const findInput = ref<HTMLInputElement | null>(null);\n let returnTo: HTMLElement | null = null;\n const open = ref(false);\n const replaceShown = ref(false);\n const focusCount = ref(0);\n const query = ref('');\n const replacement = ref('');\n const matchCase = ref(false);\n const wholeWord = ref(false);\n const status = shallowRef<string | null>(null);\n // The counter reads the deck and the selection: render again when either moves.\n const revision = useEditorState((s) => s.revision);\n const selection = useEditorState((s) => s.selection);\n const currentSlide = useEditorState((s) => s.currentSlide);\n // A step inside the speaker notes moves neither: find tells when it shows another match.\n const shownCount = ref(0);\n watch(\n editorRef,\n (editor, _old, onCleanup) => {\n if (editor)\n onCleanup(\n onFindShown(editor.find, () => {\n shownCount.value += 1;\n })\n );\n },\n { immediate: true }\n );\n const editable = useEditorState((s) => s.status === 'ready' && s.mode === 'edit');\n const options = (): FindOptions => ({ matchCase: matchCase.value, wholeWord: wholeWord.value });\n\n const show = (replace: boolean): void => {\n if (!open.value) {\n returnTo = findBarOpener();\n // A fresh Find shows only the find row; Replace opens both.\n replaceShown.value = replace;\n } else if (replace) replaceShown.value = true;\n open.value = true;\n focusCount.value += 1;\n };\n\n watch(\n focusCount,\n () => {\n findInput.value?.focus();\n findInput.value?.select();\n },\n { flush: 'post' }\n );\n\n watch(\n () => [editorRef.value, entry() === false] as const,\n ([editor, off], _old, onCleanup) => {\n if (off || !editor) return;\n // The request for this editor, and Ctrl/Cmd+F and Ctrl/Cmd+H while the focus is in this\n // editor (or nowhere).\n onCleanup(listenFindRequests(editor, () => root.value ?? anchor.value, show));\n },\n { immediate: true }\n );\n\n // The open bar keeps its height free above the slide (core's `reserveFindBarSpace`).\n watch(\n root,\n (bar, _old, onCleanup) => {\n if (bar) onCleanup(reserveFindBarSpace(bar));\n },\n { flush: 'post' }\n );\n\n // Another document: the bar closes and forgets the search, which names the old deck's text.\n watch(\n editorRef,\n (editor, _old, onCleanup) => {\n if (!editor) return;\n onCleanup(\n onNewDocument(editor, () => {\n open.value = false;\n query.value = '';\n replacement.value = '';\n status.value = null;\n })\n );\n },\n { immediate: true }\n );\n\n const run = (action: FindBarAction): void => {\n const editor = editorRef.value;\n if (!editor || !query.value) return;\n status.value = runFindBarAction(t, editor, action, query.value, replacement.value, options());\n // The buttons turn off with no match left: focus stays in the bar, in the find field.\n if (findFieldTakesFocus(editor, action, query.value, options())) findInput.value?.focus();\n };\n\n const close = (): void => {\n open.value = false;\n status.value = null;\n const back = returnTo;\n returnTo = null;\n focusAfterFindBar(editorRef.value, root.value, root.value ?? anchor.value, back);\n };\n\n const onBarKey = (e: KeyboardEvent): void => {\n if (e.key !== 'Escape') return;\n e.preventDefault();\n e.stopPropagation();\n close();\n };\n\n return () => {\n const current = entry();\n if (current === false) return null;\n // Render again when the deck or the selection moves.\n void [revision.value, selection.value, currentSlide.value, shownCount.value];\n if (typeof current === 'function')\n return [\n <span ref={anchor} hidden />,\n open.value ? current({ replace: replaceShown.value, onClose: close }) : null,\n ];\n const { matches, counter, inNotes } = findBarView(\n t,\n editorRef.value,\n open.value,\n query.value,\n options()\n );\n return (\n <div\n {...attrs}\n ref={root}\n class={['pptx-find', attrs.class, props.className]}\n role=\"search\"\n aria-label={t('find.label')}\n hidden={!open.value}\n onKeydown={onBarKey}\n >\n {open.value\n ? [\n <div class=\"pptx-find__row\">\n <ToolButton\n label={t('find.showReplace')}\n icon={replaceShown.value ? 'keyboard_arrow_up' : 'keyboard_arrow_down'}\n pressed={replaceShown.value}\n onClick={() => {\n replaceShown.value = !replaceShown.value;\n }}\n />\n <input\n ref={findInput}\n class=\"pptx-find__input\"\n type=\"text\"\n aria-label={t('find.find')}\n placeholder={t('find.findPlaceholder')}\n value={query.value}\n onInput={(e: Event) => {\n query.value = (e.target as HTMLInputElement).value;\n status.value = null;\n findAsYouType(editorRef.value, query.value, options());\n }}\n onKeydown={(e: KeyboardEvent) => {\n if (e.key !== 'Enter') return;\n e.preventDefault();\n run(e.shiftKey ? 'previous' : 'next');\n }}\n />\n <span class=\"pptx-find__count\" aria-live=\"polite\">\n {counter}\n </span>\n <ToolButton\n label={t('find.previous')}\n icon=\"keyboard_arrow_up\"\n disabled={!matches.length}\n onClick={() => run('previous')}\n />\n <ToolButton\n label={t('find.next')}\n icon=\"keyboard_arrow_down\"\n disabled={!matches.length}\n onClick={() => run('next')}\n />\n <ToolButton label={t('find.close')} icon=\"close\" onClick={close} />\n </div>,\n replaceShown.value ? (\n <div class=\"pptx-find__row pptx-find__row--replace\">\n <input\n class=\"pptx-find__input\"\n type=\"text\"\n aria-label={t('find.replace')}\n placeholder={t('find.replacePlaceholder')}\n value={replacement.value}\n disabled={!editable.value}\n onInput={(e: Event) => {\n replacement.value = (e.target as HTMLInputElement).value;\n }}\n onKeydown={(e: KeyboardEvent) => {\n if (e.key !== 'Enter') return;\n e.preventDefault();\n run('replace');\n }}\n />\n <button\n type=\"button\"\n class=\"pptx-button\"\n disabled={!editable.value || !matches.length}\n onClick={() => run('replace')}\n >\n {t('find.replaceOne')}\n </button>\n <button\n type=\"button\"\n class=\"pptx-button\"\n disabled={!editable.value || !matches.length}\n onClick={() => run('replaceAll')}\n >\n {t('find.replaceAll')}\n </button>\n </div>\n ) : null,\n <div class=\"pptx-find__options\">\n <label class=\"pptx-find__option\">\n <input\n type=\"checkbox\"\n checked={matchCase.value}\n onChange={(e: Event) => {\n matchCase.value = (e.target as HTMLInputElement).checked;\n }}\n />\n {t('find.matchCase')}\n </label>\n <label class=\"pptx-find__option\">\n <input\n type=\"checkbox\"\n checked={wholeWord.value}\n onChange={(e: Event) => {\n wholeWord.value = (e.target as HTMLInputElement).checked;\n }}\n />\n {t('find.wholeWord')}\n </label>\n </div>,\n inNotes ? <p class=\"pptx-find__hint\">{t('find.inNotes')}</p> : null,\n status.value ? (\n <p class=\"pptx-find__status\" role=\"status\">\n {status.value}\n </p>\n ) : null,\n ]\n : null}\n </div>\n );\n };\n },\n});\n","// The Vue twins of the React adapter's `headless-hooks.tsx`: `useChromeTranslate` and the\n// compounds' `t` prop, `useToolbarContext`, `useToolbarLabel`, `useToolbarLabelFor`,\n// `useHistoryGroup`, `useEditorCaret`, and `useDocumentSearch`, with DOCX Editor's names. Each\n// returns refs where React returns values, and works outside a root: no matches, no caret,\n// and actions that do nothing.\n\nimport {\n computed,\n getCurrentScope,\n inject,\n onScopeDispose,\n provide,\n shallowRef,\n watch,\n type ComputedRef,\n type InjectionKey,\n type ShallowRef,\n} from 'vue';\nimport {\n IDLE_DOCUMENT_SEARCH,\n bindHistoryGroup,\n documentSearchOf,\n editorCaretOf,\n type ChromeTranslate,\n type DocumentSearch,\n type DocumentSearchFindOptions,\n type DocumentSearchState,\n type EditorCaret,\n type EditorExecOptions,\n type FindMatch,\n type HistoryGroupBinding,\n type HistoryGroupBindingOptions,\n} from '@pptx-editor.dev/core/editor';\nimport type { Translate, TranslationKey } from '@pptx-editor.dev/i18n';\nimport { pptxTranslationKey, usePptxEditor, useTranslation } from './composables.ts';\n\n// --- Translation ----------------------------------------------------------------------------\n\n/** What {@link useChromeTranslate} returns: the translation function. @public */\nexport type UseChromeTranslateReturn = ChromeTranslate;\n\n/**\n * The chrome's translation function, as React's `useChromeTranslate`: the `t` of the nearest\n * compound that takes one, else the root's `locale`. `overrides` wins for the keys it holds.\n * @public\n */\nexport function useChromeTranslate(\n overrides?: ReadonlyMap<string, string>\n): UseChromeTranslateReturn {\n const { t } = useTranslation();\n return (key, params) => overrides?.get(key) ?? t(key as TranslationKey, params);\n}\n\n/** What {@link useToolbarContext} returns, as React's `ToolbarContextValue`. @public */\nexport interface UseToolbarContextReturn {\n /** The host's `t` on the nearest compound, or undefined. */\n readonly t: Readonly<ShallowRef<ChromeTranslate | undefined>>;\n}\n\nconst noHostTranslate = shallowRef<ChromeTranslate | undefined>(undefined);\n\n/** The nearest compound's `t`. @internal */\nexport const toolbarContextKey: InjectionKey<Readonly<ShallowRef<ChromeTranslate | undefined>>> =\n Symbol('pptxToolbarContext');\n\n/** The nearest compound's published value, as React's `useToolbarContext`. @public */\nexport function useToolbarContext(): UseToolbarContextReturn {\n return { t: inject(toolbarContextKey, noHostTranslate) };\n}\n\n/** What {@link useToolbarLabelFor} and {@link useToolbarLabel} return. @public */\nexport type UseToolbarLabelForReturn = (key: string) => string;\n\n/** What {@link useToolbarLabel} returns. @public */\nexport type UseToolbarLabelReturn = UseToolbarLabelForReturn;\n\n/** The label for a key: the host's translation, else the locale catalog. @public */\nexport function useToolbarLabelFor(t: ChromeTranslate | undefined): UseToolbarLabelForReturn {\n const { t: catalog } = useTranslation();\n return (key) => t?.(key) ?? catalog(key as TranslationKey);\n}\n\n/** The label for a key: the nearest compound's `t`, else the locale catalog. @public */\nexport function useToolbarLabel(): UseToolbarLabelReturn {\n const host = useToolbarContext().t;\n const { t: catalog } = useTranslation();\n return (key) => host.value?.(key) ?? catalog(key as TranslationKey);\n}\n\n/** The `t` prop of a compound, for its runtime props. @internal */\nexport const chromeTranslateProp = {\n /**\n * Your translation function for this compound and its parts, as DOCX Editor's `t`. Without\n * it, the root's `locale` gives the labels.\n */\n t: { type: Function as unknown as () => ChromeTranslate, default: undefined },\n} as const;\n\n/**\n * Give a compound DOCX Editor's `t` prop: its parts read the host's resolver, and the\n * returned `t` is the compound's own (a component does not see what it provides). @internal\n */\nexport function useChromeTranslateScope(host: () => ChromeTranslate | undefined): {\n readonly t: Translate;\n} {\n const parent = inject(pptxTranslationKey, null);\n const { t: inherited } = useTranslation();\n const scoped = computed<Translate>(\n () => (host() as Translate | undefined) ?? parent?.value ?? inherited\n );\n provide(pptxTranslationKey, scoped as unknown as ShallowRef<Translate>);\n const parentHost = inject(toolbarContextKey, noHostTranslate);\n provide(\n toolbarContextKey,\n computed(() => host() ?? parentHost.value) as unknown as ShallowRef<ChromeTranslate | undefined>\n );\n return {\n t: (key, params) => {\n const own = host();\n return own ? own(key, params) : inherited(key, params);\n },\n };\n}\n\n// --- History groups -------------------------------------------------------------------------\n\n/** What {@link useHistoryGroup} returns, as React's `UseHistoryGroupReturn`. @public */\nexport interface UseHistoryGroupReturn {\n /** Put it on the control as a function ref: the slider, the stepper, or the color input. */\n readonly ref: (element: unknown) => void;\n /** The options for each command of the gesture: `{ historyGroup }`. */\n readonly options: () => EditorExecOptions;\n}\n\n/**\n * One undo step for one gesture on your own control, as React's `useHistoryGroup`. Bind the\n * control with `:ref=\"group.ref\"`, and pass `group.options()` to each command of the gesture.\n * @public\n */\nexport function useHistoryGroup({ kind }: HistoryGroupBindingOptions): UseHistoryGroupReturn {\n const editor = usePptxEditor();\n const element = shallowRef<HTMLElement | null>(null);\n let binding: HistoryGroupBinding | null = null;\n if (getCurrentScope()) {\n const stop = watch(\n [editor, element],\n ([instance, el], _old, onCleanup) => {\n if (!instance || !el) return;\n const current = bindHistoryGroup(instance, el, { kind });\n binding = current;\n onCleanup(() => {\n current.dispose();\n binding = null;\n });\n },\n { immediate: true, flush: 'sync' }\n );\n onScopeDispose(stop);\n }\n return {\n ref: (node) => {\n const el = (node as { $el?: unknown } | null)?.$el ?? node;\n // `nodeType`, not `instanceof HTMLElement`: an element in an iframe has another realm.\n element.value = (el as Node | null)?.nodeType === 1 ? (el as HTMLElement) : null;\n },\n options() {\n if (!binding) throw new Error('history group control is not mounted');\n return binding.options();\n },\n };\n}\n\n// --- Caret ----------------------------------------------------------------------------------\n\n/** What {@link useEditorCaret} returns: the caret, or null. @public */\nexport type UseEditorCaretReturn = Readonly<ShallowRef<EditorCaret | null>>;\n\n/**\n * The caret, as React's `useEditorCaret`: the text box, paragraph, and offset, or null when no\n * text is being edited. The ref changes only when the caret moves. @public\n */\nexport function useEditorCaret(): UseEditorCaretReturn {\n const editor = usePptxEditor();\n const caret = shallowRef<EditorCaret | null>(null);\n if (!getCurrentScope()) return caret;\n const stop = watch(\n editor,\n (instance, _old, onCleanup) => {\n const read = (): void => {\n caret.value = instance ? editorCaretOf(instance.snapshot(), caret.value) : null;\n };\n read();\n if (instance) onCleanup(instance.subscribe(read));\n },\n { immediate: true }\n );\n onScopeDispose(stop);\n return caret;\n}\n\n// --- Search ---------------------------------------------------------------------------------\n\n/** What {@link useDocumentSearch} returns: the session's state as refs, and its actions. @public */\nexport interface UseDocumentSearchReturn {\n readonly query: ComputedRef<string>;\n readonly matchCase: ComputedRef<boolean>;\n readonly wholeWord: ComputedRef<boolean>;\n readonly matches: ComputedRef<readonly FindMatch[]>;\n readonly truncated: ComputedRef<boolean>;\n readonly activeIndex: ComputedRef<number>;\n readonly activeMatch: ComputedRef<FindMatch | null>;\n readonly isPending: ComputedRef<boolean>;\n readonly setQuery: (query: string) => void;\n readonly find: (query: string, options?: DocumentSearchFindOptions) => readonly FindMatch[];\n readonly setMatchCase: (value: boolean) => void;\n readonly setWholeWord: (value: boolean) => void;\n readonly goTo: (index: number) => boolean;\n readonly next: () => boolean;\n readonly previous: () => boolean;\n readonly clear: () => void;\n}\n\n/**\n * The editor's find session with no UI, for your own find bar, as React's\n * `useDocumentSearch`. Every composable on one editor shares the session. @public\n */\nexport function useDocumentSearch(): UseDocumentSearchReturn {\n const editor = usePptxEditor();\n const state = shallowRef<DocumentSearchState>(IDLE_DOCUMENT_SEARCH);\n const search = computed<DocumentSearch | null>(() =>\n editor.value ? documentSearchOf(editor.value) : null\n );\n if (getCurrentScope()) {\n const stop = watch(\n search,\n (session, _old, onCleanup) => {\n state.value = session?.getState() ?? IDLE_DOCUMENT_SEARCH;\n if (session) onCleanup(session.subscribe(() => void (state.value = session.getState())));\n },\n { immediate: true }\n );\n onScopeDispose(stop);\n }\n const field = <K extends keyof DocumentSearchState>(key: K) => computed(() => state.value[key]);\n return {\n query: field('query'),\n matchCase: field('matchCase'),\n wholeWord: field('wholeWord'),\n matches: field('matches'),\n truncated: field('truncated'),\n activeIndex: field('activeIndex'),\n activeMatch: field('activeMatch'),\n isPending: field('isPending'),\n setQuery: (query) => search.value?.setQuery(query),\n find: (query, options) => search.value?.find(query, options) ?? IDLE_DOCUMENT_SEARCH.matches,\n setMatchCase: (value) => search.value?.setMatchCase(value),\n setWholeWord: (value) => search.value?.setWholeWord(value),\n goTo: (index) => search.value?.goTo(index) ?? false,\n next: () => search.value?.next() ?? false,\n previous: () => search.value?.previous() ?? false,\n clear: () => search.value?.clear(),\n };\n}\n","/** @jsxImportSource vue */\n// The link popup: the Vue twin of the React adapter's `HyperlinkPopup.tsx` and of its root host.\n// `HyperlinkPopup` is the packaged panel, `PptxEditorHyperLink` (`HyperLink.tsx`) with its default\n// parts, over the root's one popup state, else over a state built from its props.\n// `PptxEditorRoot` hosts it (`LinkPopupHost`): the link control, Insert > Link, and Ctrl/Cmd+K\n// open it in edit mode, a click into linked text in reading mode; the `popups.hyperlink`\n// registry entry can replace it or turn it off. The request, anchor, and click rules are core's\n// (`overlays.ts`, `link-popup.ts`).\n\nimport {\n defineComponent,\n inject,\n onUnmounted,\n provide,\n shallowRef,\n useId,\n watch,\n type ExtractPublicPropTypes,\n type PropType,\n} from 'vue';\nimport {\n focusSurfaceOf,\n hyperlinkEntryReads,\n hyperlinkPopupFromRequest,\n linkPopupAnnouncement,\n linkPopupReturnsFocus,\n listenLinkClicks,\n listenLinkPanelKey,\n listenLinkRequests,\n type HyperlinkPopupController,\n type HyperlinkPopupStore,\n type HyperlinkPopupState,\n} from '@pptx-editor.dev/core/editor';\nimport { useEditorCommand, usePptxEditor, useTranslation } from './composables.ts';\nimport { PptxEditorHyperLink } from './HyperLink.tsx';\nimport { hyperlinkPopupKey } from './useHyperlinkPopup.ts';\nimport { usePopupEntry } from './popups.ts';\n\nconst hyperlinkPopupProps = {\n /**\n * The element the popup opens under: the caret after a click into a link, the toolbar's link\n * button, else the element the request came from (the slide for Ctrl/Cmd+K).\n */\n // No runtime type check: an element from another window (an iframe) is not `HTMLElement`.\n anchor: { type: null as unknown as PropType<HTMLElement | null>, required: true as const },\n /** The link of the selection now, or an empty string. */\n url: { type: String, required: true as const },\n /**\n * `reading` after a click into linked text (the target, Copy, Edit, Unlink), `editing` for the\n * URL field. Absent means `editing`. `useHyperlinkPopup()` gives the state and the actions.\n */\n mode: { type: String as PropType<'reading' | 'editing'>, default: undefined },\n /** Close the popup. Apply the link with `editor.exec({ type: 'setLink', url })`. */\n onClose: { type: Function as PropType<() => void>, required: true as const },\n /** A class name added to the popup panel, for a host renderer that forwards these props. */\n className: { type: String, default: undefined },\n} as const;\n\n/** What a replacement link popup receives, the twin of React's `HyperlinkPopupProps`. @public */\nexport type HyperlinkPopupProps = ExtractPublicPropTypes<typeof hyperlinkPopupProps>;\n\n/** Provide `controller` to the parts, with its state as a ref. Stops with the component. */\nfunction provideController(controller: HyperlinkPopupController, errorId: string): void {\n const state = shallowRef<HyperlinkPopupState>(controller.getState());\n const stop = controller.subscribe(() => {\n state.value = controller.getState();\n });\n onUnmounted(stop);\n provide(hyperlinkPopupKey, { controller, state, errorId });\n}\n\n/**\n * The packaged link popup: `PptxEditorHyperLink` with its default parts. A `popups.hyperlink`\n * renderer can forward its props to it. A host `class` goes on the popup panel, as `className`\n * does. @public\n */\nexport const HyperlinkPopup = defineComponent({\n name: 'HyperlinkPopup',\n inheritAttrs: false,\n props: hyperlinkPopupProps,\n setup(props, { attrs }) {\n // Outside the root that owns the shared state, a state of its own from the props.\n if (!inject(hyperlinkPopupKey, null)) {\n const editorRef = usePptxEditor();\n const own = hyperlinkPopupFromRequest(editorRef.value, {\n anchor: props.anchor,\n url: props.url,\n onClose: () => props.onClose(),\n ...(props.mode ? { mode: props.mode } : {}),\n });\n onUnmounted(() => own.dispose());\n provideController(own, useId());\n }\n return () => {\n const extra = [props.className, attrs.class as string | undefined].filter(Boolean).join(' ');\n return <PptxEditorHyperLink {...(extra ? { className: extra } : {})} />;\n };\n },\n});\n\n/**\n * The link popup of one root: `popups.hyperlink`, or the packaged `PptxEditorHyperLink`. It owns\n * the root's one popup state. Placed by `PptxEditorRoot`, so every opener works with no toolbar\n * on the page, as React's root. @internal\n */\nexport const LinkPopupHost = defineComponent({\n name: 'PptxLinkPopupHost',\n props: {\n store: { type: Object as PropType<HyperlinkPopupStore>, required: true as const },\n views: { type: Number, required: true as const },\n },\n setup(props) {\n const editorRef = usePptxEditor();\n const entry = usePopupEntry('hyperlink');\n const cmd = useEditorCommand('text.link');\n const { t } = useTranslation();\n const state = shallowRef(props.store.getState());\n let open = false;\n const stopState = props.store.subscribe(() => {\n const now = props.store.getState();\n const editor = editorRef.value;\n const isOpen = now.mode !== 'closed';\n if (open && !isOpen && editor && linkPopupReturnsFocus(editor)) focusSurfaceOf(editor);\n open = isOpen;\n state.value = now;\n });\n onUnmounted(() => {\n props.store.setEditor(null);\n stopState();\n });\n watch(editorRef, (editor) => props.store.setEditor(editor), { immediate: true });\n // A host hook keeps link controls active when the packaged popup is disabled.\n watch(\n () => entry() === false && props.views === 0,\n (off) => {\n if (off) props.store.close();\n },\n { immediate: true }\n );\n watch(\n () => [editorRef.value, entry(), props.views] as const,\n ([editor, current, views], _old, onCleanup) => {\n const controller = props.store.controller();\n if (!editor || !controller || (current === false && views === 0)) return;\n const stopRequests = listenLinkRequests(\n editor,\n () => cmd.isEnabled.value,\n (at) => controller.openEditing(at)\n );\n // Preserve reading clicks and F6. Custom renderers still opt into reading mode.\n const reads = current === false ? views > 0 : hyperlinkEntryReads(current);\n const stopClicks = reads\n ? listenLinkClicks(editor, (at) => controller.openReading(at))\n : () => {};\n const stopKey = reads\n ? listenLinkPanelKey(editor, () => controller.getState().mode === 'reading')\n : () => {};\n onCleanup(() => {\n stopRequests();\n stopClicks();\n stopKey();\n });\n },\n { immediate: true }\n );\n return () => {\n const current = entry();\n const s = state.value;\n if (current === false) return null;\n // Keep the live region mounted so reading and copy state changes are announced.\n const live = (\n <span class=\"pptx-sr-only\" role=\"status\" aria-live=\"polite\">\n {linkPopupAnnouncement(s, t)}\n </span>\n );\n if (s.mode === 'closed') return live;\n const panel =\n typeof current === 'function' ? (\n current({ anchor: s.anchor, url: s.url, mode: s.mode, onClose: props.store.close })\n ) : (\n <PptxEditorHyperLink />\n );\n return [panel, live];\n };\n },\n});\n","/** @jsxImportSource vue */\n// `PptxEditorHyperLink`: the Vue twin of the React adapter's `HyperLink.tsx`, the link popup\n// with named parts after DOCX Editor's `DocxEditor.HyperLink`. A click into linked text opens\n// it in reading mode (the target, Copy, Edit, Unlink); Ctrl/Cmd+K, the link control, Insert >\n// Link, and Edit open it in edit mode (the URL field, Apply, Cancel). The state is the root's\n// (core's `createHyperlinkPopupController`). The same ladder as React: `class` / `className`\n// and `data-mode`, an `icon` slot on the actions, `asChild`, in-place part override with\n// `hidden` and `preset: false`, and `useHyperlinkPopup()`. A renderer shows reading mode only\n// when registered with `definePopup(Component, { reading: true })`. F6 moves focus from the\n// slide text into an open reading panel.\n\nimport {\n cloneVNode,\n defineComponent,\n Fragment,\n inject,\n isVNode,\n onMounted,\n ref,\n shallowRef,\n watch,\n type ExtractPublicPropTypes,\n type VNode,\n type VNodeArrayChildren,\n} from 'vue';\nimport {\n translateKeyOrText,\n linkSelectionRect,\n type HyperlinkPopupState,\n} from '@pptx-editor.dev/core/editor';\nimport { Icon, Popover } from './chrome.tsx';\nimport { usePptxEditor, useTranslation } from './composables.ts';\nimport { hyperlinkPopupKey, useHyperlinkPopup } from './useHyperlinkPopup.ts';\n\nconst CLOSED_STATE: HyperlinkPopupState = {\n mode: 'closed',\n url: '',\n href: null,\n draft: '',\n error: null,\n copied: false,\n canEdit: false,\n anchor: null,\n};\n\nconst partProps = {\n /** A class name added to the part (`class` works too). */\n className: { type: String, default: undefined },\n /** Put this part's wiring on the one child element of the default slot. */\n asChild: { type: Boolean, default: false },\n /** Render nothing: inside the default arrangement this removes the part. */\n hidden: { type: Boolean, default: false },\n} as const;\n\n/** Shared props of every part, the twin of React's `HyperLinkPartProps`. @public */\nexport type HyperLinkPartProps = ExtractPublicPropTypes<typeof partProps>;\n/** Props of the action parts; the glyph is the `icon` slot. @public */\nexport type HyperLinkActionProps = HyperLinkPartProps;\n\nconst rootProps = {\n ...partProps,\n /** Render the packaged parts. `false` renders only the panel and the default slot. */\n preset: { type: Boolean, default: true },\n} as const;\n\n/** Props of `PptxEditorHyperLink`. @public */\nexport type HyperLinkProps = ExtractPublicPropTypes<typeof rootProps>;\n\n/** Keeps the caret: a press in the panel must not move it. Fields are exempt. */\nfunction guardMousedown(event: MouseEvent): void {\n const tag = (event.target as HTMLElement | null)?.tagName;\n if (tag === 'INPUT' || tag === 'SELECT' || tag === 'TEXTAREA') return;\n event.preventDefault();\n}\n\n/** The top-level vnodes of `children`, with fragments opened. */\nfunction flatten(children: VNodeArrayChildren | undefined, out: VNode[] = []): VNode[] {\n for (const child of children ?? []) {\n if (Array.isArray(child)) flatten(child, out);\n else if (isVNode(child)) {\n if (child.type === Fragment && Array.isArray(child.children))\n flatten(child.children as VNodeArrayChildren, out);\n else out.push(child);\n }\n }\n return out;\n}\n\n/** The part's own element, or its wiring on the host's one child (`asChild`). */\nfunction wire(\n asChild: boolean,\n children: VNode[] | undefined,\n props: Record<string, unknown>,\n fallback: () => VNode\n): VNode {\n const only = asChild ? flatten(children) : [];\n const child = only.length === 1 && typeof only[0]!.type !== 'symbol' ? only[0] : undefined;\n return child ? cloneVNode(child, props, true) : fallback();\n}\n\ntype PartName = 'Url' | 'Copy' | 'Edit' | 'Unlink' | 'Fields' | 'Error' | 'Apply' | 'Cancel';\n\n/** A part component, marked with its name so the preset swaps a host copy in place. */\nfunction part<P>(name: PartName, component: P): P {\n return Object.assign(component as object, { pptxHyperLinkPart: name }) as P;\n}\n\nconst HyperLinkUrl = part(\n 'Url',\n defineComponent({\n name: 'PptxEditorHyperLinkUrl',\n props: partProps,\n setup(props, { slots }) {\n const { state } = useHyperlinkPopup();\n const { t } = useTranslation();\n return () => {\n const s = state.value;\n if (props.hidden || !s.url) return null;\n const children = slots.default?.();\n const text = () => <bdi dir=\"ltr\">{s.url}</bdi>;\n if (!s.href) {\n const attrs = {\n class: ['pptx-link__url', props.className],\n 'data-inert': '',\n title: t('link.unsafe'),\n };\n return wire(props.asChild, children, attrs, () => (\n <span {...attrs}>{children ?? text()}</span>\n ));\n }\n const attrs = {\n class: ['pptx-link__url', props.className],\n href: s.href,\n target: '_blank',\n rel: 'noopener noreferrer',\n title: t('link.open'),\n onMousedown: guardMousedown,\n };\n return wire(props.asChild, children, attrs, () => (\n <a {...attrs}>\n {children ?? text()}\n <Icon name=\"open_in_new\" />\n </a>\n ));\n };\n },\n })\n);\n\n/** An icon button of the reading row. */\nfunction actionPart(\n name: 'Copy' | 'Edit' | 'Unlink',\n cls: string,\n glyph: string,\n use: () => { label: () => string; run: () => void; shown?: () => boolean; extra?: () => object }\n) {\n return part(\n name,\n defineComponent({\n name: `PptxEditorHyperLink${name}`,\n props: partProps,\n setup(props, { slots }) {\n const action = use();\n return () => {\n if (props.hidden || action.shown?.() === false) return null;\n const label = action.label();\n const attrs = {\n type: 'button' as const,\n class: [`pptx-link__action pptx-link__${cls}`, props.className],\n 'aria-label': label,\n title: label,\n onMousedown: guardMousedown,\n onClick: action.run,\n ...action.extra?.(),\n };\n const children = slots.default?.();\n return wire(props.asChild, children, attrs, () => (\n <button {...attrs}>{slots.icon?.() ?? children ?? <Icon name={glyph} />}</button>\n ));\n };\n },\n })\n );\n}\n\nconst HyperLinkCopy = actionPart('Copy', 'copy', 'content_copy', () => {\n const { state, copy } = useHyperlinkPopup();\n const { t } = useTranslation();\n return {\n label: () => t(state.value.copied ? 'link.copied' : 'link.copy'),\n run: () => void copy(),\n shown: () => !!state.value.href,\n extra: () => (state.value.copied ? { 'data-copied': '' } : {}),\n };\n});\n\nconst HyperLinkEdit = actionPart('Edit', 'edit', 'edit', () => {\n const { beginEdit } = useHyperlinkPopup();\n const { t } = useTranslation();\n return { label: () => t('link.edit'), run: beginEdit };\n});\n\nconst HyperLinkUnlink = actionPart('Unlink', 'unlink', 'link_off', () => {\n const { unlink } = useHyperlinkPopup();\n const { t } = useTranslation();\n return { label: () => t('link.remove'), run: () => void unlink() };\n});\n\nconst HyperLinkFields = part(\n 'Fields',\n defineComponent({\n name: 'PptxEditorHyperLinkFields',\n props: partProps,\n setup(props) {\n const provision = inject(hyperlinkPopupKey, null);\n const { state, setUrl, commitEdit } = useHyperlinkPopup();\n const { t } = useTranslation();\n const field = ref<HTMLInputElement | null>(null);\n // After the popover is placed: a browser does not focus into a hidden panel.\n onMounted(() => {\n field.value?.focus({ preventScroll: true });\n field.value?.select();\n });\n return () => {\n if (props.hidden) return null;\n const s = state.value;\n return (\n <input\n ref={field}\n class={['pptx-font-picker__search pptx-link__field', props.className]}\n type=\"url\"\n dir=\"ltr\"\n aria-label={t('link.label')}\n placeholder={t('link.placeholder')}\n value={s.draft}\n aria-invalid={s.error ? true : undefined}\n aria-describedby={s.error && provision ? provision.errorId : undefined}\n onInput={(e: Event) => setUrl((e.target as HTMLInputElement).value)}\n onKeydown={(e: KeyboardEvent) => {\n if (e.key !== 'Enter') return;\n // The Enter that applies must not reach the element focus moves to next.\n e.preventDefault();\n commitEdit();\n }}\n />\n );\n };\n },\n })\n);\n\nconst HyperLinkError = part(\n 'Error',\n defineComponent({\n name: 'PptxEditorHyperLinkError',\n props: partProps,\n setup(props) {\n const provision = inject(hyperlinkPopupKey, null);\n const { t } = useTranslation();\n return () => {\n const error = provision?.state.value.error;\n if (props.hidden || !error) return null;\n return (\n <p id={provision.errorId} role=\"alert\" class={['pptx-link__error', props.className]}>\n {translateKeyOrText(t, error)}\n </p>\n );\n };\n },\n })\n);\n\n/** A text button of the edit row. */\nfunction textPart(\n name: 'Apply' | 'Cancel',\n cls: string,\n labelKey: 'link.apply' | 'link.cancel',\n primary: boolean\n) {\n return part(\n name,\n defineComponent({\n name: `PptxEditorHyperLink${name}`,\n props: partProps,\n setup(props, { slots }) {\n const { state, commitEdit, close } = useHyperlinkPopup();\n const { t } = useTranslation();\n return () => {\n if (props.hidden) return null;\n const attrs = {\n type: 'button' as const,\n class: [\n primary ? 'pptx-button pptx-button--primary' : 'pptx-button',\n cls,\n props.className,\n ],\n disabled: primary ? state.value.draft.trim().length === 0 : undefined,\n onMousedown: guardMousedown,\n onClick: primary ? () => void commitEdit() : close,\n };\n const children = slots.default?.();\n return wire(props.asChild, children, attrs, () => (\n <button {...attrs}>{children ?? t(labelKey)}</button>\n ));\n };\n },\n })\n );\n}\n\nconst HyperLinkApply = textPart('Apply', 'pptx-link__apply', 'link.apply', true);\nconst HyperLinkCancel = textPart('Cancel', 'pptx-link__cancel', 'link.cancel', false);\n\n/** Each part child by its name, so the preset swaps it in place; other children follow. */\nfunction partOverrides(children: VNode[] | undefined): {\n parts: Partial<Record<PartName, VNode>>;\n extra: VNode[];\n} {\n const parts: Partial<Record<PartName, VNode>> = {};\n const extra: VNode[] = [];\n for (const node of flatten(children)) {\n const name = (node.type as { pptxHyperLinkPart?: PartName } | null)?.pptxHyperLinkPart;\n if (name) parts[name] = node;\n else extra.push(node);\n }\n return { parts, extra };\n}\n\n/** The default arrangement of the mode, with host parts in place. */\nfunction preset(state: HyperlinkPopupState, children: VNode[] | undefined): VNodeArrayChildren {\n const { parts, extra } = partOverrides(children);\n const take = (name: PartName, fallback: () => VNode): VNode | null =>\n name in parts ? (parts[name] ?? null) : fallback();\n if (state.mode === 'editing')\n return [\n // An existing link keeps its target, Copy, and Open while it is edited.\n state.url ? (\n <div class=\"pptx-link__row\">\n {take('Url', () => (\n <HyperLinkUrl />\n ))}\n <div class=\"pptx-link__tools\">\n {take('Copy', () => (\n <HyperLinkCopy />\n ))}\n </div>\n </div>\n ) : null,\n take('Fields', () => <HyperLinkFields />),\n take('Error', () => <HyperLinkError />),\n <div class=\"pptx-link__actions\">\n {state.url && state.canEdit ? take('Unlink', () => <HyperLinkUnlink />) : null}\n {take('Cancel', () => (\n <HyperLinkCancel />\n ))}\n {take('Apply', () => (\n <HyperLinkApply />\n ))}\n </div>,\n ...extra,\n ];\n return [\n <div class=\"pptx-link__row\">\n {take('Url', () => (\n <HyperLinkUrl />\n ))}\n <div class=\"pptx-link__tools\">\n {take('Copy', () => (\n <HyperLinkCopy />\n ))}\n {/* An action that can never run is absent, not disabled: a read-only editor. */}\n {state.canEdit ? take('Edit', () => <HyperLinkEdit />) : null}\n {state.canEdit ? take('Unlink', () => <HyperLinkUnlink />) : null}\n </div>\n </div>,\n take('Error', () => <HyperLinkError />),\n ...extra,\n ];\n}\n\nconst HyperLinkRoot = defineComponent({\n name: 'PptxEditorHyperLink',\n inheritAttrs: false,\n props: rootProps,\n setup(props, { slots, attrs }) {\n const provision = inject(hyperlinkPopupKey, null);\n const { t } = useTranslation();\n const editorRef = usePptxEditor();\n const selectionRect = shallowRef<ReturnType<typeof linkSelectionRect>>(null);\n watch(\n () => [editorRef.value, provision?.state.value.mode, provision?.state.value.anchor] as const,\n ([editor, mode, anchor], previous) => {\n if (!mode || mode === 'closed') {\n selectionRect.value = null;\n } else if (\n !previous ||\n previous[1] === 'closed' ||\n previous[0] !== editor ||\n previous[2] !== anchor\n ) {\n // Keep the selection box while the field takes focus and its draft changes.\n selectionRect.value = editor ? linkSelectionRect(editor) : null;\n }\n },\n { immediate: true, flush: 'sync' }\n );\n return () => {\n const state = provision?.state.value ?? CLOSED_STATE;\n if (!provision || state.mode === 'closed') return null;\n const children = slots.default?.();\n // `hidden` drops the packaged panel only: the gestures stay, so a host renders its own UI.\n if (props.hidden) return children ?? null;\n const reading = state.mode === 'reading';\n const inner = { class: 'pptx-link', 'data-mode': state.mode };\n const body = props.preset ? preset(state, children) : children;\n const extra = [props.className, attrs.class as string | undefined].filter(Boolean).join(' ');\n return (\n <Popover\n anchor={state.anchor}\n anchorRect={selectionRect.value}\n role=\"dialog\"\n label={t(reading ? 'link.label' : state.url ? 'link.edit' : 'link.insert')}\n onClose={() => provision.controller.close()}\n // Reading leaves the keys in the slide text; editing takes them in its field.\n passive={reading}\n field={!reading}\n className={extra ? `pptx-link-popup ${extra}` : 'pptx-link-popup'}\n >\n {{\n default: () => wire(props.asChild, children, inner, () => <div {...inner}>{body}</div>),\n }}\n </Popover>\n );\n };\n },\n});\n\n/** `PptxEditorHyperLink`: the link popup with named parts, the twin of React's. @public */\nexport const PptxEditorHyperLink = Object.assign(HyperLinkRoot, {\n Url: HyperLinkUrl,\n Copy: HyperLinkCopy,\n Edit: HyperLinkEdit,\n Unlink: HyperLinkUnlink,\n Fields: HyperLinkFields,\n Error: HyperLinkError,\n Apply: HyperLinkApply,\n Cancel: HyperLinkCancel,\n});\n","// The link popup's behavior with no UI: the Vue twin of React's `useHyperlinkPopup.ts`, after\n// DOCX Editor's composable of the same name. The state and the actions are core's\n// (`createHyperlinkPopupStore` in `overlays.ts`); these composables subscribe to one store and\n// bind it to the editor's link requests.\n\nimport {\n computed,\n getCurrentScope,\n inject,\n onScopeDispose,\n provide,\n ref,\n shallowRef,\n watch,\n useId,\n type ComputedRef,\n type InjectionKey,\n type Ref,\n type ShallowRef,\n} from 'vue';\nimport {\n createHyperlinkPopupStore,\n hyperlinkPopupActions,\n listenHyperlinkPopup,\n openHyperlinkPopup,\n type HyperlinkPopupController,\n type HyperlinkPopupActions,\n type HyperlinkPopupState,\n type HyperlinkPopupStore,\n} from '@pptx-editor.dev/core/editor';\nimport { useEditorCommand, usePptxEditor } from './composables.ts';\n\n/** What `useHyperlinkPopup` returns, the twin of React's, with the state as a ref. @public */\nexport interface UseHyperlinkPopupReturn extends HyperlinkPopupActions {\n /** Whether the popup shows, what it shows, and the draft. */\n readonly state: ComputedRef<HyperlinkPopupState>;\n}\n\n/** What `useHyperlinkPopupInstance` returns: the same shape as `useHyperlinkPopup`. @public */\nexport type UseHyperlinkPopupInstanceReturn = UseHyperlinkPopupReturn;\n\n/** The link popup store of the enclosing root. @internal */\nconst hyperlinkPopupStoreKey: InjectionKey<HyperlinkPopupStore> = Symbol('pptxHyperlinkPopupStore');\n\n/** The state and controller shared by the named link parts. @internal */\nexport interface HyperlinkPopupProvision {\n readonly controller: HyperlinkPopupController;\n readonly state: Readonly<ShallowRef<HyperlinkPopupState>>;\n readonly errorId: string;\n}\n\n/** @internal */\nexport const hyperlinkPopupKey: InjectionKey<HyperlinkPopupProvision> =\n Symbol('pptxHyperlinkPopup');\n\n/** The link popup store of the enclosing root, or null, without counting a view. @internal */\nexport function injectHyperlinkPopupStore(): HyperlinkPopupStore | null {\n return inject(hyperlinkPopupStoreKey, null);\n}\n/** Counts the host panels that show the root's link popup state. @internal */\nconst hyperlinkPopupViewsKey: InjectionKey<() => () => void> = Symbol('pptxHyperlinkPopupViews');\n\n/** Bind `store` to the editor, and while `active`, to its link requests. @internal */\nexport function useHyperlinkPopupBinding(store: HyperlinkPopupStore, active: () => boolean): void {\n const editorRef = usePptxEditor();\n const cmd = useEditorCommand('text.link');\n onScopeDispose(() => store.setEditor(null));\n watch(\n () => [editorRef.value, active()] as const,\n ([editor, on], _old, onCleanup) => {\n store.setEditor(editor);\n if (!editor || !on) return;\n // Requests for this editor only: another editor on the page opens its own popup.\n onCleanup(listenHyperlinkPopup(store, editor, () => cmd.isEnabled.value));\n },\n { immediate: true }\n );\n}\n\n/** The state and actions of `store`, with the state as a ref. */\nfunction storeResult(store: HyperlinkPopupStore): UseHyperlinkPopupReturn {\n const state = shallowRef(store.getState());\n const stop = store.subscribe(() => {\n state.value = store.getState();\n });\n if (getCurrentScope()) onScopeDispose(stop);\n return { state: computed(() => state.value), ...hyperlinkPopupActions(store) };\n}\n\n/**\n * Provide the root's link popup store and return it, with the count of host panels that show\n * it. @internal\n */\nexport function provideHyperlinkPopup(): {\n readonly store: HyperlinkPopupStore;\n readonly views: Readonly<Ref<number>>;\n} {\n const store = createHyperlinkPopupStore();\n const views = ref(0);\n provide(hyperlinkPopupStoreKey, store);\n const state = shallowRef(store.getState());\n onScopeDispose(\n store.subscribe(() => {\n state.value = store.getState();\n })\n );\n const relay: HyperlinkPopupController = {\n getState: store.getState,\n subscribe: store.subscribe,\n openReading: (anchor) => store.controller()?.openReading(anchor),\n openEditing: (anchor) => store.controller()?.openEditing(anchor),\n beginEdit: store.beginEdit,\n setUrl: store.setUrl,\n commitEdit: store.commitEdit,\n unlink: store.unlink,\n copy: store.copy,\n openTarget: store.openTarget,\n close: store.close,\n dispose: () => {},\n };\n provide(hyperlinkPopupKey, { controller: relay, state, errorId: useId() });\n provide(hyperlinkPopupViewsKey, () => {\n views.value += 1;\n let attached = true;\n return () => {\n if (!attached) return;\n attached = false;\n views.value -= 1;\n };\n });\n return { store, views };\n}\n\n/**\n * The link popup's behavior, for your own link UI, the twin of React's `useHyperlinkPopup`.\n * Inside `PptxEditorRoot` it is the shared state that the packaged popup shows; with\n * `popups.hyperlink: false`, the link controls open your panel while it is mounted. Outside a\n * root it is a standalone instance. @public\n */\nexport function useHyperlinkPopup(): UseHyperlinkPopupReturn {\n const provided = inject(hyperlinkPopupStoreKey, null);\n const attach = inject(hyperlinkPopupViewsKey, null);\n // Counted only where a scope can count it off again.\n if (provided && attach && getCurrentScope()) onScopeDispose(attach());\n if (provided) return storeResult(provided);\n // A standalone packaged popup provides its props-backed controller to its named parts.\n const own = inject(hyperlinkPopupKey, null);\n if (own) {\n const editorRef = usePptxEditor();\n const c = own.controller;\n return {\n state: computed(() => own.state.value),\n open: (link, anchor) => {\n if (editorRef.value) openHyperlinkPopup(c, editorRef.value, link, anchor);\n },\n openAtCaret: (anchor) => c.openEditing(anchor ?? null),\n close: () => c.close(),\n copy: () => c.copy(),\n beginEdit: () => c.beginEdit(),\n setUrl: (url) => c.setUrl(url),\n commitEdit: () => c.commitEdit(),\n unlink: () => c.unlink(),\n openTarget: () => c.openTarget(),\n };\n }\n return useHyperlinkPopupInstance();\n}\n\n/**\n * A link popup of its own, the twin of React's `useHyperlinkPopupInstance`. While `active`, it\n * opens for the link requests of the editor. @public\n */\nexport function useHyperlinkPopupInstance(active = true): UseHyperlinkPopupInstanceReturn {\n const store = createHyperlinkPopupStore();\n useHyperlinkPopupBinding(store, () => active);\n return storeResult(store);\n}\n","/** @jsxImportSource vue */\n// The slide canvas's context menu request: the Vue twin of the React adapter's\n// `CanvasContextMenu.tsx`. The engine surface stops the browser's own menu and selects what is\n// under the pointer first (`surface-context-menu.ts`); this composable reads the selection,\n// opens a menu request for it (shapes, pictures, text being edited, or empty slide area), and\n// renders the `popups.contextMenu` entry (or the entry of a `PptxEditorContextMenu` placed in\n// the root): the packaged `PptxEditorContextMenu` by default, a\n// host renderer, or nothing for `false`. `PptxEditorContent` binds it.\n\nimport { h, shallowRef, watch, type VNodeChild } from 'vue';\nimport {\n canvasMenuKind,\n canvasMenuPoint,\n isContextMenuKey,\n type CanvasMenuKind,\n} from '@pptx-editor.dev/core/editor';\nimport type { ContextMenuPoint } from './ContextMenu.tsx';\nimport { usePptxEditor } from './composables.ts';\nimport {\n ContextMenuTargetProvider,\n PptxEditorContextMenu,\n type ContextMenuRequest,\n} from './context-menu-parts.tsx';\nimport { useCanvasMenuEntry } from './popups.ts';\n\ninterface CanvasMenuState {\n readonly at: ContextMenuPoint;\n readonly kind: CanvasMenuKind;\n readonly keyboard: boolean;\n readonly owner: HTMLElement;\n}\n\n/** What `useCanvasContextMenu` returns. @internal */\nexport interface UseCanvasContextMenuReturn {\n /** Bind to the canvas element's `contextmenu` event. */\n readonly onContextmenu: (e: MouseEvent) => void;\n /** Bind to the canvas element's `keydown` event: Shift+F10 and the Menu key. */\n readonly onKeydown: (e: KeyboardEvent) => void;\n /** Render next to the canvas: the open menu, or nothing. */\n readonly layer: () => VNodeChild;\n}\n\n/**\n * The canvas context menu. Returns the handlers the canvas host binds (right-click, Shift+F10,\n * and the Menu key) and the layer that renders the open menu. @internal\n */\nexport function useCanvasContextMenu(): UseCanvasContextMenuReturn {\n const editor = usePptxEditor();\n const entry = useCanvasMenuEntry();\n const menu = shallowRef<ContextMenuRequest | null>(null);\n // An entry that turns `false` (a placed menu turned `disabled`) closes the open menu.\n watch(\n () => entry() === false,\n (off) => {\n if (off) menu.value = null;\n }\n );\n // Each request mounts the menu anew, so a part reads a fixed request (`useContextMenuRequest`).\n let opened = 0;\n let keyboardAt = 0;\n const open = (owner: HTMLElement, at: ContextMenuPoint | null): void => {\n const instance = editor.value;\n if (entry() === false || !instance || instance.snapshot().status !== 'ready') return;\n const state: CanvasMenuState = {\n // From the keyboard: open at the selection, or at the middle of the canvas.\n at: canvasMenuPoint(owner, at),\n kind: canvasMenuKind(instance.snapshot()),\n keyboard: at === null,\n owner,\n };\n opened++;\n const request: ContextMenuRequest = {\n ...state,\n close: () => {\n if (menu.value === request) menu.value = null;\n },\n };\n menu.value = request;\n };\n const onContextmenu = (e: MouseEvent): void => {\n e.preventDefault();\n // A Menu key press that also fires `contextmenu` opens the menu once.\n if (Date.now() - keyboardAt < 500) return;\n const pointer = e.clientX !== 0 || e.clientY !== 0;\n open(e.currentTarget as HTMLElement, pointer ? { x: e.clientX, y: e.clientY } : null);\n };\n const onKeydown = (e: KeyboardEvent): void => {\n if (!isContextMenuKey(e)) return;\n e.preventDefault();\n e.stopPropagation();\n keyboardAt = Date.now();\n open(e.currentTarget as HTMLElement, null);\n };\n const layer = (): VNodeChild => {\n const target = menu.value;\n const renderer = entry();\n if (!target || renderer === false) return null;\n return h(\n ContextMenuTargetProvider,\n { key: opened, value: target },\n {\n default: () => (typeof renderer === 'function' ? renderer({}) : h(PptxEditorContextMenu)),\n }\n );\n };\n return { onContextmenu, onKeydown, layer };\n}\n","/** @jsxImportSource vue */\n// `PptxEditorContextMenu`: the slide canvas's context menu as library parts, the Vue twin of\n// the React adapter's `PptxEditor.ContextMenu` (`context-menu-parts.tsx`), after DOCX Editor's\n// `DocxEditorContextMenu` (docx-editor/docs/site/content/customization/menus.mdx).\n//\n// The canvas opens a menu request (right-click, Shift+F10, the Menu key) for what is under the\n// pointer: shapes, pictures, text being edited, or empty slide area. The menu renders core's\n// `CANVAS_CONTEXT_MENUS` rows for that kind. `PptxEditorContextMenu.Slot slot-id` replaces or\n// hides one row in place, other children add rows at the end, and `:preset=\"false\"` keeps only\n// the children. The `popups.contextMenu` registry entry, or a menu placed in the root, decides\n// what the canvas renders.\n\nimport {\n chromeTranslateProp,\n useChromeTranslateScope,\n useToolbarContext,\n} from './headless-hooks.ts';\nimport {\n defineComponent,\n h,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n watch,\n type ExtractPublicPropTypes,\n type InjectionKey,\n type PropType,\n type VNode,\n} from 'vue';\nimport {\n CANVAS_CONTEXT_MENUS,\n CONTEXT_MENU_NAMED_PARTS,\n arrangeMenuRows,\n canvasMenuLabelKey,\n warnMenuPart,\n type CanvasMenuKind,\n type ContextMenuPartName,\n} from '@pptx-editor.dev/core/editor';\nimport { ContextMenu, type ContextMenuPoint } from './ContextMenu.tsx';\nimport { MenuRow, MenuSeparator, MenuSubmenu } from './menu-row.tsx';\nimport { MenuEntries, VUE_MENU_PARTS } from './menu-rows.tsx';\nimport {\n MenuCloseScope,\n MenuGroup,\n MenuSlotItem,\n defineMenuRowParts,\n flattenMenuChildren,\n slotRowOf,\n type MenuRowPartComponent,\n} from './menu-parts.tsx';\nimport { useCanvasMenuRegistry } from './popups.ts';\n\n/**\n * The named rows of the canvas context menu (`PptxEditorContextMenu.Cut`, …), the twin of\n * React's `ContextMenuNamedRows`. @public\n */\nexport type ContextMenuNamedRows = {\n readonly [K in ContextMenuPartName]: MenuRowPartComponent;\n};\n\nconst CONTEXT_MENU_ROW_PARTS: ContextMenuNamedRows = defineMenuRowParts(CONTEXT_MENU_NAMED_PARTS);\n\n/** What a canvas context menu opened on, and where. @public */\nexport interface ContextMenuRequest {\n /**\n * Shapes, pictures only (`picture`, the picture menu), text being edited, or empty slide\n * area. A selection of pictures only reports `picture`, not `shapes`.\n */\n readonly kind: CanvasMenuKind;\n /** Where the menu opens, in client pixels. */\n readonly at: ContextMenuPoint;\n /** Opened from the keyboard: focus goes to the first row. */\n readonly keyboard: boolean;\n /** The canvas element the menu opened on. */\n readonly owner: HTMLElement;\n /** Close the menu. */\n readonly close: () => void;\n}\n\nconst requestKey: InjectionKey<ContextMenuRequest | null> = Symbol('pptxContextMenuRequest');\n\n/** Provides an open menu request to `PptxEditorContextMenu`. @internal */\nexport const ContextMenuTargetProvider = defineComponent({\n name: 'PptxContextMenuTargetProvider',\n props: { value: { type: Object as PropType<ContextMenuRequest>, required: true as const } },\n setup(props, { slots }) {\n // The canvas mounts one provider per request, so the request is fixed for its life.\n provide(requestKey, props.value);\n return () => slots.default?.();\n },\n});\n\n/** What `useContextMenuRequest` returns: the open request, or null. @public */\nexport type UseContextMenuRequestReturn = ContextMenuRequest | null;\n\n/**\n * The open canvas context menu, for a host's own rows: what it opened on, where, and how to\n * close it. Null outside an open menu. Each request mounts the menu anew, so the value is fixed\n * for the menu's life. @public\n */\nexport function useContextMenuRequest(): UseContextMenuRequestReturn {\n return inject(requestKey, null);\n}\n\n/** What `useContextMenuTarget` returns: the element the menu opened on, or null. @public */\nexport type UseContextMenuTargetReturn = HTMLElement | null;\n\n/**\n * The element the open context menu opened on (the slide canvas), or null while no menu is\n * open. The same composable as DOCX Editor's. @public\n */\nexport function useContextMenuTarget(): UseContextMenuTargetReturn {\n return inject(requestKey, null)?.owner ?? null;\n}\n\nconst pptxEditorContextMenuProps = {\n ...chromeTranslateProp,\n /**\n * `true` (default): the built-in rows for the target, with `PptxEditorContextMenu.Slot`\n * children replacing their rows in place and other children added at the end. `false`: only\n * the children.\n */\n preset: { type: Boolean, default: true },\n /** A class name added to the menu, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n /** `true` shows no canvas menu, as DOCX Editor's `disabled`. An open menu closes. */\n disabled: { type: Boolean, default: false },\n} as const;\n\n/**\n * Props for `PptxEditorContextMenu`, the twin of React's `PptxEditorContextMenuProps`.\n * `className` (or a host `class`) lands on the menu; the default slot holds the host's rows. @public\n */\nexport type PptxEditorContextMenuProps = ExtractPublicPropTypes<typeof pptxEditorContextMenuProps>;\n\n/**\n * The slide canvas's context menu. Place it in `PptxEditorRoot` or `PptxEditorViewport`, as\n * DOCX Editor's `DocxEditorContextMenu`, or render it from the `popups.contextMenu` entry. A\n * placed menu gives the canvas the same entry, and an explicit `popups.contextMenu` entry wins.\n * `openChange` says when the menu opens and closes.\n */\nconst ContextMenuRoot = defineComponent({\n name: 'PptxEditorContextMenu',\n inheritAttrs: false,\n props: pptxEditorContextMenuProps,\n emits: { openChange: (_open: boolean) => true },\n setup(props, { attrs, slots, emit }) {\n const placedHost = useToolbarContext().t;\n const { t } = useChromeTranslateScope(() => props.t);\n const target = useContextMenuRequest();\n const registry = target ? null : useCanvasMenuRegistry();\n if (registry) {\n // Placed in the root: give the canvas the same menu, with the `t` of where it stands.\n const token = {};\n registry.place(token, () =>\n props.disabled\n ? false\n : () =>\n h(\n ContextMenuRoot,\n {\n t: props.t ?? placedHost.value,\n preset: props.preset,\n className: props.className,\n class: attrs.class,\n onOpenChange: (open: boolean) => emit('openChange', open),\n },\n slots\n )\n );\n onBeforeUnmount(() => registry.remove(token));\n }\n if (target) {\n // Each request mounts the menu anew: it opens on mount and closes on unmount.\n let told = false;\n onMounted(() => {\n if (props.disabled) return;\n told = true;\n emit('openChange', true);\n });\n onBeforeUnmount(() => {\n if (told) emit('openChange', false);\n });\n // `disabled` turning on closes an open menu.\n watch(\n () => props.disabled,\n (off) => {\n if (off) target.close();\n }\n );\n }\n return () => {\n if (!target) {\n if (!registry)\n warnMenuPart('PptxEditorContextMenu', 'outsideContextMenu', undefined, VUE_MENU_PARTS);\n return null;\n }\n if (props.disabled) return null;\n const content = (): unknown => {\n const children = flattenMenuChildren(slots.default?.());\n if (!props.preset) return children;\n // A hidden row for a row this target lacks (a text row on a shape) is no extra row.\n const { entries, overrides, extras } = arrangeMenuRows(\n CANVAS_CONTEXT_MENUS[target.kind],\n children,\n slotRowOf\n );\n const renders = new Map<string, (() => VNode) | null>();\n for (const [key, child] of overrides) renders.set(key, child ? () => child : null);\n return [\n <MenuEntries entries={entries} overrides={renders} />,\n extras.length ? <MenuSeparator /> : null,\n ...extras,\n ];\n };\n return (\n <ContextMenu\n at={target.at}\n onClose={target.close}\n label={t(canvasMenuLabelKey(target.kind))}\n keyboard={target.keyboard}\n owner={target.owner}\n class={attrs.class}\n className={props.className}\n >\n {{\n default: () => (\n <MenuCloseScope close={target.close}>{{ default: content }}</MenuCloseScope>\n ),\n }}\n </ContextMenu>\n );\n };\n },\n});\n\n/** The canvas context menu with its parts as statics, the twin of React's. @public */\nexport type ContextMenuNamespace = typeof ContextMenuRoot &\n ContextMenuNamedRows & {\n /** A registry row: replace, change, or hide it in place. */\n readonly Slot: typeof MenuSlotItem;\n /** A host row. */\n readonly Item: typeof MenuRow;\n /** A labeled set of rows. */\n readonly Group: typeof MenuGroup;\n /** A line between rows. */\n readonly Separator: typeof MenuSeparator;\n /** A row that opens a nested panel. */\n readonly Submenu: typeof MenuSubmenu;\n };\n\n/**\n * The slide canvas's context menu (`PptxEditorContextMenu`), with DOCX Editor's parts (`Slot`,\n * `Item`, `Group`, `Separator`, `Submenu`). Place it in the root or the viewport, or render it\n * in `popups.contextMenu`. @public\n *\n * @example\n * ```ts\n * const popups: PptxEditorPopups = {\n * contextMenu: (props) =>\n * h(PptxEditorContextMenu, props, () => [\n * h(PptxEditorContextMenu.Slot, { slotId: 'format.painter', hidden: true }),\n * h(PptxEditorContextMenu.Item, { label: 'Ask legal', icon: 'info', onSelect: askLegal }),\n * ]),\n * };\n * ```\n */\nexport const PptxEditorContextMenu: ContextMenuNamespace = Object.assign(ContextMenuRoot, {\n ...CONTEXT_MENU_ROW_PARTS,\n Slot: MenuSlotItem,\n Item: MenuRow,\n Group: MenuGroup,\n Separator: MenuSeparator,\n Submenu: MenuSubmenu,\n});\n","/** @jsxImportSource vue */\n// A right-click menu at a point: the Vue twin of `ContextMenu` in the React adapter's\n// `ContextMenu.tsx`, after DOCX Editor's context menu. The menu opens at the pointer and flips\n// to stay inside the window (`placeInViewport`), focus moves into it and returns on close, and\n// the rows share the popover menu's keyboard rules (`menu-keyboard.ts`). The rows are\n// `MenuRow`, `MenuSeparator`, and `MenuSubmenu` (`menu-row.tsx`).\n\nimport {\n Teleport,\n defineComponent,\n onBeforeUnmount,\n onMounted,\n ref,\n shallowRef,\n watch,\n type ExtractPublicPropTypes,\n type PropType,\n} from 'vue';\nimport {\n focusEdge,\n focusMenuRowAtPointer,\n focusPanelFromPointer,\n focusSurfaceOf,\n handleMenuKey,\n listenContextMenuDismiss,\n panelKeyPressed,\n panelItems,\n placeInViewport,\n popoverScope,\n inFixedView,\n placeInFixedFrame,\n} from '@pptx-editor.dev/core/editor';\nimport { keepFocus } from './chrome.tsx';\nimport { usePptxEditor } from './composables.ts';\n\n/** A point in client (viewport) pixels. @public */\nexport interface ContextMenuPoint {\n /** The horizontal position in CSS pixels from the left of the window. */\n readonly x: number;\n /** The vertical position in CSS pixels from the top of the window. */\n readonly y: number;\n}\n\nconst contextMenuProps = {\n /** Where the menu opens: the pointer, or the focused element for a keyboard open. */\n at: { type: Object as PropType<ContextMenuPoint>, required: true as const },\n /** Closes the menu: the host stops rendering it. */\n onClose: { type: Function as PropType<() => void>, required: true as const },\n /** The accessible name of the menu. */\n label: { type: String, required: true as const },\n /** Opened from the keyboard (Shift+F10, the Menu key): focus goes to the first row. */\n keyboard: { type: Boolean, default: false },\n /** The element the menu opened on; its editor scope carries the theme tokens. */\n owner: { type: Object as PropType<HTMLElement | null>, default: undefined },\n /** A class name added to the menu, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n} as const;\n\n/**\n * Props of `ContextMenu`, the twin of React's `ContextMenuProps`. `className` (or a host\n * `class`) lands on the menu; the default slot is its rows. @public\n */\nexport type ContextMenuProps = ExtractPublicPropTypes<typeof contextMenuProps>;\n\n/**\n * A context menu at a point. Closed by Escape (focus returns to where it was), Tab, a click\n * outside, or a window resize. The arrow keys, Home, and End move through the rows. @public\n */\nexport const ContextMenu = defineComponent({\n name: 'ContextMenu',\n // The menu renders in the editor scope (a teleport), so the host's `class` goes onto it here.\n inheritAttrs: false,\n props: contextMenuProps,\n setup(props, { attrs, slots }) {\n const editor = usePptxEditor();\n const panel = ref<HTMLDivElement | null>(null);\n const pos = shallowRef<{ left: number; top: number; maxHeight?: number } | null>(null);\n const close = (): void => props.onClose();\n const place = (): void => {\n const el = panel.value;\n if (!el) return;\n pos.value = placeInFixedFrame(\n el.parentElement,\n { width: el.offsetWidth, height: el.scrollHeight + el.offsetHeight - el.clientHeight },\n (size, view) =>\n placeInViewport(\n inFixedView(props.at, view),\n size.width,\n size.height,\n view.width,\n view.height\n )\n );\n };\n // Where focus was when the menu opened: it goes back there on close.\n let back: HTMLElement | null = null;\n // A press outside, Escape, a blur, a resize, or a scroll closes it (core's\n // `listenContextMenuDismiss`).\n let stopDismiss = (): void => {};\n onMounted(() => {\n back = (panel.value?.ownerDocument.activeElement as HTMLElement | null) ?? null;\n place();\n stopDismiss = listenContextMenuDismiss(() => panel.value, close);\n });\n watch(() => [props.at.x, props.at.y], place, { flush: 'post' });\n // Focus moves in once the panel is placed: a hidden panel cannot take focus.\n watch(\n () => pos.value !== null,\n (placed) => {\n const el = panel.value;\n if (!el || !placed) return;\n // A pointer open focuses the panel, with no ring until a key is pressed.\n if (!props.keyboard || !focusEdge(panelItems(el), 'first')) focusPanelFromPointer(el);\n },\n { flush: 'post' }\n );\n onBeforeUnmount(() => {\n stopDismiss();\n const el = panel.value;\n if (!el) return;\n // Focus returns only when it is still in the menu: a click elsewhere keeps its focus.\n const active = el.ownerDocument.activeElement;\n const lost = !active || active === el.ownerDocument.body || el.contains(active);\n if (!lost) return;\n // On the slide, focus goes where typing works: the text input while text is selected.\n if (back?.closest('.pptx-surface') && editor.value && focusSurfaceOf(editor.value)) return;\n if (back?.isConnected) back.focus({ preventScroll: true });\n });\n const onKeydown = (e: KeyboardEvent): void => {\n const el = panel.value;\n panelKeyPressed(el);\n if (!el?.contains(e.target as Node)) return;\n if (e.key === 'Escape' || e.key === 'Tab') {\n e.preventDefault();\n e.stopPropagation();\n close();\n return;\n }\n if (handleMenuKey(el, e.key)) {\n e.preventDefault();\n e.stopPropagation();\n }\n };\n return () => (\n <Teleport to={popoverScope(props.owner)}>\n <div\n ref={panel}\n class={['pptx-menu pptx-contextmenu', attrs.class, props.className]}\n role=\"menu\"\n aria-label={props.label}\n tabindex={-1}\n style={\n pos.value\n ? {\n left: `${pos.value.left}px`,\n top: `${pos.value.top}px`,\n ...(pos.value.maxHeight === undefined\n ? {}\n : { maxHeight: `${pos.value.maxHeight}px` }),\n }\n : { visibility: 'hidden', left: `${props.at.x}px`, top: `${props.at.y}px` }\n }\n onMousedown={keepFocus}\n // The pointer moves the focused row, so one row looks active.\n onMousemove={(e: MouseEvent) => focusMenuRowAtPointer(panel.value, e)}\n onContextmenu={(e: MouseEvent) => e.preventDefault()}\n onKeydown={onKeydown}\n >\n {slots.default?.()}\n </div>\n </Teleport>\n );\n },\n});\n","/** @jsxImportSource vue */\n// Menu rows with an icon column, a label, and a shortcut hint, and the cascading submenu: the\n// Vue twin of `MenuRow`, `MenuSeparator`, and `MenuSubmenu` in the React adapter's\n// `ContextMenu.tsx`, with the same markup and classes. A disabled row stays in the menu with\n// the engine's reason as its tooltip. The rows share the popover menu's keyboard rules\n// (`menu-keyboard.ts`), and the submenu's place and keys come from core (`chrome-popover.ts`).\n\nimport {\n Teleport,\n defineComponent,\n inject,\n nextTick,\n normalizeClass,\n onBeforeUnmount,\n ref,\n shallowRef,\n watch,\n type ComponentOptionsMixin,\n type DefineComponent,\n type ExtractPublicPropTypes,\n type InjectionKey,\n type PropType,\n type VNode,\n type VNodeChild,\n} from 'vue';\nimport { sanitizeHref } from '@pptx-editor.dev/core/store';\nimport {\n tooltipAttributes,\n focusEdge,\n focusMenuRowAtPointer,\n panelItems,\n placeSubmenu,\n popoverScope,\n submenuPanelKey,\n translateKeyOrText,\n inFixedView,\n placeInFixedFrame,\n} from '@pptx-editor.dev/core/editor';\nimport { Icon, keepFocus } from './chrome.tsx';\nimport { useTranslation } from './composables.ts';\nimport type { JSX } from 'vue/jsx-runtime';\n\n/** Closes the menu a row is in; `null` outside a packaged menu. @internal */\nexport const menuCloseKey: InjectionKey<(() => void) | null> = Symbol('pptxMenuClose');\n\n/** The icon column of a row: other content, a named or drawn icon, or icon content. */\nfunction rowIcon(\n glyph: VNodeChild | undefined,\n icon: string | VNodeChild | undefined,\n paths: readonly string[] | null | undefined\n): VNodeChild {\n if (glyph !== undefined && glyph !== null) return glyph;\n if (typeof icon === 'string' || paths)\n return <Icon name={typeof icon === 'string' ? icon : undefined} paths={paths} />;\n return icon ?? null;\n}\n\nconst menuRowProps = {\n label: { type: String, required: true as const },\n /** A Material Symbol name from `ICON_PATHS`, or icon content (a vnode). */\n icon: { type: [String, Object] as PropType<string | VNode>, default: undefined },\n paths: { type: Array as PropType<readonly string[] | null>, default: undefined },\n /** Other icon content (a drawn shape or line), in place of `icon` and `paths`. */\n glyph: { type: Object as PropType<VNode>, default: undefined },\n /** The shortcut hint, already in this platform's form (`useTranslation` gives it). */\n shortcut: { type: String, default: undefined },\n disabled: { type: Boolean, default: false },\n /** Why the row is disabled; shown as its tooltip. */\n reason: { type: String as PropType<string | null>, default: undefined },\n /** The same as `reason`, under DOCX Editor's and `ToolbarAction`'s name. */\n disabledReason: { type: String as PropType<string | null>, default: undefined },\n /** A toggle that is on (Bold on bold text). */\n active: { type: Boolean, default: false },\n /** An on/off setting: a `menuitemcheckbox` with a check when on. */\n checked: { type: Boolean, default: undefined },\n /** With `checked`, one choice of several: a `menuitemradio` instead. */\n radio: { type: Boolean, default: false },\n /** The chrome slot or command the row runs, as `data-slot` for hosts and tests. */\n slot: { type: String, default: undefined },\n /** A class name added to the row. */\n className: { type: String, default: undefined },\n /**\n * A web link: the row opens it in a new tab. Only `http`, `https`, `mailto`, `tel`, and `ftp`\n * links pass `sanitizeHref`; any other link disables the row.\n */\n href: { type: String, default: undefined },\n} as const;\n\n/** Props of `MenuRow`, the twin of React's `MenuRowProps`. @public */\nexport type MenuRowProps = ExtractPublicPropTypes<typeof menuRowProps>;\n\nconst menuRow = defineComponent({\n name: 'MenuRow',\n props: menuRowProps,\n emits: { select: () => true },\n setup(props, { emit }) {\n const close = inject(menuCloseKey, null);\n return () => {\n const { href } = props;\n const link = href === undefined ? null : sanitizeHref(href);\n const disabled = props.disabled || (link !== null && !link.ok);\n const reason = props.reason ?? props.disabledReason;\n const shared = {\n role:\n props.checked === undefined\n ? 'menuitem'\n : props.radio\n ? 'menuitemradio'\n : 'menuitemcheckbox',\n ...(props.checked === undefined ? {} : { 'aria-checked': props.checked }),\n tabindex: -1,\n class: ['pptx-menu__item pptx-menu__row', props.className].filter(Boolean).join(' '),\n 'aria-disabled': disabled || undefined,\n // The row shows its name; the tooltip adds only the reason, which is also its description.\n ...(disabled && reason ? { 'aria-description': reason, 'data-pptx-tooltip': reason } : {}),\n 'data-slot': props.slot,\n 'data-active': props.active ? '' : undefined,\n 'data-disabled': disabled ? '' : undefined,\n onClick: () => {\n if (disabled) return;\n emit('select');\n close?.();\n },\n };\n const content = [\n <span class=\"pptx-menu__icon\" aria-hidden=\"true\">\n {rowIcon(props.glyph, props.icon, props.paths)}\n </span>,\n <span class=\"pptx-menu__label\">{props.label}</span>,\n props.checked ? <Icon name=\"check\" className=\"pptx-icon pptx-menu__check\" /> : null,\n // The shortcut is a visual hint; the row's accessible name is its label.\n props.shortcut ? (\n <span class=\"pptx-menu__shortcut\" aria-hidden=\"true\">\n {props.shortcut}\n </span>\n ) : null,\n ];\n if (link?.ok && !props.disabled)\n return (\n <a {...shared} href={link.href} target=\"_blank\" rel=\"noopener noreferrer\">\n {content}\n </a>\n );\n return (\n <button type=\"button\" {...shared}>\n {content}\n </button>\n );\n };\n },\n});\n\n// An explicit type: the inferred one lists the defaults of `reason` and `disabledReason` in an\n// order that changes between builds, and the API report must not change with it.\n/**\n * A menu row: icon, label, and shortcut. A disabled row stays focusable with `aria-disabled`,\n * so a keyboard or pointer user can read why. Emits `select`; inside a packaged menu, the menu\n * closes after. @public\n */\nexport const MenuRow: DefineComponent<\n typeof menuRowProps,\n () => JSX.Element,\n {},\n {},\n {},\n ComponentOptionsMixin,\n ComponentOptionsMixin,\n { select: () => true }\n> = menuRow;\n\n/** A line between groups of rows. @public */\nexport const MenuSeparator = defineComponent({\n name: 'MenuSeparator',\n setup() {\n return () => <div class=\"pptx-menu__sep\" role=\"separator\" />;\n },\n});\n\nconst menuSubmenuProps = {\n /** The row's label. Wins over `labelKey`. */\n label: { type: String, default: undefined },\n /** A translation key for the label, as DOCX Editor's `Menu.Submenu` takes. */\n labelKey: { type: String, default: undefined },\n /** A Material Symbol name, or icon content (a vnode). */\n icon: { type: [String, Object] as PropType<string | VNode>, default: undefined },\n paths: { type: Array as PropType<readonly string[] | null>, default: undefined },\n glyph: { type: Object as PropType<VNode>, default: undefined },\n disabled: { type: Boolean, default: false },\n reason: { type: String as PropType<string | null>, default: undefined },\n /** The submenu's own class, for a grid of shapes. */\n className: { type: String, default: undefined },\n} as const;\n\n/** Props of `MenuSubmenu`, the twin of React's `MenuSubmenuProps`. @public */\nexport type MenuSubmenuProps = ExtractPublicPropTypes<typeof menuSubmenuProps>;\n\nconst menuSubmenu = defineComponent({\n name: 'MenuSubmenu',\n // The row and a teleported panel are two root nodes: a host `class` goes on the panel, with\n // `className`, as React's; other attributes go on the row.\n inheritAttrs: false,\n props: menuSubmenuProps,\n setup(props, { slots, attrs }) {\n const { t } = useTranslation();\n const row = ref<HTMLButtonElement | null>(null);\n const panel = ref<HTMLDivElement | null>(null);\n const open = ref<false | 'pointer' | 'keyboard'>(false);\n const pos = shallowRef<{ left: number; top: number } | null>(null);\n const close = (focusRow: boolean): void => {\n open.value = false;\n pos.value = null;\n if (focusRow) row.value?.focus();\n };\n // Place the panel once it renders, then move focus in: a hidden panel cannot take focus.\n watch(\n open,\n (now) => {\n const r = row.value?.getBoundingClientRect();\n const p = panel.value;\n if (!now || !r || !p) return;\n pos.value = placeInFixedFrame(\n p.parentElement,\n { width: p.offsetWidth, height: p.offsetHeight },\n (size, view) => placeSubmenu(inFixedView(r, view), size, view)\n );\n },\n { flush: 'post' }\n );\n watch(\n [pos, open],\n ([placed, now]) => {\n if (!placed || now !== 'keyboard') return;\n // This watcher runs before the render that clears `visibility: hidden`, so wait for\n // that render, as React's effect runs after its commit.\n void nextTick(() => {\n if (pos.value && open.value === 'keyboard' && panel.value)\n focusEdge(panelItems(panel.value), 'first');\n });\n },\n { flush: 'post' }\n );\n // Hovering another row of the parent menu closes this one.\n const over = (e: Event): void => {\n const target = e.target as Node;\n const parent = row.value?.closest('.pptx-menu');\n if (!parent?.contains(target) || row.value?.contains(target)) return;\n close(false);\n };\n watch(open, (now, _old, onCleanup) => {\n if (!now) return;\n document.addEventListener('mouseover', over);\n onCleanup(() => document.removeEventListener('mouseover', over));\n });\n onBeforeUnmount(() => document.removeEventListener('mouseover', over));\n const onRowKey = (e: KeyboardEvent): void => {\n if (props.disabled || (e.key !== 'ArrowRight' && e.key !== 'Enter' && e.key !== ' ')) return;\n e.preventDefault();\n e.stopPropagation();\n open.value = 'keyboard';\n };\n return () => {\n const label = props.label ?? (props.labelKey ? translateKeyOrText(t, props.labelKey) : '');\n const { class: hostClass, ...hostAttrs } = attrs;\n return [\n <button\n {...hostAttrs}\n ref={row}\n type=\"button\"\n role=\"menuitem\"\n tabindex={-1}\n class=\"pptx-menu__item pptx-menu__row\"\n aria-haspopup=\"menu\"\n aria-expanded={!!open.value}\n aria-disabled={props.disabled || undefined}\n {...(props.disabled && props.reason\n ? { 'aria-description': props.reason, ...tooltipAttributes(label, true, props.reason) }\n : {})}\n data-open={open.value ? '' : undefined}\n onMouseenter={() => {\n if (!props.disabled) open.value = open.value || 'pointer';\n }}\n onClick={() => {\n if (!props.disabled) open.value = 'keyboard';\n }}\n onKeydown={onRowKey}\n >\n <span class=\"pptx-menu__icon\" aria-hidden=\"true\">\n {rowIcon(props.glyph, props.icon, props.paths)}\n </span>\n <span class=\"pptx-menu__label\">{label}</span>\n <Icon name=\"chevron_right\" className=\"pptx-icon pptx-menu__caret\" />\n </button>,\n open.value ? (\n <Teleport to={popoverScope(row.value)}>\n <div\n ref={panel}\n class={normalizeClass(['pptx-menu pptx-menu--submenu', hostClass, props.className])}\n role=\"menu\"\n aria-label={label}\n style={\n pos.value\n ? { left: `${pos.value.left}px`, top: `${pos.value.top}px` }\n : { visibility: 'hidden', left: '0px', top: '0px' }\n }\n onMousedown={keepFocus}\n onMousemove={(e: MouseEvent) => focusMenuRowAtPointer(panel.value, e)}\n onKeydown={(e: KeyboardEvent) => {\n if (submenuPanelKey(panel.value, e)) close(true);\n }}\n >\n {slots.default?.()}\n </div>\n </Teleport>\n ) : null,\n ];\n };\n },\n});\n\n// An explicit type, as `MenuRow`'s, so the API report does not change between builds.\n/**\n * A row that opens a cascading panel to its right (to its left at the window's edge). It opens\n * on hover, click, Enter, and ArrowRight, and closes on ArrowLeft and Escape, which give focus\n * back to the row. The default slot is the panel's rows. @public\n */\nexport const MenuSubmenu: DefineComponent<\n typeof menuSubmenuProps,\n () => (JSX.Element | null)[],\n {},\n {},\n {},\n ComponentOptionsMixin,\n ComponentOptionsMixin,\n {}\n> = menuSubmenu;\n","/** @jsxImportSource vue */\n// Menu rows over chrome slots, for the Vue menus and context menus: the Vue twin of the React\n// adapter's `menu-rows.tsx`, after DOCX Editor's `Menu.Item` and `ContextMenu.Slot`. A row takes\n// its label, icon, shortcut, enabled state, and action from the slot's registry entry and core's\n// row rules (`resolveChromeMenuRow`, `chromeRowState`, `menuRowCheck`, `runChromeRow`), so a\n// menu row and its toolbar twin cannot drift. A slot that collects a value (Insert > Shape,\n// Insert > Line, Insert > Table, New Slide, Layout) opens a submenu of its choices.\n\nimport {\n defineComponent,\n inject,\n provide,\n type InjectionKey,\n type PropType,\n type VNode,\n} from 'vue';\nimport {\n SHAPE_GALLERY,\n chromeControlForSlot,\n chromeRowState,\n editorCommandFor,\n menuEntryKey,\n menuRowCheck,\n resolveChromeMenuRow,\n runChromeRow,\n sameChromeCommandState,\n surfaceInputIn,\n tidySeparators,\n translateKeyOrText,\n warnMenuPart,\n type ChromeActionHost,\n type ChromeMenuEntry,\n type ChromeMenuItemEntry,\n type ChromeSlotId,\n type MenuPartNames,\n type PptxEditorInstance,\n} from '@pptx-editor.dev/core/editor';\nimport type { TranslationKey } from '@pptx-editor.dev/i18n';\nimport {\n chromeActionHostKey,\n useEditorState,\n usePptxEditor,\n useTranslation,\n} from './composables.ts';\nimport { MenuRow, MenuSeparator, MenuSubmenu, menuCloseKey } from './menu-row.tsx';\nimport { LineGlyph, ShapeGrid, ShapeIcon } from './ShapeControls.tsx';\nimport { LayoutGallery } from './SlideControls.tsx';\nimport { MenuTableGrid } from './TableControls.tsx';\n\nexport { menuCloseKey, tidySeparators };\n\n/** The Vue names of the menu bar and the root, for the menu warnings. */\nexport const VUE_MENU_PARTS: MenuPartNames = { bar: 'PptxEditorMenu', root: 'PptxEditorRoot' };\n\n/** The close function of the enclosing menu, or a no-op. @internal */\nexport function useMenuClose(): () => void {\n return inject(menuCloseKey, null) ?? noop;\n}\n\nfunction noop(): void {}\n\n/** The host overrides of one registry row. @internal */\nexport interface SlotRowOverrides {\n readonly labelKey?: string;\n readonly shortcutKey?: string;\n readonly className?: string;\n /** A Material Symbol name, or icon content in place of the registry icon. */\n readonly icon?: string | VNode;\n}\n\n/**\n * Run a row's slot. Outside a root there is no action host: the slot's own command runs, and an\n * adapter action (a dialog, a file pick) is refused with the reason, as `useEditorCommand`.\n */\nfunction runRow(\n editor: PptxEditorInstance | null,\n host: ChromeActionHost | null,\n slot: ChromeSlotId,\n value: string | undefined,\n input?: HTMLElement | null\n): void {\n if (host) runChromeRow(editor, host, slot, value, input);\n else editorCommandFor(editor, slot, null, 'disabled.noRoot').execute(value);\n}\n\n/** One registry row: a slot, or a slot with a value. @internal */\nexport const SlotMenuRow = defineComponent({\n name: 'PptxSlotMenuRow',\n props: {\n entry: { type: Object as PropType<ChromeMenuItemEntry>, required: true as const },\n overrides: { type: Object as PropType<SlotRowOverrides>, default: undefined },\n },\n setup(props) {\n const { t } = useTranslation();\n const editor = usePptxEditor();\n // The host knows which `popups` entries are off: their rows show disabled with the reason.\n const host = inject(chromeActionHostKey, null);\n const close = useMenuClose();\n const state = useEditorState(\n () => chromeRowState(editor.value, props.entry.slot, props.entry.value, host ?? undefined),\n sameChromeCommandState\n );\n return () => {\n const { entry, overrides } = props;\n const row = resolveChromeMenuRow(entry);\n const control = chromeControlForSlot(entry.slot);\n if (!row || !control) {\n warnMenuPart('PptxEditorMenu.Item', 'unknownSlot', entry.slot, VUE_MENU_PARTS);\n return null;\n }\n const label = overrides?.labelKey\n ? translateKeyOrText(t, overrides.labelKey)\n : translateKeyOrText(t, row.labelKey, row.labelParams);\n const shortcutKey = overrides?.shortcutKey ?? row.shortcutKey;\n const reason = state.value.disabledReason\n ? translateKeyOrText(t, state.value.disabledReason)\n : null;\n // One rule for every menu part: a string is a Material Symbol name, a vnode is content.\n const named = typeof overrides?.icon === 'string' ? overrides.icon : undefined;\n // Insert > Line has no registry icon: the row draws a line, as its options do.\n const glyph =\n named !== undefined\n ? undefined\n : ((overrides?.icon as VNode | undefined) ??\n (row.paths === null && entry.slot === 'insert.line' ? (\n <LineGlyph value=\"line\" />\n ) : undefined));\n const common = {\n label,\n disabled: !state.value.isEnabled,\n reason,\n ...(glyph !== undefined\n ? { glyph }\n : named !== undefined\n ? { icon: named, paths: null }\n : { paths: row.paths }),\n ...(overrides?.className ? { className: overrides.className } : {}),\n };\n // A slot that collects a value opens its choices, unless the row names one.\n if (entry.value === undefined && control.state.kind === 'value' && !entry.direct) {\n if (entry.slot === 'slide.add' || entry.slot === 'slide.layout')\n return <LayoutSubmenu slot={entry.slot} {...common} />;\n // Insert > Shape cascades its shape grid. Quick Styles is a gallery with no menu form\n // yet, so its row falls through to the disabled \"pick in the toolbar\" row below.\n if (entry.slot === 'insert.shape') return <GallerySubmenu slot={entry.slot} {...common} />;\n // Insert > Table: the size grid, as DOCX Editor's `Menu.TableGrid`.\n if (control.shape === 'tableGrid')\n return (\n <MenuSubmenu {...common}>\n {{\n default: () => (\n <MenuTableGrid slot={entry.slot} label={label} autoFocus onInserted={close} />\n ),\n }}\n </MenuSubmenu>\n );\n // Shape Effects: one submenu for each effect kind, as its toolbar menu has.\n if (control.optionGroups?.length && control.options?.length)\n return (\n <MenuSubmenu {...common}>\n {{\n default: () =>\n control.optionGroups!.map((group) => (\n <MenuSubmenu key={group.id} label={t(group.labelKey)}>\n {{\n default: () =>\n control\n .options!.filter((o) => o.group === group.id)\n .map((o) => (\n <SlotMenuRow\n key={o.value}\n entry={{ kind: 'item', slot: entry.slot, value: o.value }}\n />\n )),\n }}\n </MenuSubmenu>\n )),\n }}\n </MenuSubmenu>\n );\n if (control.options?.length)\n return (\n <MenuSubmenu {...common}>\n {{\n default: () =>\n control.options!.map((o) => (\n <SlotMenuRow\n key={o.value}\n entry={{ kind: 'item', slot: entry.slot, value: o.value }}\n />\n )),\n }}\n </MenuSubmenu>\n );\n // A picker with no menu form (a color, a font, a size) cannot run from a row.\n if (entry.slot !== 'text.link') {\n warnMenuPart('PptxEditorMenu.Item', 'valueRow', entry.slot, VUE_MENU_PARTS);\n return <MenuRow {...common} disabled reason={t('menu.pickInToolbar')} slot={row.key} />;\n }\n }\n // A two-state row (Bold, Ruler) is a checkbox row and a choice row (View > Normal, a\n // Shadow preset) a radio row: `aria-checked` says whether it is on.\n const { checked, radio } = menuRowCheck(row, control, state.value, entry.value);\n const valueGlyph =\n entry.value !== undefined && entry.slot === 'insert.line' ? (\n <LineGlyph value={entry.value} />\n ) : undefined;\n return (\n <MenuRow\n {...common}\n {...(valueGlyph ? { glyph: valueGlyph } : {})}\n {...(shortcutKey ? { shortcut: translateKeyOrText(t, shortcutKey) } : {})}\n {...(checked !== undefined ? { checked } : {})}\n {...(radio ? { radio: true } : {})}\n slot={row.key}\n onSelect={() => {\n // A pointer press keeps the focus where it was (the slide's text input); a keyboard\n // user's focus is on the row, inside the editor scope. Either way the scope is found.\n const scope = document.activeElement?.closest('.pptx-editor') ?? null;\n close();\n runRow(editor.value, host, entry.slot, entry.value, surfaceInputIn(scope));\n }}\n />\n );\n };\n },\n});\n\n/** The row props a gallery submenu passes on to its `MenuSubmenu`. */\nconst submenuRowProps = {\n label: { type: String, required: true as const },\n disabled: { type: Boolean, default: false },\n reason: { type: String as PropType<string | null>, default: null },\n className: { type: String, default: undefined },\n /** A Material Symbol name from `Menu.Item icon`, in place of the registry icon. */\n icon: { type: String, default: undefined },\n paths: { type: Array as PropType<readonly string[] | null>, default: undefined },\n glyph: { type: Object as PropType<VNode>, default: undefined },\n} as const;\n\n/** The `MenuSubmenu` props of a gallery row: icon content, a named icon, or the paths. */\nfunction submenuIcon(props: {\n readonly icon?: string | undefined;\n readonly paths?: readonly string[] | null | undefined;\n readonly glyph?: VNode | undefined;\n}) {\n return props.glyph !== undefined\n ? { glyph: props.glyph }\n : props.icon !== undefined\n ? { icon: props.icon }\n : { paths: props.paths ?? null };\n}\n\n/**\n * Insert > Shape: one cascading grid per gallery category, drawn from the spec geometry. As in\n * React, a named `icon` is not shown on this row.\n */\nconst GallerySubmenu = defineComponent({\n name: 'PptxGallerySubmenu',\n props: {\n slot: { type: String as PropType<ChromeSlotId>, required: true as const },\n ...submenuRowProps,\n },\n setup(props) {\n const { t } = useTranslation();\n const editor = usePptxEditor();\n const host = inject(chromeActionHostKey, null);\n const close = useMenuClose();\n return () => (\n <MenuSubmenu\n label={props.label}\n disabled={props.disabled}\n reason={props.reason}\n {...(props.className ? { className: props.className } : {})}\n {...(props.glyph !== undefined ? { glyph: props.glyph } : { paths: props.paths ?? null })}\n >\n {{\n default: () =>\n SHAPE_GALLERY.map((category) => (\n <MenuSubmenu\n key={category.id}\n label={t(category.labelKey as TranslationKey)}\n glyph={<ShapeIcon preset={category.presets[0] ?? 'rect'} />}\n className=\"pptx-menu--shapes\"\n >\n {{\n default: () => (\n <ShapeGrid\n presets={category.presets}\n onPick={(preset: string) => {\n close();\n runRow(editor.value, host, props.slot, preset);\n }}\n />\n ),\n }}\n </MenuSubmenu>\n )),\n }}\n </MenuSubmenu>\n );\n },\n});\n\n/**\n * New Slide and Layout: the deck's layout gallery, each tile drawn by the engine. Layout marks\n * the current slide's layout.\n */\nconst LayoutSubmenu = defineComponent({\n name: 'PptxLayoutSubmenu',\n props: {\n slot: { type: String as PropType<'slide.add' | 'slide.layout'>, required: true as const },\n ...submenuRowProps,\n },\n setup(props) {\n const editor = usePptxEditor();\n const host = inject(chromeActionHostKey, null);\n const close = useMenuClose();\n const current = useEditorState((s) =>\n props.slot === 'slide.layout' ? (s.slides[s.currentSlide]?.layoutId ?? '') : ''\n );\n return () => (\n <MenuSubmenu\n label={props.label}\n disabled={props.disabled}\n reason={props.reason}\n {...(props.className ? { className: props.className } : {})}\n {...submenuIcon(props)}\n >\n {{\n default: () => (\n <LayoutGallery\n {...(props.slot === 'slide.layout' ? { value: current.value } : {})}\n onChange={(layoutId: string) => {\n close();\n runRow(editor.value, host, props.slot, layoutId);\n }}\n />\n ),\n }}\n </MenuSubmenu>\n );\n },\n});\n\n/**\n * The registry row a host row replaces in place: a host `MenuItem` there keeps the row's own\n * label, shortcut, and `direct` unless it sets its own. @internal\n */\nexport const rowDefaultsKey: InjectionKey<ChromeMenuItemEntry | null> = Symbol('pptxRowDefaults');\n\n/** Provides the registry row a host row replaces, then renders the host row. */\nconst RowDefaults = defineComponent({\n name: 'PptxRowDefaults',\n props: { entry: { type: Object as PropType<ChromeMenuItemEntry>, required: true as const } },\n setup(props, { slots }) {\n provide(rowDefaultsKey, props.entry);\n return () => slots.default?.();\n },\n});\n\n/** Render a list of registry entries, with host overrides by row key. @internal */\nexport const MenuEntries = defineComponent({\n name: 'PptxMenuEntries',\n props: {\n entries: { type: Array as PropType<readonly ChromeMenuEntry[]>, required: true as const },\n /** Host rows that replace registry rows, by row key; `null` removes the row. */\n overrides: {\n type: Object as PropType<ReadonlyMap<string, (() => VNode | null) | null>>,\n default: undefined,\n },\n },\n setup(props) {\n const { t } = useTranslation();\n return () =>\n props.entries.map((entry, i) => {\n if (entry.kind === 'separator') return <MenuSeparator key={`sep-${i}`} />;\n if (entry.kind === 'submenu')\n return (\n <MenuSubmenu key={entry.id} label={t(entry.labelKey)} paths={entry.paths}>\n {{\n default: () => (\n <MenuEntries\n entries={entry.items}\n {...(props.overrides ? { overrides: props.overrides } : {})}\n />\n ),\n }}\n </MenuSubmenu>\n );\n const key = menuEntryKey(entry);\n if (props.overrides?.has(key)) {\n const render = props.overrides.get(key);\n return (\n <RowDefaults key={key} entry={entry}>\n {{ default: () => render?.() ?? null }}\n </RowDefaults>\n );\n }\n return <SlotMenuRow key={key} entry={entry} />;\n });\n },\n});\n","/** @jsxImportSource vue */\n// Slide chrome of the Home tab: the layout gallery, the New Slide split button, the Layout\n// button, and the section buttons. Each layout tile is the engine's own render of a new slide on\n// that layout, with its placeholder prompts (`renderLayoutThumbnail`). The Vue twin of the React\n// adapter's `SlideControls.tsx`, on the same core rules (`insert-controls.ts`).\n\nimport { defineComponent, ref, watch, type ExtractPublicPropTypes, type PropType } from 'vue';\nimport {\n tooltipAttributes,\n layoutGalleryEnter,\n layoutGalleryKey,\n layoutGalleryTabStop,\n layoutMasterGroups,\n translateKeyOrText,\n type ChromeControl,\n type ChromeSlotId,\n type SlideLayoutSummary,\n} from '@pptx-editor.dev/core/editor';\nimport { Icon, Popover, ToolButton, keepFocus, useAriaDisabled } from './chrome.tsx';\nimport { useEditorState, usePptxEditor, useSlideLayouts, useTranslation } from './composables.ts';\nimport { useSlot } from './slot.ts';\nimport { buttonRoleProps, renderAsChild, useSlotOverride } from './slot-override.ts';\n\nconst LayoutThumb = defineComponent({\n name: 'PptxLayoutThumb',\n props: {\n id: { type: String, required: true as const },\n ratio: { type: Number, required: true as const },\n },\n setup(props) {\n const editor = usePptxEditor();\n const box = ref<HTMLSpanElement | null>(null);\n // Repaint when the document changes (a theme or master edit changes every layout) and when\n // fonts load: the slide summaries change with the font generation, as the rail's do. The\n // engine skips a paint whose package, layout, and fonts are the same.\n const revision = useEditorState((s) => s.revision);\n const slides = useEditorState((s) => s.slides);\n watch(\n [editor, () => props.id, revision, slides, box],\n () => {\n if (editor.value && box.value) editor.value.renderLayoutThumbnail(props.id, box.value);\n },\n { flush: 'post', immediate: true }\n );\n return () => (\n <span\n ref={box}\n class=\"pptx-layout-gallery__thumb\"\n style={{ aspectRatio: String(1 / props.ratio) }}\n aria-hidden=\"true\"\n />\n );\n },\n});\n\nconst layoutGalleryProps = {\n /** The layout to mark as the current one (`menuitemradio`, checked). Absent: plain rows. */\n value: { type: String, default: undefined },\n /** The layouts to show. Default: every layout of the deck (`useSlideLayouts`). */\n layouts: { type: Array as PropType<readonly SlideLayoutSummary[]>, default: undefined },\n /** Show the tiles but take no pick. Default: true while the deck is open for viewing. */\n disabled: { type: Boolean, default: undefined },\n /**\n * Why the gallery takes no pick, for the tiles' tooltips: a catalog key (such as\n * `useEditorCommand(slotId).disabledReason`) or text. Default: the viewing reason.\n */\n disabledReason: { type: String as PropType<string | null>, default: undefined },\n /** A class name added to the gallery, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n} as const;\n\n/** Props of `LayoutGallery`, the twin of React's `LayoutGalleryProps`. @public */\nexport type LayoutGalleryProps = ExtractPublicPropTypes<typeof layoutGalleryProps>;\n\n/**\n * A grid of the deck's layouts, as the Layout and New Slide galleries show them: one group per\n * slide master, headed by its name, and each tile the engine's render of a new slide on the\n * layout, named below. The tiles are menu rows (`menuitem`, or `menuitemradio` with `value`);\n * arrow keys, Home, and End move between them, so the gallery works in any menu or popup of the\n * host. Emits `change` with the picked layout's id; `className` (or a host `class`) goes on the\n * gallery. @public\n */\nexport const LayoutGallery = defineComponent({\n name: 'LayoutGallery',\n // The host class goes on the gallery, not on the empty-deck note, as in React.\n inheritAttrs: false,\n props: layoutGalleryProps,\n emits: { change: (_layoutId: string) => true },\n setup(props, { emit, attrs }) {\n const deck = useSlideLayouts();\n const viewing = useEditorState((s) => s.mode === 'view');\n const ratio = useEditorState((s) => s.slideHeight / s.slideWidth);\n const { t } = useTranslation();\n let entered = false;\n const off = (): boolean => props.disabled ?? viewing.value;\n const reasonText = (): string | null =>\n props.disabledReason\n ? translateKeyOrText(t, props.disabledReason)\n : viewing.value\n ? t('disabled.viewing')\n : null;\n // Every tile says the one reason through `aria-describedby`.\n const offTiles = useAriaDisabled(off, reasonText);\n return () => {\n const layouts = props.layouts ?? deck.value;\n if (!layouts.length)\n return <p class=\"pptx-layout-gallery__empty\">{t('layoutGallery.empty')}</p>;\n const current = props.value;\n // One tile takes Tab focus: the current layout, or the first.\n const focusable = layoutGalleryTabStop(layouts, current);\n const isOff = off();\n const reason = reasonText();\n return (\n <div\n {...attrs}\n class={['pptx-layout-gallery', attrs.class, props.className]}\n onFocusin={(e: FocusEvent) => {\n // A menu opened from the keyboard focuses its first row: start on the current layout.\n if (entered) return;\n entered = true;\n layoutGalleryEnter(e.currentTarget as Element, e.target);\n }}\n onKeydown={(e: KeyboardEvent) => {\n // Left from the first column leaves the gallery: a submenu then closes.\n if (layoutGalleryKey(e.currentTarget as HTMLElement, e.target, e.key)) {\n e.preventDefault();\n e.stopPropagation();\n }\n }}\n >\n {layoutMasterGroups(layouts).map((m) => (\n <div key={m.id} class=\"pptx-layout-gallery__group\" role=\"group\" aria-label={m.name}>\n <div class=\"pptx-layout-gallery__header\" aria-hidden=\"true\">\n {m.name}\n </div>\n <div class=\"pptx-layout-gallery__grid\" data-columns={3}>\n {m.layouts.map((l) => (\n <button\n key={l.id}\n type=\"button\"\n role={current === undefined ? 'menuitem' : 'menuitemradio'}\n {...(current === undefined ? {} : { 'aria-checked': l.id === current })}\n tabindex={l.id === focusable ? 0 : -1}\n class=\"pptx-layout-gallery__item\"\n data-layout-type={l.type}\n data-current={l.id === current ? '' : undefined}\n {...offTiles.attrs.value}\n {...tooltipAttributes(l.name, isOff, reason)}\n onClick={() => {\n if (!isOff) emit('change', l.id);\n }}\n >\n <LayoutThumb id={l.id} ratio={ratio.value} />\n <span class=\"pptx-layout-gallery__name\">{l.name}</span>\n </button>\n ))}\n </div>\n </div>\n ))}\n {offTiles.note()}\n </div>\n );\n };\n },\n});\n\nconst slotPartProps = {\n slot: { type: String as PropType<ChromeSlotId>, required: true as const },\n control: { type: Object as PropType<ChromeControl>, required: true as const },\n} as const;\n\n/** The props of `NewSlideControl`, the twin of React's `NewSlideControlProps`. @internal */\nexport type NewSlideControlProps = ExtractPublicPropTypes<typeof slotPartProps>;\n\n/**\n * Home > New Slide: the button adds a slide on the default next layout; the arrow opens the\n * layout gallery. The toolbar's part for `slide.add`; hosts place it with `ToolbarSlot`.\n * @internal\n */\nexport const NewSlideControl = defineComponent({\n name: 'NewSlideControl',\n props: slotPartProps,\n setup(props) {\n const { cmd, label, reason } = useSlot(\n () => props.slot,\n () => props.control\n );\n const caretOff = useAriaDisabled(() => !cmd.isEnabled.value, reason);\n const editor = usePptxEditor();\n const { t } = useTranslation();\n const anchor = ref<HTMLButtonElement | null>(null);\n const open = ref(false);\n return () => {\n // The caret is part of the split button: host overrides go to the main button, as for the\n // color pickers, so the caret keeps its own class.\n const choose = t('layoutGallery.choose');\n return (\n <span class=\"pptx-toolbar__group\">\n <ToolButton\n slot={props.slot}\n label={label.value}\n paths={props.control.paths}\n disabled={!cmd.isEnabled.value}\n disabledReason={reason.value}\n onClick={() => editor.value?.exec({ type: 'addSlide' })}\n />\n <button\n ref={anchor}\n type=\"button\"\n class=\"pptx-toolbar__button pptx-toolbar__caret-button\"\n data-disabled={cmd.isEnabled.value ? undefined : ''}\n aria-label={choose}\n aria-haspopup=\"menu\"\n aria-expanded={open.value}\n {...tooltipAttributes(choose, !cmd.isEnabled.value, reason.value)}\n {...caretOff.attrs.value}\n onMousedown={keepFocus}\n onClick={() => {\n if (cmd.isEnabled.value) open.value = !open.value;\n }}\n >\n <Icon name=\"arrow_drop_down\" className=\"pptx-icon pptx-toolbar__caret\" />\n </button>\n {caretOff.note()}\n {open.value ? (\n <Popover anchor={anchor.value} onClose={() => (open.value = false)} label={label.value}>\n {{\n default: () => (\n <>\n <LayoutGallery\n onChange={(id: string) => {\n open.value = false;\n cmd.execute(id);\n }}\n />\n </>\n ),\n }}\n </Popover>\n ) : null}\n </span>\n );\n };\n },\n});\n\n/** The props of `LayoutControl`, the twin of React's `LayoutControlProps`. @internal */\nexport type LayoutControlProps = ExtractPublicPropTypes<typeof slotPartProps>;\n\n/**\n * Home > Layout: the layout gallery, with the current slide's layout marked. The trigger is one\n * button, so it takes the slot's `icon` and `asChild` as `ToolButton` does. The toolbar's part\n * for `slide.layout`; hosts place it with `ToolbarSlot`. @internal\n */\nexport const LayoutControl = defineComponent({\n name: 'LayoutControl',\n props: slotPartProps,\n setup(props) {\n const { cmd, label, tip, reason } = useSlot(\n () => props.slot,\n () => props.control\n );\n const override = useSlotOverride(props.slot);\n const anchor = ref<HTMLElement | null>(null);\n const open = ref(false);\n // A disabled trigger stays focusable and says why (`aria-disabled`).\n const off = useAriaDisabled(() => !cmd.isEnabled.value, reason);\n const toggle = (el: Element): void => {\n if (!cmd.isEnabled.value || !(el instanceof HTMLElement)) return;\n anchor.value = el;\n open.value = !open.value;\n };\n return () => {\n const disabled = !cmd.isEnabled.value;\n const attributes = {\n class: ['pptx-toolbar__button pptx-toolbar__button--wide', override?.className]\n .filter(Boolean)\n .join(' '),\n 'data-slot': props.slot,\n 'data-disabled': disabled ? '' : undefined,\n 'aria-label': label.value,\n 'aria-haspopup': 'menu' as const,\n 'aria-expanded': open.value,\n ...tip.value,\n ...off.attrs.value,\n onMousedown: keepFocus,\n onClick: (e: MouseEvent) => toggle(e.currentTarget as Element),\n };\n const host = override?.asChild;\n return [\n host ? (\n // A host element that is not a button gets the button role, a tab stop, and Enter and\n // Space, as `ToolButton` gives it.\n renderAsChild(host, {\n ...attributes,\n ...(host.type === 'button' ? { type: 'button' } : buttonRoleProps(toggle)),\n })\n ) : (\n <button type=\"button\" {...attributes}>\n {override?.icon !== undefined ? override.icon : <Icon paths={props.control.paths} />}\n <Icon name=\"arrow_drop_down\" className=\"pptx-icon pptx-toolbar__caret\" />\n </button>\n ),\n off.note(),\n open.value ? (\n <Popover anchor={anchor.value} onClose={() => (open.value = false)}>\n {{\n default: () => (\n <>\n <LayoutGallery\n value={typeof cmd.value.value === 'string' ? cmd.value.value : ''}\n onChange={(id: string) => {\n open.value = false;\n cmd.execute(id);\n }}\n />\n </>\n ),\n }}\n </Popover>\n ) : null,\n ];\n };\n },\n});\n\n/** A section button: one `ToolButton` that runs the slot's command. */\nfunction sectionControl(name: string) {\n return defineComponent({\n name,\n props: slotPartProps,\n setup(props) {\n const { cmd, label, reason } = useSlot(\n () => props.slot,\n () => props.control\n );\n return () => (\n <ToolButton\n slot={props.slot}\n label={label.value}\n paths={props.control.paths}\n disabled={!cmd.isEnabled.value}\n disabledReason={reason.value}\n onClick={() => cmd.execute()}\n />\n );\n },\n });\n}\n\n/**\n * Home > Section > Add Section: adds a section at the current slide and starts renaming it, so\n * it asks for the name, where a rail or a sorter can show the name field (`runSectionSlot`). The\n * toolbar's part for `section.add`. @internal\n */\nexport const SectionAddControl = sectionControl('PptxSectionAddControl');\n\n/**\n * Home > Section > Rename Section: opens the name field of the current slide's section in the\n * rail or the sorter. Without one, it is off and says why (`disabled.noSectionPane`). The\n * toolbar's part for `section.rename`. @internal\n */\nexport const SectionRenameControl = sectionControl('PptxSectionRenameControl');\n","/** @jsxImportSource vue */\n// Table chrome: the Insert > Table grid, where a hover picks the size, and the Table Design\n// style list, which lists the deck's styles (`tableStyleChoices`). The Vue twin of the React\n// adapter's `TableControls.tsx`, on the same core rules (`insert-controls.ts`). A menu places the\n// grid with `MenuTableGrid`, a toolbar with the `table.insert` slot.\n\nimport {\n defineComponent,\n inject,\n nextTick,\n onBeforeUnmount,\n onMounted,\n ref,\n type ExtractPublicPropTypes,\n type PropType,\n} from 'vue';\nimport {\n TABLE_GRID_COLUMNS,\n TABLE_GRID_ROWS,\n tableGridKeyStep,\n tableGridMove,\n tableStyleChoices,\n type ChromeControl,\n type ChromeSlotId,\n type TableGridSize,\n} from '@pptx-editor.dev/core/editor';\nimport { Icon, MenuItem, Popover, ToolButton, keepFocus, useAriaDisabled } from './chrome.tsx';\nimport { useEditorCommand, useEditorState, usePptxEditor, useTranslation } from './composables.ts';\nimport { menuCloseKey } from './menu-row.tsx';\nimport { useSlot } from './slot.ts';\nimport { useTriggerAttributes } from './slot-override.ts';\n\nconst menuTableGridProps = {\n /** The slot whose enabled state gates the insert. Default `table.insert`. */\n slot: { type: String as PropType<ChromeSlotId>, default: 'table.insert' },\n /** Accessible name of the grid. Default: `table.insert` (\"Table\"). */\n label: { type: String, default: undefined },\n /** Move the focus into the grid when it mounts, for a popup opened from the keyboard. */\n autoFocus: { type: Boolean, default: false },\n // The callbacks have no `default`: an absent function prop is `undefined` anyway, and a\n // default puts them in the declaration's list of defaulted props, whose order the compiler\n // takes from the order it first meets each name. That order differed between builds.\n /** Runs instead of the insert, with the rows and columns picked, as React's `onPick`. */\n onPick: { type: Function as PropType<(rows: number, cols: number) => void> },\n /**\n * Runs after the grid inserts a table, as React's `onInserted`. Without it, the insert closes\n * the surrounding menu.\n */\n onInserted: { type: Function as PropType<() => void> },\n /** A class name added to the grid, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n} as const;\n\n/** Props of `MenuTableGrid`, the twin of React's `MenuTableGridProps`. @public */\nexport type MenuTableGridProps = ExtractPublicPropTypes<typeof menuTableGridProps>;\n\n/**\n * The Insert > Table grid, 10 columns by 8 rows, as DOCX Editor's `TableSizeGrid`: the cell\n * under the pointer (or focus) picks the size and each cell names it. A `grid` with one tab\n * stop; the arrows, Home, and End move inside it. `onPick` runs instead of the insert, with the\n * rows and columns; after an insert it calls `onInserted`, and without one it closes the\n * surrounding menu. `className` (or a host `class`) goes on the grid. @public\n */\nexport const MenuTableGrid = defineComponent({\n name: 'MenuTableGrid',\n props: menuTableGridProps,\n setup(props) {\n const { t } = useTranslation();\n const editor = usePptxEditor();\n const cmd = useEditorCommand(() => props.slot);\n const size = ref<TableGridSize>({ rows: 0, cols: 0 });\n // The cell that holds the grid's single tab stop.\n const cursor = ref<TableGridSize>({ rows: 1, cols: 1 });\n const grid = ref<HTMLDivElement | null>(null);\n const closeMenu = inject(menuCloseKey, null);\n // As DOCX Editor's `TableInsert`: an opened grid takes the focus on its tab-stop cell. The\n // popup places itself (and becomes visible) after this mounts, so the focus waits for the\n // next frame: a hidden element takes no focus.\n let frame = 0;\n onMounted(() => {\n if (!props.autoFocus) return;\n frame = requestAnimationFrame(() =>\n grid.value?.querySelector<HTMLElement>('[tabindex=\"0\"]')?.focus()\n );\n });\n onBeforeUnmount(() => cancelAnimationFrame(frame));\n const pick = (rows: number, cols: number): void => {\n if (props.onPick) return void props.onPick(rows, cols);\n // The slot gates the grid; the grid always inserts a table, as DOCX Editor's.\n const command = { type: 'insertTable' as const, rows, cols };\n const ed = editor.value;\n if (!ed || !cmd.isEnabled.value || !ed.can(command).ok) return;\n if (!ed.exec(command).ok) return;\n // In a menu, the insert closes it, as DOCX Editor's grid does through the menu context.\n if (props.onInserted) props.onInserted();\n else closeMenu?.();\n };\n const move = (step: Parameters<typeof tableGridMove>[1]): void => {\n const next = tableGridMove(cursor.value, step);\n cursor.value = next;\n size.value = next;\n void nextTick(() =>\n grid.value?.querySelector<HTMLElement>(`[data-cell=\"${next.rows}x${next.cols}\"]`)?.focus()\n );\n };\n return () => (\n <div\n ref={grid}\n role=\"grid\"\n aria-label={props.label ?? t('table.insert')}\n class={['pptx-table-grid', props.className]}\n data-slot={props.slot}\n data-disabled={!props.onPick && !cmd.isEnabled.value ? '' : undefined}\n onMousedown={keepFocus}\n onMouseleave={() => (size.value = { rows: 0, cols: 0 })}\n onKeydown={(e: KeyboardEvent) => {\n const step = tableGridKeyStep(e.key);\n if (!step) return;\n move(step);\n // The grid's arrows do not also walk the menu rows behind it.\n e.preventDefault();\n e.stopPropagation();\n }}\n >\n <div class=\"pptx-table-grid__cells\" data-columns={TABLE_GRID_COLUMNS}>\n {Array.from({ length: TABLE_GRID_ROWS }, (_, r) => (\n <div key={r} role=\"row\" class=\"pptx-table-grid__row\">\n {Array.from({ length: TABLE_GRID_COLUMNS }, (_, c) => (\n <button\n key={c}\n type=\"button\"\n role=\"gridcell\"\n data-cell={`${r + 1}x${c + 1}`}\n tabindex={cursor.value.rows === r + 1 && cursor.value.cols === c + 1 ? 0 : -1}\n class=\"pptx-table-grid__cell\"\n aria-label={t('table.gridSize', { cols: c + 1, rows: r + 1 })}\n data-active={r < size.value.rows && c < size.value.cols ? '' : undefined}\n onMouseenter={() => (size.value = { rows: r + 1, cols: c + 1 })}\n onFocus={() => (size.value = { rows: r + 1, cols: c + 1 })}\n onClick={() => pick(r + 1, c + 1)}\n />\n ))}\n </div>\n ))}\n </div>\n {/* Not a live region: it would speak on every cell a pointer sweep crosses, and each\n cell already names its size. */}\n <p class=\"pptx-table-grid__label\" aria-hidden=\"true\">\n {size.value.rows\n ? t('table.gridSize', { cols: size.value.cols, rows: size.value.rows })\n : t('table.insert')}\n </p>\n </div>\n );\n },\n});\n\nconst slotPartProps = {\n slot: { type: String as PropType<ChromeSlotId>, required: true as const },\n control: { type: Object as PropType<ChromeControl>, required: true as const },\n} as const;\n\n/** Insert > Table as a control: a button that opens the grid. @internal */\nexport const TableGridControl = defineComponent({\n name: 'PptxTableGridControl',\n props: slotPartProps,\n setup(props) {\n const { cmd, label, reason } = useSlot(\n () => props.slot,\n () => props.control\n );\n const anchor = ref<HTMLSpanElement | null>(null);\n const open = ref(false);\n const close = (): void => {\n open.value = false;\n };\n return () => [\n <span ref={anchor} class=\"pptx-toolbar__group\">\n <ToolButton\n slot={props.slot}\n label={label.value}\n paths={props.control.paths}\n disabled={!cmd.isEnabled.value}\n disabledReason={reason.value}\n hasPopup=\"dialog\"\n expanded={open.value}\n onClick={() => (open.value = !open.value)}\n />\n </span>,\n open.value ? (\n // The popup anchors on the button, so Escape gives the focus back to it, as DOCX\n // Editor's `TableInsert`; it closes when the focus leaves the grid (Tab).\n <Popover\n anchor={anchor.value?.querySelector('button') ?? anchor.value}\n label={label.value}\n role=\"dialog\"\n onClose={close}\n >\n {{\n default: () => (\n <>\n <div\n onFocusout={(e: FocusEvent) => {\n const box = e.currentTarget as HTMLElement;\n if (!box.contains(e.relatedTarget as Node | null)) close();\n }}\n >\n <MenuTableGrid\n slot={props.slot}\n label={label.value}\n autoFocus\n onInserted={close}\n />\n </div>\n </>\n ),\n }}\n </Popover>\n ) : null,\n ];\n },\n});\n\n/** Table Design > Table styles: the deck's styles by name; the table's style is checked. @internal */\nexport const TableStyleControl = defineComponent({\n name: 'PptxTableStyleControl',\n props: slotPartProps,\n setup(props) {\n const { cmd, label, reason, tip } = useSlot(\n () => props.slot,\n () => props.control\n );\n // A disabled trigger stays focusable and says why, as every other picker does.\n const off = useAriaDisabled(() => !cmd.isEnabled.value, reason);\n const { t } = useTranslation();\n const editor = usePptxEditor();\n const anchor = ref<HTMLButtonElement | null>(null);\n const open = ref(false);\n // The list comes from the open deck: read it again when the document changes.\n const revision = useEditorState((s) => s.revision);\n const trigger = useTriggerAttributes(\n props.slot,\n 'pptx-toolbar__button pptx-toolbar__button--wide',\n () => ({ disabled: !cmd.isEnabled.value })\n );\n return () => {\n void revision.value;\n const styles = tableStyleChoices(editor.value);\n // Styles without a name are numbered among themselves, so the user can tell them apart.\n const unnamed = styles.filter((s) => !s.builtIn && !s.name);\n return [\n <button\n ref={anchor}\n type=\"button\"\n {...trigger()}\n data-slot={props.slot}\n aria-label={label.value}\n aria-haspopup=\"menu\"\n aria-expanded={open.value}\n {...tip.value}\n {...off.attrs.value}\n onMousedown={keepFocus}\n onClick={() => (open.value = !open.value)}\n >\n <Icon paths={props.control.paths} />\n <Icon name=\"arrow_drop_down\" className=\"pptx-icon pptx-toolbar__caret\" />\n </button>,\n off.note(),\n open.value ? (\n <Popover anchor={anchor.value} onClose={() => (open.value = false)}>\n {{\n default: () => (\n <>\n {styles.map((s) => (\n <MenuItem\n key={s.id}\n checked={s.id === cmd.value.value}\n onSelect={() => {\n cmd.execute(s.id);\n open.value = false;\n }}\n >\n {{\n default: () =>\n s.builtIn\n ? t('table.defaultStyle')\n : s.name || t('table.unnamedStyle', { n: unnamed.indexOf(s) + 1 }),\n }}\n </MenuItem>\n ))}\n </>\n ),\n }}\n </Popover>\n ) : null,\n ];\n };\n },\n});\n","/** @jsxImportSource vue */\n// `PptxEditorMenu`: the menu bar as library parts, the Vue twin of the React adapter's\n// `PptxEditor.Menu` (`menu-parts.tsx`), after DOCX Editor's `DocxEditorMenu`\n// (docx-editor/docs/site/content/customization/menus.mdx, packages/vue/src/editor/menu/).\n//\n// The preset bar renders core's `CHROME_MENUS` (File, Edit, View, Insert, Format, Arrange,\n// Slide Show). A named menu child (`PptxEditorMenu.File`) changes its menu in place: `hidden`\n// removes it, `MenuSlotItem slot-id` replaces or hides one row, other children add rows at its\n// end, and `:preset=\"false\"` keeps only its children. `MenuEntry` with another id adds a host\n// menu. `:preset=\"false\"` on the bar renders only the children. Hiding a row changes the\n// interface only: its command still runs from the toolbar, the keyboard, and the API. Which\n// rows and menus show, and how the bar's keys move, come from core (`menu-arrangement.ts`).\n\nimport { chromeTranslateProp, useChromeTranslateScope } from './headless-hooks.ts';\nimport {\n Comment,\n Fragment,\n Text,\n defineComponent,\n inject,\n isVNode,\n normalizeClass,\n provide,\n ref,\n watch,\n type DefineComponent,\n type ExtractPublicPropTypes,\n type PropType,\n type VNode,\n type VNodeArrayChildren,\n type VNodeChild,\n} from 'vue';\nimport {\n arrangeMenuBar,\n arrangeMenuRows,\n menuBarArrow,\n menuBarClosedOnEscape,\n menuBarRestoresFocus,\n menuBarTriggerKey,\n menuPartName,\n translateKeyOrText,\n warnMenuPart,\n MENU_NAMED_PARTS,\n type ChromeMenu,\n type ChromeMenuId,\n type ChromeSlotId,\n type MenuNamedRow,\n type MenuRowPartName,\n type MenuSlotRowSpec,\n} from '@pptx-editor.dev/core/editor';\nimport { Icon, Popover, keepFocus } from './chrome.tsx';\nimport { useTranslation } from './composables.ts';\nimport { MenuRow, MenuSeparator, MenuSubmenu, menuCloseKey } from './menu-row.tsx';\nimport { MenuEntries, SlotMenuRow, VUE_MENU_PARTS, rowDefaultsKey } from './menu-rows.tsx';\nimport { MenuTableGrid } from './TableControls.tsx';\n\n// ---------------------------------------------------------------------------------------------\n// Reading host children\n\n/** A vnode prop by its camelCase or kebab-case name (templates pass either). */\nfunction prop(vnode: VNode, camel: string): unknown {\n const props = (vnode.props ?? {}) as Record<string, unknown>;\n if (camel in props) return props[camel];\n return props[camel.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)];\n}\n\n/** A boolean vnode prop: present with no value (`hidden`) means true, as Vue casts it. */\nfunction flag(vnode: VNode, camel: string): boolean | undefined {\n const value = prop(vnode, camel);\n if (value === undefined) return undefined;\n return value === '' || value === true || value === 'true';\n}\n\nconst text = (value: unknown): string | undefined =>\n typeof value === 'string' ? value : undefined;\n\n/** The direct children of a slot, with fragments opened and comments and blank text dropped. */\nexport function flattenMenuChildren(\n children: VNodeArrayChildren | VNodeChild | undefined,\n out: VNode[] = []\n): VNode[] {\n if (Array.isArray(children)) {\n for (const child of children) flattenMenuChildren(child as VNodeChild, out);\n return out;\n }\n if (!isVNode(children)) return out;\n if (children.type === Comment) return out;\n if (children.type === Text && String(children.children ?? '').trim() === '') return out;\n if (children.type === Fragment && Array.isArray(children.children))\n return flattenMenuChildren(children.children as VNodeArrayChildren, out);\n out.push(children);\n return out;\n}\n\n/** The default slot content of a component vnode, as vnodes. */\nfunction slotChildren(vnode: VNode): VNode[] {\n const c = vnode.children as unknown;\n if (Array.isArray(c)) return flattenMenuChildren(c as VNodeArrayChildren);\n const slot = (c as { default?: () => VNodeArrayChildren } | null)?.default;\n return typeof slot === 'function' ? flattenMenuChildren(slot()) : [];\n}\n\n/**\n * The registry row a child names: a `MenuSlotItem`, or a named row (`PptxEditorMenu.Cut`) with\n * its row pinned. Null for any other child. @internal\n */\nexport function slotRowOf(vnode: VNode): MenuSlotRowSpec | null {\n const pinned = (vnode.type as { pptxMenuRow?: MenuNamedRow } | null)?.pptxMenuRow;\n if (pinned)\n return { slotId: pinned.slot, value: pinned.value, hidden: flag(vnode, 'hidden') ?? false };\n if (vnode.type !== MenuSlotItem) return null;\n return {\n slotId: String(prop(vnode, 'slotId')),\n value: text(prop(vnode, 'value')),\n hidden: flag(vnode, 'hidden') ?? false,\n };\n}\n\n// ---------------------------------------------------------------------------------------------\n// MenuSlotItem\n\nconst menuSlotItemProps = {\n /** The slot the row runs, for example `text.bold`. */\n slotId: { type: String as PropType<ChromeSlotId>, required: true as const },\n /** The value a value slot runs with (`arrange.order` with `front`). */\n value: { type: String, default: undefined },\n /** A translation key for the row's label, in place of the registry label. */\n labelKey: { type: String, default: undefined },\n /** A translation key for the shortcut shown at the end of the row. */\n shortcutKey: { type: String, default: undefined },\n /** In place of the registry icon: a Material Symbol name, or icon content (a vnode). */\n icon: { type: [String, Object] as PropType<string | VNode>, default: undefined },\n /**\n * Run the slot's command at once instead of opening its choices (a value slot such as\n * `slide.add`). Unset, the row runs as the registry row it replaces.\n */\n direct: { type: Boolean, default: undefined },\n /** Remove the row. Its command keeps working elsewhere. */\n hidden: { type: Boolean, default: false },\n /** A class name added to the row, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n} as const;\n\n/**\n * Props for `PptxEditorMenu.Item` and `PptxEditorContextMenu.Slot`: one registry row, the twin\n * of React's `MenuSlotItemProps`. `className` (or a host `class`) lands on the row. @public\n */\nexport type MenuSlotItemProps = ExtractPublicPropTypes<typeof menuSlotItemProps>;\n\n/**\n * A menu row for a registered slot: its label, icon, shortcut, enabled state, and action come\n * from the chrome registry. A slot that collects a value opens a submenu of its choices.\n * @public\n */\nexport const MenuSlotItem = defineComponent({\n name: 'MenuSlotItem',\n // The row may be a submenu (a fragment), so the host's `class` goes onto the row here.\n inheritAttrs: false,\n props: menuSlotItemProps,\n setup(props, { attrs }) {\n // In place of a registry row, the row keeps that row's own label and shortcut.\n const replaced = inject(rowDefaultsKey, null);\n return () => {\n if (props.hidden) return null;\n const labelKey = props.labelKey ?? replaced?.labelKey;\n // In place of a registry row that runs its command, the row runs it too, unless it says not to.\n const inherited =\n !!replaced?.direct && replaced.slot === props.slotId && props.value === undefined;\n const direct = props.direct ?? inherited;\n // A row that opens choices does not show the shortcut of the direct row it replaces.\n const shortcutKey =\n props.shortcutKey ?? (inherited && !direct ? undefined : replaced?.shortcutKey);\n const className = normalizeClass([attrs.class, props.className]);\n return (\n <SlotMenuRow\n entry={{\n kind: 'item',\n slot: props.slotId,\n ...(props.value !== undefined ? { value: props.value } : {}),\n ...(direct ? { direct: true as const } : {}),\n }}\n overrides={{\n ...(labelKey ? { labelKey } : {}),\n ...(shortcutKey ? { shortcutKey } : {}),\n ...(className ? { className } : {}),\n ...(props.icon !== undefined ? { icon: props.icon } : {}),\n }}\n />\n );\n };\n },\n});\n\n// ---------------------------------------------------------------------------------------------\n// Named rows\n\nconst menuRowPartProps = {\n /** The row's text, or a translation key, in place of the registry label. */\n label: { type: String, default: undefined },\n /** A translation key for the row's label, in place of the registry label. */\n labelKey: { type: String, default: undefined },\n /** A translation key for the shortcut shown at the end of the row. */\n shortcutKey: { type: String, default: undefined },\n /** In place of the registry icon: a Material Symbol name, or icon content (a vnode). */\n icon: { type: [String, Object] as PropType<string | VNode>, default: undefined },\n /** A class name added to the row, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n /** Remove the row. Its command keeps working elsewhere. */\n hidden: { type: Boolean, default: false },\n} as const;\n\n/** Props for a named menu row, the twin of React's `MenuRowPartProps`. @public */\nexport type MenuRowPartProps = ExtractPublicPropTypes<typeof menuRowPartProps>;\n\n/** A named menu row: a `MenuSlotItem` with its slot pinned, as React's. @public */\nexport type MenuRowPartComponent = DefineComponent<MenuRowPartProps> & {\n /** The registry row the part stands for. */\n readonly pptxMenuRow: MenuNamedRow;\n};\n\n/**\n * A named row, after DOCX Editor's `defineCommandRow`: a `MenuSlotItem` with its slot and value\n * pinned, and the row as a static (`pptxMenuRow`), so a menu finds it among its children.\n * @internal\n */\nfunction defineMenuRowPart(name: string, row: MenuNamedRow): MenuRowPartComponent {\n return Object.assign(\n defineComponent({\n name: `MenuRow${name}`,\n inheritAttrs: false,\n props: menuRowPartProps,\n setup(props, { attrs }) {\n return () => {\n const labelKey = props.label ?? props.labelKey;\n return (\n <MenuSlotItem\n slotId={row.slot}\n {...(row.value !== undefined ? { value: row.value } : {})}\n {...(labelKey !== undefined ? { labelKey } : {})}\n {...(props.shortcutKey !== undefined ? { shortcutKey: props.shortcutKey } : {})}\n {...(props.icon !== undefined ? { icon: props.icon } : {})}\n className={normalizeClass([attrs.class, props.className]) || undefined}\n hidden={props.hidden}\n />\n );\n };\n },\n }),\n { pptxMenuRow: row }\n ) as unknown as MenuRowPartComponent;\n}\n\n/** The named rows of `table`, by name. @internal */\nexport function defineMenuRowParts<K extends string>(\n table: Readonly<Record<K, MenuNamedRow>>\n): Record<K, MenuRowPartComponent> {\n return Object.fromEntries(\n Object.entries<MenuNamedRow>(table).map(([name, row]) => [name, defineMenuRowPart(name, row)])\n ) as Record<K, MenuRowPartComponent>;\n}\n\n/**\n * The named rows of the menu bar (`PptxEditorMenu.Cut`, `PptxEditorMenu.PageSetup`, …), the\n * twin of React's `MenuNamedRows`. @public\n */\nexport type MenuNamedRows = { readonly [K in MenuRowPartName]: MenuRowPartComponent };\n\nconst MENU_ROW_PARTS: MenuNamedRows = defineMenuRowParts(MENU_NAMED_PARTS);\n\n// ---------------------------------------------------------------------------------------------\n// MenuGroup\n\nconst menuGroupProps = {\n /** A heading shown above the rows. Wins over `labelKey`. */\n label: { type: String, default: undefined },\n /** A translation key for the heading. */\n labelKey: { type: String, default: undefined },\n /** Remove the group and its rows. */\n hidden: { type: Boolean, default: false },\n /** A class name added to the group, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n} as const;\n\n/** Props for `PptxEditorMenu.Group`, the twin of React's `MenuGroupProps`. @public */\nexport type MenuGroupProps = ExtractPublicPropTypes<typeof menuGroupProps>;\n\n/** A labeled set of rows inside a menu. A host `class` lands on the group. @public */\nexport const MenuGroup = defineComponent({\n name: 'MenuGroup',\n props: menuGroupProps,\n setup(props, { slots }) {\n const { t } = useTranslation();\n return () => {\n if (props.hidden) return null;\n const heading =\n props.label ?? (props.labelKey ? translateKeyOrText(t, props.labelKey) : undefined);\n return (\n <div role=\"group\" aria-label={heading} class={['pptx-menu__group', props.className]}>\n {heading ? (\n <div class=\"pptx-menu__heading\" aria-hidden=\"true\">\n {heading}\n </div>\n ) : null}\n {slots.default?.()}\n </div>\n );\n };\n },\n});\n\n// ---------------------------------------------------------------------------------------------\n// MenuEntry and the named menus\n\nconst menuPartProps = {\n /** The menu's title. Wins over `labelKey`. Built-in menus keep their own title without it. */\n label: { type: String, default: undefined },\n /** A translation key for the menu's title. */\n labelKey: { type: String, default: undefined },\n /** Icon content before the title: a Material Symbol name, or a vnode. */\n icon: { type: [String, Object] as PropType<string | VNode>, default: undefined },\n /** Remove the menu from the bar. */\n hidden: { type: Boolean, default: false },\n /**\n * `true` (default): the built-in rows, with `MenuSlotItem` children replacing their rows in\n * place and other children added at the end. `false`: only the children.\n */\n preset: { type: Boolean, default: undefined },\n /** For a host menu: the menu it follows. Without it, host menus follow the built-in ones. */\n after: { type: String as PropType<ChromeMenuId | (string & {})>, default: undefined },\n /** A class name added to the menu's panel, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n} as const;\n\nconst menuEntryProps = {\n /** A built-in menu id changes that menu; any other id adds a host menu. */\n id: { type: String as PropType<ChromeMenuId | (string & {})>, required: true as const },\n ...menuPartProps,\n} as const;\n\n/**\n * Props for `PptxEditorMenu.Entry`, the twin of React's `MenuEntryProps`. `className` (or a\n * host `class`) goes onto the menu's panel; the default slot is the menu's rows. @public\n */\nexport type MenuEntryProps = ExtractPublicPropTypes<typeof menuEntryProps>;\n\n/**\n * One menu of the bar. Inside `PptxEditorMenu` it is a description the bar reads; the bar\n * renders it. @public\n */\nexport const MenuEntry = defineComponent({\n name: 'MenuEntry',\n props: menuEntryProps,\n setup() {\n // `PptxEditorMenu` reads its entries' props; rendered anywhere else, an entry says so.\n return () => {\n warnMenuPart('PptxEditorMenu.Entry', 'outsideBar', undefined, VUE_MENU_PARTS);\n return null;\n };\n },\n});\n\n/** Props of a named menu: `MenuEntryProps` without `id`. */\ntype MenuPartProps = ExtractPublicPropTypes<typeof menuPartProps>;\n\n/** A named menu (`PptxEditorMenu.File`): a `MenuEntry` with its id pinned. @public */\nexport type MenuPartComponent = DefineComponent<MenuPartProps> & {\n /** The menu the part stands for. */\n readonly pptxMenu: ChromeMenuId;\n};\n\nfunction defineMenu(id: ChromeMenuId): MenuPartComponent {\n const name = menuPartName(id);\n return Object.assign(\n defineComponent({\n name: name.replace('.', ''),\n props: menuPartProps,\n setup() {\n return () => {\n warnMenuPart(`PptxEditor${name}`, 'outsideBar', undefined, VUE_MENU_PARTS);\n return null;\n };\n },\n }),\n { pptxMenu: id }\n ) as unknown as MenuPartComponent;\n}\n\n/** The named menus. */\nconst MENU_PARTS = {\n File: defineMenu('file'),\n Edit: defineMenu('edit'),\n View: defineMenu('view'),\n Insert: defineMenu('insert'),\n Format: defineMenu('format'),\n Arrange: defineMenu('arrange'),\n SlideShow: defineMenu('slideShow'),\n} as const;\n\n/** What the bar reads from a `MenuEntry` or named menu child. */\ninterface EntrySpec {\n readonly id: string;\n readonly label: string | undefined;\n readonly labelKey: string | undefined;\n readonly icon: string | VNode | undefined;\n readonly className: string | undefined;\n readonly hidden: boolean;\n readonly preset: boolean | undefined;\n readonly after: string | undefined;\n readonly children: () => VNode[];\n}\n\n/** The menu a child describes: `MenuEntry`, or a named menu with its pinned id. */\nfunction entryOf(vnode: VNode): EntrySpec | null {\n const pinned = (vnode.type as { pptxMenu?: ChromeMenuId } | null)?.pptxMenu;\n if (!pinned && vnode.type !== MenuEntry) return null;\n const icon = prop(vnode, 'icon');\n return {\n id: pinned ?? String(prop(vnode, 'id')),\n label: text(prop(vnode, 'label')),\n labelKey: text(prop(vnode, 'labelKey')),\n icon: typeof icon === 'string' || isVNode(icon) ? icon : undefined,\n className: normalizeClass([prop(vnode, 'class'), prop(vnode, 'className')]) || undefined,\n hidden: flag(vnode, 'hidden') ?? false,\n preset: flag(vnode, 'preset'),\n after: text(prop(vnode, 'after')),\n children: () => slotChildren(vnode),\n };\n}\n\n/** The rows of a built-in menu after the host's children. */\nfunction builtInRows(menu: ChromeMenu, spec: EntrySpec | undefined): VNodeChild {\n if (spec?.preset === false) return spec.children();\n const { entries, overrides, extras } = arrangeMenuRows(\n menu.entries,\n spec?.children() ?? [],\n slotRowOf,\n // A hidden row this menu does not have removes nothing, and says so.\n (slot) =>\n warnMenuPart(\n `PptxEditor${menuPartName(menu.id)} > PptxEditorMenu.Item`,\n 'unmatchedHidden',\n slot,\n VUE_MENU_PARTS\n )\n );\n const renders = new Map<string, (() => VNode) | null>();\n for (const [key, child] of overrides) renders.set(key, child ? () => child : null);\n return [<MenuEntries entries={entries} overrides={renders} />, ...extras];\n}\n\n// ---------------------------------------------------------------------------------------------\n// The bar\n\n/** Provides the close function to the rows of one open menu. @internal */\nexport const MenuCloseScope = defineComponent({\n name: 'PptxMenuCloseScope',\n props: { close: { type: Function as PropType<() => void>, required: true as const } },\n setup(props, { slots }) {\n provide(menuCloseKey, () => props.close());\n return () => slots.default?.();\n },\n});\n\n/** One menu as the bar draws it. */\ninterface BarMenu {\n readonly id: string;\n readonly title: string;\n readonly icon: string | VNode | undefined;\n readonly className: string | undefined;\n readonly content: () => VNodeChild;\n}\n\nconst menuProps = {\n ...chromeTranslateProp,\n /**\n * `true` (default): the built-in menus, changed by named menu and `MenuEntry` children;\n * other children follow the menus. `false`: only the children.\n */\n preset: { type: Boolean, default: true },\n /** A class name added to the bar, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n} as const;\n\n/**\n * Props for `PptxEditorMenu`, the twin of React's `MenuProps`. `className` (or a host `class`)\n * lands on the bar; the default slot holds the named menus, `MenuEntry` children, and other bar content.\n * @public\n */\nexport type MenuProps = ExtractPublicPropTypes<typeof menuProps>;\n\n/**\n * The menu bar: File, Edit, View, Insert, Format, Arrange, and Slide Show, from core's\n * `CHROME_MENUS`. Every row runs a registered slot, so its state and action are the toolbar's.\n * @public\n */\nconst MenuRoot = defineComponent({\n name: 'PptxEditorMenu',\n props: menuProps,\n setup(props, { slots }) {\n const { t } = useChromeTranslateScope(() => props.t);\n const open = ref<string | null>(null);\n // Roving tab stop, as DOCX Editor's menu bar: the bar is one Tab stop, the arrows move.\n const active = ref<string | null>(null);\n const triggers = new Map<string, HTMLButtonElement>();\n // Set when hover switched the bar to a menu: the click that follows must not close it.\n let switchedByHover = false;\n // A pointer open puts focus on the trigger so the arrow keys reach the menu; closing gives\n // focus back to where it was (the slide's text input, the slide). A keyboard open, and\n // Escape, return to the trigger.\n let restoreTo: HTMLElement | null = null;\n const bar = ref<HTMLDivElement | null>(null);\n const close = (): void => {\n open.value = null;\n };\n watch(\n open,\n (now) => {\n if (now !== null) return;\n const target = restoreTo;\n restoreTo = null;\n // Focus that a row moved on purpose (a dialog, the find bar, the link popup) stays there.\n if (target && menuBarRestoresFocus(target, bar.value))\n target.focus({ preventScroll: true });\n },\n { flush: 'post' }\n );\n const rtl = (): boolean => {\n const first = triggers.values().next().value;\n return !!first && getComputedStyle(first).direction === 'rtl';\n };\n return () => {\n const specs = new Map<string, EntrySpec>();\n const loose: VNode[] = [];\n for (const child of flattenMenuChildren(slots.default?.())) {\n const spec = entryOf(child);\n if (spec) specs.set(spec.id, spec);\n else loose.push(child);\n }\n // With `preset` off, a named built-in menu still brings its title and rows, as in DOCX\n // Editor; `MenuEntry :preset=\"false\"` keeps only its children.\n const menus: BarMenu[] = arrangeMenuBar(specs, props.preset, t).map(\n ({ id, title, spec, registry }) => ({\n id,\n title,\n icon: spec?.icon,\n className: spec?.className,\n content: () => (registry ? builtInRows(registry, spec) : (spec?.children() ?? null)),\n })\n );\n const stop = menus.some((m) => m.id === active.value) ? active.value : (menus[0]?.id ?? null);\n const step = (from: string, by: -1 | 1, keepOpen: boolean): void => {\n const index = menus.findIndex((m) => m.id === from);\n const next = menus[(index + by + menus.length) % menus.length];\n if (!next) return;\n active.value = next.id;\n // The trigger takes focus first, so an open popover moves focus to its first row.\n triggers.get(next.id)?.focus();\n if (keepOpen) open.value = next.id;\n };\n const onTriggerKey = (id: string, e: KeyboardEvent): void => {\n const action = menuBarTriggerKey(e.key, rtl());\n if (!action) return;\n e.preventDefault();\n if (action.kind === 'step') step(id, action.by, open.value !== null);\n else if (action.kind === 'open') {\n active.value = id;\n open.value = id;\n } else {\n const target = action.edge === 'first' ? menus[0] : menus[menus.length - 1];\n if (!target) return;\n active.value = target.id;\n triggers.get(target.id)?.focus();\n }\n };\n const onPanelKey = (id: string, e: KeyboardEvent): void => {\n const by = menuBarArrow(e.key, rtl());\n if (!by) return;\n e.preventDefault();\n step(id, by, true);\n };\n const onClick = (id: string): void => {\n if (switchedByHover) {\n switchedByHover = false;\n return;\n }\n active.value = id;\n const trigger = triggers.get(id);\n if (open.value === null) {\n const focused = trigger?.ownerDocument.activeElement;\n restoreTo =\n focused instanceof HTMLElement && focused !== focused.ownerDocument.body\n ? focused\n : null;\n }\n // A pointer open puts focus on the trigger, so the arrow keys reach the menu instead of\n // moving a shape on the slide (the popover then focuses its first row).\n trigger?.focus({ preventScroll: true });\n open.value = open.value === id ? null : id;\n };\n return (\n <div\n ref={bar}\n role=\"menubar\"\n aria-label={t('menu.ariaLabel')}\n class={['pptx-menubar', props.className]}\n >\n {menus.map((menu) => [\n <button\n key={`trigger-${menu.id}`}\n ref={(el) => {\n if (el) triggers.set(menu.id, el as HTMLButtonElement);\n else triggers.delete(menu.id);\n }}\n type=\"button\"\n role=\"menuitem\"\n class=\"pptx-menubar__trigger\"\n aria-haspopup=\"menu\"\n aria-expanded={open.value === menu.id}\n tabindex={stop === menu.id ? 0 : -1}\n data-menu={menu.id}\n onMousedown={keepFocus}\n onFocus={() => {\n active.value = menu.id;\n }}\n onKeydown={(e: KeyboardEvent) => onTriggerKey(menu.id, e)}\n onMouseenter={() => {\n if (open.value !== null && open.value !== menu.id) {\n switchedByHover = true;\n active.value = menu.id;\n // Focus follows the open menu, so the old panel's cleanup cannot pull it back.\n triggers.get(menu.id)?.focus({ preventScroll: true });\n open.value = menu.id;\n }\n }}\n onMouseleave={() => {\n switchedByHover = false;\n }}\n onClick={() => onClick(menu.id)}\n >\n {/* The same icon rule as the rows: a string is a Material Symbol name. */}\n {typeof menu.icon === 'string' ? <Icon name={menu.icon} /> : (menu.icon ?? null)}\n {menu.title}\n </button>,\n open.value === menu.id ? (\n <Popover\n key={`panel-${menu.id}`}\n anchor={triggers.get(menu.id) ?? null}\n onClose={() => {\n // Escape leaves focus on the menubar item, not on the slide (WAI-ARIA menubar).\n if (menuBarClosedOnEscape(triggers.get(menu.id))) restoreTo = null;\n close();\n }}\n label={menu.title}\n >\n {{\n default: () => (\n <MenuCloseScope close={close}>\n {{\n default: () => (\n <div\n class={['pptx-menubar__panel', menu.className]}\n data-menu={menu.id}\n onKeydown={(e: KeyboardEvent) => onPanelKey(menu.id, e)}\n >\n {menu.content()}\n </div>\n ),\n }}\n </MenuCloseScope>\n ),\n }}\n </Popover>\n ) : null,\n ])}\n {loose}\n </div>\n );\n };\n },\n});\n\n/** The menu bar with its parts as statics, the twin of React's `MenuNamespace`. @public */\nexport type MenuNamespace = typeof MenuRoot &\n MenuNamedRows & {\n /** A host menu, or a built-in one by id. */\n readonly Entry: typeof MenuEntry;\n /** A registry row: replace, change, or hide it in place. */\n readonly Item: typeof MenuSlotItem;\n /** A host row. */\n readonly Row: typeof MenuRow;\n /** A labeled set of rows. */\n readonly Group: typeof MenuGroup;\n /** A line between rows. */\n readonly Separator: typeof MenuSeparator;\n /** A row that opens a nested panel. */\n readonly Submenu: typeof MenuSubmenu;\n /** The Insert > Table grid, for a host's own Table submenu (DOCX Editor's `Menu.TableGrid`). */\n readonly TableGrid: typeof MenuTableGrid;\n readonly File: MenuPartComponent;\n readonly Edit: MenuPartComponent;\n readonly View: MenuPartComponent;\n readonly Insert: MenuPartComponent;\n readonly Format: MenuPartComponent;\n readonly Arrange: MenuPartComponent;\n readonly SlideShow: MenuPartComponent;\n };\n\n/**\n * The menu bar (`PptxEditorMenu`): File, Edit, View, Insert, Format, Arrange, and Slide Show,\n * with DOCX Editor's parts (`Entry`, `Item`, `Row`, `Group`, `Separator`, `Submenu`) and one\n * named part per menu (`PptxEditorMenu.File`, …). @public\n *\n * @example\n * ```vue\n * <PptxEditorMenu>\n * <PptxEditorMenu.File>\n * <PptxEditorMenu.Row label=\"Open…\" icon=\"folder_open\" @select=\"openFile\" />\n * </PptxEditorMenu.File>\n * <PptxEditorMenu.Edit>\n * <PptxEditorMenu.Item slot-id=\"more.delete\" hidden />\n * </PptxEditorMenu.Edit>\n * <PptxEditorMenu.Arrange hidden />\n * </PptxEditorMenu>\n * ```\n */\nexport const PptxEditorMenu: MenuNamespace = Object.assign(MenuRoot, {\n ...MENU_ROW_PARTS,\n ...MENU_PARTS,\n Entry: MenuEntry,\n Item: MenuSlotItem,\n Row: MenuRow,\n Group: MenuGroup,\n Separator: MenuSeparator,\n Submenu: MenuSubmenu,\n TableGrid: MenuTableGrid,\n});\n","/** @jsxImportSource vue */\n// View > Slide Sorter: the Vue twin of the React adapter's `SlideSorter.tsx`, with the same\n// markup, classes, ARIA, and keys. Every slide shows as a thumbnail in a grid, grouped by\n// section. Click, Shift+click, and Ctrl/Cmd+click select slides; a drag moves the selection;\n// Delete, Ctrl/Cmd+D, and the context menu act on it; a double-click or Enter opens the slide in\n// the Normal view. Every edit goes through the same commands as the rail, so it is one undo\n// step. The keys come from core (`sorterKeyDown`).\n\nimport {\n computed,\n defineComponent,\n onBeforeUnmount,\n onMounted,\n ref,\n shallowRef,\n watch,\n type ExtractPublicPropTypes,\n type VNodeChild,\n} from 'vue';\nimport {\n chromeControlForSlot,\n focusSorterOnShow,\n tooltipAttributes,\n groupSlideSections,\n focusCurrentSlideOrCanvas,\n openSlideInNormalView,\n sectionOfSlide,\n slideMenuPoint,\n slideSorterMounted,\n sorterKeyDown,\n translateKeyOrText,\n warnSlideSorterUnmounted,\n type SlideSummary,\n} from '@pptx-editor.dev/core/editor';\nimport { Icon, keepFocus, useAriaDisabled } from './chrome.tsx';\nimport { useEditorCommand, useEditorState, usePptxEditor, useTranslation } from './composables.ts';\nimport { useEditorDialog } from './popups.ts';\nimport {\n PptxEditorZoomPill,\n Thumbnail,\n clickMode,\n useFocusFollowsCurrent,\n useSlideStepTarget,\n} from './panes.tsx';\nimport { RailMenuHost, type RailMenuState } from './RailContextMenu.tsx';\nimport {\n SectionNode,\n useCollapsedSections,\n useFocusAfterCollapse,\n useFocusCurrentAfterRender,\n useOpenCurrentSection,\n useSectionRenameRequests,\n useSlideSections,\n useSorterRegistration,\n} from './RailSections.tsx';\nimport { useSlideDrag } from './slide-drag.ts';\nimport { PptxEditorEditNotice } from './EditNotice.tsx';\n\nconst sameList = <T,>(a: readonly T[], b: readonly T[]): boolean =>\n a.length === b.length && a.every((v, i) => v === b[i]);\n\nconst slideSorterProps = {\n /** A class name added to the sorter, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n} as const;\n\n/** Props of `PptxEditorSlideSorter`, the twin of React's `SlideSorterProps`. @public */\nexport type SlideSorterProps = ExtractPublicPropTypes<typeof slideSorterProps>;\n\n/**\n * The slide sorter, the twin of React's `PptxEditor.SlideSorter`. Put it where the slide and the\n * rail go in the Normal view, while `snapshot().presentationView` is `slideSorter`. When the\n * view becomes `slideSorter` and no sorter of the editor is mounted, a development warning says\n * so. @public\n */\nexport const PptxEditorSlideSorter = defineComponent({\n name: 'PptxEditorSlideSorter',\n props: slideSorterProps,\n setup(props) {\n const editor = usePptxEditor();\n const { t } = useTranslation();\n const slides = useEditorState((s) => s.slides, sameList);\n const current = useEditorState((s) => s.currentSlide);\n const selected = useEditorState((s) => s.selectedSlides, sameList);\n const ratio = useEditorState((s) => s.slideHeight / s.slideWidth);\n const readOnly = useEditorState((s) => s.mode === 'view');\n const sections = useSlideSections();\n const count = (): number => slides.value.length;\n const grouped = computed(() => groupSlideSections(sections.value, count()));\n const collapsed = useCollapsedSections();\n useOpenCurrentSection(grouped);\n useSorterRegistration();\n const list = ref<HTMLOListElement | null>(null);\n const drag = useSlideDrag('x', selected, readOnly, grouped);\n const menu = shallowRef<RailMenuState | null>(null);\n const renaming = ref<string | null>(null);\n // The sorter renames in place, also while it is flat: Add Section in a deck without\n // sections asks for the name before the new header renders.\n useSectionRenameRequests((id) => {\n renaming.value = id;\n });\n const focusCurrent = useFocusCurrentAfterRender(list);\n const trackCollapse = useFocusAfterCollapse(list, collapsed);\n // Shown from a menu, the sorter takes focus on the current slide (core's\n // `focusSorterOnShow`), after the hooks above listen for focus.\n let stopFocus = (): void => {};\n onMounted(() => {\n if (list.value) stopFocus = focusSorterOnShow(list.value);\n });\n onBeforeUnmount(() => stopFocus());\n const background = useEditorDialog('background');\n const stepTo = useSlideStepTarget(\n () => selected.value,\n count,\n () => grouped.value\n );\n // Keyboard focus follows the current slide while a tile has it (after Ctrl+D, a drop, a\n // Delete of the last tile).\n const trackFocus = useFocusFollowsCurrent(list, '.pptx-sorter__item', () => [\n current.value,\n count(),\n ]);\n const openSlide = (index: number): void =>\n openSlideInNormalView(editor.value, index, list.value);\n const openMenu = (index: number, item: HTMLElement, at: { x: number; y: number } | null) => {\n const ed = editor.value;\n if (!ed) return;\n if (!ed.snapshot().selectedSlides.includes(index)) ed.selectSlide(index);\n menu.value = { at: slideMenuPoint(item, at), index, keyboard: !at, owner: item };\n };\n const onKeydown = (e: KeyboardEvent): void =>\n sorterKeyDown(e, {\n editor: editor.value,\n readOnly: readOnly.value,\n selected: selected.value,\n current: current.value,\n count: count(),\n grouped: grouped.value,\n list: list.value,\n step: stepTo,\n openMenu: (index, item) => openMenu(index, item, null),\n focusCurrent,\n openSlide,\n });\n return () => {\n const groups = grouped.value;\n // Tab goes to the current slide, or to its section's header when that section is shut.\n const own = sectionOfSlide(groups, current.value);\n const shut = !!own && collapsed.value.includes(own.id);\n const item = (s: SlideSummary): VNodeChild => (\n <li\n key={s.index}\n class=\"pptx-sorter__item\"\n role={groups ? 'treeitem' : 'option'}\n aria-selected={selected.value.includes(s.index)}\n aria-current={s.index === current.value}\n aria-label={t(s.hidden ? 'rail.hiddenSlideLabel' : 'rail.slideLabel', {\n index: s.index + 1,\n })}\n data-hidden={s.hidden ? '' : undefined}\n data-index={s.index}\n {...drag.itemProps(s.index)}\n tabindex={s.index === current.value && !shut ? 0 : -1}\n onClick={(e: MouseEvent) => {\n (e.currentTarget as HTMLElement).focus({ preventScroll: true });\n editor.value?.selectSlide(s.index, clickMode(e));\n }}\n onDblclick={() => openSlide(s.index)}\n onContextmenu={(e: MouseEvent) => {\n e.preventDefault();\n const pointer = e.clientX !== 0 || e.clientY !== 0;\n openMenu(\n s.index,\n e.currentTarget as HTMLElement,\n pointer ? { x: e.clientX, y: e.clientY } : null\n );\n }}\n >\n <Thumbnail slide={s} ratio={ratio.value} />\n <span class=\"pptx-sorter__number\">{s.index + 1}</span>\n </li>\n );\n return (\n <section class={['pptx-sorter', props.className]} aria-label={t('sorter.ariaLabel')}>\n <ol\n ref={list}\n class=\"pptx-sorter__list\"\n role={groups ? 'tree' : 'listbox'}\n aria-multiselectable=\"true\"\n aria-label={t('sorter.ariaLabel')}\n onKeydown={onKeydown}\n onFocusin={(e: FocusEvent) => {\n trackFocus(e);\n trackCollapse(e);\n }}\n >\n {groups ? (\n groups.map((sec) => (\n <SectionNode\n key={sec.id}\n section={sec}\n collapsed={collapsed.value.includes(sec.id)}\n renaming={renaming.value === sec.id}\n variant=\"sorter\"\n focusable={shut && own?.id === sec.id}\n onRename={() => {\n renaming.value = sec.id;\n }}\n onRenameEnd={() => {\n renaming.value = null;\n }}\n onRemoved={focusCurrent}\n >\n {() =>\n slides.value.slice(sec.firstSlide, sec.firstSlide + sec.slideCount).map(item)\n }\n </SectionNode>\n ))\n ) : (\n <li role=\"presentation\" class=\"pptx-sorter__section\">\n <ol role=\"group\" class=\"pptx-sorter__grid\">\n {slides.value.map(item)}\n </ol>\n </li>\n )}\n </ol>\n <RailMenuHost\n open={\n menu.value\n ? {\n menu: menu.value,\n onClose: () => {\n menu.value = null;\n },\n onSectionAdded: (id: string) => {\n renaming.value = id;\n },\n ...(background.isAvailable.value\n ? { onBackground: () => background.open(menu.value?.owner ?? null) }\n : {}),\n }\n : null\n }\n />\n </section>\n );\n };\n },\n});\n\n/**\n * Normal and Slide Sorter as two buttons, as in a status bar: the default editor's view switch,\n * a one-of-two choice (`radiogroup`). Hosts place the `view.presentationView` slot instead. The\n * twin of React's `ViewSwitch`. @internal\n */\nexport const ViewSwitch = defineComponent({\n name: 'PptxViewSwitch',\n setup() {\n const { t } = useTranslation();\n const cmd = useEditorCommand('view.presentationView');\n const options = chromeControlForSlot('view.presentationView')?.options ?? [];\n const off = computed(() => !cmd.isEnabled.value);\n const reason = computed(() =>\n cmd.disabledReason.value ? translateKeyOrText(t, cmd.disabledReason.value) : null\n );\n // Off stays focusable, with the reason as its description.\n const offAttrs = useAriaDisabled(off, reason);\n const pick = (e: KeyboardEvent, step: number): void => {\n if (off.value) return;\n const at = options.findIndex((o) => o.value === cmd.value.value);\n const next = options[(at + step + options.length) % options.length];\n if (!next) return;\n cmd.execute(next.value);\n const buttons = (e.currentTarget as HTMLElement).parentElement?.querySelectorAll<HTMLElement>(\n '[role=\"radio\"]'\n );\n buttons?.[options.indexOf(next)]?.focus();\n };\n const STEPS: Readonly<Record<string, number>> = {\n ArrowLeft: -1,\n ArrowUp: -1,\n ArrowRight: 1,\n ArrowDown: 1,\n };\n return () => (\n <div\n class=\"pptx-zoom pptx-view-switch\"\n role=\"radiogroup\"\n aria-label={t('toolbar.presentationView')}\n onMousedown={keepFocus}\n >\n {options.map((o) => {\n const on = cmd.value.value === o.value;\n const label = t(o.labelKey);\n return (\n <button\n key={o.value}\n type=\"button\"\n role=\"radio\"\n aria-checked={on}\n aria-label={label}\n {...offAttrs.attrs.value}\n {...tooltipAttributes(label, off.value, reason.value)}\n tabindex={on ? 0 : -1}\n class=\"pptx-toolbar__button pptx-view-switch__option\"\n data-active={on ? '' : undefined}\n data-disabled={off.value ? '' : undefined}\n onClick={() => {\n if (!off.value) cmd.execute(o.value);\n }}\n onKeydown={(e: KeyboardEvent) => {\n const step = STEPS[e.key];\n if (!step) return;\n e.preventDefault();\n pick(e, step);\n }}\n >\n <Icon paths={o.paths ?? null} />\n </button>\n );\n })}\n {offAttrs.note()}\n </div>\n );\n },\n});\n\n/**\n * The default editor's workspace, the twin of React's `DefaultWorkspace`: the `normal` slot\n * (the rail, the slide, and the notes) in the Normal view, the slide sorter in the Slide Sorter\n * view. The `status` slot (by default the view switch and the zoom) stays mounted at the bottom\n * right in both, so a view switch keeps the focus it has. When the view changes and focus was\n * in the part that went away, focus goes to the current slide in the new view. @internal\n */\nexport const DefaultWorkspace = defineComponent({\n name: 'PptxDefaultWorkspace',\n setup(_props, { slots }) {\n const editor = usePptxEditor();\n const view = useEditorState((s) => s.presentationView ?? 'normal');\n const box = ref<HTMLDivElement | null>(null);\n watch(\n view,\n () => {\n const active = box.value?.ownerDocument.activeElement;\n if (active && active !== active.ownerDocument.body && active.isConnected) return;\n focusCurrentSlideOrCanvas(box.value, editor.value);\n },\n { flush: 'post' }\n );\n return () => (\n <div ref={box} class=\"pptx-default__views\">\n {view.value === 'slideSorter' ? (\n <div class=\"pptx-default__workspace\">\n <div class=\"pptx-default__main\">\n <PptxEditorSlideSorter />\n <PptxEditorEditNotice />\n </div>\n </div>\n ) : (\n slots.normal?.()\n )}\n {slots.overlay?.()}\n {slots.status ? (\n slots.status()\n ) : (\n <div class=\"pptx-statusbar\">\n <ViewSwitch />\n <PptxEditorZoomPill />\n </div>\n )}\n </div>\n );\n },\n});\n\n/**\n * Warns in development when the view becomes Slide Sorter and no slide sorter of the editor is\n * mounted, the twin of React's `SlideSorterWatch`. `PptxEditorRoot` renders it after its\n * default slot, so a sorter that mounts with the view change counts. @internal\n */\nexport const SlideSorterWatch = defineComponent({\n name: 'PptxSlideSorterWatch',\n setup() {\n const editor = usePptxEditor();\n const sorter = useEditorState((s) => s.presentationView === 'slideSorter');\n watch(\n [sorter, editor],\n ([on, ed]) => {\n if (on && ed && !slideSorterMounted(ed)) warnSlideSorterUnmounted();\n },\n { flush: 'post', immediate: true }\n );\n return () => null;\n },\n});\n","/** @jsxImportSource vue */\n// The slide rail, the zoom pill, and the side panel: the Vue twins of the React adapter's\n// `panes.tsx`, with the same markup, classes, ARIA, and keys, so the one core stylesheet styles\n// both. Each reads the editor through the composables; none holds document state of its own.\n// The keys, the drag, and the focus moves come from core (`pane-support.ts`).\n\nimport { chromeTranslateProp, useChromeTranslateScope } from './headless-hooks.ts';\nimport {\n computed,\n defineComponent,\n nextTick,\n onMounted,\n onUpdated,\n provide,\n ref,\n shallowRef,\n useId,\n watch,\n type CSSProperties,\n type ExtractPublicPropTypes,\n type PropType,\n type Ref,\n type StyleValue,\n} from 'vue';\nimport {\n ZOOM_MENU_LEVELS,\n tooltipAttributes,\n followCurrentSlide,\n groupSlideSections,\n keepCurrentSlideInView,\n railDragAxis,\n railKeyDown,\n railOrientationChrome,\n railRightToLeft,\n watchRailFold,\n resolveRailOrientation,\n runSlideStep,\n sectionOfSlide,\n slideClickMode,\n slideMenuPoint,\n slideStep,\n stepCommand,\n zoomStep,\n zoomLimitReason,\n type SlideSection,\n type SlideStep,\n type SlideRailOrientation,\n type SlideSummary,\n} from '@pptx-editor.dev/core/editor';\nimport { Icon, MenuItem, Popover, ToolButton, keepFocus, useAriaDisabled } from './chrome.tsx';\nimport { useEditorDialog } from './popups.ts';\nimport { useEditorState, usePptxEditor, useTranslation } from './composables.ts';\nimport { RailMenuHost, type RailMenuState } from './RailContextMenu.tsx';\nimport {\n SlideRailAddSlide,\n SlideRailChooseLayout,\n SlideRailCollapse,\n SlideRailDelete,\n SlideRailDuplicate,\n SlideRailExpand,\n SlideRailMoveEarlier,\n SlideRailMoveLater,\n railActionContent,\n railActionsKey,\n railExpandContent,\n} from './rail-parts.tsx';\nimport { ToolbarAction } from './toolbar-parts.ts';\nimport { useSlideDrag } from './slide-drag.ts';\nimport { LayoutGallery } from './SlideControls.tsx';\nimport {\n SectionNode,\n useCollapsedSections,\n useFocusAfterCollapse,\n useFocusCurrentAfterRender,\n useOpenCurrentSection,\n useSectionRenameRequests,\n useSlideSections,\n} from './RailSections.tsx';\n\nexport { PptxEditorSidePanel, type SidePanelProps } from './SidePanel.tsx';\n\nconst sameSlides = (a: readonly SlideSummary[], b: readonly SlideSummary[]): boolean =>\n a.length === b.length && a.every((s, i) => s === b[i]);\nconst sameIndices = (a: readonly number[], b: readonly number[]): boolean =>\n a.length === b.length && a.every((v, i) => v === b[i]);\n\n/** How a click selects slides: Shift+click a range, Ctrl/Cmd+click one more or one less. @internal */\nexport const clickMode = slideClickMode;\n\n/** A slide thumbnail, repainted only when its slide renders differently. @internal */\nexport const Thumbnail = defineComponent({\n name: 'PptxThumbnail',\n props: {\n slide: { type: Object as PropType<SlideSummary>, required: true },\n ratio: { type: Number, required: true },\n },\n setup(props) {\n const editor = usePptxEditor();\n const box = ref<HTMLDivElement | null>(null);\n const paint = (): void => {\n if (editor.value && box.value) editor.value.renderThumbnail(props.slide.index, box.value);\n };\n onMounted(paint);\n watch(() => [editor.value, props.slide] as const, paint, { flush: 'post' });\n return () => (\n <div ref={box} class=\"pptx-rail__thumb\" style={{ aspectRatio: String(1 / props.ratio) }} />\n );\n },\n});\n\n/**\n * Keyboard focus follows the current slide of a slide list (the rail, the slide sorter) while\n * one of its items `item` has focus. When the focused item goes away, focus goes to the current\n * item too, so the next key still acts on the list. Returns the list's `focusin` handler.\n * @internal\n */\nexport function useFocusFollowsCurrent(\n list: Ref<HTMLElement | null>,\n item: string,\n watched: () => readonly (number | boolean | null)[]\n): (e: FocusEvent) => void {\n let focused: HTMLElement | null = null;\n // Compare the values, not a new array: a deck edit gives new slide summaries, and the list\n // must not scroll back to the current slide when its index, the count, and the pane hold.\n watch(\n () => watched().join('|'),\n () => followCurrentSlide(list.value, item, focused),\n { flush: 'post' }\n );\n return (e) => {\n focused = (e.target as HTMLElement).closest?.<HTMLElement>(item) ?? null;\n };\n}\n\n/** Where the selected slides land one step up or down, or null at an edge. @internal */\nexport function useSlideStepTarget(\n selected: () => readonly number[],\n count: () => number,\n grouped: () => readonly SlideSection[] | null\n): (step: -1 | 1) => SlideStep | null {\n return (step) => slideStep(selected(), count(), step, grouped());\n}\n\n/** The runtime props of every pane, after DOCX Editor's `Navigation`. */\nconst paneProps = {\n /** Whether the pane is open, controlled. Use with the `update:open` event (`v-model:open`). */\n open: { type: Boolean, default: undefined },\n /** Whether the pane is open first, uncontrolled. Default `true`. */\n defaultOpen: { type: Boolean, default: undefined },\n /** The pane's width in CSS pixels (the slide rail). */\n paneWidth: { type: Number, default: undefined },\n /** A class name added to the pane, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n /** Inline styles for the pane, as React's `style`; a `width` here wins over `paneWidth`. */\n style: { type: Object as PropType<CSSProperties>, default: undefined },\n} as const;\n\n/**\n * Props of the editor's panes, the twin of React's `PaneProps`. A host `class` and `style` go\n * on the pane; a `width` in `style` wins over `paneWidth`. @public\n */\nexport type PaneProps = ExtractPublicPropTypes<typeof paneProps>;\n\nconst slideRailProps = {\n ...paneProps,\n ...chromeTranslateProp,\n /**\n * The built-in Hide thumbnails and Show thumbnails buttons. `false` removes them, for a host\n * that opens and closes the rail from its own chrome (`open`, `update:open`).\n */\n toggle: { type: Boolean, default: undefined },\n /**\n * Where the rail runs. `vertical` (the default) is a column beside the slide. `horizontal` is\n * a row under it, for a tall, narrow host: the thumbnails scroll sideways, Left and Right\n * step, a drag reorders along the row, and Hide thumbnails folds the rail down.\n */\n orientation: { type: String as PropType<SlideRailOrientation>, default: undefined },\n /**\n * `true` (default): the packaged action buttons, with named part children\n * (`PptxEditorSlideRail.AddSlide`, `.Delete`, …) in their places and other children after\n * Delete. `false`: only the default slot, in its order.\n */\n preset: { type: Boolean, default: true },\n} as const;\n\n/** Props of `PptxEditorSlideRail`, the twin of React's `SlideRailProps`. @public */\nexport type SlideRailProps = ExtractPublicPropTypes<typeof slideRailProps>;\n\n/** A pane's inline style: its width from `paneWidth`, then the host's own styles. @internal */\nexport function paneStyle(width: number | undefined, style: unknown): StyleValue {\n return width === undefined\n ? (style as StyleValue)\n : [{ width: `${width}px` }, style as StyleValue];\n}\n\n/** The collapsed rail strip keeps the host's styles but not a width: it stays a narrow strip. */\nfunction stripStyle(style: unknown): StyleValue {\n return style ? [style as StyleValue, { width: undefined }] : undefined;\n}\n\n/** The fallthrough attributes of a pane, without `class` and `style`, which it places itself. */\nfunction restAttrs(attrs: Record<string, unknown>): Record<string, unknown> {\n const { class: _class, style: _style, ...rest } = attrs;\n return rest;\n}\n\n/** Open state of a pane: controlled by `open`, else its own. Emits `update:open`. @internal */\nexport function usePaneOpen(\n props: { readonly open: boolean | undefined; readonly defaultOpen: boolean | undefined },\n emit: (event: 'update:open', open: boolean) => void\n): { readonly open: Readonly<Ref<boolean>>; setOpen(next: boolean): void } {\n const own = ref(props.defaultOpen ?? true);\n return {\n open: computed(() => props.open ?? own.value),\n setOpen: (next) => {\n if (props.open === undefined) own.value = next;\n emit('update:open', next);\n },\n };\n}\n\n/**\n * The slide thumbnail rail with drag-to-reorder, the twin of React's `PptxEditor.SlideRail`.\n * Its last button hides it to a narrow strip with a button that shows it again. Emits\n * `update:open`; a host `class` and `style` go on the rail. @public\n */\nconst SlideRailRoot = defineComponent({\n name: 'PptxEditorSlideRail',\n inheritAttrs: false,\n props: slideRailProps,\n emits: { 'update:open': (_open: boolean) => true },\n setup(props, { attrs, emit, slots }) {\n const pane = usePaneOpen(props, emit);\n const rail = ref<HTMLElement | null>(null);\n const listId = useId();\n // A toggle unmounts its own button: focus moves to the other toggle, never to the page.\n let focusToggle = false;\n const setOpen = (next: boolean): void => {\n focusToggle = rail.value?.contains(document.activeElement) ?? false;\n pane.setOpen(next);\n // A toggle the host refused leaves no flag behind for a later change to act on.\n void nextTick(() => {\n focusToggle = false;\n });\n };\n const editor = usePptxEditor();\n const { t } = useChromeTranslateScope(() => props.t);\n const slides = useEditorState((s) => s.slides, sameSlides);\n const current = useEditorState((s) => s.currentSlide);\n const selected = useEditorState((s) => s.selectedSlides, sameIndices);\n const ratio = useEditorState((s) => s.slideHeight / s.slideWidth);\n const readOnly = useEditorState((s) => s.mode === 'view');\n const list = ref<HTMLOListElement | null>(null);\n const count = (): number => slides.value.length;\n const menu = shallowRef<RailMenuState | null>(null);\n const gallery = shallowRef<HTMLElement | null>(null);\n const actions = ref<HTMLDivElement | null>(null);\n const sections = useSlideSections();\n // Sections group the rail when they cover every slide in order; otherwise it stays flat.\n const grouped = computed(() => groupSlideSections(sections.value, count()));\n const orientation = (): SlideRailOrientation =>\n resolveRailOrientation(props.orientation, 'PptxEditorSlideRail');\n const drag = useSlideDrag(() => railDragAxis(orientation()), selected, readOnly, grouped);\n // A right-to-left row mirrors the move buttons, as its arrow keys do. The direction comes\n // from the mounted rail, so it is read after each render.\n // A narrow horizontal rail (a phone) folds its secondary actions into one menu.\n const folded = shallowRef(false);\n watch(\n () => [rail.value, orientation(), pane.open.value] as const,\n ([el, axis], _old, onCleanup) =>\n onCleanup(\n watchRailFold(el, axis, (next) => {\n folded.value = next;\n })\n ),\n { flush: 'post', immediate: true }\n );\n const rightToLeft = shallowRef(false);\n const readDirection = (): void => {\n rightToLeft.value = railRightToLeft(rail.value);\n };\n onMounted(readDirection);\n onUpdated(readDirection);\n const collapsed = useCollapsedSections();\n const renaming = ref<string | null>(null);\n useOpenCurrentSection(grouped);\n // An open rail renames in place, also while it is flat: Add Section in a deck without\n // sections asks for the name before the new header renders. A closed rail has no header,\n // so it does not count.\n useSectionRenameRequests(\n (id) => {\n renaming.value = id;\n },\n () => pane.open.value\n );\n const focusCurrent = useFocusCurrentAfterRender(list);\n const trackCollapse = useFocusAfterCollapse(list, collapsed);\n const background = useEditorDialog('background');\n const stepTarget = useSlideStepTarget(\n () => selected.value,\n count,\n () => grouped.value\n );\n /**\n * Open the context menu on slide `index`. A slide outside the selection becomes the\n * selection; a slide inside a multi-selection keeps it.\n */\n const openMenu = (index: number, item: HTMLElement, at: { x: number; y: number } | null) => {\n const ed = editor.value;\n if (!ed) return;\n if (!ed.snapshot().selectedSlides.includes(index)) ed.selectSlide(index);\n menu.value = { at: slideMenuPoint(item, at), index, keyboard: at === null, owner: item };\n };\n const moveBy = (step: -1 | 1): void => {\n runSlideStep(editor.value, stepCommand(selected.value, stepTarget(step)));\n };\n const trackFocus = useFocusFollowsCurrent(list, '.pptx-rail__item', () => [\n current.value,\n count(),\n pane.open.value,\n ]);\n // A resize (a host narrowing the panel) keeps the current slide in view too.\n watch(\n list,\n (el, _old, onCleanup) => onCleanup(keepCurrentSlideInView(el, '.pptx-rail__item')),\n { flush: 'post' }\n );\n watch(\n () => pane.open.value,\n (open) => {\n // Only when the toggle's own unmount lost focus: a host that vetoed the change and\n // closes the rail later from its own chrome keeps its focus.\n const active = document.activeElement;\n const lost = !active || active === document.body || rail.value?.contains(active);\n if (focusToggle && lost)\n rail.value?.querySelector<HTMLElement>('.pptx-rail__collapse')?.focus();\n // A closed rail drops its open menu, drag, and rename.\n if (!open) {\n menu.value = null;\n drag.cancel();\n renaming.value = null;\n }\n },\n { flush: 'post' }\n );\n provide(railActionsKey, {\n t,\n editor: () => editor.value,\n why: () =>\n !editor.value ? t('disabled.noEditor') : readOnly.value ? t('disabled.viewing') : null,\n selected: () => selected.value,\n count,\n chrome: () => railOrientationChrome(orientation(), rightToLeft.value),\n step: stepTarget,\n moveBy,\n galleryOpen: () => !!gallery.value,\n // A second click closes the gallery, as the toolbar's menu buttons do.\n toggleGallery: () => {\n gallery.value = gallery.value\n ? null\n : // In a folded rail, the gallery opens at the overflow button that held its row.\n (actions.value?.querySelector<HTMLElement>('.pptx-rail__layouts, .pptx-rail__more') ??\n null);\n },\n listId,\n open: () => pane.open.value,\n toggle: () => props.toggle !== false,\n collapse: () => setOpen(false),\n expand: () => setOpen(true),\n });\n /** Slide shortcuts while the rail has focus (core's `railKeyDown`). */\n const onKeydown = (e: KeyboardEvent): void =>\n railKeyDown(e, {\n editor: editor.value,\n readOnly: readOnly.value,\n selected: selected.value,\n current: current.value,\n count: count(),\n grouped: grouped.value,\n list: list.value,\n orientation: orientation(),\n step: stepTarget,\n openMenu: (index, item) => openMenu(index, item, null),\n focusCurrent,\n });\n /** One slide of the rail. */\n const item = (s: SlideSummary) => (\n <li\n key={s.index}\n class=\"pptx-rail__item\"\n role={grouped.value ? 'treeitem' : 'option'}\n aria-selected={selected.value.includes(s.index)}\n aria-current={s.index === current.value}\n aria-label={t(s.hidden ? 'rail.hiddenSlideLabel' : 'rail.slideLabel', {\n index: s.index + 1,\n })}\n data-hidden={s.hidden ? '' : undefined}\n data-index={s.index}\n {...drag.itemProps(s.index)}\n tabindex={s.index === current.value ? 0 : -1}\n onClick={(e: MouseEvent) => {\n (e.currentTarget as HTMLElement).focus({ preventScroll: true });\n editor.value?.selectSlide(s.index, clickMode(e));\n }}\n onContextmenu={(e: MouseEvent) => {\n e.preventDefault();\n // A keyboard-opened menu reports no pointer position: open at the slide.\n const pointer = e.clientX !== 0 || e.clientY !== 0;\n openMenu(\n s.index,\n e.currentTarget as HTMLElement,\n pointer ? { x: e.clientX, y: e.clientY } : null\n );\n }}\n >\n <span class=\"pptx-rail__number\">{s.index + 1}</span>\n <Thumbnail slide={s} ratio={ratio.value} />\n </li>\n );\n return () => {\n const toggle = props.toggle !== false;\n const open = pane.open.value;\n const className = ['pptx-rail', attrs.class, props.className];\n const style = [attrs.style as StyleValue, props.style];\n // Closed with no toggle, the rail leaves the page: the host's chrome opens it again.\n if (!open && !toggle) return null;\n if (!open)\n return (\n <nav\n {...restAttrs(attrs)}\n ref={rail}\n class={[...className, 'pptx-rail--collapsed']}\n aria-label={t('rail.ariaLabel')}\n data-open=\"false\"\n data-orientation={orientation()}\n style={stripStyle(style)}\n onMousedown={keepFocus}\n >\n {railExpandContent(slots.default?.())}\n </nav>\n );\n const { content, shown } = railActionContent(\n slots.default?.(),\n props.preset !== false,\n toggle,\n folded.value\n );\n const groups = grouped.value;\n const currentSection = groups ? sectionOfSlide(groups, current.value)?.id : undefined;\n return (\n <nav\n {...restAttrs(attrs)}\n ref={rail}\n class={className}\n aria-label={t('rail.ariaLabel')}\n data-open=\"true\"\n data-orientation={orientation()}\n style={paneStyle(props.paneWidth, style)}\n >\n <ol\n ref={list}\n id={listId}\n class=\"pptx-rail__list\"\n role={groups ? 'tree' : 'listbox'}\n aria-multiselectable=\"true\"\n aria-orientation={orientation()}\n aria-label={t('rail.ariaLabel')}\n onKeydown={onKeydown}\n onFocusin={(e: FocusEvent) => {\n trackFocus(e);\n trackCollapse(e);\n }}\n >\n {groups\n ? groups.map((sec) => {\n const shut = collapsed.value.includes(sec.id);\n return (\n <SectionNode\n key={sec.id}\n section={sec}\n collapsed={shut}\n renaming={renaming.value === sec.id}\n variant=\"rail\"\n // A collapsed section that holds the current slide takes Tab in its place.\n focusable={shut && currentSection === sec.id}\n onRename={() => {\n renaming.value = sec.id;\n }}\n onRenameEnd={() => {\n renaming.value = null;\n }}\n onRemoved={focusCurrent}\n >\n {() =>\n slides.value\n .slice(sec.firstSlide, sec.firstSlide + sec.slideCount)\n .map(item)\n }\n </SectionNode>\n );\n })\n : slides.value.map(item)}\n </ol>\n <div\n ref={actions}\n class=\"pptx-rail__actions\"\n style={{ '--pptx-rail-action-columns': String(Math.max(1, Math.ceil(shown / 2))) }}\n onMousedown={keepFocus}\n >\n {content}\n </div>\n {gallery.value ? (\n <Popover\n anchor={gallery.value}\n onClose={() => {\n gallery.value = null;\n }}\n label={t('rail.chooseLayout')}\n >\n {() => (\n <LayoutGallery\n onChange={(layoutId: string) => {\n gallery.value = null;\n editor.value?.exec({ type: 'addSlide', layoutId });\n }}\n />\n )}\n </Popover>\n ) : null}\n <RailMenuHost\n open={\n menu.value\n ? {\n menu: menu.value,\n onClose: () => {\n menu.value = null;\n },\n onSectionAdded: (id: string) => {\n renaming.value = id;\n },\n ...(background.isAvailable.value\n ? { onBackground: () => background.open(menu.value?.owner ?? null) }\n : {}),\n }\n : null\n }\n />\n </nav>\n );\n };\n },\n});\n\n/**\n * The slide rail with its action parts, as React's `PptxEditor.SlideRail`: a named part child\n * replaces its button, `hidden` removes it, other children go after Delete, and `preset: false`\n * renders only the default slot. `Action` is `ToolbarAction`. @public\n */\nexport const PptxEditorSlideRail = Object.assign(SlideRailRoot, {\n AddSlide: SlideRailAddSlide,\n ChooseLayout: SlideRailChooseLayout,\n Duplicate: SlideRailDuplicate,\n MoveEarlier: SlideRailMoveEarlier,\n MoveLater: SlideRailMoveLater,\n Delete: SlideRailDelete,\n Collapse: SlideRailCollapse,\n Expand: SlideRailExpand,\n Action: ToolbarAction,\n});\n\nconst zoomPillProps = {\n /** A class name added to the pill, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n} as const;\n\n/** Props of `PptxEditorZoomPill`, the twin of React's `ZoomPillProps`. @public */\nexport type ZoomPillProps = ExtractPublicPropTypes<typeof zoomPillProps>;\n\n/** The zoom pill (`– 100% ▾ +`), the twin of React's `PptxEditor.ZoomPill`. @public */\nexport const PptxEditorZoomPill = defineComponent({\n name: 'PptxEditorZoomPill',\n props: zoomPillProps,\n setup(props) {\n const editor = usePptxEditor();\n const { t } = useTranslation();\n const zoom = useEditorState((s) => s.zoom);\n const fit = useEditorState((s) => s.fitZoom);\n // The pill zooms the slide; a thumbnail zoom for the slide sorter is a later change.\n const off = useEditorState((s) => s.presentationView === 'slideSorter');\n const reason = (): string | null => (off.value ? t('disabled.sorterZoom') : null);\n const anchor = ref<HTMLButtonElement | null>(null);\n const open = ref(false);\n // A view switch closes the zoom menu, so it does not open again on the way back.\n watch(off, (now) => {\n if (now) open.value = false;\n });\n const step = (dir: 1 | -1): void => {\n const next = zoomStep(zoom.value, dir);\n if (next) editor.value?.setZoom(next);\n };\n const levelOff = useAriaDisabled(off, reason);\n const pick = (z: number | 'fit'): void => {\n editor.value?.setZoom(z);\n open.value = false;\n };\n // A zoom button at the end of the range is off, and says why (zoom.ts).\n const limit = (dir: 1 | -1): string | null => {\n const key = zoomLimitReason(zoom.value, dir);\n return key ? t(key) : null;\n };\n return () => {\n // The sorter draws no slide at the zoom: the level shows no number there, only why it is off.\n const levelLabel = off.value\n ? t('zoom.ariaLabel')\n : t('zoom.levelAriaLabel', { percent: Math.round(zoom.value * 100) });\n return (\n <div\n class={['pptx-zoom', props.className]}\n role=\"group\"\n aria-label={t('zoom.ariaLabel')}\n onMousedown={keepFocus}\n >\n <ToolButton\n label={t('zoom.zoomOut')}\n icon=\"remove\"\n onClick={() => step(-1)}\n disabled={off.value || limit(-1) !== null}\n disabledReason={reason() ?? limit(-1)}\n />\n <button\n ref={anchor}\n type=\"button\"\n class=\"pptx-zoom__level\"\n aria-label={levelLabel}\n {...tooltipAttributes(levelLabel, off.value, reason())}\n aria-haspopup=\"menu\"\n aria-expanded={open.value && !off.value}\n // Off stays focusable, so its tooltip says why; the reason is its\n // description too.\n {...levelOff.attrs.value}\n data-disabled={off.value ? '' : undefined}\n onClick={() => {\n if (!off.value) open.value = !open.value;\n }}\n >\n {off.value ? '\\u2013' : t('zoom.level', { percent: Math.round(zoom.value * 100) })}\n <Icon name=\"arrow_drop_down\" className=\"pptx-icon pptx-toolbar__caret\" />\n </button>\n {levelOff.note()}\n <ToolButton\n label={t('zoom.zoomIn')}\n icon=\"add\"\n onClick={() => step(1)}\n disabled={off.value || limit(1) !== null}\n disabledReason={reason() ?? limit(1)}\n />\n {open.value && !off.value ? (\n <Popover\n anchor={anchor.value}\n onClose={() => {\n open.value = false;\n }}\n align=\"end\"\n >\n {() => [\n <MenuItem checked={fit.value} onSelect={() => pick('fit')}>\n {() => t('zoom.fit')}\n </MenuItem>,\n ...ZOOM_MENU_LEVELS.map((z) => (\n <MenuItem\n key={z}\n checked={!fit.value && Math.abs(z - zoom.value) < 0.001}\n onSelect={() => pick(z)}\n >\n {() => t('zoom.level', { percent: Math.round(z * 100) })}\n </MenuItem>\n )),\n ]}\n </Popover>\n ) : null}\n </div>\n );\n };\n },\n});\n","/** @jsxImportSource vue */\n// The slide rail's context menu and the section header's menu: the Vue twins of the React\n// adapter's `RailContextMenu.tsx` and `SectionContextMenu` (`RailSections.tsx`). Right-click a\n// thumbnail (or press Shift+F10 or the Menu key on it): a slide outside the selection becomes\n// the selection first; a slide inside a multi-selection keeps it, so Duplicate, Delete, and\n// Move act on every selected slide. Every row asks the engine whether it can run\n// (`commandRowReason`, `menu-arrangement.ts`). The rail and the sorter (`panes.tsx`,\n// `RailSections.tsx`) open these menus.\n\nimport { defineComponent, type ExtractPublicPropTypes, type PropType, type VNodeChild } from 'vue';\nimport {\n addSectionAt,\n addSectionCommand,\n commandRowReason,\n groupSlideSections,\n layoutRowProbe,\n railOrientationChrome,\n railOrientationOf,\n railRightToLeft,\n runSlideStep,\n slideStep,\n stepCommand,\n translateKeyOrText,\n type EditorCommand,\n type SlideSection,\n} from '@pptx-editor.dev/core/editor';\nimport type { SlideLayoutSummary } from '@pptx-editor.dev/core/contracts';\nimport { ContextMenu, type ContextMenuPoint } from './ContextMenu.tsx';\nimport { useEditorState, usePptxEditor, useTranslation } from './composables.ts';\nimport { MenuRow, MenuSeparator, MenuSubmenu } from './menu-row.tsx';\nimport { usePopupEntry } from './popups.ts';\nimport { LayoutGallery } from './SlideControls.tsx';\nimport { useSlideshow } from './Slideshow.tsx';\n\nconst NO_LAYOUTS: readonly SlideLayoutSummary[] = [];\nconst NO_SECTIONS: readonly SlideSection[] = [];\n\nconst sameIndices = (a: readonly number[], b: readonly number[]): boolean =>\n a.length === b.length && a.every((v, i) => v === b[i]);\n\n/** An open rail menu: where, on which slide, and how it opened. @public */\nexport interface RailMenuState {\n /** Where the menu opens: the pointer, or the slide for a keyboard open. */\n readonly at: ContextMenuPoint;\n /** The slide the menu opened on, from 0. */\n readonly index: number;\n /** Opened from the keyboard: focus goes to the first row. */\n readonly keyboard: boolean;\n /** The element the menu opened on; its editor scope carries the theme tokens. */\n readonly owner: HTMLElement | null;\n}\n\nconst railContextMenuProps = {\n /** Where the menu opens, on which slide, and how. */\n menu: { type: Object as PropType<RailMenuState>, required: true as const },\n /** Closes the menu. */\n onClose: { type: Function as PropType<() => void>, required: true as const },\n /** A section was added at the slide: the rail starts renaming it. */\n onSectionAdded: { type: Function as PropType<(sectionId: string) => void>, default: undefined },\n /** Opens the background dialog; the row is left out when the dialog is turned off. */\n onBackground: { type: Function as PropType<() => void>, default: undefined },\n} as const;\n\n/**\n * Props of the context menu of a slide in the rail or the sorter, and of a\n * `popups.railContextMenu` renderer, the twin of React's `RailContextMenuProps`. @public\n */\nexport type RailContextMenuProps = ExtractPublicPropTypes<typeof railContextMenuProps>;\n\n/** One row bound to a command: disabled with the engine's reason when `can` refuses it. */\ninterface CommandRow {\n readonly label: string;\n readonly icon: string;\n readonly slot: string;\n readonly shortcut?: string;\n}\n\n/**\n * The slide rail's context menu: new, duplicate, delete, and move slides, background, and\n * present from here. Rows act on every selected slide. @public\n */\nexport const RailContextMenu = defineComponent({\n name: 'RailContextMenu',\n props: railContextMenuProps,\n setup(props) {\n const editor = usePptxEditor();\n const show = useSlideshow();\n const { t } = useTranslation();\n // Re-render on every change, so each row's state is the engine's current answer.\n const revision = useEditorState((s) => s.revision);\n const selectedRef = useEditorState((s) => s.selectedSlides, sameIndices);\n const countRef = useEditorState((s) => s.slides.length);\n const readOnly = useEditorState((s) => s.mode === 'view');\n const currentRef = useEditorState((s) => s.slides[s.currentSlide]);\n const slidesRef = useEditorState((s) => s.slides);\n const layoutsRef = useEditorState((s) => s.layouts ?? NO_LAYOUTS);\n const sectionsRef = useEditorState((s) => s.sections ?? NO_SECTIONS);\n return () => {\n void revision.value;\n const close = (): void => props.onClose();\n const selected = selectedRef.value;\n const count = countRef.value;\n const many = selected.length > 1;\n const row = (command: EditorCommand | null, spec: CommandRow): VNodeChild => {\n const reason = commandRowReason(editor.value, command);\n return (\n <MenuRow\n {...spec}\n disabled={!!reason}\n reason={reason ? translateKeyOrText(t, reason) : null}\n onSelect={() => {\n close();\n // A move step opens a collapsed section it lands in (`runSlideStep`).\n if (command?.type === 'moveSlides') runSlideStep(editor.value, command);\n else if (command) editor.value?.exec(command);\n }}\n />\n );\n };\n const grouped = groupSlideSections(sectionsRef.value, count);\n const up = stepCommand(selected, slideStep(selected, count, -1, grouped));\n const down = stepCommand(selected, slideStep(selected, count, 1, grouped));\n // A row rail moves slides left and right: the rows say so, as the rail buttons do. A\n // right-to-left row mirrors them, as its arrow keys do.\n const move = railOrientationChrome(\n railOrientationOf(props.menu.owner),\n railRightToLeft(props.menu.owner)\n );\n const canPresent = count > 0 && !!editor.value;\n const addSection = addSectionCommand(props.menu.index, t);\n const sectionCan = editor.value ? editor.value.can(addSection) : null;\n const layoutReason = commandRowReason(\n editor.value,\n layoutRowProbe(layoutsRef.value, currentRef.value?.layoutId, selected)\n );\n // Checked when every selected slide is hidden; the row then shows them, else hides them.\n const hidden = selected.length > 0 && selected.every((i) => slidesRef.value[i]?.hidden);\n const hide: EditorCommand = { type: 'setSlidesHidden', indices: selected, hidden: !hidden };\n const hideCan = editor.value ? editor.value.can(hide) : null;\n return (\n <ContextMenu\n at={props.menu.at}\n onClose={close}\n label={t('contextMenu.railLabel')}\n keyboard={props.menu.keyboard}\n owner={props.menu.owner}\n >\n {{\n default: () => (\n <>\n {row(\n { type: 'addSlide' },\n { label: t('contextMenu.newSlide'), icon: 'add', slot: 'slide.add' }\n )}\n {row(\n { type: 'duplicateSlides', indices: selected },\n {\n label: many\n ? t('contextMenu.duplicateSlides', { count: selected.length })\n : t('rail.duplicateSlide'),\n icon: 'content_copy',\n shortcut: t('contextMenu.shortcuts.duplicate'),\n slot: 'slide.duplicate',\n }\n )}\n {row(\n { type: 'deleteSlides', indices: selected },\n {\n label: many\n ? t('contextMenu.deleteSlides', { count: selected.length })\n : t('rail.deleteSlide'),\n icon: 'delete',\n shortcut: t('contextMenu.shortcuts.delete'),\n slot: 'slide.delete',\n }\n )}\n <MenuRow\n label={t('sections.add')}\n icon=\"view_agenda\"\n slot=\"section.add\"\n disabled={!sectionCan?.ok}\n reason={\n sectionCan && !sectionCan.ok ? translateKeyOrText(t, sectionCan.reason) : null\n }\n onSelect={() => {\n close();\n if (!editor.value) return;\n const added = addSectionAt(editor.value, addSection, props.menu.index);\n if (added) props.onSectionAdded?.(added);\n }}\n />\n <MenuSeparator />\n <MenuSubmenu\n label={t('contextMenu.layout')}\n icon=\"dashboard\"\n disabled={!!layoutReason}\n reason={layoutReason ? translateKeyOrText(t, layoutReason) : null}\n >\n {{\n default: () => (\n <LayoutGallery\n value={currentRef.value?.layoutId ?? ''}\n onChange={(layoutId: string) => {\n close();\n editor.value?.exec({ type: 'applyLayout', indices: selected, layoutId });\n }}\n />\n ),\n }}\n </MenuSubmenu>\n {row(\n { type: 'resetSlides', indices: selected },\n { label: t('contextMenu.resetSlide'), icon: 'restart_alt', slot: 'slide.reset' }\n )}\n {props.onBackground ? (\n <MenuRow\n label={t('contextMenu.background')}\n icon=\"wallpaper\"\n slot=\"slide.background\"\n disabled={readOnly.value}\n reason={t('disabled.viewing')}\n onSelect={() => {\n close();\n props.onBackground?.();\n }}\n />\n ) : null}\n <MenuRow\n label={t('contextMenu.hideSlide')}\n icon=\"visibility_off\"\n slot=\"slide.hide\"\n checked={hidden}\n disabled={!hideCan?.ok}\n reason={hideCan && !hideCan.ok ? translateKeyOrText(t, hideCan.reason) : null}\n onSelect={() => {\n close();\n editor.value?.exec(hide);\n }}\n />\n <MenuSeparator />\n {row(up, {\n label: t(move.menuMoveEarlierLabel),\n icon: move.moveEarlierIcon,\n shortcut: t(move.menuMoveEarlierShortcut),\n slot: 'slide.moveUp',\n })}\n {row(down, {\n label: t(move.menuMoveLaterLabel),\n icon: move.moveLaterIcon,\n shortcut: t(move.menuMoveLaterShortcut),\n slot: 'slide.moveDown',\n })}\n <MenuSeparator />\n <MenuRow\n label={t('contextMenu.presentFromHere')}\n icon=\"slideshow\"\n slot=\"slide.present\"\n disabled={!canPresent}\n reason={t('disabled.noEditor')}\n onSelect={() => {\n close();\n editor.value?.goToSlide(props.menu.index);\n show.start('current');\n }}\n />\n </>\n ),\n }}\n </ContextMenu>\n );\n };\n },\n});\n\n/**\n * The slide menu that the rail and the sorter open, as the `railContextMenu` popup entry says:\n * `false` shows none, a function renders the host's menu, otherwise the packaged menu.\n * @internal\n */\nexport const RailMenuHost = defineComponent({\n name: 'PptxRailMenuHost',\n props: {\n open: { type: Object as PropType<RailContextMenuProps | null>, default: null },\n },\n setup(props) {\n const entry = usePopupEntry('railContextMenu');\n return () => {\n const renderer = entry();\n if (!props.open || renderer === false) return null;\n return typeof renderer === 'function' ? (\n renderer(props.open)\n ) : (\n <RailContextMenu {...props.open} />\n );\n };\n },\n});\n\n/** An open section menu: where it opens, how it opened, and the element it belongs to. @public */\nexport interface SectionMenuState {\n /** The point where the menu opens, in viewport pixels. */\n readonly at: ContextMenuPoint;\n /**\n * Whether a key opened the menu (Shift+F10 or the Menu key). The menu then puts focus on its\n * first row; after a right-click, on the menu itself.\n */\n readonly keyboard: boolean;\n /** The element the menu belongs to: the section header. Focus goes back to it on close. */\n readonly owner: HTMLElement | null;\n}\n\nconst sectionContextMenuProps = {\n /** The section whose header opened the menu. */\n section: { type: Object as PropType<SlideSection>, required: true as const },\n /** Where the menu opens, and how. */\n menu: { type: Object as PropType<SectionMenuState>, required: true as const },\n /** Closes the menu. Call it when a row runs or the user dismisses the menu. */\n onClose: { type: Function as PropType<() => void>, required: true as const },\n /** Starts renaming the section in place, in the rail or the sorter that opened the menu. */\n onRename: { type: Function as PropType<() => void>, required: true as const },\n /** Call after a row removes sections: focus goes to the current slide after the render. */\n onRemoved: { type: Function as PropType<() => void>, required: true as const },\n} as const;\n\n/**\n * Props of the section menu, and of a `popups.sectionContextMenu` renderer, the twin of\n * React's `SectionContextMenuProps`. @public\n */\nexport type SectionContextMenuProps = ExtractPublicPropTypes<typeof sectionContextMenuProps>;\n\n/**\n * The section menu: Rename, Remove, Remove with slides, Remove all, Move up and down, Collapse\n * and Expand all. Every row asks the engine whether it can run. @public\n */\nexport const SectionContextMenu = defineComponent({\n name: 'SectionContextMenu',\n props: sectionContextMenuProps,\n setup(props) {\n const editor = usePptxEditor();\n const { t } = useTranslation();\n const revision = useEditorState((s) => s.revision);\n return () => {\n void revision.value;\n const id = props.section.id;\n const row = (\n command: EditorCommand,\n label: string,\n icon: string,\n slot: string,\n then?: () => void\n ): VNodeChild => {\n const reason = commandRowReason(editor.value, command);\n return (\n <MenuRow\n label={label}\n icon={icon}\n slot={slot}\n disabled={!!reason}\n reason={reason ? translateKeyOrText(t, reason) : null}\n onSelect={() => {\n props.onClose();\n if (editor.value?.exec(command).ok) then?.();\n }}\n />\n );\n };\n const removed = (): void => props.onRemoved();\n // Rename runs no command until the name is typed; it needs editing mode. The probe uses a\n // fixed valid name: the section's own name can come from a file and be invalid.\n const rename = editor.value?.can({ type: 'renameSection', sectionId: id, name: 'x' });\n return (\n <ContextMenu\n at={props.menu.at}\n onClose={() => props.onClose()}\n label={t('sections.menuLabel')}\n keyboard={props.menu.keyboard}\n owner={props.menu.owner}\n >\n {{\n default: () => (\n <>\n <MenuRow\n label={t('sections.rename')}\n icon=\"edit_note\"\n slot=\"section.rename\"\n disabled={!rename?.ok}\n reason={rename && !rename.ok ? translateKeyOrText(t, rename.reason) : null}\n onSelect={() => {\n props.onClose();\n props.onRename();\n }}\n />\n {row(\n { type: 'removeSection', sectionId: id },\n t('sections.remove'),\n 'remove',\n 'section.remove',\n removed\n )}\n {row(\n { type: 'removeSection', sectionId: id, withSlides: true },\n t('sections.removeWithSlides'),\n 'delete',\n 'section.removeWithSlides',\n removed\n )}\n {row(\n { type: 'removeAllSections' },\n t('sections.removeAll'),\n 'delete',\n 'section.removeAll',\n removed\n )}\n <MenuSeparator />\n {row(\n { type: 'moveSection', sectionId: id, direction: -1 },\n t('sections.moveUp'),\n 'keyboard_arrow_up',\n 'section.moveUp'\n )}\n {row(\n { type: 'moveSection', sectionId: id, direction: 1 },\n t('sections.moveDown'),\n 'keyboard_arrow_down',\n 'section.moveDown'\n )}\n <MenuSeparator />\n {row(\n { type: 'setSectionsCollapsed', collapsed: true },\n t('sections.collapseAll'),\n 'unfold_less',\n 'section.collapseAll'\n )}\n {row(\n { type: 'setSectionsCollapsed', collapsed: false },\n t('sections.expandAll'),\n 'unfold_more',\n 'section.expandAll'\n )}\n </>\n ),\n }}\n </ContextMenu>\n );\n };\n },\n});\n","/** @jsxImportSource vue */\n// The named parts of the slide rail's action row: the Vue twins of the React adapter's\n// `rail-parts.tsx`, with the same markup and classes. Each part takes `hidden`, `icon`,\n// `className` (or a host `class`), and `asChild` (the one element of the default slot renders\n// the button). A named part child of `PptxEditorSlideRail` replaces its\n// part in place, other children go after Delete, and `preset: false` renders only the\n// default slot. The parts read the rail's state from an injection, so they render only inside\n// a rail.\n\nimport {\n Comment,\n defineComponent,\n inject,\n isVNode,\n normalizeClass,\n provide,\n shallowRef,\n type ExtractPublicPropTypes,\n type InjectionKey,\n type PropType,\n type VNode,\n type VNodeArrayChildren,\n} from 'vue';\nimport type {\n PptxEditorInstance,\n RailOrientationChrome,\n SlideStep,\n} from '@pptx-editor.dev/core/editor';\nimport { railOverflowPoint, warnAsChildChild } from '@pptx-editor.dev/core/editor';\nimport type { TranslationKey } from '@pptx-editor.dev/i18n';\nimport { ToolButton } from './chrome.tsx';\nimport { ContextMenu, type ContextMenuPoint } from './ContextMenu.tsx';\nimport { MenuRow, menuCloseKey } from './menu-row.tsx';\n\nconst partProps = {\n /** Remove the button from the rail. */\n hidden: { type: Boolean, default: false },\n /** Icon content in place of the packaged icon, about 18 pixels. */\n icon: { type: Object as PropType<VNode>, default: undefined },\n /** A class name added to the button, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n /**\n * Render the one element of the default slot as the button: it gets the part's label, state,\n * disabled reason, and click, as `ToolbarAction` does.\n */\n asChild: { type: Boolean, default: false },\n} as const;\n\n/**\n * Props of every named part of the slide rail's action row, the twin of React's\n * `SlideRailPartProps`. @public\n */\nexport type SlideRailPartProps = ExtractPublicPropTypes<typeof partProps>;\n\n/** What the rail hands its action parts; the getters keep the parts reactive. @internal */\nexport interface RailActions {\n readonly t: (key: TranslationKey) => string;\n readonly editor: () => PptxEditorInstance | null;\n /** Why the slide buttons are off, or null when they work. */\n readonly why: () => string | null;\n readonly selected: () => readonly number[];\n readonly count: () => number;\n readonly chrome: () => RailOrientationChrome;\n readonly step: (step: -1 | 1) => SlideStep | null;\n readonly moveBy: (step: -1 | 1) => void;\n readonly galleryOpen: () => boolean;\n readonly toggleGallery: () => void;\n readonly listId: string;\n /** Whether the rail is open: the action row shows, or the folded strip. */\n readonly open: () => boolean;\n /** The rail's `toggle`: `false` removes Hide thumbnails and Show thumbnails. */\n readonly toggle: () => boolean;\n readonly collapse: () => void;\n readonly expand: () => void;\n}\n\n/** Provided by `PptxEditorSlideRail` for its action parts. @internal */\nexport const railActionsKey: InjectionKey<RailActions> = Symbol('pptxRailActions');\n\n/** Inside the overflow menu of a narrow rail, the parts render as menu rows. */\nconst railOverflowKey: InjectionKey<boolean> = Symbol('pptxRailOverflow');\n\ninterface RailButton {\n readonly base: string;\n readonly label: string;\n readonly icon: string;\n readonly onClick: () => void;\n readonly disabled?: boolean;\n readonly disabledReason?: string | null;\n readonly hasPopup?: 'menu';\n readonly expanded?: boolean;\n readonly controls?: string;\n}\n\n/** Defines one part: `button` describes it from the rail's state, as React's part does. */\nfunction definePart(\n name: string,\n button: (rail: RailActions) => RailButton,\n shows: (rail: RailActions) => boolean = () => true\n) {\n return defineComponent({\n name,\n inheritAttrs: false,\n props: partProps,\n setup(props, { attrs, slots }) {\n const rail = inject(railActionsKey, null);\n const inMenu = inject(railOverflowKey, false);\n return () => {\n if (!rail || props.hidden || !shows(rail)) return null;\n const { base, icon, ...rest } = button(rail);\n const host = props.icon;\n // In the overflow menu of a narrow rail: the same action as a menu row.\n if (inMenu)\n return (\n <MenuRow\n label={rest.label}\n icon={host === undefined ? icon : host}\n disabled={!!rest.disabled}\n reason={rest.disabled ? (rest.disabledReason ?? null) : null}\n className={normalizeClass([base, attrs.class, props.className])}\n onSelect={rest.onClick}\n />\n );\n // One element in the default slot, or the packaged button (with a warning).\n const only = props.asChild ? (slots.default?.() ?? []).filter(isVNode) : [];\n const element = only.length === 1 && typeof only[0]!.type !== 'symbol' ? only[0]! : null;\n if (props.asChild && !element)\n warnAsChildChild(rest.label, { slot: name, group: 'PptxEditorSlideRail' });\n return (\n <ToolButton\n {...rest}\n host={element}\n icon={host === undefined ? icon : undefined}\n className={normalizeClass([base, attrs.class, props.className])}\n >\n {host === undefined ? undefined : () => host}\n </ToolButton>\n );\n };\n },\n });\n}\n\n/** Add slide, after the current slide, as React's `SlideRailAddSlide`. @public */\nexport const SlideRailAddSlide = definePart('SlideRailAddSlide', (rail) => ({\n base: 'pptx-rail__add',\n label: rail.t('rail.addSlide'),\n icon: 'add',\n disabled: !!rail.why(),\n disabledReason: rail.why(),\n onClick: () => rail.editor()?.exec({ type: 'addSlide' }),\n}));\n\n/** The layout gallery, as React's `SlideRailChooseLayout`. @public */\nexport const SlideRailChooseLayout = definePart('SlideRailChooseLayout', (rail) => ({\n base: 'pptx-rail__layouts',\n label: rail.t('rail.chooseLayout'),\n icon: 'note_add',\n hasPopup: 'menu',\n expanded: rail.galleryOpen(),\n disabled: !!rail.why(),\n disabledReason: rail.why(),\n onClick: rail.toggleGallery,\n}));\n\n/** Duplicate the selected slides, as React's `SlideRailDuplicate`. @public */\nexport const SlideRailDuplicate = definePart('SlideRailDuplicate', (rail) => ({\n base: 'pptx-rail__duplicate',\n label: rail.t('rail.duplicateSlide'),\n icon: 'content_copy',\n disabled: !!rail.why(),\n disabledReason: rail.why(),\n onClick: () => rail.editor()?.exec({ type: 'duplicateSlides', indices: rail.selected() }),\n}));\n\n/** Move the selected slides earlier, as React's `SlideRailMoveEarlier`. @public */\nexport const SlideRailMoveEarlier = definePart('SlideRailMoveEarlier', (rail) => ({\n base: 'pptx-rail__move',\n label: rail.t(rail.chrome().moveEarlierLabel),\n icon: rail.chrome().moveEarlierIcon,\n disabled: !!rail.why() || rail.step(-1) === null,\n disabledReason: rail.why() ?? rail.t('disabled.slideEdge'),\n onClick: () => rail.moveBy(-1),\n}));\n\n/** Move the selected slides later, as React's `SlideRailMoveLater`. @public */\nexport const SlideRailMoveLater = definePart('SlideRailMoveLater', (rail) => ({\n base: 'pptx-rail__move',\n label: rail.t(rail.chrome().moveLaterLabel),\n icon: rail.chrome().moveLaterIcon,\n disabled: !!rail.why() || rail.step(1) === null,\n disabledReason: rail.why() ?? rail.t('disabled.slideEdge'),\n onClick: () => rail.moveBy(1),\n}));\n\n/** Delete the selected slides, as React's `SlideRailDelete`. @public */\nexport const SlideRailDelete = definePart('SlideRailDelete', (rail) => ({\n base: 'pptx-rail__delete',\n label: rail.t('rail.deleteSlide'),\n icon: 'delete',\n disabled: !!rail.why() || rail.selected().length >= rail.count(),\n disabledReason: rail.why() ?? rail.t('disabled.lastSlide'),\n onClick: () => rail.editor()?.exec({ type: 'deleteSlides', indices: rail.selected() }),\n}));\n\n/** Hide thumbnails, as React's `SlideRailCollapse`. `toggle: false` removes it. @public */\nexport const SlideRailCollapse = definePart(\n 'SlideRailCollapse',\n (rail) => ({\n base: 'pptx-rail__collapse',\n label: rail.t('rail.collapse'),\n icon: rail.chrome().collapseIcon,\n expanded: true,\n controls: rail.listId,\n onClick: rail.collapse,\n }),\n (rail) => rail.toggle() && rail.open()\n);\n\n/**\n * Show thumbnails, the one button of the folded rail strip, as React's `SlideRailExpand`.\n * `toggle: false` removes it. @public\n */\nexport const SlideRailExpand = definePart(\n 'SlideRailExpand',\n (rail) => ({\n base: 'pptx-rail__collapse pptx-rail__expand',\n label: rail.t('rail.expand'),\n icon: rail.chrome().expandIcon,\n expanded: false,\n onClick: rail.expand,\n }),\n (rail) => rail.toggle() && !rail.open()\n);\n\n/** The overflow button of the rail whose slide list has the id `listId`. */\nfunction overflowButtonOf(listId: string): HTMLElement | null {\n if (typeof document === 'undefined') return null;\n const rail = document.getElementById(listId)?.closest('.pptx-rail');\n return rail?.querySelector<HTMLElement>('.pptx-rail__more') ?? null;\n}\n\n/**\n * The overflow button of a narrow rail: the secondary actions (layouts, duplicate, move,\n * delete) in one menu, as React's `SlideRailOverflow`.\n */\nconst SlideRailOverflow = defineComponent({\n name: 'PptxSlideRailOverflow',\n setup(_props, { slots }) {\n const rail = inject(railActionsKey, null);\n const menu = shallowRef<{ readonly at: ContextMenuPoint; readonly owner: HTMLElement } | null>(\n null\n );\n const close = (): void => {\n menu.value = null;\n };\n provide(menuCloseKey, close);\n provide(railOverflowKey, true);\n return () => {\n if (!rail) return null;\n const open = menu.value;\n return [\n <ToolButton\n label={rail.t('rail.moreActions')}\n icon=\"more_vert\"\n className=\"pptx-rail__more\"\n hasPopup=\"menu\"\n expanded={open !== null}\n onClick={() => {\n const owner = overflowButtonOf(rail.listId);\n menu.value = menu.value || !owner ? null : { at: railOverflowPoint(owner), owner };\n }}\n />,\n open ? (\n <ContextMenu\n at={open.at}\n owner={open.owner}\n // Focus goes to the first row, as the toolbar's menus take focus when they open.\n keyboard\n label={rail.t('rail.moreActions')}\n onClose={close}\n >\n {{ default: () => slots.default?.() }}\n </ContextMenu>\n ) : null,\n ];\n };\n },\n});\n\n/** The named parts, in their packaged order. Collapse is last and follows the host children. */\nconst PARTS: readonly unknown[] = [\n SlideRailAddSlide,\n SlideRailChooseLayout,\n SlideRailDuplicate,\n SlideRailMoveEarlier,\n SlideRailMoveLater,\n SlideRailDelete,\n];\n\nfunction flatten(children: VNodeArrayChildren | undefined, out: VNode[] = []): VNode[] {\n for (const child of children ?? []) {\n if (Array.isArray(child)) flatten(child, out);\n // A `v-if` that is false leaves a comment: it renders no button, as React's `null`.\n else if (isVNode(child) && child.type !== Comment) {\n if (Array.isArray(child.children) && typeof child.type === 'symbol')\n flatten(child.children as VNodeArrayChildren, out);\n else out.push(child);\n }\n }\n return out;\n}\n\n/**\n * A child that renders no button in the action row: a part with `hidden` (`true`, or the bare\n * attribute), Show thumbnails (only in the folded strip), and Hide thumbnails under\n * `toggle: false`.\n */\nfunction isHidden(vnode: VNode, toggle: boolean): boolean {\n if (vnode.type === SlideRailExpand || (!toggle && vnode.type === SlideRailCollapse)) return true;\n const hidden = (vnode.props as Record<string, unknown> | null)?.hidden;\n return hidden !== undefined && hidden !== false;\n}\n\n/** The folded strip's content: the host's `SlideRailExpand` child, or the packaged one. @internal */\nexport function railExpandContent(children: VNodeArrayChildren | undefined): VNode {\n return flatten(children).find((vnode) => vnode.type === SlideRailExpand) ?? <SlideRailExpand />;\n}\n\n/**\n * The rail's action row content and the number of buttons it shows, as React's\n * `railActionContent`. A `folded` (narrow) rail shows New slide and one overflow menu for the\n * other parts. @internal\n */\nexport function railActionContent(\n children: VNodeArrayChildren | undefined,\n preset: boolean,\n toggle: boolean,\n folded = false\n): { readonly content: VNode[]; readonly shown: number } {\n const nodes = flatten(children);\n if (!preset) return { content: nodes, shown: nodes.filter((n) => !isHidden(n, toggle)).length };\n const overrides = new Map<unknown, VNode>();\n const extras: VNode[] = [];\n for (const vnode of nodes)\n if (PARTS.includes(vnode.type) || vnode.type === SlideRailCollapse)\n overrides.set(vnode.type, vnode);\n else if (vnode.type !== SlideRailExpand) extras.push(vnode);\n const add = overrides.get(SlideRailAddSlide) ?? <SlideRailAddSlide />;\n const secondary: VNode[] = [\n overrides.get(SlideRailChooseLayout) ?? <SlideRailChooseLayout />,\n overrides.get(SlideRailDuplicate) ?? <SlideRailDuplicate />,\n overrides.get(SlideRailMoveEarlier) ?? <SlideRailMoveEarlier />,\n overrides.get(SlideRailMoveLater) ?? <SlideRailMoveLater />,\n overrides.get(SlideRailDelete) ?? <SlideRailDelete />,\n ];\n // A narrow rail keeps New slide and folds the rest into one menu; a hidden part stays hidden.\n const folds = folded && secondary.some((n) => !isHidden(n, toggle));\n const list: VNode[] = folds\n ? [add, <SlideRailOverflow>{{ default: () => secondary }}</SlideRailOverflow>, ...extras]\n : [add, ...secondary, ...extras];\n if (toggle) list.push(overrides.get(SlideRailCollapse) ?? <SlideRailCollapse />);\n return { content: list, shown: list.filter((n) => !isHidden(n, toggle)).length };\n}\n","// The toolbar's host parts and named parts: the Vue twin of the React adapter's\n// `toolbar-action.tsx` and `toolbar-named-parts.tsx`, after DOCX Editor's `ToolbarAction`,\n// `ToolbarSeparator`, and named parts. A named part (`PptxEditorToolbar.Bold`) is a\n// `ToolbarSlot` with its slot pinned; the names come from core (`TOOLBAR_NAMED_PARTS`), so\n// both adapters use the same ones.\n\nimport {\n camelize,\n cloneVNode,\n defineComponent,\n h,\n isVNode,\n type DefineComponent,\n type ExtractPublicPropTypes,\n type PropType,\n type VNode,\n type VNodeChild,\n Text,\n} from 'vue';\nimport {\n TOOLBAR_NAMED_PARTS,\n chromeControlForSlot,\n tooltipAttributes,\n warnAsChildChild,\n type ChromeSlotId,\n} from '@pptx-editor.dev/core/editor';\nimport { keepFocus } from './chrome.tsx';\nimport {\n FONT_FAMILY_PARTS,\n type FontFamilyItemProps,\n type FontFamilyPartProps,\n} from './FontFamilyControl.tsx';\nimport {\n SlotControl,\n ToolbarGroup,\n ToolbarRoot,\n ToolbarSlot,\n slotList,\n slotSpec,\n} from './toolbar.ts';\n\nconst toolbarActionProps = {\n /** The accessible name and tooltip: a resolved string from the host's own catalog. */\n label: { type: String, required: true as const },\n /** Icon content, about 18 pixels, as DOCX Editor's Vue `ToolbarAction`. The `icon` slot also works. */\n icon: { type: Object as PropType<VNode>, default: undefined },\n /** A class name added to the button, as React's `className`. */\n className: { type: String, default: undefined },\n /** The pressed state, for an action that toggles: `aria-pressed` and `data-active`. */\n active: { type: Boolean as PropType<boolean | undefined>, default: undefined },\n /** Turn the action off: the button stays focusable (`aria-disabled`) and `select` is not emitted. */\n disabled: { type: Boolean, default: false },\n /** Why the action is disabled, added to the tooltip. */\n disabledReason: { type: String, default: undefined },\n /** Merge the behavior onto the single default-slot element instead of a `<button>`. */\n asChild: { type: Boolean, default: false },\n} as const;\n\n/** Props of `ToolbarAction`, the twin of React's `ToolbarActionProps`. @public */\nexport type ToolbarActionProps = ExtractPublicPropTypes<typeof toolbarActionProps>;\n\n/** Warning names for `ToolbarAction`: it is a part of its own, not a slot. */\nconst ACTION_PARTS = { slot: 'ToolbarAction', group: 'ToolbarGroup' } as const;\n\n/**\n * A host-owned toolbar action, styled and behaved like the packaged controls, as React's\n * `Toolbar.Action`. Emits `select`; the `icon` prop, the `icon` slot, or the default slot is\n * its content, else its label as text. A direct child of a preset toolbar goes after the\n * groups and never collapses. @public\n */\nexport const ToolbarAction = defineComponent({\n name: 'ToolbarAction',\n props: toolbarActionProps,\n emits: { select: () => true },\n setup(props, { emit, slots }) {\n return () => {\n const shared = {\n class: ['pptx-toolbar__button', props.className],\n 'aria-label': props.label,\n ...tooltipAttributes(props.label, props.disabled, props.disabledReason),\n 'data-active': props.active ? '' : undefined,\n 'data-disabled': props.disabled ? '' : undefined,\n 'aria-pressed': props.active,\n onMousedown: keepFocus,\n onClick: () => {\n if (!props.disabled) emit('select');\n },\n };\n const select = (): void => {\n if (!props.disabled) emit('select');\n };\n if (props.asChild) {\n // Exactly one element: text and comments have symbol types.\n const nodes = (slots.default?.() ?? []).filter(isVNode);\n const child = nodes.length === 1 && typeof nodes[0]!.type !== 'symbol' ? nodes[0] : null;\n if (child) {\n const isButton = child.type === 'button';\n const wiring: Record<string, unknown> = {\n ...shared,\n // Runs after the child's own click handler: a child that calls preventDefault()\n // keeps the action from running, as in React's renderAsChild.\n onClick: (event: MouseEvent) => {\n if (!event.defaultPrevented) select();\n },\n ...(isButton\n ? { type: 'button' }\n : {\n // Not a button: the role, a tab stop, and Enter and Space (WCAG 2.1.1). A\n // link keeps its own Enter, which already clicks it.\n role: 'button',\n tabindex: 0,\n onKeydown: (event: KeyboardEvent) => {\n // As the React twin: only a link with an href keeps its own Enter.\n const target = event.currentTarget as Element & { href?: string };\n const link = target.localName === 'a' && !!target.href;\n if (event.key !== ' ' && (event.key !== 'Enter' || link)) return;\n event.preventDefault();\n select();\n },\n }),\n 'aria-disabled': props.disabled ? 'true' : undefined,\n };\n // The child's own attributes win (as React's renderAsChild); class and handlers merge.\n const own = child.props ?? {};\n for (const key of Object.keys(wiring))\n if (key !== 'class' && !/^on[A-Z]/.test(key) && key in own) delete wiring[key];\n return cloneVNode(child, wiring);\n }\n warnAsChildChild(props.label, ACTION_PARTS);\n }\n // A misused `asChild` falls back to the packaged button with the label.\n const own = props.asChild ? undefined : slots.default?.();\n const content = props.icon ?? slots.icon?.() ?? (own?.length ? own : undefined);\n // Text (the label, or text children) needs room; one element child is icon content.\n // As the React twin: text (the label, or content with a text node) sits beside any icon.\n const list: unknown[] = Array.isArray(content) ? content : content ? [content] : [];\n const hasText = list.some(\n (n) =>\n (typeof n === 'string' && n.trim() !== '') ||\n (isVNode(n) && n.type === Text && String(n.children ?? '').trim() !== '')\n );\n const text = props.icon == null && !slots.icon && (content === undefined || hasText);\n return h(\n 'button',\n {\n ...shared,\n class: [shared.class, text ? 'pptx-toolbar__button--text' : null],\n type: 'button',\n // Focusable when disabled, as every toolbar control.\n 'aria-disabled': props.disabled ? 'true' : undefined,\n },\n content ?? props.label\n );\n };\n },\n});\n\nconst toolbarSeparatorProps = {\n /** A class name added to the rule, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n} as const;\n\n/** Props of `ToolbarSeparator`, the twin of React's `ToolbarSeparatorProps`. @public */\nexport type ToolbarSeparatorProps = ExtractPublicPropTypes<typeof toolbarSeparatorProps>;\n\n/** A vertical rule between controls, as React's `Toolbar.Separator`. @public */\nexport const ToolbarSeparator = defineComponent({\n name: 'ToolbarSeparator',\n props: toolbarSeparatorProps,\n setup(props) {\n return () =>\n h('span', {\n role: 'separator',\n 'aria-orientation': 'vertical',\n class: ['pptx-toolbar__sep', props.className],\n });\n },\n});\n\nconst hostClassProps = {\n /** A class name added to the control, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n} as const;\n\nconst toolbarSlotPartProps = {\n /** Remove the control from the toolbar. Its command keeps working elsewhere. */\n hidden: { type: Boolean, default: undefined },\n ...hostClassProps,\n} as const;\n\nconst toolbarColorSplitProps = {\n ...toolbarSlotPartProps,\n /** A host glyph over the color bar, in place of the registry icon. The `icon` slot also works. */\n icon: { type: [Object, Array, String] as PropType<VNodeChild>, default: undefined },\n} as const;\n\nconst toolbarPartProps = {\n ...toolbarColorSplitProps,\n /** Render the control as the single default-slot element. */\n asChild: { type: Boolean, default: undefined },\n} as const;\n\n/**\n * Props of the named button parts (`PptxEditorToolbar.Bold`, `PptxEditorToolbar.Undo`, …), as\n * React's and DOCX Editor's: the slot is pinned, and the default slot is icon content (`icon`,\n * else the default slot, else the registry icon), not a replacement. With `asChild`, the one\n * default-slot element renders the control. @public\n */\nexport type ToolbarPartProps = ExtractPublicPropTypes<typeof toolbarPartProps>;\n\n/**\n * Props of the named picker parts (`PptxEditorToolbar.FontFamily`, …), as DOCX Editor's slot\n * parts: a picker is not one button, so it takes no `icon`, `asChild`, or slot content. @public\n */\nexport type ToolbarSlotPartProps = ExtractPublicPropTypes<typeof toolbarSlotPartProps>;\n\n/**\n * Props of the named color split parts (`PptxEditorToolbar.FontColor`, `Highlight`,\n * `ShapeFill`, `LineColor`, `TableCellFill`), as DOCX Editor's `ToolbarColorSplitProps`: the\n * main half takes an `icon` (the glyph over the color bar). @public\n */\nexport type ToolbarColorSplitProps = ExtractPublicPropTypes<typeof toolbarColorSplitProps>;\n\n/** A named button part: a component with its slot as a static. @public */\nexport type ToolbarPartComponent = DefineComponent<ToolbarPartProps> & {\n readonly pptxSlot: ChromeSlotId;\n};\n\n/** A named picker part: a component with its slot as a static. @public */\nexport type ToolbarSlotPartComponent = DefineComponent<ToolbarSlotPartProps> & {\n readonly pptxSlot: ChromeSlotId;\n};\n\n/**\n * Props of `PptxEditorToolbar.FontFamily`, as React's `FontFamilyProps`: a picker part's\n * `className` and `hidden`; its default slot composes the `Trigger`, `Content`, and `Item` parts.\n * @public\n */\nexport type FontFamilyProps = ToolbarSlotPartProps;\n\n/**\n * `PptxEditorToolbar.FontFamily`: the `font.family` picker, as DOCX Editor's `FontFamily`\n * compound. With no slot content it renders the default trigger and list; with slot content,\n * compose the `Trigger`, `Content`, and `Item` parts around the shared state. @public\n */\nexport type FontFamilyNamespace = DefineComponent<FontFamilyProps> & {\n readonly pptxSlot: ChromeSlotId;\n /** The button that opens the list. */\n readonly Trigger: DefineComponent<FontFamilyPartProps>;\n /** The list, while it is open. */\n readonly Content: DefineComponent<FontFamilyPartProps>;\n /** One option of the list. */\n readonly Item: DefineComponent<FontFamilyItemProps>;\n};\n\n/** A named color split part: a component with its slot as a static. @public */\nexport type ToolbarColorSplitComponent = DefineComponent<ToolbarColorSplitProps> & {\n readonly pptxSlot: ChromeSlotId;\n};\n\n/** The named picker parts, as React types them (`ToolbarSlotPartComponent`). */\nconst SLOT_PART_NAMES = [\n 'FontFamily',\n 'FontSize',\n 'CharacterSpacing',\n 'ChangeCase',\n 'Alignment',\n 'VerticalAlignment',\n 'BulletStyle',\n 'NumberStyle',\n 'LineSpacing',\n 'TextDirection',\n 'Autofit',\n 'Columns',\n 'Line',\n 'Shapes',\n 'LineWidth',\n 'LineStart',\n 'LineEnd',\n 'LineDash',\n 'ShapeStyles',\n 'ShapeEffects',\n 'Order',\n 'AlignObjects',\n 'Rotate',\n 'TableStyle',\n 'TableBorderTarget',\n 'TableSelect',\n 'TableDelete',\n 'TableSplitCell',\n 'TableCellMargins',\n] as const;\n\n/** The named color split parts, as React types them (`ToolbarColorSplitComponent`). */\nconst COLOR_SPLIT_NAMES = [\n 'FontColor',\n 'Highlight',\n 'ShapeFill',\n 'LineColor',\n 'TableCellFill',\n] as const;\n\ntype SlotPartName = (typeof SLOT_PART_NAMES)[number];\ntype ColorSplitName = (typeof COLOR_SPLIT_NAMES)[number];\n\nfunction definePart(name: string, slot: ChromeSlotId): ToolbarPartComponent {\n const part = `PptxEditorToolbar.${name}`;\n const props: Record<string, unknown> = (SLOT_PART_NAMES as readonly string[]).includes(name)\n ? toolbarSlotPartProps\n : (COLOR_SPLIT_NAMES as readonly string[]).includes(name)\n ? toolbarColorSplitProps\n : toolbarPartProps;\n return Object.assign(\n defineComponent({\n name: `Toolbar${name}`,\n inheritAttrs: false,\n props: props as typeof toolbarPartProps,\n setup(declared, { attrs, slots }) {\n return () => {\n if (!chromeControlForSlot(slot)) return null;\n // Undeclared `icon` or `asChild` on a picker part reach the spec from attrs, so the\n // control warns that it cannot apply them, as in React.\n const given: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(attrs)) given[camelize(key)] = value;\n Object.assign(given, declared);\n if (given.icon === undefined && slots.icon) given.icon = slots.icon;\n const spec = slotSpec(slot, given, slotList(slots.default), part);\n return h(SlotControl, { spec });\n };\n },\n }),\n { pptxSlot: slot }\n ) as unknown as ToolbarPartComponent;\n}\n\ntype NamedParts = {\n readonly [K in keyof typeof TOOLBAR_NAMED_PARTS]: K extends 'FontFamily'\n ? FontFamilyNamespace\n : K extends SlotPartName\n ? ToolbarSlotPartComponent\n : K extends ColorSplitName\n ? ToolbarColorSplitComponent\n : ToolbarPartComponent;\n};\n\n// `FontFamily` carries its compound parts as statics.\nconst NAMED_PARTS = Object.fromEntries(\n Object.entries(TOOLBAR_NAMED_PARTS).map(([name, slot]) => {\n const part = definePart(name, slot);\n return [name, name === 'FontFamily' ? Object.assign(part, FONT_FAMILY_PARTS) : part];\n })\n) as unknown as NamedParts;\n\n/**\n * The statics of `PptxEditorToolbar`, the twin of React's `ToolbarNamespace`: `Slot`, `Group`,\n * `Action`, `Separator`, and the named parts. @public\n */\nexport type PptxEditorToolbarNamespace = typeof ToolbarRoot &\n NamedParts & {\n readonly Slot: typeof ToolbarSlot;\n readonly Group: typeof ToolbarGroup;\n readonly Action: typeof ToolbarAction;\n readonly Separator: typeof ToolbarSeparator;\n };\n\n/**\n * The toolbar, with its parts as statics, as React's `PptxEditor.Toolbar`: `Slot`, `Group`,\n * `Action`, `Separator`, and the named parts (`PptxEditorToolbar.Bold`, …). @public\n */\nexport const PptxEditorToolbar: PptxEditorToolbarNamespace = Object.assign(ToolbarRoot, {\n ...NAMED_PARTS,\n Slot: ToolbarSlot,\n Group: ToolbarGroup,\n Action: ToolbarAction,\n Separator: ToolbarSeparator,\n});\n","/** @jsxImportSource vue */\n// The font family picker: the Vue twin of the React adapter's `FontFamilyControl.tsx`, after DOCX\n// Editor's `FontFamily` toolbar compound (docx-editor/packages/vue/src/editor/toolbar/\n// FontFamily.tsx): a root that holds the picker state in a part-level context (provide/inject),\n// and the `Trigger`, `Content`, and `Item` parts that read it. With no slot content the root\n// renders a trigger and a search field over a list box of groups (the slide's theme fonts,\n// labeled Headings and Body; the fonts in this presentation; all fonts), each name drawn in its\n// own face, the current family marked and scrolled into view when the list opens. With slot\n// content, a host composes the parts itself. Core's `font-picker.ts` builds the groups and rows.\n\nimport {\n defineComponent,\n inject,\n nextTick,\n normalizeClass,\n provide,\n ref,\n useId,\n watch,\n type ExtractPublicPropTypes,\n type InjectionKey,\n type PropType,\n type Ref,\n} from 'vue';\nimport {\n firstFontPickerFamily,\n focusFontOption,\n fontPickerGroups,\n fontPickerRow,\n isCurrentFontRow,\n revealCurrentFont,\n warnInvalidFontItem,\n warnPartOutsideCompound,\n type ChromeControl,\n type ChromeSlotId,\n type FontPickerGroup,\n type FontPickerRow,\n} from '@pptx-editor.dev/core/editor';\nimport { Icon, Popover, focusText, keepFocus, useAriaDisabled } from './chrome.tsx';\nimport { useEditorState, usePptxEditor, useTranslation } from './composables.ts';\nimport { useSlot } from './slot.ts';\nimport { useTriggerAttributes } from './slot-override.ts';\n\n/** The font the text uses: its family name and the theme font it comes from, if any. */\ninterface CurrentFont {\n readonly family: string | null;\n readonly theme: 'major' | 'minor' | null;\n}\n\n/** The picker state the parts share; every read is current in the reader's render. */\ninterface FontFamilyState {\n readonly slot: () => ChromeSlotId;\n readonly label: () => string;\n readonly open: Ref<boolean>;\n readonly query: Ref<string>;\n readonly groups: () => readonly FontPickerGroup[];\n readonly current: () => CurrentFont;\n /** Apply a row's value (a theme font reference or a family) and close the list. */\n readonly pick: (value: string) => void;\n /** The row a host's `Item value` stands for, or null for a value that is not a font name. */\n readonly rowFor: (value: string) => FontPickerRow | null;\n readonly anchor: Ref<HTMLButtonElement | null>;\n readonly list: Ref<HTMLElement | null>;\n readonly trigger: ReturnType<typeof useTriggerAttributes>;\n readonly slotState: ReturnType<typeof useSlot>;\n readonly off: ReturnType<typeof useAriaDisabled>;\n}\n\nconst fontFamilyKey: InjectionKey<FontFamilyState> = Symbol('pptxFontFamily');\n\n/** The shared state, or null (with a warning) outside `PptxEditorToolbar.FontFamily`. */\nfunction useFontFamilyState(part: string): FontFamilyState | null {\n const state = inject(fontFamilyKey, null);\n if (!state)\n warnPartOutsideCompound(`PptxEditorToolbar.FontFamily.${part}`, 'PptxEditorToolbar.FontFamily');\n return state;\n}\n\nconst fontFamilyPartProps = {\n /** A class name added to the part's element, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n} as const;\n\nconst fontFamilyItemProps = {\n ...fontFamilyPartProps,\n /**\n * What the item applies: a family name, or a theme font reference (`+mj-lt` for the headings\n * font, `+mn-lt` for the body font), so the text follows a later theme change.\n */\n value: { type: String, required: true as const },\n} as const;\n\n/**\n * Props of `PptxEditorToolbar.FontFamily.Trigger` and `.Content`, as React's. The default slot\n * replaces the part's default content. @public\n */\nexport type FontFamilyPartProps = ExtractPublicPropTypes<typeof fontFamilyPartProps>;\n\n/** Props of `PptxEditorToolbar.FontFamily.Item`, as React's. @public */\nexport type FontFamilyItemProps = ExtractPublicPropTypes<typeof fontFamilyItemProps>;\n\n/**\n * The button that opens the list: the current family, or the label when the selection has no\n * one family. The default slot replaces its content.\n */\nconst FontFamilyTrigger = defineComponent({\n name: 'FontFamilyTrigger',\n inheritAttrs: false,\n props: fontFamilyPartProps,\n setup(props, { attrs, slots }) {\n const state = useFontFamilyState('Trigger');\n return () => {\n if (!state) return null;\n const { cmd, label, tip } = state.slotState;\n const trigger = state.trigger();\n return [\n <button\n ref={state.anchor}\n type=\"button\"\n {...trigger}\n class={[trigger.class, props.className, attrs.class]}\n data-slot={state.slot()}\n aria-label={label.value}\n aria-haspopup=\"dialog\"\n aria-expanded={state.open.value}\n {...tip.value}\n {...state.off.attrs.value}\n onMousedown={keepFocus}\n onClick={() => {\n state.query.value = '';\n state.open.value = !state.open.value;\n }}\n >\n {slots.default?.() ?? [\n <span class=\"pptx-toolbar__family-label\">{cmd.value.value ?? label.value}</span>,\n <Icon name=\"expand_more\" className=\"pptx-icon pptx-toolbar__caret\" />,\n ]}\n </button>,\n state.off.note(),\n ];\n };\n },\n});\n\n/** One family row: an `option` with the name in its own face and the theme role, if any. */\nconst FontRow = defineComponent({\n name: 'PptxFontRow',\n props: {\n row: { type: Object as PropType<FontPickerRow>, required: true as const },\n rowClass: { type: String, default: undefined },\n },\n setup(props, { slots }) {\n const { t } = useTranslation();\n const state = inject(fontFamilyKey, null);\n return () => {\n if (!state) return null;\n const row = props.row;\n const now = state.current();\n const current = !row.disabled && isCurrentFontRow(row, now.family, now.theme);\n return (\n <button\n type=\"button\"\n role=\"option\"\n aria-selected={current}\n tabindex={-1}\n disabled={row.disabled}\n class={['pptx-menu__item pptx-font-picker__option', props.rowClass]}\n data-family={row.family || undefined}\n data-theme={row.theme ?? undefined}\n onClick={() => state.pick(row.value)}\n >\n {slots.default?.() ?? [\n // The face is a quoted, validated family name (core's `fontFaceValue`), set as a\n // custom property through a style object, never a CSS string.\n row.family ? (\n <span\n class=\"pptx-font-picker__face\"\n style={row.face ? { '--pptx-font-face': row.face } : undefined}\n >\n {row.family}\n </span>\n ) : null,\n row.roleKey ? <span class=\"pptx-font-picker__role\">{t(row.roleKey)}</span> : null,\n ]}\n {current ? <Icon name=\"check\" className=\"pptx-icon pptx-menu__check\" /> : null}\n </button>\n );\n };\n },\n});\n\n/**\n * One option of the list: it applies `value` and carries the check mark while the text uses\n * that font. The default slot replaces the name and role. A theme font that the slide's theme\n * leaves empty shows its role, disabled. A value that is not a font name renders nothing, with\n * a development warning.\n */\nconst FontFamilyItem = defineComponent({\n name: 'FontFamilyItem',\n inheritAttrs: false,\n props: fontFamilyItemProps,\n setup(props, { attrs, slots }) {\n const state = useFontFamilyState('Item');\n return () => {\n if (!state) return null;\n const row = state.rowFor(props.value);\n if (!row) {\n warnInvalidFontItem('PptxEditorToolbar.FontFamily.Item', props.value);\n return null;\n }\n return (\n <FontRow row={row} rowClass={normalizeClass([props.className, attrs.class]) || undefined}>\n {slots.default ? { default: slots.default } : undefined}\n </FontRow>\n );\n };\n },\n});\n\n/** One labeled group of the list box. */\nconst FontGroup = defineComponent({\n name: 'PptxFontGroup',\n props: {\n group: { type: Object as PropType<FontPickerGroup>, required: true as const },\n },\n setup(props) {\n const { t } = useTranslation();\n const id = useId();\n return () => (\n <div class=\"pptx-font-picker__group\" role=\"group\" aria-labelledby={id}>\n <div id={id} role=\"presentation\" class=\"pptx-menu__heading pptx-font-picker__heading\">\n {t(props.group.labelKey)}\n </div>\n {props.group.rows.map((row) => (\n <FontRow key={row.value} row={row} />\n ))}\n </div>\n );\n },\n});\n\n/**\n * The list, while it is open. With no slot content: a search field over the theme,\n * presentation, and all-fonts groups. With slot content: a list box of the host's `Item` parts.\n */\nconst FontFamilyContent = defineComponent({\n name: 'FontFamilyContent',\n inheritAttrs: false,\n props: fontFamilyPartProps,\n setup(props, { attrs, slots }) {\n const state = useFontFamilyState('Content');\n const { t } = useTranslation();\n return () => {\n if (!state || !state.open.value) return null;\n const groups = state.groups();\n const custom = slots.default;\n return (\n <Popover\n anchor={state.anchor.value}\n role=\"dialog\"\n field\n onClose={() => (state.open.value = false)}\n >\n {{\n default: () => (\n <div class={['pptx-font-picker', props.className, attrs.class]}>\n {custom ? null : (\n <input\n class=\"pptx-font-picker__search\"\n type=\"search\"\n placeholder={t('toolbar.fontSearch')}\n aria-label={t('toolbar.fontSearch')}\n value={state.query.value}\n onInput={(e: Event) =>\n (state.query.value = (e.target as HTMLInputElement).value)\n }\n onKeydown={(e: KeyboardEvent) => {\n if (e.key !== 'Enter') return;\n // The key stops here, so it does not press the trigger and open the list\n // again.\n e.preventDefault();\n const first = firstFontPickerFamily(groups);\n if (first) state.pick(first);\n }}\n />\n )}\n <div\n ref={state.list}\n class=\"pptx-font-picker__list\"\n role=\"listbox\"\n aria-label={state.label()}\n >\n {custom\n ? custom()\n : [\n ...groups.map((g) => <FontGroup key={g.id} group={g} />),\n groups.length === 0 ? (\n <p class=\"pptx-font-picker__empty\">{t('toolbar.fontNone')}</p>\n ) : null,\n ]}\n </div>\n </div>\n ),\n }}\n </Popover>\n );\n };\n },\n});\n\n/**\n * The font family picker: the toolbar's part for `font.family`, and the root of the\n * `PptxEditorToolbar.FontFamily` compound. Its default slot holds `Trigger` and `Content` parts\n * in place of the defaults. @internal\n */\nexport const FontFamilyControl = defineComponent({\n name: 'PptxFamilyControl',\n props: {\n slot: { type: String as PropType<ChromeSlotId>, required: true as const },\n control: { type: Object as PropType<ChromeControl>, required: true as const },\n },\n setup(props, { slots }) {\n const slotState = useSlot(\n () => props.slot,\n () => props.control\n );\n const { cmd, label, reason } = slotState;\n const off = useAriaDisabled(() => !cmd.isEnabled.value, reason);\n const editor = usePptxEditor();\n const anchor = ref<HTMLButtonElement | null>(null);\n const list = ref<HTMLElement | null>(null);\n const open = ref(false);\n const query = ref('');\n // The groups change with the deck (embedded and host fonts) and with the slide's theme.\n const revision = useEditorState((s) => s.revision);\n const slide = useEditorState((s) => s.currentSlide);\n // The check mark follows what the text uses: a theme font marks its theme row only.\n const theme = useEditorState((s) => s.format?.fontFamilyTheme ?? null);\n const trigger = useTriggerAttributes(\n props.slot,\n 'pptx-toolbar__field pptx-toolbar__field--family',\n () => ({ disabled: !cmd.isEnabled.value })\n );\n // Once, when the list opens: the current family comes into view.\n // After the popover took focus (its `onMounted`), a list with no search field focuses its\n // current option, so the arrow keys reach the host's `Item` parts.\n watch(open, async (isOpen) => {\n if (!isOpen) return;\n await nextTick();\n revealCurrentFont(list.value);\n focusFontOption(list.value);\n });\n provide(fontFamilyKey, {\n slot: () => props.slot,\n label: () => label.value,\n open,\n query,\n groups: () => {\n void revision.value;\n return open.value ? fontPickerGroups(editor.value, slide.value, query.value) : [];\n },\n current: () => ({\n family: typeof cmd.value.value === 'string' ? cmd.value.value : null,\n theme: theme.value,\n }),\n // A theme row applies its theme font reference (`+mj-lt`, `+mn-lt`), any other row its\n // family.\n pick: (value) => {\n cmd.execute(value);\n focusText(editor.value, anchor.value);\n open.value = false;\n },\n rowFor: (value) => {\n void revision.value;\n return fontPickerRow(editor.value, slide.value, value);\n },\n anchor,\n list,\n trigger,\n slotState,\n off,\n });\n return () => slots.default?.() ?? [<FontFamilyTrigger />, <FontFamilyContent />];\n },\n});\n\n/**\n * The sub-parts of `PptxEditorToolbar.FontFamily`, as DOCX Editor's `FontFamily` statics.\n * @internal\n */\nexport const FONT_FAMILY_PARTS = {\n Trigger: FontFamilyTrigger,\n Content: FontFamilyContent,\n Item: FontFamilyItem,\n} as const;\n","// The toolbar: the Vue twin of the React adapter's `PptxEditor.Toolbar`, with the same\n// customization ladder (DOCX Editor's toolbar.mdx): `class` and state attributes, `icon`,\n// `asChild`, `ToolbarSlot slotId` and `ToolbarGroup id` overrides with `hidden`, and\n// `preset` false. The arrangement comes from core (`arrangeToolbarGroups`,\n// `toolbarGroupsFor`), so a group override means the same in both adapters, and groups that do\n// not fit the width move into a More menu by core's rule (`toolbarCollapsedIds`). The markup and\n// classes match React's, so the one core stylesheet styles both.\n//\n// `ToolbarSlot` and `ToolbarGroup` under a preset bar are descriptions: the bar reads their\n// props and renders the controls itself, as in DOCX Editor's Vue toolbar.\n\nimport { chromeTranslateProp, useChromeTranslateScope } from './headless-hooks.ts';\nimport {\n Comment,\n Text,\n camelize,\n computed,\n defineComponent,\n h,\n isVNode,\n normalizeClass,\n provide,\n type ExtractPublicPropTypes,\n type PropType,\n type VNode,\n type VNodeArrayChildren,\n type VNodeChild,\n} from 'vue';\nimport {\n TOOLBAR_COMPOUND_SLOTS,\n TOOLBAR_NAMED_PARTS,\n arrangeToolbarGroups,\n chromeControlForSlot,\n isToolbarBarSlot,\n toolbarGroupLabel,\n toolbarGroupPriority,\n toolbarContextOf,\n toolbarGroupsFor,\n translateKeyOrText,\n warnAsChildChild,\n warnDuplicateSlot,\n warnIgnoredSlotAttributes,\n warnReplacedControlSetting,\n warnSlotOutsideBar,\n warnUnknownSlot,\n type ChromeGroup,\n type ChromeGroupId,\n type ChromeSlotId,\n type ToolbarPartNames,\n} from '@pptx-editor.dev/core/editor';\nimport { useEditorState, usePptxEditor, useTranslation } from './composables.ts';\nimport { useNotesTarget } from './notes-target.ts';\nimport { slotOverrideKey, type SlotOverride } from './slot-override.ts';\nimport { ToolbarControl } from './toolbar-controls.tsx';\nimport { FontFamilyControl } from './FontFamilyControl.tsx';\nimport { HandBar, PresetToolbar, type BarItem } from './toolbar-bar.tsx';\n\nexport { ToolbarControl } from './toolbar-controls.tsx';\n\n/** The Vue names of the toolbar parts, for development warnings. */\nconst PARTS: ToolbarPartNames = { slot: 'ToolbarSlot', group: 'ToolbarGroup' };\n\ntype SlotFn = () => VNodeArrayChildren;\n\n/**\n * A slot as a function that always returns a list: a render function may return one vnode, a\n * string, or nothing. @internal\n */\nexport function slotList(fn: unknown): SlotFn | undefined {\n if (typeof fn !== 'function') return undefined;\n return () => {\n const out = (fn as () => unknown)();\n if (Array.isArray(out)) return out as VNodeArrayChildren;\n return out === null || out === undefined ? [] : [out as VNodeArrayChildren[number]];\n };\n}\n\n/** One slot override, read from a `ToolbarSlot` or a named part. @internal */\nexport interface SlotSpec {\n readonly slotId: ChromeSlotId;\n readonly hidden: boolean;\n /** Icon content in place of the registry icon: a vnode, or a slot that renders it. */\n readonly icon: VNodeChild | SlotFn | undefined;\n readonly className: string | undefined;\n readonly asChild: boolean;\n /** The default slot: content that replaces the control, or the `asChild` element. */\n readonly children: SlotFn | undefined;\n /** The named part (`PptxEditorToolbar.Bold`) the spec came from, for warning text. */\n readonly part: string | undefined;\n}\n\n/** A boolean prop: present with no value (`hidden`) means true, as Vue casts it. */\nconst bool = (value: unknown): boolean => value === '' || value === true;\n\n/**\n * The spec of a slot override. A named button part (`PptxEditorToolbar.Bold`) takes its default\n * slot as icon content, as in React and DOCX Editor, unless it has `asChild`; a named picker part\n * keeps its props as given, so a stray `icon` or `asChild` still warns. @internal\n */\nexport function slotSpec(\n slotId: ChromeSlotId,\n props: Record<string, unknown>,\n children: SlotFn | undefined,\n part?: string\n): SlotSpec {\n // Only the class, icon, and asChild reach the control; any other attribute (`style`, `id`,\n // `data-*`, a listener) warns, as in React.\n const ignored = Object.keys(props)\n .filter((key) => !SLOT_KEYS.has(key))\n .map((key) => hyphenate(key));\n const names: ToolbarPartNames = part ? { slot: part, group: PARTS.group } : PARTS;\n warnIgnoredSlotAttributes(slotId, ignored, 'class', names);\n const shape = chromeControlForSlot(slotId)?.shape;\n const asChild = bool(props.asChild);\n const iconPart = part !== undefined && (shape === undefined || shape === 'icon') && !asChild;\n const icon = props.icon as VNodeChild | undefined;\n return {\n slotId,\n hidden: bool(props.hidden),\n icon: iconPart ? (icon ?? children) : icon,\n className: normalizeClass([props.class, props.className]) || undefined,\n asChild,\n children: iconPart ? undefined : children,\n part,\n };\n}\n\n/** An attribute name as a template writes it: `dataTest` to `data-test`. */\nconst hyphenate = (key: string): string => key.replace(/\\B([A-Z])/g, '-$1').toLowerCase();\n\n/** The props and attributes a slot part reads; anything else never reaches the control. */\nconst SLOT_KEYS: ReadonlySet<string> = new Set([\n 'slotId',\n 'hidden',\n 'icon',\n 'class',\n 'className',\n 'asChild',\n 'key',\n 'ref',\n 'ref_for',\n 'ref_key',\n]);\n\n/** The names warnings use for a spec: the named part when there is one. */\nconst specParts = (spec: SlotSpec): ToolbarPartNames =>\n spec.part ? { slot: spec.part, group: PARTS.group } : PARTS;\n\n/** The one element of an `asChild` slot, or undefined (with a warning) when there is not one. */\nfunction asChildElement(spec: SlotSpec): VNode | undefined {\n const nodes = flatten(spec.children?.());\n const [child] = nodes;\n if (nodes.length === 1 && child && typeof child.type !== 'symbol') return child;\n warnAsChildChild(spec.slotId, specParts(spec));\n return undefined;\n}\n\nconst slotControlProps = {\n spec: { type: Object as PropType<SlotSpec>, required: true as const },\n} as const;\n\n/**\n * The control a slot renders, with the slot's overrides applied: hidden renders nothing, slot\n * content replaces the control, and otherwise the control renders with the host's icon, class,\n * and `asChild` element through `slotOverrideKey`. @internal\n */\nexport const SlotControl = defineComponent({\n name: 'PptxToolbarSlotControl',\n props: slotControlProps,\n setup(props) {\n // Getters, so the control reads the current spec in its own render.\n const override: SlotOverride = {\n get slotId() {\n return props.spec.slotId;\n },\n get icon() {\n const icon = props.spec.icon;\n return typeof icon === 'function' ? (icon as SlotFn)() : icon;\n },\n get className() {\n return props.spec.className;\n },\n get asChild() {\n return props.spec.asChild ? asChildElement(props.spec) : undefined;\n },\n get part() {\n return props.spec.part;\n },\n };\n provide(slotOverrideKey, override);\n return () => {\n const spec = props.spec;\n if (spec.hidden) return null;\n // The slot content of a compound named part (`PptxEditorToolbar.FontFamily`) composes its\n // sub-parts inside the control's root; any other slot's content replaces the control.\n const compose = !!spec.part && TOOLBAR_COMPOUND_SLOTS.has(spec.slotId);\n if (!spec.asChild && spec.children && !compose) {\n // The content replaces the control, so a setting for the control does nothing: say so.\n if (spec.className) warnReplacedControlSetting(spec.slotId, 'class', specParts(spec));\n if (spec.icon !== undefined)\n warnReplacedControlSetting(spec.slotId, 'icon', specParts(spec));\n return spec.children();\n }\n const control = chromeControlForSlot(spec.slotId);\n if (!control) return null;\n if (compose && !spec.asChild && spec.children)\n return h(FontFamilyControl, { slot: spec.slotId, control }, { default: spec.children });\n const group = spec.slotId.slice(0, spec.slotId.indexOf('.'));\n return h(ToolbarControl, { group, control });\n };\n },\n});\n\nconst toolbarSlotProps = {\n /** The registered control, for example `text.bold`. */\n slotId: { type: String as PropType<ChromeSlotId>, required: true as const },\n /** Remove the control from the toolbar. Its command keeps working elsewhere. */\n hidden: { type: Boolean, default: false },\n /** A host icon in place of the registry icon. Button controls only; the `icon` slot also works. */\n icon: { type: [Object, Array, String] as PropType<VNodeChild>, default: undefined },\n /** Render the control as the single default-slot element. Button controls only. */\n asChild: { type: Boolean, default: false },\n /** A class name added to the control, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n} as const;\n\n/** Props of `ToolbarSlot`, the twin of React's `ToolbarSlotProps`. @public */\nexport type ToolbarSlotProps = ExtractPublicPropTypes<typeof toolbarSlotProps>;\n\n/**\n * One registered control. Inside a `PptxEditorToolbar` with the preset on, it declares an\n * override; anywhere else it renders the control. Default slot content replaces the control;\n * with `asChild`, its one element renders the control. @public\n */\nexport const ToolbarSlot = defineComponent({\n name: 'ToolbarSlot',\n inheritAttrs: false,\n props: toolbarSlotProps,\n setup(props, { attrs, slots }) {\n return () => {\n if (!chromeControlForSlot(props.slotId)) {\n warnUnknownSlot(props.slotId, PARTS);\n return null;\n }\n const spec = slotSpec(\n props.slotId,\n { ...attrs, ...props, icon: props.icon ?? slots.icon, class: attrs.class },\n slotList(slots.default)\n );\n return h(SlotControl, { spec });\n };\n },\n});\n\nconst toolbarGroupProps = {\n /** A built-in group id changes that group; any other id adds a host group. */\n id: { type: String as PropType<ChromeGroupId | (string & {})>, required: true as const },\n /** Remove the whole group and its separator, from the bar and the More menu. */\n hidden: { type: Boolean, default: false },\n /** The accessible name of a host group. Wins over `labelKey`. */\n label: { type: String, default: undefined },\n /** A translation key for the name of a host group, used when there is no `label`. */\n labelKey: { type: String, default: undefined },\n /**\n * Collapse priority: a lower number leaves the bar for the More menu first. Built-in groups\n * use 10 (the last group) up to 90 (history). A host group without one leaves first.\n */\n priority: { type: Number, default: undefined },\n /** Keep the group on the bar at every width. */\n pinned: { type: Boolean, default: false },\n /**\n * The group a host group follows. Without it, a host group follows every built-in group.\n * A built-in id ignores it, with a development warning.\n */\n after: { type: String as PropType<ChromeGroupId | (string & {})>, default: undefined },\n /** A class name added to the group's element. A host `class` also works. */\n className: { type: String, default: undefined },\n /**\n * Content for the group in the More menu: after the controls of a built-in group, as in\n * DOCX Editor, so a built-in id adds a menu-only row; in place of a host group's controls.\n */\n overflowContent: { type: Function as PropType<() => VNodeChild>, default: undefined },\n} as const;\n\n/** Props of `ToolbarGroup`, the twin of React's `ToolbarGroupProps`. @public */\nexport type ToolbarGroupProps = ExtractPublicPropTypes<typeof toolbarGroupProps>;\n\n/**\n * A group of controls. Inside a `PptxEditorToolbar` with the preset on, a built-in id changes\n * that group and any other id adds a host group; with `preset` false, it renders its slot. A\n * host group's accessible name is its `label`, else its translated `labelKey`, else its `id`.\n * @public\n */\nexport const ToolbarGroup = defineComponent({\n name: 'ToolbarGroup',\n props: toolbarGroupProps,\n setup(props, { slots }) {\n const { t } = useTranslation();\n return () =>\n props.hidden\n ? null\n : h(\n 'div',\n {\n class: ['pptx-toolbar__group', props.className],\n role: 'group',\n 'aria-label': toolbarGroupLabel(props, (key) => translateKeyOrText(t, key)),\n 'data-group': props.id,\n },\n slots.default?.()\n );\n },\n});\n\n/** A group override read from a `ToolbarGroup` child, with its slot content. */\ninterface GroupOverride {\n readonly id: string;\n readonly hidden: boolean;\n readonly label?: string;\n readonly labelKey?: string;\n readonly after?: string;\n readonly priority: number | undefined;\n readonly pinned: boolean;\n readonly className: string | undefined;\n readonly overflowContent: (() => VNodeChild) | undefined;\n readonly content: VNodeArrayChildren | undefined;\n}\n\n/** The slot a named part (`PptxEditorToolbar.Bold`) stands for, read from its static. */\nconst namedPartSlot = (type: unknown): ChromeSlotId | undefined =>\n (type as { pptxSlot?: ChromeSlotId } | null)?.pptxSlot;\n\n/** A vnode's props with camelCase keys (templates pass `slot-id`, `as-child`). */\nfunction vnodeProps(vnode: VNode): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const [key, value] of Object.entries(vnode.props ?? {})) out[camelize(key)] = value;\n return out;\n}\n\n/** Vnodes with fragments opened; comments (a false `v-if`) and blank text left out. */\nexport function flatten(children: VNodeArrayChildren | undefined, out: VNode[] = []): VNode[] {\n for (const child of children ?? []) {\n if (Array.isArray(child)) flatten(child, out);\n else if (isVNode(child)) {\n if (child.type === Comment) continue;\n if (child.type === Text && String(child.children ?? '').trim() === '') continue;\n if (Array.isArray(child.children) && typeof child.type === 'symbol')\n flatten(child.children as VNodeArrayChildren, out);\n else out.push(child);\n } else if (typeof child === 'string' && child.trim() !== '') out.push(h(Text, child));\n else if (typeof child === 'number') out.push(h(Text, String(child)));\n }\n return out;\n}\n\n/** A named part's name by its slot, for warning text: `text.bold` → `PptxEditorToolbar.Bold`. */\nconst NAMED_PART_BY_SLOT = new Map<string, string>(\n Object.entries(TOOLBAR_NAMED_PARTS).map(([name, slot]) => [slot, `PptxEditorToolbar.${name}`])\n);\n\n/** A vnode's named slot, as a function. */\nfunction vnodeSlot(vnode: VNode, name: string): SlotFn | undefined {\n const children = vnode.children as Record<string, unknown> | null;\n if (!children || typeof children !== 'object' || Array.isArray(children)) return undefined;\n return slotList(children[name]);\n}\n\n/** The spec a `ToolbarSlot` or named part vnode declares. */\nfunction vnodeSpec(vnode: VNode, named: ChromeSlotId | undefined): SlotSpec {\n const props = vnodeProps(vnode);\n if (props.icon === undefined && vnodeSlot(vnode, 'icon')) props.icon = vnodeSlot(vnode, 'icon');\n const slotId = named ?? (String(props.slotId) as ChromeSlotId);\n return slotSpec(\n slotId,\n props,\n vnodeSlot(vnode, 'default'),\n named ? NAMED_PART_BY_SLOT.get(named) : undefined\n );\n}\n\n/** A number prop that a template may pass as text (`priority=\"15\"`). */\nfunction numberProp(value: unknown): number | undefined {\n if (typeof value === 'number') return value;\n if (typeof value === 'string' && value.trim() !== '' && Number.isFinite(Number(value)))\n return Number(value);\n return undefined;\n}\n\n/**\n * Read `ToolbarSlot`, named part, and `ToolbarGroup` children as overrides of the preset. Only\n * direct children declare overrides. Other children (a loose `ToolbarAction`, a host element) go\n * after the groups and never collapse, as in React and DOCX Editor.\n */\nfunction collectOverrides(\n children: VNodeArrayChildren | undefined,\n inBar: (slot: string) => boolean = isToolbarBarSlot\n): { slots: Map<string, SlotSpec>; groups: Map<string, GroupOverride>; extras: VNode[] } {\n const slots = new Map<string, SlotSpec>();\n const groups = new Map<string, GroupOverride>();\n const extras: VNode[] = [];\n for (const vnode of flatten(children)) {\n const named = namedPartSlot(vnode.type);\n if (vnode.type === ToolbarSlot || named) {\n const spec = vnodeSpec(vnode, named);\n const parts = specParts(spec);\n if (!chromeControlForSlot(spec.slotId)) warnUnknownSlot(spec.slotId, parts);\n else if (!inBar(spec.slotId)) {\n // A registered control the preset bar does not draw goes after the groups, as in React;\n // a `ToolbarSlot` says so (a named part does not).\n // A hidden slot draws nothing, so it gets no warning.\n if (!named && !spec.hidden) warnSlotOutsideBar(spec.slotId, parts);\n if (!spec.hidden) extras.push(vnode);\n continue;\n }\n if (slots.has(spec.slotId)) warnDuplicateSlot(spec.slotId, parts);\n slots.set(spec.slotId, spec);\n } else if (vnode.type === ToolbarGroup) {\n const props = vnodeProps(vnode);\n const str = (v: unknown): string | undefined => (typeof v === 'string' ? v : undefined);\n const label = str(props.label);\n const labelKey = str(props.labelKey);\n const after = str(props.after);\n groups.set(String(props.id), {\n id: String(props.id),\n hidden: bool(props.hidden),\n ...(label !== undefined ? { label } : {}),\n ...(labelKey !== undefined ? { labelKey } : {}),\n ...(after !== undefined ? { after } : {}),\n priority: numberProp(props.priority),\n pinned: bool(props.pinned),\n className: normalizeClass([props.class, props.className]) || undefined,\n overflowContent:\n typeof props.overflowContent === 'function'\n ? (props.overflowContent as () => VNodeChild)\n : undefined,\n content: vnodeSlot(vnode, 'default')?.(),\n });\n } else extras.push(vnode);\n }\n return { slots, groups, extras };\n}\n\n/** Whether `nodes` renders anything: not only comments, blank text, or empty fragments. */\nconst hasContent = (nodes: VNodeArrayChildren | undefined): boolean => flatten(nodes).length > 0;\n\nconst pptxEditorToolbarProps = {\n ...chromeTranslateProp,\n /**\n * `true` (default): the registry's groups, changed by `ToolbarSlot` and `ToolbarGroup`\n * children. `false`: only the children, in the order given.\n */\n preset: { type: Boolean, default: true },\n /**\n * `true` (default): groups that do not fit the width move into a More menu, lowest priority\n * first. `false`: the bar wraps to more rows instead. A `preset` false bar never measures\n * itself, so it always wraps, as in DOCX Editor.\n */\n overflow: { type: Boolean, default: true },\n /**\n * `true` (default): the bar shows only the groups that act on the selection (text, a shape,\n * a picture, a table, or nothing). `false`: every bar group shows for every selection,\n * disabled with the engine's reason where it cannot run, and the picture or table group\n * joins after them. Hiding a group never turns off its commands.\n */\n contextual: { type: Boolean, default: true },\n /** A class name added to the bar, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n} as const;\n\n/** Props of `PptxEditorToolbar`, the twin of React's `ToolbarProps`. @public */\nexport type ToolbarProps = ExtractPublicPropTypes<typeof pptxEditorToolbarProps>;\n\n/**\n * The toolbar root. `toolbar-parts.ts` attaches the parts and exports it as\n * `PptxEditorToolbar`. With the preset (default), its arrangement derives from\n * `CHROME_GROUPS` (the groups that act on the selection, `toolbarGroupsFor`), and\n * `ToolbarSlot`, named part, and `ToolbarGroup` children change it; with `preset`\n * false, the default slot is the whole bar. Hiding a control never disables its command.\n */\nexport const ToolbarRoot = defineComponent({\n name: 'PptxEditorToolbar',\n props: pptxEditorToolbarProps,\n setup(props, { slots }) {\n const { t } = useChromeTranslateScope(() => props.t);\n // The bar shows the groups that act on the selection, as in React (`toolbarContextOf`).\n const selection = useEditorState(toolbarContextOf);\n // A focused speaker notes field takes the text formatting (`NOTES_SLOTS`), as in React.\n const notes = useNotesTarget(usePptxEditor());\n const context = computed(() => (notes.value ? 'notes' : selection.value));\n return () =>\n props.preset\n ? h(\n PresetBar,\n {\n groups: toolbarGroupsFor(context.value, { contextual: props.contextual }),\n label: t('toolbar.ariaLabel'),\n overflow: props.overflow,\n inBar: (slot: string) => isToolbarBarSlot(slot, { contextual: props.contextual }),\n class: props.className,\n },\n { default: () => slots.default?.() }\n )\n : h(HandBar, { class: props.className }, { default: () => slots.default?.() });\n },\n});\n\n/**\n * A preset bar over `groups`: the registry's controls with the host's `ToolbarSlot`, named\n * part, and `ToolbarGroup` overrides, collapsed into a More menu by priority. The toolbar draws\n * the formatting groups; each ribbon tab draws its own groups. `inBar` says which slots the bar\n * draws (default: the slots of `groups`); another slot goes after the groups. @internal\n */\nexport const PresetBar = defineComponent({\n name: 'PptxPresetBar',\n props: {\n groups: { type: Array as PropType<readonly ChromeGroup[]>, required: true },\n label: { type: String, required: true },\n /** Whether groups that do not fit move into the More menu; false wraps the bar. */\n overflow: { type: Boolean, default: false },\n inBar: { type: Function as PropType<(slot: string) => boolean>, default: undefined },\n },\n setup(props, { slots }) {\n const { t } = useTranslation();\n return () => {\n const barGroups = props.groups;\n const own = new Set(barGroups.flatMap((g) => g.controls.map((c) => `${g.id}.${c.id}`)));\n const overrides = collectOverrides(\n slots.default?.(),\n props.inBar ?? ((slot) => own.has(slot))\n );\n const items: BarItem[] = [];\n for (const entry of arrangeToolbarGroups(overrides.groups, barGroups, PARTS)) {\n const override = entry.override;\n const id = entry.kind === 'built-in' ? entry.group.id : entry.override.id;\n const placement = {\n priority: toolbarGroupPriority(id, override?.priority, barGroups),\n pinned: override?.pinned === true,\n className: override?.className,\n overflowContent: override?.overflowContent,\n };\n if (entry.kind === 'host') {\n // A group with nothing to render leaves the bar, as in React and DOCX Editor.\n if (!hasContent(entry.override.content)) continue;\n const content = entry.override.content;\n items.push({\n ...placement,\n id: entry.override.id,\n label: toolbarGroupLabel(entry.override, (key) => translateKeyOrText(t, key)),\n content: () => content ?? [],\n });\n continue;\n }\n const group = entry.group;\n const shown = group.controls.filter(\n (c) => !overrides.slots.get(`${group.id}.${c.id}`)?.hidden\n );\n if (!shown.length && !hasContent(override?.content)) continue;\n const controls = (): VNodeArrayChildren =>\n shown.map((c) => {\n const spec = overrides.slots.get(`${group.id}.${c.id}`);\n return spec\n ? h(SlotControl, { key: c.id, spec })\n : h(ToolbarControl, { key: c.id, group: group.id, control: c });\n });\n const extra = override?.content;\n const menu = placement.overflowContent;\n items.push({\n ...placement,\n id: group.id,\n label: t(group.labelKey),\n content: () => [...controls(), ...(extra ?? [])],\n menuContent: menu\n ? () => [...controls(), menu() as VNodeArrayChildren[number]]\n : undefined,\n });\n }\n return h(PresetToolbar, {\n items,\n extras: overrides.extras,\n overflow: props.overflow,\n label: props.label,\n });\n };\n },\n});\n","/** @jsxImportSource vue */\n// The toolbar's controls, one per registry shape or adapter kind: the Vue twin of the controls\n// in the React adapter's `Toolbar.tsx`. `ToolbarControl` picks the part by core's\n// `toolbarPartKind` and by `SHAPED_PARTS`, so a slot added to the registry renders in both\n// adapters without editing this file. The rules (dropdown rows, the split color, the font\n// filter) are core's (`toolbar-controls.ts`).\n\nimport {\n Fragment,\n defineComponent,\n h,\n inject,\n ref,\n type Component,\n type PropType,\n type VNode,\n type ExtractPublicPropTypes,\n} from 'vue';\nimport {\n colorMenuSelection,\n chromeSlotIsToggle,\n requestDialogSection,\n dispatchFindRequest,\n runChromeRow,\n surfaceInputIn,\n toolbarColorResetKey,\n toolbarDropdownRow,\n toolbarPartKind,\n toolbarRowSection,\n toolbarSplitDefaultColor,\n translateKeyOrText,\n type ChromeControl,\n type ChromeSlotId,\n type ToolbarPartKind,\n type ToolbarPickedColor,\n} from '@pptx-editor.dev/core/editor';\nimport {\n Icon,\n MenuItem,\n Popover,\n ToolButton,\n focusText,\n keepFocus,\n useAriaDisabled,\n} from './chrome.tsx';\nimport { ColorSwatches } from './ColorSwatches.tsx';\nimport {\n chromeActionHostKey,\n useEditorState,\n usePptxEditor,\n useTranslation,\n} from './composables.ts';\nimport { useSlot } from './slot.ts';\nimport { useTriggerAttributes } from './slot-override.ts';\nimport { SizeControl } from './toolbar-size.tsx';\nimport { FontFamilyControl } from './FontFamilyControl.tsx';\nimport { ImageControl, LinkControl } from './toolbar-file-controls.tsx';\nimport { FillControl, LineMenuControl, ShapeGalleryControl } from './ShapeControls.tsx';\nimport { EffectMenuControl, ShapeStyleGalleryControl } from './ShapeFormatControls.tsx';\nimport {\n LayoutControl,\n NewSlideControl,\n SectionAddControl,\n SectionRenameControl,\n} from './SlideControls.tsx';\nimport { TableGridControl, TableStyleControl } from './TableControls.tsx';\nimport { CorrectionsControl } from './PictureControls.tsx';\n\nconst slotPartProps = {\n slot: { type: String as PropType<ChromeSlotId>, required: true as const },\n control: { type: Object as PropType<ChromeControl>, required: true as const },\n} as const;\n\n/** A toolbar button that runs the slot's command; a toggle shows `aria-pressed`. */\nconst IconControl = defineComponent({\n name: 'PptxIconControl',\n props: slotPartProps,\n setup(props) {\n const { cmd, label, reason } = useSlot(\n () => props.slot,\n () => props.control\n );\n return () => (\n <ToolButton\n slot={props.slot}\n label={label.value}\n paths={props.control.paths}\n onClick={() => cmd.execute()}\n disabled={!cmd.isEnabled.value}\n disabledReason={reason.value}\n // The registry says which controls are toggles; `aria-pressed` goes on those only.\n pressed={chromeSlotIsToggle(props.slot) ? cmd.isActive.value : undefined}\n />\n );\n },\n});\n\n/** A value menu: a radio group of choices, or a menu of actions, with dialog rows. */\nconst DropdownControl = defineComponent({\n name: 'PptxDropdownControl',\n props: slotPartProps,\n setup(props) {\n const { cmd, label, reason, tip } = useSlot(\n () => props.slot,\n () => props.control\n );\n const off = useAriaDisabled(() => !cmd.isEnabled.value, reason);\n const { t } = useTranslation();\n const editor = usePptxEditor();\n const host = inject(chromeActionHostKey, null);\n const anchor = ref<HTMLButtonElement | null>(null);\n const open = ref(false);\n // A dropdown with no icon is the arrow half of a split button (Bullets and Numbering).\n const icon = (): readonly string[] | null | undefined =>\n props.control.options?.find((o) => o.value === cmd.value.value)?.paths ?? props.control.paths;\n const trigger = useTriggerAttributes(props.slot, '', () => ({\n disabled: !cmd.isEnabled.value,\n }));\n const openRow = (dialog: Parameters<NonNullable<typeof host>['openDialog']>[0]): void => {\n open.value = false;\n // Focus returns to the text when the dialog closes: the dialog host takes the element\n // that has focus as it opens.\n const text = anchor.value\n ?.closest('.pptx-editor')\n ?.querySelector<HTMLElement>('.pptx-surface__input');\n (text ?? anchor.value)?.focus({ preventScroll: true });\n const section = toolbarRowSection(props.slot);\n if (editor.value && section) requestDialogSection(editor.value, dialog, section);\n host?.openDialog(dialog);\n };\n return () => {\n const paths = icon();\n const base = `pptx-toolbar__button ${paths ? 'pptx-toolbar__button--wide' : 'pptx-toolbar__button--caret'}`;\n const attrs = trigger();\n const options = props.control.options ?? [];\n const glyphs = options.some((x) => x.glyph);\n return [\n <button\n ref={anchor}\n type=\"button\"\n {...attrs}\n class={[base, attrs.class].filter(Boolean).join(' ')}\n data-slot={props.slot}\n aria-label={label.value}\n aria-haspopup=\"menu\"\n aria-expanded={open.value}\n {...tip.value}\n {...off.attrs.value}\n onMousedown={keepFocus}\n onClick={() => (open.value = !open.value)}\n >\n {paths ? <Icon paths={paths} /> : null}\n <Icon name=\"arrow_drop_down\" className=\"pptx-icon pptx-toolbar__caret\" />\n </button>,\n off.note(),\n open.value ? (\n <Popover anchor={anchor.value} onClose={() => (open.value = false)}>\n {{\n default: () =>\n options.map((o) => {\n const row = toolbarDropdownRow(\n editor.value,\n host,\n props.slot,\n props.control,\n o,\n cmd.value.value\n );\n const dialog = row.dialog;\n return (\n <Fragment key={o.value}>\n {dialog ? <div class=\"pptx-menu__sep\" role=\"separator\" /> : null}\n <MenuItem\n {...(row.checked !== undefined ? { checked: row.checked } : {})}\n {...(row.refused\n ? {\n disabled: true,\n ...(row.reason ? { reason: translateKeyOrText(t, row.reason) } : {}),\n }\n : {})}\n onSelect={() => {\n if (dialog) return openRow(dialog);\n // A pick gives the caret back to the slide text, so the next key\n // (typing, Cmd+Z) reaches the slide.\n cmd.execute(o.value);\n focusText(editor.value, anchor.value);\n open.value = false;\n }}\n >\n {{\n default: () => [\n o.paths ? (\n <Icon paths={o.paths} />\n ) : o.glyph || glyphs ? (\n // A row with no preview keeps the column, so the labels line up.\n <span class=\"pptx-menu__glyph\" aria-hidden=\"true\">\n {o.glyph}\n </span>\n ) : null,\n t(o.labelKey, o.labelParams),\n ],\n }}\n </MenuItem>\n </Fragment>\n );\n }),\n }}\n </Popover>\n ) : null,\n ];\n };\n },\n});\n\n/** A split color button: the main half applies the last color, the arrow opens the swatches. */\nconst ColorControl = defineComponent({\n name: 'PptxColorControl',\n props: slotPartProps,\n setup(props) {\n const { cmd, label, reason, tip } = useSlot(\n () => props.slot,\n () => props.control\n );\n const editor = usePptxEditor();\n const { t } = useTranslation();\n const anchor = ref<HTMLButtonElement | null>(null);\n const open = ref(false);\n const text1 = useEditorState((s) => s.themeColors[0]?.[1]?.color);\n // The current color of the selection, marked in the menu.\n const selected = useEditorState((s) => colorMenuSelection(props.slot, s));\n const picked = ref<ToolbarPickedColor | null>(null);\n const off = useAriaDisabled(() => !cmd.isEnabled.value, reason);\n const close = (): void => {\n focusText(editor.value, anchor.value);\n open.value = false;\n };\n return () => {\n const last = picked.value ?? toolbarSplitDefaultColor(props.slot, text1.value);\n return (\n <span class=\"pptx-toolbar__group\">\n <ToolButton\n slot={props.slot}\n label={label.value}\n paths={props.control.paths}\n disabled={!cmd.isEnabled.value}\n disabledReason={reason.value}\n asChild={false}\n onClick={() => cmd.execute(last.choice)}\n >\n {{\n default: () => (\n <span class=\"pptx-toolbar__swatch\" style={{ background: last.color }} />\n ),\n }}\n </ToolButton>\n <button\n ref={anchor}\n type=\"button\"\n class=\"pptx-toolbar__button pptx-toolbar__step\"\n aria-label={label.value}\n aria-haspopup=\"menu\"\n aria-expanded={open.value}\n {...tip.value}\n {...off.attrs.value}\n onMousedown={keepFocus}\n onClick={() => (open.value = !open.value)}\n >\n <Icon name=\"arrow_drop_down\" className=\"pptx-icon pptx-toolbar__caret\" />\n </button>\n {off.note()}\n {open.value ? (\n <Popover anchor={anchor.value} onClose={() => (open.value = false)}>\n {{\n default: () => [\n <ColorSwatches\n selected={selected.value}\n onPick={(choice, color) => {\n picked.value = { choice, color };\n cmd.execute(choice);\n close();\n }}\n />,\n <div class=\"pptx-menu__sep\" />,\n <MenuItem onSelect={() => (cmd.execute(null), close())}>\n {{ default: () => t(toolbarColorResetKey(props.slot)) }}\n </MenuItem>,\n ],\n }}\n </Popover>\n ) : null}\n </span>\n );\n };\n },\n});\n\n/** A control that opens a panel the adapter owns: the find bar, to find or to replace. */\nconst PanelControl = defineComponent({\n name: 'PptxPanelControl',\n props: slotPartProps,\n setup(props) {\n const { cmd, label, reason } = useSlot(\n () => props.slot,\n () => props.control\n );\n const editor = usePptxEditor();\n const { t } = useTranslation();\n const host = inject(chromeActionHostKey, null);\n return () => {\n // A `popups.find` of `false`, the slide sorter, or no find bar turns the button off.\n const off = host?.unavailable?.(props.slot) ?? null;\n return (\n <ToolButton\n slot={props.slot}\n label={label.value}\n paths={props.control.paths}\n disabled={!!off || !cmd.isEnabled.value}\n disabledReason={off ? translateKeyOrText(t, off) : reason.value}\n onClick={() => dispatchFindRequest(editor.value, props.slot === 'find.replace')}\n />\n );\n };\n },\n});\n\n/**\n * A control the adapter runs itself: a registry dialog (Page setup, Format background), the\n * clipboard, or the slide show. Core's `runChromeRow` picks the action.\n */\nconst ActionControl = defineComponent({\n name: 'PptxActionControl',\n props: slotPartProps,\n setup(props) {\n const { cmd, label, reason } = useSlot(\n () => props.slot,\n () => props.control\n );\n const editor = usePptxEditor();\n const { t } = useTranslation();\n const host = inject(chromeActionHostKey, null);\n const wrap = ref<HTMLElement | null>(null);\n const run = (): void => {\n if (!host) return void cmd.execute();\n // A dialog's focus returns to this button: the dialog host takes the focused element.\n const button = wrap.value?.querySelector<HTMLElement>('[data-slot]') ?? null;\n runChromeRow(\n editor.value,\n {\n ...host,\n openDialog: (key) => {\n button?.focus({ preventScroll: true });\n host.openDialog(key);\n },\n },\n props.slot,\n undefined,\n surfaceInputIn(wrap.value?.closest('.pptx-editor'))\n );\n };\n return () => {\n // A `popups` entry of `false` turns the button off. A slot that also takes a value\n // (`image.altText`) keeps its command enabled, so the button asks the host here.\n const off = host?.unavailable?.(props.slot) ?? null;\n return (\n <span ref={wrap} class=\"pptx-toolbar__group\">\n <ToolButton\n hasPopup={props.control.state.kind === 'dialog' ? 'dialog' : undefined}\n slot={props.slot}\n label={label.value}\n paths={props.control.paths}\n disabled={!!off || !cmd.isEnabled.value}\n disabledReason={off ? translateKeyOrText(t, off) : reason.value}\n onClick={run}\n />\n </span>\n );\n };\n },\n});\n\n/**\n * Slots whose control is more than its registry shape: a searchable font list, a link editor,\n * a fill with gradients, and line menus that draw each option. As in DOCX Editor's\n * `SHAPED_PARTS`, this picks a renderer; it never decides which slots the toolbar shows.\n */\nconst SHAPED_PARTS: Partial<Record<ChromeSlotId, Component>> = {\n 'font.family': FontFamilyControl,\n 'text.link': LinkControl,\n 'insert.line': LineMenuControl,\n 'shape.fill': FillControl,\n 'shape.lineStart': LineMenuControl,\n 'shape.lineEnd': LineMenuControl,\n 'shape.styles': ShapeStyleGalleryControl,\n 'shape.effects': EffectMenuControl,\n 'slide.add': NewSlideControl,\n 'slide.layout': LayoutControl,\n 'section.add': SectionAddControl,\n 'section.rename': SectionRenameControl,\n 'table.style': TableStyleControl,\n 'image.corrections': CorrectionsControl,\n};\n\n/** The renderer for each part kind (core's `toolbarPartKind`), as React's `KIND_PARTS`. */\nconst KIND_PARTS: Record<ToolbarPartKind, Component> = {\n icon: IconControl,\n stepper: SizeControl,\n dropdown: DropdownControl,\n colorSplit: ColorControl,\n gallery: ShapeGalleryControl,\n tableGrid: TableGridControl,\n load: ImageControl,\n panel: PanelControl,\n action: ActionControl,\n};\n\nconst toolbarControlProps = {\n group: { type: String, required: true as const },\n control: { type: Object as PropType<ChromeControl>, required: true as const },\n} as const;\n\n/** The props of `ToolbarControl`, the twin of React's `ToolbarControlProps`. @public */\nexport type ToolbarControlProps = ExtractPublicPropTypes<typeof toolbarControlProps>;\n\n/** One registered control, by registry shape, as React's `PptxEditor.ToolbarControl`. @public */\nexport const ToolbarControl = defineComponent({\n name: 'ToolbarControl',\n props: toolbarControlProps,\n setup(props) {\n return (): VNode => {\n const slot = `${props.group}.${props.control.id}` as ChromeSlotId;\n const Part = SHAPED_PARTS[slot] ?? KIND_PARTS[toolbarPartKind(props.control)];\n return h(Part, { slot, control: props.control });\n };\n },\n});\n","/** @jsxImportSource vue */\n// The toolbar's Font size control: Decrease, the size box, and Increase. The Vue twin of the\n// React adapter's `toolbar-size.tsx`; the stepper shape of `CHROME_GROUPS` renders it, and core\n// gives the box text and the parse (`toolbarSizeText`, `parseToolbarSize`).\n\nimport { defineComponent, onBeforeUnmount, ref, shallowRef, useId, type PropType } from 'vue';\nimport {\n SIZE_ERROR_MS,\n parseToolbarSize,\n sizeErrorPlace,\n toolbarSizeRefusal,\n toolbarSizeText,\n type ChromeControl,\n type ChromeSlotId,\n} from '@pptx-editor.dev/core/editor';\nimport { ToolButton, focusText, useAriaDisabled } from './chrome.tsx';\nimport { useEditorState, usePptxEditor, useTranslation } from './composables.ts';\nimport { useSlot } from './slot.ts';\nimport { useTriggerAttributes } from './slot-override.ts';\n\n/** The `font.size` stepper. @internal */\nexport const SizeControl = defineComponent({\n name: 'PptxSizeControl',\n props: {\n slot: { type: String as PropType<ChromeSlotId>, required: true as const },\n control: { type: Object as PropType<ChromeControl>, required: true as const },\n },\n setup(props) {\n const { cmd, label, reason, tip } = useSlot(\n () => props.slot,\n () => props.control\n );\n const editor = usePptxEditor();\n const { t } = useTranslation();\n // The steps are off over a mixed size, as DOCX Editor turns its steppers off.\n const mixed = useEditorState((s) => s.format?.font?.disagrees.fontSizePt === true);\n const draft = ref<string | null>(null);\n const box = ref<HTMLInputElement | null>(null);\n // Set when Enter or Escape has already handled the box, so the blur that follows does nothing.\n let handled = false;\n const off = useAriaDisabled(() => !cmd.isEnabled.value, reason);\n const trigger = useTriggerAttributes(props.slot, 'pptx-toolbar__stepper', () => ({\n disabled: !cmd.isEnabled.value,\n }));\n // A size out of range is refused with its range, under the box, and announced.\n const errorId = useId();\n const error = shallowRef<{ text: string; left: number; top: number } | null>(null);\n let timer: ReturnType<typeof setTimeout> | undefined;\n const showError = (next: { text: string; left: number; top: number } | null): void => {\n clearTimeout(timer);\n error.value = next;\n if (next) timer = setTimeout(() => (error.value = null), SIZE_ERROR_MS);\n };\n onBeforeUnmount(() => clearTimeout(timer));\n const commit = (): void => {\n const refusal = toolbarSizeRefusal(draft.value);\n const n = parseToolbarSize(draft.value);\n if (!handled && refusal)\n showError({ text: t(refusal.key, refusal.params), ...sizeErrorPlace(box.value) });\n else if (!handled && n !== null) cmd.execute(n);\n handled = false;\n draft.value = null;\n };\n // Enter and Escape hand the caret back to the text, as DOCX Editor's size box does, so a\n // size armed at a caret applies to the text typed next.\n const leave = (apply: boolean): void => {\n if (apply) commit();\n draft.value = null;\n handled = true;\n focusText(editor.value, box.value);\n if (box.value?.ownerDocument.activeElement === box.value) handled = false;\n };\n return () => {\n const stepOff = !cmd.isEnabled.value || mixed.value;\n const stepReason = mixed.value ? t('disabled.mixedSize') : reason.value;\n return (\n <span {...trigger()} data-slot={props.slot}>\n <ToolButton\n label={t('toolbar.fontSizeDecrease')}\n icon=\"remove\"\n className=\"pptx-toolbar__step\"\n disabled={stepOff}\n disabledReason={stepReason}\n onClick={() => cmd.execute({ step: -1 })}\n />\n <input\n ref={box}\n class=\"pptx-toolbar__size\"\n aria-label={label.value}\n {...tip.value}\n value={draft.value ?? toolbarSizeText(cmd.value.value, mixed.value)}\n {...(error.value ? { 'aria-invalid': true, 'aria-describedby': errorId } : {})}\n {...off.attrs.value}\n readonly={!cmd.isEnabled.value}\n onInput={(e: Event) => {\n draft.value = (e.target as HTMLInputElement).value;\n showError(null);\n }}\n onBlur={commit}\n onKeydown={(e: KeyboardEvent) => {\n // The key stops here: Enter must not reach the slide text, and Escape must not\n // close a More card around the box (focus goes to the text instead).\n if (e.key !== 'Enter' && e.key !== 'Escape') return;\n e.preventDefault();\n e.stopPropagation();\n leave(e.key === 'Enter');\n }}\n />\n <ToolButton\n label={t('toolbar.fontSizeIncrease')}\n icon=\"add\"\n className=\"pptx-toolbar__step\"\n disabled={stepOff}\n disabledReason={stepReason}\n onClick={() => cmd.execute({ step: 1 })}\n />\n {off.note()}\n {error.value ? (\n <span\n id={errorId}\n role=\"alert\"\n class=\"pptx-toolbar__size-error\"\n style={{ left: `${error.value.left}px`, top: `${error.value.top}px` }}\n >\n {error.value.text}\n </span>\n ) : null}\n </span>\n );\n };\n },\n});\n","/** @jsxImportSource vue */\n// The toolbar controls that open a popup or a file picker: the link control and the picture\n// file controls (Insert Picture, Change Picture). The Vue twin of the React adapter's\n// `toolbar-file-controls.tsx`.\n\nimport { defineComponent, inject, ref, type PropType } from 'vue';\nimport {\n imageFileTypes,\n insertImageFile,\n requestLinkPopup,\n translateKeyOrText,\n type ChromeControl,\n type ChromeSlotId,\n} from '@pptx-editor.dev/core/editor';\nimport { ToolButton } from './chrome.tsx';\nimport { chromeActionHostKey, usePptxEditor, useTranslation } from './composables.ts';\nimport { useSlot } from './slot.ts';\n\nconst slotPartProps = {\n slot: { type: String as PropType<ChromeSlotId>, required: true as const },\n control: { type: Object as PropType<ChromeControl>, required: true as const },\n} as const;\n\n/** The link control: it opens the link popup (`popups.hyperlink`). @internal */\nexport const LinkControl = defineComponent({\n name: 'PptxLinkControl',\n props: slotPartProps,\n setup(props) {\n const { cmd, label, reason } = useSlot(\n () => props.slot,\n () => props.control\n );\n const editor = usePptxEditor();\n const { t } = useTranslation();\n const host = inject(chromeActionHostKey, null);\n const anchor = ref<HTMLElement | null>(null);\n return () => {\n // The button opens the popup, so a `popups.hyperlink` of `false` turns it off; the\n // command (`setLink`) keeps working.\n const off = host?.unavailable?.(props.slot) ?? null;\n return (\n <span ref={anchor} class=\"pptx-toolbar__group\">\n <ToolButton\n slot={props.slot}\n label={label.value}\n paths={props.control.paths}\n disabled={!!off || !cmd.isEnabled.value}\n disabledReason={off ? translateKeyOrText(t, off) : reason.value}\n pressed={typeof cmd.value.value === 'string' && cmd.value.value !== ''}\n onClick={() => requestLinkPopup(editor.value, anchor.value)}\n />\n </span>\n );\n };\n },\n});\n\n/** Insert Picture and Change Picture: a button over a hidden file input. @internal */\nexport const ImageControl = defineComponent({\n name: 'PptxImageControl',\n props: slotPartProps,\n setup(props) {\n const { cmd, label, reason } = useSlot(\n () => props.slot,\n () => props.control\n );\n const editor = usePptxEditor();\n const input = ref<HTMLInputElement | null>(null);\n return () => {\n // Insert > Picture adds a picture; Change Picture replaces the selected one's image.\n const target = props.control.state.kind === 'replace' ? 'replaceImage' : undefined;\n return [\n <ToolButton\n slot={props.slot}\n label={label.value}\n paths={props.control.paths}\n disabled={!cmd.isEnabled.value}\n disabledReason={reason.value}\n onClick={() => input.value?.click()}\n />,\n <input\n ref={input}\n type=\"file\"\n accept={imageFileTypes(target)}\n hidden\n onChange={(e: Event) => {\n const el = e.target as HTMLInputElement;\n const file = el.files?.[0];\n // Clear the input, so picking the same file again still fires `change`.\n el.value = '';\n if (file && editor.value) void insertImageFile(editor.value, file, target);\n }}\n />,\n ];\n };\n },\n});\n","/** @jsxImportSource vue */\n// The Shape Format controls whose look is more than an icon: the Shape Styles gallery, which\n// draws each theme style with the slide's theme colors, and the Shadow, Reflection, Glow, and\n// Soft Edges menus, which name their current choice. The Vue twin of the React adapter's\n// `ShapeFormatControls.tsx`, on the same core rules (`chrome-shapes.ts`, `insert-controls.ts`).\n// The fill control lives with the other shape controls (`ShapeControls.tsx`) and is re-exported\n// here.\n\nimport { defineComponent, ref, type ExtractPublicPropTypes, type PropType } from 'vue';\nimport {\n GLOW_ACCENTS,\n SHAPE_STYLE_GALLERY,\n chromeOptionChecked,\n effectSeparatorBefore,\n glowGridRows,\n shapeStyleChoice,\n shapeStylePreview,\n type ChromeControl,\n type ChromeSlotId,\n type ShapeStyleChoice,\n type ShapeStyleValue,\n} from '@pptx-editor.dev/core/editor';\nimport type { TranslationKey } from '@pptx-editor.dev/i18n';\nimport { Icon, Popover, keepFocus, useAriaDisabled } from './chrome.tsx';\nimport { MenuRow, MenuSeparator, MenuSubmenu } from './menu-row.tsx';\nimport { useEditorState, useTranslation } from './composables.ts';\nimport { useSlot } from './slot.ts';\nimport { useTriggerAttributes } from './slot-override.ts';\n\nexport { FillControl } from './ShapeControls.tsx';\n\nconst cellKey = (c: ShapeStyleChoice): string => `${c.row}.${c.color}`;\n\n/** The cell the trigger shows while the selection has no gallery style: Colored Fill, Accent 1. */\nconst DEFAULT_CELL: ShapeStyleChoice = { row: 'coloredFill', color: 'accent1' };\n\nconst slotPartProps = {\n slot: { type: String as PropType<ChromeSlotId>, required: true as const },\n control: { type: Object as PropType<ChromeControl>, required: true as const },\n} as const;\n\n/** One gallery cell: a small rounded box in the style's fill, outline, and text colors. */\nconst StyleSwatch = defineComponent({\n name: 'PptxStyleSwatch',\n props: {\n cell: { type: Object as PropType<ShapeStyleChoice>, required: true as const },\n className: { type: String, default: 'pptx-style-gallery__swatch' },\n },\n setup(props) {\n const { t } = useTranslation();\n const themeColors = useEditorState((s) => s.themeColors);\n return () => {\n const p = shapeStylePreview(props.cell, themeColors.value);\n return (\n <svg class={props.className} viewBox=\"0 0 40 28\" aria-hidden=\"true\">\n {p.effect > 0 ? (\n <rect\n x=\"4\"\n y=\"5\"\n width=\"34\"\n height=\"22\"\n rx=\"3\"\n class=\"pptx-style-gallery__shadow\"\n opacity={0.12 * p.effect}\n />\n ) : null}\n <rect\n x=\"2\"\n y=\"2\"\n width=\"34\"\n height=\"22\"\n rx=\"3\"\n fill={p.fill ?? 'none'}\n stroke={p.line ?? 'none'}\n stroke-width={p.line ? 1.5 : 0}\n />\n <text x=\"19\" y=\"17\" text-anchor=\"middle\" font-size=\"9\" fill={p.text}>\n {t('toolbar.shapeStyleSample')}\n </text>\n </svg>\n );\n };\n },\n});\n\nconst shapeStyleGalleryProps = {\n /**\n * The cell to check: a cell, or the slot value (`row.color`, as\n * `useEditorValueCommand('shape.styles').value` gives it), or null for none.\n */\n value: {\n type: [Object, String] as PropType<ShapeStyleChoice | ShapeStyleValue | null>,\n default: undefined,\n },\n /** Called with the picked cell, as React's `onPick`. */\n onPick: { type: Function as PropType<(cell: ShapeStyleChoice) => void>, required: true as const },\n /** A class name added to the gallery, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n} as const;\n\n/** Props of `ShapeStyleGallery`, the twin of React's `ShapeStyleGalleryProps`. @public */\nexport type ShapeStyleGalleryProps = ExtractPublicPropTypes<typeof shapeStyleGalleryProps>;\n\n/**\n * The Quick Styles gallery: six theme style rows of seven colors, drawn with the current\n * slide's theme. Put it in a popover or a menu. A pick calls `onPick` with the cell;\n * `className` (or a host `class`) goes on the gallery. @public\n */\nexport const ShapeStyleGallery = defineComponent({\n name: 'ShapeStyleGallery',\n props: shapeStyleGalleryProps,\n setup(props) {\n const { t } = useTranslation();\n return () => {\n const picked = shapeStyleChoice(props.value);\n const checked = picked ? cellKey(picked) : undefined;\n return (\n <div\n class={['pptx-style-gallery', props.className]}\n role=\"group\"\n aria-label={t('toolbar.shapeStyles')}\n // A grid for the arrow keys: Up and Down move by a row of colors.\n data-columns={SHAPE_STYLE_GALLERY[0]?.cells.length}\n >\n {SHAPE_STYLE_GALLERY.map(({ row, cells }) => (\n <div key={row} class=\"pptx-style-gallery__row\" role=\"presentation\">\n {cells.map((cell) => {\n const name = t('toolbar.shapeStyleCell', {\n row: t(`toolbar.shapeStyleRows.${cell.row}` as TranslationKey),\n color: t(`toolbar.shapeStyleColors.${cell.color}` as TranslationKey),\n });\n return (\n <button\n key={cellKey(cell)}\n type=\"button\"\n role=\"menuitemradio\"\n aria-checked={checked === cellKey(cell)}\n tabindex={-1}\n class=\"pptx-menu__item pptx-style-gallery__cell\"\n aria-label={name}\n data-pptx-tooltip={name}\n data-style={cellKey(cell)}\n onClick={() => props.onPick(cell)}\n >\n <StyleSwatch cell={cell} />\n </button>\n );\n })}\n </div>\n ))}\n </div>\n );\n };\n },\n});\n\n/** The toolbar control of `shape.styles`: a trigger and the gallery in a popover. @internal */\nexport const ShapeStyleGalleryControl = defineComponent({\n name: 'PptxShapeStyleGalleryControl',\n props: slotPartProps,\n setup(props) {\n const { cmd, label, reason, tip } = useSlot(\n () => props.slot,\n () => props.control\n );\n // a disabled picker stays in the arrow order and says why.\n const off = useAriaDisabled(() => !cmd.isEnabled.value, reason);\n const anchor = ref<HTMLButtonElement | null>(null);\n const open = ref(false);\n const trigger = useTriggerAttributes(\n props.slot,\n 'pptx-toolbar__button pptx-toolbar__button--wide',\n () => ({ disabled: !cmd.isEnabled.value })\n );\n return () => [\n <button\n ref={anchor}\n type=\"button\"\n {...trigger()}\n data-slot={props.slot}\n aria-label={label.value}\n aria-haspopup=\"menu\"\n aria-expanded={open.value}\n {...tip.value}\n {...off.attrs.value}\n onMousedown={keepFocus}\n onClick={() => (open.value = !open.value)}\n >\n <StyleSwatch\n cell={shapeStyleChoice(cmd.value.value) ?? DEFAULT_CELL}\n className=\"pptx-style-gallery__trigger\"\n />\n <Icon name=\"arrow_drop_down\" className=\"pptx-icon pptx-toolbar__caret\" />\n </button>,\n off.note(),\n open.value ? (\n <Popover anchor={anchor.value} onClose={() => (open.value = false)}>\n {{\n default: () => (\n <>\n <ShapeStyleGallery\n value={shapeStyleChoice(cmd.value.value)}\n onPick={(cell: ShapeStyleChoice) => {\n cmd.execute(cell);\n open.value = false;\n }}\n />\n </>\n ),\n }}\n </Popover>\n ) : null,\n ];\n },\n});\n\n/** The Shape Effects trigger: a rounded box with an offset shadow, drawn, not an icon path. */\nfunction effectsGlyph() {\n return (\n <svg class=\"pptx-icon pptx-effects-glyph\" viewBox=\"0 0 24 24\" aria-hidden=\"true\">\n <rect x=\"7\" y=\"7\" width=\"13\" height=\"13\" rx=\"2.5\" class=\"pptx-effects-glyph__shadow\" />\n <rect x=\"4\" y=\"4\" width=\"13\" height=\"13\" rx=\"2.5\" class=\"pptx-effects-glyph__box\" />\n </svg>\n );\n}\n\ntype EffectOption = NonNullable<ChromeControl['options']>[number];\n\n/**\n * Glow Variations: a grid with a row per size and a column per accent, each cell a box with a\n * glow in that accent. Up and Down move by a row (`data-columns`).\n */\nconst GlowGrid = defineComponent({\n name: 'PptxGlowGrid',\n props: {\n slot: { type: String as PropType<ChromeSlotId>, required: true as const },\n options: { type: Array as PropType<readonly EffectOption[]>, required: true as const },\n value: { type: [String, Number] as PropType<string | number>, default: undefined },\n },\n emits: { pick: (_value: string) => true },\n setup(props, { emit }) {\n const { t } = useTranslation();\n const themeColors = useEditorState((s) => s.themeColors);\n const swatch = (accent: string): string =>\n themeColors.value[0]?.find((s) => s.slot === accent)?.color ?? '#808080';\n return () => (\n <div\n class=\"pptx-style-gallery pptx-glow-grid\"\n role=\"group\"\n aria-label={t('toolbar.glowVariationsLabel')}\n data-columns={GLOW_ACCENTS.length}\n >\n {glowGridRows(props.options).map(({ size, cells }) => (\n <div key={size} class=\"pptx-style-gallery__row\" role=\"presentation\">\n {cells.map(({ option: o, accent }) => {\n const name = t(o.labelKey as TranslationKey, o.labelParams);\n return (\n <button\n key={o.value}\n type=\"button\"\n role=\"menuitemradio\"\n aria-checked={chromeOptionChecked(props.value, o.value)}\n tabindex={-1}\n class=\"pptx-menu__item pptx-style-gallery__cell\"\n aria-label={name}\n data-pptx-tooltip={name}\n data-slot={props.slot}\n data-value={o.value}\n onClick={() => emit('pick', o.value)}\n >\n <svg class=\"pptx-style-gallery__swatch\" viewBox=\"0 0 40 28\" aria-hidden=\"true\">\n <rect\n x=\"9\"\n y=\"6\"\n width=\"22\"\n height=\"16\"\n rx=\"2\"\n fill=\"none\"\n stroke={swatch(accent)}\n stroke-opacity=\"0.4\"\n // The glow width follows the size: 18 pt draws twice as wide as 8 pt.\n stroke-width={Number(size) / 2}\n />\n <rect x=\"9\" y=\"6\" width=\"22\" height=\"16\" rx=\"2\" class=\"pptx-glow-grid__box\" />\n </svg>\n </button>\n );\n })}\n </div>\n ))}\n </div>\n );\n },\n});\n\n/**\n * The Shape Effects menu (`shape.effects`): one submenu per effect (Shadow, Reflection, Glow,\n * Soft Edges, the option groups of the registry), with each effect's current choice checked.\n * @internal\n */\nexport const EffectMenuControl = defineComponent({\n name: 'PptxEffectMenuControl',\n props: slotPartProps,\n setup(props) {\n const { cmd, label, reason, tip } = useSlot(\n () => props.slot,\n () => props.control\n );\n // a disabled picker stays in the arrow order and says why.\n const off = useAriaDisabled(() => !cmd.isEnabled.value, reason);\n const { t } = useTranslation();\n const anchor = ref<HTMLButtonElement | null>(null);\n const open = ref(false);\n const trigger = useTriggerAttributes(\n props.slot,\n 'pptx-toolbar__button pptx-toolbar__button--wide',\n () => ({ disabled: !cmd.isEnabled.value })\n );\n const close = (): void => {\n open.value = false;\n };\n const pick = (value: string): void => {\n cmd.execute(value);\n close();\n };\n const row = (o: EffectOption) => (\n <MenuRow\n key={o.value}\n slot={props.slot}\n label={t(o.labelKey as TranslationKey, o.labelParams)}\n checked={chromeOptionChecked(cmd.value.value, o.value)}\n radio\n onSelect={() => pick(o.value)}\n />\n );\n const groupRows = (group: string, options: readonly EffectOption[]) => {\n const [first, ...rest] = options;\n if (group === 'glow' && first)\n return [\n row(first),\n <GlowGrid slot={props.slot} options={rest} value={cmd.value.value} onPick={pick} />,\n ];\n // Shadows: a line between the outer and the inner presets (the Outer and Inner sections).\n return options.flatMap((o, i) =>\n effectSeparatorBefore(group, options, i)\n ? [<MenuSeparator key={`sep-${o.value}`} />, row(o)]\n : [row(o)]\n );\n };\n return () => [\n <button\n ref={anchor}\n type=\"button\"\n {...trigger()}\n data-slot={props.slot}\n aria-label={label.value}\n aria-haspopup=\"menu\"\n aria-expanded={open.value}\n {...tip.value}\n {...off.attrs.value}\n onMousedown={keepFocus}\n onClick={() => (open.value = !open.value)}\n >\n {effectsGlyph()}\n <Icon name=\"arrow_drop_down\" className=\"pptx-icon pptx-toolbar__caret\" />\n </button>,\n off.note(),\n open.value ? (\n <Popover anchor={anchor.value} onClose={close}>\n {{\n default: () => (\n <>\n {props.control.optionGroups?.map((group) => (\n <MenuSubmenu key={group.id} label={t(group.labelKey as TranslationKey)}>\n {{\n default: () =>\n groupRows(\n group.id,\n props.control.options?.filter((o) => o.group === group.id) ?? []\n ),\n }}\n </MenuSubmenu>\n ))}\n </>\n ),\n }}\n </Popover>\n ) : null,\n ];\n },\n});\n","/** @jsxImportSource vue */\n// The Picture Format controls whose look is more than a list: the Corrections gallery, a grid\n// with a row per contrast and a column per brightness, each cell a sample picture with that\n// correction. The Vue twin of the React adapter's `PictureControls.tsx`, on the same core rules\n// (`chrome-picture.ts`, `picture-corrections.ts`).\n\nimport { defineComponent, ref, type PropType } from 'vue';\nimport {\n chromeOptionChecked,\n correctionGridRows,\n correctionPercent,\n correctionSwatch,\n type ChromeControl,\n type ChromeSlotId,\n} from '@pptx-editor.dev/core/editor';\nimport type { TranslationKey } from '@pptx-editor.dev/i18n';\nimport { Icon, Popover, keepFocus, useAriaDisabled } from './chrome.tsx';\nimport { useTranslation } from './composables.ts';\nimport { useSlot } from './slot.ts';\nimport { useTriggerAttributes } from './slot-override.ts';\n\n/** One Corrections sample: the sample picture with a brightness and a contrast. */\nconst CorrectionSwatch = defineComponent({\n name: 'PptxCorrectionSwatch',\n props: {\n brightness: { type: Number, required: true as const },\n contrast: { type: Number, required: true as const },\n },\n setup(props) {\n return () => (\n <svg class=\"pptx-corrections-grid__swatch\" viewBox=\"0 0 40 28\" aria-hidden=\"true\">\n {correctionSwatch(props.brightness, props.contrast).map((p) => (\n <path key={p.d} d={p.d} fill={p.fill} />\n ))}\n </svg>\n );\n },\n});\n\n/** The toolbar control of `image.corrections`: a trigger and the grid in a popover. @internal */\nexport const CorrectionsControl = defineComponent({\n name: 'PptxCorrectionsControl',\n props: {\n slot: { type: String as PropType<ChromeSlotId>, required: true as const },\n control: { type: Object as PropType<ChromeControl>, required: true as const },\n },\n setup(props) {\n const { cmd, label, reason, tip } = useSlot(\n () => props.slot,\n () => props.control\n );\n // A disabled picker stays in the arrow order and says why.\n const off = useAriaDisabled(() => !cmd.isEnabled.value, reason);\n const { t } = useTranslation();\n const anchor = ref<HTMLButtonElement | null>(null);\n const open = ref(false);\n const trigger = useTriggerAttributes(\n props.slot,\n 'pptx-toolbar__button pptx-toolbar__button--wide',\n () => ({ disabled: !cmd.isEnabled.value })\n );\n const pick = (value: string): void => {\n cmd.execute(value);\n open.value = false;\n };\n return () => {\n const rows = correctionGridRows(props.control.options ?? []);\n return [\n <button\n ref={anchor}\n type=\"button\"\n {...trigger()}\n data-slot={props.slot}\n aria-label={label.value}\n aria-haspopup=\"menu\"\n aria-expanded={open.value}\n {...tip.value}\n {...off.attrs.value}\n onMousedown={keepFocus}\n onClick={() => (open.value = !open.value)}\n >\n <Icon paths={props.control.paths} />\n <Icon name=\"arrow_drop_down\" className=\"pptx-icon pptx-toolbar__caret\" />\n </button>,\n off.note(),\n open.value ? (\n <Popover anchor={anchor.value} onClose={() => (open.value = false)}>\n {{\n default: () => (\n <div\n class=\"pptx-style-gallery pptx-corrections-grid\"\n role=\"group\"\n aria-label={t('pictureFormat.brightnessContrast')}\n // A grid for the arrow keys: Up and Down move by a row of brightness values.\n data-columns={rows[0]?.cells.length}\n >\n {/* The axis labels: each cell names its values, so they are hidden from assistive technology. */}\n <div class=\"pptx-corrections-grid__title\" aria-hidden=\"true\">\n {t('pictureFormat.brightness')}\n </div>\n <div class=\"pptx-corrections-grid__head\" aria-hidden=\"true\">\n {rows[0]?.cells.map(({ brightness }) => (\n <span key={brightness} class=\"pptx-corrections-grid__label\">\n {t('pictureFormat.percent', { value: correctionPercent(brightness) })}\n </span>\n ))}\n </div>\n <div class=\"pptx-corrections-grid__body\" role=\"presentation\">\n <div class=\"pptx-corrections-grid__side\" aria-hidden=\"true\">\n {t('pictureFormat.contrast')}\n </div>\n <div class=\"pptx-corrections-grid__rows\" role=\"presentation\">\n {rows.map(({ contrast, cells }) => (\n <div key={contrast} class=\"pptx-style-gallery__row\" role=\"presentation\">\n <span\n class=\"pptx-corrections-grid__label pptx-corrections-grid__label--row\"\n aria-hidden=\"true\"\n >\n {t('pictureFormat.percent', { value: correctionPercent(contrast) })}\n </span>\n {cells.map(({ option: o, brightness, contrast: c }) => {\n const name = t(o.labelKey as TranslationKey, o.labelParams);\n return (\n <button\n key={o.value}\n type=\"button\"\n role=\"menuitemradio\"\n aria-checked={chromeOptionChecked(cmd.value.value, o.value)}\n tabindex={-1}\n class=\"pptx-menu__item pptx-style-gallery__cell\"\n aria-label={name}\n data-pptx-tooltip={name}\n data-slot={props.slot}\n data-value={o.value}\n onClick={() => pick(o.value)}\n >\n <CorrectionSwatch brightness={brightness} contrast={c} />\n </button>\n );\n })}\n </div>\n ))}\n </div>\n </div>\n </div>\n ),\n }}\n </Popover>\n ) : null,\n ];\n };\n },\n});\n","/** @jsxImportSource vue */\n// The bar element of the toolbar and of each ribbon tab: the groups with separators, the fixed\n// block of loose host children, and the More menu that takes the groups that do not fit. The\n// Vue twin of React's `PresetToolbar` and `HandBar` (`Toolbar.tsx`): the same markup, classes,\n// and ARIA, with the fit rule in core (`toolbarCollapsedIds`, `observeToolbarFit`).\n\nimport {\n Fragment,\n defineComponent,\n onBeforeUnmount,\n onMounted,\n onUpdated,\n ref,\n shallowRef,\n useId,\n watch,\n type PropType,\n type VNode,\n type VNodeArrayChildren,\n type VNodeChild,\n} from 'vue';\nimport {\n createToolbarFitMemory,\n observeToolbarFit,\n toolbarCollapsedIds,\n} from '@pptx-editor.dev/core/editor';\nimport { Icon, Popover, keepFocus } from './chrome.tsx';\nimport { useEditorState, useTranslation } from './composables.ts';\nimport { useRovingToolbar } from './toolbar-measure.ts';\n\n/** One group on the bar: built-in or host, already resolved against the overrides. @internal */\nexport interface BarItem {\n readonly id: string;\n readonly label: string | undefined;\n readonly content: () => VNodeArrayChildren;\n readonly priority: number;\n readonly pinned: boolean;\n readonly className: string | undefined;\n /** The host's content for the group in the More menu. */\n readonly overflowContent: (() => VNodeChild) | undefined;\n /**\n * What a built-in group shows in the More menu when it has `overflowContent`: its own\n * controls, then that content, as DOCX Editor's `hostPanelContent`. A host group's\n * `overflowContent` replaces its controls.\n */\n readonly menuContent?: (() => VNodeArrayChildren) | undefined;\n}\n\nconst sep = (): VNode => <span class=\"pptx-toolbar__sep\" aria-hidden=\"true\" />;\n\n/** A `preset` false bar: the host's children, wrapped, with roving focus. @internal */\nexport const HandBar = defineComponent({\n name: 'PptxHandBar',\n setup(_, { slots }) {\n const { t } = useTranslation();\n const root = ref<HTMLElement | null>(null);\n const roving = useRovingToolbar(root);\n return () => (\n <div\n ref={root}\n class=\"pptx-toolbar pptx-toolbar--wrap\"\n role=\"toolbar\"\n aria-label={t('toolbar.ariaLabel')}\n data-overflow=\"wrap\"\n onMousedown={keepFocus}\n onFocusin={roving.onFocusin}\n onFocusout={roving.onFocusout}\n onKeydown={roving.onKeydown}\n >\n {slots.default?.()}\n </div>\n );\n },\n});\n\n/** The preset bar element, with the More menu. @internal */\nexport const PresetToolbar = defineComponent({\n name: 'PptxPresetToolbar',\n props: {\n items: { type: Array as PropType<readonly BarItem[]>, required: true as const },\n extras: { type: Array as PropType<readonly VNode[]>, required: true as const },\n overflow: { type: Boolean, required: true as const },\n label: { type: String, required: true as const },\n },\n setup(props) {\n const { t } = useTranslation();\n // Contextual controls change the width; refit when they appear or go.\n const context = useEditorState((s) => `${s.selection.kind}|${s.geometry?.lineHead ?? ''}`);\n const status = useEditorState((s) => s.status);\n const root = ref<HTMLElement | null>(null);\n const more = ref<HTMLElement | null>(null);\n const fixed = ref<HTMLElement | null>(null);\n const panelId = useId();\n // Widths and the collapsed set are keyed by group id, so a group that comes or goes does\n // not hand its width to its neighbour.\n const memory = createToolbarFitMemory();\n const collapsed = shallowRef<readonly string[]>([]);\n const open = ref(false);\n const roving = useRovingToolbar(root);\n\n let stopObserving: (() => void) | null = null;\n const fit = (): void => {\n const el = root.value;\n if (!el) return;\n if (!props.overflow) {\n if (collapsed.value.length) collapsed.value = [];\n return;\n }\n const next = toolbarCollapsedIds(el, props.items, memory, more.value, fixed.value);\n if (collapsed.value.join() !== next.join()) collapsed.value = next;\n };\n // After every render, as React's layout effect: measure, then watch the bar, its parent,\n // its groups, and the fixed block for size changes. A render that changes nothing leaves\n // the collapsed set as it is, so this settles.\n const refit = (): void => {\n stopObserving?.();\n stopObserving = null;\n fit();\n if (props.overflow && root.value) stopObserving = observeToolbarFit(root.value, fit);\n };\n onMounted(refit);\n onUpdated(refit);\n watch([context, status], refit, { flush: 'post' });\n onBeforeUnmount(() => stopObserving?.());\n // The More menu closes for good when nothing is in it, so it does not reopen by itself.\n watch(\n () => collapsed.value.length,\n (n) => {\n if (!n) open.value = false;\n }\n );\n\n const group = (item: BarItem, index: number, inMenu: boolean): VNode => (\n <div\n key={item.id}\n class={['pptx-toolbar__group', item.className]}\n role=\"group\"\n aria-label={item.label}\n data-group={item.id}\n data-group-index={inMenu ? undefined : index}\n >\n {/* The group's aria-label already names it: the heading is for sight only. */}\n {inMenu ? (\n <div class=\"pptx-toolbar__overflow-heading\" aria-hidden=\"true\">\n {item.label}\n </div>\n ) : null}\n {inMenu && item.overflowContent\n ? item.menuContent\n ? item.menuContent()\n : item.overflowContent()\n : item.content()}\n </div>\n );\n\n return () => {\n const items = props.items;\n const hiddenIds = new Set(props.overflow ? collapsed.value : []);\n const visible = items.map((_, i) => i).filter((i) => !hiddenIds.has(items[i]!.id));\n const hidden = items.map((_, i) => i).filter((i) => hiddenIds.has(items[i]!.id));\n return (\n <div\n ref={root}\n class={['pptx-toolbar', props.overflow ? null : 'pptx-toolbar--wrap']}\n role=\"toolbar\"\n aria-label={props.label}\n data-overflow={props.overflow ? 'menu' : 'wrap'}\n onMousedown={keepFocus}\n onFocusin={roving.onFocusin}\n onFocusout={roving.onFocusout}\n onKeydown={roving.onKeydown}\n >\n {visible.map((index, i) => (\n <Fragment key={items[index]!.id}>\n {i > 0 ? sep() : null}\n {group(items[index]!, index, false)}\n </Fragment>\n ))}\n {props.extras.length ? (\n <>\n {visible.length ? sep() : null}\n <div ref={fixed} class=\"pptx-toolbar__group pptx-toolbar__fixed\" data-fixed=\"\">\n {props.extras}\n </div>\n </>\n ) : null}\n {hidden.length ? (\n <>\n {visible.length || props.extras.length ? sep() : null}\n <button\n ref={more}\n type=\"button\"\n class=\"pptx-toolbar__button\"\n aria-label={t('toolbar.more')}\n data-pptx-tooltip={t('toolbar.more')}\n aria-haspopup=\"dialog\"\n aria-expanded={open.value}\n data-active={open.value ? '' : undefined}\n aria-controls={open.value ? panelId : undefined}\n onMousedown={keepFocus}\n onClick={() => (open.value = !open.value)}\n onKeydown={(event: KeyboardEvent) => {\n // As DOCX Editor's More button: ArrowDown opens the panel at its first control.\n if (event.key !== 'ArrowDown') return;\n event.preventDefault();\n open.value = true;\n }}\n >\n <Icon name=\"more_vert\" />\n </button>\n {open.value ? (\n <Popover\n id={panelId}\n anchor={more.value}\n align=\"end\"\n role=\"dialog\"\n focusFirst\n onClose={() => (open.value = false)}\n >\n {{\n default: () => (\n <div class=\"pptx-toolbar__overflow\" onMousedown={keepFocus}>\n {hidden.map((i) => group(items[i]!, i, true))}\n </div>\n ),\n }}\n </Popover>\n ) : null}\n </>\n ) : null}\n </div>\n );\n };\n },\n});\n","// Roving focus for a toolbar element: one Tab stop and arrow keys (`toolbar-focus.ts` in\n// core), the Vue twin of React's `useRovingToolbar` (`toolbar-measure.ts`). The room and\n// separator measures live in core (`toolbarRoom`, `separatorCost`), shared by both adapters.\n\nimport { onBeforeUnmount, onMounted, onUpdated, type Ref } from 'vue';\nimport {\n syncToolbarTabStop,\n toolbarArrowKey,\n toolbarFocusTracker,\n} from '@pptx-editor.dev/core/editor';\n\n/** What `useRovingToolbar` returns: the handlers for the bar element. @internal */\nexport interface UseRovingToolbarReturn {\n readonly onFocusin: (event: FocusEvent) => void;\n readonly onFocusout: (event: FocusEvent) => void;\n readonly onKeydown: (event: KeyboardEvent) => void;\n}\n\n/**\n * One Tab stop and arrow keys for the bar in `root`: the control that last had focus keeps the\n * Tab stop, and the arrows move between the controls, disabled ones too. A control re-renders\n * on its own (it turns on or off) and host content changes without a bar render, so the bar's\n * subtree is watched as well as its own renders. When the focused control leaves the bar with\n * its group (the selection changed), the focus stays in the bar (`toolbarFocusTracker`). @internal\n */\nexport function useRovingToolbar(root: Readonly<Ref<HTMLElement | null>>): UseRovingToolbarReturn {\n const tracker = toolbarFocusTracker();\n const sync = (): void => {\n const el = root.value;\n if (!el) return;\n syncToolbarTabStop(el, el.ownerDocument.activeElement);\n tracker.restore(el);\n };\n let observer: MutationObserver | null = null;\n onMounted(() => {\n sync();\n if (root.value && typeof MutationObserver === 'function') {\n observer = new MutationObserver(sync);\n observer.observe(root.value, {\n childList: true,\n subtree: true,\n attributes: true,\n attributeFilter: ['aria-disabled', 'hidden'],\n });\n }\n });\n onUpdated(sync);\n onBeforeUnmount(() => observer?.disconnect());\n return {\n onFocusin: (event) => {\n if (!root.value) return;\n tracker.focus(root.value, event.target);\n syncToolbarTabStop(root.value, event.target as Element);\n },\n onFocusout: (event) => {\n if (root.value) tracker.blur(root.value, event.target, event.relatedTarget);\n },\n onKeydown: (event) => {\n const el = root.value;\n if (!el) return;\n const rtl = getComputedStyle(el).direction === 'rtl';\n if (toolbarArrowKey(el, event, rtl)) event.preventDefault();\n },\n };\n}\n","// Drag to reorder in a slide list: the Vue twin of the React adapter's `slide-drag.ts`. The\n// slide rail reads as a column (`y`), the slide sorter as a grid read in rows (`x`). Dragging a\n// selected slide moves the whole selection; another slide moves alone. The drop is one\n// `moveSlides` command, so it is one undo step; the rules live in core (`pane-support.ts`).\n\nimport { shallowRef, toValue, type MaybeRefOrGetter } from 'vue';\nimport {\n dragOverSlide,\n dropSlideDrag,\n slideDropMarker,\n startSlideDrag,\n type SlideDrag,\n} from '@pptx-editor.dev/core/editor';\nimport type { SlideSection } from '@pptx-editor.dev/core/contracts';\nimport { usePptxEditor } from './composables.ts';\n\n/** The attributes and handlers of one slide item. @internal */\nexport interface SlideDragItemProps {\n readonly 'data-drop': 'before' | 'after' | undefined;\n readonly draggable: boolean;\n readonly onDragstart: (e: DragEvent) => void;\n readonly onDragover: (e: DragEvent) => void;\n readonly onDragend: () => void;\n readonly onDrop: (e: DragEvent) => void;\n}\n\n/** What `useSlideDrag` returns. @internal */\nexport interface UseSlideDragReturn {\n /** The drag attributes and handlers of slide `index`. */\n readonly itemProps: (index: number) => SlideDragItemProps;\n /** Drop a drag in progress. */\n readonly cancel: () => void;\n}\n\n/**\n * The drag handlers and drop marker of each slide item of a list, as React's `useSlideDrag`.\n * `grouped` is the list's sections (`groupSlideSections`), or null when it is flat. @internal\n */\nexport function useSlideDrag(\n axis: MaybeRefOrGetter<'x' | 'y'>,\n selected: MaybeRefOrGetter<readonly number[]>,\n readOnly: MaybeRefOrGetter<boolean>,\n grouped: MaybeRefOrGetter<readonly SlideSection[] | null> = null\n): UseSlideDragReturn {\n const editor = usePptxEditor();\n const drag = shallowRef<SlideDrag | null>(null);\n const itemProps = (index: number): SlideDragItemProps => ({\n 'data-drop': slideDropMarker(drag.value, index),\n draggable: !toValue(readOnly),\n onDragstart: (e) => {\n if (e.dataTransfer) e.dataTransfer.effectAllowed = 'move';\n drag.value = startSlideDrag(editor.value, toValue(selected), index);\n },\n onDragover: (e) => {\n if (!drag.value) return;\n e.preventDefault();\n const box = (e.currentTarget as HTMLElement).getBoundingClientRect();\n drag.value = dragOverSlide(drag.value, index, toValue(axis), box, e);\n },\n onDragend: () => {\n drag.value = null;\n },\n onDrop: (e) => {\n e.preventDefault();\n if (!drag.value || !editor.value) return;\n dropSlideDrag(editor.value, drag.value, toValue(grouped));\n drag.value = null;\n },\n });\n return {\n itemProps,\n cancel: () => {\n drag.value = null;\n },\n };\n}\n","/** @jsxImportSource vue */\n// Sections in the slide rail and the slide sorter (`p14:sectionLst`): the Vue twin of the React\n// adapter's `RailSections.tsx`, with the same markup, classes, ARIA, and keys. A header per\n// section collapses its slides (the arrow), selects them (a click on the name), renames in\n// place (double-click, F2, or the menu), and opens the section menu. Which sections are\n// collapsed is the engine's view setting (`collapsedSections`): the rail and the sorter share\n// it, and it is never saved. The keys, the focus moves, and the menu rows come from core\n// (`pane-support.ts`), so the two adapters act the same.\n//\n// In the rail and the sorter the sections are a tree (`tree` > `treeitem` > `group` >\n// `treeitem`), so the headers are in the keyboard order.\n\nimport {\n defineComponent,\n getCurrentScope,\n nextTick,\n onMounted,\n onScopeDispose,\n ref,\n shallowRef,\n toValue,\n watch,\n type MaybeRefOrGetter,\n type PropType,\n type Ref,\n type ShallowRef,\n type VNodeChild,\n} from 'vue';\nimport {\n canRenameSectionInPlace,\n focusCurrentSlideIn,\n openSectionOfCurrent,\n refocusAfterCollapse,\n registerSectionRenamer,\n registerSlideSorter,\n requestSectionRenameIn,\n sectionHeaderKeyDown,\n sectionMenuPoint,\n selectSectionByName,\n subscribeSectionRenamers,\n toggleSlideSection,\n type PptxEditorInstance,\n type SlideSection,\n} from '@pptx-editor.dev/core/editor';\nimport { Icon, keepFocus } from './chrome.tsx';\nimport { useEditorState, usePptxEditor, useTranslation } from './composables.ts';\nimport { usePopupEntry } from './popups.ts';\nimport {\n SectionContextMenu,\n type SectionContextMenuProps,\n type SectionMenuState,\n} from './RailContextMenu.tsx';\nimport type { ContextMenuPoint } from './ContextMenu.tsx';\n\nconst EMPTY: readonly SlideSection[] = [];\nconst NO_IDS: readonly string[] = [];\n\n/** The deck's sections, reference-stable while they do not change. @internal */\nexport function useSlideSections(): Readonly<ShallowRef<readonly SlideSection[]>> {\n return useEditorState((s) => s.sections ?? EMPTY);\n}\n\n/** The collapsed section ids, reference-stable while they do not change. @internal */\nexport function useCollapsedSections(): Readonly<ShallowRef<readonly string[]>> {\n return useEditorState((s) => s.collapsedSections ?? NO_IDS);\n}\n\n/**\n * When the current slide changes, its section opens, so the current slide is in view. A\n * section the user collapses stays collapsed until then, and a click on the name of a\n * collapsed section selects its slides and keeps it collapsed. @internal\n */\nexport function useOpenCurrentSection(\n grouped: MaybeRefOrGetter<readonly SlideSection[] | null>\n): void {\n const editor = usePptxEditor();\n const current = useEditorState((s) => s.currentSlide);\n watch(current, (now, was) => {\n if (now === was || !editor.value) return;\n openSectionOfCurrent(editor.value, toValue(grouped), now);\n });\n}\n\n/**\n * Returns a function that moves focus to the current slide of `list` after the next render:\n * after a section menu row removes sections, the section that had focus is gone only then. A\n * current slide in a collapsed section has no tile, so its section header takes focus.\n * @internal\n */\nexport function useFocusCurrentAfterRender(list: Ref<HTMLElement | null>): () => void {\n return () => void nextTick(() => focusCurrentSlideIn(list.value));\n}\n\n/**\n * After sections collapse (the arrow, Collapse all from a menu or the toolbar), a slide that had\n * focus can be gone: focus moves to the current slide, or to the header of its section when\n * that section is shut. Focus that went elsewhere on purpose stays there. Put the returned\n * handler on the list's `focusin`. @internal\n */\nexport function useFocusAfterCollapse(\n list: Ref<HTMLElement | null>,\n collapsed: Readonly<ShallowRef<readonly string[]>>\n): (e: FocusEvent) => void {\n let focused: HTMLElement | null = null;\n watch(collapsed, () => refocusAfterCollapse(list.value, focused), { flush: 'post' });\n return (e) => {\n focused = e.target as HTMLElement;\n };\n}\n\n/** Count a mounted slide sorter of the editor, for the Slide Sorter view's warning. @internal */\nexport function useSorterRegistration(): void {\n const editor = usePptxEditor();\n watch(\n editor,\n (next, _old, onCleanup) => {\n if (next) onCleanup(registerSlideSorter(next));\n },\n { immediate: true }\n );\n}\n\n/**\n * Ask the slide rail or the slide sorter of `editor` to start renaming section `sectionId` in\n * place, as Home > Section > Rename Section does: what the `section.rename` slot runs. Use it\n * when you build your own section chrome. When neither is mounted, nothing opens and a\n * development warning says so. The twin of React's `requestSectionRename`. @public\n */\nexport function requestSectionRename(editor: PptxEditorInstance | null, sectionId: string): void {\n requestSectionRenameIn(editor, sectionId);\n}\n\n/**\n * Start renaming when `requestSectionRename` asks for this editor, while `enabled`: a closed\n * rail has no header to rename in, so it does not count. A flat rail or sorter counts: the\n * section that Add Section creates renders its header right after the request. @internal\n */\nexport function useSectionRenameRequests(\n onRequest: (sectionId: string) => void,\n enabled: MaybeRefOrGetter<boolean> = true\n): void {\n const editor = usePptxEditor();\n watch(\n () => [editor.value, toValue(enabled)] as const,\n ([next, on], _old, onCleanup) => {\n if (next && on) onCleanup(registerSectionRenamer(next, onRequest));\n },\n { immediate: true }\n );\n}\n\n/** Whether a mounted rail or sorter of this editor renames a section in place. @internal */\nexport function useSectionRenameAvailable(): Readonly<Ref<boolean>> {\n const editor = usePptxEditor();\n const available = ref(canRenameSectionInPlace(editor.value));\n const read = (): void => {\n available.value = canRenameSectionInPlace(editor.value);\n };\n if (!getCurrentScope()) return available;\n watch(editor, read);\n onScopeDispose(subscribeSectionRenamers(read));\n return available;\n}\n\n/** A section's header row: the arrow, the name (or its rename field), and the slide count. */\nconst SectionHead = defineComponent({\n name: 'PptxSectionHead',\n props: {\n section: { type: Object as PropType<SlideSection>, required: true },\n collapsed: { type: Boolean, required: true },\n renaming: { type: Boolean, required: true },\n label: { type: String, required: true },\n onToggle: { type: Function as PropType<() => void>, required: true },\n onSelect: { type: Function as PropType<() => void>, required: true },\n onRename: { type: Function as PropType<() => void>, required: true },\n /** `keyboard`: Enter or Escape ended the rename, not a blur. */\n onRenameEnd: { type: Function as PropType<(keyboard: boolean) => void>, required: true },\n onMenu: {\n type: Function as PropType<(owner: HTMLElement, at: ContextMenuPoint | null) => void>,\n required: true,\n },\n },\n setup(props) {\n const editor = usePptxEditor();\n const { t } = useTranslation();\n const name = ref(props.section.name);\n const field = ref<HTMLInputElement | null>(null);\n // Escape cancels: the field's blur that follows must not write the name.\n let cancelled = false;\n const start = (): void => {\n cancelled = false;\n // The name when the rename starts; a rename from another replica does not reset the field.\n name.value = props.section.name;\n // The field selects its whole name once it shows that name: a rename that Escape\n // cancelled leaves the typed text in the field until the next render.\n void nextTick(() => {\n field.value?.focus();\n field.value?.select();\n });\n };\n onMounted(() => {\n if (props.renaming) start();\n });\n watch(\n () => props.renaming,\n (on) => {\n if (on) start();\n },\n { flush: 'post' }\n );\n const commitName = (keyboard: boolean): void => {\n if (cancelled) return;\n cancelled = true;\n const next = name.value.trim();\n if (next && next !== props.section.name)\n editor.value?.exec({ type: 'renameSection', sectionId: props.section.id, name: next });\n props.onRenameEnd(keyboard);\n };\n const onFieldKey = (e: KeyboardEvent): void => {\n if (e.key === 'Enter') commitName(true);\n else if (e.key === 'Escape') {\n cancelled = true;\n props.onRenameEnd(true);\n } else {\n // Editing keys stay in the field: they never act on the rail.\n e.stopPropagation();\n return;\n }\n e.preventDefault();\n e.stopPropagation();\n };\n return () => (\n <div\n class=\"pptx-rail__section-head\"\n data-collapsed={props.collapsed ? '' : undefined}\n // No tooltip while renaming: it would cover the slides under the field.\n data-pptx-tooltip={props.renaming ? undefined : props.label}\n onContextmenu={(e: MouseEvent) => {\n e.preventDefault();\n e.stopPropagation();\n props.onMenu(e.currentTarget as HTMLElement, { x: e.clientX, y: e.clientY });\n }}\n >\n <span\n class=\"pptx-rail__section-toggle\"\n aria-hidden=\"true\"\n onMousedown={keepFocus}\n onClick={(e: MouseEvent) => {\n e.stopPropagation();\n props.onToggle();\n }}\n >\n <Icon name={props.collapsed ? 'chevron_right' : 'expand_more'} />\n </span>\n {props.renaming ? (\n <input\n ref={field}\n class=\"pptx-rail__section-name-field\"\n aria-label={t('sections.nameLabel')}\n value={name.value}\n maxlength={255}\n onInput={(e: Event) => {\n name.value = (e.target as HTMLInputElement).value;\n }}\n onBlur={() => commitName(false)}\n onKeydown={onFieldKey}\n />\n ) : (\n <span\n class=\"pptx-rail__section-name\"\n onMousedown={keepFocus}\n onClick={() => props.onSelect()}\n onDblclick={() => props.onRename()}\n >\n {props.section.name}\n </span>\n )}\n <span class=\"pptx-rail__section-count\" aria-hidden=\"true\">\n {props.section.slideCount}\n </span>\n </div>\n );\n },\n});\n\n/**\n * One section: its header and its slides, a `treeitem` that takes focus and the section keys\n * (Right and Left expand and collapse, Enter selects its slides, F2 renames, Shift+F10 opens\n * the menu). Up and Down go to the rail or the sorter. The default slot is its slides.\n * @internal\n */\nexport const SectionNode = defineComponent({\n name: 'PptxSectionNode',\n props: {\n section: { type: Object as PropType<SlideSection>, required: true },\n collapsed: { type: Boolean, required: true },\n renaming: { type: Boolean, required: true },\n /** The slide rail (a list of thumbnails) or the slide sorter (a grid of tiles). */\n variant: { type: String as PropType<'rail' | 'sorter'>, required: true },\n focusable: { type: Boolean, required: true },\n onRename: { type: Function as PropType<() => void>, required: true },\n onRenameEnd: { type: Function as PropType<() => void>, required: true },\n /** A menu row removed sections: the rail or the sorter moves focus after its render. */\n onRemoved: { type: Function as PropType<() => void>, required: true },\n },\n setup(props, { slots }) {\n const editor = usePptxEditor();\n const { t } = useTranslation();\n const readOnly = useEditorState((s) => s.mode === 'view');\n const menu = shallowRef<SectionMenuState | null>(null);\n const node = ref<HTMLLIElement | null>(null);\n const menuEntry = usePopupEntry('sectionContextMenu');\n // Move up and Move down reorder the headers: the browser drops focus from a moved element,\n // so the header that had it takes it back after the move.\n let hadFocus = false;\n watch(\n () => props.section.firstSlide,\n () => {\n const el = node.value;\n const active = el?.ownerDocument.activeElement;\n if (hadFocus && el?.isConnected && (!active || active === el.ownerDocument.body))\n el.focus({ preventScroll: true });\n },\n { flush: 'post' }\n );\n const toggle = (): void =>\n toggleSlideSection(editor.value, props.section, props.collapsed, node.value);\n const openMenu = (owner: HTMLElement, at: ContextMenuPoint | null): void => {\n menu.value = { at: at ?? sectionMenuPoint(owner), keyboard: !at, owner };\n };\n const onKeydown = (e: KeyboardEvent): void => {\n if (!node.value) return;\n sectionHeaderKeyDown(e, node.value, {\n editor: editor.value,\n readOnly: readOnly.value,\n section: props.section,\n collapsed: props.collapsed,\n toggle,\n rename: () => props.onRename(),\n openMenu: (owner) => openMenu(owner, null),\n });\n };\n const menuPart = (): VNodeChild => {\n const entry = menuEntry();\n if (!menu.value || entry === false) return null;\n const menuProps: SectionContextMenuProps = {\n section: props.section,\n menu: menu.value,\n onClose: () => {\n menu.value = null;\n },\n onRename: () => props.onRename(),\n onRemoved: () => props.onRemoved(),\n };\n return typeof entry === 'function' ? entry(menuProps) : <SectionContextMenu {...menuProps} />;\n };\n return () => {\n const { section, collapsed } = props;\n const label = t(section.slideCount === 1 ? 'sections.headerOne' : 'sections.header', {\n name: section.name,\n count: section.slideCount,\n });\n const sorter = props.variant === 'sorter';\n return (\n <li\n ref={node}\n onFocus={() => {\n hadFocus = true;\n }}\n onBlur={(e: FocusEvent) => {\n // Focus that leaves is gone on purpose: to another element, to nothing (a click on\n // an empty part of the page), or out of the window. Two blurs keep it: one into the\n // section's menu, which gives focus back after its row runs, and one of a\n // disconnected element, which is the move of this header.\n // Vue moves a keyed header while it is still connected, and the browser blurs it\n // then: the blur counts only when focus is still away after the render that\n // moved it.\n const to = e.relatedTarget as HTMLElement | null;\n if (to?.closest?.('[role=\"menu\"]')) return;\n setTimeout(() => {\n const el = node.value;\n if (el?.isConnected && el.ownerDocument.activeElement !== el) hadFocus = false;\n }, 0);\n }}\n role=\"treeitem\"\n aria-expanded={!collapsed}\n aria-label={label}\n tabindex={props.focusable ? 0 : -1}\n class={sorter ? 'pptx-sorter__section' : 'pptx-rail__section'}\n data-section={section.id}\n onKeydown={onKeydown}\n onContextmenu={(e: MouseEvent) => {\n if (e.target !== e.currentTarget) return;\n e.preventDefault();\n openMenu(e.currentTarget as HTMLElement, null);\n }}\n >\n <SectionHead\n section={section}\n collapsed={collapsed}\n renaming={props.renaming}\n label={label}\n onToggle={toggle}\n // Focus goes to the current slide of the selection, so Delete, Ctrl+D, and the\n // other slide keys act on the slides that the click selected. A shut section keeps\n // focus.\n onSelect={() => selectSectionByName(editor.value, section, collapsed, node.value)}\n onRename={() => {\n if (!readOnly.value) props.onRename();\n }}\n onRenameEnd={(keyboard: boolean) => {\n props.onRenameEnd();\n // After Enter or Escape, focus goes back to the section. A blur keeps the focus\n // where the user put it.\n if (keyboard) node.value?.focus({ preventScroll: true });\n }}\n onMenu={openMenu}\n />\n {collapsed ? null : (\n <ol role=\"group\" class={sorter ? 'pptx-sorter__grid' : 'pptx-rail__section-list'}>\n {slots.default?.()}\n </ol>\n )}\n {menuPart()}\n </li>\n );\n };\n },\n});\n","/** @jsxImportSource vue */\n// The side panel (Format and Comments): the Vue twin of `SidePanel` in the React adapter's\n// `panes.tsx`, with the same markup, classes, and ARIA. The Format tab writes the selected\n// element's position, size, rotation, and text fitting through engine commands.\n\nimport {\n defineComponent,\n ref,\n type CSSProperties,\n type ExtractPublicPropTypes,\n type PropType,\n type StyleValue,\n} from 'vue';\nimport {\n elementKindLabelKey,\n platformShortcuts,\n radioGroupStep,\n} from '@pptx-editor.dev/core/editor';\nimport type { TranslationKey } from '@pptx-editor.dev/i18n';\nimport { ToolButton, keepFocus } from './chrome.tsx';\nimport { useEditorDialog } from './popups.ts';\nimport { useEditorState, usePptxEditor, useTranslation } from './composables.ts';\n\n/** The side panel's tabs, in order. */\nconst PANEL_TABS = ['format', 'comments'] as const;\n\nconst EMU_PER_INCH = 914_400;\nconst inches = (emu: number): string => (emu / EMU_PER_INCH).toFixed(2);\n\n/** A number field that commits on Enter or blur and shows the document value otherwise. */\nconst PanelNumberField = defineComponent({\n name: 'PptxPanelNumberField',\n props: {\n label: { type: String, required: true },\n value: { type: String, required: true },\n unit: { type: String, required: true },\n disabled: { type: Boolean, required: true },\n onCommit: { type: Function as PropType<(value: number) => void>, required: true },\n },\n setup(props) {\n const draft = ref<string | null>(null);\n const commit = (): void => {\n // An empty field keeps the value: `Number('')` is 0, which would move the shape.\n const d = draft.value;\n const n = d === null || d.trim() === '' ? NaN : Number(d.replace(',', '.'));\n if (Number.isFinite(n) && draft.value !== props.value) props.onCommit(n);\n draft.value = null;\n };\n return () => (\n <label class=\"pptx-field\">\n {props.label}\n <span class=\"pptx-field__control\">\n <input\n inputmode=\"decimal\"\n aria-label={props.label}\n value={draft.value ?? props.value}\n disabled={props.disabled}\n onInput={(e: Event) => {\n draft.value = (e.target as HTMLInputElement).value;\n }}\n onBlur={commit}\n onKeydown={(e: KeyboardEvent) => {\n if (e.key === 'Enter') (e.currentTarget as HTMLInputElement).blur();\n if (e.key === 'Escape') draft.value = null;\n }}\n />\n <span class=\"pptx-field__unit\">{props.unit}</span>\n </span>\n </label>\n );\n },\n});\n\n/** Position, size, rotation, and text fitting of the selected element. */\nconst FormatTab = defineComponent({\n name: 'PptxFormatTab',\n setup() {\n const { t } = useTranslation();\n const editor = usePptxEditor();\n const geometry = useEditorState((s) => s.geometry);\n const table = useEditorState((s) => s.table);\n const readOnly = useEditorState((s) => s.mode === 'view');\n const selected = useEditorState((s) =>\n s.selection.kind === 'shapes' ? s.selection.nodeIds.length : 0\n );\n const background = useEditorDialog('background');\n return () => {\n const g = geometry.value;\n if (!g)\n return selected.value > 1 ? (\n <div class=\"pptx-empty\">\n <p class=\"pptx-empty__title\">\n {t('panel.format.multipleTitle', { count: selected.value })}\n </p>\n <p class=\"pptx-empty__body\">{platformShortcuts(t('panel.format.multipleBody'))}</p>\n </div>\n ) : (\n [\n <div class=\"pptx-panel__section\">\n <h3 class=\"pptx-panel__title\">{t('panel.format.slide')}</h3>\n {background.isAvailable.value ? (\n <button\n type=\"button\"\n class=\"pptx-button\"\n disabled={readOnly.value}\n onClick={(e: MouseEvent) => background.open(e.currentTarget as HTMLElement)}\n >\n {t('menu.background')}\n </button>\n ) : null}\n </div>,\n <div class=\"pptx-empty\">\n <p class=\"pptx-empty__title\">{t('panel.format.emptyTitle')}</p>\n <p class=\"pptx-empty__body\">{t('panel.format.emptyBody')}</p>\n </div>,\n ]\n );\n const move = (patch: Partial<Record<'x' | 'y' | 'cx' | 'cy' | 'rot', number>>): void => {\n editor.value?.exec({\n type: 'setTransform',\n nodeId: g.nodeId,\n x: patch.x ?? g.x,\n y: patch.y ?? g.y,\n cx: Math.max(0, patch.cx ?? g.cx),\n cy: Math.max(0, patch.cy ?? g.cy),\n rot: patch.rot ?? g.rot,\n });\n };\n const inch = (v: number): number => Math.round(v * EMU_PER_INCH);\n const unit = t('panel.format.inchUnit');\n const field = (key: 'x' | 'y' | 'cx' | 'cy', labelKey: TranslationKey) => (\n <PanelNumberField\n label={t(labelKey)}\n value={inches(g[key])}\n unit={unit}\n disabled={readOnly.value}\n onCommit={(v: number) => move({ [key]: inch(v) })}\n />\n );\n return [\n <div class=\"pptx-panel__section\">\n <h3 class=\"pptx-panel__title\">{t('panel.format.element')}</h3>\n <span class=\"pptx-chip\">{t(elementKindLabelKey(g, table.value))}</span>\n </div>,\n <div class=\"pptx-panel__section\">\n <h3 class=\"pptx-panel__title\">{t('panel.format.size')}</h3>\n <div class=\"pptx-panel__grid\">\n {field('cx', 'panel.format.width')}\n {field('cy', 'panel.format.height')}\n </div>\n </div>,\n <div class=\"pptx-panel__section\">\n <h3 class=\"pptx-panel__title\">{t('panel.format.position')}</h3>\n <div class=\"pptx-panel__grid\">\n {field('x', 'panel.format.x')}\n {field('y', 'panel.format.y')}\n </div>\n </div>,\n <div class=\"pptx-panel__section\">\n <h3 class=\"pptx-panel__title\">{t('panel.format.rotation')}</h3>\n <div class=\"pptx-panel__grid\">\n <PanelNumberField\n label={t('panel.format.angle')}\n value={String(Math.round(g.rot * 10) / 10)}\n unit=\"°\"\n disabled={readOnly.value}\n onCommit={(v: number) => move({ rot: ((v % 360) + 360) % 360 })}\n />\n </div>\n </div>,\n g.textFitting ? (\n <div class=\"pptx-panel__section\">\n <h3 class=\"pptx-panel__title\">{t('panel.format.textFitting')}</h3>\n <div class=\"pptx-radios\" role=\"radiogroup\" aria-label={t('panel.format.textFitting')}>\n {(['none', 'shrink', 'shape'] as const).map((mode) => (\n <label key={mode} class=\"pptx-radio\">\n <input\n type=\"radio\"\n name=\"pptx-text-fitting\"\n checked={g.textFitting === mode}\n disabled={readOnly.value}\n onChange={() => editor.value?.exec({ type: 'setAutofit', mode })}\n />\n {t(`panel.format.fitting.${mode}`)}\n </label>\n ))}\n </div>\n </div>\n ) : null,\n ];\n };\n },\n});\n\nconst sidePanelProps = {\n /** The panel's width in CSS pixels. */\n paneWidth: { type: Number, default: undefined },\n /** Closes the panel. When given, the panel shows a close button, as React's `onClose`. */\n onClose: { type: Function as PropType<() => void>, default: undefined },\n /** A class name added to the panel, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n /** Inline styles for the panel, as React's `style`; a `width` here wins over `paneWidth`. */\n style: { type: Object as PropType<CSSProperties>, default: undefined },\n} as const;\n\n/**\n * Props of `PptxEditorSidePanel`, the twin of React's `SidePanelProps`. `onClose` shows a close\n * button that calls it; `className` (or a host `class`) and `style` go on the panel, and a\n * `width` in `style` wins over `paneWidth`. @public\n */\nexport type SidePanelProps = ExtractPublicPropTypes<typeof sidePanelProps>;\n\n/**\n * The side panel: Format · Comments, the twin of React's `PptxEditor.SidePanel`. The host\n * shows or hides the panel by rendering it. @public\n */\nexport const PptxEditorSidePanel = defineComponent({\n name: 'PptxEditorSidePanel',\n inheritAttrs: false,\n props: sidePanelProps,\n setup(props, { attrs }) {\n const { t } = useTranslation();\n const tab = ref<'format' | 'comments'>('format');\n return () => {\n const { class: hostClass, style: hostStyle, ...rest } = attrs;\n const style = [hostStyle as StyleValue, props.style];\n return (\n <aside\n aria-label={t('panel.ariaLabel')}\n {...rest}\n class={['pptx-panel', hostClass, props.className]}\n style={\n (props.paneWidth === undefined\n ? style\n : [{ width: `${props.paneWidth}px` }, ...style]) as StyleValue\n }\n onMousedown={keepFocus}\n >\n <div class=\"pptx-panel__head\">\n <div\n class=\"pptx-tabs\"\n role=\"tablist\"\n // One Tab stop: the selected tab; the arrow keys move between tabs.\n onKeydown={(e: KeyboardEvent) => {\n const next = radioGroupStep(PANEL_TABS, tab.value, e.key);\n if (!next) return;\n e.preventDefault();\n tab.value = next;\n (e.currentTarget as HTMLElement)\n .querySelector<HTMLElement>(`[data-tab=\"${next}\"]`)\n ?.focus();\n }}\n >\n {PANEL_TABS.map((id) => (\n <button\n key={id}\n type=\"button\"\n role=\"tab\"\n class=\"pptx-tabs__tab\"\n data-tab={id}\n aria-selected={tab.value === id}\n tabindex={tab.value === id ? 0 : -1}\n onClick={() => {\n tab.value = id;\n }}\n >\n {t(`panel.tabs.${id}`)}\n </button>\n ))}\n </div>\n {props.onClose ? (\n <ToolButton label={t('panel.close')} icon=\"close\" onClick={() => props.onClose?.()} />\n ) : null}\n </div>\n <div class=\"pptx-panel__body\" role=\"tabpanel\">\n {tab.value === 'format' ? <FormatTab /> : null}\n {tab.value === 'comments' ? (\n <div class=\"pptx-empty\">\n <p class=\"pptx-empty__title\">{t('panel.comments.emptyTitle')}</p>\n <p class=\"pptx-empty__body\">{t('panel.comments.emptyBody')}</p>\n </div>\n ) : null}\n </div>\n </aside>\n );\n };\n },\n});\n","/** @jsxImportSource vue */\n// The edit notice: the Vue twin of the React adapter's `EditNotice.tsx`. It says why the last\n// edit was refused (a keystroke, a paste, a command), so a refused edit never looks like an\n// editor that stopped responding. After a Delete of shapes or slides it says what went and\n// offers Undo, for ten seconds; a pointer over it or the focus in it holds it. It reads the\n// engine's `lastRejection` and `lastRemoval` and holds no state of its own besides the\n// dismissal and the hold. The messages and the rules for when they show are core's\n// (`overlays.ts`).\n\nimport {\n computed,\n defineComponent,\n onBeforeUnmount,\n onScopeDispose,\n shallowRef,\n watch,\n watchEffect,\n type ExtractPublicPropTypes,\n} from 'vue';\nimport {\n editNoticeShows,\n editNoticeTone,\n editRejectionMessage,\n editRemovalMessage,\n focusSurfaceOf,\n linkPopupShowsRejection,\n REMOVAL_NOTICE_MS,\n removalNoticeShows,\n type EditorRejection,\n} from '@pptx-editor.dev/core/editor';\nimport type { Translate } from '@pptx-editor.dev/i18n';\nimport { ToolButton, keepFocus } from './chrome.tsx';\nimport { useEditorState, usePptxEditor } from './composables.ts';\nimport { chromeTranslateProp, useChromeTranslateScope } from './headless-hooks.ts';\nimport { usePopupEntry } from './popups.ts';\nimport { injectHyperlinkPopupStore } from './useHyperlinkPopup.ts';\n\n/** The message for a refusal: its reason, with the detail where the reason names one. @public */\nexport function rejectionMessage(t: Translate, rejection: EditorRejection): string {\n return editRejectionMessage(t, rejection);\n}\n\nconst pptxEditorEditNoticeProps = {\n ...chromeTranslateProp,\n /** A class name added to the notice, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n} as const;\n\n/** The props of `PptxEditorEditNotice`, the same name as React's `EditNoticeProps`. @public */\nexport type EditNoticeProps = ExtractPublicPropTypes<typeof pptxEditorEditNoticeProps>;\n\n/**\n * Why the last edit was refused, or what the last Delete removed with an Undo action; the twin\n * of React's `PptxEditor.EditNotice`. Renders nothing while edits apply, and nothing for a\n * command that had nothing to do (`EditorRejection.noop`). A host `class` goes on the notice.\n * @public\n */\nexport const PptxEditorEditNotice = defineComponent({\n name: 'PptxEditorEditNotice',\n inheritAttrs: false,\n props: pptxEditorEditNoticeProps,\n setup(props, { attrs }) {\n const editorRef = usePptxEditor();\n const { t } = useChromeTranslateScope(() => props.t);\n const rejection = useEditorState((s) => s.lastRejection ?? null);\n const removal = useEditorState((s) => s.lastRemoval ?? null);\n const dismissed = shallowRef<EditorRejection | null>(null);\n // A refused link shows its reason in the open link popup: the notice does not repeat it,\n // and stays closed when the popup closes. As React's `EditNotice`.\n const linkStore = injectHyperlinkPopupStore();\n const linkPopup = shallowRef(linkStore?.getState() ?? null);\n if (linkStore)\n onScopeDispose(\n linkStore.subscribe(() => {\n linkPopup.value = linkStore.getState();\n })\n );\n const linkEntry = usePopupEntry('hyperlink');\n const covered = computed(\n () => linkEntry() !== false && linkPopupShowsRejection(linkPopup.value, rejection.value)\n );\n watch(\n covered,\n (now) => {\n if (now) dismissed.value = rejection.value;\n },\n { immediate: true }\n );\n // The serial of the removal the user closed or that timed out.\n const closed = shallowRef<number | null>(null);\n const held = shallowRef(false);\n // A click on Undo or Dismiss removes the notice under the pointer, and no mouseleave or\n // focusout follows: each new removal starts unheld.\n watch(\n () => removal.value?.serial,\n () => {\n held.value = false;\n }\n );\n let timer: ReturnType<typeof setTimeout> | undefined;\n watchEffect((onCleanup) => {\n const current = removal.value;\n if (!removalNoticeShows(current, closed.value) || held.value) return;\n const serial = current.serial;\n timer = setTimeout(() => {\n closed.value = serial;\n }, REMOVAL_NOTICE_MS);\n onCleanup(() => clearTimeout(timer));\n });\n onBeforeUnmount(() => clearTimeout(timer));\n return () => {\n const classes = ['pptx-edit-notice', attrs.class, props.className];\n const refused = rejection.value;\n if (!covered.value && editNoticeShows(refused, dismissed.value))\n return (\n <div\n {...attrs}\n class={classes}\n // A state the edit cannot run in (view mode) is information, not an error.\n data-tone={editNoticeTone(refused)}\n role=\"status\"\n onMousedown={keepFocus}\n >\n <span class=\"pptx-edit-notice__text\">{rejectionMessage(t, refused)}</span>\n <ToolButton\n label={t('notice.dismiss')}\n icon=\"close\"\n onClick={() => {\n dismissed.value = refused;\n }}\n />\n </div>\n );\n const removed = removal.value;\n if (!removalNoticeShows(removed, closed.value)) return null;\n return (\n <div\n {...attrs}\n class={classes}\n data-tone=\"info\"\n role=\"status\"\n onMousedown={keepFocus}\n onMouseenter={() => (held.value = true)}\n onMouseleave={() => (held.value = false)}\n onFocusin={() => (held.value = true)}\n onFocusout={() => (held.value = false)}\n >\n <span class=\"pptx-edit-notice__text\">{editRemovalMessage(t, removed)}</span>\n <button\n type=\"button\"\n class=\"pptx-edit-notice__action\"\n onClick={() => {\n const editor = editorRef.value;\n if (!editor) return;\n editor.exec({ type: 'undo' });\n // The button goes with the notice; the focus goes back to the slide.\n focusSurfaceOf(editor);\n }}\n >\n {t('notice.undo')}\n </button>\n <ToolButton\n label={t('notice.dismiss')}\n icon=\"close\"\n onClick={() => {\n closed.value = removed.serial;\n if (editorRef.value) focusSurfaceOf(editorRef.value);\n }}\n />\n </div>\n );\n };\n },\n});\n","/** @jsxImportSource vue */\n// The chrome tooltip bubble: the Vue twin of the React adapter's `ChromeTooltip.tsx`, after DOCX\n// Editor's `Tooltip`. The editor root mounts one; it shows the `data-pptx-tooltip` label of the\n// control under the pointer, or of the control a keyboard user moved to, after core's delay, with\n// a disabled control's reason on its own line. Core's `chrome-tooltip.ts` owns the timing and the\n// position.\n\nimport { Teleport, defineComponent, onMounted, onUnmounted, ref, shallowRef, watch } from 'vue';\nimport {\n listenChromeTooltips,\n positionChromeTooltip,\n type ChromeTooltipState,\n} from '@pptx-editor.dev/core/editor';\n\n/** The tooltip bubble for every chrome control on the page. @internal */\nexport const ChromeTooltip = defineComponent({\n name: 'ChromeTooltip',\n setup() {\n const state = shallowRef<ChromeTooltipState | null>(null);\n const bubble = ref<HTMLElement | null>(null);\n let stop: (() => void) | null = null;\n onMounted(() => {\n stop = listenChromeTooltips(document, (next) => (state.value = next));\n });\n onUnmounted(() => stop?.());\n // After the DOM update and before paint: the bubble measures itself, then core places it.\n watch(\n [state, bubble],\n ([next, el]) => {\n if (next && el) positionChromeTooltip(el, next.target);\n },\n { flush: 'post' }\n );\n return () => {\n const s = state.value;\n if (!s) return null;\n return (\n <Teleport to={s.scope}>\n {/* Visual only: the control's `aria-label` and `aria-describedby` carry the same text. */}\n <div ref={bubble} class=\"pptx-tooltip\" role=\"tooltip\" aria-hidden=\"true\">\n <span class=\"pptx-tooltip__label\">{s.label}</span>\n {s.reason ? <span class=\"pptx-tooltip__reason\">{s.reason}</span> : null}\n </div>\n </Teleport>\n );\n };\n },\n});\n","// The loading screen: the Vue twin of the React adapter's `PptxEditor.Loading`, after DOCX\n// Editor's `DocxEditor.Loading`, with the same markup and classes, so the one core stylesheet\n// styles both. It reads the same snapshot as every other part (`showsLoading` in core) and\n// renders nothing once the deck is ready.\n//\n// It carries `pptx-editor` itself, as `PptxEditorViewport` does, so the `--doc-*` tokens\n// resolve wherever it is composed.\n\nimport {\n defineComponent,\n h,\n type CSSProperties,\n type ExtractPublicPropTypes,\n type PropType,\n} from 'vue';\nimport { loadingSheetSize, sameLoadingSheetSize, showsLoading } from '@pptx-editor.dev/core/editor';\nimport { useEditorState, useTranslation } from './composables.ts';\nimport { useChromeDark } from './color-mode.ts';\n\nconst loadingSpinnerProps = {\n /** A class name added to the spinner, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n} as const;\n\n/** Props of `PptxEditorLoadingSpinner`, the twin of React's `LoadingSpinnerProps`. @public */\nexport type LoadingSpinnerProps = ExtractPublicPropTypes<typeof loadingSpinnerProps>;\n\n/**\n * The packaged spinner on its own, to compose into the default slot. It is decorative\n * (`aria-hidden`), so give the surrounding screen its own text. @public\n */\nexport const PptxEditorLoadingSpinner = defineComponent({\n name: 'PptxEditorLoadingSpinner',\n props: loadingSpinnerProps,\n setup(props) {\n return () =>\n h('span', { class: ['pptx-loading__spinner', props.className], 'aria-hidden': 'true' });\n },\n});\n\nconst loadingProps = {\n /**\n * An extra host condition, OR-ed with the editor's own. Pass it only for work the editor\n * cannot see, such as a host that mounts the root after its own fetch.\n */\n when: { type: Boolean, default: false },\n /**\n * Pin the screen over the nearest positioned ancestor, so it covers the previous deck while\n * the next one opens. A short appearance delay keeps a fast open from flashing it.\n */\n overlay: { type: Boolean, default: false },\n /** A class name added to the loading container, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n /** Inline styles for the loading container, as React's `style`. */\n style: { type: Object as PropType<CSSProperties>, default: undefined },\n} as const;\n\n/** Props of `PptxEditorLoading`, the same name as React's `LoadingProps`. @public */\nexport type LoadingProps = ExtractPublicPropTypes<typeof loadingProps>;\n\nconst LoadingImpl = defineComponent({\n name: 'PptxEditorLoading',\n props: loadingProps,\n setup(props, { slots }) {\n const loading = useEditorState(showsLoading);\n const sheet = useEditorState(loadingSheetSize, sameLoadingSheetSize);\n const dark = useChromeDark();\n const { t } = useTranslation();\n return () => {\n if (!props.when && !loading.value) return null;\n const { width, height } = sheet.value;\n const status = () =>\n slots.indicator?.() ?? [\n h(PptxEditorLoadingSpinner),\n h('span', { class: 'pptx-sr-only' }, t('app.loading')),\n ];\n return h(\n 'div',\n {\n class: [\n 'pptx-editor',\n dark.value ? 'dark' : null,\n 'pptx-loading',\n props.overlay ? 'pptx-loading--overlay' : null,\n props.className,\n ],\n style: props.style,\n role: 'status',\n 'aria-live': 'polite',\n },\n slots.default?.() ??\n h(\n 'div',\n {\n class: 'pptx-loading__sheet',\n style: { width: `${width}px`, aspectRatio: `${width} / ${height}` },\n },\n status()\n )\n );\n };\n },\n});\n\n/**\n * Shows a slide-shaped sheet with a spinner while the editor has no deck, and while a deck\n * opens; renders nothing once the deck is ready. A parse failure clears it. The `indicator`\n * slot replaces only the spinner; the default slot replaces the whole screen. The packaged\n * spinner is on it as `PptxEditorLoading.Spinner`, as React's `Loading.Spinner`.\n *\n * ```vue\n * <PptxEditorLoading overlay>\n * <template #indicator><MySpinner label=\"Opening presentation\" /></template>\n * </PptxEditorLoading>\n * ```\n *\n * @public\n */\nexport const PptxEditorLoading = Object.assign(LoadingImpl, {\n /** The packaged spinner, the same component as `PptxEditorLoadingSpinner`. */\n Spinner: PptxEditorLoadingSpinner,\n});\n","/** @jsxImportSource vue */\n// The speaker notes pane: the Vue twin of the React adapter's `NotesPane.tsx`, with the same\n// markup, classes, ARIA, and keys. A collapsible field for the current slide's notes, with\n// bold, italic, and underline. The field shows the notes formatting while you read and while\n// you type (`NotesField`). The open state is shared with `useNotesPane` through the root.\n\nimport {\n computed,\n defineComponent,\n nextTick,\n onBeforeUnmount,\n ref,\n shallowRef,\n useId,\n watch,\n type CSSProperties,\n type ExtractPublicPropTypes,\n type PropType,\n} from 'vue';\nimport {\n NOTES_FORMAT_BUTTONS,\n NO_NOTES_FORMATS,\n armNotesFormat,\n createNotesFindPainter,\n followNotesArm,\n notesCanFormat,\n notesCommittedRange,\n notesFieldFocused,\n notesFieldParagraphs,\n notesFieldText,\n notesFormatRange,\n notesFormatsAt,\n notesSelection,\n onFindShown,\n sameNotesFormats,\n warnDuplicatePane,\n type NotesFormat,\n type NotesParagraph,\n} from '@pptx-editor.dev/core/editor';\nimport { ToolButton, keepFocus } from './chrome.tsx';\nimport { useEditorState, usePptxEditor, useTranslation } from './composables.ts';\nimport { rejectionMessage } from './EditNotice.tsx';\nimport { setNotesTarget } from './notes-target.ts';\nimport { usePaneState } from './pane-state.ts';\nimport { NotesField, type NotesRestore } from './NotesView.tsx';\n\n/**\n * Uncommitted notes text and the slide it belongs to, with the formats the field shows for it,\n * so the commit stores what the user saw while typing.\n */\ninterface NotesDraft {\n readonly slideId: string;\n readonly text: string;\n readonly paragraphs?: readonly NotesParagraph[];\n}\n\nconst notesPaneProps = {\n /** Whether the pane is open, controlled. Use with the `update:open` event (`v-model:open`). */\n open: { type: Boolean, default: undefined },\n /** Whether the pane is open first, uncontrolled. Default `true`. */\n defaultOpen: { type: Boolean, default: undefined },\n /**\n * Show the pane's bold, italic, and underline buttons. Default true. Ctrl/Cmd+B, I, and U\n * work in the notes field either way.\n */\n showFormatButtons: { type: Boolean, default: true },\n /** A class name added to the pane, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n /** Inline styles for the pane, as React's `style`. */\n style: { type: Object as PropType<CSSProperties>, default: undefined },\n} as const;\n\n/**\n * Props of `PptxEditorNotesPane`, the twin of React's `NotesPaneProps`: the pane props, without\n * a width (the notes take the slide's width), and the format buttons. `className` (or a host\n * `class`) and `style` go on the pane. @public\n */\nexport type NotesPaneProps = ExtractPublicPropTypes<typeof notesPaneProps>;\n\ntype OpenProps = { readonly open: boolean | undefined; readonly defaultOpen: boolean | undefined };\n\n/**\n * The open state of a notes pane: controlled by `open`, else the root's (so host chrome built\n * on `useNotesPane` agrees), else its own. One notes pane owns the root's state; a second one\n * in the same root warns once and keeps its own value.\n */\nfunction useNotesOpen(props: OpenProps, emit: (event: 'update:open', open: boolean) => void) {\n const shared = usePaneState();\n const own = ref(props.defaultOpen ?? true);\n const owner = ref(false);\n const open = computed(() =>\n props.open !== undefined\n ? props.open\n : shared && owner.value\n ? (shared.notesOpen.value ?? props.defaultOpen ?? true)\n : own.value\n );\n const setOpen = (next: boolean): void => {\n if (props.open === undefined) {\n if (shared && owner.value) shared.setNotesOpen(next);\n else own.value = next;\n }\n emit('update:open', next);\n };\n // A toggle from `useNotesPane` goes through this pane, so a controlled pane tells its host.\n const handler = (next: boolean): void => setOpen(next);\n // The request slot decides ownership: the first pane takes it, and a later one warns once and\n // keeps its own state until the owner unmounts.\n const slot = shared?.notesRequest ?? null;\n if (slot?.current && slot.current !== handler) warnDuplicatePane('PptxEditorNotesPane');\n const claim = (): void => {\n if (slot && !slot.current) {\n slot.current = handler;\n owner.value = true;\n }\n };\n claim();\n // Also on each change of the root value: when the owner unmounts, the next change hands its\n // slot to a remaining pane.\n watch(() => shared?.notesOpen.value, claim);\n onBeforeUnmount(() => {\n if (slot?.current === handler) slot.current = null;\n });\n // The root follows the owning pane: its first value, and a controlled value.\n watch(\n [open, owner],\n () => {\n if (!shared || !owner.value) return;\n if (shared.notesOpen.value !== open.value) shared.setNotesOpen(open.value);\n },\n { immediate: true }\n );\n return { open, setOpen };\n}\n\n/**\n * Collapsible speaker notes for the current slide, the twin of React's `PptxEditor.NotesPane`.\n * The text shown is the document's; only the text typed since the field took focus is held\n * here, bound to the slide it was typed on. It is written to that slide (wherever the slide is\n * now) when the field loses focus, when the pointer goes down anywhere else, when the current\n * slide changes, and before a format or an undo. Emits `update:open`. @public\n */\nexport const PptxEditorNotesPane = defineComponent({\n name: 'PptxEditorNotesPane',\n props: notesPaneProps,\n emits: { 'update:open': (_open: boolean) => true },\n setup(props, { emit }) {\n const editor = usePptxEditor();\n const { t } = useTranslation();\n const notes = useEditorState((s) => s.notes);\n const formatted = useEditorState((s) => s.notesFormatted);\n const slideId = useEditorState((s) => s.slides[s.currentSlide]?.id ?? null);\n const readOnly = useEditorState((s) => s.mode === 'view');\n const pane = useNotesOpen(props, emit);\n const notesId = useId();\n const draft = shallowRef<NotesDraft | null>(null);\n const refusal = ref<string | null>(null);\n const formats = shallowRef(NO_NOTES_FORMATS);\n const canFormat = ref(false);\n const field = ref<HTMLDivElement | null>(null);\n let pending: NotesDraft | null = null;\n let bound: string | null = null;\n const restore: NotesRestore = { value: null };\n // An engine without formatted notes still shows the plain text.\n const paragraphs = computed<readonly NotesParagraph[]>(\n () =>\n formatted.value ??\n notes.value.split('\\n').map((text) => ({\n runs: [{ text, bold: false, italic: false, underline: false, strike: false }],\n }))\n );\n\n /**\n * Write the draft to its own slide. A deleted slide takes its notes with it. `leaving` is\n * true when the field loses the focus: its selection is not put back.\n */\n const commit = (leaving = false): void => {\n const d = pending;\n pending = null;\n draft.value = null;\n const ed = editor.value;\n if (!ed || !d) return;\n // The field redraws from the written text, which `setNotes` cleans: while the field still\n // has the focus and holds the draft, its selection goes back at the offsets of the\n // written text. A field without the focus takes no selection back (see `NotesField`).\n const el = field.value;\n const selected =\n el && !leaving && !restore.value && notesFieldFocused(el) ? notesSelection(el) : null;\n if (el && selected) {\n const text = notesFieldText(el);\n if (text === d.text) restore.value = notesCommittedRange(text, selected);\n }\n const index = ed.snapshot().slides.findIndex((s) => s.id === d.slideId);\n if (index < 0) return;\n const r = ed.exec({\n type: 'setNotes',\n index,\n text: d.text,\n ...(d.paragraphs ? { paragraphs: d.paragraphs } : {}),\n });\n refusal.value = r.ok ? null : rejectionMessage(t, r);\n };\n\n // The current slide changed under a draft (New slide, Delete slide, the rail): commit it.\n watch(\n slideId,\n (id) => {\n if (pending && pending.slideId !== id) commit();\n bound = id;\n },\n { immediate: true }\n );\n\n // Commit before a click anywhere else acts, so a rail or toolbar command sees the notes.\n watch(draft, (d, _old, onCleanup) => {\n if (!d) return;\n const doc = field.value?.ownerDocument;\n const onPointerDown = (e: Event): void => {\n if (!field.value?.contains(e.target as Node)) commit();\n };\n doc?.addEventListener('pointerdown', onPointerDown, true);\n onCleanup(() => doc?.removeEventListener('pointerdown', onPointerDown, true));\n });\n\n // Closing, from this pane, the host, or `useNotesPane`, commits the draft first: the field\n // unmounts with no blur event. Unmount commits too.\n watch(\n () => pane.open.value,\n (open) => {\n if (!open) commit();\n },\n { flush: 'post' }\n );\n onBeforeUnmount(() => commit());\n\n /**\n * The B, I, and U buttons show the formats of the selected text. They take a pick only with\n * selected text or a caret in a word, as `applyFormat` needs.\n */\n const readFormats = (): void => {\n const el = field.value;\n // A caret that moved drops the format armed at it.\n if (el) followNotesArm(el);\n // A field without the focus formats nothing: its buttons and the toolbar show no format.\n const range = el && notesFieldFocused(el) ? notesSelection(el) : null;\n const next = el && range ? notesFormatsAt(el, range) : NO_NOTES_FORMATS;\n canFormat.value = !!el && notesCanFormat(notesFieldText(el), range);\n // Every key and pointer move reads the formats: render only when one of them changed.\n if (!sameNotesFormats(formats.value, next)) formats.value = next;\n };\n\n // The notes take the editing focus: no shape stays selected on the slide, and the\n // toolbar's bold, italic, underline, and strikethrough format the notes text.\n let focused = false;\n const leaveSlide = (): void => {\n const ed = editor.value;\n if (ed && ed.snapshot().selection.kind !== 'none') ed.setSelection({ kind: 'none' });\n };\n const active = ref(false);\n const target = () => ({\n formats: formats.value,\n readOnly: readOnly.value,\n canFormat: canFormat.value,\n apply: (f: NotesFormat) => applyFormat(f),\n });\n const onFocus = (): void => {\n focused = true;\n active.value = true;\n leaveSlide();\n if (editor.value) setNotesTarget(editor.value, target());\n };\n const onBlur = (): void => {\n focused = false;\n active.value = false;\n if (editor.value) setNotesTarget(editor.value, null);\n commit(true);\n // Without the focus, B, I, and U have nothing to format.\n canFormat.value = false;\n formats.value = NO_NOTES_FORMATS;\n };\n // While the field has the focus, every selection change (the keyboard, the pointer, a\n // script, the accessibility tree) updates the B, I, and U state. The focus can come back\n // with the same selection and fire no selectionchange, so the formats are read when the\n // field becomes active too.\n watch(\n active,\n (on, _old, onCleanup) => {\n const doc = field.value?.ownerDocument;\n if (!on || !doc) return;\n readFormats();\n doc.addEventListener('selectionchange', readFormats);\n onCleanup(() => doc.removeEventListener('selectionchange', readFormats));\n },\n { flush: 'post' }\n );\n // The find bar's match in the notes: painted while find shows it, and not while the field\n // has the focus or holds a draft. A step inside the notes moves no slide or selection, so\n // find tells the pane when it shows another match. The paint waits for the field to draw.\n const painter = createNotesFindPainter();\n let mounted = true;\n const findCount = ref(0);\n const selectionKind = useEditorState((s) => s.selection.kind);\n const revision = useEditorState((s) => s.revision);\n watch(\n editor,\n (ed, _old, onCleanup) => {\n if (ed)\n onCleanup(\n onFindShown(ed.find, () => {\n findCount.value += 1;\n })\n );\n },\n { immediate: true }\n );\n watch(\n [\n editor,\n () => pane.open.value,\n paragraphs,\n draft,\n active,\n findCount,\n selectionKind,\n revision,\n slideId,\n ],\n () =>\n void nextTick(() => {\n if (!mounted) return;\n painter.paint(\n editor.value,\n pane.open.value ? field.value : null,\n paragraphs.value,\n !!draft.value\n );\n }),\n { flush: 'post', immediate: true }\n );\n onBeforeUnmount(() => {\n mounted = false;\n painter.stop();\n });\n watch([editor, formats, readOnly, canFormat], () => {\n if (editor.value && focused) setNotesTarget(editor.value, target());\n });\n watch(editor, (_next, was) => {\n if (was) setNotesTarget(was, null);\n });\n onBeforeUnmount(() => {\n if (editor.value) setNotesTarget(editor.value, null);\n });\n\n const onDraft = (text: string): void => {\n const id = pending?.slideId ?? bound ?? slideId.value;\n if (!id) return;\n const el = field.value;\n pending = { slideId: id, text, ...(el ? { paragraphs: notesFieldParagraphs(el) } : {}) };\n draft.value = pending;\n };\n\n /**\n * Bold, italic, or underline on the selected notes text, as one undo step. With a caret in\n * a word, the word takes the format; the caret stays where it was. With any other caret,\n * the format is armed: the next typed text takes it, as on the canvas.\n */\n const applyFormat = (format: NotesFormat): boolean => {\n const el = field.value;\n const ed = editor.value;\n if (!ed || readOnly.value || !el) return false;\n const text = notesFieldText(el);\n const selected = notesSelection(el);\n const word = notesFormatRange(text, selected);\n if (!word && armNotesFormat(el, format)) {\n refusal.value = null;\n readFormats();\n return true;\n }\n if (!word) {\n refusal.value = t('disabled.selectNotesText');\n return false;\n }\n // Typed text goes in first (its own undo step). `setNotes` drops characters a slide\n // cannot hold, so the offsets are counted in the text it writes.\n const range = notesCommittedRange(text, word)!;\n const caret = notesCommittedRange(text, selected);\n commit();\n const index = ed.snapshot().slides.findIndex((s) => s.id === slideId.value);\n if (index < 0) return false;\n restore.value = caret;\n const r = ed.exec({ type: 'formatNotes', index, ...range, format });\n if (!r.ok) restore.value = null;\n refusal.value = r.ok ? null : rejectionMessage(t, r);\n return r.ok;\n };\n\n /** Undo and redo in the field act on the deck, after the draft is written. */\n const applyHistory = (kind: 'undo' | 'redo'): void => {\n const el = field.value;\n const ed = editor.value;\n if (!ed || !el) return;\n const range = notesCommittedRange(notesFieldText(el), notesSelection(el));\n commit();\n const before = ed.snapshot().notesFormatted;\n restore.value = range;\n ed.exec({ type: kind });\n // The notes did not change: no redraw takes the selection, so drop it.\n if (ed.snapshot().notesFormatted === before) restore.value = null;\n // An undo can bring back a shape selection; the cursor stays in the notes, so it goes.\n leaveSlide();\n };\n\n return () => {\n const open = pane.open.value;\n const d = draft.value;\n return (\n <section\n class={['pptx-notes', props.className]}\n style={props.style}\n aria-label={t('notes.title')}\n data-open={open ? 'true' : 'false'}\n >\n <div class=\"pptx-notes__head\" onMousedown={keepFocus}>\n <span>{t('notes.title')}</span>\n {open && !readOnly.value && props.showFormatButtons ? (\n <div class=\"pptx-notes__format\" role=\"group\" aria-label={t('notes.format')}>\n {NOTES_FORMAT_BUTTONS.map(([format, icon, key]) => (\n <ToolButton\n key={format}\n label={t(key)}\n icon={icon}\n pressed={formats.value[format]}\n disabled={!canFormat.value}\n disabledReason={t('disabled.selectNotesText')}\n onClick={() => applyFormat(format)}\n />\n ))}\n </div>\n ) : null}\n <ToolButton\n label={open ? t('notes.collapse') : t('notes.expand')}\n icon={open ? 'keyboard_arrow_down' : 'keyboard_arrow_up'}\n expanded={open}\n controls={open ? notesId : undefined}\n onClick={() => {\n commit();\n pane.setOpen(!open);\n }}\n />\n </div>\n {open ? (\n <NotesField\n id={notesId}\n paragraphs={paragraphs.value}\n drafting={!!d && d.slideId === slideId.value}\n label={t('notes.title')}\n placeholder={t('notes.placeholder')}\n readOnly={readOnly.value}\n field={field}\n restore={restore}\n onDraft={onDraft}\n onCommit={onBlur}\n onFormat={applyFormat}\n onHistory={applyHistory}\n onNewSlide={() => {\n // The field moves to the new slide: no caret comes back.\n commit(true);\n editor.value?.exec({ type: 'addSlide' });\n }}\n onSelection={readFormats}\n onFocus={onFocus}\n />\n ) : null}\n {refusal.value ? (\n <p class=\"pptx-notes__refusal\" role=\"alert\">\n {refusal.value}\n </p>\n ) : null}\n </section>\n );\n };\n },\n});\n","/** @jsxImportSource vue */\n// The speaker notes field: the Vue twin of the React adapter's `NotesView.tsx`. One editable\n// element shows each run's bold, italic, underline, and strikethrough while you read and while\n// you type. Typed text is a draft that the pane commits as one `setNotes` (one undo step);\n// formats go through `formatNotes`. The core helpers (`renderNotes`, `notesSelection`) own the\n// DOM, so Vue never renders into the editable element and the caret stays where the user put\n// it. The keys come from core (`notesFieldKeyDown`).\n\nimport { defineComponent, onMounted, watch, type PropType, type Ref } from 'vue';\nimport {\n notesFieldBeforeInput,\n notesFieldFocused,\n notesFieldKeyDown,\n notesFieldText,\n notesSelection,\n renderNotes,\n selectNotes,\n type NotesFormat,\n type NotesParagraph,\n type NotesRange,\n} from '@pptx-editor.dev/core/editor';\n\n/** A selection to put back after the field draws the committed notes. @internal */\nexport type NotesCaret = NotesRange;\n\n/** A holder for the selection to put back after the next draw. @internal */\nexport interface NotesRestore {\n value: NotesCaret | null;\n}\n\n/**\n * The notes field. `paragraphs` draw it whenever no draft is pending (`drafting` false); while a\n * draft is pending, the DOM is the user's text and stays as it is. @internal\n */\nexport const NotesField = defineComponent({\n name: 'PptxNotesField',\n props: {\n id: { type: String, default: undefined },\n paragraphs: { type: Array as PropType<readonly NotesParagraph[]>, required: true },\n drafting: { type: Boolean, required: true },\n label: { type: String, required: true },\n placeholder: { type: String, required: true },\n readOnly: { type: Boolean, required: true },\n /** The pane's ref to the field element. */\n field: { type: Object as PropType<Ref<HTMLDivElement | null>>, required: true },\n /** Where the selection goes after the next draw (a format keeps its range). */\n restore: { type: Object as PropType<NotesRestore>, required: true },\n onDraft: { type: Function as PropType<(text: string) => void>, required: true },\n onCommit: { type: Function as PropType<() => void>, required: true },\n onFormat: { type: Function as PropType<(format: NotesFormat) => void>, required: true },\n onHistory: { type: Function as PropType<(kind: 'undo' | 'redo') => void>, required: true },\n /** New Slide (Ctrl+M), as on the canvas. */\n onNewSlide: { type: Function as PropType<() => void>, default: undefined },\n onSelection: { type: Function as PropType<() => void>, required: true },\n onFocus: { type: Function as PropType<() => void>, default: undefined },\n },\n setup(props) {\n let composing = false;\n // Draw the notes when they change and no draft holds the DOM; keep the caret where it was.\n // Only a focused field takes its selection back: a selection put into a field that lost the\n // focus (Tab, Escape) takes the focus back in Chromium, and the key is lost.\n const draw = (): void => {\n const el = props.field.value;\n if (!el || props.drafting) return;\n const focused = notesFieldFocused(el);\n const keep = focused ? (props.restore.value ?? notesSelection(el)) : null;\n props.restore.value = null;\n renderNotes(el, props.paragraphs);\n if (keep) selectNotes(el, keep.start, keep.end);\n props.onSelection();\n };\n onMounted(draw);\n watch(() => [props.paragraphs, props.drafting] as const, draw, { flush: 'post' });\n const onKeydown = (e: KeyboardEvent): void => {\n if (composing) return;\n notesFieldKeyDown(e, e.currentTarget as HTMLElement, {\n readOnly: props.readOnly,\n onDraft: props.onDraft,\n onFormat: props.onFormat,\n onHistory: props.onHistory,\n onNewSlide: props.onNewSlide,\n });\n };\n const draft = (e: Event): void => {\n if (!props.readOnly) props.onDraft(notesFieldText(e.currentTarget as HTMLElement));\n };\n return () => (\n <div\n ref={props.field}\n id={props.id}\n class=\"pptx-notes__text\"\n role=\"textbox\"\n aria-multiline=\"true\"\n aria-label={props.label}\n aria-placeholder={props.placeholder}\n aria-readonly={props.readOnly || undefined}\n data-placeholder={props.placeholder}\n contenteditable={props.readOnly ? 'false' : 'plaintext-only'}\n spellcheck=\"true\"\n tabindex={0}\n onKeydown={onKeydown}\n // Typed text at a caret with an armed format goes into a run with that format.\n onBeforeinput={(e: InputEvent) =>\n notesFieldBeforeInput(e, e.currentTarget as HTMLElement, {\n readOnly: props.readOnly,\n onDraft: props.onDraft,\n })\n }\n onInput={draft}\n onCompositionstart={() => {\n composing = true;\n }}\n onCompositionend={(e: CompositionEvent) => {\n composing = false;\n draft(e);\n }}\n onBlur={() => props.onCommit()}\n onFocus={() => props.onFocus?.()}\n onKeyup={() => props.onSelection()}\n onMouseup={() => props.onSelection()}\n />\n );\n },\n});\n","/** @jsxImportSource vue */\n// The open-failure notice: the Vue twin of the React adapter's `OpenFailure.tsx`, after DOCX\n// Editor's `DocxEditorOpenFailure`, with the same markup and classes. It says why the editor\n// refused a file, and when the deck that was open stays open. It reads\n// `snapshot().openFailure`; the reason groups and their messages are core's (`loading.ts`).\n//\n// The default text is generic on purpose: it explains the refusal and shows the stable code,\n// and names no contact. A host adds its own support action through the `actions` slot.\n\nimport {\n computed,\n defineComponent,\n shallowRef,\n useId,\n type ComputedRef,\n type CSSProperties,\n type ExtractPublicPropTypes,\n type PropType,\n type SlotsType,\n type VNodeChild,\n} from 'vue';\nimport {\n OPEN_FAILURE_MESSAGE_KEYS,\n shownOpenFailure,\n type ChromeTranslate,\n type DocumentOpenFailure,\n} from '@pptx-editor.dev/core/editor';\nimport { useEditorState, useTranslation } from './composables.ts';\nimport { chromeTranslateProp, useChromeTranslateScope } from './headless-hooks.ts';\n\n/** Options for `useOpenFailure`, the twin of React's `UseOpenFailureOptions`. @public */\nexport interface UseOpenFailureOptions {\n /** Your translation function for `message`. Without it, the root's `locale` gives it. */\n readonly t?: ChromeTranslate;\n}\n\n/** What `useOpenFailure` returns, the twin of React's `UseOpenFailureReturn`. @public */\nexport interface UseOpenFailureReturn {\n /** The refused open, or `null` when there is none or the person dismissed it. */\n readonly failure: ComputedRef<DocumentOpenFailure | null>;\n /** The packaged, translated message for `failure`. */\n readonly message: ComputedRef<string | null>;\n /** Whether the deck that was open before stays open. */\n readonly kept: ComputedRef<boolean>;\n /**\n * Hide this refusal. A later refusal shows again, even for the same file. Pass the failure\n * your UI showed, so a late call cannot hide a newer refusal.\n */\n dismiss(failure?: DocumentOpenFailure | null): void;\n}\n\n/**\n * Reads the file the editor refused to open, for a host that shows it in its own UI, such as\n * a toast. Pair it with `:open-failure=\"false\"` on `PptxEditor`, so the packaged notice does\n * not show as well. Call it inside a `PptxEditorRoot`. @public\n */\nexport function useOpenFailure(options: UseOpenFailureOptions = {}): UseOpenFailureReturn {\n const current = useEditorState(shownOpenFailure);\n const ready = useEditorState((s) => s.status === 'ready');\n const { t: ambient } = useTranslation();\n const t = options.t ?? ambient;\n // Each refusal is a new object, so remembering the dismissed one by reference lets the next\n // refusal of the same file show again.\n const dismissed = shallowRef<DocumentOpenFailure | null>(null);\n const failure = computed(() =>\n current.value !== null && current.value !== dismissed.value ? current.value : null\n );\n return {\n failure,\n message: computed(() =>\n failure.value ? t(OPEN_FAILURE_MESSAGE_KEYS[failure.value.reason]) : null\n ),\n kept: computed(() => ready.value),\n dismiss(shown) {\n if (!shown || shown === current.value) dismissed.value = current.value;\n },\n };\n}\n\n/** What the `actions` slot receives, the twin of React's `OpenFailureContext`. @public */\nexport interface OpenFailureContext {\n /** The refused open: its stable `code` and its `reason`. */\n readonly failure: DocumentOpenFailure;\n /** The packaged, translated message for the failure. */\n readonly message: string;\n /** Close the notice. It emits `dismiss`, as **Close** does. */\n dismiss(): void;\n}\n\nconst openFailureProps = {\n /** The notice title. Defaults to the translated `openFailure.title`. */\n title: { type: String, default: undefined },\n /**\n * Your own message in place of the packaged one, as content or per failure. The `message`\n * slot wins over it.\n */\n message: {\n type: [String, Number, Object, Array, Function] as PropType<\n VNodeChild | ((failure: DocumentOpenFailure) => VNodeChild)\n >,\n default: undefined,\n },\n /** Show the stable error code under the message. Defaults to `true`. */\n showCode: { type: Boolean, default: true },\n /**\n * Your own buttons, before **Close**: the function form of the `actions` slot, for the\n * `openFailure` object on `PptxEditor`. The slot wins over it. The notice shows no contact of\n * its own.\n */\n actions: {\n type: Function as PropType<(context: OpenFailureContext) => VNodeChild>,\n default: undefined,\n },\n /** The label of the **Close** button. Defaults to the translated `openFailure.close`. */\n closeLabel: { type: String, default: undefined },\n /** Show the packaged **Close** button. Defaults to `true`. */\n showClose: { type: Boolean, default: true },\n /** A class name added to the notice, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n /** Inline styles for the notice, as React's `style`. */\n style: { type: Object as PropType<CSSProperties>, default: undefined },\n ...chromeTranslateProp,\n} as const;\n\n/**\n * Props of `PptxEditorOpenFailure`, the same name as React's. `onDismiss` is the listener of\n * the `dismiss` event, so the `openFailure` object on `PptxEditor` can carry it. @public\n */\nexport type PptxEditorOpenFailureProps = ExtractPublicPropTypes<typeof openFailureProps> & {\n /** Listener for the `dismiss` event: the person closed the notice, by any route. */\n readonly onDismiss?: (failure: DocumentOpenFailure) => void;\n};\n\n/**\n * A notice that explains why a file did not open, the twin of React's `PptxEditor.OpenFailure`.\n * It shows nothing until the editor refuses a file, and shows again for each later refusal.\n * `PptxEditor` renders it by default. The `actions` slot (or prop) adds buttons before\n * **Close**, and the `message` slot (or prop) replaces the message. It emits `dismiss` after the\n * person closes it:\n *\n * ```vue\n * <PptxEditorOpenFailure>\n * <template #actions=\"{ failure }\">\n * <a class=\"pptx-open-failure__action\" :href=\"`/support?code=${failure.code}`\">Get help</a>\n * </template>\n * </PptxEditorOpenFailure>\n * ```\n *\n * @public\n */\nexport const PptxEditorOpenFailure = defineComponent({\n name: 'PptxEditorOpenFailure',\n props: openFailureProps,\n emits: {\n /** The person closed the notice, by any route. */\n dismiss: (_failure: DocumentOpenFailure) => true,\n },\n slots: Object as SlotsType<{\n /** Your own buttons, before **Close**. It wins over the `actions` prop. */\n actions?: (context: OpenFailureContext) => VNodeChild;\n /** Your own message in place of the packaged one. It wins over the `message` prop. */\n message?: (context: OpenFailureContext) => VNodeChild;\n }>,\n setup(props, { emit, slots }) {\n const { t } = useChromeTranslateScope(() => props.t);\n // A component does not inject what it provides itself, so the scoped `t` goes in directly.\n const { failure, message, kept, dismiss } = useOpenFailure({ t: t as ChromeTranslate });\n const titleId = useId();\n return () => {\n const shown = failure.value;\n const packaged = message.value;\n if (!shown || packaged === null) return null;\n const close = (): void => {\n dismiss(shown);\n emit('dismiss', shown);\n };\n const context: OpenFailureContext = { failure: shown, message: packaged, dismiss: close };\n return (\n <div\n class={['pptx-open-failure', props.className]}\n style={props.style}\n role=\"alert\"\n aria-labelledby={titleId}\n data-reason={shown.reason}\n >\n <div class=\"pptx-open-failure__text\">\n <p id={titleId} class=\"pptx-open-failure__title\">\n {props.title ?? t('openFailure.title')}\n </p>\n <div class=\"pptx-open-failure__message\">\n {slots.message\n ? slots.message(context)\n : typeof props.message === 'function'\n ? props.message(shown)\n : (props.message ?? packaged)}\n </div>\n {kept.value ? <p class=\"pptx-open-failure__kept\">{t('openFailure.kept')}</p> : null}\n {props.showCode ? (\n <p class=\"pptx-open-failure__code\">{t('openFailure.code', { code: shown.code })}</p>\n ) : null}\n </div>\n <div class=\"pptx-open-failure__actions\">\n {slots.actions ? slots.actions(context) : props.actions?.(context)}\n {props.showClose ? (\n <button type=\"button\" class=\"pptx-open-failure__action\" onClick={close}>\n {props.closeLabel ?? t('openFailure.close')}\n </button>\n ) : null}\n </div>\n </div>\n );\n };\n },\n});\n","/** @jsxImportSource vue */\n// The font substitution notice: the Vue twin of the React adapter's `FontNotice.tsx`, matching\n// DOCX Editor's. It lists the families that render with a substitute that can change line\n// breaks, and offers the fonts installed on this computer where the browser supports it.\n// Metric-compatible substitutes are not listed: their line breaks match the original font. The\n// list and the local font request are core's (`overlays.ts`).\n\nimport {\n computed,\n defineComponent,\n ref,\n shallowRef,\n watch,\n type ExtractPublicPropTypes,\n} from 'vue';\nimport {\n applyLocalFonts,\n canQueryLocalFonts,\n fontNoticeFamilies,\n} from '@pptx-editor.dev/core/editor';\nimport { ToolButton, keepFocus } from './chrome.tsx';\nimport { useEditorState, usePptxEditor } from './composables.ts';\nimport { chromeTranslateProp, useChromeTranslateScope } from './headless-hooks.ts';\n\nconst pptxEditorFontNoticeProps = {\n ...chromeTranslateProp,\n /** A class name added to the notice, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n} as const;\n\n/** The props of `PptxEditorFontNotice`, the same name as React's `FontNoticeProps`. @public */\nexport type FontNoticeProps = ExtractPublicPropTypes<typeof pptxEditorFontNoticeProps>;\n\n/**\n * The substitution notice, the twin of React's `PptxEditor.FontNotice`. Renders nothing when\n * every font is available. A host `class` goes on the notice. @public\n */\nexport const PptxEditorFontNotice = defineComponent({\n name: 'PptxEditorFontNotice',\n inheritAttrs: false,\n props: pptxEditorFontNoticeProps,\n setup(props, { attrs }) {\n const editorRef = usePptxEditor();\n const { t } = useChromeTranslateScope(() => props.t);\n const substituted = useEditorState((s) => s.substitutedFonts);\n // A newly opened document starts with no outcome of an earlier local font request.\n const loadState = useEditorState((s) => s.status);\n const missing = computed(() => fontNoticeFamilies(substituted.value));\n const key = computed(() => missing.value.join('|'));\n const dismissed = shallowRef<string | null>(null);\n // The outcome of a local font request, for the substituted families when it finished.\n const outcome = shallowRef<{ text: string; key: string } | null>(null);\n // A later change to the substituted families makes the outcome stale.\n const status = computed(() => (outcome.value?.key === key.value ? outcome.value.text : null));\n const busy = ref(false);\n // Each opened document starts a new round; a request from an earlier round reports nothing.\n // A request that adds fonts changes `key` itself, so only a load starts a round.\n let round = 0;\n watch(loadState, () => {\n round += 1;\n outcome.value = null;\n });\n const addLocalFonts = async (): Promise<void> => {\n const editor = editorRef.value;\n if (!editor) return;\n busy.value = true;\n const asked = round;\n try {\n const result = await applyLocalFonts(editor, missing.value);\n const now = fontNoticeFamilies(editor.snapshot().substitutedFonts).join('|');\n if (asked === round) outcome.value = { text: t(result), key: now };\n } catch {\n // `setFonts` rejects only after the editor is destroyed; nothing is left to tell.\n } finally {\n busy.value = false;\n }\n };\n return () => {\n const families = missing.value;\n if ((families.length === 0 && !status.value) || dismissed.value === key.value) return null;\n return (\n <div\n {...attrs}\n class={['pptx-font-notice', attrs.class, props.className]}\n role=\"status\"\n onMousedown={keepFocus}\n >\n <span class=\"pptx-font-notice__text\">\n {families.length ? t('fonts.notice', { families: families.join(', ') }) : status.value}\n {families.length && status.value ? ` ${status.value}` : ''}\n </span>\n {families.length && canQueryLocalFonts() ? (\n <button\n type=\"button\"\n class=\"pptx-font-notice__action\"\n disabled={busy.value || loadState.value === 'loading'}\n onClick={() => void addLocalFonts()}\n >\n {t('fonts.useLocal')}\n </button>\n ) : null}\n <ToolButton\n label={t('fonts.dismiss')}\n icon=\"close\"\n onClick={() => {\n dismissed.value = key.value;\n }}\n />\n </div>\n );\n };\n },\n});\n","// The ribbon: the Vue twin of the React adapter's `PptxEditor.Ribbon`. Tabs over the toolbar's groups from core\n// (`RIBBON_TABS`, `ribbonTabs`): each tab panel is the toolbar's preset bar with that tab's\n// groups, so `ToolbarSlot`, named parts, `ToolbarGroup`, and `ToolbarAction` work inside a tab.\n// The markup and classes match React's, so the one core stylesheet styles both.\n\nimport {\n defineComponent,\n h,\n isVNode,\n normalizeClass,\n ref,\n watch,\n nextTick,\n Comment,\n Text,\n useId,\n type ExtractPublicPropTypes,\n type PropType,\n type VNode,\n type VNodeArrayChildren,\n} from 'vue';\nimport {\n arrangeRibbonTabs,\n ribbonInsertTab,\n ribbonShownTab,\n ribbonTabs,\n translateKeyOrText,\n warnRibbonChild,\n type RibbonTabId,\n type RibbonTabLayout,\n} from '@pptx-editor.dev/core/editor';\nimport { useEditorState, useTranslation } from './composables.ts';\nimport { PresetBar } from './toolbar.ts';\n\nconst ribbonTabProps = {\n /** A built-in tab id changes that tab; any other id adds a host tab. */\n id: { type: String as PropType<RibbonTabId | (string & {})>, required: true as const },\n /** The tab's title. Wins over `labelKey`. */\n label: { type: String, default: undefined },\n /** A translation key for the tab's title. */\n labelKey: { type: String, default: undefined },\n /** Remove the tab. */\n hidden: { type: Boolean, default: false },\n /** For a host tab: the tab it follows. */\n after: { type: String as PropType<RibbonTabId | (string & {})>, default: undefined },\n /** A class name added to the tab's panel, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n} as const;\n\n/** Props of `RibbonTab`, the twin of React's `RibbonTabProps`. @public */\nexport type RibbonTabProps = ExtractPublicPropTypes<typeof ribbonTabProps>;\n\n/** One tab of the ribbon: a description `PptxEditorRibbon` reads. Its slot is toolbar children. @public */\nexport const RibbonTab = defineComponent({\n name: 'RibbonTab',\n props: ribbonTabProps,\n setup() {\n return () => null;\n },\n});\n\nconst ribbonProps = {\n /** `true` (default): the tabs of `RIBBON_TABS`, changed by `RibbonTab` children. */\n preset: { type: Boolean, default: true },\n /** The selected tab, controlled. Use with `v-model:tab`, or the `tabChange` event. */\n tab: { type: String as PropType<RibbonTabId | (string & {})>, default: undefined },\n /** The tab selected first, uncontrolled. */\n defaultTab: { type: String as PropType<RibbonTabId | (string & {})>, default: 'home' },\n /** `false`: a tab's groups wrap instead of moving into the More menu. Default `true`. */\n overflow: { type: Boolean, default: true },\n /** A class name added to the ribbon, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n} as const;\n\n/** Props of `PptxEditorRibbon`, the twin of React's `RibbonProps`. @public */\nexport type RibbonProps = ExtractPublicPropTypes<typeof ribbonProps>;\n\ninterface TabSpec {\n readonly id: string;\n readonly label?: string;\n readonly labelKey?: string;\n readonly hidden: boolean;\n readonly after?: string;\n readonly className: string | undefined;\n readonly content: VNodeArrayChildren | undefined;\n}\n\nfunction flatten(children: VNodeArrayChildren | undefined, out: VNode[] = []): VNode[] {\n for (const child of children ?? []) {\n if (Array.isArray(child)) flatten(child, out);\n else if (isVNode(child)) {\n if (Array.isArray(child.children) && typeof child.type === 'symbol')\n flatten(child.children as VNodeArrayChildren, out);\n else out.push(child);\n }\n }\n return out;\n}\n\nfunction readSpec(vnode: VNode): TabSpec {\n const props = (vnode.props ?? {}) as Record<string, unknown>;\n const pick = (camel: string): unknown =>\n camel in props ? props[camel] : props[camel.replace(/[A-Z]/g, (c) => `-${c.toLowerCase()}`)];\n const children = vnode.children as { default?: () => VNodeArrayChildren } | null;\n const label = pick('label');\n const labelKey = pick('labelKey');\n const after = pick('after');\n const hidden = pick('hidden');\n return {\n id: String(pick('id')),\n ...(typeof label === 'string' ? { label } : {}),\n ...(typeof labelKey === 'string' ? { labelKey } : {}),\n ...(typeof after === 'string' ? { after } : {}),\n hidden: hidden === '' || hidden === true,\n className: normalizeClass([props.class, pick('className')]) || undefined,\n content: children && typeof children === 'object' ? children.default?.() : undefined,\n };\n}\n\nconst sameLayout = (a: readonly RibbonTabLayout[], b: readonly RibbonTabLayout[]): boolean => {\n const key = (l: readonly RibbonTabLayout[]) =>\n l.map((t) => `${t.tab.id}:${t.groups.map((g) => g.id).join(',')}`).join('|');\n return key(a) === key(b);\n};\n\n/**\n * The ribbon: the Quick Access Toolbar, the tab names, and the selected tab's groups, with\n * contextual tabs while the selection needs them, as React's `PptxEditor.Ribbon`. Emits\n * `update:tab` (for `v-model:tab`) and `tabChange`. The tabs are attached as `PptxEditorRibbon.Tab`. @public\n */\nexport const PptxEditorRibbon = Object.assign(\n defineComponent({\n name: 'PptxEditorRibbon',\n props: ribbonProps,\n emits: {\n 'update:tab': (_tab: string) => true,\n tabChange: (_tab: string) => true,\n },\n setup(props, { emit, slots }) {\n const { t } = useTranslation();\n const baseId = useId();\n const layout = useEditorState((s) => ribbonTabs(s), sameLayout);\n const own = ref<string>(props.defaultTab);\n const names = new Map<string, HTMLElement>();\n const root = ref<HTMLElement | null>(null);\n // Whether the keyboard focus is in the ribbon, as in React: a removed panel sends no\n // `focusout` with a target, so the flag stays set until the focus goes elsewhere.\n let focusInside = false;\n const select = (id: string): void => {\n if (props.tab === undefined) own.value = id;\n emit('update:tab', id);\n emit('tabChange', id);\n };\n // The shown tab after the last render, and whether the wanted tab was gone.\n const shown = ref<{ id: string | undefined; fellBack: boolean }>({\n id: undefined,\n fellBack: false,\n });\n // A tab that went away gives way to Home, as in React: the ribbon selects it, tells the\n // host, and moves the focus to its name.\n watch(\n () => `${shown.value.fellBack}|${shown.value.id ?? ''}`,\n async () => {\n const { id, fellBack } = shown.value;\n if (!fellBack || id === undefined) return;\n select(id);\n await nextTick();\n const active = root.value?.ownerDocument.activeElement;\n if (focusInside && (!active || active === active.ownerDocument.body))\n names.get(id)?.focus();\n }\n );\n // An insert opens the new object's Format tab. The tabs\n // of the render after the insert are known in the watch, after the render.\n const insertions = useEditorState((s) => s.insertions);\n let insertTab: string | null = null;\n watch(insertions, async () => {\n await nextTick();\n if (insertTab !== null && insertTab !== (props.tab ?? own.value)) select(insertTab);\n });\n return () => {\n const specs = new Map<string, TabSpec>();\n for (const vnode of flatten(slots.default?.()))\n if (vnode.type === RibbonTab) {\n const spec = readSpec(vnode);\n specs.set(spec.id, spec);\n } else if (\n vnode.type !== Comment &&\n (vnode.type !== Text || String(vnode.children ?? '').trim() !== '')\n )\n // Text warns as in React, where a string child is not a tab; blank text does not.\n warnRibbonChild('PptxEditorRibbon', 'PptxEditorRibbon.Tab');\n const { quickAccess, tabs } = arrangeRibbonTabs(\n layout.value,\n specs,\n props.preset,\n (key) => translateKeyOrText(t, key),\n 'PptxEditorRibbon.Tab'\n );\n insertTab = ribbonInsertTab(tabs);\n const wanted = props.tab ?? own.value;\n const picked = ribbonShownTab(tabs, wanted);\n const current = picked.shown;\n if (shown.value.id !== current?.id || shown.value.fellBack !== picked.fellBack)\n shown.value = { id: current?.id, fellBack: picked.fellBack };\n const onKey = (e: KeyboardEvent): void => {\n const index = tabs.findIndex((d) => d.id === current?.id);\n const next =\n e.key === 'ArrowRight'\n ? tabs[(index + 1) % tabs.length]\n : e.key === 'ArrowLeft'\n ? tabs[(index - 1 + tabs.length) % tabs.length]\n : e.key === 'Home'\n ? tabs[0]\n : e.key === 'End'\n ? tabs[tabs.length - 1]\n : undefined;\n if (!next) return;\n e.preventDefault();\n select(next.id);\n names.get(next.id)?.focus();\n };\n const tabId = (id: string) => `${baseId}-tab-${id}`;\n const panelId = `${baseId}-panel`;\n return h(\n 'div',\n {\n ref: root,\n class: ['pptx-ribbon', props.className],\n onFocusin: () => {\n focusInside = true;\n },\n onFocusout: (e: FocusEvent) => {\n const next = e.relatedTarget as Node | null;\n if (next && !(e.currentTarget as HTMLElement).contains(next)) focusInside = false;\n },\n },\n [\n h('div', { class: 'pptx-ribbon__bar' }, [\n quickAccess\n ? h('div', { class: 'pptx-ribbon__qat' }, [\n h(\n PresetBar,\n { groups: quickAccess.groups, label: quickAccess.title, overflow: false },\n () => quickAccess.override?.content\n ),\n ])\n : null,\n h(\n 'div',\n {\n role: 'tablist',\n 'aria-label': t('ribbon.ariaLabel'),\n class: 'pptx-ribbon__tabs',\n onKeydown: onKey,\n },\n tabs.map((d) => {\n const selected = d.id === current?.id;\n return h(\n 'button',\n {\n key: d.id,\n ref: (el: unknown) => {\n if (el) names.set(d.id, el as HTMLElement);\n else names.delete(d.id);\n },\n type: 'button',\n role: 'tab',\n id: tabId(d.id),\n class: 'pptx-ribbon__tab',\n 'aria-selected': selected,\n 'aria-controls': selected ? panelId : undefined,\n tabindex: selected ? 0 : -1,\n 'data-tab': d.id,\n 'data-contextual': d.contextual ? '' : undefined,\n onMousedown: (e: MouseEvent) => e.preventDefault(),\n onClick: () => select(d.id),\n },\n d.title\n );\n })\n ),\n ]),\n current\n ? h(\n 'div',\n {\n role: 'tabpanel',\n id: panelId,\n 'aria-labelledby': tabId(current.id),\n class: ['pptx-ribbon__panel', current.override?.className],\n 'data-tab': current.id,\n },\n [\n h(\n PresetBar,\n {\n key: current.id,\n groups: current.groups,\n label: current.title,\n overflow: props.overflow,\n },\n () => current.override?.content\n ),\n ]\n )\n : null,\n ]\n );\n };\n },\n }),\n { Tab: RibbonTab }\n);\n","// The status bar: the Vue twin of the React adapter's `PptxEditor.StatusBar`, with the same\n// markup and classes, so the one core stylesheet styles both: \"Slide x of y\", the Notes button,\n// the view buttons, and zoom. The view buttons and zoom are the editor's own `ViewSwitch` and\n// `PptxEditorZoomPill`, so the bar adds no second control for the same action. Each part takes\n// `hidden` and a host `class`; a named part child replaces its part in place, other children\n// follow the Notes button, and `preset: false` renders only the children.\n\nimport { chromeTranslateProp, useChromeTranslateScope } from './headless-hooks.ts';\nimport {\n defineComponent,\n h,\n isVNode,\n normalizeClass,\n type ExtractPublicPropTypes,\n type PropType,\n type VNode,\n type VNodeArrayChildren,\n} from 'vue';\nimport { chromeKeepsFocus, slideStatus, warnAsChildChild } from '@pptx-editor.dev/core/editor';\nimport { Icon } from './chrome.tsx';\nimport { useEditorState, useTranslation } from './composables.ts';\nimport { useNotesPane } from './pane-state.ts';\nimport { PptxEditorZoomPill } from './panes.tsx';\nimport { ViewSwitch } from './SlideSorter.tsx';\nimport { ToolbarAction } from './toolbar-parts.ts';\n\nconst partProps = {\n /** Remove the part from the status bar. */\n hidden: { type: Boolean, default: false },\n /** A class name added to the part, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n} as const;\n\n/** Props of every status bar part: `hidden`, and `className` (or `class`) on the part. @public */\nexport type StatusBarPartProps = ExtractPublicPropTypes<typeof partProps>;\n\nfunction keepFocus(e: MouseEvent): void {\n if (chromeKeepsFocus(e.target)) e.preventDefault();\n}\n\n/** \"Slide 2 of 5\", as React's `StatusBarSlideNumber`. @public */\nexport const StatusBarSlideNumber = defineComponent({\n name: 'StatusBarSlideNumber',\n props: partProps,\n setup(props) {\n const { t } = useTranslation();\n const status = useEditorState(\n (s) => slideStatus(s),\n (a, b) => a?.current === b?.current && a?.total === b?.total\n );\n return () =>\n props.hidden\n ? null\n : h(\n 'span',\n {\n class: ['pptx-statusbar__slide', props.className],\n 'data-part': 'slideNumber',\n 'aria-live': 'polite',\n },\n status.value ? t('statusBar.slide', status.value) : ''\n );\n },\n});\n\n/** The part name in warnings about `StatusBarNotes`. */\nconst NOTES_PART = { slot: 'StatusBar.Notes', group: 'StatusBar' } as const;\n\nconst notesPartProps = {\n ...partProps,\n /** Icon content in place of the packaged icon. */\n icon: { type: Object as PropType<VNode>, default: undefined },\n /** Render the one element of the default slot as the button: it gets the label, state, and click. */\n asChild: { type: Boolean, default: false },\n} as const;\n\n/**\n * Props of `StatusBarNotes`, the twin of React's `StatusBarNotesProps`: the part props, and the\n * ladder's `icon` and `asChild` (the element goes in the default slot). `className` (or a host\n * `class`) goes on the button. @public\n */\nexport type StatusBarNotesProps = ExtractPublicPropTypes<typeof notesPartProps>;\n\n/**\n * The Notes button: shows or hides the speaker notes (`useNotesPane`), as React's\n * `StatusBarNotes`. @public\n */\nexport const StatusBarNotes = defineComponent({\n name: 'StatusBarNotes',\n inheritAttrs: false,\n props: notesPartProps,\n setup(props, { attrs, slots }) {\n const { t } = useTranslation();\n const notes = useNotesPane();\n return () => {\n if (props.hidden) return null;\n // One element child, or the packaged Notes button with its icon (and a warning that names\n // this part).\n const only = props.asChild ? (slots.default?.() ?? []).filter(isVNode) : [];\n const host = only.length === 1 && typeof only[0]!.type !== 'symbol';\n if (props.asChild && !host) warnAsChildChild('notes', NOTES_PART);\n return h('span', { class: 'pptx-statusbar__notes-part', 'data-part': 'notes' }, [\n h(\n ToolbarAction,\n {\n label: t('statusBar.notes'),\n icon: host ? undefined : (props.icon ?? h(Icon, { name: 'edit_note' })),\n className: normalizeClass(['pptx-statusbar__notes', attrs.class, props.className]),\n active: notes.open.value,\n asChild: host,\n onSelect: notes.toggle,\n },\n host ? { default: () => only } : undefined\n ),\n ]);\n };\n },\n});\n\n/**\n * The view buttons: the editor's view switch (`view.presentationView`: Normal and Slide\n * Sorter), the same control as the default editor's status area, as React's `StatusBarViews`.\n * @public\n */\nexport const StatusBarViews = defineComponent({\n name: 'StatusBarViews',\n props: partProps,\n setup(props) {\n return () =>\n props.hidden\n ? null\n : h('span', { class: ['pptx-statusbar__views', props.className], 'data-part': 'views' }, [\n h(ViewSwitch),\n ]);\n },\n});\n\n/** Zoom out, the zoom level with its menu, and zoom in: the editor's `PptxEditorZoomPill`. @public */\nexport const StatusBarZoom = defineComponent({\n name: 'StatusBarZoom',\n props: partProps,\n setup(props) {\n return () =>\n props.hidden\n ? null\n : h('span', { class: ['pptx-statusbar__zoom', props.className], 'data-part': 'zoom' }, [\n h(PptxEditorZoomPill),\n ]);\n },\n});\n\nconst PARTS: readonly unknown[] = [\n StatusBarSlideNumber,\n StatusBarNotes,\n StatusBarViews,\n StatusBarZoom,\n];\n\nconst statusBarProps = {\n ...chromeTranslateProp,\n /** `false`: only the default slot, with no default parts. */\n preset: { type: Boolean, default: true },\n /** A class name added to the bar, as React's `className`. A host `class` also works. */\n className: { type: String, default: undefined },\n} as const;\n\n/** Props of `PptxEditorStatusBar`, the twin of React's `StatusBarProps`. @public */\nexport type StatusBarProps = ExtractPublicPropTypes<typeof statusBarProps>;\n\nfunction flatten(children: VNodeArrayChildren | undefined, out: VNode[] = []): VNode[] {\n for (const child of children ?? []) {\n if (Array.isArray(child)) flatten(child, out);\n else if (isVNode(child)) {\n if (Array.isArray(child.children) && typeof child.type === 'symbol')\n flatten(child.children as VNodeArrayChildren, out);\n else out.push(child);\n }\n }\n return out;\n}\n\n/**\n * The status bar: \"Slide x of y\", the Notes button, the view buttons, and zoom, as React's\n * `PptxEditor.StatusBar`. A named part child replaces its part in place; other children follow\n * the Notes button. The parts are attached as `PptxEditorStatusBar.SlideNumber`, `.Notes`,\n * `.Views`, and `.Zoom`. @public\n */\nexport const PptxEditorStatusBar = Object.assign(\n defineComponent({\n name: 'PptxEditorStatusBar',\n props: statusBarProps,\n setup(props, { slots }) {\n const { t } = useChromeTranslateScope(() => props.t);\n return () => {\n const children = slots.default?.();\n const bar = (content: VNodeArrayChildren) =>\n h(\n 'div',\n {\n role: 'group',\n 'aria-label': t('statusBar.ariaLabel'),\n class: ['pptx-statusbar pptx-statusbar--bar', props.className],\n onMousedown: keepFocus,\n },\n content\n );\n if (!props.preset) return bar(children ?? []);\n const overrides = new Map<unknown, VNode>();\n const extras: VNode[] = [];\n for (const vnode of flatten(children))\n if (PARTS.includes(vnode.type)) overrides.set(vnode.type, vnode);\n else extras.push(vnode);\n return bar([\n overrides.get(StatusBarSlideNumber) ?? h(StatusBarSlideNumber),\n h('span', { class: 'pptx-statusbar__spacer' }),\n overrides.get(StatusBarNotes) ?? h(StatusBarNotes),\n ...extras,\n overrides.get(StatusBarViews) ?? h(StatusBarViews),\n overrides.get(StatusBarZoom) ?? h(StatusBarZoom),\n ]);\n };\n },\n }),\n {\n SlideNumber: StatusBarSlideNumber,\n Notes: StatusBarNotes,\n Views: StatusBarViews,\n Zoom: StatusBarZoom,\n Action: ToolbarAction,\n }\n);\n","// The composables a host uses to build its own chrome: the Vue twins of the React adapter's\n// `customization-hooks.ts`, after DOCX Editor's Vue `useZoom`, `useEditorEvent`,\n// `useEditorSnapshot`, and `useScopeClassName`. Each reads the editor through its one\n// subscription and calls back into the instance: no composable keeps a second copy of editor\n// state. Call them in `setup`.\n\nimport {\n computed,\n getCurrentScope,\n onScopeDispose,\n shallowRef,\n toValue,\n watch,\n type ComputedRef,\n type MaybeRefOrGetter,\n type Ref,\n} from 'vue';\nimport {\n ZOOM_LEVELS,\n onEditorEvent,\n stepEditorZoom,\n zoomStep,\n type EditorSnapshot,\n type PptxEditorEvents,\n type PptxEditorInstance,\n} from '@pptx-editor.dev/core/editor';\nimport { useEditorState, usePptxEditor } from './composables.ts';\nimport { useChromeDark, useScopedByAncestor } from './color-mode.ts';\n\n/** What {@link useZoom} returns: React's `UseZoomReturn`, with refs for the state. @public */\nexport interface UseZoomReturn {\n /** The zoom in force. 1 is 100 %. In fit mode it is the zoom that fits the slide. */\n readonly zoom: ComputedRef<number>;\n /** Whether the editor fits the slide to the window and follows its size. */\n readonly isFit: ComputedRef<boolean>;\n /** Set a fixed zoom, kept in the range 10 % to 400 %. Leaves fit mode. */\n readonly setZoom: (zoom: number) => void;\n /** Fit the slide to the window, and keep it fitted when the window changes size. */\n readonly fit: () => void;\n /** A fixed 100 %. */\n readonly reset: () => void;\n /** One step of `levels` in from the zoom in force. Does nothing at 400 %. */\n readonly zoomIn: () => void;\n /** One step of `levels` out from the zoom in force. Does nothing at 10 %. */\n readonly zoomOut: () => void;\n /** Whether `zoomIn` can step. */\n readonly canZoomIn: ComputedRef<boolean>;\n /** Whether `zoomOut` can step. */\n readonly canZoomOut: ComputedRef<boolean>;\n /** The steps the zoom buttons move through, so a custom control shows the same levels. */\n readonly levels: readonly number[];\n}\n\ninterface ZoomSlice {\n readonly zoom: number;\n readonly fit: boolean;\n}\n\nconst selectZoom = (s: EditorSnapshot): ZoomSlice => ({ zoom: s.zoom, fit: s.fitZoom });\nconst sameZoom = (a: ZoomSlice, b: ZoomSlice): boolean => a.zoom === b.zoom && a.fit === b.fit;\n\n/**\n * Read and set the slide zoom, as React's `useZoom` and DOCX Editor's. Outside\n * `PptxEditorRoot`, and before the editor mounts, it reports 100 % and every action does\n * nothing. @public\n */\nexport function useZoom(): UseZoomReturn {\n const editor = usePptxEditor();\n const slice = useEditorState(selectZoom, sameZoom);\n const setZoom = (next: number): void => editor.value?.setZoom(next);\n const next = computed(() => zoomStep(slice.value.zoom, 1));\n const previous = computed(() => zoomStep(slice.value.zoom, -1));\n return {\n zoom: computed(() => slice.value.zoom),\n isFit: computed(() => slice.value.fit),\n setZoom,\n fit: () => editor.value?.setZoom('fit'),\n reset: () => setZoom(1),\n zoomIn: () => stepEditorZoom(editor.value, 1),\n zoomOut: () => stepEditorZoom(editor.value, -1),\n canZoomIn: computed(() => !!editor.value && next.value !== null),\n canZoomOut: computed(() => !!editor.value && previous.value !== null),\n levels: ZOOM_LEVELS,\n };\n}\n\n/** What {@link useEditorEvent} returns: nothing; the subscription ends with the scope. @public */\nexport type UseEditorEventReturn = void;\n\n/** What {@link useEditorSnapshot} returns: the change counter. @public */\nexport type UseEditorSnapshotReturn = Readonly<Ref<number>>;\n\n/**\n * Subscribe to an editor event (`'change'`, `'selectionChange'`, `'rejection'`,\n * `'openFailure'`) for the lifetime of the component, as React's `useEditorEvent` and DOCX\n * Editor's. It does nothing until `PptxEditorRoot` creates the editor, and subscribes again\n * when the instance changes. @public\n */\nexport function useEditorEvent<E extends keyof PptxEditorEvents>(\n event: E,\n handler: PptxEditorEvents[E]\n): UseEditorEventReturn {\n const editor = usePptxEditor();\n if (!getCurrentScope()) return;\n watch(\n editor,\n (instance, _prev, onCleanup) => {\n if (instance) onCleanup(onEditorEvent(instance, event, handler));\n },\n { immediate: true }\n );\n}\n\n/**\n * A counter that changes each time `editor` publishes a change, as React's\n * `useEditorSnapshot` and DOCX Editor's. Read it in a render function or a `computed` to\n * follow the editor. Prefer `useEditorState` with a selector. @public\n */\nexport function useEditorSnapshot(\n editor: MaybeRefOrGetter<PptxEditorInstance | null>\n): UseEditorSnapshotReturn {\n const revision = shallowRef(0);\n if (!getCurrentScope()) return revision;\n const stop = watch(\n () => toValue(editor),\n (instance, _prev, onCleanup) => {\n if (!instance) return;\n const bump = (): void => void (revision.value += 1);\n onCleanup(instance.subscribe(bump));\n bump();\n },\n { immediate: true }\n );\n onScopeDispose(stop);\n return revision;\n}\n\n/** What {@link useScopeClassName} returns. @public */\nexport type UseScopeClassNameReturn = ComputedRef<'' | 'pptx-editor ' | 'pptx-editor dark '>;\n\n/**\n * The scope classes a part you build yourself adds to its own root element, so the editor's\n * `--doc-*` tokens and chrome styles apply to it, as React's `useScopeClassName`. Inside\n * `PptxEditorViewport` it is `''`. Outside it, it is `'pptx-editor '`, or `'pptx-editor dark '`\n * when the root's `colorMode` resolved dark. It is a ref, so it follows a `'system'` color\n * mode. The value ends with a space, so it concatenates cleanly. @public\n */\nexport function useScopeClassName(): UseScopeClassNameReturn {\n const scoped = useScopedByAncestor();\n const dark = useChromeDark();\n return computed(() => (scoped ? '' : dark.value ? 'pptx-editor dark ' : 'pptx-editor '));\n}\n","// Adapted from DOCX Editor `packages/vue/src/editor/useDocxSource.ts` and\n// `useEditorHostDocument.ts` at commit 5993bd223.\n//\n// Opening a presentation, as a composable: the Vue twin of React's `usePptxSource.ts`. The\n// rules (the two font paths, the fetch) are core's (`pptx-source.ts`); this file owns only the\n// Vue lifetime.\n\nimport {\n computed,\n shallowRef,\n toValue,\n watch,\n type ComputedRef,\n type MaybeRefOrGetter,\n type ShallowRef,\n} from 'vue';\nimport {\n editorHostDocument,\n fetchPptxSource,\n isAbortError,\n onEditorHostChange,\n pptxFontsShape,\n pptxSourceBytes,\n pptxSourceFontsResolver,\n resolveEagerPptxFonts,\n type FontResolver,\n type PptxSource,\n type UsePptxSourceOptions,\n} from '@pptx-editor.dev/core/editor';\nimport type { FontConfiguration } from '@pptx-editor.dev/core/contracts';\nimport { usePptxEditor } from './composables.ts';\n\n/** What `usePptxSource` returns, the twin of React's, with refs. @public */\nexport interface UsePptxSourceReturn {\n /** Bytes for the `document` prop; undefined until they arrive. */\n readonly document: ComputedRef<Uint8Array | undefined>;\n /** What to give the `fonts` prop: a configuration, a stable resolver, or undefined. */\n readonly fonts: ComputedRef<FontConfiguration | FontResolver | undefined>;\n /** Why the presentation could not be opened. A font failure never shows here. */\n readonly error: ComputedRef<Error | null>;\n /** True until the presentation arrives or fails, and while eager fonts load. */\n readonly isLoading: ComputedRef<boolean>;\n}\n\n/**\n * Load a presentation, and optionally its fonts, for `PptxEditor`, the twin of React's\n * `usePptxSource` and of DOCX Editor's `useDocxSource`. Eager fonts hold the deck back until\n * they settle; an on-demand resolver does not. A font failure never fails the deck. @public\n */\nexport function usePptxSource(\n source: MaybeRefOrGetter<PptxSource | null | undefined>,\n options: MaybeRefOrGetter<UsePptxSourceOptions> = {}\n): UsePptxSourceReturn {\n const bytes = shallowRef<Uint8Array | undefined>(undefined);\n const fonts = shallowRef<FontConfiguration | FontResolver | undefined>(undefined);\n const error = shallowRef<Error | null>(null);\n const documentLoading = shallowRef(toValue(source) != null);\n const fontsSettled = shallowRef(toValue(options).fonts === undefined);\n // One resolver for the composable's life, which reads the options at each request.\n const resolver = pptxSourceFontsResolver(() => toValue(options).fonts);\n\n // Fonts load once per path, not per options object, as React's: a getter that builds a new\n // `fonts` value at each read must not resolve the fonts again and reload the deck.\n watch(\n () => pptxFontsShape(toValue(options).fonts),\n (_shape, _previous, onCleanup) => {\n const fontsSource = toValue(options).fonts;\n if (fontsSource === undefined) {\n fonts.value = undefined;\n fontsSettled.value = true;\n return;\n }\n // On demand: the answer needs the parsed deck, so there is nothing to wait for.\n if (pptxFontsShape(fontsSource) === 'on-demand') {\n fonts.value = resolver;\n fontsSettled.value = true;\n return;\n }\n let live = true;\n fonts.value = undefined;\n fontsSettled.value = false;\n void resolveEagerPptxFonts(fontsSource).then((composed) => {\n if (!live) return;\n if (composed) fonts.value = composed;\n fontsSettled.value = true;\n });\n onCleanup(() => {\n live = false;\n });\n },\n { immediate: true }\n );\n\n watch(\n () => toValue(source),\n (next, _previous, onCleanup) => {\n if (next == null) {\n bytes.value = undefined;\n error.value = null;\n documentLoading.value = false;\n return;\n }\n const immediate = pptxSourceBytes(next);\n if (immediate) {\n bytes.value = immediate;\n error.value = null;\n documentLoading.value = false;\n return;\n }\n // Keep the old bytes while the new URL loads, as React does, so the editor keeps its deck.\n let live = true;\n const controller = new AbortController();\n documentLoading.value = true;\n error.value = null;\n fetchPptxSource(next as string | URL, toValue(options).fetchOptions, controller.signal).then(\n (loaded) => {\n if (!live) return;\n bytes.value = loaded;\n documentLoading.value = false;\n },\n (cause: unknown) => {\n if (!live || isAbortError(cause)) return;\n error.value =\n cause instanceof Error ? cause : new Error('could not open the presentation');\n documentLoading.value = false;\n }\n );\n onCleanup(() => {\n live = false;\n controller.abort();\n });\n },\n { immediate: true }\n );\n\n return {\n document: computed(() => (fontsSettled.value ? bytes.value : undefined)),\n fonts: computed(() => fonts.value),\n error: computed(() => error.value),\n isLoading: computed(() => documentLoading.value || !fontsSettled.value),\n };\n}\n\n/** What `useEditorHostDocument` returns: a read-only ref to the host document. @public */\nexport type UseEditorHostDocumentReturn = Readonly<ShallowRef<Document | null>>;\n\n/**\n * The document that the editor's slide is mounted in, the twin of React's\n * `useEditorHostDocument`: an iframe's when the host mounted the editor there, else the page's\n * own. Null during server rendering. @public\n */\nexport function useEditorHostDocument(): UseEditorHostDocumentReturn {\n const editorRef = usePptxEditor();\n const current = shallowRef<Document | null>(null);\n const read = (): void => {\n const editor = editorRef.value;\n current.value = editor\n ? editorHostDocument(editor)\n : typeof globalThis.document === 'undefined'\n ? null\n : globalThis.document;\n };\n watch(\n () => editorRef.value,\n (editor, _previous, onCleanup) => {\n read();\n if (editor) onCleanup(onEditorHostChange(editor, read));\n },\n { immediate: true, flush: 'post' }\n );\n return current;\n}\n","// Copied from DOCX Editor `packages/vue/src/editor/useFonts.ts` at commit 5993bd223.\n// Keep the exported API equal to the source.\n\nimport { toValue } from 'vue';\nimport {\n composeFontOrigins,\n defineFontResolver,\n type FontConfigurationFragment,\n type FontOrigin,\n type FontResolutionRequest,\n type FontResolver,\n type MarkedFontResolver,\n} from '@pptx-editor.dev/core/editor';\nimport type { FontConfiguration } from '@pptx-editor.dev/core/contracts';\nimport type { MaybeRefOrGetter } from 'vue';\n\n/**\n * What `useFonts` returns: one marked resolver for the component's life. Named for the\n * adapters' composable parity check (PPTX Editor addition).\n *\n * @public\n */\nexport type UseFontsReturn = MarkedFontResolver;\n\n/**\n * The first argument of `useFonts`: a `FontConfiguration`, a fragment, a `FontResolver` (such\n * as `packagedFonts()`), a promise of a configuration or a fragment, or `undefined`. Each may\n * be a `ref` or a getter, which `useFonts` reads again at each resolve.\n *\n * @public\n */\nexport type FontsInput =\n | FontConfiguration\n | FontConfigurationFragment\n | FontResolver\n | Promise<FontConfiguration | FontConfigurationFragment | undefined>\n | undefined;\n\n/**\n * Read one origin, resolving a `ref` but NEVER calling a function.\n *\n * `toValue` invokes a plain function to read it as a getter, and a resolver invoked with\n * no argument reads `request.defaultFamily` off `undefined` and throws — which is how\n * `useFonts(googleFonts())` came to leave the document on fixed measurement with no\n * diagnostic at all.\n *\n * Arity looked like a way to tell the two apart and is not one. A getter never declares a\n * parameter, so \"declares one ⇒ not a getter\" is sound — but the branch it falls THROUGH\n * to is the mirror-image unsound move, reading a zero-arity function as a getter and\n * calling it. `(request = FALLBACK) => …` and `(...args) => …` are both length 0 and both\n * resolvers, and this file's own contract names that trap by name.\n *\n * So: every function is a value here, exactly as in the React twin, and the two adapters\n * have no behavioural difference left to diverge on. A getter still works, because\n * `composeFontOrigins` calls every function origin once per resolve and a getter ignores\n * the argument it is handed — the re-read the getter form exists for is unaffected. The\n * one shape that changes is a getter returning another ORIGIN (`() => packagedFonts()`),\n * which cannot be told from a resolver by anything; `composeFontOrigins` reports it rather\n * than composing an empty fragment in silence. Wrap that in a `computed` if you need it.\n */\nconst readOrigin = (origin: MaybeRefOrGetter<FontsInput | FontOrigin>): FontOrigin =>\n (typeof origin === 'function' ? origin : toValue(origin)) as FontOrigin;\n\n/**\n * Merge font origins into one stable value for the `fonts` prop of `PptxEditor` or\n * `PptxEditorRoot`, as React's `useFonts`: `useFonts(packagedFonts())`, or\n * `useFonts(brandFragment, packagedFonts())` for brand faces first. Origins compose\n * first-wins in argument order and resolve one after another. The value never changes\n * identity, so the fonts are not replaced on a re-render; `ref` and getter arguments are read\n * again when a deck opens or a family is requested.\n *\n * @public\n */\nexport function useFonts(\n source: MaybeRefOrGetter<FontsInput>,\n ...fragments: readonly MaybeRefOrGetter<FontConfigurationFragment | undefined>[]\n): UseFontsReturn;\n/**\n * The uniform form: every position takes the same `FontOrigin`, so composing two resolvers is\n * one extra argument. A resolver after the first position must carry the\n * `defineFontResolver` mark.\n *\n * @public\n */\nexport function useFonts(...origins: readonly MaybeRefOrGetter<FontOrigin>[]): UseFontsReturn;\nexport function useFonts(\n ...origins: readonly MaybeRefOrGetter<FontsInput | FontOrigin>[]\n): UseFontsReturn {\n const reactiveOrigins = origins;\n const readOrigins = (): readonly FontOrigin[] => reactiveOrigins.map(readOrigin);\n\n // Marked, so this composition can itself be an origin of another list or\n // the `fonts` option of `createPptxEditor` without being read as a zero-argument loader.\n return defineFontResolver((request: FontResolutionRequest) =>\n composeFontOrigins(readOrigins(), request)\n );\n}\n","// The font family picker's behavior as a composable: the Vue twin of the React adapter's\n// `useFontFamily` (packages/react/src/useFontFamily.ts), after DOCX Editor's Vue\n// `useFontFamily` (docx-editor/packages/vue/src/editor/toolbar/useFontFamily.ts): the current\n// value, the offerable families, the enabled state, and the setter, with no UI. PPTX Editor adds\n// the groups of core's `font-picker.ts` (the slide's theme fonts, the deck's fonts, all fonts).\n\nimport { computed, type ComputedRef } from 'vue';\nimport {\n fontPickerGroups,\n isCurrentFontRow,\n type FontPickerGroup,\n type FontPickerRow,\n} from '@pptx-editor.dev/core/editor';\nimport { useEditorCommand, useEditorState, usePptxEditor } from './composables.ts';\n\nconst NO_FAMILIES: readonly string[] = Object.freeze([]);\n\n/** What `useFontFamily` returns, as React's `UseFontFamilyReturn`. @public */\nexport interface UseFontFamilyReturn {\n /** The family of the selected text, or null for a mixed selection or no selection. */\n readonly value: ComputedRef<string | null>;\n /**\n * The theme font the selected text uses (`major` for the headings font, `minor` for the body\n * font), or null when it names a family.\n */\n readonly theme: ComputedRef<'major' | 'minor' | null>;\n /**\n * Apply a family, or a theme font reference (`+mj-lt`, `+mn-lt`) so the text follows a later\n * theme change. A refusal does nothing.\n */\n readonly setValue: (family: string) => void;\n /** Every family the editor offers: standard, configured, embedded, and the deck's own. */\n readonly options: ComputedRef<readonly string[]>;\n /**\n * The packaged picker's groups for the current slide, empty groups left out: the theme fonts\n * (labeled Headings and Body), the other families the deck names, then all families.\n */\n readonly groups: ComputedRef<readonly FontPickerGroup[]>;\n /** Whether a row is the font the selected text uses, for a check mark. */\n readonly isCurrent: (row: FontPickerRow) => boolean;\n /** Whether the engine can change the font now. */\n readonly isEnabled: ComputedRef<boolean>;\n /** Why the font cannot change: a catalog key, or the engine's own text. */\n readonly disabledReason: ComputedRef<string | null>;\n}\n\n/**\n * The font family picker's behavior, with no UI, as React's `useFontFamily` and DOCX Editor's\n * Vue composable of the same name. @public\n */\nexport function useFontFamily(): UseFontFamilyReturn {\n const editorRef = usePptxEditor();\n const cmd = useEditorCommand('font.family');\n // The families change with the deck (embedded and host fonts) and with the slide's theme.\n const revision = useEditorState((s) => s.revision);\n const slide = useEditorState((s) => s.currentSlide);\n const theme = useEditorState((s) => s.format?.fontFamilyTheme ?? null);\n const value = computed(() => (typeof cmd.value.value === 'string' ? cmd.value.value : null));\n const choices = computed(() => {\n // `revision` is the change signal for the deck's fonts.\n void revision.value;\n return {\n groups: fontPickerGroups(editorRef.value, slide.value, ''),\n options: editorRef.value?.fontFamilies() ?? NO_FAMILIES,\n };\n });\n return {\n value,\n theme: computed(() => theme.value),\n setValue: (family) => void cmd.execute(family),\n options: computed(() => choices.value.options),\n groups: computed(() => choices.value.groups),\n isCurrent: (row) => !row.disabled && isCurrentFontRow(row, value.value, theme.value),\n isEnabled: cmd.isEnabled,\n disabledReason: cmd.disabledReason,\n };\n}\n"],"mappings":";AAMA;AAAA,EACE,mBAAAA;AAAA,EACA,sBAAAC;AAAA,EACA,KAAAC;AAAA,EACA,cAAAC;AAAA,EACA,cAAAC;AAAA,OAKK;AACP;AAAA,EACE,sBAAAC;AAAA,EACA;AAAA,OAOK;;;ACjBP;AAAA,EACE,mBAAAC;AAAA,EACA;AAAA,EACA,KAAAC;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AU;AAAA,UAClB,CAAC;AAAA,QACL;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF,CAAC;AAOM,IAAM,aAAa,OAAO,OAAO,mBAAmB;AAAA,EACzD,MAAM;AAAA,EACN,UAAU;AAAA,EACV,SAAS;AAAA,EACT,SAAS;AAAA,EACT;AAAA,EACA,WAAW;AAAA,EACX,aAAa;AAAA,EACb,WAAW;AAAA,EACX,UAAU;AAAA,EACV,WAAW;AAAA,EACX,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,SAAS;AAAA,EACT;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,SAAS;AAAA,EACT,MAAM;AAAA,EACN,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,WAAW;AACb,CAAC;","names":["defineComponent","getCurrentInstance","h","mergeProps","shallowRef","createEditorRefApi","defineComponent","h","onMounted","onUnmounted","provide","shallowRef","watch","translateKeyOrText","createTranslator","getCurrentScope","onScopeDispose","shallowRef","toValue","watch","shallowRef","shallowRef","watch","onScopeDispose","getCurrentScope","toValue","computed","defineComponent","h","inject","provide","shallowRef","watch","Fragment","computed","defineComponent","h","computed","shallowRef","toValue","watch","warnUnsupportedOverride","inject","computed","toValue","warnUnsupportedOverride","shallowRef","watch","cloneVNode","defineComponent","inject","onMounted","provide","ref","shallowRef","watch","computed","inject","onMounted","onScopeDispose","provide","shallowRef","watch","shallowRef","part","inject","defineComponent","cloneVNode","provide","preset","children","ref","onMounted","watch","defineComponent","computed","h","Fragment","Fragment","computed","defineComponent","h","useId","watch","translateDialogErrors","parts","defineComponent","useId","watch","computed","translateDialogErrors","h","Fragment","Fragment","computed","defineComponent","h","useId","watch","commitDialogCommand","translateDialogErrors","translateKeyOrText","parts","defineComponent","useId","watch","commitDialogCommand","computed","translateDialogErrors","text","translateKeyOrText","h","inches","Fragment","computed","defineComponent","h","ref","shallowRef","useId","commitDialogCommand","gradientCss","translateDialogErrors","computed","defineComponent","onMounted","ref","shallowRef","jsx","jsxs","defineComponent","ref","onMounted","shallowRef","computed","computed","defineComponent","onMounted","ref","shallowRef","watch","dialogInitialFocus","translateKeyOrText","computed","toValue","tooltipAttributes","translateKeyOrText","computed","toValue","translateKeyOrText","tooltipAttributes","Fragment","jsx","jsxs","defineComponent","preset","translateKeyOrText","ref","shallowRef","computed","dialogInitialFocus","onMounted","watch","Fragment","jsx","jsxs","parts","defineComponent","ref","shallowRef","commitDialogCommand","computed","translateDialogErrors","useId","gradientCss","h","defineComponent","h","computed","defineComponent","onMounted","ref","toValue","useId","watch","translateDialogErrors","Fragment","jsx","jsxs","computed","translateDialogErrors","toValue","defineComponent","useId","ref","watch","onMounted","shallowRef","shallowRef","Fragment","jsx","jsxs","parts","defineComponent","h","defineComponent","h","ref","useId","defineComponent","ref","watch","jsx","jsxs","defineComponent","ref","watch","Fragment","jsx","jsxs","parts","defineComponent","useId","ref","h","defineComponent","h","useId","takeDialogSection","Fragment","jsx","jsxs","parts","defineComponent","useId","takeDialogSection","h","defineComponent","h","jsx","jsxs","parts","defineComponent","h","h","shallowRef","watch","provide","defineComponent","inject","computed","computed","inject","provide","shallowRef","warnOutsideRoot","computed","defineComponent","inject","onBeforeUnmount","onMounted","onUnmounted","provide","ref","shallowRef","watch","translateKeyOrText","jsx","jsxs","shallowRef","provide","inject","defineComponent","ref","computed","watch","onMounted","onBeforeUnmount","onUnmounted","translateKeyOrText","defineComponent","inject","onScopeDispose","provide","ref","shallowRef","watch","dispatchFindRequest","computed","getCurrentScope","inject","onScopeDispose","provide","shallowRef","watch","shallowRef","inject","computed","provide","getCurrentScope","watch","onScopeDispose","jsx","jsxs","dispatchFindRequest","ref","provide","inject","onScopeDispose","defineComponent","shallowRef","watch","defineComponent","inject","onUnmounted","provide","shallowRef","useId","watch","cloneVNode","defineComponent","Fragment","inject","isVNode","onMounted","ref","shallowRef","watch","translateKeyOrText","computed","getCurrentScope","inject","onScopeDispose","provide","ref","shallowRef","watch","useId","inject","onScopeDispose","watch","shallowRef","getCurrentScope","computed","ref","provide","useId","jsx","jsxs","partProps","flatten","isVNode","Fragment","cloneVNode","defineComponent","text","attrs","inject","ref","onMounted","translateKeyOrText","parts","shallowRef","watch","jsx","shallowRef","onUnmounted","provide","defineComponent","inject","useId","watch","h","shallowRef","watch","defineComponent","h","inject","onBeforeUnmount","onMounted","provide","watch","arrangeMenuRows","warnMenuPart","Teleport","defineComponent","onBeforeUnmount","onMounted","ref","shallowRef","watch","focusMenuRowAtPointer","focusSurfaceOf","popoverScope","jsx","defineComponent","ref","shallowRef","onMounted","watch","onBeforeUnmount","focusSurfaceOf","Teleport","popoverScope","focusMenuRowAtPointer","Teleport","defineComponent","inject","normalizeClass","onBeforeUnmount","ref","shallowRef","watch","tooltipAttributes","focusEdge","focusMenuRowAtPointer","panelItems","popoverScope","translateKeyOrText","inFixedView","placeInFixedFrame","jsx","jsxs","defineComponent","inject","ref","shallowRef","watch","placeInFixedFrame","inFixedView","focusEdge","panelItems","onBeforeUnmount","translateKeyOrText","tooltipAttributes","Teleport","popoverScope","normalizeClass","focusMenuRowAtPointer","defineComponent","inject","provide","SHAPE_GALLERY","chromeControlForSlot","editorCommandFor","sameChromeCommandState","translateKeyOrText","defineComponent","ref","watch","tooltipAttributes","translateKeyOrText","Fragment","jsx","jsxs","defineComponent","ref","watch","translateKeyOrText","tooltipAttributes","slotPartProps","defineComponent","inject","nextTick","onBeforeUnmount","onMounted","ref","Fragment","jsx","jsxs","defineComponent","ref","inject","onMounted","onBeforeUnmount","nextTick","_","slotPartProps","jsx","inject","editorCommandFor","defineComponent","sameChromeCommandState","chromeControlForSlot","translateKeyOrText","jsx","SHAPE_GALLERY","preset","provide","Fragment","defineComponent","inject","isVNode","normalizeClass","provide","ref","watch","translateKeyOrText","warnMenuPart","jsx","jsxs","isVNode","Fragment","defineComponent","inject","normalizeClass","translateKeyOrText","warnMenuPart","provide","ref","watch","jsx","defineComponent","provide","inject","h","onBeforeUnmount","onMounted","watch","warnMenuPart","arrangeMenuRows","shallowRef","watch","h","computed","defineComponent","onBeforeUnmount","onMounted","ref","shallowRef","watch","chromeControlForSlot","tooltipAttributes","groupSlideSections","sectionOfSlide","slideMenuPoint","translateKeyOrText","computed","defineComponent","nextTick","onMounted","onUpdated","provide","ref","shallowRef","useId","watch","tooltipAttributes","groupSlideSections","railOrientationChrome","railRightToLeft","runSlideStep","slideStep","stepCommand","defineComponent","translateKeyOrText","Fragment","jsx","jsxs","NO_LAYOUTS","defineComponent","translateKeyOrText","Comment","defineComponent","inject","isVNode","normalizeClass","provide","shallowRef","jsx","partProps","defineComponent","inject","normalizeClass","isVNode","shallowRef","provide","flatten","Comment","preset","camelize","cloneVNode","defineComponent","h","isVNode","Text","TOOLBAR_NAMED_PARTS","chromeControlForSlot","tooltipAttributes","warnAsChildChild","defineComponent","inject","nextTick","normalizeClass","provide","ref","useId","watch","jsx","jsxs","part","inject","defineComponent","normalizeClass","useId","ref","watch","nextTick","provide","Comment","Text","computed","defineComponent","h","isVNode","normalizeClass","provide","chromeControlForSlot","translateKeyOrText","warnAsChildChild","Fragment","defineComponent","h","inject","ref","colorMenuSelection","dispatchFindRequest","runChromeRow","surfaceInputIn","translateKeyOrText","defineComponent","onBeforeUnmount","ref","shallowRef","useId","jsx","jsxs","defineComponent","ref","useId","shallowRef","onBeforeUnmount","defineComponent","inject","ref","requestLinkPopup","translateKeyOrText","jsx","slotPartProps","defineComponent","inject","ref","translateKeyOrText","requestLinkPopup","defineComponent","ref","Fragment","jsx","jsxs","slotPartProps","defineComponent","ref","defineComponent","ref","chromeOptionChecked","jsx","jsxs","defineComponent","ref","chromeOptionChecked","jsx","jsxs","slotPartProps","defineComponent","inject","ref","text","Fragment","translateKeyOrText","colorMenuSelection","dispatchFindRequest","runChromeRow","surfaceInputIn","h","Fragment","defineComponent","onBeforeUnmount","onMounted","onUpdated","ref","shallowRef","useId","watch","onBeforeUnmount","onMounted","onUpdated","Fragment","jsx","jsxs","defineComponent","ref","useId","shallowRef","onMounted","onUpdated","watch","onBeforeUnmount","PARTS","part","chromeControlForSlot","normalizeClass","flatten","warnAsChildChild","defineComponent","provide","h","translateKeyOrText","isVNode","Comment","Text","parts","computed","defineComponent","tooltipAttributes","isVNode","own","cloneVNode","warnAsChildChild","Text","text","h","definePart","part","chromeControlForSlot","camelize","TOOLBAR_NAMED_PARTS","shallowRef","toValue","shallowRef","toValue","defineComponent","getCurrentScope","nextTick","onMounted","onScopeDispose","ref","shallowRef","toValue","watch","jsx","jsxs","watch","toValue","nextTick","defineComponent","ref","nextTick","onMounted","watch","jsxs","jsx","shallowRef","menuProps","defineComponent","ref","platformShortcuts","radioGroupStep","jsx","jsxs","defineComponent","ref","platformShortcuts","radioGroupStep","jsx","jsxs","sameIndices","defineComponent","ref","onMounted","watch","slideStep","computed","useId","nextTick","shallowRef","groupSlideSections","railRightToLeft","onUpdated","item","runSlideStep","stepCommand","provide","railOrientationChrome","tooltipAttributes","computed","defineComponent","onBeforeUnmount","onScopeDispose","shallowRef","watch","watchEffect","focusSurfaceOf","jsx","jsxs","defineComponent","shallowRef","onScopeDispose","computed","watch","watchEffect","onBeforeUnmount","focusSurfaceOf","jsx","jsxs","defineComponent","computed","groupSlideSections","ref","shallowRef","onMounted","onBeforeUnmount","slideMenuPoint","sectionOfSlide","chromeControlForSlot","translateKeyOrText","tooltipAttributes","watch","Teleport","defineComponent","onMounted","onUnmounted","ref","shallowRef","watch","jsx","jsxs","defineComponent","shallowRef","createTranslator","provide","watch","onMounted","instance","translateKeyOrText","onUnmounted","h","defineComponent","h","defineComponent","h","computed","defineComponent","nextTick","onBeforeUnmount","ref","shallowRef","useId","watch","notesFieldFocused","notesFieldText","notesSelection","onFindShown","defineComponent","onMounted","watch","jsx","jsx","jsxs","ref","computed","watch","onBeforeUnmount","defineComponent","useId","shallowRef","text","notesFieldFocused","notesSelection","notesFieldText","onFindShown","nextTick","computed","defineComponent","shallowRef","useId","jsx","jsxs","shallowRef","computed","defineComponent","useId","computed","defineComponent","ref","shallowRef","watch","jsx","jsxs","defineComponent","computed","shallowRef","ref","watch","defineComponent","h","isVNode","normalizeClass","ref","watch","nextTick","Comment","Text","useId","translateKeyOrText","defineComponent","flatten","isVNode","normalizeClass","useId","ref","watch","nextTick","Comment","Text","translateKeyOrText","h","defineComponent","h","isVNode","normalizeClass","chromeKeepsFocus","warnAsChildChild","partProps","keepFocus","chromeKeepsFocus","defineComponent","h","isVNode","warnAsChildChild","normalizeClass","PARTS","flatten","computed","getCurrentScope","onScopeDispose","shallowRef","toValue","watch","zoomStep","next","computed","zoomStep","getCurrentScope","watch","shallowRef","toValue","onScopeDispose","computed","shallowRef","toValue","watch","shallowRef","toValue","watch","computed","toValue","computed","fontPickerGroups","isCurrentFontRow","computed","fontPickerGroups","isCurrentFontRow","composeFontOrigins","defineFontResolver","partProps","h","defineComponent","getCurrentInstance","shallowRef","createEditorRefApi","mergeProps"]}