@sheetxl/scripting 0.7.6 → 0.7.8
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/LICENSE.md +1 -1
- package/README.md +2 -2
- package/browser/cjs/{p_nv7_x7esy4lWPH.cjs → 5Q37vr8T0Xc7E4lD.cjs} +3 -3
- package/browser/cjs/{BHP1BlRoa-6TNjiB.cjs → BhoRfqgvp5DsyB2s.cjs} +1 -1
- package/browser/cjs/{DkOTSThyA5u-_ub9.cjs → DUx52P8-6kfUQX3C.cjs} +2 -2
- package/browser/cjs/{zgssxHJ3y5-QRGBL.cjs → TUuKyQul5oKkSwib.cjs} +21 -21
- package/browser/cjs/index.cjs +2 -2
- package/browser/cjs/{ClckkFntgsqMKeYG.cjs → t-zVKL1w3QFVmFtW.cjs} +1 -1
- package/browser/esm/{CdYur831w0feAFEx.mjs → Bi2hx3s7L3e_w3YZ.mjs} +3 -3
- package/browser/esm/{Tl3UglWc6KduHjfn.mjs → D8_3gOPus0W3NA-P.mjs} +21 -21
- package/browser/esm/{C0113WDySNJZE9ry.mjs → DEdx0bIjt65XZiwS.mjs} +1 -1
- package/{node/esm/BYVdasODBnhC-lx2.mjs → browser/esm/DY6nBMNGZo3OkzZU.mjs} +2 -2
- package/browser/esm/{ClVFYkRxs47p7BBT.mjs → K3HL4Ss6WGTAn3wh.mjs} +1 -1
- package/browser/esm/index.mjs +2 -2
- package/{browser/esm/BTRF2gIszLyzwiU7.mjs → node/esm/AuT3ZBeWGof0IJJ8.mjs} +2 -2
- package/node/esm/{Dvs1M5VqWGsB57ia.mjs → BowpYLDhDt6ZeLFU.mjs} +21 -21
- package/node/esm/{DkcmG4zuw2XYLmhc.mjs → CMQpEkzUkzTbAbHY.mjs} +3 -3
- package/node/esm/{M6GmlkBuxsC7TAwB.mjs → CzKYxVNI0Mg3IfC-.mjs} +1 -1
- package/node/esm/{kuonMEfk3Bh02Lnf.mjs → Dc6drpRJe4EdWdbT.mjs} +1 -1
- package/node/esm/index.mjs +2 -2
- package/package.json +3 -3
package/LICENSE.md
CHANGED
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
# SheetXL — the api-first spreadsheet
|
|
2
|
+
|
|
1
3
|
<p align="center">
|
|
2
4
|
<img src="./static/img/social-light.png#gh-light-mode-only">
|
|
3
5
|
<img src="./static/img/social-dark.png#gh-dark-mode-only">
|
|
4
6
|
</p>
|
|
5
7
|
|
|
6
|
-
# SheetXL — the api-first spreadsheet
|
|
7
|
-
|
|
8
8
|
[](https://discord.gg/NTKdwUgK9p)
|
|
9
9
|
[](https://www.npmjs.com/package/@sheetxl/studio-mui)
|
|
10
10
|
[](https://www.npmjs.com/package/@sheetxl/studio-mui)
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.8
|
|
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
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("@sheetxl/primitives"),ae=require("@sheetxl/utils");let L=null,I=null;const oe={compilerOptions:{target:"esnext"}};async function le(h,x,b="/script.js",w="__SHEETXL"){try{const K=await(async function(){if(L)return L;if(I){if(await I,!L)throw new Error("ESBuild initialization promise resolved, but instance is not available.");return L}let p,T;I=new Promise((a,S)=>{p=a,T=S});try{const{initialize:a}=await Promise.resolve().then(()=>require("./
|
|
6
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const $=require("@sheetxl/primitives"),ae=require("@sheetxl/utils");let L=null,I=null;const oe={compilerOptions:{target:"esnext"}};async function le(h,x,b="/script.js",w="__SHEETXL"){try{const K=await(async function(){if(L)return L;if(I){if(await I,!L)throw new Error("ESBuild initialization promise resolved, but instance is not available.");return L}let p,T;I=new Promise((a,S)=>{p=a,T=S});try{const{initialize:a}=await Promise.resolve().then(()=>require("./BhoRfqgvp5DsyB2s.cjs"));return L=await a(),p(),L}catch(a){throw console.error("Failed to import or initialize esbuild:",a),I=null,T(a),a}})(),j="@sheetxl/primitives",n=`
|
|
7
7
|
export const FormulaContext = globalThis.${w}?.FormulaContext;
|
|
8
8
|
export const ScalarType = globalThis.${w}?.ScalarType;
|
|
9
9
|
export const Observable = globalThis.${w}?.Observable;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
interface FirstTest {
|
|
16
16
|
isTrue?: boolean;
|
|
17
17
|
}
|
|
18
|
-
`,Y=new Map([["IReferenceRange","r"],["IRange","l"]]),Z=new Map([["IWorkbook","workbook"],["ISheet","sheet"],["ICellRanges","ranges"],["ICellRange","range"],["IFormulaContext","context"]]),V=(h,x)=>{Array.from(x.keys()).forEach(b=>{const w=x.get(b);x.set(`${h}.${b}`,w)})},ce=new Map([["Scalar","*"],["FormulaError.Known",$.ScalarType.Error],["Date","Date"],["JSON","JSON"]]),de=new Map([]),X="SheetXL";V(X,Y),V(X,Z),V(X,de);const ue=new Map([["Promise",()=>({async:!0})],["Observable",()=>({stream:!0})]]);let q=null;async function pe(){if(q)return q;try{return await(await Promise.resolve().then(()=>require("./
|
|
18
|
+
`,Y=new Map([["IReferenceRange","r"],["IRange","l"]]),Z=new Map([["IWorkbook","workbook"],["ISheet","sheet"],["ICellRanges","ranges"],["ICellRange","range"],["IFormulaContext","context"]]),V=(h,x)=>{Array.from(x.keys()).forEach(b=>{const w=x.get(b);x.set(`${h}.${b}`,w)})},ce=new Map([["Scalar","*"],["FormulaError.Known",$.ScalarType.Error],["Date","Date"],["JSON","JSON"]]),de=new Map([]),X="SheetXL";V(X,Y),V(X,Z),V(X,de);const ue=new Map([["Promise",()=>({async:!0})],["Observable",()=>({stream:!0})]]);let q=null;async function pe(){if(q)return q;try{return await(await Promise.resolve().then(()=>require("./t-zVKL1w3QFVmFtW.cjs"))).initialize()}catch(h){throw q=null,h}finally{q=null}}exports.compileModule=async function(h){const x=h?.source??null;if(!x)return null;const b=(h.disableBundle||h.declarationsOnly)??!1,w=[se(),pe()],K=await Promise.all(w),j=K[0],n=K[1];let F="",f=null;const p=[],T={allowJs:!0,declaration:!1,sourceMap:!1,inlineSourceMap:!1,inlineSources:!1,isolatedModules:!0,preserveConstEnums:!1,module:99,noResolve:!0,emitDeclarationOnly:!1,target:n.ScriptTarget.ES2020},a="script",S=`${a}.ts`,_="lib.d.ts",H="global.d.ts",M={[S]:x,[_]:`
|
|
19
19
|
/**
|
|
20
20
|
* Represents the completion of an asynchronous operation
|
|
21
21
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.8
|
|
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,6 +1,6 @@
|
|
|
1
1
|
"use strict";/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.8
|
|
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
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.TypeScriptCompiler=class{constructor(r={}){this.workerWrapper=null}async getWorkerWrapper(){if(this.workerWrapper)return this.workerWrapper;const{createCompilerWorker:r}=await Promise.resolve().then(()=>require("./
|
|
6
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.TypeScriptCompiler=class{constructor(r={}){this.workerWrapper=null}async getWorkerWrapper(){if(this.workerWrapper)return this.workerWrapper;const{createCompilerWorker:r}=await Promise.resolve().then(()=>require("./TUuKyQul5oKkSwib.cjs"));return this.workerWrapper=await r(),this.workerWrapper}async compileModule(r){try{return(await this.getWorkerWrapper()).execute(r)}catch(e){throw console.error("Failed to compile using worker:",e),e}}terminate(){this.workerWrapper?.terminate(),this.workerWrapper=null}};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.8
|
|
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
|
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});let c=class{constructor(e){this._worker=null,this._nextId=1,this._pendingRequests=new Map,this._workerFactory=e}start(){if(typeof Worker>"u")throw new Error("Web Workers are not supported in this environment.");return this._worker||(this._worker=this._workerFactory(),this._worker.onmessage=e=>{const{id:n,result:t,error:r}=e.data,o=this._pendingRequests.get(n);if(o)if(this._pendingRequests.delete(n),r){const a=new Error(r.message);a.stack=r.stack,r.cause&&(a.cause=r.cause),o.reject(a)}else o.resolve(t)},this._worker.onerror=e=>{console.error("Worker error:",e),this._pendingRequests.forEach(n=>{n.reject(new Error(`Worker failed: ${e.message}`))}),this._pendingRequests.clear(),this._worker=null}),Promise.resolve()}execute(e){if(!this._worker)throw new Error("Worker is not initialized. Call start() first.");const n=this._nextId++;return new Promise((t,r)=>{this._pendingRequests.set(n,{resolve:t,reject:r}),this._worker.postMessage({id:n,params:e})})}terminate(){this._worker&&(this._worker.terminate(),this._worker=null)}};class u{constructor(n){this._onExecute=n}execute(n){return this._onExecute(n)}start(){return Promise.resolve()}terminate(){}}const s=`/**
|
|
7
|
-
* @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.7.
|
|
7
|
+
* @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.7.8
|
|
8
8
|
*
|
|
9
9
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
10
10
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -223,7 +223,7 @@ var T;
|
|
|
223
223
|
return r = typeof e == "string" ? rt.get(e) : ot.get(e), r || (r = T.Unknown), new r(t, n);
|
|
224
224
|
}, T.getBuiltInById = (e) => Te.get(e) || xt;
|
|
225
225
|
/**
|
|
226
|
-
* @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.7.
|
|
226
|
+
* @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.7.8
|
|
227
227
|
*
|
|
228
228
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
229
229
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -406,7 +406,7 @@ const Ft = Object.freeze([]), Dt = Object.freeze({}), ze = (e) => e, de = () =>
|
|
|
406
406
|
ut(e[i], t?.[i], n) === null && (o = !0, delete e[i]);
|
|
407
407
|
}
|
|
408
408
|
return o && Object.keys(e).length === 0 ? null : void 0;
|
|
409
|
-
}, Ke = typeof performance == "object" && typeof performance.now == "function" ? () => performance.now() : () => Date.now(), Ve = (e) => e == null,
|
|
409
|
+
}, Ke = typeof performance == "object" && typeof performance.now == "function" ? () => performance.now() : () => Date.now(), Ve = (e) => e == null, Ge = (e, t) => !(t.left > e.right || t.right < e.left || t.top > e.bottom || t.bottom < e.top), qe = !(typeof window > "u" || !window.document || !window.document.createElement), k = { Windows: "windows", MacOS: "macos", IOS: "ios", Linux: "linux", Android: "android", Safari: "safari", Firefox: "firefox", Node: "node", Unknown: "unknown" }, oe = () => {
|
|
410
410
|
if (dt()) return k.Node;
|
|
411
411
|
const e = globalThis.navigator !== void 0 && globalThis.navigator.userAgent ? globalThis.navigator.userAgent.toLowerCase() : "";
|
|
412
412
|
return e ? /(win32|win64|windows|wince)/i.test(e) ? k.Windows : /(macintosh|macintel|macppc|mac68k|macos)/i.test(e) ? k.MacOS : /(iphone|ipad|ipod)/i.test(e) ? k.IOS : /android/.test(e) ? k.Android : /linux/.test(e) ? k.Linux : /^((?!chrome|android|).)*safari/i.test(e) ? k.Safari : /^((?!chrome|android|Seamonkey).)*firefox/i.test(e) ? k.Firefox : k.Unknown : k.Unknown;
|
|
@@ -422,7 +422,7 @@ const We = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeEl
|
|
|
422
422
|
return Number.isFinite(t) ? t : 0;
|
|
423
423
|
}, camelToPrettyCase: (e) => e.length === 1 ? e.toUpperCase() : e.replace(/([A-Z])/g, " $1").replace(/^./, function(t) {
|
|
424
424
|
return t.toUpperCase();
|
|
425
|
-
}).trim(), canUseDOM:
|
|
425
|
+
}).trim(), canUseDOM: qe, cancelTimeout: (e) => {
|
|
426
426
|
cancelAnimationFrame(e.id);
|
|
427
427
|
}, castToString: (e) => e == null || e === void 0 ? "" : typeof e != "string" ? "" + e : e, cloneObject: (e) => Ve(e) ? e : JSON.parse(JSON.stringify(e)), consoleWithNoSource: (...e) => new Promise((t) => {
|
|
428
428
|
setTimeout(() => {
|
|
@@ -537,7 +537,7 @@ const We = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeEl
|
|
|
537
537
|
}, isNode: dt, isNullOrUndefined: Ve, isNumeric: (e) => {
|
|
538
538
|
const t = 1 * e;
|
|
539
539
|
return Number.isFinite(t) && typeof t == "number";
|
|
540
|
-
}, isObject: ne, isPromiseLike: (e) => !!e && typeof e.then == "function", isRectInsideRect: (e, t) => e.top >= t.top && e.bottom <= t.bottom && e.left >= t.left && e.right <= t.right, isRectIntersect:
|
|
540
|
+
}, isObject: ne, isPromiseLike: (e) => !!e && typeof e.then == "function", isRectInsideRect: (e, t) => e.top >= t.top && e.bottom <= t.bottom && e.left >= t.left && e.right <= t.right, isRectIntersect: Ge, mergeContentful: (...e) => {
|
|
541
541
|
const t = e.length;
|
|
542
542
|
if (t > 0 && e[t - 1] !== void 0 && !ne(e[t - 1])) return e[t - 1];
|
|
543
543
|
let n = e[0] || {};
|
|
@@ -550,7 +550,7 @@ const We = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeEl
|
|
|
550
550
|
e();
|
|
551
551
|
});
|
|
552
552
|
}, openFileDialog: (e = "*.*") => new Promise((t, n) => {
|
|
553
|
-
if (!
|
|
553
|
+
if (!qe) return void n("Unable to open dialog with no dom.");
|
|
554
554
|
const r = document.createElement("input");
|
|
555
555
|
r.type = "file", r.accept = e;
|
|
556
556
|
let o = null, a = !1;
|
|
@@ -604,7 +604,7 @@ const We = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeEl
|
|
|
604
604
|
return { ip: Math.trunc(e), fp: o, ipLength: Math.ceil(Math.log10(n + 1)), fpLength: a };
|
|
605
605
|
}, subtractRect: (e, t, n = !1) => {
|
|
606
606
|
if (!t) return [e];
|
|
607
|
-
if (!
|
|
607
|
+
if (!Ge(e, t)) return [];
|
|
608
608
|
const r = [];
|
|
609
609
|
let o = e;
|
|
610
610
|
const a = () => {
|
|
@@ -1042,9 +1042,9 @@ class tt {
|
|
|
1042
1042
|
}
|
|
1043
1043
|
var Ee;
|
|
1044
1044
|
(Ee = tt || (tt = {})).ErrorMessages = mt, Ee.Global = new Ee();
|
|
1045
|
-
const
|
|
1045
|
+
const Gt = "__SHEETXL";
|
|
1046
1046
|
let ee = null, le = null;
|
|
1047
|
-
async function
|
|
1047
|
+
async function qt() {
|
|
1048
1048
|
if (ee)
|
|
1049
1049
|
return ee;
|
|
1050
1050
|
if (le) {
|
|
@@ -1071,9 +1071,9 @@ const Wt = {
|
|
|
1071
1071
|
target: "esnext"
|
|
1072
1072
|
}
|
|
1073
1073
|
};
|
|
1074
|
-
async function Yt(e, t, n = "/script.js", r =
|
|
1074
|
+
async function Yt(e, t, n = "/script.js", r = Gt) {
|
|
1075
1075
|
try {
|
|
1076
|
-
const o = await
|
|
1076
|
+
const o = await qt(), a = "@sheetxl/primitives", i = \`
|
|
1077
1077
|
export const FormulaContext = globalThis.\${r}?.FormulaContext;
|
|
1078
1078
|
export const ScalarType = globalThis.\${r}?.ScalarType;
|
|
1079
1079
|
export const Observable = globalThis.\${r}?.Observable;
|
|
@@ -1280,8 +1280,8 @@ async function nn(e) {
|
|
|
1280
1280
|
const M = s.typeName?.getText?.() ?? null, K = yt.get(M);
|
|
1281
1281
|
let V = !1;
|
|
1282
1282
|
K && (m.range = K, V = !0);
|
|
1283
|
-
const
|
|
1284
|
-
if (
|
|
1283
|
+
const G = Zt.get(M);
|
|
1284
|
+
if (G && (m.scalar = G), G !== void 0 && (V = !0), P) {
|
|
1285
1285
|
const R = gt.get(M);
|
|
1286
1286
|
if (R)
|
|
1287
1287
|
return R;
|
|
@@ -1328,8 +1328,8 @@ async function nn(e) {
|
|
|
1328
1328
|
}
|
|
1329
1329
|
const V = {};
|
|
1330
1330
|
c(s.type, V, m, !1), m.returnType = V;
|
|
1331
|
-
const
|
|
1332
|
-
fe(s) && (
|
|
1331
|
+
const G = {};
|
|
1332
|
+
fe(s) && (G.default = !0, u = P), Object.keys(G).length > 0 && (m.behavior = G), m.parameters = [];
|
|
1333
1333
|
const H = /* @__PURE__ */ new Map();
|
|
1334
1334
|
for (let R = 0; R < s.parameters.length; R++) {
|
|
1335
1335
|
const b = s.parameters[R], N = {};
|
|
@@ -1355,8 +1355,8 @@ async function nn(e) {
|
|
|
1355
1355
|
b.dotDotDotToken && (N.rest = !0), m.parameters.push(N);
|
|
1356
1356
|
const C = { description: "" };
|
|
1357
1357
|
L.parameters[N.name] = C;
|
|
1358
|
-
const
|
|
1359
|
-
|
|
1358
|
+
const q = I.getSymbolAtLocation(b.name).getDocumentationComment(I);
|
|
1359
|
+
q && q.length > 0 && q[0].text && (C.description = q[0].text), v !== void 0 && (C.defaultValue = v), H.set(N.name, N);
|
|
1360
1360
|
}
|
|
1361
1361
|
if (s.jsDoc && s.jsDoc.length > 0) {
|
|
1362
1362
|
const R = s.jsDoc;
|
|
@@ -1369,8 +1369,8 @@ async function nn(e) {
|
|
|
1369
1369
|
if (!v) continue;
|
|
1370
1370
|
v = v.toLowerCase();
|
|
1371
1371
|
let C = z.comment;
|
|
1372
|
-
const
|
|
1373
|
-
if (!(typeof C != "string" && !
|
|
1372
|
+
const q = v === "hidden";
|
|
1373
|
+
if (!(typeof C != "string" && !q) && (typeof C == "string" && (C = C.replace(/[\\r\\n]+/g, "\\\\n").trim()), !(!q && C && (C = C.split(/\\\\n/)[0], !C || C.length === 0)))) {
|
|
1374
1374
|
if (C && typeof C == "string") {
|
|
1375
1375
|
const O = /\\{@link(code|plain)?\\s+([^}|]+)(?:\\s*\\|\\s*([^}]+))?\\}/g;
|
|
1376
1376
|
let F, Z = C, te = [];
|
|
@@ -1505,4 +1505,4 @@ var ln = /* @__PURE__ */ Object.freeze({
|
|
|
1505
1505
|
__proto__: null,
|
|
1506
1506
|
initialize: an
|
|
1507
1507
|
});
|
|
1508
|
-
`,i=typeof self<"u"&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",s],{type:"text/javascript;charset=utf-8"});function d(e){let n;try{if(n=i&&(self.URL||self.webkitURL).createObjectURL(i),!n)throw"";const t=new Worker(n,{type:"module",name:e?.name});return t.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(n)}),t}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(s),{type:"module",name:e?.name})}}const l=async()=>{const{compileModule:e}=await Promise.resolve().then(()=>require("./
|
|
1508
|
+
`,i=typeof self<"u"&&self.Blob&&new Blob(["URL.revokeObjectURL(import.meta.url);",s],{type:"text/javascript;charset=utf-8"});function d(e){let n;try{if(n=i&&(self.URL||self.webkitURL).createObjectURL(i),!n)throw"";const t=new Worker(n,{type:"module",name:e?.name});return t.addEventListener("error",()=>{(self.URL||self.webkitURL).revokeObjectURL(n)}),t}catch{return new Worker("data:text/javascript;charset=utf-8,"+encodeURIComponent(s),{type:"module",name:e?.name})}}const l=async()=>{const{compileModule:e}=await Promise.resolve().then(()=>require("./5Q37vr8T0Xc7E4lD.cjs")),n=new u(t=>e(t));return await n.start(),n};exports.createCompilerWorker=async function(){if(typeof process<"u"&&process.versions?.node&&typeof Worker>"u")return await l();if(typeof Worker<"u"){const e=new c(()=>new d);try{return await e.start(),e}catch(n){console.error("Failed to start TypescriptCompiler worker reverting to fallback:",n)}}return await l()};
|
package/browser/cjs/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.8
|
|
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
|
-
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@sheetxl/utils");let l=null,n=null,t=null;const c=Object.freeze({compileTypescript:async function(e){if(!(e?.source??null))return null;if(n&&u.CommonUtils.deepEqual(n,e))return l;const i=await(async function(){if(t)return t;const{TypeScriptCompiler:o}=await Promise.resolve().then(()=>require("./
|
|
6
|
+
*/Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@sheetxl/utils");let l=null,n=null,t=null;const c=Object.freeze({compileTypescript:async function(e){if(!(e?.source??null))return null;if(n&&u.CommonUtils.deepEqual(n,e))return l;const i=await(async function(){if(t)return t;const{TypeScriptCompiler:o}=await Promise.resolve().then(()=>require("./DUx52P8-6kfUQX3C.cjs"));return t=new o,t})(),r=await i.compileModule(e);return l=r,n=e,r}});exports.ScriptingUtils=c;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.8
|
|
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,7 +1,7 @@
|
|
|
1
1
|
import { ScalarType as v } from "@sheetxl/primitives";
|
|
2
2
|
import { CommonUtils as ae } from "@sheetxl/utils";
|
|
3
3
|
/**
|
|
4
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.
|
|
4
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.8
|
|
5
5
|
*
|
|
6
6
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
7
7
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -21,7 +21,7 @@ async function le(h, x, S = "/script.js", w = "__SHEETXL") {
|
|
|
21
21
|
p = a, b = T;
|
|
22
22
|
});
|
|
23
23
|
try {
|
|
24
|
-
const { initialize: a } = await import("./
|
|
24
|
+
const { initialize: a } = await import("./K3HL4Ss6WGTAn3wh.mjs");
|
|
25
25
|
return L = await a(), p(), L;
|
|
26
26
|
} catch (a) {
|
|
27
27
|
throw console.error("Failed to import or initialize esbuild:", a), P = null, b(a), a;
|
|
@@ -70,7 +70,7 @@ let B = null;
|
|
|
70
70
|
async function pe() {
|
|
71
71
|
if (B) return B;
|
|
72
72
|
try {
|
|
73
|
-
return await (await import("./
|
|
73
|
+
return await (await import("./DEdx0bIjt65XZiwS.mjs")).initialize();
|
|
74
74
|
} catch (h) {
|
|
75
75
|
throw B = null, h;
|
|
76
76
|
} finally {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.8
|
|
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.
|
|
@@ -47,7 +47,7 @@ class u {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
const s = `/**
|
|
50
|
-
* @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.7.
|
|
50
|
+
* @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.7.8
|
|
51
51
|
*
|
|
52
52
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
53
53
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -266,7 +266,7 @@ var T;
|
|
|
266
266
|
return r = typeof e == "string" ? rt.get(e) : ot.get(e), r || (r = T.Unknown), new r(t, n);
|
|
267
267
|
}, T.getBuiltInById = (e) => Te.get(e) || xt;
|
|
268
268
|
/**
|
|
269
|
-
* @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.7.
|
|
269
|
+
* @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.7.8
|
|
270
270
|
*
|
|
271
271
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
272
272
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -449,7 +449,7 @@ const Ft = Object.freeze([]), Dt = Object.freeze({}), ze = (e) => e, de = () =>
|
|
|
449
449
|
ut(e[i], t?.[i], n) === null && (o = !0, delete e[i]);
|
|
450
450
|
}
|
|
451
451
|
return o && Object.keys(e).length === 0 ? null : void 0;
|
|
452
|
-
}, Ke = typeof performance == "object" && typeof performance.now == "function" ? () => performance.now() : () => Date.now(), Ve = (e) => e == null,
|
|
452
|
+
}, Ke = typeof performance == "object" && typeof performance.now == "function" ? () => performance.now() : () => Date.now(), Ve = (e) => e == null, Ge = (e, t) => !(t.left > e.right || t.right < e.left || t.top > e.bottom || t.bottom < e.top), qe = !(typeof window > "u" || !window.document || !window.document.createElement), k = { Windows: "windows", MacOS: "macos", IOS: "ios", Linux: "linux", Android: "android", Safari: "safari", Firefox: "firefox", Node: "node", Unknown: "unknown" }, oe = () => {
|
|
453
453
|
if (dt()) return k.Node;
|
|
454
454
|
const e = globalThis.navigator !== void 0 && globalThis.navigator.userAgent ? globalThis.navigator.userAgent.toLowerCase() : "";
|
|
455
455
|
return e ? /(win32|win64|windows|wince)/i.test(e) ? k.Windows : /(macintosh|macintel|macppc|mac68k|macos)/i.test(e) ? k.MacOS : /(iphone|ipad|ipod)/i.test(e) ? k.IOS : /android/.test(e) ? k.Android : /linux/.test(e) ? k.Linux : /^((?!chrome|android|).)*safari/i.test(e) ? k.Safari : /^((?!chrome|android|Seamonkey).)*firefox/i.test(e) ? k.Firefox : k.Unknown : k.Unknown;
|
|
@@ -465,7 +465,7 @@ const We = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeEl
|
|
|
465
465
|
return Number.isFinite(t) ? t : 0;
|
|
466
466
|
}, camelToPrettyCase: (e) => e.length === 1 ? e.toUpperCase() : e.replace(/([A-Z])/g, " $1").replace(/^./, function(t) {
|
|
467
467
|
return t.toUpperCase();
|
|
468
|
-
}).trim(), canUseDOM:
|
|
468
|
+
}).trim(), canUseDOM: qe, cancelTimeout: (e) => {
|
|
469
469
|
cancelAnimationFrame(e.id);
|
|
470
470
|
}, castToString: (e) => e == null || e === void 0 ? "" : typeof e != "string" ? "" + e : e, cloneObject: (e) => Ve(e) ? e : JSON.parse(JSON.stringify(e)), consoleWithNoSource: (...e) => new Promise((t) => {
|
|
471
471
|
setTimeout(() => {
|
|
@@ -580,7 +580,7 @@ const We = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeEl
|
|
|
580
580
|
}, isNode: dt, isNullOrUndefined: Ve, isNumeric: (e) => {
|
|
581
581
|
const t = 1 * e;
|
|
582
582
|
return Number.isFinite(t) && typeof t == "number";
|
|
583
|
-
}, isObject: ne, isPromiseLike: (e) => !!e && typeof e.then == "function", isRectInsideRect: (e, t) => e.top >= t.top && e.bottom <= t.bottom && e.left >= t.left && e.right <= t.right, isRectIntersect:
|
|
583
|
+
}, isObject: ne, isPromiseLike: (e) => !!e && typeof e.then == "function", isRectInsideRect: (e, t) => e.top >= t.top && e.bottom <= t.bottom && e.left >= t.left && e.right <= t.right, isRectIntersect: Ge, mergeContentful: (...e) => {
|
|
584
584
|
const t = e.length;
|
|
585
585
|
if (t > 0 && e[t - 1] !== void 0 && !ne(e[t - 1])) return e[t - 1];
|
|
586
586
|
let n = e[0] || {};
|
|
@@ -593,7 +593,7 @@ const We = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeEl
|
|
|
593
593
|
e();
|
|
594
594
|
});
|
|
595
595
|
}, openFileDialog: (e = "*.*") => new Promise((t, n) => {
|
|
596
|
-
if (!
|
|
596
|
+
if (!qe) return void n("Unable to open dialog with no dom.");
|
|
597
597
|
const r = document.createElement("input");
|
|
598
598
|
r.type = "file", r.accept = e;
|
|
599
599
|
let o = null, a = !1;
|
|
@@ -647,7 +647,7 @@ const We = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeEl
|
|
|
647
647
|
return { ip: Math.trunc(e), fp: o, ipLength: Math.ceil(Math.log10(n + 1)), fpLength: a };
|
|
648
648
|
}, subtractRect: (e, t, n = !1) => {
|
|
649
649
|
if (!t) return [e];
|
|
650
|
-
if (!
|
|
650
|
+
if (!Ge(e, t)) return [];
|
|
651
651
|
const r = [];
|
|
652
652
|
let o = e;
|
|
653
653
|
const a = () => {
|
|
@@ -1085,9 +1085,9 @@ class tt {
|
|
|
1085
1085
|
}
|
|
1086
1086
|
var Ee;
|
|
1087
1087
|
(Ee = tt || (tt = {})).ErrorMessages = mt, Ee.Global = new Ee();
|
|
1088
|
-
const
|
|
1088
|
+
const Gt = "__SHEETXL";
|
|
1089
1089
|
let ee = null, le = null;
|
|
1090
|
-
async function
|
|
1090
|
+
async function qt() {
|
|
1091
1091
|
if (ee)
|
|
1092
1092
|
return ee;
|
|
1093
1093
|
if (le) {
|
|
@@ -1114,9 +1114,9 @@ const Wt = {
|
|
|
1114
1114
|
target: "esnext"
|
|
1115
1115
|
}
|
|
1116
1116
|
};
|
|
1117
|
-
async function Yt(e, t, n = "/script.js", r =
|
|
1117
|
+
async function Yt(e, t, n = "/script.js", r = Gt) {
|
|
1118
1118
|
try {
|
|
1119
|
-
const o = await
|
|
1119
|
+
const o = await qt(), a = "@sheetxl/primitives", i = \`
|
|
1120
1120
|
export const FormulaContext = globalThis.\${r}?.FormulaContext;
|
|
1121
1121
|
export const ScalarType = globalThis.\${r}?.ScalarType;
|
|
1122
1122
|
export const Observable = globalThis.\${r}?.Observable;
|
|
@@ -1323,8 +1323,8 @@ async function nn(e) {
|
|
|
1323
1323
|
const M = s.typeName?.getText?.() ?? null, K = yt.get(M);
|
|
1324
1324
|
let V = !1;
|
|
1325
1325
|
K && (m.range = K, V = !0);
|
|
1326
|
-
const
|
|
1327
|
-
if (
|
|
1326
|
+
const G = Zt.get(M);
|
|
1327
|
+
if (G && (m.scalar = G), G !== void 0 && (V = !0), P) {
|
|
1328
1328
|
const R = gt.get(M);
|
|
1329
1329
|
if (R)
|
|
1330
1330
|
return R;
|
|
@@ -1371,8 +1371,8 @@ async function nn(e) {
|
|
|
1371
1371
|
}
|
|
1372
1372
|
const V = {};
|
|
1373
1373
|
c(s.type, V, m, !1), m.returnType = V;
|
|
1374
|
-
const
|
|
1375
|
-
fe(s) && (
|
|
1374
|
+
const G = {};
|
|
1375
|
+
fe(s) && (G.default = !0, u = P), Object.keys(G).length > 0 && (m.behavior = G), m.parameters = [];
|
|
1376
1376
|
const H = /* @__PURE__ */ new Map();
|
|
1377
1377
|
for (let R = 0; R < s.parameters.length; R++) {
|
|
1378
1378
|
const b = s.parameters[R], N = {};
|
|
@@ -1398,8 +1398,8 @@ async function nn(e) {
|
|
|
1398
1398
|
b.dotDotDotToken && (N.rest = !0), m.parameters.push(N);
|
|
1399
1399
|
const C = { description: "" };
|
|
1400
1400
|
L.parameters[N.name] = C;
|
|
1401
|
-
const
|
|
1402
|
-
|
|
1401
|
+
const q = I.getSymbolAtLocation(b.name).getDocumentationComment(I);
|
|
1402
|
+
q && q.length > 0 && q[0].text && (C.description = q[0].text), v !== void 0 && (C.defaultValue = v), H.set(N.name, N);
|
|
1403
1403
|
}
|
|
1404
1404
|
if (s.jsDoc && s.jsDoc.length > 0) {
|
|
1405
1405
|
const R = s.jsDoc;
|
|
@@ -1412,8 +1412,8 @@ async function nn(e) {
|
|
|
1412
1412
|
if (!v) continue;
|
|
1413
1413
|
v = v.toLowerCase();
|
|
1414
1414
|
let C = z.comment;
|
|
1415
|
-
const
|
|
1416
|
-
if (!(typeof C != "string" && !
|
|
1415
|
+
const q = v === "hidden";
|
|
1416
|
+
if (!(typeof C != "string" && !q) && (typeof C == "string" && (C = C.replace(/[\\r\\n]+/g, "\\\\n").trim()), !(!q && C && (C = C.split(/\\\\n/)[0], !C || C.length === 0)))) {
|
|
1417
1417
|
if (C && typeof C == "string") {
|
|
1418
1418
|
const O = /\\{@link(code|plain)?\\s+([^}|]+)(?:\\s*\\|\\s*([^}]+))?\\}/g;
|
|
1419
1419
|
let F, Z = C, te = [];
|
|
@@ -1575,7 +1575,7 @@ async function p() {
|
|
|
1575
1575
|
return await l();
|
|
1576
1576
|
}
|
|
1577
1577
|
const l = async () => {
|
|
1578
|
-
const { compileModule: e } = await import("./
|
|
1578
|
+
const { compileModule: e } = await import("./Bi2hx3s7L3e_w3YZ.mjs"), n = new u((t) => e(t));
|
|
1579
1579
|
return await n.start(), n;
|
|
1580
1580
|
};
|
|
1581
1581
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.8
|
|
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.7.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.8
|
|
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("./D8_3gOPus0W3NA-P.mjs");
|
|
14
14
|
return this.workerWrapper = await r(), this.workerWrapper;
|
|
15
15
|
}
|
|
16
16
|
async compileModule(r) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.8
|
|
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/browser/esm/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CommonUtils as u } from "@sheetxl/utils";
|
|
2
2
|
/**
|
|
3
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.
|
|
3
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.8
|
|
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.
|
|
@@ -11,7 +11,7 @@ const p = Object.freeze({ compileTypescript: async function(t) {
|
|
|
11
11
|
if (n && u.deepEqual(n, t)) return i;
|
|
12
12
|
const l = await (async function() {
|
|
13
13
|
if (e) return e;
|
|
14
|
-
const { TypeScriptCompiler: o } = await import("./
|
|
14
|
+
const { TypeScriptCompiler: o } = await import("./DY6nBMNGZo3OkzZU.mjs");
|
|
15
15
|
return e = new o(), e;
|
|
16
16
|
})(), r = await l.compileModule(t);
|
|
17
17
|
return i = r, n = t, r;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.8
|
|
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("./BowpYLDhDt6ZeLFU.mjs");
|
|
14
14
|
return this.workerWrapper = await r(), this.workerWrapper;
|
|
15
15
|
}
|
|
16
16
|
async compileModule(r) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.8
|
|
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.
|
|
@@ -47,7 +47,7 @@ class u {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
const s = `/**
|
|
50
|
-
* @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.7.
|
|
50
|
+
* @license @sheetxl/primitives - Primitives - Base types for SheetXL functions. - v0.7.8
|
|
51
51
|
*
|
|
52
52
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
53
53
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -266,7 +266,7 @@ var T;
|
|
|
266
266
|
return r = typeof e == "string" ? rt.get(e) : ot.get(e), r || (r = T.Unknown), new r(t, n);
|
|
267
267
|
}, T.getBuiltInById = (e) => Te.get(e) || xt;
|
|
268
268
|
/**
|
|
269
|
-
* @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.7.
|
|
269
|
+
* @license @sheetxl/utils - Utils - Utilities used by most SheetXL components. - v0.7.8
|
|
270
270
|
*
|
|
271
271
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
272
272
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -449,7 +449,7 @@ const Ft = Object.freeze([]), Dt = Object.freeze({}), ze = (e) => e, de = () =>
|
|
|
449
449
|
ut(e[i], t?.[i], n) === null && (o = !0, delete e[i]);
|
|
450
450
|
}
|
|
451
451
|
return o && Object.keys(e).length === 0 ? null : void 0;
|
|
452
|
-
}, Ke = typeof performance == "object" && typeof performance.now == "function" ? () => performance.now() : () => Date.now(), Ve = (e) => e == null,
|
|
452
|
+
}, Ke = typeof performance == "object" && typeof performance.now == "function" ? () => performance.now() : () => Date.now(), Ve = (e) => e == null, Ge = (e, t) => !(t.left > e.right || t.right < e.left || t.top > e.bottom || t.bottom < e.top), qe = !(typeof window > "u" || !window.document || !window.document.createElement), k = { Windows: "windows", MacOS: "macos", IOS: "ios", Linux: "linux", Android: "android", Safari: "safari", Firefox: "firefox", Node: "node", Unknown: "unknown" }, oe = () => {
|
|
453
453
|
if (dt()) return k.Node;
|
|
454
454
|
const e = globalThis.navigator !== void 0 && globalThis.navigator.userAgent ? globalThis.navigator.userAgent.toLowerCase() : "";
|
|
455
455
|
return e ? /(win32|win64|windows|wince)/i.test(e) ? k.Windows : /(macintosh|macintel|macppc|mac68k|macos)/i.test(e) ? k.MacOS : /(iphone|ipad|ipod)/i.test(e) ? k.IOS : /android/.test(e) ? k.Android : /linux/.test(e) ? k.Linux : /^((?!chrome|android|).)*safari/i.test(e) ? k.Safari : /^((?!chrome|android|Seamonkey).)*firefox/i.test(e) ? k.Firefox : k.Unknown : k.Unknown;
|
|
@@ -465,7 +465,7 @@ const We = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeEl
|
|
|
465
465
|
return Number.isFinite(t) ? t : 0;
|
|
466
466
|
}, camelToPrettyCase: (e) => e.length === 1 ? e.toUpperCase() : e.replace(/([A-Z])/g, " $1").replace(/^./, function(t) {
|
|
467
467
|
return t.toUpperCase();
|
|
468
|
-
}).trim(), canUseDOM:
|
|
468
|
+
}).trim(), canUseDOM: qe, cancelTimeout: (e) => {
|
|
469
469
|
cancelAnimationFrame(e.id);
|
|
470
470
|
}, castToString: (e) => e == null || e === void 0 ? "" : typeof e != "string" ? "" + e : e, cloneObject: (e) => Ve(e) ? e : JSON.parse(JSON.stringify(e)), consoleWithNoSource: (...e) => new Promise((t) => {
|
|
471
471
|
setTimeout(() => {
|
|
@@ -580,7 +580,7 @@ const We = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeEl
|
|
|
580
580
|
}, isNode: dt, isNullOrUndefined: Ve, isNumeric: (e) => {
|
|
581
581
|
const t = 1 * e;
|
|
582
582
|
return Number.isFinite(t) && typeof t == "number";
|
|
583
|
-
}, isObject: ne, isPromiseLike: (e) => !!e && typeof e.then == "function", isRectInsideRect: (e, t) => e.top >= t.top && e.bottom <= t.bottom && e.left >= t.left && e.right <= t.right, isRectIntersect:
|
|
583
|
+
}, isObject: ne, isPromiseLike: (e) => !!e && typeof e.then == "function", isRectInsideRect: (e, t) => e.top >= t.top && e.bottom <= t.bottom && e.left >= t.left && e.right <= t.right, isRectIntersect: Ge, mergeContentful: (...e) => {
|
|
584
584
|
const t = e.length;
|
|
585
585
|
if (t > 0 && e[t - 1] !== void 0 && !ne(e[t - 1])) return e[t - 1];
|
|
586
586
|
let n = e[0] || {};
|
|
@@ -593,7 +593,7 @@ const We = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeEl
|
|
|
593
593
|
e();
|
|
594
594
|
});
|
|
595
595
|
}, openFileDialog: (e = "*.*") => new Promise((t, n) => {
|
|
596
|
-
if (!
|
|
596
|
+
if (!qe) return void n("Unable to open dialog with no dom.");
|
|
597
597
|
const r = document.createElement("input");
|
|
598
598
|
r.type = "file", r.accept = e;
|
|
599
599
|
let o = null, a = !1;
|
|
@@ -647,7 +647,7 @@ const We = (e, t = !1) => (document.hasFocus() || t) && (e === document.activeEl
|
|
|
647
647
|
return { ip: Math.trunc(e), fp: o, ipLength: Math.ceil(Math.log10(n + 1)), fpLength: a };
|
|
648
648
|
}, subtractRect: (e, t, n = !1) => {
|
|
649
649
|
if (!t) return [e];
|
|
650
|
-
if (!
|
|
650
|
+
if (!Ge(e, t)) return [];
|
|
651
651
|
const r = [];
|
|
652
652
|
let o = e;
|
|
653
653
|
const a = () => {
|
|
@@ -1085,9 +1085,9 @@ class tt {
|
|
|
1085
1085
|
}
|
|
1086
1086
|
var Ee;
|
|
1087
1087
|
(Ee = tt || (tt = {})).ErrorMessages = mt, Ee.Global = new Ee();
|
|
1088
|
-
const
|
|
1088
|
+
const Gt = "__SHEETXL";
|
|
1089
1089
|
let ee = null, le = null;
|
|
1090
|
-
async function
|
|
1090
|
+
async function qt() {
|
|
1091
1091
|
if (ee)
|
|
1092
1092
|
return ee;
|
|
1093
1093
|
if (le) {
|
|
@@ -1114,9 +1114,9 @@ const Wt = {
|
|
|
1114
1114
|
target: "esnext"
|
|
1115
1115
|
}
|
|
1116
1116
|
};
|
|
1117
|
-
async function Yt(e, t, n = "/script.js", r =
|
|
1117
|
+
async function Yt(e, t, n = "/script.js", r = Gt) {
|
|
1118
1118
|
try {
|
|
1119
|
-
const o = await
|
|
1119
|
+
const o = await qt(), a = "@sheetxl/primitives", i = \`
|
|
1120
1120
|
export const FormulaContext = globalThis.\${r}?.FormulaContext;
|
|
1121
1121
|
export const ScalarType = globalThis.\${r}?.ScalarType;
|
|
1122
1122
|
export const Observable = globalThis.\${r}?.Observable;
|
|
@@ -1323,8 +1323,8 @@ async function nn(e) {
|
|
|
1323
1323
|
const M = s.typeName?.getText?.() ?? null, K = yt.get(M);
|
|
1324
1324
|
let V = !1;
|
|
1325
1325
|
K && (m.range = K, V = !0);
|
|
1326
|
-
const
|
|
1327
|
-
if (
|
|
1326
|
+
const G = Zt.get(M);
|
|
1327
|
+
if (G && (m.scalar = G), G !== void 0 && (V = !0), P) {
|
|
1328
1328
|
const R = gt.get(M);
|
|
1329
1329
|
if (R)
|
|
1330
1330
|
return R;
|
|
@@ -1371,8 +1371,8 @@ async function nn(e) {
|
|
|
1371
1371
|
}
|
|
1372
1372
|
const V = {};
|
|
1373
1373
|
c(s.type, V, m, !1), m.returnType = V;
|
|
1374
|
-
const
|
|
1375
|
-
fe(s) && (
|
|
1374
|
+
const G = {};
|
|
1375
|
+
fe(s) && (G.default = !0, u = P), Object.keys(G).length > 0 && (m.behavior = G), m.parameters = [];
|
|
1376
1376
|
const H = /* @__PURE__ */ new Map();
|
|
1377
1377
|
for (let R = 0; R < s.parameters.length; R++) {
|
|
1378
1378
|
const b = s.parameters[R], N = {};
|
|
@@ -1398,8 +1398,8 @@ async function nn(e) {
|
|
|
1398
1398
|
b.dotDotDotToken && (N.rest = !0), m.parameters.push(N);
|
|
1399
1399
|
const C = { description: "" };
|
|
1400
1400
|
L.parameters[N.name] = C;
|
|
1401
|
-
const
|
|
1402
|
-
|
|
1401
|
+
const q = I.getSymbolAtLocation(b.name).getDocumentationComment(I);
|
|
1402
|
+
q && q.length > 0 && q[0].text && (C.description = q[0].text), v !== void 0 && (C.defaultValue = v), H.set(N.name, N);
|
|
1403
1403
|
}
|
|
1404
1404
|
if (s.jsDoc && s.jsDoc.length > 0) {
|
|
1405
1405
|
const R = s.jsDoc;
|
|
@@ -1412,8 +1412,8 @@ async function nn(e) {
|
|
|
1412
1412
|
if (!v) continue;
|
|
1413
1413
|
v = v.toLowerCase();
|
|
1414
1414
|
let C = z.comment;
|
|
1415
|
-
const
|
|
1416
|
-
if (!(typeof C != "string" && !
|
|
1415
|
+
const q = v === "hidden";
|
|
1416
|
+
if (!(typeof C != "string" && !q) && (typeof C == "string" && (C = C.replace(/[\\r\\n]+/g, "\\\\n").trim()), !(!q && C && (C = C.split(/\\\\n/)[0], !C || C.length === 0)))) {
|
|
1417
1417
|
if (C && typeof C == "string") {
|
|
1418
1418
|
const O = /\\{@link(code|plain)?\\s+([^}|]+)(?:\\s*\\|\\s*([^}]+))?\\}/g;
|
|
1419
1419
|
let F, Z = C, te = [];
|
|
@@ -1575,7 +1575,7 @@ async function p() {
|
|
|
1575
1575
|
return await l();
|
|
1576
1576
|
}
|
|
1577
1577
|
const l = async () => {
|
|
1578
|
-
const { compileModule: e } = await import("./
|
|
1578
|
+
const { compileModule: e } = await import("./CMQpEkzUkzTbAbHY.mjs"), n = new u((t) => e(t));
|
|
1579
1579
|
return await n.start(), n;
|
|
1580
1580
|
};
|
|
1581
1581
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ScalarType as v } from "@sheetxl/primitives";
|
|
2
2
|
import { CommonUtils as ae } from "@sheetxl/utils";
|
|
3
3
|
/**
|
|
4
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.
|
|
4
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.8
|
|
5
5
|
*
|
|
6
6
|
* (C) 2025-present SheetXL Inc. & Michael T. Ford
|
|
7
7
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -21,7 +21,7 @@ async function le(h, x, S = "/script.js", w = "__SHEETXL") {
|
|
|
21
21
|
p = a, b = T;
|
|
22
22
|
});
|
|
23
23
|
try {
|
|
24
|
-
const { initialize: a } = await import("./
|
|
24
|
+
const { initialize: a } = await import("./CzKYxVNI0Mg3IfC-.mjs");
|
|
25
25
|
return L = await a(), p(), L;
|
|
26
26
|
} catch (a) {
|
|
27
27
|
throw console.error("Failed to import or initialize esbuild:", a), P = null, b(a), a;
|
|
@@ -70,7 +70,7 @@ let B = null;
|
|
|
70
70
|
async function pe() {
|
|
71
71
|
if (B) return B;
|
|
72
72
|
try {
|
|
73
|
-
return await (await import("./
|
|
73
|
+
return await (await import("./Dc6drpRJe4EdWdbT.mjs")).initialize();
|
|
74
74
|
} catch (h) {
|
|
75
75
|
throw B = null, h;
|
|
76
76
|
} finally {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as s from "esbuild-wasm";
|
|
2
2
|
/**
|
|
3
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.
|
|
3
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.8
|
|
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
|
/**
|
|
2
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.
|
|
2
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.8
|
|
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/node/esm/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { CommonUtils as u } from "@sheetxl/utils";
|
|
2
2
|
/**
|
|
3
|
-
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.
|
|
3
|
+
* @license @sheetxl/scripting - Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild. - v0.7.8
|
|
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.
|
|
@@ -11,7 +11,7 @@ const p = Object.freeze({ compileTypescript: async function(t) {
|
|
|
11
11
|
if (n && u.deepEqual(n, t)) return i;
|
|
12
12
|
const l = await (async function() {
|
|
13
13
|
if (e) return e;
|
|
14
|
-
const { TypeScriptCompiler: o } = await import("./
|
|
14
|
+
const { TypeScriptCompiler: o } = await import("./AuT3ZBeWGof0IJJ8.mjs");
|
|
15
15
|
return e = new o(), e;
|
|
16
16
|
})(), r = await l.compileModule(t);
|
|
17
17
|
return i = r, n = t, r;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheetxl/scripting",
|
|
3
3
|
"description": "Scripting - Scripting engine for Macros and formulas; includes TypeScript and EsBuild.",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.8",
|
|
5
5
|
"license": "SEE LICENSE IN <LICENSE>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"scripting"
|
|
41
41
|
],
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@sheetxl/primitives": "^0.7.
|
|
44
|
-
"@sheetxl/utils": "^0.7.
|
|
43
|
+
"@sheetxl/primitives": "^0.7.8",
|
|
44
|
+
"@sheetxl/utils": "^0.7.8",
|
|
45
45
|
"path-browserify": "^1.0.1"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|