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
@@ -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,41 @@ export interface V2AuthoringFacade {
449
450
  * `#assignUserColor()` after `#init`.
450
451
  */
451
452
  export interface User {
453
+ commentIdentity?: {
454
+ providerId: string;
455
+ userId: string;
456
+ } | null;
457
+ /** Stable application user id. Collaborative change records report it as the actor id. */
452
458
  id?: string | null;
453
459
  name?: string | null;
454
460
  email?: string | null;
455
461
  image?: string | null;
462
+ /**
463
+ * Opaque identity claim published with this session's change records, such as
464
+ * a JWT your server signs. SuperDoc never verifies it.
465
+ */
466
+ claim?: UserClaim;
456
467
  [key: string]: unknown;
457
468
  }
469
+ /** Context passed to a {@link UserClaim} function. */
470
+ export interface UserClaimContext {
471
+ /** Collaboration document id of the session. */
472
+ documentId: string;
473
+ /** Yjs client id of the session. */
474
+ clientId: number;
475
+ }
476
+ /**
477
+ * Identity claim for {@link User.claim}: a string, or a function that returns
478
+ * one for the session's collaboration document and Yjs client id.
479
+ */
480
+ export type UserClaim = string | ((ctx: UserClaimContext) => string | Promise<string>);
481
+ /** Per-session retention of attributed change records (`doc.changes`). */
482
+ export interface ChangesConfig {
483
+ /** Maximum number of retained records. Defaults to 1000. */
484
+ retainRecords?: number;
485
+ /** Maximum retained size in bytes, including captured updates. Defaults to 8 MiB. */
486
+ retainBytes?: number;
487
+ }
458
488
  /** V2-neutral active editor facade exposed by legacy shell methods. */
459
489
  export interface EditorCommands {
460
490
  search?: (text: string | RegExp, options?: Record<string, unknown>) => SearchMatch[];
@@ -3178,19 +3208,7 @@ export interface EditorTransactionEvent {
3178
3208
  /** Header/footer variant (`default`, `first`, `even`, `odd`) when available. */
3179
3209
  sectionType?: string | null;
3180
3210
  }
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
- }
3211
+ export type { ContentControlRef } from '../../public/content-control-ref.js';
3194
3212
  /**
3195
3213
  * Previous content-control reference shape.
3196
3214
  * @deprecated replaceWith=`ContentControlRef` compat-indefinitely=v2 event payload compatibility
@@ -3216,13 +3234,7 @@ export interface ContentControlActiveChangePayload {
3216
3234
  /** Reported source of the selection change. */
3217
3235
  source: 'keyboard' | 'pointer';
3218
3236
  }
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
- }
3237
+ export type { ContentControlClickPayload } from '../../public/content-control-ref.js';
3226
3238
  export interface SuperDocLayoutEngineOptions {
3227
3239
  /**
3228
3240
  * Layout engine flow mode.
@@ -3881,6 +3893,37 @@ export interface TrackChangesInteractionConfig {
3881
3893
  */
3882
3894
  allowDecisions?: boolean;
3883
3895
  }
