superdoc 2.29.0 → 2.30.0-next.19
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-B_5ggdWg.es.js → FindReplaceSurface-BEnRLpD9.es.js} +1 -1
- package/dist/chunks/{FindReplaceSurface-fVHxPXtn.cjs → FindReplaceSurface-DWXgWgg7.cjs} +1 -1
- package/dist/chunks/{PasswordPromptSurface-CZqhDQQ1.es.js → PasswordPromptSurface-DjV1JgjD.es.js} +1 -1
- package/dist/chunks/{PasswordPromptSurface-x8GNmMJT.cjs → PasswordPromptSurface-VFPnQOML.cjs} +1 -1
- package/dist/chunks/{PdfViewer-CW09MNrB.es.js → PdfViewer-C2r-K8zC.es.js} +1 -1
- package/dist/chunks/{PdfViewer-CkrAHpC-.cjs → PdfViewer-DYTbPVUr.cjs} +1 -1
- package/dist/chunks/{_plugin-vue_export-helper-BkbCxNeT.cjs → _plugin-vue_export-helper-BzM2_tVU.cjs} +9 -0
- package/dist/chunks/{_plugin-vue_export-helper-DRPRMkeA.es.js → _plugin-vue_export-helper-CmkaJDnr.es.js} +4 -1
- package/dist/chunks/{create-super-doc-ui-L60GhVAX.cjs → create-super-doc-ui-D7uBUZfs.cjs} +14347 -13625
- package/dist/chunks/{create-super-doc-ui-Dc8dQAMc.es.js → create-super-doc-ui-_t6kMzLs.es.js} +14076 -13360
- 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/comments/comment-create-attribution.d.ts +4 -0
- package/dist/document-api/src/comments/comments.types.d.ts +4 -0
- package/dist/document-api/src/content-controls/content-controls.types.d.ts +1 -0
- package/dist/document-api/src/contract/command-catalog.d.ts +1 -1
- package/dist/document-api/src/contract/operation-definitions.d.ts +76 -8
- package/dist/document-api/src/contract/operation-registry.d.ts +2 -2
- package/dist/document-api/src/contract/schemas.d.ts +7 -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 +13 -1
- 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/document-api/src/paragraphs/paragraphs.d.ts +8 -3
- package/dist/document-api/src/paragraphs/paragraphs.types.d.ts +49 -5
- package/dist/document-api/src/tables/data/table-preset-appearance.generated.d.ts +2 -0
- package/dist/document-api/src/tables/table-style-presets.d.ts +73 -0
- package/dist/document-api/src/tables/tables.d.ts +4 -1
- package/dist/document-api/src/types/sd-props.d.ts +7 -0
- package/dist/document-api/src/types/table-operations.types.d.ts +12 -15
- package/dist/layout-engine/contracts/src/index.d.ts +4 -1
- package/dist/layout-engine/contracts/src/table-cell-vector-overlay.d.ts +2 -0
- 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/index.d.ts +2 -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-tracked-change-thread.d.ts +6 -4
- package/dist/superdoc/src/components/CommentsLayer/comment-params.d.ts +84 -0
- package/dist/superdoc/src/components/CommentsLayer/use-comment.d.ts +15 -95
- package/dist/superdoc/src/components/Whiteboard/use-whiteboard.d.ts +30 -9
- package/dist/superdoc/src/composables/use-comment-sidebar.d.ts +6 -0
- package/dist/superdoc/src/composables/use-document.d.ts +51 -99
- package/dist/superdoc/src/core/SuperDoc.d.ts +12 -3
- 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/config/normalize-interaction-config.d.ts +10 -1
- package/dist/superdoc/src/core/document-open-telemetry.d.ts +1 -1
- package/dist/superdoc/src/core/editor-runtime/types.d.ts +4 -0
- package/dist/superdoc/src/core/editor-runtime/v2/v2-editor-runtime-adapter.d.ts +1 -0
- package/dist/superdoc/src/core/types/index.d.ts +110 -42
- package/dist/superdoc/src/core/v2-integration/v2-integration.d.ts +6 -0
- package/dist/superdoc/src/helpers/deprecation.d.ts +12 -3
- package/dist/superdoc/src/helpers/object-guards.d.ts +1 -0
- package/dist/superdoc/src/helpers/v2-review-geometry-delivery.d.ts +22 -0
- package/dist/superdoc/src/internal/toolbar/built-in/ToolbarButton.vue.d.ts +1 -0
- package/dist/superdoc/src/public/content-control-ref.d.ts +12 -0
- package/dist/superdoc/src/public/index.d.cts +20 -0
- package/dist/superdoc/src/public/index.d.ts +4 -1
- 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/commands.d.ts +5 -1
- package/dist/superdoc/src/public/ui/content-controls-handle.d.ts +31 -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-paragraph.d.ts +7 -0
- package/dist/superdoc/src/public/ui/format-painter-state.d.ts +29 -0
- package/dist/superdoc/src/public/ui/heavy-read-gate.d.ts +41 -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 +80 -0
- package/dist/superdoc/src/public/ui/loose-record.d.ts +4 -0
- package/dist/superdoc/src/public/ui/reasons.d.ts +1 -0
- package/dist/superdoc/src/public/ui/search-handle.d.ts +24 -0
- package/dist/superdoc/src/public/ui/selection-targets.d.ts +53 -0
- package/dist/superdoc/src/public/ui/shared-tracked-changes-catalog.d.ts +16 -0
- package/dist/superdoc/src/public/ui/styles-handle.d.ts +54 -0
- package/dist/superdoc/src/public/ui/tracked-change-ids.d.ts +51 -0
- package/dist/superdoc/src/public/ui/types.d.ts +31 -2
- package/dist/superdoc/src/public/ui/ui-bench-timing.d.ts +9 -0
- package/dist/superdoc/src/public/ui.d.cts +18 -0
- package/dist/superdoc/src/public/ui.d.ts +1 -1
- package/dist/superdoc/src/stores/comments-store.d.ts +23052 -537
- 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 +3 -3
- package/dist/superdoc/src/stores/helpers/review-presentation.d.ts +91 -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 +148 -0
- package/dist/superdoc/src/stores/superdoc-store.d.ts +12 -2895
- package/dist/superdoc.cjs +1000 -566
- package/dist/superdoc.es.js +1000 -566
- 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 +12 -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 -11
- package/dist/word-layout/src/tab-layout.d.ts +0 -193
|
@@ -3,11 +3,12 @@ import { DiagnosticsConfig } from './diagnostics.js';
|
|
|
3
3
|
import { Doc as YDoc } from 'yjs';
|
|
4
4
|
import { HocuspocusProviderWebsocket } from '@hocuspocus/provider';
|
|
5
5
|
import { Ref, ComputedRef } from 'vue';
|
|
6
|
-
import {
|
|
6
|
+
import { HyperlinkTarget, SelectionInfo } from '../../../../document-api/src/index.js';
|
|
7
7
|
import { DocumentFontOption, FontAssetUrlResolver, FontFamilyOption, FontLoadSummary, FontResolutionRecord } from '../../../../shared/font-system/src/index.js';
|
|
8
8
|
import { SuperDoc as SuperDocClass } from '../SuperDoc.js';
|
|
9
9
|
import { SuperDocActiveEditorExtensions, SuperDocExtension } from '../extensions/index.js';
|
|
10
10
|
import { BrowserDocumentApi } from '../../public/browser-document-api.js';
|
|
11
|
+
import { ContentControlClickPayload, ContentControlRef } from '../../public/content-control-ref.js';
|
|
11
12
|
import { CustomCommandContext, FontFamilyOption as ToolbarFontFamilyOption } from '../../public/ui/types.js';
|
|
12
13
|
export type { DocumentFontOption, FontFamilyOption, FontLoadSummary, FontResolutionRecord, } from '../../../../shared/font-system/src/index.js';
|
|
13
14
|
export type SuperDoc = SuperDocClass;
|
|
@@ -449,12 +450,41 @@ export interface V2AuthoringFacade {
|
|
|
449
450
|
* `#assignUserColor()` after `#init`.
|
|
450
451
|
*/
|
|
451
452
|
export interface User {
|
|
453
|
+
commentIdentity?: {
|
|
454
|
+
providerId: string;
|
|
455
|
+
userId: string;
|
|
456
|
+
} | null;
|
|
457
|
+
/** Stable application user id. Collaborative change records report it as the actor id. */
|
|
452
458
|
id?: string | null;
|
|
453
459
|
name?: string | null;
|
|
454
460
|
email?: string | null;
|
|
455
461
|
image?: string | null;
|
|
462
|
+
/**
|
|
463
|
+
* Opaque identity claim published with this session's change records, such as
|
|
464
|
+
* a JWT your server signs. SuperDoc never verifies it.
|
|
465
|
+
*/
|
|
466
|
+
claim?: UserClaim;
|
|
456
467
|
[key: string]: unknown;
|
|
457
468
|
}
|
|
469
|
+
/** Context passed to a {@link UserClaim} function. */
|
|
470
|
+
export interface UserClaimContext {
|
|
471
|
+
/** Collaboration document id of the session. */
|
|
472
|
+
documentId: string;
|
|
473
|
+
/** Yjs client id of the session. */
|
|
474
|
+
clientId: number;
|
|
475
|
+
}
|
|
476
|
+
/**
|
|
477
|
+
* Identity claim for {@link User.claim}: a string, or a function that returns
|
|
478
|
+
* one for the session's collaboration document and Yjs client id.
|
|
479
|
+
*/
|
|
480
|
+
export type UserClaim = string | ((ctx: UserClaimContext) => string | Promise<string>);
|
|
481
|
+
/** Per-session retention of attributed change records (`doc.changes`). */
|
|
482
|
+
export interface ChangesConfig {
|
|
483
|
+
/** Maximum number of retained records. Defaults to 1000. */
|
|
484
|
+
retainRecords?: number;
|
|
485
|
+
/** Maximum retained size in bytes, including captured updates. Defaults to 8 MiB. */
|
|
486
|
+
retainBytes?: number;
|
|
487
|
+
}
|
|
458
488
|
/** V2-neutral active editor facade exposed by legacy shell methods. */
|
|
459
489
|
export interface EditorCommands {
|
|
460
490
|
search?: (text: string | RegExp, options?: Record<string, unknown>) => SearchMatch[];
|
|
@@ -848,9 +878,6 @@ export interface ProofingProvider {
|
|
|
848
878
|
suggest?: (request: ProofingSuggestRequest) => Promise<ProofingSuggestResult>;
|
|
849
879
|
dispose?: () => Promise<void> | void;
|
|
850
880
|
}
|
|
851
|
-
export interface SelectionInfo {
|
|
852
|
-
[key: string]: unknown;
|
|
853
|
-
}
|
|
854
881
|
/**
|
|
855
882
|
* Font surface on a SuperDoc instance (`superdoc.fonts`). The substitution- and load-aware
|
|
856
883
|
* answer to "what fonts does this document use and did SuperDoc render them faithfully" -
|
|
@@ -3178,19 +3205,7 @@ export interface EditorTransactionEvent {
|
|
|
3178
3205
|
/** Header/footer variant (`default`, `first`, `even`, `odd`) when available. */
|
|
3179
3206
|
sectionType?: string | null;
|
|
3180
3207
|
}
|
|
3181
|
-
|
|
3182
|
-
export interface ContentControlRef {
|
|
3183
|
-
/** Content-control id from the DOCX. */
|
|
3184
|
-
id: string;
|
|
3185
|
-
/** Content-control tag, when the DOCX defines one. */
|
|
3186
|
-
tag?: string;
|
|
3187
|
-
/** Display name from the DOCX, when defined. */
|
|
3188
|
-
alias?: string;
|
|
3189
|
-
/** Content-control type, such as `text`, `checkbox`, or `date`. */
|
|
3190
|
-
controlType: ContentControlType;
|
|
3191
|
-
/** Whether the control is inline or contains one or more blocks. */
|
|
3192
|
-
scope: 'inline' | 'block';
|
|
3193
|
-
}
|
|
3208
|
+
export type { ContentControlRef } from '../../public/content-control-ref.js';
|
|
3194
3209
|
/**
|
|
3195
3210
|
* Previous content-control reference shape.
|
|
3196
3211
|
* @deprecated replaceWith=`ContentControlRef` compat-indefinitely=v2 event payload compatibility
|
|
@@ -3216,13 +3231,7 @@ export interface ContentControlActiveChangePayload {
|
|
|
3216
3231
|
/** Reported source of the selection change. */
|
|
3217
3232
|
source: 'keyboard' | 'pointer';
|
|
3218
3233
|
}
|
|
3219
|
-
|
|
3220
|
-
export interface ContentControlClickPayload {
|
|
3221
|
-
/** Innermost clicked content control. */
|
|
3222
|
-
target: ContentControlRef;
|
|
3223
|
-
/** Content-control clicks always originate from a pointer. */
|
|
3224
|
-
source: 'pointer';
|
|
3225
|
-
}
|
|
3234
|
+
export type { ContentControlClickPayload } from '../../public/content-control-ref.js';
|
|
3226
3235
|
export interface SuperDocLayoutEngineOptions {
|
|
3227
3236
|
/**
|
|
3228
3237
|
* Layout engine flow mode.
|
|
@@ -3881,6 +3890,37 @@ export interface TrackChangesInteractionConfig {
|
|
|
3881
3890
|
*/
|
|
3882
3891
|
allowDecisions?: boolean;
|
|
3883
3892
|
}
|
|
3893
|
+
/** Native keyboard writing assistance requested from the device keyboard. */
|
|
3894
|
+
export interface WritingAssistanceConfig {
|
|
3895
|
+
/** Let the keyboard apply autocorrect and predictive replacements (default: false). */
|
|
3896
|
+
autocorrect?: boolean;
|
|
3897
|
+
/** Keyboard auto-capitalization mode (default: 'off'). */
|
|
3898
|
+
autocapitalize?: 'off' | 'sentences' | 'words' | 'characters';
|
|
3899
|
+
/** Let the keyboard underline and suggest spelling fixes (default: false). */
|
|
3900
|
+
spellcheck?: boolean;
|
|
3901
|
+
}
|
|
3902
|
+
/**
|
|
3903
|
+
* Opt-in touch behavior for this Editor. Every field defaults to off, and
|
|
3904
|
+
* omitted or `false` values keep the existing touch behavior unchanged.
|
|
3905
|
+
* Mouse, pen and keyboard input are never affected.
|
|
3906
|
+
*/
|
|
3907
|
+
export interface TouchInteractionConfig {
|
|
3908
|
+
/**
|
|
3909
|
+
* Opt in to SuperDoc-owned touch gestures (default: false).
|
|
3910
|
+
*
|
|
3911
|
+
* When enabled, a stationary touch hold on document content opens the
|
|
3912
|
+
* existing SuperDoc context menu when the finger lifts, with the same caret
|
|
3913
|
+
* and selection rules as a right-click. The lift does not activate content
|
|
3914
|
+
* underneath. Where the browser shows its own text-selection menu for the
|
|
3915
|
+
* hold (iOS Safari), it is dismissed once the SuperDoc menu opens and the
|
|
3916
|
+
* held word stays selected in SuperDoc; where the browser reports the hold
|
|
3917
|
+
* as a context-menu event (Android Chrome), the existing right-click path
|
|
3918
|
+
* opens the menu once. A hold during IME composition does nothing. Taps and
|
|
3919
|
+
* swipes keep their existing behavior. Hosts that disable the context menu,
|
|
3920
|
+
* and viewing mode, keep native behavior. Read when the editor mounts.
|
|
3921
|
+
*/
|
|
3922
|
+
gestures?: boolean;
|
|
3923
|
+
}
|
|
3884
3924
|
/**
|
|
3885
3925
|
* Controls which interactions this Editor allows, independent of what
|
|
3886
3926
|
* SuperDoc renders.
|
|
@@ -3893,6 +3933,10 @@ export interface InteractionConfig {
|
|
|
3893
3933
|
comments?: CommentInteractionConfig;
|
|
3894
3934
|
/** Tracked-change interaction policy. */
|
|
3895
3935
|
trackedChanges?: TrackChangesInteractionConfig;
|
|
3936
|
+
/** Opt-in touch behavior. Omitted fields keep the existing behavior. */
|
|
3937
|
+
touch?: TouchInteractionConfig;
|
|
3938
|
+
/** Native keyboard writing assistance. Everything is off when omitted. */
|
|
3939
|
+
writingAssistance?: WritingAssistanceConfig;
|
|
3896
3940
|
}
|
|
3897
3941
|
/**
|
|
3898
3942
|
* Shared plumbing for dialogs and floating overlays, including surfaces the
|
|
@@ -3937,16 +3981,25 @@ export interface SurfacesConfig {
|
|
|
3937
3981
|
};
|
|
3938
3982
|
}
|
|
3939
3983
|
/**
|
|
3940
|
-
*
|
|
3941
|
-
*
|
|
3942
|
-
*
|
|
3984
|
+
* Worker URLs accepted by v2. The editor runs on the page and starts no
|
|
3985
|
+
* document worker, so only `collaboration` is used, and only by collaboration
|
|
3986
|
+
* targets with `providerType: 'extension'`.
|
|
3943
3987
|
*/
|
|
3944
3988
|
interface V2WorkerUrlsConfig {
|
|
3945
|
-
/**
|
|
3989
|
+
/**
|
|
3990
|
+
* @deprecated The editor runs on the page and starts no document worker.
|
|
3991
|
+
* Accepted and ignored for configuration compatibility.
|
|
3992
|
+
*/
|
|
3946
3993
|
document?: string | URL;
|
|
3947
|
-
/**
|
|
3994
|
+
/**
|
|
3995
|
+
* Your provider-extension collaboration worker, built with
|
|
3996
|
+
* `bootstrapSuperDocCollaborationWorker` from the same SuperDoc version.
|
|
3997
|
+
* Must be a same-origin module worker URL. Required for
|
|
3998
|
+
* `providerType: 'extension'`; ignored by the built-in providers, which
|
|
3999
|
+
* sync on the page.
|
|
4000
|
+
*/
|
|
3948
4001
|
collaboration?: string | URL;
|
|
3949
|
-
/** @deprecated
|
|
4002
|
+
/** @deprecated Accepted and ignored for configuration compatibility. */
|
|
3950
4003
|
reviewIndex?: string | URL;
|
|
3951
4004
|
}
|
|
3952
4005
|
export interface Config {
|
|
@@ -4172,12 +4225,25 @@ export interface Config {
|
|
|
4172
4225
|
onReady?: (params: SuperDocReadyPayload) => void;
|
|
4173
4226
|
/** Callback when comments are updated. */
|
|
4174
4227
|
onCommentsUpdate?: (params: SuperDocCommentsUpdatePayload) => void;
|
|
4228
|
+
/**
|
|
4229
|
+
* Called when someone accepts a tracked change from its bubble in the comments sidebar.
|
|
4230
|
+
* Receives the tracked-change comment and the active editor. In SuperDoc 2 it runs after the accept is applied.
|
|
4231
|
+
*/
|
|
4232
|
+
onTrackedChangeBubbleAccept?: (comment: Comment, editor: Editor | null) => void;
|
|
4233
|
+
/**
|
|
4234
|
+
* Called when someone rejects a tracked change from its bubble in the comments sidebar.
|
|
4235
|
+
* Receives the tracked-change comment and the active editor. In SuperDoc 2 it runs after the reject is applied.
|
|
4236
|
+
*/
|
|
4237
|
+
onTrackedChangeBubbleReject?: (comment: Comment, editor: Editor | null) => void;
|
|
4175
4238
|
/**
|
|
4176
4239
|
* Callback when the selection enters, leaves, or moves between content controls.
|
|
4177
4240
|
* @deprecated replaceWith=`superdoc.ui.contentControls.observe` compat-indefinitely=v2 event compatibility
|
|
4178
4241
|
*/
|
|
4179
4242
|
onContentControlActiveChange?: (params: ContentControlActiveChangePayload) => void;
|
|
4180
|
-
/**
|
|
4243
|
+
/**
|
|
4244
|
+
* Callback when someone clicks inside a content control.
|
|
4245
|
+
* @deprecated replaceWith=`superdoc.ui.contentControls.onClick` removeIn=v3.0
|
|
4246
|
+
*/
|
|
4181
4247
|
onContentControlClick?: (params: ContentControlClickPayload) => void;
|
|
4182
4248
|
/** Callback when awareness is updated. */
|
|
4183
4249
|
onAwarenessUpdate?: (params: SuperDocAwarenessUpdatePayload) => void;
|
|
@@ -4232,6 +4298,8 @@ export interface Config {
|
|
|
4232
4298
|
* Callback when the zoom level changes. Fires for every zoom source:
|
|
4233
4299
|
* `setZoom()`, the toolbar zoom control, and fit-width
|
|
4234
4300
|
* adjustments.
|
|
4301
|
+
*
|
|
4302
|
+
* @deprecated replaceWith=`superdoc.ui.zoom.observe` removeIn=v3.0
|
|
4235
4303
|
*/
|
|
4236
4304
|
onZoomChange?: (params: SuperDocZoomPayload) => void;
|
|
4237
4305
|
/**
|
|
@@ -4404,22 +4472,22 @@ export interface Config {
|
|
|
4404
4472
|
*/
|
|
4405
4473
|
fonts?: FontsConfig;
|
|
4406
4474
|
/**
|
|
4407
|
-
*
|
|
4408
|
-
*
|
|
4409
|
-
*
|
|
4475
|
+
* Worker URLs. Only `collaboration` is used: the provider-extension
|
|
4476
|
+
* collaboration worker for `providerType: 'extension'`. `document` and
|
|
4477
|
+
* `reviewIndex` are accepted and ignored because the editor runs on the page.
|
|
4410
4478
|
*/
|
|
4411
4479
|
workerUrls?: V2WorkerUrlsConfig;
|
|
4412
4480
|
/**
|
|
4413
|
-
* Budget for the
|
|
4414
|
-
* (
|
|
4415
|
-
*
|
|
4416
|
-
*
|
|
4417
|
-
*
|
|
4418
|
-
*
|
|
4419
|
-
* budget. Must be a finite positive number no greater than 2147483647, the
|
|
4420
|
-
* platform timer ceiling above which a delay would fire immediately.
|
|
4481
|
+
* Budget for the provider-extension collaboration worker
|
|
4482
|
+
* (`workerUrls.collaboration`, `providerType: 'extension'`) to start up and
|
|
4483
|
+
* send its first response, in milliseconds. Defaults to the collaboration
|
|
4484
|
+
* `syncTimeoutMs`, or 30000. Worker load errors are reported immediately and
|
|
4485
|
+
* do not wait for this budget. Ignored by the built-in providers and by
|
|
4486
|
+
* documents opened without collaboration, which start no worker.
|
|
4421
4487
|
*/
|
|
4422
4488
|
workerStartupTimeoutMs?: number;
|
|
4489
|
+
/** Retention of attributed change records read through `activeEditor.doc.changes`. */
|
|
4490
|
+
changes?: ChangesConfig;
|
|
4423
4491
|
/**
|
|
4424
4492
|
* Whether `layoutEngineOptions` are passed when a DOCX editor opens.
|
|
4425
4493
|
*
|
|
@@ -72,6 +72,12 @@ interface V2ReviewWindowDiagnostics {
|
|
|
72
72
|
records: readonly Record<string, unknown>[];
|
|
73
73
|
}
|
|
74
74
|
interface V2ReviewWindowController {
|
|
75
|
+
noteAnalysisProgress?(progress: {
|
|
76
|
+
state: string;
|
|
77
|
+
done: number;
|
|
78
|
+
total: number;
|
|
79
|
+
stage: string | null;
|
|
80
|
+
} | null): void;
|
|
75
81
|
setContext(context: V2ReviewWindowContext | null): void;
|
|
76
82
|
onCommittedPagePaint?(commit: V2CommittedPageWindow): void;
|
|
77
83
|
refreshCommittedWindow(reason?: string): void;
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Deprecation utilities for steering consumers toward the Document API.
|
|
3
|
+
*
|
|
4
|
+
* ProseMirror will be removed in a future major version. These helpers emit
|
|
5
|
+
* one-time console warnings when deprecated properties are accessed on an
|
|
6
|
+
* editor instance handed to consumer callbacks (onEditorCreate, etc.).
|
|
7
|
+
*
|
|
8
|
+
* Internal code continues to use the raw Editor — only the consumer-facing
|
|
9
|
+
* boundary wraps the editor with a Proxy.
|
|
10
|
+
*/
|
|
2
11
|
/**
|
|
3
12
|
* Log a console.warn once per key. Subsequent calls with the same key are no-ops.
|
|
4
13
|
*/
|
|
@@ -12,9 +21,9 @@ export declare function warnOnce(key: string, message: string): void;
|
|
|
12
21
|
*
|
|
13
22
|
* @returns Proxied editor (or the original if null/already wrapped)
|
|
14
23
|
*/
|
|
15
|
-
export declare function createDeprecatedEditorProxy<T extends
|
|
24
|
+
export declare function createDeprecatedEditorProxy<T extends object | null | undefined>(editor: T): T;
|
|
16
25
|
/**
|
|
17
26
|
* Unwrap a potentially proxied editor back to the raw Editor instance.
|
|
18
27
|
* Safe to call on an already-raw editor — returns it unchanged.
|
|
19
28
|
*/
|
|
20
|
-
export declare function unwrapEditor(editor:
|
|
29
|
+
export declare function unwrapEditor<T extends object>(editor: T | null | undefined): T | null | undefined;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface ReviewGeometryDeliveryPayload extends Readonly<Record<string, unknown>> {
|
|
2
|
+
documentEpoch?: unknown;
|
|
3
|
+
paintEpoch?: unknown;
|
|
4
|
+
commitSequence?: unknown;
|
|
5
|
+
generation?: unknown;
|
|
6
|
+
pageIndices?: unknown;
|
|
7
|
+
zoomScale?: unknown;
|
|
8
|
+
reviewGeometry?: unknown;
|
|
9
|
+
}
|
|
10
|
+
type Render = {
|
|
11
|
+
mountContainer: HTMLElement | null;
|
|
12
|
+
documentId?: string | null;
|
|
13
|
+
epoch?: number | null;
|
|
14
|
+
};
|
|
15
|
+
export declare function createReviewGeometryDelivery<T extends Render>(deliver: (value: T, payload: ReviewGeometryDeliveryPayload) => void): {
|
|
16
|
+
notify: (documentId: string, payload: ReviewGeometryDeliveryPayload, current: T | null, ready?: boolean) => boolean;
|
|
17
|
+
observe: (current: T) => void;
|
|
18
|
+
flush(current: T): boolean;
|
|
19
|
+
replay(current: T): boolean;
|
|
20
|
+
reset(): void;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ContentControlType } from '../../../document-api/src/index.js';
|
|
2
|
+
export interface ContentControlRef {
|
|
3
|
+
id: string;
|
|
4
|
+
tag?: string;
|
|
5
|
+
alias?: string;
|
|
6
|
+
controlType: ContentControlType;
|
|
7
|
+
scope: 'inline' | 'block';
|
|
8
|
+
}
|
|
9
|
+
export interface ContentControlClickPayload {
|
|
10
|
+
target: ContentControlRef;
|
|
11
|
+
source: 'pointer';
|
|
12
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// Generated by scripts/ensure-types.cjs. Do not edit by hand.
|
|
2
2
|
import type { AwarenessState as __Cjs_AwarenessState } from './index.js' with { "resolution-mode": "import" };
|
|
3
3
|
import type { AwarenessUser as __Cjs_AwarenessUser } from './index.js' with { "resolution-mode": "import" };
|
|
4
|
+
import type { BlockChange as __Cjs_BlockChange } from './index.js' with { "resolution-mode": "import" };
|
|
4
5
|
import type { BlockNavigationAddress as __Cjs_BlockNavigationAddress } from './index.js' with { "resolution-mode": "import" };
|
|
5
6
|
import type { BlocksListResult as __Cjs_BlocksListResult } from './index.js' with { "resolution-mode": "import" };
|
|
6
7
|
import type { BookmarkAddress as __Cjs_BookmarkAddress } from './index.js' with { "resolution-mode": "import" };
|
|
@@ -8,6 +9,11 @@ import type { BookmarkInfo as __Cjs_BookmarkInfo } from './index.js' with { "res
|
|
|
8
9
|
import type { BorrowedSuperDocUI as __Cjs_BorrowedSuperDocUI } from './index.js' with { "resolution-mode": "import" };
|
|
9
10
|
import type { BuiltInCommandId as __Cjs_BuiltInCommandId } from './index.js' with { "resolution-mode": "import" };
|
|
10
11
|
import type { CanPerformPermissionParams as __Cjs_CanPerformPermissionParams } from './index.js' with { "resolution-mode": "import" };
|
|
12
|
+
import type { ChangeActor as __Cjs_ChangeActor } from './index.js' with { "resolution-mode": "import" };
|
|
13
|
+
import type { ChangeCause as __Cjs_ChangeCause } from './index.js' with { "resolution-mode": "import" };
|
|
14
|
+
import type { ChangeProvenance as __Cjs_ChangeProvenance } from './index.js' with { "resolution-mode": "import" };
|
|
15
|
+
import type { ChangeRecord as __Cjs_ChangeRecord } from './index.js' with { "resolution-mode": "import" };
|
|
16
|
+
import type { ChangesConfig as __Cjs_ChangesConfig } from './index.js' with { "resolution-mode": "import" };
|
|
11
17
|
import type { CollaborationConfig as __Cjs_CollaborationConfig } from './index.js' with { "resolution-mode": "import" };
|
|
12
18
|
import type { CommentAddress as __Cjs_CommentAddress } from './index.js' with { "resolution-mode": "import" };
|
|
13
19
|
import type { CommentInteractionConfig as __Cjs_CommentInteractionConfig } from './index.js' with { "resolution-mode": "import" };
|
|
@@ -283,6 +289,7 @@ import type { ToolbarItemId as __Cjs_ToolbarItemId } from './index.js' with { "r
|
|
|
283
289
|
import type { ToolbarOptionalItemId as __Cjs_ToolbarOptionalItemId } from './index.js' with { "resolution-mode": "import" };
|
|
284
290
|
import type { ToolbarRegion as __Cjs_ToolbarRegion } from './index.js' with { "resolution-mode": "import" };
|
|
285
291
|
import type { ToolbarStringId as __Cjs_ToolbarStringId } from './index.js' with { "resolution-mode": "import" };
|
|
292
|
+
import type { TouchInteractionConfig as __Cjs_TouchInteractionConfig } from './index.js' with { "resolution-mode": "import" };
|
|
286
293
|
import type { TrackChangeAuthor as __Cjs_TrackChangeAuthor } from './index.js' with { "resolution-mode": "import" };
|
|
287
294
|
import type { TrackChangeHighlightColors as __Cjs_TrackChangeHighlightColors } from './index.js' with { "resolution-mode": "import" };
|
|
288
295
|
import type { TrackChangesAuthorColorsConfig as __Cjs_TrackChangesAuthorColorsConfig } from './index.js' with { "resolution-mode": "import" };
|
|
@@ -298,14 +305,18 @@ import type { UIConfig as __Cjs_UIConfig } from './index.js' with { "resolution-
|
|
|
298
305
|
import type { UpgradeToCollaborationOptions as __Cjs_UpgradeToCollaborationOptions } from './index.js' with { "resolution-mode": "import" };
|
|
299
306
|
import type { UpgradeToCollaborationResult as __Cjs_UpgradeToCollaborationResult } from './index.js' with { "resolution-mode": "import" };
|
|
300
307
|
import type { User as __Cjs_User } from './index.js' with { "resolution-mode": "import" };
|
|
308
|
+
import type { UserClaim as __Cjs_UserClaim } from './index.js' with { "resolution-mode": "import" };
|
|
309
|
+
import type { UserClaimContext as __Cjs_UserClaimContext } from './index.js' with { "resolution-mode": "import" };
|
|
301
310
|
import type { V2CollaborationConfig as __Cjs_V2CollaborationConfig } from './index.js' with { "resolution-mode": "import" };
|
|
302
311
|
import type { ViewingOptions as __Cjs_ViewingOptions } from './index.js' with { "resolution-mode": "import" };
|
|
303
312
|
import type { ViewingTrackedChangesMode as __Cjs_ViewingTrackedChangesMode } from './index.js' with { "resolution-mode": "import" };
|
|
304
313
|
import type { ViewingVisibilityConfig as __Cjs_ViewingVisibilityConfig } from './index.js' with { "resolution-mode": "import" };
|
|
305
314
|
import type { ViewOptions as __Cjs_ViewOptions } from './index.js' with { "resolution-mode": "import" };
|
|
315
|
+
import type { WritingAssistanceConfig as __Cjs_WritingAssistanceConfig } from './index.js' with { "resolution-mode": "import" };
|
|
306
316
|
export type { __Cjs_AwarenessState as AwarenessState };
|
|
307
317
|
export type { __Cjs_AwarenessUser as AwarenessUser };
|
|
308
318
|
export declare const BlankDOCX: typeof import('./index.js', { with: { "resolution-mode": "import" } }).BlankDOCX;
|
|
319
|
+
export type { __Cjs_BlockChange as BlockChange };
|
|
309
320
|
export type { __Cjs_BlockNavigationAddress as BlockNavigationAddress };
|
|
310
321
|
export type { __Cjs_BlocksListResult as BlocksListResult };
|
|
311
322
|
export type { __Cjs_BookmarkAddress as BookmarkAddress };
|
|
@@ -314,6 +325,11 @@ export type { __Cjs_BorrowedSuperDocUI as BorrowedSuperDocUI };
|
|
|
314
325
|
export declare const buildTheme: typeof import('./index.js', { with: { "resolution-mode": "import" } }).buildTheme;
|
|
315
326
|
export type { __Cjs_BuiltInCommandId as BuiltInCommandId };
|
|
316
327
|
export type { __Cjs_CanPerformPermissionParams as CanPerformPermissionParams };
|
|
328
|
+
export type { __Cjs_ChangeActor as ChangeActor };
|
|
329
|
+
export type { __Cjs_ChangeCause as ChangeCause };
|
|
330
|
+
export type { __Cjs_ChangeProvenance as ChangeProvenance };
|
|
331
|
+
export type { __Cjs_ChangeRecord as ChangeRecord };
|
|
332
|
+
export type { __Cjs_ChangesConfig as ChangesConfig };
|
|
317
333
|
export type { __Cjs_CollaborationConfig as CollaborationConfig };
|
|
318
334
|
export type { __Cjs_CommentAddress as CommentAddress };
|
|
319
335
|
export type { __Cjs_CommentInteractionConfig as CommentInteractionConfig };
|
|
@@ -600,6 +616,7 @@ export type { __Cjs_ToolbarItemId as ToolbarItemId };
|
|
|
600
616
|
export type { __Cjs_ToolbarOptionalItemId as ToolbarOptionalItemId };
|
|
601
617
|
export type { __Cjs_ToolbarRegion as ToolbarRegion };
|
|
602
618
|
export type { __Cjs_ToolbarStringId as ToolbarStringId };
|
|
619
|
+
export type { __Cjs_TouchInteractionConfig as TouchInteractionConfig };
|
|
603
620
|
export type { __Cjs_TrackChangeAuthor as TrackChangeAuthor };
|
|
604
621
|
export type { __Cjs_TrackChangeHighlightColors as TrackChangeHighlightColors };
|
|
605
622
|
export type { __Cjs_TrackChangesAuthorColorsConfig as TrackChangesAuthorColorsConfig };
|
|
@@ -615,8 +632,11 @@ export type { __Cjs_UIConfig as UIConfig };
|
|
|
615
632
|
export type { __Cjs_UpgradeToCollaborationOptions as UpgradeToCollaborationOptions };
|
|
616
633
|
export type { __Cjs_UpgradeToCollaborationResult as UpgradeToCollaborationResult };
|
|
617
634
|
export type { __Cjs_User as User };
|
|
635
|
+
export type { __Cjs_UserClaim as UserClaim };
|
|
636
|
+
export type { __Cjs_UserClaimContext as UserClaimContext };
|
|
618
637
|
export type { __Cjs_V2CollaborationConfig as V2CollaborationConfig };
|
|
619
638
|
export type { __Cjs_ViewingOptions as ViewingOptions };
|
|
620
639
|
export type { __Cjs_ViewingTrackedChangesMode as ViewingTrackedChangesMode };
|
|
621
640
|
export type { __Cjs_ViewingVisibilityConfig as ViewingVisibilityConfig };
|
|
622
641
|
export type { __Cjs_ViewOptions as ViewOptions };
|
|
642
|
+
export type { __Cjs_WritingAssistanceConfig as WritingAssistanceConfig };
|
|
@@ -115,7 +115,7 @@ export type { SuperDocLayoutEngineOptions as LayoutEngineOptions } from '../core
|
|
|
115
115
|
export type { FlowBlock, FlowMode, Layout, Fragment as LayoutFragment, Page as LayoutPage } from '../../../layout-engine/contracts/src/index.js';
|
|
116
116
|
export type { LayoutMetrics } from '../../../layout-engine/layout-bridge/src/index.js';
|
|
117
117
|
export type { LayoutMode } from '../../../layout-engine/painters/dom/src/index.js';
|
|
118
|
-
export type { CommentInteractionConfig, CommentsConfig, CommentsLayout, CommentsResponsiveConfig, TrackChangesInteractionConfig, } from '../core/types/index.js';
|
|
118
|
+
export type { CommentInteractionConfig, CommentsConfig, CommentsLayout, CommentsResponsiveConfig, TouchInteractionConfig, TrackChangesInteractionConfig, WritingAssistanceConfig, } from '../core/types/index.js';
|
|
119
119
|
export type { TrackChangeHighlightColors } from '../core/types/index.js';
|
|
120
120
|
export type { ContentControlsConfig } from '../core/types/index.js';
|
|
121
121
|
export type { RulerConfig } from '../core/types/index.js';
|
|
@@ -200,6 +200,9 @@ export type { UpgradeToCollaborationResult } from '../core/types/index.js';
|
|
|
200
200
|
export type { SuperDocCollaborationUpgradeError } from '../core/types/index.js';
|
|
201
201
|
export type { V2CollaborationConfig } from '../core/types/index.js';
|
|
202
202
|
export type { User } from '../core/types/index.js';
|
|
203
|
+
export type { UserClaim, UserClaimContext } from '../core/types/index.js';
|
|
204
|
+
export type { ChangesConfig } from '../core/types/index.js';
|
|
205
|
+
export type { BlockChange, ChangeActor, ChangeCause, ChangeProvenance, ChangeRecord } from '../../../document-api/src/index.js';
|
|
203
206
|
export type { ViewOptions } from '../core/types/index.js';
|
|
204
207
|
export type { ViewingOptions } from '../core/types/index.js';
|
|
205
208
|
export type { ViewingTrackedChangesMode } from '../core/types/index.js';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type AsyncReadEntry = {
|
|
2
|
+
token: string | null;
|
|
3
|
+
value: unknown;
|
|
4
|
+
hasSettled: boolean;
|
|
5
|
+
inflightToken: string | null;
|
|
6
|
+
failedToken?: string | null;
|
|
7
|
+
failureCount?: number;
|
|
8
|
+
retryAtMs?: number;
|
|
9
|
+
settled?: Promise<void>;
|
|
10
|
+
};
|
|
11
|
+
export type AsyncReadSettlement = {
|
|
12
|
+
key: string;
|
|
13
|
+
settledAtMs: number;
|
|
14
|
+
commandId: string | null;
|
|
15
|
+
commandKind: string | null;
|
|
16
|
+
};
|
|
17
|
+
export interface AsyncReadCacheOptions {
|
|
18
|
+
isDisposed: () => boolean;
|
|
19
|
+
recomputeAfterSettle: () => void;
|
|
20
|
+
recomputeWhenRetryDue: () => void;
|
|
21
|
+
}
|
|
22
|
+
export declare function failureRetryDelayMs(failureCount: number): number;
|
|
23
|
+
export declare function createAsyncReadCache(options: AsyncReadCacheOptions): {
|
|
24
|
+
entries: Map<string, AsyncReadEntry>;
|
|
25
|
+
issue: (key: string, token: string, run: () => unknown, normalize: (raw: unknown) => unknown) => AsyncReadEntry | null;
|
|
26
|
+
seed: (key: string, token: string | null, value: unknown, inflightToken?: string | null) => void;
|
|
27
|
+
clearKeys: (predicate: (key: string) => boolean) => void;
|
|
28
|
+
scheduleRefresh: () => void;
|
|
29
|
+
scheduleFailureRetry: (retryAtMs: number) => void;
|
|
30
|
+
cancelFailureRetry: () => void;
|
|
31
|
+
drainSettlements: () => AsyncReadSettlement[];
|
|
32
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { LooseRecord } from './loose-record.js';
|
|
2
|
+
import { TableCommandSpec } from './commands.js';
|
|
3
|
+
export declare const PARAGRAPH_INDENT_STEP_TWIPS = 720;
|
|
4
|
+
export type ParagraphIndentationTwips = {
|
|
5
|
+
left?: number;
|
|
6
|
+
right?: number;
|
|
7
|
+
firstLine?: number;
|
|
8
|
+
hanging?: number;
|
|
9
|
+
};
|
|
10
|
+
export declare function pointsToTwips(value: number): number;
|
|
11
|
+
export declare function readParagraphIndentationFromResult(result: unknown): ParagraphIndentationTwips | null;
|
|
12
|
+
export interface ResolvedTableContext {
|
|
13
|
+
canMerge: boolean;
|
|
14
|
+
tableNodeId: string;
|
|
15
|
+
rowIndex: number;
|
|
16
|
+
columnIndex: number;
|
|
17
|
+
cellNodeId: string | null;
|
|
18
|
+
mergeRange: {
|
|
19
|
+
start: {
|
|
20
|
+
rowIndex: number;
|
|
21
|
+
columnIndex: number;
|
|
22
|
+
};
|
|
23
|
+
end: {
|
|
24
|
+
rowIndex: number;
|
|
25
|
+
columnIndex: number;
|
|
26
|
+
};
|
|
27
|
+
} | null;
|
|
28
|
+
}
|
|
29
|
+
export declare function readMergeRange(range: LooseRecord | undefined): {
|
|
30
|
+
start: {
|
|
31
|
+
rowIndex: number;
|
|
32
|
+
columnIndex: number;
|
|
33
|
+
};
|
|
34
|
+
end: {
|
|
35
|
+
rowIndex: number;
|
|
36
|
+
columnIndex: number;
|
|
37
|
+
};
|
|
38
|
+
} | null;
|
|
39
|
+
export declare function buildTableCommandInput(action: TableCommandSpec['action'], context: ResolvedTableContext): LooseRecord | null;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { SuperDocUIReason } from './reasons.js';
|
|
2
|
+
import { CommandExecutionResult, CommandState, ListPresetId, PartialLinkEditReceipt, Receipt, SelectionSlice, SuperDocUIFailureReceipt, SuperDocUIReceiptFailureCode, ViewportRect, ViewportRectResult, WorkflowActionResult } from './types.js';
|
|
3
|
+
import { AnyFn, LooseRecord } from './loose-record.js';
|
|
4
|
+
import { CommandDescriptor, TrackDecisionSpec, UiDocRoute } from './commands.js';
|
|
5
|
+
export declare const SUPERDOC_UI_REASON_VALUES: Set<string>;
|
|
6
|
+
export declare function coerceSuperDocUIReason(reason: unknown, fallback: SuperDocUIReason): SuperDocUIReason;
|
|
7
|
+
export declare function normalizeHostSelectionApplyResult(result: unknown): WorkflowActionResult;
|
|
8
|
+
export declare const LIST_TOGGLE_KINDS: Record<string, 'bullet' | 'ordered'>;
|
|
9
|
+
export declare function listToggleKind(id: string): 'bullet' | 'ordered' | null;
|
|
10
|
+
export declare const TOOLBAR_LIST_STYLE_PRESETS: Record<string, ListPresetId>;
|
|
11
|
+
export declare function presetFromToolbarStyleKey(styleKey: string): {
|
|
12
|
+
preset?: ListPresetId;
|
|
13
|
+
behavior?: 'toggleStyle';
|
|
14
|
+
};
|
|
15
|
+
export declare function safeCall<T>(fn: (() => T) | undefined, fallback: T): T;
|
|
16
|
+
export declare function hostMethod(target: unknown, name: string): ((...args: unknown[]) => unknown) | null;
|
|
17
|
+
export declare function hasAbortedFlag(value: unknown): value is {
|
|
18
|
+
readonly aborted: boolean;
|
|
19
|
+
};
|
|
20
|
+
export declare function isPromiseLike(value: unknown): value is PromiseLike<unknown>;
|
|
21
|
+
export declare function resolveDocOperation(doc: LooseRecord | null, path: UiDocRoute): AnyFn | null;
|
|
22
|
+
export declare function failedReceipt(message: string, code?: Exclude<SuperDocUIReceiptFailureCode, 'PARTIAL_LINK_EDIT'>): SuperDocUIFailureReceipt;
|
|
23
|
+
export declare function partialLinkEditFailure(hyperlinkResult: CommandExecutionResult, textResult: CommandExecutionResult): PartialLinkEditReceipt;
|
|
24
|
+
export declare const MIRRORED_EDIT_COMMAND_IDS: {
|
|
25
|
+
readonly undo: "history.undo";
|
|
26
|
+
readonly redo: "history.redo";
|
|
27
|
+
};
|
|
28
|
+
export declare function normalizeCommandState(state: Partial<CommandState>, source: CommandState['source']): CommandState;
|
|
29
|
+
export declare function commandResultFromOperationResult(result: unknown): CommandExecutionResult;
|
|
30
|
+
export declare function isSuccessfulReceipt(result: CommandExecutionResult): result is Extract<Receipt, {
|
|
31
|
+
success: true;
|
|
32
|
+
}>;
|
|
33
|
+
export declare function commandResultSucceeded(result: CommandExecutionResult): boolean;
|
|
34
|
+
export declare function combineCommandResults(results: readonly CommandExecutionResult[]): CommandExecutionResult;
|
|
35
|
+
export declare function trackDecisionCommand(id: string): TrackDecisionSpec | null;
|
|
36
|
+
export declare function rectResult(rects: readonly ViewportRect[]): ViewportRectResult;
|
|
37
|
+
export declare function rectFailure(reason: string): ViewportRectResult;
|
|
38
|
+
export declare function relativizeRects(result: ViewportRectResult, relativeTo?: HTMLElement): ViewportRectResult;
|
|
39
|
+
export declare function commandIsActive(descriptor: CommandDescriptor, selection: SelectionSlice): boolean;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { OperationId } from '../../../../document-api/src/index.js';
|
|
1
2
|
import { SuperDocUIReason } from './reasons.js';
|
|
3
|
+
export type InternalUiDocRoute = 'format.readEffectiveInlineUniformity' | 'lists.indentRange' | 'lists.outdentRange' | 'lists.outdentInStory' | 'lists.removeInStory';
|
|
4
|
+
export type DocumentApiAliasRoute = 'format.strikethrough';
|
|
5
|
+
export type UiDocRoute = OperationId | DocumentApiAliasRoute | InternalUiDocRoute;
|
|
2
6
|
/**
|
|
3
7
|
* The original v2-native command ids. These are the historically stable
|
|
4
8
|
* `superdoc/ui` built-ins; the broader catalog below adds v1 headless-toolbar
|
|
@@ -192,7 +196,7 @@ export interface CommandDescriptor {
|
|
|
192
196
|
/** Other ids that alias this command (documentation). */
|
|
193
197
|
aliases?: readonly string[];
|
|
194
198
|
/** Dotted path on the public Document API facade (`activeEditor.doc`). */
|
|
195
|
-
docRoute?:
|
|
199
|
+
docRoute?: UiDocRoute;
|
|
196
200
|
/** Public SuperDoc-instance method this command calls. */
|
|
197
201
|
instanceRoute?: string;
|
|
198
202
|
/** Fixed argument passed to `instanceRoute` instead of the payload. */
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { LooseRecord } from './loose-record.js';
|
|
2
|
+
import { ContentControlsHandle, ContentControlsSlice, ScrollIntoViewInput, SelectionTarget, SnapshotSubscribable, Subscribable, SuperDocUIState, ViewportRectResult, WorkflowActionResult, WorkflowScrollResult } from './types.js';
|
|
3
|
+
type ScrollPlacement = {
|
|
4
|
+
block?: ScrollIntoViewInput['block'];
|
|
5
|
+
behavior?: ScrollIntoViewInput['behavior'];
|
|
6
|
+
};
|
|
7
|
+
export interface ContentControlsHandleDeps {
|
|
8
|
+
superdoc: unknown;
|
|
9
|
+
select: (selector: (state: Pick<SuperDocUIState, 'contentControls'>) => ContentControlsSlice) => Subscribable<ContentControlsSlice>;
|
|
10
|
+
snapshotHandle: (sub: Subscribable<ContentControlsSlice>) => SnapshotSubscribable<ContentControlsSlice>;
|
|
11
|
+
leasedDirectorySnapshot: (passive: Subscribable<ContentControlsSlice>, directory: Subscribable<ContentControlsSlice>) => SnapshotSubscribable<ContentControlsSlice>;
|
|
12
|
+
directoryLeaseHeld: () => boolean;
|
|
13
|
+
demandCatalog: () => void;
|
|
14
|
+
isDisposed: () => boolean;
|
|
15
|
+
currentEditor: () => LooseRecord | null;
|
|
16
|
+
currentHost: () => LooseRecord | null;
|
|
17
|
+
documentContentControls: () => unknown;
|
|
18
|
+
rectOf: (target: SelectionTarget) => ViewportRectResult;
|
|
19
|
+
scrollIntoView: (target: SelectionTarget, placement: ScrollPlacement) => Promise<WorkflowScrollResult>;
|
|
20
|
+
applySelection: (target: SelectionTarget) => WorkflowActionResult;
|
|
21
|
+
activateChrome: (id: string) => void;
|
|
22
|
+
onDocumentReset: (hook: () => void) => void;
|
|
23
|
+
onDestroy: (detach: () => void) => void;
|
|
24
|
+
}
|
|
25
|
+
export interface ContentControlsController {
|
|
26
|
+
handle: ContentControlsHandle;
|
|
27
|
+
clearHighlight: () => void;
|
|
28
|
+
clearClickListeners: () => void;
|
|
29
|
+
}
|
|
30
|
+
export declare function createContentControlsHandle(deps: ContentControlsHandleDeps): ContentControlsController;
|
|
31
|
+
export {};
|
|
@@ -8,7 +8,7 @@ type FirstPartyCommandMutation = {
|
|
|
8
8
|
};
|
|
9
9
|
supports: (memberPath: string) => boolean;
|
|
10
10
|
run: (memberPath: string, args: readonly unknown[]) => unknown;
|
|
11
|
-
runListApply: (input: unknown) => Promise<
|
|
11
|
+
runListApply: (input: unknown) => Promise<unknown>;
|
|
12
12
|
};
|
|
13
13
|
export declare function registerFirstPartyCommandMutation(superdoc: object, host: object, mutation: FirstPartyCommandMutation): void;
|
|
14
14
|
/**
|
|
@@ -18,21 +18,5 @@ export declare function registerFirstPartyCommandMutation(superdoc: object, host
|
|
|
18
18
|
export declare function readFirstPartyPageNumbers(ui: object): Promise<unknown>;
|
|
19
19
|
export declare function executeFirstPartyCommandAsync(ui: Pick<SuperDocUI, 'commands'>, id: string, payload?: unknown): Promise<CommandExecutionResult>;
|
|
20
20
|
export declare function executeFirstPartyShortcutAsync(ui: object, id: string, payload?: unknown): Promise<CommandExecutionResult>;
|
|
21
|
-
/**
|
|
22
|
-
* Heavy-read policy for the async read coordinator (source-loading deferral).
|
|
23
|
-
* One shared table: the coordinator's gate and the table-driven policy tests
|
|
24
|
-
* both consume THIS list, so the deferred set cannot silently drift from the
|
|
25
|
-
* tested set. Keys are coordinator cache keys (exact) or key families
|
|
26
|
-
* (prefix). See the gate in `readAsync` for the runtime semantics.
|
|
27
|
-
*/
|
|
28
|
-
interface HeavyDocReadPolicyEntry {
|
|
29
|
-
key: string;
|
|
30
|
-
match: 'exact' | 'prefix';
|
|
31
|
-
/** Audit rationale — why this key is catalog-scale (or reserved). */
|
|
32
|
-
note: string;
|
|
33
|
-
}
|
|
34
|
-
export declare const HEAVY_DOC_READ_POLICY: readonly HeavyDocReadPolicyEntry[];
|
|
35
|
-
/** Whether a coordinator cache key falls under the heavy-read policy. */
|
|
36
|
-
export declare function isHeavyDocReadKey(key: string): boolean;
|
|
37
21
|
export declare function createSuperDocUI(options: SuperDocUIOptions): SuperDocUI;
|
|
38
22
|
export {};
|