@docx-editor.dev/core 2.30.0 → 2.32.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 (133) hide show
  1. package/README.md +24 -0
  2. package/dist/automation.cjs +1 -1
  3. package/dist/automation.d.ts +18 -27
  4. package/dist/automation.js +1 -1
  5. package/dist/binding.cjs +1 -1
  6. package/dist/binding.d.ts +17 -16
  7. package/dist/binding.js +1 -1
  8. package/dist/bookmark-names-DDuAra_V.d.ts +37 -0
  9. package/dist/{chrome-print-BM3Js-6X.d.ts → chrome-print-CznJ0ucN.d.ts} +361 -41
  10. package/dist/chunk-25EXMBV2.cjs +5 -0
  11. package/dist/chunk-2CWQY27B.cjs +1 -0
  12. package/dist/chunk-3IEXDEFH.cjs +7 -0
  13. package/dist/chunk-65XBN67F.cjs +2 -0
  14. package/dist/chunk-6NVZNB7O.cjs +3 -0
  15. package/dist/chunk-6UDJUI3W.cjs +2 -0
  16. package/dist/chunk-ACLR4DMK.js +1 -0
  17. package/dist/{chunk-RJCQGJR7.js → chunk-B2BEELUE.js} +1 -1
  18. package/dist/chunk-DDFHKQFU.js +30 -0
  19. package/dist/chunk-E4IAO4CY.cjs +2 -0
  20. package/dist/chunk-ETDZFNMI.js +2 -0
  21. package/dist/chunk-FDSL5OJU.cjs +30 -0
  22. package/dist/chunk-FS7CMYLT.js +4 -0
  23. package/dist/chunk-GDS24SZN.js +30 -0
  24. package/dist/chunk-GIY6NT2X.js +5 -0
  25. package/dist/chunk-GWM3AKUD.js +18 -0
  26. package/dist/chunk-HDOXACHP.js +2 -0
  27. package/dist/chunk-IILEENID.js +1 -0
  28. package/dist/chunk-L5TYBFDB.js +1 -0
  29. package/dist/chunk-MNF2K7NN.cjs +30 -0
  30. package/dist/chunk-O324RB6R.cjs +1 -0
  31. package/dist/chunk-OKMEMSKB.cjs +1 -0
  32. package/dist/chunk-QXJKYNYZ.js +1 -0
  33. package/dist/chunk-RALTVLB6.js +2 -0
  34. package/dist/chunk-SRVKFUFI.js +3 -0
  35. package/dist/chunk-TELQ52LG.cjs +1 -0
  36. package/dist/chunk-TJHE5EET.cjs +1 -0
  37. package/dist/chunk-UMMRURPE.js +7 -0
  38. package/dist/chunk-WN7ICTA5.js +1 -0
  39. package/dist/{chunk-FLBEJC6X.cjs → chunk-XJYZVGQR.cjs} +1 -1
  40. package/dist/chunk-ZGTIE3QJ.cjs +4 -0
  41. package/dist/chunk-ZOZI27AW.cjs +18 -0
  42. package/dist/collaboration/replication.cjs +1 -1
  43. package/dist/collaboration/replication.d.ts +20 -5
  44. package/dist/collaboration/replication.js +1 -1
  45. package/dist/collaboration.cjs +1 -1
  46. package/dist/collaboration.d.ts +5 -6
  47. package/dist/collaboration.js +1 -1
  48. package/dist/contracts/document.d.ts +3 -3
  49. package/dist/contracts/editor.d.ts +13 -10
  50. package/dist/contracts/interaction.d.ts +2 -2
  51. package/dist/contracts/modules.d.ts +15 -13
  52. package/dist/contracts/types.d.ts +135 -2
  53. package/dist/{custom-node-writes-0v0Kgw1T.d.ts → custom-node-writes-CLJKGD9t.d.ts} +7 -2
  54. package/dist/{diagnostic-context-CcAO4q1s.d.ts → diagnostic-context-BtDUY3v2.d.ts} +3 -2
  55. package/dist/{diagnostic-hints-2Bke6H_w.d.ts → diagnostic-hints-DK8-V0fk.d.ts} +2 -2
  56. package/dist/{document-protection-8eyMWIJ0.d.ts → document-protection-NaniLHWF.d.ts} +1 -1
  57. package/dist/{editor-DaEJd2so.d.ts → editor-DZwOTmlR.d.ts} +386 -279
  58. package/dist/editor-fonts-D_-vjuJi.d.ts +53 -0
  59. package/dist/{editor-scope-7o9xweiJ.d.ts → editor-scope-B3L-1ALc.d.ts} +57 -4
  60. package/dist/editor.cjs +1 -1
  61. package/dist/editor.css +6 -4
  62. package/dist/editor.d.ts +646 -31
  63. package/dist/editor.js +1 -1
  64. package/dist/export.cjs +2 -2
  65. package/dist/export.d.ts +9 -16
  66. package/dist/export.js +2 -2
  67. package/dist/{failure-NS2lsya4.d.ts → failure-6KGFrDO9.d.ts} +1 -1
  68. package/dist/{font-resolver-CL9BVKZo.d.ts → font-resolver-BlQNGdvR.d.ts} +1 -1
  69. package/dist/{headless-document-view-DZQN8Bnx.d.ts → headless-document-view-Bcz9_Qva.d.ts} +115 -4
  70. package/dist/index.cjs +1 -1
  71. package/dist/index.d.ts +27 -26
  72. package/dist/index.js +1 -1
  73. package/dist/{layout-shaping-cEnVrhWg.d.ts → layout-shaping-E5J4Z1Gf.d.ts} +1 -1
  74. package/dist/layout.cjs +1 -1
  75. package/dist/layout.d.ts +95 -23
  76. package/dist/layout.js +1 -1
  77. package/dist/{note-properties-9FH8zAeG.d.ts → note-properties-Ds5R2_3F.d.ts} +1 -1
  78. package/dist/output.cjs +1 -1
  79. package/dist/output.d.ts +24 -10
  80. package/dist/output.js +1 -1
  81. package/dist/{protocol-CZ1uUlPO.d.ts → protocol-DKa4qt7F.d.ts} +167 -5
  82. package/dist/{review-paragraph-order-CqVelc5A.d.ts → review-paragraph-order-Dc17w_6v.d.ts} +1 -1
  83. package/dist/revision-projection-Cn6rZJ7H.d.ts +258 -0
  84. package/dist/{semantic-cell-selection-Dr9yxFZt.d.ts → semantic-cell-selection-BaUR0iJ4.d.ts} +2 -2
  85. package/dist/{semantic-interaction-Dc3pf3hr.d.ts → semantic-interaction-CJoHLoOl.d.ts} +1 -1
  86. package/dist/{semantic-paint-Bz3FBAoH.d.ts → semantic-paint-BPw_n0li.d.ts} +7 -4
  87. package/dist/{semantic-record-queries-Bx0pl6kL.d.ts → semantic-record-queries-C0rJ3sB4.d.ts} +1 -1
  88. package/dist/{semantic-records-CjcF26ZL.d.ts → semantic-records-BvN-WWst.d.ts} +365 -512
  89. package/dist/store.cjs +1 -1
  90. package/dist/store.d.ts +47 -22
  91. package/dist/store.js +1 -1
  92. package/dist/{types-barrel-CA0xB8kH.d.ts → tree-op-types-C_S2niXW.d.ts} +1239 -747
  93. package/dist/{tree-package-store-DKhdEVym.d.ts → tree-package-store-CRHvMyNj.d.ts} +676 -646
  94. package/dist/{tree-session-contract-CwnTEVLF.d.ts → tree-session-contract-D1awo_dA.d.ts} +26 -13
  95. package/dist/unsupported-elements-CVos5cqe.d.ts +23 -0
  96. package/docs/accept-reject-without-scrolling.md +95 -0
  97. package/docs/comment-on-found-text.md +72 -0
  98. package/docs/custom-review-cards.md +178 -0
  99. package/docs/highlight-ranges.md +48 -0
  100. package/docs/index.md +36 -0
  101. package/docs/propose-rewrite.md +247 -0
  102. package/docs/tracked-replacement.md +68 -0
  103. package/package.json +3 -2
  104. package/dist/chunk-2PV5L5NJ.js +0 -5
  105. package/dist/chunk-5OTS2EJ7.js +0 -7
  106. package/dist/chunk-5P4223J4.cjs +0 -27
  107. package/dist/chunk-5RRAZMBU.cjs +0 -1
  108. package/dist/chunk-5SPITS5F.js +0 -18
  109. package/dist/chunk-6JIJOZDW.js +0 -1
  110. package/dist/chunk-7ATNKARV.js +0 -2
  111. package/dist/chunk-BGCUTKWE.cjs +0 -5
  112. package/dist/chunk-BTQKU64Q.cjs +0 -1
  113. package/dist/chunk-EBCXSH2W.js +0 -3
  114. package/dist/chunk-ERECKTIR.cjs +0 -2
  115. package/dist/chunk-HYASLE2G.cjs +0 -1
  116. package/dist/chunk-JC47NRJC.cjs +0 -3
  117. package/dist/chunk-KJRTNY2Q.cjs +0 -2
  118. package/dist/chunk-NKPUH3QJ.js +0 -1
  119. package/dist/chunk-PF5NJWS3.js +0 -2
  120. package/dist/chunk-PWTRJSES.cjs +0 -18
  121. package/dist/chunk-QFKGI242.cjs +0 -30
  122. package/dist/chunk-RPPV4S6T.cjs +0 -4
  123. package/dist/chunk-T32MGBJS.js +0 -1
  124. package/dist/chunk-UM26GH5B.js +0 -30
  125. package/dist/chunk-VRCZBFLH.js +0 -27
  126. package/dist/chunk-WF7JZ755.cjs +0 -1
  127. package/dist/chunk-WK5X2MMA.cjs +0 -7
  128. package/dist/chunk-WPDD2Y32.js +0 -2
  129. package/dist/chunk-YBMWBXST.cjs +0 -2
  130. package/dist/chunk-YZGUBCHP.js +0 -1
  131. package/dist/chunk-ZOS2PM4A.js +0 -4
  132. package/dist/image-resources-Bipz8toD.d.ts +0 -211
  133. package/dist/omml-equation-DP2WpUbK.d.ts +0 -97
