@rowsncolumns/rnc-yrs-store 0.29.0 → 0.29.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 +24 -23
- package/dist/rnc_yrs_store.js +29 -25
- package/dist/rnc_yrs_store_bg.wasm +0 -0
- package/package.json +1 -1
package/dist/rnc_yrs_store.d.ts
CHANGED
|
@@ -554,31 +554,32 @@ export class YrsSheetDoc {
|
|
|
554
554
|
* `positional_state` is the document's whole state as one v1 update (what `encodeStateAsUpdate`
|
|
555
555
|
* gives). The result is the converted document's whole state as one v1 update. It loads in a
|
|
556
556
|
* fresh engine as an ordinary v5 document and reads, cell for cell and facet for facet, what the
|
|
557
|
-
* input read on the positional store. The
|
|
558
|
-
*
|
|
559
|
-
*
|
|
557
|
+
* input read on the positional store. The result is a document of its own: read its content and
|
|
558
|
+
* copy it into a room, never merge its bytes into one. Two conversions of the same input read the
|
|
559
|
+
* same; their bytes are not the same.
|
|
560
560
|
*
|
|
561
|
-
*
|
|
562
|
-
*
|
|
563
|
-
*
|
|
561
|
+
* Without `line_ids_json` (`undefined` or `null`) each line takes the client-0 id of its position,
|
|
562
|
+
* as a room's own conversion names them ([`convert_to_stable_ids`]). With it, each line takes the
|
|
563
|
+
* id the map gives its position and a fresh id `make_id(freshClient, n)` where it gives none
|
|
564
|
+
* ([`convert_to_stable_ids_with_line_ids`]): `{"freshClient": <1..=2^32-1>, "sheets":
|
|
565
|
+
* {"<sheetId>": {"rowIds": [<id> | null, …], "columnIds": [<id> | null, …]}}}`, an id as its
|
|
566
|
+
* decimal string (as `rowIds` / `columnIds` give them). A host restoring a version saved before its
|
|
567
|
+
* room was converted gives the room's ids to the lines the room still has, so a reference the room
|
|
568
|
+
* keeps on a line stays on that line, and fresh ids to the rest (a `freshClient` the room never
|
|
569
|
+
* used), so a reference never lands on another line.
|
|
564
570
|
*
|
|
565
|
-
*
|
|
566
|
-
* * `already-stable-ids
|
|
567
|
-
* * `newer-format
|
|
568
|
-
* * `migration-refused
|
|
569
|
-
*
|
|
570
|
-
*
|
|
571
|
-
*
|
|
572
|
-
*
|
|
573
|
-
*
|
|
574
|
-
*
|
|
575
|
-
*
|
|
576
|
-
* It runs the migration a load into the v5 store runs ([`YrsStore::migrate_to_v5`]) on a store
|
|
577
|
-
* of its own, twice: once keeping the positional plane, to check that the v5 document holds
|
|
578
|
-
* every positional entry, then once deleting what it read, for the result. No engine session,
|
|
579
|
-
* no calc engine. An engine still never converts a document it is handed (`dual.rs`).
|
|
571
|
+
* Throws, with no result, a message that starts with:
|
|
572
|
+
* * `already-stable-ids`: the input is already v5;
|
|
573
|
+
* * `newer-format`: the input is stamped with a data format after v5;
|
|
574
|
+
* * `migration-refused`: a `sheet-format.cells` the migration of this engine does not convert;
|
|
575
|
+
* * `invalid-document`: bytes that are not a v1 update, an update that is not a whole state, a
|
|
576
|
+
* document that holds no sheet and no cell, or a positional entry outside the grid;
|
|
577
|
+
* * `convert-failed`: the migration would leave a positional entry out, or the engine failed;
|
|
578
|
+
* * `invalid-line-ids`: a map that is not the shape above, a fresh client of 0 or past 32 bits, an
|
|
579
|
+
* id that is no line id, an id of the fresh client, one id named twice on an axis, a sheet the
|
|
580
|
+
* document does not hold, or a sheet whose lines are already named.
|
|
580
581
|
*/
|
|
581
|
-
export function convertToStableIds(positional_state: Uint8Array): Uint8Array;
|
|
582
|
+
export function convertToStableIds(positional_state: Uint8Array, line_ids_json?: string | null): Uint8Array;
|
|
582
583
|
|
|
583
584
|
/**
|
|
584
585
|
* Engine-less resolution of a `GridRange` on `sheet_id` through an op list in application order
|
|
@@ -688,7 +689,7 @@ export interface InitOutput {
|
|
|
688
689
|
readonly yrssheetdoc_new: () => number;
|
|
689
690
|
readonly yrssheetdoc_setCell: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
690
691
|
readonly spreadsheetengine_stateAsUpdate: (a: number) => [number, number];
|
|
691
|
-
readonly convertToStableIds: (a: number, b: number) => [number, number, number, number];
|
|
692
|
+
readonly convertToStableIds: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
692
693
|
readonly spreadsheetengine_anchorRange: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
693
694
|
readonly spreadsheetengine_columnIds: (a: number, b: number) => [number, number];
|
|
694
695
|
readonly spreadsheetengine_parseStableCellKey: (a: number, b: number, c: number) => [number, number];
|
package/dist/rnc_yrs_store.js
CHANGED
|
@@ -1779,42 +1779,46 @@ if (Symbol.dispose) YrsSheetDoc.prototype[Symbol.dispose] = YrsSheetDoc.prototyp
|
|
|
1779
1779
|
* `positional_state` is the document's whole state as one v1 update (what `encodeStateAsUpdate`
|
|
1780
1780
|
* gives). The result is the converted document's whole state as one v1 update. It loads in a
|
|
1781
1781
|
* fresh engine as an ordinary v5 document and reads, cell for cell and facet for facet, what the
|
|
1782
|
-
* input read on the positional store. The
|
|
1783
|
-
*
|
|
1784
|
-
*
|
|
1782
|
+
* input read on the positional store. The result is a document of its own: read its content and
|
|
1783
|
+
* copy it into a room, never merge its bytes into one. Two conversions of the same input read the
|
|
1784
|
+
* same; their bytes are not the same.
|
|
1785
1785
|
*
|
|
1786
|
-
*
|
|
1787
|
-
*
|
|
1788
|
-
*
|
|
1786
|
+
* Without `line_ids_json` (`undefined` or `null`) each line takes the client-0 id of its position,
|
|
1787
|
+
* as a room's own conversion names them ([`convert_to_stable_ids`]). With it, each line takes the
|
|
1788
|
+
* id the map gives its position and a fresh id `make_id(freshClient, n)` where it gives none
|
|
1789
|
+
* ([`convert_to_stable_ids_with_line_ids`]): `{"freshClient": <1..=2^32-1>, "sheets":
|
|
1790
|
+
* {"<sheetId>": {"rowIds": [<id> | null, …], "columnIds": [<id> | null, …]}}}`, an id as its
|
|
1791
|
+
* decimal string (as `rowIds` / `columnIds` give them). A host restoring a version saved before its
|
|
1792
|
+
* room was converted gives the room's ids to the lines the room still has, so a reference the room
|
|
1793
|
+
* keeps on a line stays on that line, and fresh ids to the rest (a `freshClient` the room never
|
|
1794
|
+
* used), so a reference never lands on another line.
|
|
1789
1795
|
*
|
|
1790
|
-
*
|
|
1791
|
-
* * `already-stable-ids
|
|
1792
|
-
* * `newer-format
|
|
1793
|
-
* * `migration-refused
|
|
1794
|
-
*
|
|
1795
|
-
*
|
|
1796
|
-
*
|
|
1797
|
-
*
|
|
1798
|
-
*
|
|
1799
|
-
*
|
|
1800
|
-
*
|
|
1801
|
-
* It runs the migration a load into the v5 store runs ([`YrsStore::migrate_to_v5`]) on a store
|
|
1802
|
-
* of its own, twice: once keeping the positional plane, to check that the v5 document holds
|
|
1803
|
-
* every positional entry, then once deleting what it read, for the result. No engine session,
|
|
1804
|
-
* no calc engine. An engine still never converts a document it is handed (`dual.rs`).
|
|
1796
|
+
* Throws, with no result, a message that starts with:
|
|
1797
|
+
* * `already-stable-ids`: the input is already v5;
|
|
1798
|
+
* * `newer-format`: the input is stamped with a data format after v5;
|
|
1799
|
+
* * `migration-refused`: a `sheet-format.cells` the migration of this engine does not convert;
|
|
1800
|
+
* * `invalid-document`: bytes that are not a v1 update, an update that is not a whole state, a
|
|
1801
|
+
* document that holds no sheet and no cell, or a positional entry outside the grid;
|
|
1802
|
+
* * `convert-failed`: the migration would leave a positional entry out, or the engine failed;
|
|
1803
|
+
* * `invalid-line-ids`: a map that is not the shape above, a fresh client of 0 or past 32 bits, an
|
|
1804
|
+
* id that is no line id, an id of the fresh client, one id named twice on an axis, a sheet the
|
|
1805
|
+
* document does not hold, or a sheet whose lines are already named.
|
|
1805
1806
|
* @param {Uint8Array} positional_state
|
|
1807
|
+
* @param {string | null} [line_ids_json]
|
|
1806
1808
|
* @returns {Uint8Array}
|
|
1807
1809
|
*/
|
|
1808
|
-
export function convertToStableIds(positional_state) {
|
|
1810
|
+
export function convertToStableIds(positional_state, line_ids_json) {
|
|
1809
1811
|
const ptr0 = passArray8ToWasm0(positional_state, wasm.__wbindgen_malloc);
|
|
1810
1812
|
const len0 = WASM_VECTOR_LEN;
|
|
1811
|
-
|
|
1813
|
+
var ptr1 = isLikeNone(line_ids_json) ? 0 : passStringToWasm0(line_ids_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1814
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1815
|
+
const ret = wasm.convertToStableIds(ptr0, len0, ptr1, len1);
|
|
1812
1816
|
if (ret[3]) {
|
|
1813
1817
|
throw takeFromExternrefTable0(ret[2]);
|
|
1814
1818
|
}
|
|
1815
|
-
var
|
|
1819
|
+
var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
1816
1820
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1817
|
-
return
|
|
1821
|
+
return v3;
|
|
1818
1822
|
}
|
|
1819
1823
|
|
|
1820
1824
|
/**
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rowsncolumns/rnc-yrs-store",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.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).",
|