@docx-editor.dev/core 2.32.0 → 2.34.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 (121) hide show
  1. package/README.md +1 -1
  2. package/THIRD_PARTY_NOTICES.md +1 -0
  3. package/dist/automation.cjs +1 -1
  4. package/dist/automation.d.ts +14 -52
  5. package/dist/automation.js +1 -1
  6. package/dist/binding.cjs +1 -1
  7. package/dist/binding.d.ts +14 -14
  8. package/dist/binding.js +1 -1
  9. package/dist/{chrome-print-CznJ0ucN.d.ts → chrome-print-DY0xsXm_.d.ts} +231 -125
  10. package/dist/chunk-37IYWENL.cjs +1 -0
  11. package/dist/chunk-37RNWL45.js +4 -0
  12. package/dist/chunk-5HUVQXET.cjs +4 -0
  13. package/dist/chunk-5JP3QQF7.js +7 -0
  14. package/dist/chunk-5KOLFKOB.cjs +5 -0
  15. package/dist/chunk-6MF5PN2E.js +236 -0
  16. package/dist/chunk-77JT2AU7.js +2 -0
  17. package/dist/{chunk-ETDZFNMI.js → chunk-7FUORGCW.js} +1 -1
  18. package/dist/chunk-A5BTVPET.cjs +236 -0
  19. package/dist/chunk-AFXFH2T2.js +3 -0
  20. package/dist/chunk-AVCYP7OY.js +5 -0
  21. package/dist/chunk-BL2E4QRA.js +1 -0
  22. package/dist/chunk-DB7X4Y6O.js +4 -0
  23. package/dist/chunk-DR6W23TB.cjs +2 -0
  24. package/dist/chunk-DYLB5U42.js +1 -0
  25. package/dist/chunk-E5BKDHIP.cjs +1 -0
  26. package/dist/chunk-IWXBRUPG.cjs +4 -0
  27. package/dist/{chunk-L5TYBFDB.js → chunk-KCUXXO3Q.js} +1 -1
  28. package/dist/chunk-KYA4Y2YB.js +1 -0
  29. package/dist/{chunk-6UDJUI3W.cjs → chunk-L74TCGVH.cjs} +1 -1
  30. package/dist/chunk-NBSSQSKY.js +30 -0
  31. package/dist/{chunk-OKMEMSKB.cjs → chunk-NEM774E3.cjs} +1 -1
  32. package/dist/chunk-NKZVMMHU.cjs +1 -0
  33. package/dist/chunk-TXIO5WYQ.cjs +32 -0
  34. package/dist/chunk-UKG2TXWH.cjs +7 -0
  35. package/dist/chunk-V7CO55DO.cjs +3 -0
  36. package/dist/chunk-VLQDQNSS.js +1 -0
  37. package/dist/chunk-VQOAC3VI.cjs +30 -0
  38. package/dist/chunk-YWJSQA2O.js +32 -0
  39. package/dist/chunk-ZJ74LCFI.cjs +1 -0
  40. package/dist/collaboration/replication.cjs +1 -1
  41. package/dist/collaboration/replication.d.ts +13 -4
  42. package/dist/collaboration/replication.js +1 -1
  43. package/dist/collaboration.d.ts +3 -3
  44. package/dist/contracts/document.d.ts +3 -3
  45. package/dist/contracts/editor.d.ts +10 -10
  46. package/dist/contracts/interaction.d.ts +2 -2
  47. package/dist/contracts/modules.d.ts +12 -12
  48. package/dist/contracts/types.d.ts +4 -4
  49. package/dist/{custom-node-writes-CLJKGD9t.d.ts → custom-node-writes-DparEcZK.d.ts} +45 -7
  50. package/dist/diagnostic-context-CkZKkKvB.d.ts +98 -0
  51. package/dist/{diagnostic-hints-DK8-V0fk.d.ts → diagnostic-hints-BTyb8yzX.d.ts} +3 -3
  52. package/dist/{document-protection-NaniLHWF.d.ts → document-protection-DdWxihIN.d.ts} +1 -1
  53. package/dist/{headless-document-view-Bcz9_Qva.d.ts → drawing-graphic-kind-CK0cMc7H.d.ts} +161 -18
  54. package/dist/drawing-preview-package-fFjXpOMS.d.ts +115 -0
  55. package/dist/{editor-DZwOTmlR.d.ts → editor-DDCkWqfD.d.ts} +125 -21
  56. package/dist/{editor-scope-B3L-1ALc.d.ts → editor-scope-CA6egMaK.d.ts} +5 -1
  57. package/dist/editor.cjs +1 -1
  58. package/dist/editor.css +4 -4
  59. package/dist/editor.d.ts +387 -78
  60. package/dist/editor.js +1 -1
  61. package/dist/export.cjs +2 -2
  62. package/dist/export.d.ts +47 -12
  63. package/dist/export.js +2 -2
  64. package/dist/{font-resolver-BlQNGdvR.d.ts → font-resolver-Bm9XqTNO.d.ts} +14 -0
  65. package/dist/index.cjs +1 -1
  66. package/dist/index.d.ts +38 -23
  67. package/dist/index.js +1 -1
  68. package/dist/{layout-shaping-E5J4Z1Gf.d.ts → layout-shaping-Byj-TwsI.d.ts} +1 -1
  69. package/dist/layout.cjs +1 -1
  70. package/dist/layout.d.ts +434 -199
  71. package/dist/layout.js +1 -1
  72. package/dist/metafile-drawing-Ce6TuWLm.d.ts +115 -0
  73. package/dist/{note-properties-Ds5R2_3F.d.ts → note-properties-BiunaIQa.d.ts} +31 -7
  74. package/dist/output.cjs +1 -1
  75. package/dist/output.d.ts +77 -13
  76. package/dist/output.js +1 -1
  77. package/dist/{protocol-DKa4qt7F.d.ts → protocol-Dn44dL4M.d.ts} +184 -120
  78. package/dist/{review-paragraph-order-Dc17w_6v.d.ts → review-paragraph-order-BWMXAKuA.d.ts} +1 -1
  79. package/dist/{revision-projection-Cn6rZJ7H.d.ts → revision-projection-DwFhgIR0.d.ts} +1 -1
  80. package/dist/{semantic-cell-selection-BaUR0iJ4.d.ts → semantic-cell-selection-DhalxEBH.d.ts} +2 -2
  81. package/dist/{semantic-interaction-CJoHLoOl.d.ts → semantic-interaction-QeuzEtAk.d.ts} +2 -4
  82. package/dist/{semantic-paint-BPw_n0li.d.ts → semantic-paint-BYDZbTiY.d.ts} +16 -9
  83. package/dist/{semantic-record-queries-C0rJ3sB4.d.ts → semantic-record-queries-Bf5bgQL3.d.ts} +1 -1
  84. package/dist/{semantic-records-BvN-WWst.d.ts → semantic-records-CzZiWMY8.d.ts} +348 -132
  85. package/dist/store.cjs +1 -1
  86. package/dist/store.d.ts +526 -19
  87. package/dist/store.js +1 -1
  88. package/dist/{tree-op-types-C_S2niXW.d.ts → tree-op-types-DKvJSH8T.d.ts} +1024 -501
  89. package/dist/{tree-package-store-CRHvMyNj.d.ts → tree-package-store-Cl3BkWXF.d.ts} +8 -3
  90. package/dist/{tree-session-contract-D1awo_dA.d.ts → tree-session-contract-BL50pqs8.d.ts} +15 -8
  91. package/dist/{unsupported-elements-CVos5cqe.d.ts → unsupported-elements-Bra4QTOM.d.ts} +1 -1
  92. package/licenses/ECMA-376.md +29 -0
  93. package/package.json +2 -2
  94. package/dist/bookmark-names-DDuAra_V.d.ts +0 -37
  95. package/dist/chunk-25EXMBV2.cjs +0 -5
  96. package/dist/chunk-3IEXDEFH.cjs +0 -7
  97. package/dist/chunk-65XBN67F.cjs +0 -2
  98. package/dist/chunk-6NVZNB7O.cjs +0 -3
  99. package/dist/chunk-ACLR4DMK.js +0 -1
  100. package/dist/chunk-B2BEELUE.js +0 -1
  101. package/dist/chunk-DDFHKQFU.js +0 -30
  102. package/dist/chunk-E4IAO4CY.cjs +0 -2
  103. package/dist/chunk-FDSL5OJU.cjs +0 -30
  104. package/dist/chunk-FS7CMYLT.js +0 -4
  105. package/dist/chunk-GDS24SZN.js +0 -30
  106. package/dist/chunk-GIY6NT2X.js +0 -5
  107. package/dist/chunk-GWM3AKUD.js +0 -18
  108. package/dist/chunk-HDOXACHP.js +0 -2
  109. package/dist/chunk-IILEENID.js +0 -1
  110. package/dist/chunk-MNF2K7NN.cjs +0 -30
  111. package/dist/chunk-O324RB6R.cjs +0 -1
  112. package/dist/chunk-QXJKYNYZ.js +0 -1
  113. package/dist/chunk-RALTVLB6.js +0 -2
  114. package/dist/chunk-SRVKFUFI.js +0 -3
  115. package/dist/chunk-TELQ52LG.cjs +0 -1
  116. package/dist/chunk-TJHE5EET.cjs +0 -1
  117. package/dist/chunk-UMMRURPE.js +0 -7
  118. package/dist/chunk-XJYZVGQR.cjs +0 -1
  119. package/dist/chunk-ZGTIE3QJ.cjs +0 -4
  120. package/dist/chunk-ZOZI27AW.cjs +0 -18
  121. package/dist/diagnostic-context-BtDUY3v2.d.ts +0 -31
