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,210 +1,31 @@
1
- /**
2
- * @typedef {{ width: number, height: number, originalWidth?: number, originalHeight?: number }} WhiteboardPageSize
3
- * @typedef {{ x: number, y: number }} Point
4
- *
5
- * Authored input shapes — what `addStroke`/`addText`/`addImage` accept
6
- * from a consumer (pixel-space coordinates, optional ids). The
7
- * add* methods normalize these into the stored shapes below.
8
- *
9
- * @typedef {{ points: number[][], color?: string, width?: number, type?: 'draw'|'erase' }} WhiteboardStroke
10
- * @typedef {{ id?: string|number, x: number, y: number, content: string, fontSize?: number, width?: number }} WhiteboardTextItem
11
- * @typedef {{ id?: string|number, stickerId?: string, x: number, y: number, src: string, width?: number, height?: number, type?: string }} WhiteboardImageItem
12
- *
13
- * Stored / normalized shapes — what the page actually holds in
14
- * `this.strokes` / `this.text` / `this.images` and what gets
15
- * serialized via `toJSON()` and re-applied via `applyData()`. Fields
16
- * suffixed with `N` (pointsN, xN, yN, widthN, heightN, fontSizeN) are
17
- * normalized to the page's 0..1 coordinate space; raw `width`/`height`
18
- * pairs are kept where consumers expect pixel sizes.
19
- *
20
- * SD-3213 follow-up: the public types were previously `any[]` for the
21
- * fields and the toJSON / applyData signatures; consumers reading
22
- * `page.strokes[0].points` would have hit pointsN at runtime with no
23
- * IntelliSense. The named shapes below restore typing without
24
- * over-committing the authored shapes (which the add* methods
25
- * normalize away).
26
- *
27
- * @typedef {{ pointsN: number[][], widthN?: number, color?: string, type?: 'draw'|'erase' }} WhiteboardStoredStroke
28
- * @typedef {{ id: string|number, xN: number, yN: number, content: string, fontSizeN?: number, widthN?: number | null }} WhiteboardStoredTextItem
29
- * @typedef {{ id: string|number, stickerId?: string | number | null, xN: number, yN: number, src: string, widthN?: number | null, heightN?: number | null, type?: string }} WhiteboardStoredImageItem
30
- *
31
- * @typedef {{
32
- * strokes?: WhiteboardStoredStroke[],
33
- * text?: WhiteboardStoredTextItem[],
34
- * images?: WhiteboardStoredImageItem[],
35
- * }} WhiteboardStoredPageData
36
- *
37
- * @typedef {{
38
- * pageIndex: number,
39
- * enabled: boolean,
40
- * Renderer: any,
41
- * onChange?: () => void,
42
- * onToolChange?: (tool: string) => void,
43
- * }} WhiteboardPageInit
44
- */
45
- /**
46
- * Per-page whiteboard renderer/controller.
47
- */
48
- export class WhiteboardPage {
49
- /**
50
- * Create a page controller.
51
- * @param {WhiteboardPageInit} props
52
- */
53
- constructor(props: WhiteboardPageInit);
54
- /** @type {number|null} */
55
- pageIndex: number | null;
56
- /** @type {WhiteboardStoredStroke[]} */
57
- strokes: WhiteboardStoredStroke[];
58
- /** @type {WhiteboardStoredTextItem[]} */
59
- text: WhiteboardStoredTextItem[];
60
- /** @type {WhiteboardStoredImageItem[]} */
61
- images: WhiteboardStoredImageItem[];
62
- /** @type {WhiteboardPageSize|null} */
63
- size: WhiteboardPageSize | null;
64
- /** @type {{ width: number|null, height: number|null }|null} */
65
- originalSize: {
66
- width: number | null;
67
- height: number | null;
68
- } | null;
69
- /**
70
- * Set tool for this page.
71
- * @param {string} tool
72
- */
73
- setTool(tool: string): void;
74
- /**
75
- * Get current tool for this page.
76
- * @returns {string}
77
- */
78
- getTool(): string;
79
- /**
80
- * Enable/disable interactivity for this page.
81
- * @param {boolean} enabled
82
- */
83
- setEnabled(enabled: boolean): void;
84
- /**
85
- * @returns {boolean}
86
- */
87
- isEnabled(): boolean;
88
- /**
89
- * Store page size (does not resize canvas).
90
- * @param {WhiteboardPageSize} size
91
- */
92
- setSize(size: WhiteboardPageSize): void;
93
- /**
94
- * Resize the Konva stage.
95
- * @param {number} width
96
- * @param {number} height
97
- */
98
- resize(width: number, height: number): void;
99
- /**
100
- * Mount Konva stage into a container.
101
- * @param {HTMLElement} container
102
- */
103
- mount(container: HTMLElement): void;
104
- /**
105
- * Re-render all content for this page.
106
- */
107
- render(): void;
108
- /**
109
- * Render stroke paths.
110
- */
111
- renderStrokes(): void;
112
- /**
113
- * Render text nodes.
114
- */
115
- renderText(): void;
116
- /**
117
- * Render image/sticker nodes.
118
- * NOTE: Images are reconciled by id to avoid re-creating nodes (prevents flicker).
119
- * If src changes for an existing id, this path does not reload the image.
120
- */
121
- renderImages(): void;
122
- /**
123
- * Destroy Konva stage and clean up listeners.
124
- */
125
- destroy(): void;
126
- /**
127
- * Serialize page data.
128
- * Returns the page's serializable shape. SD-3213 follow-up: fixed
129
- * stale JSDoc that said `stickers` (which never existed on the
130
- * runtime return) and typed the values as the stored normalized
131
- * shapes instead of `any[]`.
132
- *
133
- * @returns {{ strokes: WhiteboardStoredStroke[], text: WhiteboardStoredTextItem[], images: WhiteboardStoredImageItem[] }}
134
- */
135
- toJSON(): {
136
- strokes: WhiteboardStoredStroke[];
137
- text: WhiteboardStoredTextItem[];
138
- images: WhiteboardStoredImageItem[];
139
- };
140
- /**
141
- * Apply data to this page and re-render.
142
- * @param {WhiteboardStoredPageData} data
143
- */
144
- applyData(data?: WhiteboardStoredPageData): void;
145
- /**
146
- * Add a stroke to the model.
147
- * @param {WhiteboardStroke} stroke
148
- */
149
- addStroke(stroke: WhiteboardStroke): void;
150
- /**
151
- * Add a text item to the model.
152
- * @param {WhiteboardTextItem} item
153
- */
154
- addText(item: WhiteboardTextItem): void;
155
- /**
156
- * Add an image/sticker to the model.
157
- * @param {WhiteboardImageItem} item
158
- */
159
- addImage(item: WhiteboardImageItem): void;
160
- #private;
161
- }
162
1
  export type WhiteboardPageSize = {
163
2
  width: number;
164
3
  height: number;
165
4
  originalWidth?: number;
166
5
  originalHeight?: number;
167
6
  };
