superdoc 2.29.0-next.9 → 2.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/chunks/{FindReplaceSurface-BKVHzhQ4.es.js → FindReplaceSurface-B_5ggdWg.es.js} +1 -1
  2. package/dist/chunks/{FindReplaceSurface-BNDrJ6VS.cjs → FindReplaceSurface-fVHxPXtn.cjs} +1 -1
  3. package/dist/chunks/{PasswordPromptSurface-6mF6Azda.es.js → PasswordPromptSurface-CZqhDQQ1.es.js} +1 -1
  4. package/dist/chunks/{PasswordPromptSurface-BNkaztaP.cjs → PasswordPromptSurface-x8GNmMJT.cjs} +1 -1
  5. package/dist/chunks/{PdfViewer-aOWhUVI7.es.js → PdfViewer-CW09MNrB.es.js} +4 -10
  6. package/dist/chunks/{PdfViewer-DmSkZehl.cjs → PdfViewer-CkrAHpC-.cjs} +4 -10
  7. package/dist/chunks/{_plugin-vue_export-helper-6MBoygIY.cjs → _plugin-vue_export-helper-BkbCxNeT.cjs} +31 -7
  8. package/dist/chunks/{_plugin-vue_export-helper-CsJQtMvr.es.js → _plugin-vue_export-helper-DRPRMkeA.es.js} +20 -8
  9. package/dist/chunks/{create-super-doc-ui-Bm5kmx0W.es.js → create-super-doc-ui-Dc8dQAMc.es.js} +83 -114
  10. package/dist/chunks/{create-super-doc-ui-DN70aatf.cjs → create-super-doc-ui-L60GhVAX.cjs} +199 -236
  11. package/dist/collaboration-upgrade-engine.cjs +1 -1
  12. package/dist/collaboration-upgrade-engine.es.js +1 -1
  13. package/dist/document-api/src/contract/command-catalog.d.ts +1 -1
  14. package/dist/public/ui-react.cjs +1 -1
  15. package/dist/public/ui-react.es.js +1 -1
  16. package/dist/public/ui-vue.cjs +1 -1
  17. package/dist/public/ui-vue.es.js +1 -1
  18. package/dist/public/ui.cjs +1 -1
  19. package/dist/public/ui.es.js +1 -1
  20. package/dist/style.css +1 -1
  21. package/dist/style.layered.css +1 -1
  22. package/dist/superdoc/src/components/CommentsLayer/collect-removed-comment-ids.d.ts +11 -1
  23. package/dist/superdoc/src/components/CommentsLayer/collect-tracked-change-thread.d.ts +19 -2
  24. package/dist/superdoc/src/components/CommentsLayer/comment-urls.d.ts +1 -1
  25. package/dist/superdoc/src/components/CommentsLayer/commentsList/super-comments-list.d.ts +23 -20
  26. package/dist/superdoc/src/components/CommentsLayer/helpers.d.ts +1 -4
  27. package/dist/superdoc/src/components/CommentsLayer/tracked-change-threading.d.ts +16 -1
  28. package/dist/superdoc/src/components/Whiteboard/WhiteboardLayer.vue.d.ts +4 -5
  29. package/dist/superdoc/src/components/Whiteboard/WhiteboardPage.vue.d.ts +3 -4
  30. package/dist/superdoc/src/components/Whiteboard/whiteboard-types.d.ts +2 -0
  31. package/dist/superdoc/src/components/surfaces/watermark-surface-runtime.d.ts +7 -7
  32. package/dist/superdoc/src/composables/use-comment-small-screen.d.ts +11 -7
  33. package/dist/superdoc/src/composables/use-compact-comment-popover.d.ts +44 -18
  34. package/dist/superdoc/src/composables/use-find-replace.d.ts +13 -3
  35. package/dist/superdoc/src/composables/use-password-prompt.d.ts +1 -1
  36. package/dist/superdoc/src/composables/use-viewport-fit.d.ts +62 -26
  37. package/dist/superdoc/src/core/SuperDoc.d.ts +3 -3
  38. package/dist/superdoc/src/core/pdf/pdf-adapter.d.ts +6 -2
  39. package/dist/superdoc/src/core/types/index.d.ts +37 -4
  40. package/dist/superdoc/src/core/v2-integration/browser-peer-runtime.d.ts +5 -3
  41. package/dist/superdoc/src/core/v2-integration/cdn-engine-loader.d.ts +3 -13
  42. package/dist/superdoc/src/core/v2-integration/internal-vue-runtime.d.ts +64 -59
  43. package/dist/superdoc/src/helpers/object-guards.d.ts +1 -0
  44. package/dist/superdoc/src/helpers/v2-author-required-rejection.d.ts +8 -11
  45. package/dist/superdoc/src/helpers/v2-bulk-decision-event.d.ts +9 -7
  46. package/dist/superdoc/src/helpers/v2-keyboard-edit-rejection.d.ts +8 -7
  47. package/dist/superdoc/src/helpers/v2-mutation-exception.d.ts +12 -8
  48. package/dist/superdoc/src/helpers/v2-review-target.d.ts +11 -1
  49. package/dist/superdoc/src/helpers/v2-selection-sync.d.ts +40 -14
  50. package/dist/superdoc/src/helpers/v2-typing-mutation-event.d.ts +14 -5
  51. package/dist/superdoc/src/icons.d.ts +11 -19
  52. package/dist/superdoc/src/internal/diagnostics/translate-diagnostic.d.ts +6 -4
  53. package/dist/superdoc/src/internal/toolbar/built-in/PageNumberMenu.vue.d.ts +25 -15
  54. package/dist/superdoc/src/internal/toolbar/built-in/constants.d.ts +3 -1
  55. package/dist/superdoc/src/internal/toolbar/built-in/font-options.d.ts +15 -1
  56. package/dist/superdoc/src/internal/toolbar/built-in/font-typeahead.d.ts +37 -7
  57. package/dist/superdoc/src/internal/toolbar/built-in/format-negation.d.ts +10 -4
  58. package/dist/superdoc/src/internal/toolbar/built-in/general.d.ts +12 -1
  59. package/dist/superdoc/src/internal/toolbar/built-in/helpers.d.ts +9 -4
  60. package/dist/superdoc/src/internal/toolbar/built-in/list-style-buttons.d.ts +2 -2
  61. package/dist/superdoc/src/internal/toolbar/built-in/page-number-feedback.d.ts +4 -5
  62. package/dist/superdoc/src/internal/toolbar/built-in/scroll-helpers.d.ts +3 -4
  63. package/dist/superdoc/src/internal/toolbar/built-in/toolbarIcons.d.ts +78 -145
  64. package/dist/superdoc/src/internal/toolbar/built-in/url-safety.d.ts +11 -3
  65. package/dist/superdoc/src/internal/toolbar/built-in-toolbar.d.ts +4 -3
  66. package/dist/superdoc/src/internal/toolbar/image-upload.d.ts +29 -39
  67. package/dist/superdoc/src/public/ui/format-painter-helpers.d.ts +2 -8
  68. package/dist/superdoc/src/stores/comments-store.d.ts +7 -7
  69. package/dist/superdoc/src/stores/helpers/comment-document-scope.d.ts +22 -0
  70. package/dist/superdoc/src/stores/helpers/pending-selection-snapshot.d.ts +17 -0
  71. package/dist/superdoc/src/stores/helpers/tracked-change-compaction.d.ts +16 -0
  72. package/dist/superdoc/src/stores/helpers/tracked-change-decision.d.ts +45 -0
  73. package/dist/superdoc/src/stores/superdoc-store.d.ts +21 -21
  74. package/dist/superdoc.cjs +423 -464
  75. package/dist/superdoc.es.js +335 -376
  76. package/dist-cdn/style.layered.css +1 -1
  77. package/dist-cdn/superdoc.min.css +1 -1
  78. package/dist-cdn/superdoc.min.js +41 -41
  79. package/package.json +3 -2
  80. package/dist/superdoc/src/main.d.ts +0 -1
