@sheetxl/studio-mui 0.4.19 → 0.4.21

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 (98) hide show
  1. package/browser/cjs/B1KlR2XYFpYbKjYS.cjs +20 -0
  2. package/browser/cjs/{afHzhXTMVhLQJ6uC.cjs → B1RMsexbz4bNlty_.cjs} +1 -1
  3. package/browser/cjs/B32faQpVaX1tkPuc.cjs +6 -0
  4. package/browser/cjs/B3XiHrRxW1LxML7F.cjs +6 -0
  5. package/browser/cjs/BGikYpeNpjwvXUdQ.cjs +18 -0
  6. package/browser/cjs/BY5l7DteiFtb2AKy.cjs +6 -0
  7. package/browser/cjs/Bb0Hd2RE7iVWVbm8.cjs +6 -0
  8. package/browser/cjs/C3EZkRIKfQURg9hX.cjs +6 -0
  9. package/browser/cjs/C7r573AdygYrVVEJ.cjs +7 -0
  10. package/browser/cjs/DEEknE8ARp0mc7fk.cjs +6 -0
  11. package/browser/cjs/DZwzUUHda3jr5jo4.cjs +6 -0
  12. package/browser/cjs/index.cjs +2 -2
  13. package/browser/cjs/veQZSq7ekc6G1FZT.cjs +42 -0
  14. package/browser/esm/B84RbTkXZiq6XIdH.mjs +49 -0
  15. package/browser/esm/{C4lgCnqxoHUTMKx0.mjs → BLy-hRTZkVfaGrcr.mjs} +1 -1
  16. package/browser/esm/Bapmv0WdnDq3Jl_q.mjs +53 -0
  17. package/browser/esm/C0OuiugFYjsjbY8q.mjs +46 -0
  18. package/browser/esm/{6nabbOchsfGHTDbJ.mjs → CGVN-NJF8ZTm9apo.mjs} +11 -10
  19. package/browser/esm/CcLpUDzJOdfqQ8Kf.mjs +25 -0
  20. package/browser/esm/Csg-hJrzm9r4vJrm.mjs +2156 -0
  21. package/browser/esm/{DwyDpojQzn8Yb0Z3.mjs → DHf2N2UY78nZFge3.mjs} +100 -98
  22. package/browser/esm/Dlc8L0qha0mZFIkY.mjs +62 -0
  23. package/browser/esm/{Duk7LVR9m02nk_H1.mjs → Dv-0R5pQwEnowzoO.mjs} +87 -85
  24. package/browser/esm/index.mjs +29 -29
  25. package/browser/esm/mVKwmIdSj4ua1Qce.mjs +4443 -0
  26. package/browser/esm/{aeeg2i5lmw2EnSq8.mjs → sHK4zKkWLGt2hVmW.mjs} +27 -26
  27. package/licenses/dependencies.txt +71 -342
  28. package/node/esm/{C1qlFAMFUg7JxINj.mjs → 49Eux5a_I5wZ-jfq.mjs} +29 -28
  29. package/node/esm/{Svd1DLPJnYKhJsxn.mjs → B00pGeZ7sj6QOFgF.mjs} +4 -3
  30. package/node/esm/{Cqh-VwF8iLFUBQG2.mjs → BEtxwx_Ji4aFNg8V.mjs} +79 -78
  31. package/node/esm/{BOlA6nKvsuwJ8-qE.mjs → BTcBIT144Lil18l-.mjs} +13 -11
  32. package/node/esm/{SdVxzy9D4jvK5ILt.mjs → Bw_f4uhXHpg1RA6Z.mjs} +7 -6
  33. package/node/esm/CGrG-gsnGd-Pn_T2.mjs +88 -0
  34. package/node/esm/CiUfb3MQCUC2McDP.mjs +46 -0
  35. package/node/esm/D1bjybdBQ28bumrW.mjs +63 -0
  36. package/node/esm/{wuBONOGgEy1w5A3Q.mjs → Dcnd4LiYyGf2eaNl.mjs} +23 -22
  37. package/node/esm/{BbLVlH-VHXBiyGbB.mjs → DiLUM75s3D56Y6Fx.mjs} +11 -10
  38. package/node/esm/index.mjs +2378 -18426
  39. package/package.json +8 -8
  40. package/browser/cjs/9JbHyHSHGCO4uFHn.cjs +0 -7
  41. package/browser/cjs/B17ClH6YVt0_UP8s.cjs +0 -6
  42. package/browser/cjs/B9LTfguTHj9uQv3h.cjs +0 -6
  43. package/browser/cjs/BYWh4kkrXJKKl2Ju.cjs +0 -145
  44. package/browser/cjs/BYrNOLTwEhs6LHAw.cjs +0 -6
  45. package/browser/cjs/Bh8xJY_qVp_q9NdJ.cjs +0 -6
  46. package/browser/cjs/Bl5l1B_eznDfB_7v.cjs +0 -18
  47. package/browser/cjs/C1LBzI2ntslIKFn5.cjs +0 -6
  48. package/browser/cjs/CGWf__jrNH3xfu2y.cjs +0 -161
  49. package/browser/cjs/CGlk1dj000Bm5cqP.cjs +0 -7
  50. package/browser/cjs/CX_y7y31Q5qi020q.cjs +0 -6
  51. package/browser/cjs/Cby5RVhO-aNkuWsV.cjs +0 -11
  52. package/browser/cjs/D2CoaVzteKVTLz2u.cjs +0 -42
  53. package/browser/cjs/D4ge-OwnSGkzaQnk.cjs +0 -15
  54. package/browser/cjs/D54KO7Qf1gFYpUYh.cjs +0 -11
  55. package/browser/cjs/D5Hr7ebLiJgvcT0k.cjs +0 -6
  56. package/browser/cjs/D6qxm65mk30iMCfQ.cjs +0 -6
  57. package/browser/cjs/DIR6Yr7FCZPYWi4-.cjs +0 -6
  58. package/browser/cjs/DeklxocxxZiZyZ5u.cjs +0 -6
  59. package/browser/cjs/Dh2Z7N-jImJZemiw.cjs +0 -6
  60. package/browser/cjs/Dngll9GyDqkTUUmu.cjs +0 -6
  61. package/browser/cjs/KmAkK4F7kLQEM3IN.cjs +0 -12
  62. package/browser/cjs/n8wDl6JTlhLU6ZAW.cjs +0 -16
  63. package/browser/cjs/zr0HW2FkaHX7brxh.cjs +0 -110
  64. package/browser/esm/B8eNugj_qKnbe7K9.mjs +0 -59
  65. package/browser/esm/BPRkMu1MFxUWK930.mjs +0 -3803
  66. package/browser/esm/BQtrstD4gTIutZpE.mjs +0 -1467
  67. package/browser/esm/BeT_3zf80WoubGnC.mjs +0 -1352
  68. package/browser/esm/C226zpF9x3cqGDep.mjs +0 -44
  69. package/browser/esm/C52hEZh6H2W5Zw5u.mjs +0 -2250
  70. package/browser/esm/CJi45DDPGy79h3Hk.mjs +0 -1366
  71. package/browser/esm/CSAsCpXnzBKwTizz.mjs +0 -23326
  72. package/browser/esm/ChetmIXTvR3tA23A.mjs +0 -48
  73. package/browser/esm/CtAFduFwOuqSdkvi.mjs +0 -23
  74. package/browser/esm/D1mFp2w9djJ0V4vm.mjs +0 -52
  75. package/browser/esm/DA83VkmtEXnqG2ye.mjs +0 -43
  76. package/browser/esm/Dy_zBluT96wehR25.mjs +0 -46
  77. package/browser/esm/NwT_h_qyOIJUd95T.mjs +0 -392
  78. package/browser/esm/eNfgzWFw915mA1DM.mjs +0 -84
  79. package/browser/esm/i07lQ5p_zaWwjifI.mjs +0 -12
  80. package/browser/esm/mWKbTdOrhJijxGkQ.mjs +0 -13391
  81. package/browser/esm/qTwpcY21ZDbsJF8q.mjs +0 -424
  82. package/browser/esm/rOu2mn5CpwGjRPMt.mjs +0 -1672
  83. package/browser/esm/xBoO8UGcKLTEtu2_.mjs +0 -1703
  84. package/node/esm/8IRz_tiw9gL3CiTm.mjs +0 -46
  85. package/node/esm/BGuyZxOceFDiCkHS.mjs +0 -553
  86. package/node/esm/BRc35RfDs9NeSBil.mjs +0 -78
  87. package/node/esm/BWNYjBRxl8-kaqWc.mjs +0 -1706
  88. package/node/esm/Bdk5FW-41aJV-x0f.mjs +0 -392
  89. package/node/esm/C2KYv5fsjkP4dceu.mjs +0 -86
  90. package/node/esm/C7eBwbZmMMcQeZ5y.mjs +0 -1479
  91. package/node/esm/CCmhTOlFNku7bidD.mjs +0 -44
  92. package/node/esm/COWuJnOkG4AgfLpx.mjs +0 -3776
  93. package/node/esm/CcxYuxLYIW_z4w-n.mjs +0 -1378
  94. package/node/esm/DO-FR-M-Iy43f7rk.mjs +0 -60
  95. package/node/esm/DOa-YBJSa8QO8ypH.mjs +0 -1246
  96. package/node/esm/DXgMMPZD2XcdNWPg.mjs +0 -44
  97. package/node/esm/DXlF9nEg2kAr3Ykp.mjs +0 -13464
  98. package/node/esm/FcospSz9-0aW4gFs.mjs +0 -1719
