superdoc 2.29.0-next.3 → 2.29.0-next.9

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 (128) hide show
  1. package/dist/chunks/{PdfViewer-boENOZdF.cjs → PdfViewer-DmSkZehl.cjs} +70 -99
  2. package/dist/chunks/{PdfViewer-D4lVeOJu.es.js → PdfViewer-aOWhUVI7.es.js} +67 -96
  3. package/dist/chunks/{constants-DpXuDx_g.cjs → constants-BeeNZoQp.cjs} +1 -1
  4. package/dist/chunks/{constants-B6VBlmKp.es.js → constants-BvNs_ybI.es.js} +1 -1
  5. package/dist/chunks/{create-super-doc-ui-BFt8agAI.es.js → create-super-doc-ui-Bm5kmx0W.es.js} +12 -29
  6. package/dist/chunks/{create-super-doc-ui-BAGOnYGM.cjs → create-super-doc-ui-DN70aatf.cjs} +17 -28
  7. package/dist/collaboration-upgrade-engine.cjs +1 -1
  8. package/dist/collaboration-upgrade-engine.es.js +1 -1
  9. package/dist/document-api/src/capabilities/html-markdown-support.d.ts +4 -6
  10. package/dist/document-api/src/comments/comments.d.ts +2 -0
  11. package/dist/document-api/src/contract/operation-definitions.d.ts +2 -2
  12. package/dist/document-api/src/contract/operation-registry.d.ts +10 -9
  13. package/dist/document-api/src/index.d.ts +8 -7
  14. package/dist/document-api/src/insert/insert.d.ts +2 -2
  15. package/dist/document-api/src/replace/replace.d.ts +3 -2
  16. package/dist/document-api/src/types/address.d.ts +3 -0
  17. package/dist/document-api/src/types/temporary-mutation.d.ts +5 -1
  18. package/dist/document-api/src/write/write.d.ts +12 -6
  19. package/dist/public/ui-react.cjs +1 -1
  20. package/dist/public/ui-react.es.js +1 -1
  21. package/dist/public/ui-vue.cjs +1 -1
  22. package/dist/public/ui-vue.es.js +1 -1
  23. package/dist/public/ui.cjs +1 -1
  24. package/dist/public/ui.es.js +1 -1
  25. package/dist/style.css +1 -1
  26. package/dist/style.layered.css +1 -1
  27. package/dist/superdoc/src/SuperDoc.vue.d.ts +132 -58
  28. package/dist/superdoc/src/components/CommentsLayer/CommentDialog.vue.d.ts +28 -13
  29. package/dist/superdoc/src/components/CommentsLayer/floating-comment-positioning.d.ts +24 -23
  30. package/dist/superdoc/src/components/CommentsLayer/tracked-change-threading.d.ts +0 -1
  31. package/dist/superdoc/src/components/CommentsLayer/use-comment.d.ts +28 -13
  32. package/dist/superdoc/src/components/PdfViewer/PdfViewer.vue.d.ts +132 -45
  33. package/dist/superdoc/src/components/PdfViewer/PdfViewerDocument.vue.d.ts +62 -16
  34. package/dist/superdoc/src/components/PdfViewer/PdfViewerPage.vue.d.ts +77 -17
  35. package/dist/superdoc/src/components/PdfViewer/pdf-viewer-types.d.ts +45 -0
  36. package/dist/superdoc/src/components/Whiteboard/WhiteboardLayer.vue.d.ts +81 -16
  37. package/dist/superdoc/src/components/Whiteboard/WhiteboardPage.vue.d.ts +49 -13
  38. package/dist/superdoc/src/components/Whiteboard/use-whiteboard.d.ts +30 -15
  39. package/dist/superdoc/src/components/Whiteboard/whiteboard-types.d.ts +11 -0
  40. package/dist/superdoc/src/components/surfaces/focusable-selector.d.ts +1 -5
  41. package/dist/superdoc/src/composables/find-shortcut-owner.d.ts +16 -9
  42. package/dist/superdoc/src/composables/replace-continuation.d.ts +11 -15
  43. package/dist/superdoc/src/composables/use-document.d.ts +1210 -30
  44. package/dist/superdoc/src/composables/use-field.d.ts +88 -25
  45. package/dist/superdoc/src/composables/use-password-prompt.d.ts +23 -24
  46. package/dist/superdoc/src/composables/useUiFontFamily.d.ts +3 -11
  47. package/dist/superdoc/src/core/SuperDoc.d.ts +1 -1
  48. package/dist/superdoc/src/core/collaboration/collaboration-comments.d.ts +9 -4
  49. package/dist/superdoc/src/core/collaboration/helpers.d.ts +20 -3
  50. package/dist/superdoc/src/core/collaboration/permissions.d.ts +15 -10
  51. package/dist/superdoc/src/core/collaboration/resolve-v2-collaboration-target.d.ts +4 -3
  52. package/dist/superdoc/src/core/collaboration/v2-awareness-bridge.d.ts +2 -1
  53. package/dist/superdoc/src/core/config/merge-comments-config.d.ts +1 -5
  54. package/dist/superdoc/src/core/config/merge-defined.d.ts +3 -8
  55. package/dist/superdoc/src/core/config/normalize-hyperlinks-config.d.ts +7 -12
  56. package/dist/superdoc/src/core/config/normalize-surfaces-config.d.ts +9 -12
  57. package/dist/superdoc/src/core/config/normalize-ui-config.d.ts +1 -12
  58. package/dist/superdoc/src/core/create-app.d.ts +13 -24
  59. package/dist/superdoc/src/core/editor-runtime/conformance/fake-v2-runtime.d.ts +2 -1
  60. package/dist/superdoc/src/core/editor-runtime/editor-runtime-registry.d.ts +2 -1
  61. package/dist/superdoc/src/core/editor-runtime/index.d.ts +1 -1
  62. package/dist/superdoc/src/core/editor-runtime/types.d.ts +2 -1
  63. package/dist/superdoc/src/core/editor-runtime/v2/v2-session-shortcut-routes.d.ts +1 -1
  64. package/dist/superdoc/src/core/helpers/export.d.ts +3 -2
  65. package/dist/superdoc/src/core/helpers/file.d.ts +8 -45
  66. package/dist/superdoc/src/core/helpers/normalize-track-changes-config.d.ts +6 -60
  67. package/dist/superdoc/src/core/pdf/helpers/constants.d.ts +2 -2
  68. package/dist/superdoc/src/core/pdf/helpers/floor.d.ts +1 -1
  69. package/dist/superdoc/src/core/pdf/helpers/range.d.ts +1 -1
  70. package/dist/superdoc/src/core/pdf/helpers/read-file.d.ts +1 -1
  71. package/dist/superdoc/src/core/pdf/pdf-adapter.d.ts +24 -61
  72. package/dist/superdoc/src/core/superdoc-ui-owner.d.ts +1 -1
  73. package/dist/superdoc/src/core/surface-manager.d.ts +21 -83
  74. package/dist/superdoc/src/core/types/index.d.ts +4 -19
  75. package/dist/superdoc/src/core/v2-integration/v2-integration.d.ts +10 -10
  76. package/dist/superdoc/src/core/whiteboard/Whiteboard.d.ts +22 -208
  77. package/dist/superdoc/src/core/whiteboard/WhiteboardPage.d.ts +163 -189
  78. package/dist/superdoc/src/core/whiteboard/helpers/createTextarea.d.ts +14 -1
  79. package/dist/superdoc/src/core/whiteboard/helpers/flattenPoints.d.ts +1 -1
  80. package/dist/superdoc/src/core/whiteboard/helpers/getRandomId.d.ts +1 -1
  81. package/dist/superdoc/src/helpers/comment-focus.d.ts +21 -4
  82. package/dist/superdoc/src/helpers/deprecation.d.ts +5 -11
  83. package/dist/superdoc/src/helpers/interaction-trace.d.ts +7 -24
  84. package/dist/superdoc/src/helpers/mark-raw-component.d.ts +1 -0
  85. package/dist/superdoc/src/helpers/object-guards.d.ts +1 -5
  86. package/dist/superdoc/src/helpers/selection-source.d.ts +1 -1
  87. package/dist/superdoc/src/helpers/use-selection.d.ts +35 -15
  88. package/dist/superdoc/src/internal/diagnostics/diagnostic-dedupe.d.ts +6 -15
  89. package/dist/superdoc/src/internal/toolbar/built-in/AIWriter.vue.d.ts +2 -2
  90. package/dist/superdoc/src/internal/toolbar/built-in/ButtonGroup.vue.d.ts +4 -24
  91. package/dist/superdoc/src/internal/toolbar/built-in/FontFamilyCombobox.vue.d.ts +34 -0
  92. package/dist/superdoc/src/internal/toolbar/built-in/FontSizeCombobox.vue.d.ts +34 -0
  93. package/dist/superdoc/src/internal/toolbar/built-in/LinkInput.vue.d.ts +1 -1
  94. package/dist/superdoc/src/internal/toolbar/built-in/Toolbar.vue.d.ts +9 -3
  95. package/dist/superdoc/src/internal/toolbar/built-in/ToolbarComboBox.vue.d.ts +12 -14
  96. package/dist/superdoc/src/internal/toolbar/built-in/ToolbarDropdown.vue.d.ts +1 -11
  97. package/dist/superdoc/src/internal/toolbar/built-in/color-dropdown-helpers.d.ts +9 -19
  98. package/dist/superdoc/src/internal/toolbar/built-in/constants.d.ts +12 -45
  99. package/dist/superdoc/src/internal/toolbar/built-in/default-items.d.ts +34 -17
  100. package/dist/superdoc/src/internal/toolbar/built-in/toolbar-focus-helpers.d.ts +10 -2
  101. package/dist/superdoc/src/internal/toolbar/built-in/toolbarTexts.d.ts +61 -61
  102. package/dist/superdoc/src/internal/toolbar/built-in/use-toolbar-item.d.ts +110 -48
  103. package/dist/superdoc/src/internal/toolbar/built-in-toolbar.d.ts +7 -27
  104. package/dist/superdoc/src/internal/toolbar/compatibility-catalog.d.ts +4 -3
  105. package/dist/superdoc/src/internal/toolbar/toolbar-item-aliases.d.ts +1 -1
  106. package/dist/superdoc/src/public/browser-document-api.d.ts +5 -4
  107. package/dist/superdoc/src/public/index.d.cts +26 -0
  108. package/dist/superdoc/src/public/index.d.ts +13 -0
  109. package/dist/superdoc/src/public/ui/commands.d.ts +14 -13
  110. package/dist/superdoc/src/public/ui/create-super-doc-ui.d.ts +1 -1
  111. package/dist/superdoc/src/public/ui/entity-at.d.ts +2 -1
  112. package/dist/superdoc/src/public/ui/style-match-patch.d.ts +2 -2
  113. package/dist/superdoc/src/public/ui/types.d.ts +1 -1
  114. package/dist/superdoc/src/stores/comments-store.d.ts +225 -99
  115. package/dist/superdoc/src/stores/helpers/comment-grouping.d.ts +30 -0
  116. package/dist/superdoc/src/stores/helpers/comment-identity.d.ts +40 -0
  117. package/dist/superdoc/src/stores/helpers/floating-comment-instances.d.ts +48 -13
  118. package/dist/superdoc/src/stores/helpers/tracked-change-identity.d.ts +19 -0
  119. package/dist/superdoc/src/stores/helpers/tracked-change-row-values.d.ts +0 -4
  120. package/dist/superdoc/src/stores/helpers/tracked-change-thread-index.d.ts +21 -24
  121. package/dist/superdoc/src/stores/superdoc-store.d.ts +676 -298
  122. package/dist/superdoc.cjs +1325 -2262
  123. package/dist/superdoc.es.js +1321 -2259
  124. package/dist-cdn/style.layered.css +1 -1
  125. package/dist-cdn/superdoc.min.css +1 -1
  126. package/dist-cdn/superdoc.min.js +42 -42
  127. package/package.json +2 -2
  128. package/dist/superdoc/src/internal/toolbar/index.d.ts +0 -10
