@docx-editor.dev/core 2.31.0 → 2.33.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.
Files changed (140) hide show
  1. package/README.md +25 -1
  2. package/THIRD_PARTY_NOTICES.md +1 -0
  3. package/dist/automation.cjs +1 -1
  4. package/dist/automation.d.ts +16 -54
  5. package/dist/automation.js +1 -1
  6. package/dist/binding.cjs +1 -1
  7. package/dist/binding.d.ts +17 -15
  8. package/dist/binding.js +1 -1
  9. package/dist/{chrome-print-BWvaVEhD.d.ts → chrome-print-CrPI9ZQc.d.ts} +128 -38
  10. package/dist/chunk-23MKR33J.js +4 -0
  11. package/dist/chunk-2CWQY27B.cjs +1 -0
  12. package/dist/chunk-2DEY5NUC.cjs +32 -0
  13. package/dist/chunk-2DR4TH6B.js +1 -0
  14. package/dist/chunk-2F2UEAE2.js +2 -0
  15. package/dist/chunk-2GPGAFOJ.cjs +5 -0
  16. package/dist/chunk-ALD626VU.cjs +2 -0
  17. package/dist/chunk-AU33YWEJ.js +236 -0
  18. package/dist/chunk-AXU63LYW.cjs +1 -0
  19. package/dist/chunk-CM5VZRBV.js +32 -0
  20. package/dist/chunk-D7FAFFTN.js +1 -0
  21. package/dist/chunk-DYUVJNDD.cjs +1 -0
  22. package/dist/chunk-ESYUKD5D.js +2 -0
  23. package/dist/chunk-F7TGQMVR.js +5 -0
  24. package/dist/chunk-FLW7KIQX.js +30 -0
  25. package/dist/chunk-JG4A6W6I.js +7 -0
  26. package/dist/chunk-JNGLSBPH.js +2 -0
  27. package/dist/chunk-KE6ZWRIY.cjs +236 -0
  28. package/dist/chunk-L3YXJDPX.js +1 -0
  29. package/dist/chunk-LI42N7OW.cjs +4 -0
  30. package/dist/chunk-PLKDS4JT.js +1 -0
  31. package/dist/chunk-PXMTQ73F.cjs +2 -0
  32. package/dist/chunk-R4R3AAE4.js +1 -0
  33. package/dist/chunk-RFUNFTGV.cjs +1 -0
  34. package/dist/chunk-SVM6PGMS.js +3 -0
  35. package/dist/chunk-SZURLHR3.cjs +3 -0
  36. package/dist/chunk-UYCGCVZ2.cjs +1 -0
  37. package/dist/chunk-WN7ICTA5.js +1 -0
  38. package/dist/chunk-X34QRAUU.cjs +1 -0
  39. package/dist/chunk-XNBYG4XJ.cjs +30 -0
  40. package/dist/chunk-ZDFJW5XS.cjs +2 -0
  41. package/dist/chunk-ZWO4JHNN.cjs +7 -0
  42. package/dist/collaboration/replication.cjs +1 -1
  43. package/dist/collaboration/replication.d.ts +29 -4
  44. package/dist/collaboration/replication.js +1 -1
  45. package/dist/collaboration.cjs +1 -1
  46. package/dist/collaboration.d.ts +5 -5
  47. package/dist/collaboration.js +1 -1
  48. package/dist/contracts/document.d.ts +3 -3
  49. package/dist/contracts/editor.d.ts +13 -9
  50. package/dist/contracts/interaction.d.ts +2 -2
  51. package/dist/contracts/modules.d.ts +15 -12
  52. package/dist/contracts/types.d.ts +135 -2
  53. package/dist/{custom-node-writes-TeUvMP13.d.ts → custom-node-writes-AqY5KpVx.d.ts} +7 -2
  54. package/dist/diagnostic-context-CuzhOX0g.d.ts +98 -0
  55. package/dist/{diagnostic-hints-C9JlLz1L.d.ts → diagnostic-hints-BtCaCqQC.d.ts} +4 -4
  56. package/dist/{document-protection-C8x3P2J6.d.ts → document-protection-BvbpSXbQ.d.ts} +1 -1
  57. package/dist/drawing-graphic-kind-CXYGYbB3.d.ts +324 -0
  58. package/dist/drawing-preview-package-B9lSLRg4.d.ts +115 -0
  59. package/dist/{editor-B2ShlO23.d.ts → editor-B7OOAAie.d.ts} +181 -244
  60. package/dist/editor-fonts-D_-vjuJi.d.ts +53 -0
  61. package/dist/{editor-scope-C7ke1KJG.d.ts → editor-scope-CA6egMaK.d.ts} +6 -2
  62. package/dist/editor.cjs +1 -1
  63. package/dist/editor.css +4 -4
  64. package/dist/editor.d.ts +259 -31
  65. package/dist/editor.js +1 -1
  66. package/dist/export.cjs +2 -2
  67. package/dist/export.d.ts +48 -19
  68. package/dist/export.js +2 -2
  69. package/dist/{failure-NS2lsya4.d.ts → failure-6KGFrDO9.d.ts} +1 -1
  70. package/dist/{font-resolver-CWh40DYp.d.ts → font-resolver-Bm9XqTNO.d.ts} +15 -1
  71. package/dist/index.cjs +1 -1
  72. package/dist/index.d.ts +43 -26
  73. package/dist/index.js +1 -1
  74. package/dist/{layout-shaping-CWS3j0Xr.d.ts → layout-shaping-Ci_BTnSU.d.ts} +1 -1
  75. package/dist/layout.cjs +1 -1
  76. package/dist/layout.d.ts +181 -99
  77. package/dist/layout.js +1 -1
  78. package/dist/metafile-drawing-DtMFyMKq.d.ts +107 -0
  79. package/dist/{note-properties-QsKh24sM.d.ts → note-properties-DCIJUKIy.d.ts} +1 -1
  80. package/dist/output.cjs +1 -1
  81. package/dist/output.d.ts +11 -7
  82. package/dist/output.js +1 -1
  83. package/dist/{protocol-COZJUKUY.d.ts → protocol-Cp_QzVxS.d.ts} +75 -5
  84. package/dist/{review-paragraph-order-C_QbCKcH.d.ts → review-paragraph-order-BJQ43_r0.d.ts} +1 -1
  85. package/dist/revision-projection-OVusTS77.d.ts +258 -0
  86. package/dist/{semantic-cell-selection-Cub9FDa8.d.ts → semantic-cell-selection-CoI5hHBm.d.ts} +2 -2
  87. package/dist/{semantic-interaction-dApRIYpt.d.ts → semantic-interaction-BbA4dgEo.d.ts} +1 -1
  88. package/dist/{semantic-paint-DLzA8sjP.d.ts → semantic-paint-B5JcIv9c.d.ts} +19 -9
  89. package/dist/{semantic-record-queries-3yp9o11g.d.ts → semantic-record-queries-DnO8J5_j.d.ts} +1 -1
  90. package/dist/{semantic-records-B-akgRch.d.ts → semantic-records-DoK0lNjS.d.ts} +439 -418
  91. package/dist/store.cjs +1 -1
  92. package/dist/store.d.ts +511 -20
  93. package/dist/store.js +1 -1
  94. package/dist/{types-barrel-CkF2JbU4.d.ts → tree-op-types-Df4oY2u4.d.ts} +1081 -524
  95. package/dist/{tree-package-store-B8l8DX3Z.d.ts → tree-package-store-DXhX1PE-.d.ts} +8 -3
  96. package/dist/{tree-session-contract-DeLRqohz.d.ts → tree-session-contract-CF2625mv.d.ts} +5 -5
  97. package/dist/unsupported-elements-CUojsaCr.d.ts +23 -0
  98. package/docs/accept-reject-without-scrolling.md +95 -0
  99. package/docs/comment-on-found-text.md +72 -0
  100. package/docs/custom-review-cards.md +178 -0
  101. package/docs/highlight-ranges.md +48 -0
  102. package/docs/index.md +36 -0
  103. package/docs/propose-rewrite.md +247 -0
  104. package/docs/tracked-replacement.md +68 -0
  105. package/licenses/ECMA-376.md +29 -0
  106. package/package.json +3 -2
  107. package/dist/bookmark-names-DDuAra_V.d.ts +0 -37
  108. package/dist/chunk-243W4WW2.cjs +0 -2
  109. package/dist/chunk-2E2RPEKX.js +0 -1
  110. package/dist/chunk-4S24UOPG.js +0 -30
  111. package/dist/chunk-5JPIEN54.cjs +0 -3
  112. package/dist/chunk-5SO5QDMV.cjs +0 -2
  113. package/dist/chunk-6IDOVU6L.cjs +0 -1
  114. package/dist/chunk-6JIJOZDW.js +0 -1
  115. package/dist/chunk-BTQKU64Q.cjs +0 -1
  116. package/dist/chunk-DBOOTED4.cjs +0 -30
  117. package/dist/chunk-EOTAXOJY.cjs +0 -5
  118. package/dist/chunk-FDAKJ2SJ.cjs +0 -30
  119. package/dist/chunk-FNNOJNGY.js +0 -3
  120. package/dist/chunk-FT33HRZP.js +0 -5
  121. package/dist/chunk-HC6YNKUI.cjs +0 -1
  122. package/dist/chunk-HZ66UCIS.js +0 -2
  123. package/dist/chunk-IBRBNT37.cjs +0 -1
  124. package/dist/chunk-IVIN7X43.js +0 -30
  125. package/dist/chunk-LZY6B6IV.js +0 -4
  126. package/dist/chunk-MOYYRVFV.cjs +0 -2
  127. package/dist/chunk-N6B3BXCL.js +0 -1
  128. package/dist/chunk-Q5K2GGNG.js +0 -2
  129. package/dist/chunk-R2XINWVE.js +0 -7
  130. package/dist/chunk-SUEXVBPR.js +0 -1
  131. package/dist/chunk-T2QQHG5C.js +0 -18
  132. package/dist/chunk-VWIJKH4A.js +0 -1
  133. package/dist/chunk-WO4V6PNS.cjs +0 -18
  134. package/dist/chunk-XMJKFURD.cjs +0 -4
  135. package/dist/chunk-XSTGE3NI.cjs +0 -1
  136. package/dist/chunk-YQWMI6J5.cjs +0 -7
  137. package/dist/chunk-ZCJS7D7S.js +0 -2
  138. package/dist/diagnostic-context-DJ0P1uZE.d.ts +0 -31
  139. package/dist/headless-document-view-qOpaCF82.d.ts +0 -143
  140. package/dist/omml-equation-BsLAa2lX.d.ts +0 -115
