superdoc 2.29.0-next.3 → 2.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/dist/chunks/{FindReplaceSurface-BKVHzhQ4.es.js → FindReplaceSurface-B_5ggdWg.es.js} +1 -1
  2. package/dist/chunks/{FindReplaceSurface-BNDrJ6VS.cjs → FindReplaceSurface-fVHxPXtn.cjs} +1 -1
  3. package/dist/chunks/{PasswordPromptSurface-6mF6Azda.es.js → PasswordPromptSurface-CZqhDQQ1.es.js} +1 -1
  4. package/dist/chunks/{PasswordPromptSurface-BNkaztaP.cjs → PasswordPromptSurface-x8GNmMJT.cjs} +1 -1
  5. package/dist/chunks/{PdfViewer-D4lVeOJu.es.js → PdfViewer-CW09MNrB.es.js} +70 -105
  6. package/dist/chunks/{PdfViewer-boENOZdF.cjs → PdfViewer-CkrAHpC-.cjs} +74 -109
  7. package/dist/chunks/{_plugin-vue_export-helper-6MBoygIY.cjs → _plugin-vue_export-helper-BkbCxNeT.cjs} +31 -7
  8. package/dist/chunks/{_plugin-vue_export-helper-CsJQtMvr.es.js → _plugin-vue_export-helper-DRPRMkeA.es.js} +20 -8
  9. package/dist/chunks/{constants-DpXuDx_g.cjs → constants-BeeNZoQp.cjs} +1 -1
  10. package/dist/chunks/{constants-B6VBlmKp.es.js → constants-BvNs_ybI.es.js} +1 -1
  11. package/dist/chunks/{create-super-doc-ui-BFt8agAI.es.js → create-super-doc-ui-Dc8dQAMc.es.js} +89 -137
  12. package/dist/chunks/{create-super-doc-ui-BAGOnYGM.cjs → create-super-doc-ui-L60GhVAX.cjs} +211 -259
  13. package/dist/collaboration-upgrade-engine.cjs +1 -1
  14. package/dist/collaboration-upgrade-engine.es.js +1 -1
  15. package/dist/document-api/src/capabilities/html-markdown-support.d.ts +4 -6
  16. package/dist/document-api/src/comments/comments.d.ts +2 -0
  17. package/dist/document-api/src/contract/command-catalog.d.ts +1 -1
  18. package/dist/document-api/src/contract/operation-definitions.d.ts +2 -2
  19. package/dist/document-api/src/contract/operation-registry.d.ts +10 -9
  20. package/dist/document-api/src/index.d.ts +8 -7
  21. package/dist/document-api/src/insert/insert.d.ts +2 -2
  22. package/dist/document-api/src/replace/replace.d.ts +3 -2
  23. package/dist/document-api/src/types/address.d.ts +3 -0
  24. package/dist/document-api/src/types/temporary-mutation.d.ts +5 -1
  25. package/dist/document-api/src/write/write.d.ts +12 -6
  26. package/dist/public/ui-react.cjs +1 -1
  27. package/dist/public/ui-react.es.js +1 -1
  28. package/dist/public/ui-vue.cjs +1 -1
  29. package/dist/public/ui-vue.es.js +1 -1
  30. package/dist/public/ui.cjs +1 -1
  31. package/dist/public/ui.es.js +1 -1
  32. package/dist/style.css +1 -1
  33. package/dist/style.layered.css +1 -1
  34. package/dist/superdoc/src/SuperDoc.vue.d.ts +132 -58
  35. package/dist/superdoc/src/components/CommentsLayer/CommentDialog.vue.d.ts +28 -13
  36. package/dist/superdoc/src/components/CommentsLayer/collect-removed-comment-ids.d.ts +11 -1
  37. package/dist/superdoc/src/components/CommentsLayer/collect-tracked-change-thread.d.ts +19 -2
  38. package/dist/superdoc/src/components/CommentsLayer/comment-urls.d.ts +1 -1
  39. package/dist/superdoc/src/components/CommentsLayer/commentsList/super-comments-list.d.ts +23 -20
  40. package/dist/superdoc/src/components/CommentsLayer/floating-comment-positioning.d.ts +24 -23
  41. package/dist/superdoc/src/components/CommentsLayer/helpers.d.ts +1 -4
  42. package/dist/superdoc/src/components/CommentsLayer/tracked-change-threading.d.ts +16 -2
  43. package/dist/superdoc/src/components/CommentsLayer/use-comment.d.ts +28 -13
  44. package/dist/superdoc/src/components/PdfViewer/PdfViewer.vue.d.ts +132 -45
  45. package/dist/superdoc/src/components/PdfViewer/PdfViewerDocument.vue.d.ts +62 -16
  46. package/dist/superdoc/src/components/PdfViewer/PdfViewerPage.vue.d.ts +77 -17
  47. package/dist/superdoc/src/components/PdfViewer/pdf-viewer-types.d.ts +45 -0
  48. package/dist/superdoc/src/components/Whiteboard/WhiteboardLayer.vue.d.ts +80 -16
  49. package/dist/superdoc/src/components/Whiteboard/WhiteboardPage.vue.d.ts +48 -13
  50. package/dist/superdoc/src/components/Whiteboard/use-whiteboard.d.ts +30 -15
  51. package/dist/superdoc/src/components/Whiteboard/whiteboard-types.d.ts +13 -0
  52. package/dist/superdoc/src/components/surfaces/focusable-selector.d.ts +1 -5
  53. package/dist/superdoc/src/components/surfaces/watermark-surface-runtime.d.ts +7 -7
  54. package/dist/superdoc/src/composables/find-shortcut-owner.d.ts +16 -9
  55. package/dist/superdoc/src/composables/replace-continuation.d.ts +11 -15
  56. package/dist/superdoc/src/composables/use-comment-small-screen.d.ts +11 -7
  57. package/dist/superdoc/src/composables/use-compact-comment-popover.d.ts +44 -18
  58. package/dist/superdoc/src/composables/use-document.d.ts +1210 -30
  59. package/dist/superdoc/src/composables/use-field.d.ts +88 -25
  60. package/dist/superdoc/src/composables/use-find-replace.d.ts +13 -3
  61. package/dist/superdoc/src/composables/use-password-prompt.d.ts +23 -24
  62. package/dist/superdoc/src/composables/use-viewport-fit.d.ts +62 -26
  63. package/dist/superdoc/src/composables/useUiFontFamily.d.ts +3 -11
  64. package/dist/superdoc/src/core/SuperDoc.d.ts +4 -4
  65. package/dist/superdoc/src/core/collaboration/collaboration-comments.d.ts +9 -4
  66. package/dist/superdoc/src/core/collaboration/helpers.d.ts +20 -3
  67. package/dist/superdoc/src/core/collaboration/permissions.d.ts +15 -10
  68. package/dist/superdoc/src/core/collaboration/resolve-v2-collaboration-target.d.ts +4 -3
  69. package/dist/superdoc/src/core/collaboration/v2-awareness-bridge.d.ts +2 -1
  70. package/dist/superdoc/src/core/config/merge-comments-config.d.ts +1 -5
  71. package/dist/superdoc/src/core/config/merge-defined.d.ts +3 -8
  72. package/dist/superdoc/src/core/config/normalize-hyperlinks-config.d.ts +7 -12
  73. package/dist/superdoc/src/core/config/normalize-surfaces-config.d.ts +9 -12
  74. package/dist/superdoc/src/core/config/normalize-ui-config.d.ts +1 -12
  75. package/dist/superdoc/src/core/create-app.d.ts +13 -24
  76. package/dist/superdoc/src/core/editor-runtime/conformance/fake-v2-runtime.d.ts +2 -1
  77. package/dist/superdoc/src/core/editor-runtime/editor-runtime-registry.d.ts +2 -1
  78. package/dist/superdoc/src/core/editor-runtime/index.d.ts +1 -1
  79. package/dist/superdoc/src/core/editor-runtime/types.d.ts +2 -1
  80. package/dist/superdoc/src/core/editor-runtime/v2/v2-session-shortcut-routes.d.ts +1 -1
  81. package/dist/superdoc/src/core/helpers/export.d.ts +3 -2
  82. package/dist/superdoc/src/core/helpers/file.d.ts +8 -45
  83. package/dist/superdoc/src/core/helpers/normalize-track-changes-config.d.ts +6 -60
  84. package/dist/superdoc/src/core/pdf/helpers/constants.d.ts +2 -2
  85. package/dist/superdoc/src/core/pdf/helpers/floor.d.ts +1 -1
  86. package/dist/superdoc/src/core/pdf/helpers/range.d.ts +1 -1
  87. package/dist/superdoc/src/core/pdf/helpers/read-file.d.ts +1 -1
  88. package/dist/superdoc/src/core/pdf/pdf-adapter.d.ts +28 -61
  89. package/dist/superdoc/src/core/superdoc-ui-owner.d.ts +1 -1
  90. package/dist/superdoc/src/core/surface-manager.d.ts +21 -83
  91. package/dist/superdoc/src/core/types/index.d.ts +41 -23
  92. package/dist/superdoc/src/core/v2-integration/browser-peer-runtime.d.ts +5 -3
  93. package/dist/superdoc/src/core/v2-integration/cdn-engine-loader.d.ts +3 -13
  94. package/dist/superdoc/src/core/v2-integration/internal-vue-runtime.d.ts +64 -59
  95. package/dist/superdoc/src/core/v2-integration/v2-integration.d.ts +10 -10
  96. package/dist/superdoc/src/core/whiteboard/Whiteboard.d.ts +22 -208
  97. package/dist/superdoc/src/core/whiteboard/WhiteboardPage.d.ts +163 -189
  98. package/dist/superdoc/src/core/whiteboard/helpers/createTextarea.d.ts +14 -1
  99. package/dist/superdoc/src/core/whiteboard/helpers/flattenPoints.d.ts +1 -1
  100. package/dist/superdoc/src/core/whiteboard/helpers/getRandomId.d.ts +1 -1
  101. package/dist/superdoc/src/helpers/comment-focus.d.ts +21 -4
  102. package/dist/superdoc/src/helpers/deprecation.d.ts +5 -11
  103. package/dist/superdoc/src/helpers/interaction-trace.d.ts +7 -24
  104. package/dist/superdoc/src/helpers/mark-raw-component.d.ts +1 -0
  105. package/dist/superdoc/src/helpers/object-guards.d.ts +2 -5
  106. package/dist/superdoc/src/helpers/selection-source.d.ts +1 -1
  107. package/dist/superdoc/src/helpers/use-selection.d.ts +35 -15
  108. package/dist/superdoc/src/helpers/v2-author-required-rejection.d.ts +8 -11
  109. package/dist/superdoc/src/helpers/v2-bulk-decision-event.d.ts +9 -7
  110. package/dist/superdoc/src/helpers/v2-keyboard-edit-rejection.d.ts +8 -7
  111. package/dist/superdoc/src/helpers/v2-mutation-exception.d.ts +12 -8
  112. package/dist/superdoc/src/helpers/v2-review-target.d.ts +11 -1
  113. package/dist/superdoc/src/helpers/v2-selection-sync.d.ts +40 -14
  114. package/dist/superdoc/src/helpers/v2-typing-mutation-event.d.ts +14 -5
  115. package/dist/superdoc/src/icons.d.ts +11 -19
  116. package/dist/superdoc/src/internal/diagnostics/diagnostic-dedupe.d.ts +6 -15
  117. package/dist/superdoc/src/internal/diagnostics/translate-diagnostic.d.ts +6 -4
  118. package/dist/superdoc/src/internal/toolbar/built-in/AIWriter.vue.d.ts +2 -2
  119. package/dist/superdoc/src/internal/toolbar/built-in/ButtonGroup.vue.d.ts +4 -24
  120. package/dist/superdoc/src/internal/toolbar/built-in/FontFamilyCombobox.vue.d.ts +34 -0
  121. package/dist/superdoc/src/internal/toolbar/built-in/FontSizeCombobox.vue.d.ts +34 -0
  122. package/dist/superdoc/src/internal/toolbar/built-in/LinkInput.vue.d.ts +1 -1
  123. package/dist/superdoc/src/internal/toolbar/built-in/PageNumberMenu.vue.d.ts +25 -15
  124. package/dist/superdoc/src/internal/toolbar/built-in/Toolbar.vue.d.ts +9 -3
  125. package/dist/superdoc/src/internal/toolbar/built-in/ToolbarComboBox.vue.d.ts +12 -14
  126. package/dist/superdoc/src/internal/toolbar/built-in/ToolbarDropdown.vue.d.ts +1 -11
  127. package/dist/superdoc/src/internal/toolbar/built-in/color-dropdown-helpers.d.ts +9 -19
  128. package/dist/superdoc/src/internal/toolbar/built-in/constants.d.ts +14 -45
  129. package/dist/superdoc/src/internal/toolbar/built-in/default-items.d.ts +34 -17
  130. package/dist/superdoc/src/internal/toolbar/built-in/font-options.d.ts +15 -1
  131. package/dist/superdoc/src/internal/toolbar/built-in/font-typeahead.d.ts +37 -7
  132. package/dist/superdoc/src/internal/toolbar/built-in/format-negation.d.ts +10 -4
  133. package/dist/superdoc/src/internal/toolbar/built-in/general.d.ts +12 -1
  134. package/dist/superdoc/src/internal/toolbar/built-in/helpers.d.ts +9 -4
  135. package/dist/superdoc/src/internal/toolbar/built-in/list-style-buttons.d.ts +2 -2
  136. package/dist/superdoc/src/internal/toolbar/built-in/page-number-feedback.d.ts +4 -5
  137. package/dist/superdoc/src/internal/toolbar/built-in/scroll-helpers.d.ts +3 -4
  138. package/dist/superdoc/src/internal/toolbar/built-in/toolbar-focus-helpers.d.ts +10 -2
  139. package/dist/superdoc/src/internal/toolbar/built-in/toolbarIcons.d.ts +78 -145
  140. package/dist/superdoc/src/internal/toolbar/built-in/toolbarTexts.d.ts +61 -61
  141. package/dist/superdoc/src/internal/toolbar/built-in/url-safety.d.ts +11 -3
  142. package/dist/superdoc/src/internal/toolbar/built-in/use-toolbar-item.d.ts +110 -48
  143. package/dist/superdoc/src/internal/toolbar/built-in-toolbar.d.ts +11 -30
  144. package/dist/superdoc/src/internal/toolbar/compatibility-catalog.d.ts +4 -3
  145. package/dist/superdoc/src/internal/toolbar/image-upload.d.ts +29 -39
  146. package/dist/superdoc/src/internal/toolbar/toolbar-item-aliases.d.ts +1 -1
  147. package/dist/superdoc/src/public/browser-document-api.d.ts +5 -4
  148. package/dist/superdoc/src/public/index.d.cts +26 -0
  149. package/dist/superdoc/src/public/index.d.ts +13 -0
  150. package/dist/superdoc/src/public/ui/commands.d.ts +14 -13
  151. package/dist/superdoc/src/public/ui/create-super-doc-ui.d.ts +1 -1
  152. package/dist/superdoc/src/public/ui/entity-at.d.ts +2 -1
  153. package/dist/superdoc/src/public/ui/format-painter-helpers.d.ts +2 -8
  154. package/dist/superdoc/src/public/ui/style-match-patch.d.ts +2 -2
  155. package/dist/superdoc/src/public/ui/types.d.ts +1 -1
  156. package/dist/superdoc/src/stores/comments-store.d.ts +231 -105
  157. package/dist/superdoc/src/stores/helpers/comment-document-scope.d.ts +22 -0
  158. package/dist/superdoc/src/stores/helpers/comment-grouping.d.ts +30 -0
  159. package/dist/superdoc/src/stores/helpers/comment-identity.d.ts +40 -0
  160. package/dist/superdoc/src/stores/helpers/floating-comment-instances.d.ts +48 -13
  161. package/dist/superdoc/src/stores/helpers/pending-selection-snapshot.d.ts +17 -0
  162. package/dist/superdoc/src/stores/helpers/tracked-change-compaction.d.ts +16 -0
  163. package/dist/superdoc/src/stores/helpers/tracked-change-decision.d.ts +45 -0
  164. package/dist/superdoc/src/stores/helpers/tracked-change-identity.d.ts +19 -0
  165. package/dist/superdoc/src/stores/helpers/tracked-change-row-values.d.ts +0 -4
  166. package/dist/superdoc/src/stores/helpers/tracked-change-thread-index.d.ts +21 -24
  167. package/dist/superdoc/src/stores/superdoc-store.d.ts +694 -316
  168. package/dist/superdoc.cjs +1804 -2782
  169. package/dist/superdoc.es.js +1720 -2699
  170. package/dist-cdn/style.layered.css +1 -1
  171. package/dist-cdn/superdoc.min.css +1 -1
  172. package/dist-cdn/superdoc.min.js +42 -42
  173. package/package.json +3 -2
  174. package/dist/superdoc/src/internal/toolbar/index.d.ts +0 -10
  175. package/dist/superdoc/src/main.d.ts +0 -1
