@docx-editor.dev/react 2.4.1 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +690 -351
- package/dist/index.d.ts +690 -351
- package/dist/index.js +5 -5
- package/dist/index.mjs +5 -5
- package/package.json +7 -7
- package/src/styles/editor.css +6 -0
- package/src/styles/zIndex.ts +28 -0
package/dist/index.d.mts
CHANGED
|
@@ -1,17 +1,35 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import react__default, {
|
|
2
|
+
import react__default, { ReactNode, CSSProperties, ReactElement, ForwardRefExoticComponent, RefAttributes, HTMLAttributes, Ref } from 'react';
|
|
3
|
+
import { RevisionAuthorStyle, DocxEditorInstance, FontConfigurationFragment, FontResolver, EditorModule, ImageDecodePort, ChromeSlotId, SupportedImageMime, TableChromeSlotId, ChromeMenuId, ChromeMenuEntry, SurfaceHyperlink, ReviewAuthorInfo, ImageWrapTarget, TextMeasurer, PaginatedSurfaceState, NavigationCommand, SurfaceFormatting, SectionProperties, RulerIndent } from '@docx-editor.dev/core/editor';
|
|
4
|
+
export { CHROME_GROUPS, CHROME_MENUS, ChromeMenu, ChromeMenuEntry, ChromeMenuId, ChromeMenuItemEntry, ChromeMenuSeparatorEntry, ChromeMenuSubmenuEntry, ChromeSlotId, FontConfigurationBase, FontConfigurationFragment, FontLoadFailure, FontLoadFailureReason, FontResolutionRequest, FontResolver, FontUrlSource, ImageWrapTarget, LOADING_SNAPSHOT, LoadFontsRequest, LoadFontsResult, MAX_RESOLVER_FAMILIES, PX_PER_CM, PX_PER_INCH, ReviewAuthorInfo, RevisionAuthorAssignments, RevisionAuthorStyle, RevisionStyles, RulerTick, RulerUnit, ToolbarCommandState, WORD_DEFAULT_FONT, chromeMenuSlots, commandForSlot, composeFontConfiguration, createFontSource, generateRulerTicks, loadFonts, rulerPageBox, runToolbarCommand, toolbarCommandState } from '@docx-editor.dev/core/editor';
|
|
3
5
|
import { DocumentSource, FontConfiguration, ZoomMode, Editor, DocumentChange, EditorFontError, TextMatch, ViewScope, DocumentHandle, EditorCommand, EditorScope, ExecResult, EditorSnapshot, EditorEvents, PageSetup, IndentFormatting, ColorValue, Theme } from '@docx-editor.dev/core/contracts/editor';
|
|
4
6
|
export { Editor, EditorCommand, EditorFontError, EditorFontErrorCode, EditorQuery, EditorScope, EditorSnapshot, FontConfiguration, FontFaceRequest, FontSource, FontSourceSubstitution, PageSetup } from '@docx-editor.dev/core/contracts/editor';
|
|
5
|
-
import {
|
|
6
|
-
export {
|
|
7
|
-
import { TFunction, Translations } from '@docx-editor.dev/i18n';
|
|
7
|
+
import { TFunction, Translations, LocaleStrings } from '@docx-editor.dev/i18n';
|
|
8
|
+
export { TranslationKey } from '@docx-editor.dev/i18n';
|
|
8
9
|
import { ContentControlType, ContentControlSummary } from '@docx-editor.dev/core';
|
|
9
10
|
export { DocxDocument } from '@docx-editor.dev/core/contracts/types';
|
|
10
11
|
|
|
12
|
+
/** @public */
|
|
13
|
+
declare const VERSION: string;
|
|
14
|
+
|
|
15
|
+
/** React composables take plain values; parity name matches the Vue surface. @public */
|
|
16
|
+
type MaybeRefOrGetter<T> = T;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Slot and icon content in public component props.
|
|
20
|
+
*
|
|
21
|
+
* React hosts pass {@link ReactNode}. Vue hosts pass {@link https://vuejs.org/api/utility-types.html#vnode | VNode}
|
|
22
|
+
* through the paired {@link DocxEditorChildren} alias in `@docx-editor.dev/vue`.
|
|
23
|
+
*
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
type DocxEditorChildren = ReactNode;
|
|
27
|
+
|
|
11
28
|
/** Props for `DocxEditor.Content`. @public */
|
|
12
29
|
interface DocxEditorContentProps {
|
|
13
30
|
/** Appended after the load-bearing `docx-paginated-surface` class. */
|
|
14
31
|
className?: string;
|
|
32
|
+
children?: DocxEditorChildren;
|
|
15
33
|
}
|
|
16
34
|
/**
|
|
17
35
|
* The element the engine paints pages into. Must render inside a
|
|
@@ -38,6 +56,16 @@ interface DocxEditorLoadingProps {
|
|
|
38
56
|
* provider only after those resolve.
|
|
39
57
|
*/
|
|
40
58
|
when?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Render as an opaque overlay pinned over the nearest positioned ancestor, covering
|
|
61
|
+
* the previous document while the next one opens. This is the shape for the big-file
|
|
62
|
+
* case: a large document mounts behind one painted frame, and the overlay is what
|
|
63
|
+
* that frame shows. It carries a short appearance delay, so an open that finishes
|
|
64
|
+
* quickly never flashes it. Compose it INSIDE a positioned box (the packaged frame
|
|
65
|
+
* puts it in the workspace row); without `overlay` the part is an in-flow box that
|
|
66
|
+
* fills whatever the host gives it.
|
|
67
|
+
*/
|
|
68
|
+
overlay?: boolean;
|
|
41
69
|
/** Appended after the load-bearing `docx-editor docx-editor__loading` classes. */
|
|
42
70
|
className?: string;
|
|
43
71
|
/** Inline styles for the loading container, as on `DocxEditor.Viewport`. */
|
|
@@ -47,7 +75,7 @@ interface DocxEditorLoadingProps {
|
|
|
47
75
|
* used, so the batteries-included path has something to show. Compose your own around
|
|
48
76
|
* `DocxEditor.Loading.Spinner` to keep the packaged indicator beside your own copy.
|
|
49
77
|
*/
|
|
50
|
-
children?:
|
|
78
|
+
children?: DocxEditorChildren;
|
|
51
79
|
}
|
|
52
80
|
/** Props for `DocxEditor.Loading.Spinner`. @public */
|
|
53
81
|
interface DocxEditorLoadingSpinnerProps {
|
|
@@ -91,11 +119,17 @@ interface DocxEditorLoadingComponent {
|
|
|
91
119
|
* </DocxEditor.Root>
|
|
92
120
|
* ```
|
|
93
121
|
*
|
|
94
|
-
* It
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
122
|
+
* It covers TWO windows. Before bytes arrive it is the empty-state screen. And while a
|
|
123
|
+
* LARGE document opens — the engine mounts it behind one painted frame precisely so this
|
|
124
|
+
* screen can paint before the blocking parse and layout — it holds until the pages land;
|
|
125
|
+
* pass `overlay` to pin it over the previous document for that window. A parse failure
|
|
126
|
+
* clears both, so a broken document never spins forever; report that from
|
|
127
|
+
* `snapshot().parseError` or the `error` event. Add `when` only for async the editor
|
|
128
|
+
* cannot observe, typically a host that mounts the provider after its own fetch.
|
|
129
|
+
*
|
|
130
|
+
* A host gating its own `DocxEditor.Content` must key that on `snapshot().isLoading`,
|
|
131
|
+
* which clears as soon as bytes are handed over — never on `isOpening`, whose scheduled
|
|
132
|
+
* mount needs the mount point to stay in the tree.
|
|
99
133
|
*
|
|
100
134
|
* Rendered OUTSIDE a `DocxEditor.Root` it always shows, because there is no editor to
|
|
101
135
|
* report otherwise — the same rule `useEditorState` documents for a null editor. Place
|
|
@@ -107,6 +141,91 @@ interface DocxEditorLoadingComponent {
|
|
|
107
141
|
*/
|
|
108
142
|
declare const DocxEditorLoading: DocxEditorLoadingComponent;
|
|
109
143
|
|
|
144
|
+
/**
|
|
145
|
+
* Colour tracked changes by the TYPE of change instead of by author, while mounted.
|
|
146
|
+
*
|
|
147
|
+
* The editor colours by author out of the box — Word's own default, so a paragraph three
|
|
148
|
+
* people edited reads as three people. Mount this to opt out: insertions take
|
|
149
|
+
* `--doc-revision-insertion` and deletions `--doc-revision-deletion`, whoever proposed
|
|
150
|
+
* them. Renders nothing; unmounting it returns to by-author colouring.
|
|
151
|
+
*
|
|
152
|
+
* Composed with `DocxEditor.AuthorStyle`, it also expresses "highlight these reviewers and
|
|
153
|
+
* leave everyone else green and red": the authors you declare keep their own colour, and
|
|
154
|
+
* this puts the rest on the kind colours.
|
|
155
|
+
*
|
|
156
|
+
* ```tsx
|
|
157
|
+
* <DocxEditor.Root document={bytes} modules={MODULES}>
|
|
158
|
+
* <DocxEditor.ColorByChangeType />
|
|
159
|
+
* …
|
|
160
|
+
* </DocxEditor.Root>
|
|
161
|
+
* ```
|
|
162
|
+
*
|
|
163
|
+
* @public
|
|
164
|
+
*/
|
|
165
|
+
declare function DocxEditorColorByChangeType(): null;
|
|
166
|
+
/**
|
|
167
|
+
* Props for `DocxEditor.AuthorStyle`: one author, and the {@link RevisionAuthorStyle}
|
|
168
|
+
* fields to apply — `color` (document ink and the review chrome's accent), `background`
|
|
169
|
+
* (the wash), `spanClassName` (classes on the painted spans), and `avatarUrl`.
|
|
170
|
+
*
|
|
171
|
+
* @public
|
|
172
|
+
*/
|
|
173
|
+
interface DocxEditorAuthorStyleProps extends RevisionAuthorStyle {
|
|
174
|
+
/** The author to style. Matches `w:author` exactly. */
|
|
175
|
+
author: string;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Declare one author's presentation, while mounted.
|
|
179
|
+
*
|
|
180
|
+
* Renders nothing. The editor already colours every author from the
|
|
181
|
+
* `--doc-review-author-N` ramp; this overrides one of them, and leaves the rest where they
|
|
182
|
+
* are. Prop changes re-apply live — pages repaint without a remount, so the caret and undo
|
|
183
|
+
* history stay — and unmounting returns that author to the ramp.
|
|
184
|
+
*
|
|
185
|
+
* Read who is in the document with `useReviewAuthors`, and read these declarations back
|
|
186
|
+
* inside a custom review card with `useReviewAuthor`.
|
|
187
|
+
*
|
|
188
|
+
* ```tsx
|
|
189
|
+
* <DocxEditor.Root document={bytes} modules={MODULES}>
|
|
190
|
+
* <DocxEditor.AuthorStyle author="Jess Lin" color="#7c3aed" avatarUrl="/jess.png" />
|
|
191
|
+
* …
|
|
192
|
+
* </DocxEditor.Root>
|
|
193
|
+
* ```
|
|
194
|
+
*
|
|
195
|
+
* @public
|
|
196
|
+
*/
|
|
197
|
+
declare function DocxEditorAuthorStyle(props: DocxEditorAuthorStyleProps): null;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* The editor instance from the nearest `DocxEditor.Root`, or `null` before the Root's
|
|
201
|
+
* mount effect has created it (and outside any Root). Deliberately not a throwing
|
|
202
|
+
* variant: pre-mount is a normal frame every consumer renders through, and the state
|
|
203
|
+
* hooks built on this already answer it with a typed loading snapshot.
|
|
204
|
+
*
|
|
205
|
+
* @public
|
|
206
|
+
*/
|
|
207
|
+
declare function useDocxEditor(): DocxEditorInstance | null;
|
|
208
|
+
/**
|
|
209
|
+
* Whether a review rail is mounted under this Root, and how much room it wants.
|
|
210
|
+
*
|
|
211
|
+
* The GUTTER is the reason this exists. `DocxEditor.Viewport` reserves space beside the
|
|
212
|
+
* page for the pane, and the ruler shifts by the same amount — but neither of them can see
|
|
213
|
+
* whether a rail was actually composed in. Keyed on the pane's open state alone, every
|
|
214
|
+
* consumer of the tier-2 `<DocxEditor>` sugar (which mounts no rail) had its page pushed
|
|
215
|
+
* 158px off centre beside an empty column.
|
|
216
|
+
*
|
|
217
|
+
* A rail registers on mount and unregisters on unmount, so the reservation follows what is
|
|
218
|
+
* really on screen. Count rather than boolean: StrictMode mounts twice, and a host may
|
|
219
|
+
* legitimately compose two rails.
|
|
220
|
+
*/
|
|
221
|
+
interface ReviewRailRegistry {
|
|
222
|
+
readonly mounted: number;
|
|
223
|
+
readonly register: () => () => void;
|
|
224
|
+
readonly registerCommentDraft: (handler: () => void) => () => void;
|
|
225
|
+
readonly requestCommentDraft: () => boolean;
|
|
226
|
+
}
|
|
227
|
+
declare const ReviewRailContext: react.Context<ReviewRailRegistry | null>;
|
|
228
|
+
|
|
110
229
|
/**
|
|
111
230
|
* Props for `DocxEditor.Root`. Creation parameters (`document`, `fonts`, `author`,
|
|
112
231
|
* `locale`, and the initial `mode`/`zoom`) are sampled when the instance is created;
|
|
@@ -116,7 +235,9 @@ declare const DocxEditorLoading: DocxEditorLoadingComponent;
|
|
|
116
235
|
* @public
|
|
117
236
|
*/
|
|
118
237
|
interface DocxEditorRootProps {
|
|
119
|
-
/** A document to load: DOCX bytes or an existing handle.
|
|
238
|
+
/** A document to load: DOCX bytes, `'blank'` for an empty one, or an existing handle.
|
|
239
|
+
* Identity change remounts; `'blank'` is a constant, so holding it across renders does
|
|
240
|
+
* not. Omitting this mounts NO document, which is not the same as an empty one. */
|
|
120
241
|
document?: DocumentSource;
|
|
121
242
|
/**
|
|
122
243
|
* Font bytes for Word-accurate (HarfBuzz-shaped) wrap and pagination. Omitted, layout
|
|
@@ -137,8 +258,16 @@ interface DocxEditorRootProps {
|
|
|
137
258
|
* construction-time in the engine.
|
|
138
259
|
*/
|
|
139
260
|
modules?: readonly EditorModule[];
|
|
140
|
-
/**
|
|
141
|
-
|
|
261
|
+
/**
|
|
262
|
+
* The mode the editor opens in, matching the toolbar's three-state pill. Sampled at
|
|
263
|
+
* mount only.
|
|
264
|
+
*
|
|
265
|
+
* `'edit'` opens in editing even when the document's `w:trackRevisions` asks for
|
|
266
|
+
* tracked changes; `'suggesting'` opens in suggesting (needs a review module and an
|
|
267
|
+
* `author`); `'view'` is read-only and the toolbar cannot leave it. Omitted, the
|
|
268
|
+
* DOCUMENT decides: a package carrying `w:trackRevisions` opens in suggesting.
|
|
269
|
+
*/
|
|
270
|
+
mode?: 'edit' | 'view' | 'suggesting';
|
|
142
271
|
/**
|
|
143
272
|
* A fixed scale. Supplying one also means the mode is fixed, unless `zoomMode` says
|
|
144
273
|
* otherwise: an app that pinned 100% keeps 100% on every window size.
|
|
@@ -154,7 +283,9 @@ interface DocxEditorRootProps {
|
|
|
154
283
|
*/
|
|
155
284
|
zoomMode?: ZoomMode | 'auto';
|
|
156
285
|
/** Fired once per instance, after it is published to the tree (and after any
|
|
157
|
-
* `DocxEditor.Content` in the same commit has attached its mount point).
|
|
286
|
+
* `DocxEditor.Content` in the same commit has attached its mount point). A large
|
|
287
|
+
* document mounts behind one painted frame; `onReady` fires AFTER that mount lands,
|
|
288
|
+
* so scrolling or selecting from it works on any document size. */
|
|
158
289
|
onReady?: (editor: Editor) => void;
|
|
159
290
|
/** Fired when the document changes (revision + identity deltas, not bytes). */
|
|
160
291
|
onChange?: (change: DocumentChange) => void;
|
|
@@ -167,8 +298,29 @@ interface DocxEditorRootProps {
|
|
|
167
298
|
tableInteractionLabel?: (key: 'table.insertRowBelow' | 'table.insertColumnRight') => string;
|
|
168
299
|
/** Optional decode port for embedded image insertion and paint in tests or custom hosts. */
|
|
169
300
|
imageDecodePort?: ImageDecodePort;
|
|
170
|
-
children?:
|
|
301
|
+
children?: DocxEditorChildren;
|
|
302
|
+
}
|
|
303
|
+
/** @public Vue-only lifecycle listeners; exported for cross-adapter API parity. */
|
|
304
|
+
interface DocxEditorRootListeners {
|
|
305
|
+
onReady?: (editor: Editor) => void;
|
|
306
|
+
onChange?: (change: DocumentChange) => void;
|
|
307
|
+
onFontError?: (error: EditorFontError) => void;
|
|
308
|
+
}
|
|
309
|
+
/** @public Vue-only setup result; exported for cross-adapter API parity. */
|
|
310
|
+
interface ProvideDocxEditorResult {
|
|
311
|
+
readonly DocxEditorRoot: typeof DocxEditorRoot;
|
|
312
|
+
readonly rootProps: Omit<DocxEditorRootProps, keyof DocxEditorRootListeners>;
|
|
313
|
+
readonly rootListeners: DocxEditorRootListeners;
|
|
314
|
+
readonly editorRef: ReturnType<typeof useDocxEditor>;
|
|
171
315
|
}
|
|
316
|
+
/**
|
|
317
|
+
* Prepares Root props and listeners while exposing the instance created by that Root.
|
|
318
|
+
* Call this function during render, like a React hook.
|
|
319
|
+
*
|
|
320
|
+
* @public
|
|
321
|
+
*/
|
|
322
|
+
declare function useProvidedDocxEditor(options: DocxEditorRootProps): ProvideDocxEditorResult;
|
|
323
|
+
|
|
172
324
|
/**
|
|
173
325
|
* Creates and owns a `DocxEditorInstance` and provides it to the subtree. Renders no
|
|
174
326
|
* DOM — compose it with `DocxEditor.Viewport` + `DocxEditor.Content` for the painted
|
|
@@ -183,7 +335,7 @@ interface DocxEditorViewportProps {
|
|
|
183
335
|
/** Appended after the load-bearing viewport classes (e.g. `dark` for chrome theming). */
|
|
184
336
|
className?: string;
|
|
185
337
|
style?: CSSProperties;
|
|
186
|
-
children?:
|
|
338
|
+
children?: DocxEditorChildren;
|
|
187
339
|
}
|
|
188
340
|
/**
|
|
189
341
|
* The sole scroll container for the painted document. Put `DocxEditor.Content` inside
|
|
@@ -195,17 +347,33 @@ declare function DocxEditorViewport({ className, style, children }: DocxEditorVi
|
|
|
195
347
|
|
|
196
348
|
/** Resolves an i18n key to display text. @public */
|
|
197
349
|
type ToolbarTranslate = (key: string) => string;
|
|
350
|
+
interface ToolbarContextValue {
|
|
351
|
+
readonly t: ToolbarTranslate | undefined;
|
|
352
|
+
/** Host save handler for the `file.save` part; absent renders the part disabled. */
|
|
353
|
+
readonly onSave: (() => void) | undefined;
|
|
354
|
+
}
|
|
355
|
+
declare const ToolbarContext: react.Context<ToolbarContextValue>;
|
|
356
|
+
/** The toolbar root's published value. Internal: parts read it, hosts pass props. */
|
|
357
|
+
declare function useToolbarContext(): ToolbarContextValue;
|
|
358
|
+
/**
|
|
359
|
+
* The label for an i18n key given a host resolver: the host's translation, else the
|
|
360
|
+
* locale catalogue. The toolbar ROOT needs this before it publishes its context, so the
|
|
361
|
+
* resolver is separate from the context read below — a raw key must never reach the DOM.
|
|
362
|
+
*/
|
|
363
|
+
declare function useToolbarLabelFor(t: ToolbarTranslate | undefined): (key: string) => string;
|
|
364
|
+
/** The label for an i18n key: the host's translation, else the locale catalogue. */
|
|
365
|
+
declare function useToolbarLabel(): (key: string) => string;
|
|
198
366
|
|
|
199
367
|
/** Props for `DocxEditorToolbar.Button`. @public */
|
|
200
368
|
interface ToolbarButtonProps$1 {
|
|
201
369
|
/** The chrome slot this button drives (`'text.bold'`, `'history.undo'`, ...). */
|
|
202
370
|
slot: ChromeSlotId;
|
|
203
371
|
/** Icon override; falls back to `children`, then to the registry's icon paths. */
|
|
204
|
-
icon?:
|
|
372
|
+
icon?: DocxEditorChildren;
|
|
205
373
|
/** Merge the button's behavior into the single child element instead of a <button>. */
|
|
206
374
|
asChild?: boolean;
|
|
207
375
|
className?: string;
|
|
208
|
-
children?:
|
|
376
|
+
children?: DocxEditorChildren;
|
|
209
377
|
/** Render nothing — inside the default arrangement this removes the slot. */
|
|
210
378
|
hidden?: boolean;
|
|
211
379
|
}
|
|
@@ -230,7 +398,7 @@ interface ImageInsertTriggerProps {
|
|
|
230
398
|
className?: string;
|
|
231
399
|
hidden?: boolean;
|
|
232
400
|
asChild?: boolean;
|
|
233
|
-
children?:
|
|
401
|
+
children?: DocxEditorChildren;
|
|
234
402
|
}
|
|
235
403
|
/** Toolbar insert-image control — opens the shared file picker. @public */
|
|
236
404
|
declare function ImageInsertTrigger({ className, hidden, asChild, children, }: ImageInsertTriggerProps): react.JSX.Element | null;
|
|
@@ -243,7 +411,7 @@ interface ImageWrapProps {
|
|
|
243
411
|
className?: string;
|
|
244
412
|
hidden?: boolean;
|
|
245
413
|
asChild?: boolean;
|
|
246
|
-
children?:
|
|
414
|
+
children?: DocxEditorChildren;
|
|
247
415
|
}
|
|
248
416
|
/**
|
|
249
417
|
* Wrap-text dropdown presenting all nine Word choices.
|
|
@@ -265,7 +433,7 @@ interface ImageAltTextProps {
|
|
|
265
433
|
className?: string;
|
|
266
434
|
hidden?: boolean;
|
|
267
435
|
asChild?: boolean;
|
|
268
|
-
children?:
|
|
436
|
+
children?: DocxEditorChildren;
|
|
269
437
|
}
|
|
270
438
|
/**
|
|
271
439
|
* Opens a small panel to edit image description (and optional title).
|
|
@@ -282,12 +450,17 @@ interface ImageAltTextPartComponent {
|
|
|
282
450
|
readonly docxSlot: 'image.altText';
|
|
283
451
|
}
|
|
284
452
|
|
|
453
|
+
/** @public */
|
|
454
|
+
interface RefObject<T> {
|
|
455
|
+
readonly current: T | null;
|
|
456
|
+
}
|
|
457
|
+
|
|
285
458
|
/** Props for `DocxEditor.ImagePropertiesDialog`. @public */
|
|
286
459
|
interface DocxEditorImagePropertiesDialogProps {
|
|
287
460
|
open: boolean;
|
|
288
461
|
onClose: () => void;
|
|
289
462
|
className?: string;
|
|
290
|
-
triggerRef?:
|
|
463
|
+
triggerRef?: RefObject<HTMLElement | null>;
|
|
291
464
|
}
|
|
292
465
|
/**
|
|
293
466
|
* Properties dialog for the selected picture.
|
|
@@ -300,7 +473,7 @@ interface ImagePropertiesTriggerProps {
|
|
|
300
473
|
className?: string;
|
|
301
474
|
hidden?: boolean;
|
|
302
475
|
asChild?: boolean;
|
|
303
|
-
children?:
|
|
476
|
+
children?: DocxEditorChildren;
|
|
304
477
|
}
|
|
305
478
|
/**
|
|
306
479
|
* Opens the image properties dialog for the selected drawing.
|
|
@@ -311,6 +484,9 @@ declare function ImagePropertiesTrigger({ className, hidden, asChild, children,
|
|
|
311
484
|
declare namespace ImagePropertiesTrigger {
|
|
312
485
|
var docxSlot: "image.properties";
|
|
313
486
|
}
|
|
487
|
+
declare const ToolbarImageProperties: typeof ImagePropertiesTrigger & {
|
|
488
|
+
docxSlot: "image.properties";
|
|
489
|
+
};
|
|
314
490
|
|
|
315
491
|
type NormalizedImagePayload = {
|
|
316
492
|
readonly ok: true;
|
|
@@ -367,7 +543,7 @@ interface ToolbarColorSplitProps extends ToolbarSlotPartProps {
|
|
|
367
543
|
* The BAR is not replaceable and still paints the live value, so a host swapping the glyph
|
|
368
544
|
* keeps the thing that makes this control readable at a glance.
|
|
369
545
|
*/
|
|
370
|
-
icon?:
|
|
546
|
+
icon?: DocxEditorChildren;
|
|
371
547
|
}
|
|
372
548
|
/** A split colour control pinned to one slot. @public */
|
|
373
549
|
interface ToolbarColorSplitComponent {
|
|
@@ -391,7 +567,7 @@ interface ToolbarActionProps {
|
|
|
391
567
|
*/
|
|
392
568
|
label: string;
|
|
393
569
|
/** Icon content. Inline SVG sized ~18px matches the packaged controls. */
|
|
394
|
-
icon?:
|
|
570
|
+
icon?: DocxEditorChildren;
|
|
395
571
|
/** Pressed state, for an action that toggles. Sets `aria-pressed` and `data-active`. */
|
|
396
572
|
active?: boolean;
|
|
397
573
|
disabled?: boolean;
|
|
@@ -401,7 +577,7 @@ interface ToolbarActionProps {
|
|
|
401
577
|
/** Merge the behavior onto the single child element instead of rendering a `<button>`. */
|
|
402
578
|
asChild?: boolean;
|
|
403
579
|
className?: string;
|
|
404
|
-
children?:
|
|
580
|
+
children?: DocxEditorChildren;
|
|
405
581
|
}
|
|
406
582
|
/**
|
|
407
583
|
* A host-owned toolbar action, styled and behaved like the packaged controls.
|
|
@@ -437,7 +613,7 @@ declare function useFontFamily(): UseFontFamilyResult;
|
|
|
437
613
|
interface FontFamilyPartProps {
|
|
438
614
|
asChild?: boolean;
|
|
439
615
|
className?: string;
|
|
440
|
-
children?:
|
|
616
|
+
children?: DocxEditorChildren;
|
|
441
617
|
}
|
|
442
618
|
/** Props for the compound root. @public */
|
|
443
619
|
interface FontFamilyProps extends FontFamilyPartProps {
|
|
@@ -507,7 +683,7 @@ declare function useParagraphStyle(): UseParagraphStyleResult;
|
|
|
507
683
|
interface ParagraphStylePartProps {
|
|
508
684
|
asChild?: boolean;
|
|
509
685
|
className?: string;
|
|
510
|
-
children?:
|
|
686
|
+
children?: DocxEditorChildren;
|
|
511
687
|
}
|
|
512
688
|
/** Props for the compound root. @public */
|
|
513
689
|
interface ParagraphStyleProps extends ParagraphStylePartProps {
|
|
@@ -544,7 +720,7 @@ interface TableChromePartProps {
|
|
|
544
720
|
/** Merge props onto the single child element instead of rendering a default host node. */
|
|
545
721
|
asChild?: boolean;
|
|
546
722
|
/** Custom panel body or trigger label; defaults to the packaged control chrome. */
|
|
547
|
-
children?:
|
|
723
|
+
children?: DocxEditorChildren;
|
|
548
724
|
}
|
|
549
725
|
/** Props for a value-driven row or swatch inside a table compound menu. @public */
|
|
550
726
|
interface TableChromeItemProps extends TableChromePartProps {
|
|
@@ -561,11 +737,11 @@ interface TableChromePartComponent extends ToolbarSlotPartComponent {
|
|
|
561
737
|
/** The chrome slot this compound drives. */
|
|
562
738
|
readonly docxSlot: TableChromeSlotId;
|
|
563
739
|
/** Opens the picker menu or dialog. */
|
|
564
|
-
readonly Trigger: (props: TableChromePartProps) =>
|
|
740
|
+
readonly Trigger: (props: TableChromePartProps) => DocxEditorChildren;
|
|
565
741
|
/** The open menu or dialog panel; omit to use the default item list. */
|
|
566
|
-
readonly Content: (props: TableChromePartProps) =>
|
|
742
|
+
readonly Content: (props: TableChromePartProps) => DocxEditorChildren;
|
|
567
743
|
/** One selectable value row or swatch inside {@link Content}. */
|
|
568
|
-
readonly Item: (props: TableChromeItemProps) =>
|
|
744
|
+
readonly Item: (props: TableChromeItemProps) => DocxEditorChildren;
|
|
569
745
|
}
|
|
570
746
|
/**
|
|
571
747
|
* Border-target picker compound (`DocxEditor.Toolbar.TableBorderTarget`).
|
|
@@ -576,11 +752,11 @@ interface TableBorderTargetNamespace extends TableChromePartComponent {
|
|
|
576
752
|
/** Chrome slot id: `table.borderTarget`. */
|
|
577
753
|
readonly docxSlot: 'table.borderTarget';
|
|
578
754
|
/** Button that opens the border-edge target menu. */
|
|
579
|
-
readonly Trigger: (props: TableChromePartProps) =>
|
|
755
|
+
readonly Trigger: (props: TableChromePartProps) => DocxEditorChildren;
|
|
580
756
|
/** Open menu listing edge scopes and clear. */
|
|
581
|
-
readonly Content: (props: TableChromePartProps) =>
|
|
757
|
+
readonly Content: (props: TableChromePartProps) => DocxEditorChildren;
|
|
582
758
|
/** One edge scope or clear row inside the target menu. */
|
|
583
|
-
readonly Item: (props: TableChromeItemProps) =>
|
|
759
|
+
readonly Item: (props: TableChromeItemProps) => DocxEditorChildren;
|
|
584
760
|
}
|
|
585
761
|
/**
|
|
586
762
|
* Border-colour split compound with a quick-apply main button and swatch dialog
|
|
@@ -592,13 +768,13 @@ interface TableBorderColorNamespace extends TableChromePartComponent {
|
|
|
592
768
|
/** Chrome slot id: `table.borderColor`. */
|
|
593
769
|
readonly docxSlot: 'table.borderColor';
|
|
594
770
|
/** Applies the last swatch without opening the dialog. */
|
|
595
|
-
readonly Main: (props: TableChromePartProps) =>
|
|
771
|
+
readonly Main: (props: TableChromePartProps) => DocxEditorChildren;
|
|
596
772
|
/** Button that opens the border-colour swatch dialog. */
|
|
597
|
-
readonly Trigger: (props: TableChromePartProps) =>
|
|
773
|
+
readonly Trigger: (props: TableChromePartProps) => DocxEditorChildren;
|
|
598
774
|
/** Open swatch dialog for the active border target. */
|
|
599
|
-
readonly Content: (props: TableChromePartProps) =>
|
|
775
|
+
readonly Content: (props: TableChromePartProps) => DocxEditorChildren;
|
|
600
776
|
/** One colour swatch inside the border-colour dialog. */
|
|
601
|
-
readonly Item: (props: TableChromeItemProps) =>
|
|
777
|
+
readonly Item: (props: TableChromeItemProps) => DocxEditorChildren;
|
|
602
778
|
}
|
|
603
779
|
/**
|
|
604
780
|
* Cell-fill split compound (`DocxEditor.Toolbar.TableCellFill`).
|
|
@@ -609,13 +785,13 @@ interface TableCellFillNamespace extends TableChromePartComponent {
|
|
|
609
785
|
/** Chrome slot id: `table.cellFill`. */
|
|
610
786
|
readonly docxSlot: 'table.cellFill';
|
|
611
787
|
/** Applies the last swatch without opening the dialog. */
|
|
612
|
-
readonly Main: (props: TableChromePartProps) =>
|
|
788
|
+
readonly Main: (props: TableChromePartProps) => DocxEditorChildren;
|
|
613
789
|
/** Button that opens the cell-fill swatch dialog. */
|
|
614
|
-
readonly Trigger: (props: TableChromePartProps) =>
|
|
790
|
+
readonly Trigger: (props: TableChromePartProps) => DocxEditorChildren;
|
|
615
791
|
/** Open swatch dialog for the selected cell(s). */
|
|
616
|
-
readonly Content: (props: TableChromePartProps) =>
|
|
792
|
+
readonly Content: (props: TableChromePartProps) => DocxEditorChildren;
|
|
617
793
|
/** One fill swatch inside the cell-fill dialog. */
|
|
618
|
-
readonly Item: (props: TableChromeItemProps) =>
|
|
794
|
+
readonly Item: (props: TableChromeItemProps) => DocxEditorChildren;
|
|
619
795
|
}
|
|
620
796
|
/**
|
|
621
797
|
* Border-style menu compound (`DocxEditor.Toolbar.TableBorderStyle`).
|
|
@@ -626,11 +802,11 @@ interface TableBorderStyleNamespace extends TableChromePartComponent {
|
|
|
626
802
|
/** Chrome slot id: `table.borderStyle`. */
|
|
627
803
|
readonly docxSlot: 'table.borderStyle';
|
|
628
804
|
/** Button that opens the border line-style menu. */
|
|
629
|
-
readonly Trigger: (props: TableChromePartProps) =>
|
|
805
|
+
readonly Trigger: (props: TableChromePartProps) => DocxEditorChildren;
|
|
630
806
|
/** Open menu listing line styles for the active target. */
|
|
631
|
-
readonly Content: (props: TableChromePartProps) =>
|
|
807
|
+
readonly Content: (props: TableChromePartProps) => DocxEditorChildren;
|
|
632
808
|
/** One line-style row inside the style menu. */
|
|
633
|
-
readonly Item: (props: TableChromeItemProps) =>
|
|
809
|
+
readonly Item: (props: TableChromeItemProps) => DocxEditorChildren;
|
|
634
810
|
}
|
|
635
811
|
/**
|
|
636
812
|
* Border-width menu compound (`DocxEditor.Toolbar.TableBorderWidth`).
|
|
@@ -641,11 +817,11 @@ interface TableBorderWidthNamespace extends TableChromePartComponent {
|
|
|
641
817
|
/** Chrome slot id: `table.borderWidth`. */
|
|
642
818
|
readonly docxSlot: 'table.borderWidth';
|
|
643
819
|
/** Button that opens the border width menu. */
|
|
644
|
-
readonly Trigger: (props: TableChromePartProps) =>
|
|
820
|
+
readonly Trigger: (props: TableChromePartProps) => DocxEditorChildren;
|
|
645
821
|
/** Open menu listing width presets for the active target. */
|
|
646
|
-
readonly Content: (props: TableChromePartProps) =>
|
|
822
|
+
readonly Content: (props: TableChromePartProps) => DocxEditorChildren;
|
|
647
823
|
/** One width preset row inside the width menu. */
|
|
648
|
-
readonly Item: (props: TableChromeItemProps) =>
|
|
824
|
+
readonly Item: (props: TableChromeItemProps) => DocxEditorChildren;
|
|
649
825
|
}
|
|
650
826
|
/**
|
|
651
827
|
* Resolved label for the active border target in the shared draft.
|
|
@@ -678,7 +854,7 @@ interface DocxEditorToolbarProps {
|
|
|
678
854
|
* menu when it runs out of width. Default `true`.
|
|
679
855
|
*/
|
|
680
856
|
overflow?: boolean;
|
|
681
|
-
children?:
|
|
857
|
+
children?: DocxEditorChildren;
|
|
682
858
|
}
|
|
683
859
|
/** The toolbar with its parts attached as statics. @public */
|
|
684
860
|
interface DocxEditorToolbarNamespace {
|
|
@@ -759,7 +935,7 @@ type MenuId = ChromeMenuId | (string & {});
|
|
|
759
935
|
/** Props for `DocxEditor.Menu.Row`: one presentational menu row. @public */
|
|
760
936
|
interface MenuRowProps {
|
|
761
937
|
/** Material Symbols paths, rendered as inline SVG in the row's icon column. */
|
|
762
|
-
icon?:
|
|
938
|
+
icon?: DocxEditorChildren;
|
|
763
939
|
/** Right-aligned shortcut text (already resolved). */
|
|
764
940
|
shortcut?: string;
|
|
765
941
|
disabled?: boolean;
|
|
@@ -783,9 +959,19 @@ interface MenuRowProps {
|
|
|
783
959
|
selected?: true;
|
|
784
960
|
/** Stable marker for hosts, tests and e2e. */
|
|
785
961
|
slot?: string;
|
|
962
|
+
/**
|
|
963
|
+
* Vue TSX maps row identity through `rowSlot` because `slot` is reserved.
|
|
964
|
+
* React uses {@link slot} directly.
|
|
965
|
+
*/
|
|
966
|
+
rowSlot?: string;
|
|
786
967
|
onSelect?: () => void;
|
|
968
|
+
/**
|
|
969
|
+
* Vue TSX binds row activation through `selectHandler` because `onSelect`
|
|
970
|
+
* is treated as a listener. React uses {@link onSelect} directly.
|
|
971
|
+
*/
|
|
972
|
+
selectHandler?: () => void;
|
|
787
973
|
className?: string;
|
|
788
|
-
children?:
|
|
974
|
+
children?: DocxEditorChildren;
|
|
789
975
|
}
|
|
790
976
|
/**
|
|
791
977
|
* One menu row: icon column, label, shortcut column.
|
|
@@ -804,7 +990,7 @@ interface MenuGroupProps {
|
|
|
804
990
|
labelKey?: string;
|
|
805
991
|
className?: string;
|
|
806
992
|
hidden?: boolean;
|
|
807
|
-
children?:
|
|
993
|
+
children?: DocxEditorChildren;
|
|
808
994
|
}
|
|
809
995
|
/**
|
|
810
996
|
* A named section inside a panel: a visible heading and the rows under it.
|
|
@@ -866,7 +1052,7 @@ interface MenuSubmenuProps {
|
|
|
866
1052
|
/** Material Symbols paths for the parent row's icon. */
|
|
867
1053
|
paths?: readonly string[] | null;
|
|
868
1054
|
className?: string;
|
|
869
|
-
children?:
|
|
1055
|
+
children?: DocxEditorChildren;
|
|
870
1056
|
}
|
|
871
1057
|
/**
|
|
872
1058
|
* A row that opens a nested panel to its right (Insert › Break).
|
|
@@ -934,7 +1120,7 @@ interface MenuProps {
|
|
|
934
1120
|
*
|
|
935
1121
|
* Decorative: the label is the accessible name, so the icon is hidden from assistive tech.
|
|
936
1122
|
*/
|
|
937
|
-
icon?:
|
|
1123
|
+
icon?: DocxEditorChildren;
|
|
938
1124
|
className?: string;
|
|
939
1125
|
/** Render nothing — inside the default bar this removes the menu. */
|
|
940
1126
|
hidden?: boolean;
|
|
@@ -946,7 +1132,7 @@ interface MenuProps {
|
|
|
946
1132
|
*/
|
|
947
1133
|
preset?: boolean;
|
|
948
1134
|
/** Panel content. */
|
|
949
|
-
children?:
|
|
1135
|
+
children?: DocxEditorChildren;
|
|
950
1136
|
}
|
|
951
1137
|
/**
|
|
952
1138
|
* One menu of the bar: a trigger and the panel it opens.
|
|
@@ -1038,7 +1224,7 @@ interface DocxEditorMenuProps {
|
|
|
1038
1224
|
* children override their menu in place, others append.
|
|
1039
1225
|
*/
|
|
1040
1226
|
preset?: boolean;
|
|
1041
|
-
children?:
|
|
1227
|
+
children?: DocxEditorChildren;
|
|
1042
1228
|
}
|
|
1043
1229
|
/** The menu bar with its parts attached as statics. @public */
|
|
1044
1230
|
interface DocxEditorMenuNamespace {
|
|
@@ -1104,7 +1290,11 @@ declare function DocxEditorHorizontalRuler(props: DocxEditorRulerProps): ReactEl
|
|
|
1104
1290
|
* when the engine supports page-setup writes, committing one undoable step on release.
|
|
1105
1291
|
*
|
|
1106
1292
|
* Renders nothing while the editor holds no document — see
|
|
1107
|
-
* {@link selectDocumentAbsent}
|
|
1293
|
+
* {@link selectDocumentAbsent} — and nothing while the page is wider than the
|
|
1294
|
+
* viewport: the ruler rides the scroller at content x=0, so a horizontal scroll
|
|
1295
|
+
* would carry it out of view, and pinning it instead would paint ticks over page
|
|
1296
|
+
* text. Word's web peers drop it on cramped viewports; so does this part, and it
|
|
1297
|
+
* returns as soon as the page fits again.
|
|
1108
1298
|
*
|
|
1109
1299
|
* @public
|
|
1110
1300
|
*/
|
|
@@ -1177,7 +1367,7 @@ declare function useNavigationPane(options?: UseNavigationPaneOptions): UseNavig
|
|
|
1177
1367
|
interface NavigationPartProps {
|
|
1178
1368
|
className?: string;
|
|
1179
1369
|
style?: CSSProperties;
|
|
1180
|
-
children?:
|
|
1370
|
+
children?: DocxEditorChildren;
|
|
1181
1371
|
}
|
|
1182
1372
|
/**
|
|
1183
1373
|
* The pane's title row. With no children it renders the close arrow and the title.
|
|
@@ -1250,7 +1440,7 @@ interface DocxEditorNavigationProps extends UseNavigationPaneOptions {
|
|
|
1250
1440
|
className?: string;
|
|
1251
1441
|
style?: CSSProperties;
|
|
1252
1442
|
/** Replaces the default composition (header, tabs, both panels). */
|
|
1253
|
-
children?:
|
|
1443
|
+
children?: DocxEditorChildren;
|
|
1254
1444
|
}
|
|
1255
1445
|
/**
|
|
1256
1446
|
* The document navigation pane — headings and find — over the left gutter.
|
|
@@ -1383,6 +1573,12 @@ interface NavigationShiftInput {
|
|
|
1383
1573
|
readonly reservation: number;
|
|
1384
1574
|
/** Padding already reserved at the inline end, for example by the review rail. */
|
|
1385
1575
|
readonly inlineEndReservation?: number;
|
|
1576
|
+
/**
|
|
1577
|
+
* Padding already standing at the inline START besides the shift itself — the review
|
|
1578
|
+
* gutter's mirrored strip. It moves the page exactly as the shift does, so a shift
|
|
1579
|
+
* computed without it lands the page that far past the reservation.
|
|
1580
|
+
*/
|
|
1581
|
+
readonly inlineStartReservation?: number;
|
|
1386
1582
|
/**
|
|
1387
1583
|
* Whether the page's WIDTH follows the padding right now.
|
|
1388
1584
|
*
|
|
@@ -1409,7 +1605,7 @@ interface NavigationShiftInput {
|
|
|
1409
1605
|
* document with no page setup) rather than guessing: shifting on a zero measurement would
|
|
1410
1606
|
* make the pane jump on the first frame and settle on the second.
|
|
1411
1607
|
*/
|
|
1412
|
-
declare function navigationShift({ viewportWidth, pageWidthPx, reservation, inlineEndReservation, docked, }: NavigationShiftInput): number;
|
|
1608
|
+
declare function navigationShift({ viewportWidth, pageWidthPx, reservation, inlineEndReservation, inlineStartReservation, docked, }: NavigationShiftInput): number;
|
|
1413
1609
|
|
|
1414
1610
|
/**
|
|
1415
1611
|
* The px the chrome is currently displaced by an open navigation pane. `0` when no pane
|
|
@@ -1435,6 +1631,8 @@ interface DocxEditorPageSetupDialogProps {
|
|
|
1435
1631
|
*/
|
|
1436
1632
|
declare function DocxEditorPageSetupDialog({ open, onClose, className, }: DocxEditorPageSetupDialogProps): ReactElement | null;
|
|
1437
1633
|
|
|
1634
|
+
/** Internal bridge from the batteries-included editor's `t` prop to this composition part. */
|
|
1635
|
+
declare const PageNumberTranslationContext: react.Context<((key: string) => string) | null>;
|
|
1438
1636
|
/** Props for `DocxEditor.PageNumber`. @public */
|
|
1439
1637
|
interface DocxEditorPageNumberProps {
|
|
1440
1638
|
/** Appended after the default page-number classes. */
|
|
@@ -1493,12 +1691,12 @@ interface HyperLinkPartProps {
|
|
|
1493
1691
|
asChild?: boolean;
|
|
1494
1692
|
/** Render nothing — inside the default arrangement this removes the part. */
|
|
1495
1693
|
hidden?: boolean;
|
|
1496
|
-
children?:
|
|
1694
|
+
children?: DocxEditorChildren;
|
|
1497
1695
|
}
|
|
1498
1696
|
/** Props for the action parts, which also take an icon. @public */
|
|
1499
1697
|
interface HyperLinkActionProps extends HyperLinkPartProps {
|
|
1500
1698
|
/** Icon override; falls back to `children`, then to the part's default glyph. */
|
|
1501
|
-
icon?:
|
|
1699
|
+
icon?: DocxEditorChildren;
|
|
1502
1700
|
}
|
|
1503
1701
|
/** Props for `DocxEditor.HyperLink`. @public */
|
|
1504
1702
|
interface HyperLinkProps extends HyperLinkPartProps {
|
|
@@ -1606,7 +1804,7 @@ declare function DocxEditorNotesChrome({ className, }: DocxEditorNotesChromeProp
|
|
|
1606
1804
|
/** Props for a packaged context-menu row. @public */
|
|
1607
1805
|
interface ContextMenuCommandProps {
|
|
1608
1806
|
/** Icon override. Defaults to the row's own Material Symbol. */
|
|
1609
|
-
icon?:
|
|
1807
|
+
icon?: DocxEditorChildren;
|
|
1610
1808
|
/** i18n key for the label, overriding the packaged one. */
|
|
1611
1809
|
labelKey?: string;
|
|
1612
1810
|
/** i18n key for the shortcut column, overriding the packaged one. */
|
|
@@ -1703,7 +1901,7 @@ interface ContextMenuItemProps {
|
|
|
1703
1901
|
* action, so the host's own catalogue resolves it. The packaged rows go the other way.
|
|
1704
1902
|
*/
|
|
1705
1903
|
label: string;
|
|
1706
|
-
icon?:
|
|
1904
|
+
icon?: DocxEditorChildren;
|
|
1707
1905
|
/** Right-aligned shortcut text, already resolved. */
|
|
1708
1906
|
shortcut?: string;
|
|
1709
1907
|
disabled?: boolean;
|
|
@@ -1743,7 +1941,7 @@ interface DocxEditorContextMenuProps {
|
|
|
1743
1941
|
disabled?: boolean;
|
|
1744
1942
|
/** Notified whenever the panel opens or closes. */
|
|
1745
1943
|
onOpenChange?: (open: boolean) => void;
|
|
1746
|
-
children?:
|
|
1944
|
+
children?: DocxEditorChildren;
|
|
1747
1945
|
}
|
|
1748
1946
|
/**
|
|
1749
1947
|
* The packaged right-click menu over the painted document.
|
|
@@ -1795,6 +1993,45 @@ interface ContextMenuAnchor {
|
|
|
1795
1993
|
readonly x: number;
|
|
1796
1994
|
readonly y: number;
|
|
1797
1995
|
}
|
|
1996
|
+
interface ContextMenuContextValue {
|
|
1997
|
+
/**
|
|
1998
|
+
* Close the panel. `restoreFocus` on the paths where the user is FINISHING with the menu
|
|
1999
|
+
* (selecting a row); not on the ones where they are already going elsewhere.
|
|
2000
|
+
*/
|
|
2001
|
+
readonly close: (restoreFocus?: boolean) => void;
|
|
2002
|
+
/** Non-null exactly while the panel is open. */
|
|
2003
|
+
readonly anchor: ContextMenuAnchor | null;
|
|
2004
|
+
/**
|
|
2005
|
+
* The table of contents this open was over, captured AT OPEN TIME.
|
|
2006
|
+
*
|
|
2007
|
+
* Read imperatively from the editor in the same event that opens the panel, not
|
|
2008
|
+
* subscribed to. The engine records the right-click target and the panel opens from the
|
|
2009
|
+
* same event, so a subscription is a render behind: the first right-click on a TOC drew
|
|
2010
|
+
* the menu without its rows and only a second one had them. It is also the more honest
|
|
2011
|
+
* shape — an open menu describes the gesture that opened it, whatever happens next.
|
|
2012
|
+
*/
|
|
2013
|
+
readonly tocId: string | null;
|
|
2014
|
+
/**
|
|
2015
|
+
* The element the opening right-click landed on, captured AT OPEN TIME like {@link tocId}.
|
|
2016
|
+
*
|
|
2017
|
+
* What lets a contextual row decide it applies — a custom-node chip, a painted marker —
|
|
2018
|
+
* without installing a second `contextmenu` listener that could disagree with the one
|
|
2019
|
+
* that opened the panel. Null while closed, and for keyboard-invoked opens, which have
|
|
2020
|
+
* no pointer target.
|
|
2021
|
+
*/
|
|
2022
|
+
readonly target: HTMLElement | null;
|
|
2023
|
+
/**
|
|
2024
|
+
* The browser's reason for refusing a clipboard READ, once one has actually been refused.
|
|
2025
|
+
*
|
|
2026
|
+
* Lives on the ROOT rather than in the Paste row because selecting that row closes the
|
|
2027
|
+
* panel, which unmounts the row — state kept there was written and discarded in the same
|
|
2028
|
+
* batch, so the row it was meant to disable came back enabled on the next right-click and
|
|
2029
|
+
* the documented behaviour never once happened. Firefox and Safari refuse every read, so
|
|
2030
|
+
* "ask once, then stop offering it" has to outlive one open.
|
|
2031
|
+
*/
|
|
2032
|
+
readonly clipboardRefusal: string | null;
|
|
2033
|
+
readonly reportClipboardRefusal: (reason: string) => void;
|
|
2034
|
+
}
|
|
1798
2035
|
/**
|
|
1799
2036
|
* The element the opening right-click landed on, or null while the menu is closed.
|
|
1800
2037
|
*
|
|
@@ -1810,11 +2047,11 @@ interface ContentControlPartProps {
|
|
|
1810
2047
|
className?: string;
|
|
1811
2048
|
asChild?: boolean;
|
|
1812
2049
|
hidden?: boolean;
|
|
1813
|
-
children?:
|
|
2050
|
+
children?: DocxEditorChildren;
|
|
1814
2051
|
}
|
|
1815
2052
|
/** Props for action parts that also take an icon. @public */
|
|
1816
2053
|
interface ContentControlActionProps extends ContentControlPartProps {
|
|
1817
|
-
icon?:
|
|
2054
|
+
icon?: DocxEditorChildren;
|
|
1818
2055
|
}
|
|
1819
2056
|
/** Props for `DocxEditor.ContentControl`. @public */
|
|
1820
2057
|
interface ContentControlProps extends ContentControlPartProps {
|
|
@@ -1841,7 +2078,8 @@ interface DocxEditorContentControlNamespace {
|
|
|
1841
2078
|
}
|
|
1842
2079
|
declare const DocxEditorContentControl: DocxEditorContentControlNamespace;
|
|
1843
2080
|
|
|
1844
|
-
type EditorMode = 'edit' | 'view';
|
|
2081
|
+
type EditorMode = 'edit' | 'view' | 'suggesting';
|
|
2082
|
+
|
|
1845
2083
|
/**
|
|
1846
2084
|
* Props for the React `DocxEditor`. The adapter is a thin renderer over the
|
|
1847
2085
|
* `Editor` contract; it holds no editing-engine state of its own and never
|
|
@@ -1864,8 +2102,8 @@ interface DocxEditorProps {
|
|
|
1864
2102
|
* toggle, Open/New/Save controls — and passes them in; the editor renders them
|
|
1865
2103
|
* verbatim on either side of the document title.
|
|
1866
2104
|
*/
|
|
1867
|
-
readonly renderTitleBarLeft?: () =>
|
|
1868
|
-
readonly renderTitleBarRight?: () =>
|
|
2105
|
+
readonly renderTitleBarLeft?: () => DocxEditorChildren;
|
|
2106
|
+
readonly renderTitleBarRight?: () => DocxEditorChildren;
|
|
1869
2107
|
/**
|
|
1870
2108
|
* Chrome colour mode. `'system'` follows the OS and re-resolves when it changes.
|
|
1871
2109
|
* Only the editor CHROME is themed — the document canvas stays Word-faithful.
|
|
@@ -1985,9 +2223,20 @@ interface DocxEditorProps {
|
|
|
1985
2223
|
* `DocxEditor.HorizontalRuler` / `DocxEditor.VerticalRuler` yourself.
|
|
1986
2224
|
*/
|
|
1987
2225
|
rulers?: boolean;
|
|
1988
|
-
/** A document to load: DOCX bytes or an existing handle.
|
|
2226
|
+
/** A document to load: DOCX bytes, `'blank'` for an empty one, or an existing handle.
|
|
2227
|
+
* Omitting it mounts NO document, which is not the same as an empty one. */
|
|
1989
2228
|
document?: DocumentSource;
|
|
1990
|
-
/**
|
|
2229
|
+
/**
|
|
2230
|
+
* The mode the editor opens in, matching the toolbar's three-state pill. Applied at
|
|
2231
|
+
* mount only — not reactive; remount to change.
|
|
2232
|
+
*
|
|
2233
|
+
* Defaults to `'edit'`: the packaged editor opens every document ready to type, even
|
|
2234
|
+
* one whose `w:trackRevisions` asks for tracked changes. Pass `'suggesting'` (needs
|
|
2235
|
+
* `modules` with a review module and an `author`) to open in suggesting, or `'view'`
|
|
2236
|
+
* for read-only. To let the DOCUMENT decide — Word's behavior, where
|
|
2237
|
+
* `w:trackRevisions` opens in suggesting — compose `DocxEditor.Root`, which follows
|
|
2238
|
+
* the file's request when `mode` is omitted.
|
|
2239
|
+
*/
|
|
1991
2240
|
mode?: EditorMode;
|
|
1992
2241
|
/** A fixed scale. Supplying one also makes the mode fixed unless `zoomMode` says otherwise. */
|
|
1993
2242
|
zoom?: number;
|
|
@@ -2011,7 +2260,7 @@ interface DocxEditorProps {
|
|
|
2011
2260
|
* `DocxEditorReview` from `@docx-editor.dev/pro/react`). For more control,
|
|
2012
2261
|
* compose `DocxEditor.Root`/`Viewport`/`Content` directly.
|
|
2013
2262
|
*/
|
|
2014
|
-
children?:
|
|
2263
|
+
children?: DocxEditorChildren;
|
|
2015
2264
|
className?: string;
|
|
2016
2265
|
/** Fired after the underlying `Editor` is created. */
|
|
2017
2266
|
onReady?: (editor: Editor) => void;
|
|
@@ -2032,7 +2281,8 @@ interface DocxEditorProps {
|
|
|
2032
2281
|
* mirrors capabilities the `Editor` contract already names.
|
|
2033
2282
|
*/
|
|
2034
2283
|
interface DocxEditorRef {
|
|
2035
|
-
/** Load a document: DOCX bytes or an existing handle.
|
|
2284
|
+
/** Load a document: DOCX bytes, `'blank'` for an empty one, or an existing handle.
|
|
2285
|
+
* No-op before mount. */
|
|
2036
2286
|
load(document: DocumentSource): void;
|
|
2037
2287
|
/** Serialize the current document; `null` when no editor is mounted. */
|
|
2038
2288
|
save(): Promise<ArrayBuffer | null>;
|
|
@@ -2071,6 +2321,8 @@ interface DocxEditorNamespace extends ForwardRefExoticComponent<DocxEditorProps
|
|
|
2071
2321
|
readonly Menu: typeof DocxEditorMenu;
|
|
2072
2322
|
/** Conditional loading screen: renders while there is no document to paint. */
|
|
2073
2323
|
readonly Loading: typeof DocxEditorLoading;
|
|
2324
|
+
readonly ColorByChangeType: typeof DocxEditorColorByChangeType;
|
|
2325
|
+
readonly AuthorStyle: typeof DocxEditorAuthorStyle;
|
|
2074
2326
|
/** Context-fed horizontal ruler with draggable margins (props-driven export stays). */
|
|
2075
2327
|
readonly HorizontalRuler: typeof DocxEditorHorizontalRuler;
|
|
2076
2328
|
/** Context-fed vertical ruler with draggable margins (props-driven export stays). */
|
|
@@ -2113,49 +2365,111 @@ interface DocxEditorNamespace extends ForwardRefExoticComponent<DocxEditorProps
|
|
|
2113
2365
|
}
|
|
2114
2366
|
declare const DocxEditor: DocxEditorNamespace;
|
|
2115
2367
|
|
|
2368
|
+
/** @internal Test seam — count of mounted {@link useEditorState} multiplexed subscriptions. */
|
|
2369
|
+
declare function editorStateActiveSubscriptionCount(): number;
|
|
2370
|
+
/** Optional lifecycle hooks for test instrumentation. @internal */
|
|
2371
|
+
interface UseEditorStateOptions {
|
|
2372
|
+
readonly onSubscribe?: () => void;
|
|
2373
|
+
readonly onUnsubscribe?: () => void;
|
|
2374
|
+
}
|
|
2116
2375
|
/**
|
|
2117
|
-
*
|
|
2118
|
-
*
|
|
2119
|
-
*
|
|
2120
|
-
*
|
|
2376
|
+
* Subscribe to a slice of the editor's read model. Re-renders the component ONLY when
|
|
2377
|
+
* `selector`'s result changes (by `isEqual`, default `Object.is`).
|
|
2378
|
+
*
|
|
2379
|
+
* Before the editor exists — outside a `DocxEditor.Root`, pre-mount, and on the
|
|
2380
|
+
* server — the selector receives a frozen loading snapshot (`isLoading: true`,
|
|
2381
|
+
* `page: {current: 0, total: 0}`), never `null`.
|
|
2121
2382
|
*
|
|
2122
2383
|
* @public
|
|
2123
2384
|
*/
|
|
2124
|
-
declare function
|
|
2385
|
+
declare function useEditorState<T>(selector: (snapshot: EditorSnapshot) => T, isEqual?: (a: T, b: T) => boolean, options?: UseEditorStateOptions): T;
|
|
2386
|
+
|
|
2125
2387
|
/**
|
|
2126
|
-
*
|
|
2388
|
+
* The scope class a chrome part should add to its own root element: the class
|
|
2389
|
+
* when nothing above it is scoped, an empty string when something already is.
|
|
2127
2390
|
*
|
|
2128
|
-
*
|
|
2129
|
-
*
|
|
2130
|
-
*
|
|
2131
|
-
*
|
|
2132
|
-
* 158px off centre beside an empty column.
|
|
2391
|
+
* ```tsx
|
|
2392
|
+
* const scope = useScopeClassName();
|
|
2393
|
+
* <div className={`${scope}docx-toolbar`} />
|
|
2394
|
+
* ```
|
|
2133
2395
|
*
|
|
2134
|
-
*
|
|
2135
|
-
* really on screen. Count rather than boolean: StrictMode mounts twice, and a host may
|
|
2136
|
-
* legitimately compose two rails.
|
|
2396
|
+
* Returns a trailing space so it concatenates cleanly, and `''` collapses away.
|
|
2137
2397
|
*/
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2398
|
+
declare function useScopeClassName(): '' | 'docx-editor ';
|
|
2399
|
+
|
|
2400
|
+
/** Full reservation: the 300px card column plus its 16px gutter off the page edge. */
|
|
2401
|
+
declare const REVIEW_PANE_GUTTER = 316;
|
|
2402
|
+
/** The marker strip: anchors and the add-comment button, no cards. */
|
|
2403
|
+
declare const REVIEW_MARKERS_GUTTER = 44;
|
|
2404
|
+
/** What the scroll container reserves on each edge, in px. */
|
|
2405
|
+
interface ReviewGutter {
|
|
2406
|
+
readonly inlineStart: number;
|
|
2407
|
+
readonly inlineEnd: number;
|
|
2141
2408
|
}
|
|
2142
|
-
|
|
2409
|
+
interface ReviewGutterInput {
|
|
2410
|
+
/** Whether the pane is showing its cards (`snapshot.reviewPaneOpen`). */
|
|
2411
|
+
readonly open: boolean;
|
|
2412
|
+
/** Client width of the scroll container. */
|
|
2413
|
+
readonly viewportWidth: number;
|
|
2414
|
+
/** The width the page is entitled to paint at — authored width times the entitled zoom. */
|
|
2415
|
+
readonly pageWidthPx: number;
|
|
2416
|
+
/**
|
|
2417
|
+
* Start-edge room OTHER chrome is asking for — an open navigation pane's reservation.
|
|
2418
|
+
* Without it the column judged only page-against-viewport, stood in the two-pane case,
|
|
2419
|
+
* and the pane's displacement then squeezed the fit below the page's entitlement — the
|
|
2420
|
+
* very symptom the measurement exists to remove. The STATIC ask (open pane × width),
|
|
2421
|
+
* never the pane's computed shift: the shift depends on this gutter, and reading it
|
|
2422
|
+
* back would close a cycle the two reservations then chase around.
|
|
2423
|
+
*/
|
|
2424
|
+
readonly inlineStartReservation?: number;
|
|
2425
|
+
/**
|
|
2426
|
+
* An uncapped fit is in force: the page fills whatever box it is given, so there is no
|
|
2427
|
+
* entitlement to measure the leftover against. The full column stands.
|
|
2428
|
+
*/
|
|
2429
|
+
readonly docked?: boolean;
|
|
2430
|
+
}
|
|
2431
|
+
/**
|
|
2432
|
+
* The paddings, in px, the scroll container reserves for the review rail.
|
|
2433
|
+
*
|
|
2434
|
+
* Returns the FULL column for a degenerate measurement (a viewport that has not been
|
|
2435
|
+
* laid out yet, a document with no page setup) rather than guessing: that is the value
|
|
2436
|
+
* the stylesheet fell back to before this measurement existed, so an unmeasured first
|
|
2437
|
+
* frame paints exactly as it always did and collapses only once there is a real width
|
|
2438
|
+
* to decide by.
|
|
2439
|
+
*/
|
|
2440
|
+
declare function reviewGutter({ open, viewportWidth, pageWidthPx, inlineStartReservation, docked, }: ReviewGutterInput): ReviewGutter;
|
|
2441
|
+
/**
|
|
2442
|
+
* The gutter the review rail reserves right now: nothing with no rail mounted, and the
|
|
2443
|
+
* measured `reviewGutter` pair otherwise. The one source for the scroll container's
|
|
2444
|
+
* paddings and both rulers.
|
|
2445
|
+
*
|
|
2446
|
+
* The result is reference-stable — the pure function answers with one of three shared
|
|
2447
|
+
* constants — and the hook stores THAT, never the raw width: a resize sweeps through
|
|
2448
|
+
* hundreds of widths that all resolve to the same constant, and holding the width as
|
|
2449
|
+
* state re-rendered every consumer (the review rail among them) once per pixel. Storing
|
|
2450
|
+
* the derived constant lets the state setter bail on identity, so consumers re-render
|
|
2451
|
+
* only when the reservation actually flips.
|
|
2452
|
+
*/
|
|
2453
|
+
declare function useReviewGutter(): ReviewGutter;
|
|
2143
2454
|
|
|
2144
2455
|
interface SlotProps extends HTMLAttributes<HTMLElement> {
|
|
2145
|
-
children?:
|
|
2456
|
+
children?: DocxEditorChildren;
|
|
2146
2457
|
/** Fanned out alongside the child's own ref. */
|
|
2147
2458
|
ref?: Ref<unknown>;
|
|
2459
|
+
className?: string;
|
|
2460
|
+
style?: CSSProperties;
|
|
2148
2461
|
}
|
|
2149
2462
|
/** Renders its single child element with the slot's props merged in. */
|
|
2150
2463
|
declare function Slot({ children, ...slotProps }: SlotProps): ReactElement<unknown, string | react.JSXElementConstructor<any>> | null;
|
|
2151
2464
|
|
|
2152
2465
|
interface LocaleProviderProps {
|
|
2153
2466
|
i18n?: Translations;
|
|
2154
|
-
children:
|
|
2467
|
+
children: DocxEditorChildren;
|
|
2155
2468
|
}
|
|
2156
2469
|
declare function LocaleProvider({ i18n, children }: LocaleProviderProps): react.JSX.Element;
|
|
2157
2470
|
declare function useTranslation(): {
|
|
2158
2471
|
t: TFunction;
|
|
2472
|
+
catalogue: LocaleStrings;
|
|
2159
2473
|
};
|
|
2160
2474
|
|
|
2161
2475
|
/**
|
|
@@ -2264,6 +2578,15 @@ interface UseHyperlinkPopupResult {
|
|
|
2264
2578
|
*/
|
|
2265
2579
|
openTarget: () => boolean;
|
|
2266
2580
|
}
|
|
2581
|
+
/**
|
|
2582
|
+
* A field-derived link (a `HYPERLINK` field's instruction) rather than a typed
|
|
2583
|
+
* `w:hyperlink`. Structurally signalled: the field registry mints every record with no
|
|
2584
|
+
* addressable range (`paragraphId` stays empty), because no `w:hyperlink` node backs it.
|
|
2585
|
+
* The typed editing lane (edit / unlink) can never resolve its id, so chrome offers neither
|
|
2586
|
+
* action. Caret dismissal DOES apply: the field is a one-unit atom, and `fieldLinkAtCaret`
|
|
2587
|
+
* resolves the caret onto it (boundary-inclusive) so the panel closes when the caret leaves.
|
|
2588
|
+
*/
|
|
2589
|
+
declare function isFieldLink(link: SurfaceHyperlink): boolean;
|
|
2267
2590
|
/**
|
|
2268
2591
|
* The hyperlink popover's behavior.
|
|
2269
2592
|
*
|
|
@@ -2294,7 +2617,16 @@ type DocxFontsInput = FontConfiguration | FontConfigurationFragment;
|
|
|
2294
2617
|
* @public
|
|
2295
2618
|
*/
|
|
2296
2619
|
type DocxFontsSource = DocxFontsInput | Promise<DocxFontsInput> | (() => DocxFontsInput | Promise<DocxFontsInput>);
|
|
2297
|
-
/**
|
|
2620
|
+
/**
|
|
2621
|
+
* What the document itself can be: a URL to fetch, or bytes already in hand.
|
|
2622
|
+
*
|
|
2623
|
+
* A string here is ALWAYS a URL — this hook exists to fetch one. That is the opposite of
|
|
2624
|
+
* the `document` prop, whose `DocumentSource` reads the string `'blank'` as Word's blank
|
|
2625
|
+
* template; `useDocxSource('blank')` would request `./blank` and report the 404. There is
|
|
2626
|
+
* nothing to fetch for an empty document, so pass `'blank'` straight to `document`.
|
|
2627
|
+
*
|
|
2628
|
+
* @public
|
|
2629
|
+
*/
|
|
2298
2630
|
type DocxSource = string | URL | Uint8Array | ArrayBuffer;
|
|
2299
2631
|
/** Options for {@link useDocxSource}. @public */
|
|
2300
2632
|
interface UseDocxSourceOptions {
|
|
@@ -2465,22 +2797,33 @@ declare function useContentControl(): UseContentControlResult;
|
|
|
2465
2797
|
*/
|
|
2466
2798
|
declare function useContentControlInstance(): UseContentControlResult;
|
|
2467
2799
|
|
|
2468
|
-
/** Optional lifecycle hooks for test instrumentation. @internal */
|
|
2469
|
-
interface UseEditorStateOptions {
|
|
2470
|
-
readonly onSubscribe?: () => void;
|
|
2471
|
-
readonly onUnsubscribe?: () => void;
|
|
2472
|
-
}
|
|
2473
2800
|
/**
|
|
2474
|
-
*
|
|
2475
|
-
* `
|
|
2801
|
+
* Every author the review surface DRAWS, in Word's slot order, with the colour and style
|
|
2802
|
+
* each resolves to. `[]` before an editor or document exists.
|
|
2476
2803
|
*
|
|
2477
|
-
*
|
|
2478
|
-
*
|
|
2479
|
-
*
|
|
2804
|
+
* Both halves of review: authors of tracked changes first, numbered by where their first
|
|
2805
|
+
* change appears, then authors who only commented. One person is one colour across the two.
|
|
2806
|
+
*
|
|
2807
|
+
* A read of the rendered projection, not of the package: a resolved view hides the
|
|
2808
|
+
* revisions it has resolved away, so an author whose only change is hidden there is listed
|
|
2809
|
+
* only if they also commented.
|
|
2810
|
+
*
|
|
2811
|
+
* The array is reference-stable between changes (the facade caches per layout and colour
|
|
2812
|
+
* state), so it is safe as a dependency and under `useSyncExternalStore`.
|
|
2813
|
+
*
|
|
2814
|
+
* Pairs with the declarative components: read the roster here, declare the styling as
|
|
2815
|
+
* `<DocxEditor.AuthorStyle>` elements.
|
|
2816
|
+
*
|
|
2817
|
+
* ```tsx
|
|
2818
|
+
* const authors = useReviewAuthors();
|
|
2819
|
+
* authors.map(({ author }) => (
|
|
2820
|
+
* <DocxEditor.AuthorStyle key={author} author={author} color={myTeam[author]?.color} />
|
|
2821
|
+
* ));
|
|
2822
|
+
* ```
|
|
2480
2823
|
*
|
|
2481
2824
|
* @public
|
|
2482
2825
|
*/
|
|
2483
|
-
declare function
|
|
2826
|
+
declare function useReviewAuthors(): readonly ReviewAuthorInfo[];
|
|
2484
2827
|
|
|
2485
2828
|
/** What {@link useZoom} answers. @public */
|
|
2486
2829
|
interface UseZoomResult {
|
|
@@ -2598,6 +2941,23 @@ declare function useEditorValueCommand(slotId: 'image.wrap'): EditorValueCommand
|
|
|
2598
2941
|
*/
|
|
2599
2942
|
declare function useEditorValueCommand(slotId: 'image.altText'): EditorValueCommandState<string>;
|
|
2600
2943
|
|
|
2944
|
+
/** @public */
|
|
2945
|
+
type DocxEditorRefCallback<T> = (node: T | null) => void;
|
|
2946
|
+
|
|
2947
|
+
type AnchorPlacement = 'before' | 'after' | 'story-label';
|
|
2948
|
+
interface ScopedChromeAnchor {
|
|
2949
|
+
readonly ref: DocxEditorRefCallback<HTMLDivElement>;
|
|
2950
|
+
readonly style: CSSProperties;
|
|
2951
|
+
}
|
|
2952
|
+
/**
|
|
2953
|
+
* Attach contextual chrome to a painted story instead of the top of the editor viewport.
|
|
2954
|
+
*
|
|
2955
|
+
* The engine owns and may replace everything inside the paginated surface, so React cannot
|
|
2956
|
+
* portal controls into a header, footer, or note node. This hook keeps the controls as a
|
|
2957
|
+
* sibling overlay and derives only their screen placement from the current painted host.
|
|
2958
|
+
*/
|
|
2959
|
+
declare function useScopedChromeAnchor(findAnchor: (viewport: HTMLElement) => HTMLElement | null, placement: AnchorPlacement): ScopedChromeAnchor;
|
|
2960
|
+
|
|
2601
2961
|
/**
|
|
2602
2962
|
* Subscribe to an editor event (`'change'`, `'selectionChange'`, `'error'`, …) for the
|
|
2603
2963
|
* lifetime of the component. No-op until the nearest `DocxEditor.Root` has created the
|
|
@@ -2741,6 +3101,8 @@ interface PaginatedDocxEditorHandle {
|
|
|
2741
3101
|
/** Serialize the current document. */
|
|
2742
3102
|
save(): Uint8Array | null;
|
|
2743
3103
|
}
|
|
3104
|
+
/** Vue name for the same handle contract. @public */
|
|
3105
|
+
type PaginatedDocxEditorExpose = PaginatedDocxEditorHandle;
|
|
2744
3106
|
declare function PaginatedDocxEditor({ source, scale, measurer, onStateChange, onError, className, documentFontFamily, ref, }: PaginatedDocxEditorProps): react.JSX.Element;
|
|
2745
3107
|
|
|
2746
3108
|
interface PaginatedDocxEditorShellProps {
|
|
@@ -2760,8 +3122,8 @@ interface PaginatedDocxEditorShellProps {
|
|
|
2760
3122
|
* They belong to whoever embeds the editor — a demo's switchers are not editor chrome, and
|
|
2761
3123
|
* baking them in would ship them to every consumer.
|
|
2762
3124
|
*/
|
|
2763
|
-
readonly renderTitleBarLeft?: () =>
|
|
2764
|
-
readonly renderTitleBarRight?: () =>
|
|
3125
|
+
readonly renderTitleBarLeft?: () => DocxEditorChildren;
|
|
3126
|
+
readonly renderTitleBarRight?: () => DocxEditorChildren;
|
|
2765
3127
|
/** Commands, forwarded from the editor the shell hosts. */
|
|
2766
3128
|
readonly ref?: Ref<PaginatedDocxEditorHandle>;
|
|
2767
3129
|
/** Applies the editor's own dark palette; the document canvas stays Word-faithful. */
|
|
@@ -2772,207 +3134,47 @@ interface PaginatedDocxEditorShellProps {
|
|
|
2772
3134
|
readonly documentFontFamily?: string;
|
|
2773
3135
|
readonly className?: string;
|
|
2774
3136
|
}
|
|
3137
|
+
/** @deprecated Use `<DocxEditor>` from the composition layer instead. */
|
|
2775
3138
|
declare function PaginatedDocxEditorShell({ source, scale, measurer, documentName, onStateChange, onError, onSave, renderTitleBarLeft, renderTitleBarRight, ref, colorMode, onZoomChange, documentFontFamily, className, }: PaginatedDocxEditorShellProps): react.JSX.Element;
|
|
2776
3139
|
|
|
2777
3140
|
/**
|
|
2778
|
-
*
|
|
2779
|
-
*
|
|
2780
|
-
* Margins are the grey zones at either end; dragging the grey/white boundary moves them.
|
|
2781
|
-
*
|
|
2782
|
-
* The indent handles are Word's, not Google's three:
|
|
2783
|
-
*
|
|
2784
|
-
* ▽ first line at leftMargin + left + firstLine
|
|
2785
|
-
* △ hanging at leftMargin + left — drags `left`, PINS the first-line marker
|
|
2786
|
-
* ▭ left box at leftMargin + left — drags `left`, TAKES the first line with it
|
|
2787
|
-
* △ right at pageWidth - rightMargin - right
|
|
2788
|
-
*
|
|
2789
|
-
* The hanging triangle and the left box are coincident horizontally, as in Word, and are
|
|
2790
|
-
* separated vertically instead — the box sits below the strip. They differ only in what a
|
|
2791
|
-
* drag takes with them.
|
|
3141
|
+
* Paragraph-style preview + option resolution — shared between the React and
|
|
3142
|
+
* Vue toolbars so the style-picker dropdown looks and behaves identically.
|
|
2792
3143
|
*
|
|
2793
|
-
*
|
|
2794
|
-
*
|
|
3144
|
+
* Pure logic only: no i18n and no framework CSS types. The returned preview is
|
|
3145
|
+
* a plain `{ fontSize, lineHeight, fontWeight?, fontStyle?, color? }` object,
|
|
3146
|
+
* which is structurally assignable to both React's `CSSProperties` and Vue's
|
|
3147
|
+
* inline-style record, so neither adapter needs a cast. Name localization stays
|
|
3148
|
+
* in the adapters (they own the i18n `t()` boundary).
|
|
3149
|
+
* @packageDocumentation
|
|
3150
|
+
* @public
|
|
2795
3151
|
*/
|
|
2796
3152
|
|
|
2797
3153
|
/**
|
|
2798
|
-
*
|
|
2799
|
-
*
|
|
3154
|
+
* One entry of `Editor.getDocumentStyles()` — the engine's document-style
|
|
3155
|
+
* summary the picker consumes. Derived from the contract, not re-declared.
|
|
3156
|
+
* @public
|
|
2800
3157
|
*/
|
|
2801
|
-
type
|
|
3158
|
+
type DocumentStyleSummary = ReturnType<Editor['getDocumentStyles']>[number];
|
|
3159
|
+
|
|
2802
3160
|
/**
|
|
2803
|
-
*
|
|
2804
|
-
*
|
|
3161
|
+
* The paragraph alignments this control understands, in OOXML `w:jc`
|
|
3162
|
+
* vocabulary (`both` is Word's justify; `distribute` renders as justify).
|
|
3163
|
+
* Presentation-only: the dropdown emits the first four.
|
|
2805
3164
|
*/
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
/**
|
|
2820
|
-
* Paint the four indent handles.
|
|
2821
|
-
*
|
|
2822
|
-
* Off by default so a ruler with no paragraph context does not show handles pinned at
|
|
2823
|
-
* zero. When on they are painted whatever `indentEditable` says: Word shows the markers
|
|
2824
|
-
* on a read-only document and simply refuses the drag, and hiding them would remove the
|
|
2825
|
-
* only place a reader can see a paragraph's indents.
|
|
2826
|
-
*/
|
|
2827
|
-
showIndentHandles?: boolean;
|
|
2828
|
-
/** The paragraph's indent in twips; `firstLine` is SIGNED, negative for a hanging. */
|
|
2829
|
-
indent?: RulerIndent | null;
|
|
2830
|
-
/** Whether the INDENT handles drag — a different capability from `editable`. */
|
|
2831
|
-
indentEditable?: boolean;
|
|
2832
|
-
/** Fires continuously through an indent drag, for the host to preview. */
|
|
2833
|
-
onIndentChange?: (indent: RulerIndent) => void;
|
|
2834
|
-
/** Fires when an indent drag is released — the moment to commit one undoable step. */
|
|
2835
|
-
onIndentDragEnd?: () => void;
|
|
2836
|
-
unit?: 'inch' | 'cm';
|
|
2837
|
-
className?: string;
|
|
2838
|
-
style?: CSSProperties;
|
|
2839
|
-
tabMarks?: RulerTabStop[] | null;
|
|
2840
|
-
onTabMarkRemove?: (positionTwips: number) => void;
|
|
2841
|
-
}
|
|
2842
|
-
declare function HorizontalRuler({ pageSetup, zoom, editable, onLeftMarginChange, onRightMarginChange, onMarginDragEnd, showIndentHandles, indent, indentEditable, onIndentChange, onIndentDragEnd, unit, className, style, tabMarks, onTabMarkRemove, }: HorizontalRulerProps$1): react__default.ReactElement;
|
|
2843
|
-
|
|
2844
|
-
/**
|
|
2845
|
-
* One heading of the engine's outline (`Editor.getOutline()`): text, level,
|
|
2846
|
-
* and the block id `Editor.scrollToBlock` accepts. Derived from the contract.
|
|
2847
|
-
*/
|
|
2848
|
-
type OutlineHeading = ReturnType<Editor['getOutline']>[number];
|
|
2849
|
-
|
|
2850
|
-
/** One tracked change as the engine reports it (`Editor.getTrackedChanges()`). */
|
|
2851
|
-
type TrackedChangeSummary = ReturnType<Editor['getTrackedChanges']>[number];
|
|
2852
|
-
interface ScrollPageInfo {
|
|
2853
|
-
currentPage: number;
|
|
2854
|
-
totalPages: number;
|
|
2855
|
-
visible: boolean;
|
|
2856
|
-
}
|
|
2857
|
-
interface HorizontalRulerProps {
|
|
2858
|
-
pageSetup: RulerPageSetup | undefined;
|
|
2859
|
-
zoom: number;
|
|
2860
|
-
unit: 'inch' | 'cm';
|
|
2861
|
-
editable: boolean;
|
|
2862
|
-
onLeftMarginChange: (marginTwips: number) => void;
|
|
2863
|
-
onRightMarginChange: (marginTwips: number) => void;
|
|
2864
|
-
tabMarks: RulerTabStop[] | null;
|
|
2865
|
-
onTabMarkRemove: (positionTwips: number) => void;
|
|
2866
|
-
}
|
|
2867
|
-
interface VerticalRulerProps$1 {
|
|
2868
|
-
pageSetup: RulerPageSetup | undefined;
|
|
2869
|
-
zoom: number;
|
|
2870
|
-
unit: 'inch' | 'cm';
|
|
2871
|
-
editable: boolean;
|
|
2872
|
-
onTopMarginChange: (marginTwips: number) => void;
|
|
2873
|
-
onBottomMarginChange: (marginTwips: number) => void;
|
|
2874
|
-
}
|
|
2875
|
-
interface OutlineProps {
|
|
2876
|
-
headings: readonly OutlineHeading[];
|
|
2877
|
-
onHeadingClick: (blockId: string) => void;
|
|
2878
|
-
onClose: () => void;
|
|
2879
|
-
topOffset: number;
|
|
2880
|
-
scrollLeft: number;
|
|
2881
|
-
}
|
|
2882
|
-
/**
|
|
2883
|
-
* Outer chrome of the editor: i18n + error provider wrappers, the
|
|
2884
|
-
* scroll container with its background-click handler, horizontal and
|
|
2885
|
-
* vertical rulers, the floating page indicator, document outline panel
|
|
2886
|
-
* + toggle button, plus slots for the toolbar, paged-area body,
|
|
2887
|
-
* overlays, dialogs, and hidden file inputs.
|
|
2888
|
-
*
|
|
2889
|
-
* The expanded-sidebar-item highlight styles are computed here from
|
|
2890
|
-
* `expandedSidebarItem` + `trackedChanges` because they need to live
|
|
2891
|
-
* inside the editor-content `<div>` for proper scoping.
|
|
2892
|
-
*/
|
|
2893
|
-
declare function DocxEditorShell({ i18n, isDark, onEditorError, containerRef, scrollContainerRef, editorContentRef, className, containerStyle, mainContentStyle, editorContainerStyle, showRuler, readOnlyProp, showOutline, showOutlineButton, sidebarOpen, minLayoutWidth, toolbarHeight, editorScrollLeft, expandedSidebarItem, trackedChanges, onScrollContainerMouseDown, onEditorBgMouseDown, onEditorContextMenu, horizontalRulerProps, verticalRulerProps, outlineProps, onToggleOutline, scrollPageInfo, toolbar, pagedArea, overlays, dialogs, fileInputs, }: {
|
|
2894
|
-
i18n: React.ComponentProps<typeof LocaleProvider>['i18n'];
|
|
2895
|
-
isDark?: boolean;
|
|
2896
|
-
onEditorError: (error: Error) => void;
|
|
2897
|
-
containerRef: React.Ref<HTMLDivElement>;
|
|
2898
|
-
scrollContainerRef: React.Ref<HTMLDivElement>;
|
|
2899
|
-
editorContentRef: React.Ref<HTMLDivElement>;
|
|
2900
|
-
className: string | undefined;
|
|
2901
|
-
containerStyle: CSSProperties;
|
|
2902
|
-
mainContentStyle: CSSProperties;
|
|
2903
|
-
editorContainerStyle: CSSProperties;
|
|
2904
|
-
showRuler: boolean;
|
|
2905
|
-
readOnlyProp: boolean | undefined;
|
|
2906
|
-
showOutline: boolean;
|
|
2907
|
-
showOutlineButton: boolean;
|
|
2908
|
-
sidebarOpen: boolean;
|
|
2909
|
-
minLayoutWidth: number;
|
|
2910
|
-
toolbarHeight: number;
|
|
2911
|
-
editorScrollLeft: number;
|
|
2912
|
-
expandedSidebarItem: string | null;
|
|
2913
|
-
trackedChanges: readonly TrackedChangeSummary[];
|
|
2914
|
-
onScrollContainerMouseDown: (e: React.MouseEvent) => void;
|
|
2915
|
-
onEditorBgMouseDown: (e: React.MouseEvent) => void;
|
|
2916
|
-
onEditorContextMenu: (e: React.MouseEvent) => void;
|
|
2917
|
-
horizontalRulerProps: HorizontalRulerProps;
|
|
2918
|
-
verticalRulerProps: VerticalRulerProps$1;
|
|
2919
|
-
outlineProps: OutlineProps;
|
|
2920
|
-
onToggleOutline: () => void;
|
|
2921
|
-
scrollPageInfo: ScrollPageInfo;
|
|
2922
|
-
toolbar: ReactNode;
|
|
2923
|
-
pagedArea: ReactNode;
|
|
2924
|
-
overlays: ReactNode;
|
|
2925
|
-
dialogs: ReactNode;
|
|
2926
|
-
fileInputs: ReactNode;
|
|
2927
|
-
}): react.JSX.Element;
|
|
2928
|
-
|
|
2929
|
-
/**
|
|
2930
|
-
* Paragraph-style preview + option resolution — shared between the React and
|
|
2931
|
-
* Vue toolbars so the style-picker dropdown looks and behaves identically.
|
|
2932
|
-
*
|
|
2933
|
-
* Pure logic only: no i18n and no framework CSS types. The returned preview is
|
|
2934
|
-
* a plain `{ fontSize, lineHeight, fontWeight?, fontStyle?, color? }` object,
|
|
2935
|
-
* which is structurally assignable to both React's `CSSProperties` and Vue's
|
|
2936
|
-
* inline-style record, so neither adapter needs a cast. Name localization stays
|
|
2937
|
-
* in the adapters (they own the i18n `t()` boundary).
|
|
2938
|
-
* @packageDocumentation
|
|
2939
|
-
* @public
|
|
2940
|
-
*/
|
|
2941
|
-
|
|
2942
|
-
/**
|
|
2943
|
-
* One entry of `Editor.getDocumentStyles()` — the engine's document-style
|
|
2944
|
-
* summary the picker consumes. Derived from the contract, not re-declared.
|
|
2945
|
-
* @public
|
|
2946
|
-
*/
|
|
2947
|
-
type DocumentStyleSummary = ReturnType<Editor['getDocumentStyles']>[number];
|
|
2948
|
-
|
|
2949
|
-
/**
|
|
2950
|
-
* Alignment Dropdown Component (Google Docs style)
|
|
2951
|
-
*
|
|
2952
|
-
* A single dropdown button for paragraph alignment controls:
|
|
2953
|
-
* - Shows current alignment icon + chevron
|
|
2954
|
-
* - Opens a floating panel with Left, Center, Right, Justify options
|
|
2955
|
-
* - Active option is highlighted
|
|
2956
|
-
*/
|
|
2957
|
-
|
|
2958
|
-
/**
|
|
2959
|
-
* The paragraph alignments this control understands, in OOXML `w:jc`
|
|
2960
|
-
* vocabulary (`both` is Word's justify; `distribute` renders as justify).
|
|
2961
|
-
* Presentation-only: the dropdown emits the first four.
|
|
2962
|
-
*/
|
|
2963
|
-
type ParagraphAlignment = 'left' | 'center' | 'right' | 'both' | 'distribute';
|
|
2964
|
-
|
|
2965
|
-
/**
|
|
2966
|
-
* Shared FontOption shape + normaliser used by FontPicker components
|
|
2967
|
-
* in both adapters. Lifted from packages/react/src/components/ui/
|
|
2968
|
-
* normalizeFontFamilies.ts so the type definition has a single home.
|
|
2969
|
-
* @packageDocumentation
|
|
2970
|
-
* @public
|
|
2971
|
-
*/
|
|
2972
|
-
interface FontOption {
|
|
2973
|
-
name: string;
|
|
2974
|
-
fontFamily: string;
|
|
2975
|
-
category?: 'sans-serif' | 'serif' | 'monospace' | 'other';
|
|
3165
|
+
type ParagraphAlignment = 'left' | 'center' | 'right' | 'both' | 'distribute';
|
|
3166
|
+
|
|
3167
|
+
/**
|
|
3168
|
+
* Shared FontOption shape + normaliser used by FontPicker components
|
|
3169
|
+
* in both adapters. Lifted from packages/react/src/components/ui/
|
|
3170
|
+
* normalizeFontFamilies.ts so the type definition has a single home.
|
|
3171
|
+
* @packageDocumentation
|
|
3172
|
+
* @public
|
|
3173
|
+
*/
|
|
3174
|
+
interface FontOption {
|
|
3175
|
+
name: string;
|
|
3176
|
+
fontFamily: string;
|
|
3177
|
+
category?: 'sans-serif' | 'serif' | 'monospace' | 'other';
|
|
2976
3178
|
}
|
|
2977
3179
|
|
|
2978
3180
|
/**
|
|
@@ -2992,19 +3194,6 @@ interface ListState {
|
|
|
2992
3194
|
numId?: number;
|
|
2993
3195
|
}
|
|
2994
3196
|
|
|
2995
|
-
/**
|
|
2996
|
-
* TableToolbar Component
|
|
2997
|
-
*
|
|
2998
|
-
* Provides controls for editing tables:
|
|
2999
|
-
* - Add row above/below
|
|
3000
|
-
* - Add column left/right
|
|
3001
|
-
* - Delete row/column
|
|
3002
|
-
* - Merge cells
|
|
3003
|
-
* - Split cell
|
|
3004
|
-
*
|
|
3005
|
-
* Shows when cursor is in a table.
|
|
3006
|
-
*/
|
|
3007
|
-
|
|
3008
3197
|
/**
|
|
3009
3198
|
* Table editing action types
|
|
3010
3199
|
*/
|
|
@@ -3063,18 +3252,6 @@ type TableAction = 'addRowAbove' | 'addRowBelow' | 'addColumnLeft' | 'addColumnR
|
|
|
3063
3252
|
styleId: string;
|
|
3064
3253
|
};
|
|
3065
3254
|
|
|
3066
|
-
/**
|
|
3067
|
-
* Toolbar Component
|
|
3068
|
-
*
|
|
3069
|
-
* The customizable formatting rail — undo/redo, zoom, styles, fonts,
|
|
3070
|
-
* bold/italic/underline, colors, alignment, lists, table/image context,
|
|
3071
|
-
* clear formatting. Used standalone (`<Toolbar ...props>`), inside
|
|
3072
|
-
* `<EditorToolbar>` (reads from context via `EditorToolbar.Toolbar`), or
|
|
3073
|
-
* embedded inline. Also the home of the `ToolbarButton` / `ToolbarGroup` /
|
|
3074
|
-
* `ToolbarSeparator` primitives and the shared `FormattingAction` /
|
|
3075
|
-
* `SelectionFormatting` / `ToolbarProps` types.
|
|
3076
|
-
*/
|
|
3077
|
-
|
|
3078
3255
|
/**
|
|
3079
3256
|
* Current formatting state of the selection
|
|
3080
3257
|
*/
|
|
@@ -3139,6 +3316,7 @@ type FormattingAction = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'sup
|
|
|
3139
3316
|
};
|
|
3140
3317
|
/**
|
|
3141
3318
|
* Props for the Toolbar (formatting rail) component
|
|
3319
|
+
* @deprecated Use `DocxEditor.Toolbar` from the composition layer instead.
|
|
3142
3320
|
*/
|
|
3143
3321
|
interface ToolbarProps {
|
|
3144
3322
|
/** Current formatting of the selection */
|
|
@@ -3162,9 +3340,9 @@ interface ToolbarProps {
|
|
|
3162
3340
|
/** Whether to enable keyboard shortcuts (default: true) */
|
|
3163
3341
|
enableShortcuts?: boolean;
|
|
3164
3342
|
/** Ref to the editor container for keyboard events */
|
|
3165
|
-
editorRef?:
|
|
3343
|
+
editorRef?: RefObject<HTMLElement>;
|
|
3166
3344
|
/** Custom toolbar items to render at the end */
|
|
3167
|
-
children?:
|
|
3345
|
+
children?: DocxEditorChildren;
|
|
3168
3346
|
/** When true, renders with display:contents so children flow in the parent flex container */
|
|
3169
3347
|
inline?: boolean;
|
|
3170
3348
|
/** Whether to show font family picker (default: true) */
|
|
@@ -3302,30 +3480,197 @@ interface ToolbarGroupProps {
|
|
|
3302
3480
|
/**
|
|
3303
3481
|
* Individual toolbar button with shadcn styling
|
|
3304
3482
|
*/
|
|
3483
|
+
/** @deprecated Use `DocxEditor.Toolbar` button parts instead. */
|
|
3305
3484
|
declare function ToolbarButton({ active, disabled, title, onClick, children, className, ariaLabel, }: ToolbarButtonProps): react__default.JSX.Element;
|
|
3306
3485
|
/**
|
|
3307
3486
|
* Toolbar button group with modern styling
|
|
3308
3487
|
*/
|
|
3488
|
+
/** @deprecated Use `DocxEditor.Toolbar` group parts instead. */
|
|
3309
3489
|
declare function ToolbarGroup({ label, children, className }: ToolbarGroupProps): react__default.JSX.Element;
|
|
3310
3490
|
/**
|
|
3311
3491
|
* Icon-based formatting toolbar — undo/redo, zoom, styles, fonts,
|
|
3312
3492
|
* bold/italic/underline, colors, alignment, lists, table/image context, clear formatting.
|
|
3313
3493
|
*/
|
|
3494
|
+
/** @deprecated Use `DocxEditor.Toolbar` from the composition layer instead. */
|
|
3314
3495
|
declare function Toolbar(explicitProps: ToolbarProps): react__default.JSX.Element;
|
|
3315
3496
|
|
|
3316
3497
|
/**
|
|
3317
|
-
*
|
|
3498
|
+
* The horizontal ruler — page margins plus Word's four indent handles.
|
|
3499
|
+
*
|
|
3500
|
+
* Margins are the grey zones at either end; dragging the grey/white boundary moves them.
|
|
3501
|
+
*
|
|
3502
|
+
* The indent handles are Word's, not Google's three:
|
|
3503
|
+
*
|
|
3504
|
+
* ▽ first line at leftMargin + left + firstLine
|
|
3505
|
+
* △ hanging at leftMargin + left — drags `left`, PINS the first-line marker
|
|
3506
|
+
* ▭ left box at leftMargin + left — drags `left`, TAKES the first line with it
|
|
3507
|
+
* △ right at pageWidth - rightMargin - right
|
|
3508
|
+
*
|
|
3509
|
+
* The hanging triangle and the left box are coincident horizontally, as in Word, and are
|
|
3510
|
+
* separated vertically instead — the box sits below the strip. They differ only in what a
|
|
3511
|
+
* drag takes with them.
|
|
3512
|
+
*
|
|
3513
|
+
* All the arithmetic lives in the engine (`ruler-indent.ts`), including the snap grid and
|
|
3514
|
+
* the clamps, so this file only converts pixels to twips and paints.
|
|
3515
|
+
*/
|
|
3516
|
+
|
|
3517
|
+
/**
|
|
3518
|
+
* Section page setup as the engine reports it (`Editor.getPageSetup()`) —
|
|
3519
|
+
* page size, orientation, and margins, in twips. Derived from the contract.
|
|
3520
|
+
*/
|
|
3521
|
+
type RulerPageSetup = NonNullable<ReturnType<Editor['getPageSetup']>>;
|
|
3522
|
+
/**
|
|
3523
|
+
* A tab stop the ruler paints. `position` is twips from the left margin edge —
|
|
3524
|
+
* the same value the `removeTabMark` command takes as `positionTwips`.
|
|
3525
|
+
*/
|
|
3526
|
+
interface RulerTabStop {
|
|
3527
|
+
position: number;
|
|
3528
|
+
alignment: 'left' | 'center' | 'right' | 'decimal' | 'bar';
|
|
3529
|
+
}
|
|
3530
|
+
interface HorizontalRulerProps$1 {
|
|
3531
|
+
pageSetup?: RulerPageSetup | null;
|
|
3532
|
+
zoom?: number;
|
|
3533
|
+
/** Whether the MARGIN handles drag. */
|
|
3534
|
+
editable?: boolean;
|
|
3535
|
+
onLeftMarginChange?: (marginTwips: number) => void;
|
|
3536
|
+
onRightMarginChange?: (marginTwips: number) => void;
|
|
3537
|
+
/** Fires when a margin drag is released — the moment to commit what the drag previewed. */
|
|
3538
|
+
onMarginDragEnd?: () => void;
|
|
3539
|
+
/**
|
|
3540
|
+
* Paint the four indent handles.
|
|
3541
|
+
*
|
|
3542
|
+
* Off by default so a ruler with no paragraph context does not show handles pinned at
|
|
3543
|
+
* zero. When on they are painted whatever `indentEditable` says: Word shows the markers
|
|
3544
|
+
* on a read-only document and simply refuses the drag, and hiding them would remove the
|
|
3545
|
+
* only place a reader can see a paragraph's indents.
|
|
3546
|
+
*/
|
|
3547
|
+
showIndentHandles?: boolean;
|
|
3548
|
+
/** The paragraph's indent in twips; `firstLine` is SIGNED, negative for a hanging. */
|
|
3549
|
+
indent?: RulerIndent | null;
|
|
3550
|
+
/** Whether the INDENT handles drag — a different capability from `editable`. */
|
|
3551
|
+
indentEditable?: boolean;
|
|
3552
|
+
/** Fires continuously through an indent drag, for the host to preview. */
|
|
3553
|
+
onIndentChange?: (indent: RulerIndent) => void;
|
|
3554
|
+
/** Fires when an indent drag is released — the moment to commit one undoable step. */
|
|
3555
|
+
onIndentDragEnd?: () => void;
|
|
3556
|
+
unit?: 'inch' | 'cm';
|
|
3557
|
+
className?: string;
|
|
3558
|
+
style?: CSSProperties;
|
|
3559
|
+
tabMarks?: RulerTabStop[] | null;
|
|
3560
|
+
onTabMarkRemove?: (positionTwips: number) => void;
|
|
3561
|
+
}
|
|
3562
|
+
declare function HorizontalRuler({ pageSetup, zoom, editable, onLeftMarginChange, onRightMarginChange, onMarginDragEnd, showIndentHandles, indent, indentEditable, onIndentChange, onIndentDragEnd, unit, className, style, tabMarks, onTabMarkRemove, }: HorizontalRulerProps$1): react__default.ReactElement;
|
|
3563
|
+
|
|
3564
|
+
/**
|
|
3565
|
+
* One heading of the engine's outline (`Editor.getOutline()`): text, level,
|
|
3566
|
+
* and the block id `Editor.scrollToBlock` accepts. Derived from the contract.
|
|
3567
|
+
*/
|
|
3568
|
+
type OutlineHeading = ReturnType<Editor['getOutline']>[number];
|
|
3569
|
+
declare const OUTLINE_LEFT_OFFSET = 12;
|
|
3570
|
+
declare const OUTLINE_RESERVED_SPACE: number;
|
|
3571
|
+
declare const OUTLINE_BUTTON_LEFT_OFFSET = 12;
|
|
3572
|
+
declare const OUTLINE_BUTTON_RESERVED_SPACE: number;
|
|
3573
|
+
interface DocumentOutlineProps {
|
|
3574
|
+
headings: readonly OutlineHeading[];
|
|
3575
|
+
/** Called with the heading's block id — feed it to `Editor.scrollToBlock`. */
|
|
3576
|
+
onHeadingClick: (blockId: string) => void;
|
|
3577
|
+
onClose: () => void;
|
|
3578
|
+
topOffset?: number;
|
|
3579
|
+
/** Horizontal scroll offset of the editor — outline slides left with the doc. */
|
|
3580
|
+
scrollLeft?: number;
|
|
3581
|
+
/**
|
|
3582
|
+
* Left anchor (px) from the editor area's left edge. Defaults to
|
|
3583
|
+
* OUTLINE_LEFT_OFFSET; the host bumps it past the vertical ruler when one
|
|
3584
|
+
* is shown so the panel doesn't render on top of it.
|
|
3585
|
+
*/
|
|
3586
|
+
leftOffset?: number;
|
|
3587
|
+
}
|
|
3588
|
+
declare const DocumentOutline: react__default.NamedExoticComponent<DocumentOutlineProps>;
|
|
3589
|
+
|
|
3590
|
+
/** One tracked change as the engine reports it (`Editor.getTrackedChanges()`). */
|
|
3591
|
+
type TrackedChangeSummary = ReturnType<Editor['getTrackedChanges']>[number];
|
|
3592
|
+
interface ScrollPageInfo {
|
|
3593
|
+
currentPage: number;
|
|
3594
|
+
totalPages: number;
|
|
3595
|
+
visible: boolean;
|
|
3596
|
+
}
|
|
3597
|
+
interface HorizontalRulerProps {
|
|
3598
|
+
pageSetup: RulerPageSetup | undefined;
|
|
3599
|
+
zoom: number;
|
|
3600
|
+
unit: 'inch' | 'cm';
|
|
3601
|
+
editable: boolean;
|
|
3602
|
+
onLeftMarginChange: (marginTwips: number) => void;
|
|
3603
|
+
onRightMarginChange: (marginTwips: number) => void;
|
|
3604
|
+
tabMarks: RulerTabStop[] | null;
|
|
3605
|
+
onTabMarkRemove: (positionTwips: number) => void;
|
|
3606
|
+
}
|
|
3607
|
+
interface VerticalRulerProps$1 {
|
|
3608
|
+
pageSetup: RulerPageSetup | undefined;
|
|
3609
|
+
zoom: number;
|
|
3610
|
+
unit: 'inch' | 'cm';
|
|
3611
|
+
editable: boolean;
|
|
3612
|
+
onTopMarginChange: (marginTwips: number) => void;
|
|
3613
|
+
onBottomMarginChange: (marginTwips: number) => void;
|
|
3614
|
+
}
|
|
3615
|
+
interface OutlineProps {
|
|
3616
|
+
headings: readonly OutlineHeading[];
|
|
3617
|
+
onHeadingClick: (blockId: string) => void;
|
|
3618
|
+
onClose: () => void;
|
|
3619
|
+
topOffset: number;
|
|
3620
|
+
scrollLeft: number;
|
|
3621
|
+
}
|
|
3622
|
+
/**
|
|
3623
|
+
* Outer chrome of the editor: i18n + error provider wrappers, the
|
|
3624
|
+
* scroll container with its background-click handler, horizontal and
|
|
3625
|
+
* vertical rulers, the floating page indicator, document outline panel
|
|
3626
|
+
* + toggle button, plus slots for the toolbar, paged-area body,
|
|
3627
|
+
* overlays, dialogs, and hidden file inputs.
|
|
3318
3628
|
*
|
|
3319
|
-
*
|
|
3320
|
-
*
|
|
3321
|
-
* -
|
|
3322
|
-
* - MenuBar: File/Format/Insert menus (auto-wired from EditorToolbarContext)
|
|
3323
|
-
* - TitleBarRight: right-aligned actions slot
|
|
3629
|
+
* The expanded-sidebar-item highlight styles are computed here from
|
|
3630
|
+
* `expandedSidebarItem` + `trackedChanges` because they need to live
|
|
3631
|
+
* inside the editor-content `<div>` for proper scoping.
|
|
3324
3632
|
*/
|
|
3633
|
+
/** @deprecated Use `<DocxEditor>` from the composition layer instead. */
|
|
3634
|
+
declare function DocxEditorShell({ i18n, isDark, onEditorError, containerRef, scrollContainerRef, editorContentRef, className, containerStyle, mainContentStyle, editorContainerStyle, showRuler, readOnlyProp, showOutline, showOutlineButton, sidebarOpen, minLayoutWidth, toolbarHeight, editorScrollLeft, expandedSidebarItem, trackedChanges, onScrollContainerMouseDown, onEditorBgMouseDown, onEditorContextMenu, horizontalRulerProps, verticalRulerProps, outlineProps, onToggleOutline, scrollPageInfo, toolbar, pagedArea, overlays, dialogs, fileInputs, }: {
|
|
3635
|
+
i18n: React.ComponentProps<typeof LocaleProvider>['i18n'];
|
|
3636
|
+
isDark?: boolean;
|
|
3637
|
+
onEditorError: (error: Error) => void;
|
|
3638
|
+
containerRef: React.Ref<HTMLDivElement>;
|
|
3639
|
+
scrollContainerRef: React.Ref<HTMLDivElement>;
|
|
3640
|
+
editorContentRef: React.Ref<HTMLDivElement>;
|
|
3641
|
+
className: string | undefined;
|
|
3642
|
+
containerStyle: CSSProperties;
|
|
3643
|
+
mainContentStyle: CSSProperties;
|
|
3644
|
+
editorContainerStyle: CSSProperties;
|
|
3645
|
+
showRuler: boolean;
|
|
3646
|
+
readOnlyProp: boolean | undefined;
|
|
3647
|
+
showOutline: boolean;
|
|
3648
|
+
showOutlineButton: boolean;
|
|
3649
|
+
sidebarOpen: boolean;
|
|
3650
|
+
minLayoutWidth: number;
|
|
3651
|
+
toolbarHeight: number;
|
|
3652
|
+
editorScrollLeft: number;
|
|
3653
|
+
expandedSidebarItem: string | null;
|
|
3654
|
+
trackedChanges: readonly TrackedChangeSummary[];
|
|
3655
|
+
onScrollContainerMouseDown: (e: React.MouseEvent) => void;
|
|
3656
|
+
onEditorBgMouseDown: (e: React.MouseEvent) => void;
|
|
3657
|
+
onEditorContextMenu: (e: React.MouseEvent) => void;
|
|
3658
|
+
horizontalRulerProps: HorizontalRulerProps;
|
|
3659
|
+
verticalRulerProps: VerticalRulerProps$1;
|
|
3660
|
+
outlineProps: OutlineProps;
|
|
3661
|
+
onToggleOutline: () => void;
|
|
3662
|
+
scrollPageInfo: ScrollPageInfo;
|
|
3663
|
+
toolbar: ReactNode;
|
|
3664
|
+
pagedArea: ReactNode;
|
|
3665
|
+
overlays: ReactNode;
|
|
3666
|
+
dialogs: ReactNode;
|
|
3667
|
+
fileInputs: ReactNode;
|
|
3668
|
+
}): react.JSX.Element;
|
|
3325
3669
|
|
|
3326
3670
|
interface LogoProps {
|
|
3327
3671
|
children: ReactNode;
|
|
3328
3672
|
}
|
|
3673
|
+
/** @deprecated Use `<DocxEditor>` title slots instead. */
|
|
3329
3674
|
declare function Logo({ children }: LogoProps): react__default.JSX.Element;
|
|
3330
3675
|
interface DocumentNameProps {
|
|
3331
3676
|
value: string;
|
|
@@ -3333,11 +3678,14 @@ interface DocumentNameProps {
|
|
|
3333
3678
|
placeholder?: string;
|
|
3334
3679
|
editable?: boolean;
|
|
3335
3680
|
}
|
|
3681
|
+
/** @deprecated Use `<DocxEditor>` document name slot instead. */
|
|
3336
3682
|
declare function DocumentName({ value, onChange, placeholder, editable }: DocumentNameProps): react__default.JSX.Element;
|
|
3337
3683
|
interface TitleBarRightProps {
|
|
3338
3684
|
children: ReactNode;
|
|
3339
3685
|
}
|
|
3686
|
+
/** @deprecated Use `<DocxEditor>` title slots instead. */
|
|
3340
3687
|
declare function TitleBarRight({ children }: TitleBarRightProps): react__default.JSX.Element;
|
|
3688
|
+
/** @deprecated Use `DocxEditor.Menu` from the composition layer instead. */
|
|
3341
3689
|
declare function MenuBar(): react__default.JSX.Element;
|
|
3342
3690
|
interface TitleBarProps {
|
|
3343
3691
|
children: ReactNode;
|
|
@@ -3354,19 +3702,22 @@ interface TitleBarProps {
|
|
|
3354
3702
|
* Logo and TitleBarRight span full height. DocumentName + MenuBar
|
|
3355
3703
|
* stack vertically in the center column.
|
|
3356
3704
|
*/
|
|
3705
|
+
/** @deprecated Use `<DocxEditor>` from the composition layer instead. */
|
|
3357
3706
|
declare function TitleBar({ children }: TitleBarProps): react__default.JSX.Element;
|
|
3358
3707
|
|
|
3708
|
+
/** @public */
|
|
3709
|
+
interface PageIndicatorProps {
|
|
3710
|
+
currentPage: number;
|
|
3711
|
+
totalPages: number;
|
|
3712
|
+
visible: boolean;
|
|
3713
|
+
}
|
|
3359
3714
|
/**
|
|
3360
3715
|
* Floating page indicator shown next to the scrollbar while the user
|
|
3361
3716
|
* scrolls a multi-page document. Wrapped so the `{current} of {total}`
|
|
3362
3717
|
* template runs through `t()`; `useTranslation()` only works inside
|
|
3363
3718
|
* `<LocaleProvider>`, which `DocxEditor`'s own body is not.
|
|
3364
3719
|
*/
|
|
3365
|
-
declare function PageIndicator({ currentPage, totalPages, visible
|
|
3366
|
-
currentPage: number;
|
|
3367
|
-
totalPages: number;
|
|
3368
|
-
visible: boolean;
|
|
3369
|
-
}): react.JSX.Element;
|
|
3720
|
+
declare function PageIndicator({ currentPage, totalPages, visible }: PageIndicatorProps): react.JSX.Element;
|
|
3370
3721
|
|
|
3371
3722
|
/**
|
|
3372
3723
|
* VerticalRuler Component
|
|
@@ -3410,16 +3761,4 @@ declare function VerticalRuler({ pageSetup, zoom, editable, onTopMarginChange, o
|
|
|
3410
3761
|
*/
|
|
3411
3762
|
declare function useEditorSnapshot(editor: Editor | null): number;
|
|
3412
3763
|
|
|
3413
|
-
|
|
3414
|
-
* @docx-editor.dev/react
|
|
3415
|
-
*
|
|
3416
|
-
* React adapter for the DOCX editor. A thin renderer over the `Editor`
|
|
3417
|
-
* contract from `@docx-editor.dev/core`: it supplies DOM and paints
|
|
3418
|
-
* the engine's positioned display list, and holds no editing-engine state.
|
|
3419
|
-
*
|
|
3420
|
-
* @packageDocumentation
|
|
3421
|
-
* @public
|
|
3422
|
-
*/
|
|
3423
|
-
declare const VERSION = "0.0.2";
|
|
3424
|
-
|
|
3425
|
-
export { CONTENT_CONTROL_SLOTS, type ChromeTranslate, type ContentControlActionProps, type ContentControlInspectorState, type ContentControlLock, type ContentControlPartProps, type ContentControlProps, type ContentControlSlotId, type ContextMenuAnchor, ContextMenuCellVerticalAlignment, type ContextMenuCommandProps, ContextMenuCopy, ContextMenuCut, ContextMenuDelete, ContextMenuDeleteTable, ContextMenuDeleteTableColumn, ContextMenuDeleteTableRow, ContextMenuInsertColumnLeft, ContextMenuInsertColumnRight, ContextMenuInsertRowAbove, ContextMenuInsertRowBelow, ContextMenuItem, type ContextMenuItemProps, ContextMenuPaste, ContextMenuSelectAll, type ContextMenuTableRowProps, DocumentName, DocxEditor, DocxEditorContent, DocxEditorContentControl, type DocxEditorContentControlNamespace, type DocxEditorContentProps, DocxEditorContextMenu, type DocxEditorContextMenuNamespace, type DocxEditorContextMenuProps, DocxEditorDocumentOutline, type DocxEditorDocumentOutlineProps, DocxEditorFontNotice, type DocxEditorFontNoticeProps, DocxEditorHeaderFooterChrome, type DocxEditorHeaderFooterChromeProps, DocxEditorHorizontalRuler, DocxEditorHyperLink, type DocxEditorHyperLinkNamespace, DocxEditorImagePropertiesDialog, type DocxEditorImagePropertiesDialogProps, DocxEditorLoading, type DocxEditorLoadingComponent, type DocxEditorLoadingProps, DocxEditorLoadingSpinner, type DocxEditorLoadingSpinnerProps, DocxEditorMenu, type DocxEditorMenuNamespace, type DocxEditorMenuProps, type DocxEditorNamespace, DocxEditorNavigation, type DocxEditorNavigationNamespace, type DocxEditorNavigationProps, DocxEditorNotesChrome, type DocxEditorNotesChromeProps, DocxEditorPageSetupDialog, type DocxEditorPageSetupDialogProps, type DocxEditorProps, type DocxEditorRef, DocxEditorRoot, type DocxEditorRootProps, type DocxEditorRulerProps, DocxEditorShell, DocxEditorToolbar, type DocxEditorToolbarNamespace, type DocxEditorToolbarProps, DocxEditorVerticalRuler, DocxEditorViewport, type DocxEditorViewportProps, type DocxFontsInput, type DocxFontsSource, type DocxSource, type EditorCaret, type EditorCommandState, type EditorMode, type EditorValueCommandState, type FontFamilyItemProps, type FontFamilyNamespace, type FontFamilyPartProps, type FontFamilyProps, type FontsInput, type HeaderFooterState, HorizontalRuler, type HorizontalRulerProps$1 as HorizontalRulerProps, type HyperLinkActionProps, type HyperLinkPartProps, type HyperLinkProps, type HyperlinkPopupAnchor, type HyperlinkPopupMode, type HyperlinkPopupState, ImageAltText, ImageInsertProvider, ImageInsertTrigger, ImagePropertiesTrigger, ImageWrap, type IndentUpdate, LocaleProvider, Logo, type MenuActionProps, MenuBar, type MenuGroupProps, type MenuId, type MenuItemProps, type MenuPartComponent, type MenuProps, type MenuReportIssueProps, type MenuRowProps, type MenuSeparatorProps, type MenuSubmenuProps, type MenuTableGridProps, NAVIGATION_PANE_GAP, NAVIGATION_PANE_INSET, NAVIGATION_PANE_WIDTH, NavigationClose, NavigationFind, NavigationHeader, NavigationHeadings, type NavigationPartProps, type NavigationShiftInput, NavigationTab, type NavigationTabProps, type NavigationTab$1 as NavigationTabValue, NavigationTabs, NavigationTitle, NavigationToggle, type NormalizedImagePayload, type NotePropertiesState, type OutlineHeading$1 as OutlineHeading, type OutlineHeadingItem, PageIndicator, type PageSetupUpdate, PaginatedDocxEditor, type PaginatedDocxEditorHandle as PaginatedDocxEditorExpose, type PaginatedDocxEditorHandle, type PaginatedDocxEditorProps, PaginatedDocxEditorShell, type PaginatedDocxEditorShellProps, type ParagraphStyleItemProps, type ParagraphStyleNamespace, type ParagraphStyleOption, type ParagraphStylePartProps, type ParagraphStyleProps, RULER_WIDTH, ReviewRailContext, type ReviewRailRegistry, SEARCH_DEBOUNCE_MS, SEARCH_MATCH_LIMIT, Slot, type SlotProps, type TableBorderColorNamespace, type TableBorderStyleNamespace, type TableBorderTargetNamespace, type TableBorderWidthNamespace, type TableCellFillNamespace, type TableChromeItemProps, type TableChromePartComponent, type TableChromePartProps, TitleBar, TitleBarRight, Toolbar, type ToolbarActionProps, type ToolbarAlignmentComponent, ToolbarButton, type ToolbarButtonProps$1 as ToolbarButtonProps, ToolbarGroup, type ToolbarPartComponent, type ToolbarPartProps, type ToolbarProps, type ToolbarSeparatorProps, type ToolbarSlotPartComponent, type ToolbarSlotPartProps, type ToolbarTranslate, type UseContentControlResult, type UseDocumentOutlineResult, type UseDocumentSearchResult, type UseDocxSourceOptions, type UseDocxSourceResult, type UseFontFamilyResult, type UseHyperlinkPopupResult, type UseNavigationPaneOptions, type UseNavigationPaneResult, type UsePageSetupReturn, type UseParagraphIndentReturn, type UseParagraphStyleResult, type UseZoomResult, VERSION, VerticalRuler, type VerticalRulerProps, navigationPaneReservation, navigationShift, normalizeImageBytes, useChromeTranslate, useContentControl, useContentControlInstance, useContextMenuTarget, useDocumentOutline, useDocumentSearch, useDocxEditor, useDocxSource, useEditorCaret, useEditorCommand, useEditorEvent, useEditorSnapshot, useEditorState, useEditorValueCommand, useFontFamily, useFonts, useHeaderFooterState, useHyperlinkPopup, useHyperlinkPopupInstance, useNavigationPane, useNavigationShift, useNotePropertiesState, useNoteScopeState, usePageSetup, useParagraphIndent, useParagraphStyle, useTableBorderTargetLabel, useTranslation, useZoom };
|
|
3764
|
+
export { CONTENT_CONTROL_SLOTS, type ChromeTranslate, type ContentControlActionProps, type ContentControlInspectorState, type ContentControlLock, type ContentControlPartProps, type ContentControlProps, type ContentControlSlotId, type ContextMenuAnchor, ContextMenuCellVerticalAlignment, type ContextMenuCommandProps, type ContextMenuContextValue, ContextMenuCopy, ContextMenuCut, ContextMenuDelete, ContextMenuDeleteTable, ContextMenuDeleteTableColumn, ContextMenuDeleteTableRow, ContextMenuInsertColumnLeft, ContextMenuInsertColumnRight, ContextMenuInsertRowAbove, ContextMenuInsertRowBelow, ContextMenuItem, type ContextMenuItemProps, ContextMenuPaste, ContextMenuRefreshToc, ContextMenuRefreshTocPageNumbers, ContextMenuSelectAll, type ContextMenuTableRowProps, DocumentName, DocumentOutline, DocxEditor, DocxEditorAuthorStyle, type DocxEditorAuthorStyleProps, type DocxEditorChildren, DocxEditorColorByChangeType, DocxEditorContent, DocxEditorContentControl, type DocxEditorContentControlNamespace, type DocxEditorContentProps, DocxEditorContextMenu, type DocxEditorContextMenuNamespace, type DocxEditorContextMenuProps, DocxEditorDocumentOutline, type DocxEditorDocumentOutlineProps, DocxEditorFontNotice, type DocxEditorFontNoticeProps, DocxEditorHeaderFooterChrome, type DocxEditorHeaderFooterChromeProps, DocxEditorHorizontalRuler, DocxEditorHyperLink, type DocxEditorHyperLinkNamespace, DocxEditorImagePropertiesDialog, type DocxEditorImagePropertiesDialogProps, DocxEditorLoading, type DocxEditorLoadingComponent, type DocxEditorLoadingProps, DocxEditorLoadingSpinner, type DocxEditorLoadingSpinnerProps, DocxEditorMenu, type DocxEditorMenuNamespace, type DocxEditorMenuProps, type DocxEditorNamespace, DocxEditorNavigation, type DocxEditorNavigationNamespace, type DocxEditorNavigationProps, DocxEditorNotesChrome, type DocxEditorNotesChromeProps, DocxEditorPageNumber, type DocxEditorPageNumberProps, DocxEditorPageSetupDialog, type DocxEditorPageSetupDialogProps, type DocxEditorProps, type DocxEditorRef, DocxEditorRoot, type DocxEditorRootListeners, type DocxEditorRootProps, type DocxEditorRulerProps, DocxEditorShell, DocxEditorToolbar, type DocxEditorToolbarNamespace, type DocxEditorToolbarProps, DocxEditorVerticalRuler, DocxEditorViewport, type DocxEditorViewportProps, type DocxFontsInput, type DocxFontsSource, type DocxSource, type EditorCaret, type EditorCommandState, type EditorMode, type EditorValueCommandState, type FontFamilyItemProps, type FontFamilyNamespace, type FontFamilyPartProps, type FontFamilyProps, type FontsInput, type HeaderFooterState, HorizontalRuler, type HorizontalRulerProps$1 as HorizontalRulerProps, type HyperLinkActionProps, type HyperLinkPartProps, type HyperLinkProps, type HyperlinkPopupAnchor, type HyperlinkPopupMode, type HyperlinkPopupState, ImageAltText, ImageInsertProvider, ImageInsertTrigger, ImagePropertiesTrigger, type ImagePropertiesTriggerProps, ImageWrap, type IndentUpdate, LocaleProvider, type LocaleProviderProps, Logo, type MaybeRefOrGetter, type MenuActionProps, MenuBar, type MenuGroupProps, type MenuId, type MenuItemProps, type MenuPartComponent, type MenuProps, type MenuReportIssueProps, type MenuRowProps, type MenuSeparatorProps, type MenuSubmenuProps, type MenuTableGridProps, NAVIGATION_PANE_GAP, NAVIGATION_PANE_INSET, NAVIGATION_PANE_WIDTH, NavigationClose, NavigationFind, NavigationHeader, NavigationHeadings, type NavigationPartProps, type NavigationShiftInput, NavigationTab, type NavigationTabProps, type NavigationTab$1 as NavigationTabValue, NavigationTabs, NavigationTitle, NavigationToggle, type NormalizedImagePayload, type NotePropertiesState, OUTLINE_BUTTON_LEFT_OFFSET, OUTLINE_BUTTON_RESERVED_SPACE, OUTLINE_LEFT_OFFSET, OUTLINE_RESERVED_SPACE, type OutlineHeading$1 as OutlineHeading, type OutlineHeadingItem, PageIndicator, type PageIndicatorProps, PageNumberTranslationContext, type PageSetupUpdate, PaginatedDocxEditor, type PaginatedDocxEditorExpose, type PaginatedDocxEditorHandle, type PaginatedDocxEditorProps, PaginatedDocxEditorShell, type PaginatedDocxEditorShellProps, type ParagraphStyleItemProps, type ParagraphStyleNamespace, type ParagraphStyleOption, type ParagraphStylePartProps, type ParagraphStyleProps, type ProvideDocxEditorResult, REVIEW_MARKERS_GUTTER, REVIEW_PANE_GUTTER, RULER_WIDTH, type ReviewGutter, type ReviewGutterInput, ReviewRailContext, type ReviewRailRegistry, SEARCH_DEBOUNCE_MS, SEARCH_MATCH_LIMIT, type ScopedChromeAnchor, Slot, type SlotProps, type TableBorderColorNamespace, type TableBorderStyleNamespace, type TableBorderTargetNamespace, type TableBorderWidthNamespace, type TableCellFillNamespace, type TableChromeItemProps, type TableChromePartComponent, type TableChromePartProps, TitleBar, TitleBarRight, Toolbar, type ToolbarActionProps, type ToolbarAlignmentComponent, ToolbarButton, type ToolbarButtonProps$1 as ToolbarButtonProps, ToolbarContext, type ToolbarContextValue, ToolbarGroup, ToolbarImageProperties, type ToolbarPartComponent, type ToolbarPartProps, type ToolbarProps, type ToolbarSeparatorProps, type ToolbarSlotPartComponent, type ToolbarSlotPartProps, type ToolbarTranslate, type UseContentControlResult, type UseDocumentOutlineResult, type UseDocumentSearchResult, type UseDocxSourceOptions, type UseDocxSourceResult, type UseFontFamilyResult, type UseHyperlinkPopupResult, type UseNavigationPaneOptions, type UseNavigationPaneResult, type UsePageSetupReturn, type UseParagraphIndentReturn, type UseParagraphStyleResult, type UseZoomResult, VERSION, VerticalRuler, type VerticalRulerProps, editorStateActiveSubscriptionCount, isFieldLink, navigationPaneReservation, navigationShift, normalizeImageBytes, useProvidedDocxEditor as provideDocxEditor, reviewGutter, useChromeTranslate, useContentControl, useContentControlInstance, useContextMenuTarget, useDocumentOutline, useDocumentSearch, useDocxEditor, useDocxSource, useEditorCaret, useEditorCommand, useEditorEvent, useEditorSnapshot, useEditorState, useEditorValueCommand, useFontFamily, useFonts, useHeaderFooterState, useHyperlinkPopup, useHyperlinkPopupInstance, useNavigationPane, useNavigationShift, useNotePropertiesState, useNoteScopeState, usePageSetup, useParagraphIndent, useParagraphStyle, useReviewAuthors, useReviewGutter, useScopeClassName, useScopedChromeAnchor, useTableBorderTargetLabel, useToolbarContext, useToolbarLabel, useToolbarLabelFor, useTranslation, useZoom };
|