@@ -1,139 +1,14 @@
1
- import { q as ResolvedRevisionMarkup, a as ReviewDisplayMode } from './semantic-records-B-akgRch.js';
2
- import { t as DocAnchor, g as ReviewRevisionKind, c as ReviewCommentItem, b as ReviewRevisionItem, d as ReviewCustomItem, aT as SourceCrop, Y as DrawingKind, a2 as ImageWrapTarget, _ as DrawingPositionInput, Z as DrawingLocks, a1 as ImageResourceState, r as ColorValue, x as ExecErrorCode, a6 as ParagraphFormatCommand, af as SupportedImageMime, al as Watermark, E as ExecResult, an as WatermarkState, n as ContentControlFilter, o as DocRange, k as RunFormatting, p as Revision, a9 as Rect, ae as SelectionPin, ai as Unsubscribe } from './types-barrel-CkF2JbU4.js';
3
- import { H as HistoryDiagnostic, V as ViewScope, b as HistoryGroup, a as EditorExecOptions, E as EditorScope, c as HistoryGroupOptions } from './editor-scope-C7ke1KJG.js';
4
- import { C as CollaborationDiagnosticCode, c as CustomNodeDiagnosticCode, D as DiagnosticErrorName, F as FailureStage, B as ByteSizeBucket, b as CountBucket, f as DocumentOpenDiagnosticCode, a as DocumentPartKind, g as DocumentSaveDiagnosticCode, E as EditDiagnosticCode, j as ReviewDiagnosticCode, k as ReviewOperation, R as ReviewChangeKind, i as FormattingChangeKind, h as FontDiagnosticCode, H as HistoryDiagnosticCode, P as PerformanceDiagnosticCode } from './diagnostic-hints-C9JlLz1L.js';
1
+ import { d as ResolvedRevisionMarkup, a as ReviewDisplayMode } from './revision-projection-OVusTS77.js';
2
+ import { ResolvedReviewPane } from './contracts/types.js';
3
+ import { V as ViewScope, b as HistoryDiagnostic, c as HistoryGroup, a as EditorExecOptions, E as EditorScope, d as HistoryGroupOptions } from './editor-scope-CA6egMaK.js';
4
+ import { E as EditorFontErrorCode, a as FontFaceRequest } from './editor-fonts-D_-vjuJi.js';
5
+ import { T as RevisionBatchSkipDetail, t as DocAnchor, g as ReviewRevisionKind, c as ReviewCommentItem, b as ReviewRevisionItem, d as ReviewCustomItem, aT as SourceCrop, a8 as DrawingKind, ag as ImageWrapTarget, aa as DrawingPositionInput, a9 as DrawingLocks, af as ImageResourceState, r as ColorValue, x as ExecErrorCode, ah as ParagraphFormatCommand, an as SupportedImageMime, ar as Watermark, E as ExecResult, at as WatermarkState, n as ContentControlFilter, o as DocRange, k as RunFormatting, p as Revision, ak as Rect, am as SelectionPin, ao as Unsubscribe } from './tree-op-types-Df4oY2u4.js';
6
+ import { C as CollaborationDiagnosticCode, b as CustomNodeDiagnosticCode, c as DiagnosticErrorName, F as FailureStage, B as ByteSizeBucket, a as CountBucket, e as DocumentOpenDiagnosticCode, f as DocumentPartKind, g as DocumentSaveDiagnosticCode, E as EditDiagnosticCode, R as ReviewDiagnosticCode, k as ReviewOperation, j as ReviewChangeKind, i as FormattingChangeKind, h as FontDiagnosticCode, H as HistoryDiagnosticCode, P as PerformanceDiagnosticCode } from './diagnostic-hints-BtCaCqQC.js';
5
7
  import { DocEdits, DocQueries, DocQueryResults, ContentControlSummary } from './contracts/document.js';
