@rowsncolumns/rnc-yrs-store 0.10.1 → 0.10.3

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.
@@ -45,6 +45,17 @@ export class SpreadsheetEngine {
45
45
  * the moved coordinate (row for vertical, column for horizontal), 1-based.
46
46
  */
47
47
  dataEdge(sheet_id: number, row: number, col: number, d_row: number, d_col: number, limit: number): number;
48
+ /**
49
+ * Excel's *current region* around a 1-based cell as JSON `[top, left, bottom, right]` — the
50
+ * contiguous data block Ctrl/Cmd+A selects. Same signature and shape as `rnc-engine`'s
51
+ * `SpreadsheetEngine.dataRegion` (`SpreadsheetEngineLike.dataRegion`), which the
52
+ * `@rowsncolumns/rnc-engine` wrapper feature-detects on its inner engine: without this export
53
+ * the wrapper returns `undefined` and the grid falls back to walking its resident JS values,
54
+ * so Ctrl/Cmd+A on a windowed sheet stops at the resident band. Computed over the engine's
55
+ * full document (presence-only pass); a cell with no data in it or its eight neighbours is
56
+ * its own region.
57
+ */
58
+ dataRegion(sheet_id: number, row: number, col: number): string;
48
59
  /**
49
60
  * How many inbound updates are deferred on a causal gap (a dropped/reordered transport
50
61
  * drain). Zero in a healthy stream; persistently non-zero means the host should run a
@@ -302,6 +313,7 @@ export interface InitOutput {
302
313
  readonly spreadsheetengine_canUndo: (a: number) => number;
303
314
  readonly spreadsheetengine_clearHistory: (a: number) => void;
304
315
  readonly spreadsheetengine_dataEdge: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => number;
316
+ readonly spreadsheetengine_dataRegion: (a: number, b: number, c: number, d: number) => [number, number];
305
317
  readonly spreadsheetengine_deferredRemoteUpdates: (a: number) => number;
306
318
  readonly spreadsheetengine_dependents: (a: number, b: number, c: number, d: number) => [number, number];
307
319
  readonly spreadsheetengine_documentFacets: (a: number) => [number, number];
@@ -135,6 +135,32 @@ export class SpreadsheetEngine {
135
135
  const ret = wasm.spreadsheetengine_dataEdge(this.__wbg_ptr, sheet_id, row, col, d_row, d_col, limit);
136
136
  return ret >>> 0;
137
137
  }
138
+ /**
139
+ * Excel's *current region* around a 1-based cell as JSON `[top, left, bottom, right]` — the
140
+ * contiguous data block Ctrl/Cmd+A selects. Same signature and shape as `rnc-engine`'s
141
+ * `SpreadsheetEngine.dataRegion` (`SpreadsheetEngineLike.dataRegion`), which the
142
+ * `@rowsncolumns/rnc-engine` wrapper feature-detects on its inner engine: without this export
143
+ * the wrapper returns `undefined` and the grid falls back to walking its resident JS values,
144
+ * so Ctrl/Cmd+A on a windowed sheet stops at the resident band. Computed over the engine's
145
+ * full document (presence-only pass); a cell with no data in it or its eight neighbours is
146
+ * its own region.
147
+ * @param {number} sheet_id
148
+ * @param {number} row
149
+ * @param {number} col
150
+ * @returns {string}
151
+ */
152
+ dataRegion(sheet_id, row, col) {
153
+ let deferred1_0;
154
+ let deferred1_1;
155
+ try {
156
+ const ret = wasm.spreadsheetengine_dataRegion(this.__wbg_ptr, sheet_id, row, col);
157
+ deferred1_0 = ret[0];
158
+ deferred1_1 = ret[1];
159
+ return getStringFromWasm0(ret[0], ret[1]);
160
+ } finally {
161
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
162
+ }
163
+ }
138
164
  /**
139
165
  * How many inbound updates are deferred on a causal gap (a dropped/reordered transport
140
166
  * drain). Zero in a healthy stream; persistently non-zero means the host should run a
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rowsncolumns/rnc-yrs-store",
3
- "version": "0.10.1",
3
+ "version": "0.10.3",
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).",
@@ -15,9 +15,10 @@
15
15
  },
16
16
  "./rnc_yrs_store_bg.wasm": "./dist/rnc_yrs_store_bg.wasm"
17
17
  },
18
- "comment": "The vendored wasm in `src/wasm` is the DEPLOYED, working build (the engine staging runs at 1M), copied verbatim — NOT rebuilt from the in-tree crate (which may lag the optimized release branch). To refresh from source: `wasm-pack build crates/rnc-yrs-store --target web`, copy the three artifacts into `src/wasm`, and re-apply the inline-default `throw` patch (see README).",
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
- "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/"
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
22
  },
22
23
  "files": [
23
24
  "dist"