logisheets 1.0.0 → 1.1.1

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.
Files changed (45) hide show
  1. package/dist/src/api/workbook.d.ts +52 -1
  2. package/dist/src/api/workbook.js +64 -0
  3. package/dist/src/api/worksheet.d.ts +26 -1
  4. package/dist/src/api/worksheet.js +52 -0
  5. package/dist/src/bindings/bind_form_schema.d.ts +8 -0
  6. package/dist/src/bindings/bind_form_schema.js +15 -1
  7. package/dist/src/bindings/block_data_row.d.ts +4 -0
  8. package/dist/src/bindings/block_data_row.js +1 -0
  9. package/dist/src/bindings/block_schema_field_entry.d.ts +3 -0
  10. package/dist/src/bindings/checkpoint_meta.d.ts +4 -0
  11. package/dist/src/bindings/checkpoint_meta.js +1 -0
  12. package/dist/src/bindings/edit_payload.d.ts +4 -0
  13. package/dist/src/bindings/index.d.ts +9 -0
  14. package/dist/src/bindings/index.js +9 -0
  15. package/dist/src/bindings/restore_checkpoint.d.ts +10 -0
  16. package/dist/src/bindings/restore_checkpoint.js +12 -0
  17. package/dist/src/bindings/rpc_delete_checkpoint_params.d.ts +3 -0
  18. package/dist/src/bindings/rpc_delete_checkpoint_params.js +1 -0
  19. package/dist/src/bindings/rpc_export_block_data_params.d.ts +5 -0
  20. package/dist/src/bindings/rpc_export_block_data_params.js +1 -0
  21. package/dist/src/bindings/rpc_get_all_blocks_params.d.ts +4 -0
  22. package/dist/src/bindings/rpc_get_all_blocks_params.js +1 -0
  23. package/dist/src/bindings/rpc_get_data_boundary_params.d.ts +7 -0
  24. package/dist/src/bindings/rpc_get_data_boundary_params.js +1 -0
  25. package/dist/src/bindings/rpc_predict_fill_params.d.ts +11 -0
  26. package/dist/src/bindings/rpc_predict_fill_params.js +1 -0
  27. package/dist/src/bindings/rpc_save_checkpoint_params.d.ts +4 -0
  28. package/dist/src/bindings/rpc_save_checkpoint_params.js +1 -0
  29. package/dist/src/bindings/rpc_workbook_methods.d.ts +18 -0
  30. package/dist/src/bindings/upsert_field_formulas.d.ts +8 -0
  31. package/dist/src/bindings/upsert_field_formulas.js +15 -1
  32. package/dist/src/pure.d.ts +9 -0
  33. package/dist/src/pure.js +20 -0
  34. package/dist/src/types.js +2 -2
  35. package/dist/wasm/logisheets_wasm_server.d.ts +8 -0
  36. package/dist/wasm/logisheets_wasm_server.js +583 -0
  37. package/dist/wasm/logisheets_wasm_server_bg.wasm +0 -0
  38. package/dist/wasm/logisheets_wasm_server_bg.wasm.d.ts +12 -0
  39. package/dist/wasm/package.json +14 -0
  40. package/package.json +2 -2
  41. package/wasm/logisheets_wasm_server.d.ts +8 -0
  42. package/wasm/logisheets_wasm_server.js +583 -0
  43. package/wasm/logisheets_wasm_server_bg.wasm +0 -0
  44. package/wasm/logisheets_wasm_server_bg.wasm.d.ts +12 -0
  45. package/wasm/package.json +14 -0
@@ -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
- return { sheetIdx: this._sheetIdx, blockId: this._blockId, fieldFormulas: this._fieldFormulas };
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';
@@ -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.type === 'row')
6
+ if (l?.type === 'row')
7
7
  return { y: l.start, x: 0 };
8
- if (l.type === 'col')
8
+ if (l?.type === 'col')
9
9
  return { y: 0, x: l.start };
10
10
  throw Error('should not happend');
11
11
  }
@@ -0,0 +1,8 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export function handle(msg: any, book_id?: number | null): any;
4
+ /**
5
+ * Input: AsyncFuncResult
6
+ * Output: ActionAffect
7
+ */
8
+ export function input_async_result(id: number, result: any): any;