@@ -1,48 +0,0 @@
1
- import { jsx as o, jsxs as A } from "react/jsx-runtime";
2
- import { memo as E, useMemo as D, useState as m, useCallback as F } from "react";
3
- import { Box as S, FormControl as O, TextField as P } from "@mui/material";
4
- import { T as f, D as U, g as l } from "./CSAsCpXnzBKwTizz.mjs";
5
- import { alpha as p } from "@mui/system";
6
- /**
7
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.19
8
- *
9
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
10
- * License: The license can be found at https://www.sheetxl.com/license.
11
- */
12
- const V = ["Ok", "Cancel"], Q = E((b) => {
13
- const { initialHyperlink: t = null, initialDisplay: H = null, onUpdateHyperlink: x, context: s, onOption: h, onValidateOption: r, onDone: d, options: y = V, defaultOption: c = y?.[0], cancelOption: i = "Cancel", sx: I, ...v } = b, w = D(() => (t ?? s?.()?.getHyperlink()) !== null, []), T = D(() => {
14
- let n = null, a = null;
15
- t && (typeof t == "string" ? a = t : n = t);
16
- const g = n ?? s?.()?.getHyperlink();
17
- return { address: a ?? g?.getAddress() ?? "", textToDisplay: g?.getDisplayText() ?? "" };
18
- }, [t, s]), [e, M] = m(T.address), [u, B] = m(() => {
19
- const n = s?.().toTextUnformatted() ?? H;
20
- return n === T.address ? "" : n;
21
- }), [$, k] = m(!1), L = F((n) => {
22
- B(n.target.value);
23
- }, []), C = F(async (n, a) => null, []), W = f(async (n) => {
24
- n !== i && x?.(e === "" ? null : { address: e }, u), h?.(n, n === i, n === c), d?.();
25
- }, [e, u, x, d, h, c, i]), j = f((n) => {
26
- M(n.target.value), C(n.target.value, null);
27
- }, [r]), z = f(async (n) => {
28
- let a = await Promise.resolve(r?.(n));
29
- try {
30
- a !== !1 && (a = await C(e, n));
31
- } catch {
32
- }
33
- return a ?? !0;
34
- }, [r]);
35
- return o(U, { title: (w ? "Edit" : "Insert") + " Link", options: y, onDone: d, onOption: (n) => W(n), onValidateOption: z, defaultOption: c, cancelOption: i, autoFocusSel: ".autoFocus", sx: { width: "480px", ...I }, ...v, children: A(S, { sx: { paddingTop: (n) => n.spacing(1), paddingBottom: (n) => n.spacing(0), rowGap: (n) => n.spacing(1), display: "flex", flexDirection: "column" }, children: [o(O, { sx: { paddingTop: (n) => n.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: o(P, { label: "Address", placeholder: "Enter a url or cell reference.", onFocus: (n) => {
36
- $ || n.target?.select(), k(!0);
37
- }, sx: { "& .MuiFormHelperText-root": { marginTop: (n) => n.spacing(0.5) } }, InputLabelProps: { shrink: !0 }, InputProps: { inputProps: { className: "autoFocus", spellCheck: !1, autoComplete: "off", sx: { paddingTop: (n) => n.spacing(1.25), paddingBottom: (n) => n.spacing(0.75), backgroundImage: `linear-gradient(${p("#fff", l(5))}, ${p("#fff", l(5))})` } } }, value: e, onChange: j, onContextMenu: (n) => {
38
- n.stopPropagation();
39
- } }) }), o(O, { sx: { paddingTop: (n) => n.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: o(P, { label: "Display Text", placeholder: e?.startsWith("#") ? e.substring(1) : e, onFocus: () => {
40
- k(!0);
41
- }, sx: { "& .MuiFormHelperText-root": { marginTop: (n) => n.spacing(0.5) } }, InputLabelProps: { shrink: !0 }, InputProps: { inputProps: { spellCheck: !1, autoComplete: "off", sx: { paddingTop: (n) => n.spacing(1.25), paddingBottom: (n) => n.spacing(0.75), backgroundImage: `linear-gradient(${p("#fff", l(5))}, ${p("#fff", l(5))})` } } }, value: u, onChange: L, onContextMenu: (n) => {
42
- n.stopPropagation();
43
- } }) })] }) });
44
- });
45
- export {
46
- Q as HyperlinkDialog,
47
- Q as default
48
- };
@@ -1,23 +0,0 @@
1
- import { jsx as o, jsxs as D } from "react/jsx-runtime";
2
- import { memo as T, useState as i, useCallback as N } from "react";
3
- import { Box as w, FormControlLabel as F, Checkbox as j } from "@mui/material";
4
- import { T as v, D as y, k as B } from "./CSAsCpXnzBKwTizz.mjs";
5
- /**
6
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.19
7
- *
8
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
9
- * License: The license can be found at https://www.sheetxl.com/license.
10
- */
11
- const H = ["Ok", "Cancel"], L = T((g) => {
12
- const { tableOptions: a, context: r, onOption: p, onValidateOption: I, onDone: c, options: d = H, defaultOption: t = d?.[0], cancelOption: s = "Cancel", sx: u, ...x } = g, [b, h] = i(!1), [n, f] = i(() => a?.hasHeader ?? !1), [l, O] = i(() => a?.ranges ?? null), C = v((e) => {
13
- const m = { ...a, hasHeader: n, ranges: l };
14
- p?.(e, e === s, e === t), c?.({ option: e, tableOptions: m });
15
- }, [c, p, t, s, n, l, a]), k = N(async (e, m) => null, []);
16
- return o(y, { title: "Insert Table", options: d, onDone: C, onValidateOption: k, defaultOption: t, cancelOption: s, autoFocusSel: ".range-input input", sx: { width: "360px", ...u }, ...x, children: D(w, { sx: { paddingTop: (e) => e.spacing(1), paddingBottom: (e) => e.spacing(0), rowGap: (e) => e.spacing(1), display: "flex", flexDirection: "column" }, children: [o(B, { formName: "range", value: l, onChangeInput: (e) => O(e), resolvedAddress: r.getNames().getRanges.bind(r.getNames()), onFocus: (e) => {
17
- b || e.target?.select(), h(!0);
18
- } }), o(F, { control: o(j, { checked: n, onChange: () => f(!n) }), label: "Table has headers", labelPlacement: "end" })] }) });
19
- });
20
- export {
21
- L as TableNewDialog,
22
- L as default
23
- };
@@ -1,52 +0,0 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { memo as E, useMemo as M, useState as h, useCallback as j } from "react";
3
- import { Box as S, FormControl as V, TextField as $ } from "@mui/material";
4
- import { T as m, D as z, g as C } from "./CSAsCpXnzBKwTizz.mjs";
5
- import { alpha as O } from "@mui/system";
6
- /**
7
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.19
8
- *
9
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
10
- * License: The license can be found at https://www.sheetxl.com/license.
11
- */
12
- const G = ["Ok", "Cancel"], q = E((F) => {
13
- const { initialComments: T = null, onUpdateComments: u, context: k, onOption: d, onValidateOption: p, onDone: r, options: g = G, defaultOption: c = g?.[0], cancelOption: s = "Cancel", sx: w, ...y } = F, f = M(() => {
14
- const t = T ?? k?.()?.getComments();
15
- let n = "";
16
- if (t && t.content && t.content.runs) {
17
- const e = t.content.runs;
18
- for (let i = 0; i < e.length; i++) {
19
- const a = e[i];
20
- n += a?.text;
21
- }
22
- }
23
- return n;
24
- }, []), [o, D] = h(f), [P, b] = h(!1), x = j(async (t, n) => null, []), v = m(async (t) => {
25
- const n = o === "" ? [] : o.split(`
26
- `);
27
- if (t !== s) {
28
- const e = [];
29
- for (let a = 0; a < n.length; a++) e.push({ text: n[a] });
30
- u?.({ content: { runs: e } });
31
- }
32
- d?.(t, t === s, t === c), r?.();
33
- }, [o, u, r, d, c, s]), I = m((t) => {
34
- D(t.target.value), x(t.target.value, null);
35
- }, [p]), B = m(async (t) => {
36
- let n = await Promise.resolve(p?.(t));
37
- try {
38
- n !== !1 && (n = await x(o, t));
39
- } catch {
40
- }
41
- return n ?? !0;
42
- }, [p, o]);
43
- return l(z, { title: (f ? "Edit" : "Insert") + " Comments", options: g, onDone: r, onOption: (t) => v(t), onValidateOption: B, defaultOption: c, cancelOption: s, autoFocusSel: ".autoFocus", sx: { width: "480px", ...w }, ...y, children: l(S, { sx: { paddingTop: (t) => t.spacing(1), paddingBottom: (t) => t.spacing(0), rowGap: (t) => t.spacing(1), display: "flex", flexDirection: "column" }, children: l(V, { sx: { paddingTop: (t) => t.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: l($, { label: "Comments", placeholder: "Enter a comment.", onFocus: (t) => {
44
- P || t.target?.select(), b(!0);
45
- }, sx: { "& .MuiFormHelperText-root": { marginTop: (t) => t.spacing(0.5) } }, InputLabelProps: { shrink: !0 }, InputProps: { inputProps: { className: "autoFocus", spellCheck: !1, autoComplete: "off", sx: { paddingTop: (t) => t.spacing(1.25), paddingBottom: (t) => t.spacing(0.75), backgroundImage: `linear-gradient(${O("#fff", C(5))}, ${O("#fff", C(5))})` } } }, value: o, onChange: I, onContextMenu: (t) => {
46
- t.stopPropagation();
47
- } }) }) }) });
48
- });
49
- export {
50
- q as CommentsDialog,
51
- q as default
52
- };
@@ -1,43 +0,0 @@
1
- import { jsx as i } from "react/jsx-runtime";
2
- import { memo as z, forwardRef as A, useState as s } from "react";
3
- import { s as t, Z as E, D as R, A as K, R as O } from "./CSAsCpXnzBKwTizz.mjs";
4
- import { Box as W, FormControl as Z, TextField as q } from "@mui/material";
5
- import { alpha as y } from "@mui/system";
6
- /**
7
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.19
8
- *
9
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
10
- * License: The license can be found at https://www.sheetxl.com/license.
11
- */
12
- const G = ["Input"], _ = z(A((w, F) => {
13
- const { initialValue: T = "", onOption: C, onValidateOption: r, onInputOption: l, onValidateInputOption: p, onDone: u, inputProps: c, inputLabel: I, inputType: P, inputPlaceHolder: v, options: d = G, autoFocusSel: b = ".autoFocus", cancelOption: m, defaultOption: g = d?.[0], ...k } = w, [D, V] = s(!1), [a, B] = s(T), [S, H] = s(""), [L, M] = s(!0), e = t(async (o, n) => {
14
- if (!p) return !0;
15
- const h = await p?.(o, n);
16
- H(h?.message ?? "");
17
- const x = h?.valid ?? !0;
18
- return M(x), x;
19
- }, [p]), f = t(async (o) => {
20
- l?.(a, o);
21
- }, [a, l, u, C, m, g]), N = t(async (o) => {
22
- o.keyCode === E.Enter && await e?.(a, null);
23
- }, [a, f]), $ = t((o) => {
24
- B(o.target.value), e?.(o.target.value, null);
25
- }, [r]), j = t(async (o) => {
26
- let n = await e(a, o);
27
- try {
28
- n !== !1 && (n = await e(a, o));
29
- } catch {
30
- }
31
- return n ?? !0;
32
- }, [a, r]);
33
- return i(R, { options: d, onDone: u, onOption: (o, n) => {
34
- n || f(o);
35
- }, onValidateOption: j, cancelOption: m, defaultOption: g, autoFocusSel: b, ref: F, ...k, children: i(W, { sx: { paddingTop: (o) => o.spacing(1), paddingBottom: (o) => o.spacing(0) }, children: i(Z, { sx: { paddingTop: (o) => o.spacing(1.5), minWidth: 135, width: "100%" }, size: "small", children: i(q, { onFocus: (o) => {
36
- D || o.target?.select(), V(!0);
37
- }, type: P, label: I, helperText: S || " ", sx: { width: "100%", "& .MuiFormHelperText-root": { marginTop: (o) => o.spacing(0.5), color: L ? void 0 : "error.main" } }, InputLabelProps: { shrink: !0 }, InputProps: { inputProps: { placeholder: v, spellCheck: !1, autoComplete: "off", ...c, className: K("autoFocus", c?.className), sx: { paddingTop: (o) => o.spacing(1.25), paddingBottom: (o) => o.spacing(0.75), backgroundImage: `linear-gradient(${y("#fff", O(5))}, ${y("#fff", O(5))})` } } }, value: a, onChange: $, onKeyDown: N, onContextMenu: (o) => {
38
- o.stopPropagation();
39
- } }) }) }) });
40
- }));
41
- export {
42
- _ as default
43
- };
@@ -1,46 +0,0 @@
1
- import { Workbook as y, IRange as k } from "@sheetxl/sdk";
2
- /**
3
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.19
4
- *
5
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
6
- * License: The license can be found at https://www.sheetxl.com/license.
7
- */
8
- const E = async (a, p) => {
9
- const { trimLeadingBlankRow: i = !0, trimLeadingBlankColumn: f = !0, excludeHidden: h = !1, sheetKey: r = null, papaParseConfig: m = {} } = p || {}, u = await import("./qTwpcY21ZDbsJF8q.mjs").then((s) => s.p);
10
- if (!a) throw new Error("workbook must be specified");
11
- let t = null;
12
- if (r === null ? t = a.getSelectedSheet() : typeof r == "number" ? t = a.getSheets().search()[r] : typeof r == "string" && (t = a.getSheets().getByName(r)), !t) throw new Error("invalid sheetKey specified");
13
- let c = null;
14
- const d = [];
15
- let e = null, n = t.getUsedRange({ excludeHidden: h });
16
- if (!n) throw new Error("Nothing to export");
17
- if (!i || !f) {
18
- const s = i ? n.getRowStart() : 0, l = f ? n.getColumnStart() : 0;
19
- n = n.getOffsetTo(s, l);
20
- }
21
- n.forEach((s, l) => {
22
- const w = l.getCoords(), x = l.getCell();
23
- c !== w.rowIndex && (e && d.push(e), e = [], c = w.rowIndex);
24
- const S = x.toTextUnformatted() ?? "";
25
- e.push(S);
26
- }, { includeEmpty: !0, address: null }), e && d.push(e);
27
- const o = { ...m }, g = u.unparse(d, o);
28
- return new TextEncoder().encode(g).buffer;
29
- }, b = async (a, p) => {
30
- const { papaParseConfig: i, setValuesOptions: f, createWorkbookOptions: h } = p ?? {}, r = await import("./qTwpcY21ZDbsJF8q.mjs").then((o) => o.p), m = new TextDecoder().decode(a);
31
- let u = -1;
32
- const t = new y(h), c = t.getSelectedSheet().getEntireRange().startIncrementalUpdates({ orientation: k.Orientation.Row }), d = p?.onProgress;
33
- let e = 0;
34
- const n = { ...i, transform: (o, g) => {
35
- i?.transform && (o = i.transform(o, g));
36
- const s = g;
37
- s === 0 && u++;
38
- let l = o ?? "";
39
- return c.pushAt(u, s, l), e++, e % 1e5 == 0 && d?.(e), o;
40
- } };
41
- return r.parse(m, n).data, c.apply({ textParser: !0, ...f }), t;
42
- };
43
- export {
44
- b as fromBufferCSV,
45
- E as toBufferCSV
46
- };
@@ -1,392 +0,0 @@
1
- import C, { memo as ne, useState as z, useRef as m, useCallback as re, useEffect as S } from "react";
2
- /**
3
- * @license @sheetxl/studio-mui - Studio - Spreadsheet UI built with SheetXL SDK using React & MUI. - v0.4.19
4
- *
5
- * (C) 2025-present SheetXL Inc. & Michael T. Ford
6
- * License: The license can be found at https://www.sheetxl.com/license.
7
- */
8
- function we(e, t, r) {
9
- return t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
10
- }
11
- function ue(e, t) {
12
- var r = Object.keys(e);
13
- if (Object.getOwnPropertySymbols) {
14
- var n = Object.getOwnPropertySymbols(e);
15
- t && (n = n.filter(function(o) {
16
- return Object.getOwnPropertyDescriptor(e, o).enumerable;
17
- })), r.push.apply(r, n);
18
- }
19
- return r;
20
- }
21
- function ae(e) {
22
- for (var t = 1; t < arguments.length; t++) {
23
- var r = arguments[t] != null ? arguments[t] : {};
24
- t % 2 ? ue(Object(r), !0).forEach(function(n) {
25
- we(e, n, r[n]);
26
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : ue(Object(r)).forEach(function(n) {
27
- Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
28
- });
29
- }
30
- return e;
31
- }
32
- function le(e, t) {
33
- (t == null || t > e.length) && (t = e.length);
34
- for (var r = 0, n = new Array(t); r < t; r++) n[r] = e[r];
35
- return n;
36
- }
37
- function Oe(e, t, r) {
38
- return t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
39
- }
40
- function se(e, t) {
41
- var r = Object.keys(e);
42
- if (Object.getOwnPropertySymbols) {
43
- var n = Object.getOwnPropertySymbols(e);
44
- t && (n = n.filter(function(o) {
45
- return Object.getOwnPropertyDescriptor(e, o).enumerable;
46
- })), r.push.apply(r, n);
47
- }
48
- return r;
49
- }
50
- function de(e) {
51
- for (var t = 1; t < arguments.length; t++) {
52
- var r = arguments[t] != null ? arguments[t] : {};
53
- t % 2 ? se(Object(r), !0).forEach(function(n) {
54
- Oe(e, n, r[n]);
55
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : se(Object(r)).forEach(function(n) {
56
- Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
57
- });
58
- }
59
- return e;
60
- }
61
- function R(e) {
62
- return function t() {
63
- for (var r = this, n = arguments.length, o = new Array(n), i = 0; i < n; i++) o[i] = arguments[i];
64
- return o.length >= e.length ? e.apply(this, o) : function() {
65
- for (var c = arguments.length, u = new Array(c), f = 0; f < c; f++) u[f] = arguments[f];
66
- return t.apply(r, [].concat(o, u));
67
- };
68
- };
69
- }
70
- function Y(e) {
71
- return {}.toString.call(e).includes("Object");
72
- }
73
- function _(e) {
74
- return typeof e == "function";
75
- }
76
- var k = R(function(e, t) {
77
- throw new Error(e[t] || e.default);
78
- })({ initialIsRequired: "initial state is required", initialType: "initial state should be an object", initialContent: "initial state shouldn't be an empty object", handlerType: "handler should be an object or a function", handlersType: "all handlers should be a functions", selectorType: "selector should be a function", changeType: "provided value of changes should be an object", changeField: 'it seams you want to change a field in the state which is not specified in the "initial" state', default: "an unknown error accured in `state-local` package" }), je = function(e, t) {
79
- return Y(t) || k("changeType"), Object.keys(t).some(function(r) {
80
- return n = e, o = r, !Object.prototype.hasOwnProperty.call(n, o);
81
- var n, o;
82
- }) && k("changeField"), t;
83
- }, Me = function(e) {
84
- _(e) || k("selectorType");
85
- }, Ee = function(e) {
86
- _(e) || Y(e) || k("handlerType"), Y(e) && Object.values(e).some(function(t) {
87
- return !_(t);
88
- }) && k("handlersType");
89
- }, Pe = function(e) {
90
- var t;
91
- e || k("initialIsRequired"), Y(e) || k("initialType"), t = e, Object.keys(t).length || k("initialContent");
92
- };
93
- function Se(e, t) {
94
- return _(t) ? t(e.current) : t;
95
- }
96
- function ke(e, t) {
97
- return e.current = de(de({}, e.current), t), t;
98
- }
99
- function xe(e, t, r) {
100
- return _(t) ? t(e.current) : Object.keys(r).forEach(function(n) {
101
- var o;
102
- return (o = t[n]) === null || o === void 0 ? void 0 : o.call(t, e.current[n]);
103
- }), r;
104
- }
105
- var X, Ie = function(e) {
106
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
107
- Pe(e), Ee(t);
108
- var r = { current: e }, n = R(xe)(r, t), o = R(ke)(r), i = R(je)(e), c = R(Se)(r);
109
- return [function() {
110
- var u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : function(f) {
111
- return f;
112
- };
113
- return Me(u), u(r.current);
114
- }, function(u) {
115
- (function() {
116
- for (var f = arguments.length, g = new Array(f), O = 0; O < f; O++) g[O] = arguments[O];
117
- return function(b) {
118
- return g.reduceRight(function(E, P) {
119
- return P(E);
120
- }, b);
121
- };
122
- })(n, o, i, c)(u);
123
- }];
124
- }, pe = { configIsRequired: "the configuration object is required", configType: "the configuration object should be an object", default: "an unknown error accured in `@monaco-editor/loader` package", deprecation: `Deprecation warning!
125
- You are using deprecated way of configuration.
126
-
127
- Instead of using
128
- monaco.config({ urls: { monacoBase: '...' } })
129
- use
130
- monaco.config({ paths: { vs: '...' } })
131
-
132
- For more please check the link https://github.com/suren-atoyan/monaco-loader#config
133
- ` }, fe = (X = function(e, t) {
134
- throw new Error(e[t] || e.default);
135
- }, function e() {
136
- for (var t = this, r = arguments.length, n = new Array(r), o = 0; o < r; o++) n[o] = arguments[o];
137
- return n.length >= X.length ? X.apply(this, n) : function() {
138
- for (var i = arguments.length, c = new Array(i), u = 0; u < i; u++) c[u] = arguments[u];
139
- return e.apply(t, [].concat(n, c));
140
- };
141
- })(pe), Te = function(e) {
142
- var t;
143
- return e || fe("configIsRequired"), t = e, {}.toString.call(t).includes("Object") || fe("configType"), e.urls ? (console.warn(pe.deprecation), { paths: { vs: e.urls.monacoBase } }) : e;
144
- };
145
- function he(e, t) {
146
- return Object.keys(t).forEach(function(r) {
147
- t[r] instanceof Object && e[r] && Object.assign(t[r], he(e[r], t[r]));
148
- }), ae(ae({}, e), t);
149
- }
150
- var Ae = { type: "cancelation", msg: "operation is manually canceled" };
151
- function Z(e) {
152
- var t = !1, r = new Promise(function(n, o) {
153
- e.then(function(i) {
154
- return t ? o(Ae) : n(i);
155
- }), e.catch(o);
156
- });
157
- return r.cancel = function() {
158
- return t = !0;
159
- }, r;
160
- }
161
- var ee, me = function(e) {
162
- if (Array.isArray(e)) return e;
163
- }(ee = Ie({ config: { paths: { vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.52.2/min/vs" } }, isInitialized: !1, resolve: null, reject: null, monaco: null })) || function(e) {
164
- if (typeof Symbol < "u" && Symbol.iterator in Object(e)) {
165
- var t = [], r = !0, n = !1, o = void 0;
166
- try {
167
- for (var i, c = e[Symbol.iterator](); !(r = (i = c.next()).done) && (t.push(i.value), t.length !== 2); r = !0) ;
168
- } catch (u) {
169
- n = !0, o = u;
170
- } finally {
171
- try {
172
- r || c.return == null || c.return();
173
- } finally {
174
- if (n) throw o;
175
- }
176
- }
177
- return t;
178
- }
179
- }(ee) || function(e) {
180
- if (e) {
181
- if (typeof e == "string") return le(e, 2);
182
- var t = Object.prototype.toString.call(e).slice(8, -1);
183
- return t === "Object" && e.constructor && (t = e.constructor.name), t === "Map" || t === "Set" ? Array.from(e) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? le(e, 2) : void 0;
184
- }
185
- }(ee) || function() {
186
- throw new TypeError(`Invalid attempt to destructure non-iterable instance.
187
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
188
- }(), N = me[0], $ = me[1];
189
- function Ce(e) {
190
- return document.body.appendChild(e);
191
- }
192
- function De(e) {
193
- var t, r, n = N(function(i) {
194
- return { config: i.config, reject: i.reject };
195
- }), o = (t = "".concat(n.config.paths.vs, "/loader.js"), r = document.createElement("script"), t && (r.src = t), r);
196
- return o.onload = function() {
197
- return e();
198
- }, o.onerror = n.reject, o;
199
- }
200
- function Ve() {
201
- var e = N(function(r) {
202
- return { config: r.config, resolve: r.resolve, reject: r.reject };
203
- }), t = window.require;
204
- t.config(e.config), t(["vs/editor/editor.main"], function(r) {
205
- ye(r), e.resolve(r);
206
- }, function(r) {
207
- e.reject(r);
208
- });
209
- }
210
- function ye(e) {
211
- N().monaco || $({ monaco: e });
212
- }
213
- var te = new Promise(function(e, t) {
214
- return $({ resolve: e, reject: t });
215
- }), G = { config: function(e) {
216
- var t = Te(e), r = t.monaco, n = function(o, i) {
217
- if (o == null) return {};
218
- var c, u, f = function(O, b) {
219
- if (O == null) return {};
220
- var E, P, x = {}, I = Object.keys(O);
221
- for (P = 0; P < I.length; P++) E = I[P], b.indexOf(E) >= 0 || (x[E] = O[E]);
222
- return x;
223
- }(o, i);
224
- if (Object.getOwnPropertySymbols) {
225
- var g = Object.getOwnPropertySymbols(o);
226
- for (u = 0; u < g.length; u++) c = g[u], i.indexOf(c) >= 0 || Object.prototype.propertyIsEnumerable.call(o, c) && (f[c] = o[c]);
227
- }
228
- return f;
229
- }(t, ["monaco"]);
230
- $(function(o) {
231
- return { config: he(o.config, n), monaco: r };
232
- });
233
- }, init: function() {
234
- var e = N(function(t) {
235
- return { monaco: t.monaco, isInitialized: t.isInitialized, resolve: t.resolve };
236
- });
237
- if (!e.isInitialized) {
238
- if ($({ isInitialized: !0 }), e.monaco) return e.resolve(e.monaco), Z(te);
239
- if (window.monaco && window.monaco.editor) return ye(window.monaco), e.resolve(window.monaco), Z(te);
240
- (function() {
241
- for (var t = arguments.length, r = new Array(t), n = 0; n < t; n++) r[n] = arguments[n];
242
- return function(o) {
243
- return r.reduceRight(function(i, c) {
244
- return c(i);
245
- }, o);
246
- };
247
- })(Ce, De)(Ve);
248
- }
249
- return Z(te);
250
- }, __getMonacoInstance: function() {
251
- return N(function(e) {
252
- return e.monaco;
253
- });
254
- } }, Le = { display: "flex", position: "relative", textAlign: "initial" }, Re = { width: "100%" }, qe = { display: "none" }, ze = { container: { display: "flex", height: "100%", width: "100%", justifyContent: "center", alignItems: "center" } }, _e = function({ children: e }) {
255
- return C.createElement("div", { style: ze.container }, e);
256
- }, ve = ne(function({ width: e, height: t, isEditorReady: r, loading: n, _ref: o, className: i, wrapperProps: c }) {
257
- return C.createElement("section", { style: { ...Le, width: e, height: t }, ...c }, !r && C.createElement(_e, null, n), C.createElement("div", { ref: o, style: { ...Re, ...!r && qe }, className: i }));
258
- }), oe = function(e) {
259
- S(e, []);
260
- }, j = function(e, t, r = !0) {
261
- let n = m(!0);
262
- S(n.current || !r ? () => {
263
- n.current = !1;
264
- } : e, t);
265
- };
266
- function q() {
267
- }
268
- function A(e, t, r, n) {
269
- return i = n, (o = e).editor.getModel(ge(o, i)) || function(c, u, f, g) {
270
- return c.editor.createModel(u, f, g ? ge(c, g) : void 0);
271
- }(e, t, r, n);
272
- var o, i;
273
- }
274
- function ge(e, t) {
275
- return e.Uri.parse(t);
276
- }
277
- var Ue = ne(function({ original: e, modified: t, language: r, originalLanguage: n, modifiedLanguage: o, originalModelPath: i, modifiedModelPath: c, keepCurrentOriginalModel: u = !1, keepCurrentModifiedModel: f = !1, theme: g = "light", loading: O = "Loading...", options: b = {}, height: E = "100%", width: P = "100%", className: x, wrapperProps: I = {}, beforeMount: H = q, onMount: J = q }) {
278
- let [w, D] = z(!1), [V, h] = z(!0), y = m(null), s = m(null), L = m(null), v = m(J), a = m(H), T = m(!1);
279
- oe(() => {
280
- let l = G.init();
281
- return l.then((d) => (s.current = d) && h(!1)).catch((d) => d?.type !== "cancelation" && console.error("Monaco initialization: error:", d)), () => y.current ? function() {
282
- let d = y.current?.getModel();
283
- u || d?.original?.dispose(), f || d?.modified?.dispose(), y.current?.dispose();
284
- }() : l.cancel();
285
- }), j(() => {
286
- if (y.current && s.current) {
287
- let l = y.current.getOriginalEditor(), d = A(s.current, e || "", n || r || "text", i || "");
288
- d !== l.getModel() && l.setModel(d);
289
- }
290
- }, [i], w), j(() => {
291
- if (y.current && s.current) {
292
- let l = y.current.getModifiedEditor(), d = A(s.current, t || "", o || r || "text", c || "");
293
- d !== l.getModel() && l.setModel(d);
294
- }
295
- }, [c], w), j(() => {
296
- let l = y.current.getModifiedEditor();
297
- l.getOption(s.current.editor.EditorOption.readOnly) ? l.setValue(t || "") : t !== l.getValue() && (l.executeEdits("", [{ range: l.getModel().getFullModelRange(), text: t || "", forceMoveMarkers: !0 }]), l.pushUndoStop());
298
- }, [t], w), j(() => {
299
- y.current?.getModel()?.original.setValue(e || "");
300
- }, [e], w), j(() => {
301
- let { original: l, modified: d } = y.current.getModel();
302
- s.current.editor.setModelLanguage(l, n || r || "text"), s.current.editor.setModelLanguage(d, o || r || "text");
303
- }, [r, n, o], w), j(() => {
304
- s.current?.editor.setTheme(g);
305
- }, [g], w), j(() => {
306
- y.current?.updateOptions(b);
307
- }, [b], w);
308
- let F = re(() => {
309
- if (!s.current) return;
310
- a.current(s.current);
311
- let l = A(s.current, e || "", n || r || "text", i || ""), d = A(s.current, t || "", o || r || "text", c || "");
312
- y.current?.setModel({ original: l, modified: d });
313
- }, [r, t, o, e, n, i, c]), U = re(() => {
314
- !T.current && L.current && (y.current = s.current.editor.createDiffEditor(L.current, { automaticLayout: !0, ...b }), F(), s.current?.editor.setTheme(g), D(!0), T.current = !0);
315
- }, [b, g, F]);
316
- return S(() => {
317
- w && v.current(y.current, s.current);
318
- }, [w]), S(() => {
319
- !V && !w && U();
320
- }, [V, w, U]), C.createElement(ve, { width: P, height: E, isEditorReady: w, loading: O, _ref: L, className: x, wrapperProps: I });
321
- }), Be = function() {
322
- let [e, t] = z(G.__getMonacoInstance());
323
- return oe(() => {
324
- let r;
325
- return e || (r = G.init(), r.then((n) => {
326
- t(n);
327
- })), () => r?.cancel();
328
- }), e;
329
- }, B = /* @__PURE__ */ new Map(), Ne = ne(function({ defaultValue: e, defaultLanguage: t, defaultPath: r, value: n, language: o, path: i, theme: c = "light", line: u, loading: f = "Loading...", options: g = {}, overrideServices: O = {}, saveViewState: b = !0, keepCurrentModel: E = !1, width: P = "100%", height: x = "100%", className: I, wrapperProps: H = {}, beforeMount: J = q, onMount: w = q, onChange: D, onValidate: V = q }) {
330
- let [h, y] = z(!1), [s, L] = z(!0), v = m(null), a = m(null), T = m(null), F = m(w), U = m(J), l = m(), d = m(n), be = function(p) {
331
- let M = m();
332
- return S(() => {
333
- M.current = p;
334
- }, [p]), M.current;
335
- }(i), ie = m(!1), K = m(!1);
336
- oe(() => {
337
- let p = G.init();
338
- return p.then((M) => (v.current = M) && L(!1)).catch((M) => M?.type !== "cancelation" && console.error("Monaco initialization: error:", M)), () => a.current ? (l.current?.dispose(), E ? b && B.set(i, a.current.saveViewState()) : a.current.getModel()?.dispose(), void a.current.dispose()) : p.cancel();
339
- }), j(() => {
340
- let p = A(v.current, e || n || "", t || o || "", i || r || "");
341
- p !== a.current?.getModel() && (b && B.set(be, a.current?.saveViewState()), a.current?.setModel(p), b && a.current?.restoreViewState(B.get(i)));
342
- }, [i], h), j(() => {
343
- a.current?.updateOptions(g);
344
- }, [g], h), j(() => {
345
- !a.current || n === void 0 || (a.current.getOption(v.current.editor.EditorOption.readOnly) ? a.current.setValue(n) : n !== a.current.getValue() && (K.current = !0, a.current.executeEdits("", [{ range: a.current.getModel().getFullModelRange(), text: n, forceMoveMarkers: !0 }]), a.current.pushUndoStop(), K.current = !1));
346
- }, [n], h), j(() => {
347
- let p = a.current?.getModel();
348
- p && o && v.current?.editor.setModelLanguage(p, o);
349
- }, [o], h), j(() => {
350
- u !== void 0 && a.current?.revealLine(u);
351
- }, [u], h), j(() => {
352
- v.current?.editor.setTheme(c);
353
- }, [c], h);
354
- let ce = re(() => {
355
- if (T.current && v.current && !ie.current) {
356
- U.current(v.current);
357
- let p = i || r, M = A(v.current, n || e || "", t || o || "", p || "");
358
- a.current = v.current?.editor.create(T.current, { model: M, automaticLayout: !0, ...g }, O), b && a.current.restoreViewState(B.get(p)), v.current.editor.setTheme(c), u !== void 0 && a.current.revealLine(u), y(!0), ie.current = !0;
359
- }
360
- }, [e, t, r, n, o, i, g, O, b, c, u]);
361
- return S(() => {
362
- h && F.current(a.current, v.current);
363
- }, [h]), S(() => {
364
- !s && !h && ce();
365
- }, [s, h, ce]), d.current = n, S(() => {
366
- h && D && (l.current?.dispose(), l.current = a.current?.onDidChangeModelContent((p) => {
367
- K.current || D(a.current.getValue(), p);
368
- }));
369
- }, [h, D]), S(() => {
370
- if (h) {
371
- let p = v.current.editor.onDidChangeMarkers((M) => {
372
- let Q = a.current.getModel()?.uri;
373
- if (Q && M.find((W) => W.path === Q.path)) {
374
- let W = v.current.editor.getModelMarkers({ resource: Q });
375
- V?.(W);
376
- }
377
- });
378
- return () => {
379
- p?.dispose();
380
- };
381
- }
382
- return () => {
383
- };
384
- }, [h, V]), C.createElement(ve, { width: P, height: x, isEditorReady: h, loading: f, _ref: T, className: I, wrapperProps: H });
385
- }), Ye = Ne;
386
- export {
387
- Ue as DiffEditor,
388
- Ne as Editor,
389
- Ye as default,
390
- G as loader,
391
- Be as useMonaco
392
- };