@rowsncolumns/rnc-yrs-store 0.13.0-beta.2 → 0.14.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.
- package/dist/rnc_yrs_store.d.ts +17 -63
- package/dist/rnc_yrs_store.js +33 -165
- package/dist/rnc_yrs_store_bg.wasm +0 -0
- package/package.json +1 -1
package/dist/rnc_yrs_store.d.ts
CHANGED
|
@@ -2,19 +2,13 @@
|
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Thin wasm-bindgen shell over
|
|
6
|
-
*
|
|
7
|
-
* JSON strings, so it builds for both wasm and native.
|
|
5
|
+
* Thin wasm-bindgen shell over [`YDocEngine`]. Bytes cross as `Uint8Array` (`Vec<u8>`/`&[u8]`),
|
|
6
|
+
* results as JSON strings — matching `YrsSheetDoc`, so it builds for both wasm and native.
|
|
8
7
|
*/
|
|
9
8
|
export class SpreadsheetEngine {
|
|
10
9
|
free(): void;
|
|
11
10
|
[Symbol.dispose](): void;
|
|
12
11
|
addSheet(sheet_id: number, title: string): void;
|
|
13
|
-
/**
|
|
14
|
-
* Anchor a `GridRange` on `sheet_id`: an opaque string (base64 stable range) that
|
|
15
|
-
* `resolveAnchor` resolves later, on any replica, through any structural edit.
|
|
16
|
-
*/
|
|
17
|
-
anchorRange(sheet_id: number, range_json: string): string;
|
|
18
12
|
applyCommand(json: string): string;
|
|
19
13
|
/**
|
|
20
14
|
* `applyCommand` without write recording, undo history, or a `CommitResult` diff — and with
|
|
@@ -39,10 +33,6 @@ export class SpreadsheetEngine {
|
|
|
39
33
|
* Drop the entire undo/redo history (`SpreadsheetEngineLike.clearHistory`).
|
|
40
34
|
*/
|
|
41
35
|
clearHistory(): void;
|
|
42
|
-
/**
|
|
43
|
-
* JSON array of the sheet's column ids in grid order, as decimal strings.
|
|
44
|
-
*/
|
|
45
|
-
columnIds(sheet_id: number): string;
|
|
46
36
|
/**
|
|
47
37
|
* Fold the style log into a base, keeping the newest `keep_tail` buffers live (see
|
|
48
38
|
* `YrsStore::compact_style_log`). Meant for a host holding the workbook write lease (a server
|
|
@@ -50,12 +40,24 @@ export class SpreadsheetEngine {
|
|
|
50
40
|
* seedRemoved, cells, skipped?}`.
|
|
51
41
|
*/
|
|
52
42
|
compactStyleLog(keep_tail: number): string;
|
|
43
|
+
/**
|
|
44
|
+
* Off-window search: coordinates of every matching cell on `sheet_id` (JSON `SheetCoordinate[]`,
|
|
45
|
+
* row-major). The windowed UI calls this so next/prev can navigate to matches outside the loaded
|
|
46
|
+
* viewport. `ranges_json` = JSON `SheetRange[]` (empty = whole sheet); match-case/whole-word/regex.
|
|
47
|
+
* Distinct fill/font colors + CF icons in one column's body rows — JSON
|
|
48
|
+
* `{cellColors, fontColors, icons}`; the "Filter by color" picker on windowed hosts.
|
|
49
|
+
* Whole-range statistics of one conditional-format rule — JSON
|
|
50
|
+
* `{count,min,max,mean,stdDev,percentiles,ranks}` or `null`. Lets a windowed host resolve CF
|
|
51
|
+
* thresholds (data bars, colour scales, icon sets, top/bottom-N, averages) over the rule's full
|
|
52
|
+
* range instead of the loaded slice.
|
|
53
|
+
*/
|
|
54
|
+
conditionalFormatRuleStats(rule_id: string, request_json: string): string;
|
|
53
55
|
/**
|
|
54
56
|
* Parse CSV text into a row-major grid of cell strings using the fast Rust `csv` reader, returned
|
|
55
57
|
* as JSON `Vec<Vec<String>>`. The host writes the grid into the sheet via a `change-batch` command
|
|
56
58
|
* so the values compute, persist, and collaborate through the normal engine path. Quoting,
|
|
57
59
|
* embedded newlines, and ragged rows are handled by the `csv` crate.
|
|
58
|
-
* RFC 4180 CSV of one sheet's merged view (blocks + hot plane,
|
|
60
|
+
* RFC 4180 CSV of one sheet's merged view (blocks + hot plane, geometry-aware). Formulas
|
|
59
61
|
* export their computed display value, like Excel/Sheets "Save as CSV". One streaming pass
|
|
60
62
|
* over the store — built to run in a Web Worker for million-row sheets.
|
|
61
63
|
* Excel-style Ctrl/Cmd+Arrow target. One of `d_row`/`d_col` is ±1, the other 0; returns
|
|
@@ -118,13 +120,6 @@ export class SpreadsheetEngine {
|
|
|
118
120
|
* (`{"includeNotes":bool,"citationsAsNotes":bool}`, camelCase, fields optional).
|
|
119
121
|
*/
|
|
120
122
|
exportXlsxWithOptions(options_json: string): Uint8Array;
|
|
121
|
-
/**
|
|
122
|
-
* Off-window search: coordinates of every matching cell on `sheet_id` (JSON `SheetCoordinate[]`,
|
|
123
|
-
* row-major). The windowed UI calls this so next/prev can navigate to matches outside the loaded
|
|
124
|
-
* viewport. `ranges_json` = JSON `SheetRange[]` (empty = whole sheet); match-case/whole-word/regex.
|
|
125
|
-
* Distinct fill/font colors + CF icons in one column's body rows — JSON
|
|
126
|
-
* `{cellColors, fontColors, icons}`; the "Filter by color" picker on windowed hosts.
|
|
127
|
-
*/
|
|
128
123
|
filterColors(sheet_id: number, col: number, start_row: number, end_row: number): string;
|
|
129
124
|
findAll(sheet_id: number, ranges_json: string, find: string, match_case: boolean, whole_word: boolean, use_regex: boolean): string;
|
|
130
125
|
/**
|
|
@@ -234,11 +229,6 @@ export class SpreadsheetEngine {
|
|
|
234
229
|
loadFromUpdateQuiet(bytes: Uint8Array): void;
|
|
235
230
|
constructor();
|
|
236
231
|
parseCsv(text: string): string;
|
|
237
|
-
/**
|
|
238
|
-
* JSON `{sheetId, row, col}` (1-based) of an `rncCells` / `rncNotes` key; `undefined` for a
|
|
239
|
-
* malformed key or an orphan (its row or column was deleted).
|
|
240
|
-
*/
|
|
241
|
-
parseStableCellKey(key: string): string | undefined;
|
|
242
232
|
/**
|
|
243
233
|
* PRECEDENTS of a cell as `{cells, ranges}` JSON (`SpreadsheetEngineLike.precedents`).
|
|
244
234
|
*/
|
|
@@ -276,33 +266,11 @@ export class SpreadsheetEngine {
|
|
|
276
266
|
* Register a host (JS) custom-function name (`SpreadsheetEngineLike.registerCustomFunction`).
|
|
277
267
|
*/
|
|
278
268
|
registerCustomFunction(name: string): void;
|
|
279
|
-
/**
|
|
280
|
-
* JSON `{range: GridRange | null, status: "ok" | "gone" | "unknown"}` for an `anchorRange`
|
|
281
|
-
* anchor: `gone` once every row or column of it was deleted, `unknown` while its lines have
|
|
282
|
-
* not arrived on this replica; a malformed anchor is an `Err`.
|
|
283
|
-
*/
|
|
284
|
-
resolveAnchor(anchor: string): string;
|
|
285
|
-
/**
|
|
286
|
-
* JSON array of the sheet's row ids in grid order, as decimal strings.
|
|
287
|
-
*/
|
|
288
|
-
rowIds(sheet_id: number): string;
|
|
289
|
-
/**
|
|
290
|
-
* Create stable-ids (v5) documents with this engine; off by default. On, a document it creates
|
|
291
|
-
* starts as v5 — its first edit or import on a fresh engine, or a loaded document that holds no
|
|
292
|
-
* data yet. A document that holds data is never converted (existing documents stay v3), and a
|
|
293
|
-
* v5 document always runs as v5, whatever the setting. Set it from the asset's chosen version,
|
|
294
|
-
* for everyone who opens the asset. `true` when the call made the open (blank) document v5.
|
|
295
|
-
*/
|
|
296
|
-
setStableIds(enabled: boolean): boolean;
|
|
297
269
|
/**
|
|
298
270
|
* Pin the evaluation timezone for `TODAY()` / `NOW()` as minutes east of UTC (`null` /
|
|
299
271
|
* `undefined` restores the default `Local` clock). Returns `false` for an offset outside ±24h.
|
|
300
272
|
*/
|
|
301
273
|
setTimezoneOffsetMinutes(minutes?: number | null): boolean;
|
|
302
|
-
/**
|
|
303
|
-
* `"v5"` while the document runs on the stable-ids store, else `"v3"`.
|
|
304
|
-
*/
|
|
305
|
-
sheetDataVersion(): string;
|
|
306
274
|
/**
|
|
307
275
|
* Per-sheet 1-based data extents as JSON `[{"sheetId", "maxRow", "maxCol"}]`.
|
|
308
276
|
*/
|
|
@@ -331,11 +299,6 @@ export class SpreadsheetEngine {
|
|
|
331
299
|
* [`YrsStore::shift_log_frontier`]).
|
|
332
300
|
*/
|
|
333
301
|
shiftLogFrontier(): string;
|
|
334
|
-
/**
|
|
335
|
-
* The `rncCells` key (`"{sheetId}:{rowId}:{colId}"`) of 1-based `(row, col)`; `undefined`
|
|
336
|
-
* while the row or column is unnamed (past the sheet's named extent). Never names lines.
|
|
337
|
-
*/
|
|
338
|
-
stableCellKey(sheet_id: number, row: number, col: number): string | undefined;
|
|
339
302
|
stateAsUpdate(): Uint8Array;
|
|
340
303
|
/**
|
|
341
304
|
* JSON `{buffers, baseBuffers, bytes, seedEntries, styledCells}` — the style history a load
|
|
@@ -378,9 +341,7 @@ export class SpreadsheetEngine {
|
|
|
378
341
|
}
|
|
379
342
|
|
|
380
343
|
/**
|
|
381
|
-
* Minimal
|
|
382
|
-
* for the fixture tooling that reads a room the way the engine reads it. It knows the v3 plane
|
|
383
|
-
* only: a v5 document's cells are in `rncCells` (`libs/rnc-yrs-store/docs/v5-document-encoding.md`).
|
|
344
|
+
* Minimal yrs-backed sheet doc exposing the canonical `sheetDataV3` encoding + yjs v1 transport.
|
|
384
345
|
*/
|
|
385
346
|
export class YrsSheetDoc {
|
|
386
347
|
free(): void;
|
|
@@ -416,6 +377,7 @@ export interface InitOutput {
|
|
|
416
377
|
readonly spreadsheetengine_canUndo: (a: number) => number;
|
|
417
378
|
readonly spreadsheetengine_clearHistory: (a: number) => void;
|
|
418
379
|
readonly spreadsheetengine_compactStyleLog: (a: number, b: number) => [number, number];
|
|
380
|
+
readonly spreadsheetengine_conditionalFormatRuleStats: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
419
381
|
readonly spreadsheetengine_dataEdge: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
|
|
420
382
|
readonly spreadsheetengine_dataRegion: (a: number, b: number, c: number, d: number) => [number, number];
|
|
421
383
|
readonly spreadsheetengine_deferredRemoteUpdates: (a: number) => number;
|
|
@@ -456,9 +418,7 @@ export interface InitOutput {
|
|
|
456
418
|
readonly spreadsheetengine_redo: (a: number) => [number, number];
|
|
457
419
|
readonly spreadsheetengine_redoDepth: (a: number) => number;
|
|
458
420
|
readonly spreadsheetengine_registerCustomFunction: (a: number, b: number, c: number) => void;
|
|
459
|
-
readonly spreadsheetengine_setStableIds: (a: number, b: number) => [number, number, number];
|
|
460
421
|
readonly spreadsheetengine_setTimezoneOffsetMinutes: (a: number, b: number) => number;
|
|
461
|
-
readonly spreadsheetengine_sheetDataVersion: (a: number) => [number, number];
|
|
462
422
|
readonly spreadsheetengine_sheetExtents: (a: number) => [number, number];
|
|
463
423
|
readonly spreadsheetengine_sheetIds: (a: number) => [number, number];
|
|
464
424
|
readonly spreadsheetengine_sheetStats: (a: number) => [number, number];
|
|
@@ -476,12 +436,6 @@ export interface InitOutput {
|
|
|
476
436
|
readonly yrssheetdoc_new: () => number;
|
|
477
437
|
readonly yrssheetdoc_setCell: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
478
438
|
readonly spreadsheetengine_stateAsUpdate: (a: number) => [number, number];
|
|
479
|
-
readonly spreadsheetengine_columnIds: (a: number, b: number) => [number, number];
|
|
480
|
-
readonly spreadsheetengine_parseStableCellKey: (a: number, b: number, c: number) => [number, number];
|
|
481
|
-
readonly spreadsheetengine_rowIds: (a: number, b: number) => [number, number];
|
|
482
|
-
readonly spreadsheetengine_stableCellKey: (a: number, b: number, c: number, d: number) => [number, number];
|
|
483
|
-
readonly spreadsheetengine_anchorRange: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
484
|
-
readonly spreadsheetengine_resolveAnchor: (a: number, b: number, c: number) => [number, number, number, number];
|
|
485
439
|
readonly spreadsheetengine_shiftLogFrontier: (a: number) => [number, number];
|
|
486
440
|
readonly spreadsheetengine_transformRange: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
|
|
487
441
|
readonly transformRangeThroughOps: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
package/dist/rnc_yrs_store.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
/* @ts-self-types="./rnc_yrs_store.d.ts" */
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* Thin wasm-bindgen shell over
|
|
5
|
-
*
|
|
6
|
-
* JSON strings, so it builds for both wasm and native.
|
|
4
|
+
* Thin wasm-bindgen shell over [`YDocEngine`]. Bytes cross as `Uint8Array` (`Vec<u8>`/`&[u8]`),
|
|
5
|
+
* results as JSON strings — matching `YrsSheetDoc`, so it builds for both wasm and native.
|
|
7
6
|
*/
|
|
8
7
|
export class SpreadsheetEngine {
|
|
9
8
|
__destroy_into_raw() {
|
|
@@ -25,33 +24,6 @@ export class SpreadsheetEngine {
|
|
|
25
24
|
const len0 = WASM_VECTOR_LEN;
|
|
26
25
|
wasm.spreadsheetengine_addSheet(this.__wbg_ptr, sheet_id, ptr0, len0);
|
|
27
26
|
}
|
|
28
|
-
/**
|
|
29
|
-
* Anchor a `GridRange` on `sheet_id`: an opaque string (base64 stable range) that
|
|
30
|
-
* `resolveAnchor` resolves later, on any replica, through any structural edit.
|
|
31
|
-
* @param {number} sheet_id
|
|
32
|
-
* @param {string} range_json
|
|
33
|
-
* @returns {string}
|
|
34
|
-
*/
|
|
35
|
-
anchorRange(sheet_id, range_json) {
|
|
36
|
-
let deferred3_0;
|
|
37
|
-
let deferred3_1;
|
|
38
|
-
try {
|
|
39
|
-
const ptr0 = passStringToWasm0(range_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
40
|
-
const len0 = WASM_VECTOR_LEN;
|
|
41
|
-
const ret = wasm.spreadsheetengine_anchorRange(this.__wbg_ptr, sheet_id, ptr0, len0);
|
|
42
|
-
var ptr2 = ret[0];
|
|
43
|
-
var len2 = ret[1];
|
|
44
|
-
if (ret[3]) {
|
|
45
|
-
ptr2 = 0; len2 = 0;
|
|
46
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
47
|
-
}
|
|
48
|
-
deferred3_0 = ptr2;
|
|
49
|
-
deferred3_1 = len2;
|
|
50
|
-
return getStringFromWasm0(ptr2, len2);
|
|
51
|
-
} finally {
|
|
52
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
27
|
/**
|
|
56
28
|
* @param {string} json
|
|
57
29
|
* @returns {string}
|
|
@@ -142,15 +114,18 @@ export class SpreadsheetEngine {
|
|
|
142
114
|
wasm.spreadsheetengine_clearHistory(this.__wbg_ptr);
|
|
143
115
|
}
|
|
144
116
|
/**
|
|
145
|
-
*
|
|
146
|
-
*
|
|
117
|
+
* Fold the style log into a base, keeping the newest `keep_tail` buffers live (see
|
|
118
|
+
* `YrsStore::compact_style_log`). Meant for a host holding the workbook write lease (a server
|
|
119
|
+
* or warm room), not for every browser. JSON `{before, after, folded, keptTail, baseBuffers,
|
|
120
|
+
* seedRemoved, cells, skipped?}`.
|
|
121
|
+
* @param {number} keep_tail
|
|
147
122
|
* @returns {string}
|
|
148
123
|
*/
|
|
149
|
-
|
|
124
|
+
compactStyleLog(keep_tail) {
|
|
150
125
|
let deferred1_0;
|
|
151
126
|
let deferred1_1;
|
|
152
127
|
try {
|
|
153
|
-
const ret = wasm.
|
|
128
|
+
const ret = wasm.spreadsheetengine_compactStyleLog(this.__wbg_ptr, keep_tail);
|
|
154
129
|
deferred1_0 = ret[0];
|
|
155
130
|
deferred1_1 = ret[1];
|
|
156
131
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
@@ -159,23 +134,33 @@ export class SpreadsheetEngine {
|
|
|
159
134
|
}
|
|
160
135
|
}
|
|
161
136
|
/**
|
|
162
|
-
*
|
|
163
|
-
*
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
137
|
+
* Off-window search: coordinates of every matching cell on `sheet_id` (JSON `SheetCoordinate[]`,
|
|
138
|
+
* row-major). The windowed UI calls this so next/prev can navigate to matches outside the loaded
|
|
139
|
+
* viewport. `ranges_json` = JSON `SheetRange[]` (empty = whole sheet); match-case/whole-word/regex.
|
|
140
|
+
* Distinct fill/font colors + CF icons in one column's body rows — JSON
|
|
141
|
+
* `{cellColors, fontColors, icons}`; the "Filter by color" picker on windowed hosts.
|
|
142
|
+
* Whole-range statistics of one conditional-format rule — JSON
|
|
143
|
+
* `{count,min,max,mean,stdDev,percentiles,ranks}` or `null`. Lets a windowed host resolve CF
|
|
144
|
+
* thresholds (data bars, colour scales, icon sets, top/bottom-N, averages) over the rule's full
|
|
145
|
+
* range instead of the loaded slice.
|
|
146
|
+
* @param {string} rule_id
|
|
147
|
+
* @param {string} request_json
|
|
167
148
|
* @returns {string}
|
|
168
149
|
*/
|
|
169
|
-
|
|
170
|
-
let
|
|
171
|
-
let
|
|
150
|
+
conditionalFormatRuleStats(rule_id, request_json) {
|
|
151
|
+
let deferred3_0;
|
|
152
|
+
let deferred3_1;
|
|
172
153
|
try {
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
|
|
154
|
+
const ptr0 = passStringToWasm0(rule_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
155
|
+
const len0 = WASM_VECTOR_LEN;
|
|
156
|
+
const ptr1 = passStringToWasm0(request_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
157
|
+
const len1 = WASM_VECTOR_LEN;
|
|
158
|
+
const ret = wasm.spreadsheetengine_conditionalFormatRuleStats(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
159
|
+
deferred3_0 = ret[0];
|
|
160
|
+
deferred3_1 = ret[1];
|
|
176
161
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
177
162
|
} finally {
|
|
178
|
-
wasm.__wbindgen_free(
|
|
163
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
179
164
|
}
|
|
180
165
|
}
|
|
181
166
|
/**
|
|
@@ -183,7 +168,7 @@ export class SpreadsheetEngine {
|
|
|
183
168
|
* as JSON `Vec<Vec<String>>`. The host writes the grid into the sheet via a `change-batch` command
|
|
184
169
|
* so the values compute, persist, and collaborate through the normal engine path. Quoting,
|
|
185
170
|
* embedded newlines, and ragged rows are handled by the `csv` crate.
|
|
186
|
-
* RFC 4180 CSV of one sheet's merged view (blocks + hot plane,
|
|
171
|
+
* RFC 4180 CSV of one sheet's merged view (blocks + hot plane, geometry-aware). Formulas
|
|
187
172
|
* export their computed display value, like Excel/Sheets "Save as CSV". One streaming pass
|
|
188
173
|
* over the store — built to run in a Web Worker for million-row sheets.
|
|
189
174
|
* Excel-style Ctrl/Cmd+Arrow target. One of `d_row`/`d_col` is ±1, the other 0; returns
|
|
@@ -381,11 +366,6 @@ export class SpreadsheetEngine {
|
|
|
381
366
|
return v2;
|
|
382
367
|
}
|
|
383
368
|
/**
|
|
384
|
-
* Off-window search: coordinates of every matching cell on `sheet_id` (JSON `SheetCoordinate[]`,
|
|
385
|
-
* row-major). The windowed UI calls this so next/prev can navigate to matches outside the loaded
|
|
386
|
-
* viewport. `ranges_json` = JSON `SheetRange[]` (empty = whole sheet); match-case/whole-word/regex.
|
|
387
|
-
* Distinct fill/font colors + CF icons in one column's body rows — JSON
|
|
388
|
-
* `{cellColors, fontColors, icons}`; the "Filter by color" picker on windowed hosts.
|
|
389
369
|
* @param {number} sheet_id
|
|
390
370
|
* @param {number} col
|
|
391
371
|
* @param {number} start_row
|
|
@@ -806,23 +786,6 @@ export class SpreadsheetEngine {
|
|
|
806
786
|
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
807
787
|
}
|
|
808
788
|
}
|
|
809
|
-
/**
|
|
810
|
-
* JSON `{sheetId, row, col}` (1-based) of an `rncCells` / `rncNotes` key; `undefined` for a
|
|
811
|
-
* malformed key or an orphan (its row or column was deleted).
|
|
812
|
-
* @param {string} key
|
|
813
|
-
* @returns {string | undefined}
|
|
814
|
-
*/
|
|
815
|
-
parseStableCellKey(key) {
|
|
816
|
-
const ptr0 = passStringToWasm0(key, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
817
|
-
const len0 = WASM_VECTOR_LEN;
|
|
818
|
-
const ret = wasm.spreadsheetengine_parseStableCellKey(this.__wbg_ptr, ptr0, len0);
|
|
819
|
-
let v2;
|
|
820
|
-
if (ret[0] !== 0) {
|
|
821
|
-
v2 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
822
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
823
|
-
}
|
|
824
|
-
return v2;
|
|
825
|
-
}
|
|
826
789
|
/**
|
|
827
790
|
* PRECEDENTS of a cell as `{cells, ranges}` JSON (`SpreadsheetEngineLike.precedents`).
|
|
828
791
|
* @param {number} sheet_id
|
|
@@ -959,66 +922,6 @@ export class SpreadsheetEngine {
|
|
|
959
922
|
const len0 = WASM_VECTOR_LEN;
|
|
960
923
|
wasm.spreadsheetengine_registerCustomFunction(this.__wbg_ptr, ptr0, len0);
|
|
961
924
|
}
|
|
962
|
-
/**
|
|
963
|
-
* JSON `{range: GridRange | null, status: "ok" | "gone" | "unknown"}` for an `anchorRange`
|
|
964
|
-
* anchor: `gone` once every row or column of it was deleted, `unknown` while its lines have
|
|
965
|
-
* not arrived on this replica; a malformed anchor is an `Err`.
|
|
966
|
-
* @param {string} anchor
|
|
967
|
-
* @returns {string}
|
|
968
|
-
*/
|
|
969
|
-
resolveAnchor(anchor) {
|
|
970
|
-
let deferred3_0;
|
|
971
|
-
let deferred3_1;
|
|
972
|
-
try {
|
|
973
|
-
const ptr0 = passStringToWasm0(anchor, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
974
|
-
const len0 = WASM_VECTOR_LEN;
|
|
975
|
-
const ret = wasm.spreadsheetengine_resolveAnchor(this.__wbg_ptr, ptr0, len0);
|
|
976
|
-
var ptr2 = ret[0];
|
|
977
|
-
var len2 = ret[1];
|
|
978
|
-
if (ret[3]) {
|
|
979
|
-
ptr2 = 0; len2 = 0;
|
|
980
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
981
|
-
}
|
|
982
|
-
deferred3_0 = ptr2;
|
|
983
|
-
deferred3_1 = len2;
|
|
984
|
-
return getStringFromWasm0(ptr2, len2);
|
|
985
|
-
} finally {
|
|
986
|
-
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
987
|
-
}
|
|
988
|
-
}
|
|
989
|
-
/**
|
|
990
|
-
* JSON array of the sheet's row ids in grid order, as decimal strings.
|
|
991
|
-
* @param {number} sheet_id
|
|
992
|
-
* @returns {string}
|
|
993
|
-
*/
|
|
994
|
-
rowIds(sheet_id) {
|
|
995
|
-
let deferred1_0;
|
|
996
|
-
let deferred1_1;
|
|
997
|
-
try {
|
|
998
|
-
const ret = wasm.spreadsheetengine_rowIds(this.__wbg_ptr, sheet_id);
|
|
999
|
-
deferred1_0 = ret[0];
|
|
1000
|
-
deferred1_1 = ret[1];
|
|
1001
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
1002
|
-
} finally {
|
|
1003
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
1006
|
-
/**
|
|
1007
|
-
* Create stable-ids (v5) documents with this engine; off by default. On, a document it creates
|
|
1008
|
-
* starts as v5 — its first edit or import on a fresh engine, or a loaded document that holds no
|
|
1009
|
-
* data yet. A document that holds data is never converted (existing documents stay v3), and a
|
|
1010
|
-
* v5 document always runs as v5, whatever the setting. Set it from the asset's chosen version,
|
|
1011
|
-
* for everyone who opens the asset. `true` when the call made the open (blank) document v5.
|
|
1012
|
-
* @param {boolean} enabled
|
|
1013
|
-
* @returns {boolean}
|
|
1014
|
-
*/
|
|
1015
|
-
setStableIds(enabled) {
|
|
1016
|
-
const ret = wasm.spreadsheetengine_setStableIds(this.__wbg_ptr, enabled);
|
|
1017
|
-
if (ret[2]) {
|
|
1018
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
1019
|
-
}
|
|
1020
|
-
return ret[0] !== 0;
|
|
1021
|
-
}
|
|
1022
925
|
/**
|
|
1023
926
|
* Pin the evaluation timezone for `TODAY()` / `NOW()` as minutes east of UTC (`null` /
|
|
1024
927
|
* `undefined` restores the default `Local` clock). Returns `false` for an offset outside ±24h.
|
|
@@ -1029,22 +932,6 @@ export class SpreadsheetEngine {
|
|
|
1029
932
|
const ret = wasm.spreadsheetengine_setTimezoneOffsetMinutes(this.__wbg_ptr, isLikeNone(minutes) ? Number.MAX_SAFE_INTEGER : (minutes) >> 0);
|
|
1030
933
|
return ret !== 0;
|
|
1031
934
|
}
|
|
1032
|
-
/**
|
|
1033
|
-
* `"v5"` while the document runs on the stable-ids store, else `"v3"`.
|
|
1034
|
-
* @returns {string}
|
|
1035
|
-
*/
|
|
1036
|
-
sheetDataVersion() {
|
|
1037
|
-
let deferred1_0;
|
|
1038
|
-
let deferred1_1;
|
|
1039
|
-
try {
|
|
1040
|
-
const ret = wasm.spreadsheetengine_sheetDataVersion(this.__wbg_ptr);
|
|
1041
|
-
deferred1_0 = ret[0];
|
|
1042
|
-
deferred1_1 = ret[1];
|
|
1043
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
1044
|
-
} finally {
|
|
1045
|
-
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1046
|
-
}
|
|
1047
|
-
}
|
|
1048
935
|
/**
|
|
1049
936
|
* Per-sheet 1-based data extents as JSON `[{"sheetId", "maxRow", "maxCol"}]`.
|
|
1050
937
|
* @returns {string}
|
|
@@ -1127,23 +1014,6 @@ export class SpreadsheetEngine {
|
|
|
1127
1014
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
1128
1015
|
}
|
|
1129
1016
|
}
|
|
1130
|
-
/**
|
|
1131
|
-
* The `rncCells` key (`"{sheetId}:{rowId}:{colId}"`) of 1-based `(row, col)`; `undefined`
|
|
1132
|
-
* while the row or column is unnamed (past the sheet's named extent). Never names lines.
|
|
1133
|
-
* @param {number} sheet_id
|
|
1134
|
-
* @param {number} row
|
|
1135
|
-
* @param {number} col
|
|
1136
|
-
* @returns {string | undefined}
|
|
1137
|
-
*/
|
|
1138
|
-
stableCellKey(sheet_id, row, col) {
|
|
1139
|
-
const ret = wasm.spreadsheetengine_stableCellKey(this.__wbg_ptr, sheet_id, row, col);
|
|
1140
|
-
let v1;
|
|
1141
|
-
if (ret[0] !== 0) {
|
|
1142
|
-
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
1143
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1144
|
-
}
|
|
1145
|
-
return v1;
|
|
1146
|
-
}
|
|
1147
1017
|
/**
|
|
1148
1018
|
* @returns {Uint8Array}
|
|
1149
1019
|
*/
|
|
@@ -1298,9 +1168,7 @@ export class SpreadsheetEngine {
|
|
|
1298
1168
|
if (Symbol.dispose) SpreadsheetEngine.prototype[Symbol.dispose] = SpreadsheetEngine.prototype.free;
|
|
1299
1169
|
|
|
1300
1170
|
/**
|
|
1301
|
-
* Minimal
|
|
1302
|
-
* for the fixture tooling that reads a room the way the engine reads it. It knows the v3 plane
|
|
1303
|
-
* only: a v5 document's cells are in `rncCells` (`libs/rnc-yrs-store/docs/v5-document-encoding.md`).
|
|
1171
|
+
* Minimal yrs-backed sheet doc exposing the canonical `sheetDataV3` encoding + yjs v1 transport.
|
|
1304
1172
|
*/
|
|
1305
1173
|
export class YrsSheetDoc {
|
|
1306
1174
|
__destroy_into_raw() {
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rowsncolumns/rnc-yrs-store",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"author": "Vinay M",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"description": "Document-backed Rust→WASM spreadsheet calc engine (yrs/CRDT, canonical sheetDataV3). Ships the `SpreadsheetEngine` (a `Store<YrsStore>`): applyCommand / undo / redo / canUndo + the Yjs collaboration surface (applyUpdate / takePendingUpdates / loadFromUpdate / stateAsUpdate) the Keryx update-pump binds to. This is the 1,000,000-row engine the demo-app ships today — previously vendored, now a versioned package. The PREBUILT wasm is included (consumers need NO Rust/wasm toolchain); the glue's default init REQUIRES an explicit `module_or_path` — pass the URL of the served `rnc_yrs_store_bg.wasm` (webpack/Turbopack statically resolve a bundled `new URL`, which would 404 from this package, so the inline-default branch is intentionally a throw).",
|