@@ -1,4 +1,21 @@
1
- export function getPreferredCommentFocusTargetClientY(): number;
2
- export function getVisibleThreadAnchorClientY(layersElement: any, positionEntry: any): any;
3
- export function getVisibleThreadHighlightClientY(threadIds: any): any;
4
- export function scrollThreadAnchorToFocusTarget(presentation: any, primaryThreadId: any, fallbackThreadId: any, targetClientY: any): any;
1
+ type ClientRectSource = {
2
+ getBoundingClientRect?: () => {
3
+ top: number;
4
+ };
5
+ };
6
+ type ThreadPositionEntry = {
7
+ bounds?: {
8
+ top?: number;
9
+ } | null;
10
+ } | null | undefined;
11
+ type ThreadAnchorPresentation = {
12
+ getReachableThreadAnchorClientY: (threadId: string, targetClientY: number) => number | null | undefined;
13
+ scrollThreadAnchorToClientY: (threadId: string, targetClientY: number, options: {
14
+ behavior: ScrollBehavior;
15
+ }) => boolean | null | undefined;
16
+ };
17
+ export declare const getPreferredCommentFocusTargetClientY: () => number;
18
+ export declare const getVisibleThreadAnchorClientY: (layersElement: ClientRectSource | null | undefined, positionEntry: ThreadPositionEntry) => number | null;
19
+ export declare const getVisibleThreadHighlightClientY: (threadIds: ReadonlyArray<string | number | null | undefined> | null | undefined) => number | null;
20
+ export declare const scrollThreadAnchorToFocusTarget: (presentation: ThreadAnchorPresentation | null | undefined, primaryThreadId: string | null | undefined, fallbackThreadId: string | null | undefined, targetClientY: number | null | undefined) => number | null;
21
+ export {};
@@ -1,9 +1,8 @@
1
+ import { Editor } from '../core/types/index.js';
1
2
  /**
2
3
  * Log a console.warn once per key. Subsequent calls with the same key are no-ops.
3
- * @param {string} key
4
- * @param {string} message
5
4
  */
