superdoc 2.29.0 → 2.30.0-next.9

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 (130) hide show
  1. package/README.md +127 -25
  2. package/dist/chunks/{FindReplaceSurface-B_5ggdWg.es.js → FindReplaceSurface-BEnRLpD9.es.js} +1 -1
  3. package/dist/chunks/{FindReplaceSurface-fVHxPXtn.cjs → FindReplaceSurface-DWXgWgg7.cjs} +1 -1
  4. package/dist/chunks/{PasswordPromptSurface-CZqhDQQ1.es.js → PasswordPromptSurface-DjV1JgjD.es.js} +1 -1
  5. package/dist/chunks/{PasswordPromptSurface-x8GNmMJT.cjs → PasswordPromptSurface-VFPnQOML.cjs} +1 -1
  6. package/dist/chunks/{PdfViewer-CW09MNrB.es.js → PdfViewer-C2r-K8zC.es.js} +1 -1
  7. package/dist/chunks/{PdfViewer-CkrAHpC-.cjs → PdfViewer-DYTbPVUr.cjs} +1 -1
  8. package/dist/chunks/{_plugin-vue_export-helper-BkbCxNeT.cjs → _plugin-vue_export-helper-BzM2_tVU.cjs} +9 -0
  9. package/dist/chunks/{_plugin-vue_export-helper-DRPRMkeA.es.js → _plugin-vue_export-helper-CmkaJDnr.es.js} +4 -1
  10. package/dist/chunks/{create-super-doc-ui-Dc8dQAMc.es.js → create-super-doc-ui-Cq8trPVC.es.js} +3179 -2639
  11. package/dist/chunks/{create-super-doc-ui-L60GhVAX.cjs → create-super-doc-ui-FH5GSHph.cjs} +3197 -2651
  12. package/dist/collaboration-upgrade-engine.cjs +1 -1
  13. package/dist/collaboration-upgrade-engine.es.js +1 -1
  14. package/dist/document-api/src/changes/changes.d.ts +26 -0
  15. package/dist/document-api/src/changes/changes.types.d.ts +156 -0
  16. package/dist/document-api/src/comments/comment-create-attribution.d.ts +4 -0
  17. package/dist/document-api/src/comments/comments.types.d.ts +4 -0
  18. package/dist/document-api/src/contract/command-catalog.d.ts +1 -1
  19. package/dist/document-api/src/contract/operation-definitions.d.ts +76 -8
  20. package/dist/document-api/src/contract/operation-registry.d.ts +2 -2
  21. package/dist/document-api/src/contract/schemas.d.ts +7 -1
  22. package/dist/document-api/src/create/create.d.ts +0 -4
  23. package/dist/document-api/src/diff/diff.types.d.ts +6 -6
  24. package/dist/document-api/src/header-footers/header-footers.d.ts +1 -3
  25. package/dist/document-api/src/index.d.ts +13 -1
  26. package/dist/document-api/src/inline-semantics/token-sets.d.ts +0 -2
  27. package/dist/document-api/src/insert/insert.d.ts +0 -1
  28. package/dist/document-api/src/paragraphs/paragraphs.d.ts +8 -3
  29. package/dist/document-api/src/paragraphs/paragraphs.types.d.ts +49 -5
  30. package/dist/document-api/src/tables/data/table-preset-appearance.generated.d.ts +2 -0
  31. package/dist/document-api/src/tables/table-style-presets.d.ts +73 -0
  32. package/dist/document-api/src/tables/tables.d.ts +4 -1
  33. package/dist/document-api/src/types/sd-props.d.ts +7 -0
  34. package/dist/document-api/src/types/table-operations.types.d.ts +12 -15
  35. package/dist/layout-engine/contracts/src/index.d.ts +4 -1
  36. package/dist/layout-engine/contracts/src/table-cell-vector-overlay.d.ts +2 -0
  37. package/dist/layout-engine/dom-contract/src/data-attrs.d.ts +4 -0
  38. package/dist/layout-engine/layout-bridge/src/coupled-footnote-pagination.d.ts +1 -0
  39. package/dist/layout-engine/layout-bridge/src/footnote-page-certificate.d.ts +1 -0
  40. package/dist/layout-engine/layout-bridge/src/footnote-page-planner.d.ts +5 -0
  41. package/dist/layout-engine/layout-bridge/src/incrementalLayout.d.ts +1 -0
  42. package/dist/layout-engine/layout-engine/src/footnote-page-flow.d.ts +3 -0
  43. package/dist/layout-engine/layout-engine/src/index.d.ts +7 -0
  44. package/dist/layout-engine/layout-engine/src/layout-paragraph.d.ts +5 -0
  45. package/dist/layout-engine/layout-engine/src/layout-table.d.ts +3 -1
  46. package/dist/layout-engine/layout-engine/src/layout-utils.d.ts +0 -4
  47. package/dist/layout-engine/layout-engine/src/paginator.d.ts +4 -0
  48. package/dist/layout-engine/painters/dom/src/index.d.ts +2 -0
  49. package/dist/layout-engine/painters/dom/src/paragraph/list-marker.d.ts +1 -1
  50. package/dist/layout-engine/painters/dom/src/paragraph/renderParagraphContent.d.ts +1 -1
  51. package/dist/layout-engine/painters/dom/src/styles.d.ts +0 -10
  52. package/dist/layout-engine/painters/dom/src/svg-utils.d.ts +1 -13
  53. package/dist/public/ui-react.cjs +1 -1
  54. package/dist/public/ui-react.es.js +1 -1
  55. package/dist/public/ui-vue.cjs +1 -1
  56. package/dist/public/ui-vue.es.js +1 -1
  57. package/dist/public/ui.cjs +1 -1
  58. package/dist/public/ui.es.js +1 -1
  59. package/dist/shared/common/Telemetry.d.ts +50 -0
  60. package/dist/shared/common/event-types.d.ts +13 -0
  61. package/dist/shared/font-system/src/bundled-face-names.d.ts +1 -0
  62. package/dist/shared/font-system/src/resolver.d.ts +1 -0
  63. package/dist/style.css +1 -1
  64. package/dist/style.layered.css +1 -1
  65. package/dist/superdoc/src/components/CommentsLayer/CommentDialog.vue.d.ts +17 -33
  66. package/dist/superdoc/src/components/CommentsLayer/collect-tracked-change-thread.d.ts +6 -4
  67. package/dist/superdoc/src/components/CommentsLayer/comment-params.d.ts +84 -0
  68. package/dist/superdoc/src/components/CommentsLayer/use-comment.d.ts +15 -95
  69. package/dist/superdoc/src/components/Whiteboard/use-whiteboard.d.ts +30 -9
  70. package/dist/superdoc/src/composables/use-comment-sidebar.d.ts +6 -0
  71. package/dist/superdoc/src/composables/use-document.d.ts +51 -99
  72. package/dist/superdoc/src/core/SuperDoc.d.ts +12 -3
  73. package/dist/superdoc/src/core/collaboration/cdn-collaboration-comment-map.d.ts +1 -0
  74. package/dist/superdoc/src/core/collaboration/collaboration-comment-map.d.ts +2 -0
  75. package/dist/superdoc/src/core/collaboration/helpers.d.ts +1 -1
  76. package/dist/superdoc/src/core/config/normalize-interaction-config.d.ts +10 -1
  77. package/dist/superdoc/src/core/document-open-telemetry.d.ts +1 -1
  78. package/dist/superdoc/src/core/editor-runtime/types.d.ts +4 -0
  79. package/dist/superdoc/src/core/editor-runtime/v2/v2-editor-runtime-adapter.d.ts +1 -0
  80. package/dist/superdoc/src/core/types/index.d.ts +110 -39
  81. package/dist/superdoc/src/helpers/deprecation.d.ts +12 -3
  82. package/dist/superdoc/src/helpers/object-guards.d.ts +1 -0
  83. package/dist/superdoc/src/helpers/v2-review-geometry-delivery.d.ts +22 -0
  84. package/dist/superdoc/src/internal/toolbar/built-in/ToolbarButton.vue.d.ts +1 -0
  85. package/dist/superdoc/src/public/content-control-ref.d.ts +12 -0
  86. package/dist/superdoc/src/public/index.d.cts +20 -0
  87. package/dist/superdoc/src/public/index.d.ts +4 -1
  88. package/dist/superdoc/src/public/ui/async-read-cache.d.ts +32 -0
  89. package/dist/superdoc/src/public/ui/block-commands.d.ts +39 -0
  90. package/dist/superdoc/src/public/ui/command-results.d.ts +39 -0
  91. package/dist/superdoc/src/public/ui/create-super-doc-ui.d.ts +1 -17
  92. package/dist/superdoc/src/public/ui/document-change-records.d.ts +7 -0
  93. package/dist/superdoc/src/public/ui/entity-rows.d.ts +14 -0
  94. package/dist/superdoc/src/public/ui/font-options.d.ts +7 -0
  95. package/dist/superdoc/src/public/ui/format-painter-paragraph.d.ts +7 -0
  96. package/dist/superdoc/src/public/ui/format-painter-state.d.ts +29 -0
  97. package/dist/superdoc/src/public/ui/heavy-read-policy.d.ts +11 -0
  98. package/dist/superdoc/src/public/ui/host-events.d.ts +3 -0
  99. package/dist/superdoc/src/public/ui/inline-values.d.ts +79 -0
  100. package/dist/superdoc/src/public/ui/loose-record.d.ts +4 -0
  101. package/dist/superdoc/src/public/ui/reasons.d.ts +1 -0
  102. package/dist/superdoc/src/public/ui/selection-targets.d.ts +47 -0
  103. package/dist/superdoc/src/public/ui/shared-tracked-changes-catalog.d.ts +16 -0
  104. package/dist/superdoc/src/public/ui/tracked-change-ids.d.ts +51 -0
  105. package/dist/superdoc/src/public/ui/types.d.ts +12 -2
  106. package/dist/superdoc/src/public/ui/ui-bench-timing.d.ts +9 -0
  107. package/dist/superdoc/src/public/ui.d.cts +14 -0
  108. package/dist/superdoc/src/public/ui.d.ts +1 -1
  109. package/dist/superdoc/src/stores/comments-store.d.ts +23022 -546
  110. package/dist/superdoc/src/stores/helpers/comment-grouping.d.ts +1 -1
  111. package/dist/superdoc/src/stores/helpers/comment-identity.d.ts +10 -10
  112. package/dist/superdoc/src/stores/helpers/review-presentation.d.ts +91 -0
  113. package/dist/superdoc/src/stores/helpers/tracked-change-identity.d.ts +4 -2
  114. package/dist/superdoc/src/stores/helpers/tracked-change-row-values.d.ts +1 -8
  115. package/dist/superdoc/src/stores/helpers/tracked-change-thread-index.d.ts +1 -1
  116. package/dist/superdoc/src/stores/helpers/v2-review-adapters.d.ts +147 -0
  117. package/dist/superdoc/src/stores/superdoc-store.d.ts +12 -2895
  118. package/dist/superdoc.cjs +837 -442
  119. package/dist/superdoc.es.js +837 -442
  120. package/dist/word-layout/src/marker-utils.d.ts +0 -5
  121. package/dist/word-layout/src/unit-conversions.d.ts +0 -1
  122. package/dist-cdn/style.layered.css +1 -1
  123. package/dist-cdn/superdoc.min.css +1 -1
  124. package/dist-cdn/superdoc.min.js +38 -42
  125. package/package.json +12 -3
  126. package/dist/document-api/src/diff/index.d.ts +0 -3
  127. package/dist/document-api/src/write/locator.d.ts +0 -24
  128. package/dist/layout-engine/painters/dom/src/features/feature-registry.d.ts +0 -41
  129. package/dist/superdoc/src/internal/toolbar/built-in/format-negation.d.ts +0 -11
  130. package/dist/word-layout/src/tab-layout.d.ts +0 -193