@@ -1,7 +1,9 @@
1
- export function toV2BulkDecisionEvent(documentId: any, fact: any): {
2
- documentId: string | null;
3
- decision: any;
4
- requestedCount: any;
5
- successfulCount: any;
6
- permissionDeniedCount: any;
7
- } | null;
1
+ import { SuperDocTrackedChangesBulkDecisionPayload } from '../core/types/index.js';
2
+ export type V2TrackedChangeBulkDecisionFact = {
3
+ schemaVersion: number;
4
+ decision: string;
5
+ requestedCount: number;
6
+ appliedCount: number;
7
+ deniedCount: number;
8
+ };
9
+ export declare function toV2BulkDecisionEvent(documentId: string | null | undefined, fact: V2TrackedChangeBulkDecisionFact | null | undefined): SuperDocTrackedChangesBulkDecisionPayload | null;
@@ -1,13 +1,14 @@
1
- export function isV2KeyboardEditRejection(event: any): boolean;
2
- export function createV2KeyboardEditRejectionException(documentId: any, event: any): {
1
+ import { V2MutationRejectedEvent } from './v2-mutation-exception.js';
2
+ export declare const V2_EDIT_REJECTED_CODE = "edit-rejected";
3
+ export declare const V2_EDIT_REJECTED_MESSAGE = "This edit couldn\u2019t be completed. Adjust the selection and try again.";
4
+ export declare function isV2KeyboardEditRejection(event: unknown): event is V2MutationRejectedEvent;
5
+ export declare function createV2KeyboardEditRejectionException(documentId: string | null | undefined, event?: unknown): {
3
6
  documentId?: string | undefined;
4
7
  error: Error;
5
8
  code: string;
6
9
  editor: null;
7
10
  };
8
- export function createV2KeyboardEditRejectionNotificationGate(): {
9
- shouldNotify(scope: any, event: any): boolean;
10
- clear(scope: any): void;
11
+ export declare function createV2KeyboardEditRejectionNotificationGate(): {
12
+ shouldNotify(scope: string | null | undefined, event: unknown): boolean;
13
+ clear(scope: string | null | undefined): void;
11
14
  };
12
- export const V2_EDIT_REJECTED_CODE: "edit-rejected";
13
- export const V2_EDIT_REJECTED_MESSAGE: "This edit couldn\u2019t be completed. Adjust the selection and try again.";
@@ -1,10 +1,14 @@
1
- export function createV2MutationRejectionCause(event: any): {
2
- editableCommandKind?: any;
3
- inputKind?: any;
4
- reason?: string | undefined;
5
- failureSource?: any;
1
+ export type V2MutationRejectedEvent = Record<string, unknown> & {
2
+ type: 'mutation:rejected';
6
3
  };
7
- export function createV2MutationRejectionNotificationGate(matches: any): {
8
- shouldNotify(scope: any, event: any): boolean;
9
- clear(scope: any): void;
4
+ export type V2MutationRejectionCause = {
5
+ failureSource?: string;
6
+ reason?: string;
7
+ inputKind?: string;
8
+ editableCommandKind?: string;
9
+ };
10
+ export declare function createV2MutationRejectionCause(event: unknown): V2MutationRejectionCause;
11
+ export declare function createV2MutationRejectionNotificationGate(matches: (event: unknown) => event is V2MutationRejectedEvent): {
12
+ shouldNotify(scope: string | null | undefined, event: unknown): boolean;
13
+ clear(scope: string | null | undefined): void;
10
14
  };
@@ -1,7 +1,17 @@
1
+ type V2ReviewTargetInput = {
2
+ entityId?: unknown;
3
+ entityType?: unknown;
4
+ };
5
+ type V2ReviewTargetComment = {
6
+ trackedChange?: unknown;
7
+ commentId?: unknown;
8
+ importedId?: unknown;
9
+ };
1
10
  /**
2
11
  * Resolve the comments-store identity for a document-origin v2 review target.
3
12
  * Painted review carriers can become interactive before the asynchronous row
4
13
  * hydration finishes. In that window the host's canonical entity id remains
5
14
  * the correct pending active identity; once hydrated, the row aliases win.
6
15
  */
7
- export function resolveV2ReviewTargetCommentId(target: any, getComment: any): any;
16
+ export declare function resolveV2ReviewTargetCommentId(target: V2ReviewTargetInput | null | undefined, getComment: ((id: string) => V2ReviewTargetComment | null | undefined) | null | undefined): string | null;
17
+ export {};
@@ -1,15 +1,41 @@
1
- export function isV2RangeSnapshot(snapshot: {
2
- anchor?: {
3
- blockId?: unknown;
4
- blockOffset?: unknown;
5
- };
6
- focus?: {
7
- blockId?: unknown;
8
- blockOffset?: unknown;
9
- };
10
- } | null | undefined): boolean;
11
- export function hasOutsideV2DomRangeSelection(selection: Selection | null | undefined, root: Node | null | undefined): boolean;
12
- export function shouldPreserveHostV2Selection(documentMode: string | null | undefined, hostSnapshot: unknown): boolean;
13
- export function shouldRetainV2FloatingSelection(hasHostRange: boolean, selectionPosition: {
1
+ type V2SelectionPoint = {
2
+ blockId?: unknown;
3
+ blockOffset?: unknown;
4
+ };
5
+ type V2RangeSnapshotInput = {
6
+ anchor?: V2SelectionPoint | null;
7
+ focus?: V2SelectionPoint | null;
8
+ };
9
+ /**
10
+ * A logical v2 selection snapshot represents a non-empty range when its anchor
11
+ * and focus point at different block positions. Mirrors the range check the v2
12
+ * shell uses when it emits `v2-selection-changed`.
13
+ */
14
+ export declare const isV2RangeSnapshot: (snapshot: V2RangeSnapshotInput | null | undefined) => boolean;
15
+ /**
16
+ * Detect a real browser text selection whose endpoints are outside the active
17
+ * v2 mount. Editable host selections can have no native DOM range, so an
18
+ * absent range must not count as an outside selection.
19
+ */
20
+ export declare const hasOutsideV2DomRangeSelection: (selection: Selection | null | undefined, root: Node | null | undefined) => boolean;
21
+ /**
22
+ * Decide whether the DOM-selection sync pass should keep the affordance driven
23
+ * by the v2 host's logical selection instead of clearing it.
24
+ *
25
+ * In editable modes the host owns pointer text selection, so native DOM ranges
26
+ * may be absent or stale. In that case the pointerup sync must defer to the
27
+ * host snapshot rather than clobber the selection the host just published.
28
+ * Only editable modes use the host snapshot. Viewing mode keeps native DOM
29
+ * selection, and unknown modes should not preserve stale host state.
30
+ */
31
+ export declare const shouldPreserveHostV2Selection: (documentMode: string | null | undefined, hostSnapshot: V2RangeSnapshotInput | null | undefined) => boolean;
32
+ /**
33
+ * A V2 paint can briefly have no DOM anchor while a selected control is being
34
+ * rebuilt. Keep an already-positioned comment affordance during that gap when
35
+ * the host still owns a range; otherwise the button unmounts and remounts on
36
+ * consecutive paint frames, making it blink and intercepting its own click.
37
+ */
38
+ export declare const shouldRetainV2FloatingSelection: (hasHostRange: boolean, selectionPosition: {
14
39
  source?: unknown;
15
- } | null | undefined): boolean;
40
+ } | null | undefined) => boolean;
41
+ export {};
@@ -1,5 +1,14 @@
1
- export function isV2EditableTextMutationEvent(event: {
2
- type?: string;
3
- origin?: string;
4
- editableCommandKind?: string;
5
- } | null | undefined): boolean;
1
+ /**
2
+ * True when a forwarded v2 host event is a committed editable-input mutation
3
+ * of the sustained-typing class, i.e. review-row hydration for it should be
4
+ * debounced rather than fired immediately.
5
+ *
6
+ * Events without a forwarded `editableCommandKind` (programmatic Document API
7
+ * mutations, history commits, unclassified structural commands) return false
8
+ * so they keep hydrating immediately.
9
+ */
10
+ export declare const isV2EditableTextMutationEvent: (event: {
11
+ type?: unknown;
12
+ origin?: unknown;
13
+ editableCommandKind?: unknown;
14
+ } | null | undefined) => boolean;
@@ -1,19 +1,11 @@
1
- import { default as commentIconSvg } from '../../../shared/common/icons/comment-solid.svg?raw';
2
- import { default as caretDownIconSvg } from '../../../shared/common/icons/caret-down-solid.svg?raw';
3
- import { default as userCheckIconSvg } from '../../../shared/common/icons/user-check-solid.svg?raw';
4
- import { default as usersIconSvg } from '../../../shared/common/icons/users-solid.svg?raw';
5
- import { default as checkIconSvg } from '../../../shared/common/icons/check-solid.svg?raw';
6
- import { default as xmarkIconSvg } from '../../../shared/common/icons/xmark-solid.svg?raw';
7
- import { default as ellipsisVerticalSvg } from '../../../shared/common/icons/ellipsis-vertical-solid.svg?raw';
8
- import { default as rotateLeftSvg } from '../../../shared/common/icons/rotate-left-solid.svg?raw';
9
- export namespace superdocIcons {
10
- export { commentIconSvg as comment };
11
- export { caretDownIconSvg as caretDown };
12
- export { userCheckIconSvg as internal };
13
- export { usersIconSvg as external };
14
- export { checkIconSvg as markDone };
15
- export { checkIconSvg as acceptChange };
16
- export { xmarkIconSvg as rejectChange };
17
- export { ellipsisVerticalSvg as overflow };
18
- export { rotateLeftSvg as reopen };
19
- }
1
+ export declare const superdocIcons: {
2
+ comment: string;
3
+ caretDown: string;
4
+ internal: string;
5
+ external: string;
6
+ markDone: string;
7
+ acceptChange: string;
8
+ rejectChange: string;
9
+ overflow: string;
10
+ reopen: string;
11
+ };
@@ -13,9 +13,9 @@ type RenderReadinessDiagnostic = {
13
13
  reason?: string;
14
14
  severity?: string;
15
15
  error?: {
16
- name?: string;
17
- message?: string;
18
- stack?: string;
16
+ name?: unknown;
17
+ message?: unknown;
18
+ stack?: unknown;
19
19
  };
20
20
  };
21
21
  /**
@@ -27,7 +27,9 @@ export declare function translateUnzipDiagnostic(record: DiagnosticRecord | null
27
27
  * Translates a `V2RenderReadinessDiagnostic`-shaped object (render stage)
28
28
  * into a public diagnostic payload, or `null` if out of scope.
29
29
  */
30
- export declare function translateRenderReadinessDiagnostic(diag: RenderReadinessDiagnostic | null | undefined, ctx?: DiagnosticTranslationContext): SuperDocExceptionDiagnosticPayload | null;
30
+ export declare function translateRenderReadinessDiagnostic(diag: RenderReadinessDiagnostic | null | undefined, ctx?: DiagnosticTranslationContext): (SuperDocExceptionDiagnosticPayload & {
31
+ error: Error;
32
+ }) | null;
31
33
  /**
32
34
  * Translates a boot/open failure into a public diagnostic payload, or
33
35
  * `null` if out of scope.
@@ -1,6 +1,16 @@
1
1
  import { PropType } from 'vue';
2
2
  import { HeaderFooterKind, HeaderFooterPageNumberAlignment, HeaderFooterPageNumbersInfo, SectionPageNumberingFormat } from '../../../../../document-api/src/index.js';
3
3
  import { CommandExecutionResult, CommandState } from '../../../public/ui/types.js';
4
+ type CommandReceipt = Exclude<CommandExecutionResult, boolean>;
5
+ type FailedCommandReceipt = Extract<CommandReceipt, {
6
+ success: false;
7
+ }>;
8
+ type PageNumberCommandResult = boolean | Pick<Extract<CommandReceipt, {
9
+ success: true;
10
+ }>, 'success'> | (Pick<FailedCommandReceipt, 'success'> & {
11
+ failure: Pick<FailedCommandReceipt['failure'], 'code' | 'details'>;
12
+ });
13
+ type PageNumberCommandState = Pick<CommandState, 'enabled'> & Partial<CommandState>;
4
14
  type PagePosition = 'top' | 'bottom';
5
15
  interface PageNumberChoice {
6
16
  position: PagePosition;
@@ -26,12 +36,12 @@ type PageNumberMenuOutcome = {
26
36
  declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
27
37
  /** Command state of `page-numbers-apply`, read when the popover opens. */
28
38
  pageNumbersState: {
29
- type: PropType<CommandState | null>;
39
+ type: PropType<PageNumberCommandState | null>;
30
40
  default: null;
31
41
  };
32
42
  /** Command state of `page-number-insert` (insert at the header/footer cursor). */
33
43
  atCursorState: {
34
- type: PropType<CommandState | null>;
44
+ type: PropType<PageNumberCommandState | null>;
35
45
  default: null;
36
46
  };
37
47
  /** Header/footer structure cannot be suggested, so numbering needs Editing. */
@@ -51,17 +61,17 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
51
61
  };
52
62
  /** Runs `page-numbers-apply` with `{ position, alignment?, showOnFirstPage?, format?, start? }`. */
53
63
  applyPageNumbers: {
54
- type: PropType<(choice: PageNumberChoice) => Promise<CommandExecutionResult>>;
64
+ type: PropType<(choice: PageNumberChoice) => Promise<PageNumberCommandResult>>;
55
65
  required: true;
56
66
  };
57
67
  /** Runs `page-numbers-remove`. */
58
68
  removePageNumbers: {
59
- type: PropType<() => Promise<CommandExecutionResult>>;
69
+ type: PropType<() => Promise<PageNumberCommandResult>>;
60
70
  required: true;
61
71
  };
62
72
  /** Runs `page-number-insert` at the header/footer cursor. */
63
73
  insertAtCursor: {
64
- type: PropType<() => Promise<CommandExecutionResult>>;
74
+ type: PropType<() => Promise<PageNumberCommandResult>>;
65
75
  required: true;
66
76
  };
67
77
  /** Closes the popover after a successful action. */
@@ -71,18 +81,18 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
71
81
  };
72
82
  /** Last choice made in this session, used when the section has no numbers yet. */
73
83
  initialChoice: {
74
- type: PropType<RememberedChoice | null>;
84
+ type: PropType<Partial<RememberedChoice> | null>;
75
85
  default: null;
76
86
  };
77
87
  }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
78
88
  /** Command state of `page-numbers-apply`, read when the popover opens. */
79
89
  pageNumbersState: {
80
- type: PropType<CommandState | null>;
90
+ type: PropType<PageNumberCommandState | null>;
81
91
  default: null;
82
92
  };
83
93
  /** Command state of `page-number-insert` (insert at the header/footer cursor). */
84
94
  atCursorState: {
85
- type: PropType<CommandState | null>;
95
+ type: PropType<PageNumberCommandState | null>;
86
96
  default: null;
87
97
  };
88
98
  /** Header/footer structure cannot be suggested, so numbering needs Editing. */
@@ -102,17 +112,17 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
102
112
  };
