@a3s-lab/office 0.25.0 → 0.27.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 +76 -2
- package/dist/0~4595.js +16 -2
- package/dist/0~5093.js +463 -201
- package/dist/0~6090.js +77 -77
- package/dist/{0~2805.js → 0~7043.js} +305 -2
- package/dist/0~document-editor.js +2451 -985
- package/dist/0~spreadsheet-editor.js +22113 -20117
- package/dist/0~work-docx-export.js +492 -10
- package/dist/0~work-docx-import.js +171 -98
- package/dist/0~work-office-diagnostics.js +198 -4
- package/dist/{164.js → 1544.js} +1412 -1055
- package/dist/4104.js +145 -29
- package/dist/6282.js +1920 -544
- package/dist/9424.js +16 -0
- package/dist/core.js +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/features/work/editors/document-command-catalog.d.ts +102 -0
- package/dist/internal/features/work/editors/document-font-dialog-model.d.ts +83 -0
- package/dist/internal/features/work/editors/document-font-dialog-script-font-model.d.ts +18 -0
- package/dist/internal/features/work/editors/document-font-dialog.d.ts +9 -0
- package/dist/internal/features/work/editors/document-home-ribbon.d.ts +2 -1
- package/dist/internal/features/work/editors/document-page-chrome-editor.d.ts +6 -0
- package/dist/internal/features/work/editors/document-page-chrome-ribbon.d.ts +2 -1
- package/dist/internal/features/work/editors/document-strike-ribbon.d.ts +7 -0
- package/dist/internal/features/work/editors/document-text-case-ribbon.d.ts +4 -0
- package/dist/internal/features/work/editors/document-toolbar.d.ts +3 -1
- package/dist/internal/features/work/editors/document-underline-ribbon.d.ts +9 -0
- package/dist/internal/features/work/editors/document-wps-shortcuts.d.ts +1 -0
- package/dist/internal/features/work/editors/spreadsheet-cell-fill-format.d.ts +11 -0
- package/dist/internal/features/work/editors/spreadsheet-cell-format.d.ts +2 -1
- package/dist/internal/features/work/editors/spreadsheet-command-controller.d.ts +18 -9
- package/dist/internal/features/work/editors/spreadsheet-format-cells-dialog-model.d.ts +13 -2
- package/dist/internal/features/work/editors/spreadsheet-format-cells-fill-panel.d.ts +13 -0
- package/dist/internal/features/work/editors/spreadsheet-format-cells-fill-preview.d.ts +6 -0
- package/dist/internal/features/work/editors/spreadsheet-format-painter.d.ts +1 -1
- package/dist/internal/features/work/editors/spreadsheet-operation-projection.d.ts +6 -0
- package/dist/internal/features/work/editors/spreadsheet-rich-text-dom-selection.d.ts +11 -0
- package/dist/internal/features/work/editors/spreadsheet-rich-text-paste.d.ts +22 -0
- package/dist/internal/features/work/editors/spreadsheet-rich-text-selection-controller.d.ts +38 -0
- package/dist/internal/features/work/editors/spreadsheet-rich-text-selection-format.d.ts +26 -0
- package/dist/internal/features/work/editors/work-office-chrome.d.ts +9 -1
- package/dist/internal/features/work/work-css-color.d.ts +1 -0
- package/dist/internal/features/work/work-document-character-formatting.d.ts +16 -1
- package/dist/internal/features/work/work-document-character-position.d.ts +9 -0
- package/dist/internal/features/work/work-document-character-scale.d.ts +8 -0
- package/dist/internal/features/work/work-document-character-spacing.d.ts +8 -0
- package/dist/internal/features/work/work-document-emphasis.d.ts +7 -0
- package/dist/internal/features/work/work-document-equations.d.ts +2 -1
- package/dist/internal/features/work/work-document-format-changes.d.ts +16 -2
- package/dist/internal/features/work/work-document-hidden-text.d.ts +5 -0
- package/dist/internal/features/work/work-document-kerning.d.ts +10 -0
- package/dist/internal/features/work/work-document-paragraph-shading.d.ts +1 -1
- package/dist/internal/features/work/work-document-script-font-extension.d.ts +2 -0
- package/dist/internal/features/work/work-document-script-fonts.d.ts +51 -0
- package/dist/internal/features/work/work-document-strike.d.ts +21 -0
- package/dist/internal/features/work/work-document-text-case.d.ts +10 -0
- package/dist/internal/features/work/work-document-underline.d.ts +37 -0
- package/dist/internal/features/work/work-document-word-line-metrics.d.ts +12 -0
- package/dist/internal/features/work/work-docx-character-position.d.ts +2 -0
- package/dist/internal/features/work/work-docx-character-scale.d.ts +2 -0
- package/dist/internal/features/work/work-docx-character-spacing.d.ts +4 -0
- package/dist/internal/features/work/work-docx-emphasis-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-emphasis.d.ts +14 -0
- package/dist/internal/features/work/work-docx-hidden-text-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-hidden-text-export.d.ts +16 -0
- package/dist/internal/features/work/work-docx-hidden-text.d.ts +11 -0
- package/dist/internal/features/work/work-docx-kerning-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-kerning.d.ts +14 -0
- package/dist/internal/features/work/work-docx-run-fonts-diagnostics.d.ts +3 -0
- package/dist/internal/features/work/work-docx-run-fonts-export.d.ts +14 -0
- package/dist/internal/features/work/work-docx-run-fonts.d.ts +13 -0
- package/dist/internal/features/work/work-docx-run-formatting-import.d.ts +23 -2
- package/dist/internal/features/work/work-docx-run-script-font-import.d.ts +9 -0
- package/dist/internal/features/work/work-docx-strike.d.ts +8 -0
- package/dist/internal/features/work/work-docx-theme-reference.d.ts +1 -1
- package/dist/internal/features/work/work-docx-twips.d.ts +6 -0
- package/dist/internal/features/work/work-docx-underline.d.ts +3 -0
- package/dist/internal/features/work/work-spreadsheet-gradient-fill-canvas.d.ts +10 -0
- package/dist/internal/features/work/work-spreadsheet-native-fill-canvas.d.ts +8 -0
- package/dist/internal/features/work/work-spreadsheet-pattern-fill-canvas.d.ts +8 -0
- package/dist/internal/features/work/work-xlsx-cell-style-origin.d.ts +2 -1
- package/dist/internal/features/work/work-xlsx-cell-style-writer.d.ts +3 -0
- package/dist/internal/features/work/work-xlsx-cell-styles.d.ts +4 -0
- package/dist/internal/features/work/work-xlsx-gradient-fill.d.ts +31 -0
- package/dist/internal/features/work/work-xlsx-native-fill.d.ts +17 -0
- package/dist/internal/features/work/work-xlsx-pattern-fill.d.ts +21 -0
- package/dist/internal/features/work/work-xlsx-rich-text-edit.d.ts +28 -0
- package/dist/internal/features/work/work-xlsx-rich-text-model.d.ts +40 -0
- package/dist/internal/features/work/work-xlsx-rich-text.d.ts +4 -18
- package/dist/office-kernel.wasm +0 -0
- package/dist/styles.css +770 -80
- package/docs/latest/en/browser-editor-architecture.md +37 -0
- package/package.json +32 -1
package/dist/9424.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
function normalizeCssColor(source) {
|
|
2
|
+
const value = source?.trim().toLowerCase();
|
|
3
|
+
if (!value) return null;
|
|
4
|
+
if ('transparent' === value) return 'transparent';
|
|
5
|
+
const shortHex = /^#([0-9a-f]{3})$/i.exec(value);
|
|
6
|
+
if (shortHex?.[1]) return `#${Array.from(shortHex[1]).map((channel)=>`${channel}${channel}`).join('')}`;
|
|
7
|
+
if (/^#[0-9a-f]{6}$/i.test(value)) return value;
|
|
8
|
+
const rgb = /^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})(?:\s*,\s*([\d.]+))?\s*\)$/i.exec(value);
|
|
9
|
+
if (!rgb) return null;
|
|
10
|
+
const channels = rgb.slice(1, 4).map(Number);
|
|
11
|
+
if (channels.some((channel)=>channel < 0 || channel > 255)) return null;
|
|
12
|
+
if (void 0 !== rgb[4] && 0 === Number(rgb[4])) return 'transparent';
|
|
13
|
+
if (void 0 !== rgb[4] && 1 !== Number(rgb[4])) return null;
|
|
14
|
+
return `#${channels.map((channel)=>channel.toString(16).padStart(2, '0')).join('')}`;
|
|
15
|
+
}
|
|
16
|
+
export { normalizeCssColor };
|
package/dist/core.js
CHANGED
|
@@ -7,6 +7,6 @@ export { createArtifact, createOfficeId, officeTemplates } from "./5184.js";
|
|
|
7
7
|
export { createOfficeDocumentCollaborationBinding, initializeOfficeDocumentCollaboration, officeDocumentCollaborationFragment, readOfficeDocumentCollaboration } from "./6282.js";
|
|
8
8
|
export { createOfficeMarkdownCollaborationBinding, initializeOfficeMarkdownCollaboration, readOfficeMarkdownCollaboration, replaceOfficeMarkdownCollaboration } from "./2591.js";
|
|
9
9
|
export { createOfficePresentationCollaborationBinding, initializeOfficePresentationCollaboration, readOfficePresentationCollaboration, replaceOfficePresentationCollaboration } from "./4560.js";
|
|
10
|
-
export { createOfficeSpreadsheetCollaborationBinding, initializeOfficeSpreadsheetCollaboration, readOfficeSpreadsheetCollaboration, replaceOfficeSpreadsheetCollaboration } from "./
|
|
10
|
+
export { createOfficeSpreadsheetCollaborationBinding, initializeOfficeSpreadsheetCollaboration, readOfficeSpreadsheetCollaboration, replaceOfficeSpreadsheetCollaboration } from "./1544.js";
|
|
11
11
|
export { normalizeWorkSpreadsheetBubbleScale, normalizeWorkSpreadsheetBubbleSizeRepresents, normalizeWorkSpreadsheetChartAxisGroup, normalizeWorkSpreadsheetCombinationSeriesType, normalizeWorkSpreadsheetDataLabelPosition, normalizeWorkSpreadsheetDataLabels, normalizeWorkSpreadsheetDoughnutHoleSize, normalizeWorkSpreadsheetErrorBars, normalizeWorkSpreadsheetRadarStyle, normalizeWorkSpreadsheetScatterStyle, normalizeWorkSpreadsheetTrendline, normalizeWorkSpreadsheetTrendlineType, workSpreadsheetChartSupportsAxes, workSpreadsheetChartSupportsErrorBars, workSpreadsheetChartSupportsTrendlines, workSpreadsheetChartTypeLabel, workSpreadsheetChartUsesNumericXAxis, workSpreadsheetCombinationSeriesTypeLabel, workSpreadsheetDataLabelPositionLabel, workSpreadsheetErrorBarTypeLabel, workSpreadsheetErrorBarValueTypeLabel, workSpreadsheetTrendlineTypeLabel } from "./8715.js";
|
|
12
12
|
export { core_OFFICE_COLLABORATION_VERSION as OFFICE_COLLABORATION_VERSION };
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,6 @@ export { createArtifact, createOfficeId, officeTemplates } from "./5184.js";
|
|
|
10
10
|
export { createOfficeDocumentCollaborationBinding, initializeOfficeDocumentCollaboration, officeDocumentCollaborationFragment, readOfficeDocumentCollaboration } from "./6282.js";
|
|
11
11
|
export { createOfficeMarkdownCollaborationBinding, initializeOfficeMarkdownCollaboration, readOfficeMarkdownCollaboration, replaceOfficeMarkdownCollaboration } from "./2591.js";
|
|
12
12
|
export { createOfficePresentationCollaborationBinding, initializeOfficePresentationCollaboration, readOfficePresentationCollaboration, replaceOfficePresentationCollaboration } from "./4560.js";
|
|
13
|
-
export { createOfficeSpreadsheetCollaborationBinding, initializeOfficeSpreadsheetCollaboration, readOfficeSpreadsheetCollaboration, replaceOfficeSpreadsheetCollaboration } from "./
|
|
13
|
+
export { createOfficeSpreadsheetCollaborationBinding, initializeOfficeSpreadsheetCollaboration, readOfficeSpreadsheetCollaboration, replaceOfficeSpreadsheetCollaboration } from "./1544.js";
|
|
14
14
|
export { normalizeWorkSpreadsheetBubbleScale, normalizeWorkSpreadsheetBubbleSizeRepresents, normalizeWorkSpreadsheetChartAxisGroup, normalizeWorkSpreadsheetCombinationSeriesType, normalizeWorkSpreadsheetDataLabelPosition, normalizeWorkSpreadsheetDataLabels, normalizeWorkSpreadsheetDoughnutHoleSize, normalizeWorkSpreadsheetErrorBars, normalizeWorkSpreadsheetRadarStyle, normalizeWorkSpreadsheetScatterStyle, normalizeWorkSpreadsheetTrendline, normalizeWorkSpreadsheetTrendlineType, workSpreadsheetChartSupportsAxes, workSpreadsheetChartSupportsErrorBars, workSpreadsheetChartSupportsTrendlines, workSpreadsheetChartTypeLabel, workSpreadsheetChartUsesNumericXAxis, workSpreadsheetCombinationSeriesTypeLabel, workSpreadsheetDataLabelPositionLabel, workSpreadsheetErrorBarTypeLabel, workSpreadsheetErrorBarValueTypeLabel, workSpreadsheetTrendlineTypeLabel } from "./8715.js";
|
|
15
15
|
export { src_DOCUMENT_SNAPSHOT_VERSION as DOCUMENT_SNAPSHOT_VERSION, src_DOCUMENT_SOURCE_VERSION as DOCUMENT_SOURCE_VERSION, src_OFFICE_COLLABORATION_VERSION as OFFICE_COLLABORATION_VERSION };
|
|
@@ -143,6 +143,20 @@ export declare const documentCommandCatalog: {
|
|
|
143
143
|
readonly editor: readonly ["Mod-Shift-v"];
|
|
144
144
|
};
|
|
145
145
|
};
|
|
146
|
+
readonly fontDialog: {
|
|
147
|
+
readonly id: "font.dialog";
|
|
148
|
+
readonly label: "字体高级设置";
|
|
149
|
+
readonly location: {
|
|
150
|
+
readonly area: "ribbon";
|
|
151
|
+
readonly tab: "home";
|
|
152
|
+
readonly group: "font";
|
|
153
|
+
};
|
|
154
|
+
readonly shortcut: {
|
|
155
|
+
readonly label: "Cmd/Ctrl+D";
|
|
156
|
+
readonly aria: "Control+D Meta+D";
|
|
157
|
+
readonly editor: readonly ["Mod-d"];
|
|
158
|
+
};
|
|
159
|
+
};
|
|
146
160
|
readonly formatPainter: {
|
|
147
161
|
readonly id: "clipboard.formatPainter";
|
|
148
162
|
readonly label: "格式刷";
|
|
@@ -194,6 +208,34 @@ export declare const documentCommandCatalog: {
|
|
|
194
208
|
readonly editor: readonly ["Mod-u"];
|
|
195
209
|
};
|
|
196
210
|
};
|
|
211
|
+
readonly doubleUnderline: {
|
|
212
|
+
readonly id: "font.doubleUnderline";
|
|
213
|
+
readonly label: "双下划线";
|
|
214
|
+
readonly location: {
|
|
215
|
+
readonly area: "ribbon";
|
|
216
|
+
readonly tab: "home";
|
|
217
|
+
readonly group: "font";
|
|
218
|
+
};
|
|
219
|
+
readonly shortcut: {
|
|
220
|
+
readonly label: "Cmd/Ctrl+Shift+D";
|
|
221
|
+
readonly aria: "Control+Shift+D Meta+Shift+D";
|
|
222
|
+
readonly editor: readonly ["Mod-Shift-d"];
|
|
223
|
+
};
|
|
224
|
+
};
|
|
225
|
+
readonly wordsUnderline: {
|
|
226
|
+
readonly id: "font.wordsUnderline";
|
|
227
|
+
readonly label: "仅字下划线";
|
|
228
|
+
readonly location: {
|
|
229
|
+
readonly area: "ribbon";
|
|
230
|
+
readonly tab: "home";
|
|
231
|
+
readonly group: "font";
|
|
232
|
+
};
|
|
233
|
+
readonly shortcut: {
|
|
234
|
+
readonly label: "Cmd/Ctrl+Shift+W";
|
|
235
|
+
readonly aria: "Control+Shift+W Meta+Shift+W";
|
|
236
|
+
readonly editor: readonly ["Mod-Shift-w"];
|
|
237
|
+
};
|
|
238
|
+
};
|
|
197
239
|
readonly strike: {
|
|
198
240
|
readonly id: "font.strike";
|
|
199
241
|
readonly label: "删除线";
|
|
@@ -203,6 +245,43 @@ export declare const documentCommandCatalog: {
|
|
|
203
245
|
readonly group: "font";
|
|
204
246
|
};
|
|
205
247
|
};
|
|
248
|
+
readonly doubleStrike: {
|
|
249
|
+
readonly id: "font.doubleStrike";
|
|
250
|
+
readonly label: "双删除线";
|
|
251
|
+
readonly location: {
|
|
252
|
+
readonly area: "ribbon";
|
|
253
|
+
readonly tab: "home";
|
|
254
|
+
readonly group: "font";
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
readonly allCaps: {
|
|
258
|
+
readonly id: "font.allCaps";
|
|
259
|
+
readonly label: "全部大写";
|
|
260
|
+
readonly location: {
|
|
261
|
+
readonly area: "ribbon";
|
|
262
|
+
readonly tab: "home";
|
|
263
|
+
readonly group: "font";
|
|
264
|
+
};
|
|
265
|
+
readonly shortcut: {
|
|
266
|
+
readonly label: "Cmd/Ctrl+Shift+A";
|
|
267
|
+
readonly aria: "Control+Shift+A Meta+Shift+A";
|
|
268
|
+
readonly editor: readonly ["Mod-Shift-a"];
|
|
269
|
+
};
|
|
270
|
+
};
|
|
271
|
+
readonly smallCaps: {
|
|
272
|
+
readonly id: "font.smallCaps";
|
|
273
|
+
readonly label: "小型大写";
|
|
274
|
+
readonly location: {
|
|
275
|
+
readonly area: "ribbon";
|
|
276
|
+
readonly tab: "home";
|
|
277
|
+
readonly group: "font";
|
|
278
|
+
};
|
|
279
|
+
readonly shortcut: {
|
|
280
|
+
readonly label: "Cmd/Ctrl+Shift+K";
|
|
281
|
+
readonly aria: "Control+Shift+K Meta+Shift+K";
|
|
282
|
+
readonly editor: readonly ["Mod-Shift-k"];
|
|
283
|
+
};
|
|
284
|
+
};
|
|
206
285
|
readonly subscript: {
|
|
207
286
|
readonly id: "font.subscript";
|
|
208
287
|
readonly label: "下标";
|
|
@@ -240,6 +319,20 @@ export declare const documentCommandCatalog: {
|
|
|
240
319
|
readonly group: "font";
|
|
241
320
|
};
|
|
242
321
|
};
|
|
322
|
+
readonly hiddenText: {
|
|
323
|
+
readonly id: "font.hiddenText";
|
|
324
|
+
readonly label: "隐藏文字";
|
|
325
|
+
readonly location: {
|
|
326
|
+
readonly area: "ribbon";
|
|
327
|
+
readonly tab: "home";
|
|
328
|
+
readonly group: "font";
|
|
329
|
+
};
|
|
330
|
+
readonly shortcut: {
|
|
331
|
+
readonly label: "Cmd/Ctrl+Shift+H";
|
|
332
|
+
readonly aria: "Control+Shift+H Meta+Shift+H";
|
|
333
|
+
readonly editor: readonly ["Mod-Shift-h"];
|
|
334
|
+
};
|
|
335
|
+
};
|
|
243
336
|
readonly clearFormatting: {
|
|
244
337
|
readonly id: "font.clearFormatting";
|
|
245
338
|
readonly label: "清除格式";
|
|
@@ -519,6 +612,15 @@ export declare const documentCommandCatalog: {
|
|
|
519
612
|
readonly group: "show";
|
|
520
613
|
};
|
|
521
614
|
};
|
|
615
|
+
readonly showHiddenText: {
|
|
616
|
+
readonly id: "view.showHiddenText";
|
|
617
|
+
readonly label: "显示隐藏文字";
|
|
618
|
+
readonly location: {
|
|
619
|
+
readonly area: "ribbon";
|
|
620
|
+
readonly tab: "view";
|
|
621
|
+
readonly group: "show";
|
|
622
|
+
};
|
|
623
|
+
};
|
|
522
624
|
readonly wordCount: {
|
|
523
625
|
readonly id: "status.wordCount";
|
|
524
626
|
readonly label: "字数统计";
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/core';
|
|
2
|
+
import { type WorkDocumentEmphasisMark } from '../work-document-emphasis';
|
|
3
|
+
import { type DocumentFontDialogScriptFontPatch, type DocumentFontFamilySource } from './document-font-dialog-script-font-model';
|
|
4
|
+
export type { DocumentFontFamilySource } from './document-font-dialog-script-font-model';
|
|
5
|
+
export type DocumentCharacterSpacingMode = 'condensed' | 'expanded' | 'mixed' | 'normal';
|
|
6
|
+
export type DocumentCharacterPositionMode = 'lowered' | 'mixed' | 'normal' | 'raised';
|
|
7
|
+
export type DocumentCharacterScaleMode = 'mixed' | 'value';
|
|
8
|
+
export type DocumentEmphasisMarkMode = 'inherit' | 'mixed' | WorkDocumentEmphasisMark;
|
|
9
|
+
export interface DocumentFontDialogSource {
|
|
10
|
+
characterScale: {
|
|
11
|
+
mixed: boolean;
|
|
12
|
+
value: number | null;
|
|
13
|
+
};
|
|
14
|
+
characterPosition: {
|
|
15
|
+
mixed: boolean;
|
|
16
|
+
value: number | null;
|
|
17
|
+
};
|
|
18
|
+
characterSpacing: {
|
|
19
|
+
mixed: boolean;
|
|
20
|
+
value: number | null;
|
|
21
|
+
};
|
|
22
|
+
kerningThreshold: {
|
|
23
|
+
mixed: boolean;
|
|
24
|
+
value: number | null;
|
|
25
|
+
};
|
|
26
|
+
emphasisMark: {
|
|
27
|
+
mixed: boolean;
|
|
28
|
+
value: WorkDocumentEmphasisMark | null;
|
|
29
|
+
};
|
|
30
|
+
hiddenText: {
|
|
31
|
+
mixed: boolean;
|
|
32
|
+
value: boolean | null;
|
|
33
|
+
};
|
|
34
|
+
latinFont: DocumentFontFamilySource;
|
|
35
|
+
eastAsiaFont: DocumentFontFamilySource;
|
|
36
|
+
complexScriptFont: DocumentFontFamilySource;
|
|
37
|
+
fontFamily: string | null;
|
|
38
|
+
fontSize: string | null;
|
|
39
|
+
previewText: string;
|
|
40
|
+
selectedCharacters: number;
|
|
41
|
+
}
|
|
42
|
+
export interface DocumentFontDialogDraft {
|
|
43
|
+
characterScaleMode: DocumentCharacterScaleMode;
|
|
44
|
+
characterScalePercent: string;
|
|
45
|
+
characterPositionMode: DocumentCharacterPositionMode;
|
|
46
|
+
characterPositionPoints: string;
|
|
47
|
+
characterSpacingMode: DocumentCharacterSpacingMode;
|
|
48
|
+
characterSpacingPoints: string;
|
|
49
|
+
kerningEnabled: boolean;
|
|
50
|
+
kerningThresholdPoints: string;
|
|
51
|
+
emphasisMark: DocumentEmphasisMarkMode;
|
|
52
|
+
hiddenText: boolean;
|
|
53
|
+
latinFont: string;
|
|
54
|
+
eastAsiaFont: string;
|
|
55
|
+
complexScriptFont: string;
|
|
56
|
+
}
|
|
57
|
+
export interface DocumentFontDialogPatch extends DocumentFontDialogScriptFontPatch {
|
|
58
|
+
characterScalePercent?: number;
|
|
59
|
+
characterPositionHalfPoints?: number;
|
|
60
|
+
characterSpacingTwips?: number;
|
|
61
|
+
kerningThresholdHalfPoints?: number | null;
|
|
62
|
+
emphasisMark?: WorkDocumentEmphasisMark | null;
|
|
63
|
+
hiddenText?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export interface DocumentFontDialogTouched {
|
|
66
|
+
characterPosition: boolean;
|
|
67
|
+
characterScale: boolean;
|
|
68
|
+
characterSpacing: boolean;
|
|
69
|
+
complexScriptFont: boolean;
|
|
70
|
+
eastAsiaFont: boolean;
|
|
71
|
+
emphasisMark: boolean;
|
|
72
|
+
hiddenText: boolean;
|
|
73
|
+
kerning: boolean;
|
|
74
|
+
latinFont: boolean;
|
|
75
|
+
}
|
|
76
|
+
export declare function documentFontDialogSource(editor: Editor): DocumentFontDialogSource;
|
|
77
|
+
export declare function createDocumentFontDialogDraft(source: DocumentFontDialogSource): DocumentFontDialogDraft;
|
|
78
|
+
export declare function documentFontDialogDraftError(draft: DocumentFontDialogDraft): string | null;
|
|
79
|
+
export declare function documentFontDialogPatch(source: DocumentFontDialogSource, draft: DocumentFontDialogDraft, touched: DocumentFontDialogTouched): DocumentFontDialogPatch;
|
|
80
|
+
export declare function applyDocumentFontDialogPatch(editor: Editor, selection: {
|
|
81
|
+
from: number;
|
|
82
|
+
to: number;
|
|
83
|
+
}, patch: DocumentFontDialogPatch): boolean;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/core';
|
|
2
|
+
import { type WorkDocumentScriptFontPatch } from '../work-document-script-fonts';
|
|
3
|
+
export interface DocumentFontFamilySource {
|
|
4
|
+
mixed: boolean;
|
|
5
|
+
value: string | null;
|
|
6
|
+
}
|
|
7
|
+
export interface DocumentFontDialogScriptFontPatch {
|
|
8
|
+
latinFont?: string | null;
|
|
9
|
+
eastAsiaFont?: string | null;
|
|
10
|
+
complexScriptFont?: string | null;
|
|
11
|
+
}
|
|
12
|
+
export declare function documentFontFamilyDraftValue(source: DocumentFontFamilySource): string;
|
|
13
|
+
export declare function appendDocumentFontDialogScriptFontPatch(patch: DocumentFontDialogScriptFontPatch, key: keyof DocumentFontDialogScriptFontPatch, source: DocumentFontFamilySource, draft: string, touched: boolean): void;
|
|
14
|
+
export declare function addDocumentScriptFontValues(latin: Map<string, string | null>, eastAsia: Map<string, string | null>, complexScript: Map<string, string | null>, attributes: Record<string, unknown>): void;
|
|
15
|
+
export declare function applyDocumentScriptFontPatch(editor: Editor, selection: {
|
|
16
|
+
from: number;
|
|
17
|
+
to: number;
|
|
18
|
+
}, scalarPatch: Readonly<Record<string, boolean | number | string | null>>, scriptFontPatch: WorkDocumentScriptFontPatch): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WorkDocumentLayoutFont } from '../work-document-fonts';
|
|
2
|
+
import { type DocumentFontDialogPatch, type DocumentFontDialogSource } from './document-font-dialog-model';
|
|
3
|
+
export declare function DocumentFontDialog({ source, layoutFonts, restoreFocusTarget, onApply, onClose, }: {
|
|
4
|
+
source: DocumentFontDialogSource;
|
|
5
|
+
layoutFonts?: readonly WorkDocumentLayoutFont[];
|
|
6
|
+
restoreFocusTarget: () => HTMLElement | null;
|
|
7
|
+
onApply: (patch: DocumentFontDialogPatch) => boolean;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
}): import("react").JSX.Element;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { Editor } from '@tiptap/core';
|
|
2
2
|
import type { WorkDocumentLayoutFont } from '../work-document-fonts';
|
|
3
3
|
import type { DocumentFindReplaceMode } from './document-find-replace-panel';
|
|
4
|
-
export declare function DocumentHomeRibbon({ editor, findReplaceMode, layoutFonts, onFindText, }: {
|
|
4
|
+
export declare function DocumentHomeRibbon({ editor, findReplaceMode, layoutFonts, onFindText, onOpenFontDialog, }: {
|
|
5
5
|
editor: Editor;
|
|
6
6
|
findReplaceMode: DocumentFindReplaceMode | null;
|
|
7
7
|
layoutFonts?: readonly WorkDocumentLayoutFont[];
|
|
8
8
|
onFindText: (replace: boolean) => void;
|
|
9
|
+
onOpenFontDialog?: () => void;
|
|
9
10
|
}): import("react").JSX.Element | null;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { Editor, Extensions } from '@tiptap/core';
|
|
2
2
|
import { normalizeDocumentPageChromeHref } from '../work-document-page-chrome-commands';
|
|
3
|
+
import { type WorkDocumentUnderlineStyle } from '../work-document-underline';
|
|
4
|
+
import { type WorkDocumentStrikeStyle } from '../work-document-strike';
|
|
3
5
|
export type DocumentPageChromeAlignment = 'center' | 'justify' | 'left' | 'right';
|
|
4
6
|
export interface DocumentPageChromeEditorState {
|
|
5
7
|
alignment: DocumentPageChromeAlignment;
|
|
@@ -9,9 +11,13 @@ export interface DocumentPageChromeEditorState {
|
|
|
9
11
|
color: string;
|
|
10
12
|
italic: boolean;
|
|
11
13
|
link: string | null;
|
|
14
|
+
strike: boolean;
|
|
15
|
+
strikeStyle: WorkDocumentStrikeStyle;
|
|
12
16
|
subscript: boolean;
|
|
13
17
|
superscript: boolean;
|
|
14
18
|
underline: boolean;
|
|
19
|
+
underlineColor: string | null;
|
|
20
|
+
underlineStyle: WorkDocumentUnderlineStyle;
|
|
15
21
|
}
|
|
16
22
|
export interface DocumentPageChromeRichTextEditorProps {
|
|
17
23
|
autoFocus?: boolean;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { Editor } from '@tiptap/core';
|
|
2
2
|
export type DocumentPageChromeEditingPart = 'footer' | 'header';
|
|
3
|
-
export declare function DocumentPageChromeRibbon({ editor, editingPart, showPageNumber, onEditingPartChange, onTogglePageNumber, onClose, }: {
|
|
3
|
+
export declare function DocumentPageChromeRibbon({ editor, editingPart, showPageNumber, onEditingPartChange, onTogglePageNumber, onOpenFontDialog, onClose, }: {
|
|
4
4
|
editor: Editor;
|
|
5
5
|
editingPart: DocumentPageChromeEditingPart;
|
|
6
6
|
showPageNumber: boolean;
|
|
7
7
|
onEditingPartChange: (part: DocumentPageChromeEditingPart) => void;
|
|
8
8
|
onTogglePageNumber: () => void;
|
|
9
|
+
onOpenFontDialog?: () => void;
|
|
9
10
|
onClose: () => void;
|
|
10
11
|
}): import("react").JSX.Element;
|
|
@@ -29,6 +29,7 @@ interface DocumentToolbarProps {
|
|
|
29
29
|
navigationOpen: boolean;
|
|
30
30
|
pageColor: string;
|
|
31
31
|
showPageNumbers: boolean;
|
|
32
|
+
showHiddenText: boolean;
|
|
32
33
|
showRulers: boolean;
|
|
33
34
|
spellcheckEnabled: boolean;
|
|
34
35
|
viewMode: DocumentViewMode;
|
|
@@ -45,6 +46,7 @@ interface DocumentToolbarProps {
|
|
|
45
46
|
onOpenLayout: (target: DocumentLayoutPanelTab) => void;
|
|
46
47
|
onToggleNavigation: () => void;
|
|
47
48
|
onTogglePageNumbers: () => void;
|
|
49
|
+
onToggleHiddenText: () => void;
|
|
48
50
|
onToggleRulers: () => void;
|
|
49
51
|
onPageColorChange: (color: string) => void;
|
|
50
52
|
onToggleSpellcheck: () => void;
|
|
@@ -77,5 +79,5 @@ interface DocumentToolbarProps {
|
|
|
77
79
|
onOpenWordCount: () => void;
|
|
78
80
|
onOpenFindReplace: (mode: DocumentFindReplaceMode) => void;
|
|
79
81
|
}
|
|
80
|
-
export declare function DocumentToolbar({ editor, defaultRibbonCollapsed, reviewOnly, suggestionOnly, history, layoutOpen, layout, layoutFonts, navigationOpen, pageColor, showPageNumbers, showRulers, spellcheckEnabled, viewMode, zoom, pageChromeEditor, pageChromeEditingPart, pageChromeShowPageNumber, onRequestImage, onPageChromeEditingPartChange, onClosePageChrome, onTogglePageChromePageNumber, onToggleLayout, onLayoutChange, onOpenLayout, onToggleNavigation, onTogglePageNumbers, onToggleRulers, onPageColorChange, onToggleSpellcheck, onViewModeChange, onZoomChange, onZoomFit, onInsertSection, onInsertNote, onInsertCaption, onInsertCrossReference, citationsOpen, citationSourceCount, onToggleCitations, onInsertField, onRefreshFields, canInsertComment, onInsertComment, commentsOpen, commentCount, onToggleComments, trackChanges, changesOpen, changeCount, findReplaceMode, fileActions, onRibbonTabChange, onToggleTrackChanges, onToggleChanges, onDecideChange, onOpenWordCount, onOpenFindReplace, }: DocumentToolbarProps): import("react").JSX.Element;
|
|
82
|
+
export declare function DocumentToolbar({ editor, defaultRibbonCollapsed, reviewOnly, suggestionOnly, history, layoutOpen, layout, layoutFonts, navigationOpen, pageColor, showPageNumbers, showHiddenText, showRulers, spellcheckEnabled, viewMode, zoom, pageChromeEditor, pageChromeEditingPart, pageChromeShowPageNumber, onRequestImage, onPageChromeEditingPartChange, onClosePageChrome, onTogglePageChromePageNumber, onToggleLayout, onLayoutChange, onOpenLayout, onToggleNavigation, onTogglePageNumbers, onToggleHiddenText, onToggleRulers, onPageColorChange, onToggleSpellcheck, onViewModeChange, onZoomChange, onZoomFit, onInsertSection, onInsertNote, onInsertCaption, onInsertCrossReference, citationsOpen, citationSourceCount, onToggleCitations, onInsertField, onRefreshFields, canInsertComment, onInsertComment, commentsOpen, commentCount, onToggleComments, trackChanges, changesOpen, changeCount, findReplaceMode, fileActions, onRibbonTabChange, onToggleTrackChanges, onToggleChanges, onDecideChange, onOpenWordCount, onOpenFindReplace, }: DocumentToolbarProps): import("react").JSX.Element;
|
|
81
83
|
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Editor } from '@tiptap/core';
|
|
2
|
+
export declare function DocumentUnderlineRibbon({ editor, label, menuLabel, colorLabel, showColor, className, }: {
|
|
3
|
+
editor: Editor;
|
|
4
|
+
label?: string;
|
|
5
|
+
menuLabel?: string;
|
|
6
|
+
colorLabel?: string;
|
|
7
|
+
showColor?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
}): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Cell } from '@fortune-sheet/core';
|
|
2
|
+
import { type XlsxNativeFill } from '../work-xlsx-native-fill';
|
|
3
|
+
export type SpreadsheetCellFillFormat = {
|
|
4
|
+
kind: 'none';
|
|
5
|
+
} | {
|
|
6
|
+
color: string;
|
|
7
|
+
kind: 'solid';
|
|
8
|
+
} | XlsxNativeFill;
|
|
9
|
+
export declare function spreadsheetCellFillFormat(cell: Cell | null | undefined): SpreadsheetCellFillFormat;
|
|
10
|
+
export declare function normalizeSpreadsheetCellFillFormat(value: unknown): SpreadsheetCellFillFormat | null;
|
|
11
|
+
export declare function withSpreadsheetCellFillFormat(cell: Cell, fill: SpreadsheetCellFillFormat): Cell | null;
|
|
@@ -4,6 +4,7 @@ import { type SpreadsheetUnderlineStyle } from '../work-spreadsheet-underline';
|
|
|
4
4
|
import { type SpreadsheetTextOrientationId } from '../work-spreadsheet-text-orientation';
|
|
5
5
|
import { type SpreadsheetCellBorderFormat } from './spreadsheet-cell-border';
|
|
6
6
|
import { type SpreadsheetCellRange } from './spreadsheet-cell-range';
|
|
7
|
+
import { type SpreadsheetCellFillFormat } from './spreadsheet-cell-fill-format';
|
|
7
8
|
export declare const MAX_SPREADSHEET_CELL_FORMAT_CELLS = 10000;
|
|
8
9
|
export type SpreadsheetHorizontalAlignment = 'general' | 'left' | 'center' | 'right';
|
|
9
10
|
export type SpreadsheetVerticalAlignment = 'top' | 'middle' | 'bottom';
|
|
@@ -21,7 +22,7 @@ export interface SpreadsheetCellFormatPatch {
|
|
|
21
22
|
italic?: boolean;
|
|
22
23
|
underline?: SpreadsheetUnderlineStyle;
|
|
23
24
|
strike?: boolean;
|
|
24
|
-
|
|
25
|
+
fill?: SpreadsheetCellFillFormat;
|
|
25
26
|
borders?: readonly SpreadsheetCellBorderFormat[];
|
|
26
27
|
locked?: boolean;
|
|
27
28
|
hidden?: boolean;
|
|
@@ -1,27 +1,28 @@
|
|
|
1
1
|
import type { Cell, Selection, Sheet } from '@fortune-sheet/core';
|
|
2
2
|
import type { SpreadsheetGridSize } from '../spreadsheet-sparse';
|
|
3
|
-
import type { WorkSpreadsheetContent } from '../work-types';
|
|
4
3
|
import type { SpreadsheetTextOrientationId } from '../work-spreadsheet-text-orientation';
|
|
4
|
+
import type { WorkSpreadsheetContent } from '../work-types';
|
|
5
5
|
import { type OfficeEditorCanCommands, type OfficeEditorExtension } from './office-editor-extension';
|
|
6
6
|
import type { SpreadsheetAutoSumFunction } from './spreadsheet-auto-sum';
|
|
7
|
-
import { type SpreadsheetCellClearMode } from './spreadsheet-cell-clear';
|
|
8
7
|
import type { SpreadsheetCellBorderFormat } from './spreadsheet-cell-border';
|
|
8
|
+
import { type SpreadsheetCellClearMode } from './spreadsheet-cell-clear';
|
|
9
|
+
import type { SpreadsheetCellFillDirection } from './spreadsheet-cell-fill';
|
|
9
10
|
import type { SpreadsheetCellFormatRequest } from './spreadsheet-cell-format';
|
|
10
|
-
import type
|
|
11
|
+
import { type SpreadsheetCellMergeCommand } from './spreadsheet-cell-merge';
|
|
11
12
|
import type { SpreadsheetCellRange } from './spreadsheet-cell-range';
|
|
12
13
|
import type { SpreadsheetCellStyleChoice } from './spreadsheet-cell-style';
|
|
13
|
-
import type { SpreadsheetCellFillDirection } from './spreadsheet-cell-fill';
|
|
14
14
|
import type { SpreadsheetCopyFromAboveKind } from './spreadsheet-copy-from-above';
|
|
15
|
-
import { type SpreadsheetFontSizeDirection } from './spreadsheet-font-size-command';
|
|
16
|
-
import { type SpreadsheetDateTimeKind } from './spreadsheet-date-time-command';
|
|
17
15
|
import type { SpreadsheetDataValidationRequest, SpreadsheetDataValidationTarget } from './spreadsheet-data-validation';
|
|
18
|
-
import { type
|
|
16
|
+
import { type SpreadsheetDateTimeKind } from './spreadsheet-date-time-command';
|
|
17
|
+
import { type SpreadsheetFontSizeDirection } from './spreadsheet-font-size-command';
|
|
18
|
+
import type { SpreadsheetFormatCellsOpenIntent } from './spreadsheet-format-cells-intent';
|
|
19
19
|
import type { SpreadsheetFormatPainterMode } from './spreadsheet-format-painter';
|
|
20
|
-
import type { SpreadsheetHyperlinkCell, SpreadsheetHyperlinkRequest } from './spreadsheet-hyperlink';
|
|
21
20
|
import { type SpreadsheetFreezePanePreset } from './spreadsheet-freeze-panes';
|
|
21
|
+
import type { SpreadsheetHyperlinkCell, SpreadsheetHyperlinkRequest } from './spreadsheet-hyperlink';
|
|
22
22
|
import type { SpreadsheetKeyboardSelection, SpreadsheetSelectionMove, SpreadsheetSelectionScope } from './spreadsheet-keyboard-navigation';
|
|
23
|
-
import type { SpreadsheetPasteContent } from './spreadsheet-paste-special';
|
|
24
23
|
import { type SpreadsheetDecimalPlacesDirection } from './spreadsheet-number-format-command';
|
|
24
|
+
import type { SpreadsheetPasteContent } from './spreadsheet-paste-special';
|
|
25
|
+
import type { SpreadsheetRichTextToggleAttribute } from './spreadsheet-rich-text-selection-format';
|
|
25
26
|
import { type SpreadsheetSheetMoveDirection } from './spreadsheet-sheet-model';
|
|
26
27
|
import type { SpreadsheetTableDesignPatch, SpreadsheetTableRequest, SpreadsheetTableTarget } from './spreadsheet-table';
|
|
27
28
|
export interface SpreadsheetWorkbookCommandPort {
|
|
@@ -147,6 +148,12 @@ export interface SpreadsheetNavigationCommandPort {
|
|
|
147
148
|
export interface SpreadsheetFormulaBarCommandPort {
|
|
148
149
|
setValue: (value: unknown) => void;
|
|
149
150
|
}
|
|
151
|
+
export interface SpreadsheetRichTextFormatCommandPort {
|
|
152
|
+
apply: (attribute: keyof Cell, value: unknown) => boolean;
|
|
153
|
+
canApply: (attribute: keyof Cell, value: unknown) => boolean;
|
|
154
|
+
canToggle: (attribute: SpreadsheetRichTextToggleAttribute) => boolean;
|
|
155
|
+
toggle: (attribute: SpreadsheetRichTextToggleAttribute) => boolean;
|
|
156
|
+
}
|
|
150
157
|
export interface SpreadsheetViewCommandPort {
|
|
151
158
|
activateSheet: (sheetId: string) => boolean;
|
|
152
159
|
}
|
|
@@ -195,6 +202,7 @@ export interface SpreadsheetEditorCommands {
|
|
|
195
202
|
renameSheet: (sheetId: string, name: string) => boolean;
|
|
196
203
|
redo: () => boolean;
|
|
197
204
|
setCellFormat: (attribute: keyof Cell, value: unknown) => boolean;
|
|
205
|
+
toggleCellFormat: (attribute: SpreadsheetRichTextToggleAttribute) => boolean;
|
|
198
206
|
setTextOrientation: (orientation: SpreadsheetTextOrientationId) => boolean;
|
|
199
207
|
setSelectedCellBorders: (format: SpreadsheetCellBorderFormat) => boolean;
|
|
200
208
|
setFreezePanes: (preset: SpreadsheetFreezePanePreset) => boolean;
|
|
@@ -228,6 +236,7 @@ export interface SpreadsheetCommandContext {
|
|
|
228
236
|
history: SpreadsheetHistoryCommandPort | null;
|
|
229
237
|
navigation: SpreadsheetNavigationCommandPort;
|
|
230
238
|
onChange: (content: WorkSpreadsheetContent) => void;
|
|
239
|
+
richTextFormat?: SpreadsheetRichTextFormatCommandPort | null;
|
|
231
240
|
selection: SpreadsheetCommandSelection | null;
|
|
232
241
|
table: SpreadsheetTableCommandPort;
|
|
233
242
|
targetSheetGridSize?: SpreadsheetGridSize | null;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { Cell } from '@fortune-sheet/core';
|
|
2
2
|
import type { WorkSpreadsheetContent } from '../work-types';
|
|
3
3
|
import { type SpreadsheetUnderlineStyle } from '../work-spreadsheet-underline';
|
|
4
|
+
import type { XlsxGradientFill } from '../work-xlsx-gradient-fill';
|
|
5
|
+
import type { XlsxPatternFill } from '../work-xlsx-pattern-fill';
|
|
4
6
|
import { type SpreadsheetCellBorderFormat, type SpreadsheetCellBorderStyle } from './spreadsheet-cell-border';
|
|
5
7
|
import { type SpreadsheetCellFormatPatch, type SpreadsheetHorizontalAlignment, type SpreadsheetVerticalAlignment } from './spreadsheet-cell-format';
|
|
8
|
+
import { type SpreadsheetCellFillFormat } from './spreadsheet-cell-fill-format';
|
|
6
9
|
import { type SpreadsheetCellRange } from './spreadsheet-cell-range';
|
|
7
10
|
export { spreadsheetFormatCellsTabs, type SpreadsheetFormatCellsTabId, } from './spreadsheet-format-cells-intent';
|
|
8
11
|
export interface SpreadsheetFormatCellsField<T> {
|
|
@@ -22,7 +25,7 @@ export interface SpreadsheetFormatCellsFields {
|
|
|
22
25
|
italic: SpreadsheetFormatCellsField<boolean>;
|
|
23
26
|
underline: SpreadsheetFormatCellsField<SpreadsheetUnderlineStyle>;
|
|
24
27
|
strike: SpreadsheetFormatCellsField<boolean>;
|
|
25
|
-
|
|
28
|
+
fill: SpreadsheetFormatCellsField<SpreadsheetCellFillFormat>;
|
|
26
29
|
borders: SpreadsheetFormatCellsField<readonly SpreadsheetCellBorderFormat[]>;
|
|
27
30
|
locked: SpreadsheetFormatCellsField<boolean>;
|
|
28
31
|
hidden: SpreadsheetFormatCellsField<boolean>;
|
|
@@ -46,15 +49,22 @@ export interface SpreadsheetFormatCellsDraft {
|
|
|
46
49
|
italic: boolean;
|
|
47
50
|
underline: SpreadsheetUnderlineStyle;
|
|
48
51
|
strike: boolean;
|
|
49
|
-
|
|
52
|
+
fill: SpreadsheetFormatCellsFillDraft;
|
|
50
53
|
borders: SpreadsheetCellBorderFormat[];
|
|
51
54
|
borderColor: string;
|
|
52
55
|
borderStyle: SpreadsheetCellBorderStyle;
|
|
53
56
|
locked: boolean;
|
|
54
57
|
hidden: boolean;
|
|
55
58
|
}
|
|
59
|
+
export interface SpreadsheetFormatCellsFillDraft {
|
|
60
|
+
gradient: XlsxGradientFill;
|
|
61
|
+
mode: SpreadsheetCellFillFormat['kind'];
|
|
62
|
+
pattern: XlsxPatternFill;
|
|
63
|
+
solidColor: string;
|
|
64
|
+
}
|
|
56
65
|
export type SpreadsheetFormatCellsTouched = Partial<Record<keyof SpreadsheetCellFormatPatch, true>>;
|
|
57
66
|
export interface SpreadsheetFormatCellsDraftErrors {
|
|
67
|
+
fill?: string;
|
|
58
68
|
numberFormat?: string;
|
|
59
69
|
fontSize?: string;
|
|
60
70
|
rotation?: string;
|
|
@@ -66,3 +76,4 @@ export declare function createSpreadsheetFormatCellsDialogSource(content: WorkSp
|
|
|
66
76
|
export declare function createSpreadsheetFormatCellsDraft(source: SpreadsheetFormatCellsDialogSource): SpreadsheetFormatCellsDraft;
|
|
67
77
|
export declare function spreadsheetFormatCellsPatch(source: SpreadsheetFormatCellsDialogSource, draft: SpreadsheetFormatCellsDraft, touched: SpreadsheetFormatCellsTouched): SpreadsheetCellFormatPatch;
|
|
68
78
|
export declare function spreadsheetFormatCellsDraftErrors(draft: SpreadsheetFormatCellsDraft): SpreadsheetFormatCellsDraftErrors;
|
|
79
|
+
export declare function spreadsheetFormatCellsActiveFill(draft: SpreadsheetFormatCellsDraft): SpreadsheetCellFillFormat;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import type { SpreadsheetCellFormatPatch } from './spreadsheet-cell-format';
|
|
3
|
+
import { type SpreadsheetFormatCellsDialogSource, type SpreadsheetFormatCellsDraft, type SpreadsheetFormatCellsDraftErrors, type SpreadsheetFormatCellsTouched } from './spreadsheet-format-cells-dialog-model';
|
|
4
|
+
interface FillPanelProps {
|
|
5
|
+
source: SpreadsheetFormatCellsDialogSource;
|
|
6
|
+
draft: SpreadsheetFormatCellsDraft;
|
|
7
|
+
errors: SpreadsheetFormatCellsDraftErrors;
|
|
8
|
+
touched: SpreadsheetFormatCellsTouched;
|
|
9
|
+
setDraft: Dispatch<SetStateAction<SpreadsheetFormatCellsDraft>>;
|
|
10
|
+
touch: (field: keyof SpreadsheetCellFormatPatch) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function SpreadsheetFormatCellsFillPanel({ source, draft, errors, touched, setDraft, touch, }: FillPanelProps): import("react").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { XlsxPatternFillType } from '../work-xlsx-pattern-fill';
|
|
2
|
+
import type { SpreadsheetCellFillFormat } from './spreadsheet-cell-fill-format';
|
|
3
|
+
export declare function SpreadsheetFormatCellsFillPreview({ fill, patternLabels, }: {
|
|
4
|
+
fill: SpreadsheetCellFillFormat;
|
|
5
|
+
patternLabels: Readonly<Record<XlsxPatternFillType, string>>;
|
|
6
|
+
}): import("react").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Cell } from '@fortune-sheet/core';
|
|
2
|
-
export declare const spreadsheetCellFormatAttributes: readonly ["bl", "it", "ff", "fs", "fc", "ht", "vt", "tb", "cl", "un", "tr", "ct", "bg"];
|
|
2
|
+
export declare const spreadsheetCellFormatAttributes: readonly ["bl", "it", "ff", "fs", "fc", "ht", "vt", "tb", "cl", "un", "tr", "ct", "bg", "a3sXlsxPatternFill", "a3sXlsxGradientFill"];
|
|
3
3
|
export type SpreadsheetCellFormatAttribute = (typeof spreadsheetCellFormatAttributes)[number];
|
|
4
4
|
export type SpreadsheetFormatPainterMode = 'once' | 'locked';
|
|
5
5
|
export type SpreadsheetCellFormatSnapshot = Record<SpreadsheetCellFormatAttribute, unknown>;
|
|
@@ -5,6 +5,12 @@ export interface SpreadsheetOperationProjection {
|
|
|
5
5
|
affectedCellCount: number;
|
|
6
6
|
sheets: WorkSpreadsheetContent['sheets'];
|
|
7
7
|
}
|
|
8
|
+
export interface SpreadsheetCellOperationCoordinate {
|
|
9
|
+
column: number;
|
|
10
|
+
row: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function spreadsheetCellOperationKey(row: number, column: number): string;
|
|
13
|
+
export declare function spreadsheetCellOperationCoordinates(operations: readonly Op[]): Map<string, Map<string, SpreadsheetCellOperationCoordinate>> | null;
|
|
8
14
|
/**
|
|
9
15
|
* Reconciles a bounded Fortune operation batch against authenticated
|
|
10
16
|
* controlled matrices. Only the outer matrix and affected rows/cells are
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface SpreadsheetRichTextDomSelection {
|
|
2
|
+
editor: HTMLElement;
|
|
3
|
+
end: number;
|
|
4
|
+
start: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function captureSpreadsheetRichTextDomSelection({ expandedOnly, root, target, }: {
|
|
7
|
+
expandedOnly?: boolean;
|
|
8
|
+
root: HTMLElement | null;
|
|
9
|
+
target?: EventTarget | null;
|
|
10
|
+
}): SpreadsheetRichTextDomSelection | null;
|
|
11
|
+
export declare function spreadsheetRichTextEditor(node: Node): HTMLElement | null;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Cell, Selection } from '@fortune-sheet/core';
|
|
2
|
+
import type { WorkSpreadsheetContent, WorkSpreadsheetSheet } from '../work-types';
|
|
3
|
+
import type { SpreadsheetRichTextPasteIntent } from '../work-xlsx-rich-text-edit';
|
|
4
|
+
import { type XlsxRichTextRun } from '../work-xlsx-rich-text-model';
|
|
5
|
+
interface ParsedSpreadsheetRichTextClipboard {
|
|
6
|
+
runs: XlsxRichTextRun[];
|
|
7
|
+
text: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function parseSpreadsheetRichTextClipboard(html: string, plainText: string): ParsedSpreadsheetRichTextClipboard | null;
|
|
10
|
+
export declare function captureSpreadsheetRichTextPaste({ clipboardData, content, root, selection, sheetId, target, }: {
|
|
11
|
+
clipboardData: Pick<DataTransfer, 'getData'>;
|
|
12
|
+
content: WorkSpreadsheetContent;
|
|
13
|
+
root: HTMLElement | null;
|
|
14
|
+
selection: Selection | null | undefined;
|
|
15
|
+
sheetId: string;
|
|
16
|
+
target: EventTarget | null;
|
|
17
|
+
}): boolean;
|
|
18
|
+
export declare function stageSpreadsheetRichTextPaste(sheet: WorkSpreadsheetSheet, row: number, column: number, sourceText: string, intent: SpreadsheetRichTextPasteIntent): void;
|
|
19
|
+
export declare function takeSpreadsheetRichTextPaste(sheet: WorkSpreadsheetSheet, row: number, column: number, current: Cell): SpreadsheetRichTextPasteIntent | undefined;
|
|
20
|
+
export declare function peekSpreadsheetRichTextPaste(sheet: WorkSpreadsheetSheet, row: number, column: number, current: Cell): SpreadsheetRichTextPasteIntent | undefined;
|
|
21
|
+
export declare function consumeSpreadsheetRichTextPaste(sheet: WorkSpreadsheetSheet, row: number, column: number): void;
|
|
22
|
+
export {};
|