6
- export function warnOnce(key: string, message: string): void;
5
+ export declare function warnOnce(key: string, message: string): void;
7
6
  /**
8
7
  * Wrap an Editor instance in a Proxy that emits one-time deprecation
9
8
  * warnings when consumers access ProseMirror internals or editor commands.
@@ -11,16 +10,11 @@ export function warnOnce(key: string, message: string): void;
11
10
  * The proxy is fully transparent — all property access and method calls are
12
11
  * forwarded to the underlying editor. Only the warning side-effect is added.
13
12
  *
14
- * @param {import('../core/types/index.js').Editor} editor
15
- * @returns {import('../core/types/index.js').Editor} Proxied editor (or the
16
- * original if null/already wrapped)
13
+ * @returns Proxied editor (or the original if null/already wrapped)
17
14
  */
18
- export function createDeprecatedEditorProxy(editor: import('../core/types/index.js').Editor): import('../core/types/index.js').Editor;
15
+ export declare function createDeprecatedEditorProxy<T extends Editor | null | undefined>(editor: T): T;
19
16
  /**
20
17
  * Unwrap a potentially proxied editor back to the raw Editor instance.
21
18
  * Safe to call on an already-raw editor — returns it unchanged.
22
- *
23
- * @param {import('../core/types/index.js').Editor | null | undefined} editor
24
- * @returns {import('../core/types/index.js').Editor | null | undefined}
25
19
  */
