superdoc 2.29.0-next.9 → 2.30.0-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +127 -25
- package/dist/chunks/{FindReplaceSurface-BKVHzhQ4.es.js → FindReplaceSurface-BEnRLpD9.es.js} +1 -1
- package/dist/chunks/{FindReplaceSurface-BNDrJ6VS.cjs → FindReplaceSurface-DWXgWgg7.cjs} +1 -1
- package/dist/chunks/{PasswordPromptSurface-6mF6Azda.es.js → PasswordPromptSurface-DjV1JgjD.es.js} +1 -1
- package/dist/chunks/{PasswordPromptSurface-BNkaztaP.cjs → PasswordPromptSurface-VFPnQOML.cjs} +1 -1
- package/dist/chunks/{PdfViewer-aOWhUVI7.es.js → PdfViewer-C2r-K8zC.es.js} +4 -10
- package/dist/chunks/{PdfViewer-DmSkZehl.cjs → PdfViewer-DYTbPVUr.cjs} +4 -10
- package/dist/chunks/{_plugin-vue_export-helper-6MBoygIY.cjs → _plugin-vue_export-helper-BzM2_tVU.cjs} +40 -7
- package/dist/chunks/{_plugin-vue_export-helper-CsJQtMvr.es.js → _plugin-vue_export-helper-CmkaJDnr.es.js} +23 -8
- package/dist/chunks/{create-super-doc-ui-DN70aatf.cjs → create-super-doc-ui--kQBNTyt.cjs} +2424 -2302
- package/dist/chunks/{create-super-doc-ui-Bm5kmx0W.es.js → create-super-doc-ui-CbEDXtpm.es.js} +2350 -2228
- package/dist/collaboration-upgrade-engine.cjs +1 -1
- package/dist/collaboration-upgrade-engine.es.js +1 -1
- package/dist/document-api/src/changes/changes.d.ts +26 -0
- package/dist/document-api/src/changes/changes.types.d.ts +156 -0
- package/dist/document-api/src/contract/command-catalog.d.ts +1 -1
- package/dist/document-api/src/contract/operation-definitions.d.ts +51 -1
- package/dist/document-api/src/create/create.d.ts +0 -4
- package/dist/document-api/src/diff/diff.types.d.ts +6 -6
- package/dist/document-api/src/header-footers/header-footers.d.ts +1 -3
- package/dist/document-api/src/index.d.ts +6 -0
- package/dist/document-api/src/inline-semantics/token-sets.d.ts +0 -2
- package/dist/document-api/src/insert/insert.d.ts +0 -1
- package/dist/layout-engine/contracts/src/index.d.ts +3 -1
- package/dist/layout-engine/dom-contract/src/data-attrs.d.ts +4 -0
- package/dist/layout-engine/layout-bridge/src/coupled-footnote-pagination.d.ts +1 -0
- package/dist/layout-engine/layout-bridge/src/footnote-page-certificate.d.ts +1 -0
- package/dist/layout-engine/layout-bridge/src/footnote-page-planner.d.ts +5 -0
- package/dist/layout-engine/layout-bridge/src/incrementalLayout.d.ts +1 -0
- package/dist/layout-engine/layout-engine/src/footnote-page-flow.d.ts +3 -0
- package/dist/layout-engine/layout-engine/src/index.d.ts +7 -0
- package/dist/layout-engine/layout-engine/src/layout-paragraph.d.ts +5 -0
- package/dist/layout-engine/layout-engine/src/layout-table.d.ts +3 -1
- package/dist/layout-engine/layout-engine/src/layout-utils.d.ts +0 -4
- package/dist/layout-engine/layout-engine/src/paginator.d.ts +4 -0
- package/dist/layout-engine/painters/dom/src/paragraph/list-marker.d.ts +1 -1
- package/dist/layout-engine/painters/dom/src/paragraph/renderParagraphContent.d.ts +1 -1
- package/dist/layout-engine/painters/dom/src/styles.d.ts +0 -10
- package/dist/layout-engine/painters/dom/src/svg-utils.d.ts +1 -13
- package/dist/public/ui-react.cjs +1 -1
- package/dist/public/ui-react.es.js +1 -1
- package/dist/public/ui-vue.cjs +1 -1
- package/dist/public/ui-vue.es.js +1 -1
- package/dist/public/ui.cjs +1 -1
- package/dist/public/ui.es.js +1 -1
- package/dist/shared/common/Telemetry.d.ts +50 -0
- package/dist/shared/common/event-types.d.ts +13 -0
- package/dist/shared/font-system/src/bundled-face-names.d.ts +1 -0
- package/dist/shared/font-system/src/resolver.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/style.layered.css +1 -1
- package/dist/superdoc/src/components/CommentsLayer/CommentDialog.vue.d.ts +17 -33
- package/dist/superdoc/src/components/CommentsLayer/collect-removed-comment-ids.d.ts +11 -1
- package/dist/superdoc/src/components/CommentsLayer/collect-tracked-change-thread.d.ts +25 -6
- package/dist/superdoc/src/components/CommentsLayer/comment-params.d.ts +84 -0
- package/dist/superdoc/src/components/CommentsLayer/comment-urls.d.ts +1 -1
- package/dist/superdoc/src/components/CommentsLayer/commentsList/super-comments-list.d.ts +23 -20
- package/dist/superdoc/src/components/CommentsLayer/helpers.d.ts +1 -4
- package/dist/superdoc/src/components/CommentsLayer/tracked-change-threading.d.ts +16 -1
- package/dist/superdoc/src/components/CommentsLayer/use-comment.d.ts +15 -95
- package/dist/superdoc/src/components/Whiteboard/WhiteboardLayer.vue.d.ts +4 -5
- package/dist/superdoc/src/components/Whiteboard/WhiteboardPage.vue.d.ts +3 -4
- package/dist/superdoc/src/components/Whiteboard/use-whiteboard.d.ts +30 -9
- package/dist/superdoc/src/components/Whiteboard/whiteboard-types.d.ts +2 -0
- package/dist/superdoc/src/components/surfaces/watermark-surface-runtime.d.ts +7 -7
- package/dist/superdoc/src/composables/use-comment-small-screen.d.ts +11 -7
- package/dist/superdoc/src/composables/use-compact-comment-popover.d.ts +44 -18
- package/dist/superdoc/src/composables/use-document.d.ts +51 -99
- package/dist/superdoc/src/composables/use-find-replace.d.ts +13 -3
- package/dist/superdoc/src/composables/use-password-prompt.d.ts +1 -1
- package/dist/superdoc/src/composables/use-viewport-fit.d.ts +62 -26
- package/dist/superdoc/src/core/SuperDoc.d.ts +15 -6
- package/dist/superdoc/src/core/collaboration/cdn-collaboration-comment-map.d.ts +1 -0
- package/dist/superdoc/src/core/collaboration/collaboration-comment-map.d.ts +2 -0
- package/dist/superdoc/src/core/collaboration/helpers.d.ts +1 -1
- package/dist/superdoc/src/core/document-open-telemetry.d.ts +1 -1
- package/dist/superdoc/src/core/editor-runtime/v2/v2-editor-runtime-adapter.d.ts +1 -0
- package/dist/superdoc/src/core/pdf/pdf-adapter.d.ts +6 -2
- package/dist/superdoc/src/core/types/index.d.ts +108 -43
- package/dist/superdoc/src/core/v2-integration/browser-peer-runtime.d.ts +5 -3
- package/dist/superdoc/src/core/v2-integration/cdn-engine-loader.d.ts +3 -13
- package/dist/superdoc/src/core/v2-integration/internal-vue-runtime.d.ts +64 -59
- package/dist/superdoc/src/helpers/deprecation.d.ts +12 -3
- package/dist/superdoc/src/helpers/object-guards.d.ts +2 -0
- package/dist/superdoc/src/helpers/v2-author-required-rejection.d.ts +8 -11
- package/dist/superdoc/src/helpers/v2-bulk-decision-event.d.ts +9 -7
- package/dist/superdoc/src/helpers/v2-keyboard-edit-rejection.d.ts +8 -7
- package/dist/superdoc/src/helpers/v2-mutation-exception.d.ts +12 -8
- package/dist/superdoc/src/helpers/v2-review-geometry-delivery.d.ts +22 -0
- package/dist/superdoc/src/helpers/v2-review-target.d.ts +11 -1
- package/dist/superdoc/src/helpers/v2-selection-sync.d.ts +40 -14
- package/dist/superdoc/src/helpers/v2-typing-mutation-event.d.ts +14 -5
- package/dist/superdoc/src/icons.d.ts +11 -19
- package/dist/superdoc/src/internal/diagnostics/translate-diagnostic.d.ts +6 -4
- package/dist/superdoc/src/internal/toolbar/built-in/PageNumberMenu.vue.d.ts +25 -15
- package/dist/superdoc/src/internal/toolbar/built-in/ToolbarButton.vue.d.ts +1 -0
- package/dist/superdoc/src/internal/toolbar/built-in/constants.d.ts +3 -1
- package/dist/superdoc/src/internal/toolbar/built-in/font-options.d.ts +15 -1
- package/dist/superdoc/src/internal/toolbar/built-in/font-typeahead.d.ts +37 -7
- package/dist/superdoc/src/internal/toolbar/built-in/general.d.ts +12 -1
- package/dist/superdoc/src/internal/toolbar/built-in/helpers.d.ts +9 -4
- package/dist/superdoc/src/internal/toolbar/built-in/list-style-buttons.d.ts +2 -2
- package/dist/superdoc/src/internal/toolbar/built-in/page-number-feedback.d.ts +4 -5
- package/dist/superdoc/src/internal/toolbar/built-in/scroll-helpers.d.ts +3 -4
- package/dist/superdoc/src/internal/toolbar/built-in/toolbarIcons.d.ts +78 -145
- package/dist/superdoc/src/internal/toolbar/built-in/url-safety.d.ts +11 -3
- package/dist/superdoc/src/internal/toolbar/built-in-toolbar.d.ts +4 -3
- package/dist/superdoc/src/internal/toolbar/image-upload.d.ts +29 -39
- package/dist/superdoc/src/public/content-control-ref.d.ts +12 -0
- package/dist/superdoc/src/public/index.d.cts +16 -0
- package/dist/superdoc/src/public/index.d.ts +3 -0
- package/dist/superdoc/src/public/ui/async-read-cache.d.ts +32 -0
- package/dist/superdoc/src/public/ui/block-commands.d.ts +39 -0
- package/dist/superdoc/src/public/ui/command-results.d.ts +39 -0
- package/dist/superdoc/src/public/ui/create-super-doc-ui.d.ts +1 -17
- package/dist/superdoc/src/public/ui/document-change-records.d.ts +7 -0
- package/dist/superdoc/src/public/ui/entity-rows.d.ts +14 -0
- package/dist/superdoc/src/public/ui/font-options.d.ts +7 -0
- package/dist/superdoc/src/public/ui/format-painter-helpers.d.ts +2 -8
- package/dist/superdoc/src/public/ui/format-painter-state.d.ts +33 -0
- package/dist/superdoc/src/public/ui/heavy-read-policy.d.ts +11 -0
- package/dist/superdoc/src/public/ui/host-events.d.ts +3 -0
- package/dist/superdoc/src/public/ui/inline-values.d.ts +79 -0
- package/dist/superdoc/src/public/ui/loose-record.d.ts +4 -0
- package/dist/superdoc/src/public/ui/selection-targets.d.ts +45 -0
- package/dist/superdoc/src/public/ui/shared-tracked-changes-catalog.d.ts +16 -0
- package/dist/superdoc/src/public/ui/tracked-change-ids.d.ts +51 -0
- package/dist/superdoc/src/public/ui/types.d.ts +12 -2
- package/dist/superdoc/src/public/ui/ui-bench-timing.d.ts +9 -0
- package/dist/superdoc/src/public/ui.d.cts +14 -0
- package/dist/superdoc/src/public/ui.d.ts +1 -1
- package/dist/superdoc/src/stores/comments-store.d.ts +23006 -542
- package/dist/superdoc/src/stores/helpers/comment-document-scope.d.ts +22 -0
- package/dist/superdoc/src/stores/helpers/comment-grouping.d.ts +1 -1
- package/dist/superdoc/src/stores/helpers/comment-identity.d.ts +10 -10
- package/dist/superdoc/src/stores/helpers/pending-selection-snapshot.d.ts +17 -0
- package/dist/superdoc/src/stores/helpers/review-presentation.d.ts +90 -0
- package/dist/superdoc/src/stores/helpers/tracked-change-compaction.d.ts +16 -0
- package/dist/superdoc/src/stores/helpers/tracked-change-decision.d.ts +45 -0
- package/dist/superdoc/src/stores/helpers/tracked-change-identity.d.ts +4 -2
- package/dist/superdoc/src/stores/helpers/tracked-change-row-values.d.ts +1 -8
- package/dist/superdoc/src/stores/helpers/tracked-change-thread-index.d.ts +1 -1
- package/dist/superdoc/src/stores/helpers/v2-review-adapters.d.ts +147 -0
- package/dist/superdoc/src/stores/superdoc-store.d.ts +12 -2895
- package/dist/superdoc.cjs +1019 -844
- package/dist/superdoc.es.js +931 -756
- package/dist/word-layout/src/marker-utils.d.ts +0 -5
- package/dist/word-layout/src/unit-conversions.d.ts +0 -1
- package/dist-cdn/style.layered.css +1 -1
- package/dist-cdn/superdoc.min.css +1 -1
- package/dist-cdn/superdoc.min.js +38 -42
- package/package.json +13 -3
- package/dist/document-api/src/diff/index.d.ts +0 -3
- package/dist/document-api/src/write/locator.d.ts +0 -24
- package/dist/layout-engine/painters/dom/src/features/feature-registry.d.ts +0 -41
- package/dist/superdoc/src/internal/toolbar/built-in/format-negation.d.ts +0 -5
- package/dist/superdoc/src/main.d.ts +0 -1
- package/dist/word-layout/src/tab-layout.d.ts +0 -193
|
@@ -1,3 +1,63 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { RuntimeDocument, SuperDocFitWidthOptions, SuperDocViewportMetrics, SuperDocZoomConfig, SuperDocZoomMode } from '../core/types/index.js';
|
|
3
|
+
import { PageMetricsPage, PageMetricsSnapshot } from '../public/ui/page-metrics.js';
|
|
4
|
+
export type ResolvedFitWidthOptions = Required<SuperDocFitWidthOptions>;
|
|
5
|
+
type PageWidthSnapshot = Partial<Pick<PageMetricsSnapshot, 'widestPageWidthPx'>> & {
|
|
6
|
+
pages?: ReadonlyArray<{
|
|
7
|
+
base?: Partial<Pick<PageMetricsPage['base'], 'widthPx'>>;
|
|
8
|
+
} | null | undefined>;
|
|
9
|
+
};
|
|
10
|
+
type EditorPageGeometry = {
|
|
11
|
+
pageMetrics?: {
|
|
12
|
+
getSnapshot?: () => PageWidthSnapshot | null | undefined;
|
|
13
|
+
} | null;
|
|
14
|
+
getPages?: () => Array<{
|
|
15
|
+
size?: {
|
|
16
|
+
w?: unknown;
|
|
17
|
+
};
|
|
18
|
+
} | null | undefined> | null | undefined;
|
|
19
|
+
getPageStyles?: () => {
|
|
20
|
+
pageSize?: {
|
|
21
|
+
width?: unknown;
|
|
22
|
+
};
|
|
23
|
+
} | null | undefined;
|
|
24
|
+
};
|
|
25
|
+
type ViewportFitEventName = 'editorCreate' | 'pagination-update' | 'pdf:document-ready';
|
|
26
|
+
interface ViewportFitSuperDoc {
|
|
27
|
+
config?: {
|
|
28
|
+
zoom?: Pick<SuperDocZoomConfig, 'fitWidth'> | null;
|
|
29
|
+
} | null;
|
|
30
|
+
activeEditor?: EditorPageGeometry | null;
|
|
31
|
+
emit(event: 'zoomChange', payload: {
|
|
32
|
+
zoom: number;
|
|
33
|
+
mode: 'fit-width';
|
|
34
|
+
}): unknown;
|
|
35
|
+
emit(event: 'viewport-change', payload: SuperDocViewportMetrics): unknown;
|
|
36
|
+
on?(event: ViewportFitEventName, listener: () => void): unknown;
|
|
37
|
+
off?(event: ViewportFitEventName, listener: () => void): unknown;
|
|
38
|
+
}
|
|
39
|
+
interface UseViewportFitOptions {
|
|
40
|
+
getSuperdoc: () => ViewportFitSuperDoc | null | undefined;
|
|
41
|
+
superdocContainerWidth: Readonly<Ref<number>>;
|
|
42
|
+
isReady: Readonly<Ref<boolean>>;
|
|
43
|
+
activeZoom: Ref<number>;
|
|
44
|
+
zoomMode: Readonly<Ref<SuperDocZoomMode>>;
|
|
45
|
+
viewportMetrics: Ref<SuperDocViewportMetrics | null>;
|
|
46
|
+
showCommentsSidebar?: Readonly<Ref<unknown>>;
|
|
47
|
+
rightSidebarRef?: Readonly<Ref<HTMLElement | null>>;
|
|
48
|
+
superdocRoot: Readonly<Ref<HTMLElement | null>>;
|
|
49
|
+
documents?: Readonly<Ref<readonly RuntimeDocument[]>>;
|
|
50
|
+
}
|
|
51
|
+
export declare const FIT_WIDTH_DEFAULTS: Readonly<{
|
|
52
|
+
min: 10;
|
|
53
|
+
max: 100;
|
|
54
|
+
padding: 0;
|
|
55
|
+
}>;
|
|
56
|
+
export declare const resolveFitWidthOptions: (rawFitConfig: unknown) => ResolvedFitWidthOptions;
|
|
57
|
+
export declare const computeFitZoom: (availableWidth: number, documentWidth: number) => number | null;
|
|
58
|
+
export declare const computeAppliedFitZoom: (availableWidth: number, documentWidth: number, options: ResolvedFitWidthOptions) => number | null;
|
|
59
|
+
export declare const normalizePdfPageMeasurement: (measured: number, scaleFactor: number, zoomFactor: number) => number | null;
|
|
60
|
+
export declare const resolveEditorPageWidth: (editor: EditorPageGeometry | null | undefined) => number | null;
|
|
1
61
|
/**
|
|
2
62
|
* Viewport fit tracking. Maintains pure viewport metrics (available width,
|
|
3
63
|
* document base width, fit zoom), stores them for `getViewportMetrics()`,
|
|
@@ -21,31 +81,7 @@
|
|
|
21
81
|
* Must be called inside a component `setup()` (registers watchers and an
|
|
22
82
|
* unmount hook).
|
|
23
83
|
*/
|
|
24
|
-
export function useViewportFit({ getSuperdoc, superdocContainerWidth, isReady, activeZoom, zoomMode, viewportMetrics, showCommentsSidebar, rightSidebarRef, superdocRoot, documents, }: {
|
|
25
|
-
getSuperdoc: any;
|
|
26
|
-
superdocContainerWidth: any;
|
|
27
|
-
isReady: any;
|
|
28
|
-
activeZoom: any;
|
|
29
|
-
zoomMode: any;
|
|
30
|
-
viewportMetrics: any;
|
|
31
|
-
showCommentsSidebar: any;
|
|
32
|
-
rightSidebarRef: any;
|
|
33
|
-
superdocRoot: any;
|
|
34
|
-
documents: any;
|
|
35
|
-
}): {
|
|
84
|
+
export declare function useViewportFit({ getSuperdoc, superdocContainerWidth, isReady, activeZoom, zoomMode, viewportMetrics, showCommentsSidebar, rightSidebarRef, superdocRoot, documents, }: UseViewportFitOptions): {
|
|
36
85
|
evaluateViewport: () => void;
|
|
37
86
|
};
|
|
38
|
-
export
|
|
39
|
-
min: 10;
|
|
40
|
-
max: 100;
|
|
41
|
-
padding: 0;
|
|
42
|
-
}>;
|
|
43
|
-
export function resolveFitWidthOptions(rawFitConfig: any): {
|
|
44
|
-
min: number;
|
|
45
|
-
max: number;
|
|
46
|
-
padding: any;
|
|
47
|
-
};
|
|
48
|
-
export function computeFitZoom(availableWidth: any, documentWidth: any): number | null;
|
|
49
|
-
export function computeAppliedFitZoom(availableWidth: any, documentWidth: any, options: any): number | null;
|
|
50
|
-
export function normalizePdfPageMeasurement(measured: any, scaleFactor: any, zoomFactor: any): any;
|
|
51
|
-
export function resolveEditorPageWidth(editor: any): number | null;
|
|
87
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import { SuperDocDiagnostics } from './types/diagnostics.js';
|
|
|
2
2
|
import { EventEmitter } from 'eventemitter3';
|
|
3
3
|
import { DocumentReplacementResult } from '../public/document-replacement.js';
|
|
4
4
|
import { HocuspocusProviderWebsocket } from '@hocuspocus/provider';
|
|
5
|
-
import {
|
|
5
|
+
import { Pinia } from 'pinia';
|
|
6
6
|
import { Whiteboard } from './whiteboard/Whiteboard.js';
|
|
7
7
|
import { normalizeUiConfig } from './config/normalize-ui-config.js';
|
|
8
8
|
import { normalizeInteractionConfig } from './config/normalize-interaction-config.js';
|
|
@@ -47,10 +47,12 @@ interface SuperDocEventMap {
|
|
|
47
47
|
'comments-list-change': [SuperDocCommentsListChangePayload];
|
|
48
48
|
/** Requests the shell open its find/replace surface (e.g. the toolbar search button). */
|
|
49
49
|
'search:open': [];
|
|
50
|
+
/** @deprecated replaceWith=`superdoc.ui.zoom.observe` removeIn=v3.0 */
|
|
50
51
|
zoomChange: [SuperDocZoomPayload];
|
|
51
52
|
'measurement-unit-change': [SuperDocMeasurementUnitChangePayload];
|
|
52
53
|
'page-margins-change': [SuperDocPageMarginsChangePayload];
|
|
53
54
|
'formatting-marks-change': [SuperDocFormattingMarksChangePayload];
|
|
55
|
+
/** @deprecated replaceWith=`superdoc.ui.document.observe` removeIn=v3.0 */
|
|
54
56
|
'document-mode-change': [SuperDocDocumentModeChangePayload];
|
|
55
57
|
/**
|
|
56
58
|
* The active editor was assigned or cleared. Internal: the UI controller
|
|
@@ -85,9 +87,15 @@ interface SuperDocEventMap {
|
|
|
85
87
|
'fonts-resolved': [FontsResolvedPayload];
|
|
86
88
|
'fonts-changed': [FontsChangedPayload];
|
|
87
89
|
'pagination-update': [SuperDocPaginationUpdatePayload];
|
|
90
|
+
/**
|
|
91
|
+
* Never emitted by SuperDoc 2.
|
|
92
|
+
*
|
|
93
|
+
* @deprecated replaceWith=`editor-update` and `doc.lists.list` removeIn=v3.0
|
|
94
|
+
*/
|
|
88
95
|
'list-definitions-change': [ListDefinitionsPayload];
|
|
89
96
|
'comments-update': [SuperDocCommentsUpdatePayload];
|
|
90
97
|
'content-control:active-change': [ContentControlActiveChangePayload];
|
|
98
|
+
/** @deprecated replaceWith=`superdoc.ui.contentControls.onClick` removeIn=v3.0 */
|
|
91
99
|
'content-control:click': [ContentControlClickPayload];
|
|
92
100
|
'collaboration-ready': [SuperDocEditorPayload];
|
|
93
101
|
'awareness-update': [SuperDocAwarenessUpdatePayload];
|
|
@@ -98,6 +106,7 @@ interface SuperDocEventMap {
|
|
|
98
106
|
'whiteboard:change': [WhiteboardData];
|
|
99
107
|
'whiteboard:enabled': [boolean];
|
|
100
108
|
'whiteboard:tool': [string];
|
|
109
|
+
/** A union of payloads; narrow by `stage`, `code`, `itemName`, `source`, or `diagnosticCode` before reading on. */
|
|
101
110
|
exception: [SuperDocExceptionPayload];
|
|
102
111
|
'viewport-change': [SuperDocViewportChangePayload];
|
|
103
112
|
'source:complete': [];
|
|
@@ -223,9 +232,9 @@ export declare class SuperDoc extends EventEmitter<SuperDocEventMap> {
|
|
|
223
232
|
* mount/unmount, `provide()`, and `config.globalProperties` setup.
|
|
224
233
|
* Not consumer API: no docs or examples reference `superdoc.app`,
|
|
225
234
|
* and the only cross-file reader (`SuperComments.createVueApp()`
|
|
226
|
-
*
|
|
227
|
-
* `
|
|
228
|
-
* internal source compilation.
|
|
235
|
+
* in `super-comments-list.ts`) uses bracket access, which
|
|
236
|
+
* TypeScript allows for `private` members, so the `@private`
|
|
237
|
+
* boundary does not break internal source compilation.
|
|
229
238
|
*
|
|
230
239
|
* Same SD-3213f-style TS surface hide as
|
|
231
240
|
* `superdocStore` / `commentsStore` /
|
|
@@ -235,7 +244,7 @@ export declare class SuperDoc extends EventEmitter<SuperDocEventMap> {
|
|
|
235
244
|
*/
|
|
236
245
|
private app;
|
|
237
246
|
/** Pinia store root for the SuperDoc Vue app. Set in `#initVueApp`. */
|
|
238
|
-
pinia:
|
|
247
|
+
pinia: Pinia | undefined;
|
|
239
248
|
/** Count of editors that have signaled `editorCreate`. */
|
|
240
249
|
readyEditors: number;
|
|
241
250
|
activeEditor: Editor | null;
|
|
@@ -339,7 +348,7 @@ export declare class SuperDoc extends EventEmitter<SuperDocEventMap> {
|
|
|
339
348
|
* surface does not pull the Pinia comment model type graph.
|
|
340
349
|
*
|
|
341
350
|
*/
|
|
342
|
-
getComment(commentId: string):
|
|
351
|
+
getComment(commentId: string): Record<string, unknown> | null;
|
|
343
352
|
/**
|
|
344
353
|
* Get the SuperDoc container element
|
|
345
354
|
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createCollaborationCommentMap(entries: Iterable<[string, unknown]>): import('yjs').Map<unknown>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CommentEvent } from '
|
|
1
|
+
import { CommentEvent } from '../../../../shared/common/event-types.js';
|
|
2
2
|
import { SuperDoc } from '../SuperDoc.js';
|
|
3
3
|
import { Modules, User } from '../types/index.js';
|
|
4
4
|
import { CollaborationCommentEvent } from './collaboration-comments.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Telemetry, TelemetryConfig } from '
|
|
1
|
+
import { Telemetry, TelemetryConfig } from '../../../shared/common/Telemetry.js';
|
|
2
2
|
import { Config } from './types/index.js';
|
|
3
3
|
type DocumentOpenTelemetryClient = Pick<Telemetry, 'trackDocumentOpen'>;
|
|
4
4
|
export type DocumentOpenTelemetry = {
|
|
@@ -189,5 +189,6 @@ export interface V2EditorRuntimeAdapterOptions {
|
|
|
189
189
|
export declare function createV2EditorRuntimeAdapter(options: V2EditorRuntimeAdapterOptions): {
|
|
190
190
|
runtime: EditorRuntime;
|
|
191
191
|
attachMountHandle(handle: HostMountHandleLike | null): void;
|
|
192
|
+
detach(): void;
|
|
192
193
|
};
|
|
193
194
|
export {};
|
|
@@ -20,10 +20,14 @@ export declare class PDFJSAdapter extends PDFAdapter {
|
|
|
20
20
|
workerSrc: string | undefined;
|
|
21
21
|
constructor(config: PDFJSConfig);
|
|
22
22
|
getDocument(file: PdfSource): Promise<PDFDocumentProxy>;
|
|
23
|
-
getPages(pdf:
|
|
23
|
+
getPages<Page = PDFPageProxy>(pdf: {
|
|
24
|
+
getPage(pageNumber: number): Promise<Page>;
|
|
25
|
+
}, firstPage: number, lastPage: number): Promise<Page[]>;
|
|
24
26
|
}
|
|
25
27
|
export declare class PDFAdapterFactory {
|
|
26
|
-
static create(config:
|
|
28
|
+
static create(config: PDFJSConfig & {
|
|
29
|
+
adapter: string;
|
|
30
|
+
}): PDFJSAdapter;
|
|
27
31
|
}
|
|
28
32
|
export declare function getWorkerSrcFromCDN(version: string): string;
|
|
29
33
|
export {};
|
|
@@ -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 {
|
|
6
|
+
import { HyperlinkTarget } from '../../../../document-api/src/index.js';
|
|
7
7
|
import { DocumentFontOption, FontAssetUrlResolver, FontFamilyOption, FontLoadSummary, FontResolutionRecord } from '../../../../shared/font-system/src/index.js';
|
|
8
8
|
import { SuperDoc as SuperDocClass } from '../SuperDoc.js';
|
|
9
9
|
import { SuperDocActiveEditorExtensions, SuperDocExtension } from '../extensions/index.js';
|
|
10
10
|
import { BrowserDocumentApi } from '../../public/browser-document-api.js';
|
|
11
|
+
import { ContentControlClickPayload, ContentControlRef } from '../../public/content-control-ref.js';
|
|
11
12
|
import { CustomCommandContext, FontFamilyOption as ToolbarFontFamilyOption } from '../../public/ui/types.js';
|
|
12
13
|
export type { DocumentFontOption, FontFamilyOption, FontLoadSummary, FontResolutionRecord, } from '../../../../shared/font-system/src/index.js';
|
|
13
14
|
export type SuperDoc = SuperDocClass;
|
|
@@ -449,12 +450,37 @@ export interface V2AuthoringFacade {
|
|
|
449
450
|
* `#assignUserColor()` after `#init`.
|
|
450
451
|
*/
|
|
451
452
|
export interface User {
|
|
453
|
+
/** Stable application user id. Collaborative change records report it as the actor id. */
|
|
452
454
|
id?: string | null;
|
|
453
455
|
name?: string | null;
|
|
454
456
|
email?: string | null;
|
|
455
457
|
image?: string | null;
|
|
458
|
+
/**
|
|
459
|
+
* Opaque identity claim published with this session's change records, such as
|
|
460
|
+
* a JWT your server signs. SuperDoc never verifies it.
|
|
461
|
+
*/
|
|
462
|
+
claim?: UserClaim;
|
|
456
463
|
[key: string]: unknown;
|
|
457
464
|
}
|
|
465
|
+
/** Context passed to a {@link UserClaim} function. */
|
|
466
|
+
export interface UserClaimContext {
|
|
467
|
+
/** Collaboration document id of the session. */
|
|
468
|
+
documentId: string;
|
|
469
|
+
/** Yjs client id of the session. */
|
|
470
|
+
clientId: number;
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* Identity claim for {@link User.claim}: a string, or a function that returns
|
|
474
|
+
* one for the session's collaboration document and Yjs client id.
|
|
475
|
+
*/
|
|
476
|
+
export type UserClaim = string | ((ctx: UserClaimContext) => string | Promise<string>);
|
|
477
|
+
/** Per-session retention of attributed change records (`doc.changes`). */
|
|
478
|
+
export interface ChangesConfig {
|
|
479
|
+
/** Maximum number of retained records. Defaults to 1000. */
|
|
480
|
+
retainRecords?: number;
|
|
481
|
+
/** Maximum retained size in bytes, including captured updates. Defaults to 8 MiB. */
|
|
482
|
+
retainBytes?: number;
|
|
483
|
+
}
|
|
458
484
|
/** V2-neutral active editor facade exposed by legacy shell methods. */
|
|
459
485
|
export interface EditorCommands {
|
|
460
486
|
search?: (text: string | RegExp, options?: Record<string, unknown>) => SearchMatch[];
|
|
@@ -2919,6 +2945,7 @@ export interface EditorUpdateEvent {
|
|
|
2919
2945
|
* available. Always present (defaults to `null`); may be `null`.
|
|
2920
2946
|
*/
|
|
2921
2947
|
sectionType: string | null;
|
|
2948
|
+
isRemote: boolean;
|
|
2922
2949
|
}
|
|
2923
2950
|
/**
|
|
2924
2951
|
* Payload emitted with the `ready` event and passed to `Config.onReady`.
|
|
@@ -3071,18 +3098,50 @@ export interface SuperDocAwarenessUpdatePayload {
|
|
|
3071
3098
|
* `Config.onCommentsUpdate`. Field set differs from older inline
|
|
3072
3099
|
* declarations: the runtime emits `comment?` and `changes?` (never a
|
|
3073
3100
|
* `data` field).
|
|
3101
|
+
*
|
|
3102
|
+
* A refused comment mutation emits `rejected: true` with a stable `reason`
|
|
3103
|
+
* (e.g. `'adapter-threw'`, `'receipt-failure'`) and leaves the comment list
|
|
3104
|
+
* unchanged so the user can retry. It may add the document receipt failure
|
|
3105
|
+
* `code` (e.g. `'TARGET_NOT_FOUND'`), a `detail` (an error message or a
|
|
3106
|
+
* structured description of the mismatch), and `committed: true` when the
|
|
3107
|
+
* change reached the document but could not be confirmed in the comment list.
|
|
3074
3108
|
*/
|
|
3075
3109
|
export interface SuperDocCommentsUpdatePayload {
|
|
3076
|
-
/** Update kind (e.g. `'
|
|
3110
|
+
/** Update kind (e.g. `'add'`, `'update'`, `'deleted'`, `'resolved'`, `'pending'`); set by the comments store. */
|
|
3077
3111
|
type: string;
|
|
3078
|
-
/** The comment object the update refers to, when applicable. */
|
|
3079
|
-
comment?: Comment;
|
|
3080
|
-
/** Per-field change set
|
|
3112
|
+
/** The comment object the update refers to, when applicable; `null` when a created comment could not be read back. */
|
|
3113
|
+
comment?: Comment | null;
|
|
3114
|
+
/** Per-field change set: `'deleted'` names the comment; `text`, `isInternal`, `resolvedTime` carry `value` (check its type, not just `key`). */
|
|
3081
3115
|
changes?: Array<{
|
|
3082
3116
|
key: string;
|
|
3083
3117
|
commentId: string;
|
|
3084
3118
|
fileId?: string | null;
|
|
3119
|
+
value?: undefined;
|
|
3120
|
+
previousValue?: undefined;
|
|
3121
|
+
} | {
|
|
3122
|
+
key: 'text';
|
|
3123
|
+
value: string;
|
|
3124
|
+
commentId?: undefined;
|
|
3125
|
+
fileId?: undefined;
|
|
3126
|
+
previousValue?: undefined;
|
|
3127
|
+
} | {
|
|
3128
|
+
key: 'isInternal';
|
|
3129
|
+
value: boolean;
|
|
3130
|
+
previousValue: boolean;
|
|
3131
|
+
commentId?: undefined;
|
|
3132
|
+
fileId?: undefined;
|
|
3133
|
+
} | {
|
|
3134
|
+
key: 'resolvedTime';
|
|
3135
|
+
value: null;
|
|
3136
|
+
commentId?: undefined;
|
|
3137
|
+
fileId?: undefined;
|
|
3138
|
+
previousValue?: undefined;
|
|
3085
3139
|
}>;
|
|
3140
|
+
rejected?: true;
|
|
3141
|
+
reason?: string;
|
|
3142
|
+
committed?: true;
|
|
3143
|
+
code?: string;
|
|
3144
|
+
detail?: unknown;
|
|
3086
3145
|
/**
|
|
3087
3146
|
* The Document API selection snapshot captured at the moment a
|
|
3088
3147
|
* `'pending'` comment was started, before the pending mark is
|
|
@@ -3145,19 +3204,7 @@ export interface EditorTransactionEvent {
|
|
|
3145
3204
|
/** Header/footer variant (`default`, `first`, `even`, `odd`) when available. */
|
|
3146
3205
|
sectionType?: string | null;
|
|
3147
3206
|
}
|
|
3148
|
-
|
|
3149
|
-
export interface ContentControlRef {
|
|
3150
|
-
/** Content-control id from the DOCX. */
|
|
3151
|
-
id: string;
|
|
3152
|
-
/** Content-control tag, when the DOCX defines one. */
|
|
3153
|
-
tag?: string;
|
|
3154
|
-
/** Display name from the DOCX, when defined. */
|
|
3155
|
-
alias?: string;
|
|
3156
|
-
/** Content-control type, such as `text`, `checkbox`, or `date`. */
|
|
3157
|
-
controlType: ContentControlType;
|
|
3158
|
-
/** Whether the control is inline or contains one or more blocks. */
|
|
3159
|
-
scope: 'inline' | 'block';
|
|
3160
|
-
}
|
|
3207
|
+
export type { ContentControlRef } from '../../public/content-control-ref.js';
|
|
3161
3208
|
/**
|
|
3162
3209
|
* Previous content-control reference shape.
|
|
3163
3210
|
* @deprecated replaceWith=`ContentControlRef` compat-indefinitely=v2 event payload compatibility
|
|
@@ -3183,13 +3230,7 @@ export interface ContentControlActiveChangePayload {
|
|
|
3183
3230
|
/** Reported source of the selection change. */
|
|
3184
3231
|
source: 'keyboard' | 'pointer';
|
|
3185
3232
|
}
|
|
3186
|
-
|
|
3187
|
-
export interface ContentControlClickPayload {
|
|
3188
|
-
/** Innermost clicked content control. */
|
|
3189
|
-
target: ContentControlRef;
|
|
3190
|
-
/** Content-control clicks always originate from a pointer. */
|
|
3191
|
-
source: 'pointer';
|
|
3192
|
-
}
|
|
3233
|
+
export type { ContentControlClickPayload } from '../../public/content-control-ref.js';
|
|
3193
3234
|
export interface SuperDocLayoutEngineOptions {
|
|
3194
3235
|
/**
|
|
3195
3236
|
* Layout engine flow mode.
|
|
@@ -3904,16 +3945,25 @@ export interface SurfacesConfig {
|
|
|
3904
3945
|
};
|
|
3905
3946
|
}
|
|
3906
3947
|
/**
|
|
3907
|
-
*
|
|
3908
|
-
*
|
|
3909
|
-
*
|
|
3948
|
+
* Worker URLs accepted by v2. The editor runs on the page and starts no
|
|
3949
|
+
* document worker, so only `collaboration` is used, and only by collaboration
|
|
3950
|
+
* targets with `providerType: 'extension'`.
|
|
3910
3951
|
*/
|
|
3911
3952
|
interface V2WorkerUrlsConfig {
|
|
3912
|
-
/**
|
|
3953
|
+
/**
|
|
3954
|
+
* @deprecated The editor runs on the page and starts no document worker.
|
|
3955
|
+
* Accepted and ignored for configuration compatibility.
|
|
3956
|
+
*/
|
|
3913
3957
|
document?: string | URL;
|
|
3914
|
-
/**
|
|
3958
|
+
/**
|
|
3959
|
+
* Your provider-extension collaboration worker, built with
|
|
3960
|
+
* `bootstrapSuperDocCollaborationWorker` from the same SuperDoc version.
|
|
3961
|
+
* Must be a same-origin module worker URL. Required for
|
|
3962
|
+
* `providerType: 'extension'`; ignored by the built-in providers, which
|
|
3963
|
+
* sync on the page.
|
|
3964
|
+
*/
|
|
3915
3965
|
collaboration?: string | URL;
|
|
3916
|
-
/** @deprecated
|
|
3966
|
+
/** @deprecated Accepted and ignored for configuration compatibility. */
|
|
3917
3967
|
reviewIndex?: string | URL;
|
|
3918
3968
|
}
|
|
3919
3969
|
export interface Config {
|
|
@@ -4139,12 +4189,25 @@ export interface Config {
|
|
|
4139
4189
|
onReady?: (params: SuperDocReadyPayload) => void;
|
|
4140
4190
|
/** Callback when comments are updated. */
|
|
4141
4191
|
onCommentsUpdate?: (params: SuperDocCommentsUpdatePayload) => void;
|
|
4192
|
+
/**
|
|
4193
|
+
* Called when someone accepts a tracked change from its bubble in the comments sidebar.
|
|
4194
|
+
* Receives the tracked-change comment and the active editor. In SuperDoc 2 it runs after the accept is applied.
|
|
4195
|
+
*/
|
|
4196
|
+
onTrackedChangeBubbleAccept?: (comment: Comment, editor: Editor | null) => void;
|
|
4197
|
+
/**
|
|
4198
|
+
* Called when someone rejects a tracked change from its bubble in the comments sidebar.
|
|
4199
|
+
* Receives the tracked-change comment and the active editor. In SuperDoc 2 it runs after the reject is applied.
|
|
4200
|
+
*/
|
|
4201
|
+
onTrackedChangeBubbleReject?: (comment: Comment, editor: Editor | null) => void;
|
|
4142
4202
|
/**
|
|
4143
4203
|
* Callback when the selection enters, leaves, or moves between content controls.
|
|
4144
4204
|
* @deprecated replaceWith=`superdoc.ui.contentControls.observe` compat-indefinitely=v2 event compatibility
|
|
4145
4205
|
*/
|
|
4146
4206
|
onContentControlActiveChange?: (params: ContentControlActiveChangePayload) => void;
|
|
4147
|
-
/**
|
|
4207
|
+
/**
|
|
4208
|
+
* Callback when someone clicks inside a content control.
|
|
4209
|
+
* @deprecated replaceWith=`superdoc.ui.contentControls.onClick` removeIn=v3.0
|
|
4210
|
+
*/
|
|
4148
4211
|
onContentControlClick?: (params: ContentControlClickPayload) => void;
|
|
4149
4212
|
/** Callback when awareness is updated. */
|
|
4150
4213
|
onAwarenessUpdate?: (params: SuperDocAwarenessUpdatePayload) => void;
|
|
@@ -4199,6 +4262,8 @@ export interface Config {
|
|
|
4199
4262
|
* Callback when the zoom level changes. Fires for every zoom source:
|
|
4200
4263
|
* `setZoom()`, the toolbar zoom control, and fit-width
|
|
4201
4264
|
* adjustments.
|
|
4265
|
+
*
|
|
4266
|
+
* @deprecated replaceWith=`superdoc.ui.zoom.observe` removeIn=v3.0
|
|
4202
4267
|
*/
|
|
4203
4268
|
onZoomChange?: (params: SuperDocZoomPayload) => void;
|
|
4204
4269
|
/**
|
|
@@ -4371,22 +4436,22 @@ export interface Config {
|
|
|
4371
4436
|
*/
|
|
4372
4437
|
fonts?: FontsConfig;
|
|
4373
4438
|
/**
|
|
4374
|
-
*
|
|
4375
|
-
*
|
|
4376
|
-
*
|
|
4439
|
+
* Worker URLs. Only `collaboration` is used: the provider-extension
|
|
4440
|
+
* collaboration worker for `providerType: 'extension'`. `document` and
|
|
4441
|
+
* `reviewIndex` are accepted and ignored because the editor runs on the page.
|
|
4377
4442
|
*/
|
|
4378
4443
|
workerUrls?: V2WorkerUrlsConfig;
|
|
4379
4444
|
/**
|
|
4380
|
-
* Budget for the
|
|
4381
|
-
* (
|
|
4382
|
-
*
|
|
4383
|
-
*
|
|
4384
|
-
*
|
|
4385
|
-
*
|
|
4386
|
-
* budget. Must be a finite positive number no greater than 2147483647, the
|
|
4387
|
-
* platform timer ceiling above which a delay would fire immediately.
|
|
4445
|
+
* Budget for the provider-extension collaboration worker
|
|
4446
|
+
* (`workerUrls.collaboration`, `providerType: 'extension'`) to start up and
|
|
4447
|
+
* send its first response, in milliseconds. Defaults to the collaboration
|
|
4448
|
+
* `syncTimeoutMs`, or 30000. Worker load errors are reported immediately and
|
|
4449
|
+
* do not wait for this budget. Ignored by the built-in providers and by
|
|
4450
|
+
* documents opened without collaboration, which start no worker.
|
|
4388
4451
|
*/
|
|
4389
4452
|
workerStartupTimeoutMs?: number;
|
|
4453
|
+
/** Retention of attributed change records read through `activeEditor.doc.changes`. */
|
|
4454
|
+
changes?: ChangesConfig;
|
|
4390
4455
|
/**
|
|
4391
4456
|
* Whether `layoutEngineOptions` are passed when a DOCX editor opens.
|
|
4392
4457
|
*
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
export
|
|
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
|
-
|
|
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>;
|