103
113
  /** Runs `page-numbers-apply` with `{ position, alignment?, showOnFirstPage?, format?, start? }`. */
104
114
  applyPageNumbers: {
105
- type: PropType<(choice: PageNumberChoice) => Promise<CommandExecutionResult>>;
115
+ type: PropType<(choice: PageNumberChoice) => Promise<PageNumberCommandResult>>;
106
116
  required: true;
107
117
  };
108
118
  /** Runs `page-numbers-remove`. */
109
119
  removePageNumbers: {
110
- type: PropType<() => Promise<CommandExecutionResult>>;
120
+ type: PropType<() => Promise<PageNumberCommandResult>>;
111
121
  required: true;
112
122
  };
113
123
  /** Runs `page-number-insert` at the header/footer cursor. */
114
124
  insertAtCursor: {
115
- type: PropType<() => Promise<CommandExecutionResult>>;
125
+ type: PropType<() => Promise<PageNumberCommandResult>>;
116
126
  required: true;
117
127
  };
118
128
  /** Closes the popover after a successful action. */
@@ -122,15 +132,15 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
122
132
  };
123
133
  /** Last choice made in this session, used when the section has no numbers yet. */
124
134
  initialChoice: {
125
- type: PropType<RememberedChoice | null>;
135
+ type: PropType<Partial<RememberedChoice> | null>;
126
136
  default: null;
127
137
  };
