@sheetwrite/react 0.1.0 → 0.3.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/README.md CHANGED
@@ -43,14 +43,25 @@ The component initializes WASM on client mount. `fallback` renders inside the st
43
43
  import { SheetwriteGrid } from "@sheetwrite/react";
44
44
  import "@sheetwrite/react/styles.css";
45
45
 
46
- <SheetwriteGrid ref={gridRef} workbook={workbook} data={data} fill />;
46
+ <SheetwriteGrid
47
+ ref={gridRef}
48
+ workbook={workbook}
49
+ data={data}
50
+ presentation="data-grid"
51
+ editors={editors}
52
+ fill
53
+ />;
47
54
  ```
48
55
 
49
- Reset-bound inputs are `workbook`, `data`, `datasource`, `datasourceStorage`, `renderer`, `workerUrl`, and `renderers`. They replace the grid. Live inputs are `theme`, `readOnly`, `config`, `overscan`, and `minColumns`.
56
+ Reset-bound inputs are `workbook`, `data`, `datasource`, `datasourceStorage`,
57
+ `presentation`, `editors`, `protectionResolver`, `mutationPolicy`,
58
+ `transactionResourceLimits`, `renderer`, `workerUrl`, and `renderers`. They
59
+ replace the grid. Live inputs are `theme`, `readOnly`, `config`, `overscan`, and
60
+ `minColumns`.
50
61
 
51
62
  `ref` receives the current `Grid` before `onReady({ grid, generation, reason })` runs and clears on replacement or unmount. Reasons are `initial`, `input-reset`, and `renderer-reset`.
52
63
 
53
- Grid events use collision-free names: `onGridChange`, `onViewportChange`, `onSelectionChange`, `onEditBegin`, `onEditCommit`, `onSearch`, and `onActiveSheetChange`. Native host `onChange` and `onScroll` remain ordinary DOM handlers.
64
+ Grid events use collision-free names: `onGridChange`, `onViewportChange`, `onSelectionChange`, `onEditBegin`, `onEditCommit`, `onSearch`, `onCommandStateChange`, `onActiveSheetChange`, `onMutationRejected`, `onRendererFallback`, `onDatasourceError`, and `onExportError`. Native host `onChange` and `onScroll` remain ordinary DOM handlers.
54
65
 
55
66
  For vanilla/preload control, import `initSheetwrite()` and `createGrid()` from `@sheetwrite/core`. See [installation](https://sheetwrite.vercel.app/docs/start/installation/), [React integration](https://sheetwrite.vercel.app/docs/frameworks/react/), and [collaboration](https://sheetwrite.vercel.app/docs/guides/collaboration/).
56
67
 
package/dist/index.d.ts CHANGED
@@ -1,8 +1,26 @@
1
1
  import { type CellScalar, type Grid, type GridOptions } from "@sheetwrite/core";
2
- import { type GridAdapterEventHandlers, type GridSizeProps, type SheetwriteInitializationProps, type SimpleColumn } from "@sheetwrite/core/adapter";
2
+ import { createSimpleRowBridge, type GridAdapterEventHandlers, type GridSizeProps, type RowBridge, type RowBridgeHandler, type RowBridgeId, type SheetwriteInitializationProps, type SimpleColumn } from "@sheetwrite/core/adapter";
3
3
  import { type CSSProperties, type ForwardedRef, type HTMLAttributes, type ReactElement, type ReactNode } from "react";
4
+ type GridAdapterEventHandlerName = "onGridChange" | "onRowDelta" | "onSelectionChange" | "onViewportChange" | "onEditBegin" | "onEditCommit" | "onSearch" | "onCommandStateChange" | "onActiveSheetChange" | "onMutationRejected" | "onRendererFallback" | "onDatasourceError" | "onExportError" | "onReady" | "onInitializationError";
5
+ type AssertNever<Value extends never> = Value;
6
+ type GridAdapterEventHandlerParity = AssertNever<Exclude<keyof GridAdapterEventHandlers, GridAdapterEventHandlerName> | Exclude<GridAdapterEventHandlerName, keyof GridAdapterEventHandlers>>;
7
+ type SheetwriteGridHostAttributes = Omit<HTMLAttributes<HTMLDivElement>, GridAdapterEventHandlerName | GridAdapterEventHandlerParity | "children">;
4
8
  /** Advanced framework adapter props for workbook data or datasource ownership. */
5
- export interface SheetwriteGridProps extends GridOptions, GridAdapterEventHandlers, SheetwriteInitializationProps, Omit<HTMLAttributes<HTMLDivElement>, keyof GridAdapterEventHandlers | "children"> {
9
+ export interface SheetwriteGridProps<Id extends RowBridgeId = RowBridgeId> extends GridOptions, GridAdapterEventHandlers<Id>, SheetwriteInitializationProps, SheetwriteGridHostAttributes {
10
+ /** Projects canonical changes to host-owned row identities. */
11
+ rowBridge?: RowBridge<Id>;
12
+ /** Receives one accepted or reconciled row projection. */
13
+ onRowDelta?: RowBridgeHandler<Id>;
14
+ /** Receives structured issues when a Grid mutation is rejected. */
15
+ onMutationRejected?: GridAdapterEventHandlers["onMutationRejected"];
16
+ /** Fires when worker rendering falls back to the main-thread canvas renderer. */
17
+ onRendererFallback?: GridAdapterEventHandlers["onRendererFallback"];
18
+ /** Receives failed datasource requests and their errors. */
19
+ onDatasourceError?: GridAdapterEventHandlers["onDatasourceError"];
20
+ /** Receives failures from built-in XLSX export actions. */
21
+ onExportError?: GridAdapterEventHandlers["onExportError"];
22
+ /** Fires after the adapter publishes a ready Grid generation. */
23
+ onReady?: GridAdapterEventHandlers["onReady"];
6
24
  /** Additional class appended to the required `sheetwrite` host class. */
7
25
  className?: string;
8
26
  /** Host styles merged before adapter sizing styles. */
@@ -14,16 +32,22 @@ export interface SheetwriteGridProps extends GridOptions, GridAdapterEventHandle
14
32
  /** Fills the parent's available width and height, taking precedence over `height`. */
15
33
  fill?: true;
16
34
  }
17
- /** Advanced framework component for workbook data or datasource input. */
18
- export declare const SheetwriteGrid: import("react").ForwardRefExoticComponent<SheetwriteGridProps & import("react").RefAttributes<Grid>>;
35
+ /** Advanced framework component with inferred row-bridge identity. */
36
+ export declare const SheetwriteGrid: <Id extends RowBridgeId = RowBridgeId>(props: SheetwriteGridProps<Id> & {
37
+ ref?: ForwardedRef<Grid>;
38
+ }) => ReactElement;
19
39
  /** Simple framework adapter props for columns and default row objects. */
20
- export type SheetwriteProps<Row extends Record<string, CellScalar>> = Omit<SheetwriteGridProps, "workbook" | "data" | "datasource" | "height" | "fill"> & GridSizeProps & {
40
+ export type SheetwriteProps<Row extends Record<string, CellScalar>, Id extends RowBridgeId = RowBridgeId> = Omit<SheetwriteGridProps<Id>, "workbook" | "data" | "datasource" | "height" | "fill" | "rowBridge"> & GridSizeProps & {
21
41
  /** Ordered schema used to derive the component-owned sheet. */
22
42
  columns: readonly SimpleColumn<Row>[];
23
43
  /** Rows converted to initial columnar data; missing column keys become `null`. */
24
44
  defaultRows: readonly Row[];
25
45
  /** Name of the generated sheet; defaults to `Sheet 1`. */
26
46
  sheetName?: string;
47
+ /** Opt-in stable identity for each host row. */
48
+ getRowId?: (row: Row, index: number) => Id;
49
+ /** Creates stable identities for Grid-inserted rows. */
50
+ createRowId?: Parameters<typeof createSimpleRowBridge<Row, Id>>[0]["createRowId"];
27
51
  };
28
52
  /**
29
53
  * Convenience component for local object rows. It derives a single-sheet workbook from
@@ -31,10 +55,10 @@ export type SheetwriteProps<Row extends Record<string, CellScalar>> = Omit<Sheet
31
55
  * through prop-driven resets and unmount cleanup. Pass a `ref` to access the live `Grid`;
32
56
  * use `SheetwriteGrid` when the host already owns a workbook or datasource.
33
57
  */
34
- export declare const Sheetwrite: <Row extends Record<string, CellScalar>>(props: SheetwriteProps<Row> & {
58
+ export declare const Sheetwrite: <Row extends Record<string, CellScalar>, Id extends RowBridgeId = RowBridgeId>(props: SheetwriteProps<Row, Id> & {
35
59
  /** Receives the live Grid after readiness and `null` on reset or unmount. */
36
60
  ref?: ForwardedRef<Grid>;
37
61
  }) => ReactElement;
38
- export type { CellScalar, Grid } from "@sheetwrite/core";
39
- export type { GridReadyEvent, SimpleColumn } from "@sheetwrite/core/adapter";
62
+ export type { CellEditor, CellEditorContext, CellEditorInstance, CellEditorNavigation, CellScalar, Grid, GridCommandName, GridCommandState, } from "@sheetwrite/core";
63
+ export type { GridReadyEvent, RowBridge, RowBridgeDelta, RowBridgeHandler, RowBridgeId, RowBridgeProjection, SimpleColumn, } from "@sheetwrite/core/adapter";
40
64
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EACf,KAAK,IAAI,EACT,KAAK,WAAW,EAGjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAGL,KAAK,wBAAwB,EAG7B,KAAK,aAAa,EAGlB,KAAK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1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { initSheetwrite, isSheetwriteReady, } from "@sheetwrite/core";
3
- import { createGridController, createSimpleGridInput, getGridResetReason, gridSizeStyle, } from "@sheetwrite/core/adapter";
3
+ import { createGridController, createSimpleGridInput, createSimpleRowBridge, getGridResetReason, gridSizeStyle, } from "@sheetwrite/core/adapter";
4
4
  import { forwardRef, useEffect, useLayoutEffect, useMemo, useRef, useState, } from "react";
5
+ const useCommitLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
5
6
  function publishGrid(ref, grid) {
6
7
  if (typeof ref === "function")
7
8
  ref(grid);
@@ -9,8 +10,8 @@ function publishGrid(ref, grid) {
9
10
  ref.current = grid;
10
11
  }
11
12
  /** Advanced framework component for workbook data or datasource input. */
12
- export const SheetwriteGrid = forwardRef(function SheetwriteGrid(props, ref) {
13
- const { className, style, fallback, wasmSource, onInitializationError, onGridChange, onSelectionChange, onViewportChange, onEditBegin, onEditCommit, onSearch, onActiveSheetChange, onReady, workbook, data, datasource, datasourceStorage, renderer, workerUrl, theme, readOnly, protectionResolver, mutationPolicy, renderers, overscan, minColumns, config, height, fill, ...hostAttributes } = props;
13
+ const SheetwriteGridComponent = forwardRef(function SheetwriteGrid(props, ref) {
14
+ const { className, style, fallback, wasmSource, onInitializationError, onGridChange, onRowDelta, onSelectionChange, onViewportChange, onEditBegin, onEditCommit, onSearch, onCommandStateChange, onActiveSheetChange, onMutationRejected, onRendererFallback, onDatasourceError, onExportError, onReady, rowBridge, workbook, data, datasource, datasourceStorage, renderer, workerUrl, presentation, theme, readOnly, protectionResolver, mutationPolicy, transactionResourceLimits, hyperlinkActivation, renderers, editors, overscan, minColumns, config, height, fill, ...hostAttributes } = props;
14
15
  const hostRef = useRef(null);
15
16
  const controllerRef = useRef(null);
16
17
  const publishedRef = useRef(null);
@@ -27,19 +28,48 @@ export const SheetwriteGrid = forwardRef(function SheetwriteGrid(props, ref) {
27
28
  config,
28
29
  });
29
30
  liveOptionsRef.current = { theme, readOnly, overscan, minColumns, config };
30
- const handlers = useRef({});
31
- Object.assign(handlers.current, {
31
+ const handlers = useRef(null);
32
+ useCommitLayoutEffect(() => {
33
+ const committedHandlers = {
34
+ onGridChange,
35
+ onRowDelta,
36
+ onSelectionChange,
37
+ onViewportChange,
38
+ onEditBegin,
39
+ onEditCommit,
40
+ onSearch,
41
+ onCommandStateChange,
42
+ onActiveSheetChange,
43
+ onMutationRejected,
44
+ onRendererFallback,
45
+ onDatasourceError,
46
+ onExportError,
47
+ onReady,
48
+ onInitializationError,
49
+ };
50
+ handlers.current = committedHandlers;
51
+ return () => {
52
+ if (handlers.current === committedHandlers)
53
+ handlers.current = null;
54
+ };
55
+ }, [
32
56
  onGridChange,
57
+ onRowDelta,
33
58
  onSelectionChange,
34
59
  onViewportChange,
35
60
  onEditBegin,
36
61
  onEditCommit,
37
62
  onSearch,
63
+ onCommandStateChange,
38
64
  onActiveSheetChange,
65
+ onMutationRejected,
66
+ onRendererFallback,
67
+ onDatasourceError,
68
+ onExportError,
39
69
  onReady,
40
70
  onInitializationError,
41
- });
42
- useLayoutEffect(() => {
71
+ ]);
72
+ useCommitLayoutEffect(() => {
43
73
  const previous = publishedRef.current;
44
74
  if (previous && previous !== ref)
45
75
  publishGrid(previous, null);
@@ -76,7 +106,7 @@ export const SheetwriteGrid = forwardRef(function SheetwriteGrid(props, ref) {
76
106
  return;
77
107
  initializedRef.current = false;
78
108
  setInitializationState("error");
79
- handlers.current.onInitializationError?.(error);
109
+ handlers.current?.onInitializationError?.(error);
80
110
  });
81
111
  return () => {
82
112
  current = false;
@@ -95,9 +125,13 @@ export const SheetwriteGrid = forwardRef(function SheetwriteGrid(props, ref) {
95
125
  datasourceStorage,
96
126
  renderer,
97
127
  workerUrl,
128
+ presentation,
98
129
  renderers,
130
+ editors,
99
131
  protectionResolver,
100
132
  mutationPolicy,
133
+ transactionResourceLimits,
134
+ hyperlinkActivation,
101
135
  ...liveOptionsRef.current,
102
136
  };
103
137
  const previousOptions = previousOptionsRef.current;
@@ -105,29 +139,72 @@ export const SheetwriteGrid = forwardRef(function SheetwriteGrid(props, ref) {
105
139
  ? "initial"
106
140
  : ((previousOptions && getGridResetReason(previousOptions, options)) ?? "input-reset");
107
141
  const controller = createGridController(host, options, {
108
- onGridChange: (event) => handlers.current.onGridChange?.(event),
109
- onSelectionChange: (selection) => handlers.current.onSelectionChange?.(selection),
110
- onViewportChange: (event) => handlers.current.onViewportChange?.(event),
111
- onEditBegin: (event) => handlers.current.onEditBegin?.(event),
112
- onEditCommit: (event) => handlers.current.onEditCommit?.(event),
113
- onSearch: (result) => handlers.current.onSearch?.(result),
114
- onActiveSheetChange: (event) => handlers.current.onActiveSheetChange?.(event),
115
- });
142
+ onGridChange: (event) => handlers.current?.onGridChange?.(event),
143
+ onRowDelta: (projection) => handlers.current?.onRowDelta?.(projection),
144
+ onSelectionChange: (selection) => handlers.current?.onSelectionChange?.(selection),
145
+ onViewportChange: (event) => handlers.current?.onViewportChange?.(event),
146
+ onEditBegin: (event) => handlers.current?.onEditBegin?.(event),
147
+ onEditCommit: (event) => handlers.current?.onEditCommit?.(event),
148
+ onSearch: (result) => handlers.current?.onSearch?.(result),
149
+ onCommandStateChange: (event) => handlers.current?.onCommandStateChange?.(event),
150
+ onActiveSheetChange: (event) => handlers.current?.onActiveSheetChange?.(event),
151
+ onMutationRejected: (event) => handlers.current?.onMutationRejected?.(event),
152
+ onRendererFallback: (event) => handlers.current?.onRendererFallback?.(event),
153
+ onDatasourceError: (event) => handlers.current?.onDatasourceError?.(event),
154
+ onExportError: (event) => handlers.current?.onExportError?.(event),
155
+ }, rowBridge);
116
156
  controllerRef.current = controller;
117
157
  generationRef.current += 1;
118
- publishGrid(publishedRef.current, controller.grid);
119
- handlers.current.onReady?.({
120
- grid: controller.grid,
121
- generation: generationRef.current,
122
- reason,
123
- });
124
- previousOptionsRef.current = options;
125
- return () => {
126
- publishGrid(publishedRef.current, null);
158
+ let destroyed = false;
159
+ const teardown = (detachPublishedRef = false) => {
160
+ if (destroyed)
161
+ return;
162
+ destroyed = true;
127
163
  if (controllerRef.current === controller)
128
164
  controllerRef.current = null;
129
- controller.destroy();
165
+ const published = publishedRef.current;
166
+ let cleanupError;
167
+ let cleanupFailed = false;
168
+ try {
169
+ publishGrid(published, null);
170
+ }
171
+ catch (error) {
172
+ cleanupError = error;
173
+ cleanupFailed = true;
174
+ }
175
+ if (detachPublishedRef && publishedRef.current === published)
176
+ publishedRef.current = null;
177
+ try {
178
+ controller.destroy();
179
+ }
180
+ catch (error) {
181
+ cleanupError = cleanupFailed
182
+ ? new AggregateError([cleanupError, error], "Sheetwrite React controller cleanup failed")
183
+ : error;
184
+ cleanupFailed = true;
185
+ }
186
+ if (cleanupFailed)
187
+ throw cleanupError;
130
188
  };
189
+ try {
190
+ publishGrid(publishedRef.current, controller.grid);
191
+ handlers.current?.onReady?.({
192
+ grid: controller.grid,
193
+ generation: generationRef.current,
194
+ reason,
195
+ });
196
+ previousOptionsRef.current = options;
197
+ }
198
+ catch (error) {
199
+ try {
200
+ teardown(true);
201
+ }
202
+ catch (cleanupError) {
203
+ throw new AggregateError([error, cleanupError], "Sheetwrite React controller creation and cleanup failed");
204
+ }
205
+ throw error;
206
+ }
207
+ return teardown;
131
208
  }, [
132
209
  initializationState,
133
210
  workbook,
@@ -136,9 +213,14 @@ export const SheetwriteGrid = forwardRef(function SheetwriteGrid(props, ref) {
136
213
  datasourceStorage,
137
214
  renderer,
138
215
  workerUrl,
216
+ presentation,
139
217
  protectionResolver,
140
218
  mutationPolicy,
219
+ transactionResourceLimits,
220
+ hyperlinkActivation,
141
221
  renderers,
222
+ editors,
223
+ rowBridge,
142
224
  ]);
143
225
  useEffect(() => controllerRef.current?.setReadOnly(readOnly ?? false), [readOnly]);
144
226
  useEffect(() => controllerRef.current?.setConfig(config), [config]);
@@ -150,9 +232,17 @@ export const SheetwriteGrid = forwardRef(function SheetwriteGrid(props, ref) {
150
232
  const hostStyle = { ...style, ...sizing };
151
233
  return (_jsx("div", { ...hostAttributes, ref: hostRef, className: hostClassName, style: hostStyle, children: initializationState === "ready" ? null : fallback }));
152
234
  });
153
- const SheetwriteComponent = forwardRef(function Sheetwrite({ columns, defaultRows, sheetName, ...props }, ref) {
235
+ /** Advanced framework component with inferred row-bridge identity. */
236
+ export const SheetwriteGrid = SheetwriteGridComponent;
237
+ const SheetwriteComponent = forwardRef(function Sheetwrite({ columns, defaultRows, sheetName, getRowId, createRowId, ...props }, ref) {
154
238
  const input = useMemo(() => createSimpleGridInput({ columns, defaultRows, sheetName }), [columns, defaultRows, sheetName]);
155
- return _jsx(SheetwriteGrid, { ...props, ...input, ref: ref });
239
+ const rowBridge = useMemo(() => createSimpleRowBridge({
240
+ columns,
241
+ defaultRows,
242
+ ...(getRowId === undefined ? {} : { getRowId }),
243
+ ...(createRowId === undefined ? {} : { createRowId }),
244
+ }), [columns, defaultRows, getRowId, createRowId]);
245
+ return _jsx(SheetwriteGrid, { ...props, ...input, rowBridge: rowBridge, ref: ref });
156
246
  });
157
247
  /**
158
248
  * Convenience component for local object rows. It derives a single-sheet workbook from
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.tsx"],"names":[],"mappings":";AAAA,OAAO,EAIL,cAAc,EACd,iBAAiB,GAClB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EAKrB,kBAAkB,EAClB,aAAa,GAGd,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAGL,UAAU,EAIV,SAAS,EACT,eAAe,EACf,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAEf,SAAS,WAAW,CAAC,GAAuB,EAAE,IAAiB;IAC7D,IAAI,OAAO,GAAG,KAAK,UAAU;QAAE,GAAG,CAAC,IAAI,CAAC,CAAC;SACpC,IAAI,GAAG;QAAE,GAAG,CAAC,OAAO,GAAG,IAAI,C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}
package/package.json CHANGED
@@ -1,17 +1,17 @@
1
1
  {
2
2
  "name": "@sheetwrite/react",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "description": "React adapter for Sheetwrite.",
6
6
  "license": "MIT",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/chh-ay/Sheetwrite.git",
9
+ "url": "git+https://github.com/chh-ay/sheetwrite.git",
10
10
  "directory": "packages/react"
11
11
  },
12
- "homepage": "https://chh-ay.github.io/Sheetwrite/",
12
+ "homepage": "https://sheetwrite.vercel.app/",
13
13
  "bugs": {
14
- "url": "https://github.com/chh-ay/Sheetwrite/issues"
14
+ "url": "https://github.com/chh-ay/sheetwrite/issues"
15
15
  },
16
16
  "keywords": [
17
17
  "spreadsheet",
@@ -45,6 +45,6 @@
45
45
  "react": ">=18"
46
46
  },
47
47
  "dependencies": {
48
- "@sheetwrite/core": "0.1.0"
48
+ "@sheetwrite/core": "0.3.0"
49
49
  }
50
50
  }