3896
+ /** Native keyboard writing assistance requested from the device keyboard. */
3897
+ export interface WritingAssistanceConfig {
3898
+ /** Let the keyboard apply autocorrect and predictive replacements (default: false). */
3899
+ autocorrect?: boolean;
3900
+ /** Keyboard auto-capitalization mode (default: 'off'). */
3901
+ autocapitalize?: 'off' | 'sentences' | 'words' | 'characters';
3902
+ /** Let the keyboard underline and suggest spelling fixes (default: false). */
3903
+ spellcheck?: boolean;
3904
+ }
3905
+ /**
3906
+ * Opt-in touch behavior for this Editor. Every field defaults to off, and
3907
+ * omitted or `false` values keep the existing touch behavior unchanged.
3908
+ * Mouse, pen and keyboard input are never affected.
3909
+ */
3910
+ export interface TouchInteractionConfig {
3911
+ /**
3912
+ * Opt in to SuperDoc-owned touch gestures (default: false).
3913
+ *
3914
+ * When enabled, a stationary touch hold on document content opens the
3915
+ * existing SuperDoc context menu when the finger lifts, with the same caret
3916
+ * and selection rules as a right-click. The lift does not activate content
3917
+ * underneath. Where the browser shows its own text-selection menu for the
3918
+ * hold (iOS Safari), it is dismissed once the SuperDoc menu opens and the
3919
+ * held word stays selected in SuperDoc; where the browser reports the hold
3920
+ * as a context-menu event (Android Chrome), the existing right-click path
3921
+ * opens the menu once. A hold during IME composition does nothing. Taps and
3922
+ * swipes keep their existing behavior. Hosts that disable the context menu,
3923
+ * and viewing mode, keep native behavior. Read when the editor mounts.
3924
+ */
3925
+ gestures?: boolean;
3926
+ }
3884
3927
  /**
3885
3928
  * Controls which interactions this Editor allows, independent of what
3886
3929
  * SuperDoc renders.
@@ -3893,6 +3936,10 @@ export interface InteractionConfig {
3893
3936
  comments?: CommentInteractionConfig;
3894
3937
  /** Tracked-change interaction policy. */
3895
3938
  trackedChanges?: TrackChangesInteractionConfig;
3939
+ /** Opt-in touch behavior. Omitted fields keep the existing behavior. */
3940
+ touch?: TouchInteractionConfig;
3941
+ /** Native keyboard writing assistance. Everything is off when omitted. */
3942
+ writingAssistance?: WritingAssistanceConfig;
3896
3943
  }
3897
3944
  /**
3898
3945
  * Shared plumbing for dialogs and floating overlays, including surfaces the
@@ -3937,16 +3984,25 @@ export interface SurfacesConfig {
3937
3984
  };
3938
3985
  }
3939
3986
  /**
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.
3987
+ * Worker URLs accepted by v2. The editor runs on the page and starts no
3988
+ * document worker, so only `collaboration` is used, and only by collaboration
3989
+ * targets with `providerType: 'extension'`.
3943
3990
  */
3944
3991
  interface V2WorkerUrlsConfig {
3945
- /** Main document worker used by non-collaborative v2 documents. */
3992
+ /**
3993
+ * @deprecated The editor runs on the page and starts no document worker.
3994
+ * Accepted and ignored for configuration compatibility.
3995
+ */
3946
3996
  document?: string | URL;
3947
- /** Collaboration-capable document worker used by v2 collaboration rooms. */
3997
+ /**
3998
+ * Your provider-extension collaboration worker, built with
3999
+ * `bootstrapSuperDocCollaborationWorker` from the same SuperDoc version.
4000
+ * Must be a same-origin module worker URL. Required for
4001
+ * `providerType: 'extension'`; ignored by the built-in providers, which
4002
+ * sync on the page.
4003
+ */
3948
4004
  collaboration?: string | URL;
3949
- /** @deprecated Review processing runs in the document worker. Accepted for configuration compatibility. */
4005
+ /** @deprecated Accepted and ignored for configuration compatibility. */
3950
4006
  reviewIndex?: string | URL;
3951
4007
  }