@@ -1,20 +1,22 @@
1
- import { c as FontConfigurationFragment, g as FontResolver, M as MarkedFontResolver, f as FontResolutionRequest } from './font-resolver-CL9BVKZo.js';
2
- import { q as DocumentSource, Q as FontConfiguration, aN as ZoomMode, z as EditorFontError, t as Editor, R as ReviewPaneOptions, b as EditorCommand, C as CanResult, au as SelectedImageState, Y as FormatPainterSurfaceState, as as ScrollPlacement, aL as TrackedChangePredicate, aK as TrackedChangeFilterMode, S as FontFaceRequest, U as FontSource, a7 as ImageContext, ay as TableBorderEdgeTarget, az as TableBorderSpec, aA as TableBorderStyle, aF as TableContext } from './editor-DaEJd2so.js';
3
- import { V as ViewScope, a as EditorExecOptions } from './editor-scope-7o9xweiJ.js';
4
- import { ag as TreeDocOp, aN as TextFormFieldRange, aO as TextFormFieldOptions, ae as Unsubscribe, E as ExecResult, _ as DrawingPositionInput, aP as DrawingTransform, A as ParagraphTabStop, y as IndentFormatting, z as ParagraphFlags, a4 as ParagraphDisagreements, az as DrawingTreeDocOp, ab as SelectionPin, Q as OoxmlPackage, g as ReviewRevisionKind, a1 as ImageWrapTarget } from './types-barrel-CA0xB8kH.js';
5
- import { c as ImageDecodePort, S as SupportedImageMime } from './image-resources-Bipz8toD.js';
6
- import { T as TextMeasurer, a as ReviewDisplayMode, q as ResolvedRevisionMarkup, t as RevisionMarkupOptions, z as RevisionMarkupChromeHandlers, S as SemanticLayout, C as ContentControlBoundaryRecord, O as SectionProperties } from './semantic-records-CjcF26ZL.js';
7
- import { F as FieldResultsMode, C as ContentLockPolicy, I as InsertImageInput, S as StoryScope, A as ApplyImagePropertiesInput, i as ImageIntentResult } from './tree-package-store-DKhdEVym.js';
1
+ import { c as FontConfigurationFragment, g as FontResolver, M as MarkedFontResolver, f as FontResolutionRequest } from './font-resolver-BlQNGdvR.js';
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';
9
+ import { ReviewPaneOptions } from './contracts/types.js';
8
10
  import { F as FontShapingOptions } from './font-shaping-policy-BvpkrfxM.js';
9
- import { F as FieldShadingMode, d as RevisionStyles, f as DrawingPaintStrings, R as ReviewAuthorInfo, c as RevisionAuthorStyle } from './semantic-paint-Bz3FBAoH.js';
11
+ import { F as FieldShadingMode, c as RevisionStyles, f as DrawingPaintStrings, R as ReviewAuthorInfo, b as RevisionAuthorStyle } from './semantic-paint-BPw_n0li.js';
10
12
  import { ReviewModuleContribution, EditorModule } from './contracts/modules.js';
11
- import { S as SemanticPosition, a as SemanticSelection, N as NavigationCommand } from './semantic-interaction-Dc3pf3hr.js';
13
+ import { S as SemanticPosition, a as SemanticSelection, N as NavigationCommand } from './semantic-interaction-CJoHLoOl.js';
12
14
  import { CollaborationModuleContribution, EditorCollaborationSession, CollaborationRemoteSelection } from './collaboration.js';
13
- import { R as ResolvedFootnoteProperties, a as ResolvedEndnoteProperties, A as AuthoredNoteProperties } from './note-properties-9FH8zAeG.js';
14
- import { B as BookmarkIndex } from './custom-node-writes-0v0Kgw1T.js';
15
- import { C as CellSelection } from './semantic-cell-selection-Dr9yxFZt.js';
16
- import { T as TreeDocxSessionView, a as TreeApplyResult } from './tree-session-contract-CwnTEVLF.js';
17
- import { C as CollaborationStatus } from './failure-NS2lsya4.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';
19
+ import { a as CollaborationStatus } from './failure-6KGFrDO9.js';
18
20
 
