@a3s-lab/office 0.23.0 → 0.25.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 +4 -2
- package/dist/0~4595.js +3 -1
- package/dist/0~spreadsheet-editor.js +145 -49
- package/dist/0~work-office-diagnostics.js +2 -2
- package/dist/{5045.js → 164.js} +1076 -18
- package/dist/4104.js +46 -748
- package/dist/core.js +1 -1
- package/dist/index.js +1 -1
- package/dist/internal/features/work/editors/office-select.d.ts +3 -1
- package/dist/internal/features/work/editors/spreadsheet-command-catalog.d.ts +28 -0
- package/dist/internal/features/work/editors/spreadsheet-command-controller.d.ts +3 -1
- package/dist/internal/features/work/editors/spreadsheet-format-cells-dialog-model.d.ts +1 -20
- package/dist/internal/features/work/editors/spreadsheet-format-cells-dialog-panels.d.ts +2 -0
- package/dist/internal/features/work/editors/spreadsheet-format-cells-dialog.d.ts +3 -1
- package/dist/internal/features/work/editors/spreadsheet-format-cells-intent.d.ts +32 -0
- package/dist/internal/features/work/work-xlsx-cell-style-origin.d.ts +1 -0
- package/dist/internal/features/work/work-xlsx-colors.d.ts +1 -1
- package/dist/internal/features/work/work-xlsx-interop.d.ts +2 -0
- package/dist/internal/features/work/work-xlsx-rich-text.d.ts +55 -0
- package/dist/internal/features/work/work-xlsx-worksheet-scan.d.ts +1 -0
- package/dist/internal/features/work/work-xlsx-worksheet.d.ts +5 -0
- package/dist/office-kernel.wasm +0 -0
- package/dist/work-spreadsheet-package-scan.worker.js +6 -2
- package/package.json +7 -1
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 "./164.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 "./164.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 };
|
|
@@ -8,7 +8,7 @@ export interface OfficeSelectOption<T extends string = string> {
|
|
|
8
8
|
previewStyle?: CSSProperties;
|
|
9
9
|
searchText?: string;
|
|
10
10
|
}
|
|
11
|
-
export declare function OfficeSelect<T extends string>({ ariaLabel, value, options, onValueChange, disabled, placeholder, className, }: {
|
|
11
|
+
export declare function OfficeSelect<T extends string>({ ariaLabel, value, options, onValueChange, disabled, placeholder, className, ariaKeyShortcuts, initialFocus, }: {
|
|
12
12
|
ariaLabel: string;
|
|
13
13
|
value: T;
|
|
14
14
|
options: readonly OfficeSelectOption<T>[];
|
|
@@ -16,4 +16,6 @@ export declare function OfficeSelect<T extends string>({ ariaLabel, value, optio
|
|
|
16
16
|
disabled?: boolean;
|
|
17
17
|
placeholder?: string;
|
|
18
18
|
className?: string;
|
|
19
|
+
ariaKeyShortcuts?: string;
|
|
20
|
+
initialFocus?: boolean;
|
|
19
21
|
}): import("react").JSX.Element;
|
|
@@ -406,6 +406,34 @@ export declare const spreadsheetCommandCatalog: {
|
|
|
406
406
|
readonly editor: readonly ["Mod-1"];
|
|
407
407
|
};
|
|
408
408
|
};
|
|
409
|
+
readonly formatCellsFont: {
|
|
410
|
+
readonly id: "font.formatCellsFont";
|
|
411
|
+
readonly label: "设置字体格式";
|
|
412
|
+
readonly location: {
|
|
413
|
+
readonly area: "ribbon";
|
|
414
|
+
readonly tab: "home";
|
|
415
|
+
readonly group: "font";
|
|
416
|
+
};
|
|
417
|
+
readonly shortcut: {
|
|
418
|
+
readonly label: "Cmd/Ctrl+Shift+F";
|
|
419
|
+
readonly aria: "Control+Shift+F Meta+Shift+F";
|
|
420
|
+
readonly editor: readonly ["Mod-Shift-f"];
|
|
421
|
+
};
|
|
422
|
+
};
|
|
423
|
+
readonly formatCellsFontSize: {
|
|
424
|
+
readonly id: "font.formatCellsFontSize";
|
|
425
|
+
readonly label: "设置字号格式";
|
|
426
|
+
readonly location: {
|
|
427
|
+
readonly area: "ribbon";
|
|
428
|
+
readonly tab: "home";
|
|
429
|
+
readonly group: "font";
|
|
430
|
+
};
|
|
431
|
+
readonly shortcut: {
|
|
432
|
+
readonly label: "Cmd/Ctrl+Shift+P";
|
|
433
|
+
readonly aria: "Control+Shift+P Meta+Shift+P";
|
|
434
|
+
readonly editor: readonly ["Mod-Shift-p"];
|
|
435
|
+
};
|
|
436
|
+
};
|
|
409
437
|
readonly borderTop: {
|
|
410
438
|
readonly id: "font.borderTop";
|
|
411
439
|
readonly label: "上框线";
|
|
@@ -7,6 +7,7 @@ import type { SpreadsheetAutoSumFunction } from './spreadsheet-auto-sum';
|
|
|
7
7
|
import { type SpreadsheetCellClearMode } from './spreadsheet-cell-clear';
|
|
8
8
|
import type { SpreadsheetCellBorderFormat } from './spreadsheet-cell-border';
|
|
9
9
|
import type { SpreadsheetCellFormatRequest } from './spreadsheet-cell-format';
|
|
10
|
+
import type { SpreadsheetFormatCellsOpenIntent } from './spreadsheet-format-cells-intent';
|
|
10
11
|
import type { SpreadsheetCellRange } from './spreadsheet-cell-range';
|
|
11
12
|
import type { SpreadsheetCellStyleChoice } from './spreadsheet-cell-style';
|
|
12
13
|
import type { SpreadsheetCellFillDirection } from './spreadsheet-cell-fill';
|
|
@@ -119,6 +120,7 @@ export interface SpreadsheetFormatCellsOpenRequest {
|
|
|
119
120
|
column: number;
|
|
120
121
|
};
|
|
121
122
|
cells: (Cell | null)[][];
|
|
123
|
+
intent: SpreadsheetFormatCellsOpenIntent;
|
|
122
124
|
}
|
|
123
125
|
export interface SpreadsheetFormatCellsCommandPort {
|
|
124
126
|
canOpen: boolean;
|
|
@@ -179,7 +181,7 @@ export interface SpreadsheetEditorCommands {
|
|
|
179
181
|
openAutoFilterMenu: () => boolean;
|
|
180
182
|
openDataValidation: () => boolean;
|
|
181
183
|
openFind: () => boolean;
|
|
182
|
-
openFormatCells: () => boolean;
|
|
184
|
+
openFormatCells: (intent?: SpreadsheetFormatCellsOpenIntent) => boolean;
|
|
183
185
|
openGoTo: () => boolean;
|
|
184
186
|
openHyperlink: () => boolean;
|
|
185
187
|
openPasteSpecial: () => boolean;
|
|
@@ -4,26 +4,7 @@ import { type SpreadsheetUnderlineStyle } from '../work-spreadsheet-underline';
|
|
|
4
4
|
import { type SpreadsheetCellBorderFormat, type SpreadsheetCellBorderStyle } from './spreadsheet-cell-border';
|
|
5
5
|
import { type SpreadsheetCellFormatPatch, type SpreadsheetHorizontalAlignment, type SpreadsheetVerticalAlignment } from './spreadsheet-cell-format';
|
|
6
6
|
import { type SpreadsheetCellRange } from './spreadsheet-cell-range';
|
|
7
|
-
export
|
|
8
|
-
readonly id: "number";
|
|
9
|
-
readonly label: "数字";
|
|
10
|
-
}, {
|
|
11
|
-
readonly id: "alignment";
|
|
12
|
-
readonly label: "对齐";
|
|
13
|
-
}, {
|
|
14
|
-
readonly id: "font";
|
|
15
|
-
readonly label: "字体";
|
|
16
|
-
}, {
|
|
17
|
-
readonly id: "border";
|
|
18
|
-
readonly label: "边框";
|
|
19
|
-
}, {
|
|
20
|
-
readonly id: "fill";
|
|
21
|
-
readonly label: "填充";
|
|
22
|
-
}, {
|
|
23
|
-
readonly id: "protection";
|
|
24
|
-
readonly label: "保护";
|
|
25
|
-
}];
|
|
26
|
-
export type SpreadsheetFormatCellsTabId = (typeof spreadsheetFormatCellsTabs)[number]['id'];
|
|
7
|
+
export { spreadsheetFormatCellsTabs, type SpreadsheetFormatCellsTabId, } from './spreadsheet-format-cells-intent';
|
|
27
8
|
export interface SpreadsheetFormatCellsField<T> {
|
|
28
9
|
value: T;
|
|
29
10
|
mixed: boolean;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Dispatch, SetStateAction } from 'react';
|
|
2
2
|
import type { SpreadsheetCellFormatPatch } from './spreadsheet-cell-format';
|
|
3
3
|
import type { SpreadsheetFormatCellsDialogSource, SpreadsheetFormatCellsDraft, SpreadsheetFormatCellsDraftErrors, SpreadsheetFormatCellsTabId, SpreadsheetFormatCellsTouched } from './spreadsheet-format-cells-dialog-model';
|
|
4
|
+
import type { SpreadsheetFormatCellsInitialFocus } from './spreadsheet-format-cells-intent';
|
|
4
5
|
interface PanelProps {
|
|
5
6
|
activeTab: SpreadsheetFormatCellsTabId;
|
|
6
7
|
idBase: string;
|
|
@@ -8,6 +9,7 @@ interface PanelProps {
|
|
|
8
9
|
draft: SpreadsheetFormatCellsDraft;
|
|
9
10
|
errors: SpreadsheetFormatCellsDraftErrors;
|
|
10
11
|
touched: SpreadsheetFormatCellsTouched;
|
|
12
|
+
initialFocus?: SpreadsheetFormatCellsInitialFocus;
|
|
11
13
|
setDraft: Dispatch<SetStateAction<SpreadsheetFormatCellsDraft>>;
|
|
12
14
|
touch: (field: keyof SpreadsheetCellFormatPatch) => void;
|
|
13
15
|
}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { SpreadsheetCellFormatPatch } from './spreadsheet-cell-format';
|
|
2
2
|
import { type SpreadsheetFormatCellsDialogSource } from './spreadsheet-format-cells-dialog-model';
|
|
3
|
-
|
|
3
|
+
import { type SpreadsheetFormatCellsOpenIntent } from './spreadsheet-format-cells-intent';
|
|
4
|
+
export declare function SpreadsheetFormatCellsDialog({ source, restoreFocusTarget, openIntent, onApply, onClose, }: {
|
|
4
5
|
source: SpreadsheetFormatCellsDialogSource;
|
|
5
6
|
restoreFocusTarget: () => HTMLElement | null;
|
|
7
|
+
openIntent?: SpreadsheetFormatCellsOpenIntent;
|
|
6
8
|
onApply: (patch: SpreadsheetCellFormatPatch) => boolean;
|
|
7
9
|
onClose: () => void;
|
|
8
10
|
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const spreadsheetFormatCellsTabs: readonly [{
|
|
2
|
+
readonly id: "number";
|
|
3
|
+
readonly label: "数字";
|
|
4
|
+
}, {
|
|
5
|
+
readonly id: "alignment";
|
|
6
|
+
readonly label: "对齐";
|
|
7
|
+
}, {
|
|
8
|
+
readonly id: "font";
|
|
9
|
+
readonly label: "字体";
|
|
10
|
+
}, {
|
|
11
|
+
readonly id: "border";
|
|
12
|
+
readonly label: "边框";
|
|
13
|
+
}, {
|
|
14
|
+
readonly id: "fill";
|
|
15
|
+
readonly label: "填充";
|
|
16
|
+
}, {
|
|
17
|
+
readonly id: "protection";
|
|
18
|
+
readonly label: "保护";
|
|
19
|
+
}];
|
|
20
|
+
export type SpreadsheetFormatCellsTabId = (typeof spreadsheetFormatCellsTabs)[number]['id'];
|
|
21
|
+
export type SpreadsheetFormatCellsInitialFocus = 'fontFamily' | 'fontSize';
|
|
22
|
+
export type SpreadsheetFormatCellsOpenIntent = {
|
|
23
|
+
tab: 'font';
|
|
24
|
+
focus?: SpreadsheetFormatCellsInitialFocus;
|
|
25
|
+
} | {
|
|
26
|
+
tab: Exclude<SpreadsheetFormatCellsTabId, 'font'>;
|
|
27
|
+
focus?: never;
|
|
28
|
+
};
|
|
29
|
+
export declare const defaultSpreadsheetFormatCellsOpenIntent: {
|
|
30
|
+
readonly tab: "number";
|
|
31
|
+
};
|
|
32
|
+
export declare function normalizeSpreadsheetFormatCellsOpenIntent(value: unknown): SpreadsheetFormatCellsOpenIntent | null;
|
|
@@ -42,3 +42,4 @@ export declare function applyXlsxSemanticColorOrigin(element: Element, origin: X
|
|
|
42
42
|
export declare function xlsxSemanticColorOriginKey(origin: XlsxSemanticColorOrigin | undefined): string;
|
|
43
43
|
export declare function xlsxSemanticColorOriginSupported(origin: XlsxSemanticColorOrigin, palette: XlsxSemanticPalette | undefined): boolean;
|
|
44
44
|
export declare function prepareXlsxSemanticPalette(styles: Document, theme: Document | null, origins: Iterable<XlsxCellStyleOrigin>): PreparedXlsxSemanticPalette;
|
|
45
|
+
export declare function normalizeXlsxSemanticColorOrigin(value: unknown): XlsxSemanticColorOrigin | undefined;
|
|
@@ -2,5 +2,5 @@ export interface XlsxColorResolver {
|
|
|
2
2
|
indexed: readonly string[];
|
|
3
3
|
theme: readonly string[];
|
|
4
4
|
}
|
|
5
|
-
export declare function createXlsxColorResolver(styles: Document, theme: Document | null): XlsxColorResolver;
|
|
5
|
+
export declare function createXlsxColorResolver(styles: Document | null, theme: Document | null): XlsxColorResolver;
|
|
6
6
|
export declare function resolveXlsxColor(element: Element | undefined, resolver: XlsxColorResolver): string | undefined;
|
|
@@ -9,6 +9,7 @@ import { type XlsxManualPageBreaks } from './work-xlsx-page-breaks';
|
|
|
9
9
|
import { type XlsxPageSetup } from './work-xlsx-page-setup';
|
|
10
10
|
import { type XlsxProtectionFeatures } from './work-xlsx-protection';
|
|
11
11
|
import { type XlsxWorksheetXmlScan } from './work-xlsx-worksheet-scan';
|
|
12
|
+
import { type XlsxRichTextCell } from './work-xlsx-rich-text';
|
|
12
13
|
import type { WorkSpreadsheetTable } from './work-types';
|
|
13
14
|
type FrozenPane = NonNullable<Sheet['frozen']>;
|
|
14
15
|
export interface XlsxDataValidation {
|
|
@@ -26,6 +27,7 @@ export interface XlsxSheetFeatures {
|
|
|
26
27
|
images: XlsxWorksheetImage[];
|
|
27
28
|
charts: XlsxWorksheetChart[];
|
|
28
29
|
tables: WorkSpreadsheetTable[];
|
|
30
|
+
richTextCells: XlsxRichTextCell[];
|
|
29
31
|
}
|
|
30
32
|
export type FortuneDataValidationItem = WorkSpreadsheetDataValidationItem;
|
|
31
33
|
export declare function readXlsxSheetFeatures(buffer: ArrayBuffer): Promise<Map<string, XlsxSheetFeatures>>;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { Cell, Sheet } from '@fortune-sheet/core';
|
|
2
|
+
import { type SpreadsheetUnderlineCellValue, type SpreadsheetUnderlineStyle } from './work-spreadsheet-underline';
|
|
3
|
+
import { type XlsxCellStyleOrigin, type XlsxSemanticColorOrigin, type XlsxSemanticPalette } from './work-xlsx-cell-style-origin';
|
|
4
|
+
import { type XlsxColorResolver } from './work-xlsx-colors';
|
|
5
|
+
export declare const MAX_XLSX_RICH_TEXT_CELL_CHARACTERS = 32767;
|
|
6
|
+
export declare const MAX_XLSX_RICH_TEXT_RUNS_PER_CELL = 512;
|
|
7
|
+
export declare const MAX_XLSX_RICH_TEXT_CELLS = 10000;
|
|
8
|
+
export declare const MAX_XLSX_RICH_TEXT_RUNS = 100000;
|
|
9
|
+
export interface XlsxRichTextRun {
|
|
10
|
+
a3sXlsxColorOrigin?: XlsxSemanticColorOrigin;
|
|
11
|
+
bl?: 0 | 1;
|
|
12
|
+
cl?: 0 | 1;
|
|
13
|
+
fc?: string;
|
|
14
|
+
ff?: string;
|
|
15
|
+
fs?: number;
|
|
16
|
+
it?: 0 | 1;
|
|
17
|
+
un?: SpreadsheetUnderlineCellValue;
|
|
18
|
+
v: string;
|
|
19
|
+
}
|
|
20
|
+
export interface XlsxRichTextCell {
|
|
21
|
+
column: number;
|
|
22
|
+
row: number;
|
|
23
|
+
runs: XlsxRichTextRun[];
|
|
24
|
+
text: string;
|
|
25
|
+
}
|
|
26
|
+
export interface XlsxRichTextReadContext {
|
|
27
|
+
readonly colors: XlsxColorResolver;
|
|
28
|
+
readonly hasRichSharedStrings: boolean;
|
|
29
|
+
readonly sharedStrings: ReadonlyMap<number, readonly XlsxRichTextRun[]>;
|
|
30
|
+
remainingCells: number;
|
|
31
|
+
remainingRuns: number;
|
|
32
|
+
}
|
|
33
|
+
interface XlsxRichTextContextOptions {
|
|
34
|
+
sharedStrings: Document | null;
|
|
35
|
+
styles: Document | null;
|
|
36
|
+
theme: Document | null;
|
|
37
|
+
}
|
|
38
|
+
interface SpreadsheetRichTextFontPatch {
|
|
39
|
+
bold?: boolean;
|
|
40
|
+
fontColor?: string;
|
|
41
|
+
fontFamily?: string;
|
|
42
|
+
fontSize?: number;
|
|
43
|
+
italic?: boolean;
|
|
44
|
+
strike?: boolean;
|
|
45
|
+
underline?: SpreadsheetUnderlineStyle;
|
|
46
|
+
}
|
|
47
|
+
export declare function createXlsxRichTextReadContext(options: XlsxRichTextContextOptions): XlsxRichTextReadContext;
|
|
48
|
+
export declare function readXlsxRichTextCells(worksheet: Document, context: XlsxRichTextReadContext): XlsxRichTextCell[];
|
|
49
|
+
export declare function applyImportedXlsxRichText(cell: Cell, richText: XlsxRichTextCell | undefined): Cell;
|
|
50
|
+
export declare function patchSpreadsheetRichTextFontRuns(cell: Cell, patch: SpreadsheetRichTextFontPatch): Cell;
|
|
51
|
+
export declare function xlsxRichTextCellText(cell: Cell): string | null;
|
|
52
|
+
export declare function sheetHasXlsxRichTextCells(sheet: Sheet): boolean;
|
|
53
|
+
export declare function xlsxRichTextStyleOrigins(sheet: Sheet): XlsxCellStyleOrigin[];
|
|
54
|
+
export declare function writeXlsxRichTextCells(worksheet: Document, sheet: Sheet, semanticPalette?: XlsxSemanticPalette): void;
|
|
55
|
+
export {};
|
|
@@ -10,3 +10,8 @@ export interface XlsxWorksheetCellEntry {
|
|
|
10
10
|
* materializing a second list of every worksheet cell.
|
|
11
11
|
*/
|
|
12
12
|
export declare function xlsxWorksheetCellEntries(worksheet: WorkSheet): Generator<XlsxWorksheetCellEntry>;
|
|
13
|
+
export declare function xlsxCellAddress(row: number, column: number): string;
|
|
14
|
+
export declare function decodeXlsxCellAddress(address: string): {
|
|
15
|
+
column: number;
|
|
16
|
+
row: number;
|
|
17
|
+
} | null;
|
package/dist/office-kernel.wasm
CHANGED
|
Binary file
|
|
@@ -4012,22 +4012,24 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
4012
4012
|
'rowBreaks',
|
|
4013
4013
|
'colBreaks'
|
|
4014
4014
|
]);
|
|
4015
|
-
const WORKSHEET_SCAN_PATTERN = /<(?:[A-Za-z_][\w.-]*:)?(?:(cols|f|pane|dataValidation|conditionalFormatting|sheetProtection|protectedRange|rowBreaks|colBreaks|pageSetup|pageMargins|printOptions|headerFooter|pageSetUpPr|drawing|tableParts)(?=[\s/>])|(row)(?=[\s/>])[^>]*\s(?:collapsed|customFormat|customHeight|hidden|ht|outlineLevel|thickBot|thickTop)\s*=|(c)(?=[\s/>])[^>]*\ss\s
|
|
4015
|
+
const WORKSHEET_SCAN_PATTERN = /<(?:[A-Za-z_][\w.-]*:)?(?:(cols|f|pane|dataValidation|conditionalFormatting|sheetProtection|protectedRange|rowBreaks|colBreaks|pageSetup|pageMargins|printOptions|headerFooter|pageSetUpPr|drawing|tableParts)(?=[\s/>])|(row)(?=[\s/>])[^>]*\s(?:collapsed|customFormat|customHeight|hidden|ht|outlineLevel|thickBot|thickTop)\s*=|(c)(?=[\s/>])[^>]*\ss\s*=|(r)(?=[\s/>]))/g;
|
|
4016
4016
|
function scanXlsxWorksheetXml(source) {
|
|
4017
4017
|
let hasDirectCellStyles = false;
|
|
4018
4018
|
let hasDiagnosticFeatures = false;
|
|
4019
4019
|
let hasFormulaFeatures = false;
|
|
4020
4020
|
let hasImportedFeatures = false;
|
|
4021
|
+
let hasRichTextCells = false;
|
|
4021
4022
|
let requiresSheetJsCellStyles = false;
|
|
4022
4023
|
WORKSHEET_SCAN_PATTERN.lastIndex = 0;
|
|
4023
4024
|
for(let match = WORKSHEET_SCAN_PATTERN.exec(source); match;){
|
|
4024
4025
|
const element = match[1];
|
|
4025
4026
|
if (match[3]) hasDirectCellStyles = true;
|
|
4027
|
+
if (match[4]) hasRichTextCells = true;
|
|
4026
4028
|
if (match[2] || match[3] || 'cols' === element) requiresSheetJsCellStyles = true;
|
|
4027
4029
|
if ('f' === element) hasFormulaFeatures = true;
|
|
4028
4030
|
if (element && IMPORTED_WORKSHEET_ELEMENTS.has(element)) hasImportedFeatures = true;
|
|
4029
4031
|
if (element && DIAGNOSTIC_WORKSHEET_ELEMENTS.has(element)) hasDiagnosticFeatures = true;
|
|
4030
|
-
if (hasDirectCellStyles && hasDiagnosticFeatures && hasFormulaFeatures && hasImportedFeatures && requiresSheetJsCellStyles) break;
|
|
4032
|
+
if (hasDirectCellStyles && hasDiagnosticFeatures && hasFormulaFeatures && hasImportedFeatures && hasRichTextCells && requiresSheetJsCellStyles) break;
|
|
4031
4033
|
match = WORKSHEET_SCAN_PATTERN.exec(source);
|
|
4032
4034
|
}
|
|
4033
4035
|
WORKSHEET_SCAN_PATTERN.lastIndex = 0;
|
|
@@ -4036,6 +4038,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
4036
4038
|
hasDiagnosticFeatures,
|
|
4037
4039
|
hasFormulaFeatures,
|
|
4038
4040
|
hasImportedFeatures,
|
|
4041
|
+
hasRichTextCells,
|
|
4039
4042
|
requiresSheetJsCellStyles
|
|
4040
4043
|
};
|
|
4041
4044
|
}
|
|
@@ -4131,6 +4134,7 @@ https://github.com/nodeca/pako/blob/main/LICENSE
|
|
|
4131
4134
|
hasDiagnosticFeatures: false,
|
|
4132
4135
|
hasFormulaFeatures: false,
|
|
4133
4136
|
hasImportedFeatures: false,
|
|
4137
|
+
hasRichTextCells: false,
|
|
4134
4138
|
requiresSheetJsCellStyles: false
|
|
4135
4139
|
};
|
|
4136
4140
|
async function plainWorkbookPlan(zip, packagePaths) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a3s-lab/office",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.0",
|
|
4
4
|
"description": "Open-source collaborative browser editors for documents, Markdown, spreadsheets, presentations, and PDFs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"office",
|
|
@@ -90,10 +90,12 @@
|
|
|
90
90
|
"playground:visual:spreadsheet-data-validation": "playwright test visual-tests/spreadsheet-data-validation.functional.spec.ts --config playwright.config.ts",
|
|
91
91
|
"playground:visual:spreadsheet-date-time": "playwright test visual-tests/spreadsheet-date-time.functional.spec.ts --config playwright.config.ts",
|
|
92
92
|
"playground:visual:spreadsheet-copy-from-above": "playwright test visual-tests/spreadsheet-copy-from-above.functional.spec.ts --config playwright.config.ts",
|
|
93
|
+
"playground:visual:spreadsheet-font-dialog-shortcuts": "playwright test visual-tests/spreadsheet-font-dialog-shortcuts.functional.spec.ts --config playwright.config.ts",
|
|
93
94
|
"playground:visual:spreadsheet-diagonal-borders": "playwright test visual-tests/spreadsheet-diagonal-borders.functional.spec.ts --config playwright.config.ts",
|
|
94
95
|
"playground:visual:spreadsheet-font-colors-shortcuts": "playwright test visual-tests/spreadsheet-font-colors-shortcuts.functional.spec.ts --config playwright.config.ts",
|
|
95
96
|
"playground:visual:spreadsheet-hyperlink": "playwright test visual-tests/spreadsheet-hyperlink.functional.spec.ts --config playwright.config.ts",
|
|
96
97
|
"playground:visual:spreadsheet-ribbon": "playwright test visual-tests/spreadsheet-ribbon.functional.spec.ts --config playwright.config.ts",
|
|
98
|
+
"playground:visual:spreadsheet-rich-text": "playwright test visual-tests/spreadsheet-rich-text.functional.spec.ts --config playwright.config.ts",
|
|
97
99
|
"playground:visual:spreadsheet-underline": "playwright test visual-tests/spreadsheet-underline.functional.spec.ts --config playwright.config.ts",
|
|
98
100
|
"playground:visual:spreadsheet-table": "playwright test visual-tests/spreadsheet-table.functional.spec.ts --config playwright.config.ts",
|
|
99
101
|
"playground:visual:update": "playwright test --config playwright.config.ts --update-snapshots",
|
|
@@ -166,6 +168,10 @@
|
|
|
166
168
|
"test:e2e:spreadsheet-date-time:check": "a3s-test check tests/e2e/spreadsheet-date-time.acl --json",
|
|
167
169
|
"test:e2e:spreadsheet-copy-from-above": "A3S_TEST_SUITE=tests/e2e/spreadsheet-copy-from-above.acl bash scripts/run-a3s-test-web-gate.sh",
|
|
168
170
|
"test:e2e:spreadsheet-copy-from-above:check": "a3s-test check tests/e2e/spreadsheet-copy-from-above.acl --json",
|
|
171
|
+
"test:e2e:spreadsheet-font-dialog-shortcuts": "A3S_TEST_SUITE=tests/e2e/spreadsheet-font-dialog-shortcuts.acl bash scripts/run-a3s-test-web-gate.sh",
|
|
172
|
+
"test:e2e:spreadsheet-font-dialog-shortcuts:check": "a3s-test check tests/e2e/spreadsheet-font-dialog-shortcuts.acl --json",
|
|
173
|
+
"test:e2e:spreadsheet-rich-text": "A3S_TEST_SUITE=tests/e2e/spreadsheet-rich-text.acl bash scripts/run-a3s-test-web-gate.sh",
|
|
174
|
+
"test:e2e:spreadsheet-rich-text:check": "a3s-test check tests/e2e/spreadsheet-rich-text.acl --json",
|
|
169
175
|
"test:e2e:spreadsheet-hyperlink": "a3s-test run tests/e2e/spreadsheet-hyperlink.acl --json",
|
|
170
176
|
"test:e2e:spreadsheet-hyperlink:check": "a3s-test check tests/e2e/spreadsheet-hyperlink.acl --json",
|
|
171
177
|
"test:e2e:spreadsheet-maximum-sparse": "a3s-test run tests/e2e/spreadsheet-maximum-sparse.acl --json",
|