superdoc 2.3.0 → 2.4.0-next.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (63) hide show
  1. package/README.md +0 -1
  2. package/dist/chunks/{FindReplaceSurface-DLxnCQOB.cjs → FindReplaceSurface-9VkPw_-X.cjs} +3 -4
  3. package/dist/chunks/{FindReplaceSurface-BEW-1NhM.es.js → FindReplaceSurface-BuvaIrQ5.es.js} +2 -3
  4. package/dist/chunks/{PasswordPromptSurface-DMbfDvpQ.cjs → PasswordPromptSurface-Bu5xHm91.cjs} +2 -2
  5. package/dist/chunks/{PasswordPromptSurface-BA6HHqEa.es.js → PasswordPromptSurface-Bz9_sKhX.es.js} +1 -1
  6. package/dist/chunks/{PdfViewer-CNOtyS-I.es.js → PdfViewer-CdVGB6Fe.es.js} +2 -2
  7. package/dist/chunks/{PdfViewer-CoFiGAhm.cjs → PdfViewer-D4eD2dV1.cjs} +3 -3
  8. package/dist/chunks/blank-docx-DP8RUPW-.cjs +7 -0
  9. package/dist/chunks/blank-docx-XRX6Ker2.es.js +2 -0
  10. package/dist/chunks/{create-super-doc-ui-CXCqHc2m.cjs → create-super-doc-ui-ByvmsAAG.cjs} +672 -190
  11. package/dist/chunks/{create-super-doc-ui-fxF2Q8Ib.es.js → create-super-doc-ui-DBXOhHdW.es.js} +667 -191
  12. package/dist/chunks/{eventemitter3-B60Fsz-a.es.js → eventemitter3-Bt2s0X0a.es.js} +1 -1
  13. package/dist/chunks/{eventemitter3-DCfwFVNn.cjs → eventemitter3-DqY4aSMf.cjs} +1 -1
  14. package/dist/chunks/{jszip-DzmwAHr3.es.js → jszip-C8srOKAO.es.js} +2 -2
  15. package/dist/chunks/{jszip-BdUBlUeG.cjs → jszip-Cs9JBLlJ.cjs} +13 -1
  16. package/dist/chunks/{rolldown-runtime-_dR15c8t.cjs → rolldown-runtime-1Y-nnZJ3.cjs} +0 -28
  17. package/dist/chunks/{rolldown-runtime-BJVcqBbz.es.js → rolldown-runtime-D7PMmH3s.es.js} +1 -17
  18. package/dist/collaboration-upgrade-engine.cjs +1 -1
  19. package/dist/collaboration-upgrade-engine.es.js +1 -1
  20. package/dist/document-api/src/comments/comment-create-attribution.d.ts +2 -0
  21. package/dist/document-api/src/comments/comments.d.ts +13 -4
  22. package/dist/document-api/src/comments/comments.types.d.ts +39 -0
  23. package/dist/document-api/src/content-controls/content-controls.types.d.ts +2 -0
  24. package/dist/document-api/src/contract/metadata-types.d.ts +18 -0
  25. package/dist/document-api/src/contract/operation-definitions.d.ts +1 -1
  26. package/dist/document-api/src/index.d.ts +2 -2
  27. package/dist/document-api/src/types/track-changes.types.d.ts +1 -3
  28. package/dist/layout-engine/painters/dom/src/_test-utils.d.ts +3 -2
  29. package/dist/layout-engine/painters/dom/src/index.d.ts +24 -19
  30. package/dist/layout-engine/painters/dom/src/page-content.d.ts +107 -39
  31. package/dist/layout-engine/painters/dom/src/persistent-page-surface.d.ts +144 -0
  32. package/dist/layout-engine/painters/dom/src/pm-position-validation.d.ts +1 -1
  33. package/dist/layout-engine/painters/dom/src/renderer.d.ts +50 -106
  34. package/dist/layout-engine/painters/dom/src/sdt/boundaries.d.ts +1 -1
  35. package/dist/public/ui-react.cjs +2 -2
  36. package/dist/public/ui-react.es.js +1 -1
  37. package/dist/public/ui.cjs +1 -1
  38. package/dist/public/ui.es.js +1 -1
  39. package/dist/style.css +138 -131
  40. package/dist/style.layered.css +138 -131
  41. package/dist/superdoc/src/core/types/index.d.ts +383 -16
  42. package/dist/superdoc/src/helpers/floor.d.ts +1 -1
  43. package/dist/superdoc/src/helpers/v2-review-mutation-impact.d.ts +5 -0
  44. package/dist/superdoc/src/helpers/v2-review-mutation-reconciler.d.ts +1 -1
  45. package/dist/superdoc/src/internal/toolbar/built-in/constants.d.ts +0 -1
  46. package/dist/superdoc/src/internal/toolbar/compatibility-catalog.d.ts +1 -1
  47. package/dist/superdoc/src/public/index.d.cts +14 -0
  48. package/dist/superdoc/src/public/index.d.ts +7 -0
  49. package/dist/superdoc/src/public/ui/types.d.ts +25 -1
  50. package/dist/superdoc/src/stores/comments-store.d.ts +124 -22
  51. package/dist/superdoc/src/stores/superdoc-store.d.ts +372 -66
  52. package/dist/superdoc.cjs +5160 -668
  53. package/dist/superdoc.es.js +5163 -675
  54. package/dist-cdn/style.layered.css +1 -1
  55. package/dist-cdn/superdoc.min.css +1 -1
  56. package/dist-cdn/superdoc.min.js +37 -37
  57. package/package.json +5 -4
  58. package/dist/chunks/blank-docx-CJAXnJKp.es.js +0 -2
  59. package/dist/chunks/blank-docx-DA-G-3VB.cjs +0 -7
  60. /package/dist/chunks/{_plugin-vue_export-helper-BTwbGDKw.cjs → _plugin-vue_export-helper-CZ1Nl59K.cjs} +0 -0
  61. /package/dist/chunks/{_plugin-vue_export-helper-CInC0bKI.es.js → _plugin-vue_export-helper-DSMAhhwD.es.js} +0 -0
  62. /package/dist/chunks/{constants-CY3R3_kF.es.js → constants-BfH0br5u.es.js} +0 -0
  63. /package/dist/chunks/{constants-sbCZ2O_A.cjs → constants-D7TNtyJd.cjs} +0 -0