6
8
  import { InteractionOutcome } from './contracts/interaction.js';
7
- import { a as SemanticSelection, S as SemanticPosition } from './semantic-interaction-dApRIYpt.js';
8
- import { a as DocumentProtectionState } from './document-protection-C8x3P2J6.js';
9
- import { C as CollaborationStatus } from './failure-NS2lsya4.js';
10
-
11
- /**
12
- * When the review pane opens by itself.
13
- *
14
- * - `'auto'`: the pane opens when a document with review items loads, and when a tracked
15
- * change is made while it is closed, in both cases when the pane has items to list. With
16
- * `revisionsIn: 'balloons'` the pane lists no tracked change and no reply to one, so
17
- * tracked changes and their replies alone do not open it.
18
- * - `'manual'`: the pane stays closed until the host or the user opens it. Use it when the
19
- * host shows review items its own way, such as in balloons or margin markers.
20
- *
21
- * @public
22
- */
23
- type ReviewPaneOpening = 'auto' | 'manual';
24
- /**
25
- * What the open review pane does when its full card column does not fit beside the page at
26
- * the page's zoom.
27
- *
28
- * - `'float'`: the pane shrinks to a strip of markers, and the open card floats over the
29
- * page.
30
- * - `'shrinkPage'`: under a fit zoom mode, the page may shrink down to the mode's
31
- * `minZoom` (or 10%) so that the full column fits. The pane changes to the marker strip
32
- * only when the column does not fit at that floor either. A fixed zoom behaves as
33
- * `'float'`.
34
- * - `'scroll'`: the page keeps the size it has beside the closed pane's marker strip, and
35
- * the full column stands beside it. The document and the column scroll together: the
36
- * viewport scrolls sideways to reach the cards.
37
- *
38
- * The setting applies to the review pane only. The navigation pane stays docked at its side
39
- * in every mode: it never scrolls with the document, and it takes its room beside the page
40
- * exactly as it does with no review pane.
41
- *
42
- * @public
43
- */
44
- type ReviewPaneOverflow = 'float' | 'shrinkPage' | 'scroll';
45
- /**
46
- * Where tracked changes open.
47
- *
48
- * - `'pane'`: the review pane lists tracked changes as cards beside the comments.
49
- * - `'balloons'`: the pane lists comments only, except comments that reply to a tracked
50
- * change: the change's balloon shows those. A tracked change opens in a balloon at its
51
- * text when the reader clicks it, or when Next Change, Previous Change, or
52
- * `setActiveReviewItem(key, { announce: true })` reaches it. A replacement is one balloon.
53
- * In both settings, Next Change and Previous Change stop on a replacement once.
54
- *
55
- * @public
56
- */
57
- type RevisionDisplay = 'pane' | 'balloons';
58
- /**
59
- * How a collapsed comment marker looks.
60
- *
61
- * - `'initials'`: a badge with the thread author's initials in the author's color, a reply
62
- * count, and a check mark when the thread is resolved.
63
- * - `'icon'`: the comment icon.
64
- *
65
- * @public
66
- */
67
- type CommentMarkerStyle = 'initials' | 'icon';
68
- /**
69
- * Review pane settings to change. Every field is optional, and an omitted field keeps its
70
- * current value.
71
- *
72
- * @public
73
- */
74
- interface ReviewPaneOptions {
75
- /** Default `'auto'`. */
76
- readonly opening?: ReviewPaneOpening;
77
- /** Default `'float'`. */
78
- readonly overflow?: ReviewPaneOverflow;
79
- /** Default `'pane'`. */
80
- readonly revisionsIn?: RevisionDisplay;
81
- /** Default `'icon'`. */
82
- readonly commentMarkers?: CommentMarkerStyle;
83
- }
84
- /**
85
- * The review pane settings in force, with every field resolved.
86
- *
87
- * @public
88
- */
89
- interface ResolvedReviewPane {
90
- /** When the pane opens by itself. */
91
- readonly opening: ReviewPaneOpening;
92
- /** What the open pane does when its card column does not fit beside the page. */
93
- readonly overflow: ReviewPaneOverflow;
94
- /** Where tracked changes open. */
95
- readonly revisionsIn: RevisionDisplay;
96
- /** How a collapsed comment marker looks. */
97
- readonly commentMarkers: CommentMarkerStyle;
98
- }
99
- /** The settings an editor starts with when nothing sets them. @public */
100
- declare const DEFAULT_REVIEW_PANE: ResolvedReviewPane;
101
- /**
102
- * Merge `options` over `base`. Throws a `TypeError` for an unknown field or value, so a
103
- * misspelled setting fails loudly instead of being ignored. Returns `base` itself when
104
- * nothing changes, so the snapshot keeps its reference.
105
- *
106
- * @public
107
- */
108
- declare function resolveReviewPane(options: ReviewPaneOptions | undefined, base?: ResolvedReviewPane): ResolvedReviewPane;
109
- /**
110
- * The fields of a review item that decide whether the review pane lists it. A
111
- * `ReviewItem` and a review item placement both have them.
112
- *
113
- * @public
114
- */
115
- interface ReviewPaneItemFields {
116
- /** The item kind, as `ReviewItem.kind` gives it. */
117
- readonly kind: 'revision' | 'comment' | 'custom';
118
- /** For a comment, the tracked change it replies to. */
119
- readonly parentRevisionId?: string;
120
- }
121
- /**
122
- * Whether the review pane lists a card for `item` under `revisionsIn`.
123
- *
124
- * With `'balloons'`, a balloon at the text shows every tracked change and every comment
125
- * that replies to a tracked change, so the pane lists neither. Give the item as an
126
- * unfiltered `getReviewItems()` read returns it: a query that excludes revision kinds
127
- * removes `parentRevisionId` from replies to the changes it drops.
128
- *
129
- * The engine applies this rule to every review item when it decides whether the pane opens
130
- * by itself or closes after a settings change. A review pane must apply the same rule before
131
- * its own filters, such as a hidden kind or a host filter. Those filters can hide every card,
132
- * and then the pane that the engine opens is empty.
133
- *
134
- * @public
135
- */
136
- declare function reviewPaneListsItem(revisionsIn: RevisionDisplay, item: ReviewPaneItemFields): boolean;
9
+ import { a as SemanticSelection, S as SemanticPosition } from './semantic-interaction-BbA4dgEo.js';
10
+ import { a as DocumentProtectionState } from './document-protection-BvbpSXbQ.js';
11
+ import { a as CollaborationStatus } from './failure-6KGFrDO9.js';
137
12
 
