@sheetxl/scripting 0.8.0-beta.17 → 0.8.0-beta.19
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.
|
@@ -168,7 +168,7 @@ var lr = ge({
|
|
|
168
168
|
EmptyArray: () => De,
|
|
169
169
|
EmptyObject: () => hn,
|
|
170
170
|
OSType: () => pe,
|
|
171
|
-
arrayMove: () =>
|
|
171
|
+
arrayMove: () => kn,
|
|
172
172
|
asNumber: () => bn,
|
|
173
173
|
camelToPrettyCase: () => wn,
|
|
174
174
|
castToString: () => Mn,
|
|
@@ -179,7 +179,7 @@ var lr = ge({
|
|
|
179
179
|
deepMerge: () => Ee,
|
|
180
180
|
diffValues: () => $n,
|
|
181
181
|
findEqualOrGreater: () => Nn,
|
|
182
|
-
findEqualOrLesser: () =>
|
|
182
|
+
findEqualOrLesser: () => Ln,
|
|
183
183
|
getFromPath: () => Bn,
|
|
184
184
|
getPlatform: () => qe,
|
|
185
185
|
isDefined: () => On,
|
|
@@ -382,7 +382,7 @@ function Nn(e, t, r = sr) {
|
|
|
382
382
|
}
|
|
383
383
|
return n;
|
|
384
384
|
}
|
|
385
|
-
function
|
|
385
|
+
function Ln(e, t, r = sr) {
|
|
386
386
|
let n = e.length - 1, i = 0;
|
|
387
387
|
for (; n >= i;) {
|
|
388
388
|
let a = Math.floor((n + i) / 2), l = r(e[a]);
|
|
@@ -391,7 +391,7 @@ function kn(e, t, r = sr) {
|
|
|
391
391
|
}
|
|
392
392
|
return n;
|
|
393
393
|
}
|
|
394
|
-
function
|
|
394
|
+
function kn(e, t, r) {
|
|
395
395
|
let n = e.slice();
|
|
396
396
|
return n.splice(r < 0 ? n.length + r : r, 0, n.splice(t, 1)[0]), n;
|
|
397
397
|
}
|
|
@@ -528,14 +528,14 @@ ge({
|
|
|
528
528
|
createConflatingRanges: () => ni,
|
|
529
529
|
createRangeComparator: () => Cr,
|
|
530
530
|
defaultRange: () => ei,
|
|
531
|
-
extendRangeToIntersectingRanges: () =>
|
|
531
|
+
extendRangeToIntersectingRanges: () => kr,
|
|
532
532
|
extendRangeToUnionRanges: () => qn,
|
|
533
533
|
intersectRanges: () => Nr,
|
|
534
534
|
isCellWithinRange: () => Gn,
|
|
535
535
|
isEqualCells: () => Ir,
|
|
536
536
|
isEqualRanges: () => yt,
|
|
537
537
|
isEqualRangesArrays: () => $r,
|
|
538
|
-
isEqualSelectionCoords: () =>
|
|
538
|
+
isEqualSelectionCoords: () => Lr,
|
|
539
539
|
isRangeWithinRange: () => Rr,
|
|
540
540
|
isRangesIntersect: () => wt,
|
|
541
541
|
isRefusedInsertCut: () => ai,
|
|
@@ -654,7 +654,7 @@ function ft(e, t, r) {
|
|
|
654
654
|
rowEnd: l
|
|
655
655
|
}, s;
|
|
656
656
|
}
|
|
657
|
-
function
|
|
657
|
+
function Lr(e, t) {
|
|
658
658
|
return e === t || !(!e || !t) && e.rangeIndex === t.rangeIndex && !!Ir(e.cell, t.cell) && $r(e.ranges, t.ranges);
|
|
659
659
|
}
|
|
660
660
|
function Jn(e, t, r) {
|
|
@@ -670,10 +670,10 @@ function Yn(e) {
|
|
|
670
670
|
function qn(e, t) {
|
|
671
671
|
if (!t || t.length === 0) return e;
|
|
672
672
|
let r = e, n = null;
|
|
673
|
-
for (; !yt(r, n);) n = r, r =
|
|
673
|
+
for (; !yt(r, n);) n = r, r = kr(n, t);
|
|
674
674
|
return r;
|
|
675
675
|
}
|
|
676
|
-
function
|
|
676
|
+
function kr(e, t) {
|
|
677
677
|
if (!t || t.length === 0) return e;
|
|
678
678
|
let r = { ...e };
|
|
679
679
|
for (let n = 0; n < t.length; n++) {
|
|
@@ -728,26 +728,26 @@ function Or(e, t = 2, r, n = ie.Row, i) {
|
|
|
728
728
|
do {
|
|
729
729
|
let d = a.sort(Cr(l ? ie.Row : ie.Column));
|
|
730
730
|
a = [], a.push(d[0]);
|
|
731
|
-
let m = d.length, o = 0, f = d[0], b = f.colStart, S = f.rowStart, A = f.colEnd,
|
|
731
|
+
let m = d.length, o = 0, f = d[0], b = f.colStart, S = f.rowStart, A = f.colEnd, L = f.rowEnd;
|
|
732
732
|
for (let h = 1; h < m; h++) {
|
|
733
733
|
let y = d[h], w = !1;
|
|
734
|
-
if (w = l ? f && S === y.rowStart &&
|
|
734
|
+
if (w = l ? f && S === y.rowStart && L === y.rowEnd && A + 1 === y.colStart : f && b === y.colStart && A === y.colEnd && L + 1 === y.rowStart, w) {
|
|
735
735
|
let D = {
|
|
736
736
|
colStart: b,
|
|
737
737
|
rowStart: S,
|
|
738
738
|
colEnd: l ? y.colEnd : A,
|
|
739
|
-
rowEnd: l ?
|
|
739
|
+
rowEnd: l ? L : y.rowEnd
|
|
740
740
|
};
|
|
741
741
|
if (f.value !== void 0 && (D.value = f.value), r) {
|
|
742
742
|
let K = i ?? [null, null];
|
|
743
743
|
K[0] = f, K[1] = y, D = r(K, D, n);
|
|
744
744
|
}
|
|
745
745
|
if (D) {
|
|
746
|
-
a[o] = D, c = !0, f = D, b = f.colStart, S = f.rowStart, A = f.colEnd,
|
|
746
|
+
a[o] = D, c = !0, f = D, b = f.colStart, S = f.rowStart, A = f.colEnd, L = f.rowEnd;
|
|
747
747
|
continue;
|
|
748
748
|
}
|
|
749
749
|
}
|
|
750
|
-
a[++o] = y, f = y, b = f.colStart, S = f.rowStart, A = f.colEnd,
|
|
750
|
+
a[++o] = y, f = y, b = f.colStart, S = f.rowStart, A = f.colEnd, L = f.rowEnd;
|
|
751
751
|
}
|
|
752
752
|
s++, l = !l, s === 1 && (c = !0);
|
|
753
753
|
} while (s < t && c && a.length > 1);
|
|
@@ -814,7 +814,7 @@ function fe(e, t, r, n) {
|
|
|
814
814
|
}
|
|
815
815
|
}
|
|
816
816
|
function Dr(e, t = q.Right, r, n, i, a = null) {
|
|
817
|
-
if (a &&
|
|
817
|
+
if (a && Lr(a, e)) return e;
|
|
818
818
|
let l = e.ranges, s = e.rangeIndex, c = l[s];
|
|
819
819
|
if (!wt({
|
|
820
820
|
rowStart: e.cell.rowIndex,
|
|
@@ -923,17 +923,17 @@ var oi, $e = (e, t) => {
|
|
|
923
923
|
let a = new Int32Array(i), l = new Int32Array(i), s = new Int32Array(i), c = new Int32Array(i), d = r ? e.colS : e.rowS, m = r ? e.colE : e.rowE, o = r ? e.rowS : e.colS, f = r ? e.rowE : e.colE;
|
|
924
924
|
for (let h = 0; h < i; h++) n ? (a[h] = -m[h], l[h] = -d[h], s[h] = -f[h], c[h] = -o[h]) : (a[h] = d[h], l[h] = m[h], s[h] = o[h], c[h] = f[h]);
|
|
925
925
|
this._M0 = a, this._M1 = l, this._m0 = s, this._m1 = c;
|
|
926
|
-
let b = r ? t.colStart : t.rowStart, S = r ? t.colEnd : t.rowEnd, A = S - b + 1,
|
|
926
|
+
let b = r ? t.colStart : t.rowStart, S = r ? t.colEnd : t.rowEnd, A = S - b + 1, L = new Int32Array(i);
|
|
927
927
|
if (i < 256 || A > 16 * i) {
|
|
928
|
-
for (let h = 0; h < i; h++)
|
|
929
|
-
|
|
928
|
+
for (let h = 0; h < i; h++) L[h] = h;
|
|
929
|
+
L.sort((h, y) => a[h] - a[y] || h - y);
|
|
930
930
|
} else {
|
|
931
931
|
let h = n ? -S : b, y = tt(A + 1);
|
|
932
932
|
for (let w = 0; w < i; w++) y[a[w] - h + 1]++;
|
|
933
933
|
for (let w = 1; w <= A; w++) y[w] += y[w - 1];
|
|
934
|
-
for (let w = 0; w < i; w++)
|
|
934
|
+
for (let w = 0; w < i; w++) L[y[a[w] - h]++] = w;
|
|
935
935
|
}
|
|
936
|
-
this._order =
|
|
936
|
+
this._order = L, this._active = new Int32Array(Math.min(2 * i, 1024)), this._scratch = new Int32Array(this._active.length);
|
|
937
937
|
}
|
|
938
938
|
_stable(e) {
|
|
939
939
|
return this._isReverse ? this._n - 1 - e : e;
|
|
@@ -997,22 +997,22 @@ var oi, $e = (e, t) => {
|
|
|
997
997
|
if (d > 0) {
|
|
998
998
|
let o = 2 * d, f = this._events;
|
|
999
999
|
f.length < o && (f = this._events = new Int32Array(Math.max(o, 2 * f.length)));
|
|
1000
|
-
let b = this._m0, S = this._m1, A = 2 ** 53 - 1,
|
|
1000
|
+
let b = this._m0, S = this._m1, A = 2 ** 53 - 1, L = -(2 ** 53 - 1), h = 0;
|
|
1001
1001
|
if (this._isReverse) for (let K = c - 1; K >= s; K--) {
|
|
1002
|
-
let
|
|
1003
|
-
f[h++] =
|
|
1002
|
+
let k = n[K];
|
|
1003
|
+
f[h++] = k << 1, f[h++] = k << 1 | 1, b[k] < A && (A = b[k]), S[k] > L && (L = S[k]);
|
|
1004
1004
|
}
|
|
1005
1005
|
else for (let K = s; K < c; K++) {
|
|
1006
|
-
let
|
|
1007
|
-
f[h++] =
|
|
1006
|
+
let k = n[K];
|
|
1007
|
+
f[h++] = k << 1, f[h++] = k << 1 | 1, b[k] < A && (A = b[k]), S[k] > L && (L = S[k]);
|
|
1008
1008
|
}
|
|
1009
|
-
let y = this._sortEvents(f, o, A,
|
|
1009
|
+
let y = this._sortEvents(f, o, A, L), w = l + o, D = this._scratch;
|
|
1010
1010
|
if ((D === y || D.length < w) && (D = new Int32Array(Math.max(w, 2 * a.length))), l === 0) D.set(y.subarray(0, o));
|
|
1011
1011
|
else {
|
|
1012
|
-
let K = 0,
|
|
1013
|
-
for (; K < l &&
|
|
1012
|
+
let K = 0, k = 0, R = 0;
|
|
1013
|
+
for (; K < l && k < o;) this._compareEvents(a[K], y[k]) <= 0 ? D[R++] = a[K++] : D[R++] = y[k++];
|
|
1014
1014
|
for (; K < l;) D[R++] = a[K++];
|
|
1015
|
-
for (;
|
|
1015
|
+
for (; k < o;) D[R++] = y[k++];
|
|
1016
1016
|
}
|
|
1017
1017
|
this._scratch = a.length >= D.length ? a : new Int32Array(D.length), a = this._active = D, l = w;
|
|
1018
1018
|
}
|
|
@@ -1027,21 +1027,21 @@ var oi, $e = (e, t) => {
|
|
|
1027
1027
|
_sweepBand() {
|
|
1028
1028
|
let e = this._active, t = this._activeLen, r = this._m0, n = this._m1, i = this._rMinS, a = this._rMinE, l = this._rOff, s = this._pool, c = this._overlaps, d = 0, m = 0, o = 0, f = 0, b = (S, A) => {
|
|
1029
1029
|
o >= i.length && (i = this._rMinS = $e(i, o + 1), a = this._rMinE = $e(a, o + 1), l = this._rOff = $e(l, i.length + 1)), i[o] = S, a[o] = A, l[o] = m, o++, m + d > s.length && (s = this._pool = $e(s, m + d));
|
|
1030
|
-
for (let
|
|
1030
|
+
for (let L = 0; L < d; L++) s[m++] = c[L];
|
|
1031
1031
|
};
|
|
1032
1032
|
for (let S = 0; S < t; S++) {
|
|
1033
|
-
let A = e[S],
|
|
1033
|
+
let A = e[S], L = A >> 1;
|
|
1034
1034
|
if (1 & A) {
|
|
1035
|
-
let h = n[
|
|
1035
|
+
let h = n[L];
|
|
1036
1036
|
if (f <= h && b(f, h), d > 1) {
|
|
1037
1037
|
let y = d - 1;
|
|
1038
|
-
for (; y >= 0 && c[y] !==
|
|
1038
|
+
for (; y >= 0 && c[y] !== L;) y--;
|
|
1039
1039
|
y !== -1 && (c[y] = c[d - 1]);
|
|
1040
1040
|
}
|
|
1041
1041
|
d--, f = h + 1;
|
|
1042
1042
|
} else {
|
|
1043
|
-
let h = r[
|
|
1044
|
-
d > 0 && f < h && b(f, h - 1), d >= c.length && (c = this._overlaps = $e(c, d + 1)), c[d++] =
|
|
1043
|
+
let h = r[L];
|
|
1044
|
+
d > 0 && f < h && b(f, h - 1), d >= c.length && (c = this._overlaps = $e(c, d + 1)), c[d++] = L, f = h;
|
|
1045
1045
|
}
|
|
1046
1046
|
}
|
|
1047
1047
|
l[o] = m, this._rCount = o, this._region = -1, this._rInter = null;
|
|
@@ -1174,12 +1174,12 @@ var oi, $e = (e, t) => {
|
|
|
1174
1174
|
let w = i[y];
|
|
1175
1175
|
o.rowS[y] = w.rowStart, o.rowE[y] = w.rowEnd, o.colS[y] = w.colStart, o.colE[y] = w.colEnd, o.value.push(w), w.rowStart < f && (f = w.rowStart), w.rowEnd > b && (b = w.rowEnd), w.colStart < S && (S = w.colStart), w.colEnd > A && (A = w.colEnd);
|
|
1176
1176
|
}
|
|
1177
|
-
let
|
|
1177
|
+
let L = {
|
|
1178
1178
|
rowStart: f,
|
|
1179
1179
|
rowEnd: b,
|
|
1180
1180
|
colStart: S,
|
|
1181
1181
|
colEnd: A
|
|
1182
|
-
}, h = this._sweep = new t(o,
|
|
1182
|
+
}, h = this._sweep = new t(o, L, s, c);
|
|
1183
1183
|
d ? this._cellComparator = Ar(s ? ie.Column : ie.Row, c) : l && (h._reuseOverlaps = []);
|
|
1184
1184
|
}
|
|
1185
1185
|
next(i) {
|
|
@@ -1496,8 +1496,8 @@ var $i;
|
|
|
1496
1496
|
ge({
|
|
1497
1497
|
DATA_URL_PNG_PREFIX: () => Br,
|
|
1498
1498
|
getImageDataUrl: () => Ni,
|
|
1499
|
-
getPngStatedSize: () =>
|
|
1500
|
-
loadImageDetails: () =>
|
|
1499
|
+
getPngStatedSize: () => Li,
|
|
1500
|
+
loadImageDetails: () => ki
|
|
1501
1501
|
});
|
|
1502
1502
|
var Br = "data:image/png;base64,", jr = "Unable to resolve image.", Rt = (e) => new Promise(async (t, r) => {
|
|
1503
1503
|
let n = null;
|
|
@@ -1543,7 +1543,7 @@ var Br = "data:image/png;base64,", jr = "Unable to resolve image.", Rt = (e) =>
|
|
|
1543
1543
|
i?.src && URL.revokeObjectURL(i.src);
|
|
1544
1544
|
}
|
|
1545
1545
|
i || n(Error(jr));
|
|
1546
|
-
}), $t = [2303741511, 218765834], Nt = 96 / .0254,
|
|
1546
|
+
}), $t = [2303741511, 218765834], Nt = 96 / .0254, Li = (e) => {
|
|
1547
1547
|
let t = new DataView(e);
|
|
1548
1548
|
if (t.byteLength < 24 || t.getUint32(0) !== $t[0] || t.getUint32(4) !== $t[1]) return null;
|
|
1549
1549
|
let r = 8;
|
|
@@ -1561,7 +1561,7 @@ var Br = "data:image/png;base64,", jr = "Unable to resolve image.", Rt = (e) =>
|
|
|
1561
1561
|
r += 12 + n;
|
|
1562
1562
|
}
|
|
1563
1563
|
return null;
|
|
1564
|
-
}, nt = "image/svg+xml",
|
|
1564
|
+
}, nt = "image/svg+xml", ki = async (e, t = null) => {
|
|
1565
1565
|
let r = null, n = async () => {
|
|
1566
1566
|
try {
|
|
1567
1567
|
let a = t ?? "image/*", l = URL.createObjectURL(new Blob([e], { type: a }));
|
|
@@ -1584,8 +1584,8 @@ var Br = "data:image/png;base64,", jr = "Unable to resolve image.", Rt = (e) =>
|
|
|
1584
1584
|
};
|
|
1585
1585
|
if (t === nt ? await i() : t?.startsWith("image/") ? await n() : (await n(), r || await i()), !r) throw Error("Failed to load image");
|
|
1586
1586
|
return r;
|
|
1587
|
-
},
|
|
1588
|
-
|
|
1587
|
+
}, Lt = /* @__PURE__ */ new Set(), Mi = (e) => {
|
|
1588
|
+
Lt.has(e) || (Lt.add(e), console.warn(\`Unknown property '\${e}' in update; ignoring.\`));
|
|
1589
1589
|
};
|
|
1590
1590
|
(function(e) {
|
|
1591
1591
|
e.PassThrough = Object.freeze({});
|
|
@@ -1611,16 +1611,16 @@ var Br = "data:image/png;base64,", jr = "Unable to resolve image.", Rt = (e) =>
|
|
|
1611
1611
|
m = null;
|
|
1612
1612
|
let f = o.length;
|
|
1613
1613
|
for (let b = 0; b < f; b++) {
|
|
1614
|
-
let S = o[b], A,
|
|
1615
|
-
if (
|
|
1614
|
+
let S = o[b], A, L = s?.[S];
|
|
1615
|
+
if (L !== void 0) {
|
|
1616
1616
|
let h = c[S];
|
|
1617
1617
|
if (!h) {
|
|
1618
1618
|
Mi(S);
|
|
1619
1619
|
continue;
|
|
1620
1620
|
}
|
|
1621
|
-
A = t(
|
|
1621
|
+
A = t(L, h, i, a?.[S], l);
|
|
1622
1622
|
} else A = a?.[S];
|
|
1623
|
-
A == null ? l &&
|
|
1623
|
+
A == null ? l && L === null && (m ??= {}, m[S] = null) : (m ??= {}, m[S] = A);
|
|
1624
1624
|
}
|
|
1625
1625
|
}
|
|
1626
1626
|
return m;
|
|
@@ -1636,11 +1636,11 @@ Please use Chrome or Edge if external copy and paste is required.\`
|
|
|
1636
1636
|
code: "perms",
|
|
1637
1637
|
message: \`You do not have permissions to access the clipboard.
|
|
1638
1638
|
All copy and paste operations will be limited to the browser tab.\`
|
|
1639
|
-
},
|
|
1639
|
+
}, kt = qe() === pe.Safari ? St : zr, Oi = {
|
|
1640
1640
|
Safari: St,
|
|
1641
1641
|
Perms: zr,
|
|
1642
|
-
PermsWrite:
|
|
1643
|
-
PermsRead:
|
|
1642
|
+
PermsWrite: kt,
|
|
1643
|
+
PermsRead: kt
|
|
1644
1644
|
}, it = async () => new Promise((e) => {
|
|
1645
1645
|
document.hasFocus() ? e() : globalThis.addEventListener?.("focus", () => {
|
|
1646
1646
|
e();
|
|
@@ -2045,18 +2045,18 @@ var Gi;
|
|
|
2045
2045
|
if (a < 309 && n.indexOf("E") < 0 && n.indexOf("e") < 0) return !0;
|
|
2046
2046
|
let l = i.charCodeAt(0), s = !1, c = !1, d = !1, m = 0, o = 0, f = 0, b = 0;
|
|
2047
2047
|
for (; b < a; b++) {
|
|
2048
|
-
let
|
|
2049
|
-
if (
|
|
2050
|
-
else if (
|
|
2051
|
-
else if ((
|
|
2048
|
+
let L = n.charCodeAt(b);
|
|
2049
|
+
if (L >= 48 && L <= 57) s = !0, c ? (f++, d || (L === 48 ? o++ : d = !0)) : (d || L !== 48) && (d = !0, m++);
|
|
2050
|
+
else if (L === l) c = !0;
|
|
2051
|
+
else if ((L === 69 || L === 101) && s) break;
|
|
2052
2052
|
}
|
|
2053
2053
|
let S = 0;
|
|
2054
2054
|
if (b < a) {
|
|
2055
|
-
let
|
|
2056
|
-
y === 45 ? (h = !0,
|
|
2055
|
+
let L = b + 1, h = !1, y = n.charCodeAt(L);
|
|
2056
|
+
y === 45 ? (h = !0, L++) : y === 43 && L++;
|
|
2057
2057
|
let w = 0;
|
|
2058
|
-
for (;
|
|
2059
|
-
let D = n.charCodeAt(
|
|
2058
|
+
for (; L < a; L++) {
|
|
2059
|
+
let D = n.charCodeAt(L);
|
|
2060
2060
|
if (D < 48 || D > 57) break;
|
|
2061
2061
|
S = 10 * S + (D - 48), w++;
|
|
2062
2062
|
}
|
|
@@ -2064,8 +2064,8 @@ var Gi;
|
|
|
2064
2064
|
h && (S = -S);
|
|
2065
2065
|
}
|
|
2066
2066
|
if (d) {
|
|
2067
|
-
let
|
|
2068
|
-
return
|
|
2067
|
+
let L = (m > 0 ? m - 1 : -(o + 1)) + S;
|
|
2068
|
+
return L >= -309 && L <= 307;
|
|
2069
2069
|
}
|
|
2070
2070
|
let A = S - f;
|
|
2071
2071
|
return A >= -308 && A <= 308;
|
|
@@ -2294,7 +2294,7 @@ var Gt, ot, Hi, T, me = {
|
|
|
2294
2294
|
}
|
|
2295
2295
|
}
|
|
2296
2296
|
e.Blocked = A;
|
|
2297
|
-
class
|
|
2297
|
+
class L extends n {
|
|
2298
2298
|
constructor(R, F) {
|
|
2299
2299
|
super(t.Unknown, r.Unknown, R, F);
|
|
2300
2300
|
}
|
|
@@ -2302,7 +2302,7 @@ var Gt, ot, Hi, T, me = {
|
|
|
2302
2302
|
this.code = T.Code.Unknown;
|
|
2303
2303
|
}
|
|
2304
2304
|
}
|
|
2305
|
-
e.Unknown =
|
|
2305
|
+
e.Unknown = L;
|
|
2306
2306
|
class h extends n {
|
|
2307
2307
|
constructor(R, F) {
|
|
2308
2308
|
super(t.Field, r.Field, R, F);
|
|
@@ -2448,7 +2448,6 @@ var Wi = class {
|
|
|
2448
2448
|
getSheetCount() {
|
|
2449
2449
|
return 1;
|
|
2450
2450
|
}
|
|
2451
|
-
markVolatile() {}
|
|
2452
2451
|
defer(e, t) {}
|
|
2453
2452
|
formatResults(e) {}
|
|
2454
2453
|
filterHidden(e, t) {
|
|
@@ -2531,12 +2530,12 @@ var Wi = class {
|
|
|
2531
2530
|
getOS: () => "unknown",
|
|
2532
2531
|
getUser: () => "unidentified",
|
|
2533
2532
|
getDescription: () => "Stubbed Formula Context"
|
|
2534
|
-
}, qi = 2958465,
|
|
2533
|
+
}, qi = 2958465, Le = new Wi(), Zi = class {
|
|
2535
2534
|
constructor() {
|
|
2536
|
-
this._scope =
|
|
2535
|
+
this._scope = Le, this._argsFn = null;
|
|
2537
2536
|
}
|
|
2538
2537
|
_setScope(e) {
|
|
2539
|
-
this._scope = e ??
|
|
2538
|
+
this._scope = e ?? Le;
|
|
2540
2539
|
}
|
|
2541
2540
|
_getScope() {
|
|
2542
2541
|
return this._scope;
|
|
@@ -2570,7 +2569,7 @@ var Wi = class {
|
|
|
2570
2569
|
}
|
|
2571
2570
|
parseAsLiteral(e) {
|
|
2572
2571
|
let t = this._getScope();
|
|
2573
|
-
return t.parseAsLiteral ? t.parseAsLiteral(e) :
|
|
2572
|
+
return t.parseAsLiteral ? t.parseAsLiteral(e) : Le.parseAsLiteral(e);
|
|
2574
2573
|
}
|
|
2575
2574
|
toText(e) {
|
|
2576
2575
|
return this._getScope().toText(e);
|
|
@@ -2638,9 +2637,6 @@ var Wi = class {
|
|
|
2638
2637
|
getSheetCount() {
|
|
2639
2638
|
return this._getScope().getSheetCount?.() ?? 1;
|
|
2640
2639
|
}
|
|
2641
|
-
markVolatile() {
|
|
2642
|
-
this._getScope().markVolatile?.();
|
|
2643
|
-
}
|
|
2644
2640
|
defer(e, t) {
|
|
2645
2641
|
return this._getScope().defer?.(e, t);
|
|
2646
2642
|
}
|
|
@@ -2660,14 +2656,14 @@ var Wi = class {
|
|
|
2660
2656
|
return this._getScope().getAddress(e, t);
|
|
2661
2657
|
}
|
|
2662
2658
|
compare(e, t, r) {
|
|
2663
|
-
return this._getScope().compare?.(e, t, r) ??
|
|
2659
|
+
return this._getScope().compare?.(e, t, r) ?? Le.compare(e, t, r);
|
|
2664
2660
|
}
|
|
2665
2661
|
getRuntime() {
|
|
2666
2662
|
return this._getScope().getRuntime();
|
|
2667
2663
|
}
|
|
2668
2664
|
createRichData(e, t) {
|
|
2669
2665
|
let r = this._getScope();
|
|
2670
|
-
return r.createRichData ? r.createRichData(e, t) :
|
|
2666
|
+
return r.createRichData ? r.createRichData(e, t) : Le.createRichData(e, t);
|
|
2671
2667
|
}
|
|
2672
2668
|
getArgs() {
|
|
2673
2669
|
let e = this._argsFn, t = e ? e() : null;
|
|
@@ -2887,7 +2883,7 @@ const ua = /* @__PURE__ */ new Map([["Volatile", () => ({ volatile: !0 })], [\`\
|
|
|
2887
2883
|
case n.PrefixUnaryExpression: return r.operator === n.MinusToken && r.operand?.kind === n.NumericLiteral ? -parseFloat(r.operand.text) : void 0;
|
|
2888
2884
|
default: return;
|
|
2889
2885
|
}
|
|
2890
|
-
},
|
|
2886
|
+
}, ke = (e) => {
|
|
2891
2887
|
if (!e || e.length === 0) return "";
|
|
2892
2888
|
let t = "";
|
|
2893
2889
|
for (let r = 0; r < e.length; r++) {
|
|
@@ -2963,7 +2959,7 @@ function fa(e, t, r, n) {
|
|
|
2963
2959
|
te(M[0], U, _, !1, { count: 0 }), z = U.scalar ?? "*";
|
|
2964
2960
|
}
|
|
2965
2961
|
return v.lambda = z, !0;
|
|
2966
|
-
},
|
|
2962
|
+
}, L = (u, p, v, _) => {
|
|
2967
2963
|
if (!_) {
|
|
2968
2964
|
o(u, E.FunctionReturn, \`Function type is not a valid return type: '\${f(u)}'. Declare a 'Lambda' return instead.\`);
|
|
2969
2965
|
return;
|
|
@@ -2973,7 +2969,7 @@ function fa(e, t, r, n) {
|
|
|
2973
2969
|
C && (C.kind === e.SyntaxKind.AnyKeyword ? z = "raw" : (te(C, M, v, !1, { count: 0 }), z = M.scalar ?? "*"));
|
|
2974
2970
|
const U = u.parameters;
|
|
2975
2971
|
U && !U.some(($) => $.dotDotDotToken) && (p.lambdaArity = U.length), p.lambda = z;
|
|
2976
|
-
}, h = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Set(), K = /* @__PURE__ */ new WeakSet(),
|
|
2972
|
+
}, h = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Set(), K = /* @__PURE__ */ new WeakSet(), k = (u) => u !== void 0 && u.getSourceFile() === t, R = (u, p = !1) => {
|
|
2977
2973
|
return u.getJsDocTags(r).find((_) => _.name === "name")?.text?.map((_) => _.text).join("").trim() || (p ? lr.camelToPrettyCase(u.name) : u.name);
|
|
2978
2974
|
}, F = (u) => {
|
|
2979
2975
|
const p = u.getJsDocTags(r).find((v) => v.name === "deprecated");
|
|
@@ -2998,7 +2994,7 @@ function fa(e, t, r, n) {
|
|
|
2998
2994
|
const M = [];
|
|
2999
2995
|
let z = !1;
|
|
3000
2996
|
if (C && C.flags & e.SymbolFlags.Enum) {
|
|
3001
|
-
if (!C.declarations?.some(
|
|
2997
|
+
if (!C.declarations?.some(k)) {
|
|
3002
2998
|
o(u, E.EnumNotLocal, \`'\${C.name}' is not declared in this module: '\${p}'. An enum must be declared in the module that uses it.\`);
|
|
3003
2999
|
return;
|
|
3004
3000
|
}
|
|
@@ -3016,7 +3012,7 @@ function fa(e, t, r, n) {
|
|
|
3016
3012
|
R(x, !0),
|
|
3017
3013
|
V,
|
|
3018
3014
|
I,
|
|
3019
|
-
|
|
3015
|
+
ke(x.getDocumentationComment(r)),
|
|
3020
3016
|
F(x)
|
|
3021
3017
|
]);
|
|
3022
3018
|
}), g) {
|
|
@@ -3042,7 +3038,7 @@ function fa(e, t, r, n) {
|
|
|
3042
3038
|
V.sort((N, ne) => O(N) - O(ne));
|
|
3043
3039
|
}
|
|
3044
3040
|
const Q = C && C.flags & e.SymbolFlags.Variable ? C.valueDeclaration : void 0, he = new Set(V);
|
|
3045
|
-
if (C && Q &&
|
|
3041
|
+
if (C && Q && k(Q)) for (const P of r.getTypeOfSymbolAtLocation(C, Q).getProperties()) {
|
|
3046
3042
|
const O = P.valueDeclaration, N = r.getTypeOfSymbolAtLocation(P, O ?? Q);
|
|
3047
3043
|
if (!(N.flags & (e.TypeFlags.NumberLiteral | e.TypeFlags.StringLiteral))) continue;
|
|
3048
3044
|
const ne = N.value;
|
|
@@ -3050,7 +3046,7 @@ function fa(e, t, r, n) {
|
|
|
3050
3046
|
R(P, !0),
|
|
3051
3047
|
ne,
|
|
3052
3048
|
O,
|
|
3053
|
-
|
|
3049
|
+
ke(P.getDocumentationComment(r)),
|
|
3054
3050
|
F(P)
|
|
3055
3051
|
]));
|
|
3056
3052
|
}
|
|
@@ -3086,7 +3082,7 @@ function fa(e, t, r, n) {
|
|
|
3086
3082
|
] : [g, x])
|
|
3087
3083
|
};
|
|
3088
3084
|
C ? h.set(C, G) : y.set($, G);
|
|
3089
|
-
const X = C ?
|
|
3085
|
+
const X = C ? ke(C.getDocumentationComment(r)) : "", j = {};
|
|
3090
3086
|
for (const [g, , , x] of M) x && (j[g] = { description: x });
|
|
3091
3087
|
if (X || Object.keys(j).length > 0) {
|
|
3092
3088
|
const g = {};
|
|
@@ -3410,7 +3406,7 @@ function fa(e, t, r, n) {
|
|
|
3410
3406
|
const V = p.enum;
|
|
3411
3407
|
V && !x && (o(j[0], E.EnumPosition, \`'\${$}' cannot hold the enum '\${V.id}': '\${f(u)}'. The members of a range reach the body as they are, so nothing checks them against the enum. Take the enum as a value, or type the range by its scalar ('\${$}<\${V.type}>').\`), delete p.enum);
|
|
3412
3408
|
}
|
|
3413
|
-
} else u.kind === e.SyntaxKind.FunctionType &&
|
|
3409
|
+
} else u.kind === e.SyntaxKind.FunctionType && L(u, p, v, _);
|
|
3414
3410
|
}, Ze = (u) => (e.getCombinedModifierFlags(u) & e.ModifierFlags.Export) !== 0, Ie = (u) => (e.getCombinedModifierFlags(u) & e.ModifierFlags.Default) !== 0;
|
|
3415
3411
|
try {
|
|
3416
3412
|
e.forEachChild(t, (u) => {
|
|
@@ -3427,7 +3423,7 @@ function fa(e, t, r, n) {
|
|
|
3427
3423
|
const v = {}, _ = { parameters: {} };
|
|
3428
3424
|
try {
|
|
3429
3425
|
v.name = p;
|
|
3430
|
-
const C = r.getSymbolAtLocation(u.name), M =
|
|
3426
|
+
const C = r.getSymbolAtLocation(u.name), M = ke(C?.getDocumentationComment(r));
|
|
3431
3427
|
M && (_.summary = M);
|
|
3432
3428
|
const z = {};
|
|
3433
3429
|
b = null, S(u.type, z, v, !1), v.returnType = z;
|
|
@@ -3525,7 +3521,7 @@ function fa(e, t, r, n) {
|
|
|
3525
3521
|
const ce = { description: "" };
|
|
3526
3522
|
_.parameters[N.name] = ce;
|
|
3527
3523
|
const Qe = r.getSymbolAtLocation(O.name);
|
|
3528
|
-
ce.description =
|
|
3524
|
+
ce.description = ke(Qe?.getDocumentationComment(r)), ae !== void 0 && (N.defaultValue = ae);
|
|
3529
3525
|
for (const ue of [N, ...N.repeating ?? []]) {
|
|
3530
3526
|
const Se = ue.enum ? w.get(ue.enum) : void 0;
|
|
3531
3527
|
Se && ((_.enums ??= {})[ue.enum.id] = Se);
|
|
@@ -3913,12 +3909,12 @@ async function Ia(e) {
|
|
|
3913
3909
|
getDefaultLibFileName: (p) => o,
|
|
3914
3910
|
getNewLine: () => \`
|
|
3915
3911
|
\`
|
|
3916
|
-
},
|
|
3912
|
+
}, L = i.createProgram([
|
|
3917
3913
|
m,
|
|
3918
3914
|
f,
|
|
3919
3915
|
...l ? [st, nr] : []
|
|
3920
|
-
], c, A), h =
|
|
3921
|
-
|
|
3916
|
+
], c, A), h = L.getTypeChecker(), y = L.getSourceFile(m), w = e.runGuard;
|
|
3917
|
+
L.emit(void 0, void 0, void 0, void 0, w ? { before: [Sa(i, w.key, w.timeoutMs)] } : void 0), s = b[\`\${d}.js\`] ?? "";
|
|
3922
3918
|
const D = (p) => ({
|
|
3923
3919
|
start: p.start ?? 0,
|
|
3924
3920
|
length: p.length ?? 0,
|
|
@@ -3926,14 +3922,14 @@ async function Ia(e) {
|
|
|
3926
3922
|
code: \`TS\${p.code}\`,
|
|
3927
3923
|
message: i.flattenDiagnosticMessageText(p.messageText, \`
|
|
3928
3924
|
\`)
|
|
3929
|
-
}), K =
|
|
3925
|
+
}), K = L.getSyntacticDiagnostics(y).map(D), k = l ? L.getSemanticDiagnostics(y).filter((p) => p.category === i.DiagnosticCategory.Error || p.category === i.DiagnosticCategory.Warning).map(D) : [], R = fa(i, y, h, {
|
|
3930
3926
|
builtInNames: e.builtInNames,
|
|
3931
3927
|
isBuiltIn: e.isBuiltIn,
|
|
3932
3928
|
lenient: e.lenient
|
|
3933
3929
|
});
|
|
3934
3930
|
let F = [
|
|
3935
3931
|
...K,
|
|
3936
|
-
...
|
|
3932
|
+
...k,
|
|
3937
3933
|
...R.diagnostics
|
|
3938
3934
|
];
|
|
3939
3935
|
e.lenient && (F = F.filter((p) => p.code !== E.MissingType));
|
|
@@ -4,7 +4,7 @@ var t = class {
|
|
|
4
4
|
}
|
|
5
5
|
async getWorkerWrapper() {
|
|
6
6
|
if (this.workerWrapper) return this.workerWrapper;
|
|
7
|
-
const { createCompilerWorker: r } = await import("./
|
|
7
|
+
const { createCompilerWorker: r } = await import("./DYo_7j0y20wRtntJ.mjs");
|
|
8
8
|
return this.workerWrapper = await r(), this.workerWrapper;
|
|
9
9
|
}
|
|
10
10
|
async compileModule(r) {
|
package/browser/esm/index.mjs
CHANGED
|
@@ -50,7 +50,7 @@ var k = Object.freeze({ compile: async function(t) {
|
|
|
50
50
|
if (l && f.deepEqual(l, t)) return a;
|
|
51
51
|
const n = await (await (async function() {
|
|
52
52
|
if (o) return o;
|
|
53
|
-
const { TypeScriptCompiler: e } = await import("./
|
|
53
|
+
const { TypeScriptCompiler: e } = await import("./Dxfyqtw07s-Dtn7T.mjs");
|
|
54
54
|
return o = new e();
|
|
55
55
|
})()).compileModule(t);
|
|
56
56
|
return a = n, l = t, n;
|
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.8.0-beta.
|
|
4
|
+
"version": "0.8.0-beta.19",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"scripting"
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@sheetxl/primitives": "^0.8.0-beta.
|
|
43
|
-
"@sheetxl/utils": "^0.8.0-beta.
|
|
42
|
+
"@sheetxl/primitives": "^0.8.0-beta.19",
|
|
43
|
+
"@sheetxl/utils": "^0.8.0-beta.19"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"esbuild-wasm": ">=0.25.7",
|