@pptx-editor.dev/react 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,3369 @@
1
+ import * as react from 'react';
2
+ import { ReactNode, ReactElement, CSSProperties, ComponentType, MouseEvent } from 'react';
3
+ import { ChromeTranslate, PptxEditorInstance, ColumnsDialogFields, BulletsDialogFields, FontDialogFields, ParagraphDialogFields, SlideBackground, EditorRejection, MenuNamedRow, ChromeSlotId, ChromeMenuId, CanvasMenuKind, SlideSection, CommandResult, EditorCommand, EditorExecOptions, EditorSnapshot, EditorMode, EditorFontsOption, EditorFontError, EditorModule, ColorMode, ChromeGroupId, ChromeControl, SlideshowController, ToolbarValueMap, ToolbarShownValue, SlideRailOrientation, DocumentOpenFailure, RibbonTabId, ResolvedColorMode, DocumentSearchState, DocumentSearchFindOptions, FindMatch, EditorCaret, HistoryGroupBindingOptions, PptxEditorEvents, ShapeStyleChoice, ShapeStyleValue, HyperlinkPopupActions, HyperlinkPopupState, FontResolver, PptxSource, UsePptxSourceOptions, GradientFill, SlideLayoutSummary, ParagraphFormatRead, ParagraphFormatCommand, FontFormatRead, FontFormatCommand, BulletFormatRead, BulletFormat, FontConfigurationFragment, MarkedFontResolver, FontOrigin, FontPickerGroup, FontPickerRow, PopoverAnchorRect, ContextMenuPartName, MenuRowPartName } from '@pptx-editor.dev/core/editor';
4
+ export { BulletFormat, BulletFormatRead, BulletsDialogFields, CanvasMenuKind, ChromeControl, ChromeGroupId, ChromeMenuId, ChromeSlotId, ChromeTranslate, ColorMode, ColumnsDialogFields, CommandResult, ContextMenuPartName, DEFAULT_FONT, DocumentOpenFailure, DocumentSearchFindOptions, DocumentSearchState, EditorCaret, EditorCommand, EditorExecOptions, EditorFontError, EditorFontsOption, EditorMode, EditorModule, EditorRejection, EditorRemoval, EditorSnapshot, FontConfigurationBase, FontConfigurationFragment, FontDialogFields, FontFormatCommand, FontFormatRead, FontLoadFailure, FontLoadFailureReason, FontOrigin, FontPickerGroup, FontPickerGroupId, FontPickerRow, FontResolutionRequest, FontResolver, FontResolverMark, FontUrlSource, GradientFill, HistoryGroupBindingOptions, HyperlinkPopupActions, HyperlinkPopupLink, HyperlinkPopupMode, HyperlinkPopupState, LoadFontsRequest, LoadFontsResult, MAX_RESOLVER_FAMILIES, MarkedFontResolver, MenuNamedRow, MenuRowPartName, ParagraphDialogFields, ParagraphFormatCommand, ParagraphFormatRead, PptxEditorEvents, PptxEditorInstance, PptxFontOrigin, PptxFontsInput, PptxFontsSource, PptxSource, ResolvedColorMode, RibbonTabId, ShapeStyleChoice, ShapeStyleValue, SlideBackground, SlideLayoutSummary, SlideRailOrientation, SlideSection, SlideshowController, ToolbarShownValue, ToolbarValueMap, UsePptxSourceOptions, composeFontConfiguration, composeFontOrigins, createFontSource, deferFonts, defineFontResolver, gradientCss, isFontResolver, loadFonts, platformShortcuts } from '@pptx-editor.dev/core/editor';
5
+ import { Translate, LocaleCatalog } from '@pptx-editor.dev/i18n';
6
+ import { FontConfiguration } from '@pptx-editor.dev/core/contracts';
7
+ export { EditorFontErrorCode, FontConfiguration, FontFaceRequest, FontSource, FontSourceSubstitution } from '@pptx-editor.dev/core/contracts';
8
+
9
+ /** Shared props of every part. @public */
10
+ interface HyperLinkPartProps {
11
+ readonly className?: string;
12
+ /** Put this part's wiring on the one child element instead of the default element. */
13
+ readonly asChild?: boolean;
14
+ /** Render nothing: inside the default arrangement this removes the part. */
15
+ readonly hidden?: boolean;
16
+ readonly children?: ReactNode;
17
+ }
18
+ /** Props of the action parts, which also take an icon. @public */
19
+ interface HyperLinkActionProps extends HyperLinkPartProps {
20
+ /** The glyph; falls back to `children`, then to the part's default icon. */
21
+ readonly icon?: ReactNode;
22
+ }
23
+ /** Props of `PptxEditor.HyperLink`. @public */
24
+ interface HyperLinkProps extends HyperLinkPartProps {
25
+ /** Render the packaged parts. `false` renders only the panel and your children. */
26
+ readonly preset?: boolean;
27
+ }
28
+ /** The target. A safe link opens in a new tab; any other shows as text. @public */
29
+ declare function HyperLinkUrl({ className, asChild, hidden, children }: HyperLinkPartProps): ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
30
+ declare namespace HyperLinkUrl {
31
+ var pptxHyperLinkPart: "Url";
32
+ }
33
+ /** Copy the safe target. @public */
34
+ declare function HyperLinkCopy(props: HyperLinkActionProps): ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
35
+ declare namespace HyperLinkCopy {
36
+ var pptxHyperLinkPart: "Copy";
37
+ }
38
+ /** Switch to the URL field. @public */
39
+ declare function HyperLinkEdit(props: HyperLinkActionProps): ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
40
+ declare namespace HyperLinkEdit {
41
+ var pptxHyperLinkPart: "Edit";
42
+ }
43
+ /** Remove the link, keeping its text. @public */
44
+ declare function HyperLinkUnlink(props: HyperLinkActionProps): ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
45
+ declare namespace HyperLinkUnlink {
46
+ var pptxHyperLinkPart: "Unlink";
47
+ }
48
+ /** The URL field. Enter applies. @public */
49
+ declare function HyperLinkFields({ className, hidden }: HyperLinkPartProps): react.JSX.Element | null;
50
+ declare namespace HyperLinkFields {
51
+ var pptxHyperLinkPart: "Fields";
52
+ }
53
+ /** Why the last Apply or Unlink was refused. @public */
54
+ declare function HyperLinkError({ className, hidden }: HyperLinkPartProps): react.JSX.Element | null;
55
+ declare namespace HyperLinkError {
56
+ var pptxHyperLinkPart: "Error";
57
+ }
58
+ /** Apply the draft. @public */
59
+ declare function HyperLinkApply({ className, asChild, hidden, children }: HyperLinkPartProps): ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
60
+ declare namespace HyperLinkApply {
61
+ var pptxHyperLinkPart: "Apply";
62
+ }
63
+ /** Close without applying. @public */
64
+ declare function HyperLinkCancel({ className, asChild, hidden, children }: HyperLinkPartProps): ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
65
+ declare namespace HyperLinkCancel {
66
+ var pptxHyperLinkPart: "Cancel";
67
+ }
68
+ /** The link popup compound. @public */
69
+ interface HyperLinkNamespace {
70
+ (props: HyperLinkProps): ReactNode;
71
+ readonly Url: typeof HyperLinkUrl;
72
+ readonly Copy: typeof HyperLinkCopy;
73
+ readonly Edit: typeof HyperLinkEdit;
74
+ readonly Unlink: typeof HyperLinkUnlink;
75
+ readonly Fields: typeof HyperLinkFields;
76
+ readonly Error: typeof HyperLinkError;
77
+ readonly Apply: typeof HyperLinkApply;
78
+ readonly Cancel: typeof HyperLinkCancel;
79
+ }
80
+ /** `PptxEditor.HyperLink`: the link popup with named parts. @public */
81
+ declare const HyperLink: HyperLinkNamespace;
82
+
83
+ /** @jsxImportSource react */
84
+
85
+ /** Open the find bar of `editor`: to find, or with the replace row when `replace`. @public */
86
+ declare function requestFindBar(editor: PptxEditorInstance | null, replace?: boolean): void;
87
+ /** The props of `FindBar`. @public */
88
+ interface FindBarProps {
89
+ /**
90
+ * Your translation function for the bar, as DOCX Editor's `t` on its find pane. Without it,
91
+ * the root's `locale` gives the labels.
92
+ */
93
+ readonly t?: ChromeTranslate;
94
+ /** Appended after the `pptx-find` class. */
95
+ className?: string;
96
+ }
97
+ /** The find and replace bar. Render one inside the editor's viewport, over the canvas. @public */
98
+ declare const FindBar: (props: FindBarProps) => ReactNode;
99
+
100
+ /** @jsxImportSource react */
101
+
102
+ /**
103
+ * Presentation overrides for a dialog part. @public
104
+ *
105
+ * Anything beyond these members reaches the rendered element, so a part takes an `id`, an
106
+ * `aria-*` label, or a `data-*` test hook. The part's own wiring wins every collision: a host
107
+ * cannot replace Apply's handler or its `data-pptx-part` marker by passing one. To own the
108
+ * element and its handler outright, pass `asChild` and supply your own.
109
+ */
110
+ interface DialogPartProps {
111
+ /** A class name added to the part's element. */
112
+ readonly className?: string;
113
+ /** Inline styles for the part's element. */
114
+ readonly style?: CSSProperties;
115
+ /** Remove the part from the arrangement. */
116
+ readonly hidden?: boolean;
117
+ /** Apply the part's wiring to the single child element. */
118
+ readonly asChild?: boolean;
119
+ /** Content in place of the part's default content. */
120
+ readonly children?: ReactNode;
121
+ /** The id of the part's element. */
122
+ readonly id?: string;
123
+ /** The tooltip of the part's element. */
124
+ readonly title?: string;
125
+ /** The accessible name of the part's element. */
126
+ readonly 'aria-label'?: string;
127
+ /** `data-*` attributes, passed to the part's element. */
128
+ readonly [attribute: `data-${string}`]: unknown;
129
+ }
130
+ /** Layout customization for a packaged dialog. @public */
131
+ interface DialogCustomizationProps {
132
+ /** A class name added to the dialog surface. */
133
+ readonly className?: string;
134
+ /** Styles added to the dialog surface. */
135
+ readonly style?: CSSProperties;
136
+ /**
137
+ * `true` (default): the default arrangement, with named children replacing their parts in
138
+ * place and other children appended. `false`: only the children.
139
+ */
140
+ readonly preset?: boolean;
141
+ /** Named parts that replace the defaults, or the whole arrangement with `preset={false}`. */
142
+ readonly children?: ReactNode;
143
+ }
144
+ /** A dialog's draft and actions, as its parts and a host's own fields read them. @public */
145
+ interface UseDialogReturn<Fields extends object> {
146
+ /** The draft values. */
147
+ readonly values: Fields;
148
+ /** Change one field of the draft. */
149
+ setValue<K extends keyof Fields>(name: K, value: Fields[K]): void;
150
+ /** Translated messages per field, and `form` for the whole draft. */
151
+ readonly errors: Readonly<Partial<Record<Extract<keyof Fields, string> | 'form', string>>>;
152
+ /** False when the dialog cannot apply now (no document, viewing mode). */
153
+ readonly isEnabled: boolean;
154
+ /** Validate and commit the draft. The dialog closes when the document took it. */
155
+ apply(): void;
156
+ /** Discard the draft and close. */
157
+ cancel(): void;
158
+ }
159
+
160
+ /** Props for `PptxEditor.ColumnsDialog`. @public */
161
+ interface ColumnsDialogProps extends DialogCustomizationProps {
162
+ /** Whether the dialog is shown. The host owns this state. */
163
+ readonly open: boolean;
164
+ /** Called on Cancel, Escape, a click on the backdrop, and after OK applies. */
165
+ readonly onClose: () => void;
166
+ }
167
+ /**
168
+ * The field names of the Columns dialog, for `ColumnsDialog.Field`: both fields (`columns`), or
169
+ * one of them, named as its `ColumnsDialogFields` key. @public
170
+ */
171
+ type ColumnsDialogFieldName = 'columns' | 'count' | 'spacing';
172
+ /** The Columns draft and its actions, for a host's own field inside the dialog. @public */
173
+ type UseColumnsDialogReturn = UseDialogReturn<ColumnsDialogFields>;
174
+ declare function ColumnsDialogRoot({ open, onClose, className, style, preset, children, }: ColumnsDialogProps): ReactNode;
175
+ /**
176
+ * Read the draft of the enclosing Columns dialog, for a host's own field inside it. It does not
177
+ * open the dialog: `useEditorDialog('columns').open()` does. @public
178
+ */
179
+ declare function useColumnsDialog(): UseColumnsDialogReturn;
180
+ /**
181
+ * Home > Columns > More Columns: the number of text columns of the selected shapes and the
182
+ * spacing between them, applied as one undo step, with replaceable parts (`Header`, `Title`,
183
+ * `Body`, `Footer`, `Field`, `Error`, `Apply`, `Cancel`).
184
+ *
185
+ * @public
186
+ */
187
+ declare const ColumnsDialog: typeof ColumnsDialogRoot & {
188
+ Header: (props: DialogPartProps) => ReactNode;
189
+ Title: (props: DialogPartProps) => ReactNode;
190
+ Body: (props: DialogPartProps) => ReactNode;
191
+ Footer: (props: DialogPartProps) => ReactNode;
192
+ Field: (props: DialogPartProps & {
193
+ readonly name: ColumnsDialogFieldName;
194
+ }) => ReactNode;
195
+ Error: (props: DialogPartProps) => ReactNode;
196
+ Apply: (props: DialogPartProps) => ReactNode;
197
+ Cancel: (props: DialogPartProps) => ReactNode;
198
+ };
199
+
200
+ /** Props for `PptxEditor.BulletsAndNumberingDialog`. @public */
201
+ interface BulletsAndNumberingDialogProps extends DialogCustomizationProps {
202
+ /** Whether the dialog is shown. The host owns this state. */
203
+ readonly open: boolean;
204
+ /** Called on Cancel, Escape, a click on the backdrop, and after OK applies. */
205
+ readonly onClose: () => void;
206
+ }
207
+ /**
208
+ * The field names of the Bullets and Numbering dialog, for `BulletsAndNumberingDialog.Field`:
209
+ * the fields of a whole tab (`bullet`, `number`), or one field, named as its input: `style`,
210
+ * `char`, `font`, `sizePercent`, and `color` on the Bulleted tab; `numberStyle`, `numberSizePercent`,
211
+ * `numberColor`, and `startAt` on the Numbered tab. @public
212
+ */
213
+ type BulletsAndNumberingDialogFieldName = 'bullet' | 'number' | 'style' | 'char' | 'font' | 'sizePercent' | 'color' | 'numberStyle' | 'numberSizePercent' | 'numberColor' | 'startAt';
214
+ /** The Bullets and Numbering draft and its actions, for a host's own field. @public */
215
+ type UseBulletsAndNumberingDialogReturn = UseDialogReturn<BulletsDialogFields>;
216
+ declare function BulletsAndNumberingDialogRoot({ open, onClose, className, style, preset, children, }: BulletsAndNumberingDialogProps): ReactNode;
217
+ /**
218
+ * Read the draft of the enclosing Bullets and Numbering dialog, for a host's own field inside
219
+ * it. It does not open the dialog: `useEditorDialog('bulletsAndNumbering').open()` does.
220
+ * @public
221
+ */
222
+ declare function useBulletsAndNumberingDialog(): UseBulletsAndNumberingDialogReturn;
223
+ /**
224
+ * Format > Bullets and Numbering: the bullet or numbering style, size, color, and start number
225
+ * of the selected paragraphs, applied as one undo step, with replaceable parts (`Header`,
226
+ * `Title`, `Body`, `Footer`, `Field`, `Error`, `Apply`, `Cancel`).
227
+ *
228
+ * @public
229
+ */
230
+ declare const BulletsAndNumberingDialog: typeof BulletsAndNumberingDialogRoot & {
231
+ Header: (props: DialogPartProps) => ReactNode;
232
+ Title: (props: DialogPartProps) => ReactNode;
233
+ Body: (props: DialogPartProps) => ReactNode;
234
+ Footer: (props: DialogPartProps) => ReactNode;
235
+ Field: (props: DialogPartProps & {
236
+ readonly name: BulletsAndNumberingDialogFieldName;
237
+ }) => ReactNode;
238
+ Error: (props: DialogPartProps) => ReactNode;
239
+ Apply: (props: DialogPartProps) => ReactNode;
240
+ Cancel: (props: DialogPartProps) => ReactNode;
241
+ };
242
+
243
+ /** Props for `PptxEditor.FontDialog`. @public */
244
+ interface FontDialogProps extends DialogCustomizationProps {
245
+ /** Whether the dialog is shown. The host owns this state. */
246
+ readonly open: boolean;
247
+ /** Called on Cancel, Escape, a click on the backdrop, and after OK applies. */
248
+ readonly onClose: () => void;
249
+ }
250
+ /**
251
+ * The field names of the Font dialog, for `FontDialog.Field`: a section of the Font tab
252
+ * (`allText`, `effects`) or one field, named as its `FontDialogFields` key, on either tab.
253
+ * @public
254
+ */
255
+ type FontDialogFieldName = 'allText' | 'effects' | 'fontFamily' | 'style' | 'size' | 'color' | 'underline' | 'underlineColor' | 'strike' | 'doubleStrike' | 'superscript' | 'offset' | 'subscript' | 'smallCaps' | 'allCaps' | 'spacing' | 'by' | 'kerning' | 'kerningAt';
256
+ /** The Font draft and its actions, for a host's own field inside the dialog. @public */
257
+ type UseFontDialogReturn = UseDialogReturn<FontDialogFields>;
258
+ declare function FontDialogRoot({ open, onClose, className, style, preset, children, }: FontDialogProps): ReactNode;
259
+ /**
260
+ * Read the draft of the enclosing Font dialog, for a host's own field inside it. It does not
261
+ * open the dialog: `useEditorDialog('font').open()` does. @public
262
+ */
263
+ declare function useFontDialog(): UseFontDialogReturn;
264
+ /**
265
+ * Format > Font: the font, style, size, underline, effects, character spacing, and kerning of
266
+ * the selected text, applied as one undo step, with replaceable parts (`Header`, `Title`,
267
+ * `Body`, `Footer`, `Field`, `Error`, `Apply`, `Cancel`).
268
+ *
269
+ * @public
270
+ */
271
+ declare const FontDialog: typeof FontDialogRoot & {
272
+ Header: (props: DialogPartProps) => ReactNode;
273
+ Title: (props: DialogPartProps) => ReactNode;
274
+ Body: (props: DialogPartProps) => ReactNode;
275
+ Footer: (props: DialogPartProps) => ReactNode;
276
+ Field: (props: DialogPartProps & {
277
+ readonly name: FontDialogFieldName;
278
+ }) => ReactNode;
279
+ Error: (props: DialogPartProps) => ReactNode;
280
+ Apply: (props: DialogPartProps) => ReactNode;
281
+ Cancel: (props: DialogPartProps) => ReactNode;
282
+ };
283
+
284
+ /** Props for `PptxEditor.ParagraphDialog`. @public */
285
+ interface ParagraphDialogProps extends DialogCustomizationProps {
286
+ /** Whether the dialog is shown. The host owns this state. */
287
+ readonly open: boolean;
288
+ /** Called on Cancel, Escape, a click on the backdrop, and after OK applies. */
289
+ readonly onClose: () => void;
290
+ }
291
+ /**
292
+ * The field names of the Paragraph dialog, for `ParagraphDialog.Field`: a section (`general`,
293
+ * `indentation`, `spacing`) or one field in it, named as its `ParagraphDialogFields` key. A
294
+ * spacing field holds its unit list. @public
295
+ */
296
+ type ParagraphDialogFieldName = 'general' | 'indentation' | 'spacing' | 'alignment' | 'indentLeft' | 'special' | 'specialBy' | 'spaceBefore' | 'spaceAfter' | 'lineRule' | 'lineAt';
297
+ /** The Paragraph draft and its actions, for a host's own field inside the dialog. @public */
298
+ type UseParagraphDialogReturn = UseDialogReturn<ParagraphDialogFields>;
299
+ declare function ParagraphDialogRoot({ open, onClose, className, style, preset, children, }: ParagraphDialogProps): ReactNode;
300
+ /**
301
+ * Read the draft of the enclosing Paragraph dialog, for a host's own field inside it. It does
302
+ * not open the dialog: `useEditorDialog('paragraph').open()` does. @public
303
+ */
304
+ declare function useParagraphDialog(): UseParagraphDialogReturn;
305
+ /**
306
+ * Format > Paragraph: alignment, indents, spacing, and line spacing of the selected paragraphs,
307
+ * applied as one undo step, with replaceable parts (`Header`, `Title`, `Body`, `Footer`,
308
+ * `Field`, `Error`, `Apply`, `Cancel`).
309
+ *
310
+ * @example
311
+ * ```tsx
312
+ * <PptxEditor.ParagraphDialog {...props}>
313
+ * <PptxEditor.ParagraphDialog.Field name="indentation" hidden />
314
+ * </PptxEditor.ParagraphDialog>
315
+ * ```
316
+ *
317
+ * @public
318
+ */
319
+ declare const ParagraphDialog: typeof ParagraphDialogRoot & {
320
+ Header: (props: DialogPartProps) => ReactNode;
321
+ Title: (props: DialogPartProps) => ReactNode;
322
+ Body: (props: DialogPartProps) => ReactNode;
323
+ Footer: (props: DialogPartProps) => ReactNode;
324
+ Field: (props: DialogPartProps & {
325
+ readonly name: ParagraphDialogFieldName;
326
+ }) => ReactNode;
327
+ Error: (props: DialogPartProps) => ReactNode;
328
+ Apply: (props: DialogPartProps) => ReactNode;
329
+ Cancel: (props: DialogPartProps) => ReactNode;
330
+ };
331
+
332
+ /** The draft of the Format Picture dialog, in inches, degrees, and percent. @public */
333
+ interface ImagePropertiesDialogFields {
334
+ /** Width in inches, on the slide (`SelectedImageState.widthEmu`). */
335
+ readonly width: number;
336
+ /** Height in inches, on the slide (`SelectedImageState.heightEmu`). */
337
+ readonly height: number;
338
+ /** Lock aspect ratio: a width change scales the height, and the other way round. */
339
+ readonly lockAspect: boolean;
340
+ /** Rotation in degrees, clockwise. */
341
+ readonly rotation: number;
342
+ /** Crop of the left edge, in percent of the image; a negative value adds space. */
343
+ readonly cropLeft: number;
344
+ /** Crop of the top edge, in percent of the image. */
345
+ readonly cropTop: number;
346
+ /** Crop of the right edge, in percent of the image. */
347
+ readonly cropRight: number;
348
+ /** Crop of the bottom edge, in percent of the image. */
349
+ readonly cropBottom: number;
350
+ }
351
+ /** The Format Picture draft and its actions. @public */
352
+ type UseImagePropertiesDialogReturn = UseDialogReturn<ImagePropertiesDialogFields>;
353
+ /** The field names of the Format Picture dialog, for `ImagePropertiesDialog.Field`. @public */
354
+ type ImagePropertiesDialogFieldName = 'size' | 'rotation' | 'crop';
355
+ /** Props for `PptxEditor.ImagePropertiesDialog`. @public */
356
+ interface ImagePropertiesDialogProps extends DialogCustomizationProps {
357
+ /** Whether the dialog is shown. The host owns this state. */
358
+ readonly open: boolean;
359
+ /** Called on Cancel, Escape, a click on the backdrop, and after OK. */
360
+ readonly onClose: () => void;
361
+ }
362
+ declare function ImagePropertiesDialogRoot(props: ImagePropertiesDialogProps): ReactNode;
363
+ /**
364
+ * Read the draft of the enclosing Format Picture dialog, for a host's own field inside it. It
365
+ * does not open the dialog: `useEditorDialog('imageProperties').open()` does. @public
366
+ */
367
+ declare function useImagePropertiesDialog(): UseImagePropertiesDialogReturn;
368
+ /**
369
+ * Format Picture: size, rotation, and crop position of the selected picture, with replaceable
370
+ * parts (`Header`, `Title`, `Body`, `Footer`, `Field`, `Error`, `Apply`, `Cancel`).
371
+ *
372
+ * @example
373
+ * ```tsx
374
+ * <PptxEditor.ImagePropertiesDialog {...props}>
375
+ * <PptxEditor.ImagePropertiesDialog.Field name="rotation" hidden />
376
+ * </PptxEditor.ImagePropertiesDialog>
377
+ * ```
378
+ *
379
+ * @public
380
+ */
381
+ declare const ImagePropertiesDialog: typeof ImagePropertiesDialogRoot & {
382
+ Header: (props: DialogPartProps) => ReactNode;
383
+ Title: (props: DialogPartProps) => ReactNode;
384
+ Body: (props: DialogPartProps) => ReactNode;
385
+ Footer: (props: DialogPartProps) => ReactNode;
386
+ Field: (props: DialogPartProps & {
387
+ readonly name: ImagePropertiesDialogFieldName;
388
+ }) => ReactNode;
389
+ Error: (props: DialogPartProps) => ReactNode;
390
+ Apply: (props: DialogPartProps) => ReactNode;
391
+ Cancel: (props: DialogPartProps) => ReactNode;
392
+ };
393
+
394
+ /** The draft of the Alt Text dialog. @public */
395
+ interface ImageAltTextDialogFields {
396
+ /** The description a screen reader reads (`p:cNvPr/@descr`). */
397
+ readonly description: string;
398
+ /** The title (`p:cNvPr/@title`). */
399
+ readonly title: string;
400
+ /** Mark as decorative: a screen reader skips the element, and the description is dropped. */
401
+ readonly decorative: boolean;
402
+ }
403
+ /** The Alt Text draft and its actions. @public */
404
+ type UseImageAltTextDialogReturn = UseDialogReturn<ImageAltTextDialogFields>;
405
+ /** The field names of the Alt Text dialog, for `ImageAltTextDialog.Field`. @public */
406
+ type ImageAltTextDialogFieldName = 'description' | 'title' | 'decorative';
407
+ /** Props for `PptxEditor.ImageAltTextDialog`. @public */
408
+ interface ImageAltTextDialogProps extends DialogCustomizationProps {
409
+ /** Whether the dialog is shown. The host owns this state. */
410
+ readonly open: boolean;
411
+ /** Called on Cancel, Escape, a click on the backdrop, and after OK. */
412
+ readonly onClose: () => void;
413
+ }
414
+ declare function ImageAltTextDialogRoot(props: ImageAltTextDialogProps): ReactNode;
415
+ /**
416
+ * Read the draft of the enclosing Alt Text dialog, for a host's own field inside it. It does
417
+ * not open the dialog: `useEditorDialog('imageAltText').open()` does. @public
418
+ */
419
+ declare function useImageAltTextDialog(): UseImageAltTextDialogReturn;
420
+ /**
421
+ * Alt text of the selected element: description, title, and "Mark as decorative", with
422
+ * replaceable parts (`Header`, `Title`, `Body`, `Footer`, `Field`, `Error`, `Apply`, `Cancel`).
423
+ *
424
+ * @example
425
+ * ```tsx
426
+ * <PptxEditor.ImageAltTextDialog {...props}>
427
+ * <PptxEditor.ImageAltTextDialog.Field name="title" hidden />
428
+ * </PptxEditor.ImageAltTextDialog>
429
+ * ```
430
+ *
431
+ * @public
432
+ */
433
+ declare const ImageAltTextDialog: typeof ImageAltTextDialogRoot & {
434
+ Header: (props: DialogPartProps) => ReactNode;
435
+ Title: (props: DialogPartProps) => ReactNode;
436
+ Body: (props: DialogPartProps) => ReactNode;
437
+ Footer: (props: DialogPartProps) => ReactNode;
438
+ Field: (props: DialogPartProps & {
439
+ readonly name: ImageAltTextDialogFieldName;
440
+ }) => ReactNode;
441
+ Error: (props: DialogPartProps) => ReactNode;
442
+ Apply: (props: DialogPartProps) => ReactNode;
443
+ Cancel: (props: DialogPartProps) => ReactNode;
444
+ };
445
+
446
+ /**
447
+ * The draft of the Background dialog. `background` is the fill OK applies: a fill, `null` for
448
+ * the layout's background, or `undefined` to keep the slide's own fill. @public
449
+ */
450
+ interface BackgroundDialogFields {
451
+ /** The fill OK applies: a fill, `null` for the layout's background, `undefined` to keep the slide's own. */
452
+ readonly background: SlideBackground | null | undefined;
453
+ /** Apply the fill to every slide. */
454
+ readonly allSlides: boolean;
455
+ }
456
+ /** The Background draft and its actions. @public */
457
+ interface UseBackgroundDialogReturn extends UseDialogReturn<BackgroundDialogFields> {
458
+ /** Pick the layout's background in the draft. */
459
+ reset(): void;
460
+ }
461
+ /**
462
+ * The field names of the Background dialog, for `BackgroundDialog.Field`: one per fill kind
463
+ * (`SlideBackground['kind']`), and Apply to all slides. @public
464
+ */
465
+ type BackgroundDialogFieldName = 'solid' | 'gradient' | 'picture' | 'allSlides';
466
+ /** Props for `PptxEditor.BackgroundDialog`. @public */
467
+ interface BackgroundDialogProps extends DialogCustomizationProps {
468
+ /** Whether the dialog is shown. The host owns this state. */
469
+ readonly open: boolean;
470
+ /** Called on Cancel, Escape, a click on the backdrop, and after OK. */
471
+ readonly onClose: () => void;
472
+ }
473
+ declare function BackgroundDialogRoot(props: BackgroundDialogProps): ReactNode;
474
+ /**
475
+ * Read the draft of the enclosing Background dialog, for a host's own field inside it. It does
476
+ * not open the dialog: `useEditorDialog('background').open()` does. @public
477
+ */
478
+ declare function useBackgroundDialog(): UseBackgroundDialogReturn;
479
+ /**
480
+ * Change the slide background, with replaceable parts (`Header`, `Title`, `Body`, `Footer`,
481
+ * `Field`, `Error`, `Reset`, `Apply`, `Cancel`).
482
+ *
483
+ * @example
484
+ * ```tsx
485
+ * <PptxEditor.BackgroundDialog {...props}>
486
+ * <PptxEditor.BackgroundDialog.Field name="picture" hidden />
487
+ * </PptxEditor.BackgroundDialog>
488
+ * ```
489
+ *
490
+ * @public
491
+ */
492
+ declare const BackgroundDialog: typeof BackgroundDialogRoot & {
493
+ Header: (props: DialogPartProps) => ReactNode;
494
+ Title: (props: DialogPartProps) => ReactNode;
495
+ Body: (props: DialogPartProps) => ReactNode;
496
+ Footer: (props: DialogPartProps) => ReactNode;
497
+ Field: (props: DialogPartProps & {
498
+ readonly name: BackgroundDialogFieldName;
499
+ }) => ReactNode;
500
+ Error: (props: DialogPartProps) => ReactNode;
501
+ Reset: (props: DialogPartProps) => ReactNode;
502
+ Apply: (props: DialogPartProps) => ReactNode;
503
+ Cancel: (props: DialogPartProps) => ReactNode;
504
+ };
505
+
506
+ /**
507
+ * The draft of the Page setup dialog. `theme` keeps the name of the dialog's `theme` and
508
+ * `onThemeChange` props on `main`. @public
509
+ */
510
+ interface PageSetupDialogFields {
511
+ /** The chrome theme the appearance choice shows. */
512
+ readonly theme: 'light' | 'dark';
513
+ }
514
+ /** The Page setup draft and its actions. @public */
515
+ type UsePageSetupDialogReturn = UseDialogReturn<PageSetupDialogFields>;
516
+ /** The field names of the Page setup dialog, for `PageSetupDialog.Field`. @public */
517
+ type PageSetupDialogFieldName = 'slideSize' | 'theme' | 'fonts' | 'substitutes';
518
+ /** Props for `PptxEditor.PageSetupDialog`. @public */
519
+ interface PageSetupDialogProps extends DialogCustomizationProps {
520
+ /** Whether the dialog is shown. The host owns this state. */
521
+ readonly open: boolean;
522
+ /** Called on Cancel, Escape, a click on the backdrop, and after OK. */
523
+ readonly onClose: () => void;
524
+ /** The chrome theme; the appearance choice shows only with `onThemeChange`. */
525
+ readonly theme?: 'light' | 'dark';
526
+ /** Called by OK when the appearance choice changed. */
527
+ readonly onThemeChange?: (theme: 'light' | 'dark') => void;
528
+ }
529
+ declare function PageSetupDialogRoot(props: PageSetupDialogProps): ReactNode;
530
+ /**
531
+ * Read the draft of the enclosing Page setup dialog, for a host's own field inside it. It does
532
+ * not open the dialog: `useEditorDialog('pageSetup').open()` does. @public
533
+ */
534
+ declare function usePageSetupDialog(): UsePageSetupDialogReturn;
535
+ /**
536
+ * Page setup: slide size, appearance, and fonts, with replaceable parts (`Header`, `Title`,
537
+ * `Body`, `Footer`, `Field`, `Error`, `Apply`, `Cancel`).
538
+ *
539
+ * @example
540
+ * ```tsx
541
+ * <PptxEditor.PageSetupDialog {...props}>
542
+ * <PptxEditor.PageSetupDialog.Field name="substitutes" hidden />
543
+ * <PptxEditor.PageSetupDialog.Apply className="acme-primary" />
544
+ * </PptxEditor.PageSetupDialog>
545
+ * ```
546
+ *
547
+ * @public
548
+ */
549
+ declare const PageSetupDialog: typeof PageSetupDialogRoot & {
550
+ Header: (props: DialogPartProps) => ReactNode;
551
+ Title: (props: DialogPartProps) => ReactNode;
552
+ Body: (props: DialogPartProps) => ReactNode;
553
+ Footer: (props: DialogPartProps) => ReactNode;
554
+ Field: (props: DialogPartProps & {
555
+ readonly name: PageSetupDialogFieldName;
556
+ }) => ReactNode;
557
+ Error: (props: DialogPartProps) => ReactNode;
558
+ Apply: (props: DialogPartProps) => ReactNode;
559
+ Cancel: (props: DialogPartProps) => ReactNode;
560
+ };
561
+
562
+ /** Props for `PptxEditor.Loading`. @public */
563
+ interface LoadingProps {
564
+ /**
565
+ * An extra host condition, OR-ed with the editor's own. The default already shows the screen
566
+ * while the editor has no deck, so pass this only for work the editor cannot see, such as a
567
+ * host that mounts the root after its own fetch.
568
+ */
569
+ readonly when?: boolean;
570
+ /**
571
+ * Pin the screen over the nearest positioned ancestor, so it covers the previous deck while
572
+ * the next one opens. A short appearance delay keeps a fast open from flashing it. Without
573
+ * `overlay`, the screen is an in-flow box that fills its parent.
574
+ */
575
+ readonly overlay?: boolean;
576
+ /** Appended after the `pptx-editor pptx-loading` classes. */
577
+ readonly className?: string;
578
+ /** Inline styles for the loading container. */
579
+ readonly style?: CSSProperties;
580
+ /**
581
+ * Your own indicator in place of the packaged spinner, centered on the slide-shaped sheet.
582
+ * Include text for screen readers, as the packaged indicator does.
583
+ */
584
+ readonly indicator?: ReactNode;
585
+ /** The whole loading screen in place of the packaged sheet. */
586
+ readonly children?: ReactNode;
587
+ }
588
+ /** Props for `PptxEditor.Loading.Spinner`. @public */
589
+ interface LoadingSpinnerProps {
590
+ /** Appended after the `pptx-loading__spinner` class. */
591
+ readonly className?: string;
592
+ }
593
+ /**
594
+ * The packaged spinner on its own, to compose into custom `children`. It is decorative
595
+ * (`aria-hidden`), so give the surrounding screen its own text. @public
596
+ */
597
+ declare function LoadingSpinner({ className }: LoadingSpinnerProps): react.JSX.Element;
598
+ /** The loading part, with the packaged spinner as a static. @public */
599
+ interface LoadingComponent {
600
+ /** Renders the loading screen, or nothing once the deck is ready. */
601
+ (props: LoadingProps): ReactNode;
602
+ /** The packaged indicator, to compose into custom children. */
603
+ readonly Spinner: typeof LoadingSpinner;
604
+ }
605
+ /**
606
+ * Shows a slide-shaped sheet with a spinner while the editor has no deck, and while a deck
607
+ * opens; renders nothing once the deck is ready. A parse failure clears it, so a broken file
608
+ * never spins forever: report it from `snapshot().error`. Compose it inside a positioned box
609
+ * with `overlay` to cover the previous deck while the next one opens:
610
+ *
611
+ * ```tsx
612
+ * <PptxEditor.Root document={bytes}>
613
+ * <PptxEditor.Viewport>
614
+ * <div style={{ position: 'relative', flex: 1 }}>
615
+ * <PptxEditor.Content />
616
+ * <PptxEditor.Loading overlay />
617
+ * </div>
618
+ * </PptxEditor.Viewport>
619
+ * </PptxEditor.Root>
620
+ * ```
621
+ *
622
+ * Outside a `PptxEditor.Root` it always shows, because no editor reports otherwise.
623
+ *
624
+ * @public
625
+ */
626
+ declare const Loading: LoadingComponent;
627
+
628
+ /** @jsxImportSource react */
629
+
630
+ /** The message for a refusal: its reason, with the detail where the reason names one. @public */
631
+ declare function rejectionMessage(t: Translate, rejection: EditorRejection): string;
632
+ /** The props of `EditNotice`. @public */
633
+ interface EditNoticeProps {
634
+ /**
635
+ * Your translation function for the notice, as DOCX Editor's `t` on its notices. Without it,
636
+ * the root's `locale` gives the labels.
637
+ */
638
+ readonly t?: ChromeTranslate;
639
+ /** Appended after the `pptx-edit-notice` class. */
640
+ className?: string;
641
+ }
642
+ /**
643
+ * Why the last edit was refused, or what the last Delete removed with an Undo action. Renders
644
+ * nothing while edits apply, and nothing for a command that had nothing to do
645
+ * (`EditorRejection.noop`). @public
646
+ */
647
+ declare const EditNotice: (props: EditNoticeProps) => ReactNode;
648
+
649
+ /** @jsxImportSource react */
650
+
651
+ /** The props of `FontNotice`. @public */
652
+ interface FontNoticeProps {
653
+ /**
654
+ * Your translation function for the notice, as DOCX Editor's `t` on its font notice. Without
655
+ * it, the root's `locale` gives the labels.
656
+ */
657
+ readonly t?: ChromeTranslate;
658
+ /** Appended after the `pptx-font-notice` class. */
659
+ className?: string;
660
+ }
661
+ /** The substitution notice. Renders nothing when every font is available. @public */
662
+ declare const FontNotice: (props: FontNoticeProps) => ReactNode;
663
+
664
+ /** Props for `Menu.Item` and `ContextMenu.Slot`: one registry row. @public */
665
+ interface MenuSlotItemProps {
666
+ /** The slot the row runs, for example `text.bold`. */
667
+ readonly slotId: ChromeSlotId;
668
+ /** The value a value slot runs with (`arrange.order` with `front`). */
669
+ readonly value?: string;
670
+ /** A translation key for the row's label, in place of the registry label. */
671
+ readonly labelKey?: string;
672
+ /** A translation key for the shortcut shown at the end of the row. */
673
+ readonly shortcutKey?: string;
674
+ /**
675
+ * In place of the registry icon: a Material Symbol name (as `Menu.Row` reads it), or icon
676
+ * content (an element).
677
+ */
678
+ readonly icon?: ReactNode;
679
+ /**
680
+ * Run the slot's command at once instead of opening its choices (a value slot such as
681
+ * `slide.add`). Unset, the row runs as the registry row it replaces: Insert > New slide adds a
682
+ * slide at once; `direct={false}` opens the layout gallery there.
683
+ */
684
+ readonly direct?: boolean;
685
+ /** A class name added to the row. */
686
+ readonly className?: string;
687
+ /** Remove the row. Its command keeps working elsewhere. */
688
+ readonly hidden?: boolean;
689
+ }
690
+ /**
691
+ * A menu row for a registered slot: its label, icon, shortcut, enabled state, and action come
692
+ * from the chrome registry. A slot that collects a value opens a submenu of its choices.
693
+ * @public
694
+ */
695
+ declare function MenuSlotItem(props: MenuSlotItemProps): ReactNode;
696
+ /** Props for a named menu row (`Menu.Cut`, `ContextMenu.Cut`, …), as DOCX Editor's. @public */
697
+ interface MenuRowPartProps {
698
+ /** The row's text, or a translation key, in place of the registry label. */
699
+ readonly label?: string;
700
+ /** A translation key for the row's label, in place of the registry label. */
701
+ readonly labelKey?: string;
702
+ /** A translation key for the shortcut shown at the end of the row. */
703
+ readonly shortcutKey?: string;
704
+ /** In place of the registry icon: a Material Symbol name, or icon content (an element). */
705
+ readonly icon?: ReactNode;
706
+ /** A class name added to the row. */
707
+ readonly className?: string;
708
+ /** Remove the row. Its command keeps working elsewhere. */
709
+ readonly hidden?: boolean;
710
+ }
711
+ /** A named menu row: a `Menu.Item` with its slot pinned. @public */
712
+ interface MenuRowPartComponent {
713
+ (props: MenuRowPartProps): ReactNode;
714
+ /** The registry row the part stands for. */
715
+ readonly pptxMenuRow: MenuNamedRow;
716
+ }
717
+ /** Props for `Menu.Group`. @public */
718
+ interface MenuGroupProps {
719
+ /** A heading shown above the rows. Wins over `labelKey`. */
720
+ readonly label?: string;
721
+ /** A translation key for the heading. */
722
+ readonly labelKey?: string;
723
+ /** A class name added to the group. */
724
+ readonly className?: string;
725
+ /** Remove the group and its rows. */
726
+ readonly hidden?: boolean;
727
+ /** The group's rows. */
728
+ readonly children?: ReactNode;
729
+ }
730
+ /** A labeled set of rows inside a menu. @public */
731
+ declare function MenuGroup({ label, labelKey, className, hidden, children }: MenuGroupProps): react.JSX.Element | null;
732
+ /** Props for `Menu.Entry` and the named menus (`Menu.File`, …). @public */
733
+ interface MenuEntryProps {
734
+ /** A built-in menu id changes that menu; any other id adds a host menu. */
735
+ readonly id: ChromeMenuId | (string & {});
736
+ /** The menu's title. Wins over `labelKey`. Built-in menus keep their own title without it. */
737
+ readonly label?: string;
738
+ /** A translation key for the menu's title. */
739
+ readonly labelKey?: string;
740
+ /** Icon content before the title. */
741
+ readonly icon?: ReactNode;
742
+ /** A class name added to the menu's panel. */
743
+ readonly className?: string;
744
+ /** Remove the menu from the bar. */
745
+ readonly hidden?: boolean;
746
+ /**
747
+ * `true` (default): the built-in rows, with `Menu.Item` children replacing their rows in
748
+ * place and other children added at the end. `false`: only the children.
749
+ */
750
+ readonly preset?: boolean;
751
+ /** For a host menu: the menu it follows. Without it, host menus follow the built-in ones. */
752
+ readonly after?: ChromeMenuId | (string & {});
753
+ /** The menu's rows: `Menu.Item` children change built-in rows; others add rows. */
754
+ readonly children?: ReactNode;
755
+ }
756
+ /**
757
+ * One menu of the bar. Inside `PptxEditor.Menu` it is a description the bar reads; the bar
758
+ * renders it. @public
759
+ */
760
+ declare function MenuEntry(_props: MenuEntryProps): ReactNode;
761
+ /** A named menu: a `Menu.Entry` with its id pinned. @public */
762
+ interface MenuPartComponent {
763
+ /** Changes the built-in menu the part stands for, as a `Menu.Entry` with its id. */
764
+ (props: Omit<MenuEntryProps, 'id'>): ReactNode;
765
+ /** The menu the part stands for. */
766
+ readonly pptxMenu: ChromeMenuId;
767
+ }
768
+ /** Props for `PptxEditor.Menu`. @public */
769
+ interface MenuProps {
770
+ /**
771
+ * Your translation function for this compound and its parts, as DOCX Editor's `t`. Without
772
+ * it, the root's `locale` gives the labels.
773
+ */
774
+ readonly t?: ChromeTranslate;
775
+ /** A class name added to the bar. */
776
+ readonly className?: string;
777
+ /**
778
+ * `true` (default): the built-in menus, changed by named menu and `Menu.Entry` children;
779
+ * other children follow the menus. `false`: only the children.
780
+ */
781
+ readonly preset?: boolean;
782
+ /** Named menus and `Menu.Entry` children, and other content after the menus. */
783
+ readonly children?: ReactNode;
784
+ }
785
+
786
+ /** A point in client (viewport) pixels. @public */
787
+ interface ContextMenuPoint {
788
+ /** The horizontal position in CSS pixels from the left of the window. */
789
+ readonly x: number;
790
+ /** The vertical position in CSS pixels from the top of the window. */
791
+ readonly y: number;
792
+ }
793
+ /** Props of `ContextMenu`. @public */
794
+ interface ContextMenuProps {
795
+ /** Where the menu opens: the pointer, or the focused element for a keyboard open. */
796
+ readonly at: ContextMenuPoint;
797
+ /** Called when the menu closes: a row ran, Escape, Tab, or a click outside. */
798
+ readonly onClose: () => void;
799
+ /** The accessible name of the menu. */
800
+ readonly label: string;
801
+ /** Opened from the keyboard (Shift+F10, the Menu key): focus goes to the first row. */
802
+ readonly keyboard?: boolean;
803
+ /** The element the menu opened on; its editor scope carries the theme tokens. */
804
+ readonly owner?: HTMLElement | null;
805
+ /** A class name added to the menu. */
806
+ readonly className?: string;
807
+ /** The menu's rows. */
808
+ readonly children: ReactNode;
809
+ }
810
+ /**
811
+ * A context menu at a point. Closed by Escape (focus returns to where it was), Tab, a click
812
+ * outside, or a window resize. The arrow keys, Home, and End move through the rows. @public
813
+ */
814
+ declare function ContextMenu({ at, onClose, label, keyboard, owner, className, children, }: ContextMenuProps): react.ReactPortal;
815
+ /** Props of `MenuRow`. @public */
816
+ interface MenuRowProps {
817
+ /** The row's text, and its accessible name. */
818
+ readonly label: string;
819
+ /**
820
+ * A Material Symbol name from `ICON_PATHS`, or icon content (an element), as DOCX Editor's
821
+ * `ContextMenuItem` and `Toolbar.Action` take.
822
+ */
823
+ readonly icon?: string | ReactNode;
824
+ /** SVG path data for the icon, in place of `icon`. */
825
+ readonly paths?: readonly string[] | null;
826
+ /** Other icon content (a drawn shape or line), in place of `icon` and `paths`. */
827
+ readonly glyph?: ReactNode;
828
+ /** The shortcut hint, already in this platform's form (`useTranslation` gives it). */
829
+ readonly shortcut?: string;
830
+ /** The row cannot run. It stays focusable and names `reason`. */
831
+ readonly disabled?: boolean;
832
+ /** Why the row is disabled; shown as its tooltip. */
833
+ readonly reason?: string | null;
834
+ /** The same as `reason`, under DOCX Editor's and `Toolbar.Action`'s name. */
835
+ readonly disabledReason?: string | null;
836
+ /** A toggle that is on (Bold on bold text). */
837
+ readonly active?: boolean;
838
+ /** An on/off setting (View > Smart guides): a `menuitemcheckbox` with a check when on. */
839
+ readonly checked?: boolean;
840
+ /**
841
+ * With `checked`, one choice of several (a Shadow preset, or View > Normal and Slide sorter):
842
+ * a `menuitemradio` instead of a `menuitemcheckbox`.
843
+ */
844
+ readonly radio?: boolean;
845
+ /** The chrome slot or command the row runs, as `data-slot` for hosts and tests. */
846
+ readonly slot?: string;
847
+ /** A class name added to the row. */
848
+ readonly className?: string;
849
+ /**
850
+ * A web link: the row opens it in a new tab. Only `http`, `https`, `mailto`, `tel`, and `ftp`
851
+ * links pass `sanitizeHref`; any other link disables the row.
852
+ */
853
+ readonly href?: string;
854
+ /** Runs the row. Inside `PptxEditor.Menu` or `PptxEditor.ContextMenu`, the menu closes after. */
855
+ readonly onSelect?: () => void;
856
+ }
857
+ /**
858
+ * A menu row: icon, label, and shortcut. A disabled row stays focusable with `aria-disabled`,
859
+ * so a keyboard or pointer user can read why. @public
860
+ */
861
+ declare function MenuRow(props: MenuRowProps): react.JSX.Element;
862
+ /** A line between groups of rows. @public */
863
+ declare function MenuSeparator(): react.JSX.Element;
864
+ /** Props of `MenuSubmenu`. @public */
865
+ interface MenuSubmenuProps {
866
+ /** The row's label. Wins over `labelKey`. */
867
+ readonly label?: string;
868
+ /** A translation key for the label, as DOCX Editor's `Menu.Submenu` takes. */
869
+ readonly labelKey?: string;
870
+ /** A Material Symbol name, or icon content (an element). */
871
+ readonly icon?: string | ReactNode;
872
+ /** SVG path data for the icon, in place of `icon`. */
873
+ readonly paths?: readonly string[] | null;
874
+ /** Other icon content (a drawn shape or line), in place of `icon` and `paths`. */
875
+ readonly glyph?: ReactNode;
876
+ /** The row cannot open its panel. It stays focusable and names `reason`. */
877
+ readonly disabled?: boolean;
878
+ /** Why the row is disabled; shown as its tooltip. */
879
+ readonly reason?: string | null;
880
+ /** The submenu's own class, for a grid of shapes. */
881
+ readonly className?: string;
882
+ /** The rows of the cascading panel. */
883
+ readonly children: ReactNode;
884
+ }
885
+ /**
886
+ * A row that opens a cascading panel to its right (to its left at the window's edge). It opens
887
+ * on hover, click, Enter, and ArrowRight, and closes on ArrowLeft and Escape, which give focus
888
+ * back to the row. @public
889
+ */
890
+ declare function MenuSubmenu(props: MenuSubmenuProps): react.JSX.Element;
891
+
892
+ /** What a canvas context menu opened on, and where. @public */
893
+ interface ContextMenuRequest {
894
+ /**
895
+ * Shapes, pictures only (`picture`, the picture menu), text being edited, or empty
896
+ * slide area. A selection of pictures only reports `picture`, not `shapes`.
897
+ */
898
+ readonly kind: CanvasMenuKind;
899
+ /** Where the menu opens, in client pixels. */
900
+ readonly at: ContextMenuPoint;
901
+ /** Opened from the keyboard: focus goes to the first row. */
902
+ readonly keyboard: boolean;
903
+ /** The canvas element the menu opened on. */
904
+ readonly owner: HTMLElement;
905
+ /** Close the menu. */
906
+ readonly close: () => void;
907
+ }
908
+ /**
909
+ * The open canvas context menu, for a host's own rows: what it opened on, where, and how to
910
+ * close it. Null outside an open menu. @public
911
+ */
912
+ declare function useContextMenuRequest(): ContextMenuRequest | null;
913
+ /**
914
+ * The element the open context menu opened on (the slide canvas), or null while no menu is
915
+ * open. The same hook as DOCX Editor's. @public
916
+ */
917
+ declare function useContextMenuTarget(): HTMLElement | null;
918
+ /** Props for `PptxEditor.ContextMenu`. @public */
919
+ interface PptxEditorContextMenuProps {
920
+ /**
921
+ * Your translation function for this compound and its parts, as DOCX Editor's `t`. Without
922
+ * it, the root's `locale` gives the labels.
923
+ */
924
+ readonly t?: ChromeTranslate;
925
+ /** A class name added to the menu. */
926
+ readonly className?: string;
927
+ /**
928
+ * `true` (default): the built-in rows for the target, with `ContextMenu.Slot` children
929
+ * replacing their rows in place and other children added at the end. `false`: only the
930
+ * children.
931
+ */
932
+ readonly preset?: boolean;
933
+ /**
934
+ * `true` shows no canvas menu, as DOCX Editor's `disabled`. An open menu closes. Default
935
+ * `false`.
936
+ */
937
+ readonly disabled?: boolean;
938
+ /** Called with `true` when the menu opens and `false` when it closes. */
939
+ readonly onOpenChange?: (open: boolean) => void;
940
+ /** `ContextMenu.Slot` children change built-in rows; other children add rows. */
941
+ readonly children?: ReactNode;
942
+ }
943
+
944
+ /** An open rail menu: where, on which slide, and how it opened. @public */
945
+ interface RailMenuState {
946
+ /** Where the menu opens: the pointer, or the slide for a keyboard open. */
947
+ readonly at: ContextMenuPoint;
948
+ /** The slide the menu opened on, from 0. */
949
+ readonly index: number;
950
+ /** Opened from the keyboard: focus goes to the first row. */
951
+ readonly keyboard: boolean;
952
+ /** The element the menu opened on; its editor scope carries the theme tokens. */
953
+ readonly owner: HTMLElement | null;
954
+ }
955
+ /** Props of the context menu of a slide in the rail or the sorter, and of a `popups.railContextMenu` renderer. @public */
956
+ interface RailContextMenuProps {
957
+ /** Where the menu opens, on which slide, and how. */
958
+ readonly menu: RailMenuState;
959
+ /** Called when the menu closes. */
960
+ readonly onClose: () => void;
961
+ /** A section was added at the slide: the rail starts renaming it. */
962
+ readonly onSectionAdded?: (sectionId: string) => void;
963
+ /** Opens the background dialog; the row is left out when the dialog is turned off. */
964
+ readonly onBackground?: () => void;
965
+ }
966
+ /**
967
+ * The slide rail's context menu: new, duplicate, delete, and move slides, background, and
968
+ * present from here. Rows act on every selected slide. @public
969
+ */
970
+ declare function RailContextMenu({ menu, onClose, onBackground, onSectionAdded, }: RailContextMenuProps): react.JSX.Element;
971
+
972
+ /**
973
+ * Ask the slide rail or the slide sorter of `editor` to start renaming section `sectionId` in
974
+ * place, as Home > Section > Rename Section does: what the `section.rename` slot runs. Use it
975
+ * when you build your own section chrome. When neither is mounted, nothing opens and a
976
+ * development warning says so. @public
977
+ */
978
+ declare function requestSectionRename(editor: PptxEditorInstance | null, sectionId: string): void;
979
+ /** An open section menu: where it opens, how it opened, and the element it belongs to. @public */
980
+ interface SectionMenuState {
981
+ /** The point where the menu opens, in viewport pixels. */
982
+ readonly at: ContextMenuPoint;
983
+ /**
984
+ * Whether a key opened the menu (Shift+F10 or the Menu key). The menu then puts focus on its
985
+ * first row; after a right-click, on the menu itself.
986
+ */
987
+ readonly keyboard: boolean;
988
+ /** The element the menu belongs to: the section header. Focus goes back to it on close. */
989
+ readonly owner: HTMLElement | null;
990
+ }
991
+ /**
992
+ * Props of the section menu, and of a `popups.sectionContextMenu` renderer: the menu of a
993
+ * section header in the slide rail and in the slide sorter. @public
994
+ */
995
+ interface SectionContextMenuProps {
996
+ /** The section whose header opened the menu. */
997
+ readonly section: SlideSection;
998
+ /** Where the menu opens, and how. */
999
+ readonly menu: SectionMenuState;
1000
+ /** Closes the menu. Call it when a row runs or the user dismisses the menu. */
1001
+ readonly onClose: () => void;
1002
+ /** Starts renaming the section in place, in the rail or the sorter that opened the menu. */
1003
+ readonly onRename: () => void;
1004
+ /** Call after a row removes sections: focus goes to the current slide after the render. */
1005
+ readonly onRemoved: () => void;
1006
+ }
1007
+ /**
1008
+ * The section menu: Rename, Remove, Remove with slides, Remove all, Move up
1009
+ * and down, Collapse and Expand all. Every row asks the engine whether it can run. @public
1010
+ */
1011
+ declare function SectionContextMenu({ section, menu, onClose, onRename, onRemoved, }: SectionContextMenuProps): react.JSX.Element;
1012
+
1013
+ /** What a replacement link popup receives. @public */
1014
+ interface HyperlinkPopupProps {
1015
+ /**
1016
+ * The element the popup opens under: the toolbar's link button, else the element the request
1017
+ * came from (the slide for Ctrl/Cmd+K, a menu row's opener).
1018
+ */
1019
+ readonly anchor: HTMLElement | null;
1020
+ /** The link of the selection now, or an empty string. */
1021
+ readonly url: string;
1022
+ /**
1023
+ * `reading` after a click into linked text (the target, Copy, Edit, Unlink), `editing` for the
1024
+ * URL field. Absent means `editing`. `useHyperlinkPopup()` gives the state and the actions. A
1025
+ * renderer receives `reading` only when registered with `definePopup(C, { reading: true })`.
1026
+ */
1027
+ readonly mode?: 'reading' | 'editing';
1028
+ /** Close the popup. Apply the link with `editor.exec({ type: 'setLink', url })`. */
1029
+ readonly onClose: () => void;
1030
+ /** A class name added to the popup panel, for a host renderer that forwards these props. */
1031
+ readonly className?: string;
1032
+ }
1033
+ /** What a replacement find bar receives. @public */
1034
+ interface FindPopupProps {
1035
+ /** Opened to replace (Ctrl/Cmd+H), not only to find. */
1036
+ readonly replace: boolean;
1037
+ /** Close the bar. Run `editor.find` and `editor.replace` for the search itself. */
1038
+ readonly onClose: () => void;
1039
+ }
1040
+ /**
1041
+ * A render callback for an automatic popup. `false` disables automatic rendering. Same shape
1042
+ * as DOCX Editor's `DocxEditorPopup`. @public
1043
+ */
1044
+ type PptxEditorPopup<Props extends object> = false | ((props: Props) => ReactNode);
1045
+ /**
1046
+ * Register an ordinary component in the `popups` map while keeping its props and hooks.
1047
+ * Define the component outside the parent render function to keep its state across renders.
1048
+ *
1049
+ * @example
1050
+ * ```tsx
1051
+ * function AcmePageSetup({ open, onClose }: PageSetupDialogProps) {
1052
+ * return open ? <AcmeDialog title="Slide size" onDismiss={onClose} /> : null;
1053
+ * }
1054
+ *
1055
+ * <PptxEditor.Root popups={{ pageSetup: definePopup(AcmePageSetup) }}>…</PptxEditor.Root>
1056
+ * ```
1057
+ *
1058
+ * @public
1059
+ */
1060
+ declare function definePopup<Props extends object>(component: ComponentType<Props>, options?: DefinePopupOptions): (props: Props) => ReactNode;
1061
+ /** Options of `definePopup`. @public */
1062
+ interface DefinePopupOptions {
1063
+ /**
1064
+ * For `popups.hyperlink`: the renderer shows reading mode too, so a click into linked text
1065
+ * opens it with `mode: 'reading'`. Without it a renderer opens for the URL field alone.
1066
+ */
1067
+ readonly reading?: boolean;
1068
+ }
1069
+ /**
1070
+ * Render overrides for the dialogs the editor mounts. `false` disables one. A render callback
1071
+ * receives the session props (`open`, `onClose`) and can forward them to the packaged dialog
1072
+ * with its own options.
1073
+ *
1074
+ * @example
1075
+ * ```tsx
1076
+ * const popups: PptxEditorPopups = {
1077
+ * pageSetup: (props) => <PageSetupDialog {...props} theme={theme} onThemeChange={setTheme} />,
1078
+ * background: false,
1079
+ * };
1080
+ * ```
1081
+ *
1082
+ * @public
1083
+ */
1084
+ interface PptxEditorPopups {
1085
+ /** File > Page setup: slide size, appearance, and fonts. */
1086
+ pageSetup?: PptxEditorPopup<PageSetupDialogProps>;
1087
+ /** Format background: slide background fill. */
1088
+ background?: PptxEditorPopup<BackgroundDialogProps>;
1089
+ /** Format > Paragraph: alignment, indents, spacing before and after, and line spacing. */
1090
+ paragraph?: PptxEditorPopup<ParagraphDialogProps>;
1091
+ /**
1092
+ * The link popup (Ctrl/Cmd+K, the toolbar's link control, Insert > Link). `PptxEditor.Root`
1093
+ * hosts it, so it opens with no toolbar on the page. `false` turns links off in the chrome:
1094
+ * the link control and rows show as disabled; `setLink` keeps working from the API.
1095
+ */
1096
+ hyperlink?: PptxEditorPopup<HyperlinkPopupProps>;
1097
+ /**
1098
+ * The find and replace bar (Ctrl/Cmd+F, Ctrl/Cmd+H), rendered where `PptxEditor.FindBar`
1099
+ * stands. `false` turns it off; `editor.find` keeps working from the API.
1100
+ */
1101
+ find?: PptxEditorPopup<FindPopupProps>;
1102
+ /**
1103
+ * The slide canvas's context menu. A callback usually renders `PptxEditor.ContextMenu` with
1104
+ * host rows; `false` shows no menu. A `PptxEditor.ContextMenu` placed in the root or the
1105
+ * viewport gives the same entry, and this entry wins over it.
1106
+ */
1107
+ contextMenu?: PptxEditorPopup<PptxEditorContextMenuProps>;
1108
+ /**
1109
+ * The context menu of a slide in the slide rail and of a tile in the slide sorter. A callback
1110
+ * renders the host's menu, or `RailContextMenu` with its own options; `false` shows no menu.
1111
+ */
1112
+ railContextMenu?: PptxEditorPopup<RailContextMenuProps>;
1113
+ /** Format > Font: font, effects, offset, character spacing, and kerning. */
1114
+ font?: PptxEditorPopup<FontDialogProps>;
1115
+ /** Format > Bullets and Numbering: bullet or number style, size, color, and start number. */
1116
+ bulletsAndNumbering?: PptxEditorPopup<BulletsAndNumberingDialogProps>;
1117
+ /** Home > Columns > More Columns: the number of text columns and the spacing between them. */
1118
+ columns?: PptxEditorPopup<ColumnsDialogProps>;
1119
+ /**
1120
+ * The Alt Text dialog of the selected element (Picture Format and the context menu), as DOCX
1121
+ * Editor's `imageAltText`. `false` turns it off; `setAltText` keeps working from the API.
1122
+ */
1123
+ imageAltText?: PptxEditorPopup<ImageAltTextDialogProps>;
1124
+ /**
1125
+ * The Format Picture dialog: size, rotation, and crop position of the selected picture, as
1126
+ * DOCX Editor's `imageProperties`. `false` turns it off; `setImageProperties` keeps working.
1127
+ */
1128
+ imageProperties?: PptxEditorPopup<ImagePropertiesDialogProps>;
1129
+ /**
1130
+ * The menu of a section header in the slide rail and in the slide sorter (Rename, Remove,
1131
+ * Move, Collapse all). A callback renders the host's menu, or `SectionContextMenu` with its
1132
+ * own options; `false` shows no menu. The section commands keep working from the API.
1133
+ */
1134
+ sectionContextMenu?: PptxEditorPopup<SectionContextMenuProps>;
1135
+ }
1136
+ /** The modal dialogs the registry mounts and `useEditorDialog` opens. @public */
1137
+ type PptxEditorDialogKey = 'pageSetup' | 'background' | 'paragraph' | 'font' | 'bulletsAndNumbering' | 'columns' | 'imageAltText' | 'imageProperties';
1138
+ /** What `useEditorDialog` returns. @public */
1139
+ interface UseEditorDialogReturn {
1140
+ /**
1141
+ * Show the dialog. Focus returns to `returnFocusTo`, or to the element that has focus now,
1142
+ * when it closes. Does nothing when the popup entry is `false`.
1143
+ */
1144
+ open(returnFocusTo?: HTMLElement | null): void;
1145
+ /** Hide the dialog. */
1146
+ close(): void;
1147
+ /** Whether the dialog shows now. */
1148
+ readonly isOpen: boolean;
1149
+ /** False when the popup entry is `false`: hide or disable the control that opens it. */
1150
+ readonly isAvailable: boolean;
1151
+ }
1152
+ /**
1153
+ * Open, close, and read one of the editor's dialogs. The packaged openers use the same call,
1154
+ * so a host renderer in `popups` receives every request. Outside `PptxEditor.Root` it reports
1155
+ * the dialog as unavailable. It takes the dialog's key; the per-dialog hooks
1156
+ * (`usePageSetupDialog`, `useBackgroundDialog`, `useParagraphDialog`, `useFontDialog`,
1157
+ * `useBulletsAndNumberingDialog`, `useColumnsDialog`) read an open dialog's draft, as in DOCX Editor.
1158
+ *
1159
+ * @example
1160
+ * ```tsx
1161
+ * function PageSetupButton() {
1162
+ * const pageSetup = useEditorDialog('pageSetup');
1163
+ * if (!pageSetup.isAvailable) return null;
1164
+ * return <button onClick={() => pageSetup.open()}>Page setup</button>;
1165
+ * }
1166
+ * ```
1167
+ *
1168
+ * @public
1169
+ */
1170
+ declare function useEditorDialog(key: PptxEditorDialogKey): UseEditorDialogReturn;
1171
+
1172
+ /** Props for `PptxEditor.Root`. Only `document` identity reloads the document. @public */
1173
+ interface PptxEditorRootProps {
1174
+ /** `.pptx` bytes. Identity change loads the new document. */
1175
+ readonly document?: Uint8Array;
1176
+ /** `'edit'` (default) or `'view'`. Changes apply without a reload. */
1177
+ readonly mode?: EditorMode;
1178
+ /** UI locale catalog; English when omitted. */
1179
+ readonly locale?: LocaleCatalog;
1180
+ /** Fired once per instance after it is published. */
1181
+ readonly onReady?: (editor: PptxEditorInstance) => void;
1182
+ /** Fired after every change of editor state. */
1183
+ readonly onChange?: (editor: PptxEditorInstance) => void;
1184
+ /**
1185
+ * Font bytes for the host's faces, as DOCX Editor's `fonts` prop: a `FontConfiguration`, a
1186
+ * fragment, or a `FontResolver` such as `packagedFonts()`. Use `useFonts(...)` for a stable
1187
+ * value. A change replaces the fonts in place (`setFonts`); the document, the selection, and
1188
+ * the undo history stay. Omitted, the packaged substitutes load and nothing is fetched.
1189
+ */
1190
+ readonly fonts?: EditorFontsOption;
1191
+ /** Called for each font failure: a failed origin, a refused face, or a failed resolution. */
1192
+ readonly onFontError?: (error: EditorFontError) => void;
1193
+ /**
1194
+ * Families the font picker offers besides the standard ones and the deck's own. A change
1195
+ * updates the picker in place (`setFontFamilies`); the document and the undo history stay.
1196
+ */
1197
+ readonly fontFamilies?: readonly string[];
1198
+ /**
1199
+ * Capability modules, as DOCX Editor's `modules` prop: the review and collaboration modules
1200
+ * of `@pptx-editor.dev/pro`. Read once, when the editor is created: a later change has no
1201
+ * effect and prints a development warning. Create the list once, outside the component.
1202
+ */
1203
+ readonly modules?: readonly EditorModule[];
1204
+ /** Customize the dialogs the editor mounts. Set an entry to `false` to turn one off. */
1205
+ readonly popups?: PptxEditorPopups;
1206
+ /**
1207
+ * The chrome color mode: `'light'` (default), `'dark'`, or `'system'`, which follows the
1208
+ * operating system. Only the chrome is themed; the slide keeps the deck's own colors.
1209
+ */
1210
+ readonly colorMode?: ColorMode;
1211
+ /** The editor's layout: a `PptxEditor.Viewport` with its parts. */
1212
+ readonly children?: ReactNode;
1213
+ }
1214
+ /**
1215
+ * The imperative handle of `PptxEditor` and `PptxEditor.Root`, as DOCX Editor's
1216
+ * `DocxEditorRef`, and the same members as the Vue adapter's. Every member forwards to the
1217
+ * editor instance and is safe to call before the editor mounts: `load` and `exec` refuse with
1218
+ * `disabled.noEditor`, `save` and `getEditor` return `null`, `focus` does nothing, and
1219
+ * `snapshot` returns an empty snapshot. Everything else is on the instance that `getEditor`
1220
+ * returns. @public
1221
+ */
1222
+ interface PptxEditorRef {
1223
+ /** Open `.pptx` bytes. Resolves when the presentation is open, or with the refusal. */
1224
+ load(bytes: Uint8Array): Promise<CommandResult>;
1225
+ /**
1226
+ * The presentation as `.pptx` bytes, or `null` when no presentation is open. The bytes own an
1227
+ * `ArrayBuffer`, so `new Blob([bytes])` takes them as they are.
1228
+ */
1229
+ save(): Uint8Array<ArrayBuffer> | null;
1230
+ /** The editor instance, or `null` before it mounts. */
1231
+ getEditor(): PptxEditorInstance | null;
1232
+ /** Give the keyboard back to the slide: the text caret, else the slide surface. */
1233
+ focus(): void;
1234
+ /** Run a command, as `editor.exec`. */
1235
+ exec(command: EditorCommand, options?: EditorExecOptions): CommandResult;
1236
+ /** The current editor state, as `editor.snapshot()`. */
1237
+ snapshot(): EditorSnapshot;
1238
+ }
1239
+ /** Owns the editor instance. Takes a `ref` to a `PptxEditorRef`. @public */
1240
+ declare const PptxEditorRoot: react.ForwardRefExoticComponent<PptxEditorRootProps & react.RefAttributes<PptxEditorRef>>;
1241
+ /** The props of `PptxEditorViewport`. @public */
1242
+ interface PptxEditorViewportProps {
1243
+ /** Appended after the `pptx-editor` class. */
1244
+ className?: string;
1245
+ /** The chrome and the content of the editor. */
1246
+ children?: ReactNode;
1247
+ }
1248
+ /**
1249
+ * The editor's scroll and styling scope: carries the `.pptx-editor` class, and `dark` with it
1250
+ * when the root's `colorMode` resolves to dark. @public
1251
+ */
1252
+ declare function PptxEditorViewport({ className, children }: PptxEditorViewportProps): react.JSX.Element;
1253
+ /** The props of `PptxEditorContent`. @public */
1254
+ interface PptxEditorContentProps {
1255
+ /** Appended after the `pptx-canvas` class. */
1256
+ className?: string;
1257
+ }
1258
+ /**
1259
+ * The slide canvas: attaches the engine surface in a layout effect. Right-click, Shift+F10, and
1260
+ * the Menu key open its context menu. @public
1261
+ */
1262
+ declare function PptxEditorContent({ className }: PptxEditorContentProps): react.JSX.Element;
1263
+
1264
+ /** Props of an element a host passes with `asChild`. */
1265
+ type HostElementProps = Record<string, unknown>;
1266
+
1267
+ /** @jsxImportSource react */
1268
+
1269
+ /** What every `Toolbar.Slot` takes. @public */
1270
+ interface ToolbarSlotBaseProps {
1271
+ /** The registered control, for example `text.bold`. */
1272
+ readonly slotId: ChromeSlotId;
1273
+ /** Remove the control from the toolbar. Its command keeps working elsewhere. */
1274
+ readonly hidden?: boolean;
1275
+ /** A host icon in place of the registry icon. Button controls only. */
1276
+ readonly icon?: ReactNode;
1277
+ /** A class name added to the control. */
1278
+ readonly className?: string;
1279
+ }
1280
+ /**
1281
+ * Props for `PptxEditor.Toolbar.Slot`. With `asChild`, the single child element renders the
1282
+ * control and receives its label, state, and click handler. Without it, children replace the
1283
+ * control in its place. @public
1284
+ */
1285
+ type ToolbarSlotProps = ToolbarSlotBaseProps & ({
1286
+ /** Render the control as the single child element. Button controls only. */
1287
+ readonly asChild: true;
1288
+ /** The host element that renders the control. */
1289
+ readonly children: ReactElement;
1290
+ } | {
1291
+ readonly asChild?: false;
1292
+ /** Content that replaces the control in its place. */
1293
+ readonly children?: ReactNode;
1294
+ });
1295
+ /**
1296
+ * Props for the named button parts (`Toolbar.Bold`, `Toolbar.Undo`, …), as DOCX Editor's: the
1297
+ * slot is pinned, and children are icon content (`icon`, else children, else the registry
1298
+ * icon), not a replacement. `<Toolbar.Bold hidden />` is
1299
+ * `<Toolbar.Slot slotId="text.bold" hidden />`. @public
1300
+ */
1301
+ type ToolbarPartProps = Omit<ToolbarSlotBaseProps, 'slotId'> & ({
1302
+ /** Render the control as the single child element. */
1303
+ readonly asChild: true;
1304
+ /** The host element that renders the control. */
1305
+ readonly children: ReactElement;
1306
+ } | {
1307
+ readonly asChild?: false;
1308
+ /** Icon content, when there is no `icon`. */
1309
+ readonly children?: ReactNode;
1310
+ });
1311
+ /**
1312
+ * Props for the named picker parts (`Toolbar.FontFamily`, `Toolbar.FontColor`, …), as DOCX
1313
+ * Editor's slot parts: a picker is not one button, so it takes no `icon`, `asChild`, or
1314
+ * children. @public
1315
+ */
1316
+ interface ToolbarSlotPartProps {
1317
+ /** Remove the control from the toolbar. Its command keeps working elsewhere. */
1318
+ readonly hidden?: boolean;
1319
+ /** A class name added to the control's trigger. */
1320
+ readonly className?: string;
1321
+ }
1322
+ /**
1323
+ * Props for the named color split parts (`Toolbar.FontColor`, `Toolbar.Highlight`,
1324
+ * `Toolbar.ShapeFill`, `Toolbar.LineColor`), as DOCX Editor's `ToolbarColorSplitProps`: the
1325
+ * main half takes an `icon` (the glyph over the color bar). @public
1326
+ */
1327
+ interface ToolbarColorSplitProps extends ToolbarSlotPartProps {
1328
+ /** A host glyph over the color bar, in place of the registry icon. */
1329
+ readonly icon?: ReactNode;
1330
+ }
1331
+ /** A named color split part: a component with its slot as a static. @public */
1332
+ interface ToolbarColorSplitComponent {
1333
+ /** Changes, replaces, or hides the color control the part stands for. */
1334
+ (props: ToolbarColorSplitProps): ReactNode;
1335
+ /** The slot the part stands for. The toolbar reads it to place the part. */
1336
+ readonly pptxSlot: ChromeSlotId;
1337
+ }
1338
+ /** A named toolbar part: a `Toolbar.Slot` with its slot pinned. @public */
1339
+ interface ToolbarPartComponent {
1340
+ /** Changes, replaces, or hides the control the part stands for. */
1341
+ (props: ToolbarPartProps): ReactNode;
1342
+ /** The slot the part stands for. The toolbar reads it to place the part. */
1343
+ readonly pptxSlot: ChromeSlotId;
1344
+ }
1345
+ /** A named picker part: a component with its slot as a static. @public */
1346
+ interface ToolbarSlotPartComponent {
1347
+ /** Changes, replaces, or hides the control the part stands for. */
1348
+ (props: ToolbarSlotPartProps): ReactNode;
1349
+ /** The slot the part stands for. The toolbar reads it to place the part. */
1350
+ readonly pptxSlot: ChromeSlotId;
1351
+ }
1352
+ /** Props for `PptxEditor.Toolbar.Group`. @public */
1353
+ interface ToolbarGroupProps {
1354
+ /** A built-in group id changes that group; any other id adds a host group. */
1355
+ readonly id: ChromeGroupId | (string & {});
1356
+ /** Remove the whole group and its separator, from the bar and the More menu. */
1357
+ readonly hidden?: boolean;
1358
+ /** The accessible name of a host group. Wins over `labelKey`. */
1359
+ readonly label?: string;
1360
+ /** A translation key for the name of a host group, used when there is no `label`. */
1361
+ readonly labelKey?: string;
1362
+ /**
1363
+ * Collapse priority: a lower number leaves the bar for the More menu first. Built-in groups
1364
+ * use 10 (the last group) up to 90 (history). A host group without one leaves first.
1365
+ */
1366
+ readonly priority?: number;
1367
+ /** Keep the group on the bar at every width. */
1368
+ readonly pinned?: boolean;
1369
+ /**
1370
+ * The group a host group follows. Without it, a host group follows every built-in group.
1371
+ * A built-in id ignores it, with a development warning.
1372
+ */
1373
+ readonly after?: ChromeGroupId | (string & {});
1374
+ /** A class name added to the group's element. */
1375
+ readonly className?: string;
1376
+ /**
1377
+ * Content for the group in the More menu: after the controls of a built-in group, as in
1378
+ * DOCX Editor, so a built-in id adds a menu-only row; in place of a host group's controls.
1379
+ */
1380
+ readonly overflowContent?: () => ReactNode;
1381
+ /** Controls added after the group's built-in controls, or the controls of a host group. */
1382
+ readonly children?: ReactNode;
1383
+ }
1384
+
1385
+ /** The props of `ToolbarControl`. @public */
1386
+ interface ToolbarControlProps {
1387
+ /** The id of the group the control belongs to, such as `text`. */
1388
+ group: string;
1389
+ /** The registry entry of the control, from `CHROME_GROUPS`. */
1390
+ control: ChromeControl;
1391
+ }
1392
+ /** One control, by registry shape. @public */
1393
+ declare function ToolbarControl({ group, control }: ToolbarControlProps): react.JSX.Element;
1394
+ /**
1395
+ * One registered control. Inside a `Toolbar` with the preset on, it declares an override;
1396
+ * anywhere else (`preset={false}`, a group) it renders the control.
1397
+ *
1398
+ * @example
1399
+ * ```tsx
1400
+ * <PptxEditor.Toolbar>
1401
+ * <PptxEditor.Toolbar.Slot slotId="text.bold" icon={<BoldIcon />} className="acme-bold" />
1402
+ * <PptxEditor.Toolbar.Slot slotId="history.undo" asChild>
1403
+ * <AcmeButton>Undo</AcmeButton>
1404
+ * </PptxEditor.Toolbar.Slot>
1405
+ * <PptxEditor.Toolbar.Slot slotId="text.strike" hidden />
1406
+ * </PptxEditor.Toolbar>
1407
+ * ```
1408
+ *
1409
+ * @public
1410
+ */
1411
+ declare function ToolbarSlot(props: ToolbarSlotProps): ReactNode;
1412
+ /**
1413
+ * A group of controls. Inside a `Toolbar` with the preset on, a built-in id changes that group
1414
+ * and any other id adds a host group; with `preset={false}`, it renders its children. A host
1415
+ * group's accessible name is its `label`, else its translated `labelKey`, else its `id`.
1416
+ *
1417
+ * @example
1418
+ * ```tsx
1419
+ * <PptxEditor.Toolbar>
1420
+ * <PptxEditor.Toolbar.Group id="acme" label="Acme">
1421
+ * <button type="button" onClick={askLegal}>Ask legal</button>
1422
+ * </PptxEditor.Toolbar.Group>
1423
+ * <PptxEditor.Toolbar.Group id="find" hidden />
1424
+ * </PptxEditor.Toolbar>
1425
+ * ```
1426
+ *
1427
+ * @public
1428
+ */
1429
+ declare function ToolbarGroup(props: ToolbarGroupProps): ReactNode;
1430
+ /** Props for `PptxEditor.Toolbar`. @public */
1431
+ interface ToolbarProps {
1432
+ /**
1433
+ * Your translation function for this compound and its parts, as DOCX Editor's `t`. Without
1434
+ * it, the root's `locale` gives the labels.
1435
+ */
1436
+ readonly t?: ChromeTranslate;
1437
+ /** A class name added to the bar. */
1438
+ readonly className?: string;
1439
+ /**
1440
+ * `true` (default): the registry's groups, changed by `Toolbar.Slot` and `Toolbar.Group`
1441
+ * children. `false`: only the children, in the order given.
1442
+ */
1443
+ readonly preset?: boolean;
1444
+ /**
1445
+ * `true` (default): groups that do not fit the width move into a More menu, lowest priority
1446
+ * first. `false`: the bar wraps to more rows instead. A `preset={false}` bar never measures
1447
+ * itself, so it always wraps, as in DOCX Editor.
1448
+ */
1449
+ readonly overflow?: boolean;
1450
+ /**
1451
+ * `true` (default): the bar shows only the groups that act on the selection (text, a shape,
1452
+ * a picture, a table, or nothing). `false`: every bar group shows for every selection,
1453
+ * disabled with the engine's reason where it cannot run, and the picture or table group
1454
+ * joins after them. Hiding a group never turns off its commands.
1455
+ */
1456
+ readonly contextual?: boolean;
1457
+ /** `Toolbar.Slot` and `Toolbar.Group` overrides, or the whole bar when `preset` is false. */
1458
+ readonly children?: ReactNode;
1459
+ }
1460
+
1461
+ /** The editor instance published by `PptxEditor.Root`. @public */
1462
+ declare const PptxEditorContext: react.Context<PptxEditorInstance | null>;
1463
+ /** The slide show of the editor in `PptxEditor.Root`. @public */
1464
+ interface UseSlideshowReturn {
1465
+ /** The running show, or null. `PptxEditor.Slideshow` paints it. */
1466
+ readonly controller: SlideshowController | null;
1467
+ /**
1468
+ * Start the show from the first shown slide or from the current slide. Does nothing without
1469
+ * an open document with slides. Viewing mode can present.
1470
+ */
1471
+ start(from: 'start' | 'current'): void;
1472
+ /** Close the show. */
1473
+ stop(): void;
1474
+ }
1475
+ /** The slide show published by `PptxEditor.Root`. @public */
1476
+ declare const SlideshowContext: react.Context<UseSlideshowReturn>;
1477
+ /** The slide show of the editor in `PptxEditor.Root`. @public */
1478
+ declare function useSlideshow(): UseSlideshowReturn;
1479
+ /**
1480
+ * The editor instance, or null before it mounts. Outside `PptxEditor.Root` it is always null,
1481
+ * and a development warning says so, as for the other parts. @public
1482
+ */
1483
+ declare function usePptxEditor(): PptxEditorInstance | null;
1484
+ /** The translator, with shortcut text for this platform. @public */
1485
+ declare function useTranslation(): {
1486
+ t: Translate;
1487
+ };
1488
+ /** Build a translator for a locale catalog. @public */
1489
+ declare function translatorFor(locale?: LocaleCatalog): Translate;
1490
+ /**
1491
+ * Subscribe to a slice of editor state. Re-renders only when `isEqual` says the slice changed
1492
+ * (default `Object.is`).
1493
+ *
1494
+ * @public
1495
+ */
1496
+ declare function useEditorState<T>(selector: (snapshot: EditorSnapshot) => T, isEqual?: (a: T, b: T) => boolean): T;
1497
+ /** A chrome slot's state and its runner: one source of enabled state. @public */
1498
+ interface UseEditorCommandReturn {
1499
+ /**
1500
+ * Run the slot's command, with a value for value controls: the picked option's value, a
1501
+ * number of points for `font.size`, or `{ step: 1 }` / `{ step: -1 }` for its Increase and
1502
+ * Decrease Font Size buttons (`commandForSlotValue`). Returns true when the engine ran it and
1503
+ * false on a refusal, as in DOCX Editor.
1504
+ */
1505
+ readonly execute: (value?: unknown) => boolean;
1506
+ /** Whether the command can run now. */
1507
+ readonly isEnabled: boolean;
1508
+ /** Whether a toggle control shows as pressed. */
1509
+ readonly isActive: boolean;
1510
+ /**
1511
+ * Why the command cannot run: a catalog key, or the engine's own text. Show it with
1512
+ * `translateKeyOrText(t, reason)`.
1513
+ */
1514
+ readonly disabledReason: string | null;
1515
+ /** The value a value control shows (a font size, a family), when it has one. */
1516
+ readonly value?: string | number;
1517
+ }
1518
+ /**
1519
+ * State and execution for one `ChromeSlotId`. A slot the adapter runs (a dialog, the link
1520
+ * popup, find, the slide show) runs through `PptxEditor.Root`, as a menu row does; outside a
1521
+ * root it is disabled with the reason. `useEditorCommand('text.link').execute(url)` sets the
1522
+ * link (`null` removes it) with or without the popup. While the speaker notes field has the
1523
+ * cursor, `text.bold`, `text.italic`, `text.underline`, and `text.strike` format the notes
1524
+ * text. `execute` takes any value, so a host can pass a
1525
+ * registry option's `value`; `useEditorValueCommand` types it. @public
1526
+ */
1527
+ declare function useEditorCommand(slot: ChromeSlotId): UseEditorCommandReturn;
1528
+ /** A typed value slot's state and runner, after DOCX Editor's `useEditorValueCommand`. @public */
1529
+ interface UseEditorValueCommandReturn<V, S = V> {
1530
+ /**
1531
+ * Run the slot's command with a value of its `ToolbarValueMap` type. The result says why the
1532
+ * engine refused it (`disabled.invalidValue`, `disabled.noEffectChange`). Pass
1533
+ * `{ historyGroup }` to make the values of one gesture (a slider drag) one undo step.
1534
+ */
1535
+ readonly execute: (value: V, options?: EditorExecOptions) => CommandResult;
1536
+ /** The value the slot shows (`ToolbarShownValue`), or null when it is mixed or unavailable. */
1537
+ readonly value: S | null;
1538
+ /**
1539
+ * The slot's fixed choices, from the registry (the Rotate, Align, line width, or Shape Effects
1540
+ * rows); none for a slot with a free value (`font.size`, `shape.fill`, `shape.styles`).
1541
+ */
1542
+ readonly options: readonly V[];
1543
+ /** Whether the command can run now. */
1544
+ readonly isEnabled: boolean;
1545
+ /** Why the command cannot run: a catalog key, or the engine's own text. */
1546
+ readonly disabledReason: string | null;
1547
+ }
1548
+ /**
1549
+ * State and execution for one typed value slot: `execute` takes the slot's `ToolbarValueMap`
1550
+ * type, so a typo in a value does not compile, and returns the engine's result. @public
1551
+ */
1552
+ declare function useEditorValueCommand<K extends keyof ToolbarValueMap>(slot: K): UseEditorValueCommandReturn<ToolbarValueMap[K], ToolbarShownValue<K>>;
1553
+
1554
+ /**
1555
+ * Props of `MenuTableGrid` (`PptxEditor.Menu.TableGrid`), DOCX Editor's `Menu.TableGrid` part
1556
+ * (`slot`, `className`), with the props a host menu or toolbar popup needs. @public
1557
+ */
1558
+ interface MenuTableGridProps {
1559
+ /** The slot whose enabled state gates the insert. Default `table.insert`. */
1560
+ readonly slot?: ChromeSlotId;
1561
+ /** Accessible name of the grid. Default: `table.insert` ("Table"). */
1562
+ readonly label?: string;
1563
+ /** Runs instead of the insert, with the picked size. */
1564
+ readonly onPick?: (rows: number, cols: number) => void;
1565
+ /** Runs after a table is inserted. Default: close the surrounding `PptxEditor.Menu`. */
1566
+ readonly onInserted?: () => void;
1567
+ /** Move the focus into the grid when it mounts, for a popup opened from the keyboard. */
1568
+ readonly autoFocus?: boolean;
1569
+ /** A class name added to the grid. */
1570
+ readonly className?: string;
1571
+ }
1572
+ /**
1573
+ * The Insert > Table grid, 10 columns by 8 rows, as DOCX Editor's `TableSizeGrid`: the cell
1574
+ * under the pointer (or focus) picks the size and each cell names it. A `grid` with one tab
1575
+ * stop; the arrows, Home, and End move inside it. The insert puts the caret in the new
1576
+ * table's first cell, and the editor takes the focus. @public
1577
+ */
1578
+ declare function MenuTableGrid({ slot, label, onPick, onInserted, autoFocus, className, }: MenuTableGridProps): react.JSX.Element;
1579
+
1580
+ /** @jsxImportSource react */
1581
+
1582
+ /** Props for `PptxEditor.Toolbar.Action`. @public */
1583
+ interface ToolbarActionProps {
1584
+ /** The accessible name and tooltip: a resolved string from the host's own catalog. */
1585
+ readonly label: string;
1586
+ /** Icon content, about 18 pixels, as the packaged icons. */
1587
+ readonly icon?: ReactNode;
1588
+ /** The pressed state, for an action that toggles: `aria-pressed` and `data-active`. */
1589
+ readonly active?: boolean;
1590
+ /** Turn the action off: the button stays focusable (`aria-disabled`) and `onSelect` does not run. */
1591
+ readonly disabled?: boolean;
1592
+ /** Why the action is disabled: in the tooltip and spoken through `aria-describedby`. */
1593
+ readonly disabledReason?: string;
1594
+ /** Runs the host's action. */
1595
+ readonly onSelect?: () => void;
1596
+ /** Merge the behavior onto the single child element instead of rendering a `<button>`. */
1597
+ readonly asChild?: boolean;
1598
+ /** A class name added to the button. */
1599
+ readonly className?: string;
1600
+ /** Visible content when there is no `icon`, or the element for `asChild`. */
1601
+ readonly children?: ReactNode;
1602
+ }
1603
+ /**
1604
+ * A host-owned toolbar action, styled and behaved like the packaged controls. Put it in a
1605
+ * `Toolbar.Group` so it collapses into the More menu with its group. A direct child of a
1606
+ * preset toolbar goes after the groups and never collapses, as in DOCX Editor. Without an
1607
+ * `icon` or children, it shows its `label` as text.
1608
+ *
1609
+ * @example
1610
+ * ```tsx
1611
+ * <PptxEditor.Toolbar>
1612
+ * <PptxEditor.Toolbar.Group id="review" label="Review" priority={15}>
1613
+ * <PptxEditor.Toolbar.Action label="Send for review" icon={<SendIcon />} onSelect={send} />
1614
+ * </PptxEditor.Toolbar.Group>
1615
+ * </PptxEditor.Toolbar>
1616
+ * ```
1617
+ *
1618
+ * @public
1619
+ */
1620
+ declare function ToolbarAction(props: ToolbarActionProps): ReactNode;
1621
+ /** Props for `PptxEditor.Toolbar.Separator`. @public */
1622
+ interface ToolbarSeparatorProps {
1623
+ /** A class name added to the separator. */
1624
+ readonly className?: string;
1625
+ }
1626
+ /** A vertical rule between controls, for a `preset={false}` toolbar. @public */
1627
+ declare function ToolbarSeparator({ className }: ToolbarSeparatorProps): ReactNode;
1628
+
1629
+ /** Props of `Toolbar.FontFamily.Trigger` and `Toolbar.FontFamily.Content`. @public */
1630
+ interface FontFamilyPartProps {
1631
+ /** A class name added to the part's element. */
1632
+ readonly className?: string;
1633
+ /** Content in place of the part's default content. */
1634
+ readonly children?: ReactNode;
1635
+ }
1636
+ /** Props of `Toolbar.FontFamily.Item`. @public */
1637
+ interface FontFamilyItemProps extends FontFamilyPartProps {
1638
+ /**
1639
+ * What the item applies: a family name, or a theme font reference (`+mj-lt` for the headings
1640
+ * font, `+mn-lt` for the body font), so the text follows a later theme change.
1641
+ */
1642
+ readonly value: string;
1643
+ }
1644
+ /**
1645
+ * Props of `Toolbar.FontFamily`: a picker part's `className` and `hidden`, and children that
1646
+ * compose its `Trigger`, `Content`, and `Item` parts. @public
1647
+ */
1648
+ interface FontFamilyProps extends ToolbarSlotPartProps {
1649
+ /** `Toolbar.FontFamily.Trigger` and `Toolbar.FontFamily.Content`, in place of the defaults. */
1650
+ readonly children?: ReactNode;
1651
+ }
1652
+ /**
1653
+ * `Toolbar.FontFamily`: the `font.family` picker, as DOCX Editor's `FontFamily` compound. With
1654
+ * no children it renders the default trigger and list; with children, compose the `Trigger`,
1655
+ * `Content`, and `Item` parts around the shared state. @public
1656
+ */
1657
+ interface FontFamilyNamespace {
1658
+ /** Changes, hides, or recomposes the font family picker. */
1659
+ (props: FontFamilyProps): ReactNode;
1660
+ /** The slot the part stands for. The toolbar reads it to place the part. */
1661
+ readonly pptxSlot: ChromeSlotId;
1662
+ /** The button that opens the list. */
1663
+ readonly Trigger: (props: FontFamilyPartProps) => ReactNode;
1664
+ /** The list, while it is open. */
1665
+ readonly Content: (props: FontFamilyPartProps) => ReactNode;
1666
+ /** One option of the list. */
1667
+ readonly Item: (props: FontFamilyItemProps) => ReactNode;
1668
+ }
1669
+
1670
+ /** @jsxImportSource react */
1671
+
1672
+ /**
1673
+ * Every named toolbar part, attached to `PptxEditor.Toolbar` as statics: button parts take
1674
+ * `ToolbarPartProps`, picker parts `ToolbarSlotPartProps`, as in DOCX Editor. @public
1675
+ */
1676
+ interface ToolbarNamedParts {
1677
+ /** `history.undo`. */
1678
+ readonly Undo: ToolbarPartComponent;
1679
+ /** `history.redo`. */
1680
+ readonly Redo: ToolbarPartComponent;
1681
+ /** `font.family`, with its `Trigger`, `Content`, and `Item` parts. */
1682
+ readonly FontFamily: FontFamilyNamespace;
1683
+ /** `font.size`. */
1684
+ readonly FontSize: ToolbarSlotPartComponent;
1685
+ /** `text.bold`. */
1686
+ readonly Bold: ToolbarPartComponent;
1687
+ /** `text.italic`. */
1688
+ readonly Italic: ToolbarPartComponent;
1689
+ /** `text.underline`. */
1690
+ readonly Underline: ToolbarPartComponent;
1691
+ /** `text.strike`. */
1692
+ readonly Strike: ToolbarPartComponent;
1693
+ /** `text.color`. */
1694
+ readonly FontColor: ToolbarColorSplitComponent;
1695
+ /** `text.highlight`. */
1696
+ readonly Highlight: ToolbarColorSplitComponent;
1697
+ /** `text.link`. */
1698
+ readonly Link: ToolbarPartComponent;
1699
+ /** `format.clear`. */
1700
+ readonly ClearFormatting: ToolbarPartComponent;
1701
+ /** `text.characterSpacing`. */
1702
+ readonly CharacterSpacing: ToolbarSlotPartComponent;
1703
+ /** `text.changeCase`. */
1704
+ readonly ChangeCase: ToolbarSlotPartComponent;
1705
+ /** `text.dialog`: opens the Font dialog. */
1706
+ readonly Font: ToolbarPartComponent;
1707
+ /** `script.super`. */
1708
+ readonly Superscript: ToolbarPartComponent;
1709
+ /** `script.sub`. */
1710
+ readonly Subscript: ToolbarPartComponent;
1711
+ /** `paragraph.align`. */
1712
+ readonly Alignment: ToolbarSlotPartComponent;
1713
+ /** `paragraph.valign`. */
1714
+ readonly VerticalAlignment: ToolbarSlotPartComponent;
1715
+ /** `list.bullet`. */
1716
+ readonly BulletList: ToolbarPartComponent;
1717
+ /** `list.numbered`. */
1718
+ readonly NumberedList: ToolbarPartComponent;
1719
+ /** `list.bulletStyle`: the Bullets gallery. */
1720
+ readonly BulletStyle: ToolbarSlotPartComponent;
1721
+ /** `list.numberStyle`: the Numbering gallery. */
1722
+ readonly NumberStyle: ToolbarSlotPartComponent;
1723
+ /** `list.outdent`. */
1724
+ readonly Outdent: ToolbarPartComponent;
1725
+ /** `list.indent`. */
1726
+ readonly Indent: ToolbarPartComponent;
1727
+ /** `list.lineSpacing`. */
1728
+ readonly LineSpacing: ToolbarSlotPartComponent;
1729
+ /** `paragraph.dialog`: opens the Paragraph dialog. */
1730
+ readonly Paragraph: ToolbarPartComponent;
1731
+ /** `paragraph.textDirection`. */
1732
+ readonly TextDirection: ToolbarSlotPartComponent;
1733
+ /** `paragraph.autofit`. */
1734
+ readonly Autofit: ToolbarSlotPartComponent;
1735
+ /** `paragraph.columns`. */
1736
+ readonly Columns: ToolbarSlotPartComponent;
1737
+ /** `insert.textBox`. */
1738
+ readonly TextBox: ToolbarPartComponent;
1739
+ /** `insert.line`. */
1740
+ readonly Line: ToolbarSlotPartComponent;
1741
+ /** `insert.shape`. */
1742
+ readonly Shapes: ToolbarSlotPartComponent;
1743
+ /** `insert.image`. */
1744
+ readonly ImageInsert: ToolbarPartComponent;
1745
+ /** `shape.fill`. */
1746
+ readonly ShapeFill: ToolbarColorSplitComponent;
1747
+ /** `shape.lineColor`. */
1748
+ readonly LineColor: ToolbarColorSplitComponent;
1749
+ /** `shape.lineWidth`. */
1750
+ readonly LineWidth: ToolbarSlotPartComponent;
1751
+ /** `shape.lineStart`. */
1752
+ readonly LineStart: ToolbarSlotPartComponent;
1753
+ /** `shape.lineEnd`. */
1754
+ readonly LineEnd: ToolbarSlotPartComponent;
1755
+ /** `shape.lineDash`. */
1756
+ readonly LineDash: ToolbarSlotPartComponent;
1757
+ /** `shape.styles`. */
1758
+ readonly ShapeStyles: ToolbarSlotPartComponent;
1759
+ /** `shape.effects`. */
1760
+ readonly ShapeEffects: ToolbarSlotPartComponent;
1761
+ /** `shape.properties`. */
1762
+ readonly FormatShape: ToolbarPartComponent;
1763
+ /** `format.painter`. */
1764
+ readonly FormatPainter: ToolbarPartComponent;
1765
+ /** `arrange.order`. */
1766
+ readonly Order: ToolbarSlotPartComponent;
1767
+ /** `arrange.align`. */
1768
+ readonly AlignObjects: ToolbarSlotPartComponent;
1769
+ /** `arrange.group`. */
1770
+ readonly GroupObjects: ToolbarPartComponent;
1771
+ /** `arrange.ungroup`. */
1772
+ readonly UngroupObjects: ToolbarPartComponent;
1773
+ /** `arrange.rotate`. */
1774
+ readonly Rotate: ToolbarSlotPartComponent;
1775
+ /** `arrange.selectionPane`. */
1776
+ readonly SelectionPane: ToolbarPartComponent;
1777
+ /** `more.duplicate`. */
1778
+ readonly Duplicate: ToolbarPartComponent;
1779
+ /** `more.delete`. */
1780
+ readonly Delete: ToolbarPartComponent;
1781
+ /** `find.find`. */
1782
+ readonly Find: ToolbarPartComponent;
1783
+ /** `find.replace`. */
1784
+ readonly Replace: ToolbarPartComponent;
1785
+ /** `view.smartGuides`. */
1786
+ readonly SmartGuides: ToolbarPartComponent;
1787
+ /** `file.pageSetup`. */
1788
+ readonly PageSetup: ToolbarPartComponent;
1789
+ /** `edit.cut`. */
1790
+ readonly Cut: ToolbarPartComponent;
1791
+ /** `edit.copy`. */
1792
+ readonly Copy: ToolbarPartComponent;
1793
+ /** `edit.paste`. */
1794
+ readonly Paste: ToolbarPartComponent;
1795
+ /** `edit.selectAll`. */
1796
+ readonly SelectAll: ToolbarPartComponent;
1797
+ /** `slide.background`. */
1798
+ readonly FormatBackground: ToolbarPartComponent;
1799
+ /** `slide.add`: New slide, with its layout gallery. */
1800
+ readonly NewSlide: ToolbarPartComponent;
1801
+ /** `slide.layout`: the layout gallery of the current slide. */
1802
+ readonly SlideLayout: ToolbarPartComponent;
1803
+ /** `slide.reset`. */
1804
+ readonly ResetSlide: ToolbarPartComponent;
1805
+ /** `slide.hide`. */
1806
+ readonly HideSlide: ToolbarPartComponent;
1807
+ /** `view.presentationView`: the Normal or Slide sorter view. */
1808
+ readonly PresentationView: ToolbarPartComponent;
1809
+ /** `section.add`. */
1810
+ readonly AddSection: ToolbarPartComponent;
1811
+ /** `section.rename`. */
1812
+ readonly RenameSection: ToolbarPartComponent;
1813
+ /** `section.remove`. */
1814
+ readonly RemoveSection: ToolbarPartComponent;
1815
+ /** `section.removeAll`. */
1816
+ readonly RemoveAllSections: ToolbarPartComponent;
1817
+ /** `section.collapseAll`. */
1818
+ readonly CollapseAllSections: ToolbarPartComponent;
1819
+ /** `section.expandAll`. */
1820
+ readonly ExpandAllSections: ToolbarPartComponent;
1821
+ /** `view.playFromStart`. */
1822
+ readonly PlayFromStart: ToolbarPartComponent;
1823
+ /** `view.playFromCurrent`. */
1824
+ readonly PlayFromCurrent: ToolbarPartComponent;
1825
+ /** `image.corrections`. */
1826
+ readonly ImageCorrections: ToolbarPartComponent;
1827
+ /** `image.color`. */
1828
+ readonly ImageColor: ToolbarPartComponent;
1829
+ /** `image.transparency`. */
1830
+ readonly ImageTransparency: ToolbarPartComponent;
1831
+ /** `image.change`. */
1832
+ readonly ImageChange: ToolbarPartComponent;
1833
+ /** `image.reset`. */
1834
+ readonly ImageReset: ToolbarPartComponent;
1835
+ /** `image.styles`. */
1836
+ readonly ImageStyles: ToolbarPartComponent;
1837
+ /** `image.altText`. */
1838
+ readonly ImageAltText: ToolbarPartComponent;
1839
+ /** `image.crop`. */
1840
+ readonly ImageCrop: ToolbarPartComponent;
1841
+ /** `image.cropToShape`. */
1842
+ readonly ImageCropToShape: ToolbarPartComponent;
1843
+ /** `image.cropFit`. */
1844
+ readonly ImageCropFit: ToolbarPartComponent;
1845
+ /** `image.properties`. */
1846
+ readonly ImageProperties: ToolbarPartComponent;
1847
+ /** `table.insert`. */
1848
+ readonly TableInsert: ToolbarPartComponent;
1849
+ /** `table.style`. */
1850
+ readonly TableStyle: ToolbarSlotPartComponent;
1851
+ /** `table.headerRow`. */
1852
+ readonly TableHeaderRow: ToolbarPartComponent;
1853
+ /** `table.totalRow`. */
1854
+ readonly TableTotalRow: ToolbarPartComponent;
1855
+ /** `table.bandedRows`. */
1856
+ readonly TableBandedRows: ToolbarPartComponent;
1857
+ /** `table.firstColumn`. */
1858
+ readonly TableFirstColumn: ToolbarPartComponent;
1859
+ /** `table.lastColumn`. */
1860
+ readonly TableLastColumn: ToolbarPartComponent;
1861
+ /** `table.bandedColumns`. */
1862
+ readonly TableBandedColumns: ToolbarPartComponent;
1863
+ /** `table.cellFill`. */
1864
+ readonly TableCellFill: ToolbarColorSplitComponent;
1865
+ /** `table.borderTarget`. */
1866
+ readonly TableBorderTarget: ToolbarSlotPartComponent;
1867
+ /** `table.select`. */
1868
+ readonly TableSelect: ToolbarSlotPartComponent;
1869
+ /** `table.delete`. */
1870
+ readonly TableDelete: ToolbarSlotPartComponent;
1871
+ /** `table.insertRowAbove`. */
1872
+ readonly TableInsertRowAbove: ToolbarPartComponent;
1873
+ /** `table.insertRowBelow`. */
1874
+ readonly TableInsertRowBelow: ToolbarPartComponent;
1875
+ /** `table.insertColumnLeft`. */
1876
+ readonly TableInsertColumnLeft: ToolbarPartComponent;
1877
+ /** `table.insertColumnRight`. */
1878
+ readonly TableInsertColumnRight: ToolbarPartComponent;
1879
+ /** `table.mergeCells`. */
1880
+ readonly TableMergeCells: ToolbarPartComponent;
1881
+ /** `table.splitCell`. */
1882
+ readonly TableSplitCell: ToolbarSlotPartComponent;
1883
+ /** `table.distributeRows`. */
1884
+ readonly TableDistributeRows: ToolbarPartComponent;
1885
+ /** `table.distributeColumns`. */
1886
+ readonly TableDistributeColumns: ToolbarPartComponent;
1887
+ /** `table.cellMargins`. */
1888
+ readonly TableCellMargins: ToolbarSlotPartComponent;
1889
+ }
1890
+
1891
+ /**
1892
+ * Props of `NotesPane`: the pane props, without a width (the notes take the slide's width),
1893
+ * and the format buttons. @public
1894
+ */
1895
+ interface NotesPaneProps extends Omit<PaneProps, 'paneWidth'> {
1896
+ /**
1897
+ * Show the pane's bold, italic, and underline buttons. Default true. Ctrl/Cmd+B, I, and U
1898
+ * work in the notes field either way.
1899
+ */
1900
+ readonly showFormatButtons?: boolean;
1901
+ }
1902
+ /**
1903
+ * Collapsible speaker notes for the current slide. The text shown is the document's; only the
1904
+ * text typed since the field took focus is held here, bound to the slide it was typed on. It
1905
+ * is written to that slide (wherever the slide is now) when the field loses focus, when the
1906
+ * pointer goes down anywhere else, when the current slide changes, and before a format or an
1907
+ * undo. @public
1908
+ */
1909
+ declare function NotesPane(props?: NotesPaneProps): react.JSX.Element;
1910
+
1911
+ /**
1912
+ * Props of the editor's panes, after DOCX Editor's `Navigation` (`open`, `onOpenChange`,
1913
+ * `paneWidth`). A pane given `open` is controlled by the host. @public
1914
+ */
1915
+ interface PaneProps {
1916
+ /** A class name added to the pane. */
1917
+ readonly className?: string;
1918
+ /** Whether the pane is open, controlled. Use with `onOpenChange`. */
1919
+ readonly open?: boolean;
1920
+ /** Whether the pane is open first, uncontrolled. Default `true`. */
1921
+ readonly defaultOpen?: boolean;
1922
+ /** Called when the user opens or closes the pane. */
1923
+ readonly onOpenChange?: (open: boolean) => void;
1924
+ /** The pane's width in CSS pixels (the slide rail). */
1925
+ readonly paneWidth?: number;
1926
+ /** Inline styles for the pane, after DOCX Editor's `Navigation`; a `width` here wins over `paneWidth`. */
1927
+ readonly style?: CSSProperties;
1928
+ }
1929
+ /** Props of `SlideRail`: the pane props, DOCX Editor's `toggle`, and `orientation`. @public */
1930
+ interface SlideRailProps extends PaneProps {
1931
+ /**
1932
+ * Your translation function for this compound and its parts, as DOCX Editor's `t`. Without
1933
+ * it, the root's `locale` gives the labels.
1934
+ */
1935
+ readonly t?: ChromeTranslate;
1936
+ /**
1937
+ * Where the rail runs. `vertical` (the default) is a column beside the slide. `horizontal` is
1938
+ * a row under it, for a tall, narrow host: the thumbnails scroll sideways, Left and Right
1939
+ * step, a drag reorders along the row, and Hide thumbnails folds the rail down.
1940
+ */
1941
+ readonly orientation?: SlideRailOrientation;
1942
+ /**
1943
+ * The built-in Hide thumbnails and Show thumbnails buttons. `false` removes them, for a host
1944
+ * that opens and closes the rail from its own chrome (`open`, `onOpenChange`).
1945
+ */
1946
+ readonly toggle?: boolean;
1947
+ /**
1948
+ * `true` (default): the packaged action buttons, with named part children
1949
+ * (`SlideRail.AddSlide`, `SlideRail.Delete`, …) in their places and other children after
1950
+ * Delete. `false`: only the children, in their order.
1951
+ */
1952
+ readonly preset?: boolean;
1953
+ /** Named part children replace their buttons; other children go after **Delete**. */
1954
+ readonly children?: ReactNode;
1955
+ }
1956
+ /** Props of `ZoomPill`. @public */
1957
+ interface ZoomPillProps {
1958
+ /** A class name added to the pill. */
1959
+ readonly className?: string;
1960
+ }
1961
+ /** The zoom pill (`– 100% ▾ +`). @public */
1962
+ declare function ZoomPill({ className }?: ZoomPillProps): react.JSX.Element;
1963
+ /** Props of `SidePanel`. The host shows or hides the panel by rendering it. @public */
1964
+ interface SidePanelProps {
1965
+ /** Shows a close button that calls it. */
1966
+ readonly onClose?: () => void;
1967
+ /** A class name added to the panel. */
1968
+ readonly className?: string;
1969
+ /** The panel's width in CSS pixels. */
1970
+ readonly paneWidth?: number;
1971
+ /** Inline styles for the panel; a `width` here wins over `paneWidth`. */
1972
+ readonly style?: CSSProperties;
1973
+ }
1974
+ /** The side panel: Format · Comments. @public */
1975
+ declare function SidePanel({ onClose, className, paneWidth, style }: SidePanelProps): react.JSX.Element;
1976
+
1977
+ /** Props of every named part of the slide rail's action row. @public */
1978
+ interface SlideRailPartProps {
1979
+ /** A class name added to the button. */
1980
+ readonly className?: string;
1981
+ /** Remove the button from the rail. */
1982
+ readonly hidden?: boolean;
1983
+ /** Icon content in place of the packaged icon, about 18 pixels. */
1984
+ readonly icon?: ReactNode;
1985
+ /**
1986
+ * Render the one element child as the button: it gets the part's label, state, disabled
1987
+ * reason, and click, as `SlideRail.Action` and `Toolbar.Action` do.
1988
+ */
1989
+ readonly asChild?: boolean;
1990
+ /** The element for `asChild`. */
1991
+ readonly children?: ReactNode;
1992
+ }
1993
+ /** Add slide, after the current slide. @public */
1994
+ declare function SlideRailAddSlide(props: SlideRailPartProps): ReactNode;
1995
+ /** The layout gallery: adds a slide with the layout the person picks. @public */
1996
+ declare function SlideRailChooseLayout(props: SlideRailPartProps): ReactNode;
1997
+ /** Duplicate the selected slides. @public */
1998
+ declare function SlideRailDuplicate(props: SlideRailPartProps): ReactNode;
1999
+ /** Move the selected slides one place earlier (up, or left in a horizontal rail). @public */
2000
+ declare function SlideRailMoveEarlier(props: SlideRailPartProps): ReactNode;
2001
+ /** Move the selected slides one place later (down, or right in a horizontal rail). @public */
2002
+ declare function SlideRailMoveLater(props: SlideRailPartProps): ReactNode;
2003
+ /** Delete the selected slides. The last slide stays. @public */
2004
+ declare function SlideRailDelete(props: SlideRailPartProps): ReactNode;
2005
+ /** Hide thumbnails: folds the rail to a narrow strip. `toggle={false}` on the rail removes it. @public */
2006
+ declare function SlideRailCollapse(props: SlideRailPartProps): ReactNode;
2007
+ /**
2008
+ * Show thumbnails: the one button of the folded rail strip, which opens the rail again. A
2009
+ * child of `SlideRail` replaces it in place; `hidden` leaves the strip with no button.
2010
+ * `toggle={false}` on the rail removes it. @public
2011
+ */
2012
+ declare function SlideRailExpand(props: SlideRailPartProps): ReactNode;
2013
+
2014
+ /** @jsxImportSource react */
2015
+
2016
+ /** Options for `useOpenFailure`, as DOCX Editor's `UseOpenFailureOptions`. @public */
2017
+ interface UseOpenFailureOptions {
2018
+ /** Your translation function for `message`. Without it, the root's `locale` gives it. */
2019
+ readonly t?: ChromeTranslate;
2020
+ }
2021
+ /** The current refused open, with the packaged message and a way to dismiss it. @public */
2022
+ interface UseOpenFailureReturn {
2023
+ /** The refused open, or `null` when there is none or the person dismissed it. */
2024
+ readonly failure: DocumentOpenFailure | null;
2025
+ /** The packaged, translated message for `failure`. */
2026
+ readonly message: string | null;
2027
+ /** Whether the deck that was open before stays open. */
2028
+ readonly kept: boolean;
2029
+ /**
2030
+ * Hide this refusal. A later refusal shows again, even for the same file. Pass the failure
2031
+ * your UI showed, so a late call cannot hide a newer refusal.
2032
+ */
2033
+ dismiss(failure?: DocumentOpenFailure | null): void;
2034
+ }
2035
+ /**
2036
+ * Reads the file the editor refused to open, for a host that shows it in its own UI, such as
2037
+ * a toast. Pair it with `openFailure={false}` on `<PptxEditor>`, so the packaged notice does not
2038
+ * show as well. Call it inside a `PptxEditor.Root`. @public
2039
+ */
2040
+ declare function useOpenFailure(options?: UseOpenFailureOptions): UseOpenFailureReturn;
2041
+ /** What `actions` receives. @public */
2042
+ interface OpenFailureContext {
2043
+ /** The refused open: its stable `code` and its `reason`. */
2044
+ readonly failure: DocumentOpenFailure;
2045
+ /** The packaged, translated message for the failure. */
2046
+ readonly message: string;
2047
+ /** Close the notice. It calls `onDismiss`, as **Close** does. */
2048
+ dismiss(): void;
2049
+ }
2050
+ /** Props for `PptxEditor.OpenFailure`. @public */
2051
+ interface PptxEditorOpenFailureProps {
2052
+ /** The notice title. Defaults to the translated `openFailure.title`. */
2053
+ readonly title?: string;
2054
+ /** Your own message in place of the packaged one, as content or per failure. */
2055
+ readonly message?: ReactNode | ((failure: DocumentOpenFailure) => ReactNode);
2056
+ /** Show the stable error code under the message. Defaults to `true`. */
2057
+ readonly showCode?: boolean;
2058
+ /** Your own buttons, before **Close**. The notice shows no contact of its own. */
2059
+ readonly actions?: (context: OpenFailureContext) => ReactNode;
2060
+ /** The label of the **Close** button. Defaults to the translated `openFailure.close`. */
2061
+ readonly closeLabel?: string;
2062
+ /** Show the packaged **Close** button. Defaults to `true`. */
2063
+ readonly showClose?: boolean;
2064
+ /** Called after the person closes the notice, by any route. */
2065
+ readonly onDismiss?: (failure: DocumentOpenFailure) => void;
2066
+ /** Appended after the `pptx-open-failure` class. */
2067
+ readonly className?: string;
2068
+ /** Inline styles for the notice. */
2069
+ readonly style?: CSSProperties;
2070
+ /**
2071
+ * Your translation function for the notice, as DOCX Editor's `t`. Without it, the root's
2072
+ * `locale` gives the labels.
2073
+ */
2074
+ readonly t?: ChromeTranslate;
2075
+ }
2076
+ /**
2077
+ * A notice that explains why a file did not open, and says when the deck that was open stays
2078
+ * open. It shows nothing until the editor refuses a file, and shows again for each later
2079
+ * refusal. `<PptxEditor>` renders it by default; compose it yourself inside a positioned box in
2080
+ * a `PptxEditor.Root`:
2081
+ *
2082
+ * ```tsx
2083
+ * <PptxEditor.OpenFailure
2084
+ * actions={({ failure }) => (
2085
+ * <a className="pptx-open-failure__action" href={`/support?code=${failure.code}`}>
2086
+ * Get help
2087
+ * </a>
2088
+ * )}
2089
+ * />
2090
+ * ```
2091
+ *
2092
+ * For a toast or a banner of your own, use `useOpenFailure`. @public
2093
+ */
2094
+ declare const OpenFailure: (props: PptxEditorOpenFailureProps) => ReactNode;
2095
+
2096
+ /**
2097
+ * The slide show of the editor in `PptxEditor.Root`. Mount it once inside the viewport. It
2098
+ * shows nothing until a show starts: `useSlideshow().start(...)`, or the keys F5 (from the
2099
+ * start) and Shift+F5 or Ctrl/Cmd+Enter (from the current slide). @public
2100
+ */
2101
+ declare function Slideshow(): react.JSX.Element;
2102
+
2103
+ /** Props of {@link SlideSorter}. @public */
2104
+ interface SlideSorterProps {
2105
+ /** A class name added to the sorter. */
2106
+ readonly className?: string;
2107
+ }
2108
+ /**
2109
+ * The slide sorter. Put it where the slide and the rail go in the Normal view, while
2110
+ * `snapshot().presentationView` is `slideSorter`. When the view becomes `slideSorter` and no
2111
+ * sorter of the editor is mounted, a development warning says so. @public
2112
+ */
2113
+ declare function SlideSorter({ className }?: SlideSorterProps): react.JSX.Element;
2114
+
2115
+ /** @jsxImportSource react */
2116
+
2117
+ /** Props for `PptxEditor.Ribbon.Tab`. @public */
2118
+ interface RibbonTabProps {
2119
+ /** A built-in tab id changes that tab; any other id adds a host tab. */
2120
+ readonly id: RibbonTabId | (string & {});
2121
+ /** The tab's title. Wins over `labelKey`. Built-in tabs keep their own title without it. */
2122
+ readonly label?: string;
2123
+ /** A translation key for the tab's title. */
2124
+ readonly labelKey?: string;
2125
+ /** Remove the tab. Its commands keep working from menus, keys, and the API. */
2126
+ readonly hidden?: boolean;
2127
+ /** For a host tab: the tab it follows. Without it, host tabs follow the built-in ones. */
2128
+ readonly after?: RibbonTabId | (string & {});
2129
+ /** A class name added to the tab's panel. */
2130
+ readonly className?: string;
2131
+ /**
2132
+ * `Toolbar.Slot`, named parts, `Toolbar.Group`, and `Toolbar.Action` for the tab's panel, as
2133
+ * toolbar children: they change the tab's groups, or are the groups of a host tab.
2134
+ */
2135
+ readonly children?: ReactNode;
2136
+ }
2137
+ /** One tab of the ribbon. Inside `PptxEditor.Ribbon` it is a description the ribbon reads. @public */
2138
+ declare function RibbonTab(_props: RibbonTabProps): ReactNode;
2139
+ /** Props for `PptxEditor.Ribbon`. @public */
2140
+ interface RibbonProps {
2141
+ /** A class name added to the ribbon. */
2142
+ readonly className?: string;
2143
+ /**
2144
+ * `true` (default): the tabs of `RIBBON_TABS`, changed by `Ribbon.Tab` children. `false`:
2145
+ * only the `Ribbon.Tab` children.
2146
+ */
2147
+ readonly preset?: boolean;
2148
+ /** The selected tab, controlled. Use with `onTabChange`. */
2149
+ readonly tab?: RibbonTabId | (string & {});
2150
+ /** The tab selected first, uncontrolled. Default `home`. */
2151
+ readonly defaultTab?: RibbonTabId | (string & {});
2152
+ /** Called when the user selects another tab. */
2153
+ readonly onTabChange?: (tab: string) => void;
2154
+ /** `false`: a tab's groups wrap instead of moving into the More menu. Default `true`. */
2155
+ readonly overflow?: boolean;
2156
+ /** `Ribbon.Tab` children. */
2157
+ readonly children?: ReactNode;
2158
+ }
2159
+
2160
+ /** @jsxImportSource react */
2161
+
2162
+ /** Props of every status bar part. @public */
2163
+ interface StatusBarPartProps {
2164
+ /** A class name added to the part. */
2165
+ readonly className?: string;
2166
+ /** Remove the part from the status bar. */
2167
+ readonly hidden?: boolean;
2168
+ }
2169
+ /** "Slide 2 of 5". @public */
2170
+ declare function StatusBarSlideNumber({ className, hidden }: StatusBarPartProps): ReactNode;
2171
+ /** Props of `StatusBar.Notes`: the part props, and the ladder's `icon` and `asChild`. @public */
2172
+ interface StatusBarNotesProps extends StatusBarPartProps {
2173
+ /** Icon content in place of the packaged icon. */
2174
+ readonly icon?: ReactNode;
2175
+ /** Render the one element child as the button: it gets the label, state, and click. */
2176
+ readonly asChild?: boolean;
2177
+ /** The element for `asChild`. */
2178
+ readonly children?: ReactNode;
2179
+ }
2180
+ /** The Notes button: shows or hides the speaker notes (`useNotesPane`). @public */
2181
+ declare function StatusBarNotes({ className, hidden, icon, asChild, children, }: StatusBarNotesProps): ReactNode;
2182
+ /**
2183
+ * The view buttons: the editor's view switch (`view.presentationView`: Normal and Slide
2184
+ * Sorter), the same control as the default editor's status area. @public
2185
+ */
2186
+ declare function StatusBarViews({ className, hidden }: StatusBarPartProps): ReactNode;
2187
+ /** Zoom out, the zoom level with its menu, and zoom in: the editor's `ZoomPill`. @public */
2188
+ declare function StatusBarZoom({ className, hidden }: StatusBarPartProps): ReactNode;
2189
+ /** Props for `PptxEditor.StatusBar`. @public */
2190
+ interface StatusBarProps {
2191
+ /**
2192
+ * Your translation function for this compound and its parts, as DOCX Editor's `t`. Without
2193
+ * it, the root's `locale` gives the labels.
2194
+ */
2195
+ readonly t?: ChromeTranslate;
2196
+ /** A class name added to the bar. */
2197
+ readonly className?: string;
2198
+ /**
2199
+ * `true` (default): slide number, notes, views, and zoom, with named part children replacing
2200
+ * their parts in place and other children after the notes button. `false`: only the children.
2201
+ */
2202
+ readonly preset?: boolean;
2203
+ /** Named part children replace their parts; other children go after **Notes**. */
2204
+ readonly children?: ReactNode;
2205
+ }
2206
+
2207
+ /** @jsxImportSource react */
2208
+
2209
+ /**
2210
+ * The packaged link popup: `PptxEditor.HyperLink` with its default parts. A `popups.hyperlink`
2211
+ * renderer can forward its props to it, or render `PptxEditor.HyperLink` with its own parts.
2212
+ * @public
2213
+ */
2214
+ declare function HyperlinkPopup(props: HyperlinkPopupProps): ReactNode;
2215
+
2216
+ /** What `useNotesPane` returns. @public */
2217
+ interface UseNotesPaneReturn {
2218
+ /** Whether the notes pane shows its text. */
2219
+ readonly open: boolean;
2220
+ /** Show or hide the notes text. A controlled pane gets the change through `onOpenChange`. */
2221
+ readonly setOpen: (open: boolean) => void;
2222
+ /** Show the notes text when hidden, and hide it when shown. */
2223
+ readonly toggle: () => void;
2224
+ }
2225
+ /**
2226
+ * The open state of the speaker notes that `PptxEditor.NotesPane` shows, after DOCX Editor's
2227
+ * `useNavigationPane`. Use it to build a notes toggle of your own. Outside `PptxEditor.Root` it
2228
+ * warns and does nothing. @public
2229
+ */
2230
+ declare function useNotesPane(): UseNotesPaneReturn;
2231
+
2232
+ /** What `useEditorColorMode` returns. @public */
2233
+ interface UseEditorColorModeReturn {
2234
+ /** The resolved theme: `'dark'` or `'light'`. Re-renders when `colorMode` or the OS setting changes. */
2235
+ readonly colorMode: ResolvedColorMode;
2236
+ }
2237
+ /**
2238
+ * The theme the enclosing `PptxEditor.Root` resolved from its `colorMode`, so parts you build
2239
+ * yourself (a portaled popover) can match the chrome. `'system'` follows the operating system
2240
+ * and re-renders when it changes. Outside a root, or without `colorMode`, it is `'light'`. The
2241
+ * same hook as DOCX Editor's.
2242
+ *
2243
+ * @example
2244
+ * ```tsx
2245
+ * function MyPanel() {
2246
+ * const { colorMode } = useEditorColorMode();
2247
+ * return <aside className={colorMode === 'dark' ? 'panel panel--dark' : 'panel'} />;
2248
+ * }
2249
+ * ```
2250
+ *
2251
+ * @public
2252
+ */
2253
+ declare function useEditorColorMode(): UseEditorColorModeReturn;
2254
+
2255
+ /**
2256
+ * The chrome's translation function, as DOCX Editor's `useChromeTranslate`: the `t` of the
2257
+ * nearest compound that takes one, else the root's `locale`. `overrides` wins for the keys it
2258
+ * holds. Use it for the labels of your own parts, so they follow the same language.
2259
+ *
2260
+ * @example
2261
+ * ```tsx
2262
+ * const t = useChromeTranslate();
2263
+ * <PptxEditor.Toolbar.Action label={t('toolbar.save')} onSelect={save} />
2264
+ * ```
2265
+ *
2266
+ * @public
2267
+ */
2268
+ declare function useChromeTranslate(overrides?: ReadonlyMap<string, string>): ChromeTranslate;
2269
+ /** What a compound's `t` prop publishes to its parts, as DOCX Editor's toolbar context. @public */
2270
+ interface ToolbarContextValue {
2271
+ /** The host's `t` on the nearest compound, or undefined. */
2272
+ readonly t: ChromeTranslate | undefined;
2273
+ }
2274
+ /** The nearest compound's `t`. @public */
2275
+ declare const ToolbarContext: react.Context<ToolbarContextValue>;
2276
+ /** The nearest compound's published value, as DOCX Editor's `useToolbarContext`. @public */
2277
+ declare function useToolbarContext(): ToolbarContextValue;
2278
+ /**
2279
+ * The label for a key, given a host resolver: the host's translation, else the locale
2280
+ * catalog, as DOCX Editor's `useToolbarLabelFor`. @public
2281
+ */
2282
+ declare function useToolbarLabelFor(t: ChromeTranslate | undefined): (key: string) => string;
2283
+ /** The label for a key: the nearest compound's `t`, else the locale catalog. @public */
2284
+ declare function useToolbarLabel(): (key: string) => string;
2285
+ /** What {@link useHistoryGroup} returns. @public */
2286
+ interface UseHistoryGroupReturn {
2287
+ /** Put it on the control: the slider, the stepper, or the color input. */
2288
+ readonly ref: (element: HTMLElement | null) => void;
2289
+ /** The options for each command of the gesture: `{ historyGroup }`. */
2290
+ readonly options: () => EditorExecOptions;
2291
+ }
2292
+ /**
2293
+ * One undo step for one gesture on your own control, as DOCX Editor's `useHistoryGroup`. Bind
2294
+ * the control with `ref`, and pass `options()` to each command that the gesture runs. A drag,
2295
+ * a held key, or a color pick is then one step of `editor.exec({ type: 'undo' })`.
2296
+ *
2297
+ * @example
2298
+ * ```tsx
2299
+ * const group = useHistoryGroup({ kind: 'range' });
2300
+ * const size = useEditorValueCommand('font.size');
2301
+ * <input type="range" ref={group.ref} onChange={(e) => size.execute(+e.target.value, group.options())} />
2302
+ * ```
2303
+ *
2304
+ * @public
2305
+ */
2306
+ declare function useHistoryGroup({ kind }: HistoryGroupBindingOptions): UseHistoryGroupReturn;
2307
+ /**
2308
+ * The caret, as DOCX Editor's `useEditorCaret`: the text box, paragraph, and offset, or null
2309
+ * when no text is being edited. Compared by value, so a consumer re-renders only when the
2310
+ * caret moves.
2311
+ *
2312
+ * @public
2313
+ */
2314
+ declare function useEditorCaret(): EditorCaret | null;
2315
+ /** What {@link useDocumentSearch} returns, as DOCX Editor's `UseDocumentSearchResult`. @public */
2316
+ interface UseDocumentSearchResult extends DocumentSearchState {
2317
+ /** Change the text to find. The matches update at once. */
2318
+ readonly setQuery: (query: string) => void;
2319
+ /** Search now and return the matches. `selectFirst` selects the first match. */
2320
+ readonly find: (query: string, options?: DocumentSearchFindOptions) => readonly FindMatch[];
2321
+ readonly setMatchCase: (value: boolean) => void;
2322
+ readonly setWholeWord: (value: boolean) => void;
2323
+ /** Select the match at `index` and show its slide. False for an index with no match. */
2324
+ readonly goTo: (index: number) => boolean;
2325
+ /** Select the next match, after the last one the first. */
2326
+ readonly next: () => boolean;
2327
+ /** Select the previous match, before the first one the last. */
2328
+ readonly previous: () => boolean;
2329
+ /** Empty the query and drop the matches. The selection stays. */
2330
+ readonly clear: () => void;
2331
+ }
2332
+ /**
2333
+ * The editor's find session with no UI, for your own find bar, as DOCX Editor's
2334
+ * `useDocumentSearch`. Every hook on one editor shares the session. Outside a root, it has no
2335
+ * matches and every action does nothing.
2336
+ *
2337
+ * @public
2338
+ */
2339
+ declare function useDocumentSearch(): UseDocumentSearchResult;
2340
+
2341
+ /** What {@link useZoom} returns. @public */
2342
+ interface UseZoomResult {
2343
+ /** The zoom in force. 1 is 100 %. In fit mode it is the zoom that fits the slide. */
2344
+ readonly zoom: number;
2345
+ /** Whether the editor fits the slide to the window and follows its size. */
2346
+ readonly isFit: boolean;
2347
+ /** Set a fixed zoom, kept in the range 10 % to 400 %. Leaves fit mode. */
2348
+ readonly setZoom: (zoom: number) => void;
2349
+ /** Fit the slide to the window, and keep it fitted when the window changes size. */
2350
+ readonly fit: () => void;
2351
+ /** A fixed 100 %. */
2352
+ readonly reset: () => void;
2353
+ /** One step of `levels` in from the zoom in force. Does nothing at 400 %. */
2354
+ readonly zoomIn: () => void;
2355
+ /** One step of `levels` out from the zoom in force. Does nothing at 10 %. */
2356
+ readonly zoomOut: () => void;
2357
+ /** Whether `zoomIn` can step. */
2358
+ readonly canZoomIn: boolean;
2359
+ /** Whether `zoomOut` can step. */
2360
+ readonly canZoomOut: boolean;
2361
+ /** The steps the zoom buttons move through, so a custom control shows the same levels. */
2362
+ readonly levels: readonly number[];
2363
+ }
2364
+ /**
2365
+ * Read and set the slide zoom, as DOCX Editor's `useZoom`. Outside `PptxEditor.Root`, and
2366
+ * before the editor mounts, it reports 100 % and every action does nothing, so a control can
2367
+ * render unconditionally.
2368
+ *
2369
+ * @example
2370
+ * ```tsx
2371
+ * const { zoom, isFit, fit, zoomIn, canZoomIn } = useZoom();
2372
+ * <button onClick={fit} aria-pressed={isFit}>Fit</button>
2373
+ * <button onClick={zoomIn} disabled={!canZoomIn}>+</button>
2374
+ * <span>{Math.round(zoom * 100)}%</span>
2375
+ * ```
2376
+ *
2377
+ * @public
2378
+ */
2379
+ declare function useZoom(): UseZoomResult;
2380
+ /**
2381
+ * Subscribe to an editor event (`'change'`, `'selectionChange'`, `'rejection'`,
2382
+ * `'openFailure'`) for the lifetime of the component, as DOCX Editor's `useEditorEvent`. It
2383
+ * does nothing until the nearest `PptxEditor.Root` creates the editor, and subscribes again
2384
+ * when the instance changes. A new handler on each render does not subscribe again; the
2385
+ * latest one is called.
2386
+ *
2387
+ * @example
2388
+ * ```tsx
2389
+ * useEditorEvent('rejection', (rejection) => toast(rejection.reason));
2390
+ * ```
2391
+ *
2392
+ * @public
2393
+ */
2394
+ declare function useEditorEvent<E extends keyof PptxEditorEvents>(event: E, handler: PptxEditorEvents[E]): void;
2395
+ /**
2396
+ * Re-render the caller each time `editor` publishes a change, as DOCX Editor's
2397
+ * `useEditorSnapshot`. Returns a counter that changes on each change, so it also serves as a
2398
+ * dependency. Prefer `useEditorState` with a selector: it re-renders only when its slice
2399
+ * changes.
2400
+ *
2401
+ * @public
2402
+ */
2403
+ declare function useEditorSnapshot(editor: PptxEditorInstance | null): number;
2404
+ /**
2405
+ * The scope classes a part you build yourself adds to its own root element, so the editor's
2406
+ * `--doc-*` tokens and chrome styles apply to it, as DOCX Editor's `useScopeClassName`. Inside
2407
+ * `PptxEditor.Viewport` it is `''`: the viewport already carries the scope. Outside it, it is
2408
+ * `'pptx-editor '`, or `'pptx-editor dark '` when the root's `colorMode` resolved dark. A part
2409
+ * that portals out of the viewport (to `document.body`) adds `pptx-editor` itself, with
2410
+ * `useEditorColorMode` for the theme.
2411
+ *
2412
+ * The value ends with a space, so it concatenates cleanly, and `''` collapses away.
2413
+ *
2414
+ * @example
2415
+ * ```tsx
2416
+ * const scope = useScopeClassName();
2417
+ * <aside className={`${scope}my-panel`} />
2418
+ * ```
2419
+ *
2420
+ * @public
2421
+ */
2422
+ declare function useScopeClassName(): '' | 'pptx-editor ' | 'pptx-editor dark ';
2423
+
2424
+ /** @jsxImportSource react */
2425
+
2426
+ /** Props of `ShapeStyleGallery`. @public */
2427
+ interface ShapeStyleGalleryProps {
2428
+ /**
2429
+ * The cell to check: a cell, or the slot value (`row.color`, as
2430
+ * `useEditorValueCommand('shape.styles').value` gives it), or null for none.
2431
+ */
2432
+ readonly value?: ShapeStyleChoice | ShapeStyleValue | null;
2433
+ /** Called with the picked cell. */
2434
+ readonly onPick: (cell: ShapeStyleChoice) => void;
2435
+ /** A class name added to the gallery. */
2436
+ readonly className?: string;
2437
+ }
2438
+ /**
2439
+ * The Quick Styles gallery: six theme style rows of seven colors, drawn with the current
2440
+ * slide's theme. Put it in a popover or a menu. @public
2441
+ */
2442
+ declare function ShapeStyleGallery({ value, onPick, className }: ShapeStyleGalleryProps): ReactNode;
2443
+
2444
+ /** What `useHyperlinkPopup` returns, as DOCX Editor's hook of the same name. @public */
2445
+ interface UseHyperlinkPopupResult extends HyperlinkPopupActions {
2446
+ /** Whether the popup shows, what it shows, and the draft. */
2447
+ readonly state: HyperlinkPopupState;
2448
+ }
2449
+ /**
2450
+ * The link popup's behavior, for your own link UI, as DOCX Editor's `useHyperlinkPopup`.
2451
+ *
2452
+ * Inside `PptxEditor.Root` it is the shared state that the packaged popup shows, so your panel,
2453
+ * the toolbar's link control, Insert > Link, and Ctrl/Cmd+K agree. With
2454
+ * `popups.hyperlink: false`, the link controls open your panel while it is mounted. Outside a
2455
+ * root it is a standalone instance, as `useHyperlinkPopupInstance()`.
2456
+ *
2457
+ * @example
2458
+ * ```tsx
2459
+ * function LinkPanel() {
2460
+ * const { state, setUrl, commitEdit, close } = useHyperlinkPopup();
2461
+ * if (state.mode === 'closed') return null;
2462
+ * return (
2463
+ * <form onSubmit={(e) => { e.preventDefault(); commitEdit(); }}>
2464
+ * <input value={state.draft} onChange={(e) => setUrl(e.target.value)} />
2465
+ * <button type="button" onClick={close}>Cancel</button>
2466
+ * </form>
2467
+ * );
2468
+ * }
2469
+ * ```
2470
+ *
2471
+ * @public
2472
+ */
2473
+ declare function useHyperlinkPopup(): UseHyperlinkPopupResult;
2474
+ /**
2475
+ * A link popup of its own, as DOCX Editor's `useHyperlinkPopupInstance`. While `active`, it
2476
+ * opens for the link requests of the editor. Inside a root, prefer `useHyperlinkPopup()`: the
2477
+ * root's own popup also answers the requests.
2478
+ *
2479
+ * @public
2480
+ */
2481
+ declare function useHyperlinkPopupInstance(active?: boolean): UseHyperlinkPopupResult;
2482
+
2483
+ /** What `usePptxSource` returns, as DOCX Editor's `UseDocxSourceResult`. @public */
2484
+ interface UsePptxSourceResult {
2485
+ /** Bytes for the `document` prop; undefined until they arrive. */
2486
+ readonly document: Uint8Array | undefined;
2487
+ /**
2488
+ * What to give the `fonts` prop: a composed configuration on the eager path, a stable
2489
+ * resolver on the on-demand path, or undefined until there is something to give.
2490
+ */
2491
+ readonly fonts: FontConfiguration | FontResolver | undefined;
2492
+ /** Why the presentation could not be opened. A font failure never shows here. */
2493
+ readonly error: Error | null;
2494
+ /** True until the presentation arrives or fails, and while eager fonts load. */
2495
+ readonly isLoading: boolean;
2496
+ }
2497
+ /**
2498
+ * Load a presentation, and optionally its fonts, for `PptxEditor`, as DOCX Editor's
2499
+ * `useDocxSource`.
2500
+ *
2501
+ * ```tsx
2502
+ * const { document, fonts, error } = usePptxSource(url, { fonts: packagedFonts() });
2503
+ * if (error) return <p>{error.message}</p>;
2504
+ * return <PptxEditor document={document} fonts={fonts} />;
2505
+ * ```
2506
+ *
2507
+ * Eager fonts (a value, a promise, or a zero-argument loader) hold the deck back until they
2508
+ * settle, so the slides lay out once. An on-demand resolver (`packagedFonts()`,
2509
+ * `googleFonts()`) needs the parsed deck, so the bytes go through at once and the slides lay
2510
+ * out again when the faces arrive. A font failure never fails the deck.
2511
+ *
2512
+ * A URL is fetched with the browser's `fetch`, as written. Check a URL from user input first.
2513
+ *
2514
+ * @public
2515
+ */
2516
+ declare function usePptxSource(source: PptxSource | null | undefined, options?: UsePptxSourceOptions): UsePptxSourceResult;
2517
+ /** What `useEditorHostDocument` returns: the host document, or null with no DOM. @public */
2518
+ type UseEditorHostDocumentReturn = Document | null;
2519
+ /**
2520
+ * The document that the editor's slide is mounted in, as DOCX Editor's
2521
+ * `useEditorHostDocument`: an iframe's when the host mounted the editor there, else the page's
2522
+ * own. Null during server rendering. Your own chrome that adds document listeners, reads
2523
+ * focus, or adds a `<style>` uses it in place of the global `document`. Its `defaultView` is
2524
+ * the editor's window.
2525
+ *
2526
+ * @example
2527
+ * ```tsx
2528
+ * const hostDocument = useEditorHostDocument();
2529
+ * useEffect(() => {
2530
+ * if (!hostDocument) return;
2531
+ * hostDocument.addEventListener('keydown', onShortcut);
2532
+ * return () => hostDocument.removeEventListener('keydown', onShortcut);
2533
+ * }, [hostDocument]);
2534
+ * ```
2535
+ *
2536
+ * @public
2537
+ */
2538
+ declare function useEditorHostDocument(): UseEditorHostDocumentReturn;
2539
+
2540
+ /** The props of `ShapeIcon`. @public */
2541
+ interface ShapeIconProps {
2542
+ /** The preset geometry name (`a:prstGeom/@prst`), such as `rect`. */
2543
+ preset: string;
2544
+ }
2545
+ /** A preset's preview, drawn from its spec geometry. @public */
2546
+ declare function ShapeIcon({ preset }: ShapeIconProps): react.JSX.Element | null;
2547
+ /** The props of `ShapeGrid`. @public */
2548
+ interface ShapeGridProps {
2549
+ /** The preset geometry names to show, in order. */
2550
+ presets: readonly string[];
2551
+ /** Called with the preset the person picked. */
2552
+ onPick: (preset: string) => void;
2553
+ }
2554
+ /**
2555
+ * One gallery category's presets as a grid of previews drawn from their spec geometry. Each
2556
+ * preview is a `menuitem`; the arrow keys move by grid rows (`data-columns`). @public
2557
+ */
2558
+ declare function ShapeGrid({ presets, onPick }: ShapeGridProps): react.JSX.Element;
2559
+ /** The props of `ShapeGalleryControl`. @public */
2560
+ interface ShapeGalleryControlProps {
2561
+ /** The chrome slot the control runs. */
2562
+ slot: ChromeSlotId;
2563
+ /** The registry entry of the control, from `CHROME_GROUPS`. */
2564
+ control: ChromeControl;
2565
+ }
2566
+ /** The insert-shape gallery: every category, every preset as its own preview. @public */
2567
+ declare function ShapeGalleryControl({ slot, control }: ShapeGalleryControlProps): react.JSX.Element;
2568
+ /** The props of `FillControl`. @public */
2569
+ interface FillControlProps {
2570
+ /** The chrome slot the control runs. */
2571
+ slot: ChromeSlotId;
2572
+ /** The registry entry of the control, from `CHROME_GROUPS`. */
2573
+ control: ChromeControl;
2574
+ }
2575
+ /**
2576
+ * Fill color: one menu with the theme and standard colors, Transparent, gradient presets from
2577
+ * the theme colors, and a custom gradient dialog. @public
2578
+ */
2579
+ declare function FillControl({ slot, control }: FillControlProps): react.JSX.Element;
2580
+ /** Props for `PptxEditor.GradientDialog`. @public */
2581
+ interface GradientDialogProps {
2582
+ /** Whether the dialog shows. */
2583
+ readonly open: boolean;
2584
+ /** The gradient the dialog starts from. */
2585
+ readonly initial: GradientFill | null;
2586
+ /** Called when the dialog closes, applied or not. */
2587
+ readonly onClose: () => void;
2588
+ /** Called with the gradient the person applied. */
2589
+ readonly onApply: (gradient: GradientFill) => void;
2590
+ }
2591
+ /** The custom gradient dialog: type, angle, stops, rotation, and a preview. @public */
2592
+ declare function GradientDialog({ open, initial, onClose, onApply }: GradientDialogProps): react.JSX.Element;
2593
+ /** The props of `LineGlyph`. @public */
2594
+ interface LineGlyphProps {
2595
+ /** The line kind or line end to draw, as the line menus give it. */
2596
+ value: string;
2597
+ /** Draw the end at the start of the line (mirrored), for the line start menu. */
2598
+ start?: boolean;
2599
+ }
2600
+ /** Glyphs for line kinds and line ends, drawn at the right of a 48×24 box. @public */
2601
+ declare function LineGlyph({ value, start }: LineGlyphProps): react.JSX.Element;
2602
+ /** The props of `LineMenuControl`. @public */
2603
+ interface LineMenuControlProps {
2604
+ /** The chrome slot the control runs. */
2605
+ slot: ChromeSlotId;
2606
+ /** The registry entry of the control, from `CHROME_GROUPS`. */
2607
+ control: ChromeControl;
2608
+ }
2609
+ /** The line tool and the line start and end menus, with each option drawn. @public */
2610
+ declare function LineMenuControl({ slot, control }: LineMenuControlProps): react.JSX.Element | null;
2611
+
2612
+ /**
2613
+ * The deck's slide layouts (`EditorSnapshot.layouts`), in the order the galleries list them,
2614
+ * reference-stable while they do not change. For a host's own layout picker. @public
2615
+ */
2616
+ declare function useSlideLayouts(): readonly SlideLayoutSummary[];
2617
+ /** Props of {@link LayoutGallery}, named as DOCX Editor's `StylePicker` names them. @public */
2618
+ interface LayoutGalleryProps {
2619
+ /** The layout to mark as the current one (`menuitemradio`, checked). Absent: plain rows. */
2620
+ readonly value?: string;
2621
+ /** Called with the picked layout's id (`SlideLayoutSummary.id`). */
2622
+ readonly onChange: (layoutId: string) => void;
2623
+ /** A class name added to the gallery's root element. */
2624
+ readonly className?: string;
2625
+ /** The layouts to show. Default: every layout of the deck (`useSlideLayouts`). */
2626
+ readonly layouts?: readonly SlideLayoutSummary[];
2627
+ /** Show the tiles but take no pick. Default: true while the deck is open for viewing. */
2628
+ readonly disabled?: boolean;
2629
+ /**
2630
+ * Why the gallery takes no pick, for the tiles' tooltips: a catalog key (such as
2631
+ * `useEditorCommand(slotId).disabledReason`) or text. Default: the viewing reason.
2632
+ */
2633
+ readonly disabledReason?: string | null;
2634
+ }
2635
+ /**
2636
+ * A grid of the deck's layouts, as the Layout and New Slide galleries show them: one
2637
+ * group per slide master, headed by its name, and each tile the engine's render of a new slide
2638
+ * on the layout, named below. The tiles are menu rows (`menuitem`, or `menuitemradio` with
2639
+ * `value`); arrow keys, Home, and End move between them, so the gallery works in any menu or
2640
+ * popup of the host. @public
2641
+ */
2642
+ declare function LayoutGallery({ value: current, onChange, className, layouts: given, disabled, disabledReason, }: LayoutGalleryProps): react.JSX.Element;
2643
+ /** The props of `NewSlideControl`. @internal */
2644
+ interface NewSlideControlProps {
2645
+ /** The chrome slot the control runs. */
2646
+ slot: ChromeSlotId;
2647
+ /** The registry entry of the control, from `CHROME_GROUPS`. */
2648
+ control: ChromeControl;
2649
+ }
2650
+ /**
2651
+ * Home > New Slide: the button adds a slide on the default next layout; the arrow opens the
2652
+ * layout gallery. The toolbar's part for `slide.add`; hosts place it with `Toolbar.Slot`. @internal
2653
+ */
2654
+ declare function NewSlideControl({ slot, control }: NewSlideControlProps): react.JSX.Element;
2655
+ /** The props of `LayoutControl`. @internal */
2656
+ interface LayoutControlProps {
2657
+ /** The chrome slot the control runs. */
2658
+ slot: ChromeSlotId;
2659
+ /** The registry entry of the control, from `CHROME_GROUPS`. */
2660
+ control: ChromeControl;
2661
+ }
2662
+ /**
2663
+ * Home > Layout: the layout gallery, with the current slide's layout marked. The trigger is one
2664
+ * button, so it takes the slot's `icon` and `asChild` as `ToolButton` does. The toolbar's part
2665
+ * for `slide.layout`; hosts place it with `Toolbar.Slot`. @internal
2666
+ */
2667
+ declare function LayoutControl({ slot, control }: LayoutControlProps): react.JSX.Element;
2668
+
2669
+ /** What `useParagraphFormat` returns. @public */
2670
+ interface UseParagraphFormatReturn {
2671
+ /** The selected paragraphs' formatting, or null when no text is selected. */
2672
+ readonly format: ParagraphFormatRead | null;
2673
+ /** Whether the engine can write paragraph formatting now (text or a shape with text selected, editable). */
2674
+ readonly isEnabled: boolean;
2675
+ /** Write the given fields as ONE undo step. Returns whether the engine accepted them. */
2676
+ readonly apply: (update: ParagraphFormatCommand) => boolean;
2677
+ }
2678
+ /**
2679
+ * The selection's paragraph formatting, and the command to change it. `apply` sends one
2680
+ * `setParagraphFormat`, so a dialog's worth of changes is one undo step.
2681
+ *
2682
+ * @example
2683
+ * ```tsx
2684
+ * function SpaceAfterButton() {
2685
+ * const { isEnabled, apply } = useParagraphFormat();
2686
+ * return <button disabled={!isEnabled} onClick={() => apply({ spaceAfterPt: 12 })}>12 pt after</button>;
2687
+ * }
2688
+ * ```
2689
+ *
2690
+ * @public
2691
+ */
2692
+ declare function useParagraphFormat(): UseParagraphFormatReturn;
2693
+
2694
+ /** What `useFontFormat` returns. @public */
2695
+ interface UseFontFormatReturn {
2696
+ /** The font of the selected text, or of every run of the selected shapes; null with none. */
2697
+ readonly format: FontFormatRead | null;
2698
+ /** Whether the engine can write font formatting now (text or a shape with text selected, editable). */
2699
+ readonly isEnabled: boolean;
2700
+ /** Write the given fields as ONE undo step. Returns whether the engine accepted them. */
2701
+ readonly apply: (update: FontFormatCommand) => boolean;
2702
+ }
2703
+ /**
2704
+ * The font of the selected text (or of every run of the selected shapes), and the command to
2705
+ * change it. `apply` sends one `setFontFormat`, so
2706
+ * a dialog's worth of changes is one undo step.
2707
+ *
2708
+ * @example
2709
+ * ```tsx
2710
+ * function Loose() {
2711
+ * const { isEnabled, apply } = useFontFormat();
2712
+ * return <button disabled={!isEnabled} onClick={() => apply({ characterSpacingPt: 3 })}>Loose</button>;
2713
+ * }
2714
+ * ```
2715
+ *
2716
+ * @public
2717
+ */
2718
+ declare function useFontFormat(): UseFontFormatReturn;
2719
+
2720
+ /** What `useBulletFormat` returns. @public */
2721
+ interface UseBulletFormatReturn {
2722
+ /**
2723
+ * The bullet format of the selected paragraphs: null when they have no list, undefined when
2724
+ * they differ or nothing with text is selected.
2725
+ */
2726
+ readonly format: BulletFormatRead | null | undefined;
2727
+ /** Whether the engine can write a bullet format now (text or a shape with text selected, editable). */
2728
+ readonly isEnabled: boolean;
2729
+ /**
2730
+ * Write a bullet format (null turns the list off) as ONE undo step. An omitted field keeps
2731
+ * each paragraph's value; with no `kind`, the size and color change and each paragraph keeps
2732
+ * its own bullet or number. Returns whether the engine accepted it.
2733
+ */
2734
+ readonly apply: (format: BulletFormat | null) => boolean;
2735
+ }
2736
+ /**
2737
+ * The bullet format of the selected paragraphs, and the command to change it. `apply` sends one
2738
+ * `setBulletFormat`, so a dialog's worth of changes is one undo step.
2739
+ *
2740
+ * @example
2741
+ * ```tsx
2742
+ * function Bigger() {
2743
+ * const { isEnabled, apply } = useBulletFormat();
2744
+ * return <button disabled={!isEnabled} onClick={() => apply({ sizePercent: 150 })}>Bigger bullets</button>;
2745
+ * }
2746
+ * ```
2747
+ *
2748
+ * @public
2749
+ */
2750
+ declare function useBulletFormat(): UseBulletFormatReturn;
2751
+
2752
+ /**
2753
+ * What `useFonts` returns: one marked resolver for the component's life. Named for the
2754
+ * adapters' composable parity check (PPTX Editor addition).
2755
+ *
2756
+ * @public
2757
+ */
2758
+ type UseFontsReturn = MarkedFontResolver;
2759
+ /**
2760
+ * Anything that can describe fonts: a resolved configuration, a bare fragment, a promise
2761
+ * for either (what a loader like `defaultFonts()` returns), or an on-demand
2762
+ * {@link FontResolver} (what `packagedFonts()` and `googleFonts()` return).
2763
+ *
2764
+ * The resolver arm is BARE `FontResolver`, unmarked. `FontOrigin` — what a list position
2765
+ * takes — requires the `defineFontResolver` mark, because a list may also hold a
2766
+ * zero-argument loader and only the mark separates the two. There is no such ambiguity in
2767
+ * the first argument of {@link useFonts}, which has never accepted a loader, so it keeps
2768
+ * taking any resolver.
2769
+ *
2770
+ * @public
2771
+ */
2772
+ type FontsInput = FontConfiguration | FontConfigurationFragment | FontResolver | Promise<FontConfiguration | FontConfigurationFragment | undefined> | undefined;
2773
+ /**
2774
+ * Merge font origins into one stable value for `PptxEditor.Root`'s `fonts` prop.
2775
+ *
2776
+ * ```tsx
2777
+ * // The bundled substitutes: the families this document names, plus its default face.
2778
+ * const fonts = useFonts(packagedFonts());
2779
+ *
2780
+ * // The same, plus the Google catalog for everything they do not cover.
2781
+ * const fonts = useFonts(packagedFonts(), googleFonts());
2782
+ *
2783
+ * // Brand faces first, then whatever is left.
2784
+ * const fonts = useFonts(brandFragment, packagedFonts());
2785
+ *
2786
+ * return <PptxEditor.Root fonts={fonts}>{children}</PptxEditor.Root>;
2787
+ * ```
2788
+ *
2789
+ * EVERY argument takes the same union, so adding an origin is adding an argument and
2790
+ * never a change of shape. Origins compose first-wins in argument order, exactly like
2791
+ * `composeFontConfiguration`: the first argument beats later ones, and any of them beats
2792
+ * a substitution for a family some origin supplies directly.
2793
+ *
2794
+ * They resolve ONE AFTER ANOTHER, not concurrently, so that each can be told which faces
2795
+ * the ones before it already cover and skip fetching them. That costs one extra origin's
2796
+ * latency on the critical path and saves a duplicate download — and, for a network origin,
2797
+ * a request that would have told a font host which families the document uses for nothing.
2798
+ * Order origins cheapest-first.
2799
+ *
2800
+ * The returned resolver never changes identity, so the editor is never rebuilt on account
2801
+ * of this prop. Arguments are re-read when opening a document or requesting a new family.
2802
+ * Changing them alone does not replace already loaded faces; reload the document for that.
2803
+ *
2804
+ * It is marked (`defineFontResolver`), so it can itself be an origin of another list or
2805
+ * the `fonts` option of `createPptxEditor` without being mistaken for a zero-argument loader.
2806
+ *
2807
+ * @public
2808
+ */
2809
+ declare function useFonts(source: FontsInput, ...fragments: readonly (FontConfigurationFragment | undefined)[]): UseFontsReturn;
2810
+ /**
2811
+ * The uniform form: every position takes the same {@link FontOrigin}, so composing two
2812
+ * resolvers is one extra argument.
2813
+ *
2814
+ * A resolver in any position but the first must carry the `defineFontResolver` mark. The
2815
+ * first position keeps the older, looser type so that every call that compiled before this
2816
+ * overload existed still compiles.
2817
+ *
2818
+ * @public
2819
+ */
2820
+ declare function useFonts(...origins: readonly FontOrigin[]): UseFontsReturn;
2821
+
2822
+ /** What `useFontFamily` returns, as DOCX Editor's `UseFontFamilyResult`. @public */
2823
+ interface UseFontFamilyReturn {
2824
+ /** The family of the selected text, or null for a mixed selection or no selection. */
2825
+ readonly value: string | null;
2826
+ /**
2827
+ * The theme font the selected text uses (`major` for the headings font, `minor` for the body
2828
+ * font), or null when it names a family.
2829
+ */
2830
+ readonly theme: 'major' | 'minor' | null;
2831
+ /**
2832
+ * Apply a family, or a theme font reference (`+mj-lt`, `+mn-lt`) so the text follows a later
2833
+ * theme change. A refusal does nothing.
2834
+ */
2835
+ readonly setValue: (family: string) => void;
2836
+ /** Every family the editor offers: standard, configured, embedded, and the deck's own. */
2837
+ readonly options: readonly string[];
2838
+ /**
2839
+ * The packaged picker's groups for the current slide, empty groups left out: the theme fonts
2840
+ * (labeled Headings and Body), the other families the deck names, then all families.
2841
+ */
2842
+ readonly groups: readonly FontPickerGroup[];
2843
+ /** Whether a row is the font the selected text uses, for a check mark. */
2844
+ readonly isCurrent: (row: FontPickerRow) => boolean;
2845
+ /** Whether the engine can change the font now. */
2846
+ readonly isEnabled: boolean;
2847
+ /** Why the font cannot change: a catalog key, or the engine's own text. */
2848
+ readonly disabledReason: string | null;
2849
+ }
2850
+ /**
2851
+ * The font family picker's behavior, with no UI, as DOCX Editor's `useFontFamily`.
2852
+ *
2853
+ * @example
2854
+ * ```tsx
2855
+ * function FamilyList() {
2856
+ * const { groups, setValue, isCurrent, isEnabled } = useFontFamily();
2857
+ * return groups.flatMap((group) =>
2858
+ * group.rows.map((row) => (
2859
+ * <button key={row.value} disabled={!isEnabled || row.disabled} aria-pressed={isCurrent(row)}
2860
+ * onClick={() => setValue(row.value)}>{row.family}</button>
2861
+ * ))
2862
+ * );
2863
+ * }
2864
+ * ```
2865
+ *
2866
+ * @public
2867
+ */
2868
+ declare function useFontFamily(): UseFontFamilyReturn;
2869
+
2870
+ /**
2871
+ * Prevent chrome mousedown from moving focus (inputs keep their behavior). Chrome building
2872
+ * block, not a stable API. @internal
2873
+ */
2874
+ declare function keepFocus(e: MouseEvent): void;
2875
+ /** The props of `Icon`. @public */
2876
+ interface IconProps {
2877
+ /** A Material Symbol name from `ICON_PATHS`. */
2878
+ name?: string;
2879
+ /** SVG path data, in place of `name`. */
2880
+ paths?: readonly string[] | null;
2881
+ /** The class of the `svg` element. Defaults to `pptx-icon`. */
2882
+ className?: string;
2883
+ }
2884
+ /** An inline Material Symbol. @public */
2885
+ declare function Icon({ name, paths, className }: IconProps): react.JSX.Element;
2886
+ /** The props of `ToolButton`. @internal */
2887
+ interface ToolButtonProps {
2888
+ /** The accessible name and tooltip of the button. */
2889
+ label: string;
2890
+ /** SVG path data for the icon, in place of `icon`. */
2891
+ paths?: readonly string[] | null;
2892
+ /** A Material Symbol name from `ICON_PATHS`. */
2893
+ icon?: string;
2894
+ /** Called when the person activates the button. */
2895
+ onClick: () => void;
2896
+ /** The button cannot run. It stays focusable and names `disabledReason`. */
2897
+ disabled?: boolean;
2898
+ /** Why the button is disabled; read after its name. */
2899
+ disabledReason?: string | null;
2900
+ /** For a toggle: whether it is on (`aria-pressed`). */
2901
+ pressed?: boolean;
2902
+ /** For a button that shows or hides a region: whether it is shown (`aria-expanded`). */
2903
+ expanded?: boolean;
2904
+ /** The id of the region the button shows or hides (`aria-controls`). */
2905
+ controls?: string;
2906
+ /** Content after the icon. */
2907
+ children?: ReactNode;
2908
+ /** A class name added to the button. */
2909
+ className?: string;
2910
+ /** The chrome slot this button drives, as `data-slot` for hosts and tests. */
2911
+ slot?: string;
2912
+ /** The popup this button opens (`aria-haspopup`); `expanded` says whether it is open. */
2913
+ hasPopup?: 'menu' | 'grid' | 'dialog';
2914
+ /** False for the main half of a color split: a host element cannot stand in for it. */
2915
+ asChild?: boolean;
2916
+ /** A host element that renders the button, from a part's own `asChild` (no slot override). */
2917
+ host?: ReactElement<HostElementProps> | null;
2918
+ }
2919
+ /** A toolbar icon button with tooltip and disabled reason. Not a stable API. @internal */
2920
+ declare function ToolButton(props: ToolButtonProps): react.JSX.Element;
2921
+ /** The props of `Popover`. @internal */
2922
+ interface PopoverProps {
2923
+ /** The element the panel opens under. */
2924
+ anchor: HTMLElement | null;
2925
+ /** Called when the panel closes: an outside click, Escape, or Tab. */
2926
+ onClose: () => void;
2927
+ /** The panel's content. */
2928
+ children: ReactNode;
2929
+ /** The edge of the anchor that the panel lines up with. Defaults to `start`. */
2930
+ align?: 'start' | 'end';
2931
+ /** The accessible name; defaults to the trigger's `aria-label`. */
2932
+ label?: string;
2933
+ /** `menu` (default) for rows, or `dialog` for a form or controls. */
2934
+ role?: 'menu' | 'dialog';
2935
+ /** The element id, for the trigger's `aria-controls`. */
2936
+ id?: string;
2937
+ /**
2938
+ * A dialog panel opened from the keyboard takes focus at its first control (a menu always
2939
+ * does), and Tab past its first or last control closes it and returns to the trigger.
2940
+ */
2941
+ focusFirst?: boolean;
2942
+ /**
2943
+ * A dialog with a field to type in (the font search): its field takes focus when it opens,
2944
+ * for pointer and keyboard users alike.
2945
+ */
2946
+ field?: boolean;
2947
+ /** A panel that takes no focus when it opens: the keys stay in the slide text. */
2948
+ passive?: boolean;
2949
+ /** A class name added to the panel. */
2950
+ className?: string;
2951
+ /**
2952
+ * A box in client pixels to open at instead of the anchor's own box (the link popup at the
2953
+ * selected text). Focus and dismissal still use `anchor`.
2954
+ */
2955
+ anchorRect?: PopoverAnchorRect | null;
2956
+ }
2957
+ /**
2958
+ * A popover anchored under an element, closed on outside click, Escape, or Tab.
2959
+ *
2960
+ * As a `menu` (the default) it follows the WAI-ARIA menu pattern, as DOCX Editor's menus do:
2961
+ * the arrow keys, Home, and End move through the rows (by grid rows in a swatch grid), and
2962
+ * every row is one `tabIndex=-1` stop. As a `dialog` it holds a form or controls (the font
2963
+ * search, the link field, the More card). With `field`, its field takes focus when it opens,
2964
+ * for pointer and keyboard users. Otherwise, when the trigger has focus at open (a keyboard
2965
+ * user), focus moves to the first row or control; after a pointer open the panel itself takes
2966
+ * focus (core's `focusPopoverOnOpen`), so typing and the arrow keys reach the popover, not the
2967
+ * slide text. Escape returns focus to the trigger. Another close gives focus back to where it
2968
+ * was before a pointer open (the slide text), else to the trigger, unless the popover moved it
2969
+ * on purpose. @internal
2970
+ */
2971
+ declare function Popover({ anchor, onClose, children, align, label, role, id, focusFirst, field, passive, className, anchorRect, }: PopoverProps): react.ReactPortal;
2972
+ /** The props of `MenuItem`. @internal */
2973
+ interface MenuItemProps {
2974
+ /** The row's content. */
2975
+ children: ReactNode;
2976
+ /** Called when the person activates the row. */
2977
+ onSelect: () => void;
2978
+ /** For a choice row: whether it is the current choice (`aria-checked`). */
2979
+ checked?: boolean;
2980
+ /** The row cannot run. */
2981
+ disabled?: boolean;
2982
+ /**
2983
+ * Why a disabled row cannot run. The row then stays focusable (`aria-disabled`) and names
2984
+ * the reason, so a keyboard or screen-reader user meets it too; it still does not run.
2985
+ */
2986
+ reason?: string;
2987
+ /** The row's tooltip. */
2988
+ title?: string;
2989
+ /** A row of a `listbox` (the font list) instead of a menu. */
2990
+ option?: boolean;
2991
+ /** An on/off setting: `menuitemcheckbox`. */
2992
+ checkbox?: boolean;
2993
+ /**
2994
+ * A hint read after the row's name (`aria-description`), so the name stays the label alone:
2995
+ * mark a visible hint in the row `aria-hidden`.
2996
+ */
2997
+ description?: string;
2998
+ }
2999
+ /**
3000
+ * A menu row: `menuitem`, or `menuitemradio` when `checked` is given (`menuitemcheckbox` with
3001
+ * `checkbox`, for an on/off setting), or `option` in a list box. Rows are `tabIndex=-1`: the
3002
+ * arrow keys move between them. @internal
3003
+ */
3004
+ declare function MenuItem({ children, onSelect, checked, disabled, reason, title, option, checkbox, description, }: MenuItemProps): react.JSX.Element;
3005
+
3006
+ /**
3007
+ * `PptxEditor.Toolbar` with its statics, as DOCX Editor's `DocxEditorToolbarNamespace`. @public
3008
+ */
3009
+ interface PptxEditorToolbarNamespace extends ToolbarNamedParts {
3010
+ /** The toolbar, with every registered group. See `ToolbarProps`. */
3011
+ (props: ToolbarProps): ReactNode;
3012
+ /** Changes, replaces, or hides one registered control. */
3013
+ readonly Slot: typeof ToolbarSlot;
3014
+ /** Changes a built-in group or adds a host group. */
3015
+ readonly Group: typeof ToolbarGroup;
3016
+ /** A host-owned action the chrome registry does not describe. */
3017
+ readonly Action: typeof ToolbarAction;
3018
+ /** A vertical rule between controls. */
3019
+ readonly Separator: typeof ToolbarSeparator;
3020
+ }
3021
+ /**
3022
+ * The toolbar, with its parts: `Toolbar.Slot` changes or replaces one registered control,
3023
+ * `Toolbar.Group` changes a built-in group or adds a host group, `Toolbar.Action` is a host's
3024
+ * own button, and the named parts (`Toolbar.Bold`, `Toolbar.FontFamily`, …) stand for one slot
3025
+ * each. @public
3026
+ */
3027
+ declare const Toolbar: PptxEditorToolbarNamespace;
3028
+ /**
3029
+ * The named rows of the menu bar (`Menu.Cut`, `Menu.PageSetup`, …), one per row of core's
3030
+ * `MENU_NAMED_PARTS`. Put one in the menu that holds its row. @public
3031
+ */
3032
+ type MenuNamedRows = {
3033
+ readonly [K in MenuRowPartName]: MenuRowPartComponent;
3034
+ };
3035
+ /**
3036
+ * The named rows of the canvas context menu (`ContextMenu.Cut`, `ContextMenu.MergeCells`, …),
3037
+ * one per row of core's `CONTEXT_MENU_NAMED_PARTS`. @public
3038
+ */
3039
+ type ContextMenuNamedRows = {
3040
+ readonly [K in ContextMenuPartName]: MenuRowPartComponent;
3041
+ };
3042
+ /** The menu bar with its parts attached as statics. @public */
3043
+ interface MenuNamespace extends MenuNamedRows {
3044
+ /** The menu bar. See `MenuProps`. */
3045
+ (props: MenuProps): ReactNode;
3046
+ /** A menu of the bar: a built-in id changes it, another id adds a host menu. */
3047
+ readonly Entry: typeof MenuEntry;
3048
+ /** A row for a registered slot. */
3049
+ readonly Item: typeof MenuSlotItem;
3050
+ /** A host row: label, icon, shortcut, and an action. */
3051
+ readonly Row: typeof MenuRow;
3052
+ /** A labeled set of rows. */
3053
+ readonly Group: typeof MenuGroup;
3054
+ /** A line between rows. */
3055
+ readonly Separator: typeof MenuSeparator;
3056
+ /** A row that opens a nested panel. */
3057
+ readonly Submenu: typeof MenuSubmenu;
3058
+ /** The Insert > Table grid, for a host's own Table submenu (DOCX Editor's `Menu.TableGrid`). */
3059
+ readonly TableGrid: typeof MenuTableGrid;
3060
+ /** The File menu. */
3061
+ readonly File: MenuPartComponent;
3062
+ /** The Edit menu. */
3063
+ readonly Edit: MenuPartComponent;
3064
+ /** The View menu. */
3065
+ readonly View: MenuPartComponent;
3066
+ /** The Insert menu. */
3067
+ readonly Insert: MenuPartComponent;
3068
+ /** The Format menu. */
3069
+ readonly Format: MenuPartComponent;
3070
+ /** The Arrange menu. */
3071
+ readonly Arrange: MenuPartComponent;
3072
+ /** The Slide Show menu. */
3073
+ readonly SlideShow: MenuPartComponent;
3074
+ }
3075
+ /**
3076
+ * The menu bar (`PptxEditor.Menu`): File, Edit, View, Insert, Format, Arrange, and Slide Show,
3077
+ * with DOCX Editor's parts (`Entry`, `Item`, `Row`, `Group`, `Separator`, `Submenu`) and one
3078
+ * named part per menu (`Menu.File`, …). @public
3079
+ */
3080
+ declare const PptxEditorMenu: MenuNamespace;
3081
+ /** The canvas context menu with its parts attached as statics. @public */
3082
+ interface ContextMenuNamespace extends ContextMenuNamedRows {
3083
+ /** The canvas context menu, for the target that opened it. See `PptxEditorContextMenuProps`. */
3084
+ (props: PptxEditorContextMenuProps): ReactNode;
3085
+ /** A row for a registered slot; replaces or hides the built-in row of the same slot. */
3086
+ readonly Slot: typeof MenuSlotItem;
3087
+ /** A host row: label, icon, shortcut, and an action. */
3088
+ readonly Item: typeof MenuRow;
3089
+ /** A labeled set of rows. */
3090
+ readonly Group: typeof MenuGroup;
3091
+ /** A line between rows. */
3092
+ readonly Separator: typeof MenuSeparator;
3093
+ /** A row that opens a nested panel. */
3094
+ readonly Submenu: typeof MenuSubmenu;
3095
+ }
3096
+ /**
3097
+ * The slide canvas's context menu (`PptxEditor.ContextMenu`), with DOCX Editor's parts (`Slot`,
3098
+ * `Item`, `Group`, `Separator`, `Submenu`). Place it in the root or the viewport, or render it
3099
+ * in `popups.contextMenu`. @public
3100
+ */
3101
+ declare const PptxEditorContextMenu: ContextMenuNamespace;
3102
+
3103
+ /** The ribbon with its parts attached as statics. @public */
3104
+ interface RibbonNamespace {
3105
+ /** The ribbon. See `RibbonProps`. */
3106
+ (props: RibbonProps): ReactNode;
3107
+ /** A tab: a built-in id changes it, another id adds a host tab. */
3108
+ readonly Tab: typeof RibbonTab;
3109
+ }
3110
+ /**
3111
+ * The ribbon (`PptxEditor.Ribbon`): the reference PDF's tabs over the toolbar's
3112
+ * groups, with the Quick Access Toolbar and contextual tabs. Each tab panel takes toolbar
3113
+ * children (`Toolbar.Slot`, named parts, `Toolbar.Group`, `Toolbar.Action`) through
3114
+ * `Ribbon.Tab`. @public
3115
+ */
3116
+ declare const PptxEditorRibbon: RibbonNamespace;
3117
+
3118
+ /** The status bar with its parts attached as statics. @public */
3119
+ interface StatusBarNamespace {
3120
+ /** The status bar. See `StatusBarProps`. */
3121
+ (props: StatusBarProps): ReactNode;
3122
+ /** "Slide x of y". */
3123
+ readonly SlideNumber: typeof StatusBarSlideNumber;
3124
+ /** The Notes button. */
3125
+ readonly Notes: typeof StatusBarNotes;
3126
+ /** The view switch. */
3127
+ readonly Views: typeof StatusBarViews;
3128
+ /** The zoom pill. */
3129
+ readonly Zoom: typeof StatusBarZoom;
3130
+ /** A host-owned button with the bar's styling: the same component as `Toolbar.Action`. */
3131
+ readonly Action: typeof ToolbarAction;
3132
+ }
3133
+ /**
3134
+ * The status bar (`PptxEditor.StatusBar`): slide x of y, the Notes button, the view switch,
3135
+ * and the zoom pill. @public
3136
+ */
3137
+ declare const PptxEditorStatusBar: StatusBarNamespace;
3138
+
3139
+ /** The slide rail with its action parts attached as statics, as `StatusBarNamespace`. @public */
3140
+ interface SlideRailNamespace {
3141
+ /** The slide rail. See `SlideRailProps`. */
3142
+ (props: SlideRailProps): ReactNode;
3143
+ /** Add slide. */
3144
+ readonly AddSlide: typeof SlideRailAddSlide;
3145
+ /** The layout gallery button. */
3146
+ readonly ChooseLayout: typeof SlideRailChooseLayout;
3147
+ /** Duplicate the selected slides. */
3148
+ readonly Duplicate: typeof SlideRailDuplicate;
3149
+ /** Move the selected slides earlier. */
3150
+ readonly MoveEarlier: typeof SlideRailMoveEarlier;
3151
+ /** Move the selected slides later. */
3152
+ readonly MoveLater: typeof SlideRailMoveLater;
3153
+ /** Delete the selected slides. */
3154
+ readonly Delete: typeof SlideRailDelete;
3155
+ /** Hide thumbnails. */
3156
+ readonly Collapse: typeof SlideRailCollapse;
3157
+ /** Show thumbnails: the button of the folded strip. */
3158
+ readonly Expand: typeof SlideRailExpand;
3159
+ /** A host-owned button with the rail's styling: the same component as `Toolbar.Action`. */
3160
+ readonly Action: typeof ToolbarAction;
3161
+ }
3162
+ /**
3163
+ * The slide rail (`PptxEditor.SlideRail`) with its action parts: a named part child replaces
3164
+ * its button, `hidden` removes it, other children go after Delete, and `preset={false}` renders
3165
+ * only the children. @public
3166
+ */
3167
+ declare const SlideRail: SlideRailNamespace;
3168
+
3169
+ /** Props of the `<PptxEditor>` sugar component. @public */
3170
+ interface PptxEditorProps {
3171
+ /** `.pptx` bytes. Identity change loads the new document. */
3172
+ readonly document?: Uint8Array;
3173
+ /** `'edit'` (default) or `'view'`. Changes apply without a reload. */
3174
+ readonly mode?: EditorMode;
3175
+ /** UI locale catalog, as on `PptxEditor.Root`. English when omitted. */
3176
+ readonly locale?: LocaleCatalog;
3177
+ /** Fired once per instance after it is published, as on `PptxEditor.Root`. */
3178
+ readonly onReady?: (editor: PptxEditorInstance) => void;
3179
+ /** Fired after every change of editor state, as on `PptxEditor.Root`. */
3180
+ readonly onChange?: (editor: PptxEditorInstance) => void;
3181
+ /** Appended after the `pptx-default` class of the viewport. */
3182
+ readonly className?: string;
3183
+ /** Customize the dialogs the editor mounts, as on `PptxEditor.Root`. */
3184
+ readonly popups?: PptxEditorPopups;
3185
+ /** The chrome color mode, as on `PptxEditor.Root`. */
3186
+ readonly colorMode?: ColorMode;
3187
+ /** Font bytes for the host's faces, as on `PptxEditor.Root`. */
3188
+ readonly fonts?: EditorFontsOption;
3189
+ /** Called for each font failure, as on `PptxEditor.Root`. */
3190
+ readonly onFontError?: (error: EditorFontError) => void;
3191
+ /** Families the font picker offers, as on `PptxEditor.Root`. A change applies in place. */
3192
+ readonly fontFamilies?: readonly string[];
3193
+ /** Capability modules (`@pptx-editor.dev/pro`), as on `PptxEditor.Root`. Read at mount. */
3194
+ readonly modules?: readonly EditorModule[];
3195
+ /**
3196
+ * The notice for a file that does not open (`PptxEditor.OpenFailure`). An object is
3197
+ * `PptxEditorOpenFailureProps`, passed straight through. `false` removes the notice, for a host that
3198
+ * reports the failure itself through `useOpenFailure`. Default `true`.
3199
+ */
3200
+ readonly openFailure?: boolean | PptxEditorOpenFailureProps;
3201
+ /**
3202
+ * Your own buttons in the open-failure notice, before **Close**. It replaces
3203
+ * `openFailure.actions`; pass only one. With `openFailure={false}` it renders nothing. Both
3204
+ * cases print a development warning.
3205
+ */
3206
+ readonly renderOpenFailureActions?: (context: OpenFailureContext) => ReactNode;
3207
+ /**
3208
+ * The toolbar (`PptxEditor.Toolbar`). An object is `ToolbarProps`, passed straight through,
3209
+ * so `toolbar={{ children: <PptxEditor.Toolbar.Bold hidden /> }}` changes one control.
3210
+ * `false` removes it. Default `true`.
3211
+ */
3212
+ readonly toolbar?: boolean | ToolbarProps;
3213
+ /**
3214
+ * The menu bar (`PptxEditor.Menu`), above the toolbar. An object is `MenuProps`, passed
3215
+ * straight through, as DOCX Editor's `menu`. Default `false`: the packaged editor shows the
3216
+ * toolbar only.
3217
+ */
3218
+ readonly menu?: boolean | MenuProps;
3219
+ /**
3220
+ * The slide canvas's context menu. An object is `PptxEditorContextMenuProps`, passed straight
3221
+ * through, so `contextMenu={{ children: <PptxEditor.ContextMenu.Cut hidden /> }}` changes one
3222
+ * row. `false` shows no menu. It sets `popups.contextMenu`, and a `popups.contextMenu` entry
3223
+ * wins over it. Default `true`.
3224
+ */
3225
+ readonly contextMenu?: boolean | PptxEditorContextMenuProps;
3226
+ /**
3227
+ * The packaged link popup. `false` removes it, as `popups.hyperlink: false` does: a host
3228
+ * panel that reads `useHyperlinkPopup()` then opens for the link controls. A
3229
+ * `popups.hyperlink` entry wins over it. Default `true`.
3230
+ */
3231
+ readonly hyperlinkPopup?: boolean;
3232
+ /**
3233
+ * The slide rail (`PptxEditor.SlideRail`), as DOCX Editor's `navigation`. An object is
3234
+ * `SlideRailProps`, passed straight through, so `slideRail={{ open, onOpenChange }}` drives
3235
+ * it from your own chrome. `false` removes it. Default `true`.
3236
+ */
3237
+ readonly slideRail?: boolean | SlideRailProps;
3238
+ /**
3239
+ * The speaker notes pane (`PptxEditor.NotesPane`). An object is `NotesPaneProps`, passed
3240
+ * straight through. `false` removes it. Default `true`.
3241
+ */
3242
+ readonly notesPane?: boolean | NotesPaneProps;
3243
+ /** Extra content inside the viewport, after the slide show. */
3244
+ readonly children?: ReactNode;
3245
+ }
3246
+ /** The compound namespace plus the sugar component. @public */
3247
+ declare const PptxEditor: react.ForwardRefExoticComponent<PptxEditorProps & react.RefAttributes<PptxEditorRef>> & {
3248
+ Root: react.ForwardRefExoticComponent<PptxEditorRootProps & react.RefAttributes<PptxEditorRef>>;
3249
+ Viewport: typeof PptxEditorViewport;
3250
+ Content: typeof PptxEditorContent;
3251
+ Toolbar: PptxEditorToolbarNamespace;
3252
+ ToolbarControl: typeof ToolbarControl;
3253
+ SlideRail: SlideRailNamespace;
3254
+ SlideSorter: typeof SlideSorter;
3255
+ NotesPane: typeof NotesPane;
3256
+ ZoomPill: typeof ZoomPill;
3257
+ SidePanel: typeof SidePanel;
3258
+ FontNotice: (props: FontNoticeProps) => ReactNode;
3259
+ EditNotice: (props: EditNoticeProps) => ReactNode;
3260
+ OpenFailure: (props: PptxEditorOpenFailureProps) => ReactNode;
3261
+ Loading: LoadingComponent;
3262
+ PageSetupDialog: ((props: PageSetupDialogProps) => ReactNode) & {
3263
+ Header: (props: DialogPartProps) => ReactNode;
3264
+ Title: (props: DialogPartProps) => ReactNode;
3265
+ Body: (props: DialogPartProps) => ReactNode;
3266
+ Footer: (props: DialogPartProps) => ReactNode;
3267
+ Field: (props: DialogPartProps & {
3268
+ readonly name: PageSetupDialogFieldName;
3269
+ }) => ReactNode;
3270
+ Error: (props: DialogPartProps) => ReactNode;
3271
+ Apply: (props: DialogPartProps) => ReactNode;
3272
+ Cancel: (props: DialogPartProps) => ReactNode;
3273
+ };
3274
+ BackgroundDialog: ((props: BackgroundDialogProps) => ReactNode) & {
3275
+ Header: (props: DialogPartProps) => ReactNode;
3276
+ Title: (props: DialogPartProps) => ReactNode;
3277
+ Body: (props: DialogPartProps) => ReactNode;
3278
+ Footer: (props: DialogPartProps) => ReactNode;
3279
+ Field: (props: DialogPartProps & {
3280
+ readonly name: BackgroundDialogFieldName;
3281
+ }) => ReactNode;
3282
+ Error: (props: DialogPartProps) => ReactNode;
3283
+ Reset: (props: DialogPartProps) => ReactNode;
3284
+ Apply: (props: DialogPartProps) => ReactNode;
3285
+ Cancel: (props: DialogPartProps) => ReactNode;
3286
+ };
3287
+ ImageAltTextDialog: ((props: ImageAltTextDialogProps) => ReactNode) & {
3288
+ Header: (props: DialogPartProps) => ReactNode;
3289
+ Title: (props: DialogPartProps) => ReactNode;
3290
+ Body: (props: DialogPartProps) => ReactNode;
3291
+ Footer: (props: DialogPartProps) => ReactNode;
3292
+ Field: (props: DialogPartProps & {
3293
+ readonly name: ImageAltTextDialogFieldName;
3294
+ }) => ReactNode;
3295
+ Error: (props: DialogPartProps) => ReactNode;
3296
+ Apply: (props: DialogPartProps) => ReactNode;
3297
+ Cancel: (props: DialogPartProps) => ReactNode;
3298
+ };
3299
+ ImagePropertiesDialog: ((props: ImagePropertiesDialogProps) => ReactNode) & {
3300
+ Header: (props: DialogPartProps) => ReactNode;
3301
+ Title: (props: DialogPartProps) => ReactNode;
3302
+ Body: (props: DialogPartProps) => ReactNode;
3303
+ Footer: (props: DialogPartProps) => ReactNode;
3304
+ Field: (props: DialogPartProps & {
3305
+ readonly name: ImagePropertiesDialogFieldName;
3306
+ }) => ReactNode;
3307
+ Error: (props: DialogPartProps) => ReactNode;
3308
+ Apply: (props: DialogPartProps) => ReactNode;
3309
+ Cancel: (props: DialogPartProps) => ReactNode;
3310
+ };
3311
+ ParagraphDialog: (({ open, onClose, className, style, preset, children, }: ParagraphDialogProps) => ReactNode) & {
3312
+ Header: (props: DialogPartProps) => ReactNode;
3313
+ Title: (props: DialogPartProps) => ReactNode;
3314
+ Body: (props: DialogPartProps) => ReactNode;
3315
+ Footer: (props: DialogPartProps) => ReactNode;
3316
+ Field: (props: DialogPartProps & {
3317
+ readonly name: ParagraphDialogFieldName;
3318
+ }) => ReactNode;
3319
+ Error: (props: DialogPartProps) => ReactNode;
3320
+ Apply: (props: DialogPartProps) => ReactNode;
3321
+ Cancel: (props: DialogPartProps) => ReactNode;
3322
+ };
3323
+ FontDialog: (({ open, onClose, className, style, preset, children, }: FontDialogProps) => ReactNode) & {
3324
+ Header: (props: DialogPartProps) => ReactNode;
3325
+ Title: (props: DialogPartProps) => ReactNode;
3326
+ Body: (props: DialogPartProps) => ReactNode;
3327
+ Footer: (props: DialogPartProps) => ReactNode;
3328
+ Field: (props: DialogPartProps & {
3329
+ readonly name: FontDialogFieldName;
3330
+ }) => ReactNode;
3331
+ Error: (props: DialogPartProps) => ReactNode;
3332
+ Apply: (props: DialogPartProps) => ReactNode;
3333
+ Cancel: (props: DialogPartProps) => ReactNode;
3334
+ };
3335
+ BulletsAndNumberingDialog: (({ open, onClose, className, style, preset, children, }: BulletsAndNumberingDialogProps) => ReactNode) & {
3336
+ Header: (props: DialogPartProps) => ReactNode;
3337
+ Title: (props: DialogPartProps) => ReactNode;
3338
+ Body: (props: DialogPartProps) => ReactNode;
3339
+ Footer: (props: DialogPartProps) => ReactNode;
3340
+ Field: (props: DialogPartProps & {
3341
+ readonly name: BulletsAndNumberingDialogFieldName;
3342
+ }) => ReactNode;
3343
+ Error: (props: DialogPartProps) => ReactNode;
3344
+ Apply: (props: DialogPartProps) => ReactNode;
3345
+ Cancel: (props: DialogPartProps) => ReactNode;
3346
+ };
3347
+ ColumnsDialog: (({ open, onClose, className, style, preset, children, }: ColumnsDialogProps) => ReactNode) & {
3348
+ Header: (props: DialogPartProps) => ReactNode;
3349
+ Title: (props: DialogPartProps) => ReactNode;
3350
+ Body: (props: DialogPartProps) => ReactNode;
3351
+ Footer: (props: DialogPartProps) => ReactNode;
3352
+ Field: (props: DialogPartProps & {
3353
+ readonly name: ColumnsDialogFieldName;
3354
+ }) => ReactNode;
3355
+ Error: (props: DialogPartProps) => ReactNode;
3356
+ Apply: (props: DialogPartProps) => ReactNode;
3357
+ Cancel: (props: DialogPartProps) => ReactNode;
3358
+ };
3359
+ Slideshow: typeof Slideshow;
3360
+ FindBar: (props: FindBarProps) => ReactNode;
3361
+ HyperLink: HyperLinkNamespace;
3362
+ Menu: MenuNamespace;
3363
+ ContextMenu: ContextMenuNamespace;
3364
+ Ribbon: RibbonNamespace;
3365
+ StatusBar: StatusBarNamespace;
3366
+ };
3367
+
3368
+ export { BackgroundDialog, BulletsAndNumberingDialog, ColumnsDialog, ContextMenu, EditNotice, FillControl, FindBar, FontDialog, FontNotice, GradientDialog, HyperLink, HyperlinkPopup, Icon, ImageAltTextDialog, ImagePropertiesDialog, LayoutControl, LayoutGallery, LineGlyph, LineMenuControl, Loading, LoadingSpinner, MenuEntry, MenuGroup, MenuItem, MenuRow, MenuSeparator, MenuSlotItem, MenuSubmenu, MenuTableGrid, NewSlideControl, NotesPane, OpenFailure, PageSetupDialog, ParagraphDialog, Popover, PptxEditor, PptxEditorContent, PptxEditorContext, PptxEditorContextMenu, PptxEditorMenu, PptxEditorRibbon, PptxEditorRoot, PptxEditorStatusBar, PptxEditorViewport, RailContextMenu, RibbonTab, SectionContextMenu, ShapeGalleryControl, ShapeGrid, ShapeIcon, ShapeStyleGallery, SidePanel, SlideRail, SlideRailAddSlide, SlideRailChooseLayout, SlideRailCollapse, SlideRailDelete, SlideRailDuplicate, SlideRailExpand, SlideRailMoveEarlier, SlideRailMoveLater, SlideSorter, Slideshow, SlideshowContext, StatusBarNotes, StatusBarSlideNumber, StatusBarViews, StatusBarZoom, ToolButton, Toolbar, ToolbarAction, ToolbarContext, ToolbarControl, ToolbarGroup, ToolbarSeparator, ToolbarSlot, ZoomPill, definePopup, keepFocus, rejectionMessage, requestFindBar, requestSectionRename, translatorFor, useBackgroundDialog, useBulletFormat, useBulletsAndNumberingDialog, useChromeTranslate, useColumnsDialog, useContextMenuRequest, useContextMenuTarget, useDocumentSearch, useEditorCaret, useEditorColorMode, useEditorCommand, useEditorDialog, useEditorEvent, useEditorHostDocument, useEditorSnapshot, useEditorState, useEditorValueCommand, useFontDialog, useFontFamily, useFontFormat, useFonts, useHistoryGroup, useHyperlinkPopup, useHyperlinkPopupInstance, useImageAltTextDialog, useImagePropertiesDialog, useNotesPane, useOpenFailure, usePageSetupDialog, useParagraphDialog, useParagraphFormat, usePptxEditor, usePptxSource, useScopeClassName, useSlideLayouts, useSlideshow, useToolbarContext, useToolbarLabel, useToolbarLabelFor, useTranslation, useZoom };
3369
+ export type { BackgroundDialogFieldName, BackgroundDialogFields, BackgroundDialogProps, BulletsAndNumberingDialogFieldName, BulletsAndNumberingDialogProps, ColumnsDialogFieldName, ColumnsDialogProps, ContextMenuNamedRows, ContextMenuNamespace, ContextMenuPoint, ContextMenuProps, ContextMenuRequest, DefinePopupOptions, DialogCustomizationProps, DialogPartProps, EditNoticeProps, FillControlProps, FindBarProps, FindPopupProps, FontDialogFieldName, FontDialogProps, FontFamilyItemProps, FontFamilyNamespace, FontFamilyPartProps, FontFamilyProps, FontNoticeProps, FontsInput, GradientDialogProps, HyperLinkActionProps, HyperLinkNamespace, HyperLinkPartProps, HyperLinkProps, HyperlinkPopupProps, IconProps, ImageAltTextDialogFieldName, ImageAltTextDialogFields, ImageAltTextDialogProps, ImagePropertiesDialogFieldName, ImagePropertiesDialogFields, ImagePropertiesDialogProps, LayoutControlProps, LayoutGalleryProps, LineGlyphProps, LineMenuControlProps, LoadingComponent, LoadingProps, LoadingSpinnerProps, MenuEntryProps, MenuGroupProps, MenuItemProps, MenuNamedRows, MenuNamespace, MenuPartComponent, MenuProps, MenuRowPartComponent, MenuRowPartProps, MenuRowProps, MenuSlotItemProps, MenuSubmenuProps, MenuTableGridProps, NewSlideControlProps, NotesPaneProps, OpenFailureContext, PageSetupDialogFieldName, PageSetupDialogFields, PageSetupDialogProps, PaneProps, ParagraphDialogFieldName, ParagraphDialogProps, PopoverProps, PptxEditorContentProps, PptxEditorContextMenuProps, PptxEditorDialogKey, PptxEditorOpenFailureProps, PptxEditorPopup, PptxEditorPopups, PptxEditorProps, PptxEditorRef, PptxEditorRootProps, PptxEditorToolbarNamespace, PptxEditorViewportProps, RailContextMenuProps, RailMenuState, RibbonNamespace, RibbonProps, RibbonTabProps, SectionContextMenuProps, SectionMenuState, ShapeGalleryControlProps, ShapeGridProps, ShapeIconProps, ShapeStyleGalleryProps, SidePanelProps, SlideRailNamespace, SlideRailPartProps, SlideRailProps, SlideSorterProps, StatusBarNamespace, StatusBarNotesProps, StatusBarPartProps, StatusBarProps, ToolButtonProps, ToolbarActionProps, ToolbarColorSplitComponent, ToolbarColorSplitProps, ToolbarContextValue, ToolbarControlProps, ToolbarGroupProps, ToolbarNamedParts, ToolbarPartComponent, ToolbarPartProps, ToolbarProps, ToolbarSeparatorProps, ToolbarSlotBaseProps, ToolbarSlotPartComponent, ToolbarSlotPartProps, ToolbarSlotProps, UseBackgroundDialogReturn, UseBulletFormatReturn, UseBulletsAndNumberingDialogReturn, UseColumnsDialogReturn, UseDialogReturn, UseDocumentSearchResult, UseEditorColorModeReturn, UseEditorCommandReturn, UseEditorDialogReturn, UseEditorHostDocumentReturn, UseEditorValueCommandReturn, UseFontDialogReturn, UseFontFamilyReturn, UseFontFormatReturn, UseFontsReturn, UseHistoryGroupReturn, UseHyperlinkPopupResult, UseImageAltTextDialogReturn, UseImagePropertiesDialogReturn, UseNotesPaneReturn, UseOpenFailureOptions, UseOpenFailureReturn, UsePageSetupDialogReturn, UseParagraphDialogReturn, UseParagraphFormatReturn, UsePptxSourceResult, UseSlideshowReturn, UseZoomResult, ZoomPillProps };