ooxml-ui 1.18.3 → 1.20.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 (166) hide show
  1. package/README.md +96 -39
  2. package/custom-elements.json +13 -2
  3. package/dist/building-block-styles.d.ts +5 -0
  4. package/dist/building-block-styles.d.ts.map +1 -0
  5. package/dist/{chunk-MSXUCINT.js → chunk-4XPAPETH.js} +4 -4
  6. package/dist/{chunk-SVRIVUWC.js → chunk-C7B7TJ2J.js} +1 -1
  7. package/dist/{chunk-ANPFMQ6E.js → chunk-QBXYGKPB.js} +1 -1
  8. package/dist/{chunk-CWBSXK7P.js → chunk-QLHCGV4C.js} +1 -1
  9. package/dist/chunk-T5ARELU2.js +299 -0
  10. package/dist/{chunk-SPRZIHUH.js → chunk-TJ245GDD.js} +37 -24
  11. package/dist/{chunk-EVL7GFC7.js → chunk-UB36NYDT.js} +5 -5
  12. package/dist/{chunk-LD3K2RDN.js → chunk-XL77FR4B.js} +2 -0
  13. package/dist/{chunk-KNC2UEUR.js → chunk-YZH2QS7J.js} +1 -1
  14. package/dist/controls.d.ts +1 -1
  15. package/dist/controls.d.ts.map +1 -1
  16. package/dist/controls.js +4 -4
  17. package/dist/docx/building-blocks.d.ts +31 -0
  18. package/dist/docx/collaboration-room.d.ts +46 -0
  19. package/dist/docx/collaboration-session.d.ts +2 -0
  20. package/dist/docx/collaboration-types.d.ts +13 -0
  21. package/dist/docx/component.d.ts +14 -1
  22. package/dist/docx/editor-core.d.ts +6 -0
  23. package/dist/docx/element-api.d.ts +11 -0
  24. package/dist/docx/events.d.ts +4 -1
  25. package/dist/docx/field-update.d.ts +8 -4
  26. package/dist/docx/form-field-view.d.ts +3 -0
  27. package/dist/docx/index.d.ts +2 -0
  28. package/dist/docx/ribbon-popover.d.ts +5 -4
  29. package/dist/docx/styles/index.d.ts +0 -4
  30. package/dist/docx/table-model-adapter.d.ts +2 -0
  31. package/dist/docx.js +18866 -18192
  32. package/dist/form/color-grid.d.ts +21 -2
  33. package/dist/form/color-grid.d.ts.map +1 -1
  34. package/dist/index.js +9 -9
  35. package/dist/pptx/chunk-3ESFHUZI.cjs +1016 -0
  36. package/dist/pptx/{chunk-S2Y3VUNC.cjs → chunk-ABDWUQRQ.cjs} +2230 -1726
  37. package/dist/pptx/{chunk-AUCJIB3M.mjs → chunk-F6P7VS5I.mjs} +2191 -1709
  38. package/dist/pptx/chunk-MK2ASJSY.mjs +991 -0
  39. package/dist/pptx/dom/elements/text-warp.d.ts.map +1 -1
  40. package/dist/pptx/dom/index.cjs +217 -216
  41. package/dist/pptx/dom/index.mjs +16 -15
  42. package/dist/pptx/index.cjs +2976 -2880
  43. package/dist/pptx/index.mjs +2 -2
  44. package/dist/pptx/render/collaboration-options.d.ts +29 -0
  45. package/dist/pptx/render/collaboration-options.d.ts.map +1 -0
  46. package/dist/pptx/render/embedded-font-bytes.d.ts +27 -0
  47. package/dist/pptx/render/embedded-font-bytes.d.ts.map +1 -0
  48. package/dist/pptx/render/embedded-font-trust.d.ts +48 -0
  49. package/dist/pptx/render/embedded-font-trust.d.ts.map +1 -0
  50. package/dist/pptx/render/embedded-fonts.d.ts +8 -18
  51. package/dist/pptx/render/embedded-fonts.d.ts.map +1 -1
  52. package/dist/pptx/render/font-weight-names.d.ts +66 -0
  53. package/dist/pptx/render/font-weight-names.d.ts.map +1 -0
  54. package/dist/pptx/render/google-webfonts.d.ts +9 -4
  55. package/dist/pptx/render/google-webfonts.d.ts.map +1 -1
  56. package/dist/pptx/render/index.d.ts +3 -0
  57. package/dist/pptx/render/index.d.ts.map +1 -1
  58. package/dist/pptx/render/morph-animation.d.ts +5 -1
  59. package/dist/pptx/render/morph-animation.d.ts.map +1 -1
  60. package/dist/pptx/render/morph-image-alpha.d.ts +49 -0
  61. package/dist/pptx/render/morph-image-alpha.d.ts.map +1 -0
  62. package/dist/pptx/render/morph-predicates.d.ts.map +1 -1
  63. package/dist/pptx/render/paragraph-bullet-marker-style.d.ts.map +1 -1
  64. package/dist/pptx/render/ribbon-galleries/gallery-placements.d.ts +2 -0
  65. package/dist/pptx/render/ribbon-galleries/gallery-placements.d.ts.map +1 -1
  66. package/dist/pptx/render/ribbon-galleries/gallery-registry.d.ts.map +1 -1
  67. package/dist/pptx/render/ribbon-galleries/gallery-types.d.ts +3 -1
  68. package/dist/pptx/render/ribbon-galleries/gallery-types.d.ts.map +1 -1
  69. package/dist/pptx/render/ribbon-galleries/index.d.ts +1 -0
  70. package/dist/pptx/render/ribbon-galleries/index.d.ts.map +1 -1
  71. package/dist/pptx/render/ribbon-galleries/text-warp-gallery.d.ts +19 -0
  72. package/dist/pptx/render/ribbon-galleries/text-warp-gallery.d.ts.map +1 -0
  73. package/dist/pptx/render/ribbon-help-commands.d.ts +13 -0
  74. package/dist/pptx/render/ribbon-help-commands.d.ts.map +1 -1
  75. package/dist/pptx/render/ribbon-record-commands.d.ts +4 -1
  76. package/dist/pptx/render/ribbon-record-commands.d.ts.map +1 -1
  77. package/dist/pptx/render/ribbon-slide-show-commands.d.ts +6 -0
  78. package/dist/pptx/render/ribbon-slide-show-commands.d.ts.map +1 -1
  79. package/dist/pptx/render/slide-transition-css.d.ts.map +1 -1
  80. package/dist/pptx/render/table-cell-css.d.ts +12 -0
  81. package/dist/pptx/render/table-cell-css.d.ts.map +1 -1
  82. package/dist/pptx/render/table-style.d.ts +10 -1
  83. package/dist/pptx/render/table-style.d.ts.map +1 -1
  84. package/dist/pptx/render/text-block-style.d.ts.map +1 -1
  85. package/dist/pptx/render/text-east-asian-breaks.d.ts.map +1 -1
  86. package/dist/pptx/render/text-metric-tracking.d.ts.map +1 -1
  87. package/dist/pptx/render/text-run-gradient-span.d.ts.map +1 -1
  88. package/dist/pptx/render/text-run-style.d.ts.map +1 -1
  89. package/dist/pptx/render/text-tab-layout.d.ts.map +1 -1
  90. package/dist/pptx/render/text-warp-envelope-measure.d.ts.map +1 -1
  91. package/dist/pptx/render/text-warp-outline-font-cache.d.ts +2 -1
  92. package/dist/pptx/render/text-warp-outline-font-cache.d.ts.map +1 -1
  93. package/dist/pptx/render/text-warp-outline-webfont-fetch.d.ts.map +1 -1
  94. package/dist/pptx/render/theme-color-grid.d.ts +20 -0
  95. package/dist/pptx/render/theme-color-grid.d.ts.map +1 -0
  96. package/dist/pptx/render/used-fonts.d.ts.map +1 -1
  97. package/dist/pptx/theme/index.cjs +24 -16
  98. package/dist/pptx/theme/index.d.ts +1 -0
  99. package/dist/pptx/theme/index.d.ts.map +1 -1
  100. package/dist/pptx/theme/index.mjs +1 -1
  101. package/dist/pptx/theme/office-css.d.ts +6 -0
  102. package/dist/pptx/theme/office-css.d.ts.map +1 -0
  103. package/dist/pptx/types.d.ts +5 -1
  104. package/dist/pptx/types.d.ts.map +1 -1
  105. package/dist/pptx/web-components/chart-format-pane-styles.d.ts +1 -1
  106. package/dist/pptx/web-components/chart-format-pane-styles.d.ts.map +1 -1
  107. package/dist/pptx/web-components/control-styles.d.ts.map +1 -1
  108. package/dist/pptx/web-components/index.d.ts +1 -0
  109. package/dist/pptx/web-components/index.d.ts.map +1 -1
  110. package/dist/pptx/web-components/mobile-bar-styles.d.ts +2 -2
  111. package/dist/pptx/web-components/mobile-bar-styles.d.ts.map +1 -1
  112. package/dist/pptx/web-components/mobile-insert-styles.d.ts +1 -1
  113. package/dist/pptx/web-components/mobile-insert-styles.d.ts.map +1 -1
  114. package/dist/pptx/web-components/notes-toolbar-styles.d.ts +1 -1
  115. package/dist/pptx/web-components/notes-toolbar-styles.d.ts.map +1 -1
  116. package/dist/pptx/web-components/office-aliases.d.ts +9 -0
  117. package/dist/pptx/web-components/office-aliases.d.ts.map +1 -1
  118. package/dist/pptx/web-components/office-token-bridge.d.ts +1 -1
  119. package/dist/pptx/web-components/office-token-bridge.d.ts.map +1 -1
  120. package/dist/pptx/web-components/ribbon-gallery.d.ts +1 -0
  121. package/dist/pptx/web-components/ribbon-gallery.d.ts.map +1 -1
  122. package/dist/pptx/web-components/subtitle-settings-styles.d.ts +1 -1
  123. package/dist/pptx/web-components/subtitle-settings-styles.d.ts.map +1 -1
  124. package/dist/pptx/web-components/theme-editor-styles.d.ts +1 -1
  125. package/dist/pptx/web-components/theme-editor-styles.d.ts.map +1 -1
  126. package/dist/presence.js +3 -3
  127. package/dist/ribbon/gallery.d.ts +4 -2
  128. package/dist/ribbon/gallery.d.ts.map +1 -1
  129. package/dist/smartart.js +3 -3
  130. package/dist/teams.js +6 -6
  131. package/dist/theme-bridge.d.ts +28 -0
  132. package/dist/theme-bridge.d.ts.map +1 -0
  133. package/dist/theme.d.ts +10 -3
  134. package/dist/theme.d.ts.map +1 -0
  135. package/dist/theme.js +2 -2
  136. package/dist/tokens.d.ts +1 -0
  137. package/dist/tokens.d.ts.map +1 -1
  138. package/dist/visio/building-blocks.d.ts +37 -0
  139. package/dist/visio/collaboration-types.d.ts +3 -0
  140. package/dist/visio/controller.d.ts +6 -0
  141. package/dist/visio/index.d.ts +2 -0
  142. package/dist/visio/styles/theme.d.ts +1 -1
  143. package/dist/visio/styles.d.ts +1 -1
  144. package/dist/visio/viewer-element.d.ts +15 -0
  145. package/dist/visio/viewer-share-sync.d.ts +23 -0
  146. package/dist/visio/viewer-share.d.ts +20 -6
  147. package/dist/visio.js +8030 -7776
  148. package/dist/xlsx/building-blocks.d.ts +55 -0
  149. package/dist/xlsx/collaboration-types.d.ts +7 -35
  150. package/dist/xlsx/component.d.ts +3 -1
  151. package/dist/xlsx/dialogs/styles.d.ts +1 -1
  152. package/dist/xlsx/editor-core.d.ts +1 -0
  153. package/dist/xlsx/element-api.d.ts +6 -0
  154. package/dist/xlsx/formula-bar/styles.d.ts +1 -1
  155. package/dist/xlsx/grid/page-break-layer.d.ts +1 -1
  156. package/dist/xlsx/grid/styles.d.ts +1 -1
  157. package/dist/xlsx/index.d.ts +1 -0
  158. package/dist/xlsx/page-views/page-layout-css.d.ts +1 -1
  159. package/dist/xlsx/sheet-tabs/styles.d.ts +1 -1
  160. package/dist/xlsx/surface-shell.d.ts +3 -0
  161. package/dist/xlsx/theme/styles.d.ts +1 -4
  162. package/dist/xlsx.js +425 -326
  163. package/package.json +3 -3
  164. package/dist/chunk-7E3HU7RL.js +0 -123
  165. package/dist/pptx/chunk-BDXQX6RA.cjs +0 -373
  166. package/dist/pptx/chunk-ZAOD6O2D.mjs +0 -357
