superdoc 2.3.0 → 2.4.0-next.2
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 +0 -1
- package/dist/chunks/{FindReplaceSurface-DLxnCQOB.cjs → FindReplaceSurface-Dx0llWqP.cjs} +1 -1
- package/dist/chunks/{PasswordPromptSurface-DMbfDvpQ.cjs → PasswordPromptSurface-BUUVC2ee.cjs} +1 -1
- package/dist/chunks/{PdfViewer-CoFiGAhm.cjs → PdfViewer-qpvzwYMz.cjs} +1 -1
- package/dist/chunks/blank-docx-DP8RUPW-.cjs +7 -0
- package/dist/chunks/blank-docx-XRX6Ker2.es.js +2 -0
- package/dist/chunks/{create-super-doc-ui-fxF2Q8Ib.es.js → create-super-doc-ui-D4kk9AjM.es.js} +331 -102
- package/dist/chunks/{create-super-doc-ui-CXCqHc2m.cjs → create-super-doc-ui-DXdWuTzm.cjs} +331 -102
- package/dist/chunks/{eventemitter3-B60Fsz-a.es.js → eventemitter3-Bt2s0X0a.es.js} +1 -1
- package/dist/chunks/{eventemitter3-DCfwFVNn.cjs → eventemitter3-DqY4aSMf.cjs} +1 -1
- package/dist/chunks/{jszip-DzmwAHr3.es.js → jszip-C8srOKAO.es.js} +2 -2
- package/dist/chunks/{jszip-BdUBlUeG.cjs → jszip-Cs9JBLlJ.cjs} +13 -1
- package/dist/chunks/{rolldown-runtime-_dR15c8t.cjs → rolldown-runtime-1Y-nnZJ3.cjs} +0 -28
- package/dist/chunks/{rolldown-runtime-BJVcqBbz.es.js → rolldown-runtime-D7PMmH3s.es.js} +1 -17
- package/dist/collaboration-upgrade-engine.cjs +1 -1
- package/dist/collaboration-upgrade-engine.es.js +1 -1
- package/dist/document-api/src/comments/comment-create-attribution.d.ts +2 -0
- package/dist/document-api/src/comments/comments.d.ts +13 -4
- package/dist/document-api/src/comments/comments.types.d.ts +39 -0
- package/dist/document-api/src/content-controls/content-controls.types.d.ts +2 -0
- package/dist/document-api/src/contract/metadata-types.d.ts +18 -0
- package/dist/document-api/src/contract/operation-definitions.d.ts +1 -1
- package/dist/document-api/src/index.d.ts +2 -2
- package/dist/layout-engine/painters/dom/src/_test-utils.d.ts +3 -2
- package/dist/layout-engine/painters/dom/src/index.d.ts +24 -19
- package/dist/layout-engine/painters/dom/src/page-content.d.ts +107 -39
- package/dist/layout-engine/painters/dom/src/persistent-page-surface.d.ts +144 -0
- package/dist/layout-engine/painters/dom/src/pm-position-validation.d.ts +1 -1
- package/dist/layout-engine/painters/dom/src/renderer.d.ts +50 -106
- package/dist/layout-engine/painters/dom/src/sdt/boundaries.d.ts +1 -1
- package/dist/public/ui-react.cjs +2 -2
- package/dist/public/ui-react.es.js +1 -1
- package/dist/public/ui.cjs +1 -1
- package/dist/public/ui.es.js +1 -1
- package/dist/style.css +97 -90
- package/dist/style.layered.css +97 -90
- package/dist/superdoc/src/core/types/index.d.ts +258 -11
- package/dist/superdoc/src/helpers/floor.d.ts +1 -1
- package/dist/superdoc/src/helpers/v2-review-mutation-impact.d.ts +4 -0
- package/dist/superdoc/src/internal/toolbar/built-in/constants.d.ts +0 -1
- package/dist/superdoc/src/public/index.d.cts +6 -0
- package/dist/superdoc/src/public/index.d.ts +3 -0
- package/dist/superdoc/src/stores/comments-store.d.ts +34 -10
- package/dist/superdoc/src/stores/superdoc-store.d.ts +102 -30
- package/dist/superdoc.cjs +4581 -608
- package/dist/superdoc.es.js +4581 -612
- package/dist-cdn/style.layered.css +1 -1
- package/dist-cdn/superdoc.min.css +1 -1
- package/dist-cdn/superdoc.min.js +37 -37
- package/package.json +5 -4
- package/dist/chunks/blank-docx-CJAXnJKp.es.js +0 -2
- package/dist/chunks/blank-docx-DA-G-3VB.cjs +0 -7
|
@@ -5,9 +5,88 @@ import { DocumentFontOption, FontAssetUrlResolver, FontFamilyOption, FontLoadSum
|
|
|
5
5
|
import { SuperDoc as SuperDocClass } from '../SuperDoc.js';
|
|
6
6
|
import { SuperDocActiveEditorExtensions, SuperDocExtension } from '../extensions/index.js';
|
|
7
7
|
import { BrowserDocumentApi } from '../../public/browser-document-api.js';
|
|
8
|
+
import { CustomCommandContext } from '../../public/ui/types.js';
|
|
8
9
|
export type { DocumentFontOption, FontAssetUrlContext, FontAssetUrlResolver, FontFaceSlot, FontFamilyOption, FontLoadResult, FontLoadStatus, FontLoadSummary, FontResolutionReason, FontResolutionRecord, GlyphException, ResolvedFontEvidence, SubstitutePolicyAction, SubstituteVerdict, } from '../../../../shared/font-system/src/index.js';
|
|
9
10
|
export type SuperDoc = SuperDocClass;
|
|
10
11
|
export type { BrowserDocumentApi } from '../../public/browser-document-api.js';
|
|
12
|
+
/**
|
|
13
|
+
* A row in a custom dropdown's option list, and the value handed back to the
|
|
14
|
+
* `command` callback when one is chosen.
|
|
15
|
+
*
|
|
16
|
+
* `label` and `key` are what the toolbar reads: `handleSelect` uses `label` as
|
|
17
|
+
* the command argument (unless `dropdownValueKey` names another member) and
|
|
18
|
+
* `key` as the selection identity (`ButtonGroup.vue:167-169`).
|
|
19
|
+
*
|
|
20
|
+
* Both are optional here rather than required, because a `type: 'render'`
|
|
21
|
+
* entry is a custom-rendered row that the selection path explicitly skips
|
|
22
|
+
* (`ButtonGroup.vue:268`), so it carries neither. The index signature keeps
|
|
23
|
+
* the rest of the row open.
|
|
24
|
+
*/
|
|
25
|
+
export interface ToolbarDropdownOption {
|
|
26
|
+
/** Row text, and the default command argument when the row is chosen. */
|
|
27
|
+
label?: string;
|
|
28
|
+
/** Stable row identity, used for selection state. */
|
|
29
|
+
key?: string;
|
|
30
|
+
/** Attributes spread onto the rendered row. */
|
|
31
|
+
props?: Record<string, unknown>;
|
|
32
|
+
[key: string]: unknown;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The context a custom toolbar button's `command` callback receives.
|
|
36
|
+
*
|
|
37
|
+
* The runtime registers the callback as a custom command and invokes it with
|
|
38
|
+
* the controller's {@link CustomCommandContext} plus three toolbar-specific
|
|
39
|
+
* members (`built-in-toolbar.js:#prepareCustomButton`), so a consumer writing
|
|
40
|
+
* `({ execute, option }) => ...` gets both halves typed.
|
|
41
|
+
*
|
|
42
|
+
* `item` is deliberately `unknown`. It is the live Vue reactive object
|
|
43
|
+
* `useToolbarItem` returns — a bag of `ref`s whose shape is an implementation
|
|
44
|
+
* detail. Typing it would publish that internal and freeze it; see #1098 for
|
|
45
|
+
* the public toolbar-item contract that would replace it.
|
|
46
|
+
*/
|
|
47
|
+
export interface ToolbarCustomButtonContext extends CustomCommandContext {
|
|
48
|
+
/** The live toolbar item handle. Internal shape; see #1098. */
|
|
49
|
+
item: unknown;
|
|
50
|
+
/**
|
|
51
|
+
* The selected dropdown row, passed through verbatim, or `undefined` for a
|
|
52
|
+
* plain button that has no selection.
|
|
53
|
+
*/
|
|
54
|
+
option?: ToolbarDropdownOption;
|
|
55
|
+
/** Argument threaded through the command payload. */
|
|
56
|
+
argument?: unknown;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* A custom entry appended to the built-in toolbar's default item set.
|
|
60
|
+
*
|
|
61
|
+
* Intentionally loose. `name` and `command` are the two members the runtime
|
|
62
|
+
* contract already fixes, and the rest stays open because the public
|
|
63
|
+
* toolbar-item shape has not been decided yet (#1098).
|
|
64
|
+
*
|
|
65
|
+
* Tightening it further needs that contract first. `useToolbarItem` accepting
|
|
66
|
+
* a `type` only proves construction does not throw, not that the entry renders
|
|
67
|
+
* as a top-level toolbar item -- `options` has no render branch at all,
|
|
68
|
+
* `dropdown` needs rows and a trigger, and `overflow` draws only when the
|
|
69
|
+
* separately-built overflow list is non-empty, which `customButtons` cannot
|
|
70
|
+
* populate. Encoding those rules here would publish a contract on the strength
|
|
71
|
+
* of constructor behavior, and they need rendered-behavior tests rather than
|
|
72
|
+
* direct `useToolbarItem` construction to establish.
|
|
73
|
+
*/
|
|
74
|
+
export interface ToolbarCustomButton {
|
|
75
|
+
/** Unique item name. Also derives the registered command id. */
|
|
76
|
+
name: string;
|
|
77
|
+
/**
|
|
78
|
+
* What the entry does when activated. A function is registered as a custom
|
|
79
|
+
* command and invoked with {@link ToolbarCustomButtonContext}; a string is
|
|
80
|
+
* read as a canonical V2 command id and routed through the shared controller
|
|
81
|
+
* (`built-in-toolbar.js:948`).
|
|
82
|
+
*
|
|
83
|
+
* Optional because a separator has nothing to do. An actionable entry that
|
|
84
|
+
* omits it silently no-ops on click -- a real defect, but one this type
|
|
85
|
+
* cannot flag without the variant split that #1098 owns.
|
|
86
|
+
*/
|
|
87
|
+
command?: string | ((context: ToolbarCustomButtonContext) => unknown);
|
|
88
|
+
[key: string]: unknown;
|
|
89
|
+
}
|
|
11
90
|
export type V2AuthoringSelectionCollapse = 'start' | 'end' | null;
|
|
12
91
|
export type V2AuthoringResult = {
|
|
13
92
|
ok: true;
|
|
@@ -284,6 +363,47 @@ export interface FontFamilyConfig {
|
|
|
284
363
|
[key: string]: unknown;
|
|
285
364
|
}
|
|
286
365
|
export type FontConfig = FontFamilyConfig;
|
|
366
|
+
/**
|
|
367
|
+
* One row in the toolbar's font-family dropdown.
|
|
368
|
+
*
|
|
369
|
+
* Distinct from {@link FontFamilyConfig}, which describes a family to load and
|
|
370
|
+
* measure. This describes a row to render.
|
|
371
|
+
*
|
|
372
|
+
* `label` and `key` are both required because the toolbar has no fallback for
|
|
373
|
+
* either. `label` is the value applied to the selection
|
|
374
|
+
* (`emitFontCommand(option.label)`) and what active-state matching compares
|
|
375
|
+
* against (`fontOptions.find((i) => i.label === fontFamily)`); `key` is the
|
|
376
|
+
* selection identity and the rendered list key. An entry missing either one
|
|
377
|
+
* produces a blank row or an undefined command value rather than a
|
|
378
|
+
* degraded-but-working option.
|
|
379
|
+
*/
|
|
380
|
+
export interface ToolbarFontOption {
|
|
381
|
+
/**
|
|
382
|
+
* Logical family name. Rendered as the row's text, written to the selection
|
|
383
|
+
* when chosen, and compared against the current font for active state.
|
|
384
|
+
*/
|
|
385
|
+
label: string;
|
|
386
|
+
/** Stable option identity, used for selection state and the list key. */
|
|
387
|
+
key: string;
|
|
388
|
+
/**
|
|
389
|
+
* Attributes spread onto the rendered row, which is the only channel that
|
|
390
|
+
* reaches it: both renderers bind `option.props` and nothing else
|
|
391
|
+
* (`ToolbarComboBox.vue:559`, `ToolbarDropdown.vue:420`).
|
|
392
|
+
*
|
|
393
|
+
* `props.style.fontFamily` is the preview stack the row is drawn in;
|
|
394
|
+
* `normalizeFontOption` falls back to `label` then `key` when it is absent,
|
|
395
|
+
* so a row always previews in something. Weight and any other per-row style
|
|
396
|
+
* go here too — `props: { style: { fontWeight: 700 } }` renders, a top-level
|
|
397
|
+
* `fontWeight` does not.
|
|
398
|
+
*/
|
|
399
|
+
props?: {
|
|
400
|
+
style?: {
|
|
401
|
+
fontFamily?: string;
|
|
402
|
+
[key: string]: unknown;
|
|
403
|
+
};
|
|
404
|
+
[key: string]: unknown;
|
|
405
|
+
};
|
|
406
|
+
}
|
|
287
407
|
export interface FontsConfig {
|
|
288
408
|
bundled?: boolean | 'baseline' | 'full' | string[] | Record<string, unknown>;
|
|
289
409
|
families?: FontFamilyConfig[];
|
|
@@ -779,8 +899,24 @@ export interface ContextMenuItem {
|
|
|
779
899
|
icon?: string;
|
|
780
900
|
/** Custom Vue component to render this item. */
|
|
781
901
|
component?: unknown;
|
|
782
|
-
/**
|
|
902
|
+
/**
|
|
903
|
+
* Callback invoked when the item is clicked.
|
|
904
|
+
*
|
|
905
|
+
* @deprecated replaceWith=`onSelect` removeIn=v3.0 — V1 only. SuperDoc 2
|
|
906
|
+
* cannot invoke this: its first argument is a ProseMirror `Editor` the v2
|
|
907
|
+
* runtime does not have, and `ContextMenuContext` carries fields v2 does not
|
|
908
|
+
* expose. Items using it render and then do nothing when clicked, and the
|
|
909
|
+
* runtime warns once naming the replacement.
|
|
910
|
+
*/
|
|
783
911
|
action?: (editor: Editor, context: ContextMenuContext) => void;
|
|
912
|
+
/**
|
|
913
|
+
* Application-owned click handler. Runs after the menu dismisses.
|
|
914
|
+
*
|
|
915
|
+
* This is the supported way to attach a product action such as "copy the
|
|
916
|
+
* selection into our workflow"; the built-in `intent` union covers only what
|
|
917
|
+
* SuperDoc itself performs.
|
|
918
|
+
*/
|
|
919
|
+
onSelect?: (payload: ContextMenuSelectPayload) => void | Promise<void>;
|
|
784
920
|
/** Predicate controlling visibility. */
|
|
785
921
|
showWhen?: (context: ContextMenuContext) => boolean;
|
|
786
922
|
/** Custom renderer returning an HTML element. */
|
|
@@ -788,6 +924,66 @@ export interface ContextMenuItem {
|
|
|
788
924
|
/** Keyboard shortcut label displayed beside the item. */
|
|
789
925
|
shortcut?: string;
|
|
790
926
|
}
|
|
927
|
+
/** The menu context a `ContextMenuItem.onSelect` handler receives. */
|
|
928
|
+
export interface ContextMenuSelectContext {
|
|
929
|
+
/**
|
|
930
|
+
* Text selected when the menu opened. Empty when the caret was collapsed, and
|
|
931
|
+
* also empty when a worker-backed read had not settled by click time — await
|
|
932
|
+
* `selectedTextSettled` when accuracy matters more than the gesture.
|
|
933
|
+
*/
|
|
934
|
+
selectedText: string;
|
|
935
|
+
/**
|
|
936
|
+
* The settled selection text.
|
|
937
|
+
*
|
|
938
|
+
* The handler is invoked synchronously so it keeps the click's user
|
|
939
|
+
* activation, which gesture-gated APIs such as `navigator.clipboard.write`,
|
|
940
|
+
* `window.open`, and `showOpenFilePicker` require. Awaiting this resolves the
|
|
941
|
+
* accurate text but spends that activation, so reach for it only when the
|
|
942
|
+
* handler does not need a gesture. Resolves to `selectedText` when the read
|
|
943
|
+
* had already settled or failed.
|
|
944
|
+
*/
|
|
945
|
+
selectedTextSettled: Promise<string>;
|
|
946
|
+
hasSelection: boolean;
|
|
947
|
+
/** How the menu was opened. */
|
|
948
|
+
trigger: 'click' | 'slash';
|
|
949
|
+
isInTable: boolean;
|
|
950
|
+
isInList: boolean;
|
|
951
|
+
documentMode: 'editing' | 'suggesting' | 'viewing';
|
|
952
|
+
isEditable: boolean;
|
|
953
|
+
}
|
|
954
|
+
/** Repaint coordination handed alongside the Document API surface. */
|
|
955
|
+
export interface ContextMenuSelectReadiness {
|
|
956
|
+
/** Render epoch of the mounted surface, or null when not mounted. */
|
|
957
|
+
getRenderEpoch(): number | null;
|
|
958
|
+
/** Resolves once a mutation's scheduled repaint has settled. */
|
|
959
|
+
whenPainted(input?: {
|
|
960
|
+
txId?: string;
|
|
961
|
+
afterEpoch?: number | null;
|
|
962
|
+
}): Promise<{
|
|
963
|
+
renderEpoch: number | null;
|
|
964
|
+
}>;
|
|
965
|
+
}
|
|
966
|
+
/**
|
|
967
|
+
* What a `ContextMenuItem.onSelect` handler is given.
|
|
968
|
+
*
|
|
969
|
+
* `document` is the async Document API surface, and it is a result rather than
|
|
970
|
+
* a handle: it reports `available: false` with a reason before the document is
|
|
971
|
+
* ready, so a handler has to check before reaching for `doc`. It is not the
|
|
972
|
+
* ProseMirror `Editor` the deprecated `action` callback took, which the v2
|
|
973
|
+
* runtime does not have.
|
|
974
|
+
*/
|
|
975
|
+
export interface ContextMenuSelectPayload {
|
|
976
|
+
document: {
|
|
977
|
+
available: true;
|
|
978
|
+
doc: BrowserDocumentApi;
|
|
979
|
+
readiness: ContextMenuSelectReadiness;
|
|
980
|
+
} | {
|
|
981
|
+
available: false;
|
|
982
|
+
reason: string;
|
|
983
|
+
};
|
|
984
|
+
/** The context captured when the menu opened, not the live document state. */
|
|
985
|
+
context: ContextMenuSelectContext | null;
|
|
986
|
+
}
|
|
791
987
|
/** A section (group) of items in the context menu. */
|
|
792
988
|
export interface ContextMenuSection {
|
|
793
989
|
/** Unique identifier for the section. */
|
|
@@ -1675,18 +1871,31 @@ export interface Modules {
|
|
|
1675
1871
|
icons?: Record<string, unknown>;
|
|
1676
1872
|
/** Text/label overrides keyed by toolbar item id. Falls back to `Config.toolbarTexts`. */
|
|
1677
1873
|
texts?: Record<string, string>;
|
|
1678
|
-
/**
|
|
1679
|
-
|
|
1874
|
+
/**
|
|
1875
|
+
* Custom font list rendered in the font-family dropdown.
|
|
1876
|
+
*
|
|
1877
|
+
* AIDEV-NOTE: legacy-public - accepts {@link FontFamilyConfig} entries
|
|
1878
|
+
* alongside dropdown rows. This spelling was typed `FontConfig[]`,
|
|
1879
|
+
* whose index signature let `{ family, label, key }` compile and work,
|
|
1880
|
+
* so narrowing it to rows alone would break installs mid-2.x.
|
|
1881
|
+
* Replaced by `ui.toolbar.fonts`, which takes rows only.
|
|
1882
|
+
* Earliest removal: v3.0 (#853).
|
|
1883
|
+
*
|
|
1884
|
+
* The runtime uses the list verbatim and reads `label` and `key` off
|
|
1885
|
+
* each entry, so a `family`-only entry renders a blank row either way.
|
|
1886
|
+
*/
|
|
1887
|
+
fonts?: Array<FontConfig | ToolbarFontOption>;
|
|
1680
1888
|
/** Hide buttons that overflow the available width (default: true). */
|
|
1681
1889
|
hideButtons?: boolean;
|
|
1682
1890
|
/** Recompute the visible toolbar item set on container resize (default: false). */
|
|
1683
1891
|
responsiveToContainer?: boolean;
|
|
1684
1892
|
/**
|
|
1685
|
-
* Custom toolbar buttons appended to the default item set.
|
|
1686
|
-
*
|
|
1687
|
-
*
|
|
1688
|
-
*
|
|
1689
|
-
*
|
|
1893
|
+
* Custom toolbar buttons appended to the default item set.
|
|
1894
|
+
*
|
|
1895
|
+
* AIDEV-NOTE: legacy-public - stays an open record. This spelling was
|
|
1896
|
+
* typed `Array<Record<string, unknown>>`, so narrowing it now would
|
|
1897
|
+
* reject entries that compile and work today. Replaced by
|
|
1898
|
+
* `ui.toolbar.customButtons`. Earliest removal: v3.0 (#853).
|
|
1690
1899
|
*/
|
|
1691
1900
|
customButtons?: Array<Record<string, unknown>>;
|
|
1692
1901
|
/**
|
|
@@ -2161,7 +2370,7 @@ export interface SuperDocLayoutEngineOptions {
|
|
|
2161
2370
|
* @experimental Diagnostic posture, not a supported product mode and not a
|
|
2162
2371
|
* pipeline bypass: both settings route through the same canonical
|
|
2163
2372
|
* render-pipeline engine. `true` (default) paints an initial window and
|
|
2164
|
-
*
|
|
2373
|
+
* (the canonical initial-render and incremental engine
|
|
2165
2374
|
* passes); `false` makes EVERY mounted repaint wait for complete source
|
|
2166
2375
|
* coverage and materialize the full body before painting — not only the
|
|
2167
2376
|
* first paint — via the exact-complete engine pass, which can be much
|
|
@@ -2171,7 +2380,6 @@ export interface SuperDocLayoutEngineOptions {
|
|
|
2171
2380
|
* render-readiness diagnostic. The render surface has no independent
|
|
2172
2381
|
* first-paint timeout; callers and harnesses must provide their own.
|
|
2173
2382
|
*/
|
|
2174
|
-
progressiveBodyStreaming?: boolean;
|
|
2175
2383
|
/**
|
|
2176
2384
|
* P6a: per-paint work-counter HUD (console table +
|
|
2177
2385
|
* `data-v2-paint-hud-recent`) and the dark reuse-collapse tripwire for the
|
|
@@ -2411,13 +2619,44 @@ export interface UIConfig {
|
|
|
2411
2619
|
icons?: Record<string, unknown>;
|
|
2412
2620
|
/** Text overrides, merged over the built-in set. */
|
|
2413
2621
|
texts?: Record<string, unknown>;
|
|
2622
|
+
/**
|
|
2623
|
+
* Hide buttons that overflow the available width (default: true).
|
|
2624
|
+
*
|
|
2625
|
+
* The runtime has always honored this through the toolbar options
|
|
2626
|
+
* pass-through; it was only missing from this type, so passing it here
|
|
2627
|
+
* failed excess-property checks while working at runtime.
|
|
2628
|
+
*/
|
|
2629
|
+
hideButtons?: boolean;
|
|
2414
2630
|
/** Size the toolbar to its container rather than the viewport. */
|
|
2415
2631
|
responsiveToContainer?: boolean;
|
|
2632
|
+
/**
|
|
2633
|
+
* Custom font list rendered in the font-family dropdown. The runtime
|
|
2634
|
+
* uses this list verbatim, so entries are dropdown rows
|
|
2635
|
+
* ({@link ToolbarFontOption}), not families to load
|
|
2636
|
+
* ({@link FontFamilyConfig}). Register loadable families through
|
|
2637
|
+
* `fonts.families` instead.
|
|
2638
|
+
*/
|
|
2639
|
+
fonts?: ToolbarFontOption[];
|
|
2640
|
+
/**
|
|
2641
|
+
* Custom toolbar buttons appended to the default item set.
|
|
2642
|
+
*
|
|
2643
|
+
* `name` and the `command` callback are typed; the rest of the
|
|
2644
|
+
* `ToolbarItem` shape stays open because it is not yet public (#1098).
|
|
2645
|
+
*/
|
|
2646
|
+
customButtons?: ToolbarCustomButton[];
|
|
2647
|
+
/**
|
|
2648
|
+
* Show the formatting marks (pilcrow) button in the toolbar. Off by
|
|
2649
|
+
* default. Distinct from `layoutEngineOptions.showFormattingMarks`, which
|
|
2650
|
+
* controls whether the marks render in the document.
|
|
2651
|
+
*/
|
|
2652
|
+
showFormattingMarksButton?: boolean;
|
|
2653
|
+
/** Show the table of contents insert button in the toolbar. Off by default. */
|
|
2654
|
+
showTableOfContentsButton?: boolean;
|
|
2416
2655
|
};
|
|
2417
2656
|
/** Built-in comments UI. Enabled by default. */
|
|
2418
2657
|
comments?: boolean | Record<string, unknown>;
|
|
2419
2658
|
/** Built-in right-click and slash context menu. Enabled by default. */
|
|
2420
|
-
contextMenu?: boolean |
|
|
2659
|
+
contextMenu?: boolean | ContextMenuConfig;
|
|
2421
2660
|
/**
|
|
2422
2661
|
* Built-in find/replace surface. Disabled by default. Enabling it lets
|
|
2423
2662
|
* SuperDoc intercept Cmd+F / Ctrl+F; `editor.ui.search` stays available to
|
|
@@ -2783,6 +3022,14 @@ export interface Config {
|
|
|
2783
3022
|
lockedBy?: User;
|
|
2784
3023
|
/** Whether to show the ruler in the editor. */
|
|
2785
3024
|
rulers?: boolean;
|
|
3025
|
+
/**
|
|
3026
|
+
* Element or selector the ruler mounts into. Omit to render it inline above
|
|
3027
|
+
* the editor.
|
|
3028
|
+
*
|
|
3029
|
+
* @deprecated replaceWith=`ui.ruler.container` removeIn=v3.0 — the runtime
|
|
3030
|
+
* still honors it, and the canonical value wins when both are set.
|
|
3031
|
+
*/
|
|
3032
|
+
rulerContainer?: string | HTMLElement;
|
|
2786
3033
|
/** Whether to suppress default styles in docx mode. */
|
|
2787
3034
|
suppressDefaultDocxStyles?: boolean;
|
|
2788
3035
|
/** Provided JSON to override content with. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export function floor(val:
|
|
1
|
+
export function floor(val: number, precision?: number): number;
|
|
@@ -17,6 +17,9 @@ import type { ContextMenuConfig as __Cjs_ContextMenuConfig } from './index.js' w
|
|
|
17
17
|
import type { ContextMenuContext as __Cjs_ContextMenuContext } from './index.js' with { "resolution-mode": "import" };
|
|
18
18
|
import type { ContextMenuItem as __Cjs_ContextMenuItem } from './index.js' with { "resolution-mode": "import" };
|
|
19
19
|
import type { ContextMenuSection as __Cjs_ContextMenuSection } from './index.js' with { "resolution-mode": "import" };
|
|
20
|
+
import type { ContextMenuSelectContext as __Cjs_ContextMenuSelectContext } from './index.js' with { "resolution-mode": "import" };
|
|
21
|
+
import type { ContextMenuSelectPayload as __Cjs_ContextMenuSelectPayload } from './index.js' with { "resolution-mode": "import" };
|
|
22
|
+
import type { ContextMenuSelectReadiness as __Cjs_ContextMenuSelectReadiness } from './index.js' with { "resolution-mode": "import" };
|
|
20
23
|
import type { DirectSurfaceRequest as __Cjs_DirectSurfaceRequest } from './index.js' with { "resolution-mode": "import" };
|
|
21
24
|
import type { DocRange as __Cjs_DocRange } from './index.js' with { "resolution-mode": "import" };
|
|
22
25
|
import type { Document as __Cjs_Document } from './index.js' with { "resolution-mode": "import" };
|
|
@@ -194,6 +197,9 @@ export type { __Cjs_ContextMenuConfig as ContextMenuConfig };
|
|
|
194
197
|
export type { __Cjs_ContextMenuContext as ContextMenuContext };
|
|
195
198
|
export type { __Cjs_ContextMenuItem as ContextMenuItem };
|
|
196
199
|
export type { __Cjs_ContextMenuSection as ContextMenuSection };
|
|
200
|
+
export type { __Cjs_ContextMenuSelectContext as ContextMenuSelectContext };
|
|
201
|
+
export type { __Cjs_ContextMenuSelectPayload as ContextMenuSelectPayload };
|
|
202
|
+
export type { __Cjs_ContextMenuSelectReadiness as ContextMenuSelectReadiness };
|
|
197
203
|
export declare const createTheme: typeof import('./index.js', { with: { "resolution-mode": "import" } }).createTheme;
|
|
198
204
|
export declare const defineSuperDocExtension: typeof import('./index.js', { with: { "resolution-mode": "import" } }).defineSuperDocExtension;
|
|
199
205
|
export type { __Cjs_DirectSurfaceRequest as DirectSurfaceRequest };
|
|
@@ -176,4 +176,7 @@ export type { ContextMenuConfig } from '../core/types/index.js';
|
|
|
176
176
|
export type { ContextMenuContext } from '../core/types/index.js';
|
|
177
177
|
export type { ContextMenuItem } from '../core/types/index.js';
|
|
178
178
|
export type { ContextMenuSection } from '../core/types/index.js';
|
|
179
|
+
export type { ContextMenuSelectContext } from '../core/types/index.js';
|
|
180
|
+
export type { ContextMenuSelectPayload } from '../core/types/index.js';
|
|
181
|
+
export type { ContextMenuSelectReadiness } from '../core/types/index.js';
|
|
179
182
|
export type { FindReplaceConfig } from '../core/types/index.js';
|
|
@@ -152,7 +152,10 @@ export const useCommentsStore: import('pinia').StoreDefinition<"comments", Pick<
|
|
|
152
152
|
replacedFile?: boolean | undefined;
|
|
153
153
|
}) => void;
|
|
154
154
|
translateCommentsForExport: () => any[];
|
|
155
|
-
handleEditorLocationsUpdate: (allCommentPositions:
|
|
155
|
+
handleEditorLocationsUpdate: (allCommentPositions: Object, options?: {
|
|
156
|
+
retainMissingTrackedChangeGeometry?: boolean;
|
|
157
|
+
retainedTrackedChangeIds?: Iterable<string>;
|
|
158
|
+
}) => void;
|
|
156
159
|
clearEditorCommentPositions: () => void;
|
|
157
160
|
handleTrackedChangeUpdate: ({ superdoc, params, broadcastChanges, documentState }: {
|
|
158
161
|
superdoc: Object;
|
|
@@ -183,7 +186,10 @@ export const useCommentsStore: import('pinia').StoreDefinition<"comments", Pick<
|
|
|
183
186
|
setV2CommentsAdapter: (adapter: any) => void;
|
|
184
187
|
getV2CommentsAdapter: (superdoc: any) => any;
|
|
185
188
|
hydrateCommentsFromV2: ({ superdoc, adapter, documentId }?: {}) => Promise<any>;
|
|
186
|
-
|
|
189
|
+
applyReviewSnapshotFromV2: ({ superdoc, commentsAdapter, trackedChangesAdapter, documentId, commentItems, trackedChangeItems, trackedList, patch, }?: {}) => any;
|
|
190
|
+
reconcileCommentsFromV2: ({ superdoc, adapter, documentId, items, preparedInputs }?: {
|
|
191
|
+
preparedInputs?: null | undefined;
|
|
192
|
+
}) => any;
|
|
187
193
|
isV2EditorActive: (superdoc: any) => boolean;
|
|
188
194
|
replyCommentV2: ({ superdoc, parentCommentId, text }?: {}) => Promise<any>;
|
|
189
195
|
editCommentV2: ({ superdoc, commentId, text }?: {}) => Promise<any>;
|
|
@@ -220,9 +226,11 @@ export const useCommentsStore: import('pinia').StoreDefinition<"comments", Pick<
|
|
|
220
226
|
failures: any[];
|
|
221
227
|
reason?: undefined;
|
|
222
228
|
}>;
|
|
223
|
-
reconcileTrackedChangesFromV2: ({ superdoc, adapter, documentId, items, pruneStale }?: {
|
|
229
|
+
reconcileTrackedChangesFromV2: ({ superdoc, adapter, documentId, items, pruneStale, preparedParams, }?: {
|
|
224
230
|
pruneStale?: boolean | undefined;
|
|
231
|
+
preparedParams?: null | undefined;
|
|
225
232
|
}) => any;
|
|
233
|
+
remapTrackedChangeIdentities: (pairs?: any[], { documentId }?: {}) => void;
|
|
226
234
|
}, "suppressInternalExternal" | "activeComment" | "activeFloatingCommentInstanceId" | "floatingCommentsOffset" | "pendingComment" | "currentCommentText" | "isDebugging" | "editingCommentId" | "editorCommentPositions" | "isCommentHighlighted" | "v2CommentsAdapter" | "COMMENT_EVENTS" | "hasInitializedComments" | "hasSyncedCollaborationComments" | "commentDialogs" | "overlappingComments" | "overlappedIds" | "commentsList" | "isCommentsListVisible" | "generalCommentIds" | "editorCommentIds" | "commentsParentElement" | "hasInitializedLocations" | "sortedConversations" | "visibleConversations" | "skipSelectionUpdate" | "isFloatingCommentsReady" | "instantSidebarAlignmentTargetY" | "instantSidebarAlignmentThreadId" | "instantSidebarAlignmentInstanceId" | "viewingVisibility" | "v2TrackedChangesAdapter">, Pick<{
|
|
227
235
|
COMMENT_EVENTS: {
|
|
228
236
|
readonly RESOLVED: "resolved";
|
|
@@ -377,7 +385,10 @@ export const useCommentsStore: import('pinia').StoreDefinition<"comments", Pick<
|
|
|
377
385
|
replacedFile?: boolean | undefined;
|
|
378
386
|
}) => void;
|
|
379
387
|
translateCommentsForExport: () => any[];
|
|
380
|
-
handleEditorLocationsUpdate: (allCommentPositions:
|
|
388
|
+
handleEditorLocationsUpdate: (allCommentPositions: Object, options?: {
|
|
389
|
+
retainMissingTrackedChangeGeometry?: boolean;
|
|
390
|
+
retainedTrackedChangeIds?: Iterable<string>;
|
|
391
|
+
}) => void;
|
|
381
392
|
clearEditorCommentPositions: () => void;
|
|
382
393
|
handleTrackedChangeUpdate: ({ superdoc, params, broadcastChanges, documentState }: {
|
|
383
394
|
superdoc: Object;
|
|
@@ -408,7 +419,10 @@ export const useCommentsStore: import('pinia').StoreDefinition<"comments", Pick<
|
|
|
408
419
|
setV2CommentsAdapter: (adapter: any) => void;
|
|
409
420
|
getV2CommentsAdapter: (superdoc: any) => any;
|
|
410
421
|
hydrateCommentsFromV2: ({ superdoc, adapter, documentId }?: {}) => Promise<any>;
|
|
411
|
-
|
|
422
|
+
applyReviewSnapshotFromV2: ({ superdoc, commentsAdapter, trackedChangesAdapter, documentId, commentItems, trackedChangeItems, trackedList, patch, }?: {}) => any;
|
|
423
|
+
reconcileCommentsFromV2: ({ superdoc, adapter, documentId, items, preparedInputs }?: {
|
|
424
|
+
preparedInputs?: null | undefined;
|
|
425
|
+
}) => any;
|
|
412
426
|
isV2EditorActive: (superdoc: any) => boolean;
|
|
413
427
|
replyCommentV2: ({ superdoc, parentCommentId, text }?: {}) => Promise<any>;
|
|
414
428
|
editCommentV2: ({ superdoc, commentId, text }?: {}) => Promise<any>;
|
|
@@ -445,9 +459,11 @@ export const useCommentsStore: import('pinia').StoreDefinition<"comments", Pick<
|
|
|
445
459
|
failures: any[];
|
|
446
460
|
reason?: undefined;
|
|
447
461
|
}>;
|
|
448
|
-
reconcileTrackedChangesFromV2: ({ superdoc, adapter, documentId, items, pruneStale }?: {
|
|
462
|
+
reconcileTrackedChangesFromV2: ({ superdoc, adapter, documentId, items, pruneStale, preparedParams, }?: {
|
|
449
463
|
pruneStale?: boolean | undefined;
|
|
464
|
+
preparedParams?: null | undefined;
|
|
450
465
|
}) => any;
|
|
466
|
+
remapTrackedChangeIdentities: (pairs?: any[], { documentId }?: {}) => void;
|
|
451
467
|
}, "getConfig" | "documentsWithConverations" | "getGroupedComments" | "hasOpenTrackedChanges" | "getCommentsByPosition" | "getFloatingComments" | "getFloatingCommentInstances" | "isViewingMode" | "shouldRenderReviewInViewing">, Pick<{
|
|
452
468
|
COMMENT_EVENTS: {
|
|
453
469
|
readonly RESOLVED: "resolved";
|
|
@@ -602,7 +618,10 @@ export const useCommentsStore: import('pinia').StoreDefinition<"comments", Pick<
|
|
|
602
618
|
replacedFile?: boolean | undefined;
|
|
603
619
|
}) => void;
|
|
604
620
|
translateCommentsForExport: () => any[];
|
|
605
|
-
handleEditorLocationsUpdate: (allCommentPositions:
|
|
621
|
+
handleEditorLocationsUpdate: (allCommentPositions: Object, options?: {
|
|
622
|
+
retainMissingTrackedChangeGeometry?: boolean;
|
|
623
|
+
retainedTrackedChangeIds?: Iterable<string>;
|
|
624
|
+
}) => void;
|
|
606
625
|
clearEditorCommentPositions: () => void;
|
|
607
626
|
handleTrackedChangeUpdate: ({ superdoc, params, broadcastChanges, documentState }: {
|
|
608
627
|
superdoc: Object;
|
|
@@ -633,7 +652,10 @@ export const useCommentsStore: import('pinia').StoreDefinition<"comments", Pick<
|
|
|
633
652
|
setV2CommentsAdapter: (adapter: any) => void;
|
|
634
653
|
getV2CommentsAdapter: (superdoc: any) => any;
|
|
635
654
|
hydrateCommentsFromV2: ({ superdoc, adapter, documentId }?: {}) => Promise<any>;
|
|
636
|
-
|
|
655
|
+
applyReviewSnapshotFromV2: ({ superdoc, commentsAdapter, trackedChangesAdapter, documentId, commentItems, trackedChangeItems, trackedList, patch, }?: {}) => any;
|
|
656
|
+
reconcileCommentsFromV2: ({ superdoc, adapter, documentId, items, preparedInputs }?: {
|
|
657
|
+
preparedInputs?: null | undefined;
|
|
658
|
+
}) => any;
|
|
637
659
|
isV2EditorActive: (superdoc: any) => boolean;
|
|
638
660
|
replyCommentV2: ({ superdoc, parentCommentId, text }?: {}) => Promise<any>;
|
|
639
661
|
editCommentV2: ({ superdoc, commentId, text }?: {}) => Promise<any>;
|
|
@@ -670,7 +692,9 @@ export const useCommentsStore: import('pinia').StoreDefinition<"comments", Pick<
|
|
|
670
692
|
failures: any[];
|
|
671
693
|
reason?: undefined;
|
|
672
694
|
}>;
|
|
673
|
-
reconcileTrackedChangesFromV2: ({ superdoc, adapter, documentId, items, pruneStale }?: {
|
|
695
|
+
reconcileTrackedChangesFromV2: ({ superdoc, adapter, documentId, items, pruneStale, preparedParams, }?: {
|
|
674
696
|
pruneStale?: boolean | undefined;
|
|
697
|
+
preparedParams?: null | undefined;
|
|
675
698
|
}) => any;
|
|
676
|
-
|
|
699
|
+
remapTrackedChangeIdentities: (pairs?: any[], { documentId }?: {}) => void;
|
|
700
|
+
}, "getCommentAliasIds" | "getTrackedChangeThread" | "getCommentPositionKey" | "getCommentPosition" | "getCommentAnchoredText" | "getCommentAnchorData" | "resolveCommentPositionEntry" | "getCommentDocumentId" | "belongsToDocument" | "init" | "setViewingVisibility" | "getComment" | "setActiveComment" | "getCommentLocation" | "hasOverlapId" | "getPendingComment" | "showAddComment" | "addComment" | "addHydratedComment" | "cancelComment" | "deleteComment" | "removePendingComment" | "cancelImportedTrackedChangeBootstrap" | "removeCommentsForDocument" | "processLoadedDocxComments" | "translateCommentsForExport" | "handleEditorLocationsUpdate" | "clearEditorCommentPositions" | "handleTrackedChangeUpdate" | "refreshTrackedChangeCommentsByIds" | "syncResolvedCommentsWithDocument" | "syncTrackedChangePositionsWithDocument" | "setActiveFloatingCommentInstance" | "requestInstantSidebarAlignment" | "peekInstantSidebarAlignment" | "clearInstantSidebarAlignment" | "syncTrackedChangeComments" | "decideTrackedChangeFromSidebar" | "setV2CommentsAdapter" | "getV2CommentsAdapter" | "hydrateCommentsFromV2" | "applyReviewSnapshotFromV2" | "reconcileCommentsFromV2" | "isV2EditorActive" | "replyCommentV2" | "editCommentV2" | "resolveCommentV2" | "reopenCommentV2" | "setV2TrackedChangesAdapter" | "getV2TrackedChangesAdapter" | "hydrateTrackedChangesFromV2" | "reconcileTrackedChangeMutationFromV2" | "reconcileTrackedChangesFromV2" | "remapTrackedChangeIdentities">>;
|