@sheetxl/react 0.8.0-beta.22 → 0.8.0-beta.23

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 (76) hide show
  1. package/browser/esm/{D0g7sllamMog1m-Z.mjs → 2-8Z3hKcjFc9IUm_.mjs} +3 -3
  2. package/browser/esm/{BqIbT28MM3SBdvh_.mjs → B1qMCa-WDnmPYR_C.mjs} +2 -2
  3. package/browser/esm/{D7P7zWW2gdWclI2p.mjs → B1rKvYmr4ynvDkqM.mjs} +3 -3
  4. package/browser/esm/{C7rc3CMd_XOITW1V.mjs → B7RYx03rC74aIduo.mjs} +7 -7
  5. package/browser/esm/{BPS1PDZKyF6ivJwa.mjs → BG96UT5-ooOuigD0.mjs} +1 -1
  6. package/browser/esm/{DgmkBz2cYtVZ8tXv.mjs → BHukFXtx1rpfvfIy.mjs} +1 -1
  7. package/browser/esm/{D8NUgUzdI7YFxyyA.mjs → BN7pckCvCRZMPCmK.mjs} +7 -7
  8. package/browser/esm/{mJyEnJIX0iGfGtvE.mjs → BklsD3lkZGRSwAFi.mjs} +1 -1
  9. package/browser/esm/{CJVcfqrty5b-eowN.mjs → C-eTPeTwXQoqn3Lb.mjs} +2 -2
  10. package/browser/esm/{Biz8qA4-1wRN8de2.mjs → C9wgyCKVT4rwQMSD.mjs} +1 -1
  11. package/browser/esm/{DH8xeknZXWn7AV5q.mjs → CD5gjg2DVLsy6h33.mjs} +6 -6
  12. package/browser/esm/{D01C312OntVURMN9.mjs → CEtZlL4v4JU0TDVR.mjs} +122 -122
  13. package/browser/esm/{np1ChcItFltS6AC5.mjs → CGEyv-QdxMuQmLqk.mjs} +1 -1
  14. package/browser/esm/{CgOhJ3utK7aSQm26.mjs → CLD7Vob5oUran-l0.mjs} +1 -1
  15. package/browser/esm/{B9rbGikcuRq1OnhM.mjs → CXJmpmqTkVe25Ita.mjs} +2 -2
  16. package/browser/esm/{hTeTTb8oYTssk6EY.mjs → CmYMKPG-TaW2dJPu.mjs} +1 -1
  17. package/browser/esm/{CrTfqdSwWScJN566.mjs → CruGvs0fdtWWO_Di.mjs} +1 -1
  18. package/browser/esm/{B9wkino8VMasq6E3.mjs → Cw3PQMs1RDxzIo35.mjs} +2 -2
  19. package/browser/esm/{DhGJU1camaOf7KOq.mjs → D5r5ejlRpFFXN6TK.mjs} +4 -4
  20. package/browser/esm/{mUKvsPCmRWzQke-M.mjs → D952mmmww4cYPatc.mjs} +1 -1
  21. package/browser/esm/{QKnTzTdIYAMcBU8r.mjs → DQ5DeFNj_0mj6QMd.mjs} +1 -1
  22. package/browser/esm/{DyFeCww9e_4G9c-1.mjs → DSvlk_YzOev20rgN.mjs} +173 -160
  23. package/browser/esm/{Bjzo7g25tw9kTCYC.mjs → DedLmnV_HajYHYSM.mjs} +2 -2
  24. package/browser/esm/{DxsGY5rYjITV3SLK.mjs → G6Ek0k1QC1pUHvPd.mjs} +1 -1
  25. package/browser/esm/{HQkKZC6SPUdQwgxi.mjs → OPWkc7t367MwVsVU.mjs} +1 -1
  26. package/browser/esm/chart.mjs +11 -11
  27. package/browser/esm/control.mjs +16 -16
  28. package/browser/esm/group.mjs +29 -29
  29. package/browser/esm/index.mjs +3593 -3588
  30. package/browser/esm/note.mjs +10 -10
  31. package/browser/esm/picture.mjs +2 -2
  32. package/browser/esm/shape.mjs +2 -2
  33. package/browser/esm/slicer.mjs +55 -50
  34. package/node/esm/{CZc2QH8i-TgW9nGI.mjs → B5ae_WW6vAz2jOsn.mjs} +1 -1
  35. package/node/esm/{CcLUKcJROXrbSXjb.mjs → BD04OJgRWKiE2W1H.mjs} +1 -1
  36. package/node/esm/{l0GtU6LYlBywzc9T.mjs → BGLOvRRJr4nt8QdO.mjs} +2 -2
  37. package/node/esm/{CE5fMGMmykts2yJP.mjs → BKrvkWuGTMdkvdy6.mjs} +1 -1
  38. package/node/esm/{aLt3NYdUcYQu4Ur4.mjs → BMWwIbesFn8e6-Ov.mjs} +1 -1
  39. package/node/esm/{CfpNgRvWmu36cTfV.mjs → BhgjRcXOyNKBdqUW.mjs} +5 -5
  40. package/node/esm/{DX7ysYSfnigj0ak8.mjs → Bv0fGxNecKUr_qYS.mjs} +1 -1
  41. package/node/esm/{C3XXdc_UXH2g2W5E.mjs → CF5ztfx05vyEMEub.mjs} +1 -1
  42. package/node/esm/{C91YeRrspETjFcRc.mjs → CeSZX96RPPjn29Hw.mjs} +2 -2
  43. package/node/esm/{-6T2zqPkDm0WgUKI.mjs → CeuVkQpY8O4nZG-k.mjs} +2 -2
  44. package/node/esm/{FUQMKIiQQ5m3xzeO.mjs → Csl959_HnUC4Y06N.mjs} +1 -1
  45. package/node/esm/{cju5Gx-t_74o116W.mjs → Cx16BErZDzlQEXH_.mjs} +2 -2
  46. package/node/esm/{i4aPmKocZebCBeSd.mjs → D8mwVRSclIFn5SVM.mjs} +6 -6
  47. package/node/esm/{BPMjPMRyVTEZq_6j.mjs → DJyNfqgeIlJ6lOHS.mjs} +1 -1
  48. package/node/esm/{COlzVELrEvgm2STX.mjs → DL2RKBB2PXzdJyx_.mjs} +4 -4
  49. package/node/esm/{DHTbAHbCiEWhilV_.mjs → DmHHRlyfyFWj6wvW.mjs} +1 -1
  50. package/node/esm/{BcASbEBHzMKiXn5i.mjs → VFXZqkIvB9MDE2Ea.mjs} +1 -1
  51. package/node/esm/{GG78Gq3CY8SDS-48.mjs → YC2O0ix33xKY0ShQ.mjs} +12 -12
  52. package/node/esm/chart.mjs +19 -19
  53. package/node/esm/control.mjs +16 -16
  54. package/node/esm/group.mjs +27 -27
  55. package/node/esm/{CzQMRmArhJ6blZJp.mjs → iMUcM8KW4HIW2Ksm.mjs} +1 -1
  56. package/node/esm/index.mjs +3558 -3552
  57. package/node/esm/{BpcTu_chuDjr_XFv.mjs → k3c-0DQ1fifSFOnO.mjs} +1 -1
  58. package/node/esm/note.mjs +10 -10
  59. package/node/esm/picture.mjs +175 -162
  60. package/node/esm/shape.mjs +169 -169
  61. package/node/esm/slicer.mjs +100 -95
  62. package/node/esm/{DxKxx-yEkSydHyWQ.mjs → vYeFE_eUMRqsgnkd.mjs} +1 -1
  63. package/package.json +7 -7
  64. package/types/src/cell/CornerTriangle.d.ts +2 -1
  65. package/types/src/editor/SheetCellEditorLayer.d.ts +0 -5
  66. package/types/src/editor/formulaPresentation.d.ts +4 -3
  67. package/types/src/movable/IMovableArea.d.ts +11 -0
  68. package/types/src/sheet/IWorksheetElement.d.ts +13 -4
  69. package/types/src/theme/ExplicitTokens.d.ts +18 -0
  70. package/types/src/theme/ThemeRootStyles.d.ts +31 -0
  71. package/types/src/theme/buildTokensCSS.d.ts +15 -0
  72. package/types/src/theme/index.d.ts +2 -4
  73. package/types/src/theme/useAppColorScheme.d.ts +4 -1
  74. package/types/src/theme/useGridColorScheme.d.ts +2 -1
  75. package/types/src/theme/useSystemColors.d.ts +0 -14
  76. package/types/src/workbook/IWorkbookElement.d.ts +36 -8
