@stll/folio-vue 0.2.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/ListButtons-B498PX1d.js +4256 -0
- package/dist/ListButtons-D-zMJ7rl.cjs +4 -0
- package/dist/PageSetupDialog-CGBaBVzo.cjs +15 -0
- package/dist/PageSetupDialog-DsjAfJy0.js +4873 -0
- package/dist/TablePropertiesDialog-A-1Pm1f9.cjs +1 -0
- package/dist/TablePropertiesDialog-PyXEJC_o.js +887 -0
- package/dist/components/DocxEditor/pagedEditorRef.d.ts +75 -0
- package/dist/components/DocxEditor/types.d.ts +528 -0
- package/dist/components/EditorToolbarContext.d.ts +9 -0
- package/dist/components/FormattingBar.types.d.ts +67 -0
- package/dist/components/Toolbar/presets.d.ts +25 -0
- package/dist/components/dialogs/index.d.ts +24 -0
- package/dist/components/imageContextMenuTypes.d.ts +30 -0
- package/dist/components/imageSelectionTypes.d.ts +13 -0
- package/dist/components/insertTableState.d.ts +9 -0
- package/dist/components/sidebar/cardStyles.d.ts +1 -0
- package/dist/components/sidebar/cardUtils.d.ts +1 -0
- package/dist/components/sidebar/resolveItemPositions.d.ts +22 -0
- package/dist/components/sidebar/sidebarUtils.d.ts +4 -0
- package/dist/components/tableStylePresets.d.ts +60 -0
- package/dist/components/toolbarUtils.d.ts +3 -0
- package/dist/components/ui/AlignmentButtons.types.d.ts +13 -0
- package/dist/components/ui/StylePicker.types.d.ts +16 -0
- package/dist/components/ui/ZoomControl.types.d.ts +21 -0
- package/dist/components/ui/fontPickerValue.d.ts +1 -0
- package/dist/components/ui/hyperlinkPopupTypes.d.ts +20 -0
- package/dist/composables/commentMarks.d.ts +32 -0
- package/dist/composables/imageOverlayRect.d.ts +44 -0
- package/dist/composables/index.d.ts +30 -0
- package/dist/composables/useAutoSave.d.ts +39 -0
- package/dist/composables/useClipboard.d.ts +21 -0
- package/dist/composables/useColorMode.d.ts +8 -0
- package/dist/composables/useCommentLifecycle.d.ts +39 -0
- package/dist/composables/useCommentManagement.d.ts +47 -0
- package/dist/composables/useCommentSidebarItems.d.ts +24 -0
- package/dist/composables/useContextMenus.d.ts +64 -0
- package/dist/composables/useControllableBoolean.d.ts +16 -0
- package/dist/composables/useDocumentLifecycle.d.ts +11 -0
- package/dist/composables/useDocxEditor.d.ts +123 -0
- package/dist/composables/useDocxEditorRefApi.d.ts +68 -0
- package/dist/composables/useDragAutoScroll.d.ts +11 -0
- package/dist/composables/useFileIO.d.ts +43 -0
- package/dist/composables/useFindReplace.d.ts +22 -0
- package/dist/composables/useFixedDropdown.d.ts +14 -0
- package/dist/composables/useFormattingActions.d.ts +21 -0
- package/dist/composables/useHistory.d.ts +9 -0
- package/dist/composables/useHostCallbacks.d.ts +24 -0
- package/dist/composables/useHyperlinkManagement.d.ts +40 -0
- package/dist/composables/useImageActions.d.ts +25 -0
- package/dist/composables/useKeyboardShortcuts.d.ts +25 -0
- package/dist/composables/useMenuActions.d.ts +36 -0
- package/dist/composables/useOutlineSidebar.d.ts +24 -0
- package/dist/composables/usePageSetupControls.d.ts +28 -0
- package/dist/composables/usePagesPointer.d.ts +87 -0
- package/dist/composables/useParagraphStyleOptions.d.ts +18 -0
- package/dist/composables/usePortalClass.d.ts +8 -0
- package/dist/composables/useSelectionHighlight.d.ts +19 -0
- package/dist/composables/useSelectionSync.d.ts +30 -0
- package/dist/composables/useTableResize.d.ts +7 -0
- package/dist/composables/useTableSelection.d.ts +10 -0
- package/dist/composables/useToolbarDropdowns.d.ts +15 -0
- package/dist/composables/useToolbarFontSize.d.ts +15 -0
- package/dist/composables/useTrackedChanges.d.ts +12 -0
- package/dist/composables/useVisualLineNavigation.d.ts +11 -0
- package/dist/composables/useWheelZoom.d.ts +10 -0
- package/dist/composables/useZoom.d.ts +16 -0
- package/dist/composables.cjs +61 -0
- package/dist/composables.js +378 -0
- package/dist/dialogs.cjs +1 -0
- package/dist/dialogs.js +3 -0
- package/dist/folio-vue.css +2 -0
- package/dist/i18n/index.d.ts +36 -0
- package/dist/i18n/messages.d.ts +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.js +4088 -0
- package/dist/messages.cjs +1 -0
- package/dist/messages.js +1 -0
- package/dist/renderAsync.d.ts +35 -0
- package/dist/styles/index.d.ts +12 -0
- package/dist/styles/zIndex.d.ts +18 -0
- package/dist/styles.cjs +1 -0
- package/dist/styles.js +5 -0
- package/dist/ui/folio-ui.d.ts +139 -0
- package/dist/ui.cjs +1 -0
- package/dist/ui.d.ts +67 -0
- package/dist/ui.js +446 -0
- package/dist/useZoom-BryUw3Cu.cjs +1 -0
- package/dist/useZoom-CIIRid8U.js +626 -0
- package/dist/utils/aiEditRange.d.ts +26 -0
- package/dist/utils/autoScroll.d.ts +22 -0
- package/dist/utils/cardStyles.d.ts +3 -0
- package/dist/utils/colorMode.d.ts +32 -0
- package/dist/utils/comments.d.ts +20 -0
- package/dist/utils/cssTypes.d.ts +7 -0
- package/dist/utils/domQueries.d.ts +39 -0
- package/dist/utils/fontOptions.d.ts +26 -0
- package/dist/utils/hostFonts.d.ts +25 -0
- package/dist/utils/imageClipboard.d.ts +9 -0
- package/dist/utils/index.d.ts +13 -0
- package/dist/utils/listState.d.ts +22 -0
- package/dist/utils/reportIssue.d.ts +18 -0
- package/dist/utils/selectionHighlight.d.ts +44 -0
- package/dist/utils/sidebarConstants.d.ts +8 -0
- package/dist/utils/stylePreview.d.ts +53 -0
- package/dist/utils/textSelection.d.ts +40 -0
- package/dist/zIndex-BY0qa8Au.js +12 -0
- package/dist/zIndex-dFsQbASx.cjs +1 -0
- package/package.json +99 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { EditorState, Transaction } from 'prosemirror-state';
|
|
2
|
+
import { EditorView } from 'prosemirror-view';
|
|
3
|
+
import { FolioEditor } from '@stll/folio-core/controller/folioEditor';
|
|
4
|
+
import { Layout } from '@stll/folio-core/layout-engine';
|
|
5
|
+
import { ScrollToParaIdOptions } from '@stll/folio-core/paged-layout/paragraphFlash';
|
|
6
|
+
import { Document } from '@stll/folio-core/types/document';
|
|
7
|
+
/**
|
|
8
|
+
* Imperative handle exposed by the Vue paged editor sub-component.
|
|
9
|
+
*
|
|
10
|
+
* Structurally mirrors the React package's `PagedEditorRef`
|
|
11
|
+
* (`packages/react/src/paged-editor/PagedEditor.tsx`). The Vue PagedEditor
|
|
12
|
+
* component itself is not ported yet; this type defines the contract so
|
|
13
|
+
* `DocxEditorRef.getEditorRef()` can return it.
|
|
14
|
+
*
|
|
15
|
+
* TODO(vue): re-home to the Vue PagedEditor component when it lands.
|
|
16
|
+
*/
|
|
17
|
+
export type PagedEditorRef = {
|
|
18
|
+
/** The headless editor controller (imperative API + events; Seam 6). */
|
|
19
|
+
getEditor: () => FolioEditor;
|
|
20
|
+
/** Get the current document. */
|
|
21
|
+
getDocument: () => Document | null;
|
|
22
|
+
/** Get the ProseMirror EditorState. */
|
|
23
|
+
getState: () => EditorState | null;
|
|
24
|
+
/** Get the ProseMirror EditorView. */
|
|
25
|
+
getView: () => EditorView | null;
|
|
26
|
+
/**
|
|
27
|
+
* Look up the persistent hidden HF EditorView by `rId`. Returns null when the
|
|
28
|
+
* slot isn't mounted (no HF for that rId, or the hidden host hasn't mounted).
|
|
29
|
+
*/
|
|
30
|
+
getHfView: (rId: string) => EditorView | null;
|
|
31
|
+
/**
|
|
32
|
+
* Force-create the hidden editor view if it has been deferred. Use from
|
|
33
|
+
* surfaces that need a live view before any user interaction.
|
|
34
|
+
*/
|
|
35
|
+
ensureView: (options?: {
|
|
36
|
+
focus?: boolean;
|
|
37
|
+
}) => void;
|
|
38
|
+
/** Focus the editor. */
|
|
39
|
+
focus: () => void;
|
|
40
|
+
/** Blur the editor. */
|
|
41
|
+
blur: () => void;
|
|
42
|
+
/** Check if focused. */
|
|
43
|
+
isFocused: () => boolean;
|
|
44
|
+
/** Dispatch a transaction. */
|
|
45
|
+
dispatch: (tr: Transaction) => void;
|
|
46
|
+
/** Undo. */
|
|
47
|
+
undo: () => boolean;
|
|
48
|
+
/** Redo. */
|
|
49
|
+
redo: () => boolean;
|
|
50
|
+
/** Check whether undo is available. */
|
|
51
|
+
canUndo: () => boolean;
|
|
52
|
+
/** Check whether redo is available. */
|
|
53
|
+
canRedo: () => boolean;
|
|
54
|
+
/** Set selection by PM position. */
|
|
55
|
+
setSelection: (anchor: number, head?: number) => void;
|
|
56
|
+
/** Get current layout. */
|
|
57
|
+
getLayout: () => Layout | null;
|
|
58
|
+
/** Force re-layout. */
|
|
59
|
+
relayout: () => void;
|
|
60
|
+
/** Scroll the visible pages to bring a PM position into view. */
|
|
61
|
+
scrollToPosition: (pmPos: number) => void;
|
|
62
|
+
/** Scroll the visible pages to bring a page into view. */
|
|
63
|
+
scrollToPage: (pageNumber: number) => void;
|
|
64
|
+
/**
|
|
65
|
+
* Scroll the paginated view to the paragraph with the given Word `w14:paraId`.
|
|
66
|
+
* Returns whether a matching paragraph exists in the ProseMirror document.
|
|
67
|
+
*/
|
|
68
|
+
scrollToParaId: (paraId: string, options?: ScrollToParaIdOptions) => boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Resolve the page number (1-indexed) that contains the given PM position, or
|
|
71
|
+
* null if no layout is available yet. Works for unrendered pages too via the
|
|
72
|
+
* page shell map.
|
|
73
|
+
*/
|
|
74
|
+
getPageNumberForPmPos: (pmPos: number) => number | null;
|
|
75
|
+
};
|
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
import { CSSProperties, VNodeChild } from 'vue';
|
|
2
|
+
import { Plugin } from 'prosemirror-state';
|
|
3
|
+
import { EditorView } from 'prosemirror-view';
|
|
4
|
+
import { XmlFragment } from 'yjs';
|
|
5
|
+
import { FolioAIEditApplyMode, FolioAIEditApplyResult, FolioAIEditOperation, FolioAIEditSnapshot } from '@stll/folio-core/ai-edits';
|
|
6
|
+
import { ContentControlFilter, SetContentControlContentInput, SetContentControlValueInput } from '@stll/folio-core/content-controls';
|
|
7
|
+
import { FolioEditor } from '@stll/folio-core/controller/folioEditor';
|
|
8
|
+
import { DocxCompatibility } from '@stll/folio-core/docx/compatibility';
|
|
9
|
+
import { FolioSelectiveSaveFlags } from '@stll/folio-core/docx/selectiveSaveFlags';
|
|
10
|
+
import { TripwireResult } from '@stll/folio-core/docx/selectiveSaveTripwire';
|
|
11
|
+
import { SelectionState, TableContextInfo } from '@stll/folio-core/prosemirror';
|
|
12
|
+
import { AnonymizationMatch } from '@stll/folio-core/prosemirror/plugins/anonymizationDecorations';
|
|
13
|
+
import { TemplateSlashMenuKeyAction, TemplateSlashMenuState } from '@stll/folio-core/prosemirror/plugins/templateSlashMenu';
|
|
14
|
+
import { Document, ParagraphAlignment, SdtProperties, TabStop, Theme } from '@stll/folio-core/types/document';
|
|
15
|
+
import { Comment } from '@stll/folio-core/types/content';
|
|
16
|
+
import { DocxInput } from '@stll/folio-core/utils/docxInput';
|
|
17
|
+
import { ScrollToParaIdOptions } from '@stll/folio-core/paged-layout/paragraphFlash';
|
|
18
|
+
import { EditorMode } from '@stll/folio-core/managers/EditorModeManager';
|
|
19
|
+
import { DocumentLoadState } from '@stll/folio-core/managers/DocumentLoaderManager';
|
|
20
|
+
import { FolioUIComponents } from '../../ui/folio-ui';
|
|
21
|
+
import { FontOption } from '../../utils/fontOptions';
|
|
22
|
+
import { PagedEditorRef } from './pagedEditorRef';
|
|
23
|
+
export type { EditorMode };
|
|
24
|
+
/**
|
|
25
|
+
* Declarative description of one custom font face the host registers with the
|
|
26
|
+
* editor (the `fonts` prop). Multiple entries can share `family` for weights.
|
|
27
|
+
*
|
|
28
|
+
* TODO(vue): move to fontLoader when it lands (mirrors React's
|
|
29
|
+
* `packages/react/src/paged-editor/hostFonts` `FontDefinition`).
|
|
30
|
+
*/
|
|
31
|
+
export type FontDefinition = {
|
|
32
|
+
/** CSS `font-family` name to expose; match the family your documents reference. */
|
|
33
|
+
family: string;
|
|
34
|
+
/** URL to the font file (woff2, woff, ttf, or otf). */
|
|
35
|
+
src: string;
|
|
36
|
+
/** CSS `font-weight` for this face (a number like `700`, or a keyword). Defaults to `normal`. */
|
|
37
|
+
weight?: number | string;
|
|
38
|
+
};
|
|
39
|
+
/** Image context surfaced to the toolbar when the cursor is on an image node. */
|
|
40
|
+
export type ImageContextInfo = {
|
|
41
|
+
pos: number;
|
|
42
|
+
wrapType: string;
|
|
43
|
+
displayMode: string;
|
|
44
|
+
cssFloat: string | null;
|
|
45
|
+
transform: string | null;
|
|
46
|
+
alt: string | null;
|
|
47
|
+
borderWidth: number | null;
|
|
48
|
+
borderColor: string | null;
|
|
49
|
+
borderStyle: string | null;
|
|
50
|
+
};
|
|
51
|
+
/** Tracked-change context surfaced to the contextual review toolbar. */
|
|
52
|
+
export type ActiveTrackedChangeInfo = {
|
|
53
|
+
type: "insertion" | "deletion";
|
|
54
|
+
author: string;
|
|
55
|
+
date: string | null;
|
|
56
|
+
from: number;
|
|
57
|
+
to: number;
|
|
58
|
+
};
|
|
59
|
+
export type DocxEditorProps = {
|
|
60
|
+
/** Document data — ArrayBuffer, Uint8Array, Blob, or File */
|
|
61
|
+
documentBuffer?: DocxInput | null;
|
|
62
|
+
/** Pre-parsed document (alternative to documentBuffer) */
|
|
63
|
+
document?: Document | null;
|
|
64
|
+
/**
|
|
65
|
+
* Stable identity of the loaded document (same across internal edits, distinct
|
|
66
|
+
* per loaded file). Distinguishes a genuine external load from an edited
|
|
67
|
+
* document round-tripped back through state. Falls back to a document-metadata
|
|
68
|
+
* signature when omitted.
|
|
69
|
+
*/
|
|
70
|
+
documentKey?: string;
|
|
71
|
+
/** Callback when document is saved */
|
|
72
|
+
onSave?: (buffer: ArrayBuffer) => void;
|
|
73
|
+
/** Author name used for comments and track changes */
|
|
74
|
+
author?: string;
|
|
75
|
+
/** Callback when document changes */
|
|
76
|
+
onChange?: (document: Document) => void;
|
|
77
|
+
/** Callback when selection changes */
|
|
78
|
+
onSelectionChange?: (state: SelectionState | null) => void;
|
|
79
|
+
/**
|
|
80
|
+
* Fired with the resolved PM positions and selected plain text on every
|
|
81
|
+
* selection-bearing transaction. Atom inline nodes (tab, hard_break) collapse
|
|
82
|
+
* to a single space; empty string when the selection is collapsed.
|
|
83
|
+
*/
|
|
84
|
+
onSelectionTextChange?: (selection: {
|
|
85
|
+
from: number;
|
|
86
|
+
to: number;
|
|
87
|
+
text: string;
|
|
88
|
+
}) => void;
|
|
89
|
+
/** Callback on error */
|
|
90
|
+
onError?: (error: Error) => void;
|
|
91
|
+
/** Callback when fonts are loaded */
|
|
92
|
+
onFontsLoaded?: () => void;
|
|
93
|
+
/**
|
|
94
|
+
* Custom families shown in the toolbar's font-family dropdown. Strings render
|
|
95
|
+
* as plain names; pass `FontOption` objects for a CSS fallback chain and
|
|
96
|
+
* category grouping. Omit for folio's defaults; an empty array renders an
|
|
97
|
+
* empty (but enabled) dropdown. Pass a stable reference.
|
|
98
|
+
*/
|
|
99
|
+
fontFamilies?: ReadonlyArray<string | FontOption>;
|
|
100
|
+
/**
|
|
101
|
+
* Custom font faces the host registers with the browser so runs render in
|
|
102
|
+
* them. Each entry injects one face; multiple entries can share `family` for
|
|
103
|
+
* different weights. Registration is best-effort (a malformed entry is
|
|
104
|
+
* skipped). Match `family` to the applied `fontFamilies` name. Pass a stable
|
|
105
|
+
* reference.
|
|
106
|
+
*/
|
|
107
|
+
fonts?: ReadonlyArray<FontDefinition>;
|
|
108
|
+
/** Theme for styling */
|
|
109
|
+
theme?: Theme | null;
|
|
110
|
+
/** Whether to show toolbar (default: true) */
|
|
111
|
+
showToolbar?: boolean;
|
|
112
|
+
/** Whether to show zoom control (default: true) */
|
|
113
|
+
showZoomControl?: boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Whether to show the review controls — the track-changes toggle and the
|
|
116
|
+
* markup display-mode selector (default: true). Turn off for plain-markdown
|
|
117
|
+
* editing, where tracked changes and markup views are meaningless.
|
|
118
|
+
*/
|
|
119
|
+
showReviewControls?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Whether the page header/footer can be edited — double-click-to-edit and the
|
|
122
|
+
* hover hints (default: true). Turn off for plain-markdown editing, which has
|
|
123
|
+
* no running header/footer.
|
|
124
|
+
*/
|
|
125
|
+
showHeaderFooterEditing?: boolean;
|
|
126
|
+
/** Whether to show page margin guides/boundaries (default: false) */
|
|
127
|
+
showMarginGuides?: boolean;
|
|
128
|
+
/** Color for margin guides (default: '#c0c0c0') */
|
|
129
|
+
marginGuideColor?: string;
|
|
130
|
+
/**
|
|
131
|
+
* Whether the rulers start visible (default: false). Seeds the toolbar's
|
|
132
|
+
* ruler toggle; users show/hide the rulers at runtime (like Word's
|
|
133
|
+
* View > Ruler).
|
|
134
|
+
*/
|
|
135
|
+
showRuler?: boolean;
|
|
136
|
+
/** Measurement unit shown on the rulers (default: 'inch'). */
|
|
137
|
+
rulerUnit?: "inch" | "cm";
|
|
138
|
+
/** Initial zoom level (default: 1.0) */
|
|
139
|
+
initialZoom?: number;
|
|
140
|
+
/** Whether Ctrl/Cmd+wheel and trackpad-pinch zoom are enabled (default: true) */
|
|
141
|
+
enableWheelZoom?: boolean;
|
|
142
|
+
/** Whether the editor is read-only. When true, hides toolbar and rulers */
|
|
143
|
+
readOnly?: boolean;
|
|
144
|
+
/** Whether comments/tracked changes should auto-open the review sidebar (default: true) */
|
|
145
|
+
autoOpenReviewSidebar?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Override folio's built-in chrome UI primitives (Button, …) with a
|
|
148
|
+
* consumer's design-system components. Omitted entries fall back to folio's
|
|
149
|
+
* defaults, so standalone folio works without any injection.
|
|
150
|
+
*/
|
|
151
|
+
components?: Partial<FolioUIComponents>;
|
|
152
|
+
/** Custom toolbar actions */
|
|
153
|
+
toolbarExtra?: VNodeChild;
|
|
154
|
+
/** Additional CSS class name */
|
|
155
|
+
className?: string;
|
|
156
|
+
/** Additional inline styles */
|
|
157
|
+
style?: CSSProperties;
|
|
158
|
+
/** Placeholder when no document */
|
|
159
|
+
placeholder?: VNodeChild;
|
|
160
|
+
/** Loading indicator */
|
|
161
|
+
loadingIndicator?: VNodeChild;
|
|
162
|
+
/** Keep the current parsed document visible while a new buffer is loading. */
|
|
163
|
+
preserveDocumentWhileLoading?: boolean;
|
|
164
|
+
/** Initial scroll offset for the editor's document scroll container. */
|
|
165
|
+
initialScrollTop?: number;
|
|
166
|
+
/** Callback when the editor's document scroll container scrolls. */
|
|
167
|
+
onScrollTopChange?: (scrollTop: number) => void;
|
|
168
|
+
/** Whether to show the document outline sidebar (default: false) */
|
|
169
|
+
showOutline?: boolean;
|
|
170
|
+
/** Whether to show print button in toolbar (default: true) */
|
|
171
|
+
showPrintButton?: boolean;
|
|
172
|
+
/** Callback when print is triggered */
|
|
173
|
+
onPrint?: () => void;
|
|
174
|
+
/**
|
|
175
|
+
* Insert controls are opt-in: each renders only when its handler is provided
|
|
176
|
+
* (and, for tables, `showTableInsert` is not false). Omit a handler to keep
|
|
177
|
+
* that control out of the toolbar. Wire to the view-level helpers exported
|
|
178
|
+
* from the package (`insertTableInView`, `insertPageBreakInView`,
|
|
179
|
+
* `insertTableOfContentsInView`, `insertImageFromFile`).
|
|
180
|
+
*/
|
|
181
|
+
onInsertImage?: (() => void) | undefined;
|
|
182
|
+
/** Insert a `rows × columns` table at the current selection. */
|
|
183
|
+
onInsertTable?: ((rows: number, columns: number) => void) | undefined;
|
|
184
|
+
/** Whether the Insert Table control is shown when `onInsertTable` is set (default: true). */
|
|
185
|
+
showTableInsert?: boolean | undefined;
|
|
186
|
+
/** Insert a page break at the current selection. */
|
|
187
|
+
onInsertPageBreak?: (() => void) | undefined;
|
|
188
|
+
/** Insert a table of contents generated from the document's headings. */
|
|
189
|
+
onInsertTOC?: (() => void) | undefined;
|
|
190
|
+
/** Callback when content is copied */
|
|
191
|
+
onCopy?: () => void;
|
|
192
|
+
/** Callback when content is cut */
|
|
193
|
+
onCut?: () => void;
|
|
194
|
+
/** Callback when content is pasted */
|
|
195
|
+
onPaste?: () => void;
|
|
196
|
+
/** Editor mode: 'editing' (direct edits), 'suggesting' (track changes), or 'viewing' (read-only). Default: 'editing' */
|
|
197
|
+
mode?: EditorMode;
|
|
198
|
+
/** Callback when the editing mode changes */
|
|
199
|
+
onModeChange?: (mode: EditorMode) => void;
|
|
200
|
+
/** Callback when a readonly user action would mutate the document. */
|
|
201
|
+
onReadonlyEditAttempt?: () => void;
|
|
202
|
+
/**
|
|
203
|
+
* Controlled comments array. When provided, the editor reads comment thread
|
|
204
|
+
* metadata from this prop and emits every change through `onCommentsChange`.
|
|
205
|
+
* Use with collaboration backends (Yjs, etc.); PM carries range markers,
|
|
206
|
+
* thread metadata lives outside the doc.
|
|
207
|
+
*/
|
|
208
|
+
comments?: Comment[];
|
|
209
|
+
/** Fires whenever the comments array changes (controlled and uncontrolled). */
|
|
210
|
+
onCommentsChange?: (comments: Comment[]) => void;
|
|
211
|
+
/** Callback with the parsed document's editing compatibility report. */
|
|
212
|
+
onCompatibilityChange?: (compatibility: DocxCompatibility) => void;
|
|
213
|
+
/**
|
|
214
|
+
* Fires when the live ProseMirror view is captured (or torn down). The host
|
|
215
|
+
* wires this to drive the AI suggestion overlay (decoration meta, apply,
|
|
216
|
+
* scroll-to) from outside the editor.
|
|
217
|
+
*/
|
|
218
|
+
onEditorViewReady?: (view: EditorView | null) => void;
|
|
219
|
+
/** Yjs-backed collaboration owner. Experimental and opt-in. */
|
|
220
|
+
collaboration?: DocxEditorCollaboration | undefined;
|
|
221
|
+
/**
|
|
222
|
+
* Fires with the current anonymization match list every time the decoration
|
|
223
|
+
* plugin recomputes it (mount, term push, doc edit, async DOCX load). The
|
|
224
|
+
* host mirrors per-document counts and "matching workspace terms" to the
|
|
225
|
+
* inspector facet without polling the plugin state.
|
|
226
|
+
*/
|
|
227
|
+
onAnonymizationMatchesChange?: (matches: readonly AnonymizationMatch[]) => void;
|
|
228
|
+
/**
|
|
229
|
+
* Fires when the user clicks an anonymization highlight in the rendered
|
|
230
|
+
* document. Hosts push the selection into a sidebar bridge so the inspector
|
|
231
|
+
* facet can scroll/flash the matching row.
|
|
232
|
+
*/
|
|
233
|
+
onAnonymizationTermClick?: ((canonical: string, label: string) => void) | undefined;
|
|
234
|
+
/**
|
|
235
|
+
* Canonical to mark as selected in the rendered document. The first matching
|
|
236
|
+
* rect scrolls into view whenever `anonymizationSelectionSeq` increments (so
|
|
237
|
+
* repeated sidebar clicks of the same term re-trigger the scroll).
|
|
238
|
+
*/
|
|
239
|
+
selectedAnonymizationCanonical?: string | null | undefined;
|
|
240
|
+
/** Monotonic counter from the bridge store; drives the re-scroll. */
|
|
241
|
+
anonymizationSelectionSeq?: number | undefined;
|
|
242
|
+
/**
|
|
243
|
+
* Render legal-template markers ({{field}}, {{@clause:..}}, {{#if}}/{{#each}})
|
|
244
|
+
* as rich widgets on the page instead of raw text. Off for ordinary
|
|
245
|
+
* documents; on for the template editor.
|
|
246
|
+
*/
|
|
247
|
+
showTemplateDirectives?: boolean | undefined;
|
|
248
|
+
/**
|
|
249
|
+
* Fires when the template editor's `/` slash-command trigger opens, its typed
|
|
250
|
+
* query changes, or it closes. Only active alongside `showTemplateDirectives`.
|
|
251
|
+
* The host renders the floating menu and inserts the chosen marker; the plugin
|
|
252
|
+
* owns only the trigger state.
|
|
253
|
+
*/
|
|
254
|
+
onSlashMenuChange?: ((state: TemplateSlashMenuState) => void) | undefined;
|
|
255
|
+
/**
|
|
256
|
+
* Resolves a navigation/commit key (Up / Down / Enter) while the slash menu is
|
|
257
|
+
* open. Return `true` to let the editor swallow the key. Escape is handled
|
|
258
|
+
* inside the plugin and never reaches this callback.
|
|
259
|
+
*/
|
|
260
|
+
onSlashMenuKeyAction?: ((action: TemplateSlashMenuKeyAction) => boolean) | undefined;
|
|
261
|
+
/**
|
|
262
|
+
* Host-provided text context-menu entries, appended after the built-ins.
|
|
263
|
+
* `requiresSelection` items only render when text is selected. Selecting one
|
|
264
|
+
* fires `onCustomContextAction` with the item id and the selection range
|
|
265
|
+
* captured when the menu opened (right-click can collapse the live PM
|
|
266
|
+
* selection, so the captured range is the reliable one).
|
|
267
|
+
*/
|
|
268
|
+
customContextMenuItems?: readonly {
|
|
269
|
+
id: string;
|
|
270
|
+
label: string;
|
|
271
|
+
requiresSelection?: boolean;
|
|
272
|
+
icon?: VNodeChild;
|
|
273
|
+
}[] | undefined;
|
|
274
|
+
onCustomContextAction?: ((id: string, selectionRange: {
|
|
275
|
+
from: number;
|
|
276
|
+
to: number;
|
|
277
|
+
}) => void) | undefined;
|
|
278
|
+
/**
|
|
279
|
+
* Operational flags for save-path features. Selective save and its tripwire
|
|
280
|
+
* mode are OFF by default; hosts opt in once their rollout pipeline is ready.
|
|
281
|
+
*/
|
|
282
|
+
featureFlags?: FolioSelectiveSaveFlags;
|
|
283
|
+
/**
|
|
284
|
+
* Receives the structured comparison between selective save and full repack
|
|
285
|
+
* whenever {@link FolioSelectiveSaveFlags.selectiveSaveTripwire} is enabled.
|
|
286
|
+
* Saves are never blocked by the tripwire; this is observability only.
|
|
287
|
+
*/
|
|
288
|
+
onSelectiveSaveTripwire?: (result: TripwireResult) => void;
|
|
289
|
+
};
|
|
290
|
+
export type { FolioSelectiveSaveFlags, TripwireResult };
|
|
291
|
+
export type DocxEditorCollaboration = {
|
|
292
|
+
awareness?: {
|
|
293
|
+
clientID: number;
|
|
294
|
+
getStates: () => Map<number, unknown>;
|
|
295
|
+
off: (event: "change" | "update", handler: () => void) => void;
|
|
296
|
+
on: (event: "change" | "update", handler: () => void) => void;
|
|
297
|
+
} | undefined;
|
|
298
|
+
onSeeded?: (() => void) | undefined;
|
|
299
|
+
plugins?: Plugin[] | undefined;
|
|
300
|
+
shouldSeed?: boolean | undefined;
|
|
301
|
+
yXmlFragment: XmlFragment;
|
|
302
|
+
};
|
|
303
|
+
/**
|
|
304
|
+
* Imperative handle exposed by the DocxEditor component.
|
|
305
|
+
*/
|
|
306
|
+
export type DocxEditorRef = {
|
|
307
|
+
/** Get the current document */
|
|
308
|
+
getDocument: () => Document | null;
|
|
309
|
+
/** Whether the live ProseMirror state has edits that have not been serialized. */
|
|
310
|
+
hasPendingChanges: () => boolean;
|
|
311
|
+
/** Get the editor ref */
|
|
312
|
+
getEditorRef: () => PagedEditorRef | null;
|
|
313
|
+
/** The headless editor controller (Seam 6), or null before the editor mounts. */
|
|
314
|
+
getEditor: () => FolioEditor | null;
|
|
315
|
+
/** Save the document to buffer. Pass { selective: false } to force full repack. */
|
|
316
|
+
save: (options?: {
|
|
317
|
+
selective?: boolean;
|
|
318
|
+
}) => Promise<ArrayBuffer | null>;
|
|
319
|
+
/** Set zoom level */
|
|
320
|
+
setZoom: (zoom: number) => void;
|
|
321
|
+
/** Get current zoom level */
|
|
322
|
+
getZoom: () => number;
|
|
323
|
+
/** Focus the editor */
|
|
324
|
+
focus: () => void;
|
|
325
|
+
/** Get current page number */
|
|
326
|
+
getCurrentPage: () => number;
|
|
327
|
+
/** Get total page count */
|
|
328
|
+
getTotalPages: () => number;
|
|
329
|
+
/** Scroll to a specific page */
|
|
330
|
+
scrollToPage: (pageNumber: number) => void;
|
|
331
|
+
/**
|
|
332
|
+
* Scroll the paginated view to the paragraph with the given Word `w14:paraId`.
|
|
333
|
+
* Pass `options.highlight` to briefly flash it in a custom color.
|
|
334
|
+
*/
|
|
335
|
+
scrollToParaId: (paraId: string, options?: ScrollToParaIdOptions) => boolean;
|
|
336
|
+
/** Open print preview */
|
|
337
|
+
openPrintPreview: () => void;
|
|
338
|
+
/** Print the document directly */
|
|
339
|
+
print: () => void;
|
|
340
|
+
/** Load a pre-parsed document programmatically */
|
|
341
|
+
loadDocument: (doc: Document) => void;
|
|
342
|
+
/** Load a DOCX buffer programmatically (ArrayBuffer, Uint8Array, Blob, or File) */
|
|
343
|
+
loadDocumentBuffer: (buffer: DocxInput) => Promise<void>;
|
|
344
|
+
/**
|
|
345
|
+
* Force-create the underlying editor view if it has been deferred. Surfaces
|
|
346
|
+
* that need a live view before the user interacts with the document body
|
|
347
|
+
* (notably the AI chat composer, which gates "send" on snapshot availability)
|
|
348
|
+
* must call this once on mount with `focus: false`; otherwise the perf
|
|
349
|
+
* deferral keeps the view null and they wait forever.
|
|
350
|
+
*/
|
|
351
|
+
ensureEditorView: (options?: {
|
|
352
|
+
focus?: boolean;
|
|
353
|
+
}) => void;
|
|
354
|
+
/** Create the block snapshot that an external AI editor should reference. */
|
|
355
|
+
createAIEditSnapshot: () => FolioAIEditSnapshot | null;
|
|
356
|
+
/** Apply AI-authored operations against a previously created block snapshot. */
|
|
357
|
+
applyAIEditOperations: (options: {
|
|
358
|
+
snapshot: FolioAIEditSnapshot;
|
|
359
|
+
operations: FolioAIEditOperation[];
|
|
360
|
+
mode?: FolioAIEditApplyMode;
|
|
361
|
+
author?: string;
|
|
362
|
+
}) => FolioAIEditApplyResult;
|
|
363
|
+
/**
|
|
364
|
+
* Accept the tracked-change marks belonging to a previously applied AI edit.
|
|
365
|
+
* Pass a single id for inserts/standalone deletions, or the full id list
|
|
366
|
+
* (`applied.revisionIds`) for a replace, which has separate ids for its
|
|
367
|
+
* deletion and insertion sides. Returns whether a matching range was found.
|
|
368
|
+
*/
|
|
369
|
+
acceptAIEditOperation: (revisionIds: number | readonly number[]) => boolean;
|
|
370
|
+
/**
|
|
371
|
+
* Reject the tracked-change marks belonging to a previously applied AI edit.
|
|
372
|
+
* Same id semantics as `acceptAIEditOperation`.
|
|
373
|
+
*/
|
|
374
|
+
rejectAIEditOperation: (revisionIds: number | readonly number[]) => boolean;
|
|
375
|
+
/**
|
|
376
|
+
* Undo / redo the last history-recorded edit IN PLACE — e.g. an
|
|
377
|
+
* `acceptAIEditOperation` / `rejectAIEditOperation` resolution — without
|
|
378
|
+
* reloading the document, so the view and scroll position are preserved.
|
|
379
|
+
* Routes to whichever surface is active: the inline header/footer editor when
|
|
380
|
+
* one is being edited, otherwise the document body. Only edits that produce
|
|
381
|
+
* document changes are recorded; selection-only changes carry no steps and are
|
|
382
|
+
* never undone. Returns `false` when there is nothing to undo / redo.
|
|
383
|
+
*/
|
|
384
|
+
undo: () => boolean;
|
|
385
|
+
redo: () => boolean;
|
|
386
|
+
/**
|
|
387
|
+
* Scroll the editor viewport so the tracked-change marks belonging to the
|
|
388
|
+
* given `revisionIds` come into view, and select them. No-op when none of the
|
|
389
|
+
* revisions are present.
|
|
390
|
+
*/
|
|
391
|
+
scrollToAIEditOperation: (revisionIds: number | readonly number[]) => boolean;
|
|
392
|
+
/**
|
|
393
|
+
* Scroll the editor viewport so the block referenced by `blockId` is in view,
|
|
394
|
+
* and place the selection inside it. Returns `false` when the block can't be
|
|
395
|
+
* resolved on the live document (e.g. it was edited away).
|
|
396
|
+
*
|
|
397
|
+
* When `snapshot` is supplied, ids resolve against it — required for review
|
|
398
|
+
* panel pending-suggestion navigation, because block ids are sequential and a
|
|
399
|
+
* freshly recomputed snapshot would re-number blocks after a structural
|
|
400
|
+
* accept. Without `snapshot`, falls back to a fresh-from-live-doc snapshot.
|
|
401
|
+
*/
|
|
402
|
+
scrollToBlock: (blockId: string, snapshot?: FolioAIEditSnapshot) => boolean;
|
|
403
|
+
/**
|
|
404
|
+
* List every block-level content control in the live document, filtered by
|
|
405
|
+
* tag / alias / id / sdtType. Returns the modeled SdtProperties projection
|
|
406
|
+
* plus a synthetic identifier so callers can address each control by insertion
|
|
407
|
+
* order even if tag/alias collide.
|
|
408
|
+
*
|
|
409
|
+
* IMPORTANT: the returned `pmPos` values are valid only for the document state
|
|
410
|
+
* at fetch time. After any mutation that changes earlier content's size, later
|
|
411
|
+
* controls shift and stored `pmPos` values become stale. For batch-fill flows
|
|
412
|
+
* over duplicate-tag controls, either refetch via `getContentControls()` after
|
|
413
|
+
* each mutation, or address by stable `{ tag }` / `{ id }` / `{ alias }`.
|
|
414
|
+
*/
|
|
415
|
+
getContentControls: (filter?: ContentControlFilter) => {
|
|
416
|
+
properties: SdtProperties;
|
|
417
|
+
/** Index in the PM document tree, outer→inner. */
|
|
418
|
+
path: number[];
|
|
419
|
+
/**
|
|
420
|
+
* PM position of the control's open token in the SOURCE document state.
|
|
421
|
+
* Disambiguates duplicates within one snapshot, but does not survive
|
|
422
|
+
* mutations that resize earlier content — see `getContentControls`.
|
|
423
|
+
*/
|
|
424
|
+
pmPos: number;
|
|
425
|
+
}[];
|
|
426
|
+
/**
|
|
427
|
+
* Scroll to the first content control matching the filter and place the caret
|
|
428
|
+
* inside it. Returns false when no match is present.
|
|
429
|
+
*/
|
|
430
|
+
scrollToContentControl: (filter: ContentControlFilter) => boolean;
|
|
431
|
+
/**
|
|
432
|
+
* Replace a control's inner content with plain text or pre-built block
|
|
433
|
+
* content. Locked controls throw `ContentControlLockedError` unless
|
|
434
|
+
* `{ force: true }` is passed. Writes go through a normal undoable transaction.
|
|
435
|
+
*/
|
|
436
|
+
setContentControlContent: (filter: ContentControlFilter, input: SetContentControlContentInput, options?: {
|
|
437
|
+
force?: boolean;
|
|
438
|
+
}) => boolean;
|
|
439
|
+
/**
|
|
440
|
+
* Set a structured value on a typed control (dropdown / checkbox / date).
|
|
441
|
+
* Throws `ContentControlTypeError` when the input shape does not match the
|
|
442
|
+
* control's sdtType. Writes go through a normal undoable transaction.
|
|
443
|
+
*/
|
|
444
|
+
setContentControlValue: (filter: ContentControlFilter, input: SetContentControlValueInput, options?: {
|
|
445
|
+
force?: boolean;
|
|
446
|
+
}) => boolean;
|
|
447
|
+
/**
|
|
448
|
+
* Remove a control. With `{ keepContent: true }` the inner blocks survive
|
|
449
|
+
* in-place; otherwise the wrapper and its children are dropped. Refuses to
|
|
450
|
+
* unwrap a `w15:repeatingSection` (would orphan its row items) unless
|
|
451
|
+
* `{ force: true }` is passed.
|
|
452
|
+
*/
|
|
453
|
+
removeContentControl: (filter: ContentControlFilter, options?: {
|
|
454
|
+
keepContent?: boolean;
|
|
455
|
+
force?: boolean;
|
|
456
|
+
}) => boolean;
|
|
457
|
+
};
|
|
458
|
+
/**
|
|
459
|
+
* Selection formatting snapshot for the toolbar.
|
|
460
|
+
*
|
|
461
|
+
* TODO(vue): mirror the React toolbar's `SelectionFormatting` exactly once the
|
|
462
|
+
* Vue toolbar lands; `EditorState` is internal, so fidelity here is secondary to
|
|
463
|
+
* `DocxEditorProps` / `DocxEditorRef`.
|
|
464
|
+
*/
|
|
465
|
+
export type SelectionFormatting = {
|
|
466
|
+
/** Whether selected text is bold */
|
|
467
|
+
bold?: boolean | undefined;
|
|
468
|
+
/** Whether selected text is italic */
|
|
469
|
+
italic?: boolean | undefined;
|
|
470
|
+
/** Whether selected text is underlined */
|
|
471
|
+
underline?: boolean | undefined;
|
|
472
|
+
/** Whether selected text has strikethrough */
|
|
473
|
+
strike?: boolean | undefined;
|
|
474
|
+
/** Whether selected text is superscript */
|
|
475
|
+
superscript?: boolean | undefined;
|
|
476
|
+
/** Whether selected text is subscript */
|
|
477
|
+
subscript?: boolean | undefined;
|
|
478
|
+
/** Font family of selected text */
|
|
479
|
+
fontFamily?: string | undefined;
|
|
480
|
+
/** Font size of selected text (in half-points) */
|
|
481
|
+
fontSize?: number | undefined;
|
|
482
|
+
/** Text color */
|
|
483
|
+
color?: string | undefined;
|
|
484
|
+
/** Highlight color */
|
|
485
|
+
highlight?: string | undefined;
|
|
486
|
+
/** Paragraph alignment */
|
|
487
|
+
alignment?: ParagraphAlignment | undefined;
|
|
488
|
+
/** List state of the current paragraph */
|
|
489
|
+
listState?: ListState | undefined;
|
|
490
|
+
/** Line spacing in twips (OOXML value, 240 = single spacing) */
|
|
491
|
+
lineSpacing?: number | undefined;
|
|
492
|
+
/** Paragraph style ID */
|
|
493
|
+
styleId?: string | undefined;
|
|
494
|
+
/** Paragraph left indentation in twips */
|
|
495
|
+
indentLeft?: number | undefined;
|
|
496
|
+
/** Whether the paragraph is RTL (bidi) */
|
|
497
|
+
bidi?: boolean | undefined;
|
|
498
|
+
};
|
|
499
|
+
/**
|
|
500
|
+
* List state of the current paragraph.
|
|
501
|
+
*
|
|
502
|
+
* TODO(vue): source from the Vue list toolbar (mirrors React's
|
|
503
|
+
* `components/ui/ListButtons` `ListState`) when it lands.
|
|
504
|
+
*/
|
|
505
|
+
export type ListState = {
|
|
506
|
+
type: string;
|
|
507
|
+
level: number;
|
|
508
|
+
isInList: boolean;
|
|
509
|
+
numId?: number;
|
|
510
|
+
};
|
|
511
|
+
/** Aggregated internal state held by DocxEditor's top-level reducer slot. */
|
|
512
|
+
export type EditorState = {
|
|
513
|
+
documentLoad: DocumentLoadState;
|
|
514
|
+
/** Current selection formatting for toolbar */
|
|
515
|
+
selectionFormatting: SelectionFormatting;
|
|
516
|
+
/** Paragraph indent data for ruler */
|
|
517
|
+
paragraphIndentLeft: number;
|
|
518
|
+
paragraphIndentRight: number;
|
|
519
|
+
paragraphFirstLineIndent: number;
|
|
520
|
+
paragraphHangingIndent: boolean;
|
|
521
|
+
paragraphTabs: TabStop[] | null;
|
|
522
|
+
/** ProseMirror table context (for showing table toolbar) */
|
|
523
|
+
pmTableContext: TableContextInfo | null;
|
|
524
|
+
/** Image context when cursor is on an image node */
|
|
525
|
+
pmImageContext: ImageContextInfo | null;
|
|
526
|
+
/** Active tracked change at cursor (for contextual toolbar) */
|
|
527
|
+
activeTrackedChange: ActiveTrackedChangeInfo | null;
|
|
528
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared toolbar prop bag — mirrors React's ToolbarProps. Loosely
|
|
3
|
+
* typed because the consumer surface here is just the slot-down
|
|
4
|
+
* channel; tightening would require dragging the entire
|
|
5
|
+
* ToolbarProps interface across the framework boundary.
|
|
6
|
+
*/
|
|
7
|
+
export type EditorToolbarProps = Record<string, unknown>;
|
|
8
|
+
export declare function provideEditorToolbar(props: EditorToolbarProps): void;
|
|
9
|
+
export declare function useEditorToolbar(): EditorToolbarProps;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ColorValue, Theme } from '@stll/folio-core/types/document';
|
|
2
|
+
import { ListState } from '../utils/listState';
|
|
3
|
+
import { ParagraphAlignment } from './ui/AlignmentButtons.types';
|
|
4
|
+
import { StyleOption } from './ui/StylePicker.types';
|
|
5
|
+
/**
|
|
6
|
+
* The controls the minimal bar can emit. Mirrors the relevant subset of
|
|
7
|
+
* React's `FormattingAction` (packages/react/src/components/toolbarPrimitives.tsx):
|
|
8
|
+
* mark toggles + list/indent verbs, plus the object-shaped alignment / style /
|
|
9
|
+
* text-color intents.
|
|
10
|
+
*/
|
|
11
|
+
export type FormattingAction = "bold" | "italic" | "underline" | "bulletList" | "numberedList" | "indent" | "outdent" | {
|
|
12
|
+
type: "alignment";
|
|
13
|
+
value: ParagraphAlignment;
|
|
14
|
+
} | {
|
|
15
|
+
type: "applyStyle";
|
|
16
|
+
value: string;
|
|
17
|
+
} | {
|
|
18
|
+
type: "textColor";
|
|
19
|
+
value: ColorValue | string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Current formatting of the selection driving the bar's active states.
|
|
23
|
+
* Mirrors the fields React's `SelectionFormatting` exposes that the minimal
|
|
24
|
+
* bar reads.
|
|
25
|
+
*/
|
|
26
|
+
export type SelectionFormatting = {
|
|
27
|
+
/** Whether selected text is bold. */
|
|
28
|
+
bold?: boolean | undefined;
|
|
29
|
+
/** Whether selected text is italic. */
|
|
30
|
+
italic?: boolean | undefined;
|
|
31
|
+
/** Whether selected text is underlined. */
|
|
32
|
+
underline?: boolean | undefined;
|
|
33
|
+
/** Text color (hex, with or without a leading `#`). */
|
|
34
|
+
color?: string | undefined;
|
|
35
|
+
/** Paragraph alignment. */
|
|
36
|
+
alignment?: ParagraphAlignment | undefined;
|
|
37
|
+
/** List state of the current paragraph. */
|
|
38
|
+
listState?: ListState | undefined;
|
|
39
|
+
/** Paragraph style id. */
|
|
40
|
+
styleId?: string | undefined;
|
|
41
|
+
/** Paragraph left indentation in twips. */
|
|
42
|
+
indentLeft?: number | undefined;
|
|
43
|
+
};
|
|
44
|
+
export type FormattingBarProps = {
|
|
45
|
+
/** Current formatting of the selection (drives active states). */
|
|
46
|
+
currentFormatting?: SelectionFormatting;
|
|
47
|
+
/** Whether the bar is disabled. */
|
|
48
|
+
disabled?: boolean;
|
|
49
|
+
/** Whether undo is available. */
|
|
50
|
+
canUndo?: boolean;
|
|
51
|
+
/** Whether redo is available. */
|
|
52
|
+
canRedo?: boolean;
|
|
53
|
+
/** Additional CSS class name. */
|
|
54
|
+
className?: string;
|
|
55
|
+
/** Whether to show the paragraph-style picker (default: true). */
|
|
56
|
+
showStylePicker?: boolean;
|
|
57
|
+
/** Whether to show the text-color picker (default: true). */
|
|
58
|
+
showTextColorPicker?: boolean;
|
|
59
|
+
/** Whether to show the alignment control (default: true). */
|
|
60
|
+
showAlignmentButtons?: boolean;
|
|
61
|
+
/** Whether to show the list + indent controls (default: true). */
|
|
62
|
+
showListButtons?: boolean;
|
|
63
|
+
/** Document styles for the style picker (Vue `StylePicker` option shape). */
|
|
64
|
+
documentStyles?: StyleOption[];
|
|
65
|
+
/** Document theme — feeds the color picker's theme-color matrix. */
|
|
66
|
+
theme?: Theme | null;
|
|
67
|
+
};
|