@sheetxl/scripting 0.4.10 → 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/{Bsq5VlJY-Td38K9C.cjs → BkP57BcKBVhJRup6.cjs} +5 -5
- package/browser/cjs/{D7hfNYOs7_pkIGbS.cjs → CBrxfIVjVoHo8-IX.cjs} +1 -1
- package/browser/cjs/{CuRwP5MTc0sKqfRf.cjs → CxeKZrSi9qTmM302.cjs} +387 -385
- package/browser/cjs/DKBHGmlcuuioi8Lf.cjs +13 -0
- package/browser/cjs/{CJbQzW9SauWj1FBs.cjs → a3Iep33Vu7URpTHP.cjs} +1 -1
- package/browser/cjs/index.cjs +2 -2
- package/browser/cjs/{BPtWwADfTFtbtFp1.cjs → khSLLzqzmr7Cidzx.cjs} +2 -2
- package/browser/esm/{CScJG5QypXGnPkR2.mjs → 82d-pn5TYte-wk6J.mjs} +387 -385
- package/browser/esm/{fKEbHLCqu8DVTdFS.mjs → CzvqUn8m8ZE1sVnx.mjs} +1 -1
- package/{node/esm/BwmZ8LkckrBAukJF.mjs → browser/esm/DIuEZ8oh1MzdXn0j.mjs} +2 -2
- package/browser/esm/{GsUk_uxd64EIkKwU.mjs → DTaMg8MeUlF6X8wO.mjs} +20 -20
- package/browser/esm/{kareFFeW32O_ajMm.mjs → Db_V2k1ItiCEuVFp.mjs} +1 -1
- package/browser/esm/{DK5PDu18K4_x66tQ.mjs → ZcaR45N07z-TrTku.mjs} +58 -52
- package/browser/esm/index.mjs +2 -2
- package/licenses/dependencies.txt +2 -2
- package/node/esm/{CiTOh9mK8ZyCe6vy.mjs → B2AXwIR6K4mp8VyX.mjs} +3 -3
- package/{browser/esm/BU7b75vTym2nREBl.mjs → node/esm/BW8zR29678uuRjt3.mjs} +2 -2
- package/node/esm/{Ankf3x5Wv3jyLLnO.mjs → CFNeK9dgiSBGzlf2.mjs} +387 -385
- package/node/esm/{B4O_Vb46djSB-6pt.mjs → CdT9QaMEFu8pV7pa.mjs} +1 -1
- package/node/esm/{DHRL2LI8r6S4fCwI.mjs → DGwJ9qS_Md5reXWO.mjs} +1 -1
- package/node/esm/index.mjs +2 -2
- package/package.json +3 -3
- package/browser/cjs/DOgVGbF-vm0eId3R.cjs +0 -13
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - 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.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - 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.
|
|
@@ -10,7 +10,7 @@ class o {
|
|
|
10
10
|
}
|
|
11
11
|
async getWorkerWrapper() {
|
|
12
12
|
if (this.workerWrapper) return this.workerWrapper;
|
|
13
|
-
const { createCompilerWorker: r } = await import("./
|
|
13
|
+
const { createCompilerWorker: r } = await import("./82d-pn5TYte-wk6J.mjs");
|
|
14
14
|
return this.workerWrapper = await r(), this.workerWrapper;
|
|
15
15
|
}
|
|
16
16
|
async compileModule(r) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { e as he } from "./ZcaR45N07z-TrTku.mjs";
|
|
2
2
|
/**
|
|
3
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
3
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.12
|
|
4
4
|
*
|
|
5
5
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
6
6
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -166,7 +166,7 @@ var se, q, r;
|
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
168
|
e.Field = B;
|
|
169
|
-
class
|
|
169
|
+
class X extends a {
|
|
170
170
|
constructor(n, o) {
|
|
171
171
|
super(e.Code.Calc, e.Label.Calc, n, o);
|
|
172
172
|
}
|
|
@@ -174,7 +174,7 @@ var se, q, r;
|
|
|
174
174
|
this.code = e.Code.Calc;
|
|
175
175
|
}
|
|
176
176
|
}
|
|
177
|
-
e.Calc =
|
|
177
|
+
e.Calc = X;
|
|
178
178
|
class O extends a {
|
|
179
179
|
constructor(n, o) {
|
|
180
180
|
super(e.Code.Busy, e.Label.Busy, n, o);
|
|
@@ -193,7 +193,7 @@ var se, q, r;
|
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
e.Python = A;
|
|
196
|
-
class
|
|
196
|
+
class Y extends a {
|
|
197
197
|
constructor(n, o) {
|
|
198
198
|
super(e.Code.Timeout, e.Label.Timeout, n, o);
|
|
199
199
|
}
|
|
@@ -201,7 +201,7 @@ var se, q, r;
|
|
|
201
201
|
this.code = e.Code.Timeout;
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
-
e.Timeout =
|
|
204
|
+
e.Timeout = Y;
|
|
205
205
|
})(r || (r = {}));
|
|
206
206
|
const f = {};
|
|
207
207
|
f[r.Code.Parse] = r.Parse, f[r.Code.Null] = r.Null, f[r.Code.Div0] = r.Div0, f[r.Code.Value] = r.Value, f[r.Code.Ref] = r.Ref, f[r.Code.Name] = r.Name, f[r.Code.Num] = r.Num, f[r.Code.NA] = r.NA, f[r.Code.GettingData] = r.GettingData, f[r.Code.Spill] = r.Spill, f[r.Code.Connect] = r.Connect, f[r.Code.Blocked] = r.Blocked, f[r.Code.Unknown] = r.Unknown, f[r.Code.Field] = r.Field, f[r.Code.Calc] = r.Calc, f[r.Code.Busy] = r.Busy, f[r.Code.Python] = r.Python, f[r.Code.Timeout] = r.Timeout;
|
|
@@ -218,25 +218,25 @@ var u;
|
|
|
218
218
|
let p;
|
|
219
219
|
return p = typeof e == "string" ? de.get(e) : ue.get(e), p || (p = u.Unknown), new p(a, C);
|
|
220
220
|
}, u.getBuiltInById = (e) => ne.get(e) || xe;
|
|
221
|
-
let I = null,
|
|
221
|
+
let I = null, H = null;
|
|
222
222
|
const be = { compilerOptions: { target: "esnext" } };
|
|
223
223
|
async function Te(e, a, C = "/script.js", p = "__SHEETXL") {
|
|
224
224
|
try {
|
|
225
225
|
const F = await async function() {
|
|
226
226
|
if (I) return I;
|
|
227
|
-
if (
|
|
228
|
-
if (await
|
|
227
|
+
if (H) {
|
|
228
|
+
if (await H, !I) throw new Error("ESBuild initialization promise resolved, but instance is not available.");
|
|
229
229
|
return I;
|
|
230
230
|
}
|
|
231
231
|
let b, N;
|
|
232
|
-
|
|
232
|
+
H = new Promise((d, S) => {
|
|
233
233
|
b = d, N = S;
|
|
234
234
|
});
|
|
235
235
|
try {
|
|
236
|
-
const { initialize: d } = await import("./
|
|
236
|
+
const { initialize: d } = await import("./Db_V2k1ItiCEuVFp.mjs");
|
|
237
237
|
return I = await d(), b(), I;
|
|
238
238
|
} catch (d) {
|
|
239
|
-
throw console.error("Failed to import or initialize esbuild:", d),
|
|
239
|
+
throw console.error("Failed to import or initialize esbuild:", d), H = null, N(d), d;
|
|
240
240
|
}
|
|
241
241
|
}(), R = "@sheetxl/primitives", s = `
|
|
242
242
|
export const FormulaContext = globalThis.${p}?.FormulaContext;
|
|
@@ -278,15 +278,15 @@ const ke = async () => `
|
|
|
278
278
|
}, Ne = /* @__PURE__ */ new Map([["Scalar", "*"], ["FormulaError.Known", Ce], ["Date", "Date"], ["JSON", "JSON"]]), Se = /* @__PURE__ */ new Map([]), te = "SheetXL";
|
|
279
279
|
ee(te, pe), ee(te, me), ee(te, Se);
|
|
280
280
|
const Ee = /* @__PURE__ */ new Map([["Promise", () => ({ async: !0 })], ["Observable", () => ({ stream: !0 })]]);
|
|
281
|
-
let
|
|
281
|
+
let W = null;
|
|
282
282
|
async function Le() {
|
|
283
|
-
if (
|
|
283
|
+
if (W) return W;
|
|
284
284
|
try {
|
|
285
|
-
return await (await import("./
|
|
285
|
+
return await (await import("./CzvqUn8m8ZE1sVnx.mjs")).initialize();
|
|
286
286
|
} catch (e) {
|
|
287
|
-
throw
|
|
287
|
+
throw W = null, e;
|
|
288
288
|
} finally {
|
|
289
|
-
|
|
289
|
+
W = null;
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
async function ve(e) {
|
|
@@ -307,10 +307,10 @@ interface Promise<T> {
|
|
|
307
307
|
*/
|
|
308
308
|
finally(onfinally?: (() => void) | undefined | null): Promise<T>;
|
|
309
309
|
}
|
|
310
|
-
`, [_]: R },
|
|
310
|
+
`, [_]: R }, X = { getSourceFile: (t, i, T, E) => s.createSourceFile(t, B[t], s.ScriptTarget.Latest, !0), fileExists: (t) => B[t] !== void 0, readFile: (t) => B[t], writeFile: (t, i) => {
|
|
311
311
|
B[t] = i;
|
|
312
312
|
}, getCurrentDirectory: () => "./", getCanonicalFileName: (t) => t, useCaseSensitiveFileNames: () => !0, getDefaultLibFileName: (t) => G, getNewLine: () => `
|
|
313
|
-
` }, O = s.createProgram([S, _], N,
|
|
313
|
+
` }, O = s.createProgram([S, _], N, X), A = O.getTypeChecker(), Y = O.getSourceFile(S), m = O.emit();
|
|
314
314
|
m.diagnostics.length > 0 && console.warn(m.diagnostics), K = B[`${d}.js`];
|
|
315
315
|
const n = (t, i, T, E) => {
|
|
316
316
|
if (t) {
|
|
@@ -356,7 +356,7 @@ interface Promise<T> {
|
|
|
356
356
|
}, o = [], L = (t, i) => {
|
|
357
357
|
o.push(i);
|
|
358
358
|
};
|
|
359
|
-
if (s.forEachChild(
|
|
359
|
+
if (s.forEachChild(Y, (t) => {
|
|
360
360
|
if (((i) => (s.getCombinedModifierFlags(i) & s.ModifierFlags.Export) !== 0)(t) && s.isFunctionDeclaration(t)) {
|
|
361
361
|
const i = {}, T = { parameters: {} }, E = t?.name?.getText();
|
|
362
362
|
try {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - 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.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - 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
7
|
const h = "text/html", b = "text/plain", L = "image/png", Tt = Object.freeze({ left: 0, top: 0 }), Ct = Object.freeze({ left: 0, top: 0, bottom: 0, right: 0 }), Mt = Object.freeze({ x: 0, y: 0, width: 0, height: 0 });
|
|
8
8
|
Object.freeze(Object.defineProperty({ __proto__: null, EmptyBounds: Mt, EmptyRect: Ct, EmptyTopLeft: Tt }, Symbol.toStringTag, { value: "Module" }));
|
|
9
|
-
const m = "column", j = "row", Rt = Object.freeze({ colIndex: 0, rowIndex: 0 }), At = Object.freeze({ colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 }), yt = (e, t) => e.colStart === t.colStart ? e.rowStart - t.rowStart : e.colStart - t.colStart, gt = (e, t) => e.rowStart === t.rowStart ? e.colStart - t.colStart : e.rowStart - t.rowStart, Ft = (e, t) => e.rowEnd === t.rowEnd ? t.colEnd - e.colEnd : t.rowEnd - e.rowEnd, Lt = (e, t) => e.colEnd === t.colEnd ? t.rowEnd - e.rowEnd : t.colEnd - e.colEnd, J = (e, t) => e.colIndex === t.colIndex ? e.rowIndex - t.rowIndex : e.colIndex - t.colIndex, H = (e, t) => e.rowIndex === t.rowIndex ? e.colIndex - t.colIndex : e.rowIndex - t.rowIndex, bt = (e = j, t = !1) => t ? e !== m ? Ft : Lt : e !== m ? gt : yt,
|
|
9
|
+
const m = "column", j = "row", Rt = Object.freeze({ colIndex: 0, rowIndex: 0 }), At = Object.freeze({ colStart: 0, rowStart: 0, colEnd: 0, rowEnd: 0 }), yt = (e, t) => e.colStart === t.colStart ? e.rowStart - t.rowStart : e.colStart - t.colStart, gt = (e, t) => e.rowStart === t.rowStart ? e.colStart - t.colStart : e.rowStart - t.rowStart, Ft = (e, t) => e.rowEnd === t.rowEnd ? t.colEnd - e.colEnd : t.rowEnd - e.rowEnd, Lt = (e, t) => e.colEnd === t.colEnd ? t.rowEnd - e.rowEnd : t.colEnd - e.colEnd, J = (e, t) => e.colIndex === t.colIndex ? e.rowIndex - t.rowIndex : e.colIndex - t.colIndex, H = (e, t) => e.rowIndex === t.rowIndex ? e.colIndex - t.colIndex : e.rowIndex - t.rowIndex, bt = (e = j, t = !1) => t ? e !== m ? Ft : Lt : e !== m ? gt : yt, K = (e, t) => e === t || !(!e || !t) && e.rowIndex === t.rowIndex && e.colIndex === t.colIndex, D = (e, t) => e === t || !(!e || !t) && e.rowStart === t.rowStart && e.rowEnd === t.rowEnd && e.colStart === t.colStart && e.colEnd === t.colEnd, $ = (e, t) => !(!e || !t || e.colStart > t.colEnd || t.colStart > e.colEnd || e.rowStart > t.rowEnd || t.rowStart > e.rowEnd), Y = (e, t) => {
|
|
10
10
|
if (e === t) return !0;
|
|
11
11
|
if (!e || !t || e.length !== t.length) return !1;
|
|
12
12
|
for (let n = 0; n < e.length; n++) if (!D(e[n], t[n])) return !1;
|
|
@@ -36,23 +36,23 @@ function X(e, t = 2, n, r = j, o) {
|
|
|
36
36
|
do {
|
|
37
37
|
const c = a.sort(bt(i ? j : m));
|
|
38
38
|
a = [], a.push(c[0]);
|
|
39
|
-
const
|
|
40
|
-
let w = 0,
|
|
41
|
-
for (let A = 1; A <
|
|
39
|
+
const u = c.length;
|
|
40
|
+
let w = 0, d = c[0], f = d.colStart, p = d.rowStart, x = d.colEnd, O = d.rowEnd;
|
|
41
|
+
for (let A = 1; A < u; A++) {
|
|
42
42
|
const g = c[A];
|
|
43
43
|
let G = !1;
|
|
44
|
-
if (G = i ?
|
|
44
|
+
if (G = i ? d && p === g.rowStart && O === g.rowEnd && x + 1 === g.colStart : d && f === g.colStart && x === g.colEnd && O + 1 === g.rowStart, G) {
|
|
45
45
|
let S = { colStart: f, rowStart: p, colEnd: i ? g.colEnd : x, rowEnd: i ? O : g.rowEnd };
|
|
46
|
-
if (
|
|
46
|
+
if (d.value !== void 0 && (S.value = d.value), n) {
|
|
47
47
|
const F = o ?? [null, null];
|
|
48
|
-
F[0] =
|
|
48
|
+
F[0] = d, F[1] = g, S = n(F, S, r);
|
|
49
49
|
}
|
|
50
50
|
if (S) {
|
|
51
|
-
a[w] = S, s = !0,
|
|
51
|
+
a[w] = S, s = !0, d = S, f = d.colStart, p = d.rowStart, x = d.colEnd, O = d.rowEnd;
|
|
52
52
|
continue;
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
|
-
a[++w] = g,
|
|
55
|
+
a[++w] = g, d = g, f = d.colStart, p = d.rowStart, x = d.colEnd, O = d.rowEnd;
|
|
56
56
|
}
|
|
57
57
|
l++, i = !i, l === 1 && (s = !0);
|
|
58
58
|
} while (l < t && s && a.length > 1);
|
|
@@ -66,16 +66,16 @@ Object.freeze(Object.defineProperty({ __proto__: null, EmptyCell: Rt, EmptyRange
|
|
|
66
66
|
const n = [];
|
|
67
67
|
let r, o, a = Number.MIN_SAFE_INTEGER, i = Number.MIN_SAFE_INTEGER;
|
|
68
68
|
return { append: (l, s, c) => {
|
|
69
|
-
let
|
|
69
|
+
let u = !0;
|
|
70
70
|
const w = c !== void 0;
|
|
71
71
|
if (w) {
|
|
72
72
|
const p = e ? e(o, c, t) : o === c ? c : void 0;
|
|
73
|
-
p === void 0 ?
|
|
73
|
+
p === void 0 ? u = !1 : c = p;
|
|
74
74
|
}
|
|
75
|
-
if (
|
|
75
|
+
if (u && s === i + 1 && l === a) return t ? r.rowEnd = s : r.colEnd = s, i = s, void (o = c);
|
|
76
76
|
r && n.push(r);
|
|
77
|
-
const
|
|
78
|
-
r = { colStart:
|
|
77
|
+
const d = t ? l : s, f = t ? s : l;
|
|
78
|
+
r = { colStart: d, rowStart: f, colEnd: d, rowEnd: f }, w && (r.value = c), a = l, i = s, o = c;
|
|
79
79
|
}, done: (l) => (r && (n.push(r), r = null), l ? X(n, 3, l === !0 ? Pt : l, t ? m : j, Ut) : n) };
|
|
80
80
|
}, createRangeComparator: bt, defaultRange: (e, t, n) => e ? n ? (n.colStart = e.colStart ?? t.colStart, n.rowStart = e.rowStart ?? t.rowStart, n.colEnd = e.colEnd ?? t.colEnd, n.rowEnd = e.rowEnd ?? t.rowEnd, n) : { colStart: e.colStart ?? t.colStart, rowStart: e.rowStart ?? t.rowStart, colEnd: e.colEnd ?? t.colEnd, rowEnd: e.rowEnd ?? t.rowEnd } : t, extendRangeToIntersectingRanges: Z, extendRangeToUnionRanges: (e, t) => {
|
|
81
81
|
if (!t || t.length === 0) return e;
|
|
@@ -93,7 +93,7 @@ Object.freeze(Object.defineProperty({ __proto__: null, EmptyCell: Rt, EmptyRange
|
|
|
93
93
|
const r = Math.max(e.colStart, t.colStart), o = Math.max(e.rowStart, t.rowStart), a = Math.min(e.colEnd, t.colEnd), i = Math.min(e.rowEnd, t.rowEnd);
|
|
94
94
|
let l = n;
|
|
95
95
|
return l ? (l.colStart = r, l.rowStart = o, l.colEnd = a, l.rowEnd = i) : l = { colStart: r, rowStart: o, colEnd: a, rowEnd: i }, l;
|
|
96
|
-
}, isCellWithinRange: (e, t) => !(!e || !t || e.rowIndex < t.rowStart || e.rowIndex > t.rowEnd || e.colIndex < t.colStart || e.colIndex > t.colEnd), isEqualCells:
|
|
96
|
+
}, isCellWithinRange: (e, t) => !(!e || !t || e.rowIndex < t.rowStart || e.rowIndex > t.rowEnd || e.colIndex < t.colStart || e.colIndex > t.colEnd), isEqualCells: K, isEqualRanges: D, isEqualRangesArrays: Y, isEqualSelectionCoords: (e, t) => e === t || !(!e || !t) && e.rangeIndex === t.rangeIndex && !!K(e.cell, t.cell) && Y(e.ranges, t.ranges), isRangeWithinRange: (e, t) => !(e.rowStart < t.rowStart || e.rowEnd > t.rowEnd || e.colStart < t.colStart || e.colEnd > t.colEnd), isRangesIntersect: $, isSingleCell: (e) => !!e && e.rowEnd === e.rowStart && e.colStart === e.colEnd, isValidRange: (e) => !(!e || typeof e.colStart != "number" || e.colStart < 0 || typeof e.colEnd != "number" || e.colEnd < e.colStart || typeof e.rowStart != "number" || e.rowStart < 0 || typeof e.rowEnd != "number" || e.rowEnd < e.rowStart), mergeRangedValues: X, rowFirstCellComparator: H, rowFirstRangeComparator: gt, sanitizeRange: (e) => e ? { colStart: e.colIndex ?? e.colStart ?? 0, rowStart: e.rowIndex ?? e.rowStart ?? 0, colEnd: e.colIndex ?? e.colEnd ?? 0, rowEnd: e.rowIndex ?? e.rowEnd ?? 0 } : null, translateRange: (e, t = -e.rowStart, n = -e.colStart, r) => r ? (r.colStart = e.colStart + n, r.rowStart = e.rowStart + t, r.colEnd = e.colEnd + n, r.rowEnd = e.rowEnd + t, r) : { colStart: e.colStart + n, rowStart: e.rowStart + t, colEnd: e.colEnd + n, rowEnd: e.rowEnd + t }, unionRanges: U, unionRangesArrays: (e, t, n) => {
|
|
97
97
|
if (!e || e.length === 0) return null;
|
|
98
98
|
if (e.length === 1 && !t) return e[0];
|
|
99
99
|
let r = e[0];
|
|
@@ -106,7 +106,9 @@ function Nt(e) {
|
|
|
106
106
|
return !!t && typeof t == "object";
|
|
107
107
|
}(e) && !function(t) {
|
|
108
108
|
const n = Object.prototype.toString.call(t);
|
|
109
|
-
return n === "[object RegExp]" || n === "[object Date]" ||
|
|
109
|
+
return n === "[object RegExp]" || n === "[object Date]" || function(r) {
|
|
110
|
+
return r.$$typeof === kt;
|
|
111
|
+
}(t);
|
|
110
112
|
}(e);
|
|
111
113
|
}
|
|
112
114
|
function I(e, t) {
|
|
@@ -119,10 +121,11 @@ function Bt(e, t, n) {
|
|
|
119
121
|
});
|
|
120
122
|
}
|
|
121
123
|
function Q(e) {
|
|
122
|
-
return Object.keys(e).concat((t
|
|
123
|
-
return Object.
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
return Object.keys(e).concat(function(t) {
|
|
125
|
+
return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(t).filter(function(n) {
|
|
126
|
+
return Object.propertyIsEnumerable.call(t, n);
|
|
127
|
+
}) : [];
|
|
128
|
+
}(e));
|
|
126
129
|
}
|
|
127
130
|
function tt(e, t) {
|
|
128
131
|
try {
|
|
@@ -139,11 +142,12 @@ function E(e, t, n) {
|
|
|
139
142
|
return i.isMergeableObject(o) && Q(o).forEach(function(s) {
|
|
140
143
|
l[s] = I(o[s], i);
|
|
141
144
|
}), Q(a).forEach(function(s) {
|
|
142
|
-
|
|
143
|
-
|
|
145
|
+
(function(c, u) {
|
|
146
|
+
return tt(c, u) && !(Object.hasOwnProperty.call(c, u) && Object.propertyIsEnumerable.call(c, u));
|
|
147
|
+
})(o, s) || (tt(o, s) && i.isMergeableObject(a[s]) ? l[s] = function(c, u) {
|
|
144
148
|
if (!u.customMerge) return E;
|
|
145
|
-
const
|
|
146
|
-
return typeof
|
|
149
|
+
const w = u.customMerge(c);
|
|
150
|
+
return typeof w == "function" ? w : E;
|
|
147
151
|
}(s, i)(o[s], a[s], i) : l[s] = I(a[s], i));
|
|
148
152
|
}), l;
|
|
149
153
|
}(e, t, n) : I(t, n);
|
|
@@ -195,14 +199,14 @@ const it = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeEl
|
|
|
195
199
|
}), debounce: function(e, t = 300, n = !1) {
|
|
196
200
|
let r, o, a, i, l = 0;
|
|
197
201
|
function s() {
|
|
198
|
-
let
|
|
199
|
-
|
|
202
|
+
let u = Date.now() - l;
|
|
203
|
+
u < t && u >= 0 ? r = setTimeout(s, t - u) : (r = null, n || (i = e.apply(a, o), a = o = null));
|
|
200
204
|
}
|
|
201
205
|
t == null && (t = 100);
|
|
202
206
|
const c = function() {
|
|
203
207
|
a = globalThis, o = arguments, l = Date.now();
|
|
204
|
-
var
|
|
205
|
-
return r || (r = setTimeout(s, t)),
|
|
208
|
+
var u = n && !r;
|
|
209
|
+
return r || (r = setTimeout(s, t)), u && (i = e.apply(a, o), a = o = null), i;
|
|
206
210
|
};
|
|
207
211
|
return c.clear = function() {
|
|
208
212
|
r && (clearTimeout(r), r = null);
|
|
@@ -504,17 +508,19 @@ Object.freeze(Object.defineProperty({ __proto__: null, DATA_URL_PNG_PREFIX: Ot,
|
|
|
504
508
|
const a = t?.properties, i = t?.arrayType ?? !1;
|
|
505
509
|
let l = o;
|
|
506
510
|
if (t && t.merge && l && r) l = t.merge(l, r, n);
|
|
507
|
-
else if (!i
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
511
|
+
else if (!i) {
|
|
512
|
+
if (a) {
|
|
513
|
+
const s = Object.keys({ ...o, ...r });
|
|
514
|
+
l = null;
|
|
515
|
+
for (let c = 0; c < s.length; c++) {
|
|
516
|
+
const u = s[c];
|
|
517
|
+
let w, d = o[u];
|
|
518
|
+
if (d !== void 0) {
|
|
519
|
+
const f = a[u];
|
|
520
|
+
w = f ? (0, ct.resolveTypedUpdates)(d, f, n, r?.[u]) : d;
|
|
521
|
+
} else w = r?.[u];
|
|
522
|
+
w != null && (l = l ?? {}, l[u] = w);
|
|
523
|
+
}
|
|
518
524
|
}
|
|
519
525
|
}
|
|
520
526
|
return l;
|
|
@@ -688,29 +694,29 @@ class wt {
|
|
|
688
694
|
await N(), o && a.length === 0 && (a.push(new ClipboardItem({ [v]: new Blob([o], { type: v }) })), a.push(new ClipboardItem({ [h]: new Blob([ft(o)], { type: h }) })));
|
|
689
695
|
for (let l = 0; l < Math.min(1, a.length); l++) {
|
|
690
696
|
const s = a[l];
|
|
691
|
-
let c = s.types.indexOf(h),
|
|
697
|
+
let c = s.types.indexOf(h), u = null;
|
|
692
698
|
if (c !== -1) {
|
|
693
699
|
const f = await s.getType(h);
|
|
694
|
-
|
|
700
|
+
u = await W(f), u && (u = Wt(o, u));
|
|
695
701
|
}
|
|
696
|
-
if (!
|
|
702
|
+
if (!u && s.types.includes(b)) {
|
|
697
703
|
const f = await s.getType(b);
|
|
698
704
|
if (f) {
|
|
699
705
|
let p = null;
|
|
700
|
-
typeof f == "string" ? (console.warn("text as string", f), p = f) : p = await W(f), p && (
|
|
706
|
+
typeof f == "string" ? (console.warn("text as string", f), p = f) : p = await W(f), p && (u = `<div ${C}="${o}">${p}</div>`);
|
|
701
707
|
}
|
|
702
708
|
}
|
|
703
|
-
if (!
|
|
709
|
+
if (!u && s.types.includes(L)) {
|
|
704
710
|
const f = await s.getType(L), p = xt(await f.arrayBuffer());
|
|
705
|
-
|
|
711
|
+
u = `<div ${C}="${o}"><img src="${Ot + p}"/></div>`;
|
|
706
712
|
}
|
|
707
|
-
!
|
|
708
|
-
const w = new Blob([
|
|
713
|
+
!u && o && (u = ft(o));
|
|
714
|
+
const w = new Blob([u ?? ""], { type: h }), d = {};
|
|
709
715
|
for (let f = 0; f < s.types.length; f++) {
|
|
710
716
|
const p = s.types[f];
|
|
711
|
-
|
|
717
|
+
d[p] = f === c ? w : s.getType(p);
|
|
712
718
|
}
|
|
713
|
-
|
|
719
|
+
u && c === -1 && (d[h] = w), o && (d[v] = new Blob([o], { type: v })), r.push(new ClipboardItem(d));
|
|
714
720
|
}
|
|
715
721
|
try {
|
|
716
722
|
r && r.length !== 0 ? await this._nativeClipboard.write(r) : await (async (l) => {
|
|
@@ -809,12 +815,12 @@ const Vt = Object.freeze({ compileTypescript: async function(e) {
|
|
|
809
815
|
if (q && $t.deepEqual(q, e)) return ht;
|
|
810
816
|
const t = await async function() {
|
|
811
817
|
if (M) return M;
|
|
812
|
-
const { TypeScriptCompiler: r } = await import("./
|
|
818
|
+
const { TypeScriptCompiler: r } = await import("./DIuEZ8oh1MzdXn0j.mjs");
|
|
813
819
|
return M = new r(), M;
|
|
814
820
|
}(), n = await t.compileModule(e);
|
|
815
821
|
return ht = n, q = e, n;
|
|
816
822
|
} });
|
|
817
823
|
export {
|
|
818
824
|
Vt as S,
|
|
819
|
-
$t as
|
|
825
|
+
$t as e
|
|
820
826
|
};
|
package/browser/esm/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { S as t } from "./
|
|
1
|
+
import { S as t } from "./ZcaR45N07z-TrTku.mjs";
|
|
2
2
|
/**
|
|
3
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
3
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.12
|
|
4
4
|
*
|
|
5
5
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
6
6
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Name: @sheetxl/primitives
|
|
2
|
-
Version: 0.4.
|
|
2
|
+
Version: 0.4.12
|
|
3
3
|
License: SEE LICENSE IN <LICENSE>
|
|
4
4
|
Private: false
|
|
5
5
|
Description: Primitives - Base types for SheetXL functions.
|
|
@@ -21,7 +21,7 @@ https://www.sheetxl.com/licensing-pricing
|
|
|
21
21
|
---
|
|
22
22
|
|
|
23
23
|
Name: @sheetxl/utils
|
|
24
|
-
Version: 0.4.
|
|
24
|
+
Version: 0.4.12
|
|
25
25
|
License: SEE LICENSE IN <LICENSE>
|
|
26
26
|
Private: false
|
|
27
27
|
Description: Utils - Utilities used by most SheetXL components.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { e as he } from "./index.mjs";
|
|
2
2
|
/**
|
|
3
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
3
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.12
|
|
4
4
|
*
|
|
5
5
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
6
6
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -233,7 +233,7 @@ async function Te(e, a, C = "/script.js", p = "__SHEETXL") {
|
|
|
233
233
|
b = d, N = S;
|
|
234
234
|
});
|
|
235
235
|
try {
|
|
236
|
-
const { initialize: d } = await import("./
|
|
236
|
+
const { initialize: d } = await import("./CdT9QaMEFu8pV7pa.mjs");
|
|
237
237
|
return I = await d(), b(), I;
|
|
238
238
|
} catch (d) {
|
|
239
239
|
throw console.error("Failed to import or initialize esbuild:", d), H = null, N(d), d;
|
|
@@ -282,7 +282,7 @@ let W = null;
|
|
|
282
282
|
async function Le() {
|
|
283
283
|
if (W) return W;
|
|
284
284
|
try {
|
|
285
|
-
return await (await import("./
|
|
285
|
+
return await (await import("./DGwJ9qS_Md5reXWO.mjs")).initialize();
|
|
286
286
|
} catch (e) {
|
|
287
287
|
throw W = null, e;
|
|
288
288
|
} finally {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.4.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - 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.
|
|
@@ -10,7 +10,7 @@ class o {
|
|
|
10
10
|
}
|
|
11
11
|
async getWorkerWrapper() {
|
|
12
12
|
if (this.workerWrapper) return this.workerWrapper;
|
|
13
|
-
const { createCompilerWorker: r } = await import("./
|
|
13
|
+
const { createCompilerWorker: r } = await import("./CFNeK9dgiSBGzlf2.mjs");
|
|
14
14
|
return this.workerWrapper = await r(), this.workerWrapper;
|
|
15
15
|
}
|
|
16
16
|
async compileModule(r) {
|