superdoc 2.28.0-next.8 → 2.28.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 (64) hide show
  1. package/dist/chunks/{FindReplaceSurface-8V8AjgR4.cjs → FindReplaceSurface-BRs3JrCq.cjs} +1 -1
  2. package/dist/chunks/{FindReplaceSurface-RUiTFDt3.es.js → FindReplaceSurface-Dm043CZP.es.js} +1 -1
  3. package/dist/chunks/{PasswordPromptSurface-B5DHV6qr.cjs → PasswordPromptSurface-BpqP4pUa.cjs} +1 -1
  4. package/dist/chunks/{PasswordPromptSurface-BDpxqdzp.es.js → PasswordPromptSurface-DGjmN7A-.es.js} +1 -1
  5. package/dist/chunks/{PdfViewer-omriDChK.cjs → PdfViewer-Cg072l5d.cjs} +1 -1
  6. package/dist/chunks/{PdfViewer-DjdsIh6n.es.js → PdfViewer-JHXZQZ9x.es.js} +1 -1
  7. package/dist/chunks/{_plugin-vue_export-helper-BUdjGKyl.cjs → _plugin-vue_export-helper-6MBoygIY.cjs} +9 -0
  8. package/dist/chunks/{_plugin-vue_export-helper-7ZiLY07t.es.js → _plugin-vue_export-helper-CsJQtMvr.es.js} +4 -1
  9. package/dist/chunks/{create-super-doc-ui-C4Ka5Ph3.es.js → create-super-doc-ui-BbjHD1ul.es.js} +184 -28
  10. package/dist/chunks/{create-super-doc-ui-B4c55pFy.cjs → create-super-doc-ui-BfgYblyI.cjs} +195 -27
  11. package/dist/collaboration-upgrade-engine.cjs +1 -1
  12. package/dist/collaboration-upgrade-engine.es.js +1 -1
  13. package/dist/document-api/src/contract/operation-definitions.d.ts +2 -2
  14. package/dist/document-api/src/lists/lists.types.d.ts +1 -0
  15. package/dist/document-api/src/sections/sections.types.d.ts +5 -1
  16. package/dist/document-api/src/types/clipboard.d.ts +5 -1
  17. package/dist/document-api/src/types/receipt.d.ts +2 -1
  18. package/dist/layout-engine/contracts/src/index.d.ts +5 -1
  19. package/dist/layout-engine/contracts/src/run-helpers.d.ts +1 -0
  20. package/dist/layout-engine/layout-bridge/src/index.d.ts +1 -0
  21. package/dist/layout-engine/layout-bridge/src/place-inline-drawings.d.ts +9 -0
  22. package/dist/layout-engine/layout-engine/src/layout-drawing.d.ts +2 -1
  23. package/dist/layout-engine/layout-engine/src/paginator.d.ts +1 -0
  24. package/dist/layout-engine/style-engine/src/ooxml/index.d.ts +1 -1
  25. package/dist/public/ui-react.cjs +1 -1
  26. package/dist/public/ui-react.es.js +1 -1
  27. package/dist/public/ui-vue.cjs +1 -1
  28. package/dist/public/ui-vue.es.js +1 -1
  29. package/dist/public/ui.cjs +3 -2
  30. package/dist/public/ui.es.js +3 -2
  31. package/dist/shared/font-system/src/resolver.d.ts +3 -3
  32. package/dist/style.css +1 -1
  33. package/dist/style.layered.css +1 -1
  34. package/dist/superdoc/src/components/CommentsLayer/FloatingComments.vue.d.ts +11 -0
  35. package/dist/superdoc/src/components/CommentsLayer/PdfCommentsLayer.vue.d.ts +4 -0
  36. package/dist/superdoc/src/composables/use-high-contrast-mode.d.ts +8 -4
  37. package/dist/superdoc/src/composables/use-superdoc-instance.d.ts +7 -0
  38. package/dist/superdoc/src/core/SuperDoc.d.ts +1 -5
  39. package/dist/superdoc/src/core/collaboration/helpers.d.ts +0 -5
  40. package/dist/superdoc/src/core/collaboration/resolve-v2-collaboration-target.d.ts +2 -1
  41. package/dist/superdoc/src/core/create-app.d.ts +2 -6
  42. package/dist/superdoc/src/core/editor-runtime/types.d.ts +2 -0
  43. package/dist/superdoc/src/core/editor-runtime/v2/v2-editor-runtime-adapter.d.ts +2 -0
  44. package/dist/superdoc/src/core/types/index.d.ts +14 -0
  45. package/dist/superdoc/src/core/v2-integration/internal-vue-runtime.d.ts +1 -0
  46. package/dist/superdoc/src/core/v2-integration/v2-integration.d.ts +104 -84
  47. package/dist/superdoc/src/helpers/v2-review-mutation-impact.d.ts +2 -0
  48. package/dist/superdoc/src/internal/diagnostics/translate-diagnostic.d.ts +5 -0
  49. package/dist/superdoc/src/internal/toolbar/built-in/constants.d.ts +0 -48
  50. package/dist/superdoc/src/internal/toolbar/built-in-toolbar.d.ts +4 -1
  51. package/dist/superdoc/src/internal/toolbar/compatibility-catalog.d.ts +16 -0
  52. package/dist/superdoc/src/public/ui/types.d.ts +39 -1
  53. package/dist/superdoc/src/public/ui.d.cts +12 -0
  54. package/dist/superdoc/src/public/ui.d.ts +1 -1
  55. package/dist/superdoc/src/stores/comments-store.d.ts +7 -97
  56. package/dist/superdoc/src/stores/superdoc-store.d.ts +21 -291
  57. package/dist/superdoc.cjs +262 -1462
  58. package/dist/superdoc.es.js +538 -12833
  59. package/dist-cdn/style.layered.css +1 -1
  60. package/dist-cdn/superdoc.min.css +1 -1
  61. package/dist-cdn/superdoc.min.js +42 -42
  62. package/package.json +4 -3
  63. package/dist/superdoc/src/core/collaboration/collaboration.d.ts +0 -18
  64. package/dist/superdoc/src/helpers/group-changes.d.ts +0 -1