138
13
  /**
139
14
  * What a fit mode fits the page to.
@@ -167,6 +42,52 @@ type ZoomMode = {
167
42
  readonly maxZoom?: number;
168
43
  };
169
44
 
45
+ /**
46
+ * One occurrence of a search query in the document.
47
+ *
48
+ * Carries TWO addresses on purpose. `blockId` + `start` is the engine's own: stable
49
+ * across edits and independent of ordering. `paragraphIndex` + `runIndex` + `runOffset`
50
+ * is the positional one a find/replace UI needs to show and navigate results, and it is
51
+ * derived from the same walk rather than left to the caller to reconstruct — a caller
52
+ * guessing at run boundaries would send the selection to the wrong place.
53
+ *
54
+ * A match can span runs when formatting changes mid-word; the run address is where it
55
+ * STARTS. `scope` identifies a non-body story so navigation opens the correct surface.
56
+ * A frame scope selects its anchoring drawing and never places a caret inside its story.
57
+ * A match inside a field result reports the field atom's model range. Its `length` is one,
58
+ * while `text` carries the visible match and can be longer. Select with `start` and `length`.
59
+ * Never derive the selected length from `text.length`.
60
+ */
61
+ interface TextMatch {
62
+ readonly blockId: string;
63
+ /** Character offset within the paragraph's concatenated run text. */
64
+ readonly start: number;
65
+ readonly length: number;
66
+ /**
67
+ * Paragraph ordinal within this match's story. Table and nested-table paragraphs count.
68
+ * Non-paragraph blocks add no ordinal.
69
+ */
70
+ readonly paragraphIndex: number;
71
+ /** Index of the run the match starts in, and the offset within that run. */
72
+ readonly runIndex: number;
73
+ readonly runOffset: number;
74
+ /** Story containing the match. Absence means the body. */
75
+ readonly scope?: ViewScope;
76
+ /** The matched text as it appears in the document. */
77
+ readonly text: string;
78
+ /**
79
+ * Paragraph text immediately before and after the match, bounded at the derivation
80
+ * boundary. A results list shows the match in its sentence — "…as described in this
81
+ * **Exhi**bit A" — and nothing else in the contract can reach paragraph text, so a
82
+ * caller would otherwise have to re-read the document to render one row.
83
+ *
84
+ * Optional and additive: an implementation that has not derived them omits them, and a
85
+ * consumer treats absent as empty.
86
+ */
87
+ readonly contextBefore?: string;
88
+ readonly contextAfter?: string;
89
+ }
90
+
170
91
  /**
171
92
  * Anonymous diagnostics: why something failed, as stable codes and bucketed numbers.
172
93
  *
@@ -352,8 +273,11 @@ interface ReviewSkippedDiagnostic extends DiagnosticBase {
352
273
  /** The role of the part the changes are in, such as `'footnotes'`. Never its name. */
353
274
  readonly part?: DocumentPartKind;
354
275
  /**
355
- * For `review.revision-unsupported`, the engine condition that refused the change, such as
356
- * `unaddressed` (no `w:id` or author) or `unrecorded-properties`. See `diagnosticCauses()`.
276
+ * The structure behind the skip. For `review.revision-unsupported`, the engine condition that
277
+ * refused the change, such as `unaddressed` (no `w:id` or author). For
278
+ * `review.incomplete-group`, the change the decision would also decide, such as
279
+ * `paired-change` (the other half of a move or merge) or `removed-content`. For
280
+ * `review.retained-structure`, `nested-table`. See `diagnosticCauses()`.
357
281
  */
358
282
  readonly cause?: string;
359
283
  }
