superdoc 2.29.0 → 2.30.0-next.4

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 (112) 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-L60GhVAX.cjs → create-super-doc-ui--kQBNTyt.cjs} +2733 -2574
  11. package/dist/chunks/{create-super-doc-ui-Dc8dQAMc.es.js → create-super-doc-ui-CbEDXtpm.es.js} +2734 -2581
  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/contract/command-catalog.d.ts +1 -1
  17. package/dist/document-api/src/contract/operation-definitions.d.ts +51 -1
  18. package/dist/document-api/src/create/create.d.ts +0 -4
  19. package/dist/document-api/src/diff/diff.types.d.ts +6 -6
  20. package/dist/document-api/src/header-footers/header-footers.d.ts +1 -3
  21. package/dist/document-api/src/index.d.ts +6 -0
  22. package/dist/document-api/src/inline-semantics/token-sets.d.ts +0 -2
  23. package/dist/document-api/src/insert/insert.d.ts +0 -1
  24. package/dist/layout-engine/contracts/src/index.d.ts +3 -1
  25. package/dist/layout-engine/dom-contract/src/data-attrs.d.ts +4 -0
  26. package/dist/layout-engine/layout-bridge/src/coupled-footnote-pagination.d.ts +1 -0
  27. package/dist/layout-engine/layout-bridge/src/footnote-page-certificate.d.ts +1 -0
  28. package/dist/layout-engine/layout-bridge/src/footnote-page-planner.d.ts +5 -0
  29. package/dist/layout-engine/layout-bridge/src/incrementalLayout.d.ts +1 -0
  30. package/dist/layout-engine/layout-engine/src/footnote-page-flow.d.ts +3 -0
  31. package/dist/layout-engine/layout-engine/src/index.d.ts +7 -0
  32. package/dist/layout-engine/layout-engine/src/layout-paragraph.d.ts +5 -0
  33. package/dist/layout-engine/layout-engine/src/layout-table.d.ts +3 -1
  34. package/dist/layout-engine/layout-engine/src/layout-utils.d.ts +0 -4
  35. package/dist/layout-engine/layout-engine/src/paginator.d.ts +4 -0
  36. package/dist/layout-engine/painters/dom/src/paragraph/list-marker.d.ts +1 -1
  37. package/dist/layout-engine/painters/dom/src/paragraph/renderParagraphContent.d.ts +1 -1
  38. package/dist/layout-engine/painters/dom/src/styles.d.ts +0 -10
  39. package/dist/layout-engine/painters/dom/src/svg-utils.d.ts +1 -13
  40. package/dist/public/ui-react.cjs +1 -1
  41. package/dist/public/ui-react.es.js +1 -1
  42. package/dist/public/ui-vue.cjs +1 -1
  43. package/dist/public/ui-vue.es.js +1 -1
  44. package/dist/public/ui.cjs +1 -1
  45. package/dist/public/ui.es.js +1 -1
  46. package/dist/shared/common/Telemetry.d.ts +50 -0
  47. package/dist/shared/common/event-types.d.ts +13 -0
  48. package/dist/shared/font-system/src/bundled-face-names.d.ts +1 -0
  49. package/dist/shared/font-system/src/resolver.d.ts +1 -0
  50. package/dist/style.css +1 -1
  51. package/dist/style.layered.css +1 -1
  52. package/dist/superdoc/src/components/CommentsLayer/CommentDialog.vue.d.ts +17 -33
  53. package/dist/superdoc/src/components/CommentsLayer/collect-tracked-change-thread.d.ts +6 -4
  54. package/dist/superdoc/src/components/CommentsLayer/comment-params.d.ts +84 -0
  55. package/dist/superdoc/src/components/CommentsLayer/use-comment.d.ts +15 -95
  56. package/dist/superdoc/src/components/Whiteboard/use-whiteboard.d.ts +30 -9
  57. package/dist/superdoc/src/composables/use-document.d.ts +51 -99
  58. package/dist/superdoc/src/core/SuperDoc.d.ts +12 -3
  59. package/dist/superdoc/src/core/collaboration/cdn-collaboration-comment-map.d.ts +1 -0
  60. package/dist/superdoc/src/core/collaboration/collaboration-comment-map.d.ts +2 -0
  61. package/dist/superdoc/src/core/collaboration/helpers.d.ts +1 -1
  62. package/dist/superdoc/src/core/document-open-telemetry.d.ts +1 -1
  63. package/dist/superdoc/src/core/editor-runtime/v2/v2-editor-runtime-adapter.d.ts +1 -0
  64. package/dist/superdoc/src/core/types/index.d.ts +71 -39
  65. package/dist/superdoc/src/helpers/deprecation.d.ts +12 -3
  66. package/dist/superdoc/src/helpers/object-guards.d.ts +1 -0
  67. package/dist/superdoc/src/helpers/v2-review-geometry-delivery.d.ts +22 -0
  68. package/dist/superdoc/src/internal/toolbar/built-in/ToolbarButton.vue.d.ts +1 -0
  69. package/dist/superdoc/src/public/content-control-ref.d.ts +12 -0
  70. package/dist/superdoc/src/public/index.d.cts +16 -0
  71. package/dist/superdoc/src/public/index.d.ts +3 -0
  72. package/dist/superdoc/src/public/ui/async-read-cache.d.ts +32 -0
  73. package/dist/superdoc/src/public/ui/block-commands.d.ts +39 -0
  74. package/dist/superdoc/src/public/ui/command-results.d.ts +39 -0
  75. package/dist/superdoc/src/public/ui/create-super-doc-ui.d.ts +1 -17
  76. package/dist/superdoc/src/public/ui/document-change-records.d.ts +7 -0
  77. package/dist/superdoc/src/public/ui/entity-rows.d.ts +14 -0
  78. package/dist/superdoc/src/public/ui/font-options.d.ts +7 -0
  79. package/dist/superdoc/src/public/ui/format-painter-state.d.ts +33 -0
  80. package/dist/superdoc/src/public/ui/heavy-read-policy.d.ts +11 -0
  81. package/dist/superdoc/src/public/ui/host-events.d.ts +3 -0
  82. package/dist/superdoc/src/public/ui/inline-values.d.ts +79 -0
  83. package/dist/superdoc/src/public/ui/loose-record.d.ts +4 -0
  84. package/dist/superdoc/src/public/ui/selection-targets.d.ts +45 -0
  85. package/dist/superdoc/src/public/ui/shared-tracked-changes-catalog.d.ts +16 -0
  86. package/dist/superdoc/src/public/ui/tracked-change-ids.d.ts +51 -0
  87. package/dist/superdoc/src/public/ui/types.d.ts +12 -2
  88. package/dist/superdoc/src/public/ui/ui-bench-timing.d.ts +9 -0
  89. package/dist/superdoc/src/public/ui.d.cts +14 -0
  90. package/dist/superdoc/src/public/ui.d.ts +1 -1
  91. package/dist/superdoc/src/stores/comments-store.d.ts +23000 -536
  92. package/dist/superdoc/src/stores/helpers/comment-grouping.d.ts +1 -1
  93. package/dist/superdoc/src/stores/helpers/comment-identity.d.ts +10 -10
  94. package/dist/superdoc/src/stores/helpers/review-presentation.d.ts +90 -0
  95. package/dist/superdoc/src/stores/helpers/tracked-change-identity.d.ts +4 -2
  96. package/dist/superdoc/src/stores/helpers/tracked-change-row-values.d.ts +1 -8
  97. package/dist/superdoc/src/stores/helpers/tracked-change-thread-index.d.ts +1 -1
  98. package/dist/superdoc/src/stores/helpers/v2-review-adapters.d.ts +147 -0
  99. package/dist/superdoc/src/stores/superdoc-store.d.ts +12 -2895
  100. package/dist/superdoc.cjs +604 -388
  101. package/dist/superdoc.es.js +604 -388
  102. package/dist/word-layout/src/marker-utils.d.ts +0 -5
  103. package/dist/word-layout/src/unit-conversions.d.ts +0 -1
  104. package/dist-cdn/style.layered.css +1 -1
  105. package/dist-cdn/superdoc.min.css +1 -1
  106. package/dist-cdn/superdoc.min.js +38 -42
  107. package/package.json +12 -3
  108. package/dist/document-api/src/diff/index.d.ts +0 -3
  109. package/dist/document-api/src/write/locator.d.ts +0 -24
  110. package/dist/layout-engine/painters/dom/src/features/feature-registry.d.ts +0 -41
  111. package/dist/superdoc/src/internal/toolbar/built-in/format-negation.d.ts +0 -11
  112. package/dist/word-layout/src/tab-layout.d.ts +0 -193
