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.
- package/dist/chunks/{FindReplaceSurface-BKVHzhQ4.es.js → FindReplaceSurface-B_5ggdWg.es.js} +1 -1
- package/dist/chunks/{FindReplaceSurface-BNDrJ6VS.cjs → FindReplaceSurface-fVHxPXtn.cjs} +1 -1
- package/dist/chunks/{PasswordPromptSurface-6mF6Azda.es.js → PasswordPromptSurface-CZqhDQQ1.es.js} +1 -1
- package/dist/chunks/{PasswordPromptSurface-BNkaztaP.cjs → PasswordPromptSurface-x8GNmMJT.cjs} +1 -1
- package/dist/chunks/{PdfViewer-aOWhUVI7.es.js → PdfViewer-CW09MNrB.es.js} +4 -10
- package/dist/chunks/{PdfViewer-DmSkZehl.cjs → PdfViewer-CkrAHpC-.cjs} +4 -10
- package/dist/chunks/{_plugin-vue_export-helper-6MBoygIY.cjs → _plugin-vue_export-helper-BkbCxNeT.cjs} +31 -7
- package/dist/chunks/{_plugin-vue_export-helper-CsJQtMvr.es.js → _plugin-vue_export-helper-DRPRMkeA.es.js} +20 -8
- package/dist/chunks/{create-super-doc-ui-Bm5kmx0W.es.js → create-super-doc-ui-Dc8dQAMc.es.js} +83 -114
- package/dist/chunks/{create-super-doc-ui-DN70aatf.cjs → create-super-doc-ui-L60GhVAX.cjs} +199 -236
- package/dist/collaboration-upgrade-engine.cjs +1 -1
- package/dist/collaboration-upgrade-engine.es.js +1 -1
- package/dist/document-api/src/contract/command-catalog.d.ts +1 -1
- package/dist/public/ui-react.cjs +1 -1
- package/dist/public/ui-react.es.js +1 -1
- package/dist/public/ui-vue.cjs +1 -1
- package/dist/public/ui-vue.es.js +1 -1
- package/dist/public/ui.cjs +1 -1
- package/dist/public/ui.es.js +1 -1
- package/dist/style.css +1 -1
- package/dist/style.layered.css +1 -1
- package/dist/superdoc/src/components/CommentsLayer/collect-removed-comment-ids.d.ts +11 -1
- package/dist/superdoc/src/components/CommentsLayer/collect-tracked-change-thread.d.ts +19 -2
- package/dist/superdoc/src/components/CommentsLayer/comment-urls.d.ts +1 -1
- package/dist/superdoc/src/components/CommentsLayer/commentsList/super-comments-list.d.ts +23 -20
- package/dist/superdoc/src/components/CommentsLayer/helpers.d.ts +1 -4
- package/dist/superdoc/src/components/CommentsLayer/tracked-change-threading.d.ts +16 -1
- package/dist/superdoc/src/components/Whiteboard/WhiteboardLayer.vue.d.ts +4 -5
- package/dist/superdoc/src/components/Whiteboard/WhiteboardPage.vue.d.ts +3 -4
- package/dist/superdoc/src/components/Whiteboard/whiteboard-types.d.ts +2 -0
- package/dist/superdoc/src/components/surfaces/watermark-surface-runtime.d.ts +7 -7
- package/dist/superdoc/src/composables/use-comment-small-screen.d.ts +11 -7
- package/dist/superdoc/src/composables/use-compact-comment-popover.d.ts +44 -18
- package/dist/superdoc/src/composables/use-find-replace.d.ts +13 -3
- package/dist/superdoc/src/composables/use-password-prompt.d.ts +1 -1
- package/dist/superdoc/src/composables/use-viewport-fit.d.ts +62 -26
- package/dist/superdoc/src/core/SuperDoc.d.ts +3 -3
- package/dist/superdoc/src/core/pdf/pdf-adapter.d.ts +6 -2
- package/dist/superdoc/src/core/types/index.d.ts +37 -4
- package/dist/superdoc/src/core/v2-integration/browser-peer-runtime.d.ts +5 -3
- package/dist/superdoc/src/core/v2-integration/cdn-engine-loader.d.ts +3 -13
- package/dist/superdoc/src/core/v2-integration/internal-vue-runtime.d.ts +64 -59
- package/dist/superdoc/src/helpers/object-guards.d.ts +1 -0
- package/dist/superdoc/src/helpers/v2-author-required-rejection.d.ts +8 -11
- package/dist/superdoc/src/helpers/v2-bulk-decision-event.d.ts +9 -7
- package/dist/superdoc/src/helpers/v2-keyboard-edit-rejection.d.ts +8 -7
- package/dist/superdoc/src/helpers/v2-mutation-exception.d.ts +12 -8
- package/dist/superdoc/src/helpers/v2-review-target.d.ts +11 -1
- package/dist/superdoc/src/helpers/v2-selection-sync.d.ts +40 -14
- package/dist/superdoc/src/helpers/v2-typing-mutation-event.d.ts +14 -5
- package/dist/superdoc/src/icons.d.ts +11 -19
- package/dist/superdoc/src/internal/diagnostics/translate-diagnostic.d.ts +6 -4
- package/dist/superdoc/src/internal/toolbar/built-in/PageNumberMenu.vue.d.ts +25 -15
- package/dist/superdoc/src/internal/toolbar/built-in/constants.d.ts +3 -1
- package/dist/superdoc/src/internal/toolbar/built-in/font-options.d.ts +15 -1
- package/dist/superdoc/src/internal/toolbar/built-in/font-typeahead.d.ts +37 -7
- package/dist/superdoc/src/internal/toolbar/built-in/format-negation.d.ts +10 -4
- package/dist/superdoc/src/internal/toolbar/built-in/general.d.ts +12 -1
- package/dist/superdoc/src/internal/toolbar/built-in/helpers.d.ts +9 -4
- package/dist/superdoc/src/internal/toolbar/built-in/list-style-buttons.d.ts +2 -2
- package/dist/superdoc/src/internal/toolbar/built-in/page-number-feedback.d.ts +4 -5
- package/dist/superdoc/src/internal/toolbar/built-in/scroll-helpers.d.ts +3 -4
- package/dist/superdoc/src/internal/toolbar/built-in/toolbarIcons.d.ts +78 -145
- package/dist/superdoc/src/internal/toolbar/built-in/url-safety.d.ts +11 -3
- package/dist/superdoc/src/internal/toolbar/built-in-toolbar.d.ts +4 -3
- package/dist/superdoc/src/internal/toolbar/image-upload.d.ts +29 -39
- package/dist/superdoc/src/public/ui/format-painter-helpers.d.ts +2 -8
- package/dist/superdoc/src/stores/comments-store.d.ts +7 -7
- package/dist/superdoc/src/stores/helpers/comment-document-scope.d.ts +22 -0
- package/dist/superdoc/src/stores/helpers/pending-selection-snapshot.d.ts +17 -0
- package/dist/superdoc/src/stores/helpers/tracked-change-compaction.d.ts +16 -0
- package/dist/superdoc/src/stores/helpers/tracked-change-decision.d.ts +45 -0
- package/dist/superdoc/src/stores/superdoc-store.d.ts +21 -21
- package/dist/superdoc.cjs +423 -464
- package/dist/superdoc.es.js +335 -376
- package/dist-cdn/style.layered.css +1 -1
- package/dist-cdn/superdoc.min.css +1 -1
- package/dist-cdn/superdoc.min.js +41 -41
- package/package.json +3 -2
- package/dist/superdoc/src/main.d.ts +0 -1
|
@@ -1,145 +1,78 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
export { pageNumberIconSvg as pageNumber };
|
|
80
|
-
export { alignLeftIconSvg as alignLeft };
|
|
81
|
-
export { alignRightIconSvg as alignRight };
|
|
82
|
-
export { alignCenterIconSvg as alignCenter };
|
|
83
|
-
export { alignJustifyIconSvg as alignJustify };
|
|
84
|
-
export { listIconSvg as bulletList };
|
|
85
|
-
export { listIconSvg as bulletListDisc };
|
|
86
|
-
export { listCircleIconSvg as bulletListCircle };
|
|
87
|
-
export { listSquareIconSvg as bulletListSquare };
|
|
88
|
-
export { listOlIconSvg as numberedList };
|
|
89
|
-
export { listDecimalIconSvg as numberedListDecimal };
|
|
90
|
-
export { listDecimalParenIconSvg as numberedListDecimalParen };
|
|
91
|
-
export { listUpperRomanIconSvg as numberedListUpperRoman };
|
|
92
|
-
export { listLowerRomanIconSvg as numberedListLowerRoman };
|
|
93
|
-
export { listUpperAlphaIconSvg as numberedListUpperAlpha };
|
|
94
|
-
export { listUpperAlphaParenIconSvg as numberedListUpperAlphaParen };
|
|
95
|
-
export { listLowerAlphaIconSvg as numberedListLowerAlpha };
|
|
96
|
-
export { listLowerAlphaParenIconSvg as numberedListLowerAlphaParen };
|
|
97
|
-
export { outdentIconSvg as indentLeft };
|
|
98
|
-
export { indentIconSvg as indentRight };
|
|
99
|
-
export { paragraphLtrIconSvg as directionLtr };
|
|
100
|
-
export { paragraphRtlIconSvg as directionRtl };
|
|
101
|
-
export { fileHalfDashedIconSvg as pageBreak };
|
|
102
|
-
export { paintRollerIconSvg as copyFormat };
|
|
103
|
-
export { textSlashIconSvg as clearFormatting };
|
|
104
|
-
export { listCheckIconSvg as trackChanges };
|
|
105
|
-
export { fileIconSvg as trackChangesFinal };
|
|
106
|
-
export { eyeIconSvg as trackChangesOriginal };
|
|
107
|
-
export { calendarCheckIconSvg as trackChangesAccept };
|
|
108
|
-
export { calendarXmarkIconSvg as trackChangesReject };
|
|
109
|
-
export { userEditIconSvg as documentMode };
|
|
110
|
-
export { userEditIconSvg as documentEditingMode };
|
|
111
|
-
export { commentIconSvg as documentSuggestingMode };
|
|
112
|
-
export { eyeIconSvg as documentViewingMode };
|
|
113
|
-
export { circleIconSvg as colorOption };
|
|
114
|
-
export { checkIconSvg as colorOptionCheck };
|
|
115
|
-
export { linkIconSvg as linkInput };
|
|
116
|
-
export { xmarkIconSvg as removeLink };
|
|
117
|
-
export { upRightFromSquareIconSvg as openLink };
|
|
118
|
-
export { ellipsisVerticalIconSvg as overflow };
|
|
119
|
-
export { caretUpIconSvg as dropdownCaretUp };
|
|
120
|
-
export { caretDownIconSvg as dropdownCaretDown };
|
|
121
|
-
export { rulerSvg as ruler };
|
|
122
|
-
export { paintbrushSvg as paintbrush };
|
|
123
|
-
export { highlighterIcon as highlight };
|
|
124
|
-
export { magicWandIcon as ai };
|
|
125
|
-
export { tableIconSvg as table };
|
|
126
|
-
export { tableColumnsIconSvg as tableActions };
|
|
127
|
-
export { arrowsLeftRightIconSvg as splitCell };
|
|
128
|
-
export { arrowsToDotIconSvg as mergeCells };
|
|
129
|
-
export { plusIconSvg as addRowBefore };
|
|
130
|
-
export { plusIconSvg as addRowAfter };
|
|
131
|
-
export { plusIconSvg as addColumnBefore };
|
|
132
|
-
export { plusIconSvg as addColumnAfter };
|
|
133
|
-
export { trashIconSvg as deleteRow };
|
|
134
|
-
export { trashIconSvg as deleteColumn };
|
|
135
|
-
export { trashIconSvg as deleteTable };
|
|
136
|
-
export { borderNoneIconSvg as deleteBorders };
|
|
137
|
-
export { wrenchIconSvg as fixTables };
|
|
138
|
-
export { upDownIconSvg as lineHeight };
|
|
139
|
-
export { magnifyingGlassSvg as search };
|
|
140
|
-
export { scissorsIconSvg as cut };
|
|
141
|
-
export { copyIconSvg as copy };
|
|
142
|
-
export { pasteIconSvg as paste };
|
|
143
|
-
export { strikethroughSvg as strikethrough };
|
|
144
|
-
export { paragraphIconSvg as formattingMarks };
|
|
145
|
-
}
|
|
1
|
+
export declare const toolbarIcons: {
|
|
2
|
+
undo: string;
|
|
3
|
+
redo: string;
|
|
4
|
+
bold: string;
|
|
5
|
+
italic: string;
|
|
6
|
+
underline: string;
|
|
7
|
+
color: string;
|
|
8
|
+
link: string;
|
|
9
|
+
image: string;
|
|
10
|
+
tableOfContents: string;
|
|
11
|
+
watermark: string;
|
|
12
|
+
pageNumber: string;
|
|
13
|
+
alignLeft: string;
|
|
14
|
+
alignRight: string;
|
|
15
|
+
alignCenter: string;
|
|
16
|
+
alignJustify: string;
|
|
17
|
+
bulletList: string;
|
|
18
|
+
bulletListDisc: string;
|
|
19
|
+
bulletListCircle: string;
|
|
20
|
+
bulletListSquare: string;
|
|
21
|
+
numberedList: string;
|
|
22
|
+
numberedListDecimal: string;
|
|
23
|
+
numberedListDecimalParen: string;
|
|
24
|
+
numberedListUpperRoman: string;
|
|
25
|
+
numberedListLowerRoman: string;
|
|
26
|
+
numberedListUpperAlpha: string;
|
|
27
|
+
numberedListUpperAlphaParen: string;
|
|
28
|
+
numberedListLowerAlpha: string;
|
|
29
|
+
numberedListLowerAlphaParen: string;
|
|
30
|
+
indentLeft: string;
|
|
31
|
+
indentRight: string;
|
|
32
|
+
directionLtr: string;
|
|
33
|
+
directionRtl: string;
|
|
34
|
+
pageBreak: string;
|
|
35
|
+
copyFormat: string;
|
|
36
|
+
clearFormatting: string;
|
|
37
|
+
trackChanges: string;
|
|
38
|
+
trackChangesFinal: string;
|
|
39
|
+
trackChangesOriginal: string;
|
|
40
|
+
trackChangesAccept: string;
|
|
41
|
+
trackChangesReject: string;
|
|
42
|
+
documentMode: string;
|
|
43
|
+
documentEditingMode: string;
|
|
44
|
+
documentSuggestingMode: string;
|
|
45
|
+
documentViewingMode: string;
|
|
46
|
+
colorOption: string;
|
|
47
|
+
colorOptionCheck: string;
|
|
48
|
+
linkInput: string;
|
|
49
|
+
removeLink: string;
|
|
50
|
+
openLink: string;
|
|
51
|
+
overflow: string;
|
|
52
|
+
dropdownCaretUp: string;
|
|
53
|
+
dropdownCaretDown: string;
|
|
54
|
+
ruler: string;
|
|
55
|
+
paintbrush: string;
|
|
56
|
+
highlight: string;
|
|
57
|
+
ai: string;
|
|
58
|
+
table: string;
|
|
59
|
+
tableActions: string;
|
|
60
|
+
splitCell: string;
|
|
61
|
+
mergeCells: string;
|
|
62
|
+
addRowBefore: string;
|
|
63
|
+
addRowAfter: string;
|
|
64
|
+
addColumnBefore: string;
|
|
65
|
+
addColumnAfter: string;
|
|
66
|
+
deleteRow: string;
|
|
67
|
+
deleteColumn: string;
|
|
68
|
+
deleteTable: string;
|
|
69
|
+
deleteBorders: string;
|
|
70
|
+
fixTables: string;
|
|
71
|
+
lineHeight: string;
|
|
72
|
+
search: string;
|
|
73
|
+
cut: string;
|
|
74
|
+
copy: string;
|
|
75
|
+
paste: string;
|
|
76
|
+
strikethrough: string;
|
|
77
|
+
formattingMarks: string;
|
|
78
|
+
};
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal href sanitizer for the built-in link popover.
|
|
3
|
+
*
|
|
4
|
+
* The v1 toolbar used the shared `@superdoc/url-validation` package, which is not
|
|
5
|
+
* a resolvable runtime dependency of the published `superdoc` ES build. This
|
|
6
|
+
* keeps the same fail-closed posture (only known-safe schemes pass) without
|
|
7
|
+
* pulling in that package: dangerous schemes (`javascript:`, `data:`,
|
|
8
|
+
* `vbscript:`) return `null`, mirroring the v1 contract that callers treat a
|
|
9
|
+
* `null` result as an invalid URL.
|
|
10
|
+
*/
|
|
1
11
|
/**
|
|
2
12
|
* Validate and normalize an href. Returns `{ href }` for safe values, or `null`.
|
|
3
|
-
* @param {string} value
|
|
4
|
-
* @returns {{ href: string }|null}
|
|
5
13
|
*/
|
|
6
|
-
export function sanitizeHref(value:
|
|
14
|
+
export declare function sanitizeHref(value: unknown): {
|
|
7
15
|
href: string;
|
|
8
16
|
} | null;
|
|
@@ -32,8 +32,9 @@ type BuiltInToolbarConfig = {
|
|
|
32
32
|
showPageNumberButton: boolean;
|
|
33
33
|
uiDisplayFallbackFont?: string;
|
|
34
34
|
};
|
|
35
|
+
type ToolbarSuperDoc = Partial<Pick<SuperDoc, 'activeEditor' | 'config' | 'ui' | 'uiConfig' | 'fonts' | 'on' | 'off' | 'emit' | 'focus' | 'toggleRuler' | 'toggleFormattingMarks' | 'setShowFormattingMarks'>>;
|
|
35
36
|
type BuiltInToolbarOptions = {
|
|
36
|
-
superdoc?:
|
|
37
|
+
superdoc?: ToolbarSuperDoc | null;
|
|
37
38
|
editor?: Editor | null;
|
|
38
39
|
selector?: string | HTMLElement | null;
|
|
39
40
|
element?: string | HTMLElement | null;
|
|
@@ -58,7 +59,7 @@ export declare class BuiltInToolbar extends EventEmitter {
|
|
|
58
59
|
pendingSelectionCapture: SelectionCapture | null | undefined;
|
|
59
60
|
isDev: boolean;
|
|
60
61
|
role: string;
|
|
61
|
-
superdoc:
|
|
62
|
+
superdoc: ToolbarSuperDoc | null | undefined;
|
|
62
63
|
toolbarContainer: HTMLElement | null;
|
|
63
64
|
toolbar: ComponentPublicInstance | null;
|
|
64
65
|
_detachFontsChanged: (() => void) | null;
|
|
@@ -66,7 +67,7 @@ export declare class BuiltInToolbar extends EventEmitter {
|
|
|
66
67
|
app?: App | null;
|
|
67
68
|
activeEditor: Editor | null;
|
|
68
69
|
ui: BorrowedSuperDocUI | null;
|
|
69
|
-
snapshot: ToolbarSnapshotSlice | null;
|
|
70
|
+
snapshot: Partial<Pick<ToolbarSnapshotSlice, 'commands' | 'copyFormatActive'>> | null;
|
|
70
71
|
_unsubscribeController: (() => void) | null;
|
|
71
72
|
_detachFormatPainterModeChange: (() => void) | null;
|
|
72
73
|
_customCommandRegs: Map<string, CustomCommandRegistrationResult<CustomButtonPayload>>;
|
|
@@ -1,10 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interactive image acquisition for the built-in toolbar (SD-3567).
|
|
3
|
+
*
|
|
4
|
+
* The toolbar image button routes through the shared controller command
|
|
5
|
+
* `image` → `create.image`, which requires a base64 PNG/JPEG data-URI `src`.
|
|
6
|
+
* This module owns the browser file picker and the File → data-URI
|
|
7
|
+
* conversion; the toolbar dispatches the resulting payload through the
|
|
8
|
+
* normal controller command path.
|
|
9
|
+
*/
|
|
10
|
+
/** Accept filter for the picker: PNG and JPEG only (V1 parity; OOXML-native formats). */
|
|
11
|
+
export declare const IMAGE_PICKER_ACCEPT = ".png,.jpg,.jpeg,image/png,image/jpeg";
|
|
12
|
+
type NamedBlob = Blob & {
|
|
13
|
+
name?: string;
|
|
14
|
+
};
|
|
15
|
+
interface ImageFilePickerOptions {
|
|
16
|
+
ownerDocument?: Document;
|
|
17
|
+
onPick?: (file: File) => void | Promise<void>;
|
|
18
|
+
onError?: (error: unknown) => void;
|
|
19
|
+
}
|
|
20
|
+
interface ImageFilePicker {
|
|
21
|
+
input: HTMLInputElement;
|
|
22
|
+
open: () => void;
|
|
23
|
+
destroy: () => void;
|
|
24
|
+
}
|
|
1
25
|
/**
|
|
2
26
|
* Whether a picked/dropped file is an insertable image (PNG/JPEG). Falls back
|
|
3
27
|
* to the file extension when the browser reports no MIME type.
|
|
4
|
-
* @param {File | null | undefined} file
|
|
5
|
-
* @returns {boolean}
|
|
6
28
|
*/
|
|
7
|
-
export function isSupportedImageFile(file: File | null | undefined): boolean;
|
|
29
|
+
export declare function isSupportedImageFile(file: File | null | undefined): boolean;
|
|
8
30
|
/**
|
|
9
31
|
* Read a File/Blob into a base64 data URI.
|
|
10
32
|
*
|
|
@@ -12,52 +34,20 @@ export function isSupportedImageFile(file: File | null | undefined): boolean;
|
|
|
12
34
|
* accepts those by extension, but `readAsDataURL` would then produce an
|
|
13
35
|
* `application/octet-stream` data URI that `create.image` rejects. Rewrite
|
|
14
36
|
* the media type from the filename so extension-accepted files still insert.
|
|
15
|
-
* @param {Blob & { name?: string }} file
|
|
16
|
-
* @returns {Promise<string>}
|
|
17
37
|
*/
|
|
18
|
-
export function fileToDataUri(file:
|
|
19
|
-
name?: string;
|
|
20
|
-
}): Promise<string>;
|
|
38
|
+
export declare function fileToDataUri(file: NamedBlob): Promise<string>;
|
|
21
39
|
/**
|
|
22
40
|
* Resolve the `create.image` src for a picked file. Uses the consumer's
|
|
23
41
|
* `handleImageUpload` callback when configured (V1 contract:
|
|
24
42
|
* `(file: File) => Promise<string>`). A returned non-data URL is fetched and
|
|
25
43
|
* embedded, because `create.image` requires an embedded base64 data URI.
|
|
26
|
-
* @param {File} file
|
|
27
|
-
* @param {((file: File) => Promise<string>) | null | undefined} handleImageUpload
|
|
28
|
-
* @returns {Promise<string>}
|
|
29
44
|
*/
|
|
30
|
-
export function resolveImageSrc(file: File, handleImageUpload: ((file: File) => Promise<string>) | null | undefined): Promise<string>;
|
|
45
|
+
export declare function resolveImageSrc(file: File, handleImageUpload: ((file: File) => Promise<string>) | null | undefined): Promise<string>;
|
|
31
46
|
/**
|
|
32
47
|
* Hidden `<input type=file>` picker bound to one toolbar instance. The input
|
|
33
48
|
* stays attached (hidden) so automation and tests can drive it; `destroy()`
|
|
34
49
|
* removes it. Picking a file calls `onPick(file)`; an unsupported type or a
|
|
35
50
|
* failed pick routes through `onError(error)`.
|
|
36
|
-
*
|
|
37
|
-
* @param {{
|
|
38
|
-
* ownerDocument?: Document,
|
|
39
|
-
* onPick?: (file: File) => unknown,
|
|
40
|
-
* onError?: (error: Error) => void,
|
|
41
|
-
* }} options
|
|
42
|
-
* @returns {{ input: HTMLInputElement, open: () => void, destroy: () => void }}
|
|
43
|
-
*/
|
|
44
|
-
export function createImageFilePicker({ ownerDocument, onPick, onError }?: {
|
|
45
|
-
ownerDocument?: Document;
|
|
46
|
-
onPick?: (file: File) => unknown;
|
|
47
|
-
onError?: (error: Error) => void;
|
|
48
|
-
}): {
|
|
49
|
-
input: HTMLInputElement;
|
|
50
|
-
open: () => void;
|
|
51
|
-
destroy: () => void;
|
|
52
|
-
};
|
|
53
|
-
/**
|
|
54
|
-
* Interactive image acquisition for the built-in toolbar (SD-3567).
|
|
55
|
-
*
|
|
56
|
-
* The toolbar image button routes through the shared controller command
|
|
57
|
-
* `image` → `create.image`, which requires a base64 PNG/JPEG data-URI `src`.
|
|
58
|
-
* This module owns the browser file picker and the File → data-URI
|
|
59
|
-
* conversion; the toolbar dispatches the resulting payload through the
|
|
60
|
-
* normal controller command path.
|
|
61
51
|
*/
|
|
62
|
-
|
|
63
|
-
export
|
|
52
|
+
export declare function createImageFilePicker({ ownerDocument, onPick, onError, }?: ImageFilePickerOptions): ImageFilePicker;
|
|
53
|
+
export {};
|
|
@@ -2,22 +2,16 @@
|
|
|
2
2
|
* Maps SDRunProps field names to InlineRunPatch field names.
|
|
3
3
|
* SDRunProps (read-side) and InlineRunPatch (write-side) use different keys
|
|
4
4
|
* for the same properties; direct assignment between them is forbidden.
|
|
5
|
-
*
|
|
6
|
-
* @param {Record<string, unknown>} props - SDRunProps object from doc.getNodeById
|
|
7
|
-
* @returns {Record<string, unknown>} InlineRunPatch ready for doc.format.apply
|
|
8
5
|
*/
|
|
9
|
-
export function sdRunPropsToInlineRunPatch(props: Record<string, unknown>): Record<string, unknown>;
|
|
6
|
+
export declare function sdRunPropsToInlineRunPatch(props: Record<string, unknown>): Record<string, unknown>;
|
|
10
7
|
/**
|
|
11
8
|
* Serializes a selection to a stable string key used to detect whether
|
|
12
9
|
* the target selection is the same as the source (skip apply in that case).
|
|
13
10
|
*
|
|
14
11
|
* Falls back to the plain text target when the host has not populated an
|
|
15
12
|
* explicit `selectionTarget` yet.
|
|
16
|
-
*
|
|
17
|
-
* @param {{ selectionTarget?: unknown; target?: unknown } | null | undefined} selection
|
|
18
|
-
* @returns {string}
|
|
19
13
|
*/
|
|
20
|
-
export function selectionKey(selection: {
|
|
14
|
+
export declare function selectionKey(selection: {
|
|
21
15
|
selectionTarget?: unknown;
|
|
22
16
|
target?: unknown;
|
|
23
17
|
} | null | undefined): string;
|
|
@@ -91,8 +91,8 @@ export const useCommentsStore: import('pinia').StoreDefinition<"comments", Pick<
|
|
|
91
91
|
key: null;
|
|
92
92
|
entry: null;
|
|
93
93
|
};
|
|
94
|
-
getCommentDocumentId: (comment:
|
|
95
|
-
belongsToDocument: (comment:
|
|
94
|
+
getCommentDocumentId: (comment: import('./helpers/comment-document-scope.js').DocumentScopedComment) => string | null;
|
|
95
|
+
belongsToDocument: (comment: import('./helpers/comment-document-scope.js').DocumentScopedComment, activeDocumentId: string | null | undefined, options?: import('./helpers/comment-document-scope.js').BelongsToDocumentOptions) => boolean;
|
|
96
96
|
viewingVisibility: {
|
|
97
97
|
documentMode: string;
|
|
98
98
|
commentsVisible: boolean;
|
|
@@ -412,8 +412,8 @@ export const useCommentsStore: import('pinia').StoreDefinition<"comments", Pick<
|
|
|
412
412
|
key: null;
|
|
413
413
|
entry: null;
|
|
414
414
|
};
|
|
415
|
-
getCommentDocumentId: (comment:
|
|
416
|
-
belongsToDocument: (comment:
|
|
415
|
+
getCommentDocumentId: (comment: import('./helpers/comment-document-scope.js').DocumentScopedComment) => string | null;
|
|
416
|
+
belongsToDocument: (comment: import('./helpers/comment-document-scope.js').DocumentScopedComment, activeDocumentId: string | null | undefined, options?: import('./helpers/comment-document-scope.js').BelongsToDocumentOptions) => boolean;
|
|
417
417
|
viewingVisibility: {
|
|
418
418
|
documentMode: string;
|
|
419
419
|
commentsVisible: boolean;
|
|
@@ -733,8 +733,8 @@ export const useCommentsStore: import('pinia').StoreDefinition<"comments", Pick<
|
|
|
733
733
|
key: null;
|
|
734
734
|
entry: null;
|
|
735
735
|
};
|
|
736
|
-
getCommentDocumentId: (comment:
|
|
737
|
-
belongsToDocument: (comment:
|
|
736
|
+
getCommentDocumentId: (comment: import('./helpers/comment-document-scope.js').DocumentScopedComment) => string | null;
|
|
737
|
+
belongsToDocument: (comment: import('./helpers/comment-document-scope.js').DocumentScopedComment, activeDocumentId: string | null | undefined, options?: import('./helpers/comment-document-scope.js').BelongsToDocumentOptions) => boolean;
|
|
738
738
|
viewingVisibility: {
|
|
739
739
|
documentMode: string;
|
|
740
740
|
commentsVisible: boolean;
|
|
@@ -961,4 +961,4 @@ export const useCommentsStore: import('pinia').StoreDefinition<"comments", Pick<
|
|
|
961
961
|
appliedCount: number;
|
|
962
962
|
} | undefined;
|
|
963
963
|
remapTrackedChangeIdentities: (pairs?: any[], { documentId }?: {}) => void;
|
|
964
|
-
}, "resolveCommentPositionEntry" | "getCommentAliasIds" | "getCommentPositionKey" | "
|
|
964
|
+
}, "resolveCommentPositionEntry" | "getCommentAliasIds" | "getCommentPositionKey" | "belongsToDocument" | "getComment" | "getTrackedChangeThread" | "getCommentPosition" | "getCommentDocumentId" | "init" | "setViewingVisibility" | "setActiveComment" | "getPendingComment" | "showAddComment" | "addComment" | "addHydratedComment" | "cancelComment" | "deleteComment" | "removePendingComment" | "removeCommentsForDocument" | "setReviewDirectoryFromV2" | "clearReviewDirectory" | "handleEditorLocationsUpdate" | "clearEditorCommentPositions" | "handleTrackedChangeUpdate" | "syncResolvedCommentsWithDocument" | "setActiveFloatingCommentInstance" | "requestInstantSidebarAlignment" | "peekInstantSidebarAlignment" | "clearInstantSidebarAlignment" | "decideTrackedChangeFromSidebar" | "setV2CommentsAdapter" | "getV2CommentsAdapter" | "applyReviewWindowFromV2" | "reconcileCommentsFromV2" | "announceV2CommentCreated" | "dropCommentsFromMutationImpact" | "isV2EditorActive" | "replyCommentV2" | "editCommentV2" | "resolveCommentV2" | "reopenCommentV2" | "setV2TrackedChangesAdapter" | "getV2TrackedChangesAdapter" | "getV2TrackedChangeRowCount" | "reconcileTrackedChangeMutationFromV2" | "reconcileTrackedChangesFromV2" | "remapTrackedChangeIdentities">>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type DocumentScopedComment = {
|
|
2
|
+
fileId?: unknown;
|
|
3
|
+
documentId?: unknown;
|
|
4
|
+
selection?: {
|
|
5
|
+
documentId?: unknown;
|
|
6
|
+
} | null;
|
|
7
|
+
} | null | undefined;
|
|
8
|
+
type OpenDocument = {
|
|
9
|
+
id?: unknown;
|
|
10
|
+
} | null | undefined;
|
|
11
|
+
export type OpenDocumentsSource = OpenDocument[] | {
|
|
12
|
+
value?: OpenDocument[] | null;
|
|
13
|
+
} | null | undefined;
|
|
14
|
+
export type BelongsToDocumentOptions = {
|
|
15
|
+
allowSingleDocumentMismatch?: boolean;
|
|
16
|
+
};
|
|
17
|
+
export declare const getCommentDocumentId: (comment: DocumentScopedComment) => string | null;
|
|
18
|
+
export declare const createCommentDocumentScope: (readOpenDocuments: () => OpenDocumentsSource) => {
|
|
19
|
+
belongsToDocument: (comment: DocumentScopedComment, activeDocumentId: string | null | undefined, options?: BelongsToDocumentOptions) => boolean;
|
|
20
|
+
belongsToTrackedChangeSyncDocument: (comment: DocumentScopedComment, activeDocumentId: string | null | undefined) => boolean;
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type PendingSelectionHost = {
|
|
2
|
+
activeEditor?: {
|
|
3
|
+
options?: {
|
|
4
|
+
documentId?: unknown;
|
|
5
|
+
} | null;
|
|
6
|
+
doc?: {
|
|
7
|
+
selection?: {
|
|
8
|
+
current?: () => unknown;
|
|
9
|
+
} | null;
|
|
10
|
+
} | null;
|
|
11
|
+
} | null;
|
|
12
|
+
} | null | undefined;
|
|
13
|
+
export type PendingActiveSelection = {
|
|
14
|
+
source?: unknown;
|
|
15
|
+
documentId?: unknown;
|
|
16
|
+
} | null | undefined;
|
|
17
|
+
export declare const getPendingSelectionSnapshot: (superdoc: PendingSelectionHost, activeSelection: PendingActiveSelection) => unknown;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type CompactableTrackedChangeRow = {
|
|
2
|
+
commentId?: unknown;
|
|
3
|
+
importedId?: unknown;
|
|
4
|
+
trackedChangeCanonicalId?: unknown;
|
|
5
|
+
trackedChangeAnchorKey?: unknown;
|
|
6
|
+
trackedChangePositionAliases?: unknown;
|
|
7
|
+
resolvedTime?: unknown;
|
|
8
|
+
resolvedById?: unknown;
|
|
9
|
+
resolvedByEmail?: unknown;
|
|
10
|
+
resolvedByName?: unknown;
|
|
11
|
+
trackedChangeDecision?: unknown;
|
|
12
|
+
};
|
|
13
|
+
export declare const getBodyTrackedChangeIdentityIds: (comment: CompactableTrackedChangeRow) => string[];
|
|
14
|
+
export declare const groupBodyTrackedChangeCommentsByIdentity: <Row extends CompactableTrackedChangeRow>(comments: readonly Row[]) => Map<number, Row[]>;
|
|
15
|
+
export declare const mergeDuplicateBodyTrackedChangeComments: <Row extends CompactableTrackedChangeRow>(groups: ReadonlyMap<number, readonly Row[]>) => Map<Row, Row>;
|
|
16
|
+
export declare const createDroppedCommentIdMap: <Row extends CompactableTrackedChangeRow>(duplicates: ReadonlyMap<Row, Row>) => Map<string, string>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export type TrackedChangeDecisionRow = {
|
|
2
|
+
trackedChangeType?: unknown;
|
|
3
|
+
trackedChangeDisplayType?: unknown;
|
|
4
|
+
trackedChangeCanonicalId?: unknown;
|
|
5
|
+
trackedChangeAnchorKey?: unknown;
|
|
6
|
+
};
|
|
7
|
+
export type TrackedChangeReceiptRef = {
|
|
8
|
+
kind?: unknown;
|
|
9
|
+
entityType?: unknown;
|
|
10
|
+
entityId?: unknown;
|
|
11
|
+
};
|
|
12
|
+
export type TrackedChangeDecisionReceipt = {
|
|
13
|
+
success?: unknown;
|
|
14
|
+
txId?: unknown;
|
|
15
|
+
removed?: unknown;
|
|
16
|
+
invalidatedRefs?: unknown;
|
|
17
|
+
};
|
|
18
|
+
export type TrackedChangeDecisionOutcome = {
|
|
19
|
+
decidedId?: unknown;
|
|
20
|
+
decidedIds?: unknown;
|
|
21
|
+
receipt?: TrackedChangeDecisionReceipt | null;
|
|
22
|
+
};
|
|
23
|
+
export type ActiveTrackedChangeTargetAdapter = {
|
|
24
|
+
clearActiveTrackedChangeTargetIfMatches?: (decidedId: string) => unknown;
|
|
25
|
+
};
|
|
26
|
+
export type CanonicalPaintHost = {
|
|
27
|
+
activeEditor?: {
|
|
28
|
+
documentMutationReadiness?: {
|
|
29
|
+
whenPainted?: (receipt: TrackedChangeDecisionReceipt) => unknown;
|
|
30
|
+
} | null;
|
|
31
|
+
} | null;
|
|
32
|
+
};
|
|
33
|
+
export declare const normalizeTrackedChangeDecisionType: (value: unknown) => string | null;
|
|
34
|
+
export declare const trackedChangeDecisionKeepsCommentAnchor: ({ comment, decision, }?: {
|
|
35
|
+
comment?: TrackedChangeDecisionRow | null;
|
|
36
|
+
decision?: unknown;
|
|
37
|
+
}) => boolean;
|
|
38
|
+
export declare const collectTrackedChangeDecisionIdsWithAliases: (comment: TrackedChangeDecisionRow | null | undefined, aliasIds: Iterable<string>) => Set<string>;
|
|
39
|
+
export declare const collectTrackedChangeEntityIdsFromReceipt: (receipt: TrackedChangeDecisionReceipt | null | undefined) => Set<string>;
|
|
40
|
+
export declare const collectReliableDecidedTrackedChangeIds: (outcome: TrackedChangeDecisionOutcome | null | undefined) => Set<string>;
|
|
41
|
+
export declare const clearV2ActiveTrackedChangeTarget: (adapter: ActiveTrackedChangeTargetAdapter | null | undefined, decidedId: string | null | undefined) => void;
|
|
42
|
+
export declare const waitForTrackedDecisionCanonicalPaint: ({ superdoc, receipt, }?: {
|
|
43
|
+
superdoc?: CanonicalPaintHost | null;
|
|
44
|
+
receipt?: TrackedChangeDecisionReceipt | null;
|
|
45
|
+
}) => Promise<void>;
|