@@ -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[];
@@ -723,6 +843,111 @@ export type LinkPopoverResolution = {
723
843
  * default popover.
724
844
  */
725
845
  export type LinkPopoverResolver = (ctx: LinkPopoverContext) => LinkPopoverResolution | null | undefined;
846
+ /**
847
+ * Canonical presentation settings for the built-in comments UI.
848
+ *
849
+ * Presentation only, and deliberately not the whole of `modules.comments`.
850
+ * That block also carries `readOnly` and `allowResolve`, which resolve through
851
+ * `interaction.comments`, and `permissionResolver`, which is read off
852
+ * `modules.comments` or the top-level `Config`. All three are stripped from
853
+ * this bag: policy outlives the built-in UI, so an application drawing its own
854
+ * comment surface still has to honor it. See the fields themselves, which are
855
+ * rejected by name with the spelling that applies to each.
856
+ *
857
+ * Open on purpose, for the same reason `modules.comments` is: the runtime
858
+ * merges this bag over that block and spreads the result through the comments
859
+ * store, which accepts pass-through keys. Closing it would reject working
860
+ * configurations, which is a worse failure than the missing autocomplete it
861
+ * would buy. The named fields are the ones the shell reads.
862
+ */
863
+ export type CommentsConfig = {
864
+ /** How comments present themselves as the surface narrows. */
865
+ displayMode?: 'auto' | 'sidebar' | 'inline';
866
+ /** CSS selector for an explicit width measurement target in `auto` mode. */
867
+ compactMeasurementSelector?: string;
868
+ /** Fixed compact-mode breakpoint override, in pixels. */
869
+ compactBreakpointPx?: number;
870
+ /** Comment highlight colors (internal/external and active overrides). */
871
+ highlightColors?: {
872
+ /** Base highlight color for internal comments. */
873
+ internal?: string;
874
+ /** Base highlight color for external comments. */
875
+ external?: string;
876
+ /** Active highlight color override for internal comments. */
877
+ activeInternal?: string;
878
+ /** Active highlight color override for external comments. */
879
+ activeExternal?: string;
880
+ };
881
+ /** Comment highlight opacity, active and inactive. */
882
+ highlightOpacity?: {
883
+ /** Opacity for the active comment highlight. */
884
+ active?: number;
885
+ /** Opacity for inactive comment highlights. */
886
+ inactive?: number;
887
+ };
888
+ /** Highlight color used while hovering a comment. */
889
+ highlightHoverColor?: string;
890
+ /** Tracked-change highlight colors. */
891
+ trackChangeHighlightColors?: TrackChangeHighlightColors;
892
+ /** Active tracked-change highlight colors (defaults to the above). */
893
+ trackChangeActiveHighlightColors?: TrackChangeHighlightColors;
894
+ /**
895
+ * Policy, not presentation. `normalizeUiConfig` strips all three from this
896
+ * bag before anything reads it, so accepting them here would advertise a
897
+ * setting that is silently discarded.
898
+ *
899
+ * `readOnly` and `allowResolve` belong on `interaction.comments`, where they
900
+ * resolve and keep applying to an application drawing its own comment
901
+ * surface.
902
+ *
903
+ * `permissionResolver` is collaboration wiring rather than policy, and has
904
+ * no `ui` spelling at all. `pickResolver` takes the first of
905
+ * `modules.comments.permissionResolver` and the top-level
906
+ * `Config.permissionResolver`, in that order, so either works and the
907
+ * comments-scoped one wins.
908
+ */
909
+ readOnly?: never;
910
+ allowResolve?: never;
911
+ permissionResolver?: never;
912
+ } & Record<string, unknown>;
913
+ /** Border and background colors for one tracked-change highlight state. */
914
+ export interface TrackChangeHighlightColors {
915
+ /** Border color for inserted text. */
916
+ insertBorder?: string;
917
+ /** Background color for inserted text. */
918
+ insertBackground?: string;
919
+ /** Border color for deleted text. */
920
+ deleteBorder?: string;
921
+ /** Background color for deleted text. */
922
+ deleteBackground?: string;
923
+ /** Border color for a format change. */
924
+ formatBorder?: string;
925
+ }
926
+ /**
927
+ * Canonical configuration for the chrome drawn around content controls.
928
+ *
929
+ * `chrome` is the whole option bag this surface has. `'default'` and `'none'`
930
+ * are the only values the painter and the v2 host accept; anything else is
931
+ * coerced back to `'default'`.
932
+ */
933
+ export interface ContentControlsConfig {
934
+ /** Whether SuperDoc draws its own chrome around each content control. */
935
+ chrome?: 'default' | 'none';
936
+ }
937
+ /**
938
+ * Canonical configuration for the built-in link popover.
939
+ *
940
+ * `popoverResolver` supersedes `modules.links.popoverResolver`, which stays
941
+ * supported for all of v2. Setting both keeps the canonical one; the legacy
942
+ * spelling only applies when the canonical one is absent.
943
+ */
944
+ export interface LinkPopoverConfig {
945
+ /**
946
+ * Called when a user clicks a link, to decide which popover to show.
947
+ * Returning `null` or `undefined` falls back to the built-in popover.
948
+ */
949
+ popoverResolver?: LinkPopoverResolver;
950
+ }
726
951
  /** Context object passed to context menu callbacks (showWhen, render, action, menuProvider). */
727
952
  export interface ContextMenuContext {
728
953
  /** The editor instance. */
@@ -779,8 +1004,24 @@ export interface ContextMenuItem {
779
1004
  icon?: string;
780
1005
  /** Custom Vue component to render this item. */
781
1006
  component?: unknown;
782
- /** Callback invoked when the item is clicked. */
1007
+ /**
1008
+ * Callback invoked when the item is clicked.
1009
+ *
1010
+ * @deprecated replaceWith=`onSelect` removeIn=v3.0 — V1 only. SuperDoc 2
1011
+ * cannot invoke this: its first argument is a ProseMirror `Editor` the v2
1012
+ * runtime does not have, and `ContextMenuContext` carries fields v2 does not
1013
+ * expose. Items using it render and then do nothing when clicked, and the
1014
+ * runtime warns once naming the replacement.
1015
+ */
783
1016
  action?: (editor: Editor, context: ContextMenuContext) => void;
1017
+ /**
1018
+ * Application-owned click handler. Runs after the menu dismisses.
1019
+ *
1020
+ * This is the supported way to attach a product action such as "copy the
1021
+ * selection into our workflow"; the built-in `intent` union covers only what
1022
+ * SuperDoc itself performs.
1023
+ */
1024
+ onSelect?: (payload: ContextMenuSelectPayload) => void | Promise<void>;
784
1025
  /** Predicate controlling visibility. */
785
1026
  showWhen?: (context: ContextMenuContext) => boolean;
786
1027
  /** Custom renderer returning an HTML element. */
@@ -788,6 +1029,66 @@ export interface ContextMenuItem {
788
1029
  /** Keyboard shortcut label displayed beside the item. */
789
1030
  shortcut?: string;
790
1031
  }
1032
+ /** The menu context a `ContextMenuItem.onSelect` handler receives. */
1033
+ export interface ContextMenuSelectContext {
1034
+ /**
1035
+ * Text selected when the menu opened. Empty when the caret was collapsed, and
1036
+ * also empty when a worker-backed read had not settled by click time — await
1037
+ * `selectedTextSettled` when accuracy matters more than the gesture.
1038
+ */
1039
+ selectedText: string;
1040
+ /**
1041
+ * The settled selection text.
1042
+ *
1043
+ * The handler is invoked synchronously so it keeps the click's user
1044
+ * activation, which gesture-gated APIs such as `navigator.clipboard.write`,
1045
+ * `window.open`, and `showOpenFilePicker` require. Awaiting this resolves the
1046
+ * accurate text but spends that activation, so reach for it only when the
1047
+ * handler does not need a gesture. Resolves to `selectedText` when the read
1048
+ * had already settled or failed.
1049
+ */
1050
+ selectedTextSettled: Promise<string>;
1051
+ hasSelection: boolean;
1052
+ /** How the menu was opened. */
1053
+ trigger: 'click' | 'slash';
1054
+ isInTable: boolean;
1055
+ isInList: boolean;
1056
+ documentMode: 'editing' | 'suggesting' | 'viewing';
1057
+ isEditable: boolean;
1058
+ }
1059
+ /** Repaint coordination handed alongside the Document API surface. */
1060
+ export interface ContextMenuSelectReadiness {
1061
+ /** Render epoch of the mounted surface, or null when not mounted. */
1062
+ getRenderEpoch(): number | null;
1063
+ /** Resolves once a mutation's scheduled repaint has settled. */
1064
+ whenPainted(input?: {
1065
+ txId?: string;
1066
+ afterEpoch?: number | null;
1067
+ }): Promise<{
1068
+ renderEpoch: number | null;
1069
+ }>;
1070
+ }
1071
+ /**
1072
+ * What a `ContextMenuItem.onSelect` handler is given.
1073
+ *
1074
+ * `document` is the async Document API surface, and it is a result rather than
1075
+ * a handle: it reports `available: false` with a reason before the document is
1076
+ * ready, so a handler has to check before reaching for `doc`. It is not the
1077
+ * ProseMirror `Editor` the deprecated `action` callback took, which the v2
1078
+ * runtime does not have.
1079
+ */
1080
+ export interface ContextMenuSelectPayload {
1081
+ document: {
1082
+ available: true;
1083
+ doc: BrowserDocumentApi;
1084
+ readiness: ContextMenuSelectReadiness;
1085
+ } | {
1086
+ available: false;
1087
+ reason: string;
1088
+ };
1089
+ /** The context captured when the menu opened, not the live document state. */
1090
+ context: ContextMenuSelectContext | null;
1091
+ }
791
1092
  /** A section (group) of items in the context menu. */
792
1093
  export interface ContextMenuSection {
793
1094
  /** Unique identifier for the section. */
@@ -1454,6 +1755,17 @@ export interface FindReplaceConfig {
1454
1755
  width?: number | string;
1455
1756
  maxWidth?: number | string;
1456
1757
  maxHeight?: number | string;
1758
+ /**
1759
+ * Focus the find input when the surface opens. Defaults to `true`; set
1760
+ * `false` to leave focus wherever the user had it.
1761
+ *
1762
+ * Honored but undeclared until #1094: `useFindReplace` spreads this whole
1763
+ * bag into the surface request, and `SurfaceManager` applies it last, over
1764
+ * the `modules.surfaces.floating` defaults.
1765
+ */
1766
+ autoFocus?: boolean;
1767
+ /** Close the surface on a pointer press outside it. Defaults to `false`. */
1768
+ closeOnOutsidePointerDown?: boolean;
1457
1769
  };
1458
1770
  }
1459
1771
  /**
@@ -1675,18 +1987,31 @@ export interface Modules {
1675
1987
  icons?: Record<string, unknown>;
1676
1988
  /** Text/label overrides keyed by toolbar item id. Falls back to `Config.toolbarTexts`. */
1677
1989
  texts?: Record<string, string>;
1678
- /** Custom font list rendered in the font-family dropdown. */
1679
- fonts?: FontConfig[];
1990
+ /**
1991
+ * Custom font list rendered in the font-family dropdown.
1992
+ *
1993
+ * AIDEV-NOTE: legacy-public - accepts {@link FontFamilyConfig} entries
1994
+ * alongside dropdown rows. This spelling was typed `FontConfig[]`,
1995
+ * whose index signature let `{ family, label, key }` compile and work,
1996
+ * so narrowing it to rows alone would break installs mid-2.x.
1997
+ * Replaced by `ui.toolbar.fonts`, which takes rows only.
1998
+ * Earliest removal: v3.0 (#853).
1999
+ *
2000
+ * The runtime uses the list verbatim and reads `label` and `key` off
2001
+ * each entry, so a `family`-only entry renders a blank row either way.
2002
+ */
2003
+ fonts?: Array<FontConfig | ToolbarFontOption>;
1680
2004
  /** Hide buttons that overflow the available width (default: true). */
1681
2005
  hideButtons?: boolean;
1682
2006
  /** Recompute the visible toolbar item set on container resize (default: false). */
1683
2007
  responsiveToContainer?: boolean;
1684
2008
  /**
1685
- * Custom toolbar buttons appended to the default item set. Each entry is
1686
- * a `ToolbarItem`-shaped object (see the consumer-facing toolbar docs for
1687
- * the full shape). The internal `ToolbarItem` type is not yet on the
1688
- * public surface; this typedef accepts the structural shape consumers
1689
- * already pass through `modules.toolbar.customButtons`.
2009
+ * Custom toolbar buttons appended to the default item set.
2010
+ *
2011
+ * AIDEV-NOTE: legacy-public - stays an open record. This spelling was
2012
+ * typed `Array<Record<string, unknown>>`, so narrowing it now would
2013
+ * reject entries that compile and work today. Replaced by
2014
+ * `ui.toolbar.customButtons`. Earliest removal: v3.0 (#853).
1690
2015
  */
1691
2016
  customButtons?: Array<Record<string, unknown>>;
1692
2017
  /**
@@ -2161,7 +2486,7 @@ export interface SuperDocLayoutEngineOptions {
2161
2486
  * @experimental Diagnostic posture, not a supported product mode and not a
2162
2487
  * pipeline bypass: both settings route through the same canonical
2163
2488
  * render-pipeline engine. `true` (default) paints an initial window and
2164
- * appends as source streams in (the open-first-window and append engine
2489
+ * (the canonical initial-render and incremental engine
2165
2490
  * passes); `false` makes EVERY mounted repaint wait for complete source
2166
2491
  * coverage and materialize the full body before painting — not only the
2167
2492
  * first paint — via the exact-complete engine pass, which can be much
@@ -2171,7 +2496,6 @@ export interface SuperDocLayoutEngineOptions {
2171
2496
  * render-readiness diagnostic. The render surface has no independent
2172
2497
  * first-paint timeout; callers and harnesses must provide their own.
2173
2498
  */
2174
- progressiveBodyStreaming?: boolean;
2175
2499
  /**
2176
2500
  * P6a: per-paint work-counter HUD (console table +
2177
2501
  * `data-v2-paint-hud-recent`) and the dark reuse-collapse tripwire for the
@@ -2411,28 +2735,63 @@ export interface UIConfig {
2411
2735
  icons?: Record<string, unknown>;
2412
2736
  /** Text overrides, merged over the built-in set. */
2413
2737
  texts?: Record<string, unknown>;
2738
+ /**
2739
+ * Hide buttons that overflow the available width (default: true).
2740
+ *
2741
+ * The runtime has always honored this through the toolbar options
2742
+ * pass-through; it was only missing from this type, so passing it here
2743
+ * failed excess-property checks while working at runtime.
2744
+ */
2745
+ hideButtons?: boolean;
2414
2746
  /** Size the toolbar to its container rather than the viewport. */
2415
2747
  responsiveToContainer?: boolean;
2748
+ /**
2749
+ * Custom font list rendered in the font-family dropdown. The runtime
2750
+ * uses this list verbatim, so entries are dropdown rows
2751
+ * ({@link ToolbarFontOption}), not families to load
2752
+ * ({@link FontFamilyConfig}). Register loadable families through
2753
+ * `fonts.families` instead.
2754
+ */
2755
+ fonts?: ToolbarFontOption[];
2756
+ /**
2757
+ * Custom toolbar buttons appended to the default item set.
2758
+ *
2759
+ * `name` and the `command` callback are typed; the rest of the
2760
+ * `ToolbarItem` shape stays open because it is not yet public (#1098).
2761
+ */
2762
+ customButtons?: ToolbarCustomButton[];
2763
+ /**
2764
+ * Show the formatting marks (pilcrow) button in the toolbar. Off by
2765
+ * default. Distinct from `layoutEngineOptions.showFormattingMarks`, which
2766
+ * controls whether the marks render in the document.
2767
+ */
2768
+ showFormattingMarksButton?: boolean;
2769
+ /** Show the table of contents insert button in the toolbar. Off by default. */
2770
+ showTableOfContentsButton?: boolean;
2416
2771
  };
2417
2772
  /** Built-in comments UI. Enabled by default. */
2418
- comments?: boolean | Record<string, unknown>;
2773
+ comments?: boolean | CommentsConfig;
2419
2774
  /** Built-in right-click and slash context menu. Enabled by default. */
2420
- contextMenu?: boolean | Record<string, unknown>;
2775
+ contextMenu?: boolean | ContextMenuConfig;
2421
2776
  /**
2422
2777
  * Built-in find/replace surface. Disabled by default. Enabling it lets
2423
2778
  * SuperDoc intercept Cmd+F / Ctrl+F; `editor.ui.search` stays available to
2424
2779
  * custom UI either way.
2425
2780
  */
2426
- search?: boolean | Record<string, unknown>;
2427
- /** Built-in popover shown when a link is selected. Disabled by default. */
2428
- linkPopover?: boolean | Record<string, unknown>;
2781
+ search?: boolean | FindReplaceConfig;
2782
+ /**
2783
+ * Built-in popover shown when a link is clicked. It renders by default;
2784
+ * pass `false` (or `ui: false`) to suppress it. Supplying a
2785
+ * {@link LinkPopoverConfig.popoverResolver} replaces it with your own UI.
2786
+ */
2787
+ linkPopover?: boolean | LinkPopoverConfig;
2429
2788
  /** Built-in ruler. Disabled by default. */
2430
2789
  ruler?: boolean | {
2431
2790
  /** Element or selector to render the ruler into. */
2432
2791
  container?: string | HTMLElement;
2433
2792
  };
2434
2793
  /** Built-in chrome drawn around content controls. Enabled by default. */
2435
- contentControls?: boolean | Record<string, unknown>;
2794
+ contentControls?: boolean | ContentControlsConfig;
2436
2795
  }
2437
2796
  /**
2438
2797
  * What the user is permitted to do, as distinct from what SuperDoc draws.
@@ -2783,6 +3142,14 @@ export interface Config {
2783
3142
  lockedBy?: User;
2784
3143
  /** Whether to show the ruler in the editor. */
2785
3144
  rulers?: boolean;
3145
+ /**
3146
+ * Element or selector the ruler mounts into. Omit to render it inline above
3147
+ * the editor.
3148
+ *
3149
+ * @deprecated replaceWith=`ui.ruler.container` removeIn=v3.0 — the runtime
3150
+ * still honors it, and the canonical value wins when both are set.
3151
+ */
3152
+ rulerContainer?: string | HTMLElement;
2786
3153
  /** Whether to suppress default styles in docx mode. */
2787
3154
  suppressDefaultDocxStyles?: boolean;
2788
3155
  /** Provided JSON to override content with. */
@@ -1 +1 @@
1
- export function floor(val: any, precision: any): number;
1
+ export function floor(val: number, precision?: number): number;
@@ -9,7 +9,12 @@
9
9
  * one authoritative catalog after render instead of issuing one read per id.
10
10
  */
11
11
  export function getV2TrackedChangeMutationImpact(event: any): {
12
+ allResolved?: any;
12
13
  upsertIds: Set<any>;
13
14
  removedIds: Set<any>;
15
+ remappedPairs: {
16
+ from: string;
17
+ to: string;
18
+ }[];
14
19
  reconcileMode: string;
15
20
  } | null;
@@ -12,7 +12,7 @@ export function createV2ReviewMutationReconciler({ getContext, reconcile, hydrat
12
12
  onReconciled: any;
13
13
  }): {
14
14
  enqueue: (impact: any) => void;
15
- enqueueAfterPaint(impact: any, waitForPaint: any): void;
15
+ enqueueAfterPaint(impact: any, waitForPaint: any): Promise<any>;
16
16
  onRender: (supersedesInFlight?: boolean) => void;
17
17
  reset(): void;
18
18
  getPendingIds(): Set<any>;
@@ -29,7 +29,6 @@ export function mapFontFamilyOptionsToToolbar(options: ReadonlyArray<import('../
29
29
  export const TOOLBAR_FONTS: {
30
30
  label: string;
31
31
  key: string;
32
- fontWeight: number;
33
32
  props: {
34
33
  style: {
35
34
  fontFamily: string;
@@ -36,7 +36,7 @@ export interface BuiltInToolbarItemEntry {
36
36
  * docs present them; it is documentation-only.
37
37
  *
38
38
  * Every documented `Available buttons` entry from
39
- * `apps/docs/editor/built-in-ui/toolbar.mdx` appears here exactly once, plus the
39
+ * the built-in UI documentation appears here exactly once, plus the
40
40
  * `customButtons` shell concept.
41
41
  */
42
42
  export declare const BUILT_IN_TOOLBAR_CATALOG: readonly BuiltInToolbarItemEntry[];
@@ -9,14 +9,19 @@ import type { BorrowedSuperDocUI as __Cjs_BorrowedSuperDocUI } from './index.js'
9
9
  import type { CanPerformPermissionParams as __Cjs_CanPerformPermissionParams } from './index.js' with { "resolution-mode": "import" };
10
10
  import type { CollaborationConfig as __Cjs_CollaborationConfig } from './index.js' with { "resolution-mode": "import" };
11
11
  import type { CommentAddress as __Cjs_CommentAddress } from './index.js' with { "resolution-mode": "import" };
12
+ import type { CommentsConfig as __Cjs_CommentsConfig } from './index.js' with { "resolution-mode": "import" };
12
13
  import type { CommentsType as __Cjs_CommentsType } from './index.js' with { "resolution-mode": "import" };
13
14
  import type { Config as __Cjs_Config } from './index.js' with { "resolution-mode": "import" };
14
15
  import type { ContentControlActiveChangePayload as __Cjs_ContentControlActiveChangePayload } from './index.js' with { "resolution-mode": "import" };
15
16
  import type { ContentControlClickPayload as __Cjs_ContentControlClickPayload } from './index.js' with { "resolution-mode": "import" };
17
+ import type { ContentControlsConfig as __Cjs_ContentControlsConfig } from './index.js' with { "resolution-mode": "import" };
16
18
  import type { ContextMenuConfig as __Cjs_ContextMenuConfig } from './index.js' with { "resolution-mode": "import" };
17
19
  import type { ContextMenuContext as __Cjs_ContextMenuContext } from './index.js' with { "resolution-mode": "import" };
18
20
  import type { ContextMenuItem as __Cjs_ContextMenuItem } from './index.js' with { "resolution-mode": "import" };
19
21
  import type { ContextMenuSection as __Cjs_ContextMenuSection } from './index.js' with { "resolution-mode": "import" };
22
+ import type { ContextMenuSelectContext as __Cjs_ContextMenuSelectContext } from './index.js' with { "resolution-mode": "import" };
23
+ import type { ContextMenuSelectPayload as __Cjs_ContextMenuSelectPayload } from './index.js' with { "resolution-mode": "import" };
24
+ import type { ContextMenuSelectReadiness as __Cjs_ContextMenuSelectReadiness } from './index.js' with { "resolution-mode": "import" };
20
25
  import type { DirectSurfaceRequest as __Cjs_DirectSurfaceRequest } from './index.js' with { "resolution-mode": "import" };
21
26
  import type { DocRange as __Cjs_DocRange } from './index.js' with { "resolution-mode": "import" };
22
27
  import type { Document as __Cjs_Document } from './index.js' with { "resolution-mode": "import" };
@@ -46,6 +51,7 @@ import type { LayoutFragment as __Cjs_LayoutFragment } from './index.js' with {
46
51
  import type { LayoutMetrics as __Cjs_LayoutMetrics } from './index.js' with { "resolution-mode": "import" };
47
52
  import type { LayoutMode as __Cjs_LayoutMode } from './index.js' with { "resolution-mode": "import" };
48
53
  import type { LayoutPage as __Cjs_LayoutPage } from './index.js' with { "resolution-mode": "import" };
54
+ import type { LinkPopoverConfig as __Cjs_LinkPopoverConfig } from './index.js' with { "resolution-mode": "import" };
49
55
  import type { LinkPopoverContext as __Cjs_LinkPopoverContext } from './index.js' with { "resolution-mode": "import" };
50
56
  import type { LinkPopoverResolution as __Cjs_LinkPopoverResolution } from './index.js' with { "resolution-mode": "import" };
51
57
  import type { LinkPopoverResolver as __Cjs_LinkPopoverResolver } from './index.js' with { "resolution-mode": "import" };
@@ -161,6 +167,7 @@ import type { TextAddress as __Cjs_TextAddress } from './index.js' with { "resol
161
167
  import type { TextSegment as __Cjs_TextSegment } from './index.js' with { "resolution-mode": "import" };
162
168
  import type { TextTarget as __Cjs_TextTarget } from './index.js' with { "resolution-mode": "import" };
163
169
  import type { TrackChangeAuthor as __Cjs_TrackChangeAuthor } from './index.js' with { "resolution-mode": "import" };
170
+ import type { TrackChangeHighlightColors as __Cjs_TrackChangeHighlightColors } from './index.js' with { "resolution-mode": "import" };
164
171
  import type { TrackChangesAuthorColorsConfig as __Cjs_TrackChangesAuthorColorsConfig } from './index.js' with { "resolution-mode": "import" };
165
172
  import type { TrackChangesModuleConfig as __Cjs_TrackChangesModuleConfig } from './index.js' with { "resolution-mode": "import" };
166
173
  import type { TrackChangesSemanticColorsConfig as __Cjs_TrackChangesSemanticColorsConfig } from './index.js' with { "resolution-mode": "import" };
@@ -185,15 +192,20 @@ export declare const buildTheme: typeof import('./index.js', { with: { "resoluti
185
192
  export type { __Cjs_CanPerformPermissionParams as CanPerformPermissionParams };
186
193
  export type { __Cjs_CollaborationConfig as CollaborationConfig };
187
194
  export type { __Cjs_CommentAddress as CommentAddress };
195
+ export type { __Cjs_CommentsConfig as CommentsConfig };
188
196
  export type { __Cjs_CommentsType as CommentsType };
189
197
  export declare const compareVersions: typeof import('./index.js', { with: { "resolution-mode": "import" } }).compareVersions;
190
198
  export type { __Cjs_Config as Config };
191
199
  export type { __Cjs_ContentControlActiveChangePayload as ContentControlActiveChangePayload };
192
200
  export type { __Cjs_ContentControlClickPayload as ContentControlClickPayload };
201
+ export type { __Cjs_ContentControlsConfig as ContentControlsConfig };
193
202
  export type { __Cjs_ContextMenuConfig as ContextMenuConfig };
194
203
  export type { __Cjs_ContextMenuContext as ContextMenuContext };
195
204
  export type { __Cjs_ContextMenuItem as ContextMenuItem };
196
205
  export type { __Cjs_ContextMenuSection as ContextMenuSection };
206
+ export type { __Cjs_ContextMenuSelectContext as ContextMenuSelectContext };
207
+ export type { __Cjs_ContextMenuSelectPayload as ContextMenuSelectPayload };
208
+ export type { __Cjs_ContextMenuSelectReadiness as ContextMenuSelectReadiness };
197
209
  export declare const createTheme: typeof import('./index.js', { with: { "resolution-mode": "import" } }).createTheme;
198
210
  export declare const defineSuperDocExtension: typeof import('./index.js', { with: { "resolution-mode": "import" } }).defineSuperDocExtension;
199
211
  export type { __Cjs_DirectSurfaceRequest as DirectSurfaceRequest };
@@ -228,6 +240,7 @@ export type { __Cjs_LayoutFragment as LayoutFragment };
228
240
  export type { __Cjs_LayoutMetrics as LayoutMetrics };
229
241
  export type { __Cjs_LayoutMode as LayoutMode };
230
242
  export type { __Cjs_LayoutPage as LayoutPage };
243
+ export type { __Cjs_LinkPopoverConfig as LinkPopoverConfig };
231
244
  export type { __Cjs_LinkPopoverContext as LinkPopoverContext };
232
245
  export type { __Cjs_LinkPopoverResolution as LinkPopoverResolution };
233
246
  export type { __Cjs_LinkPopoverResolver as LinkPopoverResolver };
@@ -345,6 +358,7 @@ export type { __Cjs_TextAddress as TextAddress };
345
358
  export type { __Cjs_TextSegment as TextSegment };
346
359
  export type { __Cjs_TextTarget as TextTarget };
347
360
  export type { __Cjs_TrackChangeAuthor as TrackChangeAuthor };
361
+ export type { __Cjs_TrackChangeHighlightColors as TrackChangeHighlightColors };
348
362
  export type { __Cjs_TrackChangesAuthorColorsConfig as TrackChangesAuthorColorsConfig };
349
363
  export type { __Cjs_TrackChangesModuleConfig as TrackChangesModuleConfig };
350
364
  export type { __Cjs_TrackChangesSemanticColorsConfig as TrackChangesSemanticColorsConfig };
@@ -72,6 +72,10 @@ export type { SuperDocLayoutEngineOptions as LayoutEngineOptions } from '../core
72
72
  export type { FlowBlock, FlowMode, Layout, Fragment as LayoutFragment, Page as LayoutPage } from '../../../layout-engine/contracts/src/index.js';
73
73
  export type { LayoutMetrics } from '../../../layout-engine/layout-bridge/src/index.js';
74
74
  export type { LayoutMode } from '../../../layout-engine/painters/dom/src/index.js';
75
+ export type { CommentsConfig } from '../core/types/index.js';
76
+ export type { TrackChangeHighlightColors } from '../core/types/index.js';
77
+ export type { ContentControlsConfig } from '../core/types/index.js';
78
+ export type { LinkPopoverConfig } from '../core/types/index.js';
75
79
  export type { LinkPopoverContext } from '../core/types/index.js';
76
80
  export type { LinkPopoverResolution } from '../core/types/index.js';
77
81
  export type { LinkPopoverResolver } from '../core/types/index.js';
@@ -176,4 +180,7 @@ export type { ContextMenuConfig } from '../core/types/index.js';
176
180
  export type { ContextMenuContext } from '../core/types/index.js';
177
181
  export type { ContextMenuItem } from '../core/types/index.js';
178
182
  export type { ContextMenuSection } from '../core/types/index.js';
183
+ export type { ContextMenuSelectContext } from '../core/types/index.js';
184
+ export type { ContextMenuSelectPayload } from '../core/types/index.js';
185
+ export type { ContextMenuSelectReadiness } from '../core/types/index.js';
179
186
  export type { FindReplaceConfig } from '../core/types/index.js';