@@ -1,5 +1,5 @@
1
1
  import { EditorRuntime, EditorRuntimeDocumentMode, EditorRuntimeId, EditorRuntimeState } from '../index.js';
2
- export interface FakeV2RuntimeOptions {
2
+ interface FakeV2RuntimeOptions {
3
3
  id?: EditorRuntimeId;
4
4
  documentId?: string;
5
5
  root?: HTMLElement;
@@ -7,3 +7,4 @@ export interface FakeV2RuntimeOptions {
7
7
  initialDocumentMode?: EditorRuntimeDocumentMode;
8
8
  }
9
9
  export declare function createFakeV2Runtime(options?: FakeV2RuntimeOptions): EditorRuntime;
10
+ export {};
@@ -18,7 +18,7 @@ export interface EditorRuntimeRegistryActiveChange {
18
18
  */
19
19
  readonly legacyEditorProjection: unknown | null;
20
20
  }
21
- export type EditorRuntimeRegistryListener = (change: EditorRuntimeRegistryActiveChange) => void;
21
+ type EditorRuntimeRegistryListener = (change: EditorRuntimeRegistryActiveChange) => void;
22
22
  export type EditorRuntimeRegistryUnsubscribe = () => void;
23
23
  /**
24
24
  * Internal SuperDoc registry of mounted editor runtimes and the active-runtime
@@ -115,3 +115,4 @@ export declare class EditorRuntimeRegistry {
115
115
  */
116
116
  clear(): void;
117
117
  }
118
+ export {};
@@ -1 +1 @@
1
- export type { EditorRuntimeKind, EditorRuntimeId, EditorRuntimeDocumentMode, EditorRuntimeUser, EditorRuntimeState, EditorRuntime, EditorRuntimeSnapshot, EditorRuntimeCapabilities, RuntimeLifecycleCapabilities, RuntimeSelectionCapabilities, RuntimeCommandCapabilities, RuntimeFindReplaceCapabilities, RuntimeAiCapabilities, RuntimeCommentCapabilities, RuntimeTrackedChangeCapabilities, RuntimeToolbarCapabilities, RuntimeLayoutCapabilities, RuntimeZoomCapabilities, RuntimeNavigationCapabilities, RuntimePersistenceCapabilities, EditorRuntimeCommand, EditorRuntimeCommandKind, EditorRuntimeCommandResult, EditorRuntimeRejectionCode, EditorRuntimeNoopReason, EditorRuntimeSelectionSnapshot, EditorRuntimeFindSessionSnapshot, EditorRuntimeToolbarState, EditorRuntimeLayoutSnapshot, EditorRuntimePositionToken, EditorRuntimeFocusOptions, EditorRuntimeSaveOptions, EditorRuntimeExportOptions, EditorRuntimeNavigationTarget, EditorRuntimeEvent, EditorRuntimeListener, EditorRuntimeUnsubscribe, RuntimeJsonPrimitive, RuntimeJsonValue, RuntimeJsonObject, } from './types.js';
1
+ export type { EditorRuntimeId, EditorRuntimeDocumentMode, EditorRuntimeUser, EditorRuntimeState, EditorRuntime, EditorRuntimeSnapshot, EditorRuntimeCapabilities, EditorRuntimeCommand, EditorRuntimeCommandKind, EditorRuntimeCommandResult, EditorRuntimeRejectionCode, EditorRuntimeSelectionSnapshot, EditorRuntimeFindSessionSnapshot, EditorRuntimeToolbarState, EditorRuntimeLayoutSnapshot, EditorRuntimePositionToken, EditorRuntimeFocusOptions, EditorRuntimeExportOptions, EditorRuntimeNavigationTarget, EditorRuntimeEvent, EditorRuntimeListener, EditorRuntimeUnsubscribe, } from './types.js';
@@ -1,5 +1,5 @@
1
1
  /** A structured-clone / JSON-safe primitive. */
2
- export type RuntimeJsonPrimitive = string | number | boolean | null;
2
+ type RuntimeJsonPrimitive = string | number | boolean | null;
3
3
  /** A structured-clone / JSON-safe value. */
4
4
  export type RuntimeJsonValue = RuntimeJsonPrimitive | RuntimeJsonValue[] | {
5
5
  [key: string]: RuntimeJsonValue;
@@ -418,3 +418,4 @@ export interface EditorRuntime {
418
418
  reveal(target: EditorRuntimeNavigationTarget): Promise<EditorRuntimeCommandResult>;
419
419
  subscribe(listener: EditorRuntimeListener): EditorRuntimeUnsubscribe;
420
420
  }
421
+ export {};
@@ -40,7 +40,7 @@ interface PageNumberCommandRoute {
40
40
  /** Run the command as a first-party UI action. */
41
41
  execute: () => Promise<unknown>;
42
42
  }
43
- export interface CreateV2SessionShortcutRoutesDeps {
43
+ interface CreateV2SessionShortcutRoutesDeps {
44
44
  /** Resolve the live toolbar container element for this SuperDoc instance. */
45
45
  resolveToolbarElement: () => HTMLElement | null | undefined;
46
46
  /** Resolve the live public Document API facade, or null when unavailable. */
@@ -1,2 +1,3 @@
1
- export function createDownload(data: Blob | ArrayBuffer | ArrayBufferView | string, name: string, extension: string): Blob;
2
- export function cleanName(currentName: string): string;
1
+ export type DownloadData = Blob | ArrayBuffer | ArrayBufferView<ArrayBuffer> | string;
2
+ export declare const createDownload: (data: DownloadData, name: string, extension: string) => Blob;
3
+ export declare const cleanName: (currentName: string) => string;
@@ -1,45 +1,8 @@
1
- export function extractBrowserFile(input: File | Blob | UploadWrapper | any, fallbackName?: string): File | Blob | null;
2
- export function isDocumentByteSource(input: unknown): input is ArrayBuffer | Uint8Array;
3
- export function documentByteSourceToBlob(input: ArrayBuffer | Uint8Array, type: string): Blob;
4
- export function normalizeDocumentEntry(entry: File | Blob | UploadWrapper | DocumentEntry | any): DocumentEntry | any;
5
- export type UploadWrapper = {
6
- /**
7
- * Underlying file reference used by some uploaders
8
- */
9
- originFileObj?: File | Blob | undefined;
10
- /**
11
- * Underlying file reference used by some uploaders
12
- */
13
- file?: File | Blob | undefined;
14
- /**
15
- * Underlying file reference used by some uploaders
16
- */
17
- raw?: File | Blob | undefined;
18
- /**
19
- * Optional unique id from uploaders (ignored)
20
- */
21
- uid?: string | number | undefined;
22
- /**
23
- * Display name (not always reliable for the native file)
24
- */
25
- name?: string | undefined;
26
- };
27
- export type DocumentEntry = {
28
- /**
29
- * Mime type or shorthand ('docx' | 'pdf' | 'html')
30
- */
31
- type?: string | undefined;
32
- /**
33
- * Filename to display
34
- */
35
- name?: string | undefined;
36
- /**
37
- * Document data
38
- */
39
- data?: File | Blob | ArrayBuffer | Uint8Array<ArrayBufferLike> | UploadWrapper | undefined;
40
- /**
41
- * Remote URL to fetch; left as-is for URL flows
42
- */
43
- url?: string | undefined;
44
- isNewFile?: boolean | undefined;
45
- };
1
+ import { Document, DocumentSource } from '../types/index.js';
2
+ type BrowserFile = File | Blob;
3
+ type DocumentByteSource = ArrayBuffer | Uint8Array;
4
+ export declare const extractBrowserFile: (input: unknown, fallbackName?: unknown) => BrowserFile | null;
5
+ export declare const isDocumentByteSource: (input: unknown) => input is DocumentByteSource;
6
+ export declare const documentByteSourceToBlob: (input: DocumentByteSource, type: string) => Blob;
7
+ export declare function normalizeDocumentEntry(entry: Exclude<DocumentSource, string>): Document;
8
+ export {};
@@ -1,60 +1,6 @@
1
- /**
2
- * Resolves tracked-change behavior from `config.trackChanges` and viewer
3
- * projection from `config.viewing.trackedChanges`. The normalized result is
4
- * mirrored to the previous paths while their internal consumers migrate.
5
- *
6
- * Precedence per field: canonical > legacy > derived default.
7
- *
8
- * Emits a one-time deprecation warning per legacy key path that was
9
- * populated by the caller. Suppresses warnings on a second pass over the
10
- * same config object so write-through values don't look like new legacy
11
- * usage.
12
- *
13
- * @param {Record<string, any>} config The SuperDoc config object (mutated in place)
14
- * @returns {NormalizedTrackChangesConfig}
15
- */
16
- export function normalizeTrackChangesConfig(config: Record<string, any>): NormalizedTrackChangesConfig;
17
- /**
18
- * Test-only hook: clears the deduplicated deprecation-warning set so
19
- * tests can assert the warning fires on the first invocation.
20
- */
21
- export function __resetDeprecationWarnings(): void;
22
- export type TrackChangesMode = "review" | "original" | "final" | "off";
23
- export type ViewingTrackedChangesMode = "original" | "markup" | "final";
24
- export type TrackChangesReplacementMode = "grouped" | "separate";
25
- export type InternalTrackChangesReplacementMode = "paired" | "independent";
26
- export type AuthorColorsConfig = {
27
- enabled?: boolean;
28
- overrides?: Record<string, string>;
29
- resolve?: (author: {
30
- name?: string;
31
- email?: string;
32
- image?: string;
33
- }) => (string | undefined);
34
- };
35
- export type TrackedChangeSemanticColorKey = import('../types/index.js').TrackedChangeSemanticColorKey;
36
- export type SemanticColorResolverInput = {
37
- key: TrackedChangeSemanticColorKey;
38
- author?: {
39
- name?: string;
40
- email?: string;
41
- image?: string;
42
- };
43
- type?: string;
44
- subtype?: string;
45
- targetKind?: string;
46
- semanticAnchorScope?: string;
47
- };
48
- export type SemanticColorsConfig = {
49
- enabled?: boolean;
50
- overrides?: Partial<Record<TrackedChangeSemanticColorKey, string>>;
51
- resolve?: (input: SemanticColorResolverInput) => (string | undefined);
52
- };
53
- export type NormalizedTrackChangesConfig = {
54
- visible: boolean;
55
- mode: TrackChangesMode;
56
- enabled: boolean;
57
- replacements: InternalTrackChangesReplacementMode;
58
- authorColors?: AuthorColorsConfig;
59
- semanticColors?: SemanticColorsConfig;
60
- };
1
+ import { Config, TrackChangesModuleConfig } from '../types/index.js';
2
+ type TrackChangesConfigSource = Pick<Config, 'documentMode' | 'viewing' | 'modules' | 'trackChanges' | 'layoutEngineOptions' | 'comments'>;
3
+ type NormalizedTrackChangesConfig = Required<Pick<TrackChangesModuleConfig, 'visible' | 'mode' | 'enabled' | 'replacements'>> & Pick<TrackChangesModuleConfig, 'authorColors' | 'semanticColors'>;
4
+ export declare function normalizeTrackChangesConfig(config: TrackChangesConfigSource): NormalizedTrackChangesConfig;
5
+ export declare function __resetDeprecationWarnings(): void;
6
+ export {};
@@ -1,2 +1,2 @@
1
- export const OUTPUT_SCALE: 2;
2
- export const PDF_TO_CSS_UNITS: number;
1
+ export declare const OUTPUT_SCALE = 2;
2
+ export declare const PDF_TO_CSS_UNITS: number;
@@ -1 +1 @@
1
- export function floor(val: any, precision: any): number;
1
+ export declare const floor: (val: number, precision?: number) => number;
@@ -1 +1 @@
1
- export function range(start: any, end: any): any[];
1
+ export declare const range: (start: number, end: number) => number[];
@@ -1 +1 @@
1
- export function readFileAsArrayBuffer(blob: any): Promise<any>;
1
+ export declare const readFileAsArrayBuffer: (blob: Blob) => Promise<ArrayBuffer>;
@@ -1,66 +1,33 @@
1
- /**
2
- * @param {number} version
3
- * @returns {string}
4
- */
5
- export function getWorkerSrcFromCDN(version: number): string;
6
- export function createPDFConfig(config?: Partial<PDFConfig>): PDFConfig;
7
- export class PDFJSAdapter extends PDFAdapter {
8
- /**
9
- * @param {PDFJSConfig} config
10
- */
11
- constructor(config: PDFJSConfig);
12
- pdfLib: any;
13
- workerSrc: string | undefined;
14
- /**
15
- * @param {string | ArrayBuffer | Uint8Array} file
16
- * @returns {Promise<PDFDocumentProxy>}
17
- */
18
- getDocument(file: string | ArrayBuffer | Uint8Array): Promise<PDFDocumentProxy>;
19
- /**
20
- * @param {PDFDocumentProxy} pdf
21
- * @param {number} firstPage
22
- * @param {number} lastPage
23
- * @returns {Promise<PDFPageProxy[]>}
24
- */
25
- getPages(pdf: PDFDocumentProxy, firstPage: number, lastPage: number): Promise<PDFPageProxy[]>;
26
- }
27
- export class PDFAdapterFactory {
28
- /**
29
- * @param {PDFJSConfig & {adapter: AdapterType}} config
30
- * @returns {PDFAdapter}
31
- * @throws {Error}
32
- */
33
- static create(config: PDFJSConfig & {
34
- adapter: AdapterType;
35
- }): PDFAdapter;
36
- }
37
- export type PDFDocumentProxy = import('pdfjs-dist').PDFDocumentProxy;
38
- export type PDFPageProxy = import('pdfjs-dist').PDFPageProxy;
39
- export type AdapterType = "pdfjs";
40
- export type PDFConfig = {
41
- adapter: AdapterType;
42
- pdfLib?: any;
43
- workerSrc?: string | undefined;
44
- setWorker?: boolean | undefined;
45
- };
1
+ import { PDFDocumentProxy, PDFPageProxy } from 'pdfjs-dist';
2
+ import type * as PdfJs from 'pdfjs-dist';
3
+ export type AdapterType = 'pdfjs';
4
+ export type PdfJsLib = Pick<typeof PdfJs, 'getDocument' | 'GlobalWorkerOptions' | 'version'>;
5
+ export type PdfSource = NonNullable<Parameters<PdfJsLib['getDocument']>[0]>;
46
6
  export type PDFJSConfig = {
47
- pdfLib: any;
48
- workerSrc?: string | undefined;
49
- setWorker?: boolean | undefined;
7
+ pdfLib?: object;
8
+ workerSrc?: string;
9
+ setWorker?: boolean;
50
10
  };
51
- export type RenderPagesOptions = {
52
- documentId: string;
53
- pdfDocument: PDFDocumentProxy;
54
- viewerContainer: HTMLElement;
55
- emit?: ((arg0: string, ...arg1: any[]) => void) | undefined;
56
- };
57
- export type PageSize = {
58
- width: number;
59
- height: number;
11
+ export type PDFConfig = PDFJSConfig & {
12
+ adapter: AdapterType;
60
13
  };
61
- /**
62
- * @abstract
63
- */
64
- declare class PDFAdapter {
14
+ export declare const createPDFConfig: (config?: Partial<PDFConfig>) => PDFConfig;
15
+ declare abstract class PDFAdapter {
16
+ constructor();
17
+ }
18
+ export declare class PDFJSAdapter extends PDFAdapter {
19
+ pdfLib: object | undefined;
20
+ workerSrc: string | undefined;
21
+ constructor(config: PDFJSConfig);
22
+ getDocument(file: PdfSource): Promise<PDFDocumentProxy>;
23
+ getPages<Page = PDFPageProxy>(pdf: {
24
+ getPage(pageNumber: number): Promise<Page>;
25
+ }, firstPage: number, lastPage: number): Promise<Page[]>;
26
+ }
27
+ export declare class PDFAdapterFactory {
28
+ static create(config: PDFJSConfig & {
29
+ adapter: string;
30
+ }): PDFJSAdapter;
65
31
  }
32
+ export declare function getWorkerSrcFromCDN(version: string): string;
66
33
  export {};
@@ -1 +1 @@
1
- export function getSuperDocUiOwnerId(superdoc: any): any;
1
+ export declare function getSuperDocUiOwnerId(superdoc: unknown): string | null;
@@ -1,90 +1,28 @@
1
- /**
2
- * SurfaceManager — a plain JavaScript class that owns surface lifecycle state.
3
- *
4
- * NOT a Pinia store. Lives on the SuperDoc instance and survives runtime
5
- * restarts (collaboration upgrades). Vue components observe the reactive
6
- * refs (`activeDialog`, `activeFloating`) via provide/inject.
7
- */
8
- export class SurfaceManager {
9
- /**
10
- * @param {{ getModuleConfig: () => SurfacesModuleConfig | undefined }} options
11
- */
12
- constructor({ getModuleConfig }: {
13
- getModuleConfig: () => SurfacesModuleConfig | undefined;
14
- });
15
- /** @type {import('vue').ShallowRef<ActiveSurface | null>} */
16
- activeDialog: import('vue').ShallowRef<ActiveSurface | null>;
17
- /** @type {import('vue').ShallowRef<ActiveSurface | null>} */
18
- activeFloating: import('vue').ShallowRef<ActiveSurface | null>;
19
- /**
20
- * Open a surface. Returns a handle with a result promise that always resolves.
21
- *
22
- * Throws synchronously on API misuse (bad request shape, unresolvable intent).
23
- * Normal lifecycle events (close, replace, destroy) resolve through the handle.
24
- *
25
- * @template [TResult=unknown]
26
- * @param {SurfaceRequest} rawRequest
27
- * @returns {SurfaceHandle<TResult>}
28
- */
29
- open<TResult = unknown>(rawRequest: SurfaceRequest): SurfaceHandle<TResult>;
30
- /**
31
- * Close a surface by id, or the topmost surface if no id is given.
32
- * @param {string} [id]
33
- * @param {unknown} [reason]
34
- */
35
- close(id?: string, reason?: unknown): void;
36
- /**
37
- * Settle all active surfaces with the given outcome.
38
- * Used by SuperDoc during runtime restart and destroy.
39
- * @param {SurfaceOutcome} outcome
40
- */
41
- settleAll(outcome: SurfaceOutcome): void;
42
- /**
43
- * Permanently shut down the manager. All active surfaces are settled with
44
- * { status: 'destroyed' }. Future open() calls return destroyed handles.
45
- */
46
- destroy(): void;
47
- #private;
48
- }
49
- export type SurfaceMode = import('./types/index.js').SurfaceMode;
50
- export type SurfaceRequest = import('./types/index.js').SurfaceRequest;
51
- export type SurfaceResolution = import('./types/index.js').SurfaceResolution;
52
- export type SurfaceHandle = import('./types/index.js').SurfaceHandle;
53
- export type SurfaceOutcome = import('./types/index.js').SurfaceOutcome;
54
- export type SurfacesModuleConfig = import('./types/index.js').SurfacesModuleConfig;
55
- export type ExternalSurfaceRenderContext = import('./types/index.js').ExternalSurfaceRenderContext;
56
- export type ActiveSurface = {
1
+ import { ShallowRef } from 'vue';
2
+ import { DirectSurfaceRequest, SurfaceHandle, SurfaceMode, SurfaceOutcome, SurfaceRequest, SurfacesModuleConfig } from './types/index.js';
3
+ type SurfaceRender = NonNullable<DirectSurfaceRequest['render']>;
4
+ export interface ActiveSurface {
57
5
  id: string;
58
6
  mode: SurfaceMode;
59
7
  request: SurfaceRequest;
60
- /**
61
- * Resolved Vue component
62
- */
63
8
  component?: unknown;
64
- /**
65
- * Extra props for the Vue component
66
- */
67
- props?: Record<string, unknown> | undefined;
68
- /**
69
- * External renderer
70
- */
71
- render?: ((ctx: ExternalSurfaceRenderContext) => ({
72
- destroy?: () => void;
73
- } | void)) | undefined;
74
- /**
75
- * Content-facing: settle with 'submitted'
76
- */
9
+ props?: Record<string, unknown>;
10
+ render?: SurfaceRender;
77
11
  resolve: (data?: unknown) => void;
78
- /**
79
- * Content-facing: settle with 'closed' and clear slot
80
- */
81
12
  close: (reason?: unknown) => void;
82
- /**
83
- * Settle the handle promise (internal)
84
- */
85
13
  settle: (outcome: SurfaceOutcome) => boolean;
86
- /**
87
- * Whether the handle has already been settled
88
- */
89
- settled: boolean;
90
- };
14
+ readonly settled: boolean;
15
+ }
16
+ export declare class SurfaceManager {
17
+ #private;
18
+ activeDialog: ShallowRef<ActiveSurface | null>;
19
+ activeFloating: ShallowRef<ActiveSurface | null>;
20
+ constructor({ getModuleConfig }: {
21
+ getModuleConfig: () => SurfacesModuleConfig | undefined;
22
+ });
23
+ open(rawRequest: SurfaceRequest): SurfaceHandle;
24
+ close(id?: string, reason?: unknown): void;
25
+ settleAll(outcome: SurfaceOutcome): void;
26
+ destroy(): void;
27
+ }
28
+ export {};
@@ -9,7 +9,7 @@ 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
11
  import { CustomCommandContext, FontFamilyOption as ToolbarFontFamilyOption } from '../../public/ui/types.js';
12
- export type { DocumentFontOption, FontAssetUrlContext, FontAssetUrlResolver, FontFaceSlot, FontFamilyOption, FontLoadResult, FontLoadStatus, FontLoadSummary, FontResolutionReason, FontResolutionRecord, GlyphException, ResolvedFontEvidence, SubstitutePolicyAction, SubstituteVerdict, } from '../../../../shared/font-system/src/index.js';
12
+ export type { DocumentFontOption, FontFamilyOption, FontLoadSummary, FontResolutionRecord, } from '../../../../shared/font-system/src/index.js';
13
13
  export type SuperDoc = SuperDocClass;
14
14
  export type { BrowserDocumentApi } from '../../public/browser-document-api.js';
15
15
  export type { CommentsType, ExportParams, ExportType } from '../../public/export-types.js';
@@ -1099,9 +1099,7 @@ export interface RuntimeDocument extends Document {
1099
1099
  * created one. Set by the editor-create lifecycle.
1100
1100
  *
1101
1101
  * @deprecated Direct editor access will be removed in a future version.
1102
- * Use the Document API (`editor.doc`) instead. This typedef carries the
1103
- * deprecation marker forward from the source accessor in
1104
- * `packages/superdoc/src/composables/use-document.js`.
1102
+ * Use the Document API (`editor.doc`) instead.
1105
1103
  */
1106
1104
  getEditor?: () => Editor | null | undefined;
1107
1105
  /**
@@ -2882,7 +2880,7 @@ export type DocumentMode = 'editing' | 'viewing' | 'suggesting';
2882
2880
  * - 'print': Print Layout View — displays document as it prints (default)
2883
2881
  * - 'web': Web Page View — content reflows to fit container (mobile/accessibility)
2884
2882
  */
2885
- export type ViewLayout = 'print' | 'web';
2883
+ type ViewLayout = 'print' | 'web';
2886
2884
  /**
2887
2885
  * Document view options for controlling how the document is displayed.
2888
2886
  * Mirrors OOXML document view settings.
@@ -2921,6 +2919,7 @@ export interface EditorUpdateEvent {
2921
2919
  * available. Always present (defaults to `null`); may be `null`.
2922
2920
  */
2923
2921
  sectionType: string | null;
2922
+ isRemote: boolean;
2924
2923
  }
2925
2924
  /**
2926
2925
  * Payload emitted with the `ready` event and passed to `Config.onReady`.
@@ -3073,18 +3072,50 @@ export interface SuperDocAwarenessUpdatePayload {
3073
3072
  * `Config.onCommentsUpdate`. Field set differs from older inline
3074
3073
  * declarations: the runtime emits `comment?` and `changes?` (never a
3075
3074
  * `data` field).
3075
+ *
3076
+ * A refused comment mutation emits `rejected: true` with a stable `reason`
3077
+ * (e.g. `'adapter-threw'`, `'receipt-failure'`) and leaves the comment list
3078
+ * unchanged so the user can retry. It may add the document receipt failure
3079
+ * `code` (e.g. `'TARGET_NOT_FOUND'`), a `detail` (an error message or a
3080
+ * structured description of the mismatch), and `committed: true` when the
3081
+ * change reached the document but could not be confirmed in the comment list.
3076
3082
  */
3077
3083
  export interface SuperDocCommentsUpdatePayload {
3078
- /** Update kind (e.g. `'created'`, `'updated'`, `'deleted'`); set by the comments store. */
3084
+ /** Update kind (e.g. `'add'`, `'update'`, `'deleted'`, `'resolved'`, `'pending'`); set by the comments store. */
3079
3085
  type: string;
3080
- /** The comment object the update refers to, when applicable. */
3081
- comment?: Comment;
3082
- /** Per-field change set when the update is a mutation. */
3086
+ /** The comment object the update refers to, when applicable; `null` when a created comment could not be read back. */
3087
+ comment?: Comment | null;
3088
+ /** Per-field change set: `'deleted'` names the comment; `text`, `isInternal`, `resolvedTime` carry `value` (check its type, not just `key`). */
3083
3089
  changes?: Array<{
3084
3090
  key: string;
3085
3091
  commentId: string;
3086
3092
  fileId?: string | null;
3093
+ value?: undefined;
3094
+ previousValue?: undefined;
3095
+ } | {
3096
+ key: 'text';
3097
+ value: string;
3098
+ commentId?: undefined;
3099
+ fileId?: undefined;
3100
+ previousValue?: undefined;
3101
+ } | {
3102
+ key: 'isInternal';
3103
+ value: boolean;
3104
+ previousValue: boolean;
3105
+ commentId?: undefined;
3106
+ fileId?: undefined;
3107
+ } | {
3108
+ key: 'resolvedTime';
3109
+ value: null;
3110
+ commentId?: undefined;
3111
+ fileId?: undefined;
3112
+ previousValue?: undefined;
3087
3113
  }>;
3114
+ rejected?: true;
3115
+ reason?: string;
3116
+ committed?: true;
3117
+ code?: string;
3118
+ detail?: unknown;
3088
3119
  /**
3089
3120
  * The Document API selection snapshot captured at the moment a
3090
3121
  * `'pending'` comment was started, before the pending mark is
@@ -3102,7 +3133,7 @@ export interface SuperDocCommentsUpdatePayload {
3102
3133
  */
3103
3134
  pendingSelection?: SelectionInfo | null;
3104
3135
  }
3105
- export interface EditorTransactionLike {
3136
+ interface EditorTransactionLike {
3106
3137
  readonly docChanged?: boolean;
3107
3138
  readonly doc?: {
3108
3139
  readonly content?: {
@@ -4480,19 +4511,6 @@ export interface InternalConfig extends Config {
4480
4511
  /** Normalized to `{}` by `#init` if the consumer passes nothing or `undefined`. */
4481
4512
  layoutEngineOptions: SuperDocLayoutEngineOptions;
4482
4513
  }
4483
- /**
4484
- * Internal augmentation of `SuperDocLayoutEngineOptions` for unstable tuning
4485
- * fields. The public `SuperDocLayoutEngineOptions` interface above is the
4486
- * customer-facing contract; this type adds fields the implementation may
4487
- * read but that are intentionally not part of the v1 stable API.
4488
- */
4489
- export interface InternalSuperDocLayoutEngineOptions extends SuperDocLayoutEngineOptions {
4490
- /**
4491
- * Internal-only semantic mode tuning options. Shape may change without
4492
- * notice; not part of the public surface.
4493
- */
4494
- semanticOptions?: object;
4495
- }
4496
4514
  export type ProofingStatus = 'idle' | 'checking' | 'disabled' | 'degraded';
4497
4515
  export interface ProofingError {
4498
4516
  kind: 'provider-error' | 'validation-error' | 'timeout';
@@ -1,3 +1,5 @@
1
- export function readSuperDocV2BrowserRuntime(globalObject?: typeof globalThis): any;
2
- export function installSuperDocV2BrowserRuntime(runtime?: {}, globalObject?: typeof globalThis): any;
3
- export const SUPERDOC_V2_BROWSER_RUNTIME_GLOBAL_KEY: "__SUPERDOC_V2_BROWSER_RUNTIME__";
1
+ export declare const SUPERDOC_V2_BROWSER_RUNTIME_GLOBAL_KEY = "__SUPERDOC_V2_BROWSER_RUNTIME__";
2
+ type SuperDocV2BrowserRuntime = Record<string, unknown>;
3
+ export declare function readSuperDocV2BrowserRuntime(globalObject?: object): SuperDocV2BrowserRuntime | null;
4
+ export declare function installSuperDocV2BrowserRuntime(runtime?: SuperDocV2BrowserRuntime, globalObject?: object): SuperDocV2BrowserRuntime;
5
+ export {};
@@ -1,16 +1,6 @@
1
- /**
2
- * @param {typeof globalThis} globalObject
3
- * @param {string} engineVersion
4
- * @param {string | null} buildOverride
5
- */
6
- export function resolveDocxEngineCdnBaseUrl(globalObject: typeof globalThis, engineVersion: string, buildOverride?: string | null): any;
7
- /** @param {{ engineVersion: string, buildBaseUrl: string | null }} options */
8
- export function configureCdnEngineLoader({ engineVersion, buildBaseUrl }: {
1
+ export declare function resolveDocxEngineCdnBaseUrl(globalObject: object, engineVersion: string, buildOverride?: string | null): string;
2
+ export declare function configureCdnEngineLoader({ engineVersion, buildBaseUrl, }: {
9
3
  engineVersion: string;
10
4
  buildBaseUrl: string | null;
11
5
  }): void;
12
- /**
13
- * @param {string} url
14
- * @returns {Promise<void>}
15
- */
16
- export function loadStylesheetOnce(url: string): Promise<void>;
6
+ export declare function loadStylesheetOnce(url: string): Promise<void>;