@sheetxl/grid-react 0.8.0-beta.4 → 0.8.0-beta.6

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sheetxl/grid-react",
3
3
  "description": "Grid React - Advanced grid component for React",
4
- "version": "0.8.0-beta.4",
4
+ "version": "0.8.0-beta.6",
5
5
  "license": "SEE LICENSE IN <LICENSE>",
6
6
  "type": "module",
7
7
  "exports": {
@@ -42,8 +42,8 @@
42
42
  ],
43
43
  "dependencies": {
44
44
  "@floating-ui/react-dom": "^2.1.9",
45
- "@sheetxl/utils": "^0.8.0-beta.4",
46
- "@sheetxl/utils-react": "^0.8.0-beta.4",
45
+ "@sheetxl/utils": "^0.8.0-beta.6",
46
+ "@sheetxl/utils-react": "^0.8.0-beta.6",
47
47
  "clsx": "^2.1.1",
48
48
  "react-merge-refs": "^3.0.2",
49
49
  "react-use": "^17.6.1",
@@ -60,10 +60,15 @@ export interface EditorLayerProps<C, D = string, A = EditCommitArgs> extends Vir
60
60
  * Always-mounted inline cell editor, as a grid layer.
61
61
  *
62
62
  * @remarks
63
- * The input is mounted for the life of the grid (hidden when idle);
64
- * starting an edit just seeds the first character **by value** into the {@link IEditable} and
65
- * focuses the input. Render it inside `renderLayers`; with frozen panes each pane instantiates one,
66
- * and only the pane containing the active cell shows it.
63
+ * The input is mounted for the life of the grid (hidden when idle); starting an edit seeds the first
64
+ * character **by value** into the {@link IEditable} and focuses the input. Mount it as the grid's LAST
65
+ * child so the box paints over everything; with frozen panes each pane instantiates one, and only the
66
+ * pane containing the active cell shows it.
67
+ *
68
+ * This layer carries no event handlers. The ready-mode starters (typed key / F2 / double-click) are
69
+ * the {@link EditorStartLayer}, mounted as the grid's FIRST child: a Layer's handlers are its slot's
70
+ * tap, heard on every layer's turn top first, so start handlers on the top layer would intercept keys
71
+ * and double-clicks aimed at any widget below it before that widget's own handlers ran.
67
72
  */
68
73
  export declare function EditorLayer<C, D = string, A = EditCommitArgs>(props: EditorLayerProps<C, D, A>): React.ReactElement;
69
74
  //# sourceMappingURL=EditorLayer.d.ts.map
@@ -0,0 +1,32 @@
1
+ import { EditCommitArgs } from './EditState';
2
+ import { IEditable } from './DefaultEditable';
3
+ /**
4
+ * Props for {@link EditorStartLayer}.
5
+ *
6
+ * @typeParam C - The clean value type. @typeParam D - The dirty value type. @typeParam A - Commit args.
7
+ */
8
+ export interface EditorStartLayerProps<C, D = string, A = EditCommitArgs> {
9
+ /** The editable to start edits on — the same instance the {@link EditorLayer} renders. */
10
+ editable: IEditable<C, D, A>;
11
+ }
12
+ /**
13
+ * The grid's **ready-mode** edit starters, as a content-less grid layer: a typed character / `F2` /
14
+ * `Backspace` opens an edit on the anchor, a double-click opens one on the cell under the pointer.
15
+ *
16
+ * @remarks
17
+ * This is deliberately a separate layer from the {@link EditorLayer} that paints the box. The box must
18
+ * sit at the **top** of the stack to paint over everything, but a Layer's handlers are its slot's tap
19
+ * — grid-wide ears that fire on every layer's turn, top first — so handlers on the top layer would
20
+ * intercept keys and double-clicks aimed at any widget below it (a chart, a note) before that widget's
21
+ * own handlers ran. Starting an edit is the grid *floor's* behavior: it belongs at the **bottom** of
22
+ * the stack, where it only hears what no widget above consumed. Mount it as the grid's first child.
23
+ *
24
+ * Keys are positionless, so the floor position alone is not enough for them: a focused widget that
25
+ * does not consume a printable key (it has no use for it, and must let keys through so its own
26
+ * commands can resolve) would otherwise still reach this tap. The key start therefore acts only when
27
+ * the key is aimed at the grid surface itself — the surface is the focused element — which is what
28
+ * "the grid is in ready mode" means. A double-click needs no such guard: it has a position, and a
29
+ * widget that owns that position consumes it.
30
+ */
31
+ export declare function EditorStartLayer<C, D = string, A = EditCommitArgs>(props: EditorStartLayerProps<C, D, A>): React.ReactElement;
32
+ //# sourceMappingURL=EditorStartLayer.d.ts.map
@@ -6,5 +6,6 @@ export * from './DefaultEditable';
6
6
  export * from './EditorPlacement';
7
7
  export * from './EditorInput';
8
8
  export * from './EditorLayer';
9
+ export * from './EditorStartLayer';
9
10
  export * from './EditorDiv';
10
11
  //# sourceMappingURL=index.d.ts.map