@@ -1,37 +1,85 @@
1
- import { c as FontConfigurationFragment, g as FontResolver, M as MarkedFontResolver, f as FontResolutionRequest } from './font-resolver-BlQNGdvR.js';
1
+ import { d as FontOrigin, M as MarkedFontResolver, c as FontConfigurationFragment, g as FontResolver, f as FontResolutionRequest } from './font-resolver-Bm9XqTNO.js';
2
2
  import { F as FontConfiguration, a as FontFaceRequest, b as FontSource } from './editor-fonts-D_-vjuJi.js';
3
- import { V as ViewScope, a as EditorExecOptions } from './editor-scope-B3L-1ALc.js';
4
- import { au as TreeDocOp, b0 as TextFormFieldRange, b1 as TextFormFieldOptions, ad as ImageDecodePort, ao as Unsubscribe, E as ExecResult, aa as DrawingPositionInput, b2 as DrawingTransform, G as ParagraphTabStop, y as IndentFormatting, F as ParagraphFlags, A as ParagraphDisagreements, aJ as DrawingTreeDocOp, an as SupportedImageMime, am as SelectionPin, a5 as OoxmlPackage, g as ReviewRevisionKind, aH as PackageWatermarkWrite, ag as ImageWrapTarget } from './tree-op-types-C_S2niXW.js';
5
- import { e as BookmarkStory, u as DocumentSource, aP as ZoomMode, J as EditorFontError, x as Editor, b as EditorCommand, C as CanResult, aw as SelectedImageState, _ as FormatPainterSurfaceState, f as BookmarkSummary, au as ScrollPlacement, aN as TrackedChangePredicate, aM as TrackedChangeFilterMode, a9 as ImageContext, aA as TableBorderEdgeTarget, aB as TableBorderSpec, aC as TableBorderStyle, aH as TableContext } from './editor-DZwOTmlR.js';
6
- import { T as TextMeasurer, f as UnsupportedElementRule, S as SemanticLayout, C as ContentControlBoundaryRecord, t as SectionProperties } from './semantic-records-BvN-WWst.js';
7
- import { a as ReviewDisplayMode, d as ResolvedRevisionMarkup, k as RevisionMarkupOptions, g as RevisionMarkupChromeHandlers } from './revision-projection-Cn6rZJ7H.js';
8
- import { F as FieldResultsMode, C as ContentLockPolicy, I as InsertImageInput, S as StoryScope, A as ApplyImagePropertiesInput, i as ImageIntentResult } from './tree-package-store-CRHvMyNj.js';
3
+ import { V as ViewScope, a as EditorExecOptions } from './editor-scope-CA6egMaK.js';
4
+ import { au as TreeDocOp, b3 as TextFormFieldRange, b4 as TextFormFieldOptions, ad as ImageDecodePort, ao as Unsubscribe, E as ExecResult, aa as DrawingPositionInput, aZ as DrawingTransform, G as ParagraphTabStop, y as IndentFormatting, F as ParagraphFlags, A as ParagraphDisagreements, aJ as DrawingTreeDocOp, an as SupportedImageMime, am as SelectionPin, a5 as OoxmlPackage, g as ReviewRevisionKind, aH as PackageWatermarkWrite, ag as ImageWrapTarget } from './tree-op-types-DKvJSH8T.js';
5
+ import { aJ as TableInteractionLabelKey, e as BookmarkStory, u as DocumentSource, aR as ZoomMode, J as EditorFontError, x as Editor, b as EditorCommand, C as CanResult, ax as SelectedImageState, _ as FormatPainterSurfaceState, f as BookmarkSummary, av as ScrollPlacement, aP as TrackedChangePredicate, aO as TrackedChangeFilterMode, a9 as ImageContext, aB as TableBorderEdgeTarget, aC as TableBorderSpec, aD as TableBorderStyle, aI as TableContext } from './editor-DDCkWqfD.js';
6
+ import { T as TextMeasurer, i as UnsupportedElementRule, S as SemanticLayout, C as ContentControlBoundaryRecord, t as SectionProperties } from './semantic-records-CzZiWMY8.js';
7
+ import { a as ReviewDisplayMode, d as ResolvedRevisionMarkup, k as RevisionMarkupOptions, g as RevisionMarkupChromeHandlers } from './revision-projection-DwFhgIR0.js';
8
+ import { F as FieldResultsMode, C as ContentLockPolicy, I as InsertImageInput, S as StoryScope, A as ApplyImagePropertiesInput, i as ImageIntentResult } from './tree-package-store-Cl3BkWXF.js';
9
9
  import { ReviewPaneOptions } from './contracts/types.js';
10
10
  import { F as FontShapingOptions } from './font-shaping-policy-BvpkrfxM.js';
11
- import { F as FieldShadingMode, c as RevisionStyles, f as DrawingPaintStrings, R as ReviewAuthorInfo, b as RevisionAuthorStyle } from './semantic-paint-BPw_n0li.js';
12
- import { ReviewModuleContribution, EditorModule } from './contracts/modules.js';
13
- import { S as SemanticPosition, a as SemanticSelection, N as NavigationCommand } from './semantic-interaction-CJoHLoOl.js';
14
11
  import { CollaborationModuleContribution, EditorCollaborationSession, CollaborationRemoteSelection } from './collaboration.js';
15
- import { R as ResolvedFootnoteProperties, a as ResolvedEndnoteProperties, A as AuthoredNoteProperties } from './note-properties-Ds5R2_3F.js';
16
- import { B as BookmarkIndex } from './custom-node-writes-CLJKGD9t.js';
17
- import { C as CellSelection } from './semantic-cell-selection-BaUR0iJ4.js';
18
- import { T as TreeDocxSessionView, a as TreeApplyResult } from './tree-session-contract-D1awo_dA.js';
12
+ import { F as FieldShadingMode, c as RevisionStyles, f as DrawingPaintStrings, R as ReviewAuthorInfo, b as RevisionAuthorStyle } from './semantic-paint-BYDZbTiY.js';
13
+ import { ReviewModuleContribution, EditorModule } from './contracts/modules.js';
14
+ import { S as SemanticPosition, a as SemanticSelection, N as NavigationCommand } from './semantic-interaction-QeuzEtAk.js';
15
+ import { C as CellSelection } from './semantic-cell-selection-DhalxEBH.js';
16
+ import { R as ResolvedFootnoteProperties, a as ResolvedEndnoteProperties, A as AuthoredNoteProperties } from './note-properties-BiunaIQa.js';
17
+ import { B as BookmarkIndex } from './custom-node-writes-DparEcZK.js';
18
+ import { T as TreeDocxSessionView, a as TreeApplyResult } from './tree-session-contract-BL50pqs8.js';
19
19
  import { a as CollaborationStatus } from './failure-6KGFrDO9.js';
20
20
 