19
21
  /**
20
22
  * A blank document, freshly zipped per call (the caller may hand the
@@ -259,10 +261,18 @@ interface HyperlinkActivation {
259
261
  */
260
262
  interface SurfaceNavigation {
261
263
  /** Snap to a semantic position using layout geometry, then place the caret there. */
264
+ /**
265
+ * With `orShow`, a story that cannot be opened is scrolled to without moving the caret into
266
+ * it, and the answer is `'shown'`. With `center`, the target is centered in the viewport
267
+ * unless it is already well inside it, so it never lands under chrome at the top edge.
268
+ */
262
269
  goToPosition(position: {
263
270
  paragraphId: string;
264
271
  offset: number;
265
- }): boolean;
272
+ }, options?: {
273
+ readonly orShow?: boolean;
274
+ readonly center?: boolean;
275
+ }): boolean | 'shown';
266
276
  /**
267
277
  * Scroll a bookmark into view and place the caret at it. Answers false for a name no
268
278
  * bookmark declares — an inert click, which is what Word does with a dangling anchor.
@@ -276,6 +286,19 @@ interface SurfaceNavigation {
276
286
  destroy(): void;
277
287
  }
278
288
 
289
+ /**
290
+ * The surface's view of the mark options.
291
+ *
292
+ * @public
293
+ */
294
+ interface BookmarkMarkOptionsSource {
295
+ readonly current: () => BookmarkMarkOptions;
296
+ /** Name the repaint to run when the options change. One slot: a remount replaces it. */
297
+ readonly onChange: (repaint: (() => void) | null) => void;
298
+ /** Report an error a host callback threw while marks were painted. */
299
+ readonly reportError: (error: unknown) => void;
300
+ }
301
+
279
302
  /**
280
303
  * How the caret moves through an inline content control whose effective lock is
281
304
  * `contentLocked` or `sdtContentLocked`.
@@ -324,6 +347,14 @@ interface PaginatedSurfaceOptions {
324
347
  readonly author?: string;
325
348
  /** Opening mode; changeable at runtime with `setEditingMode`. */
326
349
  readonly editingMode?: SurfaceEditingMode;
350
+ /**
351
+ * True while the active band covers both halves of a replacement: when the review UI lists
352
+ * a replacement as one card, or while an activation of the whole replacement holds. Read
353
+ * on each band paint. Set by the editor; a host changes `revisionsIn` instead.
354
+ *
355
+ * @internal
356
+ */
357
+ readonly pairsReplacements?: () => boolean;
327
358
  /**
328
359
  * Identifies the measurer for cache invalidation.
329
360
  *
@@ -363,6 +394,8 @@ interface PaginatedSurfaceOptions {
363
394
  /** Show paragraph-end furniture without changing document content. */
364
395
  readonly showParagraphMarks?: boolean;
365
396
  readonly onToggleParagraphMarks?: () => void;
397
+ /** Show bracket marks at bookmarks. Paint-level; the document does not change. */
398
+ readonly showBookmarks?: boolean;
366
399
  /**
367
400
  * How tracked changes are coloured: by AUTHOR (the default), by kind, or by author with
368
401
  * host-pinned colours. A paint-level option like {@link fieldShading}: it changes no
@@ -370,6 +403,7 @@ interface PaginatedSurfaceOptions {
370
403
  * revision markup paints, whatever the {@link revisionDisplayMode} leaves visible.
371
404
  */
372
405
  readonly revisionStyles?: RevisionStyles;
406
+ readonly unsupportedElementRules?: readonly UnsupportedElementRule[];
373
407
  readonly revisionMarkup?: ResolvedRevisionMarkup;
374
408
  /**
375
409
  * The review module's derivation hooks for this surface's session. Absent,
@@ -407,6 +441,12 @@ interface PaginatedSurfaceOptions {
407
441
  * maps it to a public code before it reports anything.
408
442
  */
409
443
  readonly onRejection?: (reason: string) => void;
444
+ /**
445
+ * The pages turned up in another document without a `moveTo`: a host moved the mount
446
+ * element itself (a Vue `Teleport` retargeted, or a plain `appendChild`). The surface has
447
+ * already re-bound its own listeners; the owner re-registers what is per document.
448
+ */
449
+ readonly onHostMoved?: (document: Document) => void;
410
450
  /**
411
451
  * Told the milliseconds of each layout pass and each paint. For `'input'`, told the browser
412
452
  * timestamp of each key press or pointer press on the pages, so a listener can time it to
@@ -433,6 +473,18 @@ interface PaginatedSurfaceOptions {
433
473
  * rather than doing something surprising with it.
434
474
  */
435
475
  readonly onRequestHyperlink?: () => void;
476
+ /**
477
+ * Ctrl/Cmd+Shift+F5: open the host's bookmark dialog. Answers whether chrome took the
478
+ * request; when none did, or when this is absent, the key is left to the browser.
479
+ */
480
+ readonly onRequestBookmark?: () => boolean;
481
+ /** Ctrl+G (Cmd+Option+G on macOS): open the host's Go To UI; answers whether chrome took it. */
482
+ readonly onRequestGoTo?: () => boolean;
483
+ /**
484
+ * The host's Show bookmarks options, read on every paint. `onChange` names the repaint to
485
+ * run when the host changes them.
486
+ */
487
+ readonly bookmarkMarks?: BookmarkMarkOptionsSource;
436
488
  /** Return true when host chrome handles this session. */
437
489
  readonly onRequestTextFormField?: (session: TextFormFieldDialogSession) => boolean;
438
490
  readonly onRequestContentControlWidget?: (session: ContentControlWidgetSession) => boolean;
@@ -458,8 +510,8 @@ interface PaginatedSurfaceOptions {
458
510
  }
459
511
 
460
512
  /**
461
- * Receives the element that shows the loading indicator on the first page, while a large
462
- * document lays out its remaining pages.
513
+ * Receives the element that shows the loading indicator below the laid-out pages, while a
514
+ * large document lays out its remaining pages.
463
515
  *
464
516
  * @example
465
517
  * ```ts
@@ -476,8 +528,8 @@ interface OpeningIndicatorHost {
476
528
  /**
477
529
  * Called with the indicator element when the first pages show, and with `null` when the
478
530
  * remaining pages are laid out or the open is abandoned. The element is empty while a host
479
- * is set: render the host's content into it. It is centered on the first page, at most 30%
480
- * of the window height below the page top, and scrolls with the document.
531
+ * is set: render the host's content into it. It is centered in a band below the last
532
+ * laid-out page, as wide as the page, and scrolls with the document.
481
533
  */
482
534
  publish(element: HTMLElement | null): void;
483
535
  }
