@gridsheet/preact-core 2.2.0 → 3.0.0-rc.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/types.d.ts CHANGED
@@ -45,10 +45,18 @@ export type FeedbackType = (args: {
45
45
  }) => void;
46
46
  export type ModeType = 'light' | 'dark';
47
47
  export type HeadersType = 'both' | 'vertical' | 'horizontal' | 'none';
48
+ export type AsyncCache = {
49
+ /** Cached result value from the async computation. */
50
+ value: any;
51
+ /** Cache key derived from function name + arguments. Used to detect when inputs change. */
52
+ key: string;
53
+ /** Absolute timestamp (ms since epoch) at which the cache expires. undefined means cache never expires. */
54
+ expireTime?: number;
55
+ };
48
56
  export type System = {
49
57
  id: string;
50
58
  sheetId: number;
51
- changedAt: Date;
59
+ changedTime: number;
52
60
  dependents: Set<string>;
53
61
  /** Cumulative top offset (px) from table origin. Set on row-header cells (x=0). */
54
62
  offsetTop?: number;
@@ -79,7 +87,9 @@ export type CellType<T = any, Custom = any> = {
79
87
  custom?: Custom;
80
88
  disableFormula?: boolean;
81
89
  prevention?: OperationType;
82
- system?: System;
90
+ _sys?: System;
91
+ /** Cached result from an async formula. Stored directly on the cell for serializability. */
92
+ asyncCache?: AsyncCache;
83
93
  /** Filter configuration. Set on col-header cells (y=0). */
84
94
  filter?: FilterConfig;
85
95
  /** Whether this row is hidden by a filter. Set on row-header cells (x=0). */
@@ -184,6 +194,10 @@ export type StoreType = {
184
194
  x: number;
185
195
  position: PositionType;
186
196
  } | null;
197
+ rowMenuState: {
198
+ y: number;
199
+ position: PositionType;
200
+ } | null;
187
201
  };
188
202
  export type Manager<T> = {
189
203
  instance: T;
@@ -235,6 +249,8 @@ export type HistoryUpdateType = {
235
249
  diffAfter: CellsByIdType;
236
250
  partial: boolean;
237
251
  };
252
+ export type MoveRelationKind = 'vacate' | 'overflow' | 'displace' | null;
253
+ export type MoveRelations = [string, string, MoveRelationKind][];
238
254
  export type HistoryMoveType = {
239
255
  operation: 'MOVE';
240
256
  srcSheetId: number;
@@ -244,12 +260,7 @@ export type HistoryMoveType = {
244
260
  redoReflection?: StorePatchType;
245
261
  diffBefore: CellsByIdType;
246
262
  diffAfter: CellsByIdType;
247
- src: AreaType;
248
- dst: AreaType;
249
- matrixFrom: IdMatrix;
250
- matrixTo: IdMatrix;
251
- matrixNew: IdMatrix;
252
- lostRows: MatricesByAddress<Id>;
263
+ moveRelations: MoveRelations;
253
264
  };
254
265
  export type HistoryInsertRowsType = {
255
266
  operation: 'INSERT_ROWS';
@@ -308,10 +319,10 @@ export type HistorySortRowsType = {
308
319
  applyed: boolean;
309
320
  undoReflection?: StorePatchType;
310
321
  redoReflection?: StorePatchType;
311
- /** idMatrix data rows before sort (index 0 = row 1) */
312
- rowsBefore: IdMatrix;
313
- /** idMatrix data rows after sort */
314
- rowsAfter: IdMatrix;
322
+ /** Mapping from original row index to new row index after sort */
323
+ sortedRowMapping: {
324
+ [beforeY: number]: number;
325
+ };
315
326
  };
316
327
  export type HistoryType = HistoryUpdateType | HistoryMoveType | HistoryInsertRowsType | HistoryRemoveRowsType | HistoryInsertColsType | HistoryRemoveColsType | HistorySortRowsType;
317
328
  export type Virtualization = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsheet/preact-core",
3
- "version": "2.2.0",
3
+ "version": "3.0.0-rc.0",
4
4
  "description": "Spreadsheet component for Preact",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",