@rowsncolumns/rnc-yrs-store 0.10.19 → 0.11.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/rnc_yrs_store.d.ts +25 -0
- package/dist/rnc_yrs_store.js +84 -0
- package/dist/rnc_yrs_store_bg.wasm +0 -0
- package/package.json +1 -1
package/dist/rnc_yrs_store.d.ts
CHANGED
|
@@ -276,6 +276,12 @@ export class SpreadsheetEngine {
|
|
|
276
276
|
* (see `@rowsncolumns/rnc-engine`) so the Option-B chrome reconciles its tab list after each commit.
|
|
277
277
|
*/
|
|
278
278
|
sheets(): string;
|
|
279
|
+
/**
|
|
280
|
+
* Every shift-log writer's latest `seq`, JSON `{"<writer id>": seq, …}` — record it with a
|
|
281
|
+
* range taken now; `transformRange` resolves the pair later. Document-wide (see
|
|
282
|
+
* [`YrsStore::shift_log_frontier`]).
|
|
283
|
+
*/
|
|
284
|
+
shiftLogFrontier(): string;
|
|
279
285
|
stateAsUpdate(): Uint8Array;
|
|
280
286
|
/**
|
|
281
287
|
* JSON `{buffers, baseBuffers, bytes, seedEntries, styledCells}` — the style history a load
|
|
@@ -296,6 +302,13 @@ export class SpreadsheetEngine {
|
|
|
296
302
|
* Drain the merged v1 update produced by local edits since the last call (empty = nothing).
|
|
297
303
|
*/
|
|
298
304
|
takePendingUpdates(): Uint8Array;
|
|
305
|
+
/**
|
|
306
|
+
* Resolve a `GridRange` on `sheet_id` taken at `frontier_json` (a `shiftLogFrontier` value) to
|
|
307
|
+
* its current coordinates: JSON `{range: GridRange | null, status: "ok" | "gone" | "unknown"}`
|
|
308
|
+
* — `gone` once a delete removed all of it, `unknown` when the log can no longer say (history
|
|
309
|
+
* cap, or the frontier names ops undone since); a malformed input is an `Err`.
|
|
310
|
+
*/
|
|
311
|
+
transformRange(sheet_id: number, range_json: string, frontier_json: string): string;
|
|
299
312
|
undo(): string;
|
|
300
313
|
/**
|
|
301
314
|
* Undo / redo stack depth (`SpreadsheetEngineLike.undoDepth` / `redoDepth`).
|
|
@@ -316,6 +329,15 @@ export class YrsSheetDoc {
|
|
|
316
329
|
setCell(sheet_id: number, row: number, col: number, cell_json: string): void;
|
|
317
330
|
}
|
|
318
331
|
|
|
332
|
+
/**
|
|
333
|
+
* Engine-less resolution of a `GridRange` on `sheet_id` through an op list in application order
|
|
334
|
+
* (`[{sheetId, index, delta, axis: "row" | "column"}]` — the shift-log wire shape; the Keryx
|
|
335
|
+
* `structural` shape `kind: "rows" | "columns"` and a plain `isRow` are accepted too): JSON
|
|
336
|
+
* `{range: GridRange | null, status: "ok" | "gone"}`. The same corner rule as `transformRange`
|
|
337
|
+
* ([`rnc_model::geometry::transform_range_through_ops_json`]); a malformed input is an `Err`.
|
|
338
|
+
*/
|
|
339
|
+
export function transformRangeThroughOps(sheet_id: number, range_json: string, ops_json: string): string;
|
|
340
|
+
|
|
319
341
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
320
342
|
|
|
321
343
|
export interface InitOutput {
|
|
@@ -387,6 +409,9 @@ export interface InitOutput {
|
|
|
387
409
|
readonly yrssheetdoc_new: () => number;
|
|
388
410
|
readonly yrssheetdoc_setCell: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
389
411
|
readonly spreadsheetengine_stateAsUpdate: (a: number) => [number, number];
|
|
412
|
+
readonly spreadsheetengine_shiftLogFrontier: (a: number) => [number, number];
|
|
413
|
+
readonly spreadsheetengine_transformRange: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
|
|
414
|
+
readonly transformRangeThroughOps: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
390
415
|
readonly __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
391
416
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
392
417
|
readonly __externref_table_alloc: () => number;
|
package/dist/rnc_yrs_store.js
CHANGED
|
@@ -953,6 +953,24 @@ export class SpreadsheetEngine {
|
|
|
953
953
|
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
954
954
|
}
|
|
955
955
|
}
|
|
956
|
+
/**
|
|
957
|
+
* Every shift-log writer's latest `seq`, JSON `{"<writer id>": seq, …}` — record it with a
|
|
958
|
+
* range taken now; `transformRange` resolves the pair later. Document-wide (see
|
|
959
|
+
* [`YrsStore::shift_log_frontier`]).
|
|
960
|
+
* @returns {string}
|
|
961
|
+
*/
|
|
962
|
+
shiftLogFrontier() {
|
|
963
|
+
let deferred1_0;
|
|
964
|
+
let deferred1_1;
|
|
965
|
+
try {
|
|
966
|
+
const ret = wasm.spreadsheetengine_shiftLogFrontier(this.__wbg_ptr);
|
|
967
|
+
deferred1_0 = ret[0];
|
|
968
|
+
deferred1_1 = ret[1];
|
|
969
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
970
|
+
} finally {
|
|
971
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
972
|
+
}
|
|
973
|
+
}
|
|
956
974
|
/**
|
|
957
975
|
* @returns {Uint8Array}
|
|
958
976
|
*/
|
|
@@ -1023,6 +1041,38 @@ export class SpreadsheetEngine {
|
|
|
1023
1041
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1024
1042
|
return v1;
|
|
1025
1043
|
}
|
|
1044
|
+
/**
|
|
1045
|
+
* Resolve a `GridRange` on `sheet_id` taken at `frontier_json` (a `shiftLogFrontier` value) to
|
|
1046
|
+
* its current coordinates: JSON `{range: GridRange | null, status: "ok" | "gone" | "unknown"}`
|
|
1047
|
+
* — `gone` once a delete removed all of it, `unknown` when the log can no longer say (history
|
|
1048
|
+
* cap, or the frontier names ops undone since); a malformed input is an `Err`.
|
|
1049
|
+
* @param {number} sheet_id
|
|
1050
|
+
* @param {string} range_json
|
|
1051
|
+
* @param {string} frontier_json
|
|
1052
|
+
* @returns {string}
|
|
1053
|
+
*/
|
|
1054
|
+
transformRange(sheet_id, range_json, frontier_json) {
|
|
1055
|
+
let deferred4_0;
|
|
1056
|
+
let deferred4_1;
|
|
1057
|
+
try {
|
|
1058
|
+
const ptr0 = passStringToWasm0(range_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1059
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1060
|
+
const ptr1 = passStringToWasm0(frontier_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1061
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1062
|
+
const ret = wasm.spreadsheetengine_transformRange(this.__wbg_ptr, sheet_id, ptr0, len0, ptr1, len1);
|
|
1063
|
+
var ptr3 = ret[0];
|
|
1064
|
+
var len3 = ret[1];
|
|
1065
|
+
if (ret[3]) {
|
|
1066
|
+
ptr3 = 0; len3 = 0;
|
|
1067
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1068
|
+
}
|
|
1069
|
+
deferred4_0 = ptr3;
|
|
1070
|
+
deferred4_1 = len3;
|
|
1071
|
+
return getStringFromWasm0(ptr3, len3);
|
|
1072
|
+
} finally {
|
|
1073
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
1074
|
+
}
|
|
1075
|
+
}
|
|
1026
1076
|
/**
|
|
1027
1077
|
* @returns {string}
|
|
1028
1078
|
*/
|
|
@@ -1120,6 +1170,40 @@ export class YrsSheetDoc {
|
|
|
1120
1170
|
}
|
|
1121
1171
|
}
|
|
1122
1172
|
if (Symbol.dispose) YrsSheetDoc.prototype[Symbol.dispose] = YrsSheetDoc.prototype.free;
|
|
1173
|
+
|
|
1174
|
+
/**
|
|
1175
|
+
* Engine-less resolution of a `GridRange` on `sheet_id` through an op list in application order
|
|
1176
|
+
* (`[{sheetId, index, delta, axis: "row" | "column"}]` — the shift-log wire shape; the Keryx
|
|
1177
|
+
* `structural` shape `kind: "rows" | "columns"` and a plain `isRow` are accepted too): JSON
|
|
1178
|
+
* `{range: GridRange | null, status: "ok" | "gone"}`. The same corner rule as `transformRange`
|
|
1179
|
+
* ([`rnc_model::geometry::transform_range_through_ops_json`]); a malformed input is an `Err`.
|
|
1180
|
+
* @param {number} sheet_id
|
|
1181
|
+
* @param {string} range_json
|
|
1182
|
+
* @param {string} ops_json
|
|
1183
|
+
* @returns {string}
|
|
1184
|
+
*/
|
|
1185
|
+
export function transformRangeThroughOps(sheet_id, range_json, ops_json) {
|
|
1186
|
+
let deferred4_0;
|
|
1187
|
+
let deferred4_1;
|
|
1188
|
+
try {
|
|
1189
|
+
const ptr0 = passStringToWasm0(range_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1190
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1191
|
+
const ptr1 = passStringToWasm0(ops_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1192
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1193
|
+
const ret = wasm.transformRangeThroughOps(sheet_id, ptr0, len0, ptr1, len1);
|
|
1194
|
+
var ptr3 = ret[0];
|
|
1195
|
+
var len3 = ret[1];
|
|
1196
|
+
if (ret[3]) {
|
|
1197
|
+
ptr3 = 0; len3 = 0;
|
|
1198
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1199
|
+
}
|
|
1200
|
+
deferred4_0 = ptr3;
|
|
1201
|
+
deferred4_1 = len3;
|
|
1202
|
+
return getStringFromWasm0(ptr3, len3);
|
|
1203
|
+
} finally {
|
|
1204
|
+
wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
|
|
1205
|
+
}
|
|
1206
|
+
}
|
|
1123
1207
|
function __wbg_get_imports() {
|
|
1124
1208
|
const import0 = {
|
|
1125
1209
|
__proto__: null,
|
|
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.11.0",
|
|
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).",
|