@@ -581,6 +633,8 @@ interface DocxEditorConfig {
581
633
  * the proposed view still marks surviving insertions.
582
634
  */
583
635
  revisionStyles?: RevisionStyles;
636
+ /** Ordered unsupported-content registrations; the first matching rule reserves a layout box. */
637
+ unsupportedElementRules?: readonly UnsupportedElementRule[];
584
638
  /** Initial local revision presentation and tracking preferences. */
585
639
  revisionMarkup?: RevisionMarkupOptions;
586
640
  /** Initial review projection. Markup modes require a review module. */
@@ -656,10 +710,106 @@ interface HyperlinkChromeHandlers {
656
710
  /** Ctrl/Cmd+K: open insert-or-edit for the selection. */
657
711
  readonly onRequest?: () => void;
658
712
  }
713
+ /**
714
+ * Host chrome for bookmarks.
715
+ *
716
+ * @public
717
+ */
718
+ interface BookmarkChromeHandlers {
719
+ /**
720
+ * Open the Bookmark dialog for the selection: the `openBookmarkDialog` command, which the
721
+ * Insert menu row and Ctrl/Cmd+Shift+F5 send.
722
+ */
723
+ readonly onRequest?: () => void;
724
+ }
725
+ /**
726
+ * Host chrome for comment drafts: the review rail, or the host's own comment UI.
727
+ *
728
+ * @public
729
+ */
730
+ interface CommentDraftChromeHandlers {
731
+ /**
732
+ * Open a comment draft on the selection: the `review.addComment` control's press. The
733
+ * handler takes no arguments. It reads the selection with `getSelectionPlacement`, and can
734
+ * pin it with `retainSelection` while the draft is open. The most recent registration
735
+ * receives each request.
736
+ */
737
+ readonly onRequest?: () => void;
738
+ }
739
+ /**
740
+ * Host chrome for Go To: the Go to tab of `DocxEditor.Navigation`, or the host's own.
741
+ *
742
+ * @public
743
+ */
744
+ interface GoToChromeHandlers {
745
+ /** Open the Go To UI: the `openGoTo` command, which its shortcut also sends. */
746
+ readonly onRequest?: () => void;
747
+ /**
748
+ * Whether Ctrl+G (Cmd+Option+G on macOS) in the document opens this UI. Defaults to `true`.
749
+ * With `false` the chord is left to the browser; `openGoTo` still opens the UI. The most
750
+ * recent registration decides. It is read when the chord arrives, so a getter can follow a
751
+ * setting without registering again.
752
+ */
753
+ readonly shortcut?: boolean;
754
+ }
755
+ /**
756
+ * One painted bookmark mark, as `BookmarkMarkOptions` callbacks see it.
757
+ *
758
+ * @public
759
+ */
760
+ interface BookmarkMarkInfo {
761
+ /** The bookmark's name as the document writes it. */
762
+ readonly name: string;
763
+ /** Whether the name starts with an underscore. */
764
+ readonly hidden: boolean;
765
+ /** The story the bookmark is in. */
766
+ readonly story: BookmarkStory;
767
+ /** Which mark this is: the start bracket, the end bracket, or a point bookmark's I-beam. */
768
+ readonly edge: 'start' | 'end' | 'point';
769
+ }
770
+ /**
771
+ * How Show bookmarks paints its marks. Register with `setBookmarkMarks`.
772
+ *
773
+ * @public
774
+ */
775
+ interface BookmarkMarkOptions {
776
+ /**
777
+ * Which bookmarks get marks: `'visible'` (the default) skips hidden bookmarks, `'all'`
778
+ * includes them, and a function decides per bookmark.
779
+ */
780
+ readonly include?: 'visible' | 'all' | ((bookmark: Omit<BookmarkMarkInfo, 'edge'>) => boolean);
781
+ /**
782
+ * Adjust each mark before it is placed: add a class, a `title` tooltip, or attributes.
783
+ * Return another element to replace the mark. The editor positions whatever comes back.
784
+ * Marks ignore the pointer; set `pointer-events: auto` on a mark that shows a tooltip.
785
+ */
786
+ readonly decorate?: (element: HTMLElement, mark: BookmarkMarkInfo) => HTMLElement | void;
787
+ /** Keep the marks when the browser prints the page. Exports never include them. */
788
+ readonly print?: boolean;
789
+ }
659
790
  /** Host chrome that edits a clicked Office Math equation. */
660
791
  interface EquationChromeHandlers {
661
792
  readonly onPopover?: (activation: EquationActivation) => void;
662
793
  }
794
+ /**
795
+ * How {@link DocxEditorInstance.attach} moves an open document.
796
+ *
797
+ * @example
798
+ * ```ts
799
+ * // Bring the editor home from a pop-out and keep typing there.
800
+ * editor.attach(mainSlot, { focus: true });
801
+ * ```
802
+ *
803
+ * @public
804
+ */
805
+ interface AttachOptions {
806
+ /**
807
+ * Focus the pages after the move, so the caret shows and typing continues. Default: focus
808
+ * returns only when the pages had it before the move or the `detach()`. A first mount from
809
+ * bytes does not take focus.
810
+ */
811
+ readonly focus?: boolean;
812
+ }
663
813
  /**
664
814
  * The concrete facade type: the full `Editor` contract plus the instance-only surface.
665
815
  *
@@ -668,6 +818,17 @@ interface EquationChromeHandlers {
668
818
  * need. Production adapters program against `Editor` for everything else.
669
819
  */
670
820
  interface DocxEditorInstance extends Editor {
821
+ /**
822
+ * Replace host font resources without replacing the document or its edit history.
823
+ * Old resolution is cancelled. Existing host faces are removed before the new
824
+ * resolver runs; no answer keeps the bounded fallback. Document-embedded faces
825
+ * remain independent of host fonts. Failures report through `onFontError`.
826
+ *
827
+ * The session, selection, undo, protection, and collaboration state stay intact.
828
+ * Throws after `destroy()`. This does not grant permission to load native fonts.
829
+ * @public
830
+ */
831
+ setFonts(fonts: DocxEditorConfig['fonts']): Promise<void>;
671
832
  /** Bumps on mount, detach, destroy, and document reload — guards async image intents. */
672
833
  readonly mountGeneration: number;
673
834
  /**
@@ -684,6 +845,28 @@ interface DocxEditorInstance extends Editor {
684
845
  * command needs.
685
846
  */
686
847
  setHyperlinkChrome(handlers: HyperlinkChromeHandlers): Unsubscribe;
848
+ /**
849
+ * Wire the host's bookmark dialog to Ctrl/Cmd+Shift+F5. Returns an unsubscribe that
850
+ * restores whatever was registered before, like {@link DocxEditorInstance.setHyperlinkChrome}.
851
+ */
852
+ setBookmarkChrome(handlers: BookmarkChromeHandlers): Unsubscribe;
853
+ /**
854
+ * Wire the host's Go To UI to the `openGoTo` command. Returns an unsubscribe that restores
855
+ * whatever was registered before. `DocxEditor.Navigation` registers its Go to tab.
856
+ */
857
+ setGoToChrome(handlers: GoToChromeHandlers): Unsubscribe;
858
+ /**
859
+ * Wire the host's comment draft UI to the `review.addComment` control. Returns an
860
+ * unsubscribe that restores whatever was registered before. While nothing is registered,
861
+ * the control is disabled, because nothing could open the draft. The review rail registers
862
+ * when it mounts.
863
+ */
864
+ setCommentDraftChrome(handlers: CommentDraftChromeHandlers): Unsubscribe;
865
+ /**
866
+ * Choose which bookmarks Show bookmarks marks and customize each mark. Returns an
867
+ * unsubscribe that restores the previous options.
868
+ */
869
+ setBookmarkMarks(options: BookmarkMarkOptions): Unsubscribe;
687
870
  /**
688
871
  * Register local revision settings chrome. Disposal cancels its active sessions.
689
872
  * Manual renderers take priority over fallback renderers. Pass null to use native chrome
@@ -867,6 +1050,8 @@ interface DocxEditorInstance extends Editor {
867
1050
  * of calling it. Call it directly from headless and non-React hosts.
868
1051
  */
869
1052
  setRevisionStyles(styles: RevisionStyles): void;
1053
+ /** Replace registrations while preserving document edits and undo history. */
1054
+ setUnsupportedElementRules(rules: readonly UnsupportedElementRule[]): void;
870
1055
  /** Merge local preferences and emit revisionMarkupChange after a change.
871
1056
  * Invalid settings throw TypeError without changing the previous settings.
872
1057
  */
@@ -892,20 +1077,42 @@ interface DocxEditorInstance extends Editor {
892
1077
  */
893
1078
  setReviewPaneOptions(options: ReviewPaneOptions): ExecResult;
894
1079
  /**
895
- * Mount into `el`. If the instance holds pending document bytes (created without a
896
- * container, or previously detached), they mount now — under the shaped measurer when
897
- * fonts have resolved in the meantime. Attaching while already mounted elsewhere moves
898
- * the live content via `session.save()`.
1080
+ * Mount into `el`, which may belong to another document: a pop-out window opened with
1081
+ * `window.open`, or a same-origin iframe.
1082
+ *
1083
+ * A document that is already open MOVES into `el`, from another element or from a
1084
+ * previous `detach()`: the undo history, the selection, other editing state (such as an
1085
+ * armed format painter) and any collaboration session stay as they are. The reading
1086
+ * position is kept, and keyboard focus returns when the pages had it before (see
1087
+ * {@link AttachOptions.focus}). Focus, selection, pointer, scroll and resize listeners,
1088
+ * timers and registered font faces follow `el`'s window. Pending document bytes (an
1089
+ * instance created without a container, or a `load` while detached) mount now instead, as
1090
+ * a fresh session.
899
1091
  *
900
- * HONEST COSTS: a mount from bytes is a fresh session — the undo stack and the caret do
901
- * not survive re-attach (the same cost as the async font remount). After `destroy()`
902
- * this is a no-op that emits a typed `error` event: a destroyed instance never remounts.
1092
+ * The host copies the editor stylesheet and any web fonts it loads into `el`'s document.
1093
+ * Move the editor back, or `destroy()` it, before that window closes. An element whose
1094
+ * window has closed (or that has no window) is refused with an `invalidTarget` error and
1095
+ * the editor stays where it is. After `destroy()` this is a no-op that emits a typed
1096
+ * `error` event: a destroyed instance never remounts.
1097
+ *
1098
+ * @example
1099
+ * ```ts
1100
+ * // Pop the editor out into its own window and bring it back later.
1101
+ * const popup = window.open('', 'editor', 'width=900,height=1000')!;
1102
+ * copyStyles(document, popup.document); // host-owned: the editor CSS and fonts
1103
+ * const slot = popup.document.createElement('div');
1104
+ * popup.document.body.append(slot);
1105
+ * editor.attach(slot);
1106
+ * popup.addEventListener('pagehide', () => editor.attach(mainSlot), { once: true });
1107
+ * ```
903
1108
  */
904
- attach(el: HTMLElement): void;
1109
+ attach(el: HTMLElement, options?: AttachOptions): void;
905
1110
  /**
906
- * Tear down the painted surface, stashing the CURRENT document bytes
907
- * (`session.save()`) so a later `attach` restores the content — but not the undo stack
908
- * or the caret. No-op when already detached or destroyed.
1111
+ * Take the editor out of its element and keep it, with its undo history, selection and
1112
+ * collaboration session, for a later `attach`. While detached the instance still saves,
1113
+ * runs commands and receives remote edits; it paints when attached again. A `load` while
1114
+ * detached replaces the kept document. `destroy()` releases everything. No-op when already
1115
+ * detached or destroyed.
909
1116
  */
910
1117
  detach(): void;
911
1118
  }
@@ -1488,6 +1695,29 @@ interface RemoteCaretLabelHost {
1488
1695
  publish(anchors: readonly RemoteCaretLabelAnchor[]): void;
1489
1696
  }
1490
1697
 
1698
+ /** The surface's bookmark lane. */
1699
+ interface SurfaceBookmarks {
1700
+ /** Every bookmark in the document: body first, then headers, footers and notes. */
1701
+ list(): readonly BookmarkSummary[];
1702
+ /** Why `insert(name)` would be refused now, or null. */
1703
+ insertRefusal(name: string): string | null;
1704
+ /** Bookmark the selection under `name`, moving a bookmark that already has it. */
1705
+ insert(name: string): boolean;
1706
+ /** Remove the bookmark with this name, compared without case, and its copies. */
1707
+ remove(name: string): boolean;
1708
+ /** Keep the first bookmark with this name and remove its copies, in one transaction. */
1709
+ keepFirst(name: string): boolean;
1710
+ /** Why a bookmark write cannot happen now, or null. */
1711
+ writeRefusal(): string | null;
1712
+ /** Select the bookmark's range and scroll it into view. */
1713
+ goTo(name: string): boolean;
1714
+ /** Whether the marks are shown. */
1715
+ shown(): boolean;
1716
+ setShown(shown: boolean): void;
1717
+ /** Paint the marks for one rendered frame. */
1718
+ paint(frame: SurfaceOverlayFrame): void;
1719
+ }
1720
+
1491
1721
  /**
1492
1722
  * What the selection is currently formatted as.
1493
1723
  *
@@ -1514,7 +1744,8 @@ interface SurfaceFormatting {
1514
1744
  /**
1515
1745
  * `w:spacing`'s line rule and its value: LINES for `multiple`, points for the other two
1516
1746
  * (`w:line` is 240ths of a line under `auto` and twentieths of a point otherwise).
1517
- * Null when the selection's paragraphs disagree, or state no line spacing at all.
1747
+ * The effective value: a paragraph whose cascade states none reads as single spacing
1748
+ * (`multiple`, 1). Null when the selection's paragraphs disagree.
1518
1749
  */
1519
1750
  readonly lineSpacing: {
1520
1751
  readonly rule: 'multiple' | 'exact' | 'atLeast';
@@ -1686,12 +1917,16 @@ interface PaginatedSurface {
1686
1917
  readonly commitGuard?: () => boolean;
1687
1918
  }): Promise<ImageIntentResult>;
1688
1919
  layout(): SemanticLayout;
1920
+ /** The measurer layout uses; sizes engine-authored shapes such as a watermark. */
1921
+ textMeasurer?(): TextMeasurer;
1689
1922
  state(): PaginatedSurfaceState;
1690
1923
  /** One-based page at the caret, or at the centre of the mounted viewport. */
1691
1924
  currentPage(mode?: 'viewport' | 'caret'): number;
1692
1925
  type(text: string): void;
1693
1926
  /** Author one explicit tracked text change without changing the editing mode. */
1694
1927
  proposeTextChange(kind: 'insertion' | 'deletion' | 'replacement', text: string, author?: string): boolean;
1928
+ /** Replace a paragraph range of the active story in place; suggesting tracks it. */
1929
+ replaceTextInPlace(paragraphId: string, start: number, end: number, text: string): boolean;
1695
1930
  /**
1696
1931
  * Queue plain typed text for a batched commit at the caret.
1697
1932
  *
@@ -1872,16 +2107,17 @@ interface PaginatedSurface {
1872
2107
  * caret-preserving edits (Backspace, Delete, Enter) and IME composition, and is
1873
2108
  * discarded when the caret moves elsewhere or the document is undone. A property the
1874
2109
  * store cannot author is refused at arm time rather than left to poison the keystroke.
2110
+ * Returns the document's refusal reason, or null when the write landed, armed, or did nothing.
1875
2111
  */
1876
- toggleRunProperty(localName: string, attributes?: Record<string, string>): void;
2112
+ toggleRunProperty(localName: string, attributes?: Record<string, string>): string | null;
1877
2113
  /**
1878
2114
  * SET a run property over the selection, rather than toggling it.
1879
2115
  *
1880
2116
  * Font family, size and colour are values, not switches: picking Arial twice must leave
1881
2117
  * the text in Arial, which a toggle would not. Arms at a collapsed caret on the same
1882
- * terms as `toggleRunProperty`.
2118
+ * terms as `toggleRunProperty`, and returns a refusal the same way.
1883
2119
  */
1884
- setRunProperty(localName: string, attributes?: Record<string, string>): void;
2120
+ setRunProperty(localName: string, attributes?: Record<string, string>): string | null;
1885
2121
  /**
1886
2122
  * Set a property on every paragraph the selection touches — alignment, style, spacing.
1887
2123
  *
@@ -2055,6 +2291,11 @@ interface PaginatedSurface {
2055
2291
  * with code `destroyed`. Does not change focus.
2056
2292
  */
2057
2293
  save(): Uint8Array;
2294
+ /**
2295
+ * {@link save} in steps a caller can pause between. Everything `save` does before it
2296
+ * serializes happens at the call, and the document is captured then.
2297
+ */
2298
+ saveSteps(): Generator<void, Uint8Array>;
2058
2299
  /** Whether a body paragraph belongs to a detected TOC boundary or cached result. */
2059
2300
  isInsideToc(paragraphId: string): boolean;
2060
2301
  /**
@@ -2062,6 +2303,8 @@ interface PaginatedSurface {
2062
2303
  * calls `openExternal`; nothing else in the engine may call `window.open`.
2063
2304
  */
2064
2305
  readonly navigation: SurfaceNavigation;
2306
+ /** List, add, delete and jump to bookmarks, and show their marks. */
2307
+ readonly bookmarkEditing: SurfaceBookmarks;
2065
2308
  /**
2066
2309
  * Pin the current selection so it stays VISIBLY selected while focus is elsewhere.
2067
2310
  *
@@ -2125,6 +2368,7 @@ interface PaginatedSurface {
2125
2368
  */
2126
2369
  setRevisionMarkup(settings: ResolvedRevisionMarkup): void;
2127
2370
  setRevisionStyles(colors: RevisionStyles | undefined): void;
2371
+ setUnsupportedElementRules(rules: readonly UnsupportedElementRule[]): void;
2128
2372
  /** Toggle paragraph-end furniture without layout or document changes. */
2129
2373
  setShowParagraphMarks(show: boolean): void;
2130
2374
  /**
@@ -2198,11 +2442,19 @@ interface PaginatedSurface {
2198
2442
  * pages painting text the tree no longer had, every card anchored where it used to be, and
2199
2443
  * the caret past the end of the paragraph — after which every keystroke was refused with
2200
2444
  * `offset-out-of-range` until the user happened to click somewhere else.
2445
+ *
2446
+ * Returns null when the write went through, and otherwise why it did not: the external
2447
+ * refresh when the write guard skipped the commit, a gate's reason (viewing, collaboration)
2448
+ * when `run` never ran, or the reason `run` reported. A `run` that commits nothing without a
2449
+ * reason counts as refused (`'rejected'`). Gate and `run` reasons also become
2450
+ * `lastRejection`; a skipped refresh changes nothing, `lastRejection` included.
2451
+ *
2452
+ * `run` receives the store history token of this commit, for the store write it performs.
2201
2453
  */
2202
- commitReviewOps(run: () => {
2454
+ commitReviewOps(run: (historyToken: symbol | undefined) => {
2203
2455
  readonly committed: boolean;
2204
2456
  readonly reason?: unknown;
2205
- }, intent?: ReviewWriteIntent): void;
2457
+ }, intent?: ReviewWriteIntent): string | null;
2206
2458
  /**
2207
2459
  * The layout as last PUBLISHED, without forcing pending work.
2208
2460
  *
@@ -2258,9 +2510,11 @@ interface PaginatedSurface {
2258
2510
  * other order repainted the bands and reported state while the caret was still the only
2259
2511
  * evidence, so a host saw the wrong twin active for one frame and then a correction. Omit it
2260
2512
  * to pin against the live selection, which is what a header or note scope has already set.
2513
+ * `preventScroll` installs `selection` with no scroll, now or on a later repaint.
2261
2514
  */
2262
2515
  activateReview(key: string, selection?: SemanticSelection, options?: {
2263
2516
  readonly allowExcluded?: boolean;
2517
+ readonly preventScroll?: boolean;
2264
2518
  }): void;
2265
2519
  /**
2266
2520
  * The key {@link activateReview} pinned, or null once its selection is no longer live.
@@ -2338,6 +2592,25 @@ interface PaginatedSurface {
2338
2592
  * @public
2339
2593
  */
2340
2594
  setTableInteractionLabel(resolver: (key: 'table.insertRowBelow' | 'table.insertColumnRight') => string): void;
2595
+ /**
2596
+ * Move the painted pages into `container`, which may belong to another document: a pop-out
2597
+ * window or an iframe. The session, undo history, selection and collaboration replica stay
2598
+ * as they are; only the DOM and the document- and window-level listeners move. Open
2599
+ * content-control menus close.
2600
+ */
2601
+ moveTo(container: HTMLElement, options?: {
2602
+ readonly focus?: boolean;
2603
+ }): void;
2604
+ /**
2605
+ * Take the pages out of their container and keep them, with all editing state, for a later
2606
+ * `moveTo`. A parked surface still accepts commands and remote edits; it paints into a
2607
+ * private, disconnected holder until it moves again.
2608
+ */
2609
+ park(): void;
2610
+ /** Whether the surface is parked: mounted nowhere, state kept. */
2611
+ parked(): boolean;
2612
+ /** The element the pages are in now: the host's, or a private holder while parked. */
2613
+ hostElement(): HTMLElement;
2341
2614
  destroy(): void;
2342
2615
  /**
2343
2616
  * The section a painted page belongs to, and the page that section starts on.
@@ -2387,8 +2660,10 @@ interface PaginatedSurface {
2387
2660
  * Flushes layout so the next enter/rebind sees the new resolution.
2388
2661
  */
2389
2662
  applyHeaderFooterLifecycle(op: {
2390
- readonly op: 'createHeaderFooter' | 'deleteHeaderFooter' | 'linkToPrevious' | 'unlinkFromPrevious' | 'setSectionFurnitureOptions' | 'setDocumentProtection';
2663
+ readonly op: 'createHeaderFooter' | 'deleteHeaderFooter' | 'linkToPrevious' | 'unlinkFromPrevious' | 'setSectionFurnitureOptions' | 'setDocumentProtection' | 'setWatermark';
2391
2664
  readonly sectionIndex?: number;
2665
+ /** `setWatermark` only: the new watermark, or null to remove it. */
2666
+ readonly watermark?: PackageWatermarkWrite | null;
2392
2667
  /** `setDocumentProtection` only: enforce filling-in-forms protection, or lift it. */
2393
2668
  readonly enforce?: boolean;
2394
2669
  readonly kind?: 'header' | 'footer';
@@ -3130,6 +3405,15 @@ declare const CHROME_GROUPS: readonly [{
3130
3405
  readonly state: {
3131
3406
  readonly kind: 'command';
3132
3407
  };
3408
+ }, {
3409
+ readonly id: 'bookmarks';
3410
+ readonly shape: 'icon';
3411
+ readonly labelKey: 'formattingBar.showBookmarks';
3412
+ readonly defaultToolbar: false;
3413
+ readonly paths: readonly string[];
3414
+ readonly state: {
3415
+ readonly kind: 'command';
3416
+ };
3133
3417
  }, {
3134
3418
  readonly id: 'protectDocument';
3135
3419
  readonly shape: 'icon';
@@ -3298,6 +3582,20 @@ declare const CHROME_GROUPS: readonly [{
3298
3582
  readonly state: {
3299
3583
  readonly kind: 'value';
3300
3584
  };
3585
+ }, {
3586
+ readonly id: 'mergeCells';
3587
+ readonly labelKey: 'table.mergeCells';
3588
+ readonly paths: readonly string[];
3589
+ readonly state: {
3590
+ readonly kind: 'command';
3591
+ };
3592
+ }, {
3593
+ readonly id: 'splitCell';
3594
+ readonly labelKey: 'table.splitCell';
3595
+ readonly paths: readonly string[];
3596
+ readonly state: {
3597
+ readonly kind: 'command';
3598
+ };
3301
3599
  }];
3302
3600
  }, {
3303
3601
  readonly id: 'paragraph';
@@ -3439,6 +3737,27 @@ declare const CHROME_GROUPS: readonly [{
3439
3737
  readonly state: {
3440
3738
  readonly kind: 'command';
3441
3739
  };
3740
+ }, {
3741
+ readonly id: 'bookmark';
3742
+ readonly labelKey: 'toolbar.bookmark';
3743
+ readonly paths: readonly string[];
3744
+ readonly state: {
3745
+ readonly kind: 'command';
3746
+ };
3747
+ }, {
3748
+ readonly id: 'goToBookmark';
3749
+ readonly labelKey: 'toolbar.goToBookmark';
3750
+ readonly paths: readonly string[];
3751
+ readonly state: {
3752
+ readonly kind: 'command';
3753
+ };
3754
+ }, {
3755
+ readonly id: 'watermark';
3756
+ readonly labelKey: 'toolbar.watermark';
3757
+ readonly paths: readonly string[];
3758
+ readonly state: {
3759
+ readonly kind: 'command';
3760
+ };
3442
3761
  }];
3443
3762
  }];
3444
3763
  /**
@@ -3455,7 +3774,7 @@ type ChromeGroupId = 'history' | 'zoom' | 'styles' | 'font' | 'text' | 'script'
3455
3774
  *
3456
3775
  * @public
3457
3776
  */
3458
- type ChromeSlotId = 'history.undo' | 'history.redo' | 'zoom.level' | 'styles.style' | 'font.family' | 'font.size' | 'text.bold' | 'text.italic' | 'text.underline' | 'text.strike' | 'text.color' | 'text.highlight' | 'text.link' | 'script.super' | 'script.sub' | 'alignment.left' | 'alignment.center' | 'alignment.right' | 'alignment.justify' | 'direction.ltr' | 'direction.rtl' | 'list.bullet' | 'list.numbered' | 'list.outdent' | 'list.indent' | 'list.lineSpacing' | 'format.painter' | 'format.clear' | 'review.revisionMarkup' | 'review.comments' | 'review.addComment' | 'review.paragraphMarks' | 'review.protectDocument' | 'review.simpleMarkup' | 'review.allMarkup' | 'review.noMarkup' | 'review.original' | 'review.previousChange' | 'review.nextChange' | 'review.acceptAllChanges' | 'review.rejectAllChanges' | 'review.authors' | 'review.editingMode' | 'contentControl.showAll' | 'contentControl.formFill' | 'contentControl.inspector' | 'contentControl.remove' | 'image.insert' | 'image.properties' | 'image.wrap' | 'image.altText' | 'table.insert' | 'table.borderTarget' | 'table.borderColor' | 'table.borderStyle' | 'table.borderWidth' | 'table.cellFill' | 'file.open' | 'file.save' | 'file.exportMarkdown' | 'file.exportPdf' | 'file.print' | 'paragraph.dialog' | 'file.pageSetup' | 'insert.textBox' | 'insert.footnote' | 'insert.endnote' | 'insert.pageNumber' | 'insert.totalPages' | 'insert.sectionPages' | 'insert.pageXofY' | 'insert.pageBreak' | 'insert.sectionBreakNextPage' | 'insert.sectionBreakContinuous' | 'insert.toc';
3777
+ type ChromeSlotId = 'history.undo' | 'history.redo' | 'zoom.level' | 'styles.style' | 'font.family' | 'font.size' | 'text.bold' | 'text.italic' | 'text.underline' | 'text.strike' | 'text.color' | 'text.highlight' | 'text.link' | 'script.super' | 'script.sub' | 'alignment.left' | 'alignment.center' | 'alignment.right' | 'alignment.justify' | 'direction.ltr' | 'direction.rtl' | 'list.bullet' | 'list.numbered' | 'list.outdent' | 'list.indent' | 'list.lineSpacing' | 'format.painter' | 'format.clear' | 'review.revisionMarkup' | 'review.comments' | 'review.addComment' | 'review.paragraphMarks' | 'review.bookmarks' | 'review.protectDocument' | 'review.simpleMarkup' | 'review.allMarkup' | 'review.noMarkup' | 'review.original' | 'review.previousChange' | 'review.nextChange' | 'review.acceptAllChanges' | 'review.rejectAllChanges' | 'review.authors' | 'review.editingMode' | 'contentControl.showAll' | 'contentControl.formFill' | 'contentControl.inspector' | 'contentControl.remove' | 'image.insert' | 'image.properties' | 'image.wrap' | 'image.altText' | 'table.insert' | 'table.borderTarget' | 'table.borderColor' | 'table.borderStyle' | 'table.borderWidth' | 'table.cellFill' | 'table.mergeCells' | 'table.splitCell' | 'file.open' | 'file.save' | 'file.exportMarkdown' | 'file.exportPdf' | 'file.print' | 'paragraph.dialog' | 'file.pageSetup' | 'insert.textBox' | 'insert.footnote' | 'insert.endnote' | 'insert.pageNumber' | 'insert.totalPages' | 'insert.sectionPages' | 'insert.pageXofY' | 'insert.pageBreak' | 'insert.sectionBreakNextPage' | 'insert.sectionBreakContinuous' | 'insert.toc' | 'insert.bookmark' | 'insert.goToBookmark' | 'insert.watermark';
3459
3778
  /**
3460
3779
  * Every control id in the chrome, as a literal union. Unique WITHIN a group, not
3461
3780
  * globally (`image.insert` / `table.insert`) — key consumers on {@link ChromeSlotId}.
@@ -3787,7 +4106,8 @@ declare function runTableCommand(editor: Editor | null, command: EditorCommand,
3787
4106
  *
3788
4107
  * Construction is separate from mounting. Pass a `container` and the document mounts
3789
4108
  * immediately; omit it and nothing touches the DOM until `attach(el)` — the provider-first
3790
- * shape. `detach()` remounts from the saved bytes, which resets undo and the caret.
4109
+ * shape. `detach()` parks the live document and a later `attach(el)` moves it in, with undo,
4110
+ * selection and collaboration intact, even into another window (a pop-out or an iframe).
3791
4111
  *
3792
4112
  * `snapshot()` is version-cached: the same reference until state actually moves, with
3793
4113
  * reference-stable sub-objects, so it is safe as a `useSyncExternalStore` source.
@@ -3924,5 +4244,5 @@ interface ChromePrintJob {
3924
4244
  */
3925
4245
  declare function runChromePrint(editor: Pick<Editor, 'save'> & Partial<Pick<Editor, 'snapshot'>>, handlers?: ChromeExportHandlers, container?: Document | Element): Promise<ChromePrintJob>;
3926
4246
 
3927
- export { CHROME_UNAVAILABLE_KEY as $, bindHistoryGroup as B, CHROME_GROUPS as C, blankDocumentBytes as E, chromeMenuSlots as G, commandForSlot as I, commandForSlotValue as J, createDocxEditor as K, createFontSource as M, customFonts as N, isChromePrintShortcut as O, loadFonts as P, runChromeExport as Q, runChromePrint as R, runToolbarCommand as U, toolbarCommandState as V, CHROME_MENUS as a, chromeControlCount as a$, DEFAULT_TABLE_CHROME_DRAFT as a8, TABLE_BORDER_STYLE_OPTIONS as aH, TABLE_BORDER_TARGET_OPTIONS as aI, TABLE_BORDER_WIDTH_OPTIONS as aJ, TABLE_CHROME_SLOT_IDS as aK, applyTableChromePick as aY, canExecuteImageCommand as aZ, captureImageMutationPreconditions as a_, EMU_PER_POINT as aa, IMAGE_OVERLAY_NUDGE_PT as ah, IMAGE_OVERLAY_NUDGE_SHIFT_PT as ai, ChromeExportError as b, chromeProbeForSlot as b0, chromeSlotId as b1, chromeSlotIsToggle as b2, commandExecOptions as b3, commandForTableChromeSlotValue as b4, computeImageResizeResult as b5, computeMovedImagePosition as b6, computeResizedImageExtentEmu as b7, createImageOverlayScrollPort as b8, cssPixelsToLayoutPoints as b9, toolbarCommandStates as bA, defaultChromeGroups as ba, defaultTableLabel as bb, emuToOverlayPoints as bc, equationAtPosition as bd, executeImageCommand as be, finalizeImageOverlayInteraction as bf, formattingBarChromeGroups as bg, isStaleImageInteractionCommit as bh, isTableChromeSlot as bi, layoutPointsToCssPixels as bj, overlayFrameToSheetCssPixels as bk, overlayHostOrigin as bl, pointsToEmu as bm, probeTableChromeCommand as bn, resizePreservesAspect as bo, runSave as bp, runTableChromeCommand as bq, runTableCommand as br, selectedDrawingOverlayTargetOf as bs, selectedImageStateOf as bt, surfacePaintScale as bu, tableChromeIconPaths as bv, tableChromeLabelKeyForTarget as bw, tableChromeToolbarState as bx, tableChromeVisible as by, tableCommandToolbarState as bz, ChromePrintError as l };
3928
- export type { LockedControlNavigation as A, DocxEditorConfig as D, FontLoadFailure as F, HistoryGroupBinding as H, LoadFontsRequest as L, SurfaceHyperlink as S, ToolbarCommandState as T, PaginatedSurfaceOptions as W, OpenPaginatedResult as X, PaginatedSurface as Y, TableCommandPlan as Z, AnchorFrameOrigin as _, ChromeControl as a0, ChromeControlId as a1, ChromeControlState as a2, ChromeExportView as a3, ChromeGroup as a4, ChromeGroupId as a5, ContentControlWidgetChromeHandlers as a6, ContentControlWidgetSession as a7, DrawingSelectionIntent as a9, SelectedDrawingOverlayTarget as aA, SurfaceEquation as aB, SurfaceFormatting as aC, SurfaceInsertImageInput as aD, SurfaceNavigation as aE, SurfaceOverlayCoordinates as aF, SurfaceParagraphFormat as aG, TableBorderStyleOption as aL, TableBorderTargetOption as aM, TableBorderTargetValue as aN, TableBorderWidthOption as aO, TableChromeDraft as aP, TableChromePick as aQ, TableChromeSlotId as aR, TableInteractionLabelKey as aS, TextFormFieldChromeHandlers as aT, TextFormFieldDialogSession as aU, ToolbarSlotValue as aV, ToolbarValueMap as aW, ToolbarValueSlot as aX, EditorCommandExecute as ab, EquationActivation as ac, EquationChromeHandlers as ad, EquationOps as ae, FinalizedImageOverlayInteraction as af, HyperlinkOps as ag, ImageInteractionSession as aj, ImageOverlayScrollPort as ak, ImageResizeHandle as al, ImageResizeResult as am, InvalidTextFormFieldChromeHandlers as an, InvalidTextFormFieldSession as ao, OpeningIndicatorHost as ap, OverlayFrameRect as aq, PaginatedSurfaceState as ar, ParagraphPropertyEdit as as, PopupChromeRegistrationOptions as at, RemoteCaretLabelAnchor as au, RemoteCaretLabelHost as av, ReviewWriteIntent as aw, RunTableChromeCommandResult as ax, SectionAnchor as ay, SectionBreakInsertType as az, ChromeExportFormat as c, ChromeExportHandlers as d, ChromeExportResult as e, ChromeMenu as f, ChromeMenuEntry as g, ChromeMenuId as h, ChromeMenuItemEntry as i, ChromeMenuSeparatorEntry as j, ChromeMenuSubmenuEntry as k, ChromePrintErrorCode as m, ChromePrintJob as n, ChromePrintOptions as o, ChromeSlotId as p, CustomFontsOptions as q, CustomFontsResolver as r, DocxEditorInstance as s, FontLoadFailureReason as t, FontMeasurementState as u, FontUrlSource as v, HistoryGroupBindingOptions as w, HyperlinkActivation as x, HyperlinkChromeHandlers as y, LoadFontsResult as z };
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 };