@@ -1,8 +1,8 @@
1
1
  import { useSuperdocStore } from '../stores/superdoc-store.js';
2
2
  import { useCommentsStore } from '../stores/comments-store.js';
3
- import { useHighContrastMode } from '../composables/use-high-contrast-mode.js';
4
- export function createSuperdocVueApp({ disablePiniaDevtools }?: {
3
+ export function createSuperdocVueApp({ disablePiniaDevtools, highContrastMode }: {
5
4
  disablePiniaDevtools?: boolean | undefined;
5
+ highContrastMode: import('../composables/use-high-contrast-mode.js').HighContrastMode;
6
6
  }): SuperdocVueAppRefs;
7
7
  /**
8
8
  * Result of `createSuperdocVueApp()`. Internal-only: the shape is consumed
@@ -25,8 +25,4 @@ export type SuperdocVueAppRefs = {
25
25
  * The Comments Pinia store
26
26
  */
27
27
  commentsStore: ReturnType<typeof useCommentsStore>;
28
- /**
29
- * The high-contrast mode composable refs (`isHighContrastMode`, `setHighContrastMode`). Named `*Store` for historical reasons; this is a plain Vue composable, not a Pinia store.
30
- */
31
- highContrastModeStore: ReturnType<typeof useHighContrastMode>;
32
28
  };
@@ -140,6 +140,8 @@ export type EditorRuntimeRejectionCode = 'runtime-not-ready' | 'host-saving' | '
140
140
  * must not inspect these to invalidate document state.
141
141
  */
142
142
  export type EditorRuntimeCommandResult = {
143
+ status: 'selected';
144
+ } | {
143
145
  status: 'committed';
144
146
  receipt?: unknown;
145
147
  } | {
@@ -40,6 +40,8 @@ interface HostDispatchRejectionLike {
40
40
  readonly detail?: string;
41
41
  }
42
42
  type HostDispatchResultLike = {
43
+ readonly status: 'selected';
44
+ } | {
43
45
  readonly status: 'committed';
44
46
  readonly receipt?: unknown;
45
47
  } | {
@@ -651,6 +651,7 @@ export interface V2LiveblocksCollaborationConfig {
651
651
  * page; non-browser SDK/CLI callers must use an absolute HTTP(S) URL.
652
652
  */
653
653
  authEndpoint?: string;
654
+ baseUrl?: string;
654
655
  /** Maximum initial synchronization wait in milliseconds. Defaults to 30,000. */
655
656
  syncTimeoutMs?: number;
656
657
  /** Explicit room operation. Defaults to `'join'`; `'create'` never joins an existing room. */
@@ -819,6 +820,18 @@ export interface ProofingIssue {
819
820
  export interface ProofingCheckResult {
820
821
  issues: ProofingIssue[];
821
822
  }
823
+ export interface ProofingSuggestRequest {
824
+ documentId?: string | null;
825
+ defaultLanguage?: string | null;
826
+ maxSuggestions?: number;
827
+ segment: ProofingSegment;
828
+ issue: Omit<ProofingIssue, 'replacements'>;
829
+ text: string;
830
+ signal: AbortSignal;
831
+ }
832
+ export interface ProofingSuggestResult {
833
+ replacements: string[];
834
+ }
822
835
  /**
823
836
  * Provider-agnostic proofing engine. SuperDoc owns segment extraction,
824
837
  * scheduling, and rendering; providers only inspect text and return ranges.
@@ -827,6 +840,7 @@ export interface ProofingProvider {
827
840
  id: string;
828
841
  getCapabilities?: () => Promise<ProofingCapabilities> | ProofingCapabilities;
829
842
  check: (request: ProofingCheckRequest) => Promise<ProofingCheckResult>;
843
+ suggest?: (request: ProofingSuggestRequest) => Promise<ProofingSuggestResult>;
830
844
  dispose?: () => Promise<void> | void;
831
845
  }
832
846
  export interface SelectionInfo {
@@ -32,6 +32,7 @@ export function onScopeDispose(...args: any[]): any;
32
32
  export function openBlock(...args: any[]): any;
33
33
  export function provide(...args: any[]): any;
34
34
  export function reactive(...args: any[]): any;
35
+ export function readonly(...args: any[]): any;
35
36
  export function ref(...args: any[]): any;
36
37
  export function renderList(...args: any[]): any;
37
38
  export function renderSlot(...args: any[]): any;
@@ -1,86 +1,106 @@
1
+ import { Component } from 'vue';
1
2
  import { isSyntheticTrackedChangeCommentLaneItem } from '../../helpers/tracked-change-comment-lane.js';
2
- /**
3
- * Replace the package loader before engine loading starts. The CDN entry uses
4
- * this seam to fetch the exact engine version from its public package URL.
5
- *
6
- * @param {() => Promise<unknown>} loader
7
- */
8
- export function configureDefaultV2IntegrationLoader(loader: () => Promise<unknown>): void;
9
- /** Load the engine before Vue evaluates the synchronous integration seam. */
10
- export function loadDefaultV2Integration(): Promise<void>;
11
- /** Load the engine for editor startup, preserving the fail-closed stub on failure. */
12
- export function loadDefaultV2IntegrationOrFallback(): Promise<void>;
13
- /**
14
- * @param {{ trackedChange?: unknown, trackedChangeAnchorKey?: unknown } | null | undefined} row
15
- * @returns {boolean}
16
- */
17
- export function isV2SyntheticTrackedChangeRow(row: {
18
- trackedChange?: unknown;
19
- trackedChangeAnchorKey?: unknown;
20
- } | null | undefined): boolean;
21
- /**
22
- * @returns {SuperDocV2Integration}
23
- */
24
- export function createStubV2Integration(): SuperDocV2Integration;
25
- /**
26
- * Build the default v2 integration the runtime always uses. The v2
27
- * browser shell is the only source of the editor runtime; no customer-provided
28
- * integration is consulted. Falls back to the local stub only if the engine
29
- * shell throws during construction (defensive, never selects v1).
30
- *
31
- * @returns {SuperDocV2Integration}
32
- */
33
- export function createDefaultV2Integration(): SuperDocV2Integration;
34
- /**
35
- * @param {SuperDocV2Integration | null | undefined} integration
36
- * @returns {boolean}
37
- */
38
- export function hasRealV2Integration(integration: SuperDocV2Integration | null | undefined): boolean;
39
- /**
40
- * @typedef {Object} SuperDocV2Integration
41
- * @property {number} version Integration contract version.
42
- * @property {unknown} [capabilities] Optional capability snapshot/hints.
43
- * @property {unknown} EditorComponent Vue component that boots the V2 DOCX editor.
44
- * @property {unknown} [RulerComponent] Optional Vue component for the V2 ruler.
45
- * @property {(...args: unknown[]) => unknown} [createGeometryPublisher] Factory for the V2 geometry publisher.
46
- * @property {(...args: unknown[]) => unknown} [createReviewWindowController] Factory for the committed V2 review-window controller.
47
- * @property {(value: unknown) => boolean} [isSyntheticTrackedChangeCommentLaneItem] Predicate for synthetic tracked-change comment-lane items.
48
- * @property {(value: unknown) => boolean} [isV2SyntheticTrackedChangeRow] Predicate for synthesized V2 tracked-change rows.
49
- */
50
- /** Default version for the local stub integration (V1-compatible). */
51
- export const SUPERDOC_V2_INTEGRATION_VERSION: 1;
52
- export { isSyntheticTrackedChangeCommentLaneItem };
53
- export type SuperDocV2Integration = {
54
- /**
55
- * Integration contract version.
56
- */
3
+ export interface V2GeometryPublishOptions {
4
+ retainMissingTrackedChangeGeometry?: boolean;
5
+ retainedTrackedChangeIds?: Iterable<string>;
6
+ reason?: string;
7
+ }
8
+ export interface V2GeometryPayload {
9
+ mountContainer: HTMLElement | null;
10
+ epoch?: number | null;
11
+ host?: unknown;
12
+ mount?: unknown;
13
+ }
14
+ export type V2CommittedPageWindow = Readonly<Record<string, unknown>>;
15
+ export interface V2GeometryPublisherOptions {
16
+ getLayersContainer: () => HTMLElement | null;
17
+ isCommentsEnabled: () => boolean;
18
+ publishPositions: (positions: Record<string, unknown>, options?: V2GeometryPublishOptions) => void;
19
+ clearPositions: () => void;
20
+ readCurrentPositions?: () => Record<string, unknown>;
21
+ setGeometryAvailable?: (value: boolean) => void;
22
+ }
23
+ export interface V2GeometryPublisher {
24
+ publish(payload: V2GeometryPayload | null, options?: V2GeometryPublishOptions): Promise<void> | void;
25
+ recollect(options?: V2GeometryPublishOptions): Promise<void> | void;
26
+ noteCommittedPageWindow?(window: V2CommittedPageWindow | null | undefined): void;
27
+ reset(): void;
28
+ getLastEpoch(): number | null;
29
+ getLastPayload(): V2GeometryPayload | null;
30
+ }
31
+ export interface V2ReviewWindowContext {
32
+ superdoc: unknown;
33
+ documentId: string;
34
+ commentsAdapter: unknown;
35
+ trackedChangesAdapter: unknown;
36
+ resolveReviewWindow: (input: unknown) => unknown;
37
+ moveFragmentWordIds: (ids: readonly string[]) => unknown;
38
+ }
39
+ export interface V2ReviewWindowResult {
40
+ comments?: {
41
+ items?: readonly unknown[];
42
+ requestedIds?: readonly string[];
43
+ unresolvedCommentIds?: readonly string[];
44
+ };
45
+ trackedChanges?: {
46
+ items?: readonly unknown[];
47
+ requestedIds?: readonly string[];
48
+ unresolvedTargets?: readonly unknown[];
49
+ };
50
+ preparedReview?: unknown;
51
+ }
52
+ export interface V2ReviewWindowControllerOptions {
53
+ applyReviewWindow?: ((context: V2ReviewWindowContext, result: V2ReviewWindowResult) => unknown) | null;
54
+ }
55
+ export interface V2ReviewMutationSettlement {
56
+ outcome: 'aborted' | 'rejected' | 'committed';
57
+ allResolved?: boolean;
58
+ resumeDomains?: readonly ('comments' | 'trackedChanges')[];
59
+ trackedRowCount?: number | null;
60
+ }
61
+ export interface V2ReviewWindowSnapshot {
62
+ readonly status: 'pending' | 'ready' | 'stale';
63
+ readonly [field: string]: unknown;
64
+ }
65
+ export interface V2ReviewWindowDiagnostics {
66
+ generation: number;
67
+ reviewEpoch: number;
68
+ hasContext: boolean;
69
+ inFlight: boolean;
70
+ queued: boolean;
71
+ mutationPaused: boolean;
72
+ records: readonly Record<string, unknown>[];
73
+ }
74
+ export interface V2ReviewWindowController {
75
+ setContext(context: V2ReviewWindowContext | null): void;
76
+ onCommittedPagePaint?(commit: V2CommittedPageWindow): void;
77
+ refreshCommittedWindow(reason?: string): void;
78
+ invalidate(reason?: string): void;
79
+ beginMutation(fact: string | {
80
+ token?: string;
81
+ } | null | undefined): void;
82
+ settleMutation(token: string | undefined, settlement?: V2ReviewMutationSettlement): void;
83
+ reset(reason?: string): void;
84
+ getSnapshot?(): V2ReviewWindowSnapshot | null;
85
+ subscribe?(listener: (snapshot: V2ReviewWindowSnapshot) => void): () => void;
86
+ getDiagnostics(): V2ReviewWindowDiagnostics | null;
87
+ }
88
+ export interface SuperDocV2Integration {
57
89
  version: number;
58
- /**
59
- * Optional capability snapshot/hints.
60
- */
61
- capabilities?: unknown;
62
- /**
63
- * Vue component that boots the V2 DOCX editor.
64
- */
65
- EditorComponent: unknown;
66
- /**
67
- * Optional Vue component for the V2 ruler.
68
- */
69
- RulerComponent?: unknown;
70
- /**
71
- * Factory for the V2 geometry publisher.
72
- */
73
- createGeometryPublisher?: ((...args: unknown[]) => unknown) | undefined;
74
- /**
75
- * Factory for the committed V2 review-window controller.
76
- */
77
- createReviewWindowController?: ((...args: unknown[]) => unknown) | undefined;
78
- /**
79
- * Predicate for synthetic tracked-change comment-lane items.
80
- */
81
- isSyntheticTrackedChangeCommentLaneItem?: ((value: unknown) => boolean) | undefined;
82
- /**
83
- * Predicate for synthesized V2 tracked-change rows.
84
- */
85
- isV2SyntheticTrackedChangeRow?: ((value: unknown) => boolean) | undefined;
86
- };
90
+ capabilities: unknown;
91
+ EditorComponent: Component;
92
+ RulerComponent: Component | null;
93
+ createGeometryPublisher: (options: V2GeometryPublisherOptions) => V2GeometryPublisher;
94
+ createReviewWindowController: (options: V2ReviewWindowControllerOptions) => V2ReviewWindowController;
95
+ isSyntheticTrackedChangeCommentLaneItem: (value: unknown) => boolean;
96
+ isV2SyntheticTrackedChangeRow: (value: unknown) => boolean;
97
+ }
98
+ export declare function configureDefaultV2IntegrationLoader(loader: () => Promise<unknown>): void;
99
+ export declare function loadDefaultV2Integration(): Promise<void>;
100
+ export declare function loadDefaultV2IntegrationOrFallback(): Promise<void>;
101
+ export declare const SUPERDOC_V2_INTEGRATION_VERSION = 1;
102
+ export { isSyntheticTrackedChangeCommentLaneItem };
103
+ export declare function isV2SyntheticTrackedChangeRow(row: unknown): boolean;
104
+ export declare function createStubV2Integration(): SuperDocV2Integration;
105
+ export declare function createDefaultV2Integration(): SuperDocV2Integration;
106
+ export declare function hasRealV2Integration(integration: SuperDocV2Integration | null | undefined): boolean;
@@ -26,6 +26,8 @@ type CommentInvalidationInput = {
26
26
  superdoc?: SuperDoc | null;
27
27
  documentId?: string | null;
28
28
  };
29
+ export declare function mutationCommittedEventChangedVisibleContent(event: Record<string, unknown>): boolean;
30
+ export declare function mutationCommittedEventChangedDocument(event: Record<string, unknown>): boolean;
29
31
  /**
30
32
  * Classify the tracked-change identities carried by a v2 mutation event.
31
33
  *
@@ -12,6 +12,11 @@ type RenderReadinessDiagnostic = {
12
12
  code?: string;
13
13
  reason?: string;
14
14
  severity?: string;
15
+ error?: {
16
+ name?: string;
17
+ message?: string;
18
+ stack?: string;
19
+ };
15
20
  };
16
21
  /**
17
22
  * Translates a `SDDiagnosticRecord`-shaped object (package-open / unzip
@@ -49,51 +49,3 @@ export namespace RESPONSIVE_BREAKPOINTS {
49
49
  let lg: number;
50
50
  let xl: number;
51
51
  }
52
- export namespace HEADLESS_ITEM_MAP {
53
- let undo: string;
54
- let redo: string;
55
- let bold: string;
56
- let italic: string;
57
- let underline: string;
58
- let strike: string;
59
- let acceptTrackedChangeBySelection: string;
60
- let rejectTrackedChangeOnSelection: string;
61
- let ruler: string;
62
- let formattingMarks: string;
63
- let zoom: string;
64
- let measurementUnit: string;
65
- let documentMode: string;
66
- let link: string;
67
- let fontFamily: string;
68
- let fontSize: string;
69
- let list: string;
70
- let numberedlist: string;
71
- let table: string;
72
- let image: string;
73
- let tableOfContents: string;
74
- let color: string;
75
- let highlight: string;
76
- let textAlign: string;
77
- let lineHeight: string;
78
- let linkedStyles: string;
79
- let indentleft: string;
80
- let indentright: string;
81
- let directionLtr: string;
82
- let directionRtl: string;
83
- let clearFormatting: string;
84
- let copyFormat: string;
85
- }
86
- export namespace TABLE_ACTION_COMMAND_MAP {
87
- let addRowBefore: string;
88
- let addRowAfter: string;
89
- let deleteRow: string;
90
- let addColumnBefore: string;
91
- let addColumnAfter: string;
92
- let deleteColumn: string;
93
- let deleteTable: string;
94
- let deleteCellAndTableBorders: string;
95
- let mergeCells: string;
96
- let splitCell: string;
97
- let fixTables: string;
98
- }
99
- export const TABLE_ACTION_COMMAND_IDS: string[];
@@ -2,6 +2,7 @@ import { EventEmitter } from 'eventemitter3';
2
2
  import { App, ComponentPublicInstance, Ref } from 'vue';
3
3
  import { Editor, SuperDoc, ToolbarCustomButton, ToolbarFontOption } from '../../core/types/index.js';
4
4
  import { BorrowedSuperDocUI, CustomCommandRegistrationResult, StyleCatalogItem, ToolbarSnapshotSlice } from '../../public/ui/types.js';
5
+ import { HighContrastMode } from '../../composables/use-high-contrast-mode.js';
5
6
  interface ToolbarItem {
6
7
  type: string;
7
8
  name: Ref<string>;
@@ -61,6 +62,7 @@ type BuiltInToolbarOptions = {
61
62
  hideButtons?: boolean;
62
63
  responsiveToContainer?: boolean;
63
64
  uiDisplayFallbackFont?: string;
65
+ highContrastMode: HighContrastMode;
64
66
  [option: string]: unknown;
65
67
  };
66
68
  /**
@@ -89,7 +91,7 @@ export declare class BuiltInToolbar extends EventEmitter {
89
91
  _customCommandRegs: Map<string, CustomCommandRegistrationResult<CustomButtonPayload>>;
90
92
  _reportedInvalidCustomItems: Set<string>;
91
93
  _lastFontOptionsSignature: string;
92
- constructor(config?: BuiltInToolbarOptions);
94
+ constructor(config: BuiltInToolbarOptions);
93
95
  getAvailableWidth(): number;
94
96
  getToolbarItemByGroup(groupName: string): ToolbarItem[];
95
97
  getToolbarItemByName(name: string): ToolbarItem | undefined;
@@ -120,6 +122,7 @@ export declare class BuiltInToolbar extends EventEmitter {
120
122
  */
121
123
  setActiveEditor(editor: Editor | null): void;
122
124
  onToolbarResize: () => void;
125
+ isCommandEnabled(commandId: string | undefined): boolean;
123
126
  updateToolbarState(): void;
124
127
  /**
125
128
  * Main toolbar command entry point used by the rendered components.
@@ -31,6 +31,21 @@ export interface BuiltInToolbarItemEntry {
31
31
  */
32
32
  readonly note?: string;
33
33
  }
34
+ export declare const TABLE_ACTION_COMMAND_IDS_BY_OPTION: {
35
+ readonly addRowBefore: "table-add-row-before";
36
+ readonly addRowAfter: "table-add-row-after";
37
+ readonly deleteRow: "table-delete-row";
38
+ readonly addColumnBefore: "table-add-column-before";
39
+ readonly addColumnAfter: "table-add-column-after";
40
+ readonly deleteColumn: "table-delete-column";
41
+ readonly deleteTable: "table-delete";
42
+ readonly deleteCellAndTableBorders: "table-remove-borders";
43
+ readonly mergeCells: "table-merge-cells";
44
+ readonly splitCell: "table-split-cell";
45
+ readonly fixTables: "table-fix";
46
+ };
47
+ export declare const TABLE_ACTION_COMMAND_IDS: readonly string[];
48
+ export declare function tableActionCommandId(option: string): string | undefined;
34
49
  /**
35
50
  * The built-in toolbar compatibility catalog. Order groups items the way the
36
51
  * docs present them; it is documentation-only.
@@ -51,6 +66,7 @@ export declare function listBuiltInToolbarItemsByGroup(group: ToolbarGroup): Bui
51
66
  * id, or `null` when the item is not controller-routed.
52
67
  */
53
68
  export declare function resolveToolbarCommandId(name: string): string | null;
69
+ export declare function resolveBuiltInItemCommandId(name: string): string | null;
54
70
  /**
55
71
  * Cross-check the catalog against the V2 command controller catalog so the two
56
72
  * cannot drift. Throws on the first inconsistency. Exercised by the unit tests;
@@ -1,4 +1,4 @@
1
- import { CommentsListQuery as DocumentApiCommentsListQuery, CommentsListResult, TrackChangesListResult, EntityAddress, TextAddress, BookmarkAddress, TextTarget, ScrollIntoViewInput, ScrollIntoViewOutput, SelectionInfo, SelectionTarget, Receipt, ReceiptFailureCode, ContentControlInfo, ContentControlTarget, StyleCatalogItem, StyleCatalogDiagnostic, StyleCatalogSourceStatus, StylesGetCatalogInput, StylesGetCatalogResult } from '../../../../document-api/src/index.js';
1
+ import { CommentsListQuery as DocumentApiCommentsListQuery, CommentsListResult, TrackChangesListResult, EntityAddress, TextAddress, BookmarkAddress, TextTarget, ScrollIntoViewInput, ScrollIntoViewOutput, SelectionInfo, SelectionTarget, Receipt, ReceiptFailureCode, ContentControlInfo, ContentControlTarget, StyleCatalogItem, StyleCatalogDiagnostic, StyleCatalogSourceStatus, StylesGetCatalogInput, StylesGetCatalogResult, StoryLocator as DocumentStoryLocator } from '../../../../document-api/src/index.js';
2
2
  import { BrowserDocumentApi, PartialBrowserDocumentApi } from '../browser-document-api.js';
3
3
  import { ExportParams } from '../export-types.js';
4
4
  import { SuperDocVisualHandle, SuperDocVisualOptions } from '../../core/extensions/types.js';
@@ -671,6 +671,25 @@ export interface ZoomSlice {
671
671
  /** @deprecated Fit-width upper bound alias. Use `fitWidth.max`; this does not limit manual zoom. */
672
672
  max: number;
673
673
  }
674
+ export interface HistorySlice {
675
+ canUndo: boolean;
676
+ canRedo: boolean;
677
+ undoDepth: number;
678
+ redoDepth: number;
679
+ }
680
+ export interface SuperDocDocumentChange {
681
+ documentEpoch: string;
682
+ seq: number;
683
+ cause: 'user' | 'api' | 'undo' | 'redo' | 'remote';
684
+ changeTag: string | null;
685
+ txId: string | null;
686
+ scope: {
687
+ kind: 'known';
688
+ stories: DocumentStoryLocator[];
689
+ } | {
690
+ kind: 'unknown';
691
+ };
692
+ }
674
693
  /** Document-level state slice. */
675
694
  export interface DocumentSlice {
676
695
  /** The active editor is ready. */
@@ -1217,6 +1236,7 @@ export interface ToolbarHandle extends SnapshotSubscribable<ToolbarSnapshotSlice
1217
1236
  /** Execute a toolbar command by id and await its settled result. */
1218
1237
  executeAsync(id: ToolbarCommandId, payload?: unknown): Promise<CommandExecutionResult>;
1219
1238
  }
1239
+ export type HistoryHandle = SnapshotSubscribable<HistorySlice>;
1220
1240
  /** Zoom handle. */
1221
1241
  export interface ZoomHandle extends SnapshotSubscribable<ZoomSlice> {
1222
1242
  /** Set an absolute zoom percentage (100 = 100%). */
@@ -1238,6 +1258,21 @@ export interface DocumentHandle extends SnapshotSubscribable<DocumentSlice> {
1238
1258
  replaceFile(file: File | Blob | ArrayBuffer | Uint8Array): Promise<unknown> | undefined;
1239
1259
  /** Replace mounted content. Operational errors reject; an unavailable host returns `ok: false`. */
1240
1260
  replaceDocument(file: File | Blob | ArrayBuffer | Uint8Array): Promise<DocumentReplacementResult>;
1261
+ onChange(listener: (change: SuperDocDocumentChange) => void): () => void;
1262
+ getVersion(): DocumentVersion | null;
1263
+ markClean(version?: DocumentVersion): DocumentMarkCleanResult;
1264
+ }
1265
+ export type DocumentVersion = string & {
1266
+ readonly __documentVersion: unique symbol;
1267
+ };
1268
+ export type DocumentMarkCleanResult = {
1269
+ ok: true;
1270
+ } | {
1271
+ ok: false;
1272
+ reason: 'document-changed' | 'unavailable';
1273
+ };
1274
+ export interface ScopedDocumentHandle {
1275
+ onChange(listener: (change: SuperDocDocumentChange) => void): () => void;
1241
1276
  }
1242
1277
  /** Viewport handle. */
1243
1278
  export interface ViewportHandle {
@@ -1589,6 +1624,7 @@ export interface SuperDocUIState {
1589
1624
  contentControls: ContentControlsSlice;
1590
1625
  /** Zoom slice. */
1591
1626
  zoom: ZoomSlice;
1627
+ history: HistorySlice;
1592
1628
  /** Fonts slice. */
1593
1629
  fonts: FontsSlice;
1594
1630
  /** Styles slice (read-only catalogue + active paragraph style). */
@@ -1618,6 +1654,7 @@ export interface SuperDocUIScope {
1618
1654
  /** Subscribe within the scope. */
1619
1655
  select<TSlice>(selector: SelectorFn<SuperDocUIState, TSlice>, equality?: EqualityFn<TSlice>): Subscribable<TSlice>;
1620
1656
  readonly decorations: DecorationsHandle;
1657
+ readonly document: ScopedDocumentHandle;
1621
1658
  /** Dispose every subscription created within the scope. */
1622
1659
  dispose(): void;
1623
1660
  }
@@ -1650,6 +1687,7 @@ export interface SuperDocUI {
1650
1687
  readonly fonts: FontsHandle;
1651
1688
  /** Zoom surface. */
1652
1689
  readonly zoom: ZoomHandle;
1690
+ readonly history: HistoryHandle;
1653
1691
  /** Document surface. */
1654
1692
  readonly document: DocumentHandle;
1655
1693
  /** Viewport / geometry surface. */
@@ -39,15 +39,19 @@ import type { DocumentApi as __Cjs_DocumentApi } from './ui.js' with { "resoluti
39
39
  import type { DocumentApiRejectionDetails as __Cjs_DocumentApiRejectionDetails } from './ui.js' with { "resolution-mode": "import" };
40
40
  import type { DocumentApiRejectionReason as __Cjs_DocumentApiRejectionReason } from './ui.js' with { "resolution-mode": "import" };
41
41
  import type { DocumentHandle as __Cjs_DocumentHandle } from './ui.js' with { "resolution-mode": "import" };
42
+ import type { DocumentMarkCleanResult as __Cjs_DocumentMarkCleanResult } from './ui.js' with { "resolution-mode": "import" };
42
43
  import type { DocumentReplacementResult as __Cjs_DocumentReplacementResult } from './ui.js' with { "resolution-mode": "import" };
43
44
  import type { DocumentSlice as __Cjs_DocumentSlice } from './ui.js' with { "resolution-mode": "import" };
44
45
  import type { DocumentStoryLocator as __Cjs_DocumentStoryLocator } from './ui.js' with { "resolution-mode": "import" };
46
+ import type { DocumentVersion as __Cjs_DocumentVersion } from './ui.js' with { "resolution-mode": "import" };
45
47
  import type { EntityAddress as __Cjs_EntityAddress } from './ui.js' with { "resolution-mode": "import" };
46
48
  import type { EqualityFn as __Cjs_EqualityFn } from './ui.js' with { "resolution-mode": "import" };
47
49
  import type { FontFamilyOption as __Cjs_FontFamilyOption } from './ui.js' with { "resolution-mode": "import" };
48
50
  import type { FontsHandle as __Cjs_FontsHandle } from './ui.js' with { "resolution-mode": "import" };
49
51
  import type { FontSizeOption as __Cjs_FontSizeOption } from './ui.js' with { "resolution-mode": "import" };
50
52
  import type { FontsSlice as __Cjs_FontsSlice } from './ui.js' with { "resolution-mode": "import" };
53
+ import type { HistoryHandle as __Cjs_HistoryHandle } from './ui.js' with { "resolution-mode": "import" };
54
+ import type { HistorySlice as __Cjs_HistorySlice } from './ui.js' with { "resolution-mode": "import" };
51
55
  import type { MetadataHandle as __Cjs_MetadataHandle } from './ui.js' with { "resolution-mode": "import" };
52
56
  import type { OperationCall as __Cjs_OperationCall } from './ui.js' with { "resolution-mode": "import" };
53
57
  import type { OperationCapabilityResolveResult as __Cjs_OperationCapabilityResolveResult } from './ui.js' with { "resolution-mode": "import" };
@@ -64,6 +68,7 @@ import type { PictureWatermarkInput as __Cjs_PictureWatermarkInput } from './ui.
64
68
  import type { Receipt as __Cjs_Receipt } from './ui.js' with { "resolution-mode": "import" };
65
69
  import type { RetainedPictureWatermarkInput as __Cjs_RetainedPictureWatermarkInput } from './ui.js' with { "resolution-mode": "import" };
66
70
  import type { RichContentInsertInput as __Cjs_RichContentInsertInput } from './ui.js' with { "resolution-mode": "import" };
71
+ import type { ScopedDocumentHandle as __Cjs_ScopedDocumentHandle } from './ui.js' with { "resolution-mode": "import" };
67
72
  import type { ScrollIntoViewInput as __Cjs_ScrollIntoViewInput } from './ui.js' with { "resolution-mode": "import" };
68
73
  import type { ScrollIntoViewOutput as __Cjs_ScrollIntoViewOutput } from './ui.js' with { "resolution-mode": "import" };
69
74
  import type { SDHtmlMarkdownSupportCheckResult as __Cjs_SDHtmlMarkdownSupportCheckResult } from './ui.js' with { "resolution-mode": "import" };
@@ -98,6 +103,7 @@ import type { StylesHandle as __Cjs_StylesHandle } from './ui.js' with { "resolu
98
103
  import type { StylesSlice as __Cjs_StylesSlice } from './ui.js' with { "resolution-mode": "import" };
99
104
  import type { StylesUpdateToMatchSelectionInput as __Cjs_StylesUpdateToMatchSelectionInput } from './ui.js' with { "resolution-mode": "import" };
100
105
  import type { Subscribable as __Cjs_Subscribable } from './ui.js' with { "resolution-mode": "import" };
106
+ import type { SuperDocDocumentChange as __Cjs_SuperDocDocumentChange } from './ui.js' with { "resolution-mode": "import" };
101
107
  import type { SuperDocEditorLike as __Cjs_SuperDocEditorLike } from './ui.js' with { "resolution-mode": "import" };
102
108
  import type { SuperDocLike as __Cjs_SuperDocLike } from './ui.js' with { "resolution-mode": "import" };
103
109
  import type { SuperDocUI as __Cjs_SuperDocUI } from './ui.js' with { "resolution-mode": "import" };
@@ -192,9 +198,11 @@ export type { __Cjs_DocumentApi as DocumentApi };
192
198
  export type { __Cjs_DocumentApiRejectionDetails as DocumentApiRejectionDetails };
193
199
  export type { __Cjs_DocumentApiRejectionReason as DocumentApiRejectionReason };
194
200
  export type { __Cjs_DocumentHandle as DocumentHandle };
201
+ export type { __Cjs_DocumentMarkCleanResult as DocumentMarkCleanResult };
195
202
  export type { __Cjs_DocumentReplacementResult as DocumentReplacementResult };
196
203
  export type { __Cjs_DocumentSlice as DocumentSlice };
197
204
  export type { __Cjs_DocumentStoryLocator as DocumentStoryLocator };
205
+ export type { __Cjs_DocumentVersion as DocumentVersion };
198
206
  export type { __Cjs_EntityAddress as EntityAddress };
199
207
  export type { __Cjs_EqualityFn as EqualityFn };
200
208
  export type { __Cjs_FontFamilyOption as FontFamilyOption };
@@ -202,6 +210,8 @@ export type { __Cjs_FontsHandle as FontsHandle };
202
210
  export type { __Cjs_FontSizeOption as FontSizeOption };
203
211
  export type { __Cjs_FontsSlice as FontsSlice };
204
212
  export declare const getDocumentApiRejectionReason: typeof import('./ui.js', { with: { "resolution-mode": "import" } }).getDocumentApiRejectionReason;
213
+ export type { __Cjs_HistoryHandle as HistoryHandle };
214
+ export type { __Cjs_HistorySlice as HistorySlice };
205
215
  export type { __Cjs_MetadataHandle as MetadataHandle };
206
216
  export type { __Cjs_OperationCall as OperationCall };
207
217
  export type { __Cjs_OperationCapabilityResolveResult as OperationCapabilityResolveResult };
@@ -218,6 +228,7 @@ export type { __Cjs_PictureWatermarkInput as PictureWatermarkInput };
218
228
  export type { __Cjs_Receipt as Receipt };
219
229
  export type { __Cjs_RetainedPictureWatermarkInput as RetainedPictureWatermarkInput };
220
230
  export type { __Cjs_RichContentInsertInput as RichContentInsertInput };
231
+ export type { __Cjs_ScopedDocumentHandle as ScopedDocumentHandle };
221
232
  export type { __Cjs_ScrollIntoViewInput as ScrollIntoViewInput };
222
233
  export type { __Cjs_ScrollIntoViewOutput as ScrollIntoViewOutput };
223
234
  export type { __Cjs_SDHtmlMarkdownSupportCheckResult as SDHtmlMarkdownSupportCheckResult };
@@ -253,6 +264,7 @@ export type { __Cjs_StylesHandle as StylesHandle };
253
264
  export type { __Cjs_StylesSlice as StylesSlice };
254
265
  export type { __Cjs_StylesUpdateToMatchSelectionInput as StylesUpdateToMatchSelectionInput };
255
266
  export type { __Cjs_Subscribable as Subscribable };
267
+ export type { __Cjs_SuperDocDocumentChange as SuperDocDocumentChange };
256
268
  export type { __Cjs_SuperDocEditorLike as SuperDocEditorLike };
257
269
  export type { __Cjs_SuperDocLike as SuperDocLike };
258
270
  export type { __Cjs_SuperDocUI as SuperDocUI };
@@ -18,5 +18,5 @@ export { createSuperDocUI } from './ui/create-super-doc-ui.js';
18
18
  export { getDocumentApiRejectionReason } from './ui/rejection-reasons.js';
19
19
  export { shallowEqual } from './ui/equality.js';
20
20
  export { BUILT_IN_COMMAND_IDS } from './ui/commands.js';
21
- export type { EqualityFn, SelectorFn, Subscribable, SuperDocUI, BorrowedSuperDocUI, SuperDocUIOptions, SuperDocUIState, SuperDocUIScope, SuperDocLike, SuperDocEditorLike, CommandHandle, CommandState, CommandExecutionResult, WorkflowReceipt, WorkflowActionResult, WorkflowScrollResult, SelectionRestoreResult, SuperDocUIReason, CommandId, CommandsHandle, ContextMenuItem, ContextMenuHandle, WatermarkHandle, SearchController, SearchHandle, SearchQueryOptions, CustomCommandContext, CustomCommandHandle, CustomCommandHandleState, CustomCommandRegistration, CustomCommandRegistrationResult, MetadataHandle, SelectionHandle, TablesHandle, TableContextInfo, ToolbarHandle, BuiltInCommandId, ToolbarCommandId, CommentsHandle, TrackChangesHandle, ContentControlsHandle, BookmarksHandle, BookmarkAddress, ContentControlFocusResult, ContentControlHighlightResult, FontsHandle, ZoomHandle, DocumentHandle, DocumentReplacementResult, ViewportHandle, DecorationsHandle, DecorationPointerEvent, StylesHandle, StylesUpdateToMatchSelectionInput, ActiveParagraphStyle, SliceStatus, SelectionSlice, SelectionCapture, CommentAnchorCapture, ToolbarSnapshotSlice, CommentsSlice, TrackChangesSlice, ContentControlsSlice, FontsSlice, ZoomSlice, DocumentSlice, StylesSlice, SearchSnapshot, SearchSlice, StyleCatalogView, StyleCatalogItemType, StyleCatalogFilterType, StyleProvenance, StyleCatalogItemVisibility, StyleCatalogItemUsage, StyleCatalogItemPreview, StyleCatalogItem, StyleCatalogDefaults, StyleCatalogDiagnostic, StyleCatalogSourceStatus, StylesGetCatalogInput, StylesGetCatalogResult, CommentInfo, CommentsListQuery, TrackChangeInfo, TrackChangePointHit, TrackChangesItem, FontFamilyOption, FontSizeOption, CommentAddress, TrackedChangeAddress, ContentControlViewportAddress, ViewportEntityAddress, ViewportEntityHit, ViewportContext, ViewportRect, ViewportGetRectInput, ViewportGetRectTarget, ViewportGetRectsInput, ViewportGetRectsResult, ViewportRectResult, BrowserDocumentApi, PartialBrowserDocumentApi, DocumentApi, Receipt, DocumentApiRejectionReason, DocumentApiRejectionDetails, TextRangeRejectionReason, ContentControlCreationRejectionReason, SelectionInfo, SelectionTarget, SelectionPoint, TextTarget, TextAddress, ScrollIntoViewInput, ScrollIntoViewOutput, EntityAddress, CommentsListResult, TrackChangesListResult, ContentControlsListResult, ContentControlInfo, ContentControlTarget, RichContentInsertInput, OperationCapabilityResolveResult, SDHtmlMarkdownSupportCheckResult, PictureWatermarkInput, RetainedPictureWatermarkInput, TextWatermark, WatermarkInfo, WatermarkTarget, WatermarksApplyInput, WatermarksApplyResult, WatermarksApplySuccess, WatermarksApplyTarget, TemporaryMutationOperation, TemporaryOperationResultTarget, TemporaryOperationEffects, TemporaryMutationInput, TemporaryMutationReplaceInput, TemporaryMutationHandleInput, TemporaryMutationReceipt, DocumentStoryLocator, OperationId, OperationCall, OperationInput, OperationOptions, OperationOutput, } from './ui/types.js';
21
+ export type { EqualityFn, SelectorFn, Subscribable, SuperDocUI, BorrowedSuperDocUI, SuperDocUIOptions, SuperDocUIState, SuperDocUIScope, SuperDocLike, SuperDocEditorLike, CommandHandle, CommandState, CommandExecutionResult, WorkflowReceipt, WorkflowActionResult, WorkflowScrollResult, SelectionRestoreResult, SuperDocUIReason, CommandId, CommandsHandle, ContextMenuItem, ContextMenuHandle, WatermarkHandle, SearchController, SearchHandle, SearchQueryOptions, CustomCommandContext, CustomCommandHandle, CustomCommandHandleState, CustomCommandRegistration, CustomCommandRegistrationResult, MetadataHandle, SelectionHandle, TablesHandle, TableContextInfo, ToolbarHandle, BuiltInCommandId, ToolbarCommandId, CommentsHandle, TrackChangesHandle, ContentControlsHandle, BookmarksHandle, BookmarkAddress, ContentControlFocusResult, ContentControlHighlightResult, FontsHandle, ZoomHandle, HistoryHandle, DocumentHandle, DocumentReplacementResult, SuperDocDocumentChange, DocumentVersion, DocumentMarkCleanResult, ScopedDocumentHandle, ViewportHandle, DecorationsHandle, DecorationPointerEvent, StylesHandle, StylesUpdateToMatchSelectionInput, ActiveParagraphStyle, SliceStatus, SelectionSlice, SelectionCapture, CommentAnchorCapture, ToolbarSnapshotSlice, CommentsSlice, TrackChangesSlice, ContentControlsSlice, FontsSlice, ZoomSlice, HistorySlice, DocumentSlice, StylesSlice, SearchSnapshot, SearchSlice, StyleCatalogView, StyleCatalogItemType, StyleCatalogFilterType, StyleProvenance, StyleCatalogItemVisibility, StyleCatalogItemUsage, StyleCatalogItemPreview, StyleCatalogItem, StyleCatalogDefaults, StyleCatalogDiagnostic, StyleCatalogSourceStatus, StylesGetCatalogInput, StylesGetCatalogResult, CommentInfo, CommentsListQuery, TrackChangeInfo, TrackChangePointHit, TrackChangesItem, FontFamilyOption, FontSizeOption, CommentAddress, TrackedChangeAddress, ContentControlViewportAddress, ViewportEntityAddress, ViewportEntityHit, ViewportContext, ViewportRect, ViewportGetRectInput, ViewportGetRectTarget, ViewportGetRectsInput, ViewportGetRectsResult, ViewportRectResult, BrowserDocumentApi, PartialBrowserDocumentApi, DocumentApi, Receipt, DocumentApiRejectionReason, DocumentApiRejectionDetails, TextRangeRejectionReason, ContentControlCreationRejectionReason, SelectionInfo, SelectionTarget, SelectionPoint, TextTarget, TextAddress, ScrollIntoViewInput, ScrollIntoViewOutput, EntityAddress, CommentsListResult, TrackChangesListResult, ContentControlsListResult, ContentControlInfo, ContentControlTarget, RichContentInsertInput, OperationCapabilityResolveResult, SDHtmlMarkdownSupportCheckResult, PictureWatermarkInput, RetainedPictureWatermarkInput, TextWatermark, WatermarkInfo, WatermarkTarget, WatermarksApplyInput, WatermarksApplyResult, WatermarksApplySuccess, WatermarksApplyTarget, TemporaryMutationOperation, TemporaryOperationResultTarget, TemporaryOperationEffects, TemporaryMutationInput, TemporaryMutationReplaceInput, TemporaryMutationHandleInput, TemporaryMutationReceipt, DocumentStoryLocator, OperationId, OperationCall, OperationInput, OperationOptions, OperationOutput, } from './ui/types.js';
22
22
  export type { PageMetricsHandle, PageMetricsSnapshot, PageMetricsPage, PageBodyTarget } from './ui/page-metrics.js';