@@ -3,11 +3,12 @@ import { DiagnosticsConfig } from './diagnostics.js';
3
3
  import { Doc as YDoc } from 'yjs';
4
4
  import { HocuspocusProviderWebsocket } from '@hocuspocus/provider';
5
5
  import { Ref, ComputedRef } from 'vue';
6
- import { ContentControlType, HyperlinkTarget } from '../../../../document-api/src/index.js';
6
+ import { HyperlinkTarget } from '../../../../document-api/src/index.js';
7
7
  import { DocumentFontOption, FontAssetUrlResolver, FontFamilyOption, FontLoadSummary, FontResolutionRecord } from '../../../../shared/font-system/src/index.js';
8
8
  import { SuperDoc as SuperDocClass } from '../SuperDoc.js';
9
9
  import { SuperDocActiveEditorExtensions, SuperDocExtension } from '../extensions/index.js';
10
10
  import { BrowserDocumentApi } from '../../public/browser-document-api.js';
11
+ import { ContentControlClickPayload, ContentControlRef } from '../../public/content-control-ref.js';
11
12
  import { CustomCommandContext, FontFamilyOption as ToolbarFontFamilyOption } from '../../public/ui/types.js';
12
13
  export type { DocumentFontOption, FontFamilyOption, FontLoadSummary, FontResolutionRecord, } from '../../../../shared/font-system/src/index.js';
13
14
  export type SuperDoc = SuperDocClass;