@@ -490,8 +414,8 @@ interface EditorEvents {
490
414
  change: (change: DocumentChange) => void;
491
415
  /**
492
416
  * Observable editor state moved without a document change: the selection or its derived
493
- * formatting, the armed typing format, the open header or footer, or the collaboration
494
- * session's status.
417
+ * formatting, the armed typing format, the open header or footer, the collaboration
418
+ * session's status, or the page count when pages finish laying out in the background.
495
419
  */
496
420
  selectionChange: (snapshot: EditorSnapshot) => void;
497
421
  error: (error: EditorError) => void;
@@ -531,6 +455,20 @@ interface EditorEvents {
531
455
  * ```
532
456
  */
533
457
  reviewItemReveal: (event: ReviewItemRevealEvent) => void;
458
+ /**
459
+ * An accept-all or reject-all decision committed: from the toolbar, the menu, or
460
+ * `exec({ type: 'resolveAllReviewChanges' })`. `skipped` names the changes it left pending,
461
+ * so a host can say why they stay. A remote decision in a collaboration session never fires
462
+ * it: it is a local event.
463
+ *
464
+ * @example
465
+ * ```ts
466
+ * editor.on('reviewChangesResolved', ({ skipped }) => {
467
+ * if (skipped.length) showNotice(`${skipped.length} changes stay pending`);
468
+ * });
469
+ * ```
470
+ */
471
+ reviewChangesResolved: (event: ReviewChangesResolvedEvent) => void;
534
472
  /**
535
473
  * The editor's pages are now in another document: it was attached for the first time, moved
536
474
  * into another element or window, detached (`document` is `null`), or found its element
@@ -595,6 +533,33 @@ interface ReviewItemRevealEvent {
595
533
  */
596
534
  readonly source: ReviewItemRevealSource;
597
535
  }
536
+ /**
537
+ * The payload of the `reviewChangesResolved` event.
538
+ *
539
+ * @public
540
+ */
541
+ interface ReviewChangesResolvedEvent {
542
+ /** Whether the decision accepted or rejected the changes. */
543
+ readonly action: 'accept' | 'reject';
544
+ /** How many listed changes it resolved. The `exec` result lists them in `revisions.resolved`. */
545
+ readonly resolvedCount: number;
546
+ /**
547
+ * The listed changes it left pending, with why: `'retained-structure'` for a row that stays
548
+ * to keep a nested table, `'incomplete-group'` for a change that would also resolve one the
549
+ * selection leaves out, `'unsupported-revision'` for a structure the engine cannot resolve,
550
+ * and `'unknown-revision'` for a key that no longer names a change. `reviewCodeOfSkip(skip)`
551
+ * gives each entry's review code, with its `detail`.
552
+ */
553
+ readonly skipped: readonly {
554
+ /** The skipped change's key, as `getReviewItems({ pairReplacements: false })` lists it. */
555
+ readonly key: string;
556
+ /** The key of the replacement it is one half of, as the default `getReviewItems()` lists it. */
557
+ readonly pairKey?: string;
558
+ readonly reason: 'unsupported-revision' | 'incomplete-group' | 'retained-structure' | 'unknown-revision';
559
+ /** Which condition kept it, such as `'locked-content'` (a content lock) or `'bound-content'` (a data binding). */
560
+ readonly detail?: RevisionBatchSkipDetail;
561
+ }[];
562
+ }
598
563
  /** What asked to reveal a review item. See {@link ReviewItemRevealEvent.source}. @public */
599
564
  type ReviewItemRevealSource = 'navigate' | 'host';
600
565
  /**
@@ -1517,9 +1482,21 @@ interface SelectedImageState {
1517
1482
  readonly dpiX: number;
1518
1483
  readonly dpiY: number;
1519
1484
  }> | null;
1485
+ /**
1486
+ * Whether `setImageProperties` can change the size. False for a hidden drawing, a drawing
1487
+ * whose size is locked, a rotated legacy VML text box or one sized as a percentage of a
1488
+ * frame, and in viewing mode. An inline text box resizes.
1489
+ */
1520
1490
  readonly canResize: boolean;
1491
+ /**
1492
+ * Whether `setImagePosition` can move the drawing. False for an inline drawing, which flows
1493
+ * with its line, for a locked or hidden drawing, a rotated legacy VML text box, and in
1494
+ * viewing mode.
1495
+ */
1521
1496
  readonly canMove: boolean;
1497
+ /** Whether `setImageWrapType` applies: pictures only, never text boxes. */
1522
1498
  readonly canChangeWrap: boolean;
1499
+ /** Whether `setImageProperties` can crop: pictures only, never text boxes. */
1523
1500
  readonly canCrop: boolean;
1524
1501
  }
1525
1502
  /**
@@ -1736,57 +1713,6 @@ interface DocumentHandle {
1736
1713
  * where a new array per render rebuilds the editor per render.
1737
1714
  */
1738
1715
  type DocumentSource = ArrayBuffer | Uint8Array | DocumentHandle | 'blank';
1739
- /** A concrete font face requested by authored document content. */
1740
- interface FontFaceRequest {
1741
- readonly family: string;
1742
- readonly weight: number;
1743
- readonly style: 'normal' | 'italic';
1744
- }
1745
- /** Immutable, byte-backed font face supplied to layout and browser paint. */
1746
- interface FontSource {
1747
- readonly request: FontFaceRequest;
1748
- readonly id: string;
1749
- readonly bytes: Uint8Array;
1750
- readonly hash: string;
1751
- readonly faceIndex: number;
1752
- readonly availability?: 'available' | 'forbidden';
1753
- }
1754
- /** An explicit authored-font substitution. No implicit platform fallback is performed. */
1755
- interface FontSourceSubstitution {
1756
- readonly from: FontFaceRequest;
1757
- readonly to: FontFaceRequest;
1758
- /** Word line-box metrics for the requested face, expressed as em ratios. */
1759
- readonly lineMetrics?: {
1760
- readonly heightEm: number;
1761
- readonly baselineEm: number;
1762
- };
1763
- }
1764
- /**
1765
- * Public font source configuration sampled when an adapter mounts. It must be immutable for that
1766
- * editor lifetime; remount the adapter to replace bytes or substitutions atomically.
1767
- */
1768
- interface FontConfiguration {
1769
- /** Selectable provider families, independent of loaded bytes. Listing them performs no fetch. */
1770
- readonly supportedFamilies?: readonly string[];
1771
- readonly epoch: number;
1772
- readonly maxFontBytes: number;
1773
- readonly sources: readonly FontSource[];
1774
- readonly substitutions?: readonly FontSourceSubstitution[];
1775
- readonly defaultFont: {
1776
- readonly family: string;
1777
- readonly sizeHalfPoints: number;
1778
- };
1779
- readonly language?: string;
1780
- }
1781
- /**
1782
- * Why a font was not admitted.
1783
- *
1784
- * Distinguished rather than collapsed because the responses differ: `overLimit` and `malformed`
1785
- * are the caller's own bytes, while `forbidden` and `hashMismatch` mean the source was not what
1786
- * it claimed and the load should not be retried. `wasmUnavailable` alone is a HOST fault — the
1787
- * shaper's WASM never loaded, `diagnostic` carries the remedy — surface it as a setup error.
1788
- */
1789
- type EditorFontErrorCode = 'initializationFailed' | 'wasmUnavailable' | 'missing' | 'forbidden' | 'overLimit' | 'malformed' | 'hashMismatch' | 'metadataMismatch' | 'fontFaceLoadFailed' | 'unsupportedFaceIndex' | 'missingFont' | 'hashInvalid' | 'fontMismatch' | 'unsupportedFace' | 'loadFailed';
1790
1716
  /** Typed adapter error reported both through `onFontError` and accessible alert UI. */
1791
1717
  declare class EditorFontError extends Error {
1792
1718
  readonly name: string;
@@ -1980,6 +1906,13 @@ interface Editor extends EditorAnchorNavigation, EditorHighlights, EditorReviewH
1980
1906
  * The search narrows to the body and its selectable text boxes when other stories cannot open.
1981
1907
  * This includes viewing mode and surfaces without header, footer, or note entry methods.
1982
1908
  * Text boxes in footnotes and endnotes remain excluded until their drawings are selectable.
1909
+ *
1910
+ * Pass a match to `exec({ type: 'replaceMatch', match, text })` to replace it, which records a
1911
+ * tracked replacement in suggesting mode, or to {@link selectMatch} and then
1912
+ * {@link addComment} to comment on it. For headless or server use, see `body.search` in
1913
+ * `@docx-editor.dev/editor-api`.
1914
+ *
1915
+ * @see {@link https://www.docx-editor.dev/docs/2.x/recipes/tracked-replacement | Replace as a tracked change}
1983
1916
  */
1984
1917
  findMatches(query: string, options?: {
1985
1918
  readonly matchCase?: boolean;
@@ -2138,6 +2071,13 @@ interface Editor extends EditorAnchorNavigation, EditorHighlights, EditorReviewH
2138
2071
  * editor.addComment('Counter-proposal: 45 days.', { historyGroup: decision });
2139
2072
  * editor.addComment('Approved.', 'Legal team', { historyGroup: decision });
2140
2073
  * ```
2074
+ *
2075
+ * To comment on found text, select it first with {@link findMatches} and
2076
+ * {@link selectMatch}. In a React or Vue host with the review module, `useReview().comment`
2077
+ * calls this. For headless or server use, see `Range.insertComment` in
2078
+ * `@docx-editor.dev/editor-api`.
2079
+ *
2080
+ * @see {@link https://www.docx-editor.dev/docs/2.x/recipes/comment-on-found-text | Comment on found text}
2141
2081
  */
2142
2082
  addComment(text: string, options?: HistoryGroupOptions): ExecResult;
2143
2083
  /** {@link addComment} with an author for this call, overriding the configured author. */
@@ -2165,6 +2105,11 @@ interface Editor extends EditorAnchorNavigation, EditorHighlights, EditorReviewH
2165
2105
  * With `options.announce: true`, a call that lands fires `reviewItemReveal` with
2166
2106
  * `source: 'host'`, also when the item was already active, so the packaged review UI opens
2167
2107
  * the item's balloon or card. By default it fires nothing. A `null` key fires nothing.
2108
+ *
2109
+ * Pass `{ reveal: false }` to open the item without scrolling, for a host whose own list
2110
+ * drives the scroll. `useReview().setActive` calls this.
2111
+ *
2112
+ * @see {@link https://www.docx-editor.dev/docs/2.x/recipes/accept-reject-without-scrolling | Accept or reject without scrolling}
2168
2113
  */
2169
2114
  setActiveReviewItem(key: string | null, options?: ReviewActivationOptions): ExecResult;
2170
2115
  /**
@@ -2212,7 +2157,19 @@ interface Editor extends EditorAnchorNavigation, EditorHighlights, EditorReviewH
2212
2157
  *
2213
2158
  * Refused for a card whose kind the engine cannot resolve structurally, which is why
2214
2159
  * `readOnly` is on the item — a surface should not offer the button in the first place.
2215
- * Other refusals name their cause, as {@link addComment} describes.
2160
+ * Other refusals name their cause, as {@link addComment} describes. A change that resolves
2161
+ * only together with another change refuses with a reason led by `incomplete-group:`, and a
2162
+ * row that stays to keep a nested table with one led by `retained-structure:`. A change a
2163
+ * content control lock keeps refuses with `code: 'locked'` and a reason led by
2164
+ * `locked-content:`; one in a data-bound control with `code: 'bound'` and `bound-content:`.
2165
+ * `reviewCodeOfRefusal(result.reason)` names the review code of each. In a React or
2166
+ * Vue host, `useReviewRefusalMessage()` turns `useReview().lastRefusal` into a sentence.
2167
+ *
2168
+ * Neither call scrolls. In a React or Vue host with the review module, `useReview().accept`
2169
+ * and `useReview().reject` call these. For headless or server use, see `Revision.accept()`
2170
+ * and `Revision.reject()` in `@docx-editor.dev/editor-api`.
2171
+ *
2172
+ * @see {@link https://www.docx-editor.dev/docs/2.x/recipes/accept-reject-without-scrolling | Accept or reject without scrolling}
2216
2173
  */
2217
2174
  acceptReviewItem(key: string, options?: HistoryGroupOptions): ExecResult;
2218
2175
  /** The rejecting half of {@link acceptReviewItem}, with the same rules and options. */
@@ -2254,11 +2211,24 @@ interface Editor extends EditorAnchorNavigation, EditorHighlights, EditorReviewH
2254
2211
  * source it — and the argument overrides it for one call. `CT_Comment` makes `@w:author`
2255
2212
  * required, so a reply with neither is refused rather than written as an empty attribute.
2256
2213
  * Other refusals name their cause, as {@link addComment} describes.
2214
+ *
2215
+ * In a React or Vue host with the review module, `useReview().reply` calls this. For
2216
+ * headless or server use, see `Comment.reply` in `@docx-editor.dev/editor-api`.
2257
2217
  */
2258
2218
  replyToReviewItem(key: string, text: string, options?: HistoryGroupOptions): ExecResult;
2259
2219
  /** {@link replyToReviewItem} with an author for this call, overriding the configured author. */
2260
2220
  replyToReviewItem(key: string, text: string, author?: string, options?: HistoryGroupOptions): ExecResult;
2221
+ /**
2222
+ * Move editing into `scope`: the body, a header or footer, a note, or a text box (`frame`).
2223
+ *
2224
+ * A frame whose `owner` is a header or footer opens that story first and edits the box
2225
+ * inside it. The box is edited on the page of the open story when that story is already
2226
+ * open, otherwise on the page in view, otherwise on the first page that shows it. A frame
2227
+ * owned by a note, a box with rotated or vertical text, and a box holding a table are refused:
2228
+ * the scope stays where it was. Read {@link getActiveScope} to confirm the entry.
2229
+ */
2261
2230
  setActiveScope(scope: ViewScope): void;
2231
+ /** The scope editing is in, as {@link setActiveScope} last set it or a press moved it. */
2262
2232
  getActiveScope(): ViewScope;
2263
2233
  query<K extends keyof EditorQueries>(query: {
2264
2234
  type: K;
@@ -2284,7 +2254,8 @@ interface Editor extends EditorAnchorNavigation, EditorHighlights, EditorReviewH
2284
2254
  */
2285
2255
  /**
2286
2256
  * Scroll a page or a block into view. Returns false when the target does not exist or
2287
- * the host has no scroll container — a caller can tell "not found" from "scrolled".
2257
+ * the host has no scroll container. During a large open, a target not laid out yet answers
2258
+ * true and scrolls once it is; input cancels that, and a page past the end never scrolls.
2288
2259
  */
2289
2260
  scrollToPage(pageNumber: number): boolean;
2290
2261
  /**
@@ -2622,6 +2593,17 @@ interface EditorCommands extends EditorCommandShape<DocEdits>, EditorHeaderFoote
2622
2593
  * returns. An empty `text` deletes it. The selection and scroll position stay put. In
2623
2594
  * suggesting mode it is a tracked replacement under the editor's author, refused where
2624
2595
  * `proposeReplacement` would be. The match must be in the open story, not a text box.
2596
+ *
2597
+ * For headless or server use, see `range.insertText(text, 'Replace')` with
2598
+ * `document.changeTrackingMode` set to `'TrackMineOnly'` in `@docx-editor.dev/editor-api`.
2599
+ *
2600
+ * @example
2601
+ * ```ts
2602
+ * const [match] = editor.findMatches('30 days', { matchCase: true });
2603
+ * if (match) editor.exec({ type: 'replaceMatch', match, text: '45 days' });
2604
+ * ```
2605
+ *
2606
+ * @see {@link https://www.docx-editor.dev/docs/2.x/recipes/tracked-replacement | Replace as a tracked change}
2625
2607
  */
2626
2608
  replaceMatch: {
2627
2609
  match: TextMatch;
@@ -2872,51 +2854,6 @@ interface EditorQueryResults extends DocQueryResults {
2872
2854
  trackedChanges: readonly Revision[];
2873
2855
  bookmarks: readonly BookmarkSummary[];
2874
2856
  }
2875
- /**
2876
- * One occurrence of a search query in the document.
2877
- *
2878
- * Carries TWO addresses on purpose. `blockId` + `start` is the engine's own: stable
2879
- * across edits and independent of ordering. `paragraphIndex` + `runIndex` + `runOffset`
2880
- * is the positional one a find/replace UI needs to show and navigate results, and it is
2881
- * derived from the same walk rather than left to the caller to reconstruct — a caller
2882
- * guessing at run boundaries would send the selection to the wrong place.
2883
- *
2884
- * A match can span runs when formatting changes mid-word; the run address is where it
2885
- * STARTS. `scope` identifies a non-body story so navigation opens the correct surface.
2886
- * A frame scope selects its anchoring drawing and never places a caret inside its story.
2887
- * A match inside a field result reports the field atom's model range. Its `length` is one,
2888
- * while `text` carries the visible match and can be longer. Select with `start` and `length`.
2889
- * Never derive the selected length from `text.length`.
2890
- */
2891
- interface TextMatch {
2892
- readonly blockId: string;
2893
- /** Character offset within the paragraph's concatenated run text. */
2894
- readonly start: number;
2895
- readonly length: number;
2896
- /**
2897
- * Paragraph ordinal within this match's story. Table and nested-table paragraphs count.
2898
- * Non-paragraph blocks add no ordinal.
2899
- */
2900
- readonly paragraphIndex: number;
2901
- /** Index of the run the match starts in, and the offset within that run. */
2902
- readonly runIndex: number;
2903
- readonly runOffset: number;
2904
- /** Story containing the match. Absence means the body. */
2905
- readonly scope?: ViewScope;
2906
- /** The matched text as it appears in the document. */
2907
- readonly text: string;
2908
- /**
2909
- * Paragraph text immediately before and after the match, bounded at the derivation
2910
- * boundary. A results list shows the match in its sentence — "…as described in this
2911
- * **Exhi**bit A" — and nothing else in the contract can reach paragraph text, so a
2912
- * caller would otherwise have to re-read the document to render one row.
2913
- *
2914
- * Optional and additive: an implementation that has not derived them omits them, and a
2915
- * consumer treats absent as empty.
2916
- */
2917
- readonly contextBefore?: string;
2918
- readonly contextAfter?: string;
2919
- }
2920
2857
  /**
2921
2858
  * The hyperlink under a position: where it points, how far it reaches, and what Word shows on
2922
2859
  * hover.
@@ -2965,12 +2902,12 @@ interface EditorSnapshot {
2965
2902
  * point on — it never depends on one existing. */
2966
2903
  readonly isLoading: boolean;
2967
2904
  /**
2968
- * Whether a supplied document is still on its way to painted pages. Opening a large
2969
- * document mounts behind one painted frame so a loading screen can show instead of a
2970
- * frozen page; this is true for exactly that window, and across it the previous
2971
- * document (if any) stays on screen. Show a loading overlay while it holds — but gate
2972
- * only chrome on it, never the mount point, which must stay mounted for the open to
2973
- * complete ({@link EditorSnapshot.isLoading} is the gate-safe flag). Optional and
2905
+ * Whether a supplied document is still on its way to painted pages. A large document
2906
+ * mounts behind one painted frame so a loading screen can show instead of a frozen page,
2907
+ * with the previous document (if any) still on screen. Show an overlay while it holds,
2908
+ * but gate only chrome on it, never the mount point, which must stay mounted for the open
2909
+ * to complete ({@link EditorSnapshot.isLoading} is the gate-safe flag). It turns false
2910
+ * when the first pages paint; they take input while the rest lay out. Optional and
2974
2911
  * additive: absent means the implementation has not derived it, read as `false`.
2975
2912
  */
2976
2913
  readonly isOpening?: boolean;
@@ -3137,5 +3074,5 @@ interface EditorError extends Error {
3137
3074
  readonly code?: string;
3138
3075
  }
3139
3076
 
3140
- export { DIAGNOSTIC_SCHEMA_VERSION as D, EditorFontError as J, DEFAULT_REVIEW_PANE as aY, cropPercentFromCropPermille as b2, cropPercentFromPermille as b3, cropPercentFromSourceCrop as b4, cropPermilleFromCropPercent as b5, cropPermilleFromPercent as b6, resolveReviewPane as b7, reviewPaneListsItem as b8, sourceCropFromCropPercent as b9, validateImageCropPercent as ba };
3141
- export type { FontFailedDiagnostic as $, AnchorHighlightAnimation as A, BookmarkPlace as B, CanResult as C, EditorDiagnostic as E, EditorCommandShape as F, EditorCommands as G, EditorError as H, EditorEvents as I, EditorFontErrorCode as K, EditorFormatPainterCommands as L, EditorHeaderFooterCommands as M, EditorHighlights as N, EditorHostChange as O, EditorHostDocument as P, EditorNoteCommands as Q, ReviewPaneOptions as R, EditorPosition as S, EditorQueries as T, EditorQuery as U, EditorQueryResults as V, EditorReviewHits as W, EditorSelection as X, EditorSnapshot as Y, FontConfiguration as Z, FontFaceRequest as _, EditorDiagnosticKind as a, ReviewPaneItemFields as a$, FontSource as a0, FontSourceSubstitution as a1, FormatPainterLevel as a2, FormatPainterMode as a3, FormatPainterSurfaceState as a4, FurnitureVariant as a5, HeaderFooterSlotArgs as a6, HeaderFooterState as a7, HighlightHit as a8, HighlightOptions as a9, ScrollPlacement as aA, ScrollToAnchorOptions as aB, SelectedImageState as aC, SessionActivity as aD, SessionDiagnostic as aE, SetReviewChangesAuthorOptions as aF, TableBorderEdgeTarget as aG, TableBorderSpec as aH, TableBorderStyle as aI, TableBorderTarget as aJ, TableCellVerticalAlignment as aK, TableColumnDividerResizeTarget as aL, TableColumnOccurrenceTarget as aM, TableContext as aN, TableRightEdgeResizeTarget as aO, TableRowOccurrenceTarget as aP, TextMatch as aQ, TimingSummary as aR, TrackedChangeFilterMode as aS, TrackedChangePredicate as aT, ZoomFitTarget as aU, ZoomMode as aV, ReviewPaneOverflow as aW, CommentMarkerStyle as aX, ImageCropPermille as aZ, ResolvedReviewPane as a_, HighlightRange as aa, HighlightRect as ab, HighlightResult as ac, HistoryDiagnosticEvent as ad, HyperlinkInfo as ae, ImageContext as af, ImageCropPercent as ag, NoteKind as ah, NotePropertiesSide as ai, NotePropertiesState as aj, PageSetup as ak, PerformanceDiagnostic as al, ResolveReviewChangesOptions as am, ResolvedNoteNumbering as an, ReviewActivationOptions as ao, ReviewChangesAttribution as ap, ReviewCommentPlacement as aq, ReviewCustomPlacement as ar, ReviewItemHit as as, ReviewItemPlacement as at, ReviewItemPlacementBase as au, ReviewItemQuery as av, ReviewItemRevealEvent as aw, ReviewItemRevealSource as ax, ReviewRevisionPlacement as ay, ReviewSkippedDiagnostic as az, EditorCommand as b, ReviewPaneOpening as b0, RevisionDisplay as b1, AnchorHighlightOptions as c, AuthoredNoteNumbering as d, BookmarkStory as e, BookmarkSummary as f, ClearAnchorHighlightOptions as g, CollaborationParticipantsDiagnostic as h, CollaborationStatusDiagnostic as i, CustomNodeDiagnosticEvent as j, DiagnosticBase as k, DiagnosticFailureDetail as l, DocumentChange as m, DocumentEditingMode as n, DocumentHandle as o, DocumentOpenDiagnostic as p, DocumentOpenFailure as q, DocumentOpenFailureReason as r, DocumentSaveDiagnostic as s, DocumentShape as t, DocumentSource as u, EditRejectedDiagnostic as v, EditRejectionOrigin as w, Editor as x, EditorAnchorNavigation as y, EditorBookmarkCommands as z };
3077
+ export { DIAGNOSTIC_SCHEMA_VERSION as D, EditorFontError as J, cropPercentFromCropPermille as aS, cropPercentFromPermille as aT, cropPercentFromSourceCrop as aU, cropPermilleFromCropPercent as aV, cropPermilleFromPercent as aW, sourceCropFromCropPercent as aX, validateImageCropPercent as aY };
3078
+ export type { FurnitureVariant as $, AnchorHighlightAnimation as A, BookmarkPlace as B, CanResult as C, EditorDiagnostic as E, EditorCommandShape as F, EditorCommands as G, EditorError as H, EditorEvents as I, EditorFormatPainterCommands as K, EditorHeaderFooterCommands as L, EditorHighlights as M, EditorHostChange as N, EditorHostDocument as O, EditorNoteCommands as P, EditorPosition as Q, EditorQueries as R, EditorQuery as S, EditorQueryResults as T, EditorReviewHits as U, EditorSelection as V, EditorSnapshot as W, FontFailedDiagnostic as X, FormatPainterLevel as Y, FormatPainterMode as Z, FormatPainterSurfaceState as _, EditorDiagnosticKind as a, HeaderFooterSlotArgs as a0, HeaderFooterState as a1, HighlightHit as a2, HighlightOptions as a3, HighlightRange as a4, HighlightRect as a5, HighlightResult as a6, HistoryDiagnosticEvent as a7, HyperlinkInfo as a8, ImageContext as a9, SetReviewChangesAuthorOptions as aA, TableBorderEdgeTarget as aB, TableBorderSpec as aC, TableBorderStyle as aD, TableBorderTarget as aE, TableCellVerticalAlignment as aF, TableColumnDividerResizeTarget as aG, TableColumnOccurrenceTarget as aH, TableContext as aI, TableRightEdgeResizeTarget as aJ, TableRowOccurrenceTarget as aK, TextMatch as aL, TimingSummary as aM, TrackedChangeFilterMode as aN, TrackedChangePredicate as aO, ZoomFitTarget as aP, ZoomMode as aQ, ImageCropPermille as aR, ImageCropPercent as aa, NoteKind as ab, NotePropertiesSide as ac, NotePropertiesState as ad, PageSetup as ae, PerformanceDiagnostic as af, ResolveReviewChangesOptions as ag, ResolvedNoteNumbering as ah, ReviewActivationOptions as ai, ReviewChangesAttribution as aj, ReviewChangesResolvedEvent as ak, ReviewCommentPlacement as al, ReviewCustomPlacement as am, ReviewItemHit as an, ReviewItemPlacement as ao, ReviewItemPlacementBase as ap, ReviewItemQuery as aq, ReviewItemRevealEvent as ar, ReviewItemRevealSource as as, ReviewRevisionPlacement as at, ReviewSkippedDiagnostic as au, ScrollPlacement as av, ScrollToAnchorOptions as aw, SelectedImageState as ax, SessionActivity as ay, SessionDiagnostic as az, EditorCommand as b, AnchorHighlightOptions as c, AuthoredNoteNumbering as d, BookmarkStory as e, BookmarkSummary as f, ClearAnchorHighlightOptions as g, CollaborationParticipantsDiagnostic as h, CollaborationStatusDiagnostic as i, CustomNodeDiagnosticEvent as j, DiagnosticBase as k, DiagnosticFailureDetail as l, DocumentChange as m, DocumentEditingMode as n, DocumentHandle as o, DocumentOpenDiagnostic as p, DocumentOpenFailure as q, DocumentOpenFailureReason as r, DocumentSaveDiagnostic as s, DocumentShape as t, DocumentSource as u, EditRejectedDiagnostic as v, EditRejectionOrigin as w, Editor as x, EditorAnchorNavigation as y, EditorBookmarkCommands as z };
@@ -0,0 +1,53 @@
1
+ /** A concrete font face requested by authored document content. */
2
+ interface FontFaceRequest {
3
+ readonly family: string;
4
+ readonly weight: number;
5
+ readonly style: 'normal' | 'italic';
6
+ }
7
+ /** Immutable, byte-backed font face supplied to layout and browser paint. */
8
+ interface FontSource {
9
+ readonly request: FontFaceRequest;
10
+ readonly id: string;
11
+ readonly bytes: Uint8Array;
12
+ readonly hash: string;
13
+ readonly faceIndex: number;
14
+ readonly availability?: 'available' | 'forbidden';
15
+ }
16
+ /** An explicit authored-font substitution. No implicit platform fallback is performed. */
17
+ interface FontSourceSubstitution {
18
+ readonly from: FontFaceRequest;
19
+ readonly to: FontFaceRequest;
20
+ /** Word line-box metrics for the requested face, expressed as em ratios. */
21
+ readonly lineMetrics?: {
22
+ readonly heightEm: number;
23
+ readonly baselineEm: number;
24
+ };
25
+ }
26
+ /**
27
+ * Public font source configuration sampled when an adapter mounts. It must be immutable for that
28
+ * editor lifetime; remount the adapter to replace bytes or substitutions atomically.
29
+ */
30
+ interface FontConfiguration {
31
+ /** Selectable provider families, independent of loaded bytes. Listing them performs no fetch. */
32
+ readonly supportedFamilies?: readonly string[];
33
+ readonly epoch: number;
34
+ readonly maxFontBytes: number;
35
+ readonly sources: readonly FontSource[];
36
+ readonly substitutions?: readonly FontSourceSubstitution[];
37
+ readonly defaultFont: {
38
+ readonly family: string;
39
+ readonly sizeHalfPoints: number;
40
+ };
41
+ readonly language?: string;
42
+ }
43
+ /**
44
+ * Why a font was not admitted.
45
+ *
46
+ * Distinguished rather than collapsed because the responses differ: `overLimit` and `malformed`
47
+ * are the caller's own bytes, while `forbidden` and `hashMismatch` mean the source was not what
48
+ * it claimed and the load should not be retried. `wasmUnavailable` alone is a HOST fault — the
49
+ * shaper's WASM never loaded, `diagnostic` carries the remedy — surface it as a setup error.
50
+ */
51
+ type EditorFontErrorCode = 'initializationFailed' | 'wasmUnavailable' | 'missing' | 'forbidden' | 'overLimit' | 'malformed' | 'hashMismatch' | 'metadataMismatch' | 'fontFaceLoadFailed' | 'unsupportedFaceIndex' | 'missingFont' | 'hashInvalid' | 'fontMismatch' | 'unsupportedFace' | 'loadFailed';
52
+
53
+ export type { EditorFontErrorCode as E, FontConfiguration as F, FontFaceRequest as a, FontSource as b, FontSourceSubstitution as c };
@@ -66,7 +66,11 @@ type EditorScope = {
66
66
  drawingNodeId: string;
67
67
  /** The paragraph that anchors that drawing. */
68
68
  hostParagraphId: string;
69
- /** Furniture or note story that owns this frame. Absence means the body story. */
69
+ /**
70
+ * Furniture or note story that owns this frame. Absence means the body story. Entering a
71
+ * frame owned by a header or footer opens that story around it; a note-owned frame cannot
72
+ * be entered.
73
+ */
70
74
  owner?: {
71
75
  kind: 'headerFooter';
72
76
  rId: string;
@@ -134,4 +138,4 @@ interface HistoryDiagnostic {
134
138
  readonly reason: string;
135
139
  }
136
140
 
137
- export type { EditorScope as E, HistoryDiagnostic as H, ViewScope as V, EditorExecOptions as a, HistoryGroup as b, HistoryGroupOptions as c, HistoryGroupOutcome as d };
141
+ export type { EditorScope as E, HistoryGroupOutcome as H, ViewScope as V, EditorExecOptions as a, HistoryDiagnostic as b, HistoryGroup as c, HistoryGroupOptions as d };