21
+ /**
22
+ * Load an origin's faces after the document first paints, instead of before.
23
+ *
24
+ * The editor opens the document with the faces the other origins supply, then lays it out
25
+ * again when these arrive. Use it for faces that are large or slow to fetch. Leave an origin
26
+ * unwrapped to install its faces with the document's other waiting fonts: a large document
27
+ * (over about 512 KB of uncompressed content) waits up to 2 seconds for them before its
28
+ * first paint.
29
+ *
30
+ * ```ts
31
+ * const fonts = [packagedFonts(), deferFonts(myBrandFonts())];
32
+ * ```
33
+ *
34
+ * A document export that receives this origin waits for its faces, so exported pages use them.
35
+ * The faces never change the configuration settings, such as `defaultFont` or `maxFontBytes`:
36
+ * those come from the origins that answer at once, so the document does not change its
37
+ * default font after it paints.
38
+ *
39
+ * @public
40
+ */
41
+ declare function deferFonts(origin: FontOrigin): MarkedFontResolver;
42
+
43
+ /**
44
+ * How a blank document starts.
45
+ *
46
+ * @public
47
+ */
48
+ interface BlankDocumentOptions {
49
+ /**
50
+ * `'rtl'` starts the document right to left: its paragraphs (`w:bidi` in the paragraph
51
+ * defaults) and its section (`w:sectPr/w:bidi`) read right to left, as a new document does
52
+ * when a right-to-left editing language is the default. `'ltr'` is the default.
53
+ */
54
+ readonly direction?: 'ltr' | 'rtl';
55
+ /**
56
+ * The language of right-to-left and complex-script text, as a BCP 47 tag such as `ar-SA`
57
+ * or `he-IL`, written as the run defaults' `w:lang/@w:bidi`. Layout follows it: European
58
+ * digits in an Arabic-script language draw in the Latin face. A value that is not a
59
+ * language tag is ignored.
60
+ */
61
+ readonly bidiLanguage?: string;
62
+ }
21
63
  /**
22
64
  * A blank document, freshly zipped per call (the caller may hand the
23
65
  * bytes to a loader that takes ownership). Calibri 11pt and Word's Normal paragraph
24
66
  * spacing are authored in `w:docDefaults`, Word's built-in style gallery in `styles.xml`,
25
67
  * and US Letter geometry in the section. Word opens the saved file.
26
68
  *
69
+ * A right-to-left interface usually wants `{ direction: 'rtl', bidiLanguage: 'ar-SA' }` (or
70
+ * the reader's own language), so the first paragraph is ready for right-to-left typing.
71
+ *
27
72
  * @public
28
73
  */
29
- declare function blankDocumentBytes(): Uint8Array;
74
+ declare function blankDocumentBytes(options?: BlankDocumentOptions): Uint8Array;
30
75
 
31
76
  type TableCommandSelectionPolicy = {
32
77
  readonly kind: 'preserveSelection';
33
78
  } | {
34
79
  readonly kind: 'adoptCommittedCaret';
80
+ } | {
81
+ readonly kind: 'selectCells';
82
+ readonly cells: CellSelection;
35
83
  };