@@ -0,0 +1,11 @@
1
+ import { SliceStatus } from './types.js';
2
+ export interface HeavyDocReadPolicyEntry {
3
+ key: string;
4
+ match: 'exact' | 'prefix';
5
+ note: string;
6
+ }
7
+ export declare const HEAVY_DOC_READ_POLICY: readonly HeavyDocReadPolicyEntry[];
8
+ export declare const COMMENTS_CATALOG_PART_URIS: ReadonlySet<string>;
9
+ export declare function isHeavyDocReadKey(key: string): boolean;
10
+ export declare const STATUS_RANK: Record<SliceStatus, number>;
11
+ export declare function combineStatus(...statuses: readonly SliceStatus[]): SliceStatus;
@@ -0,0 +1,3 @@
1
+ import { ContentControlClickPayload } from './types.js';
2
+ export declare const HOST_EVENTS: readonly ["document-replaced", "editorCreate", "active-editor-change", "document-mode-change", "formatting-marks-change", "zoomChange", "measurement-unit-change", "viewport-change", "fonts-changed"];
3
+ export declare function isContentControlClickPayload(value: unknown): value is ContentControlClickPayload;
@@ -0,0 +1,79 @@
1
+ import { SelectionSlice, SelectionTarget, SuperDocUIState } from './types.js';
2
+ import { LooseRecord } from './loose-record.js';
3
+ import { CommandDescriptor } from './commands.js';
4
+ export type EffectiveInlineUniformityState = {
5
+ state: 'uniform';
6
+ value: string;
7
+ } | {
8
+ state: 'mixed' | 'unresolvable' | 'absent';
9
+ };
10
+ export declare function readEffectiveInlineUniformityStates(raw: unknown): Record<string, EffectiveInlineUniformityState> | null;
11
+ export type SelectionTextSegment = {
12
+ blockId: string;
13
+ start: number;
14
+ end: number;
15
+ };
16
+ export declare const PROJECTED_INLINE_SELECTION_VALUE_KEYS: readonly ["fontFamily", "fontSize", "color", "highlight"];
17
+ export type ProjectedInlineSelectionValueKey = (typeof PROJECTED_INLINE_SELECTION_VALUE_KEYS)[number];
18
+ export type ProjectedInlineSelectionValues = Partial<Record<ProjectedInlineSelectionValueKey, string>>;
19
+ export declare const EFFECTIVE_MARK_KEYS: readonly ["bold", "italic", "underline", "strikethrough"];
20
+ export type EffectiveMarkKey = (typeof EFFECTIVE_MARK_KEYS)[number];
21
+ export type EffectiveMarkValues = Partial<Record<EffectiveMarkKey, boolean>>;
22
+ export type OptimisticInlineSelectionValue = {
23
+ selectionSignature: string;
24
+ value: string;
25
+ };
26
+ export type OptimisticInlineToggle = {
27
+ selectionSignature: string;
28
+ active: boolean;
29
+ generation: number;
30
+ settled: boolean;
31
+ editorSource: unknown;
32
+ documentSource: unknown;
33
+ documentMode: SuperDocUIState['documentMode'];
34
+ };
35
+ export type OptimisticParagraphAlignment = {
36
+ selectionSignature: string;
37
+ value: 'left' | 'center' | 'right' | 'justify';
38
+ generation: number;
39
+ settled: boolean;
40
+ canReconcile: boolean;
41
+ };
42
+ export type PendingInlineToggleMutation = {
43
+ key: string;
44
+ mutate: () => unknown;
45
+ result: Promise<unknown>;
46
+ resolve: (value: unknown | PromiseLike<unknown>) => void;
47
+ };
48
+ export declare function isProjectedInlineSelectionValueKey(value: string): value is ProjectedInlineSelectionValueKey;
49
+ export declare function selectionTextSegments(selection: SelectionSlice): SelectionTextSegment[];
50
+ export declare function selectionStoryLocator(selection: SelectionSlice): unknown | undefined;
51
+ export declare function selectionInlineValueStorySignature(selection: SelectionSlice): string;
52
+ export declare function selectionInlineValueSignature(selection: SelectionSlice): string | null;
53
+ export declare function selectionEffectiveUniformitySignature(selection: SelectionSlice): string | null;
54
+ export declare function normalizeOptimisticInlineSelectionValue(key: ProjectedInlineSelectionValueKey, value: unknown): string | null;
55
+ export declare function rangesOverlap(left: {
56
+ start: number;
57
+ end: number;
58
+ }, right: {
59
+ start: number;
60
+ end: number;
61
+ }): boolean;
62
+ export declare function queryMatchItemSegments(item: LooseRecord | null | undefined): SelectionTextSegment[];
63
+ export declare function sameSelectionTextSegments(left: readonly SelectionTextSegment[], right: readonly SelectionTextSegment[]): boolean;
64
+ export declare function pickSelectionTextQueryItem(result: LooseRecord | null, selection: SelectionSlice): LooseRecord | null;
65
+ export declare function readProjectedInlineStyleValue(styles: LooseRecord | null | undefined, key: ProjectedInlineSelectionValueKey): string | undefined;
66
+ export declare function normalizeLayoutFontFamily(value: unknown): string | undefined;
67
+ export declare function normalizeLayoutFontSizePt(value: unknown): string | undefined;
68
+ export declare function normalizeProjectedInlineStyleValueKey(key: ProjectedInlineSelectionValueKey, value: string): string;
69
+ export declare function projectInlineValuesFromQueryItem(item: LooseRecord | null, selection: SelectionSlice): ProjectedInlineSelectionValues;
70
+ export declare function collectProjectionTextBlocks(blocks: unknown): LooseRecord[];
71
+ export declare function projectionBlockMatchesId(block: LooseRecord, id: string): boolean;
72
+ export declare function projectionRunSelectionLength(run: LooseRecord): number;
73
+ export declare function inlineFormatMethod(descriptor: CommandDescriptor): string | null;
74
+ export declare const CLEAR_INLINE_PATCH: Readonly<Record<string, null>>;
75
+ export declare const TRACKED_CLEAR_INLINE_PATCH: Readonly<Record<string, null>>;
76
+ export declare function buildInlineFormatInput(spec: {
77
+ key: string;
78
+ kind: 'toggle' | 'value-string' | 'value-number' | 'clear';
79
+ }, target: SelectionTarget, payload: unknown, active: boolean): LooseRecord | null;
@@ -0,0 +1,4 @@
1
+ export type AnyFn = (...args: unknown[]) => unknown;
2
+ export type LooseRecord = Record<string, unknown>;
3
+ export declare function readRecord(value: unknown): LooseRecord | undefined;
4
+ export declare function readRecordList(value: unknown): Array<LooseRecord | undefined>;
@@ -94,6 +94,7 @@ export declare const SUPERDOC_UI_REASONS: {
94
94
  * are never gated by this reason.
95
95
  */
96
96
  readonly contentControlLocked: "content-control-locked";
97
+ readonly deletedTextFormattingUnsupported: "deleted-text-formatting-unsupported";
97
98
  /**
98
99
  * The current user is not allowed to run this command under the product
99
100
  * permissionResolver / role matrix (SD-3845). Distinct from document
@@ -0,0 +1,47 @@
1
+ import { SelectionCapture, SelectionSlice, SelectionTarget } from './types.js';
2
+ import { LooseRecord } from './loose-record.js';
3
+ export declare const EMPTY_SELECTION: SelectionSlice;
4
+ export declare function selectionBlockRange(selection: SelectionSlice): {
5
+ startBlockId: string;
6
+ endBlockId: string;
7
+ } | null;
8
+ export declare function selectionBlockIds(selection: SelectionSlice): string[];
9
+ export declare const MAX_REACTIVE_SELECTION_BLOCK_READS = 64;
10
+ export declare function canProbeEverySelectedBlock(blockIds: readonly string[]): boolean;
11
+ export declare function selectionStory(selection: SelectionSlice): LooseRecord;
12
+ export declare function paragraphTarget(blockId: string, story?: unknown): LooseRecord;
13
+ export declare function listsBlockTarget(blockId: string): LooseRecord;
14
+ export declare function listItemTarget(blockId: string, story?: unknown): LooseRecord;
15
+ export declare function selectionTextAddresses(selection: SelectionSlice): LooseRecord[];
16
+ export declare function textAddressesFromTarget(target: unknown): LooseRecord[];
17
+ export declare function collapsedTextAddressFromTarget(target: unknown): LooseRecord | null;
18
+ export declare function collapsedTextAddressFromSelection(selection: SelectionSlice): LooseRecord | null;
19
+ export declare function isHeaderFooterCaret(selection: SelectionSlice): boolean;
20
+ export declare function createLocationAt(selection: SelectionSlice, mode: 'nodeId' | 'target'): LooseRecord;
21
+ export declare function hyperlinkAddressToSelectionTarget(address: LooseRecord | null | undefined): LooseRecord | null;
22
+ export declare function hyperlinkTargetFromHref(href: string): LooseRecord;
23
+ export declare function isAddressableSegment(segment: unknown): segment is {
24
+ blockId: string;
25
+ range: {
26
+ start: number;
27
+ end: number;
28
+ };
29
+ };
30
+ export declare function selectionTargetFromTextTarget(target: SelectionSlice['target'] | SelectionCapture['target'] | null): SelectionTarget | null;
31
+ export type CellSelectionCapture = SelectionCapture & {
32
+ _tableCellSelectionTarget?: unknown;
33
+ _paintedSelectionTarget?: unknown;
34
+ };
35
+ export type TextSelectionTarget = SelectionTarget & {
36
+ start: Extract<SelectionTarget['start'], {
37
+ kind: 'text';
38
+ }>;
39
+ end: Extract<SelectionTarget['end'], {
40
+ kind: 'text';
41
+ }>;
42
+ };
43
+ export declare function capturedTableCellTarget(value: unknown): TextSelectionTarget | null;
44
+ export declare function selectionTargetForRestore(capture: SelectionCapture): SelectionTarget | null;
45
+ export declare function resolveInlineSelectionTarget(selection: SelectionSlice): SelectionTarget | null;
46
+ export declare function selectionHasOnlyDeletedText(selection: SelectionSlice): boolean;
47
+ export declare function selectionTouchesDeletedText(selection: SelectionSlice): boolean;
@@ -0,0 +1,16 @@
1
+ export type SharedUiTrackedChangesCatalogState = {
2
+ refCount: number;
3
+ generation: number;
4
+ abortController: AbortController;
5
+ inFlight: {
6
+ generation: number;
7
+ commitSeq: number;
8
+ promise: Promise<unknown>;
9
+ } | null;
10
+ activeMutationTokens: Set<string>;
11
+ commitSeq: number;
12
+ countedCommitEvents: WeakSet<object>;
13
+ };
14
+ export declare const sharedUiTrackedChangesCatalogByHost: WeakMap<object, SharedUiTrackedChangesCatalogState>;
15
+ export declare function acquireSharedUiTrackedChangesCatalog(host: object): SharedUiTrackedChangesCatalogState;
16
+ export declare function releaseSharedUiTrackedChangesCatalog(host: object, state: SharedUiTrackedChangesCatalogState): void;
@@ -0,0 +1,51 @@
1
+ import { CommentInfo, SelectionSlice, TrackChangeInfo, TrackChangesItem } from './types.js';
2
+ import { LooseRecord } from './loose-record.js';
3
+ import { SuperDocUIReason } from './reasons.js';
4
+ export declare function identityText(value: unknown): string;
5
+ export type TrackChangeAuthorship = Pick<TrackChangeInfo, 'author' | 'authorEmail'> & {
6
+ authorId?: unknown;
7
+ };
8
+ export declare function trackedChangeOwnedByCurrentUser(change: TrackChangeAuthorship, currentUser: LooseRecord | null): boolean;
9
+ export declare function readCollapsedHostTrackChangeId(snapshot: unknown): string | null;
10
+ export declare function isNonCollapsedHostSelection(snapshot: unknown): boolean;
11
+ export type SelectionTrackDecisionPlan = {
12
+ kind: 'ids';
13
+ ids: readonly string[];
14
+ } | {
15
+ kind: 'id';
16
+ id: string;
17
+ story?: unknown;
18
+ } | {
19
+ kind: 'range';
20
+ target: LooseRecord;
21
+ changeId: string | null;
22
+ story?: unknown;
23
+ permissionIds?: readonly string[];
24
+ } | {
25
+ kind: 'blocked';
26
+ reason: SuperDocUIReason;
27
+ } | {
28
+ kind: 'unavailable';
29
+ };
30
+ export interface TrackedChangeIdContext {
31
+ toPublicId(rawId: string): string | null;
32
+ aliasesFor(publicId: string): readonly string[];
33
+ }
34
+ export declare const trackedChangeIdContextCache: WeakMap<readonly unknown[], TrackedChangeIdContext>;
35
+ export declare function readTrackChangeProvenanceIds(item: unknown): string[];
36
+ export declare function buildTrackedChangeIdContext(items: readonly unknown[]): TrackedChangeIdContext;
37
+ export declare const storyScopedTrackedChangeIdContextCache: WeakMap<readonly unknown[], Map<string, TrackedChangeIdContext>>;
38
+ export declare const declaredBodyItemsCache: WeakMap<readonly unknown[], readonly unknown[]>;
39
+ export declare function buildStoryScopedTrackedChangeIdContext(items: readonly unknown[], story: unknown): TrackedChangeIdContext;
40
+ export declare function isTextboxStory(story: unknown): boolean;
41
+ export declare function resolveStorylessCanonicalTrackedChangeId(items: readonly unknown[], selectionIds: readonly string[]): string | null;
42
+ export declare function declaredBodyItems(items: readonly unknown[]): readonly unknown[];
43
+ export declare function resolveSelectionActiveChangeId(options: {
44
+ selectionIds: readonly string[];
45
+ publicIds?: readonly string[];
46
+ selection: SelectionSlice;
47
+ bodyItems: readonly unknown[];
48
+ allStoryItems: readonly unknown[] | null;
49
+ }): string | null;
50
+ export declare function resolveActiveCommentId(items: readonly CommentInfo[], commentId: string): string | null;
51
+ export declare function trackChangesItemPayload(item: TrackChangesItem): TrackChangeInfo;
@@ -1,5 +1,6 @@
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';
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, ChangeRecord } from '../../../../document-api/src/index.js';
2
2
  import { BrowserDocumentApi, PartialBrowserDocumentApi } from '../browser-document-api.js';
3
+ import { ContentControlClickPayload } from '../content-control-ref.js';
3
4
  import { ExportParams } from '../export-types.js';
4
5
  import { SuperDocVisualHandle, SuperDocVisualOptions } from '../../core/extensions/types.js';
5
6
  import { DocumentReplacementResult } from '../document-replacement.js';
@@ -31,10 +32,11 @@ import { BuiltInCommandId } from './commands.js';
31
32
  * (`scripts/ensure-types.cjs` `rewriteDocApiPaths`), so no bare private
32
33
  * specifier leaks into the emitted `.d.ts`.
33
34
  */
34
- export type { Receipt, DocumentApiRejectionReason, DocumentApiRejectionDetails, TextRangeRejectionReason, ContentControlCreationRejectionReason, SelectionInfo, SelectionTarget, SelectionPoint, TextTarget, TextAddress, BookmarkAddress, ScrollIntoViewInput, ScrollIntoViewOutput, DocumentApi, 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, StoryLocator as DocumentStoryLocator, OperationId, OperationCall, OperationInput, OperationOptions, OperationOutput, } from '../../../../document-api/src/index.js';
35
+ export type { Receipt, DocumentApiRejectionReason, DocumentApiRejectionDetails, TextRangeRejectionReason, ContentControlCreationRejectionReason, SelectionInfo, SelectionTarget, SelectionPoint, TextTarget, TextAddress, BookmarkAddress, ScrollIntoViewInput, ScrollIntoViewOutput, DocumentApi, 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, StoryLocator as DocumentStoryLocator, ChangeRecord, ChangeActor, ChangeCause, ChangeProvenance, BlockChange, OperationId, OperationCall, OperationInput, OperationOptions, OperationOutput, } from '../../../../document-api/src/index.js';
35
36
  export type { StyleCatalogView, StyleCatalogItemType, StyleCatalogFilterType, StyleProvenance, StyleCatalogItemVisibility, StyleCatalogItemUsage, StyleCatalogItemPreview, StyleCatalogItem, StyleCatalogDefaults, StyleCatalogDiagnostic, StyleCatalogSourceStatus, StylesGetCatalogInput, StylesGetCatalogResult, } from '../../../../document-api/src/index.js';
36
37
  export type { ListPresetId } from '../../../../document-api/src/index.js';
37
38
  export type { BrowserDocumentApi, PartialBrowserDocumentApi } from '../browser-document-api.js';
39
+ export type { ContentControlClickPayload, ContentControlRef } from '../content-control-ref.js';
38
40
  export type { DocumentReplacementResult } from '../document-replacement.js';
39
41
  export type { SuperDocUIReason } from './reasons.js';
40
42
  export type { BuiltInCommandId } from './commands.js';
@@ -164,6 +166,7 @@ export interface FontSizeOption {
164
166
  }
165
167
  /** Observable enable/active state for a toolbar-style command. */
166
168
  export interface CommandState {
169
+ pending?: boolean;
167
170
  /** Availability for a control in the current selection / mode snapshot. */
168
171
  enabled: boolean;
169
172
  /** Compatibility inverse of `enabled` for demo code that models commands as disabled. */
@@ -689,6 +692,12 @@ export interface SuperDocDocumentChange {
689
692
  } | {
690
693
  kind: 'unknown';
691
694
  };
695
+ /**
696
+ * Attributed change records behind a remote change, oldest first. Present
697
+ * only when the engine recorded the remote transactions; `scope` is then
698
+ * derived from the stories the records touched.
699
+ */
700
+ records?: ChangeRecord[];
692
701
  }
693
702
  /** Document-level state slice. */
694
703
  export interface DocumentSlice {
@@ -1132,6 +1141,7 @@ export interface ContentControlsHandle extends SnapshotSubscribable<ContentContr
1132
1141
  * should use {@link observe}.
1133
1142
  */
1134
1143
  observeActivePath(listener: (snapshot: ContentControlsSlice) => void): () => void;
1144
+ onClick(listener: (payload: ContentControlClickPayload) => void): () => void;
1135
1145
  /** Event-shaped alias of {@link observe}. */
1136
1146
  subscribe(listener: (event: {
1137
1147
  snapshot: ContentControlsSlice;
@@ -0,0 +1,9 @@
1
+ export declare function uiBenchNowMs(): number;
2
+ export declare function readUiBenchRuntime(): {
3
+ sink: ((event: Record<string, unknown>) => void) | null;
4
+ workerContext: {
5
+ commandId: string | null;
6
+ commandKind: string | null;
7
+ } | null;
8
+ };
9
+ export declare function emitUiBenchTiming(event: Record<string, unknown>): void;
@@ -1,10 +1,15 @@
1
1
  // Generated by scripts/ensure-types.cjs. Do not edit by hand.
2
2
  import type { ActiveParagraphStyle as __Cjs_ActiveParagraphStyle } from './ui.js' with { "resolution-mode": "import" };
3
+ import type { BlockChange as __Cjs_BlockChange } from './ui.js' with { "resolution-mode": "import" };
3
4
  import type { BookmarkAddress as __Cjs_BookmarkAddress } from './ui.js' with { "resolution-mode": "import" };
4
5
  import type { BookmarksHandle as __Cjs_BookmarksHandle } from './ui.js' with { "resolution-mode": "import" };
5
6
  import type { BorrowedSuperDocUI as __Cjs_BorrowedSuperDocUI } from './ui.js' with { "resolution-mode": "import" };
6
7
  import type { BrowserDocumentApi as __Cjs_BrowserDocumentApi } from './ui.js' with { "resolution-mode": "import" };
7
8
  import type { BuiltInCommandId as __Cjs_BuiltInCommandId } from './ui.js' with { "resolution-mode": "import" };
9
+ import type { ChangeActor as __Cjs_ChangeActor } from './ui.js' with { "resolution-mode": "import" };
10
+ import type { ChangeCause as __Cjs_ChangeCause } from './ui.js' with { "resolution-mode": "import" };
11
+ import type { ChangeProvenance as __Cjs_ChangeProvenance } from './ui.js' with { "resolution-mode": "import" };
12
+ import type { ChangeRecord as __Cjs_ChangeRecord } from './ui.js' with { "resolution-mode": "import" };
8
13
  import type { CommandExecutionResult as __Cjs_CommandExecutionResult } from './ui.js' with { "resolution-mode": "import" };
9
14
  import type { CommandHandle as __Cjs_CommandHandle } from './ui.js' with { "resolution-mode": "import" };
10
15
  import type { CommandId as __Cjs_CommandId } from './ui.js' with { "resolution-mode": "import" };
@@ -17,10 +22,12 @@ import type { CommentsHandle as __Cjs_CommentsHandle } from './ui.js' with { "re
17
22
  import type { CommentsListQuery as __Cjs_CommentsListQuery } from './ui.js' with { "resolution-mode": "import" };
18
23
  import type { CommentsListResult as __Cjs_CommentsListResult } from './ui.js' with { "resolution-mode": "import" };
19
24
  import type { CommentsSlice as __Cjs_CommentsSlice } from './ui.js' with { "resolution-mode": "import" };
25
+ import type { ContentControlClickPayload as __Cjs_ContentControlClickPayload } from './ui.js' with { "resolution-mode": "import" };
20
26
  import type { ContentControlCreationRejectionReason as __Cjs_ContentControlCreationRejectionReason } from './ui.js' with { "resolution-mode": "import" };
21
27
  import type { ContentControlFocusResult as __Cjs_ContentControlFocusResult } from './ui.js' with { "resolution-mode": "import" };
22
28
  import type { ContentControlHighlightResult as __Cjs_ContentControlHighlightResult } from './ui.js' with { "resolution-mode": "import" };
23
29
  import type { ContentControlInfo as __Cjs_ContentControlInfo } from './ui.js' with { "resolution-mode": "import" };
30
+ import type { ContentControlRef as __Cjs_ContentControlRef } from './ui.js' with { "resolution-mode": "import" };
24
31
  import type { ContentControlsHandle as __Cjs_ContentControlsHandle } from './ui.js' with { "resolution-mode": "import" };
25
32
  import type { ContentControlsListResult as __Cjs_ContentControlsListResult } from './ui.js' with { "resolution-mode": "import" };
26
33
  import type { ContentControlsSlice as __Cjs_ContentControlsSlice } from './ui.js' with { "resolution-mode": "import" };
@@ -157,12 +164,17 @@ import type { WorkflowScrollResult as __Cjs_WorkflowScrollResult } from './ui.js
157
164
  import type { ZoomHandle as __Cjs_ZoomHandle } from './ui.js' with { "resolution-mode": "import" };
158
165
  import type { ZoomSlice as __Cjs_ZoomSlice } from './ui.js' with { "resolution-mode": "import" };
159
166
  export type { __Cjs_ActiveParagraphStyle as ActiveParagraphStyle };
167
+ export type { __Cjs_BlockChange as BlockChange };
160
168
  export type { __Cjs_BookmarkAddress as BookmarkAddress };
161
169
  export type { __Cjs_BookmarksHandle as BookmarksHandle };
162
170
  export type { __Cjs_BorrowedSuperDocUI as BorrowedSuperDocUI };
163
171
  export type { __Cjs_BrowserDocumentApi as BrowserDocumentApi };
164
172
  export declare const BUILT_IN_COMMAND_IDS: typeof import('./ui.js', { with: { "resolution-mode": "import" } }).BUILT_IN_COMMAND_IDS;
165
173
  export type { __Cjs_BuiltInCommandId as BuiltInCommandId };
174
+ export type { __Cjs_ChangeActor as ChangeActor };
175
+ export type { __Cjs_ChangeCause as ChangeCause };
176
+ export type { __Cjs_ChangeProvenance as ChangeProvenance };
177
+ export type { __Cjs_ChangeRecord as ChangeRecord };
166
178
  export type { __Cjs_CommandExecutionResult as CommandExecutionResult };
167
179
  export type { __Cjs_CommandHandle as CommandHandle };
168
180
  export type { __Cjs_CommandId as CommandId };
@@ -175,10 +187,12 @@ export type { __Cjs_CommentsHandle as CommentsHandle };
175
187
  export type { __Cjs_CommentsListQuery as CommentsListQuery };
176
188
  export type { __Cjs_CommentsListResult as CommentsListResult };
177
189
  export type { __Cjs_CommentsSlice as CommentsSlice };
190
+ export type { __Cjs_ContentControlClickPayload as ContentControlClickPayload };
178
191
  export type { __Cjs_ContentControlCreationRejectionReason as ContentControlCreationRejectionReason };
179
192
  export type { __Cjs_ContentControlFocusResult as ContentControlFocusResult };
180
193
  export type { __Cjs_ContentControlHighlightResult as ContentControlHighlightResult };
181
194
  export type { __Cjs_ContentControlInfo as ContentControlInfo };
195
+ export type { __Cjs_ContentControlRef as ContentControlRef };
182
196
  export type { __Cjs_ContentControlsHandle as ContentControlsHandle };
183
197
  export type { __Cjs_ContentControlsListResult as ContentControlsListResult };
184
198
  export type { __Cjs_ContentControlsSlice as ContentControlsSlice };
@@ -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, 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';
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, ContentControlClickPayload, ContentControlRef, 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, ChangeRecord, ChangeActor, ChangeCause, ChangeProvenance, BlockChange, OperationId, OperationCall, OperationInput, OperationOptions, OperationOutput, } from './ui/types.js';
22
22
  export type { PageMetricsHandle, PageMetricsSnapshot, PageMetricsPage, PageBodyTarget } from './ui/page-metrics.js';