@docx-editor.dev/core 2.25.0 → 2.27.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 (115) hide show
  1. package/README.md +9 -3
  2. package/dist/automation.cjs +1 -1
  3. package/dist/automation.d.ts +31 -16
  4. package/dist/automation.js +1 -1
  5. package/dist/binding.cjs +1 -1
  6. package/dist/binding.d.ts +8 -8
  7. package/dist/binding.js +1 -1
  8. package/dist/chunk-2GK7YQB2.cjs +2 -0
  9. package/dist/chunk-4KZ6L5YF.cjs +15 -0
  10. package/dist/chunk-55AT3MOU.cjs +25 -0
  11. package/dist/chunk-6ZQMII6V.js +1 -0
  12. package/dist/chunk-7IGCWG4H.js +2 -0
  13. package/dist/chunk-7MYITTAH.js +5 -0
  14. package/dist/chunk-AVKVRU7Z.cjs +5 -0
  15. package/dist/chunk-CWRBFNK5.cjs +5 -0
  16. package/dist/chunk-DGPA3TST.cjs +27 -0
  17. package/dist/{chunk-WVJRO4WY.js → chunk-DNXVNQEO.js} +1 -1
  18. package/dist/chunk-FQN4KSFL.cjs +7 -0
  19. package/dist/{chunk-MEF2AK5L.cjs → chunk-GVUOWHTO.cjs} +1 -1
  20. package/dist/chunk-GWQJ5774.js +5 -0
  21. package/dist/chunk-HAQ72KD7.js +1 -0
  22. package/dist/chunk-HO5XFO32.cjs +3 -0
  23. package/dist/chunk-IGR23DV2.js +1 -0
  24. package/dist/chunk-JSIX2EOH.js +3 -0
  25. package/dist/chunk-K246T47S.cjs +1 -0
  26. package/dist/chunk-KAXOGCGA.js +1 -0
  27. package/dist/chunk-LZLTN5A3.cjs +1 -0
  28. package/dist/chunk-NBCVVZOM.cjs +1 -0
  29. package/dist/{chunk-AJCCS53D.js → chunk-O5INAWZQ.js} +1 -1
  30. package/dist/chunk-OHAXVTWG.cjs +1 -0
  31. package/dist/chunk-S74GRBNE.js +7 -0
  32. package/dist/chunk-UBLUVNZR.js +27 -0
  33. package/dist/chunk-UMRSBLO7.js +15 -0
  34. package/dist/chunk-VIPMGGUT.js +25 -0
  35. package/dist/chunk-WG4KMSX2.cjs +2 -0
  36. package/dist/chunk-WRLKVNNR.cjs +1 -0
  37. package/dist/chunk-ZU7IVN6G.js +2 -0
  38. package/dist/collaboration/replication.cjs +1 -1
  39. package/dist/collaboration/replication.d.ts +14 -5
  40. package/dist/collaboration/replication.js +1 -1
  41. package/dist/collaboration.d.ts +3 -3
  42. package/dist/contracts/document.d.ts +2 -2
  43. package/dist/contracts/editor.d.ts +8 -8
  44. package/dist/contracts/modules.cjs +1 -1
  45. package/dist/contracts/modules.d.ts +20 -31
  46. package/dist/contracts/modules.js +1 -1
  47. package/dist/contracts/types.d.ts +1 -1
  48. package/dist/{custom-node-writes-Cy9imOjA.d.ts → custom-node-writes-Vzpq9I8_.d.ts} +2 -2
  49. package/dist/{document-protection-Bp19Ad4I.d.ts → document-protection-9zpIHWTE.d.ts} +1 -1
  50. package/dist/{editor-DkfCCTxA.d.ts → editor-B3OBYNrF.d.ts} +29 -34
  51. package/dist/editor.cjs +1 -1
  52. package/dist/editor.css +14 -2
  53. package/dist/editor.d.ts +28 -27
  54. package/dist/editor.js +1 -1
  55. package/dist/export.cjs +2 -2
  56. package/dist/export.d.ts +26 -14
  57. package/dist/export.js +2 -2
  58. package/dist/{font-resolver-C295obND.d.ts → font-resolver-DN0xNOf_.d.ts} +5 -3
  59. package/dist/{headless-document-view-R9bzzepb.d.ts → headless-document-view-ICYqNkQ1.d.ts} +2 -2
  60. package/dist/{image-resources-DfagDguq.d.ts → image-resources-BDFxcu7W.d.ts} +1 -1
  61. package/dist/{index-3KAxeSic.d.ts → index-CkQVRJtJ.d.ts} +53 -21
  62. package/dist/index.cjs +1 -1
  63. package/dist/index.d.ts +18 -17
  64. package/dist/index.js +1 -1
  65. package/dist/{layout-shaping-C889tgmj.d.ts → layout-shaping-BvZD_VKP.d.ts} +1 -1
  66. package/dist/layout.cjs +1 -1
  67. package/dist/layout.d.ts +104 -202
  68. package/dist/layout.js +1 -1
  69. package/dist/{note-properties-CmfvOJsi.d.ts → note-properties-CkAk7g-n.d.ts} +1 -1
  70. package/dist/{omml-equation-CZ6IG2ja.d.ts → omml-equation-DuczgG5o.d.ts} +1 -1
  71. package/dist/output.cjs +1 -1
  72. package/dist/output.d.ts +8 -7
  73. package/dist/output.js +1 -1
  74. package/dist/{protocol-BhmenALD.d.ts → protocol-aKYr8r3u.d.ts} +34 -6
  75. package/dist/{review-paragraph-order-BwhRT264.d.ts → review-paragraph-order-Ddj5d6rp.d.ts} +6 -2
  76. package/dist/{revision-projection-DfWxdBqA.d.ts → revision-projection-CSNFudZY.d.ts} +74 -3
  77. package/dist/{semantic-cell-selection-CC3NwCtx.d.ts → semantic-cell-selection-DoqYCz_F.d.ts} +25 -7
  78. package/dist/{semantic-interaction-BHlV61hK.d.ts → semantic-interaction-G0bjmmmk.d.ts} +1 -1
  79. package/dist/{semantic-paint-DfWIWUs6.d.ts → semantic-paint-CsMzF8-O.d.ts} +57 -5
  80. package/dist/semantic-record-queries-1du6lQqS.d.ts +177 -0
  81. package/dist/{semantic-records-DrExlBy-.d.ts → semantic-records-B9OolWGN.d.ts} +91 -74
  82. package/dist/store.cjs +1 -1
  83. package/dist/store.d.ts +74 -17
  84. package/dist/store.js +1 -1
  85. package/dist/{tree-package-fragment-YPyYC1aD.d.ts → tree-package-fragment-DYZIk1rY.d.ts} +3 -3
  86. package/dist/{tree-session-contract-AeY2v0x9.d.ts → tree-session-contract-DQVJOOkv.d.ts} +5 -5
  87. package/dist/{types-barrel-BO73JqHG.d.ts → types-barrel-BFKR8Pzp.d.ts} +134 -110
  88. package/package.json +4 -4
  89. package/dist/chunk-3RMHRNDA.cjs +0 -1
  90. package/dist/chunk-42N7OV3G.cjs +0 -1
  91. package/dist/chunk-47ZJEEBT.js +0 -2
  92. package/dist/chunk-4B3SXBV6.js +0 -4
  93. package/dist/chunk-5MWFZ7F4.cjs +0 -11
  94. package/dist/chunk-AS2OC6J4.cjs +0 -26
  95. package/dist/chunk-B7SYEMZ7.cjs +0 -1
  96. package/dist/chunk-BME2KUNL.cjs +0 -1
  97. package/dist/chunk-CDGVVEUK.js +0 -26
  98. package/dist/chunk-E4RAPI5J.cjs +0 -2
  99. package/dist/chunk-FZJTQPH4.js +0 -2
  100. package/dist/chunk-H7XMRUAO.cjs +0 -5
  101. package/dist/chunk-ILUE2SI5.js +0 -1
  102. package/dist/chunk-IZT3C23R.js +0 -1
  103. package/dist/chunk-KJLPVGSX.cjs +0 -4
  104. package/dist/chunk-LF5LPZOP.cjs +0 -18
  105. package/dist/chunk-N5WE5O5Q.js +0 -1
  106. package/dist/chunk-OVDW4XQD.cjs +0 -2
  107. package/dist/chunk-SNN53UPD.js +0 -1
  108. package/dist/chunk-TKQH7BNE.cjs +0 -1
  109. package/dist/chunk-V7LBEUVW.js +0 -5
  110. package/dist/chunk-VE7YBFQD.js +0 -5
  111. package/dist/chunk-VOVDX7GW.js +0 -18
  112. package/dist/chunk-VQ33XGNP.cjs +0 -5
  113. package/dist/chunk-XUJINXW6.js +0 -1
  114. package/dist/chunk-Y3TPAITU.cjs +0 -1
  115. package/dist/chunk-Z65JJLLF.js +0 -11
