@sheetxl/react 0.8.0-beta.21 → 0.8.0-beta.22
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/browser/esm/{B7TCFLHs7nnOgLMi.mjs → B9rbGikcuRq1OnhM.mjs} +2 -2
- package/browser/esm/{Co65nK3fyBcyVzrS.mjs → B9wkino8VMasq6E3.mjs} +1 -1
- package/browser/esm/{C2HjD-DbaqXq93R7.mjs → BPS1PDZKyF6ivJwa.mjs} +1 -1
- package/browser/esm/{CA6w64diOtRCgr4n.mjs → Biz8qA4-1wRN8de2.mjs} +1 -1
- package/browser/esm/{k1IvXgw5-153QQUo.mjs → Bjzo7g25tw9kTCYC.mjs} +2 -2
- package/browser/esm/{fHDciYUZvXpLzoID.mjs → BqIbT28MM3SBdvh_.mjs} +2 -2
- package/browser/esm/C7rc3CMd_XOITW1V.mjs +264 -0
- package/browser/esm/{CdE8JeJkTtdh5qqp.mjs → CJVcfqrty5b-eowN.mjs} +2 -2
- package/browser/esm/{CkYId3pjG9v3XZM2.mjs → CgOhJ3utK7aSQm26.mjs} +1 -1
- package/browser/esm/{_T8e_9xhVAagwkPD.mjs → CrTfqdSwWScJN566.mjs} +1 -1
- package/browser/esm/{DL2WZkJdK1lZfpJo.mjs → D01C312OntVURMN9.mjs} +7 -7
- package/browser/esm/{Dl0ye0MfTml4mjhA.mjs → D0g7sllamMog1m-Z.mjs} +3 -3
- package/browser/esm/{zTaXN_1rvsoWg94m.mjs → D7P7zWW2gdWclI2p.mjs} +3 -3
- package/browser/esm/{BjnWnPjhT1QFkbUC.mjs → D8NUgUzdI7YFxyyA.mjs} +3 -3
- package/browser/esm/{DG1f60gvSkz8Y3qb.mjs → DH8xeknZXWn7AV5q.mjs} +6 -6
- package/browser/esm/{BQur1iFrng9Y4kh4.mjs → DgmkBz2cYtVZ8tXv.mjs} +1 -1
- package/browser/esm/{C46qV9hBGqlz6_Kt.mjs → DhGJU1camaOf7KOq.mjs} +4 -4
- package/browser/esm/{CCL3pFmdsuwahoCR.mjs → DxsGY5rYjITV3SLK.mjs} +1 -1
- package/browser/esm/{CPwcEeQtvkrESNEy.mjs → DyFeCww9e_4G9c-1.mjs} +5 -5
- package/browser/esm/{CHgyrBEiFmspcFXV.mjs → HQkKZC6SPUdQwgxi.mjs} +1 -1
- package/browser/esm/{BwMC6jAg2neI4LTH.mjs → QKnTzTdIYAMcBU8r.mjs} +1 -1
- package/browser/esm/chart.mjs +3 -3
- package/browser/esm/control.mjs +2 -2
- package/browser/esm/group.mjs +3 -3
- package/browser/esm/{mOYnwl3MMod-yX7a.mjs → hTeTTb8oYTssk6EY.mjs} +1 -1
- package/browser/esm/index.mjs +6409 -6402
- package/browser/esm/{BzCq_Z7J2qQlY4Dp.mjs → mJyEnJIX0iGfGtvE.mjs} +1 -1
- package/browser/esm/{C9dHNoiKtX9PLY1g.mjs → mUKvsPCmRWzQke-M.mjs} +1 -1
- package/browser/esm/note.mjs +4 -4
- package/browser/esm/{6lfBozPNyWlFBEDn.mjs → np1ChcItFltS6AC5.mjs} +1 -1
- package/browser/esm/picture.mjs +2 -2
- package/browser/esm/shape.mjs +2 -2
- package/browser/esm/slicer.mjs +4 -4
- package/node/esm/{Bzuh8HcJcFD2dYTY.mjs → -6T2zqPkDm0WgUKI.mjs} +2 -2
- package/node/esm/{COg8aOu0d67g_Pg5.mjs → BPMjPMRyVTEZq_6j.mjs} +1 -1
- package/node/esm/{8PerdW56-NyRf0pg.mjs → BcASbEBHzMKiXn5i.mjs} +1 -1
- package/node/esm/{BadjRr_jKKGvmEW-.mjs → BpcTu_chuDjr_XFv.mjs} +1 -1
- package/node/esm/{Mq8a4csdTfwY5CnZ.mjs → C3XXdc_UXH2g2W5E.mjs} +1 -1
- package/node/esm/{CGEbcsNJ40cYQEWX.mjs → C91YeRrspETjFcRc.mjs} +2 -2
- package/node/esm/{B2a1mRx9B8XMRd8H.mjs → CE5fMGMmykts2yJP.mjs} +1 -1
- package/node/esm/{cgqViNUwnlIX8-UW.mjs → COlzVELrEvgm2STX.mjs} +4 -4
- package/node/esm/{fM9xnrz0LJWdndYE.mjs → CZc2QH8i-TgW9nGI.mjs} +1 -1
- package/node/esm/{JrDkDzP0l4TgHusH.mjs → CcLUKcJROXrbSXjb.mjs} +1 -1
- package/node/esm/{BBBfGP0lLhBFoR9F.mjs → CfpNgRvWmu36cTfV.mjs} +5 -5
- package/node/esm/{EXPN4LM0alUK5Zw7.mjs → CzQMRmArhJ6blZJp.mjs} +1 -1
- package/node/esm/{CNYzecnb2TInTI8p.mjs → DHTbAHbCiEWhilV_.mjs} +1 -1
- package/node/esm/{DtrPF3bSD4CZC5VG.mjs → DX7ysYSfnigj0ak8.mjs} +1 -1
- package/node/esm/{CD1OBtF4vEthYy6e.mjs → DxKxx-yEkSydHyWQ.mjs} +1 -1
- package/node/esm/{BQpm93aEyzN5TiU6.mjs → FUQMKIiQQ5m3xzeO.mjs} +1 -1
- package/node/esm/{tRhXTPxocmY7ZY3z.mjs → GG78Gq3CY8SDS-48.mjs} +1 -1
- package/node/esm/{CdKkuM4Yy04LbhRL.mjs → aLt3NYdUcYQu4Ur4.mjs} +1 -1
- package/node/esm/chart.mjs +2 -2
- package/node/esm/{B4qJFO-8Vml8JbaC.mjs → cju5Gx-t_74o116W.mjs} +2 -2
- package/node/esm/control.mjs +2 -2
- package/node/esm/group.mjs +3 -3
- package/node/esm/{Df-nWyFJwXaVd79x.mjs → i4aPmKocZebCBeSd.mjs} +79 -77
- package/node/esm/index.mjs +5542 -5535
- package/node/esm/{uzlKB6H0b-ol8pDK.mjs → l0GtU6LYlBywzc9T.mjs} +1 -1
- package/node/esm/note.mjs +4 -4
- package/node/esm/picture.mjs +5 -5
- package/node/esm/shape.mjs +18 -18
- package/node/esm/slicer.mjs +4 -4
- package/package.json +7 -7
- package/types/src/movable/MovableLayer.d.ts +1 -1
- package/types/src/theme/GridColorSchemeContext.d.ts +8 -0
- package/types/src/theme/useGridColorScheme.d.ts +5 -1
- package/browser/esm/BzFKdDmdCdg3cXdh.mjs +0 -262
|
@@ -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.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.22
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
package/node/esm/note.mjs
CHANGED
|
@@ -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.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.22
|
|
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 "./
|
|
8
|
-
import { t as o } from "./
|
|
9
|
-
import { t } from "./
|
|
7
|
+
import { t as e } from "./DX7ysYSfnigj0ak8.mjs";
|
|
8
|
+
import { t as o } from "./C3XXdc_UXH2g2W5E.mjs";
|
|
9
|
+
import { t } from "./BpcTu_chuDjr_XFv.mjs";
|
|
10
10
|
import { Color as r, IColor as n, IFont as i, IFontStyle as l, IStroke as a } from "@sheetxl/sdk";
|
|
11
11
|
import { forwardRef as s, memo as d, useReducer as c } from "react";
|
|
12
12
|
import { jsx as g } from "react/jsx-runtime";
|
package/node/esm/picture.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.22
|
|
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 } from "./
|
|
8
|
-
import { n as e } from "./
|
|
9
|
-
import { t as o } from "./
|
|
10
|
-
import { i as r, r as i, t as n } from "./
|
|
7
|
+
import { t } from "./DX7ysYSfnigj0ak8.mjs";
|
|
8
|
+
import { n as e } from "./CzQMRmArhJ6blZJp.mjs";
|
|
9
|
+
import { t as o } from "./aLt3NYdUcYQu4Ur4.mjs";
|
|
10
|
+
import { i as r, r as i, t as n } from "./l0GtU6LYlBywzc9T.mjs";
|
|
11
11
|
import { forwardRef as l, memo as s, useEffect as a, useId as h, useMemo as d, useReducer as c, useRef as u, useState as p } from "react";
|
|
12
12
|
import { jsx as g, jsxs as f } from "react/jsx-runtime";
|
|
13
13
|
import { useSurfaceStateSetter as m } from "@sheetxl/grid-react";
|
package/node/esm/shape.mjs
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.22
|
|
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 "./
|
|
8
|
-
import { n as t } from "./
|
|
9
|
-
import { t as n } from "./
|
|
10
|
-
import { t as o } from "./
|
|
11
|
-
import { i as r, n as s, r as i, t as l } from "./
|
|
7
|
+
import { t as e } from "./DX7ysYSfnigj0ak8.mjs";
|
|
8
|
+
import { n as t } from "./CzQMRmArhJ6blZJp.mjs";
|
|
9
|
+
import { t as n } from "./C3XXdc_UXH2g2W5E.mjs";
|
|
10
|
+
import { t as o } from "./BcASbEBHzMKiXn5i.mjs";
|
|
11
|
+
import { i as r, n as s, r as i, t as l } from "./l0GtU6LYlBywzc9T.mjs";
|
|
12
12
|
import { forwardRef as a, memo as p, useCallback as c, useEffect as d, useMemo as h, useReducer as u, useRef as m, useState as g } from "react";
|
|
13
|
-
import { jsx as f, jsxs as
|
|
14
|
-
import { messageKey as
|
|
13
|
+
import { jsx as f, jsxs as v } from "react/jsx-runtime";
|
|
14
|
+
import { messageKey as y } from "@sheetxl/utils";
|
|
15
15
|
import { ReactUtils as x, useImperativeElement as w } from "@sheetxl/utils-react";
|
|
16
16
|
import { createPortal as b } from "react-dom";
|
|
17
17
|
var j = p(({ handles: e, width: t, height: n, zoom: o, onDrag: r }) => {
|
|
@@ -40,7 +40,7 @@ var j = p(({ handles: e, width: t, height: n, zoom: o, onDrag: r }) => {
|
|
|
40
40
|
e.stopPropagation(), i.current = null, a(!1);
|
|
41
41
|
const n = p(e);
|
|
42
42
|
n ? r(t.index, n.x, n.y, "end") : r(t.index, 0, 0, "cancel");
|
|
43
|
-
}, [p, r]),
|
|
43
|
+
}, [p, r]), y = c((e) => {
|
|
44
44
|
const t = i.current;
|
|
45
45
|
t && t.pointerId === e.pointerId && (i.current = null, a(!1), r(t.index, 0, 0, "cancel"));
|
|
46
46
|
}, [r]);
|
|
@@ -62,7 +62,7 @@ var j = p(({ handles: e, width: t, height: n, zoom: o, onDrag: r }) => {
|
|
|
62
62
|
pointerEvents: "none",
|
|
63
63
|
touchAction: "none"
|
|
64
64
|
},
|
|
65
|
-
children: e.map((e) =>
|
|
65
|
+
children: e.map((e) => v("g", {
|
|
66
66
|
className: "sxl-shape-handle",
|
|
67
67
|
style: { "--shape-scale": x },
|
|
68
68
|
children: [f("circle", {
|
|
@@ -87,7 +87,7 @@ var j = p(({ handles: e, width: t, height: n, zoom: o, onDrag: r }) => {
|
|
|
87
87
|
onPointerDown: (t) => d(t, e.index),
|
|
88
88
|
onPointerMove: h,
|
|
89
89
|
onPointerUp: u,
|
|
90
|
-
onPointerCancel:
|
|
90
|
+
onPointerCancel: y,
|
|
91
91
|
onMouseDown: (e) => e.stopPropagation()
|
|
92
92
|
})]
|
|
93
93
|
}, e.index))
|
|
@@ -182,7 +182,7 @@ var T = (e, t) => e > 0 || t > 0, C = (e, t, n) => !e || e.getWidth() === t && e
|
|
|
182
182
|
const e = { adjustments: r }, t = (t) => {
|
|
183
183
|
t.getContent().setAdjustments(e.adjustments);
|
|
184
184
|
};
|
|
185
|
-
if (!O.start(
|
|
185
|
+
if (!O.start(y("op.setShapeAdjustments"), t)) return;
|
|
186
186
|
he.current = e, me(!0);
|
|
187
187
|
}
|
|
188
188
|
he.current.adjustments = r, O.preview({ content: { adjustments: r } });
|
|
@@ -203,7 +203,7 @@ var T = (e, t) => e > 0 || t > 0, C = (e, t, n) => !e || e.getWidth() === t && e
|
|
|
203
203
|
]), fe = h(() => {
|
|
204
204
|
const e = [];
|
|
205
205
|
return de?.forEachHandle((t) => e.push(t)), e;
|
|
206
|
-
}, [de]),
|
|
206
|
+
}, [de]), ve = w(p, () => ({ isShapeEditor: () => !0 }), []), ye = R ?? N?.getFlip(), xe = ye?.horizontal ?? !1, we = ye?.vertical ?? !1, be = V % 360 != 0, je = h(() => !be && T(L, U) ? {
|
|
207
207
|
dpr: x.getDevicePixelRatio(),
|
|
208
208
|
zoom: z,
|
|
209
209
|
width: L,
|
|
@@ -244,10 +244,10 @@ var T = (e, t) => e > 0 || t > 0, C = (e, t, n) => !e || e.getWidth() === t && e
|
|
|
244
244
|
children: Ee
|
|
245
245
|
}), k)));
|
|
246
246
|
const Ae = xe !== we ? "scaleX(-1)" : void 0, De = de?.getTextRect(), Ne = J.text, ze = !!Ne && Ne.paragraphs.some((e) => e.runs.some((e) => "" !== e.text));
|
|
247
|
-
return
|
|
247
|
+
return v("div", {
|
|
248
248
|
className: "sxl-shape-editor",
|
|
249
249
|
...F,
|
|
250
|
-
ref:
|
|
250
|
+
ref: ve,
|
|
251
251
|
style: {
|
|
252
252
|
width: "100%",
|
|
253
253
|
height: "100%",
|
|
@@ -259,7 +259,7 @@ var T = (e, t) => e > 0 || t > 0, C = (e, t, n) => !e || e.getWidth() === t && e
|
|
|
259
259
|
pointerEvents: "none"
|
|
260
260
|
},
|
|
261
261
|
children: [
|
|
262
|
-
T(L, U) ?
|
|
262
|
+
T(L, U) ? v("svg", {
|
|
263
263
|
className: "sxl-shape-geometry",
|
|
264
264
|
viewBox: `0 0 ${L > 0 ? L : 1 / z} ${U > 0 ? U : 1 / z}`,
|
|
265
265
|
width: L > 0 ? "100%" : "1px",
|
|
@@ -272,7 +272,7 @@ var T = (e, t) => e > 0 || t > 0, C = (e, t, n) => !e || e.getWidth() === t && e
|
|
|
272
272
|
top: 0,
|
|
273
273
|
display: "block",
|
|
274
274
|
pointerEvents: "none",
|
|
275
|
-
filter: Pe ? "drop-shadow(1px 1px 2px rgba(0,0,0
|
|
275
|
+
filter: Pe ? "drop-shadow(1px 1px 2px var(--sxl-color-shadow, rgba(0, 0, 0, 0.15)))" : void 0
|
|
276
276
|
},
|
|
277
277
|
children: [de ? f(l, {
|
|
278
278
|
geometry: de,
|
|
@@ -280,7 +280,7 @@ var T = (e, t) => e > 0 || t > 0, C = (e, t, n) => !e || e.getWidth() === t && e
|
|
|
280
280
|
zoom: z,
|
|
281
281
|
grid: je,
|
|
282
282
|
hit: Ce
|
|
283
|
-
}) : null, B && de && De ?
|
|
283
|
+
}) : null, B && de && De ? v("g", {
|
|
284
284
|
pointerEvents: "none",
|
|
285
285
|
children: [f("rect", {
|
|
286
286
|
x: De.l,
|
package/node/esm/slicer.mjs
CHANGED
|
@@ -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.
|
|
2
|
+
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.22
|
|
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 "./
|
|
8
|
-
import { n as t } from "./
|
|
9
|
-
import { i as r, r as o, t as l } from "./
|
|
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";
|
|
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";
|
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.
|
|
4
|
+
"version": "0.8.0-beta.22",
|
|
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.
|
|
93
|
-
"@sheetxl/io": "^0.8.0-beta.
|
|
94
|
-
"@sheetxl/sdk": "^0.8.0-beta.
|
|
95
|
-
"@sheetxl/utils": "^0.8.0-beta.
|
|
96
|
-
"@sheetxl/utils-react": "^0.8.0-beta.
|
|
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",
|
|
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.
|
|
107
|
+
"@sheetxl/io-xlsx": "^0.8.0-beta.22",
|
|
108
108
|
"@types/react": "^19.3.0",
|
|
109
109
|
"@types/react-dom": "^19.3.0"
|
|
110
110
|
}
|
|
@@ -93,6 +93,6 @@ export interface MovableLayerProps extends React.HTMLAttributes<HTMLDivElement>
|
|
|
93
93
|
ref?: React.Ref<IMovableLayerElement>;
|
|
94
94
|
}
|
|
95
95
|
/** The shadow under a selected movable's frame; content that shades itself draws the same along its outline. */
|
|
96
|
-
export declare const SELECTION_SHADOW = "1px 1px 2px 2px rgba(0,0,0
|
|
96
|
+
export declare const SELECTION_SHADOW = "1px 1px 2px 2px var(--sxl-color-shadow, rgba(0, 0, 0, 0.15))";
|
|
97
97
|
export declare const MovableLayer: React.NamedExoticComponent<Omit<MovableLayerProps, "ref"> & React.RefAttributes<IMovableLayerElement>>;
|
|
98
98
|
//# sourceMappingURL=MovableLayer.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ThemeMode } from '@sheetxl/utils-react';
|
|
2
|
+
/**
|
|
3
|
+
* The resolved grid scheme of the nearest enclosing workbook or worksheet element, so content drawn
|
|
4
|
+
* inside the grid (charts, cell renderers, sheet tabs) follows a host's `gridColorScheme` rather than
|
|
5
|
+
* the shared preference. `null` outside any grid.
|
|
6
|
+
*/
|
|
7
|
+
export declare const GridColorSchemeContext: import('react').Context<ThemeMode | null>;
|
|
8
|
+
//# sourceMappingURL=GridColorSchemeContext.d.ts.map
|
|
@@ -11,10 +11,14 @@ import { ThemeMode } from '@sheetxl/utils-react';
|
|
|
11
11
|
* preview, the cell-style / color pickers) — resolves the *same* value with no prop-threading and no
|
|
12
12
|
* drift from the studio (which reads the same keys the same way).
|
|
13
13
|
*
|
|
14
|
+
* Inside a workbook or worksheet element the element's own scheme wins: a host that passes
|
|
15
|
+
* `gridColorScheme` gets it for everything drawn in that grid (charts, cell renderers, sheet tabs),
|
|
16
|
+
* not only the cells.
|
|
17
|
+
*
|
|
14
18
|
* A consumer uses it to set `data-sxl-theme-surface="grid"` + `data-sxl-theme-mode={scheme}` on its own
|
|
15
19
|
* element, then resolves `--sxl-*` from the cascade / `getComputedStyle`.
|
|
16
20
|
*
|
|
17
|
-
* @param override Optional controlled scheme; when provided it wins over the preference.
|
|
21
|
+
* @param override Optional controlled scheme; when provided it wins over the enclosing grid and the preference.
|
|
18
22
|
*/
|
|
19
23
|
export declare const useGridColorScheme: (override?: ThemeMode) => ThemeMode;
|
|
20
24
|
//# sourceMappingURL=useGridColorScheme.d.ts.map
|
|
@@ -1,262 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/react - React - React components needed to build advanced grid and spreadsheet UIs. - v0.8.0-beta.21
|
|
3
|
-
*
|
|
4
|
-
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
6
|
-
*/
|
|
7
|
-
import { t as e } from "./_T8e_9xhVAagwkPD.mjs";
|
|
8
|
-
import { forwardRef as t, memo as n, useCallback as r, useEffect as i, useLayoutEffect as a, useRef as o, useState as s } from "react";
|
|
9
|
-
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
10
|
-
import { CommonUtils as u, defineLazyModule as ee } from "@sheetxl/utils";
|
|
11
|
-
import { useImperativeElement as te, useMeasure as ne, usePendingRender as re, usePersistentState as d, useResolvedThemeMode as f } from "@sheetxl/utils-react";
|
|
12
|
-
var p = {
|
|
13
|
-
Mode: "themeMode",
|
|
14
|
-
DarkGrid: "enableDarkGrid",
|
|
15
|
-
DarkImages: "enableDarkImages"
|
|
16
|
-
}, m = {
|
|
17
|
-
[p.Mode]: null,
|
|
18
|
-
[p.DarkGrid]: !1,
|
|
19
|
-
[p.DarkImages]: !1
|
|
20
|
-
}, h = (e) => {
|
|
21
|
-
let [t] = d(p.Mode, m[p.Mode]), [n] = d(p.DarkGrid, m[p.DarkGrid]), { themeMode: r } = f({ mode: e ?? t ?? void 0 });
|
|
22
|
-
return e || (r === "dark" && n ? "dark" : "light");
|
|
23
|
-
}, g = () => {
|
|
24
|
-
let [e] = d(p.Mode, m[p.Mode]), { themeMode: t } = f({ mode: e ?? void 0 });
|
|
25
|
-
return t;
|
|
26
|
-
}, _ = ee("chart:paint", () => import("./Dl0ye0MfTml4mjhA.mjs")), v = (e, t) => {
|
|
27
|
-
let n = e.getElementType();
|
|
28
|
-
if (n === "point") {
|
|
29
|
-
let n = e.getParent();
|
|
30
|
-
return t === n || t?.getElementType() === "point" && t.getParent() === n ? e : n;
|
|
31
|
-
}
|
|
32
|
-
if (n === "legendEntry") {
|
|
33
|
-
let n = e.getParent();
|
|
34
|
-
return t === n || t?.getElementType() === "legendEntry" ? e : n;
|
|
35
|
-
}
|
|
36
|
-
if (n === "dataLabel") {
|
|
37
|
-
let n = e.getParent()?.getParent(), r = n?.getDataLabels();
|
|
38
|
-
return r ? t === r || t?.getElementType() === "dataLabel" && t.getParent()?.getParent() === n ? e : r : e;
|
|
39
|
-
}
|
|
40
|
-
return e;
|
|
41
|
-
}, y = {
|
|
42
|
-
boxes: [],
|
|
43
|
-
handles: []
|
|
44
|
-
}, b = n(t((t, n) => {
|
|
45
|
-
let { children: ee, style: d, chart: f, onChartChange: p, zoom: m = 1, width: h, height: b, selection: x = null, colorScheme: ie, onElementPress: S, onPointerDown: C, ...w } = t, [T, ae] = s(() => u.isPromiseLike(f) ? null : f), [E, oe] = s(null), D = o(p);
|
|
46
|
-
D.current = p;
|
|
47
|
-
let O = o(null);
|
|
48
|
-
i(() => {
|
|
49
|
-
let e = !0, t = (e, t) => {
|
|
50
|
-
oe(t), ae(e), O.current !== e && (O.current = e, D.current?.(e));
|
|
51
|
-
};
|
|
52
|
-
if (u.isPromiseLike(f)) return f.then((n) => {
|
|
53
|
-
e && t(n, null);
|
|
54
|
-
}, (n) => {
|
|
55
|
-
e && t(null, n);
|
|
56
|
-
}), () => {
|
|
57
|
-
e = !1;
|
|
58
|
-
};
|
|
59
|
-
t(f, null);
|
|
60
|
-
}, [f]);
|
|
61
|
-
let [k, A] = ne(), j = typeof h == "number" ? h : A.width, M = typeof b == "number" ? b : A.height, N = j ? Math.round(j / m) : 0, P = M ? Math.round(M / m) : 0, F = o({
|
|
62
|
-
width: N,
|
|
63
|
-
height: P
|
|
64
|
-
});
|
|
65
|
-
F.current = {
|
|
66
|
-
width: N,
|
|
67
|
-
height: P
|
|
68
|
-
};
|
|
69
|
-
let I = g(), L = (ie ?? I) === "dark", R = r(async (e) => {
|
|
70
|
-
let t = F.current;
|
|
71
|
-
if (!T || !t.width || !t.height) return null;
|
|
72
|
-
let n = T.getLayout(t);
|
|
73
|
-
return n ? (await _.load()).renderChartToSVG(n, { darkMode: e?.darkMode ?? !1 }) : null;
|
|
74
|
-
}, [T]), z = o(null), B = o(null), V = o(m);
|
|
75
|
-
V.current = m;
|
|
76
|
-
let H = r((e, t) => {
|
|
77
|
-
let n = z.current;
|
|
78
|
-
if (!n) return null;
|
|
79
|
-
let r = n.getBoundingClientRect(), i = V.current || 1;
|
|
80
|
-
return {
|
|
81
|
-
x: (e - r.left) / i,
|
|
82
|
-
y: (t - r.top) / i
|
|
83
|
-
};
|
|
84
|
-
}, []), U = r((e, t) => {
|
|
85
|
-
let n = B.current, r = H(e, t);
|
|
86
|
-
return T && n && r ? T.getElementAt(r, n) : null;
|
|
87
|
-
}, [T, H]), W = te(n, () => ({
|
|
88
|
-
isChartElement: () => !0,
|
|
89
|
-
getChart: () => T,
|
|
90
|
-
toSVG: R,
|
|
91
|
-
getElementAt: U
|
|
92
|
-
}), [
|
|
93
|
-
T,
|
|
94
|
-
R,
|
|
95
|
-
U
|
|
96
|
-
]), G = e([
|
|
97
|
-
W,
|
|
98
|
-
k,
|
|
99
|
-
z
|
|
100
|
-
]), K = o(null), q = o(null), [J, Y] = s(() => _.peek() ?? null), [X, se] = s(null), [ce, le] = s(0), [Z, ue] = s(y);
|
|
101
|
-
i(() => T?.addListeners({ onLayoutChange: () => le((e) => e + 1) }), [T]), re(!(X || E || J && T)), i(() => {
|
|
102
|
-
if (J) return;
|
|
103
|
-
let e = !0;
|
|
104
|
-
return _.load().then((t) => {
|
|
105
|
-
e && Y(t);
|
|
106
|
-
}, (t) => {
|
|
107
|
-
e && se(t);
|
|
108
|
-
}), () => {
|
|
109
|
-
e = !1;
|
|
110
|
-
};
|
|
111
|
-
}, [J]);
|
|
112
|
-
let Q = r(() => {
|
|
113
|
-
let e = B.current;
|
|
114
|
-
ue(T && e && x && !x.isEmpty() ? ((e, t, n) => {
|
|
115
|
-
let r = [], i = [];
|
|
116
|
-
for (let a of n.getItems()) {
|
|
117
|
-
if (a.getChart() !== e) continue;
|
|
118
|
-
let o = a.getElementType();
|
|
119
|
-
if (o === "series" || o === "dataLabels") {
|
|
120
|
-
let n = o === "series" ? a : a.getParent(), i = o === "series" ? n.getPoints() : n.getPoints().map((e) => e.getDataLabel());
|
|
121
|
-
for (let n of i) {
|
|
122
|
-
let i = e.getElementBounds(n, t);
|
|
123
|
-
i && r.push(i);
|
|
124
|
-
}
|
|
125
|
-
if (r.length > 0) continue;
|
|
126
|
-
}
|
|
127
|
-
let s = e.getElementBounds(a, t);
|
|
128
|
-
if (s && (r.push(s), n.getItems().length === 1)) {
|
|
129
|
-
let e = [
|
|
130
|
-
s.x,
|
|
131
|
-
s.x + s.width / 2,
|
|
132
|
-
s.x + s.width
|
|
133
|
-
], t = [
|
|
134
|
-
s.y,
|
|
135
|
-
s.y + s.height / 2,
|
|
136
|
-
s.y + s.height
|
|
137
|
-
];
|
|
138
|
-
for (let n of e) for (let r of t) n === e[1] && r === t[1] || i.push({
|
|
139
|
-
x: n,
|
|
140
|
-
y: r
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
return {
|
|
145
|
-
boxes: r,
|
|
146
|
-
handles: i
|
|
147
|
-
};
|
|
148
|
-
})(T, e, x) : y);
|
|
149
|
-
}, [T, x]);
|
|
150
|
-
i(() => x?.addListeners({ onChange: Q }), [x, Q]), a(() => {
|
|
151
|
-
let e = K.current;
|
|
152
|
-
if (!(J && e && T && N && P)) return;
|
|
153
|
-
let t = T.getLayout({
|
|
154
|
-
width: N,
|
|
155
|
-
height: P
|
|
156
|
-
});
|
|
157
|
-
if (B.current = t, !t) return q.current?.dispose(), q.current = null, e.style.backgroundColor = "", void Q();
|
|
158
|
-
let n = t.chartArea.fill === void 0;
|
|
159
|
-
e.style.backgroundColor = n ? `var(--sxl-color-base-100, ${L ? "#121212" : "#FFFFFF"})` : "", e.style.borderRadius = n ? `${t.chartArea.cornerRadius}px` : "";
|
|
160
|
-
let r = {
|
|
161
|
-
darkMode: L,
|
|
162
|
-
background: "transparent"
|
|
163
|
-
};
|
|
164
|
-
q.current ? q.current.update(t, r) : q.current = J.mountChart(e, t, r), Q();
|
|
165
|
-
}, [
|
|
166
|
-
J,
|
|
167
|
-
T,
|
|
168
|
-
N,
|
|
169
|
-
P,
|
|
170
|
-
ce,
|
|
171
|
-
L,
|
|
172
|
-
Q
|
|
173
|
-
]), i(() => () => {
|
|
174
|
-
q.current?.dispose(), q.current = null, B.current = null;
|
|
175
|
-
}, [T]);
|
|
176
|
-
let de = r((e) => {
|
|
177
|
-
if (C?.(e), e.button !== 0 && e.button !== 2) return;
|
|
178
|
-
let t = B.current, n = H(e.clientX, e.clientY);
|
|
179
|
-
if (!T || !t || !n) return;
|
|
180
|
-
let r = T.getElementAt(n, t);
|
|
181
|
-
if (S?.({
|
|
182
|
-
element: r,
|
|
183
|
-
point: n,
|
|
184
|
-
event: e
|
|
185
|
-
}), !x) return;
|
|
186
|
-
if (!r || r.getElementType() === "chartArea") return void x.clear();
|
|
187
|
-
let i = v(r, x.getActive());
|
|
188
|
-
x.isSelected(i) && x.getItems().length === 1 || x.select([i]);
|
|
189
|
-
}, [
|
|
190
|
-
T,
|
|
191
|
-
x,
|
|
192
|
-
S,
|
|
193
|
-
C,
|
|
194
|
-
H
|
|
195
|
-
]);
|
|
196
|
-
if (T?.isDeleted()) return;
|
|
197
|
-
let $ = X ?? E;
|
|
198
|
-
return l("div", {
|
|
199
|
-
...w,
|
|
200
|
-
onPointerDown: de,
|
|
201
|
-
style: {
|
|
202
|
-
...h === void 0 ? {} : { width: h },
|
|
203
|
-
...b === void 0 ? {} : { height: b },
|
|
204
|
-
...d,
|
|
205
|
-
overflow: "hidden"
|
|
206
|
-
},
|
|
207
|
-
ref: G,
|
|
208
|
-
children: [
|
|
209
|
-
$ ? c("div", {
|
|
210
|
-
className: "sxl-chart-element-error",
|
|
211
|
-
style: {
|
|
212
|
-
padding: "8px",
|
|
213
|
-
fontSize: "12px",
|
|
214
|
-
color: "var(--sxl-color-error, #b00020)"
|
|
215
|
-
},
|
|
216
|
-
children: $.message
|
|
217
|
-
}) : null,
|
|
218
|
-
c("div", {
|
|
219
|
-
className: "sxl-chart-element",
|
|
220
|
-
ref: K,
|
|
221
|
-
style: {
|
|
222
|
-
width: N || "100%",
|
|
223
|
-
height: P || "100%",
|
|
224
|
-
zoom: m,
|
|
225
|
-
position: "relative"
|
|
226
|
-
}
|
|
227
|
-
}),
|
|
228
|
-
Z.boxes.length > 0 ? l("div", {
|
|
229
|
-
className: "sxl-chart-element-selection",
|
|
230
|
-
style: {
|
|
231
|
-
position: "absolute",
|
|
232
|
-
left: 0,
|
|
233
|
-
top: 0,
|
|
234
|
-
width: N,
|
|
235
|
-
height: P,
|
|
236
|
-
zoom: m,
|
|
237
|
-
pointerEvents: "none"
|
|
238
|
-
},
|
|
239
|
-
children: [Z.boxes.map((e, t) => c("div", { style: {
|
|
240
|
-
position: "absolute",
|
|
241
|
-
left: e.x - 1,
|
|
242
|
-
top: e.y - 1,
|
|
243
|
-
width: Math.max(0, e.width),
|
|
244
|
-
height: Math.max(0, e.height),
|
|
245
|
-
border: "1px solid var(--sxl-color-primary, #1a73e8)",
|
|
246
|
-
boxSizing: "content-box"
|
|
247
|
-
} }, `box-${t}`)), Z.handles.map((e, t) => c("div", { style: {
|
|
248
|
-
position: "absolute",
|
|
249
|
-
left: e.x - 3,
|
|
250
|
-
top: e.y - 3,
|
|
251
|
-
width: 6,
|
|
252
|
-
height: 6,
|
|
253
|
-
background: "var(--sxl-color-base-100, #fff)",
|
|
254
|
-
border: "1px solid var(--sxl-color-primary, #1a73e8)",
|
|
255
|
-
boxSizing: "border-box"
|
|
256
|
-
} }, `handle-${t}`))]
|
|
257
|
-
}) : null
|
|
258
|
-
]
|
|
259
|
-
});
|
|
260
|
-
}));
|
|
261
|
-
b.displayName = "ChartElement";
|
|
262
|
-
export { m as a, h as i, v as n, p as o, g as r, b as t };
|