@sheetxl/grid-react 0.7.27 → 0.7.28-beta.1
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 +502 -2
- package/browser/cjs/index.cjs +3 -12
- package/browser/esm/index.mjs +5797 -1867
- package/licenses/dependencies.txt +143 -41
- package/node/esm/index.mjs +4951 -1861
- package/package.json +7 -6
- package/types/index.d.ts +2 -1503
- package/types/src/cell/CellLayer.d.ts +70 -0
- package/types/src/cell/CellRenderer.d.ts +42 -0
- package/types/src/cell/DefaultCellRenderer.d.ts +6 -0
- package/types/src/cell/GridlineLayer.d.ts +38 -0
- package/types/src/cell/Types.d.ts +12 -0
- package/types/src/cell/_CellModel.d.ts +82 -0
- package/types/src/cell/index.d.ts +6 -0
- package/types/src/editor/DefaultEditable.d.ts +121 -0
- package/types/src/editor/EditSession.d.ts +182 -0
- package/types/src/editor/EditState.d.ts +61 -0
- package/types/src/editor/EditorDiv.d.ts +65 -0
- package/types/src/editor/EditorInput.d.ts +88 -0
- package/types/src/editor/EditorLayer.d.ts +69 -0
- package/types/src/editor/EditorPlacement.d.ts +38 -0
- package/types/src/editor/index.d.ts +10 -0
- package/types/src/editor/useEditorKeymap.d.ts +74 -0
- package/types/src/grid/Grid.d.ts +16 -0
- package/types/src/grid/IGrid.d.ts +93 -0
- package/types/src/grid/index.d.ts +3 -0
- package/types/src/header/HeaderDividerAnchor.d.ts +120 -0
- package/types/src/header/index.d.ts +3 -0
- package/types/src/header/useHeaderSelectionPointer.d.ts +122 -0
- package/types/src/index.d.ts +13 -0
- package/types/src/layer/HoverTipLayer.d.ts +74 -0
- package/types/src/layer/Layer.d.ts +92 -0
- package/types/src/layer/LayerTypes.d.ts +47 -0
- package/types/src/layer/RangePrompt.d.ts +42 -0
- package/types/src/layer/Stage.d.ts +147 -0
- package/types/src/layer/StickyAnchor.d.ts +83 -0
- package/types/src/layer/StickyFloat.d.ts +65 -0
- package/types/src/layer/VirtualDiv.d.ts +59 -0
- package/types/src/layer/_Utils.d.ts +37 -0
- package/types/src/layer/index.d.ts +11 -0
- package/types/src/layer/useGridAnchor.d.ts +157 -0
- package/types/src/layer/useHoverIntent.d.ts +49 -0
- package/types/src/layer/useLayerResponder.d.ts +29 -0
- package/types/src/layer/usePlacement.d.ts +18 -0
- package/types/src/layer/useRangeHover.d.ts +35 -0
- package/types/src/list/CheckboxList.d.ts +63 -0
- package/types/src/list/List.d.ts +55 -0
- package/types/src/list/index.d.ts +3 -0
- package/types/src/metrics/Types.d.ts +23 -0
- package/types/src/metrics/index.d.ts +3 -0
- package/types/src/metrics/useGridMetrics.d.ts +67 -0
- package/types/src/range/DragHandle.d.ts +129 -0
- package/types/src/range/Draggable.d.ts +86 -0
- package/types/src/range/FillHandle.d.ts +54 -0
- package/types/src/range/RangeRect.d.ts +36 -0
- package/types/src/range/RangeResizer.d.ts +68 -0
- package/types/src/range/RangeStyle.d.ts +8 -0
- package/types/src/range/index.d.ts +13 -0
- package/types/src/selection/DefaultSelection.d.ts +59 -0
- package/types/src/selection/ICellAnchor.d.ts +21 -0
- package/types/src/selection/ISelection.d.ts +65 -0
- package/types/src/selection/RangesPickerLayer.d.ts +128 -0
- package/types/src/selection/SelectionLayer.d.ts +179 -0
- package/types/src/selection/SelectionStyle.d.ts +28 -0
- package/types/src/selection/SelectionTouchGrips.d.ts +29 -0
- package/types/src/selection/SelectionUtils.d.ts +2 -0
- package/types/src/selection/Types.d.ts +67 -0
- package/types/src/selection/_SelectionNavigation.d.ts +6 -0
- package/types/src/selection/_SelectionUtils.d.ts +7 -0
- package/types/src/selection/index.d.ts +12 -0
- package/types/src/selection/useDragCells.d.ts +218 -0
- package/types/src/selection/useSelectionPointer.d.ts +70 -0
- package/types/src/surface/GridPane.d.ts +85 -0
- package/types/src/surface/GridPaneProvider.d.ts +37 -0
- package/types/src/surface/GridSurface.d.ts +11 -0
- package/types/src/surface/IGridPane.d.ts +288 -0
- package/types/src/surface/IGridSurface.d.ts +141 -0
- package/types/src/surface/SurfaceStateProvider.d.ts +50 -0
- package/types/src/surface/_GridUtils.d.ts +37 -0
- package/types/src/surface/index.d.ts +7 -0
- package/types/src/surface/useGridPane.d.ts +31 -0
- package/types/src/surface/useSurfaceState.d.ts +22 -0
- package/types/src/svg/LineSVG.d.ts +13 -0
- package/types/src/svg/RectangleSVG.d.ts +114 -0
- package/types/src/svg/ShapeBounds.d.ts +15 -0
- package/types/src/svg/Types.d.ts +37 -0
- package/types/src/svg/index.d.ts +9 -0
- package/types/src/theme/GridTheme.d.ts +56 -0
- package/types/src/theme/index.d.ts +2 -0
- package/node/assets/style.css +0 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CellCoords } from '@sheetxl/utils';
|
|
3
|
+
import { LayerProps } from '../layer';
|
|
4
|
+
import { CellRendererProps } from './CellRenderer';
|
|
5
|
+
import { CellModelOptions } from './_CellModel';
|
|
6
|
+
/**
|
|
7
|
+
* Props for {@link CellTileDiv} — the tiled cell content WITHOUT a layer: everything the tiling
|
|
8
|
+
* engine needs, none of the z-slot concerns.
|
|
9
|
+
*/
|
|
10
|
+
export interface CellTileDivProps extends CellModelOptions {
|
|
11
|
+
/** Class for the tiling-origin box (devtools identification). */
|
|
12
|
+
className?: string;
|
|
13
|
+
/** Style merged UNDER the scroll-carry transform (which must win). */
|
|
14
|
+
style?: React.CSSProperties;
|
|
15
|
+
/**
|
|
16
|
+
* Render one cell. Called a lot — keep it cheap. Mirrors `GridSurface.renderCells`.
|
|
17
|
+
*/
|
|
18
|
+
renderCell: (props: CellRendererProps) => React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Opaque cache-bust token. The per-cell render cache survives scrolling (cells keep their
|
|
21
|
+
* absolute position), but must be dropped when cell CONTENT or geometry changes. Pass a value
|
|
22
|
+
* whose identity changes on invalidate / metrics change (and NOT on scroll); a new identity
|
|
23
|
+
* drops the cache. `renderCell` identity is always also treated as a bust.
|
|
24
|
+
*/
|
|
25
|
+
cacheToken?: unknown;
|
|
26
|
+
/**
|
|
27
|
+
* Visually suppress the cell at these SHEET-absolute coordinates — WITHOUT invalidating anything.
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* Transient per-coordinate state (a cell hidden under an open editor / a custom single-cell
|
|
31
|
+
* overlay) must not live inside the tile snapshots, or every change would rebuild tiles. This is
|
|
32
|
+
* the live channel: one scoped CSS rule targeting the cell's `data-rc` stamp (see
|
|
33
|
+
* `CellRendererProps`), so cached, rebuilt, and scrolled-back-in tiles all honor it for free.
|
|
34
|
+
* `visibility: hidden` (not `opacity`) so the suppressed cell — including any text overflowing
|
|
35
|
+
* its bounds, and a hyperlink that opted back into pointer-events — is neither visible nor
|
|
36
|
+
* hit-testable. Distinct from `hiddenCellAt`, which is a structural scan-time skip.
|
|
37
|
+
*/
|
|
38
|
+
suppressCell?: CellCoords | null;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* {@link CellLayer} is the cells' **layer**: a {@link Layer} (its z-slot; tap props forward to it)
|
|
42
|
+
* hosting one {@link CellTileDiv}. Use it directly as a grid child when the cells are the layer's
|
|
43
|
+
* ONLY content; a composite layer that hosts more than the tiles (an overlay peer of the cells)
|
|
44
|
+
* renders its own `Layer` with a `CellTileDiv` inside instead. `className` merges onto the layer's
|
|
45
|
+
* boundary div and `style` merges under the scroll transform (which must win).
|
|
46
|
+
*/
|
|
47
|
+
export interface CellLayerProps extends Omit<LayerProps, 'children'>, CellTileDivProps {
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The tiled cell content — a full-view scroll-carry {@link VirtualDiv} of immutable tile
|
|
51
|
+
* snapshots, plus the live per-coordinate suppression rule. NOT a layer: it is hosted inside one
|
|
52
|
+
* (see {@link CellLayer} for the direct-use wrapper), so a composite layer can stack overlay
|
|
53
|
+
* content beside the tiles within its single z-slot.
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* Tiles (segment containers) are positioned in ABSOLUTE content space (`tileIndex * SEGMENT_SIZE`),
|
|
57
|
+
* so a tile is a pure function of its tile coordinate — an immutable snapshot. A single outer
|
|
58
|
+
* `<div>` translates the whole content by `-origin` to carry the scroll. The tile tree is
|
|
59
|
+
* `useMemo`'d on the visible RANGE (+ content token), NOT the pixel scroll: within a range, every
|
|
60
|
+
* cell's absolute position is invariant (`origin + bounds.x` is constant as scroll shifts both
|
|
61
|
+
* terms oppositely), so a sub-tile scroll reuses the exact same tile tree and only re-renders the
|
|
62
|
+
* one outer element. Net on-screen position is identical to the classic path (`= bounds.x`).
|
|
63
|
+
*/
|
|
64
|
+
export declare const CellTileDiv: React.MemoExoticComponent<(props: CellTileDivProps) => React.JSX.Element>;
|
|
65
|
+
/**
|
|
66
|
+
* CellLayer — the thin direct-use wrapper: one {@link Layer} (its z-slot; tap props forward)
|
|
67
|
+
* hosting one {@link CellTileDiv}. See {@link CellTileDiv} for the tiling model.
|
|
68
|
+
*/
|
|
69
|
+
export declare const CellLayer: React.MemoExoticComponent<(props: CellLayerProps) => React.JSX.Element>;
|
|
70
|
+
//# sourceMappingURL=CellLayer.d.ts.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Bounds, CellCoords, RangeCoords } from '@sheetxl/utils';
|
|
2
|
+
import { IGridPane } from '../surface';
|
|
3
|
+
export interface CellRendererProps<T = any> extends React.HTMLAttributes<HTMLElement>, React.Attributes {
|
|
4
|
+
/**
|
|
5
|
+
* A value to render.
|
|
6
|
+
*/
|
|
7
|
+
value: T;
|
|
8
|
+
/**
|
|
9
|
+
* The view that is rendering a collection of cells.
|
|
10
|
+
*/
|
|
11
|
+
pane: IGridPane;
|
|
12
|
+
/**
|
|
13
|
+
* The range bounds relative to the current viewport and zoom.
|
|
14
|
+
*/
|
|
15
|
+
bounds: Bounds;
|
|
16
|
+
/**
|
|
17
|
+
* The cell coords that is being rendered.
|
|
18
|
+
*/
|
|
19
|
+
cell: CellCoords;
|
|
20
|
+
/**
|
|
21
|
+
* The RangeCoords that is being rendered.
|
|
22
|
+
*
|
|
23
|
+
* @defaultValue A range representing the coords
|
|
24
|
+
*
|
|
25
|
+
* @remarks
|
|
26
|
+
* For most cells this is the same as the coords. This will only be different for spanning cells.
|
|
27
|
+
*/
|
|
28
|
+
range?: RangeCoords;
|
|
29
|
+
/**
|
|
30
|
+
* Absolute cell-coordinate stamp (`"rowIndex:colIndex"`), provided by the layer.
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* A renderer that spreads its rest props onto its root element carries this automatically; a
|
|
34
|
+
* custom renderer must place it on its root itself. It is the hook the layer's live suppression
|
|
35
|
+
* rule targets (see `CellLayerProps.suppressCell`) — per-coordinate CSS over immutable cached
|
|
36
|
+
* tiles, so transient state (an open editor) never invalidates the tile cache. Coordinates are
|
|
37
|
+
* SHEET-absolute (never tile- or pane-relative): a cell rendered in more than one pane (a merge
|
|
38
|
+
* spanning a freeze line) matches the one selector in every instance.
|
|
39
|
+
*/
|
|
40
|
+
'data-rc'?: string;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=CellRenderer.d.ts.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CellRendererProps } from './CellRenderer';
|
|
2
|
+
/**
|
|
3
|
+
* Default cell component capable of rendering a value.
|
|
4
|
+
*/
|
|
5
|
+
export declare const DefaultCellRenderer: import('react').MemoExoticComponent<(props: CellRendererProps) => import("react").JSX.Element>;
|
|
6
|
+
//# sourceMappingURL=DefaultCellRenderer.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { OrientationFlags } from '@sheetxl/utils';
|
|
3
|
+
import { LayerProps } from '../layer';
|
|
4
|
+
import { CellModelOptions } from './_CellModel';
|
|
5
|
+
/**
|
|
6
|
+
* {@link GridlineLayer} is the gridlines' **layer**: a {@link Layer} (its z-slot; tap props forward
|
|
7
|
+
* to it) hosting its two axis `<svg>`s inside one full-view, pointer-transparent {@link VirtualDiv}
|
|
8
|
+
* (a decoration host). Use it directly as a grid child. `className`/`style` apply to the host box.
|
|
9
|
+
*/
|
|
10
|
+
export interface GridlineLayerProps extends Omit<LayerProps, 'children'>, CellModelOptions {
|
|
11
|
+
/** Class for the host box (devtools identification). */
|
|
12
|
+
className?: string;
|
|
13
|
+
/** Style for the host box. */
|
|
14
|
+
style?: React.CSSProperties;
|
|
15
|
+
/**
|
|
16
|
+
* Show grid lines. `true` shows both; an {@link OrientationFlags} partial toggles each axis.
|
|
17
|
+
*
|
|
18
|
+
* @defaultValue true
|
|
19
|
+
*/
|
|
20
|
+
showGridLines?: boolean | Partial<OrientationFlags>;
|
|
21
|
+
/**
|
|
22
|
+
* Grid line color. Overridden per-axis by {@link GridlineLayerProps.propsRows} /
|
|
23
|
+
* {@link GridlineLayerProps.propsColumns}.
|
|
24
|
+
*/
|
|
25
|
+
gridLineColor?: string;
|
|
26
|
+
/** Per-`<path>` props for the horizontal (row) lines. */
|
|
27
|
+
propsRows?: React.SVGProps<SVGPathElement>;
|
|
28
|
+
/** Per-`<path>` props for the vertical (column) lines. */
|
|
29
|
+
propsColumns?: React.SVGProps<SVGPathElement>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A **layer** (pane-aware): paints the gridlines for its pane, broken around merged cells, inside a
|
|
33
|
+
* single full-pane {@link Layer} host box. Sources the merge spans from the merges-only
|
|
34
|
+
* {@link getMergedRanges} pass — index-space, memoized on the visible RANGE (not pixel scroll), so
|
|
35
|
+
* ordinary scroll frames re-render this layer without re-scanning a single cell.
|
|
36
|
+
*/
|
|
37
|
+
export declare const GridlineLayer: React.MemoExoticComponent<(props: GridlineLayerProps) => React.JSX.Element | null>;
|
|
38
|
+
//# sourceMappingURL=GridlineLayer.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { CellCoords, RangeCoords, Bounds } from '@sheetxl/utils';
|
|
2
|
+
/**
|
|
3
|
+
* A single cell resolved for rendering: its anchor coords, the range it occupies (a 1x1 range for
|
|
4
|
+
* a normal cell, larger for a merge), the pane-relative bounds, and an optional pre-resolved value.
|
|
5
|
+
*/
|
|
6
|
+
export interface VisibleCell {
|
|
7
|
+
cell: CellCoords;
|
|
8
|
+
range?: RangeCoords;
|
|
9
|
+
bounds?: Bounds;
|
|
10
|
+
value?: any;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=Types.d.ts.map
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { CellCoords, RangeCoords } from '@sheetxl/utils';
|
|
2
|
+
import { IGridPane } from '../surface';
|
|
3
|
+
import { VisibleCell } from './Types';
|
|
4
|
+
/**
|
|
5
|
+
* The "what is visible right now" pass for a single pane.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* {@link CellLayer} renders `cells`. {@link GridlineLayer} needs only the spans — it consumes the
|
|
9
|
+
* dedicated merges-only {@link getMergedRanges} pass (same source semantics, no cell allocation)
|
|
10
|
+
* rather than this full model.
|
|
11
|
+
*/
|
|
12
|
+
export interface CellModel {
|
|
13
|
+
/** Visible cells (merge-deduped: only the anchor of a merge appears). */
|
|
14
|
+
cells: VisibleCell[];
|
|
15
|
+
/** Merged ranges spanning more than one ROW — horizontal gridlines break around these. */
|
|
16
|
+
rangesH: RangeCoords[];
|
|
17
|
+
/** Merged ranges spanning more than one COLUMN — vertical gridlines break around these. */
|
|
18
|
+
rangesV: RangeCoords[];
|
|
19
|
+
}
|
|
20
|
+
export interface CellModelOptions {
|
|
21
|
+
/**
|
|
22
|
+
* Optimization hook: return exactly the cells worth rendering for this pane. When omitted, every
|
|
23
|
+
* visible cell is iterated and {@link CellModelOptions.hiddenCellAt} is consulted.
|
|
24
|
+
*
|
|
25
|
+
* @param range Overrides the visible range (the buffered/tiled CellLayer passes a window that
|
|
26
|
+
* extends past the visible edge). When omitted, the implementation uses the pane's visible range.
|
|
27
|
+
*/
|
|
28
|
+
getVisibleCells?: (pane: IGridPane, range?: RangeCoords) => (VisibleCell | CellCoords)[];
|
|
29
|
+
/**
|
|
30
|
+
* Skip a cell that has nothing to render. Ignored for merged cells (a merge is always considered)
|
|
31
|
+
* and ignored entirely when {@link CellModelOptions.getVisibleCells} is provided.
|
|
32
|
+
*/
|
|
33
|
+
hiddenCellAt?: (coords: CellCoords) => boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Render cells for this range instead of just the visible range — an overscan buffer so scrolling
|
|
36
|
+
* within it needs no recompute. Cells outside the visible range get their geometry from
|
|
37
|
+
* `getBoundsFromRange` (they are not in the visible offset maps). Used by the tiled CellLayer.
|
|
38
|
+
*/
|
|
39
|
+
bufferRange?: RangeCoords;
|
|
40
|
+
/**
|
|
41
|
+
* Content-version token (cache-key only; ignored by {@link computeCellModel}). A new identity busts
|
|
42
|
+
* the {@link getCellModel} memo so a content edit recomputes the model immediately — without it the
|
|
43
|
+
* model cache (keyed on scroll + callback identity) would return the pre-edit cells for a frame,
|
|
44
|
+
* since an in-place value edit changes neither the scroll key nor the callback identities. Pass the
|
|
45
|
+
* same token CellLayer uses to drop its tile cache so both invalidate in lockstep.
|
|
46
|
+
*/
|
|
47
|
+
cacheToken?: unknown;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Compute the visible cells + merge spans for a pane. Pure; no React. This is the ENUMERATION half
|
|
51
|
+
* of cell rendering — the tile bucketing / element rendering half lives in {@link CellLayer}.
|
|
52
|
+
*/
|
|
53
|
+
export declare const computeCellModel: (pane: IGridPane, options?: CellModelOptions) => CellModel;
|
|
54
|
+
export declare const getCellModel: (pane: IGridPane, options?: CellModelOptions) => CellModel;
|
|
55
|
+
/**
|
|
56
|
+
* The merge/extrusion spans of the visible window — the subset of {@link CellModel} that
|
|
57
|
+
* {@link GridlineLayer} consumes. Index-space only ({@link RangeCoords}), so unlike the full model it
|
|
58
|
+
* is invariant under sub-cell PIXEL scroll.
|
|
59
|
+
*/
|
|
60
|
+
export interface MergedRanges {
|
|
61
|
+
/** Spans covering more than one ROW — horizontal gridlines break around these. */
|
|
62
|
+
rangesH: RangeCoords[];
|
|
63
|
+
/** Spans covering more than one COLUMN — vertical gridlines break around these. */
|
|
64
|
+
rangesV: RangeCoords[];
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Merges-only sibling of {@link computeCellModel}: collect just the spanned ranges (merges +
|
|
68
|
+
* extrusions) intersecting the pane's visible window. No cell array, no bounds resolution, no
|
|
69
|
+
* per-cell allocation — the full model allocates ~a-thousand `VisibleCell`s just to throw them away
|
|
70
|
+
* when the caller (gridlines) only breaks lines around spans.
|
|
71
|
+
*
|
|
72
|
+
* @remarks
|
|
73
|
+
* `hiddenCellAt` is deliberately not consulted: it is documented as ignored for merged cells, and a
|
|
74
|
+
* single (non-spanned) cell contributes nothing here — so it cannot affect this output.
|
|
75
|
+
*/
|
|
76
|
+
export declare const computeMergedRanges: (pane: IGridPane, options?: CellModelOptions) => MergedRanges;
|
|
77
|
+
export declare const getMergedRanges: (pane: IGridPane, options?: CellModelOptions) => MergedRanges;
|
|
78
|
+
/**
|
|
79
|
+
* Create a stringified cell identifier.
|
|
80
|
+
*/
|
|
81
|
+
export declare const cellIdentifier: (rowIndex: number, colIndex: number) => string;
|
|
82
|
+
//# sourceMappingURL=_CellModel.d.ts.map
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { CellCoords } from '@sheetxl/utils';
|
|
2
|
+
import { ICellAnchor } from '../selection';
|
|
3
|
+
import { EditCommitArgs } from './EditState';
|
|
4
|
+
import { EditSession, StartEditOptions, EditModel } from './EditSession';
|
|
5
|
+
/**
|
|
6
|
+
* How to edit a cell — supplied by whoever builds the editable. Returns the {@link EditModel} bits
|
|
7
|
+
* (`clean` + `commit`) for the cell, or `null` if the cell is not editable. The editable wraps these
|
|
8
|
+
* in an {@link EditSession}; the author never constructs one.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* An implementation detail of {@link DefaultEditable}, not part of the layer-facing contract. Collapses
|
|
12
|
+
* the former `getClean` + `canEdit` + `commit` (`null` ⇒ "not editable"). A story closes over a values
|
|
13
|
+
* map; the real app reads an `ISheet` (and returns `null` for a protected cell).
|
|
14
|
+
*
|
|
15
|
+
* @typeParam C - clean type. @typeParam D - dirty type. @typeParam A - commit args.
|
|
16
|
+
*/
|
|
17
|
+
export type CreateEdit<C, D = string, A = EditCommitArgs> = (coords: CellCoords) => EditModel<C, D, A> | null;
|
|
18
|
+
/**
|
|
19
|
+
* The thing a grid edits **through** — owns the active-cell anchor and the **single** current edit,
|
|
20
|
+
* and is the one place an edit is started/committed/cancelled. The parallel of {@link ICellAnchor}:
|
|
21
|
+
* where the selection owns the current coords, the editable owns the current {@link EditSession}.
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* The layer-facing contract. {@link EditorLayer} and the formula bar share one instance and drive it
|
|
25
|
+
* (`startEdit`/`commit`/`cancel`); an app-side bridge can publish {@link getSession} onto the edit-mode
|
|
26
|
+
* bus on each `subscribe` notification. It does **not** vend sessions — there is only
|
|
27
|
+
* ever one active edit, held here. {@link DefaultEditable} is the default implementation; the real app
|
|
28
|
+
* supplies its own (or reuses it with an `ISheet`-backed {@link CreateEdit}).
|
|
29
|
+
*
|
|
30
|
+
* @typeParam C - clean type. @typeParam D - dirty type. @typeParam A - commit args.
|
|
31
|
+
*/
|
|
32
|
+
export interface IEditable<C, D = string, A = EditCommitArgs> {
|
|
33
|
+
/**
|
|
34
|
+
* The active-cell anchor, as {@link ICellAnchor}. The editor reads it (`getCoords`/`subscribe`) to
|
|
35
|
+
* follow the active cell and detect click-away; it cannot move it (navigation is the selection's
|
|
36
|
+
* job — the anchor read view is intentionally setter-less).
|
|
37
|
+
*/
|
|
38
|
+
getAnchor(): ICellAnchor;
|
|
39
|
+
/** The current edit session, or `null` when idle. */
|
|
40
|
+
getSession(): EditSession<C, D, A> | null;
|
|
41
|
+
/** Subscribe to session changes (start/stop only). Returns an unsubscribe. */
|
|
42
|
+
subscribe(listener: () => void): () => void;
|
|
43
|
+
/** Begin an edit on `coords`. Returns `false` (and does nothing) if the cell is not editable. */
|
|
44
|
+
startEdit(coords: CellCoords, options?: StartEditOptions<D>): boolean;
|
|
45
|
+
/** Commit the current edit. On success clears the session; returns whether it succeeded. */
|
|
46
|
+
commit(args?: A): boolean;
|
|
47
|
+
/** Cancel the current edit (revert + clear the session). */
|
|
48
|
+
cancel(): void;
|
|
49
|
+
/**
|
|
50
|
+
* Tear the editable down: unsubscribe from the anchor (the click-away watch) and cancel any live
|
|
51
|
+
* session. Call when the owning view/sheet goes away so a per-view/per-sheet editable doesn't keep
|
|
52
|
+
* observing (and mutating through) a dead anchor.
|
|
53
|
+
*/
|
|
54
|
+
dispose(): void;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The edit-mode bus payload published (as `EditMode.args`) while a cell edit is active: the live
|
|
58
|
+
* {@link IEditable} handle. Lives here, next to {@link IEditable}, so the publisher and every bus
|
|
59
|
+
* reader share one type instead of casting `args` loosely. The bus key for this mode is `'edit'`;
|
|
60
|
+
* the fine-grained enter/edit state is read from `editable.getSession()`, not the key.
|
|
61
|
+
*/
|
|
62
|
+
export interface EditModeEditArgs<C = any, D = any, A = any> {
|
|
63
|
+
editable: IEditable<C, D, A>;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Options for {@link DefaultEditable}.
|
|
67
|
+
*/
|
|
68
|
+
export interface DefaultEditableOptions {
|
|
69
|
+
/**
|
|
70
|
+
* The click-away **pre-commit gate** fallback: when the anchor moves off the edited cell and the
|
|
71
|
+
* commit FAILS (vetoed / rejected value), the session must not stay open on cell A while the
|
|
72
|
+
* selection sits on cell B. Supply this to pull the anchor **back to the edited cell** (Excel-style
|
|
73
|
+
* — an invalid entry keeps you in the cell); the owner — who holds the writable selection the
|
|
74
|
+
* anchor reads — performs the move. When omitted, the editable **cancels** the failed edit instead
|
|
75
|
+
* (the typed value is discarded, but session and selection stay in sync).
|
|
76
|
+
*/
|
|
77
|
+
revertAnchor?: (coords: CellCoords) => void;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* The default {@link IEditable}: holds the {@link ICellAnchor} anchor and the single current edit, and
|
|
81
|
+
* mints that edit (when started) via a {@link CreateEdit} callback.
|
|
82
|
+
*
|
|
83
|
+
* @remarks
|
|
84
|
+
* One per workbook, passed by reference to every `EditorLayer` and the formula bar. Its `subscribe`
|
|
85
|
+
* fires **only** on a current-edit change (start/stop) — anchor changes are observed directly on the
|
|
86
|
+
* anchor; the edit's per-keystroke *value* updates live on the {@link EditSession}'s own `subscribe`.
|
|
87
|
+
*
|
|
88
|
+
* It owns the **click-away** rule: it watches the anchor and commits the current edit when the active
|
|
89
|
+
* cell moves off the edited cell — so the layer never has to. (When Point mode lands, this is where an
|
|
90
|
+
* anchor move would instead route a reference into the edit rather than commit.)
|
|
91
|
+
*
|
|
92
|
+
* Methods are plain (unbound) — consumers read it via `useBoundSyncExternalStore` (or its optional
|
|
93
|
+
* variant), which calls `subscribe`/the snapshot selector on the instance, so no per-method binding
|
|
94
|
+
* is needed.
|
|
95
|
+
*/
|
|
96
|
+
export declare class DefaultEditable<C, D = string, A = EditCommitArgs> implements IEditable<C, D, A> {
|
|
97
|
+
private readonly anchor;
|
|
98
|
+
private readonly createEdit;
|
|
99
|
+
private readonly revertAnchor?;
|
|
100
|
+
private readonly unsubscribeAnchor;
|
|
101
|
+
private current;
|
|
102
|
+
private readonly listeners;
|
|
103
|
+
constructor(anchor: ICellAnchor, createEdit: CreateEdit<C, D, A>, options?: DefaultEditableOptions);
|
|
104
|
+
private onAnchorChange;
|
|
105
|
+
/** @inheritdoc IEditable.getAnchor */
|
|
106
|
+
getAnchor(): ICellAnchor;
|
|
107
|
+
/** @inheritdoc IEditable.subscribe */
|
|
108
|
+
subscribe(listener: () => void): () => void;
|
|
109
|
+
/** @inheritdoc IEditable.getSession */
|
|
110
|
+
getSession(): EditSession<C, D, A> | null;
|
|
111
|
+
/** @inheritdoc IEditable.startEdit */
|
|
112
|
+
startEdit(coords: CellCoords, options?: StartEditOptions<D>): boolean;
|
|
113
|
+
/** @inheritdoc IEditable.commit */
|
|
114
|
+
commit(args?: A): boolean;
|
|
115
|
+
/** @inheritdoc IEditable.cancel */
|
|
116
|
+
cancel(): void;
|
|
117
|
+
/** @inheritdoc IEditable.dispose */
|
|
118
|
+
dispose(): void;
|
|
119
|
+
private notify;
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=DefaultEditable.d.ts.map
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
import { CellCoords } from '@sheetxl/utils';
|
|
2
|
+
import { ICellAnchor } from '../selection';
|
|
3
|
+
import { EditState, EditorMode, EditorTextSelection, EditCommitArgs } from './EditState';
|
|
4
|
+
/**
|
|
5
|
+
* The imperative handle a caret-owning **input** exposes for **caret-dependent** operations — the input
|
|
6
|
+
* analog of the selection's `SelectionNavigation`. These act on *this input's* caret/selection, so they
|
|
7
|
+
* live on the view, not on any shared value: two inputs on the same cell (the inline editor + the formula
|
|
8
|
+
* bar) share the value but each has its own caret.
|
|
9
|
+
*
|
|
10
|
+
* @remarks
|
|
11
|
+
* Deliberately broader than "cell editor": not every range input is one (the formula bar is not). A
|
|
12
|
+
* cell editor registers on the {@link EditSession} it participates in
|
|
13
|
+
* ({@link EditSession.registerEditor}), reached via {@link EditSession.getActiveEditor}.
|
|
14
|
+
*
|
|
15
|
+
* Kept **spreadsheet-agnostic** — grid-react knows text inputs, not references. Reference-specific caret
|
|
16
|
+
* ops (F4 `$`-cycling, insert a picked reference) live on a `@sheetxl/react` subtype that extends this.
|
|
17
|
+
*/
|
|
18
|
+
export interface IInputHandle {
|
|
19
|
+
/** Insert `text` at the caret (replacing any selection); the caret ends up after it. */
|
|
20
|
+
insertText(text: string): void;
|
|
21
|
+
/** Select all of the input's text. */
|
|
22
|
+
selectAll(): void;
|
|
23
|
+
/**
|
|
24
|
+
* Place this input's caret / selection. The host-facing counterpart of the read-side caret ops: caret
|
|
25
|
+
* position is a **view** concern (each input owns its own), so a host that needs one parked somewhere —
|
|
26
|
+
* e.g. after the reference just picked — asks the input rather than the edit carrying a caret of its own.
|
|
27
|
+
*/
|
|
28
|
+
setSelection(selection: EditorTextSelection): void;
|
|
29
|
+
/** Focus this input (used by `toggleEditorFocus` to move the edit between inputs). */
|
|
30
|
+
focus(): void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The model-specific bits {@link CreateEdit} supplies for a cell: the captured clean value and how to
|
|
34
|
+
* write the dirty value back. Everything else (coords/dirty/mode/lifecycle) is the library's machinery.
|
|
35
|
+
*
|
|
36
|
+
* @typeParam C - clean type. @typeParam D - dirty type. @typeParam A - commit args.
|
|
37
|
+
*/
|
|
38
|
+
export interface EditModel<C, D = string, A = EditCommitArgs> {
|
|
39
|
+
/** The clean value, captured now (edit start). */
|
|
40
|
+
clean: C;
|
|
41
|
+
/** Write the dirty value to the model. Return `false`, or throw, to reject (keeps the edit open). */
|
|
42
|
+
commit(dirty: D, args?: A): boolean | void;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* What the {@link EditSession} constructor takes: the {@link EditModel} bits plus the cell. The owning
|
|
46
|
+
* {@link DefaultEditable} assembles this (model bits from `createEdit` + the coords it was asked to
|
|
47
|
+
* edit) — a `createEdit` author supplies only the {@link EditModel}.
|
|
48
|
+
*/
|
|
49
|
+
export interface EditSessionInit<C, D = string, A = EditCommitArgs> extends EditModel<C, D, A> {
|
|
50
|
+
/** The cell being edited. */
|
|
51
|
+
coords: CellCoords;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Options applied when an edit begins (`DefaultEditable.startEdit` → the `EditSession` constructor).
|
|
55
|
+
*
|
|
56
|
+
* @typeParam D - The dirty (working) value type.
|
|
57
|
+
*/
|
|
58
|
+
export interface StartEditOptions<D = string> {
|
|
59
|
+
/** @defaultValue `'enter'` */
|
|
60
|
+
mode?: EditorMode;
|
|
61
|
+
/** Seed dirty value (the "first keystroke, by value"). `undefined` keeps the clean value. */
|
|
62
|
+
dirty?: D;
|
|
63
|
+
/** Initial selection to apply on focus. */
|
|
64
|
+
initialSelection?: EditorTextSelection | null;
|
|
65
|
+
/** @defaultValue `true` */
|
|
66
|
+
autoFocus?: boolean;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Passed to each beforeCommit consumer ({@link EditSession.addCommitListener}). Call {@link veto} to
|
|
70
|
+
* reject the commit (the edit stays open and the leave-key does not navigate).
|
|
71
|
+
*/
|
|
72
|
+
export interface CommitContext<D = string, A = EditCommitArgs> {
|
|
73
|
+
readonly coords: CellCoords;
|
|
74
|
+
/**
|
|
75
|
+
* The working value being committed, or `undefined` for a **no-op** commit (nothing typed — the
|
|
76
|
+
* model is not written, but listeners still run and may veto, e.g. to hold the session open).
|
|
77
|
+
*/
|
|
78
|
+
readonly dirty: D | undefined;
|
|
79
|
+
readonly args?: A;
|
|
80
|
+
veto(): void;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* A single edit — created per edit by a model's `getEdit`, discarded on commit/cancel. It carries the
|
|
84
|
+
* captured clean + the model's write, and owns the working state + commit lifecycle.
|
|
85
|
+
*
|
|
86
|
+
* @remarks
|
|
87
|
+
* Consumers read it via {@link getState} / {@link subscribe} and drive its value via {@link setDirty} /
|
|
88
|
+
* {@link setMode} / {@link addCommitListener}. The owning {@link DefaultEditable} constructs it and
|
|
89
|
+
* drives its `@internal` {@link commit} / {@link cancel} (you call `editable.commit/cancel`, not these).
|
|
90
|
+
* Methods are plain (unbound) — consumers read it via `useOptionalBoundSyncExternalStore`, which calls
|
|
91
|
+
* `subscribe`/the snapshot selector on the instance, so no per-method binding is needed.
|
|
92
|
+
*
|
|
93
|
+
* Implements {@link ICellAnchor} as a **fixed-cell** anchor: `getCoords` returns the edited cell
|
|
94
|
+
* (which never moves for the life of the session) and `subscribe` observes its edit state. Lets a
|
|
95
|
+
* session be read uniformly as "a thing located at a cell".
|
|
96
|
+
*/
|
|
97
|
+
export declare class EditSession<C, D = string, A = EditCommitArgs> implements ICellAnchor {
|
|
98
|
+
private readonly commitFn;
|
|
99
|
+
private state;
|
|
100
|
+
private readonly listeners;
|
|
101
|
+
private readonly commitListeners;
|
|
102
|
+
private readonly cancelListeners;
|
|
103
|
+
private readonly editors;
|
|
104
|
+
private activeEditor;
|
|
105
|
+
private activeEditorId;
|
|
106
|
+
private auxState;
|
|
107
|
+
/**
|
|
108
|
+
* Built by {@link DefaultEditable.startEdit}: the model bits + coords ({@link EditSessionInit}) plus
|
|
109
|
+
* the open-time {@link StartEditOptions} (mode, seeded keystroke, focus). A fresh focus token is
|
|
110
|
+
* stamped per session — each edit is a new session, so the input re-focuses.
|
|
111
|
+
*/
|
|
112
|
+
constructor(init: EditSessionInit<C, D, A>, options?: StartEditOptions<D>);
|
|
113
|
+
getState(): EditState<C, D>;
|
|
114
|
+
/** @inheritdoc ICellAnchor.getCoords */
|
|
115
|
+
getCoords(): CellCoords;
|
|
116
|
+
subscribe(listener: () => void): (() => void);
|
|
117
|
+
/**
|
|
118
|
+
* Register an editor participating in this edit (inline editor, formula bar…). Returns an unregister
|
|
119
|
+
* (call on unmount). Both editors of the same cell reach the SAME session via the shared editable, so
|
|
120
|
+
* both register here — which is how `toggleEditorFocus` enumerates them and a caret command finds the
|
|
121
|
+
* focused one.
|
|
122
|
+
*/
|
|
123
|
+
registerEditor(handle: IInputHandle): () => void;
|
|
124
|
+
/** Mark the focused editor (the caret owner) on focus, or `null` on blur. */
|
|
125
|
+
setActiveEditor(handle: IInputHandle | null): void;
|
|
126
|
+
/** The focused editor's handle (the caret owner), or `null`. Caret commands target this. */
|
|
127
|
+
getActiveEditor(): IInputHandle | null;
|
|
128
|
+
/**
|
|
129
|
+
* Park the LOGICAL id of the editor taking focus. Called by the **host** (the editor layer / formula bar),
|
|
130
|
+
* which is what owns editor identity — an input is a physical mount and stays identity-free.
|
|
131
|
+
*
|
|
132
|
+
* @remarks
|
|
133
|
+
* Deliberately *not* derived from {@link IInputHandle}: a handle dies with its mount, and the whole point
|
|
134
|
+
* of this id is to outlive a host that hides or unmounts (switching sheets mid-edit) so the same host can
|
|
135
|
+
* recognize itself on the way back. Never cleared on unmount — a host parks an id on FOCUS only. `null`
|
|
136
|
+
* explicitly UN-parks (focus landed on a host with no id — no host may later reclaim focus as "the
|
|
137
|
+
* active editor"); the session itself is discarded on commit/cancel, so it can't go stale across edits.
|
|
138
|
+
*/
|
|
139
|
+
setActiveEditorId(id: string | null): void;
|
|
140
|
+
/**
|
|
141
|
+
* The parked id ({@link setActiveEditorId}) of the editor that last held focus — durable across a host
|
|
142
|
+
* unmount/remount, unlike {@link getActiveEditor}. A host reads it to decide whether it *was* the active
|
|
143
|
+
* editor and may reclaim focus (so it never steals from the formula bar / a 3rd-party editor). `null`
|
|
144
|
+
* until some host has parked one.
|
|
145
|
+
*/
|
|
146
|
+
getActiveEditorId(): string | null;
|
|
147
|
+
/** All editors participating in this edit — for `toggleEditorFocus` to cycle focus. */
|
|
148
|
+
getEditors(): IInputHandle[];
|
|
149
|
+
/**
|
|
150
|
+
* An opaque, **app-defined** value the active editor publishes and peer views observe (through the
|
|
151
|
+
* session's normal `subscribe`). grid-react does not interpret it — the SDK-aware `@sheetxl/react`
|
|
152
|
+
* layer defines the shape (e.g. a formula's reference ranges for the pane picker). Cast on read.
|
|
153
|
+
* Held OFF {@link EditState} so publishing it doesn't re-render the value/mode subscribers (their
|
|
154
|
+
* `getState()` snapshot is unchanged); only `getAuxState` readers re-render.
|
|
155
|
+
*/
|
|
156
|
+
getAuxState<T = unknown>(): T | null;
|
|
157
|
+
/**
|
|
158
|
+
* Publish the {@link getAuxState} value (the active editor calls this on value/caret change; `null`
|
|
159
|
+
* when it has nothing to show). Referential guard only — the caller owns value-equality and should
|
|
160
|
+
* pass a stable reference for unchanged content, so a caret move that changes nothing doesn't churn.
|
|
161
|
+
*/
|
|
162
|
+
setAuxState(next: unknown): void;
|
|
163
|
+
setDirty(dirty: D): void;
|
|
164
|
+
setMode(mode: EditorMode): void;
|
|
165
|
+
/**
|
|
166
|
+
* @internal Driven by {@link DefaultEditable.commit}. Runs **every** beforeCommit consumer (a
|
|
167
|
+
* `veto()` or throw rejects — a throw is also logged, never silently swallowed), then the model's
|
|
168
|
+
* write. Returns whether it succeeded. A no-op (nothing typed) skips only the model write — the
|
|
169
|
+
* listeners still run (and may veto), so a consumer observing "commit happened" is never skipped.
|
|
170
|
+
* Does NOT clear the owning editable's session — `editable.commit` does that on success.
|
|
171
|
+
*/
|
|
172
|
+
commit(args?: A): boolean;
|
|
173
|
+
/** @internal Driven by {@link DefaultEditable.cancel}. Notifies cancel observers; the editable clears the session. */
|
|
174
|
+
cancel(): void;
|
|
175
|
+
/** Register a beforeCommit consumer (validation, peers, …). Many may register; any may veto. */
|
|
176
|
+
addCommitListener(fn: (ctx: CommitContext<D, A>) => void): (() => void);
|
|
177
|
+
/** Observe a cancel. */
|
|
178
|
+
addCancelListener(fn: () => void): (() => void);
|
|
179
|
+
private emit;
|
|
180
|
+
private notify;
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=EditSession.d.ts.map
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { CellCoords } from '@sheetxl/utils';
|
|
2
|
+
/**
|
|
3
|
+
* The editor's two modes (renamed from `EditMode` to avoid colliding with the global edit-mode bus
|
|
4
|
+
* `EditMode` in `@sheetxl/utils`):
|
|
5
|
+
*
|
|
6
|
+
* - `enter` — started by typing (or Backspace). Typing replaces; arrow keys commit + let the
|
|
7
|
+
* selection navigate.
|
|
8
|
+
* - `edit` — started by F2 / double-click / clicking in. Arrow keys move the caret.
|
|
9
|
+
*/
|
|
10
|
+
export type EditorMode = 'enter' | 'edit';
|
|
11
|
+
/**
|
|
12
|
+
* Intent flags passed through a commit (the editor's commit "signal") — from the keymap, up through
|
|
13
|
+
* {@link EditorInputProps.onCommit}, to {@link IEditable.commit} and on to the model's write, where
|
|
14
|
+
* the app interprets them. Kept grid-generic: a "broadcast" commit means *apply to the whole
|
|
15
|
+
* selection, not just the active cell* — an interaction concept, not a spreadsheet one.
|
|
16
|
+
*/
|
|
17
|
+
export interface EditCommitArgs {
|
|
18
|
+
/**
|
|
19
|
+
* Broadcast the value to **every cell in the current selection** rather than only the active cell —
|
|
20
|
+
* Excel's `Ctrl+Enter`. The active cell does not move (the leave-key does not navigate/traverse).
|
|
21
|
+
*/
|
|
22
|
+
broadcast?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* A text selection range within the editor input. Mirrors the `HTMLTextAreaElement` selection API.
|
|
26
|
+
*/
|
|
27
|
+
export interface EditorTextSelection {
|
|
28
|
+
start: number;
|
|
29
|
+
end: number;
|
|
30
|
+
direction?: 'forward' | 'backward' | 'none';
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The immutable snapshot inside an {@link EditSession} — the value React renders from. Its existence
|
|
34
|
+
* (a non-`null` session state) means an edit is active.
|
|
35
|
+
*
|
|
36
|
+
* @typeParam C - The clean value type. @typeParam D - The dirty (working) value type.
|
|
37
|
+
*/
|
|
38
|
+
export interface EditState<C, D = string> {
|
|
39
|
+
/** The current {@link EditorMode}. */
|
|
40
|
+
mode: EditorMode;
|
|
41
|
+
/** The cell being edited. */
|
|
42
|
+
coords: CellCoords;
|
|
43
|
+
/**
|
|
44
|
+
* The clean value, captured from the model when the edit began. The input projects it to the
|
|
45
|
+
* displayed text when {@link dirty} is unset, and a cell-aware input reads styling/rendering info
|
|
46
|
+
* from it that the dirty text does not carry.
|
|
47
|
+
*/
|
|
48
|
+
clean: C;
|
|
49
|
+
/**
|
|
50
|
+
* The working (dirty) value. `undefined` ⇒ show the {@link clean} value. The first keystroke is
|
|
51
|
+
* seeded here **by value** — why no keystroke is lost (no synthetic replay).
|
|
52
|
+
*/
|
|
53
|
+
dirty: D | undefined;
|
|
54
|
+
/** Selection to apply the next time the input focuses (consumed once per {@link token}). */
|
|
55
|
+
initialSelection?: EditorTextSelection | null;
|
|
56
|
+
/** Whether the input should grab focus when the edit begins. */
|
|
57
|
+
autoFocus: boolean;
|
|
58
|
+
/** Bumped on each (re)start; editors watch it to re-focus on a fresh open. */
|
|
59
|
+
token: number;
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=EditState.d.ts.map
|