@@ -0,0 +1,46 @@
1
+ import { type CollabSession } from 'ooxml-core/collab';
2
+ import type { WordYjsOptions } from 'ooxml-core/docx/ui';
3
+ import type { EditorCore } from './editor-core.js';
4
+ import { type DocxCollaborationOptions, type DocxCollaborationState } from './collaboration-types.js';
5
+ /** What the controller needs from the editor. */
6
+ export interface RoomHost {
7
+ /** The editor is mounted with a view the document can be bound to. */
8
+ ready(): boolean;
9
+ /** A document is being loaded; joining waits for it. */
10
+ loading(): boolean;
11
+ author(): string;
12
+ join(session: CollabSession, options: WordYjsOptions): void;
13
+ leave(): void;
14
+ error(error: Error): void;
15
+ changed(state: DocxCollaborationState): void;
16
+ }
17
+ export declare class DocxRoom {
18
+ #private;
19
+ private readonly host;
20
+ constructor(host: RoomHost);
21
+ /** The options of the declarative `collaboration` property, if set. */
22
+ get wanted(): DocxCollaborationOptions | undefined;
23
+ /** Joined or joining through the property. */
24
+ get busy(): boolean;
25
+ /** The session of a join still waiting to bind, for `reconnectCollaboration`. */
26
+ get pendingSession(): CollabSession | undefined;
27
+ /** Declarative sharing: while set, the open document is shared; undefined leaves. */
28
+ want(options: DocxCollaborationOptions | undefined): void;
29
+ /** Forgets the property and leaves. True when there was anything to leave. */
30
+ stop(): boolean;
31
+ /** Leaves before the document is replaced; true when it was shared through the property. */
32
+ suspend(): boolean;
33
+ /** Joins the wanted room with the document now open. */
34
+ resume(): void;
35
+ /** The Yjs binding started or stopped (through the property or `startYjsCollaboration`). */
36
+ yjsChanged(session: CollabSession | undefined): void;
37
+ state(): DocxCollaborationState;
38
+ /** Leaves the room; a session the host passed in stays alive, one made here is destroyed. */
39
+ leave(): void;
40
+ }
41
+ /** Binds the open document to a synchronized session (the body of `startYjsCollaboration`). */
42
+ export declare function joinYjs(core: EditorCore, session: CollabSession, options: WordYjsOptions): void;
43
+ /** Detaches the Yjs binding, keeping its current content, comments and new picture parts. */
44
+ export declare function leaveYjs(core: EditorCore): void;
45
+ /** The controller of one editor, reporting through its events and error channel. */
46
+ export declare function roomFor(core: EditorCore): DocxRoom;
@@ -12,6 +12,8 @@ export declare class CollaborationSession {
12
12
  yjs?: WordYjsCollaboration | undefined;
13
13
  presence?: EditorPresence | undefined;
14
14
  ids?: ((kind: string) => string) | undefined;
15
+ /** Called after a Yjs binding starts (with its session) or stops (undefined). */
16
+ onYjsChange?: ((session: CollabSession | undefined) => void) | undefined;
15
17
  private sendScheduled;
16
18
  constructor(element: HTMLElement, getView: () => EditorView | undefined);
17
19
  get active(): boolean;
@@ -0,0 +1,13 @@
1
+ import type { CollaborationOptions, CollaborationState, Collaborator } from 'ooxml-core/collab';
2
+ /**
3
+ * How to join a shared document (see `CollaborationOptions`): `session`, `provider`, `serverUrl`,
4
+ * else a BroadcastChannel. The user name defaults to `reviewAuthor`. The room name doubles as the
5
+ * Word `documentId`, so every participant must have loaded the same source package. `intent:
6
+ * 'join'` never seeds an empty room; anything else lets this window seed it.
7
+ */
8
+ export type DocxCollaborationOptions = CollaborationOptions;
9
+ /** One person in the room, as `collaboration-change` lists them. */
10
+ export type DocxCollaborator = Collaborator;
11
+ /** Collaboration state, reported by `collaborationState` and the `collaboration-change` event. */
12
+ export type DocxCollaborationState = CollaborationState;
13
+ export declare const OFF_STATE: DocxCollaborationState;
@@ -1,6 +1,7 @@
1
1
  import type { DocumentModel } from 'ooxml-core/docx';
2
2
  import type { CollaborationConfig, ClientReceiveResult, StepBatch } from 'ooxml-core/docx/ui';
3
3
  import { type EditorTheme, type EditorThemeMode } from 'ooxml-core/docx/ui';
4
+ import type { DocxCollaborationOptions } from './collaboration-types.js';
4
5
  import { EditorCore, type LoadedDocument } from './editor-core.js';
5
6
  import { DocxEditorApi } from './element-api.js';
6
7
  import { type DocxEditorEventMap } from './events.js';
@@ -30,7 +31,7 @@ export declare class DocxEditorElement extends DocxEditorApi {
30
31
  /** File name shown in the title bar and used for downloads from the built-in File commands. */
31
32
  get fileName(): string;
32
33
  set fileName(value: string);
33
- /** `light`, `dark`, or `auto` (default, follows the OS). Reflected to the `theme` attribute. */
34
+ /** `light`, `dark`, or `auto` (default, inherits the Office theme, then follows the OS). Reflected to the `theme` attribute. */
34
35
  get theme(): EditorThemeMode;
35
36
  set theme(value: EditorThemeMode);
36
37
  /** Token overrides applied as inline `--dve-*` custom properties on the host. */
@@ -42,6 +43,18 @@ export declare class DocxEditorElement extends DocxEditorApi {
42
43
  set documentModel(value: DocumentModel | null);
43
44
  get readOnly(): boolean;
44
45
  set readOnly(value: boolean);
46
+ /**
47
+ * Shares the loaded document in a room while set; `null` leaves (see
48
+ * `DocxCollaborationOptions`). A document loaded later is shared too: the editor leaves
49
+ * before it is replaced and rejoins after. With `intent: 'join'` an empty room is never seeded.
50
+ * Race: with the default `create`, two windows that open one empty room at the same moment both
51
+ * seed it and the room holds both bodies, so give exactly one window `create` and the others
52
+ * `join`. A room name is also the Word `documentId`: nothing verifies that every window
53
+ * loaded the same source package. A viewer `user.role` blocks local edits (advisory).
54
+ * Leaving keeps the content; a session the editor opened is destroyed, a host `session` is not.
55
+ */
56
+ get collaboration(): DocxCollaborationOptions | null;
57
+ set collaboration(value: DocxCollaborationOptions | null | undefined);
45
58
  connectedCallback(): void;
46
59
  disconnectedCallback(): void;
47
60
  load(input: Uint8Array | ArrayBuffer): Promise<void>;
@@ -6,6 +6,7 @@ import type { DocumentModel } from 'ooxml-core/docx';
6
6
  import type { loadDocument } from 'ooxml-core/docx/load';
7
7
  import type { SearchPanelHandle } from './search-panel.js';
8
8
  import { CollaborationSession } from './collaboration-session.js';
9
+ import { type DocxRoom } from './collaboration-room.js';
9
10
  import type { EditorTheme, EditorThemeMode } from 'ooxml-core/docx/ui';
10
11
  import type { EditorLocale } from './localization.js';
11
12
  import type { PrintEditingBridge } from './print-editing.js';
@@ -57,7 +58,10 @@ export declare class EditorCore {
57
58
  view?: EditorView | undefined;
58
59
  loaded?: LoadedDocument | undefined;
59
60
  loadGeneration: number;
61
+ loading: boolean;
60
62
  readOnly: boolean;
63
+ /** Set before mounting to render only the document surface. */
64
+ surfaceOnly: boolean;
61
65
  locale: EditorLocale;
62
66
  reviewAuthor: string;
63
67
  theme: EditorThemeMode;
@@ -68,6 +72,8 @@ export declare class EditorCore {
68
72
  pendingFileName?: string;
69
73
  readonly shell: ShellParts;
70
74
  readonly collab: CollaborationSession;
75
+ /** The declarative `collaboration` property and the Yjs state reporting. */
76
+ readonly room: DocxRoom;
71
77
  readonly inserts: InsertController;
72
78
  readonly formatDialogs: FormatDialogs;
73
79
  readonly imageMedia: ImageMediaCache;
@@ -1,19 +1,30 @@
1
1
  import type { RibbonAddInTab } from '../ribbon/add-in-tabs.js';
2
2
  import type { CollabSession } from 'ooxml-core/collab';
3
3
  import type { WordYjsOptions } from 'ooxml-core/docx/ui';
4
+ import type { DocxCollaborationState } from './collaboration-types.js';
4
5
  import type { EditorCore } from './editor-core.js';
5
6
  import { type RibbonActionId, type RibbonActionInput } from 'ooxml-core/docx/ui';
7
+ import { type WordToolbarProps } from './building-blocks.js';
6
8
  declare const HTMLElementBase: typeof HTMLElement;
7
9
  /**
8
10
  * Save, collaboration, dirty-tracking and UI-customisation surface of `<docx-editor>`.
9
11
  * the shared `EditorCore`, so the element class stays a thin lifecycle facade.
10
12
  */
11
13
  export declare abstract class DocxEditorApi extends HTMLElementBase {
14
+ /** Choose before connecting. This mode mounts only the document and its editing surface. */
15
+ get surfaceOnly(): boolean;
16
+ set surfaceOnly(value: boolean);
17
+ getToolbarProps(): WordToolbarProps;
18
+ get loading(): boolean;
19
+ /** Selection and formatting updates, including changes which do not dirty the document. */
20
+ subscribeEditorState(listener: () => void): () => void;
12
21
  protected abstract readonly core: EditorCore;
13
22
  abstract fileName: string;
14
23
  abstract reviewAuthor: string;
15
24
  /** Join a synchronized Yjs room after loading its matching source package. */
16
25
  startYjsCollaboration(session: CollabSession, options: WordYjsOptions): void;
26
+ /** Who is in the room, and whether it is synced; the off state when not sharing. */
27
+ get collaborationState(): DocxCollaborationState;
17
28
  reconnectCollaboration(): void;
18
29
  resyncCollaboration(): boolean;
19
30
  publishPresence(profile: {
@@ -1,6 +1,7 @@
1
1
  import type { DocumentModel } from 'ooxml-core/docx';
2
2
  import type { RibbonAddInCommandDetail } from 'ooxml-core/ribbon';
3
3
  import type { StepBatch } from 'ooxml-core/docx/ui';
4
+ import type { DocxCollaborationState } from './collaboration-types.js';
4
5
  import type { FileCommandDetail } from './file-commands.js';
5
6
  import type { PageChangeDetail } from './page-sync.js';
6
7
  import type { PresenceMessage } from './presence.js';
@@ -29,6 +30,8 @@ export interface DocxEditorEventMap {
29
30
  'presence-send': CustomEvent<PresenceMessage>;
30
31
  /** Local steps are pending; transport the batch to the collaboration authority. */
31
32
  'collaboration-send': CustomEvent<StepBatch>;
33
+ /** Sharing started, stopped, reconnected, synced or the people in the room changed. */
34
+ 'collaboration-change': CustomEvent<DocxCollaborationState>;
32
35
  /** A command of a host tab (`ribbonAddIns`) was chosen. */
33
36
  'office-ribbon-add-in': CustomEvent<RibbonAddInCommandDetail>;
34
37
  }
@@ -36,7 +39,7 @@ export type DocxEditorEventName = keyof DocxEditorEventMap;
36
39
  /** Detail payload type of the named event. */
37
40
  export type DocxEditorEventDetail<K extends DocxEditorEventName> = DocxEditorEventMap[K] extends CustomEvent<infer D> ? D : never;
38
41
  /** Runtime list of every event name; the `satisfies` check keeps it a subset of the map. */
39
- export declare const DOCX_EDITOR_EVENTS: readonly ["document-change", "document-error", "document-warning", "readonly-change", "ribbon-action", "ribbon-customize", "file-command", "page-change", "dirty-change", "presence-send", "collaboration-send", "office-ribbon-add-in"];
42
+ export declare const DOCX_EDITOR_EVENTS: readonly ["document-change", "document-error", "document-warning", "readonly-change", "ribbon-action", "ribbon-customize", "file-command", "page-change", "dirty-change", "presence-send", "collaboration-send", "collaboration-change", "office-ribbon-add-in"];
40
43
  /** Typed listener for plain elements (such as the ribbon) that are not a `<docx-editor>`. */
41
44
  export declare function on<K extends DocxEditorEventName>(target: EventTarget, name: K, listener: (event: DocxEditorEventMap[K]) => void): void;
42
45
  /**
@@ -1,16 +1,20 @@
1
+ import { type DocumentModel } from 'ooxml-core/docx';
1
2
  import type { Transaction } from 'prosemirror-state';
2
3
  import type { EditorView } from 'prosemirror-view';
3
4
  /**
4
5
  * Word's Update Field for the whole body: every `SEQ` caption is renumbered, then `REF` results
5
6
  * follow their bookmarked paragraph and `PAGEREF` results take the page from `pageOf`. A REF that
6
7
  * pointed at a caption's label and number keeps showing the label; a longer result is treated as
7
- * the entire caption. Fields with other switches or a missing bookmark are left as they are.
8
- * One undoable step; returns whether anything changed.
8
+ * the entire caption. With the document's `model`, `STYLEREF` results take the nearest text in
9
+ * their style before the field, else after it, which an empty paragraph in the style makes empty
10
+ * (the field stays, with its instruction, and a later update fills it). Fields with other
11
+ * switches or a missing bookmark or style are left as they are. One undoable step; returns
12
+ * whether anything changed.
9
13
  */
10
- export declare function updateFields(view: EditorView, pageOf: (id: string) => string | undefined): boolean;
14
+ export declare function updateFields(view: EditorView, pageOf: (id: string) => string | undefined, model?: DocumentModel): boolean;
11
15
  /**
12
16
  * The refresh behind `updateFields`, applied to `tr` so other commands (a new caption) can include
13
17
  * it in their own undo step. Without `pageOf`, `PAGEREF` results are left alone: pages need a layout.
14
18
  * With `captionsOnly`, only references that quote a caption are refreshed.
15
19
  */
16
- export declare function refreshFieldResults(tr: Transaction, pageOf?: (id: string) => string | undefined, captionsOnly?: boolean): Transaction;
20
+ export declare function refreshFieldResults(tr: Transaction, pageOf?: (id: string) => string | undefined, captionsOnly?: boolean, model?: DocumentModel): Transaction;
@@ -0,0 +1,3 @@
1
+ import { type DocumentModel } from 'ooxml-core/docx';
2
+ import { Plugin } from 'prosemirror-state';
3
+ export declare function formFieldViewPlugin(model: () => DocumentModel): Plugin;
@@ -1,4 +1,5 @@
1
1
  export { DocxEditorElement, registerDocxEditor } from './component.js';
2
+ export type { WordToolbarProps } from './building-blocks.js';
2
3
  export { DOCX_EDITOR_EVENTS } from './events.js';
3
4
  export type { RibbonAction } from './ribbon.js';
4
5
  export { RIBBON_ACTION_IDS, RIBBON_ACTION_LABELS, normalizeRibbonActions, isRibbonActionId, } from 'ooxml-core/docx/ui';
@@ -11,6 +12,7 @@ export type { DocxEditorAttribute } from './editor-attributes.js';
11
12
  export { CollaborationClient, CollaborationAuthority } from 'ooxml-core/docx/ui';
12
13
  export type { CollaborationConfig, StepBatch, ClientReceiveResult, AuthorityResult, } from 'ooxml-core/docx/ui';
13
14
  export type { CollaborationAuthorityConfig } from 'ooxml-core/docx/ui';
15
+ export type { DocxCollaborationOptions, DocxCollaborationState, DocxCollaborator, } from './collaboration-types.js';
14
16
  export type { WordYjsOptions } from 'ooxml-core/docx/ui';
15
17
  export { createCollaborationAuthority } from './collaboration-model.js';
16
18
  export { PresenceClient, PRESENCE_PALETTE } from './presence.js';
@@ -9,8 +9,9 @@ export declare function mountPopover(anchor: HTMLElement, pop: HTMLElement, expa
9
9
  /** Opens a swatch grid under the caret button `anchor`. */
10
10
  export declare function openSwatchPopover(anchor: HTMLElement, choices: Array<[string, string]>, choose: (value: string) => void): void;
11
11
  /**
12
- * Opens a scrolling list of `items` under a combo box, with `current` marked and scrolled into view.
13
- * Up/Down move through the entries, Enter chooses, Escape closes. `preview` sets each entry in its
14
- * own font face.
12
+ * Opens a scrolling list of `items` under a combo box, with `current` (an entry, or its index when
13
+ * entries can repeat) marked and scrolled into view. Up/Down move through the entries, Enter
14
+ * chooses, Escape closes. `preview` sets each entry in its own font face. `choose` gets the entry
15
+ * and its index.
15
16
  */
16
- export declare function openListPopover(anchor: HTMLElement, items: readonly string[], current: string, preview: boolean, choose: (value: string) => void): void;
17
+ export declare function openListPopover(anchor: HTMLElement, items: readonly string[], current: string | number, preview: boolean, choose: (value: string, index: number) => void): void;
@@ -1,6 +1,2 @@
1
- /**
2
- * Token presets are generated from theme/defaults.ts so the TypeScript presets and the shadow-root
3
- * CSS cannot drift. `theme="auto"` (the default) follows the OS; explicit values always win.
4
- */
5
1
  export declare const themeTokenText: string;
6
2
  export declare const editorStyleText: string;
@@ -1,6 +1,8 @@
1
1
  import type { Node as ProseMirrorNode } from 'prosemirror-model';
2
2
  import type { Paragraph, Table, TableStyleCatalog } from 'ooxml-core/docx';
3
3
  export declare function tableNode(block: Table, paragraphNode: (paragraph: Paragraph) => ProseMirrorNode, tableStyles?: TableStyleCatalog, nested?: boolean): ProseMirrorNode;
4
+ /** The block control around a table as the editor holds it. */
5
+ export declare const tableControl: (node: ProseMirrorNode, prior?: Table) => Pick<Table, 'contentControl'>;
4
6
  /** Reads editable formatting from nodes rather than a stale prior model. */
5
7
  export declare function tableFormattingFromNode(node: ProseMirrorNode): {
6
8
  rowProperties: Table['rowProperties'];