@@ -1,12 +1,12 @@
1
1
  /**
2
- * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.22
2
+ * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.23
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
5
  * License: SheetXL EULA — https://www.sheetxl.com/eula
6
6
  */
7
- import { t as e } from "./DX7ysYSfnigj0ak8.mjs";
8
- import { n as t } from "./CzQMRmArhJ6blZJp.mjs";
9
- import { i as r, r as o, t as l } from "./CZc2QH8i-TgW9nGI.mjs";
7
+ import { t as e } from "./Bv0fGxNecKUr_qYS.mjs";
8
+ import { n as t } from "./iMUcM8KW4HIW2Ksm.mjs";
9
+ import { i as r, r as o, t as l } from "./B5ae_WW6vAz2jOsn.mjs";
10
10
  import { IFont as i } from "@sheetxl/sdk";
11
11
  import { forwardRef as n, memo as s, useCallback as a, useEffect as c, useLayoutEffect as d, useMemo as h, useReducer as p, useRef as u, useState as m } from "react";
12
12
  import { jsx as g, jsxs as x } from "react/jsx-runtime";
@@ -42,87 +42,92 @@ var v = () => x("svg", {
42
42
  stroke: "currentColor",
43
43
  strokeWidth: 1.2
44
44
  })]
45
- }), k = (e) => {
45
+ }), k = (e) => ({
46
+ borderLeft: e,
47
+ borderRight: e,
48
+ borderTop: e,
49
+ borderBottom: e
50
+ }), C = (e) => {
46
51
  const t = e?.getTheme().getFontScheme().getMinorFont();
47
52
  return {
48
53
  fontFamily: i.toCSSFontFamily(t ?? "", ["sans-serif"]),
49
54
  fontSize: "11pt"
50
55
  };
51
- }, C = s(n((i, n) => {
52
- const { children: s, disabled: C, style: S, slicer: M, movable: F, zoom: D = 1, isDragging: R, onHide: z, onShow: I, onDragZone: N, adornmentHost: O, flip: j, gesture: H, ...E } = i, K = b(), T = y(), W = (t() ?? M.getTable()?.getWorksheet() ?? null)?.getStyles() ?? null, [P, A] = p((e) => e + 1, 0);
53
- e(M, {
56
+ }, S = s(n((i, n) => {
57
+ const { children: s, disabled: S, style: M, slicer: F, movable: R, zoom: D = 1, isDragging: z, onHide: I, onShow: N, onDragZone: O, onTap: j, adornmentHost: H, flip: T, gesture: E, ...K } = i, W = b(), B = y(), L = (t() ?? F.getTable()?.getWorksheet() ?? null)?.getStyles() ?? null, [P, A] = p((e) => e + 1, 0);
58
+ e(F, {
54
59
  onAnyChange: A,
55
60
  onReferencesChange: A
56
- }), c(() => W?.addListeners({ onAnyChange: A }), [W]);
57
- const [B, L] = m([]);
61
+ }), c(() => L?.addListeners({ onAnyChange: A }), [L]);
62
+ const [$, J] = m([]);
58
63
  c(() => {
59
64
  let e = !0;
60
- if (!M.isDeleted()) return M.getItems().then((t) => {
61
- e && L(t);
65
+ if (!F.isDeleted()) return F.getItems().then((t) => {
66
+ e && J(t);
62
67
  }).catch(() => {
63
- e && L([]);
68
+ e && J([]);
64
69
  }), () => {
65
70
  e = !1;
66
71
  };
67
- }, [M, P]);
68
- const [$, J] = m(!1), [X, Y] = m(null), Z = u(null), q = u(null), G = u(null), [Q, U] = m(!1);
72
+ }, [F, P]);
73
+ const [X, Y] = m(!1), [Z, q] = m(null), G = u(null), Q = u(null), U = u(null), [V, _] = m(!1);
69
74
  d(() => {
70
- const e = G.current;
75
+ const e = U.current;
71
76
  if (!e) return;
72
- const t = () => U(e.scrollHeight > e.clientHeight);
77
+ const t = () => _(e.scrollHeight > e.clientHeight);
73
78
  if (t(), "undefined" == typeof ResizeObserver) return;
74
79
  const r = new ResizeObserver(t);
75
80
  return r.observe(e), () => r.disconnect();
76
81
  }, [
77
- B,
78
- M.getRowHeight(),
79
- M.getColumnCount(),
80
- M.isShowCaption()
82
+ $,
83
+ F.getRowHeight(),
84
+ F.getColumnCount(),
85
+ F.isShowCaption()
81
86
  ]), d(() => {
82
- N?.((e) => {
87
+ O?.((e) => {
83
88
  const t = e.target;
84
- return !t || !G.current?.contains(t) && !t.closest?.("button");
89
+ return !t || !U.current?.contains(t) && !t.closest?.("button");
85
90
  });
86
- }, [N]);
87
- const V = u(!1), _ = M.getColumnCount(), ee = M.getRowHeight();
91
+ }, [O]);
92
+ const ee = u(!1), te = F.getColumnCount(), re = F.getRowHeight();
88
93
  d(() => {
89
- if (V.current || 0 === B.length || !G.current) return;
90
- V.current = !0;
91
- const e = M.toJSON()?.startItem ?? 0;
92
- e > 0 && (G.current.scrollTop = Math.floor(e / _) * (ee + 4));
94
+ if (ee.current || 0 === $.length || !U.current) return;
95
+ ee.current = !0;
96
+ const e = F.toJSON()?.startItem ?? 0;
97
+ e > 0 && (U.current.scrollTop = Math.floor(e / te) * (re + 4));
93
98
  }, [
94
- B,
95
- _,
96
- ee
99
+ $,
100
+ te,
101
+ re
97
102
  ]);
98
- const te = a((e) => {
99
- M.selectItems(e).catch((e) => T.showError(e));
100
- }, [M, T]), re = a((e, t) => {
101
- if (C) return;
102
- const r = B.map((e) => e.key), o = M.isFilterCleared() ? [] : B.filter((e) => e.isSelected).map((e) => e.key), l = Z.current;
103
+ const oe = a((e) => {
104
+ F.selectItems(e).catch((e) => B.showError(e));
105
+ }, [F, B]), le = a((e, t) => {
106
+ if (S) return;
107
+ const r = $.map((e) => e.key), o = F.isFilterCleared() ? [] : $.filter((e) => e.isSelected).map((e) => e.key), l = G.current;
103
108
  if (t.shiftKey && null !== l && r.includes(l)) {
104
109
  const i = r.indexOf(l), n = r.indexOf(e.key), s = r.slice(Math.min(i, n), Math.max(i, n) + 1);
105
- te(t.ctrlKey || t.metaKey ? [.../* @__PURE__ */ new Set([...o, ...s])] : s);
110
+ oe(t.ctrlKey || t.metaKey ? [.../* @__PURE__ */ new Set([...o, ...s])] : s);
106
111
  return;
107
112
  }
108
- Z.current = e.key, t.ctrlKey || t.metaKey || $ ? 0 === o.length ? te([e.key]) : o.includes(e.key) ? te(o.filter((t) => t !== e.key)) : te([...o, e.key]) : te([e.key]);
113
+ G.current = e.key, t.ctrlKey || t.metaKey || X ? 0 === o.length ? oe([e.key]) : o.includes(e.key) ? oe(o.filter((t) => t !== e.key)) : oe([...o, e.key]) : oe([e.key]);
109
114
  }, [
110
- M,
111
- B,
115
+ F,
112
116
  $,
113
- C,
114
- te
115
- ]), oe = f(n, () => ({ isSlicerEditor: () => !0 }), []), le = l(M.getStyle(), W), ie = h(() => o(le?.wholeTable, W), [
116
- le,
117
- W,
117
+ X,
118
+ S,
119
+ oe
120
+ ]), ie = f(n, () => ({ isSlicerEditor: () => !0 }), []), ne = l(F.getStyle(), L), se = h(() => o(ne?.wholeTable, L), [
121
+ ne,
122
+ L,
118
123
  P
119
- ]), ne = h(() => o(le?.headerRow, W), [
120
- le,
121
- W,
124
+ ]), ae = h(() => o(ne?.headerRow, L), [
125
+ ne,
126
+ L,
122
127
  P
123
128
  ]);
124
- if (M.isDeleted()) return null;
125
- const se = M.isFilterCleared(), ae = M.isShowCaption(), ce = {
129
+ if (F.isDeleted()) return null;
130
+ const ce = F.isFilterCleared(), de = F.isShowCaption(), he = {
126
131
  display: "flex",
127
132
  alignItems: "center",
128
133
  justifyContent: "center",
@@ -138,8 +143,8 @@ var v = () => x("svg", {
138
143
  };
139
144
  return x("div", {
140
145
  className: "sxl-slicer-editor",
141
- ...E,
142
- ref: oe,
146
+ ...K,
147
+ ref: ie,
143
148
  style: {
144
149
  width: "100%",
145
150
  height: "100%",
@@ -149,16 +154,16 @@ var v = () => x("svg", {
149
154
  flexDirection: "column",
150
155
  overflow: "hidden",
151
156
  position: "relative",
152
- backgroundColor: "var(--sxl-color-base-100, white)",
153
- border: "var(--sxl-color-neutral, grey) solid 1px",
154
- ...k(W),
155
- ...ie,
156
- filter: C ? "blur(1px)" : void 0,
157
- boxShadow: R ? "1px 1px 2px var(--sxl-color-shadow, rgba(0,0,0,.15))" : void 0,
158
- ...S
157
+ background: "var(--sxl-color-base-100, white)",
158
+ ...k("var(--sxl-color-neutral, grey) solid 1px"),
159
+ ...C(L),
160
+ ...se,
161
+ filter: S ? "blur(1px)" : void 0,
162
+ boxShadow: z ? "1px 1px 2px var(--sxl-color-shadow, rgba(0,0,0,.15))" : void 0,
163
+ ...M
159
164
  },
160
- children: [ae ? x("div", {
161
- ref: q,
165
+ children: [de ? x("div", {
166
+ ref: Q,
162
167
  className: "sxl-slicer-caption",
163
168
  style: {
164
169
  display: "flex",
@@ -167,7 +172,7 @@ var v = () => x("svg", {
167
172
  margin: "0 9px",
168
173
  padding: "6px 0 4px 0",
169
174
  flex: "none",
170
- ...ne
175
+ ...ae
171
176
  },
172
177
  children: [
173
178
  g("span", {
@@ -177,47 +182,47 @@ var v = () => x("svg", {
177
182
  textOverflow: "ellipsis",
178
183
  whiteSpace: "nowrap"
179
184
  },
180
- children: M.getCaption()
185
+ children: F.getCaption()
181
186
  }),
182
187
  g("button", {
183
188
  type: "button",
184
189
  className: "sxl-slicer-multi-select",
185
190
  tabIndex: -1,
186
- title: K("slicer.multiSelect"),
187
- "aria-label": K("slicer.multiSelect"),
188
- "aria-pressed": $,
191
+ title: W("slicer.multiSelect"),
192
+ "aria-label": W("slicer.multiSelect"),
193
+ "aria-pressed": X,
189
194
  style: {
190
- ...ce,
191
- borderColor: $ ? "var(--sxl-color-neutral, grey)" : "transparent",
192
- backgroundColor: $ ? "var(--sxl-color-base-200, #eee)" : void 0
195
+ ...he,
196
+ borderColor: X ? "var(--sxl-color-neutral, grey)" : "transparent",
197
+ backgroundColor: X ? "var(--sxl-color-base-200, #eee)" : "transparent"
193
198
  },
194
- onClick: () => J((e) => !e),
199
+ onClick: () => Y((e) => !e),
195
200
  children: g(w, {})
196
201
  }),
197
202
  g("button", {
198
203
  type: "button",
199
204
  className: "sxl-slicer-clear",
200
205
  tabIndex: -1,
201
- title: K("slicer.clearFilter"),
202
- "aria-label": K("slicer.clearFilter"),
203
- disabled: se || C,
206
+ title: W("slicer.clearFilter"),
207
+ "aria-label": W("slicer.clearFilter"),
208
+ disabled: ce || S,
204
209
  style: {
205
- ...ce,
206
- opacity: se ? .4 : 1,
207
- cursor: se ? "default" : "pointer"
210
+ ...he,
211
+ opacity: ce ? .4 : 1,
212
+ cursor: ce ? "default" : "pointer"
208
213
  },
209
214
  onClick: () => {
210
- M.clearFilters().catch((e) => T.showError(e));
215
+ F.clearFilters().catch((e) => B.showError(e));
211
216
  },
212
217
  children: g(v, {})
213
218
  })
214
219
  ]
215
220
  }) : null, g("div", {
216
- ref: G,
221
+ ref: U,
217
222
  className: "sxl-slicer-items",
218
223
  role: "listbox",
219
224
  "aria-multiselectable": !0,
220
- "aria-label": M.getCaption(),
225
+ "aria-label": F.getCaption(),
221
226
  style: {
222
227
  flex: "1 1 auto",
223
228
  minHeight: 0,
@@ -227,16 +232,16 @@ var v = () => x("svg", {
227
232
  "--scrollbar-width": "8px",
228
233
  "--scrollbar-border-width": "1px",
229
234
  display: "grid",
230
- gridTemplateColumns: `repeat(${_}, minmax(0, 1fr))`,
231
- gridAutoRows: `${ee}px`,
235
+ gridTemplateColumns: `repeat(${te}, minmax(0, 1fr))`,
236
+ gridAutoRows: `${re}px`,
232
237
  alignContent: "start",
233
238
  gap: 4,
234
- margin: (ae ? 4 : 9) + "px 9px 9px 9px",
235
- paddingRight: Q ? 3 : 0
239
+ margin: (de ? 4 : 9) + "px 9px 9px 9px",
240
+ paddingRight: V ? 3 : 0
236
241
  },
237
- onPointerLeave: () => Y(null),
238
- children: B.map((e) => {
239
- const t = r(e.isSelected, e.hasData, X === e.key);
242
+ onPointerLeave: () => q(null),
243
+ children: $.map((e) => {
244
+ const t = r(e.isSelected, e.hasData, Z === e.key);
240
245
  return g("div", {
241
246
  className: "sxl-slicer-item",
242
247
  role: "option",
@@ -254,15 +259,15 @@ var v = () => x("svg", {
254
259
  whiteSpace: "nowrap",
255
260
  textOverflow: "ellipsis",
256
261
  userSelect: "none",
257
- cursor: C ? void 0 : "pointer",
258
- border: "1px solid transparent",
259
- ...o(le?.[t], W)
262
+ cursor: S ? void 0 : "pointer",
263
+ ...k("1px solid transparent"),
264
+ ...o(ne?.[t], L)
260
265
  },
261
- onPointerEnter: () => Y(e.key),
266
+ onPointerEnter: () => q(e.key),
262
267
  onPointerDown: (e) => {
263
- 0 === e.button && (e.stopPropagation(), e.preventDefault(), F && !F.isSelected() && F.select());
268
+ 0 === e.button && (e.stopPropagation(), e.preventDefault(), R && !R.isSelected() && R.select());
264
269
  },
265
- onClick: (t) => re(e, t),
270
+ onClick: (t) => le(e, t),
266
271
  children: g("span", {
267
272
  style: {
268
273
  overflow: "hidden",
@@ -275,5 +280,5 @@ var v = () => x("svg", {
275
280
  })]
276
281
  });
277
282
  }));
278
- C.displayName = "SlicerEditor";
279
- export { C as SlicerEditor };
283
+ S.displayName = "SlicerEditor";
284
+ export { S as SlicerEditor };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.22
2
+ * @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.23
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
5
  * License: SheetXL EULA — https://www.sheetxl.com/eula
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sheetxl/react",
3
3
  "description": "React - React components needed to build advanced grid and spreadsheet UIs.",
4
- "version": "0.8.0-beta.22",
4
+ "version": "0.8.0-beta.23",
5
5
  "license": "SEE LICENSE IN LICENSE.md",
6
6
  "type": "module",
7
7
  "exports": {
@@ -89,11 +89,11 @@
89
89
  "@dnd-kit/modifiers": "^9.0.0",
90
90
  "@dnd-kit/sortable": "^10.0.0",
91
91
  "@dnd-kit/utilities": "^3.2.2",
92
- "@sheetxl/grid-react": "^0.8.0-beta.22",
93
- "@sheetxl/io": "^0.8.0-beta.22",
94
- "@sheetxl/sdk": "^0.8.0-beta.22",
95
- "@sheetxl/utils": "^0.8.0-beta.22",
96
- "@sheetxl/utils-react": "^0.8.0-beta.22",
92
+ "@sheetxl/grid-react": "^0.8.0-beta.23",
93
+ "@sheetxl/io": "^0.8.0-beta.23",
94
+ "@sheetxl/sdk": "^0.8.0-beta.23",
95
+ "@sheetxl/utils": "^0.8.0-beta.23",
96
+ "@sheetxl/utils-react": "^0.8.0-beta.23",
97
97
  "clsx": "^2.1.1",
98
98
  "echarts": "~6.1.0",
99
99
  "react-merge-refs": "^3.0.2",
@@ -104,7 +104,7 @@
104
104
  "react-dom": "^19.0.0"
105
105
  },
106
106
  "devDependencies": {
107
- "@sheetxl/io-xlsx": "^0.8.0-beta.22",
107
+ "@sheetxl/io-xlsx": "^0.8.0-beta.23",
108
108
  "@types/react": "^19.3.0",
109
109
  "@types/react-dom": "^19.3.0"
110
110
  }
@@ -6,7 +6,8 @@ export interface CornerTriangleProps extends React.SVGProps<SVGSVGElement> {
6
6
  */
7
7
  anchorLocation?: AnchorLocation;
8
8
  /**
9
- * defaults based on corner
9
+ * The mark's color. Set on the root `<svg>`, so a stylesheet rule on the mark's class wins over it.
10
+ * @defaultValue the `color-neutral` token
10
11
  */
11
12
  fill?: string;
12
13
  /**
@@ -2,11 +2,6 @@ import { default as React } from 'react';
2
2
  import { IWorksheet } from '@sheetxl/sdk';
3
3
  import { EditorAlignment, VirtualDivProps } from '@sheetxl/grid-react';
4
4
  import { SheetEditable } from './SheetEditable';
5
- /**
6
- * Props for {@link SheetCellEditorLayer}.
7
- *
8
- * @typeParam C - clean value type. @typeParam D - dirty value type. @typeParam A - commit args.
9
- */
10
5
  export interface SheetCellEditorLayerProps extends VirtualDivProps {
11
6
  /**
12
7
  * Stacking override, read by the grid's sorter **off this element** when the editor is a grid
@@ -59,9 +59,10 @@ export declare const EVAL_RUN_STYLE: CSSProperties;
59
59
  */
60
60
  export declare const EVAL_RUN_OUTLINE_STYLE: CSSProperties;
61
61
  /**
62
- * The hue for a paren at `depth` (0 = outermost), cycling once the palette is exhausted.
63
- * Theme-adaptive: emits `light-dark(light, dark)` so the browser re-picks from the subtree's
64
- * `color-scheme` with no re-render — no `darkMode` flag needed (see `IColor.CSSMode`'s `'adaptive'`).
62
+ * The hue for a paren at `depth` (0 = outermost): the `color-bracket` token, cycling once the palette is
63
+ * exhausted. A pair shares one hue and nesting rotates it, so which `)` closes which `(` reads at a glance
64
+ * in a deep formula without moving the caret there. Not the `color-series` palette the references use:
65
+ * parens and references sit in the same line of text and have to stay tellable apart.
65
66
  */
66
67
  export declare const parenDepthColor: (depth: number) => string;
67
68
  /**
@@ -54,6 +54,17 @@ export interface MovableElementProps extends React.HTMLAttributes<HTMLElement> {
54
54
  * box can drag from its border and put the caret where its text is pressed.
55
55
  */
56
56
  onDragZone?: (isDragZone: (event: MouseEvent | TouchEvent) => boolean) => void;
57
+ /**
58
+ * Registers what a finger tap does on the movable while it is not selected: answer `true` to take
59
+ * the tap, and the frame leaves the movable unselected. Without one, or on `false`, the tap selects.
60
+ *
61
+ * @remarks
62
+ * A finger pressed on a movable that is not selected may be starting a pan of the sheet, so the
63
+ * content never receives that press: the frame waits for the finger to lift where it went down,
64
+ * the sheet unscrolled, and only then calls this. A link that opens on a tap is the use; the sheet
65
+ * still pans from anywhere on the movable.
66
+ */
67
+ onTap?: (tap: (event: PointerEvent) => boolean) => void;
57
68
  /**
58
69
  * A box above the selection chrome, placed and turned exactly as the frame is, for the content's
59
70
  * own controls (a shape's adjustment handles). `null` when the movable has none.
@@ -10,6 +10,7 @@ import { ValidationPromptRenderProps, ValidationAlertRenderProps } from '../laye
10
10
  import { TableToolbarRenderProps } from '../layer/TableToolbar';
11
11
  import { PivotToolbarRenderProps } from '../layer/PivotToolbar';
12
12
  import { CommandContext } from '../frame';
13
+ import { ExplicitTokens } from '../theme';
13
14
  import { ISheetHeaderElement, SheetHeaderProps } from './ISheetHeaderElement';
14
15
  export interface SheetLocation {
15
16
  clientX: number;
@@ -62,14 +63,22 @@ export interface WorksheetElementProps extends React.HTMLAttributes<HTMLDivEleme
62
63
  */
63
64
  renderSheetError?: RenderSlotFn<ErrorPanelProps> | null;
64
65
  /**
65
- * The app (chrome / header) color scheme — selects the header/app surface mode.
66
+ * The app (chrome / header) color scheme — selects the header/app surface mode. `'auto'` follows the
67
+ * page: a `dark`/`light` class on `<html>`/`<body>`, else the OS.
66
68
  */
67
- colorScheme?: ThemeMode;
69
+ colorScheme?: ThemeMode | 'auto';
68
70
  /**
69
71
  * The grid-body color scheme (stays light in a dark app when *Enable Dark Grid* is off) — drives the grid
70
- * `darkMode` rendering intent and the grid surface mode.
72
+ * `darkMode` rendering intent and the grid surface mode. `'auto'` follows the page as
73
+ * {@link colorScheme} does.
71
74
  */
72
- gridColorScheme?: ThemeMode;
75
+ gridColorScheme?: ThemeMode | 'auto';
76
+ /**
77
+ * Token values for this sheet, per mode and surface: the React form of a stylesheet in
78
+ * `@layer sxl-overrides`, scoped to this instance. Same shape as the workbook's `tokens`; inside a
79
+ * workbook, set them there instead.
80
+ */
81
+ tokens?: ExplicitTokens;
73
82
  /**
74
83
  * Show the column headers
75
84
  */
@@ -0,0 +1,18 @@
1
+ import { TokenTheme, ThemeMode } from '@sheetxl/utils-react';
2
+ /** The surfaces a host can address: the `data-sxl-theme-surface` values a workbook introduces. */
3
+ export type ExplicitSurface = 'app' | 'header' | 'grid';
4
+ /**
5
+ * Token values a host states, addressed by **cell**: a `(mode × surface)` pair, so a host can name the
6
+ * header paper without a new token existing.
7
+ *
8
+ * ```ts
9
+ * {
10
+ * dark: {
11
+ * app: { 'color-base-100': '#14102c', 'color-base-200': '#14102c', 'color-primary': '#6e9bff' },
12
+ * header: { 'color-base-100': '#1a1538', 'color-base-300': '#312b55' }
13
+ * }
14
+ * }
15
+ * ```
16
+ */
17
+ export type ExplicitTokens = Partial<Record<ThemeMode, Partial<Record<ExplicitSurface, Partial<TokenTheme>>>>>;
18
+ //# sourceMappingURL=ExplicitTokens.d.ts.map
@@ -0,0 +1,31 @@
1
+ import { default as React } from 'react';
2
+ import { ExplicitTokens } from './ExplicitTokens';
3
+ export interface ThemeRootStylesProps {
4
+ /**
5
+ * The theme root's scope class, without the leading dot. Put the same class on the root element; the
6
+ * styles apply to it and everything inside it, and to floats that carry it.
7
+ */
8
+ scopeClass: string;
9
+ /** Token values for this root, per mode and surface. Pass a stable object. */
10
+ tokens?: ExplicitTokens;
11
+ }
12
+ /**
13
+ * The stylesheets that make an element a self-contained themed instance: the neutral token defaults for
14
+ * the `app`, `grid` and `header` surfaces, the spreadsheet system colors (`--sxl-sys-color-*`) resolved
15
+ * against those surfaces, and the host's {@link ThemeRootStylesProps.tokens}, all scoped to `scopeClass`.
16
+ *
17
+ * @remarks
18
+ * `WorkbookElement` and `WorksheetElement` render this at their roots. Render it yourself only when you
19
+ * build your own shell around them and its chrome sits outside their roots: then that shell is the theme
20
+ * root. Set `data-sxl-theme-mode` on the root element alongside the class.
21
+ *
22
+ * ```tsx
23
+ * const scopeClass = createThemeScopeClass('shell', useId());
24
+ * <div className={scopeClass} data-sxl-theme-mode="dark">
25
+ * <ThemeRootStyles scopeClass={scopeClass} />
26
+ * …
27
+ * </div>
28
+ * ```
29
+ */
30
+ export declare const ThemeRootStyles: React.MemoExoticComponent<({ scopeClass, tokens }: ThemeRootStylesProps) => React.JSX.Element>;
31
+ //# sourceMappingURL=ThemeRootStyles.d.ts.map
@@ -0,0 +1,15 @@
1
+ import { ExplicitTokens } from './ExplicitTokens';
2
+ /**
3
+ * The override stylesheet for {@link ExplicitTokens}: the same rules a client would write by hand in
4
+ * `@layer sxl-overrides`, scoped to one instance.
5
+ *
6
+ * @remarks
7
+ * An `app` value reaches every surface in that mode, because each surface element carries its own mode and
8
+ * the override layer outranks the surface defaults. State a `grid` or `header` cell to make that surface
9
+ * differ. A value stated for one mode never applies in the other.
10
+ *
11
+ * @param tokens The host's cells.
12
+ * @param scope The instance's `@scope` selector (e.g. `.sheetxl-workbook-r1`).
13
+ */
14
+ export declare const buildTokensCSS: (tokens: ExplicitTokens, scope?: string) => string;
15
+ //# sourceMappingURL=buildTokensCSS.d.ts.map
@@ -1,11 +1,9 @@
1
1
  export * from './DocThemesContext';
2
2
  export * from './DocThemesProvider';
3
3
  export * from './useDocThemes';
4
- export * from './createCSSSystemLookup';
5
- export * from './useSystemColors';
6
- export * from './buildOOXMLThemeCSS';
7
- export * from './buildDocThemeCSS';
8
4
  export * from './ThemeState';
9
5
  export * from './useGridColorScheme';
10
6
  export * from './useAppColorScheme';
7
+ export * from './ExplicitTokens';
8
+ export * from './ThemeRootStyles';
11
9
  //# sourceMappingURL=index.d.ts.map
@@ -10,6 +10,9 @@ import { ThemeMode } from '@sheetxl/utils-react';
10
10
  * rule, and both the workbook root (app mode) and the sheet (grid mode) are ancestors, so CSS would pick by
11
11
  * source order rather than proximity. Stating the mode selects the compound `[mode][surface]` cell, which is
12
12
  * emitted last and wins.
13
+ *
14
+ * @param override A controlled scheme (a host's `colorScheme` prop); when provided it wins over the
15
+ * preference. `'auto'` follows the page class, else the OS.
13
16
  */
14
- export declare const useAppColorScheme: () => ThemeMode;
17
+ export declare const useAppColorScheme: (override?: ThemeMode | "auto") => ThemeMode;
15
18
  //# sourceMappingURL=useAppColorScheme.d.ts.map
@@ -19,6 +19,7 @@ import { ThemeMode } from '@sheetxl/utils-react';
19
19
  * element, then resolves `--sxl-*` from the cascade / `getComputedStyle`.
20
20
  *
21
21
  * @param override Optional controlled scheme; when provided it wins over the enclosing grid and the preference.
22
+ * `'auto'` follows the page class, else the OS, without the *Enable Dark Grid* gate: the host asked for it.
22
23
  */
23
- export declare const useGridColorScheme: (override?: ThemeMode) => ThemeMode;
24
+ export declare const useGridColorScheme: (override?: ThemeMode | "auto") => ThemeMode;
24
25
  //# sourceMappingURL=useGridColorScheme.d.ts.map
@@ -1,4 +1,3 @@
1
- import { IColor } from '@sheetxl/sdk';
2
1
  import { CSSSystemLookup } from './createCSSSystemLookup';
3
2
  /**
4
3
  * Injects the default `--sxl-sys-color-*` CSS variables — the built-in (baked) system color
@@ -12,19 +11,6 @@ import { CSSSystemLookup } from './createCSSSystemLookup';
12
11
  * `:root` stylesheet (not inline styles) keeps specificity low so host overrides win.
13
12
  */
14
13
  export declare const installSystemColorDefaults: () => void;
15
- /**
16
- * Builds `--sxl-sys-color-*` CSS variable overrides from a partial set of {@link IColor.Named} system
17
- * colors, so that system/auto colors (which `IColor.toCSS()` emits as `var(--sxl-sys-color-*)`) resolve
18
- * to the provided values rather than the global host mapping.
19
- *
20
- * @remarks
21
- * Used by the grid container ({@link WorksheetElement}) and by UI rendered *outside* the grid subtree
22
- * that must still match the grid's light/dark intent — most notably a color picker popup, which is
23
- * portaled and would otherwise inherit the host's `--sxl-sys-color-*` (e.g. a light grid in a dark host
24
- * would show the host's dark `auto` color). Names are lower-cased to match the variable
25
- * `IColor.toCSS()` references; centralizing that here keeps callers from drifting.
26
- */
27
- export declare const createSystemColorVars: (colors: Partial<Record<IColor.Named, string>>) => Record<string, string>;
28
14
  /**
29
15
  * Ensures the default system-color CSS variables are present (see {@link installSystemColorDefaults}).
30
16
  * Wired into `WorksheetElement`, so the grid themes from `--sxl-sys-color-*` out of the box.
@@ -4,6 +4,7 @@ import { IWorkbook, IWorkbookIO, IMovable, ITable, IPivotTable } from '@sheetxl/
4
4
  import { LoadingPanelProps, ErrorPanelProps, RenderFloatPanel, FloatPanelProps, FloatReference, RenderSlotFn, ThemeMode, Command } from '@sheetxl/utils-react';
5
5
  import { WorksheetElementProps, IWorksheetElement, OpaqueSheetElementProps } from '../sheet';
6
6
  import { SheetEditable } from '../editor';
7
+ import { ExplicitTokens } from '../theme';
7
8
  import { CommandContext } from '../frame';
8
9
  import { WorkbookStripProps } from './WorkbookStrip';
9
10
  /**
@@ -97,17 +98,44 @@ export interface WorkbookElementProps extends Omit<React.HTMLAttributes<HTMLDivE
97
98
  */
98
99
  workbook?: IWorkbook | Promise<IWorkbook> | IWorkbookIO.ReadOptions;
99
100
  /**
100
- * Controlled override for the app (chrome) light/dark scheme. When omitted, the workbook self-sources
101
- * it from the shared appearance preference (`ThemeStateKey.Mode`). With no preference set it is light,
102
- * unless the page puts a `dark`/`light` class on `<html>`/`<body>` or a `ThemeModeFallbackContext`
103
- * above says otherwise (`'system'` follows the OS, as Studio does).
101
+ * Controlled override for the app (chrome) light/dark scheme. `'auto'` follows the page: a
102
+ * `dark`/`light` class on `<html>`/`<body>`, else the OS.
103
+ *
104
+ * When omitted, the workbook self-sources it from the shared appearance preference
105
+ * (`ThemeStateKey.Mode`). With no preference set it is light, unless the page puts a `dark`/`light` class
106
+ * on `<html>`/`<body>` or a `ThemeModeFallbackContext` above says otherwise.
104
107
  */
105
- colorScheme?: ThemeMode;
108
+ colorScheme?: ThemeMode | 'auto';
106
109
  /**
107
- * Controlled override for the grid-body scheme (stays light in a dark app when *Enable Dark Grid* is
108
- * off). When omitted, derived from {@link colorScheme} + the `ThemeStateKey.DarkGrid` preference.
110
+ * Controlled override for the grid-body scheme. `'auto'` follows the page as {@link colorScheme} does.
111
+ *
112
+ * When omitted, the grid follows {@link colorScheme} only if *Enable Dark Grid*
113
+ * (`ThemeStateKey.DarkGrid`) is on, so by default it stays light in a dark app. Pass it to make the grid
114
+ * dark with the page.
115
+ */
116
+ gridColorScheme?: ThemeMode | 'auto';
117
+ /**
118
+ * Token values for this workbook, per mode and surface: the React form of a stylesheet in
119
+ * `@layer sxl-overrides`, scoped to this instance.
120
+ *
121
+ * ```tsx
122
+ * <WorkbookElement
123
+ * colorScheme="auto"
124
+ * gridColorScheme="auto"
125
+ * tokens={{
126
+ * dark: {
127
+ * app: { 'color-base-100': '#14102c', 'color-base-200': '#14102c', 'color-primary': '#6e9bff' },
128
+ * header: { 'color-base-100': '#1a1538', 'color-base-300': '#312b55' }
129
+ * }
130
+ * }}
131
+ * />
132
+ * ```
133
+ *
134
+ * @remarks
135
+ * An `app` value reaches the grid and headers too in that mode; state a `grid` or `header` cell to make
136
+ * that surface differ. Pass a stable object: a new reference rebuilds the stylesheet.
109
137
  */
110
- gridColorScheme?: ThemeMode;
138
+ tokens?: ExplicitTokens;
111
139
  /**
112
140
  * Callback for when the workbook is loaded (first render). Useful for hiding/showing
113
141
  * loading panels.