@docx-editor.dev/core 2.7.0 → 2.9.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/automation.cjs +1 -1
- package/dist/automation.d.cts +5 -6
- package/dist/automation.d.ts +5 -6
- package/dist/automation.js +1 -1
- package/dist/binding.cjs +1 -1
- package/dist/binding.d.cts +12 -12
- package/dist/binding.d.ts +12 -12
- package/dist/binding.js +1 -1
- package/dist/chunk-2RDMWJPF.cjs +2 -0
- package/dist/chunk-5VC5HGJA.js +2 -0
- package/dist/chunk-A2JIBG75.js +1 -0
- package/dist/chunk-DKMKH77K.cjs +5 -0
- package/dist/chunk-DTQPINIM.js +15 -0
- package/dist/chunk-HHFMXG25.js +2 -0
- package/dist/chunk-IEXDXWTA.cjs +1 -0
- package/dist/chunk-IMMAG4QP.cjs +10 -0
- package/dist/chunk-KBCC66CI.js +5 -0
- package/dist/chunk-P5YSGSYC.cjs +15 -0
- package/dist/chunk-Q66ZJFRE.js +18 -0
- package/dist/chunk-TP4EHWEX.cjs +18 -0
- package/dist/chunk-VUJGPCPU.js +10 -0
- package/dist/chunk-XMHWBL3K.cjs +2 -0
- package/dist/contracts/document.d.cts +25 -3
- package/dist/contracts/document.d.ts +25 -3
- package/dist/contracts/editor.d.cts +10 -10
- package/dist/contracts/editor.d.ts +10 -10
- package/dist/contracts/interaction.d.cts +9 -9
- package/dist/contracts/interaction.d.ts +9 -9
- package/dist/contracts/modules.d.cts +6 -5
- package/dist/contracts/modules.d.ts +6 -5
- package/dist/contracts/types.d.cts +101 -1
- package/dist/contracts/types.d.ts +101 -1
- package/dist/{custom-node-writes-BpOBjNzo.d.ts → custom-node-writes-7ERv0f_X.d.cts} +25 -11
- package/dist/{custom-node-writes-C_AlNvds.d.cts → custom-node-writes-QyVZdTUA.d.ts} +25 -11
- package/dist/{editor-CXaGlcUa.d.cts → editor-CojjwMmF.d.cts} +78 -67
- package/dist/{editor-C--WWCBA.d.ts → editor-PUlv5Pp7.d.ts} +78 -67
- package/dist/editor.cjs +1 -1
- package/dist/editor.css +124 -14
- package/dist/editor.d.cts +68 -36
- package/dist/editor.d.ts +68 -36
- package/dist/editor.js +1 -1
- package/dist/{hf-references-BdjsQNE_.d.ts → hf-references-Dvk6De4Q.d.cts} +1 -2
- package/dist/{hf-references-CgEOSw3i.d.cts → hf-references-z5Y4N1ab.d.ts} +1 -2
- package/dist/{image-resources-Bkmu1Jei.d.cts → image-resources-DQOiwOuE.d.cts} +2 -2
- package/dist/{image-resources-BWd5u-op.d.ts → image-resources-eZqD_-vC.d.ts} +2 -2
- package/dist/{index-QsE1xXyT.d.cts → index-DGPSeLI0.d.cts} +1632 -1435
- package/dist/{index-DW0TsrYl.d.ts → index-oN-v8DQ5.d.ts} +1632 -1435
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +19 -19
- package/dist/index.d.ts +19 -19
- package/dist/index.js +1 -1
- package/dist/layout.cjs +1 -1
- package/dist/layout.d.cts +545 -336
- package/dist/layout.d.ts +545 -336
- package/dist/layout.js +1 -1
- package/dist/{note-nodes-BPSTVDMr.d.ts → note-nodes-BNCANoGN.d.ts} +1 -1
- package/dist/{note-nodes-C6DLxlvj.d.cts → note-nodes-DL-Au22P.d.cts} +1 -1
- package/dist/note-properties-CQlxjic_.d.cts +67 -0
- package/dist/note-properties-jvnw_DGG.d.ts +67 -0
- package/dist/omml-equation-BD-LsmWE.d.cts +84 -0
- package/dist/omml-equation-Dd3mBep-.d.ts +84 -0
- package/dist/{ooxml-tree-BU0e3DVi.d.ts → ooxml-package-CdEy9ufK.d.cts} +352 -1
- package/dist/{ooxml-tree-BU0e3DVi.d.cts → ooxml-package-CdEy9ufK.d.ts} +352 -1
- package/dist/output.cjs +1 -1
- package/dist/output.d.cts +9 -8
- package/dist/output.d.ts +9 -8
- package/dist/output.js +1 -1
- package/dist/{protocol-CD7slqvl.d.cts → protocol-C7ahrdUx.d.ts} +28 -4
- package/dist/{protocol-DsbfgBwA.d.ts → protocol-UuZOcOp7.d.cts} +28 -4
- package/dist/{review-support-Cr2n7f1-.d.ts → review-items-D5SPFtsO.d.ts} +49 -102
- package/dist/{review-support-oQrX6Xu3.d.cts → review-items-DpsqTHio.d.cts} +49 -102
- package/dist/review-reads-B2Ji3fVU.d.ts +176 -0
- package/dist/review-reads-CP106AHp.d.cts +176 -0
- package/dist/{revision-projection-UKqvPa4-.d.ts → revision-projection-CILpvv4M.d.ts} +1 -1
- package/dist/{revision-projection-WzlQGBJx.d.cts → revision-projection-Cc4wz30g.d.cts} +1 -1
- package/dist/{semantic-cell-selection-C8RC0VnN.d.ts → semantic-cell-selection-BWhVAk5B.d.ts} +16 -4
- package/dist/{semantic-cell-selection-CQOgvtbT.d.cts → semantic-cell-selection-DJPjBWzf.d.cts} +16 -4
- package/dist/{semantic-interaction-f4GyBQ_1.d.cts → semantic-interaction-BjOcDB06.d.cts} +14 -2
- package/dist/{semantic-interaction-C45D_oG2.d.ts → semantic-interaction-Cca1-X_a.d.ts} +14 -2
- package/dist/{semantic-paint-DUkGLJ_L.d.ts → semantic-paint-CufpIQFw.d.ts} +7 -7
- package/dist/{semantic-paint-BUt0ePEW.d.cts → semantic-paint-Ur7pAINj.d.cts} +7 -7
- package/dist/{semantic-records-DoW_xNgJ.d.ts → semantic-records-C3Z76KeN.d.cts} +77 -31
- package/dist/{semantic-records-CuT3Wsd-.d.cts → semantic-records-Cc1MJrhM.d.ts} +77 -31
- package/dist/{shaped-measurer-CakZ7g1s.d.ts → shaped-measurer-CYSK20E2.d.cts} +2 -4
- package/dist/{shaped-measurer-CDcHzjhf.d.cts → shaped-measurer-CwlTPDJO.d.ts} +2 -4
- package/dist/store.cjs +1 -1
- package/dist/store.d.cts +90 -18
- package/dist/store.d.ts +90 -18
- package/dist/store.js +1 -1
- package/dist/{tree-op-types-fZgbrR5F.d.ts → tree-op-types-B0-sCtw-.d.cts} +79 -10
- package/dist/{tree-op-types-QujrzgCz.d.cts → tree-op-types-XMVsJSpe.d.ts} +79 -10
- package/dist/{tree-session-5UWKAQ41.d.cts → tree-session-D945D43B.d.cts} +45 -19
- package/dist/{tree-session--6LDTNjR.d.ts → tree-session-DBJgmdmc.d.ts} +45 -19
- package/dist/{tree-store-Dy9FZ1pa.d.ts → tree-store-C6vc8E_2.d.cts} +14 -3
- package/dist/{tree-store-DhYIACNE.d.cts → tree-store-ClA-qng4.d.ts} +14 -3
- package/package.json +2 -2
- package/dist/chunk-32HTRN7R.js +0 -10
- package/dist/chunk-42PRWWVE.js +0 -2
- package/dist/chunk-BRBRYJKE.cjs +0 -2
- package/dist/chunk-DTR64XCS.cjs +0 -2
- package/dist/chunk-EMQSFPJO.cjs +0 -15
- package/dist/chunk-GBK7Z6F4.cjs +0 -5
- package/dist/chunk-GPJXQDHC.js +0 -2
- package/dist/chunk-JLSB6KNZ.js +0 -5
- package/dist/chunk-LEV2X47E.cjs +0 -18
- package/dist/chunk-NDTLLSG7.js +0 -1
- package/dist/chunk-O4VILLOM.cjs +0 -1
- package/dist/chunk-OB6JFVYA.js +0 -15
- package/dist/chunk-QTUZFJ4O.js +0 -18
- package/dist/chunk-UE7KTQLK.js +0 -2
- package/dist/chunk-WC3LI6FC.cjs +0 -10
- package/dist/chunk-XRDTD4X3.cjs +0 -2
- package/dist/content-control-walk-CbTqHq6O.d.cts +0 -56
- package/dist/content-control-walk-D06GijR0.d.ts +0 -56
- package/dist/ooxml-package-CR5us6ad.d.cts +0 -354
- package/dist/ooxml-package-D_CtywTW.d.ts +0 -354
- package/dist/review-reads-C5E7u-pt.d.ts +0 -432
- package/dist/review-reads-ChgUq41I.d.cts +0 -432
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { T as TreeDocOp, d as DrawingPositionInput, l as DrawingTransform, h as DrawingTreeDocOp } from './tree-op-types-
|
|
2
|
-
import { b as ImageDecodePort, S as SupportedImageMime } from './image-resources-
|
|
3
|
-
import './review-
|
|
1
|
+
import { T as TreeDocOp, d as DrawingPositionInput, l as DrawingTransform, h as DrawingTreeDocOp } from './tree-op-types-B0-sCtw-.cjs';
|
|
2
|
+
import { b as ImageDecodePort, S as SupportedImageMime } from './image-resources-DQOiwOuE.cjs';
|
|
3
|
+
import { g as ReviewRevisionKind } from './review-items-DpsqTHio.cjs';
|
|
4
4
|
import { EditorModule, ReviewModuleContribution } from './contracts/modules.cjs';
|
|
5
|
-
import { j as FontSource, k as FontSourceSubstitution, F as FontConfiguration,
|
|
6
|
-
import { R as RevisionDisplayMode } from './revision-projection-
|
|
7
|
-
import {
|
|
8
|
-
import { R as
|
|
9
|
-
import {
|
|
10
|
-
import { S as
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { Unsubscribe, ExecResult, IndentFormatting, SelectionPin } from './contracts/types.cjs';
|
|
14
|
-
import { c as TreeDocxSessionView, a as TreeApplyResult } from './tree-session-
|
|
5
|
+
import { j as FontSource, k as FontSourceSubstitution, F as FontConfiguration, D as DocumentSource, Z as ZoomMode, E as EditorFontError, l as Editor, b as EditorCommand, C as CanResult, S as SelectedImageState, V as ViewScope, m as FontFaceRequest, I as ImageContext, T as TableBorderEdgeTarget, n as TableBorderSpec, o as TableBorderStyle, p as TableContext } from './editor-CojjwMmF.cjs';
|
|
6
|
+
import { R as RevisionDisplayMode } from './revision-projection-Cc4wz30g.cjs';
|
|
7
|
+
import { S as SemanticPosition, a as SemanticSelection, N as NavigationCommand } from './semantic-interaction-BjOcDB06.cjs';
|
|
8
|
+
import { c as RevisionStyles, R as ReviewAuthorInfo, b as RevisionAuthorStyle, F as FieldShadingMode, d as DrawingPaintStrings } from './semantic-paint-Ur7pAINj.cjs';
|
|
9
|
+
import { R as ResolvedFootnoteProperties, a as ResolvedEndnoteProperties, A as AuthoredNoteProperties } from './note-properties-CQlxjic_.cjs';
|
|
10
|
+
import { S as SemanticLayout, C as ContentControlBoundaryRecord, T as TextMeasurer } from './semantic-records-C3Z76KeN.cjs';
|
|
11
|
+
import { S as StoryScope, A as ApplyImagePropertiesInput, d as ImageIntentResult, c as InsertImageInput, B as BookmarkIndex } from './custom-node-writes-7ERv0f_X.cjs';
|
|
12
|
+
import { C as CellSelection, S as SectionProperties } from './semantic-cell-selection-DJPjBWzf.cjs';
|
|
13
|
+
import { Unsubscribe, ExecResult, ParagraphTabStop, IndentFormatting, ParagraphFlags, ParagraphDisagreements, SelectionPin } from './contracts/types.cjs';
|
|
14
|
+
import { c as TreeDocxSessionView, a as TreeApplyResult } from './tree-session-D945D43B.cjs';
|
|
15
15
|
import './contracts/document.cjs';
|
|
16
16
|
|
|
17
17
|
/**
|
|
@@ -104,1116 +104,330 @@ declare function composeFontConfiguration(base: FontConfigurationBase, ...fragme
|
|
|
104
104
|
/**
|
|
105
105
|
* A Word-faithful blank document, freshly zipped per call (the caller may hand the
|
|
106
106
|
* bytes to a loader that takes ownership). Calibri 11pt and Word's Normal paragraph
|
|
107
|
-
* spacing are authored in `w:docDefaults`,
|
|
108
|
-
* document behaves like Word's, and saving it
|
|
107
|
+
* spacing are authored in `w:docDefaults`, Word's built-in style gallery in `styles.xml`,
|
|
108
|
+
* US Letter geometry in the section — a New document behaves like Word's, and saving it
|
|
109
|
+
* produces a file Word opens identically.
|
|
109
110
|
*
|
|
110
111
|
* @public
|
|
111
112
|
*/
|
|
112
113
|
declare function blankDocumentBytes(): Uint8Array;
|
|
113
114
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
readonly
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
readonly
|
|
125
|
-
readonly
|
|
126
|
-
|
|
115
|
+
type TableCommandSelectionPolicy = {
|
|
116
|
+
readonly kind: 'preserveSelection';
|
|
117
|
+
} | {
|
|
118
|
+
readonly kind: 'adoptCommittedCaret';
|
|
119
|
+
};
|
|
120
|
+
type TableCommandPlan = {
|
|
121
|
+
readonly ok: true;
|
|
122
|
+
readonly ops: readonly TreeDocOp[];
|
|
123
|
+
readonly selection: TableCommandSelectionPolicy;
|
|
124
|
+
} | {
|
|
125
|
+
readonly ok: false;
|
|
126
|
+
readonly code: 'unsupported' | 'invalidArgs' | 'locked';
|
|
127
|
+
readonly reason: string;
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
type NotePropertiesSlice = {
|
|
131
|
+
readonly resolved: ResolvedFootnoteProperties | ResolvedEndnoteProperties;
|
|
132
|
+
readonly documentAuthored?: AuthoredNoteProperties;
|
|
133
|
+
readonly sectionAuthored?: AuthoredNoteProperties;
|
|
134
|
+
};
|
|
135
|
+
type NotePropertiesStateSnapshot = {
|
|
136
|
+
readonly sectionIndex: number;
|
|
137
|
+
readonly footnote: NotePropertiesSlice;
|
|
138
|
+
readonly endnote: NotePropertiesSlice;
|
|
139
|
+
};
|
|
140
|
+
|
|
127
141
|
/**
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
* CONTENT rather than by origin — a swapped asset fails admission even from a trusted host.
|
|
142
|
+
* A hyperlink as the surface reports it: its identity, where it sits, and the SANITIZED
|
|
143
|
+
* target. `href: null` is an inert link — a refused scheme or a dangling relationship — which
|
|
144
|
+
* a UI shows and offers to edit but must never offer to open.
|
|
132
145
|
*/
|
|
133
|
-
interface
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
readonly
|
|
137
|
-
/**
|
|
138
|
-
readonly
|
|
139
|
-
|
|
140
|
-
readonly
|
|
146
|
+
interface SurfaceHyperlink {
|
|
147
|
+
/** Canonical node id of the `w:hyperlink`. */
|
|
148
|
+
readonly id: string;
|
|
149
|
+
readonly paragraphId: string;
|
|
150
|
+
/** UTF-16 range of the link's display text within its paragraph. */
|
|
151
|
+
readonly start: number;
|
|
152
|
+
readonly end: number;
|
|
153
|
+
readonly text: string;
|
|
154
|
+
readonly kind: 'external' | 'internal' | 'unresolved';
|
|
155
|
+
/** Sanitized projection: an absolute URL, `#anchor`, or null when inert. */
|
|
156
|
+
readonly href: string | null;
|
|
157
|
+
/** The authored target, for an editor to seed its input with. */
|
|
158
|
+
readonly authored: string;
|
|
159
|
+
readonly anchor?: string;
|
|
160
|
+
readonly tooltip?: string;
|
|
141
161
|
}
|
|
142
162
|
/**
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
* Distinguished rather than collapsed to "failed" because the responses differ: `networkError`
|
|
146
|
-
* and `httpError` are worth retrying, while `hashMismatch` and `malformed` mean the bytes were
|
|
147
|
-
* not what the source claimed and retrying will fetch the same wrong thing.
|
|
148
|
-
*/
|
|
149
|
-
type FontLoadFailureReason = 'networkError' | 'httpError' | 'hashMismatch' | 'overLimit' | 'emptyResponse'
|
|
150
|
-
/** The declared face itself is unusable (empty family, out-of-range weight); nothing was fetched. */
|
|
151
|
-
| 'invalidRequest'
|
|
152
|
-
/** The bytes are not a font at all — most often an HTML error page served with 200. */
|
|
153
|
-
| 'malformed';
|
|
154
|
-
/**
|
|
155
|
-
* One face that did not load, with whatever evidence the failure produced.
|
|
163
|
+
* Reading and writing hyperlinks on the surface.
|
|
156
164
|
*
|
|
157
|
-
*
|
|
158
|
-
*
|
|
165
|
+
* Every href that leaves here has already been through `sanitizeHref` — targets come from files,
|
|
166
|
+
* so `javascript:`, `data:` and `vbscript:` are dropped at the parse boundary rather than trusted
|
|
167
|
+
* to be filtered by whoever renders them.
|
|
159
168
|
*/
|
|
160
|
-
interface
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
+
interface HyperlinkOps {
|
|
170
|
+
/** Every link in the paragraph the caret is in. */
|
|
171
|
+
linksInCaretParagraph(): SurfaceHyperlink[];
|
|
172
|
+
/** The link the caret sits in, or null. */
|
|
173
|
+
linkAtCaret(): SurfaceHyperlink | null;
|
|
174
|
+
/**
|
|
175
|
+
* The FIELD link whose painted atom the caret sits on, or null.
|
|
176
|
+
*
|
|
177
|
+
* Separate from {@link linkAtCaret} on purpose: a `HYPERLINK` field is not a tree node, so
|
|
178
|
+
* the typed lane never returns one, and link-create must not mistake a field atom for an
|
|
179
|
+
* editable link. Resolved from the layout projection, boundary-inclusive.
|
|
180
|
+
*/
|
|
181
|
+
fieldLinkAtCaret(): SurfaceHyperlink | null;
|
|
182
|
+
/** The link with this node id, or null. */
|
|
183
|
+
linkById(linkId: string): SurfaceHyperlink | null;
|
|
184
|
+
/**
|
|
185
|
+
* Apply a link to the selection, or retarget the one the caret is already in.
|
|
186
|
+
*
|
|
187
|
+
* `text` replaces the display text when supplied. Returns whether anything committed;
|
|
188
|
+
* a refusal leaves the document exactly as it was.
|
|
189
|
+
*/
|
|
190
|
+
applyHyperlink(input: {
|
|
191
|
+
readonly url?: string;
|
|
192
|
+
readonly anchor?: string;
|
|
193
|
+
readonly text?: string;
|
|
194
|
+
readonly tooltip?: string;
|
|
195
|
+
}): boolean;
|
|
196
|
+
/** Take the link off the one at the caret (or a named one). Returns whether it committed. */
|
|
197
|
+
removeHyperlink(linkId?: string): boolean;
|
|
169
198
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
199
|
+
|
|
200
|
+
/** A click on a painted link, after native navigation was refused. */
|
|
201
|
+
interface HyperlinkActivation {
|
|
202
|
+
readonly link: SurfaceHyperlink;
|
|
203
|
+
/** The clicked line fragment's viewport rect, so a popover can be placed under it. */
|
|
204
|
+
readonly rect: {
|
|
205
|
+
readonly left: number;
|
|
206
|
+
readonly top: number;
|
|
207
|
+
readonly bottom: number;
|
|
208
|
+
readonly right: number;
|
|
209
|
+
};
|
|
180
210
|
}
|
|
181
211
|
/**
|
|
182
|
-
*
|
|
183
|
-
*
|
|
184
|
-
* Fetches ONLY the URLs listed — never a default host or engine-chosen CDN — and never
|
|
185
|
-
* rejects for a per-source failure: the result carries every admitted source and a
|
|
186
|
-
* typed entry for every drop. Compose the result with `composeFontConfiguration`.
|
|
187
|
-
*/
|
|
188
|
-
declare function loadFonts(request: LoadFontsRequest): Promise<LoadFontsResult>;
|
|
189
|
-
/**
|
|
190
|
-
* Turn font bytes you ALREADY hold into a `FontSource` — a file input, IndexedDB, a
|
|
191
|
-
* bundler import. `loadFonts` covers URLs; this covers everything else, so no caller has
|
|
192
|
-
* to hand-assemble the record or reach for a hashing helper.
|
|
212
|
+
* Moving the caret and the viewport: to a position, to a bookmark, or out to an external target.
|
|
193
213
|
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
214
|
+
* {@link SurfaceNavigation.openExternal} is THE external-activation call site, and it refuses
|
|
215
|
+
* anything but an already-sanitized href. Routing an authored target through some other path is
|
|
216
|
+
* how a document gets to choose where a click goes.
|
|
196
217
|
*/
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}):
|
|
203
|
-
|
|
218
|
+
interface SurfaceNavigation {
|
|
219
|
+
/** Snap to a semantic position using layout geometry, then place the caret there. */
|
|
220
|
+
goToPosition(position: {
|
|
221
|
+
paragraphId: string;
|
|
222
|
+
offset: number;
|
|
223
|
+
}): boolean;
|
|
224
|
+
/**
|
|
225
|
+
* Scroll a bookmark into view and place the caret at it. Answers false for a name no
|
|
226
|
+
* bookmark declares — an inert click, which is what Word does with a dangling anchor.
|
|
227
|
+
*/
|
|
228
|
+
goToBookmark(name: string): boolean;
|
|
229
|
+
/**
|
|
230
|
+
* THE external-activation call site. Refuses anything but a sanitized projection, so a
|
|
231
|
+
* caller cannot route an authored target through it by mistake.
|
|
232
|
+
*/
|
|
233
|
+
openExternal(href: string | null): boolean;
|
|
234
|
+
destroy(): void;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/** One addressable inline equation and its compact editable projection. */
|
|
238
|
+
interface SurfaceEquation {
|
|
239
|
+
readonly id: string;
|
|
240
|
+
readonly paragraphId: string;
|
|
241
|
+
readonly start: number;
|
|
242
|
+
readonly end: number;
|
|
243
|
+
readonly linear: string;
|
|
244
|
+
readonly fallbackText: string;
|
|
245
|
+
/** True when every source construct belongs to the editable subset. */
|
|
246
|
+
readonly supported: boolean;
|
|
247
|
+
}
|
|
248
|
+
/** A user click on one painted equation. */
|
|
249
|
+
interface EquationActivation {
|
|
250
|
+
readonly equation: SurfaceEquation;
|
|
251
|
+
readonly rect: {
|
|
252
|
+
readonly left: number;
|
|
253
|
+
readonly top: number;
|
|
254
|
+
readonly right: number;
|
|
255
|
+
readonly bottom: number;
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
/** Boundary-inclusive lookup, matching the hyperlink and field atom popovers. */
|
|
259
|
+
declare function equationAtPosition(equations: readonly SurfaceEquation[], position: SemanticPosition): SurfaceEquation | null;
|
|
260
|
+
type EquationAction = 'replace' | 'remove';
|
|
261
|
+
/** Engine-owned capability result for equation editing chrome. */
|
|
262
|
+
type EquationCanResult = {
|
|
263
|
+
readonly ok: true;
|
|
204
264
|
} | {
|
|
205
|
-
readonly
|
|
265
|
+
readonly ok: false;
|
|
266
|
+
readonly code: 'locked' | 'notFound' | 'unsupported';
|
|
267
|
+
readonly reason: string;
|
|
206
268
|
};
|
|
269
|
+
/** Surface equation reads and atomic replace/remove writes. */
|
|
270
|
+
interface EquationOps {
|
|
271
|
+
equationsInCaretParagraph(): SurfaceEquation[];
|
|
272
|
+
equationAtCaret(): SurfaceEquation | null;
|
|
273
|
+
equationById(equationId: string): SurfaceEquation | null;
|
|
274
|
+
/** Whether equation chrome can run an action, with the engine-owned refusal reason. */
|
|
275
|
+
can(equationId: string, action: EquationAction): EquationCanResult;
|
|
276
|
+
applyEquation(equationId: string, linear: string): boolean;
|
|
277
|
+
removeEquation(equationId: string): boolean;
|
|
278
|
+
}
|
|
207
279
|
|
|
208
280
|
/**
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
* Enabled state has exactly one source: `toolbarCommandState(editor, slot)`, which
|
|
212
|
-
* asks `Editor.can`. The registry is static data and cannot know what the engine
|
|
213
|
-
* will honour at this selection, in this document, at this moment.
|
|
281
|
+
* Everything {@link createDocxEditor} accepts. Every field is optional.
|
|
214
282
|
*
|
|
215
|
-
*
|
|
216
|
-
*
|
|
217
|
-
*
|
|
218
|
-
* alignments, the list commands and the four value slots: the registry still said
|
|
219
|
-
* parity-only, React ignored it and ran them, and Vue believed it and rendered twelve
|
|
220
|
-
* WORKING commands permanently disabled. A slot the engine has not wired needs no
|
|
221
|
-
* registry flag — `commandForSlot` answers null and `toolbarCommandState` disables the
|
|
222
|
-
* control with the engine's own words ("not wired to an editor command").
|
|
223
|
-
*/
|
|
224
|
-
type ChromeControlState =
|
|
225
|
-
/**
|
|
226
|
-
* Dispatched as one fixed engine command: enabled when
|
|
227
|
-
* `Editor.can(commandForSlot(slot))` succeeds, a click runs
|
|
228
|
-
* `runToolbarCommand(editor, slot)`. The command is resolved from the SLOT id
|
|
229
|
-
* through `commandForSlot` in toolbar-commands.ts — the one command table both
|
|
230
|
-
* adapters share. A slot with no row there is simply not wired YET, and says so
|
|
231
|
-
* through the engine rather than through this descriptor.
|
|
232
|
-
*/
|
|
233
|
-
{
|
|
234
|
-
readonly kind: 'command';
|
|
235
|
-
}
|
|
236
|
-
/**
|
|
237
|
-
* Dispatched with a PICKED value: `commandForSlotValue(slot, value)`. Enabled when
|
|
238
|
-
* the engine would honour a well-formed value right now (`toolbarCommandState`
|
|
239
|
-
* probes for exactly that), so the control needs chrome that produces a value — a
|
|
240
|
-
* font list, a size, a colour — before a click means anything.
|
|
283
|
+
* `container` is the one that changes the shape of the whole lifecycle: omitting it produces an
|
|
284
|
+
* instance that does no DOM work until `attach(el)`, which is what lets a provider own the editor
|
|
285
|
+
* before any component has rendered a mount point.
|
|
241
286
|
*
|
|
242
|
-
*
|
|
243
|
-
* to hand `Editor.can`, and a bare click has nothing to send.
|
|
287
|
+
* @public
|
|
244
288
|
*/
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
289
|
+
interface DocxEditorConfig {
|
|
290
|
+
/**
|
|
291
|
+
* The element the paginated surface mounts into. The surface owns this subtree.
|
|
292
|
+
*
|
|
293
|
+
* Optional: an instance created WITHOUT a container stashes its document bytes and does
|
|
294
|
+
* no DOM work until `attach(el)` — the provider-first shape, where the editor exists
|
|
295
|
+
* before any component has rendered a mount point. With a container, the document mounts
|
|
296
|
+
* immediately at construction, exactly as before.
|
|
297
|
+
*/
|
|
298
|
+
container?: HTMLElement;
|
|
299
|
+
/**
|
|
300
|
+
* A document to load at construction: DOCX bytes, or `'blank'` for Word's blank
|
|
301
|
+
* template. A `DocumentHandle` cannot be re-opened (the handle is identity, not
|
|
302
|
+
* content), so passing one emits a typed `error` event rather than silently loading
|
|
303
|
+
* nothing. Omitting this mounts NO document, which is not the same as an empty one.
|
|
304
|
+
*/
|
|
305
|
+
document?: DocumentSource;
|
|
306
|
+
/**
|
|
307
|
+
* Font bytes for Word-accurate (HarfBuzz-shaped) line wrap and pagination. Omitted,
|
|
308
|
+
* layout falls back to a fixed-width estimate; fonts embedded in the document are
|
|
309
|
+
* wired in automatically either way. For Word's default faces (Calibri, Times New
|
|
310
|
+
* Roman, …) pass `await loadDefaultFonts()` from `@docx-editor.dev/fonts` — a bare
|
|
311
|
+
* fragment (`{ sources, substitutions }`) is accepted and composed with defaults, or
|
|
312
|
+
* merge several origins yourself with `composeFontConfiguration`. Sampled per load;
|
|
313
|
+
* failures degrade to the fixed measurer and report through `onFontError`.
|
|
314
|
+
*
|
|
315
|
+
* Pass a {@link FontResolver} instead to resolve ON DEMAND: the function is called once
|
|
316
|
+
* per load, after the document is parsed, with the families it actually declares, and
|
|
317
|
+
* only what it returns is loaded. A document naming nothing the resolver covers costs
|
|
318
|
+
* nothing. Note that a fetching resolver makes opening a document perform network
|
|
319
|
+
* requests — the engine never supplies one, so that stays your call.
|
|
320
|
+
*/
|
|
321
|
+
fonts?: FontConfiguration | FontConfigurationFragment | FontResolver;
|
|
322
|
+
author?: string;
|
|
323
|
+
locale?: string;
|
|
324
|
+
/** Localized drawing refusal labels; defaults to English when omitted. */
|
|
325
|
+
translate?: (key: string, params?: Record<string, string | number>) => string;
|
|
326
|
+
/**
|
|
327
|
+
* Capability modules to register — the seam `@docx-editor.dev/pro` plugs in
|
|
328
|
+
* through. Omitted, the editor runs the free tier: lossless round-trip,
|
|
329
|
+
* final-state revision rendering, review chrome disabled with the engine's
|
|
330
|
+
* reason. See {@link EditorModule}.
|
|
331
|
+
*/
|
|
332
|
+
modules?: readonly EditorModule[];
|
|
333
|
+
/**
|
|
334
|
+
* The mode the editor opens in — one prop, matching the toolbar's three-state pill.
|
|
335
|
+
*
|
|
336
|
+
* - `'edit'` — opens in editing, even when the document's `w:trackRevisions` asks for
|
|
337
|
+
* tracked changes; the reader still moves between modes from the toolbar.
|
|
338
|
+
* - `'suggesting'` — opens in suggesting. It needs what suggesting always needs — a
|
|
339
|
+
* review module and an {@link DocxEditorConfig.author} — and falls back to editing
|
|
340
|
+
* with the reason published when either is missing.
|
|
341
|
+
* - `'view'` — read-only: every mutating command through the facade is refused, and
|
|
342
|
+
* the toolbar cannot leave viewing.
|
|
343
|
+
* - Omitted — the DOCUMENT decides: a package carrying `w:trackRevisions` opens in
|
|
344
|
+
* suggesting, everything else in editing.
|
|
345
|
+
*/
|
|
346
|
+
mode?: 'edit' | 'view' | 'suggesting';
|
|
347
|
+
/**
|
|
348
|
+
* How painted tracked changes are coloured. Presentation only — nothing is serialised.
|
|
349
|
+
*
|
|
350
|
+
* - `'author'` (the DEFAULT) — every change takes its author's colour from the
|
|
351
|
+
* `--doc-review-author-N` ramp, by order of first appearance, as Word does. Restyle a
|
|
352
|
+
* slot under `.docx-editor` to change the ramp.
|
|
353
|
+
* - `'kind'` — insertions green, deletions red, so "added" and "removed" are what a
|
|
354
|
+
* glance tells apart, whoever proposed them.
|
|
355
|
+
* - {@link RevisionAuthorAssignments} — style the named authors; `others` decides
|
|
356
|
+
* whether the rest take the ramp (the default) or the kind colours.
|
|
357
|
+
*
|
|
358
|
+
* The opening value. In React this is authored declaratively — `DocxEditor.ColorByChangeType`
|
|
359
|
+
* and `DocxEditor.AuthorStyle` compose and apply it, seeding this config for the first
|
|
360
|
+
* paint — so React hosts never pass it by hand; it is the entry for headless hosts. Read
|
|
361
|
+
* the document's resolved roster with `getReviewAuthors`. Applies wherever revision
|
|
362
|
+
* markup paints: the full all-markup view needs a review module registered; without one
|
|
363
|
+
* the proposed view still marks surviving insertions.
|
|
364
|
+
*/
|
|
365
|
+
revisionStyles?: RevisionStyles;
|
|
366
|
+
/** Override raster decode for insert/replace image commands; defaults to browser/headless. */
|
|
367
|
+
imageDecodePort?: ImageDecodePort;
|
|
368
|
+
/**
|
|
369
|
+
* The scale to open at, as a fixed number.
|
|
370
|
+
*
|
|
371
|
+
* Supplying one also picks the mode: an editor given a `zoom` and no `zoomMode` opens
|
|
372
|
+
* FIXED at that value and stays there. An embedder that pinned 100% keeps 100%.
|
|
373
|
+
*/
|
|
374
|
+
zoom?: number;
|
|
375
|
+
/**
|
|
376
|
+
* Where the scale comes from. Defaults to `'auto'` — fit the page width, between 50% and
|
|
377
|
+
* 100% — unless {@link DocxEditorConfig.zoom} is supplied, which means fixed.
|
|
378
|
+
*
|
|
379
|
+
* `'auto'` leaves a window wide enough for the sheet exactly where it is today and shrinks
|
|
380
|
+
* a narrower one instead of growing a horizontal scrollbar. Pass `{ type: 'fixed' }` for
|
|
381
|
+
* the old unconditional behaviour.
|
|
382
|
+
*/
|
|
383
|
+
zoomMode?: ZoomMode | 'auto';
|
|
384
|
+
onFontError?: (error: EditorFontError) => void;
|
|
385
|
+
/** Localized labels for table insertion furniture on the painted surface. */
|
|
386
|
+
tableInteractionLabel?: (key: 'table.insertRowBelow' | 'table.insertColumnRight') => string;
|
|
387
|
+
}
|
|
265
388
|
/**
|
|
266
|
-
*
|
|
267
|
-
*
|
|
268
|
-
* The legacy toolbar is not a row of uniform icon buttons: it mixes labelled dropdowns
|
|
269
|
-
* (`Normal`, `Arial`, alignment, line spacing), numeric steppers with visible values
|
|
270
|
-
* (zoom `- 100% +`, size `- 26 +`), split colour controls (a glyph over a colour swatch
|
|
271
|
-
* with its own caret), and a mode pill (`Editing`). Rendering all of them as icon
|
|
272
|
-
* buttons is the difference an owner review called out as "not visual parity" — the
|
|
273
|
-
* regions were all present and it still did not look like the product.
|
|
389
|
+
* Which measurer the current document's layout runs on, and whether shaped resolution is
|
|
390
|
+
* still in flight. Returned by {@link DocxEditorInstance.fontMeasurement}.
|
|
274
391
|
*/
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
392
|
+
interface FontMeasurementState {
|
|
393
|
+
/** `fixed` estimates advance widths; `shaped` measures real font bytes with HarfBuzz. */
|
|
394
|
+
readonly measurer: 'fixed' | 'shaped';
|
|
395
|
+
/** True while font resolution for the current document is still running. */
|
|
396
|
+
readonly resolving: boolean;
|
|
397
|
+
/** The shaped measurer's identity (admitted face hashes); absent while fixed. */
|
|
398
|
+
readonly producer?: string;
|
|
399
|
+
}
|
|
280
400
|
/**
|
|
281
|
-
*
|
|
282
|
-
* enabled.
|
|
283
|
-
*
|
|
284
|
-
* Enabled state has exactly ONE source, `toolbarCommandState`, which asks the engine. A
|
|
285
|
-
* descriptor carrying its own disabled flag would be a second answer that goes stale the moment
|
|
286
|
-
* the engine wires the slot.
|
|
401
|
+
* The host chrome that answers the engine's hyperlink gestures.
|
|
287
402
|
*
|
|
288
|
-
*
|
|
403
|
+
* A CLICK on an external link and Ctrl/Cmd+K both mean "the user wants the link UI", and the
|
|
404
|
+
* engine deliberately does not know what that looks like. Registered rather than passed at
|
|
405
|
+
* construction because the chrome mounts after the editor does, and it survives a document
|
|
406
|
+
* reload — the surface is rebuilt, the handlers are not.
|
|
289
407
|
*/
|
|
290
|
-
interface
|
|
291
|
-
/**
|
|
292
|
-
readonly
|
|
293
|
-
/**
|
|
294
|
-
readonly
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
readonly
|
|
299
|
-
/** i18n key for the accessible name and tooltip. Never hardcoded English. */
|
|
300
|
-
readonly labelKey: string;
|
|
301
|
-
/** Material Symbols path data, or null for a non-icon control (a picker). */
|
|
302
|
-
readonly paths: readonly string[] | null;
|
|
303
|
-
/** For pickers: the i18n key of the placeholder value shown. */
|
|
304
|
-
readonly valueKey?: string;
|
|
305
|
-
readonly state: ChromeControlState;
|
|
408
|
+
interface HyperlinkChromeHandlers {
|
|
409
|
+
/** A plain click on an external or inert link: show the popover at `activation.rect`. */
|
|
410
|
+
readonly onPopover?: (activation: HyperlinkActivation) => void;
|
|
411
|
+
/** Ctrl/Cmd+K: open insert-or-edit for the selection. */
|
|
412
|
+
readonly onRequest?: () => void;
|
|
413
|
+
}
|
|
414
|
+
/** Host chrome that edits a clicked Office Math equation. */
|
|
415
|
+
interface EquationChromeHandlers {
|
|
416
|
+
readonly onPopover?: (activation: EquationActivation) => void;
|
|
306
417
|
}
|
|
307
418
|
/**
|
|
308
|
-
*
|
|
309
|
-
*
|
|
310
|
-
* Never hand-list controls in an adapter — a default toolbar is built by walking `CHROME_GROUPS`,
|
|
311
|
-
* so a slot added here appears in React and Vue without either being edited.
|
|
419
|
+
* The concrete facade type: the full `Editor` contract plus the instance-only surface.
|
|
312
420
|
*
|
|
313
|
-
*
|
|
421
|
+
* `surface`, `stateVersion`, `attach` and `detach` live HERE rather than on `Editor`:
|
|
422
|
+
* they are what a store binding and a mounting host need, not what document commands
|
|
423
|
+
* need. Production adapters program against `Editor` for everything else.
|
|
314
424
|
*/
|
|
315
|
-
interface
|
|
316
|
-
/**
|
|
317
|
-
readonly
|
|
318
|
-
readonly labelKey: string;
|
|
425
|
+
interface DocxEditorInstance extends Editor {
|
|
426
|
+
/** Bumps on mount, detach, destroy, and document reload — guards async image intents. */
|
|
427
|
+
readonly mountGeneration: number;
|
|
319
428
|
/**
|
|
320
|
-
*
|
|
321
|
-
*
|
|
322
|
-
* selection), or not at all (save belongs in the host's File menu, never in the
|
|
323
|
-
* bar). Their slots stay public for composition — a host can still place
|
|
324
|
-
* `image.insert` or `file.save` explicitly — but the default chrome is the
|
|
325
|
-
* registry's default bar, which ends at the editing-mode picker.
|
|
326
|
-
*/
|
|
327
|
-
readonly contextual?: true;
|
|
328
|
-
readonly controls: readonly ChromeControl<ControlId>[];
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* The complete chrome, in bar order. Literal-typed (`as const`) so the slot-id
|
|
332
|
-
* vocabulary below is derived from the data and cannot drift from it.
|
|
333
|
-
*
|
|
334
|
-
* Taxonomy taste: ids are short, lowercaseCamel, and never repeat their group's name
|
|
335
|
-
* (`alignment.left`, not `alignment.alignLeft`; `font.family`, not `font.fontFamily`).
|
|
336
|
-
*/
|
|
337
|
-
declare const CHROME_GROUPS: readonly [{
|
|
338
|
-
readonly id: "history";
|
|
339
|
-
readonly labelKey: "formattingBar.groups.history";
|
|
340
|
-
readonly controls: readonly [{
|
|
341
|
-
readonly id: "undo";
|
|
342
|
-
readonly labelKey: "formattingBar.undoShortcut";
|
|
343
|
-
readonly paths: readonly string[];
|
|
344
|
-
readonly state: {
|
|
345
|
-
readonly kind: "command";
|
|
346
|
-
};
|
|
347
|
-
}, {
|
|
348
|
-
readonly id: "redo";
|
|
349
|
-
readonly labelKey: "formattingBar.redoShortcut";
|
|
350
|
-
readonly paths: readonly string[];
|
|
351
|
-
readonly state: {
|
|
352
|
-
readonly kind: "command";
|
|
353
|
-
};
|
|
354
|
-
}];
|
|
355
|
-
}, {
|
|
356
|
-
readonly id: "zoom";
|
|
357
|
-
readonly labelKey: "formattingBar.groups.zoom";
|
|
358
|
-
readonly controls: readonly [{
|
|
359
|
-
readonly id: "level";
|
|
360
|
-
readonly shape: "stepper";
|
|
361
|
-
readonly valueText: "100%";
|
|
362
|
-
readonly labelKey: "formattingBar.groups.zoom";
|
|
363
|
-
readonly paths: null;
|
|
364
|
-
readonly valueKey: "zoom.zoomLevel";
|
|
365
|
-
readonly state: {
|
|
366
|
-
readonly kind: "command";
|
|
367
|
-
};
|
|
368
|
-
}];
|
|
369
|
-
}, {
|
|
370
|
-
readonly id: "styles";
|
|
371
|
-
readonly labelKey: "formattingBar.groups.styles";
|
|
372
|
-
readonly controls: readonly [{
|
|
373
|
-
readonly id: "style";
|
|
374
|
-
readonly shape: "dropdown";
|
|
375
|
-
readonly labelKey: "styles.selectAriaLabel";
|
|
376
|
-
readonly paths: null;
|
|
377
|
-
readonly valueKey: "styles.normalText";
|
|
378
|
-
readonly state: {
|
|
379
|
-
readonly kind: "value";
|
|
380
|
-
};
|
|
381
|
-
}];
|
|
382
|
-
}, {
|
|
383
|
-
readonly id: "font";
|
|
384
|
-
readonly labelKey: "formattingBar.groups.font";
|
|
385
|
-
readonly controls: readonly [{
|
|
386
|
-
readonly id: "family";
|
|
387
|
-
readonly shape: "dropdown";
|
|
388
|
-
readonly labelKey: "font.selectAriaLabel";
|
|
389
|
-
readonly paths: null;
|
|
390
|
-
readonly valueKey: "font.sansSerif";
|
|
391
|
-
readonly state: {
|
|
392
|
-
readonly kind: "value";
|
|
393
|
-
};
|
|
394
|
-
}, {
|
|
395
|
-
readonly id: "size";
|
|
396
|
-
readonly shape: "stepper";
|
|
397
|
-
readonly valueText: "11";
|
|
398
|
-
readonly labelKey: "fontSize.listLabel";
|
|
399
|
-
readonly paths: null;
|
|
400
|
-
readonly valueKey: "fontSize.label";
|
|
401
|
-
readonly state: {
|
|
402
|
-
readonly kind: "value";
|
|
403
|
-
};
|
|
404
|
-
}];
|
|
405
|
-
}, {
|
|
406
|
-
readonly id: "text";
|
|
407
|
-
readonly labelKey: "formattingBar.groups.textFormatting";
|
|
408
|
-
readonly controls: readonly [{
|
|
409
|
-
readonly id: "bold";
|
|
410
|
-
readonly labelKey: "formattingBar.boldShortcut";
|
|
411
|
-
readonly paths: readonly string[];
|
|
412
|
-
readonly state: {
|
|
413
|
-
readonly kind: "command";
|
|
414
|
-
};
|
|
415
|
-
}, {
|
|
416
|
-
readonly id: "italic";
|
|
417
|
-
readonly labelKey: "formattingBar.italicShortcut";
|
|
418
|
-
readonly paths: readonly string[];
|
|
419
|
-
readonly state: {
|
|
420
|
-
readonly kind: "command";
|
|
421
|
-
};
|
|
422
|
-
}, {
|
|
423
|
-
readonly id: "underline";
|
|
424
|
-
readonly labelKey: "formattingBar.underlineShortcut";
|
|
425
|
-
readonly paths: readonly string[];
|
|
426
|
-
readonly state: {
|
|
427
|
-
readonly kind: "command";
|
|
428
|
-
};
|
|
429
|
-
}, {
|
|
430
|
-
readonly id: "strike";
|
|
431
|
-
readonly labelKey: "formattingBar.strikethrough";
|
|
432
|
-
readonly paths: readonly string[];
|
|
433
|
-
readonly state: {
|
|
434
|
-
readonly kind: "command";
|
|
435
|
-
};
|
|
436
|
-
}, {
|
|
437
|
-
readonly id: "color";
|
|
438
|
-
readonly shape: "colorSplit";
|
|
439
|
-
readonly swatch: "#ff0000";
|
|
440
|
-
readonly labelKey: "formattingBar.fontColor";
|
|
441
|
-
readonly paths: readonly string[];
|
|
442
|
-
readonly state: {
|
|
443
|
-
readonly kind: "value";
|
|
444
|
-
};
|
|
445
|
-
}, {
|
|
446
|
-
readonly id: "highlight";
|
|
447
|
-
readonly shape: "colorSplit";
|
|
448
|
-
readonly swatch: "#ffff00";
|
|
449
|
-
readonly labelKey: "formattingBar.highlightColor";
|
|
450
|
-
readonly paths: readonly string[];
|
|
451
|
-
readonly state: {
|
|
452
|
-
readonly kind: "value";
|
|
453
|
-
};
|
|
454
|
-
}, {
|
|
455
|
-
readonly id: "link";
|
|
456
|
-
readonly labelKey: "formattingBar.insertLinkShortcut";
|
|
457
|
-
readonly paths: readonly string[];
|
|
458
|
-
readonly state: {
|
|
459
|
-
readonly kind: "command";
|
|
460
|
-
};
|
|
461
|
-
}];
|
|
462
|
-
}, {
|
|
463
|
-
readonly id: "script";
|
|
464
|
-
readonly labelKey: "formattingBar.groups.script";
|
|
465
|
-
readonly controls: readonly [{
|
|
466
|
-
readonly id: "super";
|
|
467
|
-
readonly labelKey: "formattingBar.superscript";
|
|
468
|
-
readonly paths: readonly string[];
|
|
469
|
-
readonly state: {
|
|
470
|
-
readonly kind: "command";
|
|
471
|
-
};
|
|
472
|
-
}, {
|
|
473
|
-
readonly id: "sub";
|
|
474
|
-
readonly labelKey: "formattingBar.subscript";
|
|
475
|
-
readonly paths: readonly string[];
|
|
476
|
-
readonly state: {
|
|
477
|
-
readonly kind: "command";
|
|
478
|
-
};
|
|
479
|
-
}];
|
|
480
|
-
}, {
|
|
481
|
-
readonly id: "alignment";
|
|
482
|
-
readonly labelKey: "formattingBar.groups.alignment";
|
|
483
|
-
readonly controls: readonly [{
|
|
484
|
-
readonly id: "left";
|
|
485
|
-
readonly labelKey: "alignment.alignLeft";
|
|
486
|
-
readonly paths: readonly string[];
|
|
487
|
-
readonly state: {
|
|
488
|
-
readonly kind: "command";
|
|
489
|
-
};
|
|
490
|
-
}, {
|
|
491
|
-
readonly id: "center";
|
|
492
|
-
readonly labelKey: "alignment.center";
|
|
493
|
-
readonly paths: readonly string[];
|
|
494
|
-
readonly state: {
|
|
495
|
-
readonly kind: "command";
|
|
496
|
-
};
|
|
497
|
-
}, {
|
|
498
|
-
readonly id: "right";
|
|
499
|
-
readonly labelKey: "alignment.alignRight";
|
|
500
|
-
readonly paths: readonly string[];
|
|
501
|
-
readonly state: {
|
|
502
|
-
readonly kind: "command";
|
|
503
|
-
};
|
|
504
|
-
}, {
|
|
505
|
-
readonly id: "justify";
|
|
506
|
-
readonly labelKey: "alignment.justify";
|
|
507
|
-
readonly paths: readonly string[];
|
|
508
|
-
readonly state: {
|
|
509
|
-
readonly kind: "command";
|
|
510
|
-
};
|
|
511
|
-
}];
|
|
512
|
-
}, {
|
|
513
|
-
readonly id: "list";
|
|
514
|
-
readonly labelKey: "formattingBar.groups.listFormatting";
|
|
515
|
-
readonly controls: readonly [{
|
|
516
|
-
readonly id: "bullet";
|
|
517
|
-
readonly labelKey: "lists.bulletList";
|
|
518
|
-
readonly paths: readonly string[];
|
|
519
|
-
readonly state: {
|
|
520
|
-
readonly kind: "command";
|
|
521
|
-
};
|
|
522
|
-
}, {
|
|
523
|
-
readonly id: "numbered";
|
|
524
|
-
readonly labelKey: "lists.numberedList";
|
|
525
|
-
readonly paths: readonly string[];
|
|
526
|
-
readonly state: {
|
|
527
|
-
readonly kind: "command";
|
|
528
|
-
};
|
|
529
|
-
}, {
|
|
530
|
-
readonly id: "outdent";
|
|
531
|
-
readonly labelKey: "lists.decreaseIndent";
|
|
532
|
-
readonly paths: readonly string[];
|
|
533
|
-
readonly state: {
|
|
534
|
-
readonly kind: "command";
|
|
535
|
-
};
|
|
536
|
-
}, {
|
|
537
|
-
readonly id: "indent";
|
|
538
|
-
readonly labelKey: "lists.increaseIndent";
|
|
539
|
-
readonly paths: readonly string[];
|
|
540
|
-
readonly state: {
|
|
541
|
-
readonly kind: "command";
|
|
542
|
-
};
|
|
543
|
-
}, {
|
|
544
|
-
readonly id: "lineSpacing";
|
|
545
|
-
readonly shape: "dropdown";
|
|
546
|
-
readonly labelKey: "lineSpacing.label";
|
|
547
|
-
readonly paths: readonly string[];
|
|
548
|
-
readonly state: {
|
|
549
|
-
readonly kind: "command";
|
|
550
|
-
};
|
|
551
|
-
}];
|
|
552
|
-
}, {
|
|
553
|
-
readonly id: "format";
|
|
554
|
-
readonly labelKey: "formattingBar.clearFormatting";
|
|
555
|
-
readonly controls: readonly [{
|
|
556
|
-
readonly id: "clear";
|
|
557
|
-
readonly labelKey: "formattingBar.clearFormatting";
|
|
558
|
-
readonly paths: readonly string[];
|
|
559
|
-
readonly state: {
|
|
560
|
-
readonly kind: "command";
|
|
561
|
-
};
|
|
562
|
-
}];
|
|
563
|
-
}, {
|
|
564
|
-
readonly id: "review";
|
|
565
|
-
readonly labelKey: "formattingBar.commentsAndChanges";
|
|
566
|
-
readonly controls: readonly [{
|
|
567
|
-
readonly id: "comments";
|
|
568
|
-
readonly shape: "icon";
|
|
569
|
-
readonly labelKey: "formattingBar.commentsAndChanges";
|
|
570
|
-
readonly paths: readonly string[];
|
|
571
|
-
readonly state: {
|
|
572
|
-
readonly kind: "command";
|
|
573
|
-
};
|
|
574
|
-
}, {
|
|
575
|
-
readonly id: "editingMode";
|
|
576
|
-
readonly shape: "dropdown";
|
|
577
|
-
readonly labelKey: "editingMode.label";
|
|
578
|
-
readonly valueKey: "editingMode.editing";
|
|
579
|
-
readonly paths: readonly string[];
|
|
580
|
-
readonly state: {
|
|
581
|
-
readonly kind: "command";
|
|
582
|
-
};
|
|
583
|
-
}];
|
|
584
|
-
}, {
|
|
585
|
-
readonly id: "contentControl";
|
|
586
|
-
readonly labelKey: "contentControl.group";
|
|
587
|
-
readonly contextual: true;
|
|
588
|
-
readonly controls: readonly [{
|
|
589
|
-
readonly id: "showAll";
|
|
590
|
-
readonly labelKey: "contentControl.showAll";
|
|
591
|
-
readonly paths: readonly string[];
|
|
592
|
-
readonly state: {
|
|
593
|
-
readonly kind: "command";
|
|
594
|
-
};
|
|
595
|
-
}, {
|
|
596
|
-
readonly id: "formFill";
|
|
597
|
-
readonly labelKey: "contentControl.formFill";
|
|
598
|
-
readonly paths: readonly string[];
|
|
599
|
-
readonly state: {
|
|
600
|
-
readonly kind: "command";
|
|
601
|
-
};
|
|
602
|
-
}, {
|
|
603
|
-
readonly id: "inspector";
|
|
604
|
-
readonly labelKey: "contentControl.inspector";
|
|
605
|
-
readonly paths: readonly string[];
|
|
606
|
-
readonly state: {
|
|
607
|
-
readonly kind: "command";
|
|
608
|
-
};
|
|
609
|
-
}, {
|
|
610
|
-
readonly id: "remove";
|
|
611
|
-
readonly labelKey: "contentControl.remove";
|
|
612
|
-
readonly paths: readonly string[];
|
|
613
|
-
readonly state: {
|
|
614
|
-
readonly kind: "command";
|
|
615
|
-
};
|
|
616
|
-
}];
|
|
617
|
-
}, {
|
|
618
|
-
readonly id: "image";
|
|
619
|
-
readonly labelKey: "formattingBar.groups.image";
|
|
620
|
-
readonly contextual: true;
|
|
621
|
-
readonly controls: readonly [{
|
|
622
|
-
readonly id: "insert";
|
|
623
|
-
readonly labelKey: "toolbar.image";
|
|
624
|
-
readonly paths: readonly string[];
|
|
625
|
-
readonly state: {
|
|
626
|
-
readonly kind: "command";
|
|
627
|
-
};
|
|
628
|
-
}, {
|
|
629
|
-
readonly id: "properties";
|
|
630
|
-
readonly labelKey: "formattingBar.imagePropertiesShortcut";
|
|
631
|
-
readonly paths: readonly string[];
|
|
632
|
-
readonly state: {
|
|
633
|
-
readonly kind: "command";
|
|
634
|
-
};
|
|
635
|
-
}, {
|
|
636
|
-
readonly id: "wrap";
|
|
637
|
-
readonly shape: "dropdown";
|
|
638
|
-
readonly labelKey: "formattingBar.imageWrap";
|
|
639
|
-
readonly paths: readonly string[];
|
|
640
|
-
readonly valueKey: "imageWrap.inline";
|
|
641
|
-
readonly state: {
|
|
642
|
-
readonly kind: "value";
|
|
643
|
-
};
|
|
644
|
-
}, {
|
|
645
|
-
readonly id: "altText";
|
|
646
|
-
readonly shape: "dropdown";
|
|
647
|
-
readonly labelKey: "formattingBar.altText";
|
|
648
|
-
readonly paths: null;
|
|
649
|
-
readonly valueKey: "imageProperties.altText";
|
|
650
|
-
readonly state: {
|
|
651
|
-
readonly kind: "value";
|
|
652
|
-
};
|
|
653
|
-
}];
|
|
654
|
-
}, {
|
|
655
|
-
readonly id: "table";
|
|
656
|
-
readonly labelKey: "formattingBar.groups.table";
|
|
657
|
-
readonly contextual: true;
|
|
658
|
-
readonly controls: readonly [{
|
|
659
|
-
readonly id: "insert";
|
|
660
|
-
readonly labelKey: "toolbar.table";
|
|
661
|
-
readonly paths: readonly string[];
|
|
662
|
-
readonly state: {
|
|
663
|
-
readonly kind: "command";
|
|
664
|
-
};
|
|
665
|
-
}, {
|
|
666
|
-
readonly id: "borderTarget";
|
|
667
|
-
readonly shape: "dropdown";
|
|
668
|
-
readonly labelKey: "table.borders.tooltip";
|
|
669
|
-
readonly paths: readonly string[];
|
|
670
|
-
readonly state: {
|
|
671
|
-
readonly kind: "value";
|
|
672
|
-
};
|
|
673
|
-
}, {
|
|
674
|
-
readonly id: "borderColor";
|
|
675
|
-
readonly shape: "colorSplit";
|
|
676
|
-
readonly swatch: "#000000";
|
|
677
|
-
readonly labelKey: "table.borderColor";
|
|
678
|
-
readonly paths: readonly string[];
|
|
679
|
-
readonly state: {
|
|
680
|
-
readonly kind: "value";
|
|
681
|
-
};
|
|
682
|
-
}, {
|
|
683
|
-
readonly id: "borderStyle";
|
|
684
|
-
readonly shape: "dropdown";
|
|
685
|
-
readonly labelKey: "table.borders.styleAriaLabel";
|
|
686
|
-
readonly paths: readonly string[];
|
|
687
|
-
readonly state: {
|
|
688
|
-
readonly kind: "value";
|
|
689
|
-
};
|
|
690
|
-
}, {
|
|
691
|
-
readonly id: "borderWidth";
|
|
692
|
-
readonly shape: "dropdown";
|
|
693
|
-
readonly labelKey: "table.borderWidth";
|
|
694
|
-
readonly paths: readonly string[];
|
|
695
|
-
readonly state: {
|
|
696
|
-
readonly kind: "value";
|
|
697
|
-
};
|
|
698
|
-
}, {
|
|
699
|
-
readonly id: "cellFill";
|
|
700
|
-
readonly shape: "colorSplit";
|
|
701
|
-
readonly swatch: "#ffffff";
|
|
702
|
-
readonly labelKey: "table.cellFillColor";
|
|
703
|
-
readonly paths: readonly string[];
|
|
704
|
-
readonly state: {
|
|
705
|
-
readonly kind: "value";
|
|
706
|
-
};
|
|
707
|
-
}];
|
|
708
|
-
}, {
|
|
709
|
-
readonly id: "file";
|
|
710
|
-
readonly labelKey: "toolbar.file";
|
|
711
|
-
readonly contextual: true;
|
|
712
|
-
readonly controls: readonly [{
|
|
713
|
-
readonly id: "open";
|
|
714
|
-
readonly labelKey: "toolbar.open";
|
|
715
|
-
readonly paths: readonly string[];
|
|
716
|
-
readonly state: {
|
|
717
|
-
readonly kind: "load";
|
|
718
|
-
};
|
|
719
|
-
}, {
|
|
720
|
-
readonly id: "save";
|
|
721
|
-
readonly labelKey: "toolbar.saveShortcut";
|
|
722
|
-
readonly paths: readonly string[];
|
|
723
|
-
readonly state: {
|
|
724
|
-
readonly kind: "save";
|
|
725
|
-
};
|
|
726
|
-
}, {
|
|
727
|
-
readonly id: "pageSetup";
|
|
728
|
-
readonly labelKey: "toolbar.pageSetup";
|
|
729
|
-
readonly paths: readonly string[];
|
|
730
|
-
readonly state: {
|
|
731
|
-
readonly kind: "command";
|
|
732
|
-
};
|
|
733
|
-
}];
|
|
734
|
-
}, {
|
|
735
|
-
readonly id: "insert";
|
|
736
|
-
readonly labelKey: "toolbar.insert";
|
|
737
|
-
readonly contextual: true;
|
|
738
|
-
readonly controls: readonly [{
|
|
739
|
-
readonly id: "footnote";
|
|
740
|
-
readonly labelKey: "toolbar.insertFootnote";
|
|
741
|
-
readonly paths: readonly string[];
|
|
742
|
-
readonly state: {
|
|
743
|
-
readonly kind: "command";
|
|
744
|
-
};
|
|
745
|
-
}, {
|
|
746
|
-
readonly id: "endnote";
|
|
747
|
-
readonly labelKey: "toolbar.insertEndnote";
|
|
748
|
-
readonly paths: readonly string[];
|
|
749
|
-
readonly state: {
|
|
750
|
-
readonly kind: "command";
|
|
751
|
-
};
|
|
752
|
-
}, {
|
|
753
|
-
readonly id: "pageNumber";
|
|
754
|
-
readonly labelKey: "headerFooter.insertPageNumber";
|
|
755
|
-
readonly paths: readonly string[];
|
|
756
|
-
readonly state: {
|
|
757
|
-
readonly kind: "command";
|
|
758
|
-
};
|
|
759
|
-
}, {
|
|
760
|
-
readonly id: "totalPages";
|
|
761
|
-
readonly labelKey: "headerFooter.insertTotalPages";
|
|
762
|
-
readonly paths: readonly string[];
|
|
763
|
-
readonly state: {
|
|
764
|
-
readonly kind: "command";
|
|
765
|
-
};
|
|
766
|
-
}, {
|
|
767
|
-
readonly id: "sectionPages";
|
|
768
|
-
readonly labelKey: "headerFooter.insertSectionPages";
|
|
769
|
-
readonly paths: readonly string[];
|
|
770
|
-
readonly state: {
|
|
771
|
-
readonly kind: "command";
|
|
772
|
-
};
|
|
773
|
-
}, {
|
|
774
|
-
readonly id: "pageXofY";
|
|
775
|
-
readonly labelKey: "headerFooter.insertPageXofY";
|
|
776
|
-
readonly paths: readonly string[];
|
|
777
|
-
readonly state: {
|
|
778
|
-
readonly kind: "command";
|
|
779
|
-
};
|
|
780
|
-
}, {
|
|
781
|
-
readonly id: "pageBreak";
|
|
782
|
-
readonly labelKey: "toolbar.pageBreak";
|
|
783
|
-
readonly paths: readonly string[];
|
|
784
|
-
readonly state: {
|
|
785
|
-
readonly kind: "command";
|
|
786
|
-
};
|
|
787
|
-
}, {
|
|
788
|
-
readonly id: "sectionBreakNextPage";
|
|
789
|
-
readonly labelKey: "toolbar.sectionBreakNextPage";
|
|
790
|
-
readonly paths: readonly string[];
|
|
791
|
-
readonly state: {
|
|
792
|
-
readonly kind: "command";
|
|
793
|
-
};
|
|
794
|
-
}, {
|
|
795
|
-
readonly id: "sectionBreakContinuous";
|
|
796
|
-
readonly labelKey: "toolbar.sectionBreakContinuous";
|
|
797
|
-
readonly paths: readonly string[];
|
|
798
|
-
readonly state: {
|
|
799
|
-
readonly kind: "command";
|
|
800
|
-
};
|
|
801
|
-
}, {
|
|
802
|
-
readonly id: "toc";
|
|
803
|
-
readonly labelKey: "toolbar.tableOfContents";
|
|
804
|
-
readonly paths: readonly string[];
|
|
805
|
-
readonly state: {
|
|
806
|
-
readonly kind: "command";
|
|
807
|
-
};
|
|
808
|
-
}];
|
|
809
|
-
}];
|
|
810
|
-
/**
|
|
811
|
-
* Every group id in the chrome, as a literal union. Stable public API; renaming a group
|
|
812
|
-
* id is a breaking change.
|
|
813
|
-
*
|
|
814
|
-
* @public
|
|
815
|
-
*/
|
|
816
|
-
type ChromeGroupId = 'history' | 'zoom' | 'styles' | 'font' | 'text' | 'script' | 'alignment' | 'list' | 'format' | 'review' | 'contentControl' | 'image' | 'table' | 'file' | 'insert';
|
|
817
|
-
/**
|
|
818
|
-
* The public slot vocabulary: `${groupId}.${controlId}` for every control that actually
|
|
819
|
-
* exists — `text.bold`, `font.family`, `alignment.left`. THE stable contract a host
|
|
820
|
-
* composes against and `commandForSlot` resolves; renaming a slot is a breaking change.
|
|
821
|
-
*
|
|
822
|
-
* @public
|
|
823
|
-
*/
|
|
824
|
-
type ChromeSlotId = 'history.undo' | 'history.redo' | 'zoom.level' | 'styles.style' | 'font.family' | 'font.size' | 'text.bold' | 'text.italic' | 'text.underline' | 'text.strike' | 'text.color' | 'text.highlight' | 'text.link' | 'script.super' | 'script.sub' | 'alignment.left' | 'alignment.center' | 'alignment.right' | 'alignment.justify' | 'list.bullet' | 'list.numbered' | 'list.outdent' | 'list.indent' | 'list.lineSpacing' | 'format.clear' | 'review.comments' | 'review.editingMode' | 'contentControl.showAll' | 'contentControl.formFill' | 'contentControl.inspector' | 'contentControl.remove' | 'image.insert' | 'image.properties' | 'image.wrap' | 'image.altText' | 'table.insert' | 'table.borderTarget' | 'table.borderColor' | 'table.borderStyle' | 'table.borderWidth' | 'table.cellFill' | 'file.open' | 'file.save' | 'file.pageSetup' | 'insert.footnote' | 'insert.endnote' | 'insert.pageNumber' | 'insert.totalPages' | 'insert.sectionPages' | 'insert.pageXofY' | 'insert.pageBreak' | 'insert.sectionBreakNextPage' | 'insert.sectionBreakContinuous' | 'insert.toc';
|
|
825
|
-
/**
|
|
826
|
-
* Every control id in the chrome, as a literal union. Unique WITHIN a group, not
|
|
827
|
-
* globally (`image.insert` / `table.insert`) — key consumers on {@link ChromeSlotId}.
|
|
828
|
-
*
|
|
829
|
-
* @public
|
|
830
|
-
*/
|
|
831
|
-
type ChromeControlId = ChromeSlotId extends `${string}.${infer C}` ? C : never;
|
|
832
|
-
/**
|
|
833
|
-
* The slot id of one control within its group. Only meaningful for entries of
|
|
834
|
-
* `CHROME_GROUPS` — the cast is sound because every group/control pair in the registry
|
|
835
|
-
* is, by construction, a member of the `ChromeSlotId` union.
|
|
836
|
-
*
|
|
837
|
-
* @public
|
|
838
|
-
*/
|
|
839
|
-
declare function chromeSlotId(group: {
|
|
840
|
-
readonly id: string;
|
|
841
|
-
}, control: {
|
|
842
|
-
readonly id: string;
|
|
843
|
-
}): ChromeSlotId;
|
|
844
|
-
/**
|
|
845
|
-
* The groups of the DEFAULT toolbar arrangement, in bar order: every group that is
|
|
846
|
-
* not `contextual`. This is the registry's default bar — undo/redo through the
|
|
847
|
-
* editing-mode picker — and what both adapters render when the host composes
|
|
848
|
-
* nothing. Contextual slots (`image.*`, `table.insert`, `file.save`) remain
|
|
849
|
-
* available for explicit composition.
|
|
850
|
-
*
|
|
851
|
-
* @public
|
|
852
|
-
*/
|
|
853
|
-
declare function defaultChromeGroups(): readonly ChromeGroup[];
|
|
854
|
-
/**
|
|
855
|
-
* The formatting-bar groups for one editor snapshot: the default bar, plus the
|
|
856
|
-
* contextual `image` group when a drawing is selected. Insertion without a selection is
|
|
857
|
-
* not in the packaged chrome at all — a host that wants it places `image.insert` itself,
|
|
858
|
-
* through `DocxEditor.Toolbar.ImageInsert` or `DocxEditor.Menu.ImageInsert`.
|
|
859
|
-
*
|
|
860
|
-
* @public
|
|
861
|
-
*/
|
|
862
|
-
declare function formattingBarChromeGroups(image: ImageContext | null): readonly ChromeGroup[];
|
|
863
|
-
/**
|
|
864
|
-
* A row that runs one chrome slot.
|
|
865
|
-
*
|
|
866
|
-
* @public
|
|
867
|
-
*/
|
|
868
|
-
interface ChromeMenuItemEntry {
|
|
869
|
-
readonly kind: 'item';
|
|
870
|
-
readonly slot: ChromeSlotId;
|
|
871
|
-
/**
|
|
872
|
-
* Plain-label override for this row.
|
|
873
|
-
*
|
|
874
|
-
* A slot's own `labelKey` is a TOOLTIP key, and several of them fold the shortcut into
|
|
875
|
-
* the text (`formattingBar.boldShortcut` is "Bold (Ctrl+B)"). A menu puts the shortcut
|
|
876
|
-
* in its own right-hand column, so the row needs the bare noun. Both keys already exist
|
|
877
|
-
* in the catalogue — this points at the plain one rather than minting a duplicate.
|
|
878
|
-
*/
|
|
879
|
-
readonly labelKey?: string;
|
|
880
|
-
/** i18n key of the shortcut shown right-aligned on the row (`toolbar.saveShortcut`). */
|
|
881
|
-
readonly shortcutKey?: string;
|
|
882
|
-
/**
|
|
883
|
-
* The row opens a size PICKER instead of firing on click — Word's insert-table grid.
|
|
884
|
-
* The slot still owns the label, the icon and the enabled state; only the dispatch
|
|
885
|
-
* differs, and the picked size is what the host sends.
|
|
886
|
-
*/
|
|
887
|
-
readonly picker?: 'tableGrid';
|
|
888
|
-
}
|
|
889
|
-
/**
|
|
890
|
-
* A row that opens a nested panel of rows (Insert › Break).
|
|
891
|
-
*
|
|
892
|
-
* It carries its own label and icon rather than a slot, because a submenu PARENT has no
|
|
893
|
-
* command: clicking it opens the panel. Giving it a slot would mint a public id for a
|
|
894
|
-
* control that can never be enabled, and `toolbarCommandState` would have to invent an
|
|
895
|
-
* answer about it.
|
|
896
|
-
*
|
|
897
|
-
* @public
|
|
898
|
-
*/
|
|
899
|
-
interface ChromeMenuSubmenuEntry {
|
|
900
|
-
readonly kind: 'submenu';
|
|
901
|
-
readonly labelKey: string;
|
|
902
|
-
readonly paths: readonly string[] | null;
|
|
903
|
-
readonly items: readonly ChromeMenuEntry[];
|
|
904
|
-
}
|
|
905
|
-
/** A horizontal rule between groups of rows. @public */
|
|
906
|
-
interface ChromeMenuSeparatorEntry {
|
|
907
|
-
readonly kind: 'separator';
|
|
908
|
-
}
|
|
909
|
-
/** One row of a chrome menu. @public */
|
|
910
|
-
type ChromeMenuEntry = ChromeMenuItemEntry | ChromeMenuSubmenuEntry | ChromeMenuSeparatorEntry;
|
|
911
|
-
/**
|
|
912
|
-
* Every menu id, as a literal union. Stable public API; renaming one is a breaking change,
|
|
913
|
-
* exactly like a group or slot id.
|
|
914
|
-
*
|
|
915
|
-
* @public
|
|
916
|
-
*/
|
|
917
|
-
type ChromeMenuId = 'file' | 'format' | 'insert' | 'help';
|
|
918
|
-
/** One menu of the menu bar. @public */
|
|
919
|
-
interface ChromeMenu {
|
|
920
|
-
readonly id: ChromeMenuId;
|
|
921
|
-
readonly labelKey: string;
|
|
922
|
-
readonly entries: readonly ChromeMenuEntry[];
|
|
923
|
-
}
|
|
924
|
-
/**
|
|
925
|
-
* The menu bar the chrome shows above the toolbar, in bar order: File, Format, Insert,
|
|
926
|
-
* Help.
|
|
927
|
-
*
|
|
928
|
-
* @public
|
|
929
|
-
*/
|
|
930
|
-
declare const CHROME_MENUS: readonly ChromeMenu[];
|
|
931
|
-
/**
|
|
932
|
-
* Every slot a menu places, in menu order, submenus flattened. What a parity test asserts
|
|
933
|
-
* against, and what a host enumerates to know which capabilities the menu bar reaches.
|
|
934
|
-
*
|
|
935
|
-
* @public
|
|
936
|
-
*/
|
|
937
|
-
declare function chromeMenuSlots(): readonly ChromeSlotId[];
|
|
938
|
-
/** Total controls, so a parity test can assert none were dropped. */
|
|
939
|
-
declare function chromeControlCount(): number;
|
|
940
|
-
/**
|
|
941
|
-
* i18n key for the tooltip on a control an ADAPTER renders but cannot drive yet — a
|
|
942
|
-
* value slot in a toolbar that has grown no picker for it, say. It is never the reason
|
|
943
|
-
* a control is disabled: when the ENGINE refuses, the tooltip is the engine's own
|
|
944
|
-
* `disabledReason`, never an adapter paraphrase.
|
|
945
|
-
*/
|
|
946
|
-
declare const CHROME_UNAVAILABLE_KEY = "formattingBar.unavailableInPreview";
|
|
947
|
-
|
|
948
|
-
type TableCommandSelectionPolicy = {
|
|
949
|
-
readonly kind: 'preserveSelection';
|
|
950
|
-
} | {
|
|
951
|
-
readonly kind: 'adoptCommittedCaret';
|
|
952
|
-
};
|
|
953
|
-
type TableCommandPlan = {
|
|
954
|
-
readonly ok: true;
|
|
955
|
-
readonly ops: readonly TreeDocOp[];
|
|
956
|
-
readonly selection: TableCommandSelectionPolicy;
|
|
957
|
-
} | {
|
|
958
|
-
readonly ok: false;
|
|
959
|
-
readonly code: 'unsupported' | 'invalidArgs' | 'locked';
|
|
960
|
-
readonly reason: string;
|
|
961
|
-
};
|
|
962
|
-
|
|
963
|
-
type NotePropertiesSlice = {
|
|
964
|
-
readonly resolved: ResolvedFootnoteProperties | ResolvedEndnoteProperties;
|
|
965
|
-
readonly documentAuthored?: AuthoredNoteProperties;
|
|
966
|
-
readonly sectionAuthored?: AuthoredNoteProperties;
|
|
967
|
-
};
|
|
968
|
-
type NotePropertiesStateSnapshot = {
|
|
969
|
-
readonly sectionIndex: number;
|
|
970
|
-
readonly footnote: NotePropertiesSlice;
|
|
971
|
-
readonly endnote: NotePropertiesSlice;
|
|
972
|
-
};
|
|
973
|
-
|
|
974
|
-
/**
|
|
975
|
-
* A hyperlink as the surface reports it: its identity, where it sits, and the SANITIZED
|
|
976
|
-
* target. `href: null` is an inert link — a refused scheme or a dangling relationship — which
|
|
977
|
-
* a UI shows and offers to edit but must never offer to open.
|
|
978
|
-
*/
|
|
979
|
-
interface SurfaceHyperlink {
|
|
980
|
-
/** Canonical node id of the `w:hyperlink`. */
|
|
981
|
-
readonly id: string;
|
|
982
|
-
readonly paragraphId: string;
|
|
983
|
-
/** UTF-16 range of the link's display text within its paragraph. */
|
|
984
|
-
readonly start: number;
|
|
985
|
-
readonly end: number;
|
|
986
|
-
readonly text: string;
|
|
987
|
-
readonly kind: 'external' | 'internal' | 'unresolved';
|
|
988
|
-
/** Sanitized projection: an absolute URL, `#anchor`, or null when inert. */
|
|
989
|
-
readonly href: string | null;
|
|
990
|
-
/** The authored target, for an editor to seed its input with. */
|
|
991
|
-
readonly authored: string;
|
|
992
|
-
readonly anchor?: string;
|
|
993
|
-
readonly tooltip?: string;
|
|
994
|
-
}
|
|
995
|
-
/**
|
|
996
|
-
* Reading and writing hyperlinks on the surface.
|
|
997
|
-
*
|
|
998
|
-
* Every href that leaves here has already been through `sanitizeHref` — targets come from files,
|
|
999
|
-
* so `javascript:`, `data:` and `vbscript:` are dropped at the parse boundary rather than trusted
|
|
1000
|
-
* to be filtered by whoever renders them.
|
|
1001
|
-
*/
|
|
1002
|
-
interface HyperlinkOps {
|
|
1003
|
-
/** Every link in the paragraph the caret is in. */
|
|
1004
|
-
linksInCaretParagraph(): SurfaceHyperlink[];
|
|
1005
|
-
/** The link the caret sits in, or null. */
|
|
1006
|
-
linkAtCaret(): SurfaceHyperlink | null;
|
|
1007
|
-
/**
|
|
1008
|
-
* The FIELD link whose painted atom the caret sits on, or null.
|
|
1009
|
-
*
|
|
1010
|
-
* Separate from {@link linkAtCaret} on purpose: a `HYPERLINK` field is not a tree node, so
|
|
1011
|
-
* the typed lane never returns one, and link-create must not mistake a field atom for an
|
|
1012
|
-
* editable link. Resolved from the layout projection, boundary-inclusive.
|
|
1013
|
-
*/
|
|
1014
|
-
fieldLinkAtCaret(): SurfaceHyperlink | null;
|
|
1015
|
-
/** The link with this node id, or null. */
|
|
1016
|
-
linkById(linkId: string): SurfaceHyperlink | null;
|
|
1017
|
-
/**
|
|
1018
|
-
* Apply a link to the selection, or retarget the one the caret is already in.
|
|
1019
|
-
*
|
|
1020
|
-
* `text` replaces the display text when supplied. Returns whether anything committed;
|
|
1021
|
-
* a refusal leaves the document exactly as it was.
|
|
1022
|
-
*/
|
|
1023
|
-
applyHyperlink(input: {
|
|
1024
|
-
readonly url?: string;
|
|
1025
|
-
readonly anchor?: string;
|
|
1026
|
-
readonly text?: string;
|
|
1027
|
-
readonly tooltip?: string;
|
|
1028
|
-
}): boolean;
|
|
1029
|
-
/** Take the link off the one at the caret (or a named one). Returns whether it committed. */
|
|
1030
|
-
removeHyperlink(linkId?: string): boolean;
|
|
1031
|
-
}
|
|
1032
|
-
|
|
1033
|
-
/** A click on a painted link, after native navigation was refused. */
|
|
1034
|
-
interface HyperlinkActivation {
|
|
1035
|
-
readonly link: SurfaceHyperlink;
|
|
1036
|
-
/** The clicked line fragment's viewport rect, so a popover can be placed under it. */
|
|
1037
|
-
readonly rect: {
|
|
1038
|
-
readonly left: number;
|
|
1039
|
-
readonly top: number;
|
|
1040
|
-
readonly bottom: number;
|
|
1041
|
-
readonly right: number;
|
|
1042
|
-
};
|
|
1043
|
-
}
|
|
1044
|
-
/**
|
|
1045
|
-
* Moving the caret and the viewport: to a position, to a bookmark, or out to an external target.
|
|
1046
|
-
*
|
|
1047
|
-
* {@link SurfaceNavigation.openExternal} is THE external-activation call site, and it refuses
|
|
1048
|
-
* anything but an already-sanitized href. Routing an authored target through some other path is
|
|
1049
|
-
* how a document gets to choose where a click goes.
|
|
1050
|
-
*/
|
|
1051
|
-
interface SurfaceNavigation {
|
|
1052
|
-
/** Snap to a semantic position using layout geometry, then place the caret there. */
|
|
1053
|
-
goToPosition(position: {
|
|
1054
|
-
paragraphId: string;
|
|
1055
|
-
offset: number;
|
|
1056
|
-
}): boolean;
|
|
1057
|
-
/**
|
|
1058
|
-
* Scroll a bookmark into view and place the caret at it. Answers false for a name no
|
|
1059
|
-
* bookmark declares — an inert click, which is what Word does with a dangling anchor.
|
|
1060
|
-
*/
|
|
1061
|
-
goToBookmark(name: string): boolean;
|
|
1062
|
-
/**
|
|
1063
|
-
* THE external-activation call site. Refuses anything but a sanitized projection, so a
|
|
1064
|
-
* caller cannot route an authored target through it by mistake.
|
|
1065
|
-
*/
|
|
1066
|
-
openExternal(href: string | null): boolean;
|
|
1067
|
-
destroy(): void;
|
|
1068
|
-
}
|
|
1069
|
-
|
|
1070
|
-
/**
|
|
1071
|
-
* Everything {@link createDocxEditor} accepts. Every field is optional.
|
|
1072
|
-
*
|
|
1073
|
-
* `container` is the one that changes the shape of the whole lifecycle: omitting it produces an
|
|
1074
|
-
* instance that does no DOM work until `attach(el)`, which is what lets a provider own the editor
|
|
1075
|
-
* before any component has rendered a mount point.
|
|
1076
|
-
*
|
|
1077
|
-
* @public
|
|
1078
|
-
*/
|
|
1079
|
-
interface DocxEditorConfig {
|
|
1080
|
-
/**
|
|
1081
|
-
* The element the paginated surface mounts into. The surface owns this subtree.
|
|
1082
|
-
*
|
|
1083
|
-
* Optional: an instance created WITHOUT a container stashes its document bytes and does
|
|
1084
|
-
* no DOM work until `attach(el)` — the provider-first shape, where the editor exists
|
|
1085
|
-
* before any component has rendered a mount point. With a container, the document mounts
|
|
1086
|
-
* immediately at construction, exactly as before.
|
|
1087
|
-
*/
|
|
1088
|
-
container?: HTMLElement;
|
|
1089
|
-
/**
|
|
1090
|
-
* A document to load at construction: DOCX bytes, or `'blank'` for Word's blank
|
|
1091
|
-
* template. A `DocumentHandle` cannot be re-opened (the handle is identity, not
|
|
1092
|
-
* content), so passing one emits a typed `error` event rather than silently loading
|
|
1093
|
-
* nothing. Omitting this mounts NO document, which is not the same as an empty one.
|
|
1094
|
-
*/
|
|
1095
|
-
document?: DocumentSource;
|
|
1096
|
-
/**
|
|
1097
|
-
* Font bytes for Word-accurate (HarfBuzz-shaped) line wrap and pagination. Omitted,
|
|
1098
|
-
* layout falls back to a fixed-width estimate; fonts embedded in the document are
|
|
1099
|
-
* wired in automatically either way. For Word's default faces (Calibri, Times New
|
|
1100
|
-
* Roman, …) pass `await loadDefaultFonts()` from `@docx-editor.dev/fonts` — a bare
|
|
1101
|
-
* fragment (`{ sources, substitutions }`) is accepted and composed with defaults, or
|
|
1102
|
-
* merge several origins yourself with `composeFontConfiguration`. Sampled per load;
|
|
1103
|
-
* failures degrade to the fixed measurer and report through `onFontError`.
|
|
1104
|
-
*
|
|
1105
|
-
* Pass a {@link FontResolver} instead to resolve ON DEMAND: the function is called once
|
|
1106
|
-
* per load, after the document is parsed, with the families it actually declares, and
|
|
1107
|
-
* only what it returns is loaded. A document naming nothing the resolver covers costs
|
|
1108
|
-
* nothing. Note that a fetching resolver makes opening a document perform network
|
|
1109
|
-
* requests — the engine never supplies one, so that stays your call.
|
|
1110
|
-
*/
|
|
1111
|
-
fonts?: FontConfiguration | FontConfigurationFragment | FontResolver;
|
|
1112
|
-
author?: string;
|
|
1113
|
-
locale?: string;
|
|
1114
|
-
/** Localized drawing refusal labels; defaults to English when omitted. */
|
|
1115
|
-
translate?: (key: string, params?: Record<string, string | number>) => string;
|
|
1116
|
-
/**
|
|
1117
|
-
* Capability modules to register — the seam `@docx-editor.dev/pro` plugs in
|
|
1118
|
-
* through. Omitted, the editor runs the free tier: lossless round-trip,
|
|
1119
|
-
* final-state revision rendering, review chrome disabled with the engine's
|
|
1120
|
-
* reason. See {@link EditorModule}.
|
|
1121
|
-
*/
|
|
1122
|
-
modules?: readonly EditorModule[];
|
|
1123
|
-
/**
|
|
1124
|
-
* The mode the editor opens in — one prop, matching the toolbar's three-state pill.
|
|
1125
|
-
*
|
|
1126
|
-
* - `'edit'` — opens in editing, even when the document's `w:trackRevisions` asks for
|
|
1127
|
-
* tracked changes; the reader still moves between modes from the toolbar.
|
|
1128
|
-
* - `'suggesting'` — opens in suggesting. It needs what suggesting always needs — a
|
|
1129
|
-
* review module and an {@link DocxEditorConfig.author} — and falls back to editing
|
|
1130
|
-
* with the reason published when either is missing.
|
|
1131
|
-
* - `'view'` — read-only: every mutating command through the facade is refused, and
|
|
1132
|
-
* the toolbar cannot leave viewing.
|
|
1133
|
-
* - Omitted — the DOCUMENT decides: a package carrying `w:trackRevisions` opens in
|
|
1134
|
-
* suggesting, everything else in editing.
|
|
1135
|
-
*/
|
|
1136
|
-
mode?: 'edit' | 'view' | 'suggesting';
|
|
1137
|
-
/**
|
|
1138
|
-
* How painted tracked changes are coloured. Presentation only — nothing is serialised.
|
|
1139
|
-
*
|
|
1140
|
-
* - `'author'` (the DEFAULT) — every change takes its author's colour from the
|
|
1141
|
-
* `--doc-review-author-N` ramp, by order of first appearance, as Word does. Restyle a
|
|
1142
|
-
* slot under `.docx-editor` to change the ramp.
|
|
1143
|
-
* - `'kind'` — insertions green, deletions red, so "added" and "removed" are what a
|
|
1144
|
-
* glance tells apart, whoever proposed them.
|
|
1145
|
-
* - {@link RevisionAuthorAssignments} — style the named authors; `others` decides
|
|
1146
|
-
* whether the rest take the ramp (the default) or the kind colours.
|
|
1147
|
-
*
|
|
1148
|
-
* The opening value. In React this is authored declaratively — `DocxEditor.ColorByChangeType`
|
|
1149
|
-
* and `DocxEditor.AuthorStyle` compose and apply it, seeding this config for the first
|
|
1150
|
-
* paint — so React hosts never pass it by hand; it is the entry for headless hosts. Read
|
|
1151
|
-
* the document's resolved roster with `getReviewAuthors`. Applies wherever revision
|
|
1152
|
-
* markup paints: the full all-markup view needs a review module registered; without one
|
|
1153
|
-
* the proposed view still marks surviving insertions.
|
|
1154
|
-
*/
|
|
1155
|
-
revisionStyles?: RevisionStyles;
|
|
1156
|
-
/** Override raster decode for insert/replace image commands; defaults to browser/headless. */
|
|
1157
|
-
imageDecodePort?: ImageDecodePort;
|
|
1158
|
-
/**
|
|
1159
|
-
* The scale to open at, as a fixed number.
|
|
1160
|
-
*
|
|
1161
|
-
* Supplying one also picks the mode: an editor given a `zoom` and no `zoomMode` opens
|
|
1162
|
-
* FIXED at that value and stays there. An embedder that pinned 100% keeps 100%.
|
|
1163
|
-
*/
|
|
1164
|
-
zoom?: number;
|
|
1165
|
-
/**
|
|
1166
|
-
* Where the scale comes from. Defaults to `'auto'` — fit the page width, between 50% and
|
|
1167
|
-
* 100% — unless {@link DocxEditorConfig.zoom} is supplied, which means fixed.
|
|
1168
|
-
*
|
|
1169
|
-
* `'auto'` leaves a window wide enough for the sheet exactly where it is today and shrinks
|
|
1170
|
-
* a narrower one instead of growing a horizontal scrollbar. Pass `{ type: 'fixed' }` for
|
|
1171
|
-
* the old unconditional behaviour.
|
|
1172
|
-
*/
|
|
1173
|
-
zoomMode?: ZoomMode | 'auto';
|
|
1174
|
-
onFontError?: (error: EditorFontError) => void;
|
|
1175
|
-
/** Localized labels for table insertion furniture on the painted surface. */
|
|
1176
|
-
tableInteractionLabel?: (key: 'table.insertRowBelow' | 'table.insertColumnRight') => string;
|
|
1177
|
-
}
|
|
1178
|
-
/**
|
|
1179
|
-
* Which measurer the current document's layout runs on, and whether shaped resolution is
|
|
1180
|
-
* still in flight. Returned by {@link DocxEditorInstance.fontMeasurement}.
|
|
1181
|
-
*/
|
|
1182
|
-
interface FontMeasurementState {
|
|
1183
|
-
/** `fixed` estimates advance widths; `shaped` measures real font bytes with HarfBuzz. */
|
|
1184
|
-
readonly measurer: 'fixed' | 'shaped';
|
|
1185
|
-
/** True while font resolution for the current document is still running. */
|
|
1186
|
-
readonly resolving: boolean;
|
|
1187
|
-
/** The shaped measurer's identity (admitted face hashes); absent while fixed. */
|
|
1188
|
-
readonly producer?: string;
|
|
1189
|
-
}
|
|
1190
|
-
/**
|
|
1191
|
-
* The host chrome that answers the engine's hyperlink gestures.
|
|
1192
|
-
*
|
|
1193
|
-
* A CLICK on an external link and Ctrl/Cmd+K both mean "the user wants the link UI", and the
|
|
1194
|
-
* engine deliberately does not know what that looks like. Registered rather than passed at
|
|
1195
|
-
* construction because the chrome mounts after the editor does, and it survives a document
|
|
1196
|
-
* reload — the surface is rebuilt, the handlers are not.
|
|
1197
|
-
*/
|
|
1198
|
-
interface HyperlinkChromeHandlers {
|
|
1199
|
-
/** A plain click on an external or inert link: show the popover at `activation.rect`. */
|
|
1200
|
-
readonly onPopover?: (activation: HyperlinkActivation) => void;
|
|
1201
|
-
/** Ctrl/Cmd+K: open insert-or-edit for the selection. */
|
|
1202
|
-
readonly onRequest?: () => void;
|
|
1203
|
-
}
|
|
1204
|
-
/**
|
|
1205
|
-
* The concrete facade type: the full `Editor` contract plus the instance-only surface.
|
|
1206
|
-
*
|
|
1207
|
-
* `surface`, `stateVersion`, `attach` and `detach` live HERE rather than on `Editor`:
|
|
1208
|
-
* they are what a store binding and a mounting host need, not what document commands
|
|
1209
|
-
* need. Production adapters program against `Editor` for everything else.
|
|
1210
|
-
*/
|
|
1211
|
-
interface DocxEditorInstance extends Editor {
|
|
1212
|
-
/** Bumps on mount, detach, destroy, and document reload — guards async image intents. */
|
|
1213
|
-
readonly mountGeneration: number;
|
|
1214
|
-
/**
|
|
1215
|
-
* The underlying paginated surface for harnesses and tests that need capabilities the
|
|
1216
|
-
* contract does not carry yet (select-all, node-id addressed selection).
|
|
429
|
+
* The underlying paginated surface for harnesses and tests that need capabilities the
|
|
430
|
+
* contract does not carry yet (select-all, node-id addressed selection).
|
|
1217
431
|
*/
|
|
1218
432
|
readonly surface: PaginatedSurface | null;
|
|
1219
433
|
/**
|
|
@@ -1225,6 +439,8 @@ interface DocxEditorInstance extends Editor {
|
|
|
1225
439
|
* command needs.
|
|
1226
440
|
*/
|
|
1227
441
|
setHyperlinkChrome(handlers: HyperlinkChromeHandlers): Unsubscribe;
|
|
442
|
+
/** Wire the host equation popover to painted equation clicks. */
|
|
443
|
+
setEquationChrome(handlers: EquationChromeHandlers): Unsubscribe;
|
|
1228
444
|
/**
|
|
1229
445
|
* Monotonic version of the observable editor state. Bumps whenever anything
|
|
1230
446
|
* `snapshot()` reports could have moved — a committed change, a selection move, zoom,
|
|
@@ -1592,6 +808,76 @@ declare function finalizeImageOverlayInteraction(options: {
|
|
|
1592
808
|
readonly anchorFrameOrigin: AnchorFrameOrigin | null;
|
|
1593
809
|
}): FinalizedImageOverlayInteraction;
|
|
1594
810
|
|
|
811
|
+
/**
|
|
812
|
+
* How a section-addressed op should name the section a caret is in.
|
|
813
|
+
*
|
|
814
|
+
* `w:sectPr` lives on the body story, so the op can only name BODY content — and a caret in a
|
|
815
|
+
* header or a note is not body content. The three answers are genuinely different, and
|
|
816
|
+
* collapsing them to "a paragraph or `null`" is what let an unaddressable section quietly
|
|
817
|
+
* become a document-wide write.
|
|
818
|
+
*/
|
|
819
|
+
type SectionAnchor =
|
|
820
|
+
/** Name this body paragraph. Its section is the one the caret is in. */
|
|
821
|
+
{
|
|
822
|
+
readonly kind: 'anchor';
|
|
823
|
+
readonly paragraphId: string;
|
|
824
|
+
}
|
|
825
|
+
/** One section: an anchor names nothing extra, so the op may omit it. */
|
|
826
|
+
| {
|
|
827
|
+
readonly kind: 'whole-document';
|
|
828
|
+
}
|
|
829
|
+
/**
|
|
830
|
+
* Several sections, and the caret's holds no paragraph to name.
|
|
831
|
+
*
|
|
832
|
+
* An omitted anchor here would write EVERY section, which is what `scope: 'document'` is
|
|
833
|
+
* for — so answering it to a `scope: 'section'` request changes sections nobody asked
|
|
834
|
+
* about. There is no anchor that reaches an empty final section: one exists only when every
|
|
835
|
+
* paragraph already closes an earlier section, so nothing sits at or after it.
|
|
836
|
+
*/
|
|
837
|
+
| {
|
|
838
|
+
readonly kind: 'unaddressable';
|
|
839
|
+
};
|
|
840
|
+
|
|
841
|
+
/**
|
|
842
|
+
* Every field of the Paragraph dialog, in the units the rest of this contract uses:
|
|
843
|
+
* points for spacing, TWIPS for indents.
|
|
844
|
+
*
|
|
845
|
+
* An omitted field is left as authored. Where `null` is allowed it REMOVES the setting,
|
|
846
|
+
* which is not the same as writing a zero — a zero blocks the cascade, a removal lets the
|
|
847
|
+
* style through again.
|
|
848
|
+
*/
|
|
849
|
+
interface SurfaceParagraphFormat {
|
|
850
|
+
readonly alignment?: 'left' | 'center' | 'right' | 'both';
|
|
851
|
+
readonly spaceBeforePt?: number | null;
|
|
852
|
+
readonly spaceAfterPt?: number | null;
|
|
853
|
+
readonly lineSpacing?: {
|
|
854
|
+
readonly rule: 'multiple' | 'exact' | 'atLeast';
|
|
855
|
+
readonly value: number;
|
|
856
|
+
} | null;
|
|
857
|
+
readonly indentLeftTwips?: number | null;
|
|
858
|
+
readonly indentRightTwips?: number | null;
|
|
859
|
+
/** ONE signed first-line offset: negative is a hanging indent (§17.3.1.12). */
|
|
860
|
+
readonly indentFirstLineTwips?: number | null;
|
|
861
|
+
readonly contextualSpacing?: boolean;
|
|
862
|
+
readonly keepNext?: boolean;
|
|
863
|
+
readonly keepLines?: boolean;
|
|
864
|
+
readonly widowControl?: boolean;
|
|
865
|
+
readonly pageBreakBefore?: boolean;
|
|
866
|
+
/**
|
|
867
|
+
* Replace the paragraph's custom tab stops. An empty list CLEARS them, which is what Word's
|
|
868
|
+
* "Clear All" does; omit the field to leave them as authored.
|
|
869
|
+
*/
|
|
870
|
+
readonly tabStops?: readonly ParagraphTabStop[];
|
|
871
|
+
}
|
|
872
|
+
/** One property in a batched paragraph write. */
|
|
873
|
+
interface ParagraphPropertyEdit {
|
|
874
|
+
readonly localName: string;
|
|
875
|
+
/** A null-valued attribute REMOVES that attribute; see `setParagraphProperty`. */
|
|
876
|
+
readonly attributes?: Record<string, string | null>;
|
|
877
|
+
/** Keep the attributes this entry does not name, for multi-setting elements. */
|
|
878
|
+
readonly mergeAttributes?: boolean;
|
|
879
|
+
}
|
|
880
|
+
|
|
1595
881
|
/**
|
|
1596
882
|
* How an edit is written.
|
|
1597
883
|
*
|
|
@@ -1723,6 +1009,7 @@ interface PaginatedSurfaceOptions {
|
|
|
1723
1009
|
* activation (see the navigation module's single `window.open` gate).
|
|
1724
1010
|
*/
|
|
1725
1011
|
readonly onHyperlinkPopover?: (activation: HyperlinkActivation) => void;
|
|
1012
|
+
readonly onEquationPopover?: (activation: EquationActivation) => void;
|
|
1726
1013
|
/**
|
|
1727
1014
|
* Ctrl/Cmd+K — Word's Insert Hyperlink. The engine reports the request; the host's chrome
|
|
1728
1015
|
* decides what a link dialog looks like. A host that passes nothing leaves the key alone
|
|
@@ -1789,7 +1076,27 @@ interface SurfaceFormatting {
|
|
|
1789
1076
|
* touched paragraph's and `mixed` reports the disagreement per field, because a ruler
|
|
1790
1077
|
* must draw its handles somewhere and Word draws them at the first selected paragraph.
|
|
1791
1078
|
*/
|
|
1792
|
-
readonly indent: IndentFormatting | null;
|
|
1079
|
+
readonly indent: IndentFormatting | null;
|
|
1080
|
+
/**
|
|
1081
|
+
* The paragraph flags the Paragraph dialog shows as checkboxes, or null when the
|
|
1082
|
+
* selection's paragraphs disagree about that one.
|
|
1083
|
+
*
|
|
1084
|
+
* `contextualSpacing` is "Don't add space between paragraphs of the same style"; the
|
|
1085
|
+
* other four are its Pagination block. Each is read from the cascade, so a flag a STYLE
|
|
1086
|
+
* sets reads as on — which is what a checkbox has to show.
|
|
1087
|
+
*/
|
|
1088
|
+
readonly paragraphFlags: ParagraphFlags;
|
|
1089
|
+
/**
|
|
1090
|
+
* The paragraph's resolved custom tab stops, cascade included, or null when the selection
|
|
1091
|
+
* disagrees or nothing is loaded. Positions in TWIPS, like every other measurement a
|
|
1092
|
+
* control writes back.
|
|
1093
|
+
*/
|
|
1094
|
+
readonly tabStops: readonly ParagraphTabStop[] | null;
|
|
1095
|
+
/**
|
|
1096
|
+
* Which of the paragraph-level reads above are `null` because the selection DISAGREES,
|
|
1097
|
+
* as opposed to because nothing states them. See {@link ParagraphDisagreements}.
|
|
1098
|
+
*/
|
|
1099
|
+
readonly disagrees: ParagraphDisagreements;
|
|
1793
1100
|
}
|
|
1794
1101
|
/**
|
|
1795
1102
|
* Where the last pass spent its time, and how much work it actually did.
|
|
@@ -1926,6 +1233,8 @@ interface PaginatedSurface {
|
|
|
1926
1233
|
/** One-based page at the caret, or at the centre of the mounted viewport. */
|
|
1927
1234
|
currentPage(mode?: 'viewport' | 'caret'): number;
|
|
1928
1235
|
type(text: string): void;
|
|
1236
|
+
/** Author one explicit tracked text change without changing the editing mode. */
|
|
1237
|
+
proposeTextChange(kind: 'insertion' | 'deletion' | 'replacement', text: string, author?: string): boolean;
|
|
1929
1238
|
/**
|
|
1930
1239
|
* Queue plain typed text for a batched commit at the caret.
|
|
1931
1240
|
*
|
|
@@ -2099,374 +1408,1262 @@ interface PaginatedSurface {
|
|
|
2099
1408
|
readonly mergeAttributes?: boolean;
|
|
2100
1409
|
}): void;
|
|
2101
1410
|
/**
|
|
2102
|
-
*
|
|
2103
|
-
*
|
|
2104
|
-
*
|
|
1411
|
+
* Several paragraph properties in ONE transaction, so a dialog is one undo step.
|
|
1412
|
+
*
|
|
1413
|
+
* `setParagraphProperty` is this with a single entry. A dialog that fired one call per
|
|
1414
|
+
* field would leave the user pressing Ctrl+Z five times to undo one OK, and would paint
|
|
1415
|
+
* four intermediate layouts on the way.
|
|
1416
|
+
*/
|
|
1417
|
+
setParagraphProperties(entries: readonly ParagraphPropertyEdit[]): void;
|
|
1418
|
+
/**
|
|
1419
|
+
* The Paragraph dialog as ONE write: alignment, indents, spacing, line spacing and the
|
|
1420
|
+
* five paragraph flags, over every paragraph the selection touches.
|
|
1421
|
+
*
|
|
1422
|
+
* One transaction, so pressing OK is one undo step and the page repaints once. An omitted
|
|
1423
|
+
* field is left as authored; `null` where the type allows it REMOVES the setting so the
|
|
1424
|
+
* style supplies it again. Returns whether anything was written.
|
|
1425
|
+
*/
|
|
1426
|
+
setParagraphFormat(update: SurfaceParagraphFormat): boolean;
|
|
1427
|
+
/**
|
|
1428
|
+
* Word's Clear All Formatting: direct run properties off the selected text, and every
|
|
1429
|
+
* paragraph the selection touches back to the default style with its direct paragraph
|
|
1430
|
+
* properties and mark dropped.
|
|
1431
|
+
*
|
|
1432
|
+
* Only what the document states DIRECTLY — formatting inherited from a style survives, so
|
|
1433
|
+
* the text falls back to its style rather than to nothing. Properties an op cannot name
|
|
1434
|
+
* (`w:rStyle`, `w:lang`, `w:sectPr`, `w:pBdr`) are preserved for the same reason every
|
|
1435
|
+
* other write preserves them.
|
|
1436
|
+
*/
|
|
1437
|
+
clearFormatting(): void;
|
|
1438
|
+
/**
|
|
1439
|
+
* Formatting as it stands at the selection, for a toolbar to reflect.
|
|
1440
|
+
*
|
|
1441
|
+
* With a typing format armed at the caret this reports what the NEXT characters typed
|
|
1442
|
+
* will look like, not what the document holds — which is the answer a toolbar wants and
|
|
1443
|
+
* the one Word gives.
|
|
1444
|
+
*/
|
|
1445
|
+
formatting(): SurfaceFormatting;
|
|
1446
|
+
/**
|
|
1447
|
+
* The section the document declares: page size, margins, columns, orientation.
|
|
1448
|
+
*
|
|
1449
|
+
* What a ruler is made of, and what pagination is measured against.
|
|
1450
|
+
*/
|
|
1451
|
+
sectionProperties(): SectionProperties;
|
|
1452
|
+
/**
|
|
1453
|
+
* The section GOVERNING one paragraph — what a ruler or dialog reflects when the caret sits
|
|
1454
|
+
* in a multi-section document.
|
|
1455
|
+
*
|
|
1456
|
+
* Body content answers for itself, whatever story is open. A header or footer belongs to the
|
|
1457
|
+
* section that names its relationship, and a note to the section holding its reference mark.
|
|
1458
|
+
* An id nothing settles falls back to the FIRST section: the tail is the document-wide answer
|
|
1459
|
+
* and is wrong for everything not on the last page.
|
|
1460
|
+
*/
|
|
1461
|
+
sectionPropertiesAt(paragraphId: string): SectionProperties;
|
|
1462
|
+
/**
|
|
1463
|
+
* How a section-addressed op should name the section `paragraphId` is in.
|
|
1464
|
+
*
|
|
1465
|
+
* `w:sectPr` lives on the body story, so such an op can only name body content — and a caret
|
|
1466
|
+
* in a header or a note is not body content. Passing that caret straight through made every
|
|
1467
|
+
* section write from furniture fail `unknown-paragraph`.
|
|
1468
|
+
*/
|
|
1469
|
+
sectionAnchorParagraphAt(paragraphId: string): SectionAnchor;
|
|
1470
|
+
/**
|
|
1471
|
+
* Write section page-setup fields — size, orientation, margins — as ONE undoable
|
|
1472
|
+
* transaction. Twips throughout; omitted fields are left as authored. With
|
|
1473
|
+
* `anchorParagraphId` only that paragraph's governing section is written (Word's
|
|
1474
|
+
* "Apply to: This section"); without it, every section. Returns whether the write
|
|
1475
|
+
* committed (a hostile value is refused by the op layer).
|
|
1476
|
+
*/
|
|
1477
|
+
setSectionProperties(update: {
|
|
1478
|
+
readonly pageWidthTwips?: number;
|
|
1479
|
+
readonly pageHeightTwips?: number;
|
|
1480
|
+
readonly orientation?: 'portrait' | 'landscape';
|
|
1481
|
+
readonly marginTopTwips?: number;
|
|
1482
|
+
readonly marginRightTwips?: number;
|
|
1483
|
+
readonly marginBottomTwips?: number;
|
|
1484
|
+
readonly marginLeftTwips?: number;
|
|
1485
|
+
readonly anchorParagraphId?: string;
|
|
1486
|
+
}): boolean;
|
|
1487
|
+
/**
|
|
1488
|
+
* Insert a next-page section break at the caret: the paragraph splits, and the head
|
|
1489
|
+
* ends a new section cloning the governing section's page setup — Word's Layout >
|
|
1490
|
+
* Breaks > Next Page. One undoable step. Returns whether the break committed.
|
|
1491
|
+
*/
|
|
1492
|
+
insertSectionBreak(): boolean;
|
|
1493
|
+
/** The layout session, so a host or a test can see how much work a pass actually did. */
|
|
1494
|
+
layoutSession(): {
|
|
1495
|
+
readonly stats: {
|
|
1496
|
+
readonly placed: number;
|
|
1497
|
+
readonly total: number;
|
|
1498
|
+
readonly reusedPages: number;
|
|
1499
|
+
};
|
|
1500
|
+
};
|
|
1501
|
+
/**
|
|
1502
|
+
* The hyperlink lane: what link the caret is in, and the insert / retarget / unlink verbs.
|
|
1503
|
+
*
|
|
1504
|
+
* Every verb is one `transact`, so it is one undo step. Targets going IN are host-supplied
|
|
1505
|
+
* and pass the package's own URL allowlist; targets coming OUT are the sanitized
|
|
1506
|
+
* projection, so a caller cannot accidentally hand a refused scheme to a sink.
|
|
1507
|
+
*/
|
|
1508
|
+
readonly hyperlinks: HyperlinkOps;
|
|
1509
|
+
readonly equations: EquationOps;
|
|
1510
|
+
/**
|
|
1511
|
+
* Content-control chrome, form-fill navigation, and value / remove verbs.
|
|
1512
|
+
*
|
|
1513
|
+
* Value and remove commit through `session.applyTreeOps` — the same write path as typing.
|
|
1514
|
+
* Show-all and form-fill are surface chrome and never reflow layout.
|
|
1515
|
+
*/
|
|
1516
|
+
readonly contentControls: ContentControlOps;
|
|
1517
|
+
/** Whether a `rows`×`cols` table can be inserted at the caret. */
|
|
1518
|
+
canInsertTable(rows: number, cols: number): boolean;
|
|
1519
|
+
/**
|
|
1520
|
+
* Insert an empty `rows`×`cols` table at the caret, columns evenly dividing the content
|
|
1521
|
+
* width of the caret's section, and leave the caret in the first cell.
|
|
1522
|
+
*/
|
|
1523
|
+
insertTable(rows: number, cols: number): boolean;
|
|
1524
|
+
/** Whether the addressed (or caret-local) body TOC can be refreshed. */
|
|
1525
|
+
canRefreshToc(tocId?: string): boolean;
|
|
1526
|
+
/** Whether a generated body TOC can be inserted before the caret paragraph. */
|
|
1527
|
+
canInsertToc(): boolean;
|
|
1528
|
+
/** Insert and populate a generated body TOC before the caret paragraph. */
|
|
1529
|
+
insertToc(): boolean;
|
|
1530
|
+
/** Refresh cached TOC entries and/or page numbers through the two-pass layout pipeline. */
|
|
1531
|
+
refreshToc(tocId?: string, mode?: 'entire' | 'pageNumbers'): boolean;
|
|
1532
|
+
/** Whether a body paragraph belongs to a detected TOC boundary or cached result. */
|
|
1533
|
+
isInsideToc(paragraphId: string): boolean;
|
|
1534
|
+
/**
|
|
1535
|
+
* Bookmark jumps and the ONE external-activation gate. A host's popover "open" action
|
|
1536
|
+
* calls `openExternal`; nothing else in the engine may call `window.open`.
|
|
1537
|
+
*/
|
|
1538
|
+
readonly navigation: SurfaceNavigation;
|
|
1539
|
+
/**
|
|
1540
|
+
* Pin the current selection so it stays VISIBLY selected while focus is elsewhere.
|
|
1541
|
+
*
|
|
1542
|
+
* A document has one selection: the moment a panel focuses an input of its own the browser
|
|
1543
|
+
* takes the highlight off the text, which is when the user most needs to see what the panel
|
|
1544
|
+
* is about to act on. This draws the range on the engine's own overlay instead, so it
|
|
1545
|
+
* survives the focus move. The MODEL selection is untouched — the op the panel finally runs
|
|
1546
|
+
* addresses the same characters it always would.
|
|
1547
|
+
*
|
|
1548
|
+
* The pin releases itself when the caret leaves the range (either edge counts as inside),
|
|
1549
|
+
* which is what lets a host close its panel on "the user clicked somewhere else" without
|
|
1550
|
+
* every adapter reimplementing that comparison.
|
|
1551
|
+
*/
|
|
1552
|
+
retainSelection(): SelectionPin;
|
|
1553
|
+
/** Drop one owned pin. Another owner's pin remains visible. */
|
|
1554
|
+
releaseSelection(pin: SelectionPin): void;
|
|
1555
|
+
/** The pinned range, or null once it was released or escaped. */
|
|
1556
|
+
retainedSelection(): SemanticSelection | null;
|
|
1557
|
+
/**
|
|
1558
|
+
* How edits are written right now.
|
|
1559
|
+
*
|
|
1560
|
+
* Lives on the SURFACE, not on the store. The store's write vocabulary stays explicit —
|
|
1561
|
+
* an op says whether it is tracked — and the surface is the one thing that knows a
|
|
1562
|
+
* keystroke happened, so it is the right place to decide what that keystroke becomes.
|
|
1563
|
+
*/
|
|
1564
|
+
editingMode(): SurfaceEditingMode;
|
|
1565
|
+
setEditingMode(mode: SurfaceEditingMode): void;
|
|
1566
|
+
/**
|
|
1567
|
+
* Every author with a revision in the CURRENT layout, mapped to Word's colour slot by
|
|
1568
|
+
* order of first appearance. One map instance per layout, so a caller can key caches on
|
|
1569
|
+
* its identity.
|
|
1570
|
+
*/
|
|
1571
|
+
revisionAuthors(): ReadonlyMap<string, number>;
|
|
1572
|
+
/**
|
|
1573
|
+
* Replace how tracked changes are coloured, live. Paint-level: the pages repaint without
|
|
1574
|
+
* remeasuring a line, and the caret, selection and undo history stay where they are.
|
|
1575
|
+
*/
|
|
1576
|
+
setRevisionStyles(colors: RevisionStyles | undefined): void;
|
|
1577
|
+
/**
|
|
1578
|
+
* Commit ops that came from automation, through the gate a keystroke goes through.
|
|
1579
|
+
*
|
|
1580
|
+
* The narrow entry an automation host writes with, and the reason it needs one: reaching
|
|
1581
|
+
* `session.applyTreeOps` past this skips the editing-mode gate entirely — a document open for
|
|
1582
|
+
* viewing accepts a scripted edit, and a suggesting document records one as a permanent
|
|
1583
|
+
* change with no proposal and no author. Here, viewing refuses, suggesting attributes, the
|
|
1584
|
+
* refusal reason is reported like any other, and the pages repaint from the commit.
|
|
1585
|
+
*
|
|
1586
|
+
* The ops address the story the CALLER named, whatever story the reader is in: the caller
|
|
1587
|
+
* identified its target before calling, so following the caret into a header would write
|
|
1588
|
+
* somewhere else entirely. They default to the body rather than to the reader's story.
|
|
1589
|
+
*
|
|
1590
|
+
* They arrive as a BUILDER, given a way to mint the relationship an external hyperlink names.
|
|
1591
|
+
* That mint changes the package outside the transaction and outside the undo stack, so it must not
|
|
1592
|
+
* happen until the mode has allowed the write — a link minted while the batch was still being
|
|
1593
|
+
* planned left its target in a read-only document's `.rels`. A builder answering null means the
|
|
1594
|
+
* target is one this engine will not author, and the write is refused having changed nothing.
|
|
1595
|
+
*/
|
|
1596
|
+
applyAutomationOps(staged: (relate: (url: string) => string | null) => readonly TreeDocOp[] | null, scope?: StoryScope): TreeApplyResult;
|
|
1597
|
+
/**
|
|
1598
|
+
* Commit review ops — accept, reject, a new comment — through the SAME path a keystroke
|
|
1599
|
+
* takes: layout, paint, and a caret clamped to what the document now holds.
|
|
1600
|
+
*
|
|
1601
|
+
* Applying them straight to the session skipped all three. Rejecting an insertion left the
|
|
1602
|
+
* pages painting text the tree no longer had, every card anchored where it used to be, and
|
|
1603
|
+
* the caret past the end of the paragraph — after which every keystroke was refused with
|
|
1604
|
+
* `offset-out-of-range` until the user happened to click somewhere else.
|
|
1605
|
+
*/
|
|
1606
|
+
commitReviewOps(run: () => {
|
|
1607
|
+
readonly committed: boolean;
|
|
1608
|
+
readonly reason?: unknown;
|
|
1609
|
+
}): void;
|
|
1610
|
+
/**
|
|
1611
|
+
* The layout as last PUBLISHED, without forcing pending work.
|
|
1612
|
+
*
|
|
1613
|
+
* `layout()` flushes first, which is right for a caller that is about to act on geometry
|
|
1614
|
+
* and wrong for one that merely decorates it. The review rail read through `layout()` and
|
|
1615
|
+
* so forced a synchronous full pass on every keystroke — eleven seconds per read on a
|
|
1616
|
+
* 2432-block document. A card whose anchor is one frame stale is invisible; the paint that
|
|
1617
|
+
* follows the flush republishes it.
|
|
1618
|
+
*/
|
|
1619
|
+
publishedLayout(): SemanticLayout;
|
|
1620
|
+
/**
|
|
1621
|
+
* Paint-scale coordinate context for overlay chrome.
|
|
1622
|
+
*
|
|
1623
|
+
* Internal seam — not part of the public editor contract. Image overlay uses the same
|
|
1624
|
+
* `zoom * 96/72` scale and per-page horizontal offsets the painter applied.
|
|
1625
|
+
*/
|
|
1626
|
+
overlayCoordinates(): SurfaceOverlayCoordinates;
|
|
1627
|
+
/**
|
|
1628
|
+
* The comment or tracked change the caret is in, as the painted bands report it.
|
|
1629
|
+
*
|
|
1630
|
+
* ONE source for "which item is open". The band under the text and the card beside it are
|
|
1631
|
+
* two views of the same answer, and deriving it twice let them disagree — the card closed
|
|
1632
|
+
* while the text stayed highlighted.
|
|
1633
|
+
*/
|
|
1634
|
+
activeReviewKey(): string | null;
|
|
1635
|
+
/**
|
|
1636
|
+
* Open THIS item, named by key, for as long as `selection` stays the live one.
|
|
1637
|
+
*
|
|
1638
|
+
* Without it the caret is the only evidence of which card is open, and a caret cannot name a
|
|
1639
|
+
* card when two cards cover exactly the same characters: `w:ins` wrapping `w:del` — content
|
|
1640
|
+
* one reviewer added and another struck — gives the insertion and the deletion one identical
|
|
1641
|
+
* range, and every click on either card classified back to whichever the queue happened to
|
|
1642
|
+
* list first. The reader clicked "Deleted" and watched "Added" light up.
|
|
1643
|
+
*
|
|
1644
|
+
* A key, not a position, because the position is precisely what is ambiguous. It holds only
|
|
1645
|
+
* while the selection matches; a pointer or keyboard move hands the answer back to the caret,
|
|
1646
|
+
* which is what lets the reader step out of a card by clicking away from it.
|
|
1647
|
+
*
|
|
1648
|
+
* `selection` is what activation wants installed, and it is installed HERE rather than by a
|
|
1649
|
+
* `setSelection` of the caller's own so that the pin is up before anything is published. The
|
|
1650
|
+
* other order repainted the bands and reported state while the caret was still the only
|
|
1651
|
+
* evidence, so a host saw the wrong twin active for one frame and then a correction. Omit it
|
|
1652
|
+
* to pin against the live selection, which is what a header or note scope has already set.
|
|
1653
|
+
*/
|
|
1654
|
+
activateReview(key: string, selection?: SemanticSelection): void;
|
|
1655
|
+
/**
|
|
1656
|
+
* The key {@link activateReview} pinned, or null once its selection is no longer live.
|
|
1657
|
+
*
|
|
1658
|
+
* Exists so nothing outside the surface keeps its own copy of "the selection came from
|
|
1659
|
+
* opening a card". `selectionPlacement` needs that fact to stay quiet about offering a
|
|
1660
|
+
* comment on text the reader only selected by opening a card over it, and the copy it used to
|
|
1661
|
+
* keep was set on one of activation's three branches, so a header card offered to comment on
|
|
1662
|
+
* itself.
|
|
1663
|
+
*/
|
|
1664
|
+
activatedReviewKey(): string | null;
|
|
1665
|
+
/**
|
|
1666
|
+
* Close the open item until the caret next moves.
|
|
1667
|
+
*
|
|
1668
|
+
* What a click on the canvas means. The caret does not move when someone clicks the grey
|
|
1669
|
+
* around the page, so nothing else would ever put the item away.
|
|
1670
|
+
*/
|
|
1671
|
+
dismissActiveReview(): void;
|
|
1672
|
+
/**
|
|
1673
|
+
* Revision kinds the CARET must not activate, or null for none.
|
|
1674
|
+
*
|
|
1675
|
+
* The review rail filters what it renders (structural and format cards are hidden by
|
|
1676
|
+
* default), but {@link activeReviewKey} used to compute over the unfiltered queue — a
|
|
1677
|
+
* click on tracked text under a format change activated a card the rail does not draw,
|
|
1678
|
+
* and nothing on screen lit up. A host that filters its list tells the surface, so the
|
|
1679
|
+
* band and the visible cards stay one answer.
|
|
1680
|
+
*/
|
|
1681
|
+
setReviewActivationExclusions(kinds: readonly ReviewRevisionKind[] | null): void;
|
|
1682
|
+
/**
|
|
1683
|
+
* `bookmarkName -> position` over the current revision, for resolving an internal link.
|
|
1684
|
+
* First in document order wins a duplicate name, matching Word.
|
|
1685
|
+
*/
|
|
1686
|
+
bookmarks(): BookmarkIndex;
|
|
1687
|
+
/** The selected text, for copy and cut. */
|
|
1688
|
+
selectedText(): string;
|
|
1689
|
+
/** Remove the selection, if any. Returns whether anything was deleted. */
|
|
1690
|
+
deleteSelection(): boolean;
|
|
1691
|
+
navigate(command: NavigationCommand, extend?: boolean): void;
|
|
1692
|
+
/** Reverse the last history entry and put the caret back where it was made. */
|
|
1693
|
+
undo(): void;
|
|
1694
|
+
redo(): void;
|
|
1695
|
+
/**
|
|
1696
|
+
* Refresh table insertion furniture labels without remounting or relayout.
|
|
2105
1697
|
*
|
|
2106
|
-
*
|
|
2107
|
-
* the text falls back to its style rather than to nothing. Properties an op cannot name
|
|
2108
|
-
* (`w:rStyle`, `w:lang`, `w:sectPr`, `w:pBdr`) are preserved for the same reason every
|
|
2109
|
-
* other write preserves them.
|
|
1698
|
+
* @public
|
|
2110
1699
|
*/
|
|
2111
|
-
|
|
1700
|
+
refreshTableInteractionLabels(): void;
|
|
1701
|
+
focus(): void;
|
|
2112
1702
|
/**
|
|
2113
|
-
*
|
|
1703
|
+
* Refresh table insertion furniture labels without remounting the surface.
|
|
2114
1704
|
*
|
|
2115
|
-
*
|
|
2116
|
-
* will look like, not what the document holds — which is the answer a toolbar wants and
|
|
2117
|
-
* the one Word gives.
|
|
1705
|
+
* @public
|
|
2118
1706
|
*/
|
|
2119
|
-
|
|
1707
|
+
setTableInteractionLabel(resolver: (key: 'table.insertRowBelow' | 'table.insertColumnRight') => string): void;
|
|
1708
|
+
destroy(): void;
|
|
2120
1709
|
/**
|
|
2121
|
-
* The section
|
|
1710
|
+
* The section a painted page belongs to, and the page that section starts on.
|
|
2122
1711
|
*
|
|
2123
|
-
*
|
|
1712
|
+
* Published because opening a furniture story without a page opens it without a section, and
|
|
1713
|
+
* the section is what the ruler clamps to and what a new table's grid is divided from. One
|
|
1714
|
+
* header part can serve several sections, so only the page settles which one the reader is
|
|
1715
|
+
* looking at.
|
|
2124
1716
|
*/
|
|
2125
|
-
|
|
1717
|
+
sectionAtPage(pageIndex: number): {
|
|
1718
|
+
sectionIndex: number;
|
|
1719
|
+
sectionStart: number;
|
|
1720
|
+
};
|
|
1721
|
+
/** Active editing view — body, or an open header/footer story by rId. */
|
|
1722
|
+
activeScope(): ViewScope;
|
|
1723
|
+
/** Activate a view scope. Returns false when a header/footer rId cannot be opened. */
|
|
1724
|
+
setActiveScope(scope: ViewScope): boolean;
|
|
2126
1725
|
/**
|
|
2127
|
-
*
|
|
2128
|
-
*
|
|
2129
|
-
* an unknown id.
|
|
1726
|
+
* Open a header/footer story for editing on the painted surface.
|
|
1727
|
+
* Refuses dangling / unknown relationship ids.
|
|
2130
1728
|
*/
|
|
2131
|
-
|
|
1729
|
+
enterHeaderFooter(args: {
|
|
1730
|
+
readonly rId: string;
|
|
1731
|
+
readonly pageIndex?: number;
|
|
1732
|
+
readonly sectionIndex?: number;
|
|
1733
|
+
readonly kind?: 'header' | 'footer';
|
|
1734
|
+
readonly variant?: 'default' | 'first' | 'even';
|
|
1735
|
+
readonly position?: SemanticPosition;
|
|
1736
|
+
}): boolean;
|
|
1737
|
+
/** Leave furniture editing and restore the prior body selection. */
|
|
1738
|
+
exitHeaderFooter(): void;
|
|
1739
|
+
/** Chrome read-model for the open furniture scope, or null when editing the body. */
|
|
1740
|
+
headerFooterState(): {
|
|
1741
|
+
readonly editing: 'header' | 'footer' | null;
|
|
1742
|
+
readonly sectionIndex: number;
|
|
1743
|
+
readonly variant?: 'default' | 'first' | 'even';
|
|
1744
|
+
readonly rId?: string;
|
|
1745
|
+
readonly partName?: string;
|
|
1746
|
+
readonly inherited?: boolean;
|
|
1747
|
+
readonly titlePage?: boolean;
|
|
1748
|
+
readonly evenAndOddHeaders?: boolean;
|
|
1749
|
+
readonly headerDistanceTwips?: number;
|
|
1750
|
+
readonly footerDistanceTwips?: number;
|
|
1751
|
+
} | null;
|
|
2132
1752
|
/**
|
|
2133
|
-
*
|
|
2134
|
-
*
|
|
2135
|
-
* `anchorParagraphId` only that paragraph's governing section is written (Word's
|
|
2136
|
-
* "Apply to: This section"); without it, every section. Returns whether the write
|
|
2137
|
-
* committed (a hostile value is refused by the op layer).
|
|
1753
|
+
* Commit one package-level furniture lifecycle op (create/delete/link/unlink/options).
|
|
1754
|
+
* Flushes layout so the next enter/rebind sees the new resolution.
|
|
2138
1755
|
*/
|
|
2139
|
-
|
|
2140
|
-
readonly
|
|
2141
|
-
readonly
|
|
2142
|
-
readonly
|
|
2143
|
-
readonly
|
|
2144
|
-
readonly
|
|
2145
|
-
readonly
|
|
2146
|
-
readonly
|
|
2147
|
-
readonly
|
|
1756
|
+
applyHeaderFooterLifecycle(op: {
|
|
1757
|
+
readonly op: 'createHeaderFooter' | 'deleteHeaderFooter' | 'linkToPrevious' | 'unlinkFromPrevious' | 'setSectionFurnitureOptions';
|
|
1758
|
+
readonly sectionIndex?: number;
|
|
1759
|
+
readonly kind?: 'header' | 'footer';
|
|
1760
|
+
readonly variant?: 'default' | 'first' | 'even';
|
|
1761
|
+
readonly titlePage?: boolean;
|
|
1762
|
+
readonly evenAndOddHeaders?: boolean;
|
|
1763
|
+
readonly headerDistanceTwips?: number;
|
|
1764
|
+
readonly footerDistanceTwips?: number;
|
|
1765
|
+
}): {
|
|
1766
|
+
readonly ok: true;
|
|
1767
|
+
} | {
|
|
1768
|
+
readonly ok: false;
|
|
1769
|
+
readonly reason: string;
|
|
1770
|
+
};
|
|
1771
|
+
/** Insert an allowlisted page field at the caret in the open HF story. */
|
|
1772
|
+
insertPageField(field: 'PAGE' | 'NUMPAGES' | 'SECTIONPAGES' | 'PAGE_X_OF_Y'): boolean;
|
|
1773
|
+
/** Insert a footnote/endnote at the body caret. */
|
|
1774
|
+
insertNote(noteKind: 'footnote' | 'endnote'): boolean;
|
|
1775
|
+
deleteNote(noteKind: 'footnote' | 'endnote', noteId: number): boolean;
|
|
1776
|
+
convertNote(fromKind: 'footnote' | 'endnote', noteId: number): boolean;
|
|
1777
|
+
convertAllNotes(fromKind: 'footnote' | 'endnote'): boolean;
|
|
1778
|
+
setNoteProperties(args: {
|
|
1779
|
+
readonly scope: 'document' | 'section';
|
|
1780
|
+
readonly sectionIndex?: number;
|
|
1781
|
+
readonly footnote?: {
|
|
1782
|
+
readonly numFmt?: string;
|
|
1783
|
+
readonly numRestart?: string;
|
|
1784
|
+
readonly position?: string;
|
|
1785
|
+
readonly numStart?: number;
|
|
1786
|
+
};
|
|
1787
|
+
readonly endnote?: {
|
|
1788
|
+
readonly numFmt?: string;
|
|
1789
|
+
readonly numRestart?: string;
|
|
1790
|
+
readonly position?: string;
|
|
1791
|
+
readonly numStart?: number;
|
|
1792
|
+
};
|
|
1793
|
+
}): boolean;
|
|
1794
|
+
enterNote(scopeId: string, position?: {
|
|
1795
|
+
paragraphId: string;
|
|
1796
|
+
offset: number;
|
|
2148
1797
|
}): boolean;
|
|
1798
|
+
exitNote(): void;
|
|
1799
|
+
/** Resolved/authored note properties for the caret section — chrome read-model. */
|
|
1800
|
+
notePropertiesState(): NotePropertiesStateSnapshot | null;
|
|
1801
|
+
/** Plain-text preview for hover chrome — never returns markup. */
|
|
1802
|
+
notePreviewText(scopeId: string): string | null;
|
|
1803
|
+
/** Commit one table-command plan as a single store transaction. */
|
|
1804
|
+
applyTableCommandPlan(plan: TableCommandPlan): ExecResult;
|
|
1805
|
+
}
|
|
1806
|
+
/**
|
|
1807
|
+
* What opening a document produced: a mounted surface, or a refusal.
|
|
1808
|
+
*
|
|
1809
|
+
* A result rather than a throw, because every refusal here comes from FILE input — a package the
|
|
1810
|
+
* bounded reader rejected, a part that exceeded a limit — and a malformed upload should surface
|
|
1811
|
+
* as a message the host can show rather than an exception it has to catch.
|
|
1812
|
+
*/
|
|
1813
|
+
type OpenPaginatedResult = {
|
|
1814
|
+
readonly ok: true;
|
|
1815
|
+
readonly surface: PaginatedSurface;
|
|
1816
|
+
} | {
|
|
1817
|
+
readonly ok: false;
|
|
1818
|
+
readonly reason: string;
|
|
1819
|
+
readonly detail?: string;
|
|
1820
|
+
};
|
|
1821
|
+
|
|
1822
|
+
/** One URL to fetch and the face it claims to be. */
|
|
1823
|
+
interface FontUrlSource {
|
|
1824
|
+
readonly url: string;
|
|
1825
|
+
readonly family: string;
|
|
1826
|
+
readonly weight: number;
|
|
1827
|
+
readonly style: 'normal' | 'italic';
|
|
1828
|
+
/**
|
|
1829
|
+
* Expected `sha256:` content hash. When present, mismatching bytes are REFUSED —
|
|
1830
|
+
* pin this for any URL not under the app's sole control.
|
|
1831
|
+
*/
|
|
1832
|
+
readonly hash?: string;
|
|
1833
|
+
readonly faceIndex?: number;
|
|
1834
|
+
}
|
|
1835
|
+
/**
|
|
1836
|
+
* What to fetch, and under what limits.
|
|
1837
|
+
*
|
|
1838
|
+
* Only `sources` is required. Each carries its own expected hash, so bytes are trusted by
|
|
1839
|
+
* CONTENT rather than by origin — a swapped asset fails admission even from a trusted host.
|
|
1840
|
+
*/
|
|
1841
|
+
interface LoadFontsRequest {
|
|
1842
|
+
readonly sources: readonly FontUrlSource[];
|
|
1843
|
+
/** Cache API bucket name; default `docx-editor-fonts`. */
|
|
1844
|
+
readonly cacheName?: string;
|
|
1845
|
+
/** Injectable for tests and CSP-constrained hosts; defaults to global `fetch`. */
|
|
1846
|
+
readonly fetcher?: typeof fetch;
|
|
1847
|
+
/** Per-font byte ceiling; defaults to the engine hard maximum. */
|
|
1848
|
+
readonly maxFontBytes?: number;
|
|
1849
|
+
}
|
|
1850
|
+
/**
|
|
1851
|
+
* Why one font did not load.
|
|
1852
|
+
*
|
|
1853
|
+
* Distinguished rather than collapsed to "failed" because the responses differ: `networkError`
|
|
1854
|
+
* and `httpError` are worth retrying, while `hashMismatch` and `malformed` mean the bytes were
|
|
1855
|
+
* not what the source claimed and retrying will fetch the same wrong thing.
|
|
1856
|
+
*/
|
|
1857
|
+
type FontLoadFailureReason = 'networkError' | 'httpError' | 'hashMismatch' | 'overLimit' | 'emptyResponse'
|
|
1858
|
+
/** The declared face itself is unusable (empty family, out-of-range weight); nothing was fetched. */
|
|
1859
|
+
| 'invalidRequest'
|
|
1860
|
+
/** The bytes are not a font at all — most often an HTML error page served with 200. */
|
|
1861
|
+
| 'malformed';
|
|
1862
|
+
/**
|
|
1863
|
+
* One face that did not load, with whatever evidence the failure produced.
|
|
1864
|
+
*
|
|
1865
|
+
* Non-fatal: {@link LoadFontsResult} still carries every source that succeeded, and the affected
|
|
1866
|
+
* family falls back to the engine's fixed measurement.
|
|
1867
|
+
*/
|
|
1868
|
+
interface FontLoadFailure {
|
|
1869
|
+
readonly url: string;
|
|
1870
|
+
readonly request: FontFaceRequest;
|
|
1871
|
+
readonly reason: FontLoadFailureReason;
|
|
1872
|
+
/** HTTP status for `httpError`; hashes for `hashMismatch`. */
|
|
1873
|
+
readonly status?: number;
|
|
1874
|
+
readonly expectedHash?: string;
|
|
1875
|
+
readonly actualHash?: string;
|
|
1876
|
+
readonly diagnostic?: string;
|
|
1877
|
+
}
|
|
1878
|
+
/**
|
|
1879
|
+
* What one `loadFonts` call produced: the faces that arrived, plus the ones that did not.
|
|
1880
|
+
*
|
|
1881
|
+
* A `FontConfigurationFragment`, so it composes straight into `composeFontConfiguration`
|
|
1882
|
+
* alongside other font sources. Partial success is the normal case — compose it even with
|
|
1883
|
+
* failures present.
|
|
1884
|
+
*/
|
|
1885
|
+
interface LoadFontsResult extends FontConfigurationFragment {
|
|
1886
|
+
readonly sources: readonly FontSource[];
|
|
1887
|
+
readonly failures: readonly FontLoadFailure[];
|
|
1888
|
+
}
|
|
1889
|
+
/**
|
|
1890
|
+
* Fetch app-specified font URLs into verified, cache-backed `FontSource`s.
|
|
1891
|
+
*
|
|
1892
|
+
* Fetches ONLY the URLs listed — never a default host or engine-chosen CDN — and never
|
|
1893
|
+
* rejects for a per-source failure: the result carries every admitted source and a
|
|
1894
|
+
* typed entry for every drop. Compose the result with `composeFontConfiguration`.
|
|
1895
|
+
*/
|
|
1896
|
+
declare function loadFonts(request: LoadFontsRequest): Promise<LoadFontsResult>;
|
|
1897
|
+
/**
|
|
1898
|
+
* Turn font bytes you ALREADY hold into a `FontSource` — a file input, IndexedDB, a
|
|
1899
|
+
* bundler import. `loadFonts` covers URLs; this covers everything else, so no caller has
|
|
1900
|
+
* to hand-assemble the record or reach for a hashing helper.
|
|
1901
|
+
*
|
|
1902
|
+
* Returns a typed failure instead of throwing when the descriptor or the bytes are
|
|
1903
|
+
* unusable, matching `loadFonts`: one bad face degrades itself, never its neighbours.
|
|
1904
|
+
*/
|
|
1905
|
+
declare function createFontSource(bytes: Uint8Array, request: FontFaceRequest & {
|
|
1906
|
+
readonly faceIndex?: number;
|
|
1907
|
+
}, options?: {
|
|
1908
|
+
readonly id?: string;
|
|
1909
|
+
readonly maxFontBytes?: number;
|
|
1910
|
+
}): {
|
|
1911
|
+
readonly source: FontSource;
|
|
1912
|
+
} | {
|
|
1913
|
+
readonly failure: FontLoadFailure;
|
|
1914
|
+
};
|
|
1915
|
+
|
|
1916
|
+
/**
|
|
1917
|
+
* HOW a control reaches the engine — never WHETHER it is enabled.
|
|
1918
|
+
*
|
|
1919
|
+
* Enabled state has exactly one source: `toolbarCommandState(editor, slot)`, which
|
|
1920
|
+
* asks `Editor.can`. The registry is static data and cannot know what the engine
|
|
1921
|
+
* will honour at this selection, in this document, at this moment.
|
|
1922
|
+
*
|
|
1923
|
+
* There used to be a fourth member, `parityOnly`, meaning "visible but permanently
|
|
1924
|
+
* disabled". It was a second, static answer to the question `Editor.can` already
|
|
1925
|
+
* answers, and it went stale the moment the engine wired underline, strike, the four
|
|
1926
|
+
* alignments, the list commands and the four value slots: the registry still said
|
|
1927
|
+
* parity-only, React ignored it and ran them, and Vue believed it and rendered twelve
|
|
1928
|
+
* WORKING commands permanently disabled. A slot the engine has not wired needs no
|
|
1929
|
+
* registry flag — `commandForSlot` answers null and `toolbarCommandState` disables the
|
|
1930
|
+
* control with the engine's own words ("not wired to an editor command").
|
|
1931
|
+
*/
|
|
1932
|
+
type ChromeControlState =
|
|
1933
|
+
/**
|
|
1934
|
+
* Dispatched as one fixed engine command: enabled when
|
|
1935
|
+
* `Editor.can(commandForSlot(slot))` succeeds, a click runs
|
|
1936
|
+
* `runToolbarCommand(editor, slot)`. The command is resolved from the SLOT id
|
|
1937
|
+
* through `commandForSlot` in toolbar-commands.ts — the one command table both
|
|
1938
|
+
* adapters share. A slot with no row there is simply not wired YET, and says so
|
|
1939
|
+
* through the engine rather than through this descriptor.
|
|
1940
|
+
*/
|
|
1941
|
+
{
|
|
1942
|
+
readonly kind: 'command';
|
|
1943
|
+
}
|
|
1944
|
+
/**
|
|
1945
|
+
* Dispatched with a PICKED value: `commandForSlotValue(slot, value)`. Enabled when
|
|
1946
|
+
* the engine would honour a well-formed value right now (`toolbarCommandState`
|
|
1947
|
+
* probes for exactly that), so the control needs chrome that produces a value — a
|
|
1948
|
+
* font list, a size, a colour — before a click means anything.
|
|
1949
|
+
*
|
|
1950
|
+
* A distinct kind because 'command' cannot describe it: there is no fixed command
|
|
1951
|
+
* to hand `Editor.can`, and a bare click has nothing to send.
|
|
1952
|
+
*/
|
|
1953
|
+
| {
|
|
1954
|
+
readonly kind: 'value';
|
|
1955
|
+
}
|
|
1956
|
+
/** `Editor.save()` — not a command (see `runSave`). */
|
|
1957
|
+
| {
|
|
1958
|
+
readonly kind: 'save';
|
|
1959
|
+
}
|
|
1960
|
+
/**
|
|
1961
|
+
* `Editor.load()` — not a command either, and the exact twin of `save`: bytes cross the
|
|
1962
|
+
* boundary between the host and the engine, and only the host can produce them. The
|
|
1963
|
+
* control needs chrome that reads a file (a picker, a drop target) before a click means
|
|
1964
|
+
* anything, so a bare click has nothing to send — the same reason `save` is not `command`.
|
|
1965
|
+
*
|
|
1966
|
+
* A fourth kind rather than reusing `save` because the two dispatch in opposite
|
|
1967
|
+
* directions, and an adapter branching on `kind` must be able to tell them apart. Unlike
|
|
1968
|
+
* the deleted `parityOnly`, this one IS named by a control (`file.open`).
|
|
1969
|
+
*/
|
|
1970
|
+
| {
|
|
1971
|
+
readonly kind: 'load';
|
|
1972
|
+
};
|
|
1973
|
+
/**
|
|
1974
|
+
* The SHAPE a control renders as (task M6V.1).
|
|
1975
|
+
*
|
|
1976
|
+
* The legacy toolbar is not a row of uniform icon buttons: it mixes labelled dropdowns
|
|
1977
|
+
* (`Normal`, `Arial`, alignment, line spacing), numeric steppers with visible values
|
|
1978
|
+
* (zoom `- 100% +`, size `- 26 +`), split colour controls (a glyph over a colour swatch
|
|
1979
|
+
* with its own caret), and a mode pill (`Editing`). Rendering all of them as icon
|
|
1980
|
+
* buttons is the difference an owner review called out as "not visual parity" — the
|
|
1981
|
+
* regions were all present and it still did not look like the product.
|
|
1982
|
+
*/
|
|
1983
|
+
/** `modePill` is deliberately absent. It was declared, never used by any control, and
|
|
1984
|
+
* rendered nothing — the editing-mode control below is a `dropdown`, which is what the
|
|
1985
|
+
* legacy product shows. A shape no descriptor names is a branch adapters must implement
|
|
1986
|
+
* and can never exercise. */
|
|
1987
|
+
type ChromeControlShape = 'icon' | 'stepper' | 'dropdown' | 'colorSplit';
|
|
1988
|
+
/**
|
|
1989
|
+
* One toolbar control as the registry describes it — what it renders as, never whether it is
|
|
1990
|
+
* enabled.
|
|
1991
|
+
*
|
|
1992
|
+
* Enabled state has exactly ONE source, `toolbarCommandState`, which asks the engine. A
|
|
1993
|
+
* descriptor carrying its own disabled flag would be a second answer that goes stale the moment
|
|
1994
|
+
* the engine wires the slot.
|
|
1995
|
+
*
|
|
1996
|
+
* @public
|
|
1997
|
+
*/
|
|
1998
|
+
interface ChromeControl<Id extends string = string> {
|
|
1999
|
+
/** Stable control id, unique WITHIN its group. Public API; renames are breaking. */
|
|
2000
|
+
readonly id: Id;
|
|
2001
|
+
/** How it renders. Defaults to `icon`. */
|
|
2002
|
+
readonly shape?: ChromeControlShape;
|
|
2003
|
+
/** Displayed value for a stepper or dropdown (an i18n key, or a literal for numbers). */
|
|
2004
|
+
readonly valueText?: string;
|
|
2005
|
+
/** Swatch colour for a `colorSplit` control. */
|
|
2006
|
+
readonly swatch?: string;
|
|
2007
|
+
/** i18n key for the accessible name and tooltip. Never hardcoded English. */
|
|
2008
|
+
readonly labelKey: string;
|
|
2009
|
+
/** Material Symbols path data, or null for a non-icon control (a picker). */
|
|
2010
|
+
readonly paths: readonly string[] | null;
|
|
2011
|
+
/** For pickers: the i18n key of the placeholder value shown. */
|
|
2012
|
+
readonly valueKey?: string;
|
|
2013
|
+
readonly state: ChromeControlState;
|
|
2014
|
+
}
|
|
2015
|
+
/**
|
|
2016
|
+
* One toolbar group: the taxonomy both adapters derive their default arrangement FROM.
|
|
2017
|
+
*
|
|
2018
|
+
* Never hand-list controls in an adapter — a default toolbar is built by walking `CHROME_GROUPS`,
|
|
2019
|
+
* so a slot added here appears in React and Vue without either being edited.
|
|
2020
|
+
*
|
|
2021
|
+
* @public
|
|
2022
|
+
*/
|
|
2023
|
+
interface ChromeGroup<Id extends string = string, ControlId extends string = string> {
|
|
2024
|
+
/** Stable group id. Public API; renames are breaking. */
|
|
2025
|
+
readonly id: Id;
|
|
2026
|
+
readonly labelKey: string;
|
|
2149
2027
|
/**
|
|
2150
|
-
*
|
|
2151
|
-
*
|
|
2152
|
-
*
|
|
2028
|
+
* Not part of the DEFAULT toolbar arrangement. The chrome spec shows these
|
|
2029
|
+
* controls only in a context the engine does not model yet (an image or table
|
|
2030
|
+
* selection), or not at all (save belongs in the host's File menu, never in the
|
|
2031
|
+
* bar). Their slots stay public for composition — a host can still place
|
|
2032
|
+
* `image.insert` or `file.save` explicitly — but the default chrome is the
|
|
2033
|
+
* registry's default bar, which ends at the editing-mode picker.
|
|
2153
2034
|
*/
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2035
|
+
readonly contextual?: true;
|
|
2036
|
+
readonly controls: readonly ChromeControl<ControlId>[];
|
|
2037
|
+
}
|
|
2038
|
+
/**
|
|
2039
|
+
* The complete chrome, in bar order. Literal-typed (`as const`) so the slot-id
|
|
2040
|
+
* vocabulary below is derived from the data and cannot drift from it.
|
|
2041
|
+
*
|
|
2042
|
+
* Taxonomy taste: ids are short, lowercaseCamel, and never repeat their group's name
|
|
2043
|
+
* (`alignment.left`, not `alignment.alignLeft`; `font.family`, not `font.fontFamily`).
|
|
2044
|
+
*/
|
|
2045
|
+
declare const CHROME_GROUPS: readonly [{
|
|
2046
|
+
readonly id: "history";
|
|
2047
|
+
readonly labelKey: "formattingBar.groups.history";
|
|
2048
|
+
readonly controls: readonly [{
|
|
2049
|
+
readonly id: "undo";
|
|
2050
|
+
readonly labelKey: "formattingBar.undoShortcut";
|
|
2051
|
+
readonly paths: readonly string[];
|
|
2052
|
+
readonly state: {
|
|
2053
|
+
readonly kind: "command";
|
|
2054
|
+
};
|
|
2055
|
+
}, {
|
|
2056
|
+
readonly id: "redo";
|
|
2057
|
+
readonly labelKey: "formattingBar.redoShortcut";
|
|
2058
|
+
readonly paths: readonly string[];
|
|
2059
|
+
readonly state: {
|
|
2060
|
+
readonly kind: "command";
|
|
2061
|
+
};
|
|
2062
|
+
}];
|
|
2063
|
+
}, {
|
|
2064
|
+
readonly id: "zoom";
|
|
2065
|
+
readonly labelKey: "formattingBar.groups.zoom";
|
|
2066
|
+
readonly controls: readonly [{
|
|
2067
|
+
readonly id: "level";
|
|
2068
|
+
readonly shape: "stepper";
|
|
2069
|
+
readonly valueText: "100%";
|
|
2070
|
+
readonly labelKey: "formattingBar.groups.zoom";
|
|
2071
|
+
readonly paths: null;
|
|
2072
|
+
readonly valueKey: "zoom.zoomLevel";
|
|
2073
|
+
readonly state: {
|
|
2074
|
+
readonly kind: "command";
|
|
2075
|
+
};
|
|
2076
|
+
}];
|
|
2077
|
+
}, {
|
|
2078
|
+
readonly id: "styles";
|
|
2079
|
+
readonly labelKey: "formattingBar.groups.styles";
|
|
2080
|
+
readonly controls: readonly [{
|
|
2081
|
+
readonly id: "style";
|
|
2082
|
+
readonly shape: "dropdown";
|
|
2083
|
+
readonly labelKey: "styles.selectAriaLabel";
|
|
2084
|
+
readonly paths: null;
|
|
2085
|
+
readonly valueKey: "styles.normalText";
|
|
2086
|
+
readonly state: {
|
|
2087
|
+
readonly kind: "value";
|
|
2088
|
+
};
|
|
2089
|
+
}];
|
|
2090
|
+
}, {
|
|
2091
|
+
readonly id: "font";
|
|
2092
|
+
readonly labelKey: "formattingBar.groups.font";
|
|
2093
|
+
readonly controls: readonly [{
|
|
2094
|
+
readonly id: "family";
|
|
2095
|
+
readonly shape: "dropdown";
|
|
2096
|
+
readonly labelKey: "font.selectAriaLabel";
|
|
2097
|
+
readonly paths: null;
|
|
2098
|
+
readonly valueKey: "font.sansSerif";
|
|
2099
|
+
readonly state: {
|
|
2100
|
+
readonly kind: "value";
|
|
2101
|
+
};
|
|
2102
|
+
}, {
|
|
2103
|
+
readonly id: "size";
|
|
2104
|
+
readonly shape: "stepper";
|
|
2105
|
+
readonly valueText: "11";
|
|
2106
|
+
readonly labelKey: "fontSize.listLabel";
|
|
2107
|
+
readonly paths: null;
|
|
2108
|
+
readonly valueKey: "fontSize.label";
|
|
2109
|
+
readonly state: {
|
|
2110
|
+
readonly kind: "value";
|
|
2111
|
+
};
|
|
2112
|
+
}];
|
|
2113
|
+
}, {
|
|
2114
|
+
readonly id: "text";
|
|
2115
|
+
readonly labelKey: "formattingBar.groups.textFormatting";
|
|
2116
|
+
readonly controls: readonly [{
|
|
2117
|
+
readonly id: "bold";
|
|
2118
|
+
readonly labelKey: "formattingBar.boldShortcut";
|
|
2119
|
+
readonly paths: readonly string[];
|
|
2120
|
+
readonly state: {
|
|
2121
|
+
readonly kind: "command";
|
|
2122
|
+
};
|
|
2123
|
+
}, {
|
|
2124
|
+
readonly id: "italic";
|
|
2125
|
+
readonly labelKey: "formattingBar.italicShortcut";
|
|
2126
|
+
readonly paths: readonly string[];
|
|
2127
|
+
readonly state: {
|
|
2128
|
+
readonly kind: "command";
|
|
2129
|
+
};
|
|
2130
|
+
}, {
|
|
2131
|
+
readonly id: "underline";
|
|
2132
|
+
readonly labelKey: "formattingBar.underlineShortcut";
|
|
2133
|
+
readonly paths: readonly string[];
|
|
2134
|
+
readonly state: {
|
|
2135
|
+
readonly kind: "command";
|
|
2136
|
+
};
|
|
2137
|
+
}, {
|
|
2138
|
+
readonly id: "strike";
|
|
2139
|
+
readonly labelKey: "formattingBar.strikethrough";
|
|
2140
|
+
readonly paths: readonly string[];
|
|
2141
|
+
readonly state: {
|
|
2142
|
+
readonly kind: "command";
|
|
2143
|
+
};
|
|
2144
|
+
}, {
|
|
2145
|
+
readonly id: "color";
|
|
2146
|
+
readonly shape: "colorSplit";
|
|
2147
|
+
readonly swatch: "#ff0000";
|
|
2148
|
+
readonly labelKey: "formattingBar.fontColor";
|
|
2149
|
+
readonly paths: readonly string[];
|
|
2150
|
+
readonly state: {
|
|
2151
|
+
readonly kind: "value";
|
|
2152
|
+
};
|
|
2153
|
+
}, {
|
|
2154
|
+
readonly id: "highlight";
|
|
2155
|
+
readonly shape: "colorSplit";
|
|
2156
|
+
readonly swatch: "#ffff00";
|
|
2157
|
+
readonly labelKey: "formattingBar.highlightColor";
|
|
2158
|
+
readonly paths: readonly string[];
|
|
2159
|
+
readonly state: {
|
|
2160
|
+
readonly kind: "value";
|
|
2161
|
+
};
|
|
2162
|
+
}, {
|
|
2163
|
+
readonly id: "link";
|
|
2164
|
+
readonly labelKey: "formattingBar.insertLinkShortcut";
|
|
2165
|
+
readonly paths: readonly string[];
|
|
2166
|
+
readonly state: {
|
|
2167
|
+
readonly kind: "command";
|
|
2168
|
+
};
|
|
2169
|
+
}];
|
|
2170
|
+
}, {
|
|
2171
|
+
readonly id: "script";
|
|
2172
|
+
readonly labelKey: "formattingBar.groups.script";
|
|
2173
|
+
readonly controls: readonly [{
|
|
2174
|
+
readonly id: "super";
|
|
2175
|
+
readonly labelKey: "formattingBar.superscript";
|
|
2176
|
+
readonly paths: readonly string[];
|
|
2177
|
+
readonly state: {
|
|
2178
|
+
readonly kind: "command";
|
|
2179
|
+
};
|
|
2180
|
+
}, {
|
|
2181
|
+
readonly id: "sub";
|
|
2182
|
+
readonly labelKey: "formattingBar.subscript";
|
|
2183
|
+
readonly paths: readonly string[];
|
|
2184
|
+
readonly state: {
|
|
2185
|
+
readonly kind: "command";
|
|
2186
|
+
};
|
|
2187
|
+
}];
|
|
2188
|
+
}, {
|
|
2189
|
+
readonly id: "alignment";
|
|
2190
|
+
readonly labelKey: "formattingBar.groups.alignment";
|
|
2191
|
+
readonly controls: readonly [{
|
|
2192
|
+
readonly id: "left";
|
|
2193
|
+
readonly labelKey: "alignment.alignLeft";
|
|
2194
|
+
readonly paths: readonly string[];
|
|
2195
|
+
readonly state: {
|
|
2196
|
+
readonly kind: "command";
|
|
2197
|
+
};
|
|
2198
|
+
}, {
|
|
2199
|
+
readonly id: "center";
|
|
2200
|
+
readonly labelKey: "alignment.center";
|
|
2201
|
+
readonly paths: readonly string[];
|
|
2202
|
+
readonly state: {
|
|
2203
|
+
readonly kind: "command";
|
|
2204
|
+
};
|
|
2205
|
+
}, {
|
|
2206
|
+
readonly id: "right";
|
|
2207
|
+
readonly labelKey: "alignment.alignRight";
|
|
2208
|
+
readonly paths: readonly string[];
|
|
2209
|
+
readonly state: {
|
|
2210
|
+
readonly kind: "command";
|
|
2211
|
+
};
|
|
2212
|
+
}, {
|
|
2213
|
+
readonly id: "justify";
|
|
2214
|
+
readonly labelKey: "alignment.justify";
|
|
2215
|
+
readonly paths: readonly string[];
|
|
2216
|
+
readonly state: {
|
|
2217
|
+
readonly kind: "command";
|
|
2218
|
+
};
|
|
2219
|
+
}];
|
|
2220
|
+
}, {
|
|
2221
|
+
readonly id: "list";
|
|
2222
|
+
readonly labelKey: "formattingBar.groups.listFormatting";
|
|
2223
|
+
readonly controls: readonly [{
|
|
2224
|
+
readonly id: "bullet";
|
|
2225
|
+
readonly labelKey: "lists.bulletList";
|
|
2226
|
+
readonly paths: readonly string[];
|
|
2227
|
+
readonly state: {
|
|
2228
|
+
readonly kind: "command";
|
|
2229
|
+
};
|
|
2230
|
+
}, {
|
|
2231
|
+
readonly id: "numbered";
|
|
2232
|
+
readonly labelKey: "lists.numberedList";
|
|
2233
|
+
readonly paths: readonly string[];
|
|
2234
|
+
readonly state: {
|
|
2235
|
+
readonly kind: "command";
|
|
2236
|
+
};
|
|
2237
|
+
}, {
|
|
2238
|
+
readonly id: "outdent";
|
|
2239
|
+
readonly labelKey: "lists.decreaseIndent";
|
|
2240
|
+
readonly paths: readonly string[];
|
|
2241
|
+
readonly state: {
|
|
2242
|
+
readonly kind: "command";
|
|
2243
|
+
};
|
|
2244
|
+
}, {
|
|
2245
|
+
readonly id: "indent";
|
|
2246
|
+
readonly labelKey: "lists.increaseIndent";
|
|
2247
|
+
readonly paths: readonly string[];
|
|
2248
|
+
readonly state: {
|
|
2249
|
+
readonly kind: "command";
|
|
2250
|
+
};
|
|
2251
|
+
}, {
|
|
2252
|
+
readonly id: "lineSpacing";
|
|
2253
|
+
readonly shape: "dropdown";
|
|
2254
|
+
readonly labelKey: "lineSpacing.label";
|
|
2255
|
+
readonly paths: readonly string[];
|
|
2256
|
+
readonly state: {
|
|
2257
|
+
readonly kind: "command";
|
|
2258
|
+
};
|
|
2259
|
+
}];
|
|
2260
|
+
}, {
|
|
2261
|
+
readonly id: "format";
|
|
2262
|
+
readonly labelKey: "formattingBar.clearFormatting";
|
|
2263
|
+
readonly controls: readonly [{
|
|
2264
|
+
readonly id: "clear";
|
|
2265
|
+
readonly labelKey: "formattingBar.clearFormatting";
|
|
2266
|
+
readonly paths: readonly string[];
|
|
2267
|
+
readonly state: {
|
|
2268
|
+
readonly kind: "command";
|
|
2269
|
+
};
|
|
2270
|
+
}];
|
|
2271
|
+
}, {
|
|
2272
|
+
readonly id: "review";
|
|
2273
|
+
readonly labelKey: "formattingBar.commentsAndChanges";
|
|
2274
|
+
readonly controls: readonly [{
|
|
2275
|
+
readonly id: "comments";
|
|
2276
|
+
readonly shape: "icon";
|
|
2277
|
+
readonly labelKey: "formattingBar.commentsAndChanges";
|
|
2278
|
+
readonly paths: readonly string[];
|
|
2279
|
+
readonly state: {
|
|
2280
|
+
readonly kind: "command";
|
|
2281
|
+
};
|
|
2282
|
+
}, {
|
|
2283
|
+
readonly id: "editingMode";
|
|
2284
|
+
readonly shape: "dropdown";
|
|
2285
|
+
readonly labelKey: "editingMode.label";
|
|
2286
|
+
readonly valueKey: "editingMode.editing";
|
|
2287
|
+
readonly paths: readonly string[];
|
|
2288
|
+
readonly state: {
|
|
2289
|
+
readonly kind: "command";
|
|
2290
|
+
};
|
|
2291
|
+
}];
|
|
2292
|
+
}, {
|
|
2293
|
+
readonly id: "contentControl";
|
|
2294
|
+
readonly labelKey: "contentControl.group";
|
|
2295
|
+
readonly contextual: true;
|
|
2296
|
+
readonly controls: readonly [{
|
|
2297
|
+
readonly id: "showAll";
|
|
2298
|
+
readonly labelKey: "contentControl.showAll";
|
|
2299
|
+
readonly paths: readonly string[];
|
|
2300
|
+
readonly state: {
|
|
2301
|
+
readonly kind: "command";
|
|
2302
|
+
};
|
|
2303
|
+
}, {
|
|
2304
|
+
readonly id: "formFill";
|
|
2305
|
+
readonly labelKey: "contentControl.formFill";
|
|
2306
|
+
readonly paths: readonly string[];
|
|
2307
|
+
readonly state: {
|
|
2308
|
+
readonly kind: "command";
|
|
2309
|
+
};
|
|
2310
|
+
}, {
|
|
2311
|
+
readonly id: "inspector";
|
|
2312
|
+
readonly labelKey: "contentControl.inspector";
|
|
2313
|
+
readonly paths: readonly string[];
|
|
2314
|
+
readonly state: {
|
|
2315
|
+
readonly kind: "command";
|
|
2316
|
+
};
|
|
2317
|
+
}, {
|
|
2318
|
+
readonly id: "remove";
|
|
2319
|
+
readonly labelKey: "contentControl.remove";
|
|
2320
|
+
readonly paths: readonly string[];
|
|
2321
|
+
readonly state: {
|
|
2322
|
+
readonly kind: "command";
|
|
2323
|
+
};
|
|
2324
|
+
}];
|
|
2325
|
+
}, {
|
|
2326
|
+
readonly id: "image";
|
|
2327
|
+
readonly labelKey: "formattingBar.groups.image";
|
|
2328
|
+
readonly contextual: true;
|
|
2329
|
+
readonly controls: readonly [{
|
|
2330
|
+
readonly id: "insert";
|
|
2331
|
+
readonly labelKey: "toolbar.image";
|
|
2332
|
+
readonly paths: readonly string[];
|
|
2333
|
+
readonly state: {
|
|
2334
|
+
readonly kind: "command";
|
|
2335
|
+
};
|
|
2336
|
+
}, {
|
|
2337
|
+
readonly id: "properties";
|
|
2338
|
+
readonly labelKey: "formattingBar.imagePropertiesShortcut";
|
|
2339
|
+
readonly paths: readonly string[];
|
|
2340
|
+
readonly state: {
|
|
2341
|
+
readonly kind: "command";
|
|
2342
|
+
};
|
|
2343
|
+
}, {
|
|
2344
|
+
readonly id: "wrap";
|
|
2345
|
+
readonly shape: "dropdown";
|
|
2346
|
+
readonly labelKey: "formattingBar.imageWrap";
|
|
2347
|
+
readonly paths: readonly string[];
|
|
2348
|
+
readonly valueKey: "imageWrap.inline";
|
|
2349
|
+
readonly state: {
|
|
2350
|
+
readonly kind: "value";
|
|
2351
|
+
};
|
|
2352
|
+
}, {
|
|
2353
|
+
readonly id: "altText";
|
|
2354
|
+
readonly shape: "dropdown";
|
|
2355
|
+
readonly labelKey: "formattingBar.altText";
|
|
2356
|
+
readonly paths: null;
|
|
2357
|
+
readonly valueKey: "imageProperties.altText";
|
|
2358
|
+
readonly state: {
|
|
2359
|
+
readonly kind: "value";
|
|
2360
|
+
};
|
|
2361
|
+
}];
|
|
2362
|
+
}, {
|
|
2363
|
+
readonly id: "table";
|
|
2364
|
+
readonly labelKey: "formattingBar.groups.table";
|
|
2365
|
+
readonly contextual: true;
|
|
2366
|
+
readonly controls: readonly [{
|
|
2367
|
+
readonly id: "insert";
|
|
2368
|
+
readonly labelKey: "toolbar.table";
|
|
2369
|
+
readonly paths: readonly string[];
|
|
2370
|
+
readonly state: {
|
|
2371
|
+
readonly kind: "command";
|
|
2372
|
+
};
|
|
2373
|
+
}, {
|
|
2374
|
+
readonly id: "borderTarget";
|
|
2375
|
+
readonly shape: "dropdown";
|
|
2376
|
+
readonly labelKey: "table.borders.tooltip";
|
|
2377
|
+
readonly paths: readonly string[];
|
|
2378
|
+
readonly state: {
|
|
2379
|
+
readonly kind: "value";
|
|
2380
|
+
};
|
|
2381
|
+
}, {
|
|
2382
|
+
readonly id: "borderColor";
|
|
2383
|
+
readonly shape: "colorSplit";
|
|
2384
|
+
readonly swatch: "#000000";
|
|
2385
|
+
readonly labelKey: "table.borderColor";
|
|
2386
|
+
readonly paths: readonly string[];
|
|
2387
|
+
readonly state: {
|
|
2388
|
+
readonly kind: "value";
|
|
2389
|
+
};
|
|
2390
|
+
}, {
|
|
2391
|
+
readonly id: "borderStyle";
|
|
2392
|
+
readonly shape: "dropdown";
|
|
2393
|
+
readonly labelKey: "table.borders.styleAriaLabel";
|
|
2394
|
+
readonly paths: readonly string[];
|
|
2395
|
+
readonly state: {
|
|
2396
|
+
readonly kind: "value";
|
|
2397
|
+
};
|
|
2398
|
+
}, {
|
|
2399
|
+
readonly id: "borderWidth";
|
|
2400
|
+
readonly shape: "dropdown";
|
|
2401
|
+
readonly labelKey: "table.borderWidth";
|
|
2402
|
+
readonly paths: readonly string[];
|
|
2403
|
+
readonly state: {
|
|
2404
|
+
readonly kind: "value";
|
|
2405
|
+
};
|
|
2406
|
+
}, {
|
|
2407
|
+
readonly id: "cellFill";
|
|
2408
|
+
readonly shape: "colorSplit";
|
|
2409
|
+
readonly swatch: "#ffffff";
|
|
2410
|
+
readonly labelKey: "table.cellFillColor";
|
|
2411
|
+
readonly paths: readonly string[];
|
|
2412
|
+
readonly state: {
|
|
2413
|
+
readonly kind: "value";
|
|
2414
|
+
};
|
|
2415
|
+
}];
|
|
2416
|
+
}, {
|
|
2417
|
+
readonly id: "paragraph";
|
|
2418
|
+
readonly labelKey: "dialogs.paragraph.title";
|
|
2419
|
+
readonly contextual: true;
|
|
2420
|
+
readonly controls: readonly [{
|
|
2421
|
+
readonly id: "dialog";
|
|
2422
|
+
readonly labelKey: "lineSpacing.options";
|
|
2423
|
+
readonly paths: readonly string[];
|
|
2424
|
+
readonly state: {
|
|
2425
|
+
readonly kind: "command";
|
|
2426
|
+
};
|
|
2427
|
+
}];
|
|
2428
|
+
}, {
|
|
2429
|
+
readonly id: "file";
|
|
2430
|
+
readonly labelKey: "toolbar.file";
|
|
2431
|
+
readonly contextual: true;
|
|
2432
|
+
readonly controls: readonly [{
|
|
2433
|
+
readonly id: "open";
|
|
2434
|
+
readonly labelKey: "toolbar.open";
|
|
2435
|
+
readonly paths: readonly string[];
|
|
2436
|
+
readonly state: {
|
|
2437
|
+
readonly kind: "load";
|
|
2438
|
+
};
|
|
2439
|
+
}, {
|
|
2440
|
+
readonly id: "save";
|
|
2441
|
+
readonly labelKey: "toolbar.saveShortcut";
|
|
2442
|
+
readonly paths: readonly string[];
|
|
2443
|
+
readonly state: {
|
|
2444
|
+
readonly kind: "save";
|
|
2161
2445
|
};
|
|
2162
|
-
}
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
|
|
2168
|
-
|
|
2169
|
-
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2184
|
-
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2210
|
-
|
|
2211
|
-
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2259
|
-
|
|
2260
|
-
|
|
2261
|
-
|
|
2262
|
-
|
|
2263
|
-
|
|
2264
|
-
|
|
2265
|
-
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
* which is what lets the reader step out of a card by clicking away from it.
|
|
2308
|
-
*
|
|
2309
|
-
* `selection` is what activation wants installed, and it is installed HERE rather than by a
|
|
2310
|
-
* `setSelection` of the caller's own so that the pin is up before anything is published. The
|
|
2311
|
-
* other order repainted the bands and reported state while the caret was still the only
|
|
2312
|
-
* evidence, so a host saw the wrong twin active for one frame and then a correction. Omit it
|
|
2313
|
-
* to pin against the live selection, which is what a header or note scope has already set.
|
|
2314
|
-
*/
|
|
2315
|
-
activateReview(key: string, selection?: SemanticSelection): void;
|
|
2316
|
-
/**
|
|
2317
|
-
* The key {@link activateReview} pinned, or null once its selection is no longer live.
|
|
2318
|
-
*
|
|
2319
|
-
* Exists so nothing outside the surface keeps its own copy of "the selection came from
|
|
2320
|
-
* opening a card". `selectionPlacement` needs that fact to stay quiet about offering a
|
|
2321
|
-
* comment on text the reader only selected by opening a card over it, and the copy it used to
|
|
2322
|
-
* keep was set on one of activation's three branches, so a header card offered to comment on
|
|
2323
|
-
* itself.
|
|
2324
|
-
*/
|
|
2325
|
-
activatedReviewKey(): string | null;
|
|
2326
|
-
/**
|
|
2327
|
-
* Close the open item until the caret next moves.
|
|
2328
|
-
*
|
|
2329
|
-
* What a click on the canvas means. The caret does not move when someone clicks the grey
|
|
2330
|
-
* around the page, so nothing else would ever put the item away.
|
|
2331
|
-
*/
|
|
2332
|
-
dismissActiveReview(): void;
|
|
2333
|
-
/**
|
|
2334
|
-
* Revision kinds the CARET must not activate, or null for none.
|
|
2335
|
-
*
|
|
2336
|
-
* The review rail filters what it renders (structural and format cards are hidden by
|
|
2337
|
-
* default), but {@link activeReviewKey} used to compute over the unfiltered queue — a
|
|
2338
|
-
* click on tracked text under a format change activated a card the rail does not draw,
|
|
2339
|
-
* and nothing on screen lit up. A host that filters its list tells the surface, so the
|
|
2340
|
-
* band and the visible cards stay one answer.
|
|
2341
|
-
*/
|
|
2342
|
-
setReviewActivationExclusions(kinds: readonly ReviewRevisionKind[] | null): void;
|
|
2343
|
-
/**
|
|
2344
|
-
* `bookmarkName -> position` over the current revision, for resolving an internal link.
|
|
2345
|
-
* First in document order wins a duplicate name, matching Word.
|
|
2346
|
-
*/
|
|
2347
|
-
bookmarks(): BookmarkIndex;
|
|
2348
|
-
/** The selected text, for copy and cut. */
|
|
2349
|
-
selectedText(): string;
|
|
2350
|
-
/** Remove the selection, if any. Returns whether anything was deleted. */
|
|
2351
|
-
deleteSelection(): boolean;
|
|
2352
|
-
navigate(command: NavigationCommand, extend?: boolean): void;
|
|
2353
|
-
/** Reverse the last history entry and put the caret back where it was made. */
|
|
2354
|
-
undo(): void;
|
|
2355
|
-
redo(): void;
|
|
2356
|
-
/**
|
|
2357
|
-
* Refresh table insertion furniture labels without remounting or relayout.
|
|
2358
|
-
*
|
|
2359
|
-
* @public
|
|
2360
|
-
*/
|
|
2361
|
-
refreshTableInteractionLabels(): void;
|
|
2362
|
-
focus(): void;
|
|
2446
|
+
}, {
|
|
2447
|
+
readonly id: "pageSetup";
|
|
2448
|
+
readonly labelKey: "toolbar.pageSetup";
|
|
2449
|
+
readonly paths: readonly string[];
|
|
2450
|
+
readonly state: {
|
|
2451
|
+
readonly kind: "command";
|
|
2452
|
+
};
|
|
2453
|
+
}];
|
|
2454
|
+
}, {
|
|
2455
|
+
readonly id: "insert";
|
|
2456
|
+
readonly labelKey: "toolbar.insert";
|
|
2457
|
+
readonly contextual: true;
|
|
2458
|
+
readonly controls: readonly [{
|
|
2459
|
+
readonly id: "footnote";
|
|
2460
|
+
readonly labelKey: "toolbar.insertFootnote";
|
|
2461
|
+
readonly paths: readonly string[];
|
|
2462
|
+
readonly state: {
|
|
2463
|
+
readonly kind: "command";
|
|
2464
|
+
};
|
|
2465
|
+
}, {
|
|
2466
|
+
readonly id: "endnote";
|
|
2467
|
+
readonly labelKey: "toolbar.insertEndnote";
|
|
2468
|
+
readonly paths: readonly string[];
|
|
2469
|
+
readonly state: {
|
|
2470
|
+
readonly kind: "command";
|
|
2471
|
+
};
|
|
2472
|
+
}, {
|
|
2473
|
+
readonly id: "pageNumber";
|
|
2474
|
+
readonly labelKey: "headerFooter.insertPageNumber";
|
|
2475
|
+
readonly paths: readonly string[];
|
|
2476
|
+
readonly state: {
|
|
2477
|
+
readonly kind: "command";
|
|
2478
|
+
};
|
|
2479
|
+
}, {
|
|
2480
|
+
readonly id: "totalPages";
|
|
2481
|
+
readonly labelKey: "headerFooter.insertTotalPages";
|
|
2482
|
+
readonly paths: readonly string[];
|
|
2483
|
+
readonly state: {
|
|
2484
|
+
readonly kind: "command";
|
|
2485
|
+
};
|
|
2486
|
+
}, {
|
|
2487
|
+
readonly id: "sectionPages";
|
|
2488
|
+
readonly labelKey: "headerFooter.insertSectionPages";
|
|
2489
|
+
readonly paths: readonly string[];
|
|
2490
|
+
readonly state: {
|
|
2491
|
+
readonly kind: "command";
|
|
2492
|
+
};
|
|
2493
|
+
}, {
|
|
2494
|
+
readonly id: "pageXofY";
|
|
2495
|
+
readonly labelKey: "headerFooter.insertPageXofY";
|
|
2496
|
+
readonly paths: readonly string[];
|
|
2497
|
+
readonly state: {
|
|
2498
|
+
readonly kind: "command";
|
|
2499
|
+
};
|
|
2500
|
+
}, {
|
|
2501
|
+
readonly id: "pageBreak";
|
|
2502
|
+
readonly labelKey: "toolbar.pageBreak";
|
|
2503
|
+
readonly paths: readonly string[];
|
|
2504
|
+
readonly state: {
|
|
2505
|
+
readonly kind: "command";
|
|
2506
|
+
};
|
|
2507
|
+
}, {
|
|
2508
|
+
readonly id: "sectionBreakNextPage";
|
|
2509
|
+
readonly labelKey: "toolbar.sectionBreakNextPage";
|
|
2510
|
+
readonly paths: readonly string[];
|
|
2511
|
+
readonly state: {
|
|
2512
|
+
readonly kind: "command";
|
|
2513
|
+
};
|
|
2514
|
+
}, {
|
|
2515
|
+
readonly id: "sectionBreakContinuous";
|
|
2516
|
+
readonly labelKey: "toolbar.sectionBreakContinuous";
|
|
2517
|
+
readonly paths: readonly string[];
|
|
2518
|
+
readonly state: {
|
|
2519
|
+
readonly kind: "command";
|
|
2520
|
+
};
|
|
2521
|
+
}, {
|
|
2522
|
+
readonly id: "toc";
|
|
2523
|
+
readonly labelKey: "toolbar.tableOfContents";
|
|
2524
|
+
readonly paths: readonly string[];
|
|
2525
|
+
readonly state: {
|
|
2526
|
+
readonly kind: "command";
|
|
2527
|
+
};
|
|
2528
|
+
}];
|
|
2529
|
+
}];
|
|
2530
|
+
/**
|
|
2531
|
+
* Every group id in the chrome, as a literal union. Stable public API; renaming a group
|
|
2532
|
+
* id is a breaking change.
|
|
2533
|
+
*
|
|
2534
|
+
* @public
|
|
2535
|
+
*/
|
|
2536
|
+
type ChromeGroupId = 'history' | 'zoom' | 'styles' | 'font' | 'text' | 'script' | 'alignment' | 'list' | 'format' | 'review' | 'contentControl' | 'image' | 'table' | 'paragraph' | 'file' | 'insert';
|
|
2537
|
+
/**
|
|
2538
|
+
* The public slot vocabulary: `${groupId}.${controlId}` for every control that actually
|
|
2539
|
+
* exists — `text.bold`, `font.family`, `alignment.left`. THE stable contract a host
|
|
2540
|
+
* composes against and `commandForSlot` resolves; renaming a slot is a breaking change.
|
|
2541
|
+
*
|
|
2542
|
+
* @public
|
|
2543
|
+
*/
|
|
2544
|
+
type ChromeSlotId = 'history.undo' | 'history.redo' | 'zoom.level' | 'styles.style' | 'font.family' | 'font.size' | 'text.bold' | 'text.italic' | 'text.underline' | 'text.strike' | 'text.color' | 'text.highlight' | 'text.link' | 'script.super' | 'script.sub' | 'alignment.left' | 'alignment.center' | 'alignment.right' | 'alignment.justify' | 'list.bullet' | 'list.numbered' | 'list.outdent' | 'list.indent' | 'list.lineSpacing' | 'format.clear' | 'review.comments' | 'review.editingMode' | 'contentControl.showAll' | 'contentControl.formFill' | 'contentControl.inspector' | 'contentControl.remove' | 'image.insert' | 'image.properties' | 'image.wrap' | 'image.altText' | 'table.insert' | 'table.borderTarget' | 'table.borderColor' | 'table.borderStyle' | 'table.borderWidth' | 'table.cellFill' | 'file.open' | 'file.save' | 'paragraph.dialog' | 'file.pageSetup' | 'insert.footnote' | 'insert.endnote' | 'insert.pageNumber' | 'insert.totalPages' | 'insert.sectionPages' | 'insert.pageXofY' | 'insert.pageBreak' | 'insert.sectionBreakNextPage' | 'insert.sectionBreakContinuous' | 'insert.toc';
|
|
2545
|
+
/**
|
|
2546
|
+
* Every control id in the chrome, as a literal union. Unique WITHIN a group, not
|
|
2547
|
+
* globally (`image.insert` / `table.insert`) — key consumers on {@link ChromeSlotId}.
|
|
2548
|
+
*
|
|
2549
|
+
* @public
|
|
2550
|
+
*/
|
|
2551
|
+
type ChromeControlId = ChromeSlotId extends `${string}.${infer C}` ? C : never;
|
|
2552
|
+
/**
|
|
2553
|
+
* The slot id of one control within its group. Only meaningful for entries of
|
|
2554
|
+
* `CHROME_GROUPS` — the cast is sound because every group/control pair in the registry
|
|
2555
|
+
* is, by construction, a member of the `ChromeSlotId` union.
|
|
2556
|
+
*
|
|
2557
|
+
* @public
|
|
2558
|
+
*/
|
|
2559
|
+
declare function chromeSlotId(group: {
|
|
2560
|
+
readonly id: string;
|
|
2561
|
+
}, control: {
|
|
2562
|
+
readonly id: string;
|
|
2563
|
+
}): ChromeSlotId;
|
|
2564
|
+
/**
|
|
2565
|
+
* The groups of the DEFAULT toolbar arrangement, in bar order: every group that is
|
|
2566
|
+
* not `contextual`. This is the registry's default bar — undo/redo through the
|
|
2567
|
+
* editing-mode picker — and what both adapters render when the host composes
|
|
2568
|
+
* nothing. Contextual slots (`image.*`, `table.insert`, `file.save`) remain
|
|
2569
|
+
* available for explicit composition.
|
|
2570
|
+
*
|
|
2571
|
+
* @public
|
|
2572
|
+
*/
|
|
2573
|
+
declare function defaultChromeGroups(): readonly ChromeGroup[];
|
|
2574
|
+
/**
|
|
2575
|
+
* The formatting-bar groups for one editor snapshot: the default bar, plus the
|
|
2576
|
+
* contextual `image` group when a drawing is selected. Insertion without a selection is
|
|
2577
|
+
* not in the packaged chrome at all — a host that wants it places `image.insert` itself,
|
|
2578
|
+
* through `DocxEditor.Toolbar.ImageInsert` or `DocxEditor.Menu.ImageInsert`.
|
|
2579
|
+
*
|
|
2580
|
+
* @public
|
|
2581
|
+
*/
|
|
2582
|
+
declare function formattingBarChromeGroups(image: ImageContext | null): readonly ChromeGroup[];
|
|
2583
|
+
/**
|
|
2584
|
+
* A row that runs one chrome slot.
|
|
2585
|
+
*
|
|
2586
|
+
* @public
|
|
2587
|
+
*/
|
|
2588
|
+
interface ChromeMenuItemEntry {
|
|
2589
|
+
readonly kind: 'item';
|
|
2590
|
+
readonly slot: ChromeSlotId;
|
|
2363
2591
|
/**
|
|
2364
|
-
*
|
|
2592
|
+
* Plain-label override for this row.
|
|
2365
2593
|
*
|
|
2366
|
-
*
|
|
2367
|
-
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
/** Active editing view — body, or an open header/footer story by rId. */
|
|
2371
|
-
activeScope(): ViewScope;
|
|
2372
|
-
/** Activate a view scope. Returns false when a header/footer rId cannot be opened. */
|
|
2373
|
-
setActiveScope(scope: ViewScope): boolean;
|
|
2374
|
-
/**
|
|
2375
|
-
* Open a header/footer story for editing on the painted surface.
|
|
2376
|
-
* Refuses dangling / unknown relationship ids.
|
|
2594
|
+
* A slot's own `labelKey` is a TOOLTIP key, and several of them fold the shortcut into
|
|
2595
|
+
* the text (`formattingBar.boldShortcut` is "Bold (Ctrl+B)"). A menu puts the shortcut
|
|
2596
|
+
* in its own right-hand column, so the row needs the bare noun. Both keys already exist
|
|
2597
|
+
* in the catalogue — this points at the plain one rather than minting a duplicate.
|
|
2377
2598
|
*/
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
readonly sectionIndex?: number;
|
|
2382
|
-
readonly kind?: 'header' | 'footer';
|
|
2383
|
-
readonly variant?: 'default' | 'first' | 'even';
|
|
2384
|
-
readonly position?: SemanticPosition;
|
|
2385
|
-
}): boolean;
|
|
2386
|
-
/** Leave furniture editing and restore the prior body selection. */
|
|
2387
|
-
exitHeaderFooter(): void;
|
|
2388
|
-
/** Chrome read-model for the open furniture scope, or null when editing the body. */
|
|
2389
|
-
headerFooterState(): {
|
|
2390
|
-
readonly editing: 'header' | 'footer' | null;
|
|
2391
|
-
readonly sectionIndex: number;
|
|
2392
|
-
readonly variant?: 'default' | 'first' | 'even';
|
|
2393
|
-
readonly rId?: string;
|
|
2394
|
-
readonly partName?: string;
|
|
2395
|
-
readonly inherited?: boolean;
|
|
2396
|
-
readonly titlePage?: boolean;
|
|
2397
|
-
readonly evenAndOddHeaders?: boolean;
|
|
2398
|
-
readonly headerDistanceTwips?: number;
|
|
2399
|
-
readonly footerDistanceTwips?: number;
|
|
2400
|
-
} | null;
|
|
2599
|
+
readonly labelKey?: string;
|
|
2600
|
+
/** i18n key of the shortcut shown right-aligned on the row (`toolbar.saveShortcut`). */
|
|
2601
|
+
readonly shortcutKey?: string;
|
|
2401
2602
|
/**
|
|
2402
|
-
*
|
|
2403
|
-
*
|
|
2603
|
+
* The row opens a size PICKER instead of firing on click — Word's insert-table grid.
|
|
2604
|
+
* The slot still owns the label, the icon and the enabled state; only the dispatch
|
|
2605
|
+
* differs, and the picked size is what the host sends.
|
|
2404
2606
|
*/
|
|
2405
|
-
|
|
2406
|
-
readonly op: 'createHeaderFooter' | 'deleteHeaderFooter' | 'linkToPrevious' | 'unlinkFromPrevious' | 'setSectionFurnitureOptions';
|
|
2407
|
-
readonly sectionIndex?: number;
|
|
2408
|
-
readonly kind?: 'header' | 'footer';
|
|
2409
|
-
readonly variant?: 'default' | 'first' | 'even';
|
|
2410
|
-
readonly titlePage?: boolean;
|
|
2411
|
-
readonly evenAndOddHeaders?: boolean;
|
|
2412
|
-
readonly headerDistanceTwips?: number;
|
|
2413
|
-
readonly footerDistanceTwips?: number;
|
|
2414
|
-
}): {
|
|
2415
|
-
readonly ok: true;
|
|
2416
|
-
} | {
|
|
2417
|
-
readonly ok: false;
|
|
2418
|
-
readonly reason: string;
|
|
2419
|
-
};
|
|
2420
|
-
/** Insert an allowlisted page field at the caret in the open HF story. */
|
|
2421
|
-
insertPageField(field: 'PAGE' | 'NUMPAGES' | 'SECTIONPAGES' | 'PAGE_X_OF_Y'): boolean;
|
|
2422
|
-
/** Insert a footnote/endnote at the body caret. */
|
|
2423
|
-
insertNote(noteKind: 'footnote' | 'endnote'): boolean;
|
|
2424
|
-
deleteNote(noteKind: 'footnote' | 'endnote', noteId: number): boolean;
|
|
2425
|
-
convertNote(fromKind: 'footnote' | 'endnote', noteId: number): boolean;
|
|
2426
|
-
convertAllNotes(fromKind: 'footnote' | 'endnote'): boolean;
|
|
2427
|
-
setNoteProperties(args: {
|
|
2428
|
-
readonly scope: 'document' | 'section';
|
|
2429
|
-
readonly sectionIndex?: number;
|
|
2430
|
-
readonly footnote?: {
|
|
2431
|
-
readonly numFmt?: string;
|
|
2432
|
-
readonly numRestart?: string;
|
|
2433
|
-
readonly position?: string;
|
|
2434
|
-
readonly numStart?: number;
|
|
2435
|
-
};
|
|
2436
|
-
readonly endnote?: {
|
|
2437
|
-
readonly numFmt?: string;
|
|
2438
|
-
readonly numRestart?: string;
|
|
2439
|
-
readonly position?: string;
|
|
2440
|
-
readonly numStart?: number;
|
|
2441
|
-
};
|
|
2442
|
-
}): boolean;
|
|
2443
|
-
enterNote(scopeId: string, position?: {
|
|
2444
|
-
paragraphId: string;
|
|
2445
|
-
offset: number;
|
|
2446
|
-
}): boolean;
|
|
2447
|
-
exitNote(): void;
|
|
2448
|
-
/** Resolved/authored note properties for the caret section — chrome read-model. */
|
|
2449
|
-
notePropertiesState(): NotePropertiesStateSnapshot | null;
|
|
2450
|
-
/** Plain-text preview for hover chrome — never returns markup. */
|
|
2451
|
-
notePreviewText(scopeId: string): string | null;
|
|
2452
|
-
/** Commit one table-command plan as a single store transaction. */
|
|
2453
|
-
applyTableCommandPlan(plan: TableCommandPlan): ExecResult;
|
|
2607
|
+
readonly picker?: 'tableGrid';
|
|
2454
2608
|
}
|
|
2455
2609
|
/**
|
|
2456
|
-
*
|
|
2610
|
+
* A row that opens a nested panel of rows (Insert › Break).
|
|
2457
2611
|
*
|
|
2458
|
-
*
|
|
2459
|
-
*
|
|
2460
|
-
*
|
|
2612
|
+
* It carries its own label and icon rather than a slot, because a submenu PARENT has no
|
|
2613
|
+
* command: clicking it opens the panel. Giving it a slot would mint a public id for a
|
|
2614
|
+
* control that can never be enabled, and `toolbarCommandState` would have to invent an
|
|
2615
|
+
* answer about it.
|
|
2616
|
+
*
|
|
2617
|
+
* @public
|
|
2461
2618
|
*/
|
|
2462
|
-
|
|
2463
|
-
readonly
|
|
2464
|
-
readonly
|
|
2465
|
-
|
|
2466
|
-
readonly
|
|
2467
|
-
|
|
2468
|
-
|
|
2469
|
-
|
|
2619
|
+
interface ChromeMenuSubmenuEntry {
|
|
2620
|
+
readonly kind: 'submenu';
|
|
2621
|
+
readonly labelKey: string;
|
|
2622
|
+
readonly paths: readonly string[] | null;
|
|
2623
|
+
readonly items: readonly ChromeMenuEntry[];
|
|
2624
|
+
}
|
|
2625
|
+
/** A horizontal rule between groups of rows. @public */
|
|
2626
|
+
interface ChromeMenuSeparatorEntry {
|
|
2627
|
+
readonly kind: 'separator';
|
|
2628
|
+
}
|
|
2629
|
+
/** One row of a chrome menu. @public */
|
|
2630
|
+
type ChromeMenuEntry = ChromeMenuItemEntry | ChromeMenuSubmenuEntry | ChromeMenuSeparatorEntry;
|
|
2631
|
+
/**
|
|
2632
|
+
* Every menu id, as a literal union. Stable public API; renaming one is a breaking change,
|
|
2633
|
+
* exactly like a group or slot id.
|
|
2634
|
+
*
|
|
2635
|
+
* @public
|
|
2636
|
+
*/
|
|
2637
|
+
type ChromeMenuId = 'file' | 'format' | 'insert' | 'help';
|
|
2638
|
+
/** One menu of the menu bar. @public */
|
|
2639
|
+
interface ChromeMenu {
|
|
2640
|
+
readonly id: ChromeMenuId;
|
|
2641
|
+
readonly labelKey: string;
|
|
2642
|
+
readonly entries: readonly ChromeMenuEntry[];
|
|
2643
|
+
}
|
|
2644
|
+
/**
|
|
2645
|
+
* The menu bar the chrome shows above the toolbar, in bar order: File, Format, Insert,
|
|
2646
|
+
* Help.
|
|
2647
|
+
*
|
|
2648
|
+
* @public
|
|
2649
|
+
*/
|
|
2650
|
+
declare const CHROME_MENUS: readonly ChromeMenu[];
|
|
2651
|
+
/**
|
|
2652
|
+
* Every slot a menu places, in menu order, submenus flattened. What a parity test asserts
|
|
2653
|
+
* against, and what a host enumerates to know which capabilities the menu bar reaches.
|
|
2654
|
+
*
|
|
2655
|
+
* @public
|
|
2656
|
+
*/
|
|
2657
|
+
declare function chromeMenuSlots(): readonly ChromeSlotId[];
|
|
2658
|
+
/** Total controls, so a parity test can assert none were dropped. */
|
|
2659
|
+
declare function chromeControlCount(): number;
|
|
2660
|
+
/**
|
|
2661
|
+
* i18n key for the tooltip on a control an ADAPTER renders but cannot drive yet — a
|
|
2662
|
+
* value slot in a toolbar that has grown no picker for it, say. It is never the reason
|
|
2663
|
+
* a control is disabled: when the ENGINE refuses, the tooltip is the engine's own
|
|
2664
|
+
* `disabledReason`, never an adapter paraphrase.
|
|
2665
|
+
*/
|
|
2666
|
+
declare const CHROME_UNAVAILABLE_KEY = "formattingBar.unavailableInPreview";
|
|
2470
2667
|
|
|
2471
2668
|
/** Material Symbol name → SVG path data (viewBox "0 -960 960 960"). */
|
|
2472
2669
|
declare const GENERATED_ICON_PATHS: Readonly<Record<string, readonly string[]>>;
|
|
@@ -2715,4 +2912,4 @@ declare function runTableCommand(editor: Editor | null, command: EditorCommand):
|
|
|
2715
2912
|
*/
|
|
2716
2913
|
declare function createDocxEditor(config: DocxEditorConfig): DocxEditorInstance;
|
|
2717
2914
|
|
|
2718
|
-
export {
|
|
2915
|
+
export { type SelectedDrawingOverlayTarget as $, type AnchorFrameOrigin as A, type FontResolver as B, CHROME_GROUPS as C, type DocxEditorInstance as D, EMU_PER_POINT as E, type FinalizedImageOverlayInteraction as F, type FontUrlSource as G, type HyperlinkActivation as H, type HyperlinkChromeHandlers as I, type HyperlinkOps as J, IMAGE_OVERLAY_NUDGE_PT as K, IMAGE_OVERLAY_NUDGE_SHIFT_PT as L, type ImageInteractionSession as M, type ImageOverlayScrollPort as N, type OpenPaginatedResult as O, type PaginatedSurfaceOptions as P, type ImageResizeHandle as Q, type ImageResizeResult as R, type LoadFontsRequest as S, type TableCommandPlan as T, type LoadFontsResult as U, MAX_RESOLVER_FAMILIES as V, type OverlayFrameRect as W, type PaginatedSurfaceState as X, type ParagraphPropertyEdit as Y, type RunTableChromeCommandResult as Z, type SectionAnchor as _, type PaginatedSurface as a, tableChromeToolbarState as a$, type SurfaceEquation as a0, type SurfaceFormatting as a1, type SurfaceHyperlink as a2, type SurfaceNavigation as a3, type SurfaceOverlayCoordinates as a4, type SurfaceParagraphFormat as a5, TABLE_BORDER_STYLE_OPTIONS as a6, TABLE_BORDER_TARGET_OPTIONS as a7, TABLE_BORDER_WIDTH_OPTIONS as a8, TABLE_CHROME_SLOT_IDS as a9, createFontSource as aA, createImageOverlayScrollPort as aB, cssPixelsToLayoutPoints as aC, defaultChromeGroups as aD, defaultTableLabel as aE, emuToOverlayPoints as aF, equationAtPosition as aG, executeImageCommand as aH, finalizeImageOverlayInteraction as aI, formattingBarChromeGroups as aJ, isStaleImageInteractionCommit as aK, isTableChromeSlot as aL, layoutPointsToCssPixels as aM, loadFonts as aN, overlayFrameToSheetCssPixels as aO, pointsToEmu as aP, probeTableChromeCommand as aQ, resizePreservesAspect as aR, runSave as aS, runTableChromeCommand as aT, runTableCommand as aU, runToolbarCommand as aV, selectedDrawingOverlayTargetOf as aW, selectedImageStateOf as aX, surfacePaintScale as aY, tableChromeIconPaths as aZ, tableChromeLabelKeyForTarget as a_, type TableBorderStyleOption as aa, type TableBorderTargetOption as ab, type TableBorderTargetValue as ac, type TableBorderWidthOption as ad, type TableChromeDraft as ae, type TableChromePick as af, type TableChromeSlotId as ag, type TableInteractionLabelKey as ah, type ToolbarCommandState as ai, WORD_DEFAULT_FONT as aj, applyTableChromePick as ak, blankDocumentBytes as al, canExecuteImageCommand as am, captureImageMutationPreconditions as an, chromeControlCount as ao, chromeMenuSlots as ap, chromeProbeForSlot as aq, chromeSlotId as ar, commandForSlot as as, commandForSlotValue as at, commandForTableChromeSlotValue as au, composeFontConfiguration as av, computeImageResizeResult as aw, computeMovedImagePosition as ax, computeResizedImageExtentEmu as ay, createDocxEditor as az, CHROME_MENUS as b, tableChromeVisible as b0, tableCommandToolbarState as b1, toolbarCommandState as b2, toolbarCommandStates as b3, CHROME_UNAVAILABLE_KEY as c, type ChromeControl as d, type ChromeControlId as e, type ChromeControlState as f, type ChromeGroup as g, type ChromeGroupId as h, type ChromeMenu as i, type ChromeMenuEntry as j, type ChromeMenuId as k, type ChromeMenuItemEntry as l, type ChromeMenuSeparatorEntry as m, type ChromeMenuSubmenuEntry as n, type ChromeSlotId as o, DEFAULT_TABLE_CHROME_DRAFT as p, type DocxEditorConfig as q, type EquationActivation as r, type EquationChromeHandlers as s, type EquationOps as t, type FontConfigurationBase as u, type FontConfigurationFragment as v, type FontLoadFailure as w, type FontLoadFailureReason as x, type FontMeasurementState as y, type FontResolutionRequest as z };
|