@sheetxl/grid-react 0.7.21 → 0.7.23-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.
Files changed (172) hide show
  1. package/README.md +502 -2
  2. package/browser/cjs/index.cjs +3 -12
  3. package/browser/esm/index.mjs +5797 -1867
  4. package/licenses/dependencies.txt +143 -41
  5. package/node/esm/index.mjs +4951 -1861
  6. package/package.json +7 -6
  7. package/types/index.d.ts +2 -1497
  8. package/types/src/cell/CellLayer.d.ts +70 -0
  9. package/types/src/cell/CellLayer.d.ts.map +1 -0
  10. package/types/src/cell/CellRenderer.d.ts +42 -0
  11. package/types/src/cell/CellRenderer.d.ts.map +1 -0
  12. package/types/src/cell/DefaultCellRenderer.d.ts +6 -0
  13. package/types/src/cell/DefaultCellRenderer.d.ts.map +1 -0
  14. package/types/src/cell/GridlineLayer.d.ts +38 -0
  15. package/types/src/cell/GridlineLayer.d.ts.map +1 -0
  16. package/types/src/cell/Types.d.ts +12 -0
  17. package/types/src/cell/Types.d.ts.map +1 -0
  18. package/types/src/cell/_CellModel.d.ts +82 -0
  19. package/types/src/cell/_CellModel.d.ts.map +1 -0
  20. package/types/src/cell/index.d.ts +6 -0
  21. package/types/src/cell/index.d.ts.map +1 -0
  22. package/types/src/editor/DefaultEditable.d.ts +121 -0
  23. package/types/src/editor/DefaultEditable.d.ts.map +1 -0
  24. package/types/src/editor/EditSession.d.ts +182 -0
  25. package/types/src/editor/EditSession.d.ts.map +1 -0
  26. package/types/src/editor/EditState.d.ts +61 -0
  27. package/types/src/editor/EditState.d.ts.map +1 -0
  28. package/types/src/editor/EditorDiv.d.ts +65 -0
  29. package/types/src/editor/EditorDiv.d.ts.map +1 -0
  30. package/types/src/editor/EditorInput.d.ts +88 -0
  31. package/types/src/editor/EditorInput.d.ts.map +1 -0
  32. package/types/src/editor/EditorLayer.d.ts +69 -0
  33. package/types/src/editor/EditorLayer.d.ts.map +1 -0
  34. package/types/src/editor/EditorPlacement.d.ts +38 -0
  35. package/types/src/editor/EditorPlacement.d.ts.map +1 -0
  36. package/types/src/editor/index.d.ts +10 -0
  37. package/types/src/editor/index.d.ts.map +1 -0
  38. package/types/src/editor/useEditorKeymap.d.ts +74 -0
  39. package/types/src/editor/useEditorKeymap.d.ts.map +1 -0
  40. package/types/src/grid/Grid.d.ts +16 -0
  41. package/types/src/grid/Grid.d.ts.map +1 -0
  42. package/types/src/grid/IGrid.d.ts +93 -0
  43. package/types/src/grid/IGrid.d.ts.map +1 -0
  44. package/types/src/grid/index.d.ts +3 -0
  45. package/types/src/grid/index.d.ts.map +1 -0
  46. package/types/src/header/HeaderDividerAnchor.d.ts +120 -0
  47. package/types/src/header/HeaderDividerAnchor.d.ts.map +1 -0
  48. package/types/src/header/index.d.ts +3 -0
  49. package/types/src/header/index.d.ts.map +1 -0
  50. package/types/src/header/useHeaderSelectionPointer.d.ts +122 -0
  51. package/types/src/header/useHeaderSelectionPointer.d.ts.map +1 -0
  52. package/types/src/index.d.ts +13 -0
  53. package/types/src/index.d.ts.map +1 -0
  54. package/types/src/layer/HoverTipLayer.d.ts +74 -0
  55. package/types/src/layer/HoverTipLayer.d.ts.map +1 -0
  56. package/types/src/layer/Layer.d.ts +92 -0
  57. package/types/src/layer/Layer.d.ts.map +1 -0
  58. package/types/src/layer/LayerTypes.d.ts +47 -0
  59. package/types/src/layer/LayerTypes.d.ts.map +1 -0
  60. package/types/src/layer/RangePrompt.d.ts +42 -0
  61. package/types/src/layer/RangePrompt.d.ts.map +1 -0
  62. package/types/src/layer/Stage.d.ts +147 -0
  63. package/types/src/layer/Stage.d.ts.map +1 -0
  64. package/types/src/layer/StickyAnchor.d.ts +83 -0
  65. package/types/src/layer/StickyAnchor.d.ts.map +1 -0
  66. package/types/src/layer/StickyFloat.d.ts +65 -0
  67. package/types/src/layer/StickyFloat.d.ts.map +1 -0
  68. package/types/src/layer/VirtualDiv.d.ts +59 -0
  69. package/types/src/layer/VirtualDiv.d.ts.map +1 -0
  70. package/types/src/layer/_Utils.d.ts +37 -0
  71. package/types/src/layer/_Utils.d.ts.map +1 -0
  72. package/types/src/layer/index.d.ts +11 -0
  73. package/types/src/layer/index.d.ts.map +1 -0
  74. package/types/src/layer/useGridAnchor.d.ts +157 -0
  75. package/types/src/layer/useGridAnchor.d.ts.map +1 -0
  76. package/types/src/layer/useHoverIntent.d.ts +49 -0
  77. package/types/src/layer/useHoverIntent.d.ts.map +1 -0
  78. package/types/src/layer/useLayerResponder.d.ts +29 -0
  79. package/types/src/layer/useLayerResponder.d.ts.map +1 -0
  80. package/types/src/layer/usePlacement.d.ts +18 -0
  81. package/types/src/layer/usePlacement.d.ts.map +1 -0
  82. package/types/src/layer/useRangeHover.d.ts +35 -0
  83. package/types/src/layer/useRangeHover.d.ts.map +1 -0
  84. package/types/src/list/CheckboxList.d.ts +63 -0
  85. package/types/src/list/CheckboxList.d.ts.map +1 -0
  86. package/types/src/list/List.d.ts +55 -0
  87. package/types/src/list/List.d.ts.map +1 -0
  88. package/types/src/list/index.d.ts +3 -0
  89. package/types/src/list/index.d.ts.map +1 -0
  90. package/types/src/metrics/Types.d.ts +23 -0
  91. package/types/src/metrics/Types.d.ts.map +1 -0
  92. package/types/src/metrics/index.d.ts +3 -0
  93. package/types/src/metrics/index.d.ts.map +1 -0
  94. package/types/src/metrics/useGridMetrics.d.ts +67 -0
  95. package/types/src/metrics/useGridMetrics.d.ts.map +1 -0
  96. package/types/src/range/DragHandle.d.ts +129 -0
  97. package/types/src/range/DragHandle.d.ts.map +1 -0
  98. package/types/src/range/Draggable.d.ts +86 -0
  99. package/types/src/range/Draggable.d.ts.map +1 -0
  100. package/types/src/range/FillHandle.d.ts +54 -0
  101. package/types/src/range/FillHandle.d.ts.map +1 -0
  102. package/types/src/range/RangeRect.d.ts +36 -0
  103. package/types/src/range/RangeRect.d.ts.map +1 -0
  104. package/types/src/range/RangeResizer.d.ts +68 -0
  105. package/types/src/range/RangeResizer.d.ts.map +1 -0
  106. package/types/src/range/RangeStyle.d.ts +8 -0
  107. package/types/src/range/RangeStyle.d.ts.map +1 -0
  108. package/types/src/range/index.d.ts +13 -0
  109. package/types/src/range/index.d.ts.map +1 -0
  110. package/types/src/selection/DefaultSelection.d.ts +59 -0
  111. package/types/src/selection/DefaultSelection.d.ts.map +1 -0
  112. package/types/src/selection/ICellAnchor.d.ts +21 -0
  113. package/types/src/selection/ICellAnchor.d.ts.map +1 -0
  114. package/types/src/selection/ISelection.d.ts +65 -0
  115. package/types/src/selection/ISelection.d.ts.map +1 -0
  116. package/types/src/selection/RangesPickerLayer.d.ts +128 -0
  117. package/types/src/selection/RangesPickerLayer.d.ts.map +1 -0
  118. package/types/src/selection/SelectionLayer.d.ts +179 -0
  119. package/types/src/selection/SelectionLayer.d.ts.map +1 -0
  120. package/types/src/selection/SelectionStyle.d.ts +28 -0
  121. package/types/src/selection/SelectionStyle.d.ts.map +1 -0
  122. package/types/src/selection/SelectionTouchGrips.d.ts +29 -0
  123. package/types/src/selection/SelectionTouchGrips.d.ts.map +1 -0
  124. package/types/src/selection/SelectionUtils.d.ts +2 -0
  125. package/types/src/selection/SelectionUtils.d.ts.map +1 -0
  126. package/types/src/selection/Types.d.ts +67 -0
  127. package/types/src/selection/Types.d.ts.map +1 -0
  128. package/types/src/selection/_SelectionNavigation.d.ts +6 -0
  129. package/types/src/selection/_SelectionNavigation.d.ts.map +1 -0
  130. package/types/src/selection/_SelectionUtils.d.ts +7 -0
  131. package/types/src/selection/_SelectionUtils.d.ts.map +1 -0
  132. package/types/src/selection/index.d.ts +12 -0
  133. package/types/src/selection/index.d.ts.map +1 -0
  134. package/types/src/selection/useDragCells.d.ts +218 -0
  135. package/types/src/selection/useDragCells.d.ts.map +1 -0
  136. package/types/src/selection/useSelectionPointer.d.ts +70 -0
  137. package/types/src/selection/useSelectionPointer.d.ts.map +1 -0
  138. package/types/src/surface/GridPane.d.ts +85 -0
  139. package/types/src/surface/GridPane.d.ts.map +1 -0
  140. package/types/src/surface/GridPaneProvider.d.ts +37 -0
  141. package/types/src/surface/GridPaneProvider.d.ts.map +1 -0
  142. package/types/src/surface/GridSurface.d.ts +11 -0
  143. package/types/src/surface/GridSurface.d.ts.map +1 -0
  144. package/types/src/surface/IGridPane.d.ts +288 -0
  145. package/types/src/surface/IGridPane.d.ts.map +1 -0
  146. package/types/src/surface/IGridSurface.d.ts +141 -0
  147. package/types/src/surface/IGridSurface.d.ts.map +1 -0
  148. package/types/src/surface/SurfaceStateProvider.d.ts +50 -0
  149. package/types/src/surface/SurfaceStateProvider.d.ts.map +1 -0
  150. package/types/src/surface/_GridUtils.d.ts +37 -0
  151. package/types/src/surface/_GridUtils.d.ts.map +1 -0
  152. package/types/src/surface/index.d.ts +7 -0
  153. package/types/src/surface/index.d.ts.map +1 -0
  154. package/types/src/surface/useGridPane.d.ts +31 -0
  155. package/types/src/surface/useGridPane.d.ts.map +1 -0
  156. package/types/src/surface/useSurfaceState.d.ts +22 -0
  157. package/types/src/surface/useSurfaceState.d.ts.map +1 -0
  158. package/types/src/svg/LineSVG.d.ts +13 -0
  159. package/types/src/svg/LineSVG.d.ts.map +1 -0
  160. package/types/src/svg/RectangleSVG.d.ts +114 -0
  161. package/types/src/svg/RectangleSVG.d.ts.map +1 -0
  162. package/types/src/svg/ShapeBounds.d.ts +15 -0
  163. package/types/src/svg/ShapeBounds.d.ts.map +1 -0
  164. package/types/src/svg/Types.d.ts +37 -0
  165. package/types/src/svg/Types.d.ts.map +1 -0
  166. package/types/src/svg/index.d.ts +9 -0
  167. package/types/src/svg/index.d.ts.map +1 -0
  168. package/types/src/theme/GridTheme.d.ts +56 -0
  169. package/types/src/theme/GridTheme.d.ts.map +1 -0
  170. package/types/src/theme/index.d.ts +2 -0
  171. package/types/src/theme/index.d.ts.map +1 -0
  172. package/node/assets/style.css +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IGridSurface.d.ts","sourceRoot":"","sources":["../../../../src/surface/IGridSurface.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,KAAK,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EACrF,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAC/C,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAC;AAE3C,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,WAAW,gBAAiB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,YAAY,CAAC;IAC/G;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IAC9B;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,WAAW,CAAC;IACvD;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,MAAM,CAAC;IAC/D;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,MAAM,CAAC;IAClE;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC/B;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IACxC;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IACvC;;OAEG;IACH,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,IAAI,CAAC;IAC7C;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC,SAAS,CAAC;CAC5E;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;;;OAMG;IACH,UAAU,EAAE,MAAM,IAAI,CAAC;IAEvB;;;;;;;OAOG;IACH,wBAAwB,EAAE,CAAC,MAAM,EAAE,OAAO,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,EAAE,UAAU,CAAC,qBAAqB,GAAG,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;IAE3I;;;OAGG;IACH,iBAAiB,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,SAAS,CAAC;IAEvD;;;;;OAKG;IACH,eAAe,EAAE,CAAC,MAAM,EAAE,UAAU,KAAK,SAAS,CAAC;IAEnD;;;;;;OAMG;IACH,OAAO,EAAE,CAAC,MAAM,CAAC,EAAE,cAAc,KAAK,SAAS,GAAG,IAAI,CAAC;IAEvD;;OAEG;IACH,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;CAClD;AAGD;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,cAAc,EAAE,sBAAsB;CAAG"}
