@rowsncolumns/rnc-yrs-store 0.25.3 → 0.27.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.
@@ -358,11 +358,13 @@ export class SpreadsheetEngine {
358
358
  */
359
359
  setCommitWindows(windows_json: string): void;
360
360
  /**
361
- * Create stable-ids (v5) documents with this engine; off by default. On, a document it creates
362
- * starts as v5 — its first edit or import on a fresh engine, or a loaded document that holds no
363
- * data yet. A document that holds data is never converted (existing documents stay v3), and a
364
- * v5 document always runs as v5, whatever the setting. Set it from the asset's chosen version,
365
- * for everyone who opens the asset. `true` when the call made the open (blank) document v5.
361
+ * Create stable-ids (v5) documents with this engine; off by default. On, the document this
362
+ * engine itself creates starts as v5: the first edit or import of an engine that was never
363
+ * loaded from an update and never merged one. A document the engine was handed is never made
364
+ * v5 by the setting, blank or not — a room that is to be v5 is born with the stamp
365
+ * (`docMeta.sheetDataVersion = "v5"`, written by whoever creates the room) — and a v5
366
+ * document always runs as v5, whatever the setting. `true` when the call made the document
367
+ * this engine is creating v5.
366
368
  */
367
369
  setStableIds(enabled: boolean): boolean;
368
370
  /**
@@ -472,6 +474,16 @@ export class SpreadsheetEngine {
472
474
  * Drain the merged v1 update produced by local edits since the last call (empty = nothing).
473
475
  */
474
476
  takePendingUpdates(): Uint8Array;
477
+ /**
478
+ * The positional writes that were not in the v5 planes when this session moved to the
479
+ * stable-ids store: the session was on a v3 document and an update made it v5 (a conversion
480
+ * that had not read what this session wrote or received since). JSON array of
481
+ * `{kind: "cell" | "note" | "row" | "column", sheetId, rowIndex, columnIndex, value?,
482
+ * formula?, written, current}`; the same list is on the commit the move renders, as
483
+ * `unconvertedWrites`. Taken once (`"[]"` afterwards, and for a session that never moved).
484
+ * The engine does not apply them: show them and let the person re-apply.
485
+ */
486
+ takeUnconvertedWrites(): string;
475
487
  /**
476
488
  * Resolve a `GridRange` on `sheet_id` taken at `frontier_json` (a `shiftLogFrontier` value) to
477
489
  * its current coordinates: JSON `{range: GridRange | null, status: "ok" | "gone" | "unknown"}`
@@ -479,6 +491,12 @@ export class SpreadsheetEngine {
479
491
  * cap, or the frontier names ops undone since); a malformed input is an `Err`.
480
492
  */
481
493
  transformRange(sheet_id: number, range_json: string, frontier_json: string): string;
494
+ /**
495
+ * The same list read from the document as it is now, nothing taken: what a v5 document's
496
+ * positional planes hold that its v5 planes do not. `"[]"` after a conversion that read
497
+ * everything, and for a v3 document.
498
+ */
499
+ unconvertedWrites(): string;
482
500
  undo(): string;
483
501
  /**
484
502
  * Undo / redo stack depth (`SpreadsheetEngineLike.undoDepth` / `redoDepth`).
@@ -609,6 +627,8 @@ export interface InitOutput {
609
627
  readonly spreadsheetengine_takeCappedFormulas: (a: number) => [number, number];
610
628
  readonly spreadsheetengine_takeOmittedCells: (a: number) => [number, number];
611
629
  readonly spreadsheetengine_takePendingUpdates: (a: number) => [number, number];
630
+ readonly spreadsheetengine_takeUnconvertedWrites: (a: number) => [number, number];
631
+ readonly spreadsheetengine_unconvertedWrites: (a: number) => [number, number];
612
632
  readonly spreadsheetengine_undo: (a: number) => [number, number];
613
633
  readonly spreadsheetengine_undoDepth: (a: number) => number;
614
634
  readonly spreadsheetengine_unregisterExternalFunctions: (a: number, b: number, c: number) => void;
@@ -619,15 +639,15 @@ export interface InitOutput {
619
639
  readonly yrssheetdoc_new: () => number;
620
640
  readonly yrssheetdoc_setCell: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
621
641
  readonly spreadsheetengine_stateAsUpdate: (a: number) => [number, number];
622
- readonly spreadsheetengine_columnIds: (a: number, b: number) => [number, number];
623
- readonly spreadsheetengine_parseStableCellKey: (a: number, b: number, c: number) => [number, number];
624
- readonly spreadsheetengine_rowIds: (a: number, b: number) => [number, number];
625
- readonly spreadsheetengine_stableCellKey: (a: number, b: number, c: number, d: number) => [number, number];
626
642
  readonly spreadsheetengine_anchorRange: (a: number, b: number, c: number, d: number) => [number, number, number, number];
627
643
  readonly spreadsheetengine_resolveAnchor: (a: number, b: number, c: number) => [number, number, number, number];
628
644
  readonly spreadsheetengine_shiftLogFrontier: (a: number) => [number, number];
629
645
  readonly spreadsheetengine_transformRange: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
630
646
  readonly transformRangeThroughOps: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
647
+ readonly spreadsheetengine_columnIds: (a: number, b: number) => [number, number];
648
+ readonly spreadsheetengine_parseStableCellKey: (a: number, b: number, c: number) => [number, number];
649
+ readonly spreadsheetengine_rowIds: (a: number, b: number) => [number, number];
650
+ readonly spreadsheetengine_stableCellKey: (a: number, b: number, c: number, d: number) => [number, number];
631
651
  readonly __wbindgen_malloc: (a: number, b: number) => number;
632
652
  readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
633
653
  readonly __wbindgen_free: (a: number, b: number, c: number) => void;
@@ -1230,11 +1230,13 @@ export class SpreadsheetEngine {
1230
1230
  }
1231
1231
  }
1232
1232
  /**
1233
- * Create stable-ids (v5) documents with this engine; off by default. On, a document it creates
1234
- * starts as v5 — its first edit or import on a fresh engine, or a loaded document that holds no
1235
- * data yet. A document that holds data is never converted (existing documents stay v3), and a
1236
- * v5 document always runs as v5, whatever the setting. Set it from the asset's chosen version,
1237
- * for everyone who opens the asset. `true` when the call made the open (blank) document v5.
1233
+ * Create stable-ids (v5) documents with this engine; off by default. On, the document this
1234
+ * engine itself creates starts as v5: the first edit or import of an engine that was never
1235
+ * loaded from an update and never merged one. A document the engine was handed is never made
1236
+ * v5 by the setting, blank or not — a room that is to be v5 is born with the stamp
1237
+ * (`docMeta.sheetDataVersion = "v5"`, written by whoever creates the room) — and a v5
1238
+ * document always runs as v5, whatever the setting. `true` when the call made the document
1239
+ * this engine is creating v5.
1238
1240
  * @param {boolean} enabled
1239
1241
  * @returns {boolean}
1240
1242
  */
@@ -1537,6 +1539,28 @@ export class SpreadsheetEngine {
1537
1539
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1538
1540
  return v1;
1539
1541
  }
1542
+ /**
1543
+ * The positional writes that were not in the v5 planes when this session moved to the
1544
+ * stable-ids store: the session was on a v3 document and an update made it v5 (a conversion
1545
+ * that had not read what this session wrote or received since). JSON array of
1546
+ * `{kind: "cell" | "note" | "row" | "column", sheetId, rowIndex, columnIndex, value?,
1547
+ * formula?, written, current}`; the same list is on the commit the move renders, as
1548
+ * `unconvertedWrites`. Taken once (`"[]"` afterwards, and for a session that never moved).
1549
+ * The engine does not apply them: show them and let the person re-apply.
1550
+ * @returns {string}
1551
+ */
1552
+ takeUnconvertedWrites() {
1553
+ let deferred1_0;
1554
+ let deferred1_1;
1555
+ try {
1556
+ const ret = wasm.spreadsheetengine_takeUnconvertedWrites(this.__wbg_ptr);
1557
+ deferred1_0 = ret[0];
1558
+ deferred1_1 = ret[1];
1559
+ return getStringFromWasm0(ret[0], ret[1]);
1560
+ } finally {
1561
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1562
+ }
1563
+ }
1540
1564
  /**
1541
1565
  * Resolve a `GridRange` on `sheet_id` taken at `frontier_json` (a `shiftLogFrontier` value) to
1542
1566
  * its current coordinates: JSON `{range: GridRange | null, status: "ok" | "gone" | "unknown"}`
@@ -1569,6 +1593,24 @@ export class SpreadsheetEngine {
1569
1593
  wasm.__wbindgen_free(deferred4_0, deferred4_1, 1);
1570
1594
  }
1571
1595
  }
1596
+ /**
1597
+ * The same list read from the document as it is now, nothing taken: what a v5 document's
1598
+ * positional planes hold that its v5 planes do not. `"[]"` after a conversion that read
1599
+ * everything, and for a v3 document.
1600
+ * @returns {string}
1601
+ */
1602
+ unconvertedWrites() {
1603
+ let deferred1_0;
1604
+ let deferred1_1;
1605
+ try {
1606
+ const ret = wasm.spreadsheetengine_unconvertedWrites(this.__wbg_ptr);
1607
+ deferred1_0 = ret[0];
1608
+ deferred1_1 = ret[1];
1609
+ return getStringFromWasm0(ret[0], ret[1]);
1610
+ } finally {
1611
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
1612
+ }
1613
+ }
1572
1614
  /**
1573
1615
  * @returns {string}
1574
1616
  */
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rowsncolumns/rnc-yrs-store",
3
- "version": "0.25.3",
3
+ "version": "0.27.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).",
@@ -18,7 +18,8 @@
18
18
  "comment": "The vendored wasm in `src/wasm` is built from the in-tree `rust/crates/rnc-yrs-store` with `yarn build:wasm` (pinned toolchain from rust/rust-toolchain.toml; artifacts copied verbatim, stamped by src/wasm/BUILD_INFO.json). A release never compiles Rust, so re-vendor after any change under rust/ — CI's `wasm` job fails otherwise (scripts/check-wasm-fresh.mjs). Callers pass the served wasm URL as `module_or_path` (see README).",
19
19
  "scripts": {
20
20
  "build": "rm -rf dist && mkdir -p dist && cp -f src/wasm/rnc_yrs_store.js src/wasm/rnc_yrs_store.d.ts src/wasm/rnc_yrs_store_bg.wasm dist/",
21
- "build:wasm": "node ../../scripts/build-wasm.mjs --package rnc-yrs-store"
21
+ "build:wasm": "node ../../scripts/build-wasm.mjs --package rnc-yrs-store",
22
+ "prepublishOnly": "node ../../scripts/build-native.mjs --verify --release"
22
23
  },
23
24
  "files": [
24
25
  "dist"