@@ -449,12 +450,37 @@ export interface V2AuthoringFacade {
449
450
  * `#assignUserColor()` after `#init`.
450
451
  */
451
452
  export interface User {
453
+ /** Stable application user id. Collaborative change records report it as the actor id. */
452
454
  id?: string | null;
453
455
  name?: string | null;
454
456
  email?: string | null;
455
457
  image?: string | null;
458
+ /**
459
+ * Opaque identity claim published with this session's change records, such as
460
+ * a JWT your server signs. SuperDoc never verifies it.
461
+ */
462
+ claim?: UserClaim;
456
463
  [key: string]: unknown;
457
464
  }
465
+ /** Context passed to a {@link UserClaim} function. */
466
+ export interface UserClaimContext {
467
+ /** Collaboration document id of the session. */
468
+ documentId: string;
469
+ /** Yjs client id of the session. */
470
+ clientId: number;
471
+ }
472
+ /**
473
+ * Identity claim for {@link User.claim}: a string, or a function that returns
474
+ * one for the session's collaboration document and Yjs client id.
475
+ */
476
+ export type UserClaim = string | ((ctx: UserClaimContext) => string | Promise<string>);
477
+ /** Per-session retention of attributed change records (`doc.changes`). */
478
+ export interface ChangesConfig {
479
+ /** Maximum number of retained records. Defaults to 1000. */
480
+ retainRecords?: number;
481
+ /** Maximum retained size in bytes, including captured updates. Defaults to 8 MiB. */
482
+ retainBytes?: number;
483
+ }
458
484
  /** V2-neutral active editor facade exposed by legacy shell methods. */
459
485
  export interface EditorCommands {
460
486
  search?: (text: string | RegExp, options?: Record<string, unknown>) => SearchMatch[];
@@ -3178,19 +3204,7 @@ export interface EditorTransactionEvent {
3178
3204
  /** Header/footer variant (`default`, `first`, `even`, `odd`) when available. */
3179
3205
  sectionType?: string | null;
3180
3206
  }
3181
- /** A content control reported by an Editor interaction callback. */
3182
- export interface ContentControlRef {
3183
- /** Content-control id from the DOCX. */
3184
- id: string;
3185
- /** Content-control tag, when the DOCX defines one. */
3186
- tag?: string;
3187
- /** Display name from the DOCX, when defined. */
3188
- alias?: string;
3189
- /** Content-control type, such as `text`, `checkbox`, or `date`. */
3190
- controlType: ContentControlType;
3191
- /** Whether the control is inline or contains one or more blocks. */
3192
- scope: 'inline' | 'block';
3193
- }
3207
+ export type { ContentControlRef } from '../../public/content-control-ref.js';
3194
3208
  /**
3195
3209
  * Previous content-control reference shape.
3196
3210
  * @deprecated replaceWith=`ContentControlRef` compat-indefinitely=v2 event payload compatibility
@@ -3216,13 +3230,7 @@ export interface ContentControlActiveChangePayload {
3216
3230
  /** Reported source of the selection change. */
3217
3231
  source: 'keyboard' | 'pointer';
3218
3232
  }
3219
- /** Details reported when someone clicks inside a content control. */
3220
- export interface ContentControlClickPayload {
3221
- /** Innermost clicked content control. */
3222
- target: ContentControlRef;
3223
- /** Content-control clicks always originate from a pointer. */
3224
- source: 'pointer';
3225
- }
3233
+ export type { ContentControlClickPayload } from '../../public/content-control-ref.js';
3226
3234
  export interface SuperDocLayoutEngineOptions {
3227
3235
  /**
3228
3236
  * Layout engine flow mode.
@@ -3937,16 +3945,25 @@ export interface SurfacesConfig {
3937
3945
  };
3938
3946
  }
3939
3947
  /**
3940
- * Browser worker asset URLs for deployments where application code and built
3941
- * SuperDoc assets are served from different origins. Each URL must resolve to
3942
- * a same-origin module worker served by the embedding application.
3948
+ * Worker URLs accepted by v2. The editor runs on the page and starts no
3949
+ * document worker, so only `collaboration` is used, and only by collaboration
3950
+ * targets with `providerType: 'extension'`.
3943
3951
  */
3944
3952
  interface V2WorkerUrlsConfig {
3945
- /** Main document worker used by non-collaborative v2 documents. */
3953
+ /**
3954
+ * @deprecated The editor runs on the page and starts no document worker.
3955
+ * Accepted and ignored for configuration compatibility.
3956
+ */
3946
3957
  document?: string | URL;
3947
- /** Collaboration-capable document worker used by v2 collaboration rooms. */
3958
+ /**
3959
+ * Your provider-extension collaboration worker, built with
3960
+ * `bootstrapSuperDocCollaborationWorker` from the same SuperDoc version.
3961
+ * Must be a same-origin module worker URL. Required for
3962
+ * `providerType: 'extension'`; ignored by the built-in providers, which
3963
+ * sync on the page.
3964
+ */
3948
3965
  collaboration?: string | URL;
3949
- /** @deprecated Review processing runs in the document worker. Accepted for configuration compatibility. */
3966
+ /** @deprecated Accepted and ignored for configuration compatibility. */
3950
3967
  reviewIndex?: string | URL;
3951
3968
  }
3952
3969
  export interface Config {
@@ -4172,12 +4189,25 @@ export interface Config {
4172
4189
  onReady?: (params: SuperDocReadyPayload) => void;
4173
4190
  /** Callback when comments are updated. */
4174
4191
  onCommentsUpdate?: (params: SuperDocCommentsUpdatePayload) => void;
4192
+ /**
4193
+ * Called when someone accepts a tracked change from its bubble in the comments sidebar.
4194
+ * Receives the tracked-change comment and the active editor. In SuperDoc 2 it runs after the accept is applied.
4195
+ */
4196
+ onTrackedChangeBubbleAccept?: (comment: Comment, editor: Editor | null) => void;
4197
+ /**
4198
+ * Called when someone rejects a tracked change from its bubble in the comments sidebar.
4199
+ * Receives the tracked-change comment and the active editor. In SuperDoc 2 it runs after the reject is applied.
4200
+ */
4201
+ onTrackedChangeBubbleReject?: (comment: Comment, editor: Editor | null) => void;
4175
4202
  /**
4176
4203
  * Callback when the selection enters, leaves, or moves between content controls.
4177
4204
  * @deprecated replaceWith=`superdoc.ui.contentControls.observe` compat-indefinitely=v2 event compatibility
4178
4205
  */
4179
4206
  onContentControlActiveChange?: (params: ContentControlActiveChangePayload) => void;
4180
- /** Callback when someone clicks inside a content control. */
4207
+ /**
4208
+ * Callback when someone clicks inside a content control.
4209
+ * @deprecated replaceWith=`superdoc.ui.contentControls.onClick` removeIn=v3.0
4210
+ */
4181
4211
  onContentControlClick?: (params: ContentControlClickPayload) => void;
4182
4212
  /** Callback when awareness is updated. */
4183
4213
  onAwarenessUpdate?: (params: SuperDocAwarenessUpdatePayload) => void;
@@ -4232,6 +4262,8 @@ export interface Config {
4232
4262
  * Callback when the zoom level changes. Fires for every zoom source:
4233
4263
  * `setZoom()`, the toolbar zoom control, and fit-width
4234
4264
  * adjustments.
4265
+ *
4266
+ * @deprecated replaceWith=`superdoc.ui.zoom.observe` removeIn=v3.0
4235
4267
  */
4236
4268
  onZoomChange?: (params: SuperDocZoomPayload) => void;
4237
4269
  /**
@@ -4404,22 +4436,22 @@ export interface Config {
4404
4436
  */
4405
4437
  fonts?: FontsConfig;
4406
4438
  /**
4407
- * Optional same-origin URLs for v2's browser worker assets. Configure these
4408
- * when the application and SuperDoc bundle are served from different origins.
4409
- * Omitted entries keep SuperDoc's bundled worker URLs.
4439
+ * Worker URLs. Only `collaboration` is used: the provider-extension
4440
+ * collaboration worker for `providerType: 'extension'`. `document` and
4441
+ * `reviewIndex` are accepted and ignored because the editor runs on the page.
4410
4442
  */
4411
4443
  workerUrls?: V2WorkerUrlsConfig;
4412
4444
  /**
4413
- * Budget for the document worker to start up, in milliseconds
4414
- * (default: 30000). Measured from worker spawn, so it covers script
4415
- * download, parsing, evaluation, and the worker's first response to
4416
- * SuperDoc. Raise it when a large worker chunk is served
4417
- * over a slow connection or a cold dev-server cache; lower it to fail faster.
4418
- * Worker load errors are reported immediately and do not wait for this
4419
- * budget. Must be a finite positive number no greater than 2147483647, the
4420
- * platform timer ceiling above which a delay would fire immediately.
4445
+ * Budget for the provider-extension collaboration worker
4446
+ * (`workerUrls.collaboration`, `providerType: 'extension'`) to start up and
4447
+ * send its first response, in milliseconds. Defaults to the collaboration
4448
+ * `syncTimeoutMs`, or 30000. Worker load errors are reported immediately and
4449
+ * do not wait for this budget. Ignored by the built-in providers and by
4450
+ * documents opened without collaboration, which start no worker.
4421
4451
  */
4422
4452
  workerStartupTimeoutMs?: number;
4453
+ /** Retention of attributed change records read through `activeEditor.doc.changes`. */
4454
+ changes?: ChangesConfig;
4423
4455
  /**
4424
4456
  * Whether `layoutEngineOptions` are passed when a DOCX editor opens.
4425
4457
  *
@@ -1,4 +1,13 @@
1
- import { Editor } from '../core/types/index.js';
1
+ /**
2
+ * Deprecation utilities for steering consumers toward the Document API.
3
+ *
4
+ * ProseMirror will be removed in a future major version. These helpers emit
5
+ * one-time console warnings when deprecated properties are accessed on an
6
+ * editor instance handed to consumer callbacks (onEditorCreate, etc.).
7
+ *
8
+ * Internal code continues to use the raw Editor — only the consumer-facing
9
+ * boundary wraps the editor with a Proxy.
10
+ */
2
11
  /**
3
12
  * Log a console.warn once per key. Subsequent calls with the same key are no-ops.
4
13
  */
@@ -12,9 +21,9 @@ export declare function warnOnce(key: string, message: string): void;
12
21
  *
13
22
  * @returns Proxied editor (or the original if null/already wrapped)
14
23
  */
15
- export declare function createDeprecatedEditorProxy<T extends Editor | null | undefined>(editor: T): T;
24
+ export declare function createDeprecatedEditorProxy<T extends object | null | undefined>(editor: T): T;
16
25
  /**
17
26
  * Unwrap a potentially proxied editor back to the raw Editor instance.
18
27
  * Safe to call on an already-raw editor — returns it unchanged.
19
28
  */
20
- export declare function unwrapEditor(editor: Editor | null | undefined): Editor | null | undefined;
29
+ export declare function unwrapEditor<T extends object>(editor: T | null | undefined): T | null | undefined;
@@ -1,2 +1,3 @@
1
1
  export declare function isPlainObject(value: unknown): value is Record<string, unknown>;
2
+ export declare function isObjectRecord(value: unknown): value is Record<string, unknown>;
2
3
  export declare function isThenable(value: unknown): value is PromiseLike<unknown>;
@@ -0,0 +1,22 @@
1
+ export interface ReviewGeometryDeliveryPayload extends Readonly<Record<string, unknown>> {
2
+ documentEpoch?: unknown;
3
+ paintEpoch?: unknown;
4
+ commitSequence?: unknown;
5
+ generation?: unknown;
6
+ pageIndices?: unknown;
7
+ zoomScale?: unknown;
8
+ reviewGeometry?: unknown;
9
+ }
10
+ type Render = {
11
+ mountContainer: HTMLElement | null;
12
+ documentId?: string | null;
13
+ epoch?: number | null;
14
+ };
15
+ export declare function createReviewGeometryDelivery<T extends Render>(deliver: (value: T, payload: ReviewGeometryDeliveryPayload) => void): {
16
+ notify: (documentId: string, payload: ReviewGeometryDeliveryPayload, current: T | null, ready?: boolean) => boolean;
17
+ observe: (current: T) => void;
18
+ flush(current: T): boolean;
19
+ replay(current: T): boolean;
20
+ reset(): void;
21
+ };
22
+ export {};
@@ -16,6 +16,7 @@ interface ToolbarButtonItem {
16
16
  attributes: Ref<{
17
17
  className?: unknown;
18
18
  ariaLabel?: string;
19
+ ariaBusy?: boolean;
19
20
  }>;
20
21
  nestedOptions?: Ref<{
21
22
  label?: string;
@@ -0,0 +1,12 @@
1
+ import { ContentControlType } from '../../../document-api/src/index.js';
2
+ export interface ContentControlRef {
3
+ id: string;
4
+ tag?: string;
5
+ alias?: string;
6
+ controlType: ContentControlType;
7
+ scope: 'inline' | 'block';
8
+ }
9
+ export interface ContentControlClickPayload {
10
+ target: ContentControlRef;
11
+ source: 'pointer';
12
+ }
@@ -1,6 +1,7 @@
1
1
  // Generated by scripts/ensure-types.cjs. Do not edit by hand.
2
2
  import type { AwarenessState as __Cjs_AwarenessState } from './index.js' with { "resolution-mode": "import" };
3
3
  import type { AwarenessUser as __Cjs_AwarenessUser } from './index.js' with { "resolution-mode": "import" };
4
+ import type { BlockChange as __Cjs_BlockChange } from './index.js' with { "resolution-mode": "import" };
4
5
  import type { BlockNavigationAddress as __Cjs_BlockNavigationAddress } from './index.js' with { "resolution-mode": "import" };
5
6
  import type { BlocksListResult as __Cjs_BlocksListResult } from './index.js' with { "resolution-mode": "import" };
6
7
  import type { BookmarkAddress as __Cjs_BookmarkAddress } from './index.js' with { "resolution-mode": "import" };
@@ -8,6 +9,11 @@ import type { BookmarkInfo as __Cjs_BookmarkInfo } from './index.js' with { "res
8
9
  import type { BorrowedSuperDocUI as __Cjs_BorrowedSuperDocUI } from './index.js' with { "resolution-mode": "import" };
9
10
  import type { BuiltInCommandId as __Cjs_BuiltInCommandId } from './index.js' with { "resolution-mode": "import" };
10
11
  import type { CanPerformPermissionParams as __Cjs_CanPerformPermissionParams } from './index.js' with { "resolution-mode": "import" };
12
+ import type { ChangeActor as __Cjs_ChangeActor } from './index.js' with { "resolution-mode": "import" };
13
+ import type { ChangeCause as __Cjs_ChangeCause } from './index.js' with { "resolution-mode": "import" };
14
+ import type { ChangeProvenance as __Cjs_ChangeProvenance } from './index.js' with { "resolution-mode": "import" };
15
+ import type { ChangeRecord as __Cjs_ChangeRecord } from './index.js' with { "resolution-mode": "import" };
16
+ import type { ChangesConfig as __Cjs_ChangesConfig } from './index.js' with { "resolution-mode": "import" };
11
17
  import type { CollaborationConfig as __Cjs_CollaborationConfig } from './index.js' with { "resolution-mode": "import" };
12
18
  import type { CommentAddress as __Cjs_CommentAddress } from './index.js' with { "resolution-mode": "import" };
13
19
  import type { CommentInteractionConfig as __Cjs_CommentInteractionConfig } from './index.js' with { "resolution-mode": "import" };
@@ -298,6 +304,8 @@ import type { UIConfig as __Cjs_UIConfig } from './index.js' with { "resolution-
298
304
  import type { UpgradeToCollaborationOptions as __Cjs_UpgradeToCollaborationOptions } from './index.js' with { "resolution-mode": "import" };
299
305
  import type { UpgradeToCollaborationResult as __Cjs_UpgradeToCollaborationResult } from './index.js' with { "resolution-mode": "import" };
300
306
  import type { User as __Cjs_User } from './index.js' with { "resolution-mode": "import" };
307
+ import type { UserClaim as __Cjs_UserClaim } from './index.js' with { "resolution-mode": "import" };
308
+ import type { UserClaimContext as __Cjs_UserClaimContext } from './index.js' with { "resolution-mode": "import" };
301
309
  import type { V2CollaborationConfig as __Cjs_V2CollaborationConfig } from './index.js' with { "resolution-mode": "import" };
302
310
  import type { ViewingOptions as __Cjs_ViewingOptions } from './index.js' with { "resolution-mode": "import" };
303
311
  import type { ViewingTrackedChangesMode as __Cjs_ViewingTrackedChangesMode } from './index.js' with { "resolution-mode": "import" };
@@ -306,6 +314,7 @@ import type { ViewOptions as __Cjs_ViewOptions } from './index.js' with { "resol
306
314
  export type { __Cjs_AwarenessState as AwarenessState };
307
315
  export type { __Cjs_AwarenessUser as AwarenessUser };
308
316
  export declare const BlankDOCX: typeof import('./index.js', { with: { "resolution-mode": "import" } }).BlankDOCX;
317
+ export type { __Cjs_BlockChange as BlockChange };
309
318
  export type { __Cjs_BlockNavigationAddress as BlockNavigationAddress };
310
319
  export type { __Cjs_BlocksListResult as BlocksListResult };
311
320
  export type { __Cjs_BookmarkAddress as BookmarkAddress };
@@ -314,6 +323,11 @@ export type { __Cjs_BorrowedSuperDocUI as BorrowedSuperDocUI };
314
323
  export declare const buildTheme: typeof import('./index.js', { with: { "resolution-mode": "import" } }).buildTheme;
315
324
  export type { __Cjs_BuiltInCommandId as BuiltInCommandId };
316
325
  export type { __Cjs_CanPerformPermissionParams as CanPerformPermissionParams };
326
+ export type { __Cjs_ChangeActor as ChangeActor };
327
+ export type { __Cjs_ChangeCause as ChangeCause };
328
+ export type { __Cjs_ChangeProvenance as ChangeProvenance };
329
+ export type { __Cjs_ChangeRecord as ChangeRecord };
330
+ export type { __Cjs_ChangesConfig as ChangesConfig };
317
331
  export type { __Cjs_CollaborationConfig as CollaborationConfig };
318
332
  export type { __Cjs_CommentAddress as CommentAddress };
319
333
  export type { __Cjs_CommentInteractionConfig as CommentInteractionConfig };
@@ -615,6 +629,8 @@ export type { __Cjs_UIConfig as UIConfig };
615
629
  export type { __Cjs_UpgradeToCollaborationOptions as UpgradeToCollaborationOptions };
616
630
  export type { __Cjs_UpgradeToCollaborationResult as UpgradeToCollaborationResult };
617
631
  export type { __Cjs_User as User };
632
+ export type { __Cjs_UserClaim as UserClaim };
633
+ export type { __Cjs_UserClaimContext as UserClaimContext };
618
634
  export type { __Cjs_V2CollaborationConfig as V2CollaborationConfig };
619
635
  export type { __Cjs_ViewingOptions as ViewingOptions };
620
636
  export type { __Cjs_ViewingTrackedChangesMode as ViewingTrackedChangesMode };
@@ -200,6 +200,9 @@ export type { UpgradeToCollaborationResult } from '../core/types/index.js';
200
200
  export type { SuperDocCollaborationUpgradeError } from '../core/types/index.js';
201
201
  export type { V2CollaborationConfig } from '../core/types/index.js';
202
202
  export type { User } from '../core/types/index.js';
203
+ export type { UserClaim, UserClaimContext } from '../core/types/index.js';
204
+ export type { ChangesConfig } from '../core/types/index.js';
205
+ export type { BlockChange, ChangeActor, ChangeCause, ChangeProvenance, ChangeRecord } from '../../../document-api/src/index.js';
203
206
  export type { ViewOptions } from '../core/types/index.js';
204
207
  export type { ViewingOptions } from '../core/types/index.js';
205
208
  export type { ViewingTrackedChangesMode } from '../core/types/index.js';
@@ -0,0 +1,32 @@
1
+ export type AsyncReadEntry = {
2
+ token: string | null;
3
+ value: unknown;
4
+ hasSettled: boolean;
5
+ inflightToken: string | null;
6
+ failedToken?: string | null;
7
+ failureCount?: number;
8
+ retryAtMs?: number;
9
+ settled?: Promise<void>;
10
+ };
11
+ export type AsyncReadSettlement = {
12
+ key: string;
13
+ settledAtMs: number;
14
+ commandId: string | null;
15
+ commandKind: string | null;
16
+ };
17
+ export interface AsyncReadCacheOptions {
18
+ isDisposed: () => boolean;
19
+ recomputeAfterSettle: () => void;
20
+ recomputeWhenRetryDue: () => void;
21
+ }
22
+ export declare function failureRetryDelayMs(failureCount: number): number;
23
+ export declare function createAsyncReadCache(options: AsyncReadCacheOptions): {
24
+ entries: Map<string, AsyncReadEntry>;
25
+ issue: (key: string, token: string, run: () => unknown, normalize: (raw: unknown) => unknown) => AsyncReadEntry | null;
26
+ seed: (key: string, token: string | null, value: unknown, inflightToken?: string | null) => void;
27
+ clearKeys: (predicate: (key: string) => boolean) => void;
28
+ scheduleRefresh: () => void;
29
+ scheduleFailureRetry: (retryAtMs: number) => void;
30
+ cancelFailureRetry: () => void;
31
+ drainSettlements: () => AsyncReadSettlement[];
32
+ };
@@ -0,0 +1,39 @@
1
+ import { LooseRecord } from './loose-record.js';
2
+ import { TableCommandSpec } from './commands.js';
3
+ export declare const PARAGRAPH_INDENT_STEP_TWIPS = 720;
4
+ export type ParagraphIndentationTwips = {
5
+ left?: number;
6
+ right?: number;
7
+ firstLine?: number;
8
+ hanging?: number;
9
+ };
10
+ export declare function pointsToTwips(value: number): number;
11
+ export declare function readParagraphIndentationFromResult(result: unknown): ParagraphIndentationTwips | null;
12
+ export interface ResolvedTableContext {
13
+ canMerge: boolean;
14
+ tableNodeId: string;
15
+ rowIndex: number;
16
+ columnIndex: number;
17
+ cellNodeId: string | null;
18
+ mergeRange: {
19
+ start: {
20
+ rowIndex: number;
21
+ columnIndex: number;
22
+ };
23
+ end: {
24
+ rowIndex: number;
25
+ columnIndex: number;
26
+ };
27
+ } | null;
28
+ }
29
+ export declare function readMergeRange(range: LooseRecord | undefined): {
30
+ start: {
31
+ rowIndex: number;
32
+ columnIndex: number;
33
+ };
34
+ end: {
35
+ rowIndex: number;
36
+ columnIndex: number;
37
+ };
38
+ } | null;
39
+ export declare function buildTableCommandInput(action: TableCommandSpec['action'], context: ResolvedTableContext): LooseRecord | null;
@@ -0,0 +1,39 @@
1
+ import { SuperDocUIReason } from './reasons.js';
2
+ import { CommandExecutionResult, CommandState, ListPresetId, PartialLinkEditReceipt, Receipt, SelectionSlice, SuperDocUIFailureReceipt, SuperDocUIReceiptFailureCode, ViewportRect, ViewportRectResult, WorkflowActionResult } from './types.js';
3
+ import { AnyFn, LooseRecord } from './loose-record.js';
4
+ import { CommandDescriptor, TrackDecisionSpec } from './commands.js';
5
+ export declare const SUPERDOC_UI_REASON_VALUES: Set<string>;
6
+ export declare function coerceSuperDocUIReason(reason: unknown, fallback: SuperDocUIReason): SuperDocUIReason;
7
+ export declare function normalizeHostSelectionApplyResult(result: unknown): WorkflowActionResult;
8
+ export declare const LIST_TOGGLE_KINDS: Record<string, 'bullet' | 'ordered'>;
9
+ export declare function listToggleKind(id: string): 'bullet' | 'ordered' | null;
10
+ export declare const TOOLBAR_LIST_STYLE_PRESETS: Record<string, ListPresetId>;
11
+ export declare function presetFromToolbarStyleKey(styleKey: string): {
12
+ preset?: ListPresetId;
13
+ behavior?: 'toggleStyle';
14
+ };
15
+ export declare function safeCall<T>(fn: (() => T) | undefined, fallback: T): T;
16
+ export declare function hostMethod(target: unknown, name: string): ((...args: unknown[]) => unknown) | null;
17
+ export declare function hasAbortedFlag(value: unknown): value is {
18
+ readonly aborted: boolean;
19
+ };
20
+ export declare function isPromiseLike(value: unknown): value is PromiseLike<unknown>;
21
+ export declare function resolveDocOperation(doc: LooseRecord | null, path: string): AnyFn | null;
22
+ export declare function failedReceipt(message: string, code?: Exclude<SuperDocUIReceiptFailureCode, 'PARTIAL_LINK_EDIT'>): SuperDocUIFailureReceipt;
23
+ export declare function partialLinkEditFailure(hyperlinkResult: CommandExecutionResult, textResult: CommandExecutionResult): PartialLinkEditReceipt;
24
+ export declare const MIRRORED_EDIT_COMMAND_IDS: {
25
+ readonly undo: "history.undo";
26
+ readonly redo: "history.redo";
27
+ };
28
+ export declare function normalizeCommandState(state: Partial<CommandState>, source: CommandState['source']): CommandState;
29
+ export declare function commandResultFromOperationResult(result: unknown): CommandExecutionResult;
30
+ export declare function isSuccessfulReceipt(result: CommandExecutionResult): result is Extract<Receipt, {
31
+ success: true;
32
+ }>;
33
+ export declare function commandResultSucceeded(result: CommandExecutionResult): boolean;
34
+ export declare function combineCommandResults(results: readonly CommandExecutionResult[]): CommandExecutionResult;
35
+ export declare function trackDecisionCommand(id: string): TrackDecisionSpec | null;
36
+ export declare function rectResult(rects: readonly ViewportRect[]): ViewportRectResult;
37
+ export declare function rectFailure(reason: string): ViewportRectResult;
38
+ export declare function relativizeRects(result: ViewportRectResult, relativeTo?: HTMLElement): ViewportRectResult;
39
+ export declare function commandIsActive(descriptor: CommandDescriptor, selection: SelectionSlice): boolean;
@@ -8,7 +8,7 @@ type FirstPartyCommandMutation = {
8
8
  };
9
9
  supports: (memberPath: string) => boolean;
10
10
  run: (memberPath: string, args: readonly unknown[]) => unknown;
11
- runListApply: (input: unknown) => Promise<boolean>;
11
+ runListApply: (input: unknown) => Promise<unknown>;
12
12
  };
13
13
  export declare function registerFirstPartyCommandMutation(superdoc: object, host: object, mutation: FirstPartyCommandMutation): void;
14
14
  /**
@@ -18,21 +18,5 @@ export declare function registerFirstPartyCommandMutation(superdoc: object, host
18
18
  export declare function readFirstPartyPageNumbers(ui: object): Promise<unknown>;
19
19
  export declare function executeFirstPartyCommandAsync(ui: Pick<SuperDocUI, 'commands'>, id: string, payload?: unknown): Promise<CommandExecutionResult>;
20
20
  export declare function executeFirstPartyShortcutAsync(ui: object, id: string, payload?: unknown): Promise<CommandExecutionResult>;
21
- /**
22
- * Heavy-read policy for the async read coordinator (source-loading deferral).
23
- * One shared table: the coordinator's gate and the table-driven policy tests
24
- * both consume THIS list, so the deferred set cannot silently drift from the
25
- * tested set. Keys are coordinator cache keys (exact) or key families
26
- * (prefix). See the gate in `readAsync` for the runtime semantics.
27
- */
28
- interface HeavyDocReadPolicyEntry {
29
- key: string;
30
- match: 'exact' | 'prefix';
31
- /** Audit rationale — why this key is catalog-scale (or reserved). */
32
- note: string;
33
- }
34
- export declare const HEAVY_DOC_READ_POLICY: readonly HeavyDocReadPolicyEntry[];
35
- /** Whether a coordinator cache key falls under the heavy-read policy. */
36
- export declare function isHeavyDocReadKey(key: string): boolean;
37
21
  export declare function createSuperDocUI(options: SuperDocUIOptions): SuperDocUI;
38
22
  export {};
@@ -0,0 +1,7 @@
1
+ import { ChangeRecord, StoryLocator } from '../../../../document-api/src/index.js';
2
+ import { SuperDocDocumentChange } from './types.js';
3
+ type RemoteDocumentChangeFacts = Omit<SuperDocDocumentChange, 'documentEpoch' | 'seq'>;
4
+ export declare function remoteChangeRecordsOf(event: Record<string, unknown>): ChangeRecord[];
5
+ export declare function storiesOfChangeRecords(records: readonly ChangeRecord[]): StoryLocator[];
6
+ export declare function remoteDocumentChange(records: readonly ChangeRecord[]): RemoteDocumentChangeFacts;
7
+ export {};
@@ -0,0 +1,14 @@
1
+ export declare function readEntityTarget(row: unknown): unknown | null;
2
+ export declare function isHostGeometryTarget(target: unknown): boolean;
3
+ export declare function readTrackedChangeNavigationTarget(row: unknown, options?: {
4
+ preferStableBlock?: boolean;
5
+ }): unknown | null;
6
+ export declare function storyLocatorSignature(story: unknown): string;
7
+ export declare function readEntityStory(row: unknown): unknown | null;
8
+ export declare function entityRowMatchesRequest(row: unknown, id: string, story?: unknown): boolean;
9
+ export declare function readEntityRequestStory(row: unknown): unknown | undefined;
10
+ export declare function layoutStoryDatasetToStoryLocator(raw: unknown): unknown;
11
+ export declare function storyKeyToStoryLocator(raw: unknown): unknown;
12
+ export declare function readSelectionTarget(row: unknown): unknown | null;
13
+ export declare function readContentControlRequestId(input: unknown): string | null;
14
+ export declare function readEntityId(row: unknown): string | null;
@@ -0,0 +1,7 @@
1
+ import { FontFamilyOption, FontSizeOption } from './types.js';
2
+ export declare const DEFAULT_FONT_FAMILY_OPTIONS: readonly FontFamilyOption[];
3
+ export declare function canonicalFontFamilyName(family: string): string;
4
+ export declare function normalizeDocumentFontOptions(raw: unknown): FontFamilyOption[];
5
+ export declare function normalizePickerFontOptions(raw: unknown): FontFamilyOption[];
6
+ export declare function composeFontFamilyOptions(documentOptions: readonly FontFamilyOption[], pickerOptions?: readonly FontFamilyOption[]): FontFamilyOption[];
7
+ export declare const DEFAULT_FONT_SIZE_OPTIONS: readonly FontSizeOption[];
@@ -0,0 +1,33 @@
1
+ export type FormatPainterMode = 'idle' | 'armed' | 'persistent';
2
+ export interface FormatPainterParagraphSnapshot {
3
+ styleId: string | null;
4
+ alignment: 'left' | 'right' | 'center' | 'justify' | null;
5
+ spacing: unknown | null;
6
+ indentation: {
7
+ left?: number;
8
+ right?: number;
9
+ firstLine?: number;
10
+ hanging?: number;
11
+ } | null;
12
+ markRunProps: unknown | null;
13
+ numbering: {
14
+ numId: number;
15
+ level?: number;
16
+ } | null;
17
+ listStyle: unknown | null;
18
+ }
19
+ export interface FormatPainterSnapshot {
20
+ story: unknown | null;
21
+ inline: Record<string, unknown>;
22
+ mixedInlineKeys: string[];
23
+ paragraph: FormatPainterParagraphSnapshot | null;
24
+ }
25
+ export declare const FORMAT_PAINTER_BOOLEAN_KEYS: Set<string>;
26
+ export interface FormatPainterState {
27
+ mode: FormatPainterMode;
28
+ snapshot: FormatPainterSnapshot | null;
29
+ sourceSelectionKey: string | null;
30
+ lastClickAt: number;
31
+ pointerSelecting: boolean;
32
+ keyboardSelecting: boolean;
33
+ }
@@ -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;