36
84
  type TableCommandPlan = {
37
85
  readonly ok: true;
@@ -225,6 +273,29 @@ interface HyperlinkOps {
225
273
  fieldLinkAtCaret(): SurfaceHyperlink | null;
226
274
  /** The link with this node id, or null. */
227
275
  linkById(linkId: string): SurfaceHyperlink | null;
276
+ /**
277
+ * Whether every character the selection covers is a pending tracked deletion.
278
+ *
279
+ * A link panel opened over live words reads this to learn that a peer struck those words in
280
+ * suggesting mode: the selected text is unchanged, but it is about to leave the document.
281
+ *
282
+ * Reads the laid-out deletions, so it is true in All Markup and Original views. In Simple
283
+ * Markup and No Markup the struck text is hidden and the selection holds none of it, so it
284
+ * returns false; there the selected text itself changes, and a text comparison catches the
285
+ * strike instead. False for a caret and for a selection that spans paragraphs.
286
+ */
287
+ selectionIsPendingDeletion(): boolean;
288
+ /**
289
+ * The word a new link takes when the caret is collapsed inside it, or null.
290
+ *
291
+ * A link panel opened at such a caret selects this word first, so the word becomes the
292
+ * display text and the linked text. Null at a word edge, in a link, inside tracked deleted
293
+ * text, and for a range selection. Inside means the same as for formatting at the caret.
294
+ */
295
+ wordAtCaret(): {
296
+ readonly from: SemanticPosition;
297
+ readonly to: SemanticPosition;
298
+ } | null;
228
299
  /**
229
300
  * Apply a link to the selection, or retarget the one the caret is already in.
230
301
  *
@@ -470,9 +541,9 @@ interface PaginatedSurfaceOptions {
470
541
  /**
471
542
  * Ctrl/Cmd+K — Word's Insert Hyperlink. The engine reports the request; the host's chrome
472
543
  * decides what a link dialog looks like. A host that passes nothing leaves the key alone
473
- * rather than doing something surprising with it.
544
+ * rather than doing something surprising with it. Answering `false` leaves it alone too.
474
545
  */
475
- readonly onRequestHyperlink?: () => void;
546
+ readonly onRequestHyperlink?: () => boolean | void;
476
547
  /**
477
548
  * Ctrl/Cmd+Shift+F5: open the host's bookmark dialog. Answers whether chrome took the
478
549
  * request; when none did, or when this is absent, the key is left to the browser.
@@ -493,7 +564,7 @@ interface PaginatedSurfaceOptions {
493
564
  * Localized accessible names for core-owned table insertion furniture.
494
565
  * Defaults to English from `@docx-editor.dev/i18n` when omitted.
495
566
  */
496
- readonly tableInteractionLabel?: (key: 'table.insertRowBelow' | 'table.insertColumnRight') => string;
567
+ readonly tableInteractionLabel?: (key: TableInteractionLabelKey) => string;
497
568
  /** Localized drawing refusal labels; defaults to English when omitted. */
498
569
  readonly drawingStrings?: DrawingPaintStrings;
499
570
  /** Override raster decode for package image intents; defaults to browser/headless. */
@@ -682,7 +753,7 @@ interface DocxEditorConfig {
682
753
  zoomMode?: ZoomMode | 'auto';
683
754
  onFontError?: (error: EditorFontError) => void;
684
755
  /** Localized labels for table insertion furniture on the painted surface. */
685
- tableInteractionLabel?: (key: 'table.insertRowBelow' | 'table.insertColumnRight') => string;
756
+ tableInteractionLabel?: (key: TableInteractionLabelKey) => string;
686
757
  }
687
758
  /**
688
759
  * Which measurer the current document's layout runs on, and whether shaped resolution is
@@ -1243,6 +1314,11 @@ interface ImageOverlayScrollPort {
1243
1314
  interface SelectedDrawingOverlayTarget {
1244
1315
  /** Keep the text area available for pointer editing through the frame. */
1245
1316
  readonly textbox?: boolean;
1317
+ /**
1318
+ * False for a text box whose text takes no caret: rotated or vertical text, or a story
1319
+ * holding a table. Absent for a drawing that is not a text box.
1320
+ */
1321
+ readonly textEditable?: boolean;
1246
1322
  readonly id: string;
1247
1323
  readonly pageIndex: number;
1248
1324
  readonly x: number;
@@ -1508,6 +1584,12 @@ interface ParagraphPropertyEdit {
1508
1584
  readonly remove?: boolean;
1509
1585
  }
1510
1586
 
1587
+ /** Why a table of contents cannot be removed: none is addressed, or it cannot go now. @public */
1588
+ interface TocRemovalRefusal {
1589
+ readonly code: 'notFound' | 'unsupported';
1590
+ readonly reason: string;
1591
+ }
1592
+
1511
1593
  /**
1512
1594
  * Which review write is being committed through `commitReviewOps`.
1513
1595
  *
@@ -1665,6 +1747,102 @@ interface PaginatedSurfacePerf {
1665
1747
  readonly cancelledRuns: number;
1666
1748
  }
1667
1749
 
1750
+ /** Indent and list commands of the paginated surface. */
1751
+ interface SurfaceIndentAndListOps {
1752
+ /**
1753
+ * Word's Increase/Decrease Indent, over every paragraph the selection touches.
1754
+ *
1755
+ * A NUMBERED or BULLETED paragraph changes LEVEL: `w:numPr/w:ilvl` moves by one, which
1756
+ * re-resolves its marker from `numbering.xml` — so a bullet becomes a hollow circle, a
1757
+ * `1.` becomes an `a.`, exactly as Word demotes a list item. A level the definition
1758
+ * does not declare is DECLARED on the way, with Word's default format for that depth
1759
+ * (its stock bullets and number formats cycle every three levels) — a definition that
1760
+ * stops at `ilvl 0` never blocks the press. Everything else moves its `w:ind/@left` by
1761
+ * one default tab stop, never past the margin.
1762
+ *
1763
+ * Answers whether anything changed, so a caller can fall back (Tab inserting a tab
1764
+ * where there is no list to demote).
1765
+ */
1766
+ adjustIndent(direction: 'increase' | 'decrease'): boolean;
1767
+ /**
1768
+ * Tab (`increase`) or Shift+Tab (`decrease`) over a selection outside a list and outside a
1769
+ * table cell (the key moves between cells there): change the indent and keep the text.
1770
+ *
1771
+ * A selection over two or more paragraphs, or a cell rectangle (only from a host calling
1772
+ * this directly), steps the left indent of each paragraph. A selection in one paragraph that
1773
+ * starts at the paragraph start, whole or partial, works on the first line: Tab sets a first-line indent of one default tab stop
1774
+ * (`w:defaultTabStop`), or steps the left indent when the first line already has that
1775
+ * indent or more, or a hanging indent. Shift+Tab clears a first-line indent that the
1776
+ * paragraph states itself, so a style value applies again, and otherwise steps the left
1777
+ * indent back. A paragraph the selection reaches only at its start is not touched by this
1778
+ * rule, unless it is the empty last paragraph of the story.
1779
+ *
1780
+ * Answers true when the selection takes this rule, also when the write is refused or
1781
+ * changes nothing, so the text is never replaced. Answers false for a caret and for a
1782
+ * selection in one paragraph that starts inside the text; there Tab types a tab character
1783
+ * and Shift+Tab steps the left indent.
1784
+ */
1785
+ indentWithTab(direction: 'increase' | 'decrease'): boolean;
1786
+ /**
1787
+ * Set indent to exact values on every paragraph the selection touches — what a ruler
1788
+ * drag and an indent spinner both need, where {@link adjustIndent} only steps.
1789
+ *
1790
+ * Twips. Omitting a field leaves it as authored; `null` CLEARS it, so the paragraph
1791
+ * falls back to its style — distinct from zero, which blocks the cascade.
1792
+ *
1793
+ * `firstLine` is ONE SIGNED offset, negative for a hanging indent; the two OOXML
1794
+ * spellings are written for it, the unused one as an explicit zero. Answers whether
1795
+ * anything was committed.
1796
+ */
1797
+ setIndent(update: {
1798
+ readonly left?: number | null;
1799
+ readonly right?: number | null;
1800
+ readonly firstLine?: number | null;
1801
+ }): boolean;
1802
+ /**
1803
+ * Whether Increase/Decrease Indent would do anything right now.
1804
+ *
1805
+ * A list item at level 0 cannot outdent and one at level 8 cannot indent — `w:ilvl`
1806
+ * has nine levels and Word greys the control out at the ends. A missing level
1807
+ * DEFINITION never disables it: `adjustIndent` declares the level as it goes. The one
1808
+ * residue: a `w:numStyleLink` definition missing the level refuses the declaration
1809
+ * (its levels belong to the linked style), so there the press is a safe no-op rather
1810
+ * than a greyed control.
1811
+ */
1812
+ canAdjustIndent(direction: 'increase' | 'decrease'): boolean;
1813
+ /**
1814
+ * Enter on an empty list item: outdent a level, or leave the list at level 0. Backspace
1815
+ * at an item's start (`removeListNumber`): drop its number and keep the text in place.
1816
+ * Both answer false when they did not handle the key, so the caller splits or joins.
1817
+ */
1818
+ exitListOnEmptyItem(): boolean;
1819
+ /** Backspace at the start of `paragraphId`: drop its list number; false if it is not one. */
1820
+ removeListNumber(paragraphId: string): boolean;
1821
+ /**
1822
+ * Backspace at the start of an unnumbered `paragraphId`: remove its left and first-line or
1823
+ * hanging indent, or step it back to the marker of the list item it lines up with.
1824
+ *
1825
+ * False when the press should join instead: for a list item, an empty paragraph, a
1826
+ * paragraph in a content-locked control, and an indent this write cannot change (from a
1827
+ * table style, a level that paints no marker, or the earlier properties the Original view
1828
+ * shows). True when it wrote, and also when the write was refused, so the key is spent on
1829
+ * the refusal the surface publishes.
1830
+ */
1831
+ removeParagraphIndent(paragraphId: string): boolean;
1832
+ /** Whether the paragraph at the caret is a list item, for Tab's Word-like fallback. */
1833
+ isListParagraph(): boolean;
1834
+ /**
1835
+ * Word's Bullets and Numbering buttons.
1836
+ *
1837
+ * Turns every paragraph the selection touches into a list of `kind`, or takes them all
1838
+ * out when they are already one. The definition is created in `numbering.xml` on first
1839
+ * use — a document that has never carried a list has no numbering part at all.
1840
+ */
1841
+ toggleList(kind: 'bullet' | 'ordered'): boolean;
1842
+ /** Whether every paragraph the selection touches is already a list of `kind`. */
1843
+ isListActive(kind: 'bullet' | 'ordered'): boolean;
1844
+ }
1845
+
1668
1846
  /**
1669
1847
  * One live remote-caret label the engine positioned. The host owns its content; the engine
1670
1848
  * still owns the label's geometry, class, and presence colour, and rebuilds the labels
@@ -1858,8 +2036,8 @@ interface PaginatedSurfaceState {
1858
2036
  /**
1859
2037
  * The TOC the last right-click landed on, or null.
1860
2038
  *
1861
- * A right-click deliberately does not move the caret, and a TOC refuses the caret
1862
- * entirely, so `selection` can never say which table of contents the user is pointing at.
2039
+ * A TOC refuses the caret entirely, so a right-click on one leaves the caret where it was
2040
+ * and `selection` can never say which table of contents the user is pointing at.
1863
2041
  * This is how a host's context menu learns it. Surface chrome, not document state.
1864
2042
  */
1865
2043
  readonly contextTocId: string | null;
@@ -1902,7 +2080,7 @@ type SectionBreakInsertType = 'nextPage' | 'continuous';
1902
2080
  * Every write goes through the guarded mutation path on this object. Reaching past it into
1903
2081
  * `session` to apply ops directly bypasses the layout invalidation and the caret bookkeeping.
1904
2082
  */
1905
- interface PaginatedSurface {
2083
+ interface PaginatedSurface extends SurfaceIndentAndListOps {
1906
2084
  readonly session: TreeDocxSessionView;
1907
2085
  /** The collaboration replica a `collaborationModule` attached, or null. */
1908
2086
  collaborationSession(): EditorCollaborationSession | null;
@@ -1971,86 +2149,6 @@ interface PaginatedSurface {
1971
2149
  insertLineBreak(): void;
1972
2150
  /** A `w:br w:type="page"` — Ctrl+Enter, a hard page break inside the paragraph. */
1973
2151
  insertPageBreak(): void;
1974
- /**
1975
- * Word's Increase/Decrease Indent, over every paragraph the selection touches.
1976
- *
1977
- * A NUMBERED or BULLETED paragraph changes LEVEL: `w:numPr/w:ilvl` moves by one, which
1978
- * re-resolves its marker from `numbering.xml` — so a bullet becomes a hollow circle, a
1979
- * `1.` becomes an `a.`, exactly as Word demotes a list item. A level the definition
1980
- * does not declare is DECLARED on the way, with Word's default format for that depth
1981
- * (its stock bullets and number formats cycle every three levels) — a definition that
1982
- * stops at `ilvl 0` never blocks the press. Everything else moves its `w:ind/@left` by
1983
- * one default tab stop, never past the margin.
1984
- *
1985
- * Answers whether anything changed, so a caller can fall back (Tab inserting a tab
1986
- * where there is no list to demote).
1987
- */
1988
- adjustIndent(direction: 'increase' | 'decrease'): boolean;
1989
- /**
1990
- * Tab (`increase`) or Shift+Tab (`decrease`) over a selection outside a list: change the
1991
- * indent and keep the text.
1992
- *
1993
- * A selection over two or more paragraphs, or a cell rectangle, steps the left indent of
1994
- * each paragraph. A selection in one paragraph that starts at the paragraph start, whole or
1995
- * partial, works on the first line: Tab sets a first-line indent of one default tab stop
1996
- * (`w:defaultTabStop`), or steps the left indent when the first line already has that
1997
- * indent or more, or a hanging indent. Shift+Tab clears a first-line indent that the
1998
- * paragraph states itself, so a style value applies again, and otherwise steps the left
1999
- * indent back. A paragraph the selection reaches only at its start is not touched by this
2000
- * rule, unless it is the empty last paragraph of the story.
2001
- *
2002
- * Answers true when the selection takes this rule, also when the write is refused or
2003
- * changes nothing, so the text is never replaced. Answers false for a caret and for a
2004
- * selection in one paragraph that starts inside the text; there Tab types a tab character
2005
- * and Shift+Tab steps the left indent.
2006
- */
2007
- indentWithTab(direction: 'increase' | 'decrease'): boolean;
2008
- /**
2009
- * Set indent to exact values on every paragraph the selection touches — what a ruler
2010
- * drag and an indent spinner both need, where {@link adjustIndent} only steps.
2011
- *
2012
- * Twips. Omitting a field leaves it as authored; `null` CLEARS it, so the paragraph
2013
- * falls back to its style — distinct from zero, which blocks the cascade.
2014
- *
2015
- * `firstLine` is ONE SIGNED offset, negative for a hanging indent; the two OOXML
2016
- * spellings are written for it, the unused one as an explicit zero. Answers whether
2017
- * anything was committed.
2018
- */
2019
- setIndent(update: {
2020
- readonly left?: number | null;
2021
- readonly right?: number | null;
2022
- readonly firstLine?: number | null;
2023
- }): boolean;
2024
- /**
2025
- * Whether Increase/Decrease Indent would do anything right now.
2026
- *
2027
- * A list item at level 0 cannot outdent and one at level 8 cannot indent — `w:ilvl`
2028
- * has nine levels and Word greys the control out at the ends. A missing level
2029
- * DEFINITION never disables it: `adjustIndent` declares the level as it goes. The one
2030
- * residue: a `w:numStyleLink` definition missing the level refuses the declaration
2031
- * (its levels belong to the linked style), so there the press is a safe no-op rather
2032
- * than a greyed control.
2033
- */
2034
- canAdjustIndent(direction: 'increase' | 'decrease'): boolean;
2035
- /**
2036
- * Enter on an empty list item: outdent a level, or leave the list at level 0.
2037
- *
2038
- * Answers false when the caret is not on an empty list item, so the caller falls
2039
- * through to an ordinary paragraph split.
2040
- */
2041
- exitListOnEmptyItem(): boolean;
2042
- /** Whether the paragraph at the caret is a list item, for Tab's Word-like fallback. */
2043
- isListParagraph(): boolean;
2044
- /**
2045
- * Word's Bullets and Numbering buttons.
2046
- *
2047
- * Turns every paragraph the selection touches into a list of `kind`, or takes them all
2048
- * out when they are already one. The definition is created in `numbering.xml` on first
2049
- * use — a document that has never carried a list has no numbering part at all.
2050
- */
2051
- toggleList(kind: 'bullet' | 'ordered'): boolean;
2052
- /** Whether every paragraph the selection touches is already a list of `kind`. */
2053
- isListActive(kind: 'bullet' | 'ordered'): boolean;
2054
2152
  /** Select the whole document. */
2055
2153
  selectAll(): void;
2056
2154
  /**
@@ -2275,6 +2373,16 @@ interface PaginatedSurface {
2275
2373
  canEditTextFormField(): boolean;
2276
2374
  editTextFormField(): boolean;
2277
2375
  refreshToc(tocId?: string, mode?: 'entire' | 'pageNumbers'): boolean;
2376
+ /**
2377
+ * Why the addressed (or right-clicked, or caret-local) body TOC cannot be removed now, or
2378
+ * null when it can: `notFound` when there is none, `unsupported` with the reason otherwise.
2379
+ */
2380
+ removeTocRefusal(tocId?: string): TocRemovalRefusal | null;
2381
+ /**
2382
+ * Remove a body TOC: its field, or the table of contents control around it with its
2383
+ * heading. Text before and after the field stays. One undo step. Refused while suggesting.
2384
+ */
2385
+ removeToc(tocId?: string): boolean;
2278
2386
  /**
2279
2387
  * Rewrite stale REF field results in the body, footnote and endnote stories so a save
2280
2388
  * exports what the pages paint. Fresh results commit nothing (no transaction, no revision
@@ -2554,14 +2662,14 @@ interface PaginatedSurface {
2554
2662
  selectedText(): string;
2555
2663
  /**
2556
2664
  * Every clipboard flavour for the current selection: plain text, and the interop HTML
2557
- * carrying the embedded fragment when the selection is a body-story range. A cell
2558
- * rectangle answers grid text plus a flattened table; `html` is null where only plain
2559
- * text should be written. Unsupported object selections return a refusal reason.
2665
+ * carrying the embedded fragment when the selection is a body-story range. A cell rectangle
2666
+ * answers grid text plus a flattened table; `html` is null where only plain text should be
2667
+ * written. A chart refuses as `'chart-content'`, another object as `'unsupported-content'`.
2560
2668
  */
2561
2669
  copyFlavours(): {
2562
2670
  readonly text: string;
2563
2671
  readonly html: string | null;
2564
- readonly reason?: 'unsupported-content';
2672
+ readonly reason?: 'unsupported-content' | 'chart-content';
2565
2673
  };
2566
2674
  /**
2567
2675
  * Route one paste payload by fidelity: embedded fragment, then external HTML, then
@@ -2591,7 +2699,7 @@ interface PaginatedSurface {
2591
2699
  *
2592
2700
  * @public
2593
2701
  */
2594
- setTableInteractionLabel(resolver: (key: 'table.insertRowBelow' | 'table.insertColumnRight') => string): void;
2702
+ setTableInteractionLabel(resolver: (key: TableInteractionLabelKey) => string): void;
2595
2703
  /**
2596
2704
  * Move the painted pages into `container`, which may belong to another document: a pop-out
2597
2705
  * window or an iframe. The session, undo history, selection and collaboration replica stay
@@ -3804,15 +3912,20 @@ declare function chromeSlotId(group: {
3804
3912
  * @public
3805
3913
  */
3806
3914
  declare function defaultChromeGroups(): readonly ChromeGroup[];
3915
+ /** Options for {@link formattingBarChromeGroups}. @public */
3916
+ interface FormattingBarOptions {
3917
+ /** Show `direction.ltr` and `direction.rtl` after alignment, as for a right-to-left UI. */
3918
+ readonly direction?: boolean;
3919
+ }
3807
3920
  /**
3808
- * The formatting-bar groups for one editor snapshot: the default bar, plus the
3809
- * contextual `image` group when a drawing is selected. Insertion without a selection
3810
- * lives in the packaged Insert menu (`CHROME_MENUS`), not in the bar — a host that wants
3811
- * a bar button places `DocxEditor.Toolbar.ImageInsert` itself.
3921
+ * The formatting-bar groups for one editor snapshot: the default bar, the contextual `image`
3922
+ * group when a drawing is selected, and the direction group when `options.direction` asks.
3923
+ * Insertion without a selection lives in the packaged Insert menu (`CHROME_MENUS`), not in
3924
+ * the bar — a host that wants a bar button places `DocxEditor.Toolbar.ImageInsert` itself.
3812
3925
  *
3813
3926
  * @public
3814
3927
  */
3815
- declare function formattingBarChromeGroups(image: ImageContext | null): readonly ChromeGroup[];
3928
+ declare function formattingBarChromeGroups(image: ImageContext | null, options?: FormattingBarOptions): readonly ChromeGroup[];
3816
3929
 
3817
3930
  /**
3818
3931
  * The menu bar the chrome shows above the toolbar, in bar order: File, Format, Insert, Review,
@@ -3854,8 +3967,7 @@ declare const DEFAULT_TABLE_CHROME_DRAFT: TableChromeDraft;
3854
3967
  type TableChromeSlotId = 'table.borderTarget' | 'table.borderColor' | 'table.borderStyle' | 'table.borderWidth' | 'table.cellFill';
3855
3968
  /** Every {@link TableChromeSlotId}, for iteration and for {@link isTableChromeSlot}. */
3856
3969
  declare const TABLE_CHROME_SLOT_IDS: readonly TableChromeSlotId[];
3857
- /** Furniture insertion controls (Task 8) share this label seam. */
3858
- type TableInteractionLabelKey = 'table.insertRowBelow' | 'table.insertColumnRight';
3970
+
3859
3971
  /**
3860
3972
  * The English label for a furniture-insertion control.
3861
3973
  *
@@ -3952,15 +4064,9 @@ declare function commandExecOptions(value: unknown): EditorExecOptions | undefin
3952
4064
  * command needs an argument the slot itself cannot supply.
3953
4065
  *
3954
4066
  * `text.link` is the case: whether this selection could become a link is the engine's
3955
- * question, but WHICH link is a URL field's. Chrome that owns a link UI (React's
3956
- * `ToolbarLink`) asks with this and dispatches through that UI.
3957
- *
3958
- * DELIBERATELY NOT in `SLOT_COMMANDS`. Enabled state has one source, and putting the probe
3959
- * there would enable the control in EVERY adapter — including Vue, which has grown no link
3960
- * UI, where the result is an enabled button whose click can only be refused. A dead button
3961
- * is the worse lie: `file.save` was a disabled control for a capability that works, and this
3962
- * would be an enabled control for one that is not reachable. Vue's slot therefore keeps
3963
- * reporting the honest "not wired to an editor command" until its popover lands.
4067
+ * question, but WHICH link is a URL field's. `toolbarCommandState` answers the slot from
4068
+ * this probe and from whether a link UI is registered, and `runToolbarCommand` opens that
4069
+ * UI, so chrome reads the slot like any other.
3964
4070
  *
3965
4071
  * @public
3966
4072
  */
@@ -4244,5 +4350,5 @@ interface ChromePrintJob {
4244
4350
  */
4245
4351
  declare function runChromePrint(editor: Pick<Editor, 'save'> & Partial<Pick<Editor, 'snapshot'>>, handlers?: ChromeExportHandlers, container?: Document | Element): Promise<ChromePrintJob>;
4246
4352
 
4247
- export { blankDocumentBytes as $, CHROME_GROUPS as C, bindHistoryGroup as _, chromeMenuSlots as a0, commandForSlot as a1, commandForSlotValue as a2, createDocxEditor as a3, createFontSource as a4, customFonts as a5, isChromePrintShortcut as a6, loadFonts as a7, runChromeExport as a8, runChromePrint as a9, TABLE_BORDER_STYLE_OPTIONS as aR, TABLE_BORDER_TARGET_OPTIONS as aS, TABLE_BORDER_WIDTH_OPTIONS as aT, TABLE_CHROME_SLOT_IDS as aU, runToolbarCommand as aa, toolbarCommandState as ab, CHROME_UNAVAILABLE_KEY as aj, DEFAULT_TABLE_CHROME_DRAFT as ap, EMU_PER_POINT as ar, IMAGE_OVERLAY_NUDGE_PT as aw, IMAGE_OVERLAY_NUDGE_SHIFT_PT as ax, applyTableChromePick as b3, canExecuteImageCommand as b4, captureImageMutationPreconditions as b5, chromeControlCount as b6, chromeProbeForSlot as b7, chromeSlotId as b8, chromeSlotIsToggle as b9, selectedImageStateOf as bA, surfacePaintScale as bB, tableChromeIconPaths as bC, tableChromeLabelKeyForTarget as bD, tableChromeToolbarState as bE, tableChromeVisible as bF, tableCommandToolbarState as bG, toolbarCommandStates as bH, commandExecOptions as ba, commandForTableChromeSlotValue as bb, computeImageResizeResult as bc, computeMovedImagePosition as bd, computeResizedImageExtentEmu as be, createImageOverlayScrollPort as bf, cssPixelsToLayoutPoints as bg, defaultChromeGroups as bh, defaultTableLabel as bi, emuToOverlayPoints as bj, equationAtPosition as bk, executeImageCommand as bl, finalizeImageOverlayInteraction as bm, formattingBarChromeGroups as bn, isStaleImageInteractionCommit as bo, isTableChromeSlot as bp, layoutPointsToCssPixels as bq, overlayFrameToSheetCssPixels as br, overlayHostOrigin as bs, pointsToEmu as bt, probeTableChromeCommand as bu, resizePreservesAspect as bv, runSave as bw, runTableChromeCommand as bx, runTableCommand as by, selectedDrawingOverlayTargetOf as bz, CHROME_MENUS as c, ChromeExportError as d, ChromePrintError as o };
4248
- export type { AttachOptions as A, BookmarkChromeHandlers as B, DocxEditorConfig as D, EquationActivation as E, FontLoadFailure as F, FontLoadFailureReason as G, FontMeasurementState as H, FontUrlSource as I, GoToChromeHandlers as J, HistoryGroupBinding as K, HistoryGroupBindingOptions as L, HyperlinkActivation as M, HyperlinkChromeHandlers as N, InvalidTextFormFieldChromeHandlers as O, InvalidTextFormFieldSession as P, LoadFontsRequest as Q, LoadFontsResult as R, LockedControlNavigation as S, PopupChromeRegistrationOptions as T, SurfaceEquation as U, SurfaceHyperlink as V, TableChromeSlotId as W, ToolbarCommandState as X, ToolbarValueMap as Y, ToolbarValueSlot as Z, BookmarkMarkInfo as a, TableInteractionLabelKey as a$, ImageResizeHandle as aA, ImageResizeResult as aB, OpeningIndicatorHost as aC, OverlayFrameRect as aD, PaginatedSurfaceState as aE, ParagraphPropertyEdit as aF, RemoteCaretLabelAnchor as aG, RemoteCaretLabelHost as aH, ReviewWriteIntent as aI, RunTableChromeCommandResult as aJ, SectionAnchor as aK, SectionBreakInsertType as aL, SelectedDrawingOverlayTarget as aM, SurfaceInsertImageInput as aN, SurfaceNavigation as aO, SurfaceOverlayCoordinates as aP, SurfaceParagraphFormat as aQ, TableBorderStyleOption as aV, TableBorderTargetOption as aW, TableBorderTargetValue as aX, TableBorderWidthOption as aY, TableChromeDraft as aZ, TableChromePick as a_, PaginatedSurfaceOptions as ac, OpenPaginatedResult as ad, PaginatedSurface as ae, TableCommandPlan as af, SurfaceFormatting as ag, AnchorFrameOrigin as ah, BookmarkMarkOptionsSource as ai, ChromeControl as ak, ChromeControlId as al, ChromeControlState as am, ChromeGroup as an, ChromeGroupId as ao, DrawingSelectionIntent as aq, EditorCommandExecute as as, EquationOps as at, FinalizedImageOverlayInteraction as au, HyperlinkOps as av, ImageInteractionSession as ay, ImageOverlayScrollPort as az, BookmarkMarkOptions as b, TextFormFieldChromeHandlers as b0, TextFormFieldDialogSession as b1, ToolbarSlotValue as b2, ChromeExportFormat as e, ChromeExportHandlers as f, ChromeExportResult as g, ChromeExportView as h, ChromeMenu as i, ChromeMenuEntry as j, ChromeMenuId as k, ChromeMenuItemEntry as l, ChromeMenuSeparatorEntry as m, ChromeMenuSubmenuEntry as n, ChromePrintErrorCode as p, ChromePrintJob as q, ChromePrintOptions as r, ChromeSlotId as s, CommentDraftChromeHandlers as t, ContentControlWidgetChromeHandlers as u, ContentControlWidgetSession as v, CustomFontsOptions as w, CustomFontsResolver as x, DocxEditorInstance as y, EquationChromeHandlers as z };
4353
+ export { bindHistoryGroup as $, CHROME_GROUPS as C, blankDocumentBytes as a0, chromeMenuSlots as a1, commandForSlot as a2, commandForSlotValue as a3, createDocxEditor as a4, createFontSource as a5, customFonts as a6, deferFonts as a7, isChromePrintShortcut as a8, loadFonts as a9, IMAGE_OVERLAY_NUDGE_SHIFT_PT as aA, TABLE_BORDER_STYLE_OPTIONS as aV, TABLE_BORDER_TARGET_OPTIONS as aW, TABLE_BORDER_WIDTH_OPTIONS as aX, TABLE_CHROME_SLOT_IDS as aY, runChromeExport as aa, runChromePrint as ab, runToolbarCommand as ac, toolbarCommandState as ad, CHROME_UNAVAILABLE_KEY as al, DEFAULT_TABLE_CHROME_DRAFT as ar, EMU_PER_POINT as at, IMAGE_OVERLAY_NUDGE_PT as az, applyTableChromePick as b7, canExecuteImageCommand as b8, captureImageMutationPreconditions as b9, runSave as bA, runTableChromeCommand as bB, runTableCommand as bC, selectedDrawingOverlayTargetOf as bD, selectedImageStateOf as bE, surfacePaintScale as bF, tableChromeIconPaths as bG, tableChromeLabelKeyForTarget as bH, tableChromeToolbarState as bI, tableChromeVisible as bJ, tableCommandToolbarState as bK, toolbarCommandStates as bL, chromeControlCount as ba, chromeProbeForSlot as bb, chromeSlotId as bc, chromeSlotIsToggle as bd, commandExecOptions as be, commandForTableChromeSlotValue as bf, computeImageResizeResult as bg, computeMovedImagePosition as bh, computeResizedImageExtentEmu as bi, createImageOverlayScrollPort as bj, cssPixelsToLayoutPoints as bk, defaultChromeGroups as bl, defaultTableLabel as bm, emuToOverlayPoints as bn, equationAtPosition as bo, executeImageCommand as bp, finalizeImageOverlayInteraction as bq, formattingBarChromeGroups as br, isStaleImageInteractionCommit as bs, isTableChromeSlot as bt, layoutPointsToCssPixels as bu, overlayFrameToSheetCssPixels as bv, overlayHostOrigin as bw, pointsToEmu as bx, probeTableChromeCommand as by, resizePreservesAspect as bz, CHROME_MENUS as d, ChromeExportError as e, ChromePrintError as p };
4354
+ export type { AttachOptions as A, BlankDocumentOptions as B, DocxEditorConfig as D, EquationActivation as E, EquationChromeHandlers as F, FontLoadFailure as G, FontLoadFailureReason as H, FontMeasurementState as I, FontUrlSource as J, GoToChromeHandlers as K, HistoryGroupBinding as L, HistoryGroupBindingOptions as M, HyperlinkActivation as N, HyperlinkChromeHandlers as O, InvalidTextFormFieldChromeHandlers as P, InvalidTextFormFieldSession as Q, LoadFontsRequest as R, LoadFontsResult as S, LockedControlNavigation as T, PopupChromeRegistrationOptions as U, SurfaceEquation as V, SurfaceHyperlink as W, TableChromeSlotId as X, ToolbarCommandState as Y, ToolbarValueMap as Z, ToolbarValueSlot as _, BookmarkChromeHandlers as a, TableBorderTargetValue as a$, ImageInteractionSession as aB, ImageOverlayScrollPort as aC, ImageResizeHandle as aD, ImageResizeResult as aE, OpeningIndicatorHost as aF, OverlayFrameRect as aG, PaginatedSurfaceState as aH, ParagraphPropertyEdit as aI, RemoteCaretLabelAnchor as aJ, RemoteCaretLabelHost as aK, ReviewWriteIntent as aL, RunTableChromeCommandResult as aM, SectionAnchor as aN, SectionBreakInsertType as aO, SelectedDrawingOverlayTarget as aP, SurfaceIndentAndListOps as aQ, SurfaceInsertImageInput as aR, SurfaceNavigation as aS, SurfaceOverlayCoordinates as aT, SurfaceParagraphFormat as aU, TableBorderStyleOption as aZ, TableBorderTargetOption as a_, PaginatedSurfaceOptions as ae, OpenPaginatedResult as af, PaginatedSurface as ag, TableCommandPlan as ah, SurfaceFormatting as ai, AnchorFrameOrigin as aj, BookmarkMarkOptionsSource as ak, ChromeControl as am, ChromeControlId as an, ChromeControlState as ao, ChromeGroup as ap, ChromeGroupId as aq, DrawingSelectionIntent as as, EditorCommandExecute as au, EquationOps as av, FinalizedImageOverlayInteraction as aw, FormattingBarOptions as ax, HyperlinkOps as ay, BookmarkMarkInfo as b, TableBorderWidthOption as b0, TableChromeDraft as b1, TableChromePick as b2, TextFormFieldChromeHandlers as b3, TextFormFieldDialogSession as b4, TocRemovalRefusal as b5, ToolbarSlotValue as b6, BookmarkMarkOptions as c, ChromeExportFormat as f, ChromeExportHandlers as g, ChromeExportResult as h, ChromeExportView as i, ChromeMenu as j, ChromeMenuEntry as k, ChromeMenuId as l, ChromeMenuItemEntry as m, ChromeMenuSeparatorEntry as n, ChromeMenuSubmenuEntry as o, ChromePrintErrorCode as q, ChromePrintJob as r, ChromePrintOptions as s, ChromeSlotId as t, CommentDraftChromeHandlers as u, ContentControlWidgetChromeHandlers as v, ContentControlWidgetSession as w, CustomFontsOptions as x, CustomFontsResolver as y, DocxEditorInstance as z };
@@ -0,0 +1 @@
1
+ 'use strict';var chunkA5BTVPET_cjs=require('./chunk-A5BTVPET.cjs');var K=new Set(["document","hdr","ftr","footnotes","endnotes"]),rr=24,H=512,z=chunkA5BTVPET_cjs.Eb(rr);function G(t){let n=t.root;return n.namespaceUri===chunkA5BTVPET_cjs.pa&&K.has(n.localName)}function tr(t){let n=[],e=r=>{if(r.kind!=="textValue"){r.namespaceUri===chunkA5BTVPET_cjs.pa&&r.localName==="p"&&n.push(r);for(let a of r.children)e(a);}};return e(t.root),n}function X(t){let n=chunkA5BTVPET_cjs.Ob(t);let e=[],r=new Set;for(let a of tr(n)){let i=chunkA5BTVPET_cjs.Gb(a);if(!i||!chunkA5BTVPET_cjs.Fb(i))continue;let o=i.toUpperCase();if(r.has(o))continue;r.add(o);let l=chunkA5BTVPET_cjs.Dm(n,a.id);l!==null&&e.push(Object.freeze({paragraphId:o,nodeId:a.id,text:l}));}return Object.freeze(e)}function er(t){let n=z.get(t.root);if(n)return n;let e=W(t,"byParagraphId");return z.set(t.root,e),e}function W(t,n){let e=chunkA5BTVPET_cjs.Ob(t);let r=new Map,a=new Set,i=o=>{if(o.kind!=="textValue"){if(o.namespaceUri===chunkA5BTVPET_cjs.pa&&o.localName==="p"){let l=chunkA5BTVPET_cjs.Gb(o);if(l&&chunkA5BTVPET_cjs.Fb(l)){let s=l.toUpperCase();a.has(s)||(a.add(s),o.kind==="paragraph"&&(n==="byParagraphId"?r.set(s,o.id):r.set(o.id,s)));}}for(let l of o.children)i(l);}};return i(e.root),r}function V(t,n){if(t.length!==n.length)return false;for(let e=0;e<t.length;e+=1)if(t[e].root!==n[e])return false;return true}function $(t){let n=new Map,e=null,r=(o,l,s)=>{for(n.delete(o),n.set(o,{partName:l.name,root:l.root,nodeId:s});n.size>H;){let d=n.keys().next();if(d.done)break;n.delete(d.value);}},a=(o,l)=>{let s=n.get(o);if(!s)return null;let d=l.find(k=>k.name===s.partName);if(!d)return null;if(d.root===s.root)return {part:d,nodeId:s.nodeId};let u=chunkA5BTVPET_cjs.cb(d,s.nodeId);if(!u||u.kind!=="paragraph")return null;let x=chunkA5BTVPET_cjs.Gb(u);return !x||x.toUpperCase()!==o?null:(r(o,d,s.nodeId),{part:d,nodeId:s.nodeId})};return Object.assign(o=>{let l=t(),s=a(o,l);if(s)return s;if(e&&e.ids.has(o)&&V(l,e.roots))return null;for(let d of l){let u=er(d).get(o);if(u!==void 0)return r(o,d,u),{part:d,nodeId:u}}return (!e||!V(l,e.roots))&&(e={roots:l.map(d=>d.root),ids:new Set}),e.ids.size<H&&e.ids.add(o),null},{forgetIds(o){for(let{paragraphId:l,nodeId:s}of o)n.get(l)?.nodeId!==s&&n.delete(l);},forgetAll(){n.clear();},hasHints(){return n.size>0}})}function Y(t,n,e){if(!t.hasHints())return;let r=[...e.dirty,...e.created];if(e.impact!=="text-local"||r.length===0)return t.forgetAll();let a=[];for(let i of r){let o=n.find(d=>i.startsWith(`${d.name}#`)),l=o?chunkA5BTVPET_cjs.cb(o,i):null,s=l?.kind==="paragraph"?chunkA5BTVPET_cjs.Gb(l):null;if(!s)return t.forgetAll();a.push({paragraphId:s.toUpperCase(),nodeId:i});}t.forgetIds(a);}function q(t){let n=null;return e=>{let r=t();n?.root!==r.root&&(n={root:r.root,byNodeId:W(r,"byNodeId")});let a=n.byNodeId.get(e);if(a===void 0)return null;let i=chunkA5BTVPET_cjs.Dm(r,e);return i===null?null:Object.freeze({paragraphId:a,nodeId:e,text:i})}}function Z(t,n){return chunkA5BTVPET_cjs.Ua(t,n)}var or=Object.freeze({kind:"body"}),ar=1e6;function A(t,n){if(n<=0||n>=t.length)return false;let e=t.charCodeAt(n-1),r=t.charCodeAt(n);return e>=55296&&e<=56319&&r>=56320&&r<=57343}function ir(t,n,e){if(n===e)return [];let r=0,a=Math.min(n.length,e.length);for(;r<a&&n.charCodeAt(r)===e.charCodeAt(r);)r+=1;for(;r>0&&(A(n,r)||A(e,r));)r-=1;let i=0;for(;i<n.length-r&&i<e.length-r&&n.charCodeAt(n.length-i-1)===e.charCodeAt(e.length-i-1);)i+=1;for(;i>0&&(A(n,n.length-i)||A(e,e.length-i));)i-=1;let o=n.length-r-i,l=e.slice(r,e.length-i),s=[];return o>0&&s.push({op:"deleteText",paragraphId:t,start:r,end:r+o}),l.length>0&&s.push({op:"insertText",paragraphId:t,offset:r,text:l}),Object.freeze(s)}function lr(t){let n=r=>!!r&&r.kind!=="textValue"&&r.namespaceUri===chunkA5BTVPET_cjs.pa&&r.localName==="t"&&r.attributes.every(a=>a.namespaceUri===chunkA5BTVPET_cjs.qa&&a.localName==="space")&&r.children.every(a=>a.kind==="textValue"),e=[];for(let r of t){let a=e.at(-1);if(!n(a)||!n(r)){e.push(r);continue}let i=a.children.map(o=>o.kind==="textValue"?o.value:"").join("")+r.children.map(o=>o.kind==="textValue"?o.value:"").join("");e[e.length-1]={...a,attributes:/^\s|\s$/.test(i)?[{kind:"xmlSpace",namespaceUri:chunkA5BTVPET_cjs.qa,localName:"space",prefix:"xml",value:"preserve"}]:[],children:[{id:a.children[0]?.id??`${a.id}/text`,kind:"textValue",value:i}]};}return e}function F(t){if(t.kind==="textValue")return t;let n=false,e=t.children.map(r=>{let a=F(r);return a!==r&&(n=true),a});if(t.namespaceUri===chunkA5BTVPET_cjs.pa&&t.localName==="r"){let r=lr(e);(r.length!==e.length||r.some((a,i)=>a!==e[i]))&&(e=[...r],n=true);}return n?{...t,children:e}:t}function sr(t,n,e){let r=t.parts.get(n);if(!r)return t;let a=false,i=new Set;for(let o of e)(o.op==="insertText"||o.op==="deleteText")&&!o.revision&&i.add(o.paragraphId);for(let o of i){let l=chunkA5BTVPET_cjs.cb(r,o);if(!l||l.kind==="textValue")continue;let s=F(l);if(s===l)continue;let d=chunkA5BTVPET_cjs.ib(r,o,s,{deferValidation:true});d.ok&&(r=d.part,a=true);}return a?chunkA5BTVPET_cjs.kg(t,r):t}function dr(t,n){let e=n.documentId.trim();if(e.length===0||e.length>256)throw new TypeError("documentId must contain 1 to 256 characters");let r=()=>X(t.bodyStore().part),a,i=()=>{let p=t.bodyStore().part,c=t.currentPackage();if(a?.pkg===c&&a.body===p)return a.parts;let g=[p];for(let m of c.parts.values())m===p||!G(m)||g.push(m);return a={pkg:c,body:p,parts:Object.freeze(g)},a.parts},o=$(i),l=t.packageRevision,s=t.lastModelChange,d=()=>{let p=t.packageRevision,c=t.lastModelChange;p===l&&c===s||(p===l+1&&c!==null&&c!==s?Y(o,i(),c):o.forgetAll(),l=p,s=c);},u=q(()=>t.bodyStore().part),x=(p,c)=>{if(p.length===0)return {ok:true,changed:false};let g=r(),m=new Set,O=[];for(let h of p){if(typeof h.text!="string"||h.text.length>ar)return {ok:false,reason:"collaboration-text-limit"};if(typeof h.paragraphId!="string"||h.paragraphId.length===0||h.paragraphId.length>256)return {ok:false,reason:"unknown-paragraph-id"};let f=h.paragraphId.toUpperCase();if(m.has(f))return {ok:false,reason:"duplicate-paragraph-id"};m.add(f);let D=g.filter(Q=>Q.paragraphId===f);if(D.length!==1)return {ok:false,reason:"unknown-paragraph-id"};let w=D[0];O.push(...ir(w.nodeId,w.text,h.text));}if(O.length===0)return {ok:true,changed:false};let v=t.transact(or,h=>{for(let f of O)h.apply(f);h.applyPackage(f=>sr(f,f.mainDocumentPart,O));},{origin:c.origin,actorId:c.actorId,operationId:c.operationId,recordsHistory:false});return v.ok?{ok:true,changed:v.change!==null}:{ok:false,reason:v.detail??v.reason}},k={documentId:e,interactive:n.interactive===true,paragraphs:r,paragraphByNodeId:u,paragraphTextOf(p){for(let c of i()){let g=chunkA5BTVPET_cjs.Dm(c,p);if(g!==null)return g}return null},paragraphByStableId(p){let c=p.toUpperCase();d();let g=o(c);if(!g)return null;let m=chunkA5BTVPET_cjs.Dm(g.part,g.nodeId);return m===null?null:Object.freeze({paragraphId:c,nodeId:g.nodeId,text:m})},applyParagraphText(p,c,g){return x([{paragraphId:p,text:c}],g)},applyParagraphTexts:x,applyRemotePackage(p,c){let g=t.publishRemotePackage(p,c);return g.ok?{ok:true,changed:g.change!==null}:{ok:false,reason:g.detail??g.reason}},revision:()=>t.packageRevision,subscribe:p=>t.subscribe(p),observePrimitiveJournal:p=>Z(t,p),hasPendingJournals:()=>chunkA5BTVPET_cjs.Ra(t),flushPendingJournals:()=>{chunkA5BTVPET_cjs.Sa(t);},save:()=>chunkA5BTVPET_cjs.ig(t.currentPackage()),binaryPart(p){let c=t.currentPackage();return c.partBytes.get(p)??c.partBytes.get(p.startsWith("/")?p.slice(1):`/${p}`)??null}};return Object.freeze(k)}function pr(t,n,e){if(n===e||t>n.length)return Math.min(t,e.length);let r=0;for(;r<n.length&&r<e.length&&n[r]===e[r];)r+=1;let a=0;for(;a<n.length-r&&a<e.length-r&&n[n.length-1-a]===e[e.length-1-a];)a+=1;if(t<=r)return Math.min(t,e.length);if(t>n.length-a)return Math.min(e.length,t+e.length-n.length);let i=ur(n,e,r,a),o=i.offsets.get(t);return o===void 0&&(o=(i.table?mr(i.table,t,n,e,r):null)??yr(t,n,e,r,a)??r,i.offsets.set(t,o)),o}var b=[],cr=16;function ur(t,n,e,r){let a=b.findIndex(o=>o.before===t&&o.after===n);if(a>=0){let[o]=b.splice(a,1);return b.push(o),o}let i={before:t,after:n,table:hr(t,n,e,r),offsets:new Map};return b.length>=cr&&b.shift(),b.push(i),i}var gr=1<<18;function hr(t,n,e,r){let a=t.length-r-e,i=n.length-r-e;if(a*i>gr)return null;let o=i+1,l=new Uint32Array((a+1)*o);for(let s=a-1;s>=0;s-=1)for(let d=i-1;d>=0;d-=1)l[s*o+d]=t[e+s]===n[e+d]?l[(s+1)*o+d+1]+1:Math.max(l[(s+1)*o+d],l[s*o+d+1]);return {lengths:l,width:o,columns:i}}function mr(t,n,e,r,a){let{lengths:i,width:o,columns:l}=t,s=n-a,d=0,u=0;for(;d<s;)u<l&&e[a+d]===r[a+u]?(d+=1,u+=1):u>=l||i[(d+1)*o+u]>=i[d*o+u+1]?d+=1:u+=1;return a+u}var fr=[32,16,8,4];function yr(t,n,e,r,a){let i=e.slice(r,e.length-a),o=l=>{let s=i.indexOf(l);return s>=0&&i.indexOf(l,s+1)<0?s:null};for(let l of fr){let s=n.slice(Math.max(r,t-l),t);if(s.length===l){let u=o(s);if(u!==null)return r+u+s.length}let d=n.slice(t,Math.min(n.length-a,t+l));if(d.length===l){let u=o(d);if(u!==null)return r+u}}return null}exports.a=sr;exports.b=dr;exports.c=pr;