@@ -0,0 +1,50 @@
1
+ import { default as React } from 'react';
2
+ /**
3
+ * A tiny pub/sub keyed store scoped to a single {@link GridSurface}. It is the backing for
4
+ * {@link useSurfaceState} — state that conceptually belongs to the *view* (the surface) rather than to
5
+ * any one React component instance.
6
+ *
7
+ * @remarks
8
+ * The motivating case: a layer (e.g. `Draggable`, `FillHandle`) is
9
+ * rendered **once per pane** (Center / Top / Left / TopLeft), so a single logical layer is actually
10
+ * four separate React instances. Transient drag UI (a move ghost, a fill border) lives in component
11
+ * `useState`, so only the pane that captured the pointer updates — the frozen-pane copies stay stale.
12
+ * Hoisting that value into a per-surface store lets all four instances read/write one cell (by an
13
+ * explicit key), so every pane redraws its own (independently clipped) slice. The store lives for the
14
+ * life of the surface, so a split view / second view gets its own store and never bleeds.
15
+ */
16
+ export interface SurfaceStateStore {
17
+ has(key: string): boolean;
18
+ get(key: string): unknown;
19
+ set(key: string, value: unknown): void;
20
+ subscribe(key: string, onChange: () => void): () => void;
21
+ }
22
+ export declare const createSurfaceStateStore: () => SurfaceStateStore;
23
+ export declare const SurfaceStateContext: React.Context<SurfaceStateStore | null>;
24
+ export interface SurfaceStateProviderProps {
25
+ /**
26
+ * Explicit store to provide, overriding both inheritance and lazy creation. Pass one to force a
27
+ * scope — a test, or a nested surface that wants its own transient state despite an ancestor.
28
+ * Memoize it (a fresh store every render resets the scope).
29
+ */
30
+ store?: SurfaceStateStore;
31
+ children: React.ReactNode;
32
+ }
33
+ /**
34
+ * Provides the {@link SurfaceStateStore} backing {@link useSurfaceState} to descendant panes/layers.
35
+ * It resolves the store itself, highest priority first:
36
+ *
37
+ * 1. an explicit {@link SurfaceStateProviderProps.store} prop (override);
38
+ * 2. a store **inherited** from an ancestor `SurfaceStateProvider` — so a wider parent (e.g. a
39
+ * `SheetElement` wrapping its top-left corner + both header `GridSurface`s + the main `GridSurface`)
40
+ * shares one scope across sibling surfaces, letting a layer keyed the same in a header and in the body
41
+ * read one cell;
42
+ * 3. otherwise a **lazily-created own** store (the standalone default).
43
+ *
44
+ * So a {@link GridSurface} can unconditionally mount `<SurfaceStateProvider>` and get the right thing:
45
+ * its own isolated store when standalone (or under a split view / second view), the shared one when
46
+ * nested under a wider provider. Because inheritance is automatic, the common case is a bare
47
+ * `<SurfaceStateProvider>` with no props.
48
+ */
49
+ export declare const SurfaceStateProvider: React.FC<SurfaceStateProviderProps>;
50
+ //# sourceMappingURL=SurfaceStateProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SurfaceStateProvider.d.ts","sourceRoot":"","sources":["../../../../src/surface/SurfaceStateProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;IACvC,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;CAC1D;AAED,eAAO,MAAM,uBAAuB,QAAO,iBAuB1C,CAAC;AAEF,eAAO,MAAM,mBAAmB,yCAAgD,CAAC;AAEjF,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CASpE,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { RangeCoords, Bounds, TopLeft, Rectangle, SelectionTraversalUtils } from '@sheetxl/utils';
2
+ import { ViewportMetrics } from '@sheetxl/utils-react';
3
+ import { ItemSizer, IGridMetrics } from '../metrics';
4
+ /** Clamp `value` into `[min, max]` (the one shared definition — don't re-inline per module). */
5
+ export declare const clamp: (value: number, min: number, max: number) => number;
6
+ /**
7
+ * Retrieves the indices of visible headers within a specified range.
8
+ * A header is considered visible if it is not hidden according to the `hiddenAt` callback.
9
+ *
10
+ * @param hiddenAt Callback to determine hidden headers at a given index.
11
+ * @param startIndex The starting index of the range to check.
12
+ * @param stopIndex The ending index of the range to check.
13
+ * @returns An array of visible header indices within the specified range.
14
+ */
15
+ export declare const getVisibleHeaders: (hiddenAt: SelectionTraversalUtils.HiddenHeadersAt | undefined, startIndex: number, stopIndex: number) => number[];
16
+ export declare const virtualScrollToBounds: (elementBounds: Bounds, viewport: ViewportMetrics, options?: globalThis.ScrollIntoViewOptions | boolean) => TopLeft | undefined;
17
+ /**
18
+ * default implementation of hiddenAt. Uses layout and will scan zero length.
19
+ *
20
+ * Not very efficient as this just scans.
21
+ */
22
+ export declare const calcHiddenAt: (index: number, reverse: boolean | undefined, sizer: ItemSizer, limit: number) => number;
23
+ /**
24
+ * Clip `bounds` to `limitBounds` (with optional `insets`). Returns `null` when nothing survives —
25
+ * i.e. `bounds` is entirely outside `limitBounds`.
26
+ */
27
+ export declare const clipBounds: (bounds: Bounds, limitBounds: Bounds, insets?: number) => Bounds | null;
28
+ /**
29
+ * Returns the bounds for a range given a cellLayout and an optional adjustment
30
+ * The range or layout is not validated as this is expected to be a performant function
31
+ */
32
+ export declare const getBoundsFromRange: (layout: IGridMetrics, range: RangeCoords, adjustment?: Partial<Rectangle>) => Bounds;
33
+ /**
34
+ * Returns true if the x and y are bot within the bounds.
35
+ */
36
+ export declare const isPointWithinBounds: (x: number, y: number, bounds: Bounds) => boolean;
37
+ //# sourceMappingURL=_GridUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_GridUtils.d.ts","sourceRoot":"","sources":["../../../../src/surface/_GridUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,KAAK,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,uBAAuB,EAC1F,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/D,gGAAgG;AAChG,eAAO,MAAM,KAAK,GAAI,OAAO,MAAM,EAAE,KAAK,MAAM,EAAE,KAAK,MAAM,KAAG,MAC3B,CAAC;AAEtC;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAC5B,UAAU,uBAAuB,CAAC,eAAe,GAAG,SAAS,EAC7D,YAAY,MAAM,EAClB,WAAW,MAAM,KAChB,MAAM,EAYR,CAAA;AAwCD,eAAO,MAAM,qBAAqB,GAChC,eAAe,MAAM,EACrB,UAAU,eAAe,EACzB,UAAS,UAAU,CAAC,qBAAqB,GAAG,OAAY,KAAG,OAAO,GAAG,SAsCtE,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,GACvB,OAAO,MAAM,EACb,SAAS,OAAO,YAAM,EACtB,OAAO,SAAS,EAChB,OAAO,MAAM,KACZ,MAkBF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,UAAU,GACrB,QAAQ,MAAM,EACd,aAAa,MAAM,EACnB,SAAQ,MAAQ,KACf,MAAM,GAAG,IAqCX,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,GAC7B,QAAQ,YAAY,EACpB,OAAO,WAAW,EAClB,aAAa,OAAO,CAAC,SAAS,CAAC,KAC9B,MAYF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAC9B,GAAG,MAAM,EACT,GAAG,MAAM,EACT,QAAQ,MAAM,KACb,OAOF,CAAA"}
@@ -0,0 +1,7 @@
1
+ export * from './IGridPane';
2
+ export * from './IGridSurface';
3
+ export * from './GridSurface';
4
+ export * from './useGridPane';
5
+ export * from './useSurfaceState';
6
+ export * from './SurfaceStateProvider';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/surface/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAE5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAE9B,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { IGridPane } from './IGridPane';
2
+ /**
3
+ * Hook to access the current GridPane from context
4
+ *
5
+ * @throws Error if called outside of a GridPaneProvider
6
+ *
7
+ * @example
8
+ * ```tsx
9
+ * function MyLayer() {
10
+ * const pane = useGridPane();
11
+ * const bounds = pane.getRangeBounds(myRange);
12
+ * return <div>...</div>;
13
+ * }
14
+ * ```
15
+ */
16
+ export declare function useGridPane(): IGridPane;
17
+ /**
18
+ * Hook to optionally access the current GridPane from context
19
+ * Returns null if not within a GridPaneProvider
20
+ *
21
+ * @example
22
+ * ```tsx
23
+ * function MyDiv({ pane: propPane, ...props }) {
24
+ * const contextPane = useGridPaneOptional();
25
+ * const pane = propPane ?? contextPane;
26
+ * // Use pane...
27
+ * }
28
+ * ```
29
+ */
30
+ export declare function useGridPaneOptional(): IGridPane | null;
31
+ //# sourceMappingURL=useGridPane.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useGridPane.d.ts","sourceRoot":"","sources":["../../../../src/surface/useGridPane.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAI7C;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,IAAI,SAAS,CAMvC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,IAAI,SAAS,GAAG,IAAI,CAEtD"}
@@ -0,0 +1,22 @@
1
+ import { Dispatch, SetStateAction } from 'react';
2
+ /**
3
+ * Like {@link React.useState}, but the cell is **keyed** and scoped to the enclosing {@link GridSurface},
4
+ * so every pane that renders this layer reads/writes the SAME cell — writing it from the pane that owns a
5
+ * drag re-renders the frozen-pane copies too (each draws its own clipped slice). Use it for transient,
6
+ * view-scoped layer UI (a move ghost, a fill border, marching ants, a drag-insert line).
7
+ *
8
+ * @param key - A stable identifier for this piece of shared state, **unique within the surface**.
9
+ * Identity is an explicit key, not call position: two mirrored panes are separate React trees (each
10
+ * gets its own fiber, and client `useId` is only a mount-order counter), so there is no positional
11
+ * identity to collapse across them. This is the same idea as a React `key`, a Redux slice, or a store
12
+ * key. For a **singleton** use a constant (`'movable-drag'`); for **multi-instance** state (e.g. one
13
+ * mover per range) compose the model's identity into the key (`` `range-move:${rangeKey}` ``) so the
14
+ * same logical instance shares across panes while distinct instances stay separate.
15
+ * @param initialValue - The initial value (or a lazy initializer), exactly like `useState`.
16
+ *
17
+ * @remarks
18
+ * Outside a {@link GridSurface} (e.g. a standalone test) it transparently falls back to a per-instance
19
+ * store, so it still behaves like ordinary local state.
20
+ */
21
+ export declare function useSurfaceState<T>(key: string, initialValue: T | (() => T)): [T, Dispatch<SetStateAction<T>>];
22
+ //# sourceMappingURL=useSurfaceState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSurfaceState.d.ts","sourceRoot":"","sources":["../../../../src/surface/useSurfaceState.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,QAAQ,EAAE,KAAK,cAAc,EACnC,MAAM,OAAO,CAAC;AAMf;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAC/B,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,GAC1B,CAAC,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAsClC"}
@@ -0,0 +1,13 @@
1
+ import { default as React } from 'react';
2
+ import { ShapeProps } from './Types';
3
+ export interface LineSVGProps extends React.SVGProps<SVGSVGElement>, ShapeProps {
4
+ linePoints: number[];
5
+ propsPath?: React.SVGProps<SVGPathElement>;
6
+ }
7
+ /**
8
+ * A **shape**: an SVG polyline painted within the given `bounds` (used for gridlines). Like
9
+ * {@link RectangleSVG}, it takes resolved bounds and knows nothing about ranges or the pane — a
10
+ * **layer** would place it. (Shapes take bounds and paint; layers are pane-aware.)
11
+ */
12
+ export declare const LineSVG: (props: LineSVGProps) => React.JSX.Element | null;
13
+ //# sourceMappingURL=LineSVG.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LineSVG.d.ts","sourceRoot":"","sources":["../../../../src/svg/LineSVG.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,MAAM,WAAW,YAAa,SAAQ,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,UAAU;IAC7E,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,SAAS,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;CAC5C;AAED;;;;GAIG;AACH,eAAO,MAAM,OAAO,GAAI,OAAO,YAAY,6BAsC1C,CAAC"}
@@ -0,0 +1,114 @@
1
+ import { Bounds } from '@sheetxl/utils';
2
+ import { AnimatedStrokeProps, ShapeProps } from './Types';
3
+ /**
4
+ * CSS keys that the SVG paths paint via **attributes**, not the wrapper's CSS. They are excluded from
5
+ * {@link VisualSVGProps.style} so `style={{ stroke }}` is a compile error (it would silently no-op) —
6
+ * set them via the dedicated `stroke`/`fill`/`strokeWidth`/`strokeDasharray` props instead.
7
+ */
8
+ type PaintCSSKey = 'stroke' | 'fill' | 'strokeWidth' | 'strokeDasharray' | 'strokeDashoffset';
9
+ /**
10
+ * The visual props shared by {@link RectangleSVG} and {@link RangeRect} — a curated surface, NOT the
11
+ * full SVG element props. Paint with the dedicated props (`stroke`/`fill`/`strokeWidth`/…); `style` is
12
+ * the wrapper's CSS for *effects* only (opacity/filter/transition). For raw `<svg>` attributes or
13
+ * handlers, use {@link RectangleSVGProps.propsRoot}.
14
+ */
15
+ export interface VisualSVGProps {
16
+ /**
17
+ * Fill color. Omit for an outline-only shape.
18
+ */
19
+ fill?: string;
20
+ /**
21
+ * Set properties for the fill path.
22
+ */
23
+ propsFillPath?: React.SVGProps<SVGPathElement>;
24
+ /**
25
+ * Stroke color. Omit for a fill-only shape.
26
+ */
27
+ stroke?: string;
28
+ /**
29
+ * Set properties for the stroke path.
30
+ */
31
+ propsStrokePath?: React.SVGProps<SVGPathElement>;
32
+ /**
33
+ * Dash the stroke, e.g. `"3 2"` for a dashed marquee.
34
+ */
35
+ strokeDasharray?: string | number;
36
+ /**
37
+ * Starting dash offset of the stroke (the marching-ants phase).
38
+ */
39
+ strokeDashoffset?: string | number;
40
+ /**
41
+ * The stroke width — both **painted** and used for device **alignment** (the crisp-snapping parity:
42
+ * even widths center on a whole device px, odd on a half). In DEVICE px when aligned (the default) —
43
+ * so 1/2/3 stay crisp at any dpr, like the gridline; in user/CSS units when {@link disableAlign} is
44
+ * set. Stacked rectangles that share an `alignWidth` snap to the SAME grid, so they stay locked
45
+ * together while scrolling (no per-layer "shimmy") — e.g. a two-tone selection border draws its inner
46
+ * ring at the same `alignWidth`, `inset` inward, *under* the outer so only a sliver shows.
47
+ *
48
+ * @defaultValue 1
49
+ */
50
+ alignWidth?: number;
51
+ /**
52
+ * Skip device alignment: the stroke centerline (½-width + parity) and the fill/hole
53
+ * edges. Turn ON for a raw, unaligned rect (e.g. an invisible hit target).
54
+ *
55
+ * @defaultValue false
56
+ */
57
+ disableAlign?: boolean;
58
+ /**
59
+ * Disable edge-aware stroke placement. When edge-aware (the default), leading edges (top/left) sit
60
+ * before the divider, trailing (bottom/right) after — so the outline lines up with cell
61
+ * borders/gridlines; turn ON to center the stroke on the boundary instead. Ignored when
62
+ * {@link disableAlign} is set. Negated to read alongside {@link disableAlign}.
63
+ *
64
+ * @defaultValue false
65
+ */
66
+ disableEdgeAware?: boolean;
67
+ /**
68
+ * Push the rectangle inward by this many DEVICE px on every side before placement
69
+ * (still device-aligned) — for an inner ring layered inside an outer outline.
70
+ *
71
+ * @defaultValue 0
72
+ */
73
+ inset?: number;
74
+ /**
75
+ * Marching-ants animation on the stroke (e.g. the copy/cut marquee). `true` uses
76
+ * defaults; pass {@link AnimatedStrokeProps} to tune the dash/speed.
77
+ */
78
+ animatedStroke?: boolean | AnimatedStrokeProps;
79
+ /**
80
+ * Transition the path `d` so the shape glides when its bounds change (move-drag).
81
+ */
82
+ animatedTransition?: boolean;
83
+ /** Class on the root `<svg>`. */
84
+ className?: string;
85
+ /**
86
+ * CSS on the root `<svg>` for *effects* — `opacity`, `filter`, `transition`, etc. NOT
87
+ * for paint: `stroke`/`fill`/`strokeWidth`/`strokeDasharray` are excluded here (the paths paint via
88
+ * attributes, so CSS paint would silently no-op) — use the dedicated props for those.
89
+ */
90
+ style?: Omit<React.CSSProperties, PaintCSSKey>;
91
+ }
92
+ export interface RectangleSVGProps extends VisualSVGProps, ShapeProps {
93
+ /**
94
+ * RAW bounds of an evenodd cut-out of the FILL (e.g. the active cell inside a
95
+ * selection). Area-snapped (`snapDeviceEdge`), not stroke-snapped. Ignored for the stroke.
96
+ */
97
+ hole?: Bounds;
98
+ /**
99
+ * Escape hatch: props spread onto the root `<svg>` element (raw attributes, event handlers). Rare —
100
+ * the wrapper is `pointerEvents: 'none'` by default and overlays seldom need it. Prefer the dedicated
101
+ * paint props, `style`, `propsStrokePath`, and `propsFillPath`.
102
+ */
103
+ propsRoot?: React.SVGProps<SVGSVGElement>;
104
+ }
105
+ /**
106
+ * A **shape**: a single device-pixel-aligned SVG rectangle (stroke and/or fill, with an optional
107
+ * evenodd hole). It owns ALL painting and ALL snapping of its sub-shapes — stroke centerline via
108
+ * `edgeCenter`, fill/hole edges via `snapDeviceEdge` — from the RAW `bounds` it is handed. It knows
109
+ * nothing about ranges or the pane: a **layer** ({@link RangeRect}) resolves a range to bounds and
110
+ * places it. (Shapes take bounds and paint; layers are pane-aware and compose into `renderLayers`.)
111
+ */
112
+ export declare const RectangleSVG: import('react').MemoExoticComponent<(props: RectangleSVGProps) => import("react").JSX.Element | null>;
113
+ export {};
114
+ //# sourceMappingURL=RectangleSVG.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RectangleSVG.d.ts","sourceRoot":"","sources":["../../../../src/svg/RectangleSVG.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,MAAM,EAAkB,MAAM,gBAAgB,CAAC;AAI7D,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAGpE;;;;GAIG;AACH,KAAK,WAAW,GAAG,QAAQ,GAAG,MAAM,GAAG,aAAa,GAAG,iBAAiB,GAAG,kBAAkB,CAAC;AAE9F;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,aAAa,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IAC/C;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,eAAe,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;IACjD;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAClC;;OAEG;IACH,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACnC;;;;;;;;;OASG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;;;OAOG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,GAAG,mBAAmB,CAAC;IAC/C;;OAEG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,KAAK,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;CAChD;AAED,MAAM,WAAW,iBAAkB,SAAQ,cAAc,EAAE,UAAU;IACnE;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;CAC3C;AAED;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,8CAAgB,iBAAiB,wCAmLxD,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { Bounds } from '@sheetxl/utils';
2
+ /**
3
+ * The RAW (pre-snap) bounds a shape leaf ({@link RectangleSVG} / {@link LineSVG}) draws at, provided
4
+ * by its container {@link Layer} — already expressed RELATIVE to the layer box's **device-aligned**
5
+ * origin. The shape still does its own `edgeCenter` / `snapDeviceEdge` snapping; because the origin is
6
+ * a whole number of device pixels, snapping these box-relative bounds lands on the identical device
7
+ * pixel as snapping absolute, just offset into the box (which carries the absolute translate).
8
+ *
9
+ * `null` when a shape is used standalone (not inside a `Layer`) — it then needs an explicit `bounds`
10
+ * prop, which always wins over this context.
11
+ */
12
+ export declare const ShapeBoundsContext: import('react').Context<Bounds | null>;
13
+ /** The container layer's box-relative bounds for a shape; the shape prefers its own `bounds` prop. */
14
+ export declare const useShapeBounds: () => Bounds | null;
15
+ //# sourceMappingURL=ShapeBounds.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShapeBounds.d.ts","sourceRoot":"","sources":["../../../../src/svg/ShapeBounds.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,wCAAqC,CAAC;AAErE,sGAAsG;AACtG,eAAO,MAAM,cAAc,QAAO,MAAM,GAAG,IAAsC,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { Bounds } from '@sheetxl/utils';
2
+ /**
3
+ * The **shape contract**: a shape paints at the device `bounds` it is handed. `bounds` is OPTIONAL
4
+ * because a container {@link Layer} provides it via context ({@link useShapeBounds}) — author shapes
5
+ * without it inside a `Layer`, or pass it directly when standalone. A `Layer` *positions a box*; HTML
6
+ * children fill it and shape children paint at the box-relative bounds it provides.
7
+ */
8
+ export interface ShapeProps {
9
+ /**
10
+ * The RAW (pre-snap) bounds to paint at. When a shape is inside a {@link Layer} it reads these from
11
+ * context (box-relative); otherwise pass it directly (absolute). The shape device-snaps it itself.
12
+ */
13
+ bounds?: Bounds;
14
+ }
15
+ /**
16
+ * Props for animated stroke
17
+ */
18
+ export interface AnimatedStrokeProps {
19
+ /**
20
+ * The named of the animation
21
+ */
22
+ name?: string;
23
+ dashGap: number;
24
+ speed: number;
25
+ dashLength: number;
26
+ /**
27
+ * Color painted in the dash **gaps** — a solid under-stroke drawn beneath the animated dashes so the
28
+ * gaps reveal THIS color instead of whatever sits under the outline. Defaults to the grid background
29
+ * (`--sxl-color-base-100`), which keeps the marching ants legible even when the stroke runs directly
30
+ * over a same-colored fill (e.g. a reference border over the blue selection). Set explicitly to match
31
+ * a different backdrop.
32
+ *
33
+ * @defaultValue `var(--sxl-color-base-100, #fff)`
34
+ */
35
+ gapColor?: string;
36
+ }
37
+ //# sourceMappingURL=Types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Types.d.ts","sourceRoot":"","sources":["../../../../src/svg/Types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * **Shapes**: low-level SVG painters. They take resolved `bounds` and paint — no pane, no range. A
3
+ * **layer** ({@link VirtualDiv} / {@link RangeRect}) resolves a range to bounds and places them.
4
+ */
5
+ export * from './Types';
6
+ export * from './ShapeBounds';
7
+ export * from './LineSVG';
8
+ export * from './RectangleSVG';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/svg/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,56 @@
1
+ import { CSSProperties } from 'react';
2
+ import { TokenTheme, ThemeMode } from '@sheetxl/utils-react';
3
+ /**
4
+ * grid-react's own **surfaces** — the `grid` (paper + gridlines) and `header` (elevated) token overrides,
5
+ * layered over the generic app baseline (utils-react `defaultTheme`). Headers have no non-sheet consumers, so
6
+ * they belong here, not in the shared util. First-pass values (tune against the storybook diff); a later
7
+ * step can DERIVE these from the app baseline (the `createGridStyleFromMUITheme` elevate/divider math)
8
+ * instead of authoring them.
9
+ *
10
+ * A "surface" is just a partial {@link TokenTheme} merged over the baseline — see utils-react `themeVars`.
11
+ */
12
+ export declare const GRID_SURFACE: Record<ThemeMode, Partial<TokenTheme>>;
13
+ /**
14
+ * @remarks
15
+ * States `color-base-100` in both modes rather than letting it fall through to the app desktop
16
+ * ({@link buildGridThemeCSS}): with the neutral `defaultTheme`, the dark desktop and the dark grid paper are
17
+ * both `#1e1e1e`, so an unstated header would equal the cell fill and erase the row/column gutters.
18
+ *
19
+ * Header *hover* is `color-base-hover`, not `color-base-200`. `base-100/200/300` is a depth ramp — paper →
20
+ * recessed ground → border — and a pointer state is not a step on it. Parking hover on `base-200` gave one
21
+ * ramp token two unrelated meanings (the desktop on the app surface, a hover here); the header now simply
22
+ * doesn't restate `base-200` and inherits the app's desktop, like every other surface.
23
+ */
24
+ export declare const HEADER_SURFACE: Record<ThemeMode, Partial<TokenTheme>>;
25
+ /** The grid-surface `--sxl-*` var block for a mode (baseline + grid overrides + any client tweaks). */
26
+ export declare const gridThemeVars: (mode: ThemeMode, ...overrides: Array<Partial<TokenTheme> | undefined>) => CSSProperties;
27
+ /** The header-surface `--sxl-*` var block for a mode (baseline + header overrides + any client tweaks). */
28
+ export declare const headerThemeVars: (mode: ThemeMode, ...overrides: Array<Partial<TokenTheme> | undefined>) => CSSProperties;
29
+ export interface GridThemeCSSOptions {
30
+ /** App baseline per mode. @defaultValue utils-react `defaultTheme` (via `buildThemeCSS`). */
31
+ app?: Record<ThemeMode, TokenTheme>;
32
+ /** `grid` surface overrides per mode. @defaultValue {@link GRID_SURFACE}. */
33
+ grid?: Record<ThemeMode, Partial<TokenTheme>>;
34
+ /**
35
+ * `header` surface overrides per mode. A cell that omits `color-base-100` defaults to the app's
36
+ * `color-base-200` — the desktop — resolved to a value at emission time (THEMING-DESIGN §4).
37
+ * @defaultValue {@link HEADER_SURFACE}.
38
+ */
39
+ header?: Record<ThemeMode, Partial<TokenTheme>>;
40
+ /** @defaultValue `'sxl-defaults'` */
41
+ layer?: string;
42
+ /**
43
+ * Scope selector (e.g. `.sheetxl-sheet-<id>`) to emit a per-instance theme. Omit for global (interim).
44
+ * @defaultValue undefined
45
+ */
46
+ scope?: string;
47
+ }
48
+ /**
49
+ * grid-react's theme stylesheet — the app baseline (utils-react `defaultTheme`, or a passed one) + the
50
+ * `grid` / `header` surface overrides, compiled to the `data-sxl-theme-*` attribute matrix. Called by the
51
+ * react `SheetElement` with neutral defaults into `@layer sxl-defaults` (so even a chromeless sheet is
52
+ * themed), and by studio-mui with MUI-derived values into `sxl-app` on top; clients override in
53
+ * `sxl-overrides`. Consumers just set `data-sxl-theme-*` attributes.
54
+ */
55
+ export declare const buildGridThemeCSS: ({ app, grid, header, layer, scope }?: GridThemeCSSOptions) => string;
56
+ //# sourceMappingURL=GridTheme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GridTheme.d.ts","sourceRoot":"","sources":["../../../../src/theme/GridTheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAA0C,MAAM,sBAAsB,CAAC;AAE/G;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,UAAU,CAAC,CAO/D,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,UAAU,CAAC,CAWjE,CAAC;AAEF,uGAAuG;AACvG,eAAO,MAAM,aAAa,GAAI,MAAM,SAAS,EAAE,GAAG,WAAW,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC,KAAG,aACnD,CAAC;AAEpD,2GAA2G;AAC3G,eAAO,MAAM,eAAe,GAAI,MAAM,SAAS,EAAE,GAAG,WAAW,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,SAAS,CAAC,KAAG,aACnD,CAAC;AAEtD,MAAM,WAAW,mBAAmB;IAClC,6FAA6F;IAC7F,GAAG,CAAC,EAAE,MAAM,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IACpC,6EAA6E;IAC7E,IAAI,CAAC,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;IAC9C;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC;IAChD,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAAI,sCAM/B,mBAAwB,KAAG,MAsB7B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export * from './GridTheme';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/theme/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
@@ -1 +0,0 @@
1
- ._sheetxl-grid_h9wwa_7{position:relative;box-sizing:border-box;user-select:none}._sheetxl-grid_h9wwa_7 *{box-sizing:border-box!important}._sheetxl-grid_h9wwa_7 *:focus{outline:none}._sheetxl-grid_h9wwa_7 .cell-container{position:absolute;overflow:visible;white-space:pre}._sheetxl-grid_h9wwa_7 .cell-container>*{inset:0;position:absolute}._sheetxl-grid_h9wwa_7 .sheetxl-stage{contain:strict}._sheetxl-grid_h9wwa_7 .sheetxl-stage>*{contain:strict}