26
- export function unwrapEditor(editor: import('../core/types/index.js').Editor | null | undefined): import('../core/types/index.js').Editor | null | undefined;
20
+ export declare function unwrapEditor(editor: Editor | null | undefined): Editor | null | undefined;
@@ -1,26 +1,9 @@
1
- /**
2
- * @param {string} stage
3
- * @param {string} branch
4
- * @param {Record<string, unknown> | undefined} [meta]
5
- * @returns {{ traceId: string, spanId: string } | null}
6
- */
7
- export function startInteractionSpan(stage: string, branch: string, meta?: Record<string, unknown> | undefined): {
1
+ type InteractionSpan = {
8
2
  traceId: string;
9
3
  spanId: string;
10
- } | null;
11
- /**
12
- * @param {{ traceId: string, spanId: string } | null | undefined} span
13
- * @param {Record<string, unknown> | undefined} [meta]
14
- */
15
- export function endInteractionSpan(span: {
16
- traceId: string;
17
- spanId: string;
18
- } | null | undefined, meta?: Record<string, unknown> | undefined): void;
19
- /**
20
- * @param {string} stage
21
- * @param {string} branch
22
- * @param {Record<string, unknown> | undefined} meta
23
- * @param {() => any} fn
24
- * @returns {any}
25
- */
26
- export function withInteractionSpan(stage: string, branch: string, meta: Record<string, unknown> | undefined, fn: () => any): any;
4
+ };
5
+ type InteractionMeta = Record<string, unknown> | undefined;
6
+ export declare function startInteractionSpan(stage: string, branch: string, meta?: InteractionMeta): InteractionSpan | null;
7
+ export declare function endInteractionSpan(span: InteractionSpan | null | undefined, meta?: InteractionMeta): void;
8
+ export declare function withInteractionSpan<T>(stage: string, branch: string, meta: InteractionMeta, fn: () => T): T;
9
+ export {};
@@ -0,0 +1 @@
1
+ export declare function markRawComponent(component: unknown): unknown;
@@ -1,5 +1 @@
1
- /**
2
- * @param {unknown} value
3
- * @returns {value is Record<string, unknown>}
4
- */
5
- export function isPlainObject(value: unknown): value is Record<string, unknown>;
1
+ export declare function isPlainObject(value: unknown): value is Record<string, unknown>;
@@ -1 +1 @@
1
- export const DOCUMENT_EDITOR_SELECTION_SOURCE: "document-editor";
1
+ export declare const DOCUMENT_EDITOR_SELECTION_SOURCE = "document-editor";
@@ -1,17 +1,37 @@
1
- export default function useSelection(params: any): {
2
- documentId: import('vue').Ref<any, any>;
3
- page: import('vue').Ref<any, any>;
4
- selectionBounds: any;
5
- source: import('vue').Ref<any, any>;
6
- getValues: () => {
7
- documentId: any;
8
- page: any;
9
- selectionBounds: any;
10
- source: any;
11
- };
1
+ import { Ref } from 'vue';
2
+ type SelectionBounds = {
3
+ top?: number;
4
+ left?: number;
5
+ right?: number;
6
+ bottom?: number;
7
+ };
8
+ type UseSelectionParams = {
9
+ documentId?: unknown;
10
+ page?: number;
11
+ selectionBounds?: SelectionBounds | null;
12
+ source?: string | null;
13
+ };
14
+ type ContainerLocation = {
15
+ top: number;
16
+ left: number;
17
+ };
18
+ type SelectionValues<Bounds extends SelectionBounds> = {
19
+ documentId: unknown;
20
+ page: number | undefined;
21
+ selectionBounds: Bounds;
22
+ source: string | null | undefined;
23
+ };
24
+ type SelectionModel<Bounds extends SelectionBounds> = {
25
+ documentId: Ref<unknown>;
26
+ page: Ref<number | undefined>;
27
+ selectionBounds: Bounds;
28
+ source: Ref<string | null | undefined>;
29
+ getValues: () => SelectionValues<Bounds>;
12
30
  getContainerId: () => string;
13
- getContainerLocation: (parentContainer: any) => {
14
- top: number;
15
- left: number;
16
- };
31
+ getContainerLocation: (parentContainer: Pick<Element, 'getBoundingClientRect'> | null | undefined) => ContainerLocation;
17
32
  };
33
+ export default function useSelection<Bounds extends SelectionBounds>(params: UseSelectionParams & {
34
+ selectionBounds: Bounds;
35
+ }): SelectionModel<Bounds>;
36
+ export default function useSelection(params: UseSelectionParams): SelectionModel<SelectionBounds>;
37
+ export {};
@@ -11,13 +11,13 @@
11
11
  * come from the shell, not be inferred from `onV2EditorReady` timing: that
12
12
  * event only fires on success, fires AFTER the diagnostics events on the
13
13
  * success path, and never fires at all for a failed attempt.
14
- *
15
- * @param {{generation?: unknown} | null} [payload]
16
- * @returns {number}
17
14
  */
18
- export function getV2DiagnosticGeneration(payload?: {
15
+ export declare function getV2DiagnosticGeneration(payload?: {
19
16
  generation?: unknown;
20
17
  } | null): number;
18
+ export interface V2DiagnosticDedupe {
19
+ shouldEmit(documentId: string | null | undefined, generation: number, internalCode: string | null | undefined): boolean;
20
+ }
21
21
  /**
22
22
  * Creates a dedupe tracker for diagnostic emissions, scoped by documentId
23
23
  * and generation. The key is `internalCode` only (per active generation) --
@@ -43,12 +43,8 @@ export function getV2DiagnosticGeneration(payload?: {
43
43
  * a long-lived SuperDoc instance's life (e.g. a document-management app
44
44
  * cycling through many files); evicting on document removal would need to
45
45
  * hook document-lifecycle wiring, which is out of scope here.
46
- *
47
- * @returns {{ shouldEmit: (documentId: string | null | undefined, generation: number, internalCode: string | null | undefined) => boolean }}
48
46
  */
49
- export function createV2DiagnosticDedupe(): {
50
- shouldEmit: (documentId: string | null | undefined, generation: number, internalCode: string | null | undefined) => boolean;
51
- };
47
+ export declare function createV2DiagnosticDedupe(): V2DiagnosticDedupe;
52
48
  /**
53
49
  * A single boot failure can translate to a generic reason-based diagnostic
54
50
  * (`translateBootFailureReason`, e.g. `source-load-failed` -> `PARSE_ERROR`)
@@ -61,12 +57,7 @@ export function createV2DiagnosticDedupe(): {
61
57
  * `bootErrorName`-classified diagnostic (render-pipeline signal, not
62
58
  * package-integrity) is never redundant this way, since it carries genuinely
63
59
  * distinct information from the package diagnostics.
64
- *
65
- * @param {{internalCode?: string} | null} bootDiagnostic
66
- * @param {string} reason
67
- * @param {readonly unknown[]} translatedRecords
68
- * @returns {boolean}
69
60
  */
70
- export function isBootDiagnosticRedundant(bootDiagnostic: {
61
+ export declare function isBootDiagnosticRedundant(bootDiagnostic: {
71
62
  internalCode?: string;
72
63
  } | null, reason: string, translatedRecords: readonly unknown[]): boolean;
@@ -72,10 +72,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
72
72
  }>> & Readonly<{}>, {
73
73
  target: SelectionTarget | null;
74
74
  doc: AiWriterDocument | null;
75
- restoreSelection: () => void;
76
75
  selectedText: string;
77
- endpoint: string;
76
+ restoreSelection: () => void;
78
77
  apiKey: string;
78
+ endpoint: string;
79
79
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
80
80
  textareaRef: HTMLTextAreaElement;
81
81
  }, HTMLFormElement>;
@@ -1,27 +1,7 @@
1
- import { PropType, Ref, StyleValue } from 'vue';
2
- import { default as ToolbarButton } from './ToolbarButton.vue.js';
3
- import { default as ToolbarDropdown } from './ToolbarDropdown.vue.js';
4
- import { default as FontFamilyCombobox } from './FontFamilyCombobox.vue';
5
- type ButtonItem = InstanceType<typeof ToolbarButton>['$props']['toolbarItem'];
6
- type ComboBoxProps = InstanceType<typeof FontFamilyCombobox>['$props'];
7
- type ComboBoxItem = ComboBoxProps['item'];
8
- type ComboBoxCommand = Parameters<NonNullable<ComboBoxProps['onCommand']>>[0];
9
- type DropdownOption = NonNullable<InstanceType<typeof ToolbarDropdown>['$props']['options']>[number];
10
- export interface ToolbarGroupItem extends ButtonItem {
11
- type: string;
12
- id: Ref<string>;
13
- isNarrow: Ref<boolean | undefined>;
14
- isWide: Ref<boolean | undefined>;
15
- tooltip: Ref<string | undefined>;
16
- argument: Ref<unknown>;
17
- command?: unknown;
18
- splitButtonCommand?: unknown;
19
- restoreEditorFocus: boolean;
20
- dropdownStyles: Ref<StyleValue | undefined>;
21
- dropdownValueKey: Ref<string | undefined>;
22
- selectedValue: Ref<string | number | null | undefined>;
23
- nestedOptions: Ref<DropdownOption[]>;
24
- }
1
+ import { PropType } from 'vue';
2
+ import { ToolbarItem, ToolbarItemOption as DropdownOption } from '../built-in-toolbar.js';
3
+ import { ComboBoxCommand, ComboBoxItem } from './ToolbarComboBox.vue.js';
4
+ export type ToolbarGroupItem = Pick<ToolbarItem, 'type' | 'id' | 'name' | 'active' | 'icon' | 'label' | 'hideLabel' | 'iconColor' | 'hasCaret' | 'splitButton' | 'disabled' | 'expand' | 'inlineTextInputVisible' | 'hasInlineTextInput' | 'style' | 'attributes' | 'nestedOptions' | 'isNarrow' | 'isWide' | 'tooltip' | 'argument' | 'command' | 'splitButtonCommand' | 'restoreEditorFocus' | 'dropdownStyles' | 'dropdownValueKey' | 'selectedValue'>;
25
5
  export interface ToolbarGroupCommand {
26
6
  item: ToolbarGroupItem | ComboBoxItem;
27
7
  argument?: unknown;
@@ -0,0 +1,34 @@
1
+ import { PropType } from 'vue';
2
+ import { ComboBoxCommand, ComboBoxItem, ComboBoxTabOut } from './ToolbarComboBox.vue.js';
3
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
4
+ item: {
5
+ type: PropType<ComboBoxItem>;
6
+ required: true;
7
+ };
8
+ uiFontFamily: {
9
+ type: StringConstructor;
10
+ default: string;
11
+ };
12
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
13
+ command: (payload: ComboBoxCommand) => any;
14
+ "item-clicked": () => any;
15
+ "tab-out": (event: ComboBoxTabOut) => any;
16
+ "editor-handoff": () => any;
17
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
18
+ item: {
19
+ type: PropType<ComboBoxItem>;
20
+ required: true;
21
+ };
22
+ uiFontFamily: {
23
+ type: StringConstructor;
24
+ default: string;
25
+ };
26
+ }>> & Readonly<{
27
+ onCommand?: ((payload: ComboBoxCommand) => any) | undefined;
28
+ "onItem-clicked"?: (() => any) | undefined;
29
+ "onTab-out"?: ((event: ComboBoxTabOut) => any) | undefined;
30
+ "onEditor-handoff"?: (() => any) | undefined;
31
+ }>, {
32
+ uiFontFamily: string;
33
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
34
+ export default _default;
@@ -0,0 +1,34 @@
1
+ import { PropType } from 'vue';
2
+ import { ComboBoxCommand, ComboBoxItem, ComboBoxTabOut } from './ToolbarComboBox.vue.js';
3
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
4
+ item: {
5
+ type: PropType<ComboBoxItem>;
6
+ required: true;
7
+ };
8
+ uiFontFamily: {
9
+ type: StringConstructor;
10
+ default: string;
11
+ };
12
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
13
+ command: (payload: ComboBoxCommand) => any;
14
+ "item-clicked": () => any;
15
+ "tab-out": (event: ComboBoxTabOut) => any;
16
+ "editor-handoff": () => any;
17
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
18
+ item: {
19
+ type: PropType<ComboBoxItem>;
20
+ required: true;
21
+ };
22
+ uiFontFamily: {
23
+ type: StringConstructor;
24
+ default: string;
25
+ };
26
+ }>> & Readonly<{
27
+ onCommand?: ((payload: ComboBoxCommand) => any) | undefined;
28
+ "onItem-clicked"?: (() => any) | undefined;
29
+ "onTab-out"?: ((event: ComboBoxTabOut) => any) | undefined;
30
+ "onEditor-handoff"?: (() => any) | undefined;
31
+ }>, {
32
+ uiFontFamily: string;
33
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
34
+ export default _default;
@@ -171,7 +171,6 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
171
171
  ui: LinkInputUI | null;
172
172
  textTarget: object | null;
173
173
  hyperlinkTarget: object | null;
174
- restoreSelection: () => void;
175
174
  showInput: boolean;
176
175
  showLink: boolean;
177
176
  goToAnchor: (anchorUrl: string) => unknown;
@@ -180,5 +179,6 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
180
179
  clickedElement: HTMLElement | null;
181
180
  hyperlinkText: string | null;
182
181
  selectedText: string | null;
182
+ restoreSelection: () => void;
183
183
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
184
184
  export default _default;
@@ -1,6 +1,12 @@
1
- declare const _default: import('vue').DefineComponent<{}, {
2
- $emit: (event: "select" | "toggle" | "command", ...args: any[]) => void;
3
- }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
2
+ select: (...args: any[]) => void;
3
+ toggle: (...args: any[]) => void;
4
+ command: (...args: any[]) => void;
5
+ }, string, import('vue').PublicProps, Readonly<{}> & Readonly<{
6
+ onSelect?: ((...args: any[]) => any) | undefined;
7
+ onToggle?: ((...args: any[]) => any) | undefined;
8
+ onCommand?: ((...args: any[]) => any) | undefined;
9
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
4
10
  toolbarRoot: HTMLDivElement;
5
11
  }, HTMLDivElement>;
6
12
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, PropType, Ref, StyleValue } from 'vue';
2
- interface ComboBoxOption {
2
+ export interface ComboBoxOption {
3
3
  key: string;
4
4
  label: string;
5
5
  value?: string;
@@ -8,7 +8,7 @@ interface ComboBoxOption {
8
8
  [key: string]: unknown;
9
9
  };
10
10
  }
11
- interface ComboBoxItem {
11
+ export interface ComboBoxItem {
12
12
  id?: Ref<string>;
13
13
  name: Ref<string>;
14
14
  label?: Ref<string | number | null | undefined>;
@@ -25,6 +25,12 @@ interface TabOutTarget {
25
25
  shiftKey: boolean;
26
26
  target: HTMLInputElement | null;
27
27
  }
28
+ export type ComboBoxCommand = {
29
+ item: ComboBoxItem;
30
+ argument: string;
31
+ option: ComboBoxOption | null;
32
+ };
33
+ export type ComboBoxTabOut = KeyboardEvent | TabOutTarget;
28
34
  declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
29
35
  item: {
30
36
  type: PropType<ComboBoxItem>;
@@ -43,13 +49,9 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
43
49
  default: (value: string) => string;
44
50
  };
45
51
  }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
46
- command: (payload: {
47
- item: ComboBoxItem;
48
- argument: string;
49
- option: ComboBoxOption | null;
50
- }) => any;
52
+ command: (payload: ComboBoxCommand) => any;
51
53
  "item-clicked": () => any;
52
- "tab-out": (event: KeyboardEvent | TabOutTarget) => any;
54
+ "tab-out": (event: ComboBoxTabOut) => any;
53
55
  "editor-handoff": () => any;
54
56
  }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
55
57
  item: {
@@ -69,13 +71,9 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
69
71
  default: (value: string) => string;
70
72
  };
71
73
  }>> & Readonly<{
72
- onCommand?: ((payload: {
73
- item: ComboBoxItem;
74
- argument: string;
75
- option: ComboBoxOption | null;
76
- }) => any) | undefined;
74
+ onCommand?: ((payload: ComboBoxCommand) => any) | undefined;
77
75
  "onItem-clicked"?: (() => any) | undefined;
78
- "onTab-out"?: ((event: KeyboardEvent | TabOutTarget) => any) | undefined;
76
+ "onTab-out"?: ((event: ComboBoxTabOut) => any) | undefined;
79
77
  "onEditor-handoff"?: (() => any) | undefined;
80
78
  }>, {
81
79
  uiFontFamily: string;
@@ -1,15 +1,5 @@
1
1
  import { CSSProperties, PropType } from 'vue';
2
- interface DropdownOption {
3
- key?: string | number;
4
- label?: string;
5
- type?: string;
6
- disabled?: boolean;
7
- class?: unknown;
8
- props?: Record<string, unknown>;
9
- icon?: string | object | ((option: DropdownOption) => unknown);
10
- render?: () => unknown;
11
- [member: string]: unknown;
12
- }
2
+ import { ToolbarItemOption as DropdownOption } from '../built-in-toolbar.js';
13
3
  interface DropdownMenuProps {
14
4
  class?: unknown;
15
5
  style?: CSSProperties;
@@ -1,23 +1,13 @@
1
- export function makeColorOption(color: any, label?: null): {
2
- label: null;
1
+ import { BuiltInToolbar, ToolbarItem } from '../built-in-toolbar.js';
2
+ type ColorOption = {
3
+ label: string;
3
4
  icon: string;
4
- value: any;
5
- style: {
6
- color: any;
7
- boxShadow: string;
8
- borderRadius: string;
9
- };
5
+ value: string;
6
+ style: Record<string, string>;
10
7
  };
11
- export function renderColorOptions(superToolbar: any, button: any, customIcons?: any[], hasNoneIcon?: boolean): import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
8
+ type ColorDropdownToolbar = Pick<BuiltInToolbar, 'emitCommand' | 'superdoc' | 'activeEditor'>;
9
+ type ColorDropdownButton = Pick<ToolbarItem, 'name' | 'type' | 'command' | 'isCustomToolbarItem' | 'iconColor' | 'expand'>;
10
+ export declare const renderColorOptions: (superToolbar: ColorDropdownToolbar, button: ColorDropdownButton, customIcons?: ColorOption[][], hasNoneIcon?: boolean) => import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
12
11
  [key: string]: any;
13
12
  }>;
14
- export const icons: {
15
- label: null;
16
- icon: string;
17
- value: any;
18
- style: {
19
- color: any;
20
- boxShadow: string;
21
- borderRadius: string;
22
- };
23
- }[][];
13
+ export {};
@@ -1,51 +1,18 @@
1
- /**
2
- * The single seam that composes the font dropdown options: it turns the active document's
3
- * {@link import('../../../../../shared/font-system/src/index.js').DocumentFontOption}s into toolbar font options and unions them
4
- * with the bundled defaults. The toolbar only asks for the result; it does not know how a font previews.
5
- *
6
- * - A consumer-provided `configFonts` list is returned UNCHANGED (custom toolbars own their list).
7
- * - With no document options, returns `undefined` so the caller keeps its fallback to {@link TOOLBAR_FONTS}.
8
- * - Otherwise: bundled defaults and document fonts are deduped by normalized logical family, then sorted
9
- * alphabetically by the visible font name. `label`/`key` stay the pure logical family (active-state
10
- * matching + the stored value), and the preview renders in `previewFamily`.
11
- *
12
- * @param {ReadonlyArray<import('../../../../../shared/font-system/src/index.js').DocumentFontOption>} documentOptions
13
- * @param {Array} [configFonts] - the consumer's `fonts` config, if any
14
- * @returns {Array|undefined}
15
- */
16
- export function composeToolbarFontOptions(documentOptions: ReadonlyArray<import('../../../../../shared/font-system/src/index.js').DocumentFontOption>, configFonts?: any[]): any[] | undefined;
17
- /**
18
- * Map the host-computed, activation-aware font-family options onto the toolbar option shape. PURE: it
19
- * receives the already-resolved list from `superdoc.fonts.getFontFamilyOptions()` (the host owns the
20
- * `@superdoc/font-system` computation this module must not import). Returns `undefined` for an empty
21
- * list so the caller keeps its {@link TOOLBAR_FONTS} fallback. `label` is the Word-facing logical
22
- * family (stored on the selection + used for active-state matching), `key` is a stable option key, and
23
- * the row preview renders in `previewFamily` (falling back to the label).
24
- *
25
- * @param {ReadonlyArray<import('../../../../../shared/font-system/src/index.js').FontFamilyOption>} options
26
- * @returns {Array|undefined}
27
- */
28
- export function mapFontFamilyOptionsToToolbar(options: ReadonlyArray<import('../../../../../shared/font-system/src/index.js').FontFamilyOption>): any[] | undefined;
29
- export const TOOLBAR_FONTS: {
1
+ import { DocumentFontOption, FontFamilyOption } from '../../../../../shared/font-system/src/index.js';
2
+ import { ToolbarFontOption } from '../../../core/types/index.js';
3
+ export declare const TOOLBAR_FONTS: ToolbarFontOption[];
4
+ export declare function composeToolbarFontOptions(documentOptions: readonly DocumentFontOption[] | null | undefined, configFonts?: readonly ToolbarFontOption[]): readonly ToolbarFontOption[] | undefined;
5
+ export declare function mapFontFamilyOptionsToToolbar(options: readonly FontFamilyOption[] | null | undefined): ToolbarFontOption[] | undefined;
6
+ export declare const TOOLBAR_FONT_SIZES: {
30
7
  label: string;
31
8
  key: string;
32
9
  props: {
33
- style: {
34
- fontFamily: string;
35
- };
36
10
  'data-item': string;
37
11
  };
38
12
  }[];
39
- export const TOOLBAR_FONT_SIZES: {
40
- label: string;
41
- key: string;
42
- props: {
43
- 'data-item': string;
44
- };
45
- }[];
46
- export namespace RESPONSIVE_BREAKPOINTS {
47
- let sm: number;
48
- let md: number;
49
- let lg: number;
50
- let xl: number;
51
- }
13
+ export declare const RESPONSIVE_BREAKPOINTS: {
14
+ sm: number;
15
+ md: number;
16
+ lg: number;
17
+ xl: number;
18
+ };
@@ -1,18 +1,35 @@
1
- /**
2
- * Set or clear the link item's `href` without disturbing the rest of its
3
- * attributes. The static configuration (`ariaLabel`, and anything added later)
4
- * lives in the same object as the transient href, so rebuilding that object
5
- * from the keys a caller knows about silently drops the others.
6
- *
7
- * Exported because the built-in toolbar's `updateToolbarState()` writes the
8
- * href on its own path, without going through this item's handlers. Both
9
- * callers share this one rule so the two cannot drift apart.
10
- */
11
- export function withLinkHref(attributes: any, href: any): any;
12
- export function makeDefaultItems({ superToolbar, toolbarIcons, toolbarTexts, toolbarFonts, hideButtons, availableWidth, role, isDev, configuredItemNames, configuredItemOrder, excludedItemNames, additionalItems, }?: {
13
- isDev?: boolean | undefined;
14
- additionalItems?: never[] | undefined;
15
- }): {
16
- defaultItems: any[];
17
- overflowItems: any[];
1
+ import { ToolbarItemAttributes } from './use-toolbar-item.js';
2
+ import { BuiltInToolbar, ToolbarItem } from '../built-in-toolbar.js';
3
+ type DefaultItemsToolbar = Pick<BuiltInToolbar, 'config' | 'ui' | 'superdoc' | 'activeEditor' | 'pendingSelectionCapture' | 'emitCommand' | 'isCommandEnabled' | 'getLinkedStyleOptions' | 'getActiveLinkedStyleId' | 'updateLinkedStyleToMatchSelection'>;
4
+ interface DefaultItemsInput {
5
+ superToolbar: DefaultItemsToolbar;
6
+ toolbarIcons: Readonly<Record<string, unknown>>;
7
+ toolbarTexts: Readonly<Record<string, unknown>>;
8
+ toolbarFonts?: readonly FontOption[] | null;
9
+ hideButtons: boolean;
10
+ availableWidth: number;
11
+ role: string;
12
+ isDev?: boolean;
13
+ configuredItemNames?: ReadonlySet<string> | null;
14
+ configuredItemOrder?: readonly string[] | null;
15
+ excludedItemNames?: ReadonlySet<string> | null;
16
+ additionalItems?: readonly ToolbarItem[];
17
+ }
18
+ type FontOption = {
19
+ label: string;
20
+ key: string;
21
+ value?: string;
22
+ props?: {
23
+ style?: {
24
+ fontFamily?: string;
25
+ [key: string]: unknown;
26
+ };
27
+ [key: string]: unknown;
28
+ };
18
29
  };
30
+ export declare function withLinkHref(attributes: ToolbarItemAttributes, href: unknown): ToolbarItemAttributes;
31
+ export declare const makeDefaultItems: ({ superToolbar, toolbarIcons: configuredIcons, toolbarTexts: configuredTexts, toolbarFonts, hideButtons, availableWidth, role, isDev, configuredItemNames, configuredItemOrder, excludedItemNames, additionalItems, }: DefaultItemsInput) => {
32
+ defaultItems: ToolbarItem[];
33
+ overflowItems: ToolbarItem[];
34
+ };
35
+ export {};
@@ -1,2 +1,10 @@
1
- export function preventEditorFocusTransfer(event: any): void;
2
- export function refocusEditorSurface(superToolbar: any, preferredEditor?: null): void;
1
+ type FocusTarget = {
2
+ focus?: unknown;
3
+ };
4
+ type RefocusToolbar = {
5
+ superdoc?: FocusTarget | null;
6
+ activeEditor?: FocusTarget | null;
7
+ };
8
+ export declare const preventEditorFocusTransfer: (event: Pick<Event, "target" | "preventDefault">) => void;
9
+ export declare const refocusEditorSurface: (superToolbar: RefocusToolbar | null | undefined, preferredEditor?: FocusTarget | null) => void;
10
+ export {};