128
138
  }>> & Readonly<{}>, {
129
139
  suggesting: boolean;
130
- pageNumbersState: CommandState | null;
131
- atCursorState: CommandState | null;
140
+ pageNumbersState: PageNumberCommandState | null;
141
+ atCursorState: PageNumberCommandState | null;
132
142
  inHeaderFooter: boolean;
133
143
  loadCurrent: () => Promise<HeaderFooterPageNumbersInfo | null>;
134
- initialChoice: RememberedChoice | null;
144
+ initialChoice: Partial<RememberedChoice> | null;
135
145
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
136
146
  export default _default;
@@ -1,7 +1,8 @@
1
1
  import { DocumentFontOption, FontFamilyOption } from '../../../../../shared/font-system/src/index.js';
2
2
  import { ToolbarFontOption } from '../../../core/types/index.js';
3
3
  export declare const TOOLBAR_FONTS: ToolbarFontOption[];
4
- export declare function composeToolbarFontOptions(documentOptions: readonly DocumentFontOption[] | null | undefined, configFonts?: readonly ToolbarFontOption[]): readonly ToolbarFontOption[] | undefined;
4
+ type ToolbarDocumentFontOption = Pick<DocumentFontOption, 'logicalFamily' | 'previewFamily'>;
5
+ export declare function composeToolbarFontOptions(documentOptions: readonly ToolbarDocumentFontOption[] | null | undefined, configFonts?: readonly ToolbarFontOption[]): readonly ToolbarFontOption[] | undefined;
5
6
  export declare function mapFontFamilyOptionsToToolbar(options: readonly FontFamilyOption[] | null | undefined): ToolbarFontOption[] | undefined;
6
7
  export declare const TOOLBAR_FONT_SIZES: {
7
8
  label: string;
@@ -16,3 +17,4 @@ export declare const RESPONSIVE_BREAKPOINTS: {
16
17
  lg: number;
17
18
  xl: number;
18
19
  };
20
+ export {};
@@ -1 +1,15 @@
1
- export function normalizeFontOption(option: any): any;
1
+ import { ToolbarFontOption } from '../../../core/types/index.js';
2
+ /**
3
+ * Normalize a font dropdown option so each row renders in its own typeface.
4
+ *
5
+ * Consumers can pass a minimal `{ label, key }` shape. The toolbar dropdown
6
+ * spreads `option.props` onto each rendered `<li>`, so without an inline
7
+ * `style.fontFamily` every row inherits the toolbar's UI font and the
8
+ * dropdown loses its visual font preview. This fills that in from
9
+ * `props.style.fontFamily` → `label` → `key` and keeps the existing
10
+ * `data-item` hook that e2e selectors rely on.
11
+ *
12
+ * Idempotent: if `props.style.fontFamily` and `data-item` are already set,
13
+ * the option is returned with those values preserved.
14
+ */
15
+ export declare const normalizeFontOption: <T extends ToolbarFontOption>(option: T) => T;
@@ -1,11 +1,41 @@
1
- export function findPrefixMatchIndex(query: string, labels: ReadonlyArray<string>): number;
2
- export function computeTypeahead(query: string, labels: ReadonlyArray<string>, { autocomplete }?: {
3
- autocomplete?: boolean;
4
- }): {
1
+ /**
2
+ * Pure typeahead/autocomplete helpers for the font comboboxes (family + size).
3
+ *
4
+ * Matching is case-insensitive prefix matching on the logical font labels.
5
+ * Space is a normal query character, so the query is never split on spaces;
6
+ * only the outer whitespace is ignored when comparing.
7
+ *
8
+ * These functions hold no Vue or DOM state so CI can unit-test them in isolation.
9
+ */
10
+ interface TypeaheadResult {
5
11
  matchIndex: number;
6
12
  display: string;
7
13
  selectionStart: number;
8
14
  selectionEnd: number;
9
- };
10
- export function normalizeCustomFontFamily(value: any): string;
11
- export function normalizeCustomFontSize(value: string): string;
15
+ }
16
+ /**
17
+ * Index of the first label that starts with `query` (case-insensitive).
18
+ * An empty/whitespace query never matches. Returns the matching index or -1.
19
+ */
20
+ export declare const findPrefixMatchIndex: (query: string, labels: ReadonlyArray<string>) => number;
21
+ /**
22
+ * Resolve what the input should display after a keystroke.
23
+ *
24
+ * When `autocomplete` is true and a prefix match exists that is longer than the
25
+ * typed query, the completion is shown with the suffix selected so the next
26
+ * keystroke replaces it. When false (deletion) or no match exists, the raw
27
+ * query is shown with the caret at its end. `query` is the user-typed portion.
28
+ */
29
+ export declare const computeTypeahead: (query: string, labels: ReadonlyArray<string>, { autocomplete }?: {
30
+ autocomplete?: boolean;
31
+ }) => TypeaheadResult;
32
+ export declare const normalizeCustomFontFamily: (value: unknown) => string;
33
+ /**
34
+ * Normalize a typed font size to a supported point-size string.
35
+ * Parses the numeric value (ignoring any unit suffix) keeping its sign, rounds to
36
+ * the nearest half point (DOCX/Word support half points such as 10.5), and clamps
37
+ * to the supported range. Returns '' when nothing usable was typed, including
38
+ * negative or sub-minimum values.
39
+ */
40
+ export declare const normalizeCustomFontSize: (value: unknown) => string;
41
+ export {};
@@ -1,5 +1,11 @@
1
- export function isOffValue(value: unknown): boolean;
2
- /** @type {Record<string, (attrs?: Record<string, unknown>) => boolean>} */
3
- export const negationChecks: Record<string, (attrs?: Record<string, unknown>) => boolean>;
4
- export function isNegatedMark(name: string, attrs?: Record<string, unknown>): boolean;
1
+ type MarkAttrs = Record<string, unknown>;
2
+ /**
3
+ * Normalize "off" values used by cascade-aware formatting marks.
4
+ */
5
+ export declare const isOffValue: (value: unknown) => boolean;
6
+ export declare const negationChecks: Record<string, (attrs?: MarkAttrs) => boolean>;
7
+ /**
8
+ * Determine whether a mark is currently negated (explicitly turning formatting off).
9
+ */
10
+ export declare const isNegatedMark: (name: string, attrs?: MarkAttrs) => boolean;
5
11
  export default isNegatedMark;
@@ -1 +1,12 @@
1
- export function findElementBySelector(selector: string | HTMLElement | null | undefined): HTMLElement | null;
1
+ /**
2
+ * Minimal DOM helpers for the built-in toolbar shell.
3
+ *
4
+ * The v1 toolbar's `helpers/general.js` also exported a converter-backed
5
+ * paragraph-font-family fallback; that path depended on private v1 editor
6
+ * internals (`@core/super-converter`) and is intentionally dropped on V2, where
7
+ * font-family active state comes from the shared command controller snapshot.
8
+ */
9
+ /**
10
+ * Resolve a toolbar mount target from a selector string or element id.
11
+ */
12
+ export declare const findElementBySelector: (selector: string | HTMLElement | null | undefined) => HTMLElement | null;
@@ -1,5 +1,10 @@
1
- export function sanitizeNumber(value: any, defaultNumber: any): any;
2
- export function throttle(func: any, wait: any, options: any): {
3
- (...callArgs: any[]): any;
4
- cancel(): void;
1
+ interface ThrottleOptions {
2
+ leading?: boolean;
3
+ trailing?: boolean;
4
+ }
5
+ type Throttled<Args extends unknown[], Result> = ((...args: Args) => Result | undefined) & {
6
+ cancel: () => void;
5
7
  };
8
+ declare const sanitizeNumber: (value: unknown, defaultNumber: number) => number;
9
+ declare const throttle: <Args extends unknown[], Result>(func: (...args: Args) => Result, wait: number, options?: ThrottleOptions) => Throttled<Args, Result>;
10
+ export { sanitizeNumber, throttle };
@@ -1,9 +1,9 @@
1
- export const bulletStyleButtons: {
1
+ export declare const bulletStyleButtons: {
2
2
  key: string;
3
3
  icon: string;
4
4
  ariaLabel: string;
5
5
  }[];
6
- export const numberedStyleButtons: {
6
+ export declare const numberedStyleButtons: {
7
7
  key: string;
8
8
  icon: string;
9
9
  ariaLabel: string;
@@ -1,10 +1,9 @@
1
+ import { HeaderFooterKind } from '../../../../../document-api/src/index.js';
1
2
  /**
2
3
  * Briefly highlight the painted header or footer regions that are on screen,
3
4
  * so the user sees where page numbers landed without the caret leaving the
4
5
  * body. Regions are read after the repaint that follows the mutation; nothing
5
- * happens when none is visible or the host is unavailable.
6
- *
7
- * @param {HTMLElement | null | undefined} host Document viewport host element.
8
- * @param {'header' | 'footer'} kind
6
+ * happens when none is visible or the host is unavailable. `host` is the
7
+ * document viewport host element.
9
8
  */
10
- export function flashPageNumberRegions(host: HTMLElement | null | undefined, kind: "header" | "footer"): Promise<void>;
9
+ export declare function flashPageNumberRegions(host: HTMLElement | null | undefined, kind: HeaderFooterKind): Promise<void>;
@@ -1,4 +1,3 @@
1
- export function scrollToElement(targetElement: any, options?: {
2
- behavior: string;
3
- block: string;
4
- }): void;
1
+ type ScrollOptions = Pick<ScrollIntoViewOptions, 'behavior' | 'block'>;
2
+ export declare function scrollToElement(targetElement: HTMLElement | null | undefined, options?: ScrollOptions): void;
3
+ export {};