logisheets 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/api/workbook.d.ts +52 -1
- package/dist/src/api/workbook.js +64 -0
- package/dist/src/api/worksheet.d.ts +26 -1
- package/dist/src/api/worksheet.js +52 -0
- package/dist/src/bindings/bind_form_schema.d.ts +8 -0
- package/dist/src/bindings/bind_form_schema.js +15 -1
- package/dist/src/bindings/block_data_row.d.ts +4 -0
- package/dist/src/bindings/block_data_row.js +1 -0
- package/dist/src/bindings/block_schema_field_entry.d.ts +3 -0
- package/dist/src/bindings/checkpoint_meta.d.ts +4 -0
- package/dist/src/bindings/checkpoint_meta.js +1 -0
- package/dist/src/bindings/edit_payload.d.ts +4 -0
- package/dist/src/bindings/index.d.ts +9 -0
- package/dist/src/bindings/index.js +9 -0
- package/dist/src/bindings/restore_checkpoint.d.ts +10 -0
- package/dist/src/bindings/restore_checkpoint.js +12 -0
- package/dist/src/bindings/rpc_delete_checkpoint_params.d.ts +3 -0
- package/dist/src/bindings/rpc_delete_checkpoint_params.js +1 -0
- package/dist/src/bindings/rpc_export_block_data_params.d.ts +5 -0
- package/dist/src/bindings/rpc_export_block_data_params.js +1 -0
- package/dist/src/bindings/rpc_get_all_blocks_params.d.ts +4 -0
- package/dist/src/bindings/rpc_get_all_blocks_params.js +1 -0
- package/dist/src/bindings/rpc_get_data_boundary_params.d.ts +7 -0
- package/dist/src/bindings/rpc_get_data_boundary_params.js +1 -0
- package/dist/src/bindings/rpc_predict_fill_params.d.ts +11 -0
- package/dist/src/bindings/rpc_predict_fill_params.js +1 -0
- package/dist/src/bindings/rpc_save_checkpoint_params.d.ts +4 -0
- package/dist/src/bindings/rpc_save_checkpoint_params.js +1 -0
- package/dist/src/bindings/rpc_workbook_methods.d.ts +18 -0
- package/dist/src/bindings/upsert_field_formulas.d.ts +8 -0
- package/dist/src/bindings/upsert_field_formulas.js +15 -1
- package/dist/src/pure.d.ts +9 -0
- package/dist/src/pure.js +20 -0
- package/dist/src/types.js +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActionEffect, BlockField, FormulaDisplayInfo, ShadowCellInfo, SheetCellId, SheetInfo, SaveFileResult, AppData, CellInfo, CellCoordinateWithSheet, Transaction, GetBlockValuesParams, GetCellIdParams, GetShadowCellIdParams, GetShadowCellIdsParams, GetAvailableBlockIdParams, TempStatusDiff } from '../bindings';
|
|
1
|
+
import { ActionEffect, BlockField, BlockInfo, FormulaDisplayInfo, ShadowCellInfo, SheetCellId, SheetInfo, SaveFileResult, AppData, CellInfo, CellCoordinateWithSheet, Transaction, GetBlockValuesParams, GetCellIdParams, GetShadowCellIdParams, GetShadowCellIdsParams, GetAvailableBlockIdParams, TempStatusDiff, BlockDataRow } from '../bindings';
|
|
2
2
|
import { ColId, RowId } from '../types';
|
|
3
3
|
import { Worksheet } from './worksheet';
|
|
4
4
|
import { CustomFunc } from './calculator';
|
|
@@ -38,6 +38,14 @@ export declare class Workbook {
|
|
|
38
38
|
* coordinates.
|
|
39
39
|
*/
|
|
40
40
|
getCellIdByBlockRef(refName: string, key: string, field: string): Result<SheetCellId>;
|
|
41
|
+
/**
|
|
42
|
+
* Export a block's data as a row-per-key, column-per-field matrix of
|
|
43
|
+
* values. `keyFilter`/`fieldFilter` narrow the rows/columns (omit for
|
|
44
|
+
* all). Columns follow the schema's field order (filtered); pair them with
|
|
45
|
+
* the field metadata from the field manager — including which field is the
|
|
46
|
+
* key — on the caller side.
|
|
47
|
+
*/
|
|
48
|
+
exportBlockData(refName: string, keyFilter?: readonly string[], fieldFilter?: readonly string[]): Result<readonly BlockDataRow[]>;
|
|
41
49
|
/**
|
|
42
50
|
* Snapshot of all cell-value differences between the active temp
|
|
43
51
|
* branch and the committed (fork) status. Returns an empty diff
|
|
@@ -67,6 +75,25 @@ export declare class Workbook {
|
|
|
67
75
|
release(): void;
|
|
68
76
|
getSheetCount(): number;
|
|
69
77
|
getWorksheet(idx: number): Worksheet;
|
|
78
|
+
/**
|
|
79
|
+
* Fill-handle drag: predict the contents for `dst` from the source
|
|
80
|
+
* block `src` and commit them as a single (undoable) transaction.
|
|
81
|
+
*
|
|
82
|
+
* The semantics (formula reference shift, arithmetic series, value
|
|
83
|
+
* copy) live in the Rust engine; this just predicts then dispatches.
|
|
84
|
+
* Returns the prediction error if the ranges don't align on one axis.
|
|
85
|
+
*/
|
|
86
|
+
fill(sheetIdx: number, src: {
|
|
87
|
+
startRow: number;
|
|
88
|
+
startCol: number;
|
|
89
|
+
endRow: number;
|
|
90
|
+
endCol: number;
|
|
91
|
+
}, dst: {
|
|
92
|
+
startRow: number;
|
|
93
|
+
startCol: number;
|
|
94
|
+
endRow: number;
|
|
95
|
+
endCol: number;
|
|
96
|
+
}): Result<ActionEffect>;
|
|
70
97
|
getWorksheetById(id: number): Worksheet;
|
|
71
98
|
registryCustomFunc(customFunc: CustomFunc): void;
|
|
72
99
|
getShadowCellId(params: GetShadowCellIdParams): Result<number>;
|
|
@@ -76,6 +103,30 @@ export declare class Workbook {
|
|
|
76
103
|
}): Result<ShadowCellInfo>;
|
|
77
104
|
getCellId(params: GetCellIdParams): Result<SheetCellId>;
|
|
78
105
|
getAllBlockFields(): Result<readonly BlockField[]>;
|
|
106
|
+
/**
|
|
107
|
+
* Enumerate blocks across the workbook.
|
|
108
|
+
*
|
|
109
|
+
* Scope:
|
|
110
|
+
* - `sheetId` set → only that sheet
|
|
111
|
+
* - `sheetIdx` set → resolve to sheetId, then that sheet
|
|
112
|
+
* - neither set → every sheet
|
|
113
|
+
* `sheetId` wins if both are set.
|
|
114
|
+
*/
|
|
115
|
+
getAllBlocks(params?: {
|
|
116
|
+
sheetIdx?: number;
|
|
117
|
+
sheetId?: number;
|
|
118
|
+
}): Result<readonly BlockInfo[]>;
|
|
119
|
+
/** Snapshot the current workbook state under `label`. Overwrites
|
|
120
|
+
* any existing checkpoint with the same label. Returns the number
|
|
121
|
+
* of checkpoints currently stored after this save. */
|
|
122
|
+
saveCheckpoint(label: string, description?: string): Result<number>;
|
|
123
|
+
/** Drop a named checkpoint. Returns `true` if it existed. */
|
|
124
|
+
deleteCheckpoint(label: string): Result<boolean>;
|
|
125
|
+
/** List all checkpoints (newest first). */
|
|
126
|
+
listCheckpoints(): Result<ReadonlyArray<{
|
|
127
|
+
label: string;
|
|
128
|
+
description?: string;
|
|
129
|
+
}>>;
|
|
79
130
|
private _inputAsyncResult;
|
|
80
131
|
private _onCellUpdate;
|
|
81
132
|
private _onSheetUpdate;
|
package/dist/src/api/workbook.js
CHANGED
|
@@ -117,6 +117,16 @@ export class Workbook {
|
|
|
117
117
|
getCellIdByBlockRef(refName, key, field) {
|
|
118
118
|
return rpc('getCellIdByBlockRef', { refName, key, field }, this._id);
|
|
119
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* Export a block's data as a row-per-key, column-per-field matrix of
|
|
122
|
+
* values. `keyFilter`/`fieldFilter` narrow the rows/columns (omit for
|
|
123
|
+
* all). Columns follow the schema's field order (filtered); pair them with
|
|
124
|
+
* the field metadata from the field manager — including which field is the
|
|
125
|
+
* key — on the caller side.
|
|
126
|
+
*/
|
|
127
|
+
exportBlockData(refName, keyFilter, fieldFilter) {
|
|
128
|
+
return rpc('exportBlockData', { refName, keyFilter, fieldFilter }, this._id);
|
|
129
|
+
}
|
|
120
130
|
/**
|
|
121
131
|
* Snapshot of all cell-value differences between the active temp
|
|
122
132
|
* branch and the committed (fork) status. Returns an empty diff
|
|
@@ -262,6 +272,24 @@ export class Workbook {
|
|
|
262
272
|
throw Error(`invalid sheet index: ${idx}`);
|
|
263
273
|
return new Worksheet(this._id, idx);
|
|
264
274
|
}
|
|
275
|
+
/**
|
|
276
|
+
* Fill-handle drag: predict the contents for `dst` from the source
|
|
277
|
+
* block `src` and commit them as a single (undoable) transaction.
|
|
278
|
+
*
|
|
279
|
+
* The semantics (formula reference shift, arithmetic series, value
|
|
280
|
+
* copy) live in the Rust engine; this just predicts then dispatches.
|
|
281
|
+
* Returns the prediction error if the ranges don't align on one axis.
|
|
282
|
+
*/
|
|
283
|
+
fill(sheetIdx, src, dst) {
|
|
284
|
+
const inputs = this.getWorksheet(sheetIdx).predictFill(src, dst);
|
|
285
|
+
if (isErrorMessage(inputs))
|
|
286
|
+
return inputs;
|
|
287
|
+
return this.execTransaction({
|
|
288
|
+
payloads: inputs.map((value) => ({ type: 'cellInput', value })),
|
|
289
|
+
undoable: true,
|
|
290
|
+
temp: false,
|
|
291
|
+
});
|
|
292
|
+
}
|
|
265
293
|
getWorksheetById(id) {
|
|
266
294
|
return new Worksheet(this._id, id, false);
|
|
267
295
|
}
|
|
@@ -283,6 +311,42 @@ export class Workbook {
|
|
|
283
311
|
getAllBlockFields() {
|
|
284
312
|
return rpc('getAllBlockFields', undefined, this._id);
|
|
285
313
|
}
|
|
314
|
+
/**
|
|
315
|
+
* Enumerate blocks across the workbook.
|
|
316
|
+
*
|
|
317
|
+
* Scope:
|
|
318
|
+
* - `sheetId` set → only that sheet
|
|
319
|
+
* - `sheetIdx` set → resolve to sheetId, then that sheet
|
|
320
|
+
* - neither set → every sheet
|
|
321
|
+
* `sheetId` wins if both are set.
|
|
322
|
+
*/
|
|
323
|
+
getAllBlocks(params) {
|
|
324
|
+
return rpc('getAllBlocks', {
|
|
325
|
+
sheetIdx: params?.sheetIdx,
|
|
326
|
+
sheetId: params?.sheetId,
|
|
327
|
+
}, this._id);
|
|
328
|
+
}
|
|
329
|
+
// ---- Named checkpoints --------------------------------------------
|
|
330
|
+
//
|
|
331
|
+
// Save / delete / list go through dedicated RPCs (not the
|
|
332
|
+
// transaction pipeline) — they manage session-only checkpoint
|
|
333
|
+
// storage and don't touch sheet state. To restore, send a normal
|
|
334
|
+
// `restoreCheckpoint` payload via handleTransaction; that lands on
|
|
335
|
+
// the undo stack so users can Ctrl-Z to reverse the restore.
|
|
336
|
+
/** Snapshot the current workbook state under `label`. Overwrites
|
|
337
|
+
* any existing checkpoint with the same label. Returns the number
|
|
338
|
+
* of checkpoints currently stored after this save. */
|
|
339
|
+
saveCheckpoint(label, description) {
|
|
340
|
+
return rpc('saveCheckpoint', { label, description }, this._id);
|
|
341
|
+
}
|
|
342
|
+
/** Drop a named checkpoint. Returns `true` if it existed. */
|
|
343
|
+
deleteCheckpoint(label) {
|
|
344
|
+
return rpc('deleteCheckpoint', { label }, this._id);
|
|
345
|
+
}
|
|
346
|
+
/** List all checkpoints (newest first). */
|
|
347
|
+
listCheckpoints() {
|
|
348
|
+
return rpc('listCheckpoints', undefined, this._id);
|
|
349
|
+
}
|
|
286
350
|
_inputAsyncResult(r) {
|
|
287
351
|
return input_async_result(this._id, r);
|
|
288
352
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlockInfo, CellPosition, ColInfo, DisplayWindow, DisplayWindowWithStartPoint, RowInfo, Style, Value, CellInfo, SheetDimension, MergeCell, AppendixWithCell, ReproducibleCell, SheetCoordinate } from '../bindings';
|
|
1
|
+
import { BlockInfo, CellPosition, ColInfo, DisplayWindow, DisplayWindowWithStartPoint, RowInfo, Style, Value, CellInfo, SheetDimension, MergeCell, AppendixWithCell, ReproducibleCell, SheetCoordinate, CellInput } from '../bindings';
|
|
2
2
|
import { Cell } from './cell';
|
|
3
3
|
import { Result } from './utils';
|
|
4
4
|
export declare class Worksheet {
|
|
@@ -11,6 +11,10 @@ export declare class Worksheet {
|
|
|
11
11
|
getNextDownwardVisibleCell(row: number, col: number): CellPosition;
|
|
12
12
|
getNextLeftwardVisibleCell(row: number, col: number): CellPosition;
|
|
13
13
|
getNextRightwardVisibleCell(row: number, col: number): CellPosition;
|
|
14
|
+
getUpwardDataBoundary(row: number, col: number): CellPosition;
|
|
15
|
+
getDownwardDataBoundary(row: number, col: number): CellPosition;
|
|
16
|
+
getLeftwardDataBoundary(row: number, col: number): CellPosition;
|
|
17
|
+
getRightwardDataBoundary(row: number, col: number): CellPosition;
|
|
14
18
|
getDisplayWindowWithCellPosition(row: number, col: number, height: number, width: number): DisplayWindowWithStartPoint;
|
|
15
19
|
getBlockDisplayWindow(blockId: number): Result<DisplayWindow>;
|
|
16
20
|
getRowHeight(rowIdx: number): Result<number>;
|
|
@@ -22,6 +26,27 @@ export declare class Worksheet {
|
|
|
22
26
|
getReproducibleCells(coordinates: readonly SheetCoordinate[]): Result<readonly ReproducibleCell[]>;
|
|
23
27
|
getCellInfos(startRow: number, startCol: number, endRow: number, endCol: number): Result<readonly CellInfo[]>;
|
|
24
28
|
getCellInfosExceptWindow(startRow: number, startCol: number, endRow: number, endCol: number, windowStartRow: number, windowStartCol: number, windowEndRow: number, windowEndCol: number): Result<readonly CellInfo[]>;
|
|
29
|
+
/**
|
|
30
|
+
* Predict the fill-handle result: given a source block and the target
|
|
31
|
+
* block the user dragged over, returns one `CellInput` per target cell
|
|
32
|
+
* (formula relative-reference shift, arithmetic series, or value copy).
|
|
33
|
+
*
|
|
34
|
+
* This is a pure read-only query — it does not mutate the workbook. The
|
|
35
|
+
* caller wraps the returned inputs in a single transaction (see
|
|
36
|
+
* `Workbook.fill`) so the fill is one undo step. `src` and `dst` must
|
|
37
|
+
* align on a single axis (a pure vertical or horizontal drag).
|
|
38
|
+
*/
|
|
39
|
+
predictFill(src: {
|
|
40
|
+
startRow: number;
|
|
41
|
+
startCol: number;
|
|
42
|
+
endRow: number;
|
|
43
|
+
endCol: number;
|
|
44
|
+
}, dst: {
|
|
45
|
+
startRow: number;
|
|
46
|
+
startCol: number;
|
|
47
|
+
endRow: number;
|
|
48
|
+
endCol: number;
|
|
49
|
+
}): Result<readonly CellInput[]>;
|
|
25
50
|
getBlockInfo(blockId: number): BlockInfo;
|
|
26
51
|
getMergedCells(startRow: number, startCol: number, endRow: number, endCol: number): readonly MergeCell[];
|
|
27
52
|
getCell(rowIdx: number, colIdx: number): Result<Cell>;
|
|
@@ -63,6 +63,35 @@ export class Worksheet {
|
|
|
63
63
|
direction: 'right',
|
|
64
64
|
}, this._id);
|
|
65
65
|
}
|
|
66
|
+
// Ctrl+Arrow: jump to the next data/block boundary. Returns an
|
|
67
|
+
// ErrorMessage when there is no boundary ahead (caller shows a hint).
|
|
68
|
+
getUpwardDataBoundary(row, col) {
|
|
69
|
+
return rpc('getDataBoundary', { sheetIdx: this._sheetIdx, rowIdx: row, colIdx: col, direction: 'up' }, this._id);
|
|
70
|
+
}
|
|
71
|
+
getDownwardDataBoundary(row, col) {
|
|
72
|
+
return rpc('getDataBoundary', {
|
|
73
|
+
sheetIdx: this._sheetIdx,
|
|
74
|
+
rowIdx: row,
|
|
75
|
+
colIdx: col,
|
|
76
|
+
direction: 'down',
|
|
77
|
+
}, this._id);
|
|
78
|
+
}
|
|
79
|
+
getLeftwardDataBoundary(row, col) {
|
|
80
|
+
return rpc('getDataBoundary', {
|
|
81
|
+
sheetIdx: this._sheetIdx,
|
|
82
|
+
rowIdx: row,
|
|
83
|
+
colIdx: col,
|
|
84
|
+
direction: 'left',
|
|
85
|
+
}, this._id);
|
|
86
|
+
}
|
|
87
|
+
getRightwardDataBoundary(row, col) {
|
|
88
|
+
return rpc('getDataBoundary', {
|
|
89
|
+
sheetIdx: this._sheetIdx,
|
|
90
|
+
rowIdx: row,
|
|
91
|
+
colIdx: col,
|
|
92
|
+
direction: 'right',
|
|
93
|
+
}, this._id);
|
|
94
|
+
}
|
|
66
95
|
getDisplayWindowWithCellPosition(row, col, height, width) {
|
|
67
96
|
return rpc('getDisplayWindowWithinCell', { sheetIdx: this._sheetIdx, row, col, height, width }, this._id);
|
|
68
97
|
}
|
|
@@ -106,6 +135,29 @@ export class Worksheet {
|
|
|
106
135
|
windowEndCol,
|
|
107
136
|
}, this._id);
|
|
108
137
|
}
|
|
138
|
+
/**
|
|
139
|
+
* Predict the fill-handle result: given a source block and the target
|
|
140
|
+
* block the user dragged over, returns one `CellInput` per target cell
|
|
141
|
+
* (formula relative-reference shift, arithmetic series, or value copy).
|
|
142
|
+
*
|
|
143
|
+
* This is a pure read-only query — it does not mutate the workbook. The
|
|
144
|
+
* caller wraps the returned inputs in a single transaction (see
|
|
145
|
+
* `Workbook.fill`) so the fill is one undo step. `src` and `dst` must
|
|
146
|
+
* align on a single axis (a pure vertical or horizontal drag).
|
|
147
|
+
*/
|
|
148
|
+
predictFill(src, dst) {
|
|
149
|
+
return rpc('predictFill', {
|
|
150
|
+
sheetIdx: this._sheetIdx,
|
|
151
|
+
srcStartRow: src.startRow,
|
|
152
|
+
srcStartCol: src.startCol,
|
|
153
|
+
srcEndRow: src.endRow,
|
|
154
|
+
srcEndCol: src.endCol,
|
|
155
|
+
dstStartRow: dst.startRow,
|
|
156
|
+
dstStartCol: dst.startCol,
|
|
157
|
+
dstEndRow: dst.endRow,
|
|
158
|
+
dstEndCol: dst.endCol,
|
|
159
|
+
}, this._id);
|
|
160
|
+
}
|
|
109
161
|
getBlockInfo(blockId) {
|
|
110
162
|
return rpc('getBlockInfo', { sheetId: this._sheetId, blockId }, this._id);
|
|
111
163
|
}
|
|
@@ -8,6 +8,8 @@ export interface BindFormSchema {
|
|
|
8
8
|
renderIds: readonly string[];
|
|
9
9
|
row: boolean;
|
|
10
10
|
fieldFormulas: readonly string[];
|
|
11
|
+
validationFormulas: readonly string[];
|
|
12
|
+
editabilityFormulas: readonly string[];
|
|
11
13
|
}
|
|
12
14
|
export declare class BindFormSchemaBuilder {
|
|
13
15
|
private _refName;
|
|
@@ -19,6 +21,8 @@ export declare class BindFormSchemaBuilder {
|
|
|
19
21
|
private _renderIds;
|
|
20
22
|
private _row;
|
|
21
23
|
private _fieldFormulas;
|
|
24
|
+
private _validationFormulas;
|
|
25
|
+
private _editabilityFormulas;
|
|
22
26
|
refName(value: string): this;
|
|
23
27
|
sheetIdx(value: number): this;
|
|
24
28
|
blockId(value: number): this;
|
|
@@ -28,6 +32,8 @@ export declare class BindFormSchemaBuilder {
|
|
|
28
32
|
renderIds(value: readonly string[]): this;
|
|
29
33
|
row(value: boolean): this;
|
|
30
34
|
fieldFormulas(value: readonly string[]): this;
|
|
35
|
+
validationFormulas(value: readonly string[]): this;
|
|
36
|
+
editabilityFormulas(value: readonly string[]): this;
|
|
31
37
|
build(): {
|
|
32
38
|
refName: string;
|
|
33
39
|
sheetIdx: number;
|
|
@@ -38,5 +44,7 @@ export declare class BindFormSchemaBuilder {
|
|
|
38
44
|
renderIds: readonly string[];
|
|
39
45
|
row: boolean;
|
|
40
46
|
fieldFormulas: readonly string[];
|
|
47
|
+
validationFormulas: readonly string[];
|
|
48
|
+
editabilityFormulas: readonly string[];
|
|
41
49
|
};
|
|
42
50
|
}
|
|
@@ -8,6 +8,8 @@ export class BindFormSchemaBuilder {
|
|
|
8
8
|
_renderIds;
|
|
9
9
|
_row;
|
|
10
10
|
_fieldFormulas;
|
|
11
|
+
_validationFormulas;
|
|
12
|
+
_editabilityFormulas;
|
|
11
13
|
refName(value) {
|
|
12
14
|
this._refName = value;
|
|
13
15
|
return this;
|
|
@@ -44,6 +46,14 @@ export class BindFormSchemaBuilder {
|
|
|
44
46
|
this._fieldFormulas = value;
|
|
45
47
|
return this;
|
|
46
48
|
}
|
|
49
|
+
validationFormulas(value) {
|
|
50
|
+
this._validationFormulas = value;
|
|
51
|
+
return this;
|
|
52
|
+
}
|
|
53
|
+
editabilityFormulas(value) {
|
|
54
|
+
this._editabilityFormulas = value;
|
|
55
|
+
return this;
|
|
56
|
+
}
|
|
47
57
|
build() {
|
|
48
58
|
if (this._refName === undefined)
|
|
49
59
|
throw new Error('missing refName');
|
|
@@ -63,6 +73,10 @@ export class BindFormSchemaBuilder {
|
|
|
63
73
|
throw new Error('missing row');
|
|
64
74
|
if (this._fieldFormulas === undefined)
|
|
65
75
|
throw new Error('missing fieldFormulas');
|
|
66
|
-
|
|
76
|
+
if (this._validationFormulas === undefined)
|
|
77
|
+
throw new Error('missing validationFormulas');
|
|
78
|
+
if (this._editabilityFormulas === undefined)
|
|
79
|
+
throw new Error('missing editabilityFormulas');
|
|
80
|
+
return { refName: this._refName, sheetIdx: this._sheetIdx, blockId: this._blockId, fieldFrom: this._fieldFrom, keyIdx: this._keyIdx, fields: this._fields, renderIds: this._renderIds, row: this._row, fieldFormulas: this._fieldFormulas, validationFormulas: this._validationFormulas, editabilityFormulas: this._editabilityFormulas };
|
|
67
81
|
}
|
|
68
82
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -38,6 +38,7 @@ import { RemoveDiyCellById } from './remove_diy_cell_by_id';
|
|
|
38
38
|
import { ReorderBlockLines } from './reorder_block_lines';
|
|
39
39
|
import { ReproduceCells } from './reproduce_cells';
|
|
40
40
|
import { ResizeBlock } from './resize_block';
|
|
41
|
+
import { RestoreCheckpoint } from './restore_checkpoint';
|
|
41
42
|
import { SetColWidth } from './set_col_width';
|
|
42
43
|
import { SetRowHeight } from './set_row_height';
|
|
43
44
|
import { SetSheetColor } from './set_sheet_color';
|
|
@@ -194,4 +195,7 @@ export type EditPayload = {
|
|
|
194
195
|
} | {
|
|
195
196
|
type: 'reproduceCells';
|
|
196
197
|
value: ReproduceCells;
|
|
198
|
+
} | {
|
|
199
|
+
type: 'restoreCheckpoint';
|
|
200
|
+
value: RestoreCheckpoint;
|
|
197
201
|
};
|
|
@@ -8,6 +8,7 @@ export * from './bind_form_schema';
|
|
|
8
8
|
export * from './bind_random_schema';
|
|
9
9
|
export * from './block_cell_id';
|
|
10
10
|
export * from './block_cell_info';
|
|
11
|
+
export * from './block_data_row';
|
|
11
12
|
export * from './block_display_info';
|
|
12
13
|
export * from './block_field';
|
|
13
14
|
export * from './block_info';
|
|
@@ -34,6 +35,7 @@ export * from './cell_position';
|
|
|
34
35
|
export * from './cell_protection';
|
|
35
36
|
export * from './cell_ref';
|
|
36
37
|
export * from './cell_style_update';
|
|
38
|
+
export * from './checkpoint_meta';
|
|
37
39
|
export * from './col_info';
|
|
38
40
|
export * from './color';
|
|
39
41
|
export * from './comment';
|
|
@@ -109,12 +111,16 @@ export * from './reorder_block_lines';
|
|
|
109
111
|
export * from './reproduce_cells';
|
|
110
112
|
export * from './reproducible_cell';
|
|
111
113
|
export * from './resize_block';
|
|
114
|
+
export * from './restore_checkpoint';
|
|
112
115
|
export * from './row_info';
|
|
113
116
|
export * from './rpc_batch_get_cell_coordinate_with_sheet_by_id_params';
|
|
114
117
|
export * from './rpc_batch_get_cell_info_by_id_params';
|
|
115
118
|
export * from './rpc_calc_condition_params';
|
|
116
119
|
export * from './rpc_check_formula_params';
|
|
120
|
+
export * from './rpc_delete_checkpoint_params';
|
|
117
121
|
export * from './rpc_direction';
|
|
122
|
+
export * from './rpc_export_block_data_params';
|
|
123
|
+
export * from './rpc_get_all_blocks_params';
|
|
118
124
|
export * from './rpc_get_available_block_id_params';
|
|
119
125
|
export * from './rpc_get_block_col_id_params';
|
|
120
126
|
export * from './rpc_get_block_display_window_params';
|
|
@@ -129,6 +135,7 @@ export * from './rpc_get_cell_position_params';
|
|
|
129
135
|
export * from './rpc_get_cells_except_window_params';
|
|
130
136
|
export * from './rpc_get_cells_params';
|
|
131
137
|
export * from './rpc_get_col_width_params';
|
|
138
|
+
export * from './rpc_get_data_boundary_params';
|
|
132
139
|
export * from './rpc_get_display_units_of_formula_params';
|
|
133
140
|
export * from './rpc_get_display_window_params';
|
|
134
141
|
export * from './rpc_get_display_window_within_cell_params';
|
|
@@ -149,6 +156,8 @@ export * from './rpc_get_sheet_name_by_idx_params';
|
|
|
149
156
|
export * from './rpc_handle_transaction_params';
|
|
150
157
|
export * from './rpc_load_workbook_params';
|
|
151
158
|
export * from './rpc_lookup_appendix_upward_params';
|
|
159
|
+
export * from './rpc_predict_fill_params';
|
|
160
|
+
export * from './rpc_save_checkpoint_params';
|
|
152
161
|
export * from './rpc_save_params';
|
|
153
162
|
export * from './rpc_toggle_status_params';
|
|
154
163
|
export * from './rpc_transaction';
|
|
@@ -9,6 +9,7 @@ export * from './bind_form_schema';
|
|
|
9
9
|
export * from './bind_random_schema';
|
|
10
10
|
export * from './block_cell_id';
|
|
11
11
|
export * from './block_cell_info';
|
|
12
|
+
export * from './block_data_row';
|
|
12
13
|
export * from './block_display_info';
|
|
13
14
|
export * from './block_field';
|
|
14
15
|
export * from './block_info';
|
|
@@ -35,6 +36,7 @@ export * from './cell_position';
|
|
|
35
36
|
export * from './cell_protection';
|
|
36
37
|
export * from './cell_ref';
|
|
37
38
|
export * from './cell_style_update';
|
|
39
|
+
export * from './checkpoint_meta';
|
|
38
40
|
export * from './col_info';
|
|
39
41
|
export * from './color';
|
|
40
42
|
export * from './comment';
|
|
@@ -110,12 +112,16 @@ export * from './reorder_block_lines';
|
|
|
110
112
|
export * from './reproduce_cells';
|
|
111
113
|
export * from './reproducible_cell';
|
|
112
114
|
export * from './resize_block';
|
|
115
|
+
export * from './restore_checkpoint';
|
|
113
116
|
export * from './row_info';
|
|
114
117
|
export * from './rpc_batch_get_cell_coordinate_with_sheet_by_id_params';
|
|
115
118
|
export * from './rpc_batch_get_cell_info_by_id_params';
|
|
116
119
|
export * from './rpc_calc_condition_params';
|
|
117
120
|
export * from './rpc_check_formula_params';
|
|
121
|
+
export * from './rpc_delete_checkpoint_params';
|
|
118
122
|
export * from './rpc_direction';
|
|
123
|
+
export * from './rpc_export_block_data_params';
|
|
124
|
+
export * from './rpc_get_all_blocks_params';
|
|
119
125
|
export * from './rpc_get_available_block_id_params';
|
|
120
126
|
export * from './rpc_get_block_col_id_params';
|
|
121
127
|
export * from './rpc_get_block_display_window_params';
|
|
@@ -130,6 +136,7 @@ export * from './rpc_get_cell_position_params';
|
|
|
130
136
|
export * from './rpc_get_cells_except_window_params';
|
|
131
137
|
export * from './rpc_get_cells_params';
|
|
132
138
|
export * from './rpc_get_col_width_params';
|
|
139
|
+
export * from './rpc_get_data_boundary_params';
|
|
133
140
|
export * from './rpc_get_display_units_of_formula_params';
|
|
134
141
|
export * from './rpc_get_display_window_params';
|
|
135
142
|
export * from './rpc_get_display_window_within_cell_params';
|
|
@@ -150,6 +157,8 @@ export * from './rpc_get_sheet_name_by_idx_params';
|
|
|
150
157
|
export * from './rpc_handle_transaction_params';
|
|
151
158
|
export * from './rpc_load_workbook_params';
|
|
152
159
|
export * from './rpc_lookup_appendix_upward_params';
|
|
160
|
+
export * from './rpc_predict_fill_params';
|
|
161
|
+
export * from './rpc_save_checkpoint_params';
|
|
153
162
|
export * from './rpc_save_params';
|
|
154
163
|
export * from './rpc_toggle_status_params';
|
|
155
164
|
export * from './rpc_transaction';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,17 +3,23 @@ import { AppData } from './app_data';
|
|
|
3
3
|
import { AppendixWithCell } from './appendix_with_cell';
|
|
4
4
|
import { BatchGetCellCoordinateWithSheetByIdParams } from './rpc_batch_get_cell_coordinate_with_sheet_by_id_params';
|
|
5
5
|
import { BatchGetCellInfoByIdParams } from './rpc_batch_get_cell_info_by_id_params';
|
|
6
|
+
import { BlockDataRow } from './block_data_row';
|
|
6
7
|
import { BlockField } from './block_field';
|
|
7
8
|
import { BlockInfo } from './block_info';
|
|
8
9
|
import { CalcConditionParams } from './rpc_calc_condition_params';
|
|
9
10
|
import { CellCoordinateWithSheet } from './cell_coordinate_with_sheet';
|
|
10
11
|
import { CellInfo } from './cell_info';
|
|
12
|
+
import { CellInput } from './cell_input';
|
|
11
13
|
import { CellPosition } from './cell_position';
|
|
12
14
|
import { CheckFormulaParams } from './rpc_check_formula_params';
|
|
15
|
+
import { CheckpointMetaDto } from './checkpoint_meta';
|
|
16
|
+
import { DeleteCheckpointParams } from './rpc_delete_checkpoint_params';
|
|
13
17
|
import { DisplayWindow } from './display_window';
|
|
14
18
|
import { DisplayWindowWithStartPoint } from './display_window_with_start_point';
|
|
15
19
|
import { ErrorMessage } from './error_message';
|
|
20
|
+
import { ExportBlockDataParams } from './rpc_export_block_data_params';
|
|
16
21
|
import { FormulaDisplayInfo } from './formula_display_info';
|
|
22
|
+
import { GetAllBlocksParams } from './rpc_get_all_blocks_params';
|
|
17
23
|
import { GetAvailableBlockIdParams } from './rpc_get_available_block_id_params';
|
|
18
24
|
import { GetBlockColIdParams } from './rpc_get_block_col_id_params';
|
|
19
25
|
import { GetBlockDisplayWindowParams } from './rpc_get_block_display_window_params';
|
|
@@ -28,6 +34,7 @@ import { GetCellPositionParams } from './rpc_get_cell_position_params';
|
|
|
28
34
|
import { GetCellsExceptWindowParams } from './rpc_get_cells_except_window_params';
|
|
29
35
|
import { GetCellsParams } from './rpc_get_cells_params';
|
|
30
36
|
import { GetColWidthParams } from './rpc_get_col_width_params';
|
|
37
|
+
import { GetDataBoundaryParams } from './rpc_get_data_boundary_params';
|
|
31
38
|
import { GetDisplayUnitsOfFormulaParams } from './rpc_get_display_units_of_formula_params';
|
|
32
39
|
import { GetDisplayWindowParams } from './rpc_get_display_window_params';
|
|
33
40
|
import { GetDisplayWindowWithinCellParams } from './rpc_get_display_window_within_cell_params';
|
|
@@ -49,8 +56,10 @@ import { HandleTransactionParams } from './rpc_handle_transaction_params';
|
|
|
49
56
|
import { LoadWorkbookParams } from './rpc_load_workbook_params';
|
|
50
57
|
import { LookupAppendixUpwardParams } from './rpc_lookup_appendix_upward_params';
|
|
51
58
|
import { MergeCell } from './merge_cell';
|
|
59
|
+
import { PredictFillParams } from './rpc_predict_fill_params';
|
|
52
60
|
import { ReproducibleCell } from './reproducible_cell';
|
|
53
61
|
import { RowInfo } from './row_info';
|
|
62
|
+
import { SaveCheckpointParams } from './rpc_save_checkpoint_params';
|
|
54
63
|
import { SaveFileResult } from './save_file_result';
|
|
55
64
|
import { SaveParams } from './rpc_save_params';
|
|
56
65
|
import { ShadowCellInfo } from './shadow_cell_info';
|
|
@@ -78,11 +87,13 @@ export interface WorkbookMethods {
|
|
|
78
87
|
getFormula(params: GetCellParams, bookId?: number): Promise<string | ErrorMessage>;
|
|
79
88
|
getStyle(params: GetCellParams, bookId?: number): Promise<Style | ErrorMessage>;
|
|
80
89
|
getCellsExceptWindow(params: GetCellsExceptWindowParams, bookId?: number): Promise<readonly CellInfo[] | ErrorMessage>;
|
|
90
|
+
predictFill(params: PredictFillParams, bookId?: number): Promise<readonly CellInput[] | ErrorMessage>;
|
|
81
91
|
getCellPosition(params: GetCellPositionParams, bookId?: number): Promise<CellPosition | ErrorMessage>;
|
|
82
92
|
getCellId(params: GetCellIdParams, bookId?: number): Promise<SheetCellId | ErrorMessage>;
|
|
83
93
|
getReproducibleCell(params: GetReproducibleCellParams, bookId?: number): Promise<ReproducibleCell | ErrorMessage>;
|
|
84
94
|
getReproducibleCells(params: GetReproducibleCellsParams, bookId?: number): Promise<readonly ReproducibleCell[] | ErrorMessage>;
|
|
85
95
|
getNextVisibleCell(params: GetNextVisibleCellParams, bookId?: number): Promise<CellPosition | ErrorMessage>;
|
|
96
|
+
getDataBoundary(params: GetDataBoundaryParams, bookId?: number): Promise<CellPosition | ErrorMessage>;
|
|
86
97
|
batchGetCellInfoById(params: BatchGetCellInfoByIdParams, bookId?: number): Promise<readonly CellInfo[] | ErrorMessage>;
|
|
87
98
|
batchGetCellCoordinateWithSheetById(params: BatchGetCellCoordinateWithSheetByIdParams, bookId?: number): Promise<readonly CellCoordinateWithSheet[] | ErrorMessage>;
|
|
88
99
|
getBlockInfo(params: GetBlockInfoParams, bookId?: number): Promise<BlockInfo | ErrorMessage>;
|
|
@@ -92,6 +103,10 @@ export interface WorkbookMethods {
|
|
|
92
103
|
getBlockValues(params: GetBlockValuesParams, bookId?: number): Promise<readonly string[] | ErrorMessage>;
|
|
93
104
|
getAvailableBlockId(params: GetAvailableBlockIdParams, bookId?: number): Promise<number | ErrorMessage>;
|
|
94
105
|
getAllBlockFields(bookId?: number): Promise<readonly BlockField[] | ErrorMessage>;
|
|
106
|
+
getAllBlocks(params: GetAllBlocksParams, bookId?: number): Promise<readonly BlockInfo[] | ErrorMessage>;
|
|
107
|
+
saveCheckpoint(params: SaveCheckpointParams, bookId?: number): Promise<number | ErrorMessage>;
|
|
108
|
+
deleteCheckpoint(params: DeleteCheckpointParams, bookId?: number): Promise<boolean | ErrorMessage>;
|
|
109
|
+
listCheckpoints(bookId?: number): Promise<readonly CheckpointMetaDto[] | ErrorMessage>;
|
|
95
110
|
getDiyCellIdWithBlockId(params: GetDiyCellIdWithBlockIdParams, bookId?: number): Promise<number | ErrorMessage>;
|
|
96
111
|
lookupAppendixUpward(params: LookupAppendixUpwardParams, bookId?: number): Promise<AppendixWithCell | ErrorMessage>;
|
|
97
112
|
getMergedCells(params: GetMergedCellsParams, bookId?: number): Promise<readonly MergeCell[] | ErrorMessage>;
|
|
@@ -100,6 +115,7 @@ export interface WorkbookMethods {
|
|
|
100
115
|
getShadowInfoById(params: GetShadowInfoByIdParams, bookId?: number): Promise<ShadowCellInfo | ErrorMessage>;
|
|
101
116
|
undo(bookId?: number): Promise<boolean | ErrorMessage>;
|
|
102
117
|
redo(bookId?: number): Promise<boolean | ErrorMessage>;
|
|
118
|
+
cleanHistory(bookId?: number): Promise<void | ErrorMessage>;
|
|
103
119
|
toggleStatus(params: ToggleStatusParams, bookId?: number): Promise<void | ErrorMessage>;
|
|
104
120
|
cleanupTempStatus(bookId?: number): Promise<void | ErrorMessage>;
|
|
105
121
|
commitTempStatus(bookId?: number): Promise<ActionEffect | ErrorMessage>;
|
|
@@ -109,8 +125,10 @@ export interface WorkbookMethods {
|
|
|
109
125
|
getDisplayUnitsOfFormula(params: GetDisplayUnitsOfFormulaParams, bookId?: number): Promise<FormulaDisplayInfo | ErrorMessage>;
|
|
110
126
|
calcCondition(params: CalcConditionParams, bookId?: number): Promise<boolean | ErrorMessage>;
|
|
111
127
|
getCellIdByBlockRef(params: GetCellIdByBlockRefParams, bookId?: number): Promise<SheetCellId | ErrorMessage>;
|
|
128
|
+
exportBlockData(params: ExportBlockDataParams, bookId?: number): Promise<readonly BlockDataRow[] | ErrorMessage>;
|
|
112
129
|
getTempStatusChanges(bookId?: number): Promise<TempStatusDiff | ErrorMessage>;
|
|
113
130
|
checkFormula(params: CheckFormulaParams, bookId?: number): Promise<boolean | ErrorMessage>;
|
|
114
131
|
getRowInfo(params: GetRowInfoParams, bookId?: number): Promise<RowInfo | ErrorMessage>;
|
|
132
|
+
getAllBlockRefNames(): Promise<readonly string[]>;
|
|
115
133
|
handleTransaction(params: HandleTransactionParams, bookId?: number): Promise<ActionEffect | ErrorMessage>;
|
|
116
134
|
}
|
|
@@ -2,17 +2,25 @@ export interface UpsertFieldFormulas {
|
|
|
2
2
|
sheetIdx: number;
|
|
3
3
|
blockId: number;
|
|
4
4
|
fieldFormulas: readonly string[];
|
|
5
|
+
validationFormulas: readonly string[];
|
|
6
|
+
editabilityFormulas: readonly string[];
|
|
5
7
|
}
|
|
6
8
|
export declare class UpsertFieldFormulasBuilder {
|
|
7
9
|
private _sheetIdx;
|
|
8
10
|
private _blockId;
|
|
9
11
|
private _fieldFormulas;
|
|
12
|
+
private _validationFormulas;
|
|
13
|
+
private _editabilityFormulas;
|
|
10
14
|
sheetIdx(value: number): this;
|
|
11
15
|
blockId(value: number): this;
|
|
12
16
|
fieldFormulas(value: readonly string[]): this;
|
|
17
|
+
validationFormulas(value: readonly string[]): this;
|
|
18
|
+
editabilityFormulas(value: readonly string[]): this;
|
|
13
19
|
build(): {
|
|
14
20
|
sheetIdx: number;
|
|
15
21
|
blockId: number;
|
|
16
22
|
fieldFormulas: readonly string[];
|
|
23
|
+
validationFormulas: readonly string[];
|
|
24
|
+
editabilityFormulas: readonly string[];
|
|
17
25
|
};
|
|
18
26
|
}
|
|
@@ -2,6 +2,8 @@ export class UpsertFieldFormulasBuilder {
|
|
|
2
2
|
_sheetIdx;
|
|
3
3
|
_blockId;
|
|
4
4
|
_fieldFormulas;
|
|
5
|
+
_validationFormulas;
|
|
6
|
+
_editabilityFormulas;
|
|
5
7
|
sheetIdx(value) {
|
|
6
8
|
this._sheetIdx = value;
|
|
7
9
|
return this;
|
|
@@ -14,6 +16,14 @@ export class UpsertFieldFormulasBuilder {
|
|
|
14
16
|
this._fieldFormulas = value;
|
|
15
17
|
return this;
|
|
16
18
|
}
|
|
19
|
+
validationFormulas(value) {
|
|
20
|
+
this._validationFormulas = value;
|
|
21
|
+
return this;
|
|
22
|
+
}
|
|
23
|
+
editabilityFormulas(value) {
|
|
24
|
+
this._editabilityFormulas = value;
|
|
25
|
+
return this;
|
|
26
|
+
}
|
|
17
27
|
build() {
|
|
18
28
|
if (this._sheetIdx === undefined)
|
|
19
29
|
throw new Error('missing sheetIdx');
|
|
@@ -21,6 +31,10 @@ export class UpsertFieldFormulasBuilder {
|
|
|
21
31
|
throw new Error('missing blockId');
|
|
22
32
|
if (this._fieldFormulas === undefined)
|
|
23
33
|
throw new Error('missing fieldFormulas');
|
|
24
|
-
|
|
34
|
+
if (this._validationFormulas === undefined)
|
|
35
|
+
throw new Error('missing validationFormulas');
|
|
36
|
+
if (this._editabilityFormulas === undefined)
|
|
37
|
+
throw new Error('missing editabilityFormulas');
|
|
38
|
+
return { sheetIdx: this._sheetIdx, blockId: this._blockId, fieldFormulas: this._fieldFormulas, validationFormulas: this._validationFormulas, editabilityFormulas: this._editabilityFormulas };
|
|
25
39
|
}
|
|
26
40
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './bindings';
|
|
2
|
+
export * from './payloads';
|
|
3
|
+
export * from './types';
|
|
4
|
+
export * from './utils';
|
|
5
|
+
export * from './layout';
|
|
6
|
+
export { isErrorMessage, getPatternFill } from './api/utils';
|
|
7
|
+
export type { Result } from './api/utils';
|
|
8
|
+
export { CraftCalc, acquireCraftCalc } from './api/craft-calc';
|
|
9
|
+
export type { Client } from './client';
|
package/dist/src/pure.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// WASM-free entry point.
|
|
2
|
+
//
|
|
3
|
+
// The root barrel (`logisheets-web`) re-exports `./api`, which pulls in
|
|
4
|
+
// api/workbook + api/worksheet — and those statically import the web-target
|
|
5
|
+
// WASM module. That makes the root barrel unloadable outside a browser/bundler.
|
|
6
|
+
//
|
|
7
|
+
// `logisheets-web/pure` exposes everything that does NOT touch the WASM:
|
|
8
|
+
// generated bindings (payload builders + types), pure helpers, the craft-calc
|
|
9
|
+
// handle factory, and the Client *type*. Consumers that only need to construct
|
|
10
|
+
// payloads / inspect types / share logic (e.g. logician running on Node) import
|
|
11
|
+
// from here and stay engine-free.
|
|
12
|
+
export * from './bindings';
|
|
13
|
+
export * from './payloads';
|
|
14
|
+
export * from './types';
|
|
15
|
+
export * from './utils';
|
|
16
|
+
export * from './layout';
|
|
17
|
+
// Pure API helpers (no WASM): isErrorMessage, getPatternFill, Result, and the
|
|
18
|
+
// craft-calc handle (acquireCraftCalc / CraftCalc) which only builds payloads.
|
|
19
|
+
export { isErrorMessage, getPatternFill } from './api/utils';
|
|
20
|
+
export { CraftCalc, acquireCraftCalc } from './api/craft-calc';
|
package/dist/src/types.js
CHANGED
|
@@ -3,9 +3,9 @@ export function getFirstCell(v) {
|
|
|
3
3
|
if (r)
|
|
4
4
|
return { y: r.startRow, x: r.startCol };
|
|
5
5
|
const l = getSelectedLines(v);
|
|
6
|
-
if (l
|
|
6
|
+
if (l?.type === 'row')
|
|
7
7
|
return { y: l.start, x: 0 };
|
|
8
|
-
if (l
|
|
8
|
+
if (l?.type === 'col')
|
|
9
9
|
return { y: 0, x: l.start };
|
|
10
10
|
throw Error('should not happend');
|
|
11
11
|
}
|