@a3s-lab/office 0.2.2 → 0.3.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/README.md +14 -1
- package/dist/0~4595.js +117 -11
- package/dist/0~5050.js +124 -113
- package/dist/0~9512.js +1 -0
- package/dist/0~document-editor.js +2836 -1429
- package/dist/0~work-document-extensions.js +2 -2
- package/dist/internal/design-system/primitives/navigation/tabs.d.ts +3 -1
- package/dist/internal/features/work/editors/document-command-catalog.d.ts +527 -0
- package/dist/internal/features/work/editors/document-editor-support.d.ts +7 -3
- package/dist/internal/features/work/editors/document-editor.d.ts +1 -1
- package/dist/internal/features/work/editors/document-format-clipboard.d.ts +6 -0
- package/dist/internal/features/work/editors/document-format-tools.d.ts +4 -0
- package/dist/internal/features/work/editors/document-layout-panel.d.ts +4 -1
- package/dist/internal/features/work/editors/document-page-chrome-wps-shortcuts.d.ts +2 -0
- package/dist/internal/features/work/editors/document-page-layout-ribbon.d.ts +14 -0
- package/dist/internal/features/work/editors/document-review-navigation.d.ts +9 -0
- package/dist/internal/features/work/editors/document-statistics-dialog.d.ts +7 -0
- package/dist/internal/features/work/editors/document-status-bar.d.ts +2 -1
- package/dist/internal/features/work/editors/document-toolbar.d.ts +12 -42
- package/dist/internal/features/work/editors/document-wps-shortcuts.d.ts +12 -0
- package/dist/internal/features/work/editors/document-zoom.d.ts +17 -0
- package/dist/internal/features/work/editors/work-office-chrome.d.ts +22 -3
- package/dist/internal/features/work/editors/work-office-ribbon-overflow.d.ts +2 -0
- package/dist/office-kernel.wasm +0 -0
- package/dist/styles.css +213 -1
- package/docs/latest/en/browser-editor-architecture.md +33 -0
- package/package.json +11 -1
|
@@ -476,7 +476,7 @@ const DocumentSubscript = extension_subscript.extend({
|
|
|
476
476
|
},
|
|
477
477
|
addKeyboardShortcuts () {
|
|
478
478
|
return {
|
|
479
|
-
'Mod
|
|
479
|
+
'Mod-=': ()=>this.editor.commands.toggleDocumentSubscript()
|
|
480
480
|
};
|
|
481
481
|
}
|
|
482
482
|
});
|
|
@@ -493,7 +493,7 @@ const DocumentSuperscript = extension_superscript.extend({
|
|
|
493
493
|
},
|
|
494
494
|
addKeyboardShortcuts () {
|
|
495
495
|
return {
|
|
496
|
-
'Mod
|
|
496
|
+
'Mod-Shift-=': ()=>this.editor.commands.toggleDocumentSuperscript()
|
|
497
497
|
};
|
|
498
498
|
}
|
|
499
499
|
});
|
|
@@ -5,15 +5,17 @@ export type TabItem<T extends string> = {
|
|
|
5
5
|
compactLabel?: string;
|
|
6
6
|
icon?: ReactNode;
|
|
7
7
|
badge?: ReactNode;
|
|
8
|
+
contextual?: boolean;
|
|
8
9
|
disabled?: boolean;
|
|
9
10
|
tabId?: string;
|
|
10
11
|
panelId?: string;
|
|
11
12
|
};
|
|
12
|
-
export declare function Tabs<T extends string>({ ariaLabel, value, items, onChange, variant, size, className, containerRef, }: {
|
|
13
|
+
export declare function Tabs<T extends string>({ ariaLabel, value, items, onChange, onTabDoubleClick, variant, size, className, containerRef, }: {
|
|
13
14
|
ariaLabel: string;
|
|
14
15
|
value: T;
|
|
15
16
|
items: readonly TabItem<T>[];
|
|
16
17
|
onChange: (value: T) => void;
|
|
18
|
+
onTabDoubleClick?: (value: T) => void;
|
|
17
19
|
variant?: 'segment' | 'line';
|
|
18
20
|
size?: 'standard' | 'compact';
|
|
19
21
|
className?: string;
|
|
@@ -0,0 +1,527 @@
|
|
|
1
|
+
export declare const documentRibbonTabs: readonly [{
|
|
2
|
+
readonly id: "home";
|
|
3
|
+
readonly label: "开始";
|
|
4
|
+
}, {
|
|
5
|
+
readonly id: "insert";
|
|
6
|
+
readonly label: "插入";
|
|
7
|
+
}, {
|
|
8
|
+
readonly id: "page";
|
|
9
|
+
readonly label: "页面布局";
|
|
10
|
+
readonly compactLabel: "布局";
|
|
11
|
+
}, {
|
|
12
|
+
readonly id: "references";
|
|
13
|
+
readonly label: "引用";
|
|
14
|
+
}, {
|
|
15
|
+
readonly id: "review";
|
|
16
|
+
readonly label: "审阅";
|
|
17
|
+
}, {
|
|
18
|
+
readonly id: "view";
|
|
19
|
+
readonly label: "视图";
|
|
20
|
+
}];
|
|
21
|
+
export declare const documentPictureRibbonTab: {
|
|
22
|
+
readonly id: "picture";
|
|
23
|
+
readonly label: "图片";
|
|
24
|
+
readonly contextual: true;
|
|
25
|
+
};
|
|
26
|
+
export declare const documentTableRibbonTabs: readonly [{
|
|
27
|
+
readonly id: "tableDesign";
|
|
28
|
+
readonly label: "表格设计";
|
|
29
|
+
readonly compactLabel: "设计";
|
|
30
|
+
readonly contextual: true;
|
|
31
|
+
}, {
|
|
32
|
+
readonly id: "tableLayout";
|
|
33
|
+
readonly label: "表格布局";
|
|
34
|
+
readonly compactLabel: "布局";
|
|
35
|
+
readonly contextual: true;
|
|
36
|
+
}];
|
|
37
|
+
export declare const documentPageChromeRibbonTab: {
|
|
38
|
+
readonly id: "pageChrome";
|
|
39
|
+
readonly label: "页眉和页脚";
|
|
40
|
+
readonly compactLabel: "页眉页脚";
|
|
41
|
+
readonly contextual: true;
|
|
42
|
+
};
|
|
43
|
+
export type DocumentStandardRibbonTabId = (typeof documentRibbonTabs)[number]['id'];
|
|
44
|
+
export type DocumentRibbonTabId = DocumentStandardRibbonTabId | typeof documentPictureRibbonTab.id | (typeof documentTableRibbonTabs)[number]['id'] | typeof documentPageChromeRibbonTab.id;
|
|
45
|
+
export interface DocumentCommandShortcut {
|
|
46
|
+
label: string;
|
|
47
|
+
aria: string;
|
|
48
|
+
editor?: readonly string[];
|
|
49
|
+
}
|
|
50
|
+
export type DocumentCommandLocation = {
|
|
51
|
+
area: 'quickAccess';
|
|
52
|
+
} | {
|
|
53
|
+
area: 'status';
|
|
54
|
+
} | {
|
|
55
|
+
area: 'ribbon';
|
|
56
|
+
tab: DocumentStandardRibbonTabId;
|
|
57
|
+
group: string;
|
|
58
|
+
};
|
|
59
|
+
export interface DocumentCommandDefinition {
|
|
60
|
+
id: string;
|
|
61
|
+
label: string;
|
|
62
|
+
location: DocumentCommandLocation;
|
|
63
|
+
shortcut?: DocumentCommandShortcut;
|
|
64
|
+
}
|
|
65
|
+
export declare const documentCommandCatalog: {
|
|
66
|
+
readonly undo: {
|
|
67
|
+
readonly id: "history.undo";
|
|
68
|
+
readonly label: "撤销";
|
|
69
|
+
readonly location: {
|
|
70
|
+
readonly area: "quickAccess";
|
|
71
|
+
};
|
|
72
|
+
readonly shortcut: {
|
|
73
|
+
readonly label: "Cmd/Ctrl+Z";
|
|
74
|
+
readonly aria: "Control+Z Meta+Z";
|
|
75
|
+
readonly editor: readonly ["Mod-z"];
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
readonly redo: {
|
|
79
|
+
readonly id: "history.redo";
|
|
80
|
+
readonly label: "重做";
|
|
81
|
+
readonly location: {
|
|
82
|
+
readonly area: "quickAccess";
|
|
83
|
+
};
|
|
84
|
+
readonly shortcut: {
|
|
85
|
+
readonly label: "Cmd/Ctrl+Shift+Z 或 Cmd/Ctrl+Y";
|
|
86
|
+
readonly aria: "Control+Shift+Z Meta+Shift+Z Control+Y Meta+Y";
|
|
87
|
+
readonly editor: readonly ["Mod-Shift-z", "Mod-y"];
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
readonly growFont: {
|
|
91
|
+
readonly id: "font.grow";
|
|
92
|
+
readonly label: "增大字号";
|
|
93
|
+
readonly location: {
|
|
94
|
+
readonly area: "ribbon";
|
|
95
|
+
readonly tab: "home";
|
|
96
|
+
readonly group: "font";
|
|
97
|
+
};
|
|
98
|
+
readonly shortcut: {
|
|
99
|
+
readonly label: "Cmd/Ctrl+Shift+. 或 Cmd/Ctrl+]";
|
|
100
|
+
readonly aria: "Control+Shift+. Meta+Shift+. Control+] Meta+]";
|
|
101
|
+
readonly editor: readonly ["Mod-Shift-.", "Mod-]"];
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
readonly shrinkFont: {
|
|
105
|
+
readonly id: "font.shrink";
|
|
106
|
+
readonly label: "减小字号";
|
|
107
|
+
readonly location: {
|
|
108
|
+
readonly area: "ribbon";
|
|
109
|
+
readonly tab: "home";
|
|
110
|
+
readonly group: "font";
|
|
111
|
+
};
|
|
112
|
+
readonly shortcut: {
|
|
113
|
+
readonly label: "Cmd/Ctrl+Shift+, 或 Cmd/Ctrl+[";
|
|
114
|
+
readonly aria: "Control+Shift+, Meta+Shift+, Control+[ Meta+[";
|
|
115
|
+
readonly editor: readonly ["Mod-Shift-,", "Mod-["];
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
readonly copyFormat: {
|
|
119
|
+
readonly id: "clipboard.copyFormat";
|
|
120
|
+
readonly label: "复制格式";
|
|
121
|
+
readonly location: {
|
|
122
|
+
readonly area: "ribbon";
|
|
123
|
+
readonly tab: "home";
|
|
124
|
+
readonly group: "clipboard";
|
|
125
|
+
};
|
|
126
|
+
readonly shortcut: {
|
|
127
|
+
readonly label: "Cmd/Ctrl+Shift+C";
|
|
128
|
+
readonly aria: "Control+Shift+C Meta+Shift+C";
|
|
129
|
+
readonly editor: readonly ["Mod-Shift-c"];
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
readonly pasteFormat: {
|
|
133
|
+
readonly id: "clipboard.pasteFormat";
|
|
134
|
+
readonly label: "粘贴格式";
|
|
135
|
+
readonly location: {
|
|
136
|
+
readonly area: "ribbon";
|
|
137
|
+
readonly tab: "home";
|
|
138
|
+
readonly group: "clipboard";
|
|
139
|
+
};
|
|
140
|
+
readonly shortcut: {
|
|
141
|
+
readonly label: "Cmd/Ctrl+Shift+V";
|
|
142
|
+
readonly aria: "Control+Shift+V Meta+Shift+V";
|
|
143
|
+
readonly editor: readonly ["Mod-Shift-v"];
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
readonly formatPainter: {
|
|
147
|
+
readonly id: "clipboard.formatPainter";
|
|
148
|
+
readonly label: "格式刷";
|
|
149
|
+
readonly location: {
|
|
150
|
+
readonly area: "ribbon";
|
|
151
|
+
readonly tab: "home";
|
|
152
|
+
readonly group: "clipboard";
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
readonly bold: {
|
|
156
|
+
readonly id: "font.bold";
|
|
157
|
+
readonly label: "加粗";
|
|
158
|
+
readonly location: {
|
|
159
|
+
readonly area: "ribbon";
|
|
160
|
+
readonly tab: "home";
|
|
161
|
+
readonly group: "font";
|
|
162
|
+
};
|
|
163
|
+
readonly shortcut: {
|
|
164
|
+
readonly label: "Cmd/Ctrl+B";
|
|
165
|
+
readonly aria: "Control+B Meta+B";
|
|
166
|
+
readonly editor: readonly ["Mod-b"];
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
readonly italic: {
|
|
170
|
+
readonly id: "font.italic";
|
|
171
|
+
readonly label: "斜体";
|
|
172
|
+
readonly location: {
|
|
173
|
+
readonly area: "ribbon";
|
|
174
|
+
readonly tab: "home";
|
|
175
|
+
readonly group: "font";
|
|
176
|
+
};
|
|
177
|
+
readonly shortcut: {
|
|
178
|
+
readonly label: "Cmd/Ctrl+I";
|
|
179
|
+
readonly aria: "Control+I Meta+I";
|
|
180
|
+
readonly editor: readonly ["Mod-i"];
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
readonly underline: {
|
|
184
|
+
readonly id: "font.underline";
|
|
185
|
+
readonly label: "下划线";
|
|
186
|
+
readonly location: {
|
|
187
|
+
readonly area: "ribbon";
|
|
188
|
+
readonly tab: "home";
|
|
189
|
+
readonly group: "font";
|
|
190
|
+
};
|
|
191
|
+
readonly shortcut: {
|
|
192
|
+
readonly label: "Cmd/Ctrl+U";
|
|
193
|
+
readonly aria: "Control+U Meta+U";
|
|
194
|
+
readonly editor: readonly ["Mod-u"];
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
readonly strike: {
|
|
198
|
+
readonly id: "font.strike";
|
|
199
|
+
readonly label: "删除线";
|
|
200
|
+
readonly location: {
|
|
201
|
+
readonly area: "ribbon";
|
|
202
|
+
readonly tab: "home";
|
|
203
|
+
readonly group: "font";
|
|
204
|
+
};
|
|
205
|
+
};
|
|
206
|
+
readonly subscript: {
|
|
207
|
+
readonly id: "font.subscript";
|
|
208
|
+
readonly label: "下标";
|
|
209
|
+
readonly location: {
|
|
210
|
+
readonly area: "ribbon";
|
|
211
|
+
readonly tab: "home";
|
|
212
|
+
readonly group: "font";
|
|
213
|
+
};
|
|
214
|
+
readonly shortcut: {
|
|
215
|
+
readonly label: "Cmd/Ctrl+=";
|
|
216
|
+
readonly aria: "Control+= Meta+=";
|
|
217
|
+
readonly editor: readonly ["Mod-="];
|
|
218
|
+
};
|
|
219
|
+
};
|
|
220
|
+
readonly superscript: {
|
|
221
|
+
readonly id: "font.superscript";
|
|
222
|
+
readonly label: "上标";
|
|
223
|
+
readonly location: {
|
|
224
|
+
readonly area: "ribbon";
|
|
225
|
+
readonly tab: "home";
|
|
226
|
+
readonly group: "font";
|
|
227
|
+
};
|
|
228
|
+
readonly shortcut: {
|
|
229
|
+
readonly label: "Cmd/Ctrl+Shift+=";
|
|
230
|
+
readonly aria: "Control+Shift+= Meta+Shift+=";
|
|
231
|
+
readonly editor: readonly ["Mod-Shift-="];
|
|
232
|
+
};
|
|
233
|
+
};
|
|
234
|
+
readonly highlight: {
|
|
235
|
+
readonly id: "font.highlight";
|
|
236
|
+
readonly label: "突出显示";
|
|
237
|
+
readonly location: {
|
|
238
|
+
readonly area: "ribbon";
|
|
239
|
+
readonly tab: "home";
|
|
240
|
+
readonly group: "font";
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
readonly clearFormatting: {
|
|
244
|
+
readonly id: "font.clearFormatting";
|
|
245
|
+
readonly label: "清除格式";
|
|
246
|
+
readonly location: {
|
|
247
|
+
readonly area: "ribbon";
|
|
248
|
+
readonly tab: "home";
|
|
249
|
+
readonly group: "font";
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
readonly alignLeft: {
|
|
253
|
+
readonly id: "paragraph.alignLeft";
|
|
254
|
+
readonly label: "左对齐";
|
|
255
|
+
readonly location: {
|
|
256
|
+
readonly area: "ribbon";
|
|
257
|
+
readonly tab: "home";
|
|
258
|
+
readonly group: "paragraph";
|
|
259
|
+
};
|
|
260
|
+
readonly shortcut: {
|
|
261
|
+
readonly label: "Cmd/Ctrl+L";
|
|
262
|
+
readonly aria: "Control+L Meta+L";
|
|
263
|
+
readonly editor: readonly ["Mod-l"];
|
|
264
|
+
};
|
|
265
|
+
};
|
|
266
|
+
readonly alignCenter: {
|
|
267
|
+
readonly id: "paragraph.alignCenter";
|
|
268
|
+
readonly label: "居中";
|
|
269
|
+
readonly location: {
|
|
270
|
+
readonly area: "ribbon";
|
|
271
|
+
readonly tab: "home";
|
|
272
|
+
readonly group: "paragraph";
|
|
273
|
+
};
|
|
274
|
+
readonly shortcut: {
|
|
275
|
+
readonly label: "Cmd/Ctrl+E";
|
|
276
|
+
readonly aria: "Control+E Meta+E";
|
|
277
|
+
readonly editor: readonly ["Mod-e"];
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
readonly alignRight: {
|
|
281
|
+
readonly id: "paragraph.alignRight";
|
|
282
|
+
readonly label: "右对齐";
|
|
283
|
+
readonly location: {
|
|
284
|
+
readonly area: "ribbon";
|
|
285
|
+
readonly tab: "home";
|
|
286
|
+
readonly group: "paragraph";
|
|
287
|
+
};
|
|
288
|
+
readonly shortcut: {
|
|
289
|
+
readonly label: "Cmd/Ctrl+R";
|
|
290
|
+
readonly aria: "Control+R Meta+R";
|
|
291
|
+
readonly editor: readonly ["Mod-r"];
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
readonly alignJustify: {
|
|
295
|
+
readonly id: "paragraph.alignJustify";
|
|
296
|
+
readonly label: "两端对齐";
|
|
297
|
+
readonly location: {
|
|
298
|
+
readonly area: "ribbon";
|
|
299
|
+
readonly tab: "home";
|
|
300
|
+
readonly group: "paragraph";
|
|
301
|
+
};
|
|
302
|
+
readonly shortcut: {
|
|
303
|
+
readonly label: "Cmd/Ctrl+J";
|
|
304
|
+
readonly aria: "Control+J Meta+J";
|
|
305
|
+
readonly editor: readonly ["Mod-j"];
|
|
306
|
+
};
|
|
307
|
+
};
|
|
308
|
+
readonly lineSpacingSingle: {
|
|
309
|
+
readonly id: "paragraph.lineSpacingSingle";
|
|
310
|
+
readonly label: "单倍行距";
|
|
311
|
+
readonly location: {
|
|
312
|
+
readonly area: "ribbon";
|
|
313
|
+
readonly tab: "home";
|
|
314
|
+
readonly group: "paragraph";
|
|
315
|
+
};
|
|
316
|
+
readonly shortcut: {
|
|
317
|
+
readonly label: "Cmd/Ctrl+1";
|
|
318
|
+
readonly aria: "Control+1 Meta+1";
|
|
319
|
+
readonly editor: readonly ["Mod-1"];
|
|
320
|
+
};
|
|
321
|
+
};
|
|
322
|
+
readonly lineSpacingOneAndHalf: {
|
|
323
|
+
readonly id: "paragraph.lineSpacingOneAndHalf";
|
|
324
|
+
readonly label: "1.5 倍行距";
|
|
325
|
+
readonly location: {
|
|
326
|
+
readonly area: "ribbon";
|
|
327
|
+
readonly tab: "home";
|
|
328
|
+
readonly group: "paragraph";
|
|
329
|
+
};
|
|
330
|
+
readonly shortcut: {
|
|
331
|
+
readonly label: "Cmd/Ctrl+5";
|
|
332
|
+
readonly aria: "Control+5 Meta+5";
|
|
333
|
+
readonly editor: readonly ["Mod-5"];
|
|
334
|
+
};
|
|
335
|
+
};
|
|
336
|
+
readonly lineSpacingDouble: {
|
|
337
|
+
readonly id: "paragraph.lineSpacingDouble";
|
|
338
|
+
readonly label: "双倍行距";
|
|
339
|
+
readonly location: {
|
|
340
|
+
readonly area: "ribbon";
|
|
341
|
+
readonly tab: "home";
|
|
342
|
+
readonly group: "paragraph";
|
|
343
|
+
};
|
|
344
|
+
readonly shortcut: {
|
|
345
|
+
readonly label: "Cmd/Ctrl+2";
|
|
346
|
+
readonly aria: "Control+2 Meta+2";
|
|
347
|
+
readonly editor: readonly ["Mod-2"];
|
|
348
|
+
};
|
|
349
|
+
};
|
|
350
|
+
readonly heading1: {
|
|
351
|
+
readonly id: "styles.heading1";
|
|
352
|
+
readonly label: "标题 1";
|
|
353
|
+
readonly location: {
|
|
354
|
+
readonly area: "ribbon";
|
|
355
|
+
readonly tab: "home";
|
|
356
|
+
readonly group: "styles";
|
|
357
|
+
};
|
|
358
|
+
readonly shortcut: {
|
|
359
|
+
readonly label: "Cmd/Ctrl+Alt+1";
|
|
360
|
+
readonly aria: "Control+Alt+1 Meta+Alt+1";
|
|
361
|
+
readonly editor: readonly ["Mod-Alt-1"];
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
readonly heading2: {
|
|
365
|
+
readonly id: "styles.heading2";
|
|
366
|
+
readonly label: "标题 2";
|
|
367
|
+
readonly location: {
|
|
368
|
+
readonly area: "ribbon";
|
|
369
|
+
readonly tab: "home";
|
|
370
|
+
readonly group: "styles";
|
|
371
|
+
};
|
|
372
|
+
readonly shortcut: {
|
|
373
|
+
readonly label: "Cmd/Ctrl+Alt+2";
|
|
374
|
+
readonly aria: "Control+Alt+2 Meta+Alt+2";
|
|
375
|
+
readonly editor: readonly ["Mod-Alt-2"];
|
|
376
|
+
};
|
|
377
|
+
};
|
|
378
|
+
readonly heading3: {
|
|
379
|
+
readonly id: "styles.heading3";
|
|
380
|
+
readonly label: "标题 3";
|
|
381
|
+
readonly location: {
|
|
382
|
+
readonly area: "ribbon";
|
|
383
|
+
readonly tab: "home";
|
|
384
|
+
readonly group: "styles";
|
|
385
|
+
};
|
|
386
|
+
readonly shortcut: {
|
|
387
|
+
readonly label: "Cmd/Ctrl+Alt+3";
|
|
388
|
+
readonly aria: "Control+Alt+3 Meta+Alt+3";
|
|
389
|
+
readonly editor: readonly ["Mod-Alt-3"];
|
|
390
|
+
};
|
|
391
|
+
};
|
|
392
|
+
readonly find: {
|
|
393
|
+
readonly id: "editing.find";
|
|
394
|
+
readonly label: "查找";
|
|
395
|
+
readonly location: {
|
|
396
|
+
readonly area: "ribbon";
|
|
397
|
+
readonly tab: "home";
|
|
398
|
+
readonly group: "editing";
|
|
399
|
+
};
|
|
400
|
+
readonly shortcut: {
|
|
401
|
+
readonly label: "Cmd/Ctrl+F";
|
|
402
|
+
readonly aria: "Control+F Meta+F";
|
|
403
|
+
readonly editor: readonly ["Mod-f"];
|
|
404
|
+
};
|
|
405
|
+
};
|
|
406
|
+
readonly replace: {
|
|
407
|
+
readonly id: "editing.replace";
|
|
408
|
+
readonly label: "替换";
|
|
409
|
+
readonly location: {
|
|
410
|
+
readonly area: "ribbon";
|
|
411
|
+
readonly tab: "home";
|
|
412
|
+
readonly group: "editing";
|
|
413
|
+
};
|
|
414
|
+
readonly shortcut: {
|
|
415
|
+
readonly label: "Cmd/Ctrl+H";
|
|
416
|
+
readonly aria: "Control+H Meta+H";
|
|
417
|
+
readonly editor: readonly ["Mod-h"];
|
|
418
|
+
};
|
|
419
|
+
};
|
|
420
|
+
readonly insertPageBreak: {
|
|
421
|
+
readonly id: "insert.pageBreak";
|
|
422
|
+
readonly label: "插入分页符";
|
|
423
|
+
readonly location: {
|
|
424
|
+
readonly area: "ribbon";
|
|
425
|
+
readonly tab: "insert";
|
|
426
|
+
readonly group: "pages";
|
|
427
|
+
};
|
|
428
|
+
readonly shortcut: {
|
|
429
|
+
readonly label: "Cmd/Ctrl+Enter";
|
|
430
|
+
readonly aria: "Control+Enter Meta+Enter";
|
|
431
|
+
readonly editor: readonly ["Mod-Enter"];
|
|
432
|
+
};
|
|
433
|
+
};
|
|
434
|
+
readonly hyperlink: {
|
|
435
|
+
readonly id: "insert.hyperlink";
|
|
436
|
+
readonly label: "添加链接";
|
|
437
|
+
readonly location: {
|
|
438
|
+
readonly area: "ribbon";
|
|
439
|
+
readonly tab: "insert";
|
|
440
|
+
readonly group: "links";
|
|
441
|
+
};
|
|
442
|
+
readonly shortcut: {
|
|
443
|
+
readonly label: "Cmd/Ctrl+K";
|
|
444
|
+
readonly aria: "Control+K Meta+K";
|
|
445
|
+
readonly editor: readonly ["Mod-k"];
|
|
446
|
+
};
|
|
447
|
+
};
|
|
448
|
+
readonly spelling: {
|
|
449
|
+
readonly id: "review.spelling";
|
|
450
|
+
readonly label: "拼写检查";
|
|
451
|
+
readonly location: {
|
|
452
|
+
readonly area: "ribbon";
|
|
453
|
+
readonly tab: "review";
|
|
454
|
+
readonly group: "proofing";
|
|
455
|
+
};
|
|
456
|
+
readonly shortcut: {
|
|
457
|
+
readonly label: "F7";
|
|
458
|
+
readonly aria: "F7";
|
|
459
|
+
readonly editor: readonly ["F7"];
|
|
460
|
+
};
|
|
461
|
+
};
|
|
462
|
+
readonly insertComment: {
|
|
463
|
+
readonly id: "review.insertComment";
|
|
464
|
+
readonly label: "添加批注";
|
|
465
|
+
readonly location: {
|
|
466
|
+
readonly area: "ribbon";
|
|
467
|
+
readonly tab: "review";
|
|
468
|
+
readonly group: "comments";
|
|
469
|
+
};
|
|
470
|
+
readonly shortcut: {
|
|
471
|
+
readonly label: "Cmd/Ctrl+Alt+M";
|
|
472
|
+
readonly aria: "Control+Alt+M Meta+Alt+M";
|
|
473
|
+
readonly editor: readonly ["Mod-Alt-m"];
|
|
474
|
+
};
|
|
475
|
+
};
|
|
476
|
+
readonly trackChanges: {
|
|
477
|
+
readonly id: "review.trackChanges";
|
|
478
|
+
readonly label: "修订模式";
|
|
479
|
+
readonly location: {
|
|
480
|
+
readonly area: "ribbon";
|
|
481
|
+
readonly tab: "review";
|
|
482
|
+
readonly group: "tracking";
|
|
483
|
+
};
|
|
484
|
+
readonly shortcut: {
|
|
485
|
+
readonly label: "Cmd/Ctrl+Shift+E";
|
|
486
|
+
readonly aria: "Control+Shift+E Meta+Shift+E";
|
|
487
|
+
readonly editor: readonly ["Mod-Shift-e"];
|
|
488
|
+
};
|
|
489
|
+
};
|
|
490
|
+
readonly refreshFields: {
|
|
491
|
+
readonly id: "references.refreshFields";
|
|
492
|
+
readonly label: "更新域";
|
|
493
|
+
readonly location: {
|
|
494
|
+
readonly area: "ribbon";
|
|
495
|
+
readonly tab: "references";
|
|
496
|
+
readonly group: "update";
|
|
497
|
+
};
|
|
498
|
+
readonly shortcut: {
|
|
499
|
+
readonly label: "F9";
|
|
500
|
+
readonly aria: "F9";
|
|
501
|
+
readonly editor: readonly ["F9"];
|
|
502
|
+
};
|
|
503
|
+
};
|
|
504
|
+
readonly navigationPane: {
|
|
505
|
+
readonly id: "view.navigationPane";
|
|
506
|
+
readonly label: "导航窗格";
|
|
507
|
+
readonly location: {
|
|
508
|
+
readonly area: "ribbon";
|
|
509
|
+
readonly tab: "view";
|
|
510
|
+
readonly group: "show";
|
|
511
|
+
};
|
|
512
|
+
};
|
|
513
|
+
readonly wordCount: {
|
|
514
|
+
readonly id: "status.wordCount";
|
|
515
|
+
readonly label: "字数统计";
|
|
516
|
+
readonly location: {
|
|
517
|
+
readonly area: "status";
|
|
518
|
+
};
|
|
519
|
+
readonly shortcut: {
|
|
520
|
+
readonly label: "Cmd/Ctrl+Shift+G";
|
|
521
|
+
readonly aria: "Control+Shift+G Meta+Shift+G";
|
|
522
|
+
readonly editor: readonly ["Mod-Shift-g"];
|
|
523
|
+
};
|
|
524
|
+
};
|
|
525
|
+
};
|
|
526
|
+
export type DocumentCommandId = keyof typeof documentCommandCatalog;
|
|
527
|
+
export declare function getDocumentCommandDefinition<T extends DocumentCommandId>(id: T): DocumentCommandDefinition;
|
|
@@ -3,8 +3,6 @@ import type { WorkspaceContextMenuItem } from '../../workspace/components/worksp
|
|
|
3
3
|
import { type WorkAgentProposalRequest, type WorkAgentProposalTarget } from '../work-agent-proposal';
|
|
4
4
|
import type { WorkEditorAgentRequest } from '../work-agent-request';
|
|
5
5
|
import type { WorkDocumentSelectionAction, WorkDocumentSelectionMenuIcon, WorkDocumentSelectionMenuItem } from '../work-document-selection-menu';
|
|
6
|
-
export declare const MIN_DOCUMENT_ZOOM = 50;
|
|
7
|
-
export declare const MAX_DOCUMENT_ZOOM = 200;
|
|
8
6
|
export declare function documentEditorSelectionText(editor: Pick<Editor, 'state'>): string;
|
|
9
7
|
export declare function documentAgentMenuItems(selection: string, onAgentRequest: (request: WorkEditorAgentRequest) => void | Promise<void>, proposalOptions?: {
|
|
10
8
|
target: WorkAgentProposalTarget;
|
|
@@ -30,5 +28,11 @@ export declare function customSelectionMenuItems<Context>(items: readonly Custom
|
|
|
30
28
|
export declare function documentPageCount(editor: Editor): number;
|
|
31
29
|
export declare function documentCurrentPage(editor: Editor): number;
|
|
32
30
|
export declare function documentWordCount(value: string): number;
|
|
33
|
-
export
|
|
31
|
+
export interface DocumentTextStatistics {
|
|
32
|
+
characterCountWithSpaces: number;
|
|
33
|
+
characterCountWithoutSpaces: number;
|
|
34
|
+
paragraphCount: number;
|
|
35
|
+
wordCount: number;
|
|
36
|
+
}
|
|
37
|
+
export declare function documentTextStatistics(editor: Pick<Editor, 'getText' | 'state'>): DocumentTextStatistics;
|
|
34
38
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Extensions } from '@tiptap/core';
|
|
2
2
|
import type { WorkEditorAgentRequest } from '../work-agent-request';
|
|
3
3
|
import type { WorkDocumentLayoutFont } from '../work-document-fonts';
|
|
4
|
+
import { type WorkGetDocumentSelectionMenuItems } from '../work-document-selection-menu';
|
|
4
5
|
import type { WorkDocumentContent } from '../work-types';
|
|
5
6
|
import { type WorkOfficeFileAction } from './work-office-chrome';
|
|
6
|
-
import { type WorkGetDocumentSelectionMenuItems } from '../work-document-selection-menu';
|
|
7
7
|
export interface DocumentEditorProps {
|
|
8
8
|
artifactId?: string;
|
|
9
9
|
content: WorkDocumentContent;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/core';
|
|
2
|
+
export declare function copyDocumentFormatting(editor: Editor): boolean;
|
|
3
|
+
export declare function pasteDocumentFormatting(editor: Editor): boolean;
|
|
4
|
+
export declare function hasDocumentFormatClipboard(): boolean;
|
|
5
|
+
export declare function subscribeDocumentFormatClipboard(listener: () => void): () => void;
|
|
6
|
+
export declare function clearDocumentFormatClipboard(): void;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { WorkDocumentSectionLayout } from '../work-types';
|
|
2
|
-
export
|
|
2
|
+
export type DocumentLayoutPanelTab = 'columns' | 'headerFooter' | 'page';
|
|
3
|
+
export declare function DocumentLayoutPanel({ layout, activeTab: controlledActiveTab, sectionIndex, sectionCount, onActiveTabChange, onChange, onInsertSection, onMergeSection, onClose, }: {
|
|
3
4
|
layout: WorkDocumentSectionLayout;
|
|
5
|
+
activeTab?: DocumentLayoutPanelTab;
|
|
4
6
|
sectionIndex: number;
|
|
5
7
|
sectionCount: number;
|
|
8
|
+
onActiveTabChange?: (tab: DocumentLayoutPanelTab) => void;
|
|
6
9
|
onChange: (layout: WorkDocumentSectionLayout) => void;
|
|
7
10
|
onInsertSection: () => void;
|
|
8
11
|
onMergeSection: () => void;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/core';
|
|
2
|
+
import type { WorkDocumentSectionLayout } from '../work-types';
|
|
3
|
+
import type { DocumentLayoutPanelTab } from './document-layout-panel';
|
|
4
|
+
export declare function DocumentPageLayoutRibbon({ editor, layout, layoutOpen, pageColor, onLayoutChange, onOpenLayout, onToggleLayout, onPageColorChange, onInsertSection, }: {
|
|
5
|
+
editor: Editor;
|
|
6
|
+
layout: WorkDocumentSectionLayout;
|
|
7
|
+
layoutOpen: boolean;
|
|
8
|
+
pageColor: string;
|
|
9
|
+
onLayoutChange: (layout: WorkDocumentSectionLayout) => void;
|
|
10
|
+
onOpenLayout: (target: DocumentLayoutPanelTab) => void;
|
|
11
|
+
onToggleLayout: () => void;
|
|
12
|
+
onPageColorChange: (color: string) => void;
|
|
13
|
+
onInsertSection: () => void;
|
|
14
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WorkDocumentChange } from '../work-document-changes';
|
|
2
|
+
interface DocumentSelectionRange {
|
|
3
|
+
from: number;
|
|
4
|
+
to: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function selectedDocumentChangeIndex(changes: readonly WorkDocumentChange[], selection: DocumentSelectionRange): number | null;
|
|
7
|
+
export declare function adjacentDocumentChangeIndex(changes: readonly WorkDocumentChange[], selection: DocumentSelectionRange, direction: -1 | 1): number | null;
|
|
8
|
+
export declare function actionableDocumentChangeIndex(changes: readonly WorkDocumentChange[], selection: DocumentSelectionRange): number | null;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DocumentTextStatistics } from './document-editor-support';
|
|
2
|
+
export declare function DocumentStatisticsDialog({ pageCount, restoreFocusTarget, statistics, onClose, }: {
|
|
3
|
+
pageCount: number;
|
|
4
|
+
restoreFocusTarget: () => HTMLElement | null;
|
|
5
|
+
statistics: DocumentTextStatistics;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
}): import("react").JSX.Element;
|
|
@@ -12,8 +12,9 @@ interface DocumentStatusBarProps {
|
|
|
12
12
|
wordCount: number;
|
|
13
13
|
zoom: number;
|
|
14
14
|
onSpellcheckChange: (enabled: boolean) => void;
|
|
15
|
+
onOpenWordCount: () => void;
|
|
15
16
|
onViewModeChange: (mode: DocumentViewMode) => void;
|
|
16
17
|
onZoomChange: (zoom: number) => void;
|
|
17
18
|
}
|
|
18
|
-
export declare function DocumentStatusBar({ bibliographyCount, citationCount, currentPage, pageCount, saveStatus, sectionCount, sectionIndex, spellcheckEnabled, viewMode, wordCount, zoom, onSpellcheckChange, onViewModeChange, onZoomChange, }: DocumentStatusBarProps): import("react").JSX.Element;
|
|
19
|
+
export declare function DocumentStatusBar({ bibliographyCount, citationCount, currentPage, pageCount, saveStatus, sectionCount, sectionIndex, spellcheckEnabled, viewMode, wordCount, zoom, onSpellcheckChange, onOpenWordCount, onViewModeChange, onZoomChange, }: DocumentStatusBarProps): import("react").JSX.Element;
|
|
19
20
|
export {};
|