@rowsncolumns/rnc-engine 1.1.0 → 1.1.2
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-spreadsheet-engine.d.ts","sourceRoot":"","sources":["../../src/use-spreadsheet-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,KAAK,sBAAsB,
|
|
1
|
+
{"version":3,"file":"use-spreadsheet-engine.d.ts","sourceRoot":"","sources":["../../src/use-spreadsheet-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,KAAK,sBAAsB,EAQ5B,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EACL,KAAK,iBAAiB,EAEtB,KAAK,2BAA2B,EACjC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,KAAK,aAAa,EAAoB,MAAM,sBAAsB,CAAC;AAE5E;wGACwG;AACxG,MAAM,MAAM,iBAAiB,GAAG,iBAAiB,GAC/C,aAAa,GACb,sBAAsB,CAAC;AAazB,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,2BAA2B,GACnC,iBAAiB,CA0GnB"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* host intents (clipboard/citations/comments/…). Their UNION is what makes this a structural drop-in
|
|
7
7
|
* for `useSpreadsheetState` — the parity lock below is asserted here, not on either layer alone.
|
|
8
8
|
*/
|
|
9
|
-
import { useOnRequestCreateTable, useOnRequestEditTable, useOnRequestInsertSlicer, useOnRequestResizeTable, useSparklineGroups, } from "@rowsncolumns/spreadsheet-state";
|
|
9
|
+
import { useOnRequestCreateTable, useOnRequestDataValidation, useOnRequestEditTable, useOnRequestInsertSlicer, useOnRequestResizeTable, useSparklineGroups, } from "@rowsncolumns/spreadsheet-state";
|
|
10
10
|
import { useCallback, useMemo } from "react";
|
|
11
11
|
import { useEngineCore, } from "./use-engine-core";
|
|
12
12
|
import { useSpreadsheetUI } from "./use-spreadsheet-ui";
|
|
@@ -16,17 +16,19 @@ export function useSpreadsheetEngine(options) {
|
|
|
16
16
|
const core = useEngineCore(options);
|
|
17
17
|
const ui = useSpreadsheetUI();
|
|
18
18
|
// Insert → Checkbox / Dropdown pass a pre-built rule (checkbox with `showEditUI: false`). The
|
|
19
|
-
// chrome opener alone would drop it and only show the dialog —
|
|
20
|
-
//
|
|
21
|
-
//
|
|
19
|
+
// chrome opener alone would drop it and only show the dialog — compose the JS host's
|
|
20
|
+
// `useOnRequestDataValidation` (it hands a rule the dialog will show to the editor as a DRAFT the
|
|
21
|
+
// user's Save creates, and creates a dialog-less rule through the engine immediately), then flip
|
|
22
|
+
// the chrome flag so a `dialogs`-driven host opens the same editor.
|
|
23
|
+
const requestDataValidation = useOnRequestDataValidation({
|
|
24
|
+
onCreateDataValidationRule: core.onCreateDataValidationRule,
|
|
25
|
+
});
|
|
22
26
|
const onRequestDataValidation = useCallback((sheetId, activeCell, selections, rule, showEditUI = true) => {
|
|
23
|
-
|
|
24
|
-
core.onCreateDataValidationRule?.(rule);
|
|
25
|
-
}
|
|
27
|
+
requestDataValidation(sheetId, activeCell, selections, rule, showEditUI);
|
|
26
28
|
if (showEditUI) {
|
|
27
29
|
ui.onRequestDataValidation(sheetId, activeCell, selections, rule, showEditUI);
|
|
28
30
|
}
|
|
29
|
-
}, [
|
|
31
|
+
}, [requestDataValidation, ui]);
|
|
30
32
|
// The Create Table dialog pre-fills its range and guesses "My table has headers" from the
|
|
31
33
|
// engine's cells, so the opener is composed here (the chrome alone has no cell access): it
|
|
32
34
|
// writes the request the `TableEditor` create dialog reads and stashes the chrome context too.
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rowsncolumns/rnc-engine",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.2",
|
|
4
4
|
"author": "Vinay M",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"description": "Typed JS/TS interop for the Rust→WASM spreadsheet calc engine (rnc-wasm). Ergonomic JSON-in/out wrapper over the wasm-bindgen surface: applyCommand(Command)→CommitResult, readWindow→WindowSnapshot, and Map<\"sheet!A1\",CellFormat> style folding. Pluggable backend — single-user `SpreadsheetEngine` (default) or collaborative `CollabSpreadsheetEngine` (Yjs sync) — plus the Option-B `useSpreadsheetEngine` React hook.",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@rowsncolumns/dag": ">=7.2.30",
|
|
50
50
|
"@rowsncolumns/grid": ">=13.2.33",
|
|
51
51
|
"@rowsncolumns/spreadsheet": ">=10.4.0",
|
|
52
|
-
"@rowsncolumns/spreadsheet-state": ">=29.1.
|
|
52
|
+
"@rowsncolumns/spreadsheet-state": ">=29.1.2",
|
|
53
53
|
"@rowsncolumns/toolkit": ">=24.5.0",
|
|
54
54
|
"@rowsncolumns/utils": ">=9.4.0",
|
|
55
55
|
"fflate": "^0.8.2"
|