3952
4008
  export interface Config {
@@ -4172,12 +4228,25 @@ export interface Config {
4172
4228
  onReady?: (params: SuperDocReadyPayload) => void;
4173
4229
  /** Callback when comments are updated. */
4174
4230
  onCommentsUpdate?: (params: SuperDocCommentsUpdatePayload) => void;
4231
+ /**
4232
+ * Called when someone accepts a tracked change from its bubble in the comments sidebar.
4233
+ * Receives the tracked-change comment and the active editor. In SuperDoc 2 it runs after the accept is applied.
4234
+ */
4235
+ onTrackedChangeBubbleAccept?: (comment: Comment, editor: Editor | null) => void;
4236
+ /**
4237
+ * Called when someone rejects a tracked change from its bubble in the comments sidebar.
4238
+ * Receives the tracked-change comment and the active editor. In SuperDoc 2 it runs after the reject is applied.
4239
+ */
4240
+ onTrackedChangeBubbleReject?: (comment: Comment, editor: Editor | null) => void;
4175
4241
  /**
4176
4242
  * Callback when the selection enters, leaves, or moves between content controls.
4177
4243
  * @deprecated replaceWith=`superdoc.ui.contentControls.observe` compat-indefinitely=v2 event compatibility
4178
4244
  */
4179
4245
  onContentControlActiveChange?: (params: ContentControlActiveChangePayload) => void;
4180
- /** Callback when someone clicks inside a content control. */
4246
+ /**
4247
+ * Callback when someone clicks inside a content control.
4248
+ * @deprecated replaceWith=`superdoc.ui.contentControls.onClick` removeIn=v3.0
4249
+ */
4181
4250
  onContentControlClick?: (params: ContentControlClickPayload) => void;
4182
4251
  /** Callback when awareness is updated. */
4183
4252
  onAwarenessUpdate?: (params: SuperDocAwarenessUpdatePayload) => void;
@@ -4232,6 +4301,8 @@ export interface Config {
4232
4301
  * Callback when the zoom level changes. Fires for every zoom source:
4233
4302
  * `setZoom()`, the toolbar zoom control, and fit-width
4234
4303
  * adjustments.
4304
+ *
4305
+ * @deprecated replaceWith=`superdoc.ui.zoom.observe` removeIn=v3.0
4235
4306
  */
4236
4307
  onZoomChange?: (params: SuperDocZoomPayload) => void;
4237
4308
  /**
@@ -4404,22 +4475,22 @@ export interface Config {
4404
4475
  */
4405
4476
  fonts?: FontsConfig;
4406
4477
  /**
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.
4478
+ * Worker URLs. Only `collaboration` is used: the provider-extension
4479
+ * collaboration worker for `providerType: 'extension'`. `document` and
4480
+ * `reviewIndex` are accepted and ignored because the editor runs on the page.
4410
4481
  */
4411
4482
  workerUrls?: V2WorkerUrlsConfig;
4412
4483
  /**
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.
4484
+ * Budget for the provider-extension collaboration worker
4485
+ * (`workerUrls.collaboration`, `providerType: 'extension'`) to start up and
4486
+ * send its first response, in milliseconds. Defaults to the collaboration
4487
+ * `syncTimeoutMs`, or 30000. Worker load errors are reported immediately and
4488
+ * do not wait for this budget. Ignored by the built-in providers and by
4489
+ * documents opened without collaboration, which start no worker.
4421
4490
  */
4422
4491
  workerStartupTimeoutMs?: number;
4492
+ /** Retention of attributed change records read through `activeEditor.doc.changes`. */
4493
+ changes?: ChangesConfig;
4423
4494
  /**
4424
4495
  * Whether `layoutEngineOptions` are passed when a DOCX editor opens.
4425
4496
  *
@@ -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" };
@@ -283,6 +289,7 @@ import type { ToolbarItemId as __Cjs_ToolbarItemId } from './index.js' with { "r
283
289
  import type { ToolbarOptionalItemId as __Cjs_ToolbarOptionalItemId } from './index.js' with { "resolution-mode": "import" };
284
290
  import type { ToolbarRegion as __Cjs_ToolbarRegion } from './index.js' with { "resolution-mode": "import" };
285
291
  import type { ToolbarStringId as __Cjs_ToolbarStringId } from './index.js' with { "resolution-mode": "import" };
292
+ import type { TouchInteractionConfig as __Cjs_TouchInteractionConfig } from './index.js' with { "resolution-mode": "import" };
286
293
  import type { TrackChangeAuthor as __Cjs_TrackChangeAuthor } from './index.js' with { "resolution-mode": "import" };
287
294
  import type { TrackChangeHighlightColors as __Cjs_TrackChangeHighlightColors } from './index.js' with { "resolution-mode": "import" };
288
295
  import type { TrackChangesAuthorColorsConfig as __Cjs_TrackChangesAuthorColorsConfig } from './index.js' with { "resolution-mode": "import" };
@@ -298,14 +305,18 @@ import type { UIConfig as __Cjs_UIConfig } from './index.js' with { "resolution-
298
305
  import type { UpgradeToCollaborationOptions as __Cjs_UpgradeToCollaborationOptions } from './index.js' with { "resolution-mode": "import" };
299
306
  import type { UpgradeToCollaborationResult as __Cjs_UpgradeToCollaborationResult } from './index.js' with { "resolution-mode": "import" };
300
307
  import type { User as __Cjs_User } from './index.js' with { "resolution-mode": "import" };
308
+ import type { UserClaim as __Cjs_UserClaim } from './index.js' with { "resolution-mode": "import" };
309
+ import type { UserClaimContext as __Cjs_UserClaimContext } from './index.js' with { "resolution-mode": "import" };
301
310
  import type { V2CollaborationConfig as __Cjs_V2CollaborationConfig } from './index.js' with { "resolution-mode": "import" };
302
311
  import type { ViewingOptions as __Cjs_ViewingOptions } from './index.js' with { "resolution-mode": "import" };
303
312
  import type { ViewingTrackedChangesMode as __Cjs_ViewingTrackedChangesMode } from './index.js' with { "resolution-mode": "import" };
304
313
  import type { ViewingVisibilityConfig as __Cjs_ViewingVisibilityConfig } from './index.js' with { "resolution-mode": "import" };
305
314
  import type { ViewOptions as __Cjs_ViewOptions } from './index.js' with { "resolution-mode": "import" };
315
+ import type { WritingAssistanceConfig as __Cjs_WritingAssistanceConfig } from './index.js' with { "resolution-mode": "import" };
306
316
  export type { __Cjs_AwarenessState as AwarenessState };
307
317
  export type { __Cjs_AwarenessUser as AwarenessUser };
308
318
  export declare const BlankDOCX: typeof import('./index.js', { with: { "resolution-mode": "import" } }).BlankDOCX;
319
+ export type { __Cjs_BlockChange as BlockChange };
309
320
  export type { __Cjs_BlockNavigationAddress as BlockNavigationAddress };
310
321
  export type { __Cjs_BlocksListResult as BlocksListResult };
311
322
  export type { __Cjs_BookmarkAddress as BookmarkAddress };
@@ -314,6 +325,11 @@ export type { __Cjs_BorrowedSuperDocUI as BorrowedSuperDocUI };
314
325
  export declare const buildTheme: typeof import('./index.js', { with: { "resolution-mode": "import" } }).buildTheme;
315
326
  export type { __Cjs_BuiltInCommandId as BuiltInCommandId };
316
327
  export type { __Cjs_CanPerformPermissionParams as CanPerformPermissionParams };
328
+ export type { __Cjs_ChangeActor as ChangeActor };
329
+ export type { __Cjs_ChangeCause as ChangeCause };
330
+ export type { __Cjs_ChangeProvenance as ChangeProvenance };
331
+ export type { __Cjs_ChangeRecord as ChangeRecord };
332
+ export type { __Cjs_ChangesConfig as ChangesConfig };
317
333
  export type { __Cjs_CollaborationConfig as CollaborationConfig };
318
334
  export type { __Cjs_CommentAddress as CommentAddress };
319
335
  export type { __Cjs_CommentInteractionConfig as CommentInteractionConfig };
@@ -600,6 +616,7 @@ export type { __Cjs_ToolbarItemId as ToolbarItemId };
600
616
  export type { __Cjs_ToolbarOptionalItemId as ToolbarOptionalItemId };
601
617
  export type { __Cjs_ToolbarRegion as ToolbarRegion };
602
618
  export type { __Cjs_ToolbarStringId as ToolbarStringId };
619
+ export type { __Cjs_TouchInteractionConfig as TouchInteractionConfig };
603
620
  export type { __Cjs_TrackChangeAuthor as TrackChangeAuthor };
604
621
  export type { __Cjs_TrackChangeHighlightColors as TrackChangeHighlightColors };
605
622
  export type { __Cjs_TrackChangesAuthorColorsConfig as TrackChangesAuthorColorsConfig };
@@ -615,8 +632,11 @@ export type { __Cjs_UIConfig as UIConfig };
615
632
  export type { __Cjs_UpgradeToCollaborationOptions as UpgradeToCollaborationOptions };
616
633
  export type { __Cjs_UpgradeToCollaborationResult as UpgradeToCollaborationResult };
617
634
  export type { __Cjs_User as User };
635
+ export type { __Cjs_UserClaim as UserClaim };
636
+ export type { __Cjs_UserClaimContext as UserClaimContext };
618
637
  export type { __Cjs_V2CollaborationConfig as V2CollaborationConfig };
619
638
  export type { __Cjs_ViewingOptions as ViewingOptions };
620
639
  export type { __Cjs_ViewingTrackedChangesMode as ViewingTrackedChangesMode };
621
640
  export type { __Cjs_ViewingVisibilityConfig as ViewingVisibilityConfig };
622
641
  export type { __Cjs_ViewOptions as ViewOptions };
642
+ export type { __Cjs_WritingAssistanceConfig as WritingAssistanceConfig };
@@ -115,7 +115,7 @@ export type { SuperDocLayoutEngineOptions as LayoutEngineOptions } from '../core
115
115
  export type { FlowBlock, FlowMode, Layout, Fragment as LayoutFragment, Page as LayoutPage } from '../../../layout-engine/contracts/src/index.js';
116
116
  export type { LayoutMetrics } from '../../../layout-engine/layout-bridge/src/index.js';
117
117
  export type { LayoutMode } from '../../../layout-engine/painters/dom/src/index.js';
118
- export type { CommentInteractionConfig, CommentsConfig, CommentsLayout, CommentsResponsiveConfig, TrackChangesInteractionConfig, } from '../core/types/index.js';
118
+ export type { CommentInteractionConfig, CommentsConfig, CommentsLayout, CommentsResponsiveConfig, TouchInteractionConfig, TrackChangesInteractionConfig, WritingAssistanceConfig, } from '../core/types/index.js';
119
119
  export type { TrackChangeHighlightColors } from '../core/types/index.js';
120
120
  export type { ContentControlsConfig } from '../core/types/index.js';
121
121
  export type { RulerConfig } from '../core/types/index.js';
@@ -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,7 @@
1
+ import { ParagraphBatchOperation, SDParagraphProps, SDTabStop } from '../../../../document-api/src/index.js';
2
+ export type ParagraphPaintOperation = ParagraphBatchOperation;
3
+ type ParagraphPaintProperties = Omit<SDParagraphProps, 'tabs'> & {
4
+ tabs?: Partial<SDTabStop>[];
5
+ };
6
+ export declare function captureParagraphPaintOperations(props: ParagraphPaintProperties, supports?: (operationId: string) => boolean): ParagraphPaintOperation[];
7
+ export {};
@@ -0,0 +1,29 @@
1
+ import { SDRunProps } from '../../../../document-api/src/index.js';
2
+ import { ParagraphPaintOperation } from './format-painter-paragraph.js';
3
+ export type FormatPainterMode = 'idle' | 'armed' | 'persistent';
4
+ export interface FormatPainterParagraphSnapshot {
5
+ styleId: string | null;
6
+ inheritedFontKeys?: Array<'fontFamily' | 'fontSize'>;
7
+ operations: ParagraphPaintOperation[];
8
+ markRunProps: SDRunProps | null;
9
+ numbering: {
10
+ numId: number;
11
+ level?: number;
12
+ } | null;
13
+ listStyle: unknown | null;
14
+ }
15
+ export interface FormatPainterSnapshot {
16
+ story: unknown | null;
17
+ inline: Record<string, unknown>;
18
+ mixedInlineKeys: string[];
19
+ paragraph: FormatPainterParagraphSnapshot | null;
20
+ }
21
+ export declare const FORMAT_PAINTER_BOOLEAN_KEYS: Set<string>;
22
+ export interface FormatPainterState {
23
+ mode: FormatPainterMode;
24
+ snapshot: FormatPainterSnapshot | null;
25
+ sourceSelectionKey: string | null;
26
+ lastClickAt: number;
27
+ pointerSelecting: boolean;
28
+ keyboardSelecting: boolean;
29
+ }