@@ -1,5 +1,14 @@
1
- import { a6 as AutomationTableMutation, a3 as RevisionBatchResult } from './types-barrel-BO73JqHG.js';
2
- import { e as HeaderFooterVariant, N as NoteKind } from './tree-package-fragment-YPyYC1aD.js';
1
+ import { a6 as AutomationTableMutation, a3 as RevisionBatchResult } from './types-barrel-BFKR8Pzp.js';
2
+ import { c as HeaderFooterVariant, N as NoteKind } from './tree-package-fragment-DYZIk1rY.js';
3
+
4
+ /** Word's shape types, as `Word.ShapeType` spells them. */
5
+ type AutomationShapeType = 'TextBox' | 'GeometricShape' | 'Picture' | 'Group' | 'Canvas' | 'Unsupported';
6
+ /** What a shape read answers. */
7
+ interface AutomationShapeRead {
8
+ readonly id: number;
9
+ readonly name: string;
10
+ readonly type: AutomationShapeType;
11
+ }
3
12
 
4
13
  interface AutomationInlinePictureRead {
5
14
  readonly width: number;
@@ -193,6 +202,21 @@ type AutomationAuthoringOperation = {
193
202
  readonly rowCount: number;
194
203
  readonly columnCount: number;
195
204
  readonly values?: readonly (readonly string[])[];
205
+ }
206
+ /** The floating shapes anchored in a span's paragraphs, in reading order. */
207
+ | {
208
+ readonly op: 'getShapes';
209
+ readonly span: AutomationSpanRef;
210
+ /** Only shapes of these types. Absent lists every type. */
211
+ readonly types?: readonly AutomationShapeType[];
212
+ } | {
213
+ readonly op: 'getShape';
214
+ readonly shape: AutomationHandle;
215
+ }
216
+ /** A text box's own story. Any other shape has no body and refuses. */
217
+ | {
218
+ readonly op: 'getShapeBody';
219
+ readonly shape: AutomationHandle;
196
220
  } | {
197
221
  readonly op: 'getInlinePictures';
198
222
  readonly span: AutomationSpanRef;
@@ -653,9 +677,10 @@ type AutomationOperation = AutomationAuthoringOperation | {
653
677
  /**
654
678
  * The header or footer story a section declares or inherits, as a BODY.
655
679
  *
656
- * A variant the document has neither declared nor inherited is refused: minting the part would
657
- * make a read write, and a header that exists only because it was asked about is a header the
658
- * document did not have.
680
+ * A variant the document has neither declared nor inherited is still answered, as an empty
681
+ * body: every read on it answers what it answers for an empty story. Asking does not create
682
+ * the part. The first text written into the body creates it; any other write that would change
683
+ * the body is refused until then.
659
684
  */
660
685
  | {
661
686
  readonly op: 'getFurniture';
@@ -1251,7 +1276,7 @@ type AutomationOperationKind = AutomationOperation['op'];
1251
1276
  * `body` is one STORY — the main body, a header or footer variant of a section, or one note — so
1252
1277
  * every object reached through a body is reached in a named story rather than in "the document".
1253
1278
  */
1254
- type AutomationObjectKind = 'document' | 'body' | 'paragraph' | 'section' | 'note' | 'comment' | 'revision' | 'bookmark' | 'list' | 'contentControl' | 'table' | 'tableRow' | 'tableCell' | 'field' | 'inlinePicture';
1279
+ type AutomationObjectKind = 'document' | 'body' | 'paragraph' | 'section' | 'note' | 'comment' | 'revision' | 'bookmark' | 'list' | 'contentControl' | 'table' | 'tableRow' | 'tableCell' | 'field' | 'inlinePicture' | 'shape';
1255
1280
  declare const AUTOMATION_HANDLE_BRAND: unique symbol;
1256
1281
  /**
1257
1282
  * An opaque host-minted name for a document object.
@@ -1416,6 +1441,9 @@ type AutomationValue = {
1416
1441
  } | {
1417
1442
  readonly kind: 'inlinePicture';
1418
1443
  readonly picture: AutomationInlinePictureRead;
1444
+ } | {
1445
+ readonly kind: 'shape';
1446
+ readonly shape: AutomationShapeRead;
1419
1447
  } | {
1420
1448
  readonly kind: 'handle';
1421
1449
  readonly handle: AutomationHandle;
@@ -1,4 +1,4 @@
1
- import { N as OoxmlNode, Z as OoxmlElement, _ as OoxmlContentControlNode, V as OoxmlGenericElementNode, $ as OoxmlContentControlContentNode, C as CommentRecord, O as OoxmlPart } from './types-barrel-BO73JqHG.js';
1
+ import { N as OoxmlNode, Z as OoxmlElement, _ as OoxmlContentControlNode, V as OoxmlGenericElementNode, $ as OoxmlContentControlContentNode, C as CommentRecord, O as OoxmlPart } from './types-barrel-BFKR8Pzp.js';
2
2
 
3
3
  /** Nested content-control wrappers deeper than this stop flattening; content stays preserved. */
4
4
  declare const MAX_CONTENT_CONTROL_NESTING = 32;
@@ -57,7 +57,11 @@ declare function walkParagraphInline(children: readonly OoxmlNode[], depth: numb
57
57
  readonly descendRevisions?: boolean;
58
58
  }): void;
59
59
 
60
- /** Plain text of a comment's body, so a card never re-implements the run walk. */
60
+ /**
61
+ * Plain text of a comment's body, as a card shows it: a non-breaking hyphen is U+2011, an
62
+ * optional hyphen shows nothing, and a symbol shows its glyph. A card never re-implements the
63
+ * run walk.
64
+ */
61
65
  declare function commentBodyText(comment: CommentRecord): string;
62
66
  /** Author initials for an avatar, from `@w:initials` or the name. */
63
67
  declare function commentInitials(comment: CommentRecord): string;
@@ -1,4 +1,74 @@
1
- import { N as OoxmlNode } from './types-barrel-BO73JqHG.js';
1
+ import { N as OoxmlNode } from './types-barrel-BFKR8Pzp.js';
2
+
3
+ /** Named revision colors. Identifiers are stable and never contain CSS. @public */
4
+ declare const REVISION_MARKUP_COLORS: readonly ['black', 'blue', 'turquoise', 'green', 'pink', 'red', 'yellow', 'white', 'darkBlue', 'teal', 'darkGreen', 'violet', 'darkRed', 'darkYellow', 'gray50', 'gray25', 'lightBlue', 'lightYellow', 'lightOrange', 'lightPurple', 'lightGreen', 'gray'];
5
+ /** @public */
6
+ type RevisionMarkupNamedColor = (typeof REVISION_MARKUP_COLORS)[number];
7
+ /** @public */
8
+ type RevisionMarkupColor = RevisionMarkupNamedColor | 'byAuthor' | 'auto';
9
+ /** @public */
10
+ type RevisionMarkupMark = 'none' | 'colorOnly' | 'bold' | 'italic' | 'underline' | 'doubleUnderline' | 'strikethrough' | 'doubleStrikethrough';
11
+ /** @public */
12
+ type RevisionDeletionMark = RevisionMarkupMark | 'hidden' | 'caret' | 'pound';
13
+ /** @public */
14
+ type RevisionChangedLinesMark = 'none' | 'leftBorder' | 'rightBorder' | 'outsideBorder';
15
+ /** @public */
16
+ interface RevisionMarkupStyle<Mark extends string = RevisionMarkupMark> {
17
+ readonly mark: Mark;
18
+ readonly color: RevisionMarkupColor;
19
+ }
20
+ /** Viewer-only text styling. Document highlighting remains unchanged. @public */
21
+ interface RevisionMarkupTextStyle<Mark extends string = RevisionMarkupMark> extends RevisionMarkupStyle<Mark> {
22
+ /** Background color behind revision text. Defaults to `none`. */
23
+ readonly background: RevisionMarkupNamedColor | 'byAuthor' | 'none';
24
+ }
25
+ /** Fully resolved, immutable viewer preferences. @public */
26
+ interface ResolvedRevisionMarkup {
27
+ readonly insertions: RevisionMarkupTextStyle;
28
+ readonly deletions: RevisionMarkupTextStyle<RevisionDeletionMark>;
29
+ readonly movedFrom: RevisionMarkupTextStyle<RevisionDeletionMark>;
30
+ readonly movedTo: RevisionMarkupTextStyle;
31
+ readonly formatting: RevisionMarkupTextStyle;
32
+ readonly changedLines: RevisionMarkupStyle<RevisionChangedLinesMark>;
33
+ readonly cells: {
34
+ readonly inserted: RevisionMarkupNamedColor | 'byAuthor' | 'none';
35
+ readonly deleted: RevisionMarkupNamedColor | 'byAuthor' | 'none';
36
+ readonly merged: RevisionMarkupNamedColor | 'byAuthor' | 'none';
37
+ readonly split: RevisionMarkupNamedColor | 'byAuthor' | 'none';
38
+ };
39
+ readonly trackMoves: boolean;
40
+ readonly trackFormatting: boolean;
41
+ }
42
+ /** Partial viewer preferences. Omitted values keep the previous value. @public */
43
+ type RevisionMarkupOptions = {
44
+ readonly [K in keyof ResolvedRevisionMarkup]?: ResolvedRevisionMarkup[K] extends boolean ? boolean : Partial<ResolvedRevisionMarkup[K]>;
45
+ };
46
+ /** Initial viewer preferences. @public */
47
+ declare const DEFAULT_REVISION_MARKUP: ResolvedRevisionMarkup;
48
+ /** Validate and merge preferences without modifying the input. @public */
49
+ declare function resolveRevisionMarkup(input?: RevisionMarkupOptions, previous?: ResolvedRevisionMarkup): ResolvedRevisionMarkup;
50
+ /** A local settings draft owned by the editor. @public */
51
+ interface RevisionMarkupDialogSession {
52
+ /** Aborts on close, replacement, load, detach, destroy, or renderer disposal. */
53
+ readonly signal: AbortSignal;
54
+ /** Read the immutable draft. */
55
+ get(): ResolvedRevisionMarkup;
56
+ /** Merge validated options into the draft without committing preferences. */
57
+ set(options: RevisionMarkupOptions): void;
58
+ /** Restore default preferences in the draft only. */
59
+ reset(): void;
60
+ /** Observe draft changes, including effective external preference changes. */
61
+ subscribe(listener: () => void): () => void;
62
+ canApply(): boolean;
63
+ /** Commit the draft and close. Returns false after cancellation. */
64
+ apply(): boolean;
65
+ /** Close without committing the draft. */
66
+ cancel(): void;
67
+ }
68
+ /** Host rendering for the Track changes options dialog. @public */
69
+ interface RevisionMarkupChromeHandlers {
70
+ readonly onRequest?: (session: RevisionMarkupDialogSession) => void;
71
+ }
2
72
 
3
73
  /**
4
74
  * What a revision wrapper asserts about the content inside it.
@@ -59,6 +129,7 @@ declare const DEFAULT_REVISION_DISPLAY_MODE: RevisionDisplayMode;
59
129
  * delimiter-based key.
60
130
  */
61
131
  interface RevisionFilter {
132
+ readonly revisionMarkup?: ResolvedRevisionMarkup;
62
133
  readonly hiddenAuthors: ReadonlySet<string>;
63
134
  readonly includes?: (revision: RevisionAttribution) => boolean;
64
135
  readonly includesNode?: (nodeId: string, author: string) => boolean;
@@ -167,5 +238,5 @@ declare function formatRevisionOf(properties: readonly {
167
238
  /** True when this stack of revisions marks its content as deleted from the live document. */
168
239
  declare function revisionsAreDeletion(revisions: readonly RevisionAttribution[]): boolean;
169
240
 
170
- export { DEFAULT_REVISION_DISPLAY_MODE as D, formatRevisionOf as f, paragraphMarkRevisionOf as g, paragraphMarkRevisionsOf as h, revisionsAreDeletion as i, revisionsVisible as j, markRevisionRemovesMark as m, paragraphMarkFormatRevisionOf as p, revisionAuthorFilter as r, shownMarkRevision as s };
171
- export type { ReviewDisplayMode as R, RevisionDisplayMode as a, RevisionAuthorFilter as b, RevisionAttribution as c, RevisionFilter as d, RevisionKind as e };
241
+ export { revisionsVisible as A, shownMarkRevision as B, DEFAULT_REVISION_MARKUP as D, REVISION_MARKUP_COLORS as f, DEFAULT_REVISION_DISPLAY_MODE as p, resolveRevisionMarkup as r, formatRevisionOf as t, markRevisionRemovesMark as u, paragraphMarkFormatRevisionOf as v, paragraphMarkRevisionOf as w, paragraphMarkRevisionsOf as x, revisionAuthorFilter as y, revisionsAreDeletion as z };
242
+ export type { RevisionMarkupDialogSession as R, ReviewDisplayMode as a, RevisionDisplayMode as b, RevisionAuthorFilter as c, ResolvedRevisionMarkup as d, RevisionMarkupOptions as e, RevisionChangedLinesMark as g, RevisionDeletionMark as h, RevisionMarkupChromeHandlers as i, RevisionMarkupColor as j, RevisionMarkupMark as k, RevisionMarkupNamedColor as l, RevisionMarkupStyle as m, RevisionMarkupTextStyle as n, RevisionAttribution as o, RevisionFilter as q, RevisionKind as s };
@@ -1,7 +1,25 @@
1
- import { O as OoxmlPart, Z as OoxmlElement, N as OoxmlNode } from './types-barrel-BO73JqHG.js';
2
- import { a as RevisionDisplayMode, b as RevisionAuthorFilter } from './revision-projection-DfWxdBqA.js';
3
- import { b as SectionPageBorders, P as PageGeometry, I as InlineDrawingRecord, A as AnchoredDrawingRecord, T as TextMeasurer, L as LineRecord, a as StyleSpanRecord, S as SemanticLayout, C as ContentControlBoundaryRecord, c as TableRowFragmentRecord, d as TableCellFragmentRecord } from './semantic-records-DrExlBy-.js';
4
- import { S as SemanticPosition, C as CaretGeometry, a as SemanticSelection } from './semantic-interaction-BHlV61hK.js';
1
+ import { O as OoxmlPart, Z as OoxmlElement, N as OoxmlNode } from './types-barrel-BFKR8Pzp.js';
2
+ import { b as RevisionDisplayMode, c as RevisionAuthorFilter } from './revision-projection-CSNFudZY.js';
3
+ import { f as SectionPageBorders, I as InlineDrawingRecord, A as AnchoredDrawingRecord, T as TextMeasurer, L as LineRecord, e as StyleSpanRecord, S as SemanticLayout, C as ContentControlBoundaryRecord, g as TableRowFragmentRecord, h as TableCellFragmentRecord } from './semantic-records-B9OolWGN.js';
4
+ import { S as SemanticPosition, C as CaretGeometry, a as SemanticSelection } from './semantic-interaction-G0bjmmmk.js';
5
+
6
+ /** Page geometry, in points. */
7
+ interface PageGeometry {
8
+ readonly width: number;
9
+ readonly height: number;
10
+ readonly margin: {
11
+ readonly top: number;
12
+ readonly right: number;
13
+ readonly bottom: number;
14
+ readonly left: number;
15
+ };
16
+ /** `w:pgMar/@header` — sheet edge to header top, in points. Defaults to 36 (720 twips). */
17
+ readonly headerDistance?: number;
18
+ /** `w:pgMar/@footer` — sheet edge to footer bottom, in points. Defaults to 36. */
19
+ readonly footerDistance?: number;
20
+ }
21
+ /** US Letter with one-inch margins, in points. */
22
+ declare const DEFAULT_PAGE_GEOMETRY: PageGeometry;
5
23
 
6
24
  /**
7
25
  * Hard ceiling on sections enumerated from a document (matches write-path
@@ -422,7 +440,7 @@ declare function cellSelectionRects(layout: SemanticLayout, cellIds: readonly st
422
440
  * the only shape that survives the trip: the text range a rectangle stands in for would paste
423
441
  * back as one run of characters with the grid gone.
424
442
  */
425
- declare function cellSelectionText(layout: SemanticLayout, selection: CellSelection): string;
443
+ declare function cellSelectionText(layout: SemanticLayout, selection: CellSelection, paragraphText?: (layout: SemanticLayout, paragraphId: string) => string): string;
426
444
  /** Where a paragraph sits in a table, if it sits in one. */
427
445
  interface TableCellContext {
428
446
  readonly tableId: string;
@@ -440,5 +458,5 @@ interface TableCellContext {
440
458
  */
441
459
  declare function tableContextAt(layout: SemanticLayout, paragraphId: string): TableCellContext | null;
442
460
 
443
- export { pageAtY as A, paragraphSectionNode as B, DEFAULT_SECTION_PROPERTIES as D, paragraphsInCells as E, parsePageNumbering as F, parseSectionProperties as G, projectedSectionSourceIndexes as I, readSectionProperties as J, spanOffsetX as K, spansInCells as L, MAX_DOCUMENT_SECTIONS as M, tableContextAt as N, DEFAULT_VERTICAL_WEIGHT as b, caretBoxOnLine as n, cellSelectionBetween as o, cellSelectionRects as p, cellSelectionText as q, contentControlAtPoint as r, enumerateDocumentSections as s, enumerateDocumentSectionsBounded as t, findDrawingOverlayFrameInLayout as u, geometryOfSection as v, hitTestPage as w, hitTestSheet as x, isFurniturePoint as y, lineEndOffset as z };
444
- export type { CellSelection as C, HitPoint as H, PlacedCell as P, SectionProperties as S, TableCellAddress as T, SectionColumns as a, DocumentSection as c, DocumentSectionsEnumeration as d, DrawingOverlayFrame as e, HitTestOptions as f, SectionBreakType as g, SectionColumnDefinition as h, SectionMargins as i, SectionPageNumbering as j, SemanticHit as k, SemanticHitDrawing as l, TableCellContext as m };
461
+ export { isFurniturePoint as A, lineEndOffset as B, DEFAULT_PAGE_GEOMETRY as D, pageAtY as E, paragraphSectionNode as F, paragraphsInCells as G, parsePageNumbering as I, parseSectionProperties as J, projectedSectionSourceIndexes as K, readSectionProperties as L, MAX_DOCUMENT_SECTIONS as M, spanOffsetX as N, spansInCells as O, tableContextAt as Q, DEFAULT_SECTION_PROPERTIES as b, DEFAULT_VERTICAL_WEIGHT as c, caretBoxOnLine as p, cellSelectionBetween as q, cellSelectionRects as r, cellSelectionText as s, contentControlAtPoint as t, enumerateDocumentSections as u, enumerateDocumentSectionsBounded as v, findDrawingOverlayFrameInLayout as w, geometryOfSection as x, hitTestPage as y, hitTestSheet as z };
462
+ export type { CellSelection as C, HitPoint as H, PageGeometry as P, SectionProperties as S, TableCellAddress as T, SectionColumns as a, DocumentSection as d, DocumentSectionsEnumeration as e, DrawingOverlayFrame as f, HitTestOptions as g, PlacedCell as h, SectionBreakType as i, SectionColumnDefinition as j, SectionMargins as k, SectionPageNumbering as l, SemanticHit as m, SemanticHitDrawing as n, TableCellContext as o };
@@ -1,4 +1,4 @@
1
- import { T as TextMeasurer, S as SemanticLayout, B as BlockFragmentRecord, C as ContentControlBoundaryRecord, a as StyleSpanRecord } from './semantic-records-DrExlBy-.js';
1
+ import { T as TextMeasurer, S as SemanticLayout, B as BlockFragmentRecord, C as ContentControlBoundaryRecord, e as StyleSpanRecord } from './semantic-records-B9OolWGN.js';
2
2
 
3
3
  /** A caret position in the model. */
4
4
  interface SemanticPosition {
@@ -1,5 +1,7 @@
1
- import { C as ContentControlBoundaryRecord, S as SemanticLayout } from './semantic-records-DrExlBy-.js';
2
- import { V as ValidatedImageBytesHandle, R as RenderableImageMime } from './image-resources-DfagDguq.js';
1
+ import { d as ResolvedRevisionMarkup } from './revision-projection-CSNFudZY.js';
2
+ import { a as PageRecord, C as ContentControlBoundaryRecord, S as SemanticLayout } from './semantic-records-B9OolWGN.js';
3
+ import { S as SemanticRootStoryKind } from './semantic-record-queries-1du6lQqS.js';
4
+ import { V as ValidatedImageBytesHandle, R as RenderableImageMime } from './image-resources-BDFxcu7W.js';
3
5
 
4
6
  /**
5
7
  * Everything a host can say about ONE author's presentation. Every field is optional and
@@ -101,6 +103,21 @@ interface ReviewAuthorInfo {
101
103
  /** The host-supplied style, normalised; absent when the author rides the ramp. */
102
104
  readonly style?: RevisionAuthorStyle;
103
105
  }
106
+ /**
107
+ * The resolved form the painter consumes: the document's author→slot map, the host's
108
+ * per-author styles, what UNSTYLED authors take, and the paint-reuse key for all of it.
109
+ * `null` means the default kind colouring for everyone.
110
+ */
111
+ interface RevisionStyleContext {
112
+ readonly authorSlots: ReadonlyMap<string, number>;
113
+ readonly styles: ReadonlyMap<string, RevisionAuthorStyle>;
114
+ /** `spanClassName` pre-split into tokens, so paint does not split per span. */
115
+ readonly classTokens: ReadonlyMap<string, readonly string[]>;
116
+ /** Authors without a style: `'kind'` colours, or the ramp. */
117
+ readonly others: 'kind' | 'author';
118
+ /** See {@link revisionStyleContextKey}. Computed once, with the context. */
119
+ readonly key: string;
120
+ }
104
121
 
105
122
  /** Host port for safe blob URLs — only called for {@link ImageResourceState.kind} `ready`. */
106
123
  interface PaintImageUrlPort {
@@ -120,8 +137,40 @@ interface DrawingPaintStrings {
120
137
  readonly pendingResource: string;
121
138
  }
122
139
 
123
- /** Which bars a paint draws: the view's own, or none for the resolved views. */
140
+ /** Which bars a paint draws. @public */
124
141
  type ChangeBarsMode = 'all-markup' | 'simple-markup' | 'none';
142
+ /** Which story a bar stands beside; the header-editing chrome dims every other story's. */
143
+ type BarStory = Exclude<SemanticRootStoryKind, 'note-separator'>;
144
+ /** One rule in sheet coordinates (points from the page's top-left corner). */
145
+ interface BarRun {
146
+ author?: string;
147
+ color?: string;
148
+ top: number;
149
+ bottom: number;
150
+ story: BarStory;
151
+ insertion: boolean;
152
+ deletion: boolean;
153
+ format: boolean;
154
+ }
155
+ /** Page change bars in page coordinates. @public */
156
+ interface PageChangeBars {
157
+ readonly mode: ChangeBarsMode;
158
+ readonly color?: string;
159
+ /** Whether the bars take the pointer as Word's toggle. */
160
+ readonly toggle: boolean;
161
+ /** Sheet-relative x of the column, already scaled and snapped to a whole pixel. */
162
+ readonly left: number;
163
+ readonly runs: readonly BarRun[];
164
+ /** Cheap identity of `left` + `runs`, for the block-adoption path to compare. */
165
+ readonly signature: string;
166
+ }
167
+ /**
168
+ * The rules one page needs, in sheet coordinates: every root story the page paints, the
169
+ * blocks of each (tracked rows and rotated cells included), and the text-box stories its
170
+ * anchored drawings carry, each at the origin the painter places it at.
171
+ * @public
172
+ */
173
+ declare function collectPageChangeBars(page: PageRecord, scale: number, mode: ChangeBarsMode, toggle?: boolean, markup?: ResolvedRevisionMarkup, facingPages?: boolean, colors?: RevisionStyleContext): PageChangeBars;
125
174
 
126
175
  /**
127
176
  * When a field's result is drawn on its grey block, following Word's own View option.
@@ -179,6 +228,9 @@ interface PaintOptions {
179
228
  * See {@link RevisionStyles}.
180
229
  */
181
230
  readonly revisionStyles?: RevisionStyles;
231
+ readonly revisionMarkup?: ResolvedRevisionMarkup;
232
+ readonly revisionKindColors?: boolean;
233
+ readonly facingPages?: boolean;
182
234
  /**
183
235
  * Which change bars the margin draws: All Markup's neutral rule beside attributed lines
184
236
  * (the default, whatever the layout's projection — a layout that carries attribution gets
@@ -270,5 +322,5 @@ interface PaintOptions {
270
322
  */
271
323
  declare function paintSemanticLayout(container: HTMLElement, layout: SemanticLayout, options?: PaintOptions): void;
272
324
 
273
- export { DEFAULT_FIELD_SHADING as D, paintSemanticLayout as p };
274
- export type { FieldShadingMode as F, PaintOptions as P, ReviewAuthorInfo as R, RevisionAuthorAssignments as a, RevisionAuthorStyle as b, RevisionStyles as c, DrawingPaintStrings as d };
325
+ export { DEFAULT_FIELD_SHADING as D, collectPageChangeBars as e, paintSemanticLayout as p };
326
+ export type { ChangeBarsMode as C, FieldShadingMode as F, PageChangeBars as P, ReviewAuthorInfo as R, PaintOptions as a, RevisionAuthorAssignments as b, RevisionAuthorStyle as c, RevisionStyles as d, DrawingPaintStrings as f };
@@ -0,0 +1,177 @@
1
+ import { I as InlineDrawingRecord, A as AnchoredDrawingRecord, P as ParagraphFragmentRecord, L as LineRecord, a as PageRecord, N as NoteAreaRecord, b as LayoutBox, H as HeaderFooterStoryRecord, c as NoteStoryRecord, B as BlockFragmentRecord, S as SemanticLayout, C as ContentControlBoundaryRecord, d as ContentControlLock } from './semantic-records-B9OolWGN.js';
2
+
3
+ /**
4
+ * Depth-first paragraph fragments of one page, in reading order.
5
+ *
6
+ * Table interiors flatten through rows and cells; header-repeat rows are skipped unless
7
+ * asked for, so interaction sees each caret stop exactly once while paint sees everything.
8
+ */
9
+ declare function paragraphFragmentsOf(page: PageRecord, includeHeaderRepeats?: boolean): ParagraphFragmentRecord[];
10
+ declare function paragraphFragmentsOfBlocks(blocks: readonly BlockFragmentRecord[], includeHeaderRepeats?: boolean): ParagraphFragmentRecord[];
11
+ /** Every line in a layout, in reading order — the order caret navigation walks. */
12
+ declare function linesOf(layout: SemanticLayout): LineRecord[];
13
+ /** The fragment-plus-anchored-drawings shape every laid-out story shares. */
14
+ interface StoryDrawingHost {
15
+ /** Root story fragments in their published reading order. */
16
+ readonly fragments: readonly BlockFragmentRecord[];
17
+ /** Story-level positioned drawings, when that story supports anchors. */
18
+ readonly anchoredDrawings?: readonly AnchoredDrawingRecord[];
19
+ }
20
+ /** Root story kinds published directly from one page record. @public */
21
+ type SemanticRootStoryKind = 'body' | 'header' | 'footer' | 'footnote' | 'endnote' | 'note-separator';
22
+ /** Story containing a visited semantic record. @public */
23
+ type SemanticStoryKind = SemanticRootStoryKind | 'textbox';
24
+ /**
25
+ * One root story in the engine's complete published page/story order.
26
+ *
27
+ * The story discriminant preserves the precise published host type so exporters can consume
28
+ * furniture and note metadata without casting or searching the page graph a second time.
29
+ * @public
30
+ */
31
+ type SemanticStoryVisit = {
32
+ readonly page: PageRecord;
33
+ readonly story: 'body';
34
+ readonly host: PageRecord;
35
+ /** Absolute story bounds; body records are relative to the page content box. */
36
+ readonly box: LayoutBox;
37
+ /** Absolute origin to add to story-relative fragment and drawing coordinates. */
38
+ readonly origin: Readonly<{
39
+ x: number;
40
+ y: number;
41
+ }>;
42
+ readonly noteScopeId: null;
43
+ readonly noteAreaKind: null;
44
+ } | {
45
+ readonly page: PageRecord;
46
+ readonly story: 'header' | 'footer';
47
+ readonly host: HeaderFooterStoryRecord;
48
+ readonly box: LayoutBox;
49
+ readonly origin: Readonly<{
50
+ x: number;
51
+ y: number;
52
+ }>;
53
+ readonly noteScopeId: null;
54
+ readonly noteAreaKind: null;
55
+ } | {
56
+ readonly page: PageRecord;
57
+ readonly story: 'footnote' | 'endnote';
58
+ readonly host: NoteStoryRecord;
59
+ readonly box: LayoutBox;
60
+ readonly origin: Readonly<{
61
+ x: number;
62
+ y: number;
63
+ }>;
64
+ readonly noteScopeId: string;
65
+ readonly noteAreaKind: NoteAreaRecord['kind'];
66
+ } | {
67
+ readonly page: PageRecord;
68
+ readonly story: 'note-separator';
69
+ readonly host: NonNullable<NoteAreaRecord['separator']>;
70
+ readonly box: LayoutBox;
71
+ readonly origin: Readonly<{
72
+ x: number;
73
+ y: number;
74
+ }>;
75
+ readonly noteScopeId: null;
76
+ readonly noteAreaKind: NoteAreaRecord['kind'];
77
+ };
78
+ /** Visit every root story in a semantic layout, preserving page/story order. @public */
79
+ declare function forEachSemanticStory(layout: SemanticLayout, visit: (story: SemanticStoryVisit) => void): void;
80
+ /** Location of one paragraph fragment within a recursively painted story graph. @public */
81
+ interface StoryParagraphFragmentContext {
82
+ /** Absolute origin of the immediate story containing this record. */
83
+ readonly storyOrigin: Readonly<{
84
+ x: number;
85
+ y: number;
86
+ }>;
87
+ /** Zero for the supplied story; increments for every textbox boundary. */
88
+ readonly textboxDepth: number;
89
+ /** Drawing whose textbox directly owns this fragment, or null for the root story. */
90
+ readonly textboxOwner: TextboxOwnerRecord | null;
91
+ /** Root-to-leaf owning drawings, empty for the supplied story. */
92
+ readonly textboxPath: readonly TextboxOwnerRecord[];
93
+ }
94
+ /** A drawing that owns a text-box story: anchored, or inline on a line. @public */
95
+ type TextboxOwnerRecord = InlineDrawingRecord | AnchoredDrawingRecord;
96
+ /** Location of one drawing within a recursively painted story graph. @public */
97
+ interface StoryDrawingContext extends StoryParagraphFragmentContext {
98
+ /** Enclosing paragraph for an inline drawing; null for a story-level anchor. */
99
+ readonly paragraph: ParagraphFragmentRecord | null;
100
+ /** Enclosing line for an inline drawing; null for a story-level anchor. */
101
+ readonly line: LineRecord | null;
102
+ }
103
+ type RootDrawingOrigin = (drawing: AnchoredDrawingRecord) => Readonly<{
104
+ x: number;
105
+ y: number;
106
+ }>;
107
+ /** Drawing layer relative to its owning story's text. @public */
108
+ type SemanticDrawingLayer = 'behind-text' | 'inline' | 'in-front-of-text';
109
+ /**
110
+ * One drawing in bounded graph-enumeration order with exporter-grade provenance.
111
+ *
112
+ * Enumeration is deliberately not paint order: story anchors (and nested textboxes) are visited
113
+ * before inline line drawings. Renderers use `paintLayer` plus record geometry to compose layers.
114
+ * @public
115
+ */
116
+ interface SemanticDrawingVisit extends StoryDrawingContext {
117
+ /** Physical page carrying this drawing occurrence. */
118
+ readonly page: PageRecord;
119
+ /** Immediate story classification; `textbox` after textbox descent. */
120
+ readonly story: SemanticStoryKind;
121
+ /** Root story from which textbox descent began. */
122
+ readonly rootStory: SemanticRootStoryKind;
123
+ /** Note scope for drawings in note stories; null elsewhere. */
124
+ readonly noteScopeId: string | null;
125
+ /** Owning note-area kind for note/separator drawings; null elsewhere. */
126
+ readonly noteAreaKind: NoteAreaRecord['kind'] | null;
127
+ /** Precise root host and absolute origin for story-relative geometry. */
128
+ readonly root: SemanticStoryVisit;
129
+ /** Absolute origin of this drawing's extent in page-stack coordinates. */
130
+ readonly drawingOrigin: Readonly<{
131
+ x: number;
132
+ y: number;
133
+ }>;
134
+ /** Absolute painted bounds, including effects and clipping. */
135
+ readonly absolutePaintBounds: LayoutBox;
136
+ /** Absolute pointer/hit bounds. */
137
+ readonly absoluteHitBounds: LayoutBox;
138
+ /** Layer relative to text in the immediate owning story. */
139
+ readonly paintLayer: SemanticDrawingLayer;
140
+ /** Published drawing record; inline visits also carry paragraph and line. */
141
+ readonly drawing: InlineDrawingRecord | AnchoredDrawingRecord;
142
+ }
143
+ /** Visit every drawing through the canonical root-story and recursive textbox walks. @public */
144
+ declare function forEachSemanticDrawing(layout: SemanticLayout, visit: (drawing: SemanticDrawingVisit) => void): void;
145
+ /**
146
+ * Visit every paragraph fragment one story paints — its own (table interiors flattened,
147
+ * header repeats included) and the fragments inside each anchored drawing's text-box story,
148
+ * recursively.
149
+ *
150
+ * The fragment sibling of {@link forEachStoryDrawing}, sharing its depth bound, for
151
+ * consumers that read per-paragraph published fields (list markers) rather than drawings.
152
+ * The furniture list-marker token walks with this; a fragment it misses leaves a reused
153
+ * page showing a stale marker.
154
+ */
155
+ declare function forEachStoryParagraphFragment(story: StoryDrawingHost, visit: (fragment: ParagraphFragmentRecord, context: StoryParagraphFragmentContext) => void, rootOrigin?: Readonly<{
156
+ x: number;
157
+ y: number;
158
+ }>, rootDrawingOrigin?: RootDrawingOrigin): void;
159
+ /** Every fragment belonging to one paragraph, in order, across page boundaries. */
160
+ declare function fragmentsOfParagraph(layout: SemanticLayout, paragraphId: string): ParagraphFragmentRecord[];
161
+ /** The line containing a model position, or null when the position is not laid out. */
162
+ declare function lineAtPosition(layout: SemanticLayout, paragraphId: string, offset: number,
163
+ /** Lines to test, when the caller already knows which ones can carry the paragraph. */
164
+ candidates?: Iterable<LineRecord>): LineRecord | null;
165
+ /** Every content-control boundary on a layout, preferring the layout-level list. */
166
+ declare function contentControlsOfLayout(layout: SemanticLayout): readonly ContentControlBoundaryRecord[];
167
+ /**
168
+ * Axis-aligned union of boxes, or null when the list is empty.
169
+ *
170
+ * Used when a control's content spans several fragments or spans on one page.
171
+ */
172
+ declare function unionLayoutBoxes(boxes: readonly LayoutBox[]): LayoutBox | null;
173
+ /** Collapse raw + ancestor locks into one `ST_Lock` vocabulary value. */
174
+ declare function effectiveContentControlLock(locks: readonly ContentControlLock[]): ContentControlLock;
175
+
176
+ export { contentControlsOfLayout as h, effectiveContentControlLock as i, forEachSemanticDrawing as j, forEachSemanticStory as k, forEachStoryParagraphFragment as l, fragmentsOfParagraph as m, lineAtPosition as n, linesOf as o, paragraphFragmentsOf as p, paragraphFragmentsOfBlocks as q, unionLayoutBoxes as u };
177
+ export type { SemanticRootStoryKind as S, TextboxOwnerRecord as T, SemanticStoryKind as a, SemanticStoryVisit as b, SemanticDrawingLayer as c, SemanticDrawingVisit as d, StoryDrawingContext as e, StoryDrawingHost as f, StoryParagraphFragmentContext as g };