@a3s-lab/office 0.34.0 → 0.36.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 +44 -25
- package/dist/0~7048.js +497 -2
- package/dist/0~presentation-editor.js +19 -5
- package/dist/0~spreadsheet-editor.js +298 -32
- package/dist/0~work-office-diagnostics.js +1 -1
- package/dist/3266.js +189 -10
- package/dist/4121.js +257 -0
- package/dist/8715.js +299 -299
- package/dist/core.js +14 -4
- package/dist/internal/features/work/editors/presentation-editor-focus.d.ts +2 -0
- package/dist/internal/features/work/editors/presentation-text-editor.d.ts +7 -0
- package/dist/internal/features/work/editors/spreadsheet-calculation-model.d.ts +1 -1
- package/dist/internal/features/work/editors/spreadsheet-calculation-projection.d.ts +5 -2
- package/dist/internal/features/work/editors/spreadsheet-command-controller.d.ts +10 -0
- package/dist/internal/features/work/editors/spreadsheet-command-selection.d.ts +22 -1
- package/dist/internal/features/work/editors/spreadsheet-table-calculated-columns.d.ts +42 -0
- package/dist/internal/features/work/editors/use-presentation-selection.d.ts +1 -1
- package/dist/internal/features/work/work-types.d.ts +5 -0
- package/dist/internal/kernel/office-kernel-protocol.d.ts +1 -1
- package/dist/internal/kernel/office-kernel-spreadsheet-protocol.d.ts +18 -0
- package/dist/internal/kernel/office-kernel-spreadsheet-structured-reference.d.ts +48 -0
- package/dist/office-kernel.wasm +0 -0
- package/dist/office-kernel.worker.js +505 -2
- package/docs/latest/en/browser-editor-architecture.md +21 -8
- package/package.json +16 -13
package/dist/core.js
CHANGED
|
@@ -5,7 +5,7 @@ import { OFFICE_COLLABORATION_PROTOCOL as WORK_OFFICE_COLLABORATION_PROTOCOL, Of
|
|
|
5
5
|
import { directChildren, OoxmlPackage as work_ooxml_package_OoxmlPackage, parseXml, firstDescendant, directChild, descendants, createArtifact as createWorkArtifact, xmlContainsAnyElement, createOfficeId as createWorkId, attribute as work_ooxml_package_attribute } from "./4121.js";
|
|
6
6
|
import { fileNameWithoutExtension, work_file_download_downloadBlob, mountWorkLiveDocumentCapture, importWorkDocumentFile, moveWorkSourceBlob, materializeWorkDocumentContent as work_document_model_codec_materializeWorkDocumentContent, createWorkDocumentModel, work_file_download_safeFileName, documentPageSurfaceGeometryForElement, registerSourceBlob as rememberWorkSourceBlob, documentModelForContent, readSourceBlob as readWorkSourceBlob, createWorkDocumentExtensions, positionWorkLiveDocumentCapture, createWorkDocumentBlob } from "./4174.js";
|
|
7
7
|
import { normalizeSpreadsheetPrintTitleRows, sparseMatrixColumnCount, normalizeSpreadsheetPrintArea, parseSpreadsheetPrintTitles, isValidSpreadsheetDefinedName, formatSpreadsheetCellRanges, stripSpreadsheetSheetQualifier, editableSpreadsheetFormula, sparseArrayEntries, qualifySpreadsheetRange, refreshSpreadsheetPivotTables, parseSpreadsheetCellRanges, normalizeSpreadsheetPrintTitleColumns } from "./8715.js";
|
|
8
|
-
import { xlsxColorMatches, xlsxRichTextCellText, spreadsheetCellValueWithDiagonalBorder, xlsxRichTextStyleOrigins, normalizeSpreadsheetDataValidationErrorStyle, directXlsxAlignment, spreadsheetTextOrientationFromXlsx, directXlsxFontStyle, hasXlsxDirectFontStyle,
|
|
8
|
+
import { xlsxColorMatches, xlsxRichTextCellText, spreadsheetCellValueWithDiagonalBorder, xlsxRichTextStyleOrigins, normalizeSpreadsheetDataValidationErrorStyle, directXlsxAlignment, applyImportedXlsxRichText, spreadsheetTextOrientationFromXlsx, directXlsxFontStyle, hasXlsxDirectFontStyle, xlsxStyleCollectionIndex, spreadsheetExplicitTextOrientationFromCell, sheetHasXlsxRichTextCells, activeXlsxNativeFill, readXlsxRichTextCells, normalizeSpreadsheetDateValidationBoundary, createXlsxRichTextReadContext, boundedSpreadsheetDataValidationText, xlsxNativeFillKey, xlsxBooleanAttribute, xlsxAlignmentMatches, xlsxBorderLineMatches, spreadsheetTextOrientationCellStyle, spreadsheetDateValidationFormula, spreadsheetDiagonalBorderFromCellValue, xlsxUnderlineStyle, spreadsheetUnderlineCellValueFromXlsx, xlsxToggleEnabled, writeXlsxRichTextCells, activeXlsxSemanticColorOrigin, xlsxNativeFillSemanticColors, normalizeSpreadsheetTableCalculatedFormula, spreadsheetUnderlineCellValueFromSheetJs } from "./3266.js";
|
|
9
9
|
import { freezeImportedSpreadsheetCell, readXlsxGradientFill, withXlsxPatternFill, xlsxCellStyleOriginSemanticColors, setXlsxToggleChild, withXlsxCellStyleOrigin, normalizeSpreadsheetConditionalVisualOptions, xlsxColorElementMatchesOrigin, withXlsxGradientFill, ensureXlsxStyleCollection, xlsxCellStyleOrigin, xlsxSemanticColorOriginKey, readXlsxPatternFill, isSpreadsheetConditionalComparisonOperator, registerImportedSpreadsheetMatrix, defaultSpreadsheetConditionalIconThresholds, readXlsxSemanticColorOrigin, setXlsxUnderlineChild, xlsxGradientFillFallbackColor, setXlsxColorChild, createXlsxColorResolver, resolveXlsxColor, setXlsxBorderLine, normalizeSpreadsheetConditionalIconSetFormat, defaultSpreadsheetDataBarOptions, defaultXlsxBorder, prepareXlsxSemanticPalette, importedSheetProtectionAuthority, defaultSpreadsheetColorScaleThresholds, xlsxRgbColor, writeXlsxAlignment, xlsxGradientFillKey, applyXlsxSemanticColorOrigin, spreadsheetConditionalComparisonNeedsUpperValue, sheetHasProtectionState, xlsxWorksheetCellEntries, isSpreadsheetConditionalIconSetName, setXlsxValueChild, defaultXlsxFill, spreadsheetConditionalThresholdsEqual, spreadsheetConditionalIconSetCount } from "./9333.js";
|
|
10
10
|
import { updateSpreadsheetWorksheetCompatibilitySummary, inspectXlsxPivotTables, readXlsxWorksheetCharts, createXlsxFormulaCell, patchXlsxWorksheetDrawings, readXlsxWorksheetImages, writeXlsxProtection, xlsxWorksheetChartsToSheet, readXlsxFormulaFeaturesFromPackage, emptySpreadsheetWorksheetCompatibilitySummary, createSpreadsheetFormulaMetadata, createXlsxErrorCell, xlsxWorksheetImagesToSheet, readXlsxProtection, patchXlsxFormulaFeatures, patchXlsxPivotTables, writeXlsxPageSetup, XlsxCellProtectionWriter, applyImportedXlsxPivotTables, readXlsxPageSetup } from "./4166.js";
|
|
11
11
|
import { WorkFileImportController, materializeWorkFileSource } from "./9356.js";
|
|
@@ -2700,9 +2700,14 @@ function parseXlsxTable(document1, partPath) {
|
|
|
2700
2700
|
if (!name || !range || !columnsElement) return null;
|
|
2701
2701
|
const columns = directChildren(columnsElement, 'tableColumn').flatMap((column)=>{
|
|
2702
2702
|
const columnName = work_ooxml_package_attribute(column, 'name');
|
|
2703
|
-
|
|
2703
|
+
if (null === columnName) return [];
|
|
2704
|
+
const calculatedFormula = normalizeSpreadsheetTableCalculatedFormula(directChild(column, 'calculatedColumnFormula')?.textContent);
|
|
2705
|
+
return [
|
|
2704
2706
|
{
|
|
2705
|
-
name: columnName
|
|
2707
|
+
name: columnName,
|
|
2708
|
+
...calculatedFormula ? {
|
|
2709
|
+
calculatedFormula
|
|
2710
|
+
} : {}
|
|
2706
2711
|
}
|
|
2707
2712
|
];
|
|
2708
2713
|
});
|
|
@@ -2742,7 +2747,12 @@ function xlsxTableXml(table, tableId, namespace) {
|
|
|
2742
2747
|
]);
|
|
2743
2748
|
const displayName = table.displayName?.trim() || table.name;
|
|
2744
2749
|
const filter = table.headerRow ? xlsxTableAutoFilterXml(table.filters, reference, table.totalsRow) : '';
|
|
2745
|
-
const columns = table.columns.map((column, index)
|
|
2750
|
+
const columns = table.columns.map((column, index)=>{
|
|
2751
|
+
const formula = normalizeSpreadsheetTableCalculatedFormula(column.calculatedFormula);
|
|
2752
|
+
const formulaElement = formula ? `<calculatedColumnFormula>${work_xlsx_tables_escapeXml(formula.replace(/^=/, ''))}</calculatedColumnFormula>` : '';
|
|
2753
|
+
const opening = `<tableColumn id="${index + 1}" name="${work_xlsx_tables_escapeXml(column.name)}"`;
|
|
2754
|
+
return formulaElement ? `${opening}>${formulaElement}</tableColumn>` : `${opening}/>`;
|
|
2755
|
+
}).join('');
|
|
2746
2756
|
const styleName = tableStyleName(table.style);
|
|
2747
2757
|
const style = styleName ? `<tableStyleInfo name="${styleName}" showColumnStripes="${booleanToken(table.showColumnStripes)}" showFirstColumn="${booleanToken(table.showFirstColumn)}" showLastColumn="${booleanToken(table.showLastColumn)}" showRowStripes="${booleanToken(table.showRowStripes)}"/>` : '';
|
|
2748
2758
|
return [
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PresentationEditorCommands } from './presentation-command-types';
|
|
2
|
+
import type { WorkSlideElement } from '../work-types';
|
|
2
3
|
export interface PresentationObjectFocusState {
|
|
3
4
|
editingElementId: string | null;
|
|
4
5
|
selectedElementIds: readonly string[];
|
|
@@ -7,6 +8,7 @@ export interface PresentationWorkspaceFocusState extends PresentationObjectFocus
|
|
|
7
8
|
selectedSlideId: string;
|
|
8
9
|
viewMode: 'normal' | 'sorter';
|
|
9
10
|
}
|
|
11
|
+
export declare function presentationInitialEditingElementId(elements: readonly WorkSlideElement[]): string | null;
|
|
10
12
|
export declare function restorePresentationObjectFocus(container: HTMLElement | null, getState: () => PresentationObjectFocusState, focusOrigin?: Element | null): void;
|
|
11
13
|
export declare function restorePresentationWorkspaceFocus(root: HTMLElement | null, getState: () => PresentationWorkspaceFocusState, focusOrigin?: Element | null): void;
|
|
12
14
|
export declare function presentationWorkspaceFocusTarget(root: HTMLElement, state: PresentationWorkspaceFocusState): HTMLElement | undefined;
|
|
@@ -13,6 +13,13 @@ export interface PresentationTextEditorProps {
|
|
|
13
13
|
onSelectionChange?: () => void;
|
|
14
14
|
}
|
|
15
15
|
export declare function PresentationTextEditor({ autoFocus, element, onChange, onEditorChange, onExitEditing, onSelectionChange, }: PresentationTextEditorProps): import("react").JSX.Element | null;
|
|
16
|
+
/**
|
|
17
|
+
* Keep delayed first-open focus from overriding a deliberate focus move that
|
|
18
|
+
* happened while the rich-text editor was being created. The document body is
|
|
19
|
+
* treated as an unfocused baseline so opening from a non-focusable surface can
|
|
20
|
+
* still enter the editor normally.
|
|
21
|
+
*/
|
|
22
|
+
export declare function presentationFocusOwnerIsUnchanged(initialFocusTarget: HTMLElement | null): boolean;
|
|
16
23
|
export declare function createPresentationTextEditorExtensions(placeholder?: string): Extensions;
|
|
17
24
|
export declare function presentationTextElementHtml(element: WorkSlideElement): string;
|
|
18
25
|
export declare function presentationTextValue(editor: Editor, element: WorkSlideElement): PresentationTextValue;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Op, type Sheet } from '@fortune-sheet/core';
|
|
2
2
|
import type { OfficeKernelSpreadsheetCalculatedCell, OfficeKernelSpreadsheetCoordinate, OfficeKernelSpreadsheetSessionUpdate } from '../../../kernel/office-kernel-protocol';
|
|
3
|
-
import type { SpreadsheetCalculationCommand } from './spreadsheet-command-controller';
|
|
4
3
|
import { type SpreadsheetKernelFallbackCell, type SpreadsheetKernelWorkbook } from './spreadsheet-calculation-projection';
|
|
4
|
+
import type { SpreadsheetCalculationCommand } from './spreadsheet-command-controller';
|
|
5
5
|
export declare function spreadsheetCalculationTargets(workbook: SpreadsheetKernelWorkbook, command: SpreadsheetCalculationCommand): OfficeKernelSpreadsheetCoordinate[] | undefined;
|
|
6
6
|
export declare function spreadsheetCalculationSessionUpdate(previous: SpreadsheetKernelWorkbook | null, current: SpreadsheetKernelWorkbook, baseDocumentRevision: number, forceReplace?: boolean): OfficeKernelSpreadsheetSessionUpdate;
|
|
7
7
|
export declare function spreadsheetCalculationFallbackCells(workbook: SpreadsheetKernelWorkbook, command: SpreadsheetCalculationCommand, includeDataTables?: boolean): SpreadsheetKernelFallbackCell[];
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { Op, Sheet } from '@fortune-sheet/core';
|
|
2
2
|
import type { OfficeKernelSpreadsheetCoordinate, OfficeKernelSpreadsheetInputCell, OfficeKernelSpreadsheetInputSheet, OfficeKernelSpreadsheetSessionCellChange } from '../../../kernel/office-kernel-protocol';
|
|
3
|
-
import type { WorkSpreadsheetContent, WorkSpreadsheetFormulaRangeType, WorkSpreadsheetSheet } from '../work-types';
|
|
3
|
+
import type { WorkSpreadsheetContent, WorkSpreadsheetFormulaRangeType, WorkSpreadsheetSheet, WorkSpreadsheetTable } from '../work-types';
|
|
4
4
|
export declare const SPREADSHEET_KERNEL_MAX_PATCH_CELLS = 10000;
|
|
5
|
+
type SpreadsheetKernelSheet = Sheet & {
|
|
6
|
+
tables?: WorkSpreadsheetTable[];
|
|
7
|
+
};
|
|
5
8
|
export interface SpreadsheetKernelWorkbook {
|
|
6
9
|
fallbackCells: SpreadsheetKernelFallbackCell[];
|
|
7
10
|
sheets: OfficeKernelSpreadsheetInputSheet[];
|
|
@@ -34,7 +37,7 @@ export declare function createSpreadsheetKernelWorkbook(content: Pick<WorkSpread
|
|
|
34
37
|
* snapshot from the updated controlled content.
|
|
35
38
|
*/
|
|
36
39
|
export declare function prepareSpreadsheetKernelWorkbook(content: Pick<WorkSpreadsheetContent, 'sheets'>): SpreadsheetKernelWorkbookPreparation;
|
|
37
|
-
export declare function refreshSpreadsheetKernelWorkbook(sheets: readonly
|
|
40
|
+
export declare function refreshSpreadsheetKernelWorkbook(sheets: readonly SpreadsheetKernelSheet[], fallbackCells: readonly SpreadsheetKernelFallbackCell[]): SpreadsheetKernelWorkbook | null;
|
|
38
41
|
export declare function projectSpreadsheetKernelWorkbookOperations(previous: SpreadsheetKernelWorkbook, sheets: readonly WorkSpreadsheetSheet[], operations: readonly Op[]): SpreadsheetKernelOperationProjection | null;
|
|
39
42
|
export declare function spreadsheetOperationsMayChangeCalculation(operations: readonly Op[], workbook?: SpreadsheetKernelWorkbook | null): boolean;
|
|
40
43
|
export declare function spreadsheetKernelCellKey(cell: Pick<OfficeKernelSpreadsheetInputCell, 'row' | 'column'>): string;
|
|
@@ -67,6 +67,15 @@ export interface SpreadsheetCommandSelection {
|
|
|
67
67
|
sheetId: string;
|
|
68
68
|
selection: Selection;
|
|
69
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Synchronous selection state shared by commands and the Fortune Sheet bridge.
|
|
72
|
+
* Fortune applies API calls through React state, so reading its imperative API
|
|
73
|
+
* twice in the same task can otherwise return the previous selection.
|
|
74
|
+
*/
|
|
75
|
+
export interface SpreadsheetSelectionRef {
|
|
76
|
+
current: SpreadsheetCommandSelection | null;
|
|
77
|
+
requested: SpreadsheetCommandSelection | null;
|
|
78
|
+
}
|
|
70
79
|
export type SpreadsheetStructureAxis = 'row' | 'column';
|
|
71
80
|
export type SpreadsheetStructureInsertPosition = 'before' | 'after';
|
|
72
81
|
export type SpreadsheetSortDirection = 'ascending' | 'descending';
|
|
@@ -238,6 +247,7 @@ export interface SpreadsheetCommandContext {
|
|
|
238
247
|
onChange: (content: WorkSpreadsheetContent) => void;
|
|
239
248
|
richTextFormat?: SpreadsheetRichTextFormatCommandPort | null;
|
|
240
249
|
selection: SpreadsheetCommandSelection | null;
|
|
250
|
+
selectionRef?: SpreadsheetSelectionRef;
|
|
241
251
|
table: SpreadsheetTableCommandPort;
|
|
242
252
|
targetSheetGridSize?: SpreadsheetGridSize | null;
|
|
243
253
|
targetSheetId: string;
|
|
@@ -1,3 +1,24 @@
|
|
|
1
|
-
import type { SpreadsheetCommandContext, SpreadsheetCommandRange } from './spreadsheet-command-controller';
|
|
1
|
+
import type { SpreadsheetCommandContext, SpreadsheetCommandSelection, SpreadsheetCommandRange, SpreadsheetSelectionRef } from './spreadsheet-command-controller';
|
|
2
2
|
export declare function canEditSpreadsheetSelection(context: SpreadsheetCommandContext): boolean;
|
|
3
3
|
export declare function spreadsheetLiveCommandRange(context: SpreadsheetCommandContext): SpreadsheetCommandRange;
|
|
4
|
+
/**
|
|
5
|
+
* Returns the most recent selection known to the Office bridge. The ref is
|
|
6
|
+
* intentionally checked before Fortune's imperative API because that API is
|
|
7
|
+
* backed by React state and can lag behind a just-issued keyboard command.
|
|
8
|
+
*/
|
|
9
|
+
export declare function spreadsheetLiveCommandSelection(context: SpreadsheetCommandContext): SpreadsheetCommandRange | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Returns all current selections while preserving the workbook's multi-range
|
|
12
|
+
* semantics. A synchronous command selection is represented as one range.
|
|
13
|
+
*/
|
|
14
|
+
export declare function spreadsheetLiveCommandSelections(context: SpreadsheetCommandContext): SpreadsheetCommandRange[] | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Accept a Fortune selection callback unless it is older than a pending
|
|
17
|
+
* programmatic selection request. The returned value is the normalized state
|
|
18
|
+
* that should be published to React and collaboration consumers.
|
|
19
|
+
*/
|
|
20
|
+
export declare function acceptSpreadsheetSelectionChange(selectionRef: SpreadsheetSelectionRef, sheetId: string, selection: SpreadsheetCommandRange): SpreadsheetCommandSelection | null;
|
|
21
|
+
export declare function rememberSpreadsheetCommandSelection(context: SpreadsheetCommandContext, selection: SpreadsheetCommandRange): void;
|
|
22
|
+
/** Clear a pending programmatic request when a fresh user intent arrives. */
|
|
23
|
+
export declare function releaseSpreadsheetSelectionRequest(selectionRef: SpreadsheetSelectionRef): void;
|
|
24
|
+
export declare function sameSpreadsheetSelectionValue(left: SpreadsheetCommandRange, right: SpreadsheetCommandRange): boolean;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Cell } from '@fortune-sheet/core';
|
|
2
|
+
import type { WorkSpreadsheetSheet, WorkSpreadsheetTable, WorkSpreadsheetTableColumn } from '../work-types';
|
|
3
|
+
/** Keep calculated-column metadata small enough to cross every editor boundary. */
|
|
4
|
+
export declare const MAX_SPREADSHEET_TABLE_CALCULATED_FORMULA_LENGTH = 8192;
|
|
5
|
+
/**
|
|
6
|
+
* Normalizes the editable form of a table-column formula. Native table parts
|
|
7
|
+
* omit the leading `=`, while cell formulas and the calculation kernel keep
|
|
8
|
+
* it. Unsafe or external formulas are deliberately not treated as automatic
|
|
9
|
+
* fill rules.
|
|
10
|
+
*/
|
|
11
|
+
export declare function normalizeSpreadsheetTableCalculatedFormula(value: unknown): string | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Finds a shared current-row formula already authored in a table column.
|
|
14
|
+
* Ordinary one-off A1 formulas are intentionally ignored so inserting a row
|
|
15
|
+
* cannot unexpectedly overwrite a user's manual exception.
|
|
16
|
+
*/
|
|
17
|
+
export declare function inferredSpreadsheetTableCalculatedFormula(sheet: WorkSpreadsheetSheet, table: WorkSpreadsheetTable, columnOffset: number): string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Reconciles declared calculated-column formulas with formulas authored in the
|
|
20
|
+
* controlled cell matrix. A conflicting column is made manual instead of
|
|
21
|
+
* guessing which formula should be copied into a new row.
|
|
22
|
+
*/
|
|
23
|
+
export declare function reconcileSpreadsheetTableCalculatedColumns(sheet: WorkSpreadsheetSheet, table: WorkSpreadsheetTable): WorkSpreadsheetTableColumn[];
|
|
24
|
+
/** Returns true only for a formula safe to copy into a new table row. */
|
|
25
|
+
export declare function isSpreadsheetTableCalculatedFormula(value: unknown): value is string;
|
|
26
|
+
/**
|
|
27
|
+
* Applies calculated-column formulas to newly inserted body rows. The helper
|
|
28
|
+
* deliberately edits only empty cells; copied values and authored exceptions
|
|
29
|
+
* remain authoritative. Both Fortune's dense matrix and sparse `celldata`
|
|
30
|
+
* storage are updated without materializing unrelated rows or columns.
|
|
31
|
+
*/
|
|
32
|
+
export declare function fillSpreadsheetTableCalculatedColumns(sheet: WorkSpreadsheetSheet, table: WorkSpreadsheetTable, rows: readonly number[]): WorkSpreadsheetSheet;
|
|
33
|
+
export declare function spreadsheetTableCellAt(sheet: WorkSpreadsheetSheet, row: number, column: number): Cell | null;
|
|
34
|
+
export declare function spreadsheetTableCellIsEmpty(cell: Cell | null | undefined): boolean;
|
|
35
|
+
/** Copy visual cell metadata without carrying a stale cached formula result. */
|
|
36
|
+
export declare function spreadsheetCellWithCalculatedFormula(source: Cell | null | undefined, formula: string): Cell;
|
|
37
|
+
/** Iterate formula-bearing cells without forcing a dense worksheet matrix. */
|
|
38
|
+
export declare function spreadsheetTableFormulaCells(sheet: WorkSpreadsheetSheet): Array<{
|
|
39
|
+
cell: Cell;
|
|
40
|
+
column: number;
|
|
41
|
+
row: number;
|
|
42
|
+
}>;
|
|
@@ -8,4 +8,4 @@ export interface PresentationSelectionController {
|
|
|
8
8
|
select: (elementId: string | null, additive?: boolean) => void;
|
|
9
9
|
selectedElementIds: string[];
|
|
10
10
|
}
|
|
11
|
-
export declare function usePresentationSelection(elements: readonly WorkSlideElement[]): PresentationSelectionController;
|
|
11
|
+
export declare function usePresentationSelection(elements: readonly WorkSlideElement[], initialEditingElementId?: string | null): PresentationSelectionController;
|
|
@@ -236,6 +236,11 @@ export type WorkSpreadsheetTableStyle = {
|
|
|
236
236
|
};
|
|
237
237
|
export interface WorkSpreadsheetTableColumn {
|
|
238
238
|
name: string;
|
|
239
|
+
/**
|
|
240
|
+
* A bounded native table calculated-column formula. The controlled model
|
|
241
|
+
* stores the editable form with a leading `=`; XLSX table parts omit it.
|
|
242
|
+
*/
|
|
243
|
+
calculatedFormula?: string;
|
|
239
244
|
}
|
|
240
245
|
export type WorkSpreadsheetDynamicFilter = 'above-average' | 'below-average' | 'tomorrow' | 'today' | 'yesterday' | 'next-week' | 'this-week' | 'last-week' | 'next-month' | 'this-month' | 'last-month' | 'next-quarter' | 'this-quarter' | 'last-quarter' | 'next-year' | 'this-year' | 'last-year' | 'year-to-date' | 'quarter-1' | 'quarter-2' | 'quarter-3' | 'quarter-4' | 'month-1' | 'month-2' | 'month-3' | 'month-4' | 'month-5' | 'month-6' | 'month-7' | 'month-8' | 'month-9' | 'month-10' | 'month-11' | 'month-12';
|
|
241
246
|
export type WorkSpreadsheetTableFilterCriteria = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OFFICE_KERNEL_PROTOCOL_VERSION } from './office-kernel-version';
|
|
2
|
+
export type { OfficeKernelSpreadsheetCalculatedCell, OfficeKernelSpreadsheetCalculationIssue, OfficeKernelSpreadsheetCalculationRequest, OfficeKernelSpreadsheetCalculationResult, OfficeKernelSpreadsheetCoordinate, OfficeKernelSpreadsheetError, OfficeKernelSpreadsheetInputCell, OfficeKernelSpreadsheetInputSheet, OfficeKernelSpreadsheetInputTable, OfficeKernelSpreadsheetSessionCalculationRequest, OfficeKernelSpreadsheetSessionCalculationResult, OfficeKernelSpreadsheetSessionCalculationScope, OfficeKernelSpreadsheetSessionCalculationStats, OfficeKernelSpreadsheetSessionCellChange, OfficeKernelSpreadsheetSessionUpdate, OfficeKernelSpreadsheetValue, } from './office-kernel-spreadsheet-protocol';
|
|
2
3
|
export { OFFICE_KERNEL_PROTOCOL_VERSION };
|
|
3
|
-
export type { OfficeKernelSpreadsheetCalculatedCell, OfficeKernelSpreadsheetCalculationIssue, OfficeKernelSpreadsheetCalculationRequest, OfficeKernelSpreadsheetCalculationResult, OfficeKernelSpreadsheetCoordinate, OfficeKernelSpreadsheetError, OfficeKernelSpreadsheetInputCell, OfficeKernelSpreadsheetInputSheet, OfficeKernelSpreadsheetSessionCalculationRequest, OfficeKernelSpreadsheetSessionCalculationResult, OfficeKernelSpreadsheetSessionCalculationScope, OfficeKernelSpreadsheetSessionCalculationStats, OfficeKernelSpreadsheetSessionCellChange, OfficeKernelSpreadsheetSessionUpdate, OfficeKernelSpreadsheetValue, } from './office-kernel-spreadsheet-protocol';
|
|
4
4
|
import type { OfficeKernelSpreadsheetCalculationRequest, OfficeKernelSpreadsheetCalculationResult, OfficeKernelSpreadsheetSessionCalculationRequest, OfficeKernelSpreadsheetSessionCalculationResult } from './office-kernel-spreadsheet-protocol';
|
|
5
5
|
export type OfficeKernelEngine = 'wasm' | 'javascript';
|
|
6
6
|
export interface OfficeKernelPageMetrics {
|
|
@@ -29,10 +29,28 @@ export interface OfficeKernelSpreadsheetInputCell {
|
|
|
29
29
|
formula?: string;
|
|
30
30
|
value: OfficeKernelSpreadsheetValue;
|
|
31
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* The bounded table metadata needed to resolve native structured references.
|
|
34
|
+
* Ranges are zero-based and inclusive, matching the controlled workbook
|
|
35
|
+
* model. Styling, filters, and drawing metadata intentionally stay outside
|
|
36
|
+
* the calculation kernel.
|
|
37
|
+
*/
|
|
38
|
+
export interface OfficeKernelSpreadsheetInputTable {
|
|
39
|
+
name: string;
|
|
40
|
+
displayName?: string;
|
|
41
|
+
startRow: number;
|
|
42
|
+
endRow: number;
|
|
43
|
+
startColumn: number;
|
|
44
|
+
endColumn: number;
|
|
45
|
+
columns: string[];
|
|
46
|
+
headerRow: boolean;
|
|
47
|
+
totalsRow: boolean;
|
|
48
|
+
}
|
|
32
49
|
export interface OfficeKernelSpreadsheetInputSheet {
|
|
33
50
|
id: string;
|
|
34
51
|
name: string;
|
|
35
52
|
cells: OfficeKernelSpreadsheetInputCell[];
|
|
53
|
+
tables?: OfficeKernelSpreadsheetInputTable[];
|
|
36
54
|
}
|
|
37
55
|
export interface OfficeKernelSpreadsheetCalculationRequest {
|
|
38
56
|
protocol: typeof OFFICE_KERNEL_PROTOCOL_VERSION;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { OfficeKernelSpreadsheetInputSheet } from './office-kernel-spreadsheet-protocol';
|
|
2
|
+
export interface SpreadsheetStructuredRowSelection {
|
|
3
|
+
all: boolean;
|
|
4
|
+
headers: boolean;
|
|
5
|
+
data: boolean;
|
|
6
|
+
totals: boolean;
|
|
7
|
+
current: boolean;
|
|
8
|
+
}
|
|
9
|
+
export interface SpreadsheetStructuredReference {
|
|
10
|
+
tableName?: string;
|
|
11
|
+
firstColumn?: string;
|
|
12
|
+
lastColumn?: string;
|
|
13
|
+
rows: SpreadsheetStructuredRowSelection;
|
|
14
|
+
}
|
|
15
|
+
export interface SpreadsheetStructuredReferenceArea {
|
|
16
|
+
sheetId: string;
|
|
17
|
+
sheetName: string;
|
|
18
|
+
startRow: number;
|
|
19
|
+
endRow: number;
|
|
20
|
+
startColumn: number;
|
|
21
|
+
endColumn: number;
|
|
22
|
+
}
|
|
23
|
+
export type SpreadsheetStructuredReferenceErrorKind = 'invalid' | 'unsupported' | 'missing-table' | 'missing-column';
|
|
24
|
+
export declare class SpreadsheetStructuredReferenceError extends Error {
|
|
25
|
+
readonly kind: SpreadsheetStructuredReferenceErrorKind;
|
|
26
|
+
constructor(kind: SpreadsheetStructuredReferenceErrorKind, message: string);
|
|
27
|
+
}
|
|
28
|
+
/** Parse one bounded table-reference token using the OOXML column grammar. */
|
|
29
|
+
export declare function parseSpreadsheetStructuredReference(reference: string): SpreadsheetStructuredReference;
|
|
30
|
+
/**
|
|
31
|
+
* Catalog the semantic tables in a workbook and resolve references to bounded
|
|
32
|
+
* zero-based rectangular areas. The catalog deliberately contains no cells;
|
|
33
|
+
* values remain in the calculation evaluator so dependencies stay observable.
|
|
34
|
+
*/
|
|
35
|
+
export declare class SpreadsheetStructuredReferenceCatalog {
|
|
36
|
+
readonly sheets: readonly OfficeKernelSpreadsheetInputSheet[];
|
|
37
|
+
private readonly definitions;
|
|
38
|
+
private readonly byName;
|
|
39
|
+
private readonly bySheet;
|
|
40
|
+
constructor(sheets: readonly OfficeKernelSpreadsheetInputSheet[]);
|
|
41
|
+
resolve(qualifier: string | undefined, reference: string, currentSheet: OfficeKernelSpreadsheetInputSheet, currentColumn: number, currentRow: number): SpreadsheetStructuredReferenceArea[];
|
|
42
|
+
private resolveTable;
|
|
43
|
+
private resolveColumns;
|
|
44
|
+
private resolveRows;
|
|
45
|
+
private dataRows;
|
|
46
|
+
}
|
|
47
|
+
/** Expand structured tokens to A1 ranges before invoking the scalar parser. */
|
|
48
|
+
export declare function expandSpreadsheetStructuredReferences(formula: string, catalog: SpreadsheetStructuredReferenceCatalog, currentSheet: OfficeKernelSpreadsheetInputSheet, currentRow: number, currentColumn: number): string;
|
package/dist/office-kernel.wasm
CHANGED
|
Binary file
|