168
- /**
169
- * Authored input shapes — what `addStroke`/`addText`/`addImage` accept
170
- * from a consumer (pixel-space coordinates, optional ids). The
171
- * add* methods normalize these into the stored shapes below.
172
- */
173
7
  export type Point = {
174
8
  x: number;
175
9
  y: number;
176
10
  };
11
+ export type WhiteboardItemId = string | number;
12
+ export type WhiteboardStrokeType = 'draw' | 'erase';
177
13
  export type WhiteboardStroke = {
178
14
  points: number[][];
179
15
  color?: string;
180
16
  width?: number;
181
- type?: "draw" | "erase";
17
+ type?: WhiteboardStrokeType;
182
18
  };
183
19
  export type WhiteboardTextItem = {
184
- id?: string | number;
20
+ id?: WhiteboardItemId;
185
21
  x: number;
186
22
  y: number;
187
23
  content: string;
188
24
  fontSize?: number;
189
25
  width?: number;
190
26
  };
191
- /**
192
- * Stored / normalized shapes — what the page actually holds in
193
- * `this.strokes` / `this.text` / `this.images` and what gets
194
- * serialized via `toJSON()` and re-applied via `applyData()`. Fields
195
- * suffixed with `N` (pointsN, xN, yN, widthN, heightN, fontSizeN) are
196
- * normalized to the page's 0..1 coordinate space; raw `width`/`height`
197
- * pairs are kept where consumers expect pixel sizes.
198
- *
199
- * SD-3213 follow-up: the public types were previously `any[]` for the
200
- * fields and the toJSON / applyData signatures; consumers reading
201
- * `page.strokes[0].points` would have hit pointsN at runtime with no
202
- * IntelliSense. The named shapes below restore typing without
203
- * over-committing the authored shapes (which the add* methods
204
- * normalize away).
205
- */
206
27
  export type WhiteboardImageItem = {
207
- id?: string | number;
28
+ id?: WhiteboardItemId;
208
29
  stickerId?: string;
209
30
  x: number;
210
31
  y: number;
@@ -217,10 +38,10 @@ export type WhiteboardStoredStroke = {
217
38
  pointsN: number[][];
218
39
  widthN?: number;
219
40
  color?: string;
220
- type?: "draw" | "erase";
41
+ type?: WhiteboardStrokeType;
221
42
  };
222
43
  export type WhiteboardStoredTextItem = {
223
- id: string | number;
44
+ id: WhiteboardItemId;
224
45
  xN: number;
225
46
  yN: number;
226
47
  content: string;
@@ -228,8 +49,8 @@ export type WhiteboardStoredTextItem = {
228
49
  widthN?: number | null;
229
50
  };
230
51
  export type WhiteboardStoredImageItem = {
231
- id: string | number;
232
- stickerId?: string | number | null;
52
+ id: WhiteboardItemId;
53
+ stickerId?: WhiteboardItemId | null;
233
54
  xN: number;
234
55
  yN: number;
235
56
  src: string;
@@ -242,10 +63,163 @@ export type WhiteboardStoredPageData = {
242
63
  text?: WhiteboardStoredTextItem[];
243
64
  images?: WhiteboardStoredImageItem[];
244
65
  };
66
+ export type WhiteboardSerializedPage = {
67
+ strokes: WhiteboardStoredStroke[];
68
+ text: WhiteboardStoredTextItem[];
69
+ images: WhiteboardStoredImageItem[];
70
+ };
71
+ export type WhiteboardRendererEvent = {
72
+ target?: unknown;
73
+ cancelBubble?: boolean;
74
+ };
75
+ export interface WhiteboardRendererNode {
76
+ _whiteboardId?: WhiteboardItemId;
77
+ on(events: string, handler: (event: WhiteboardRendererEvent) => void): unknown;
78
+ destroy(): unknown;
79
+ name(): string;
80
+ name(name: string): unknown;
81
+ }
82
+ export interface WhiteboardShapeNode extends WhiteboardRendererNode {
83
+ x(): number;
84
+ x(value: number): unknown;
85
+ y(): number;
86
+ y(value: number): unknown;
87
+ width(): number;
88
+ width(value: number): unknown;
89
+ height(): number;
90
+ height(value: number): unknown;
91
+ scaleX(): number;
92
+ scaleY(): number;
93
+ scale(scale: Point): unknown;
94
+ draggable(value: boolean): unknown;
95
+ position(): Point;
96
+ }
97
+ export interface WhiteboardTextNode extends WhiteboardShapeNode {
98
+ scaleY(): number;
99
+ scaleY(value: number): unknown;
100
+ setAttrs(attrs: {
101
+ width: number;
102
+ scaleX: number;
103
+ scaleY?: number;
104
+ }): unknown;
105
+ text(): string;
106
+ text(value: string): unknown;
107
+ fontSize(): number;
108
+ fontFamily(): string;
109
+ fill(): string | CanvasGradient;
110
+ }
111
+ export interface WhiteboardLineNode extends WhiteboardRendererNode {
112
+ points(points: number[]): unknown;
113
+ }
114
+ export type WhiteboardBox = {
115
+ x: number;
116
+ y: number;
117
+ width: number;
118
+ height: number;
119
+ rotation: number;
120
+ };
121
+ export type WhiteboardBoundBoxFunc = (oldBox: WhiteboardBox, newBox: WhiteboardBox) => WhiteboardBox;
122
+ export interface WhiteboardTransformerNode {
123
+ destroy(): unknown;
124
+ nodes(nodes: WhiteboardShapeNode[]): unknown;
125
+ enabledAnchors(anchors: string[]): unknown;
126
+ boundBoxFunc(fn: WhiteboardBoundBoxFunc): unknown;
127
+ }
128
+ export interface WhiteboardLayerNode {
129
+ add(child: WhiteboardRendererNode | WhiteboardTransformerNode): unknown;
130
+ find(selector: string): WhiteboardShapeNode[];
131
+ destroyChildren(): unknown;
132
+ batchDraw(): unknown;
133
+ listening(listening: boolean): unknown;
134
+ getCanvas(): {
135
+ setPixelRatio(ratio: number): unknown;
136
+ };
137
+ }
138
+ export interface WhiteboardStageNode {
139
+ on(events: string, handler: (event: WhiteboardRendererEvent) => void): unknown;
140
+ add(layer: WhiteboardLayerNode): unknown;
141
+ size(size: {
142
+ width: number;
143
+ height: number;
144
+ }): unknown;
145
+ getPointerPosition(): Point | null;
146
+ destroy(): unknown;
147
+ }
148
+ export type WhiteboardLineConfig = {
149
+ points: number[];
150
+ stroke: string;
151
+ strokeWidth: number;
152
+ lineCap: 'round';
153
+ lineJoin: 'round';
154
+ globalCompositeOperation: 'destination-out' | 'source-over';
155
+ };
156
+ export interface WhiteboardPageRenderer {
157
+ Stage: new (config: {
158
+ container: HTMLDivElement;
159
+ width: number;
160
+ height: number;
161
+ }) => WhiteboardStageNode;
162
+ Layer: new () => WhiteboardLayerNode;
163
+ Line: new (config: WhiteboardLineConfig) => WhiteboardLineNode;
164
+ Text: new (config: {
165
+ x: number;
166
+ y: number;
167
+ text: string;
168
+ fontSize: number;
169
+ fontFamily: string;
170
+ fill: string;
171
+ draggable: boolean;
172
+ width: number | undefined;
173
+ }) => WhiteboardTextNode;
174
+ Image: new (config: {
175
+ x: number;
176
+ y: number;
177
+ image: HTMLImageElement;
178
+ width: number;
179
+ height: number;
180
+ draggable: boolean;
181
+ }) => WhiteboardShapeNode;
182
+ Transformer: new (config: {
183
+ enabledAnchors: string[];
184
+ rotateEnabled: boolean;
185
+ keepRatio: boolean;
186
+ boundBoxFunc: WhiteboardBoundBoxFunc;
187
+ }) => WhiteboardTransformerNode;
188
+ }
245
189
  export type WhiteboardPageInit = {
246
190
  pageIndex: number;
247
191
  enabled: boolean;
248
- Renderer: any;
192
+ Renderer?: WhiteboardPageRenderer;
249
193
  onChange?: () => void;
250
194
  onToolChange?: (tool: string) => void;
251
195
  };
196
+ export declare class WhiteboardPage {
197
+ #private;
198
+ pageIndex: number;
199
+ strokes: WhiteboardStoredStroke[];
200
+ text: WhiteboardStoredTextItem[];
201
+ images: WhiteboardStoredImageItem[];
202
+ size: WhiteboardPageSize | null;
203
+ originalSize: {
204
+ width: number | null;
205
+ height: number | null;
206
+ } | null;
207
+ constructor(props: WhiteboardPageInit);
208
+ setTool(tool: string): void;
209
+ getTool(): string;
210
+ setEnabled(enabled: boolean): void;
211
+ isEnabled(): boolean;
212
+ setSize(size: WhiteboardPageSize): void;
213
+ resize(width: number, height: number): void;
214
+ mount(container: HTMLDivElement): void;
215
+ render(): void;
216
+ renderStrokes(): void;
217
+ renderText(): void;
218
+ renderImages(): void;
219
+ destroy(): void;
220
+ toJSON(): WhiteboardSerializedPage;
221
+ applyData(data?: WhiteboardStoredPageData): void;
222
+ addStroke(stroke: WhiteboardStroke): void;
223
+ addText(item: WhiteboardTextItem): void;
224
+ addImage(item: WhiteboardImageItem): void;
225
+ }
@@ -1 +1,14 @@
1
- export function createTextarea(options?: {}): HTMLTextAreaElement;
1
+ export type TextareaSize = number | string;
2
+ export interface TextareaOptions {
3
+ value?: string;
4
+ left?: number;
5
+ top?: number;
6
+ width?: TextareaSize;
7
+ height?: TextareaSize;
8
+ fontSize?: TextareaSize;
9
+ fontFamily?: string;
10
+ color?: string;
11
+ background?: string;
12
+ resize?: string;
13
+ }
14
+ export declare function createTextarea(options?: TextareaOptions): HTMLTextAreaElement;
@@ -1 +1 @@
1
- export function flattenPoints(points: any): any;
1
+ export declare function flattenPoints(points: readonly (readonly number[])[]): number[];
@@ -1 +1 @@
1
- export function getRandomId(prefix?: string): string;
1
+ export declare function getRandomId(prefix?: string): string;
@@ -1,4 +1,21 @@
1
- export function getPreferredCommentFocusTargetClientY(): number;
2
- export function getVisibleThreadAnchorClientY(layersElement: any, positionEntry: any): any;
3
- export function getVisibleThreadHighlightClientY(threadIds: any): any;
4
- export function scrollThreadAnchorToFocusTarget(presentation: any, primaryThreadId: any, fallbackThreadId: any, targetClientY: any): any;
1
+ type ClientRectSource = {
2
+ getBoundingClientRect?: () => {
3
+ top: number;
4
+ };
5
+ };
6
+ type ThreadPositionEntry = {
7
+ bounds?: {
8
+ top?: number;
9
+ } | null;
10
+ } | null | undefined;
11
+ type ThreadAnchorPresentation = {
12
+ getReachableThreadAnchorClientY: (threadId: string, targetClientY: number) => number | null | undefined;
13
+ scrollThreadAnchorToClientY: (threadId: string, targetClientY: number, options: {
14
+ behavior: ScrollBehavior;
15
+ }) => boolean | null | undefined;
16
+ };
17
+ export declare const getPreferredCommentFocusTargetClientY: () => number;
18
+ export declare const getVisibleThreadAnchorClientY: (layersElement: ClientRectSource | null | undefined, positionEntry: ThreadPositionEntry) => number | null;
19
+ export declare const getVisibleThreadHighlightClientY: (threadIds: ReadonlyArray<string | number | null | undefined> | null | undefined) => number | null;
20
+ export declare const scrollThreadAnchorToFocusTarget: (presentation: ThreadAnchorPresentation | null | undefined, primaryThreadId: string | null | undefined, fallbackThreadId: string | null | undefined, targetClientY: number | null | undefined) => number | null;
21
+ export {};
@@ -1,9 +1,8 @@
1
+ import { Editor } from '../core/types/index.js';
1
2
  /**
2
3
  * Log a console.warn once per key. Subsequent calls with the same key are no-ops.
3
- * @param {string} key
4
- * @param {string} message
5
4
  */
6
- export function warnOnce(key: string, message: string): void;
5
+ export declare function warnOnce(key: string, message: string): void;
7
6
  /**
8
7
  * Wrap an Editor instance in a Proxy that emits one-time deprecation
9
8
  * warnings when consumers access ProseMirror internals or editor commands.
@@ -11,16 +10,11 @@ export function warnOnce(key: string, message: string): void;
11
10
  * The proxy is fully transparent — all property access and method calls are
12
11
  * forwarded to the underlying editor. Only the warning side-effect is added.
13
12
  *
14
- * @param {import('../core/types/index.js').Editor} editor
15
- * @returns {import('../core/types/index.js').Editor} Proxied editor (or the
16
- * original if null/already wrapped)
13
+ * @returns Proxied editor (or the original if null/already wrapped)
17
14
  */
18
- export function createDeprecatedEditorProxy(editor: import('../core/types/index.js').Editor): import('../core/types/index.js').Editor;
15
+ export declare function createDeprecatedEditorProxy<T extends Editor | null | undefined>(editor: T): T;
19
16
  /**
20
17
  * Unwrap a potentially proxied editor back to the raw Editor instance.
21
18
  * Safe to call on an already-raw editor — returns it unchanged.
22
- *
23
- * @param {import('../core/types/index.js').Editor | null | undefined} editor
24
- * @returns {import('../core/types/index.js').Editor | null | undefined}
25
19
  */
26
- export function unwrapEditor(editor: import('../core/types/index.js').Editor | null | undefined): import('../core/types/index.js').Editor | null | undefined;
20
+ export declare function unwrapEditor(editor: Editor | null | undefined): Editor | null | undefined;
@@ -1,26 +1,9 @@
1
- /**
2
- * @param {string} stage
3
- * @param {string} branch
4
- * @param {Record<string, unknown> | undefined} [meta]
5
- * @returns {{ traceId: string, spanId: string } | null}
6
- */
7
- export function startInteractionSpan(stage: string, branch: string, meta?: Record<string, unknown> | undefined): {
1
+ type InteractionSpan = {
8
2
  traceId: string;
9
3
  spanId: string;
10
- } | null;
11
- /**
12
- * @param {{ traceId: string, spanId: string } | null | undefined} span
13
- * @param {Record<string, unknown> | undefined} [meta]
14
- */
15
- export function endInteractionSpan(span: {
16
- traceId: string;
17
- spanId: string;
18
- } | null | undefined, meta?: Record<string, unknown> | undefined): void;
19
- /**
20
- * @param {string} stage
21
- * @param {string} branch
22
- * @param {Record<string, unknown> | undefined} meta
23
- * @param {() => any} fn
24
- * @returns {any}
25
- */
26
- export function withInteractionSpan(stage: string, branch: string, meta: Record<string, unknown> | undefined, fn: () => any): any;
4
+ };
5
+ type InteractionMeta = Record<string, unknown> | undefined;
6
+ export declare function startInteractionSpan(stage: string, branch: string, meta?: InteractionMeta): InteractionSpan | null;
7
+ export declare function endInteractionSpan(span: InteractionSpan | null | undefined, meta?: InteractionMeta): void;
8
+ export declare function withInteractionSpan<T>(stage: string, branch: string, meta: InteractionMeta, fn: () => T): T;
9
+ export {};
@@ -0,0 +1 @@
1
+ export declare function markRawComponent(component: unknown): unknown;
@@ -1,5 +1,2 @@
1
- /**
2
- * @param {unknown} value
3
- * @returns {value is Record<string, unknown>}
4
- */
5
- export function isPlainObject(value: unknown): value is Record<string, unknown>;
1
+ export declare function isPlainObject(value: unknown): value is Record<string, unknown>;
2
+ export declare function isThenable(value: unknown): value is PromiseLike<unknown>;
@@ -1 +1 @@
1
- export const DOCUMENT_EDITOR_SELECTION_SOURCE: "document-editor";
1
+ export declare const DOCUMENT_EDITOR_SELECTION_SOURCE = "document-editor";
@@ -1,17 +1,37 @@
1
- export default function useSelection(params: any): {
2
- documentId: import('vue').Ref<any, any>;
3
- page: import('vue').Ref<any, any>;
4
- selectionBounds: any;
5
- source: import('vue').Ref<any, any>;
6
- getValues: () => {
7
- documentId: any;
8
- page: any;
9
- selectionBounds: any;
10
- source: any;
11
- };
1
+ import { Ref } from 'vue';
2
+ type SelectionBounds = {
3
+ top?: number;
4
+ left?: number;
5
+ right?: number;
6
+ bottom?: number;
7
+ };
8
+ type UseSelectionParams = {
9
+ documentId?: unknown;
10
+ page?: number;
11
+ selectionBounds?: SelectionBounds | null;
12
+ source?: string | null;
13
+ };
14
+ type ContainerLocation = {
15
+ top: number;
16
+ left: number;
17
+ };
18
+ type SelectionValues<Bounds extends SelectionBounds> = {
19
+ documentId: unknown;
20
+ page: number | undefined;
21
+ selectionBounds: Bounds;
22
+ source: string | null | undefined;
23
+ };
24
+ type SelectionModel<Bounds extends SelectionBounds> = {
25
+ documentId: Ref<unknown>;
26
+ page: Ref<number | undefined>;
27
+ selectionBounds: Bounds;
28
+ source: Ref<string | null | undefined>;
29
+ getValues: () => SelectionValues<Bounds>;
12
30
  getContainerId: () => string;
13
- getContainerLocation: (parentContainer: any) => {
14
- top: number;
15
- left: number;
16
- };
31
+ getContainerLocation: (parentContainer: Pick<Element, 'getBoundingClientRect'> | null | undefined) => ContainerLocation;
17
32
  };
33
+ export default function useSelection<Bounds extends SelectionBounds>(params: UseSelectionParams & {
34
+ selectionBounds: Bounds;
35
+ }): SelectionModel<Bounds>;
36
+ export default function useSelection(params: UseSelectionParams): SelectionModel<SelectionBounds>;
37
+ export {};
@@ -1,16 +1,13 @@
1
- /**
2
- * @param {any} event - a `v2-host-event` payload.
3
- * @returns {boolean} true when the rejection means the session needs an author.
4
- */
5
- export function isV2AuthorRequiredRejection(event: any): boolean;
6
- export function createV2AuthorRequiredNotificationGate(): {
7
- shouldNotify(scope: any, event: any): boolean;
8
- clear(scope: any): void;
9
- };
1
+ import { V2MutationRejectedEvent } from './v2-mutation-exception.js';
10
2
  /** Stable, non-terminal exception code surfaced to consumers. */
11
- export const V2_AUTHOR_REQUIRED_CODE: "author-required";
3
+ export declare const V2_AUTHOR_REQUIRED_CODE = "author-required";
12
4
  /**
13
5
  * Content-safe, actionable message. Contains no document text, imported author,
14
6
  * email, path, or source key — only how to fix the configuration.
15
7
  */
16
- export const V2_AUTHOR_REQUIRED_MESSAGE: "This edit needs an author identity. Set `user.name` in your SuperDoc configuration and reopen the document to make tracked or revision-overlapping edits.";
8
+ export declare const V2_AUTHOR_REQUIRED_MESSAGE = "This edit needs an author identity. Set `user.name` in your SuperDoc configuration and reopen the document to make tracked or revision-overlapping edits.";
9
+ export declare function isV2AuthorRequiredRejection(event: unknown): event is V2MutationRejectedEvent;
10
+ export declare function createV2AuthorRequiredNotificationGate(): {
11
+ shouldNotify(scope: string | null | undefined, event: unknown): boolean;
12
+ clear(scope: string | null | undefined): void;
13
+ };
@@ -1,7 +1,9 @@
1
- export function toV2BulkDecisionEvent(documentId: any, fact: any): {
2
- documentId: string | null;
3
- decision: any;
4
- requestedCount: any;
5
- successfulCount: any;
6
- permissionDeniedCount: any;
7
- } | null;
1
+ import { SuperDocTrackedChangesBulkDecisionPayload } from '../core/types/index.js';
2
+ export type V2TrackedChangeBulkDecisionFact = {
3
+ schemaVersion: number;
4
+ decision: string;
5
+ requestedCount: number;
6
+ appliedCount: number;
7
+ deniedCount: number;
8
+ };
9
+ export declare function toV2BulkDecisionEvent(documentId: string | null | undefined, fact: V2TrackedChangeBulkDecisionFact | null | undefined): SuperDocTrackedChangesBulkDecisionPayload | null;
@@ -1,13 +1,14 @@
1
- export function isV2KeyboardEditRejection(event: any): boolean;
2
- export function createV2KeyboardEditRejectionException(documentId: any, event: any): {
1
+ import { V2MutationRejectedEvent } from './v2-mutation-exception.js';
2
+ export declare const V2_EDIT_REJECTED_CODE = "edit-rejected";
3
+ export declare const V2_EDIT_REJECTED_MESSAGE = "This edit couldn\u2019t be completed. Adjust the selection and try again.";
4
+ export declare function isV2KeyboardEditRejection(event: unknown): event is V2MutationRejectedEvent;
5
+ export declare function createV2KeyboardEditRejectionException(documentId: string | null | undefined, event?: unknown): {
3
6
  documentId?: string | undefined;
4
7
  error: Error;
5
8
  code: string;
6
9
  editor: null;
7
10
  };
8
- export function createV2KeyboardEditRejectionNotificationGate(): {
9
- shouldNotify(scope: any, event: any): boolean;
10
- clear(scope: any): void;
11
+ export declare function createV2KeyboardEditRejectionNotificationGate(): {
12
+ shouldNotify(scope: string | null | undefined, event: unknown): boolean;
13
+ clear(scope: string | null | undefined): void;
11
14
  };
12
- export const V2_EDIT_REJECTED_CODE: "edit-rejected";
13
- export const V2_EDIT_REJECTED_MESSAGE: "This edit couldn\u2019t be completed. Adjust the selection and try again.";