@sheetxl/studio-vanilla 0.4.11 → 0.4.12
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/cjs/{BlSFY6zLlebuejdV.cjs → B35OZ0mE8aINQPP9.cjs} +2 -2
- package/browser/cjs/{DiBy6-IxLscyMW2y.cjs → BPzEQNENF-gEBkg9.cjs} +2 -2
- package/browser/cjs/{C7EZCTczsC-gkRcq.cjs → BUokV6yuzE-_8MyK.cjs} +2 -2
- package/browser/cjs/{T4SHYo66xDT3l9JN.cjs → BeZHmOKfa37mFNAu.cjs} +2 -2
- package/browser/cjs/{BplA5pDzOJpfTZuA.cjs → BflJ_0gT9lQtDvY_.cjs} +2 -2
- package/browser/cjs/{DFspSkki779xN-Ey.cjs → BwN8vKi5o3-PbIMo.cjs} +2 -2
- package/browser/cjs/{D3iOk-Q2tRdUeTcn.cjs → C3OizZPVuxO2fjSG.cjs} +1 -1
- package/browser/cjs/{BshvMtUxTJHj3JQN.cjs → CBL6KkiWI2RPflEN.cjs} +2 -2
- package/browser/cjs/CN6-6xpZMpFqSS8M.cjs +7 -0
- package/browser/cjs/{vfUix5Di0Ro8tEID.cjs → CTrEV_UpxC0W6cZZ.cjs} +2 -2
- package/browser/cjs/{CFcjX5-nVsgzdZ4F.cjs → CU30GVjjFXl44vEU.cjs} +1 -1
- package/browser/cjs/{DgBn3aW39yjgm0X_.cjs → CZWBxvUXzfpn_zmc.cjs} +2 -2
- package/browser/cjs/{DrlS1oz9Nea8Pm3j.cjs → Ccs2ouvlLekaLGH0.cjs} +2 -2
- package/browser/cjs/{B0rdyyttE2Aibsag.cjs → Ce-8L4Viq3I_6j0i.cjs} +2 -2
- package/browser/cjs/{SzxJv7OUs5ojl8gx.cjs → CtNjLzIHB8WX63Bl.cjs} +2 -2
- package/browser/cjs/{Dx-jp_LJxWbAScyA.cjs → DAHpsyykuPBkoh-Z.cjs} +1 -1
- package/browser/cjs/{B2e7dDI-zKoqXpIW.cjs → DJbKKxeeTEHHA1gR.cjs} +20 -20
- package/browser/cjs/{CjZbhk41S1qO_74G.cjs → D_VQzwC1zzTJyKtG.cjs} +1 -1
- package/browser/cjs/{Db_Ew1r6yOMYylvA.cjs → GrsZZ_mEdsM5dEMA.cjs} +2 -2
- package/browser/cjs/{BPTHTRDvNOVkUJGa.cjs → JKEGlXjMwGnXk_Gv.cjs} +2 -2
- package/browser/cjs/{C5FXOMLhAu_KTjVe.cjs → L1iE_VcelYZIy0wI.cjs} +1 -1
- package/browser/cjs/{DFtyXc7YFh9dIp74.cjs → Q_VvA-yUQx3xFKiJ.cjs} +1 -1
- package/browser/cjs/{BAyEOOtO-9sHQQRW.cjs → fTGpiXzFm3K_u2Fm.cjs} +2 -2
- package/browser/cjs/{CuTW2Pt-L5n-hNxV.cjs → hwDUzorB6aCvH1eL.cjs} +1 -1
- package/browser/cjs/index.cjs +2 -2
- package/browser/cjs/{BuWtGFX0HiBezGjw.cjs → no5c2H18QD2qmOH6.cjs} +2 -2
- package/browser/esm/{BALnKy2Fp7fyk-lc.mjs → B4Mm5gczpI_k2zzN.mjs} +2 -2
- package/browser/esm/{BXUGsC1Mo3FP8vnW.mjs → B8ISUdOxsJMYWzNN.mjs} +2 -2
- package/browser/esm/{BGpv6Kq7eBlJy43T.mjs → BnJiF38TGudjoHzT.mjs} +1 -1
- package/browser/esm/Bts4nCgfCAUpTfxz.mjs +7 -0
- package/browser/esm/{DtmE60AvstK9u0Ta.mjs → C3cyAbIH8Qc8MIFN.mjs} +20 -20
- package/browser/esm/C4jlaVv8bELgiHyE.mjs +7 -0
- package/browser/esm/{CFFC0SNc24a0Dxnh.mjs → CYIhGb86r-kKOrP5.mjs} +2 -2
- package/browser/esm/{B905wKzTtod-jbsD.mjs → CcpskguvlvemArQn.mjs} +2 -2
- package/browser/esm/CeRfALx1iU5fqOUg.mjs +7 -0
- package/browser/esm/CfYWmP_Hots5f0f6.mjs +7 -0
- package/browser/esm/CkarbqNx_lhlBnw7.mjs +7 -0
- package/browser/esm/D2PlWNQjrTgf6GuR.mjs +7 -0
- package/browser/esm/{Cc_VWd0wF5-39LsI.mjs → D3KNxvnrwR6_fTJE.mjs} +1 -1
- package/browser/esm/{Bo_ZPRrOQrqOVHAF.mjs → DIJyH94oCzUnlcNZ.mjs} +2 -2
- package/browser/esm/{De6RPxc4p_jXLlT5.mjs → DVAG1NxFe3cMjLE1.mjs} +1 -1
- package/browser/esm/DVqga7g7j0FUiM6p.mjs +7 -0
- package/browser/esm/{PS0cqYnlMVEGOQpI.mjs → DcX8yGEBX6qi9RCe.mjs} +2 -2
- package/browser/esm/{BUSR_OK5Qi6hRPfw.mjs → DeXfOSxGE_Ez7DZq.mjs} +1 -1
- package/browser/esm/{Cq8D_M0jeHLcnRjg.mjs → DzgM_rkwyIHsCb6I.mjs} +1 -1
- package/browser/esm/{BDVJ7eOPpW5FnEAP.mjs → M4hZ25330e96seUM.mjs} +1 -1
- package/browser/esm/Qp2Toeh_EbJH_f_6.mjs +7 -0
- package/browser/esm/SAyRTPVprOHZ8Up8.mjs +7 -0
- package/browser/esm/_ft7JYO6QdDbIu3d.mjs +7 -0
- package/browser/esm/{BlGoi1_x9rUMpWMd.mjs → dpdy0BU4GGI5lZrX.mjs} +1 -1
- package/browser/esm/index.mjs +2 -2
- package/browser/esm/{tFhROdVSw9KLQfUN.mjs → oLCocGFRAwsVsOSE.mjs} +2 -2
- package/cdn/assets/7_O6nILzn1fSVvkO.js +13449 -0
- package/cdn/assets/B3kbBB6oxKBErwzn.js +27 -0
- package/cdn/assets/BB66NDz7S3ocEfRB.js +150 -0
- package/cdn/assets/BCK7yhx9JfzU2rF0.js +22 -0
- package/cdn/assets/BSAH88RG1oubICau.js +84 -0
- package/cdn/assets/BT5EcMEFBsphczwC.js +1469 -0
- package/cdn/assets/BcWoqhD_sX85c7Mh.js +1701 -0
- package/cdn/assets/BoOefjrM4kZ-YXxa.js +90 -0
- package/cdn/assets/BtweFYnoj_aEfydW.js +1371 -0
- package/cdn/assets/Bv0Xb6DdcQbPYJKo.js +24 -0
- package/cdn/assets/CC-S4NMYhLg3WgqO.js +3875 -0
- package/cdn/assets/CJhyHcQcrhbtC33r.js +50 -0
- package/cdn/assets/CUc6gRjjRGTFWSHD.js +50 -0
- package/cdn/assets/CfObTzh8pGdd8D23.js +2183 -0
- package/cdn/assets/CiY3HumGDc_5bMtR.js +58 -0
- package/cdn/assets/CpPLN0-hDsTIFHZV.js +46 -0
- package/cdn/assets/Cq94woVmlxhjWVRI.js +21 -0
- package/cdn/assets/CsjftXmSYQRHNKdq.js +41 -0
- package/cdn/assets/DBL4jY0AVc53RGNm.js +637 -0
- package/cdn/assets/DDW1WJ2IM_9ZUfKm.js +36 -0
- package/cdn/assets/DJQOS9qxVAlpgDMt.js +1704 -0
- package/cdn/assets/DWJE3K3jMKMTCi3o.js +393 -0
- package/cdn/assets/D_5RgqgwXsoqLJDR.js +241 -0
- package/cdn/assets/DfmaL8DmDaFAv8M_.js +6481 -0
- package/cdn/assets/DgLPO_EQ9DYoGgec.js +423 -0
- package/cdn/assets/DkS6quwH1okWaho6.js +46 -0
- package/cdn/assets/DxMu6URURFWj9aXM.js +2373 -0
- package/cdn/assets/Jhm2DAcrfAqiM-Y-.js +26490 -0
- package/cdn/assets/MRBi3juXAW0lA_mj.js +1358 -0
- package/cdn/assets/dk2teWHDODYNarJY.js +27 -0
- package/cdn/assets/phYz0vGgqIEQ2hco.js +12 -0
- package/cdn/assets/qA23x9VVBL9R4qxN.js +43 -0
- package/cdn/index.js +41 -37
- package/cdn/loader.js +1 -1
- package/package.json +3 -3
- package/browser/esm/B5kkStdEkTczERyM.mjs +0 -7
- package/browser/esm/BuURCm92KsyGHG9e.mjs +0 -7
- package/browser/esm/CGZ5MX7afzMxDkCe.mjs +0 -7
- package/browser/esm/CzmNwV9tfFYUp_gS.mjs +0 -7
- package/browser/esm/DlVZFM9ZR5jGyG0_.mjs +0 -7
- package/browser/esm/DqXxZP6yKF4U1YfY.mjs +0 -7
- package/browser/esm/Dz2OVgq3kxi1TkfX.mjs +0 -7
- package/browser/esm/QBGUD1XS5_pysBLL.mjs +0 -7
- package/browser/esm/uGDCdtqxjqRCo4Xn.mjs +0 -7
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { g as i } from "./phYz0vGgqIEQ2hco.js";
|
|
2
|
+
import { r as s } from "./D_5RgqgwXsoqLJDR.js";
|
|
3
|
+
/**
|
|
4
|
+
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.12
|
|
5
|
+
*
|
|
6
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
7
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
8
|
+
*/
|
|
9
|
+
function c(t, a) {
|
|
10
|
+
for (var o = 0; o < a.length; o++) {
|
|
11
|
+
const e = a[o];
|
|
12
|
+
if (typeof e != "string" && !Array.isArray(e)) {
|
|
13
|
+
for (const r in e) if (r !== "default" && !(r in t)) {
|
|
14
|
+
const n = Object.getOwnPropertyDescriptor(e, r);
|
|
15
|
+
n && Object.defineProperty(t, r, n.get ? n : { enumerable: !0, get: () => e[r] });
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return Object.freeze(Object.defineProperty(t, Symbol.toStringTag, { value: "Module" }));
|
|
20
|
+
}
|
|
21
|
+
var f = s();
|
|
22
|
+
const l = i(f), u = c({ __proto__: null, default: l }, [f]);
|
|
23
|
+
export {
|
|
24
|
+
u as R,
|
|
25
|
+
f as r,
|
|
26
|
+
l as z
|
|
27
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.12
|
|
3
|
+
*
|
|
4
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
+
*/
|
|
7
|
+
function e(t) {
|
|
8
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
e as g
|
|
12
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { a as r } from "./DDW1WJ2IM_9ZUfKm.js";
|
|
2
|
+
import { r as n } from "./dk2teWHDODYNarJY.js";
|
|
3
|
+
import { S as p, s as b, B as k, ah as B, ai as I } from "./Jhm2DAcrfAqiM-Y-.js";
|
|
4
|
+
/**
|
|
5
|
+
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.12
|
|
6
|
+
*
|
|
7
|
+
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
8
|
+
* License: The license can be found at https://www.sheetxl.com/license.
|
|
9
|
+
*/
|
|
10
|
+
const E = ["Ok", "Cancel"], U = n.memo((V) => {
|
|
11
|
+
const { value: a = null, context: t, onOption: c, onValidateOption: L, onDone: m, onUpdate: g, options: x = E, defaultOption: f = x?.[0], cancelOption: N = "Cancel", sx: h, ...C } = V, y = n.useMemo(() => t?.getNames().findValidName("Range1"), []), d = n.useMemo(() => {
|
|
12
|
+
if (!a) return !0;
|
|
13
|
+
}, []), [l, R] = n.useState({ displayText: a?.getName() ?? y, errorText: null }), [s, v] = n.useState({ displayValue: a?.getRanges() ?? t?.selection() ?? null, errorText: null }), [T, O] = n.useState(!1), S = n.useCallback(async (e) => !l.errorText && !s.errorText, [t]), j = p((e, o, u) => {
|
|
14
|
+
if (!o) {
|
|
15
|
+
let i = null;
|
|
16
|
+
d ? i = t?.getNames().addReference(l?.displayText, s?.displayValue, !1) : (a.getType() === "reference" && a.doBatch(() => {
|
|
17
|
+
a.setName(l?.displayText), a.setReference(s?.displayValue);
|
|
18
|
+
}, `Edit Named '${l?.displayText}'`), i = a), i && (i.select(), g(i, d));
|
|
19
|
+
}
|
|
20
|
+
c?.(e, o, u), m?.();
|
|
21
|
+
}, [t, l, s, m, c, f, N, g]), w = p((e) => {
|
|
22
|
+
let o = null;
|
|
23
|
+
try {
|
|
24
|
+
t?.getNames().validateName(e);
|
|
25
|
+
} catch (u) {
|
|
26
|
+
o = u.message;
|
|
27
|
+
}
|
|
28
|
+
R({ displayText: e, errorText: o });
|
|
29
|
+
}, []), D = p((e) => {
|
|
30
|
+
a && a.getName().toLowerCase() === e.toLowerCase() || t?.getNames().validateName(e);
|
|
31
|
+
}, [t, a]), F = n.useCallback((e) => {
|
|
32
|
+
v({ displayValue: e ?? null, errorText: null });
|
|
33
|
+
}, []);
|
|
34
|
+
return r.jsx(b, { title: (d ? "Define" : "Edit") + " Range", options: x, onOption: j, onValidateOption: S, defaultOption: f, cancelOption: N, autoFocusSel: ".autoFocus", sx: { width: "460px", ...h }, ...C, children: r.jsxs(k, { sx: { paddingTop: (e) => e.spacing(1), paddingBottom: (e) => e.spacing(0), rowGap: (e) => e.spacing(1), range: "flex", flexDirection: "column" }, children: [r.jsx(B, { formName: "name", defaultInput: y, value: l.displayText, onChangeInput: w, onValidate: D, onFocus: (e) => {
|
|
35
|
+
T || e.target?.select(), O(!0);
|
|
36
|
+
} }), r.jsx(I, { formName: "range", value: s.displayValue, onChangeInput: F, resolvedAddress: t.getNames().getRanges.bind(t.getNames()), onFocus: (e) => {
|
|
37
|
+
T || e.target?.select(), O(!0);
|
|
38
|
+
} })] }) });
|
|
39
|
+
});
|
|
40
|
+
export {
|
|
41
|
+
U as NamedReferenceDialog,
|
|
42
|
+
U as default
|
|
43
|
+
};
|
package/cdn/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.
|
|
2
|
+
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.12
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
6
|
*/
|
|
7
|
-
const S = /* @__PURE__ */ new Map(), k = (e,
|
|
8
|
-
const { message: t, icon: r, customElement: p, hide: m = !1, className: a, cssVars:
|
|
7
|
+
const S = /* @__PURE__ */ new Map(), k = (e, n = {}) => {
|
|
8
|
+
const { message: t, icon: r, customElement: p, hide: m = !1, className: a, cssVars: f = {} } = n;
|
|
9
9
|
if (m) return;
|
|
10
10
|
const l = typeof e == "string" ? document.querySelector(e) : e;
|
|
11
11
|
if (!l) return void console.warn(`Element with selector "${e}" not found for panel.`);
|
|
12
|
-
let
|
|
13
|
-
if (h(e), p)
|
|
12
|
+
let o;
|
|
13
|
+
if (h(e), p) o = p;
|
|
14
14
|
else {
|
|
15
|
-
|
|
16
|
-
const
|
|
15
|
+
o = document.createElement("div"), o.className = a ? `sheetxl-panel ${a}` : "sheetxl-panel";
|
|
16
|
+
const u = Object.entries(f).map(([s, y]) => `--sheetxl-panel-${s}: ${y};`).join(" "), g = `
|
|
17
17
|
@keyframes sheetxl-spin {
|
|
18
18
|
from { transform: rotate(0deg); }
|
|
19
19
|
to { transform: rotate(360deg); }
|
|
@@ -81,21 +81,21 @@ const S = /* @__PURE__ */ new Map(), k = (e, o = {}) => {
|
|
|
81
81
|
margin: 0;
|
|
82
82
|
}
|
|
83
83
|
`, d = document.createElement("style");
|
|
84
|
-
if (d.textContent = g,
|
|
84
|
+
if (d.textContent = g, o.appendChild(d), r) {
|
|
85
85
|
const s = document.createElement("div");
|
|
86
|
-
s.className = "sheetxl-icon", typeof r == "string" ? s.innerHTML = r : r instanceof HTMLElement && s.appendChild(r),
|
|
86
|
+
s.className = "sheetxl-icon", typeof r == "string" ? s.innerHTML = r : r instanceof HTMLElement && s.appendChild(r), o.appendChild(s);
|
|
87
87
|
}
|
|
88
88
|
if (t) {
|
|
89
89
|
const s = document.createElement("div");
|
|
90
|
-
s.className = "sheetxl-message", s.textContent = t,
|
|
90
|
+
s.className = "sheetxl-message", s.textContent = t, o.appendChild(s);
|
|
91
91
|
}
|
|
92
|
-
|
|
92
|
+
u && (o.style.cssText += u), window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches && o.classList.add("dark");
|
|
93
93
|
}
|
|
94
|
-
window.getComputedStyle(l).position === "static" && (l.style.position = "relative"), l.appendChild(
|
|
94
|
+
window.getComputedStyle(l).position === "static" && (l.style.position = "relative"), l.appendChild(o), S.set(e, o);
|
|
95
95
|
}, h = (e) => {
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
}, L = (e,
|
|
96
|
+
const n = S.get(e);
|
|
97
|
+
n && n.parentNode && (n.parentNode.removeChild(n), S.delete(e));
|
|
98
|
+
}, L = (e, n = {}) => {
|
|
99
99
|
k(e, { icon: `
|
|
100
100
|
<svg width="24" height="24" viewBox="0 0 24 24" style="animation: sheetxl-spin 1s linear infinite;">
|
|
101
101
|
<circle cx="12" cy="12" r="10" fill="none" stroke="currentColor" stroke-width="2" stroke-dasharray="31.416" stroke-dashoffset="31.416">
|
|
@@ -103,61 +103,65 @@ const S = /* @__PURE__ */ new Map(), k = (e, o = {}) => {
|
|
|
103
103
|
<animate attributeName="stroke-dashoffset" dur="2s" values="0;-15.708;-31.416" repeatCount="indefinite"/>
|
|
104
104
|
</circle>
|
|
105
105
|
</svg>
|
|
106
|
-
`, className: "loading", ...
|
|
107
|
-
}, b = (e,
|
|
106
|
+
`, className: "loading", ...n });
|
|
107
|
+
}, b = (e, n = {}) => {
|
|
108
108
|
k(e, { message: "Failed to load SheetXL", icon: `
|
|
109
109
|
<svg width="24" height="24" viewBox="0 0 24 24" fill="currentColor">
|
|
110
110
|
<path d="M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"/>
|
|
111
111
|
</svg>
|
|
112
|
-
`, className: "error", ...
|
|
112
|
+
`, className: "error", ...n });
|
|
113
113
|
}, x = /* @__PURE__ */ new Map();
|
|
114
114
|
let c;
|
|
115
|
-
const C = async (e) => c || (c = await (async (
|
|
115
|
+
const C = async (e) => c || (c = await (async (n, t) => {
|
|
116
116
|
try {
|
|
117
|
-
t?.selector && L(t?.selector, t?.loading),
|
|
117
|
+
if (t?.selector && L(t?.selector, t?.loading), !n) {
|
|
118
|
+
const { resolveDependencies: r } = await import("./assets/Cq94woVmlxhjWVRI.js");
|
|
119
|
+
n = await r(t?.dependencies);
|
|
120
|
+
}
|
|
121
|
+
t?.licenseKey && await n.StudioMUI.LicenseManager.setLicenseKey(t.licenseKey), t?.selector && h(t?.selector);
|
|
118
122
|
} catch (r) {
|
|
119
123
|
throw t?.selector && (h(t.selector), b(t.selector, { message: `Failed to initialize: ${r instanceof Error ? r.message : String(r)}`, ...t?.error })), console.error("Failed to initialize:", r), r;
|
|
120
124
|
}
|
|
121
|
-
return
|
|
122
|
-
})(null, typeof e == "object" ? e : void 0), c), M = { attachStudio: async (e,
|
|
125
|
+
return n;
|
|
126
|
+
})(null, typeof e == "object" ? e : void 0), c), M = { attachStudio: async (e, n) => (c || (c = await C(e)), (async (t, r, p, m) => {
|
|
123
127
|
if (!r) throw new Error("Either a 'selector' or a 'InitializationOptions' must be provided to attach.");
|
|
124
|
-
const a = typeof r == "string" ? r : r.selector || "#sheetxl",
|
|
125
|
-
if (!
|
|
128
|
+
const a = typeof r == "string" ? r : r.selector || "#sheetxl", f = typeof a == "string" ? document.querySelector(a) : a;
|
|
129
|
+
if (!f) throw new Error(`Element with selector "${a}" not found.`);
|
|
126
130
|
if (x.has(a) && x.get(a) !== null) throw new Error(`SheetXL already attached to "${a}". Detach first if you want to re-attach.`);
|
|
127
131
|
const l = typeof r == "object" ? r : null;
|
|
128
132
|
L(a, l?.loading);
|
|
129
133
|
try {
|
|
130
134
|
h(a);
|
|
131
|
-
const
|
|
135
|
+
const o = t.ReactDOMClient.createRoot(f), u = t.React.createRef(), g = t.StudioMUI[p];
|
|
132
136
|
let d = null;
|
|
133
137
|
await new Promise((v) => {
|
|
134
|
-
|
|
138
|
+
o.render(t.React.createElement(g, { ...m, ref: (i) => {
|
|
135
139
|
i && (d = i, v());
|
|
136
140
|
} }));
|
|
137
141
|
});
|
|
138
|
-
const y = { runtime: t, root:
|
|
142
|
+
const y = { runtime: t, root: o };
|
|
139
143
|
x.set(a, y);
|
|
140
144
|
let E = !1;
|
|
141
145
|
return new Proxy(d, { get(v, i, z) {
|
|
142
146
|
if (E) throw new Error(`SheetXL instance attached to "${a}" has been detached. Cannot access properties.`);
|
|
143
147
|
return i === "update" ? (N) => {
|
|
144
|
-
const $ = { ...m, ...N, ref:
|
|
145
|
-
return
|
|
146
|
-
} : i === "detach" ? () => (x.delete(a),
|
|
148
|
+
const $ = { ...m, ...N, ref: u };
|
|
149
|
+
return o.render(t.React.createElement(g, $)), Promise.resolve();
|
|
150
|
+
} : i === "detach" ? () => (x.delete(a), o.unmount(), E = !0, Promise.resolve()) : Reflect.get(v, i, z);
|
|
147
151
|
} });
|
|
148
|
-
} catch (
|
|
149
|
-
throw h(a), b(a, { message: `Failed to initialize: ${
|
|
152
|
+
} catch (o) {
|
|
153
|
+
throw h(a), b(a, { message: `Failed to initialize: ${o instanceof Error ? o.message : String(o)}`, ...l?.error }), console.error("Failed to initialize:", o), o;
|
|
150
154
|
}
|
|
151
|
-
})(c, e, "Studio",
|
|
155
|
+
})(c, e, "Studio", n)), async initialize(e) {
|
|
152
156
|
await C(e);
|
|
153
157
|
} }, w = document.currentScript;
|
|
154
158
|
if (w) {
|
|
155
159
|
console.log("SheetXL script tag:", w);
|
|
156
160
|
const e = w.dataset ? w.dataset.target : "#sheetxl";
|
|
157
|
-
document.querySelector(e) || console.error(`SheetXL: Target element "${e}" not found in the document.`), M.attachStudio(e, { autoFocus: !0 }).then((
|
|
158
|
-
console.log("SheetXL studio created and attached:",
|
|
159
|
-
}).catch((
|
|
160
|
-
console.error("Error creating SheetXL studio:",
|
|
161
|
+
document.querySelector(e) || console.error(`SheetXL: Target element "${e}" not found in the document.`), M.attachStudio(e, { autoFocus: !0 }).then((n) => {
|
|
162
|
+
console.log("SheetXL studio created and attached:", n);
|
|
163
|
+
}).catch((n) => {
|
|
164
|
+
console.error("Error creating SheetXL studio:", n);
|
|
161
165
|
});
|
|
162
166
|
}
|
|
163
167
|
const X = M;
|
package/cdn/loader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(e){typeof define=="function"&&define.amd?define(e):e()})(function(){"use strict";/**
|
|
2
|
-
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.
|
|
2
|
+
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.12
|
|
3
3
|
*
|
|
4
4
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheetxl/studio-vanilla",
|
|
3
3
|
"description": "SheetXL Studio - Vanilla entry point for integrating SheetXL UI.",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.12",
|
|
5
5
|
"license": "SEE LICENSE IN <LICENSE>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "./browser/esm/index.mjs",
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
"@mui/styled-engine": "^6.5.0",
|
|
42
42
|
"@mui/system": "^6.5.0",
|
|
43
43
|
"@mui/utils": "^6.4.9",
|
|
44
|
-
"@sheetxl/studio-mui": "^0.4.
|
|
44
|
+
"@sheetxl/studio-mui": "^0.4.12",
|
|
45
45
|
"react": "^19.1.0",
|
|
46
46
|
"react-dom": "^19.1.0",
|
|
47
47
|
"csstype": "^3.1.3",
|
|
48
48
|
"http-server": "^14.1.1"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@sheetxl/sdk": "^0.4.
|
|
51
|
+
"@sheetxl/sdk": "^0.4.12"
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license @sheetxl/studio-vanilla - SheetXL Studio - Vanilla entry point for integrating SheetXL UI. - v0.4.11
|
|
3
|
-
*
|
|
4
|
-
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
5
|
-
* License: The license can be found at https://www.sheetxl.com/license.
|
|
6
|
-
*/
|
|
7
|
-
import{a3 as e,j as t,r as n,$ as s,p as i,a4 as o,V as a,D as l,B as r,a5 as c,a6 as p,a7 as d,a8 as u,a9 as f,T as x,a as g,I as m,aa as h,ab as O,ac as j,x as C,ad as y,ae as b,af as R,ag as T,a2 as v,F as k,a0 as S,a1 as w}from"./DtmE60AvstK9u0Ta.mjs";import{ICell as E,IRange as F}from"@sheetxl/sdk";const I=e(t.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack"),D=e(t.jsx("path",{d:"m20 12-1.41-1.41L13 16.17V4h-2v12.17l-5.58-5.59L4 12l8 8z"}),"ArrowDownward"),L=e(t.jsx("path",{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward"),P=e(t.jsx("path",{d:"m4 12 1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8z"}),"ArrowUpward"),A=n.memo(e=>{const{label:i,value:o,options:a,onSelect:l,tabIndex:r=0,...c}=e,[p,d]=n.useState(()=>z(o,a));n.useEffect(()=>{d(z(o,a))},[o,a]);const u=s(e=>{d(e.target.value),l?.(a[e.target.value])},[l,a]),f=n.useMemo(()=>Object.keys(a).map(e=>t.jsx(v,{value:e,children:e},e)),[a]);return t.jsxs(k,{sx:{minWidth:135},size:"small",children:[t.jsx(S,{children:i}),t.jsx(w,{inputProps:{tabIndex:r},value:p,label:i,onChange:u,sx:{backgroundImage:`linear-gradient(${g("#fff",C(5))}, ${g("#fff",C(5))})`},...c,children:f})]})}),K={Workbook:"workbook",Sheet:"sheet"},V={enter:140,exit:140},M={Formulas:E.Content.Formulas,Values:E.Content.Values,Notes:E.Content.Notes,Comments:E.Content.Comments},$={...M};delete $.Values;const B={"By Rows":!0,"By Columns":!1},z=(e,t)=>{const n=Object.keys(t);for(let s=0;s<n.length;s++){const i=n[s];if(t[i]===e)return i}},H=n.memo(e=>{const{replace:v=!1,findText:k,replaceText:S,findOptions:w,replaceOptions:z,title:H,onHide:W,onFindOrReplace:N,...U}=e,G=n.useRef(null),X=n.useRef(null),q=n.useRef(null),J=n.useRef(null),Q=n.useRef(null),Y=n.useRef(null),Z=(e,t)=>{t&&(t.start(e,{center:!1}),setTimeout(()=>t.stop(e),180))},[_,ee]=n.useState(!1),[te,ne]=n.useState(!1),[se,ie]=n.useState(v),[oe,ae]=n.useState(!1),[le,re]=n.useState(!1),[ce,pe]=n.useState({findText:null,replaceText:null,replace:v,replaceOptions:{},findOptions:{matchCase:!1,matchEntireCell:!1,useRegex:!1,orientation:F.Orientation.Row,fields:[E.Content.Formulas]},scope:K.Sheet}),de=s(async(e,t,n,s)=>{if(!N)return;const i={...ce};i.replaceOptions={...i.replaceOptions},i.findOptions={...i.findOptions},i.replaceOptions.maxCount=n?void 0:1,i.replace=t,t&&ce.findOptions.fields?.[0]===E.Content.Values&&(i.findOptions.fields=[E.Content.Formulas]),i.findOptions.reverse=!e;const o=await N({autoFocus:s,...i});ae(0===o)},[ce,N]);n.useEffect(()=>{ae(!1)},[ce,te,se]);const ue=s((e,t)=>{if(e.keyCode===i.Enter){if(!ce.findText)return;let n=!0,s=!1;e.shiftKey&&(n=!1),t?(e.ctrlKey&&e.altKey&&(s=!0),Z(e,s?Y.current:Q.current)):Z(e,n?J.current:q.current),de(n,t,s,!1)}},[ce]),fe=n.useRef(null);n.useLayoutEffect(()=>{pe(e=>{const t={...e};t.findText=k&&k.length>0?k:e.findText??"",ee(!0),void 0!==S&&(t.replaceText=S),w&&(t.findOptions={...t.findOptions,...w}),t.replaceText||(t.replaceText=""),t.replaceOptions&&(t.replaceOptions={...t.replaceOptions}),z&&(t.replaceOptions={...t.replaceOptions,...z}),ce.findOptions.fields?.[0]||(ce.findOptions.fields=[E.Content.Formulas]);const n=!(!z&&void 0===S);return n&&ie(n),t}),le||fe.current?.focus()},[k,S,w,z]),n.useEffect(()=>{se?(ce.findOptions.fields[0],E.Content.Values):ee(!0)},[se]),n.useEffect(()=>{if(_&&G.current&&ce.findText===G.current.value)return G.current===document.activeElement||G.current.contains(document.activeElement)?(G.current?.select(),void ee(!1)):void G.current.addEventListener("focus",()=>{G.current?.select(),ee(!1)},{once:!0})},[_,ce]);const[xe,{width:ge}]=o();return t.jsx(a,{ref:fe,title:H??(se?"Find & Replace":"Find"),initialPosition:{y:"35"},autoFocusSel:".input",onHide:W,onFocus:()=>re(!0),onBlur:()=>{re(!1),ae(!1)},PaperProps:{elevation:le?3:1},...U,children:t.jsxs(l,{dividers:!0,ref:xe,sx:{display:"flex",flexDirection:"column",paddingLeft:e=>e.spacing(1.5),paddingRight:e=>e.spacing(1.5)},onKeyDown:e=>{if("h"===e.key&&e.ctrlKey)ie(!0),G.current?.contains(document.activeElement)&&X.current?.focus();else if("f"===e.key&&e.ctrlKey)G.current?.focus();else if("c"===e.key&&e.altKey)pe(e=>{const t={...e};return t.findOptions.matchCase=!e.findOptions.matchCase,t});else if("e"===e.key&&e.altKey)pe(e=>{const t={...e};return t.findOptions.matchEntireCell=!e.findOptions.matchEntireCell,t});else{if("r"!==e.key||!e.altKey)return;pe(e=>{const t={...e};return t.findOptions.useRegex=!e.findOptions.useRegex,t})}e.preventDefault()},children:[t.jsxs(r,{sx:{display:"flex",flexDirection:"row",gap:e=>e.spacing(1)},children:[t.jsxs(r,{sx:{display:"flex",flexDirection:"row",alignItems:"start",gap:e=>e.spacing(.25),paddingTop:"3px"},children:[t.jsx(c,{selected:te,onSelectToggle:e=>{ne(e)},preventFocus:!0,label:"Toggle Additional Options",icon:p(t.jsx(d,{}))}),t.jsx(c,{selected:se,onSelectToggle:e=>{ie(e)},preventFocus:!0,label:"Toggle Replace",icon:p(t.jsx(f,{})),shortcut:{key:se?"F":"H",modifiers:[u.Ctrl]}})]}),t.jsxs(r,{sx:{display:"flex",flexDirection:"column",maxWidth:"100%",boxSizing:"border-box"},children:[t.jsxs(r,{sx:{display:"flex",flexDirection:"row",alignItems:"center"},children:[t.jsx(x,{label:"Find",InputLabelProps:{shrink:!0},InputProps:{sx:{paddingRight:e=>e.spacing(1),minWidth:ge>460?"20em":void 0,backgroundImage:`linear-gradient(${g("#fff",C(5))}, ${g("#fff",C(5))})`},inputProps:{draggable:!1,ref:G,className:"input",autoFocus:!0,spellCheck:!1,autoComplete:"off",sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75)}},endAdornment:t.jsx(m,{sx:{transform:"scale(0.75) translateX(16px)"},position:"end",children:t.jsxs(r,{sx:{display:"flex",alignItems:"center",flexDirection:"row",gap:"1px"},children:[t.jsx(c,{selected:ce.findOptions.matchCase,onSelectToggle:e=>{pe(t=>{const n={...t};return n.findOptions.matchCase=e,n})},label:"Match Case",shortcut:{key:"C",modifiers:[u.Alt]},icon:p(t.jsx(h,{}))}),t.jsx(c,{selected:ce.findOptions.matchEntireCell,onSelectToggle:e=>{pe(t=>{const n={...t};return n.findOptions.matchEntireCell=e,n})},label:"Match Entire Cell",shortcut:{key:"E",modifiers:[u.Alt]},icon:p(t.jsx(O,{}))}),t.jsx(c,{selected:ce.findOptions.useRegex,onSelectToggle:e=>{pe(t=>{const n={...t};return n.findOptions.useRegex=e,n})},label:"Use Regular Expression",shortcut:{key:"R",modifiers:[u.Alt]},icon:p(t.jsx(j,{}))})]})})},sx:{flex:"1 1 100%",marginRight:e=>e.spacing(1),"& .MuiOutlinedInput-notchedOutline":{borderColor:e=>oe?`${e.palette.error.main} !important`:void 0},"& .MuiInputLabel-outlined":{color:e=>oe?`${e.palette.error.main} !important`:void 0}},value:ce.findText??"",onChange:e=>{pe(t=>{const n={...t};return n.findText=e.target.value,n})},onKeyDown:e=>ue(e,!1),onContextMenu:e=>{e.stopPropagation()}}),t.jsx(c,{selected:ce.findOptions.reverse,onSelectToggle:e=>{de(!1,!1)},touchRippleRef:q,label:"",shortcut:{key:"Enter",modifiers:[u.Shift]},icon:p(ce.findOptions.orientation!==F.Orientation.Column?t.jsx(I,{}):t.jsx(P,{})),disabled:!ce.findText}),t.jsx(c,{selected:!ce.findOptions.reverse,onSelectToggle:e=>{de(!0,!1)},touchRippleRef:J,label:"Next Match",shortcut:{key:"Enter"},icon:p(ce.findOptions.orientation!==F.Orientation.Column?t.jsx(L,{}):t.jsx(D,{})),disabled:!ce.findText})]}),t.jsx(y,{in:se,timeout:V,onExit:()=>{G.current?.focus()},children:t.jsxs(r,{sx:{display:"flex",flexDirection:"row",alignItems:"center",marginTop:e=>e.spacing(2)},children:[t.jsx(x,{label:"Replace",InputLabelProps:{shrink:!0},InputProps:{sx:{paddingRight:e=>e.spacing(1),backgroundImage:`linear-gradient(${g("#fff",C(5))}, ${g("#fff",C(5))})`},inputProps:{ref:X,className:"input",spellCheck:!1,autoComplete:"off",sx:{paddingTop:e=>e.spacing(1.25),paddingBottom:e=>e.spacing(.75)}}},sx:{flex:"1 1 100%",marginRight:e=>e.spacing(1)},value:ce.replaceText??"",onChange:e=>{pe(t=>{const n={...t};return n.replaceText=e.target.value,n})},onKeyDown:e=>ue(e,!0),onContextMenu:e=>{e.stopPropagation()}}),t.jsx(c,{onSelectToggle:e=>{de(!0,!0)},touchRippleRef:Q,label:"Replace",shortcut:{key:"Enter"},icon:p(t.jsx(b,{})),disabled:!ce.findText}),t.jsx(c,{onSelectToggle:e=>{de(!0,!0,!0)},touchRippleRef:Y,label:"Replace All",shortcut:{key:"Enter",modifiers:[u.Ctrl,u.Alt]},icon:p(t.jsx(R,{})),disabled:!ce.findText})]})})]})]}),t.jsx(y,{in:te,timeout:V,onExit:()=>{G.current?.focus()},children:t.jsxs(r,{sx:{minHeight:"10px",flex:"1 1 100%",display:"flex",flexDirection:"column",gap:e=>e.spacing(.5),marginTop:e=>e.spacing(1)},children:[t.jsx(T,{orientation:"horizontal",sx:{marginBottom:e=>e.spacing(1.5)}}),t.jsxs(r,{sx:{display:"flex",flexDirection:ge>=413?"row":"column",justifyContent:"space-evenly",alignItems:"center",rowGap:e=>e.spacing(2)},tabIndex:-1,children:[t.jsx(A,{label:"Within",value:ce.scope,options:K,onSelect:e=>{pe(t=>{const n={...t};return n.scope=e,n})}}),t.jsx(A,{label:"Search",value:ce.findOptions.orientation!==F.Orientation.Column,options:B,onSelect:e=>{pe(t=>{const n={...t};return n.findOptions.orientation=e?F.Orientation.Row:F.Orientation.Column,n})}}),t.jsx(A,{label:"Look in",value:se&&ce.findOptions.fields?.[0]===E.Content.Values?E.Content.Formulas:ce.findOptions.fields?.[0],options:se?$:M,onSelect:e=>{pe(t=>{const n={...t};return n.findOptions.fields=[e],n})}})]})]})})]})})});export{H as FindReplaceWindow,K as ScopeOptions,H as default};
|