@sheetxl/scripting-react 0.8.0-beta.18 → 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.
- package/browser/esm/{vfb7JLXYahZvaC5V.mjs → BABZf5_WlcHJ5K5Z.mjs} +1 -1
- package/browser/esm/{mYcbn_vPBAVBNd6p.mjs → BPL0QmFHDQUQM7Uf.mjs} +2 -2
- package/browser/esm/{Cr2g76sGtdqfR5fr.mjs → DoydgeYxGhrTsc6h.mjs} +1 -1
- package/browser/esm/index.mjs +5 -7
- package/node/esm/index.mjs +37 -39
- package/package.json +6 -6
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/scripting-react - Scripting React - Monaco based script editor and scripting UI for SheetXL. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/scripting-react - Scripting React - Monaco based script editor and scripting UI for SheetXL. - v0.8.0-beta.19
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/scripting-react - Scripting React - Monaco based script editor and scripting UI for SheetXL. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/scripting-react - Scripting React - Monaco based script editor and scripting UI for SheetXL. - v0.8.0-beta.19
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
6
6
|
*/
|
|
7
|
-
import { t as e } from "./
|
|
7
|
+
import { t as e } from "./DoydgeYxGhrTsc6h.mjs";
|
|
8
8
|
var t = e((e) => {
|
|
9
9
|
Object.defineProperty(e, "__esModule", { value: !0 }), e.DummySourceCache = void 0, e.DummySourceCache = function() {
|
|
10
10
|
function e() {}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/scripting-react - Scripting React - Monaco based script editor and scripting UI for SheetXL. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/scripting-react - Scripting React - Monaco based script editor and scripting UI for SheetXL. - v0.8.0-beta.19
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
package/browser/esm/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`._script-editor_1kuph_5{& .monaco-editor{position:absolute;& .margin-icon{background-position:50%;background-repeat:no-repeat;background-size:contain;width:16px;height:16px;display:block}& .formula{cursor:pointer;background-image:url("data:image/svg+xml;utf8,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" fill=\\"grey\\"><path d=\\"m 12.106007,8.1692949 c 0.124174,-0.1578352 0.181773,-0.3565642 0.283755,-0.5271169 0.10273,-0.1715492 0.04413,-0.2027176 -0.129161,-0.2014713 -0.685452,0.00576 -1.371152,-0.00277 -2.056604,0.00501 C 10.021228,7.4479573 9.9586414,7.407817 9.9935503,7.2080883 10.145401,6.3413623 10.291269,5.4736396 10.51219,4.6213758 10.642847,4.1167002 10.782479,3.6117747 11.061498,3.1622046 11.339518,2.7138809 11.726751,2.5974365 12.2035,2.829328 c 0.398455,0.1934923 0.722604,0.4827333 0.990152,0.8340617 0.116944,0.1535968 0.27079,0.2740306 0.449073,0.1715499 0.343348,-0.1974819 0.644807,-0.4383502 0.819599,-0.826332 0.100985,-0.2244112 0.157836,-0.476001 0.04039,-0.7058977 C 14.339646,1.9840253 14.038187,1.7618584 13.707056,1.6394296 13.156999,1.4362128 12.562559,1.4840872 12.017239,1.6758341 11.38789,1.8970037 10.783727,2.2625445 10.259602,2.6724688 10.066109,2.8238217 9.8783519,2.9839017 9.7013165,3.1547035 9.0502751,3.7823067 8.5657962,4.529097 8.2246919,5.3651534 7.9823276,5.9595939 7.7888351,6.5660026 7.6913412,7.2015842 7.673637,7.318528 7.6357391,7.423253 7.5065759,7.4432009 7.3472438,7.4678879 7.1592376,7.4436995 6.9974121,7.4441728 6.6351128,7.4451447 6.2598478,7.3676233 5.9915515,7.6815496 5.8721151,7.8211835 5.7461952,7.9840062 5.6439635,8.1371045 c -0.1009847,0.1518511 -0.093255,0.3002122 0.085027,0.367535 0.1957362,0.073561 0.4528118,0.026182 0.6530361,0.0197 0.2645558,-0.00847 0.5291116,0.00501 0.7936674,-7.476e-4 0.1820229,-0.00374 0.2413669,0.030421 0.2064588,0.2358807 C 7.3487406,8.9587006 7.3095941,9.1492003 7.2804197,9.3464333 7.1804317,10.024404 7.0667304,10.700629 6.9525298,11.376606 6.7936963,12.314146 6.6371075,13.252434 6.4655575,14.188478 6.3017374,15.082631 6.1855427,15.985013 5.983074,16.873433 5.8249883,17.568607 5.7240037,18.277248 5.5556954,18.969682 5.4145655,19.550158 5.293882,20.143601 4.9722259,20.665731 4.7380909,21.045734 4.3959882,21.206312 3.9663652,21.104829 3.5778849,21.012322 3.2115961,20.866205 2.8951763,20.608631 2.6862246,20.438328 2.4473513,20.31141 2.1920214,20.458026 1.9519014,20.595915 1.7791048,20.851743 1.646453,21.088123 1.2205704,21.847879 1.915497,22.569984 2.6655289,22.684434 3.1692071,22.760986 3.666153,22.580208 4.1087416,22.356046 4.6996913,22.056582 5.2103511,21.635437 5.6387269,21.13874 5.9898058,20.731558 6.3575906,20.343327 6.6500737,19.890016 6.8450616,19.58756 7.0238427,19.274881 7.1866655,18.954471 7.7639005,17.817206 8.1227091,16.589926 8.4189318,15.354418 8.5613081,14.760227 8.716401,14.169777 8.8478064,13.572843 9.0268365,12.760724 9.1741996,11.934891 9.3083481,11.114294 9.3749255,10.707112 9.4310263,10.300679 9.5160532,9.8967389 9.5861222,9.5636133 9.6442168,9.2185186 9.6890985,8.8814035 9.7414633,8.4891827 9.990308,8.5136187 10.329668,8.4762164 c 0.286249,-0.03167 0.574492,-0.046376 0.861739,-0.067571 0.230395,-0.016703 0.494951,0.00396 0.711881,-0.088019 0.07754,-0.032911 0.147613,-0.080788 0.202719,-0.1513533 z\\"/><path d=\\"M 22.473802,7.8481382 C 22.426924,7.6912996 22.341898,7.5501696 22.231437,7.4294861 22.130452,7.3192756 21.987827,7.1749046 21.851933,7.1098255 21.411589,6.8988785 20.817398,7.0838898 20.436149,7.3422154 20.23343,7.479854 20.052405,7.6519026 19.871131,7.8167201 19.691352,7.9802913 19.517061,8.1488492 19.35723,8.3321177 19.025101,8.7128687 18.724639,9.1210479 18.436396,9.5354601 18.296263,9.7374301 17.901549,10.472252 17.781115,10.399942 17.654198,10.323892 17.495365,9.5905657 17.435023,9.3843566 17.351243,9.0978583 17.29539,8.8016361 17.161741,8.5323425 16.97922,8.1643081 16.865268,7.7623629 16.608941,7.4307332 16.325934,7.0639457 16.001036,6.9584722 15.558946,7.092371 c -0.43436,0.1314054 -0.78469,0.4049374 -1.128539,0.6819608 -0.503927,0.4056851 -0.879442,0.926319 -1.256951,1.4439609 -0.28226,0.387483 -0.284753,0.3857373 0.04488,0.7380631 0.206458,0.2211702 0.202718,0.2184272 0.389229,-0.00847 0.2663,-0.3251469 0.524872,-0.6595196 0.882433,-0.8934057 0.261315,-0.1713009 0.417904,-0.1368908 0.57948,0.1326518 0.07929,0.1326517 0.146866,0.2752777 0.200225,0.4208957 0.335619,0.9141014 0.590201,1.8541344 0.89191,2.7784594 0.03815,0.117691 -0.01122,0.193991 -0.06707,0.278519 -0.356565,0.538837 -0.719363,1.074182 -1.123054,1.578607 -0.320409,0.401198 -0.643312,0.803891 -1.073932,1.097621 -0.187757,0.128912 -0.40768,0.217679 -0.635831,0.156839 -0.233887,-0.06283 -0.37377,-0.27478 -0.587459,-0.373521 -0.006,-0.003 -0.01272,-0.0052 -0.01895,-0.0079 -0.09974,-0.04064 -0.249845,-0.0389 -0.353074,-0.01571 -0.454059,0.102482 -0.697669,0.614139 -0.790177,1.023813 -0.08379,0.371776 -0.0013,0.778209 0.261315,1.062463 0.228899,0.24785 0.572248,0.351327 0.901634,0.356315 0.189003,0.0028 0.39995,-0.04663 0.57549,-0.11445 0.670241,-0.262062 1.181649,-0.887172 1.605038,-1.441717 0.285501,-0.374517 0.550555,-0.763994 0.829573,-1.143499 0.230645,-0.313677 0.68595,-1.247726 0.81586,-1.250718 0.07854,-0.0017 0.09924,0.185762 0.114199,0.241117 0.03341,0.123675 0.06658,0.247351 0.102232,0.370279 0.167561,0.578481 0.343848,1.156464 0.525122,1.730458 0.120934,0.384242 0.315921,0.782697 0.560779,1.103356 0.07431,0.09749 0.167311,0.190749 0.26306,0.266799 0.371276,0.296972 0.838799,0.27453 1.266177,0.123177 0.191498,-0.06757 0.370029,-0.163071 0.539335,-0.275527 0.781948,-0.519886 1.340732,-1.244235 1.868598,-2.002495 0.124423,-0.178781 0.107467,-0.278769 -0.03441,-0.428127 -0.367286,-0.386237 -0.357062,-0.389727 -0.705149,0.01995 -0.261066,0.306446 -0.527117,0.612643 -0.879442,0.818851 -0.245855,0.144621 -0.413416,0.103229 -0.592696,-0.118439 -0.14861,-0.183518 -0.246353,-0.396709 -0.33138,-0.614886 -0.349831,-0.901136 -0.588954,-1.838675 -0.885177,-2.757515 -0.21743,-0.674231 -0.223414,-0.680464 0.20945,-1.248723 0.447575,-0.587708 0.875703,-1.1968602 1.462163,-1.6613914 0.431119,-0.3416031 0.73183,-0.3226534 1.129037,0.059094 0.0788,0.075801 0.207456,0.1388856 0.316919,0.1476127 0.369781,0.029674 0.691187,-0.3024566 0.880939,-0.5792304 0.188006,-0.2727835 0.259319,-0.6183768 0.163072,-0.9392845 z\\"/></svg>")}& .macro{cursor:pointer;background-image:url("data:image/svg+xml;utf8,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" fill=\\"grey\\"><path d=\\"m 7.3808594,2.8925781 c 0.6501558,0 1.3048608,0.1705676 1.8886719,0.5078125 l 9.2343747,5.3242188 c 1.167878,0.6758404 1.882813,1.9216266 1.882813,3.2675786 0,1.306438 -0.674828,2.517089 -1.783203,3.205078 L 9.2617188,20.595703 C 8.1035923,21.277644 6.6635531,21.275631 5.4960937,20.589844 4.3295773,19.917617 3.6132812,18.67473 3.6132813,17.330078 V 6.6660156 c 0,-1.3461361 0.7160606,-2.5932648 1.8828124,-3.265625 C 6.0817308,3.0628871 6.7318751,2.8925781 7.3808594,2.8925781 Z M 7.375,5.1835937 C 7.1238145,5.188954 6.883074,5.2521559 6.6601562,5.3691406 l -0.00781,0.00586 -0.00781,0.00391 C 6.1849913,5.6446615 5.9023438,6.1366335 5.9023437,6.6660156 V 17.330078 c 0,0.524949 0.2791508,1.016586 0.7363282,1.275391 0.4554716,0.266714 1.013907,0.272881 1.4785156,0.0098 l 9.2441405,-5.34375 c 0.450764,-0.263898 0.736328,-0.74603 0.736328,-1.27539 0,-0.52882 -0.290494,-1.018444 -0.742187,-1.277344 L 8.1171875,5.3789062 C 7.8951499,5.2512094 7.6461047,5.183439 7.375,5.1835937 Z\\"/></svg>")}& .autorun{cursor:pointer;background-image:url("data:image/svg+xml;utf8,<svg xmlns=\\"http://www.w3.org/2000/svg\\" viewBox=\\"0 0 24 24\\" fill=\\"grey\\"><path d=\\"m 11.999964,1.7500508 c -0.462401,0 -0.923676,0.3281109 -0.924272,0.9260918 V 13.159721 c -0.0012,1.23176 1.847315,1.231936 1.848545,0 V 2.6761426 c 5.97e-4,-0.598201 -0.461872,-0.9260918 -0.924273,-0.9260918 z m 5.998674,2.6454569 c -0.728133,0.068914 -1.207022,1.0512547 -0.5149,1.63931 1.880223,1.6037705 2.962848,3.9512403 2.962038,6.4226023 -4.23e-4,4.655627 -3.790565,8.443993 -8.445812,8.443993 -4.6552096,0 -8.443993,-3.789762 -8.443993,-8.445813 C 3.5560359,10.008191 4.6172167,7.6804932 6.4634264,6.0784841 7.4240529,5.2735715 6.1821863,3.8462722 5.2535029,4.6829783 -1.9571321,10.940557 2.4945266,22.78839 12.039992,22.749957 21.585452,22.711525 25.944958,10.82919 18.684564,4.6302147 18.515847,4.4852865 18.331563,4.4098479 18.146012,4.3955077 c -0.05049,-0.0039 -0.09883,-0.00459 -0.147374,0 z\\"/></svg>")}}}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|
|
2
2
|
/**
|
|
3
|
-
* @license @sheetxl/scripting-react - Scripting React - Monaco based script editor and scripting UI for SheetXL. - v0.8.0-beta.
|
|
3
|
+
* @license @sheetxl/scripting-react - Scripting React - Monaco based script editor and scripting UI for SheetXL. - v0.8.0-beta.19
|
|
4
4
|
*
|
|
5
5
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
6
6
|
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
7
7
|
*/
|
|
8
|
-
import { n as e } from "./
|
|
8
|
+
import { n as e } from "./DoydgeYxGhrTsc6h.mjs";
|
|
9
9
|
import { Suspense as t, forwardRef as n, memo as r, useEffect as i, useMemo as a, useRef as o, useState as s, version as c } from "react";
|
|
10
10
|
import { createRoot as l } from "react-dom/client";
|
|
11
11
|
import { CommonUtils as u, TimerUtils as d, defineLazyModule as f, messageKey as p } from "@sheetxl/utils";
|
|
@@ -392,7 +392,7 @@ var le = parseInt(c.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
392
392
|
}
|
|
393
393
|
});
|
|
394
394
|
})();
|
|
395
|
-
let [e] = await Promise.all([import("./
|
|
395
|
+
let [e] = await Promise.all([import("./BABZf5_WlcHJ5K5Z.mjs"), _e().catch((e) => {
|
|
396
396
|
console.warn("cant load types", e);
|
|
397
397
|
})]);
|
|
398
398
|
return e;
|
|
@@ -413,7 +413,7 @@ var le = parseInt(c.split(".")[0], 10) >= 19 ? function(e) {
|
|
|
413
413
|
children: n("scriptEditor.retry")
|
|
414
414
|
}) : null]
|
|
415
415
|
});
|
|
416
|
-
}, N = _(he.load, { renderError: ({ error: e }) => b(M, { error: e }) }), P = ["define", "require"], ge = !1, F = "@0.8.0-beta.
|
|
416
|
+
}, N = _(he.load, { renderError: ({ error: e }) => b(M, { error: e }) }), P = ["define", "require"], ge = !1, F = "@0.8.0-beta.19";
|
|
417
417
|
F !== "@local" && F !== "@0.0.0" || (F = "");
|
|
418
418
|
var I = `https://cdn.jsdelivr.net/npm/@sheetxl/sdk${F}/types/scripting.d.ts`, L = null, R = null, _e = () => (R || (R = (async () => await (await fetch(I)).text())().then((e) => (L = e, e))).catch(() => {
|
|
419
419
|
R = null;
|
|
@@ -937,7 +937,7 @@ var U = null, W = null, G = null, K = null, xe = !1, Se = !1, q = !1, J = { curr
|
|
|
937
937
|
let r = t.getModel(), i = [];
|
|
938
938
|
_e(!0);
|
|
939
939
|
let a = A(x)?.getSource() ?? "";
|
|
940
|
-
return t.getValue() !== a && t.setValue(a), xe ? (q(""), H(r, n, t), z(n)) : (xe = !0, q("Loading Types"), import("./
|
|
940
|
+
return t.getValue() !== a && t.setValue(a), xe ? (q(""), H(r, n, t), z(n)) : (xe = !0, q("Loading Types"), import("./BPL0QmFHDQUQM7Uf.mjs").then((t) => e(t.default, 1)).then(async (e) => {
|
|
941
941
|
q("");
|
|
942
942
|
let r = e.AutoTypings, i = new e.JsDelivrSourceResolver(), a = (e) => e.startsWith("@sheetxl/") || e.startsWith("@types/sheetxl__");
|
|
943
943
|
r.create(t, {
|
|
@@ -1358,8 +1358,6 @@ var X = {
|
|
|
1358
1358
|
}, Pe = () => {
|
|
1359
1359
|
x.registerTaskPane({
|
|
1360
1360
|
key: "scriptEditor",
|
|
1361
|
-
getTitle: () => "Script (Typescript)",
|
|
1362
|
-
getIcon: () => "ScriptRun",
|
|
1363
1361
|
component: Ne,
|
|
1364
1362
|
keepMounted: !0
|
|
1365
1363
|
}, !0), function() {
|
package/node/esm/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/scripting-react - Scripting React - Monaco based script editor and scripting UI for SheetXL. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/scripting-react - Scripting React - Monaco based script editor and scripting UI for SheetXL. - v0.8.0-beta.19
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: SheetXL EULA — https://www.sheetxl.com/eula
|
|
@@ -355,7 +355,7 @@ var I = {
|
|
|
355
355
|
{ include: "common" }
|
|
356
356
|
]
|
|
357
357
|
}
|
|
358
|
-
}, D = /(?:\s|\/\/[^\n]*|\/\*[\s\S]*?\*\/)*/y, $ = /(import\b\s*(?:type\s+(?!from\b))?)(?:([^'";]*?)\s*\bfrom\s*)?(['"])([^'"\n]+)\3[ \t]*;?/y,
|
|
358
|
+
}, D = /(?:\s|\/\/[^\n]*|\/\*[\s\S]*?\*\/)*/y, $ = /(import\b\s*(?:type\s+(?!from\b))?)(?:([^'";]*?)\s*\bfrom\s*)?(['"])([^'"\n]+)\3[ \t]*;?/y, A = (e) => e.replace(/\s+/g, " ").trim(), R = (e) => {
|
|
359
359
|
const t = [];
|
|
360
360
|
let n = 0;
|
|
361
361
|
for (;;) {
|
|
@@ -370,13 +370,13 @@ var I = {
|
|
|
370
370
|
module: r[4],
|
|
371
371
|
quote: r[3],
|
|
372
372
|
typeOnly: /\btype\s+$/.test(r[1]),
|
|
373
|
-
binding:
|
|
374
|
-
names: c ? o.slice(s + 1, a).split(",").map(
|
|
373
|
+
binding: A(l).replace(/\s*,$/, ""),
|
|
374
|
+
names: c ? o.slice(s + 1, a).split(",").map(A).filter(Boolean) : null,
|
|
375
375
|
namesStart: i + s + 1,
|
|
376
376
|
namesEnd: i + a
|
|
377
377
|
}), n = $.lastIndex;
|
|
378
378
|
}
|
|
379
|
-
},
|
|
379
|
+
}, T = (e) => [
|
|
380
380
|
e.typeOnly,
|
|
381
381
|
e.binding,
|
|
382
382
|
e.names?.join(","),
|
|
@@ -507,7 +507,7 @@ var B, H = p("scripting-react:monaco", async () => {
|
|
|
507
507
|
children: n("scriptEditor.retry")
|
|
508
508
|
}) : null]
|
|
509
509
|
});
|
|
510
|
-
}, q = y(H.load, { renderError: ({ error: e }) => C(U, { error: e }) }), K = ["define", "require"], z = !1, G = "@0.8.0-beta.
|
|
510
|
+
}, q = y(H.load, { renderError: ({ error: e }) => C(U, { error: e }) }), K = ["define", "require"], z = !1, G = "@0.8.0-beta.19";
|
|
511
511
|
"@local" !== G && "@0.0.0" !== G || (G = "");
|
|
512
512
|
var J = `https://cdn.jsdelivr.net/npm/@sheetxl/sdk${G}/types/scripting.d.ts`, X = null, Z = null, Y = () => (Z || (Z = (async () => await (await fetch(J)).text())().then((e) => (X = e, e))).catch(() => {
|
|
513
513
|
Z = null;
|
|
@@ -537,7 +537,7 @@ var J = `https://cdn.jsdelivr.net/npm/@sheetxl/sdk${G}/types/scripting.d.ts`, X
|
|
|
537
537
|
}
|
|
538
538
|
}
|
|
539
539
|
const c = ((e, t) => {
|
|
540
|
-
const n =
|
|
540
|
+
const n = R(e), r = n.length > 0 ? n[n.length - 1].end : 0, o = R(t);
|
|
541
541
|
if (0 === o.length) return {
|
|
542
542
|
body: t,
|
|
543
543
|
inserts: [],
|
|
@@ -548,7 +548,7 @@ var J = `https://cdn.jsdelivr.net/npm/@sheetxl/sdk${G}/types/scripting.d.ts`, X
|
|
|
548
548
|
i = (i + t.slice(s)).replace(/^(?:[ \t]*\r?\n)+/, "");
|
|
549
549
|
const a = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map();
|
|
550
550
|
for (const e of n) {
|
|
551
|
-
if (a.add(
|
|
551
|
+
if (a.add(T(e)), !e.names) continue;
|
|
552
552
|
const t = P(e);
|
|
553
553
|
l.has(t) || l.set(t, e);
|
|
554
554
|
let n = c.get(t);
|
|
@@ -558,7 +558,7 @@ var J = `https://cdn.jsdelivr.net/npm/@sheetxl/sdk${G}/types/scripting.d.ts`, X
|
|
|
558
558
|
const u = /* @__PURE__ */ new Map(), d = [], p = /* @__PURE__ */ new Map();
|
|
559
559
|
for (const e of o) {
|
|
560
560
|
if (!e.names || e.binding) {
|
|
561
|
-
const t =
|
|
561
|
+
const t = T(e);
|
|
562
562
|
if (a.has(t)) continue;
|
|
563
563
|
a.add(t), d.push(e.text);
|
|
564
564
|
continue;
|
|
@@ -839,7 +839,7 @@ var se = null, ae = null, ce = null, le = null, ue = !1, de = !1, pe = !1, me =
|
|
|
839
839
|
}) })
|
|
840
840
|
});
|
|
841
841
|
}, be = n(t((e, t) => {
|
|
842
|
-
const { className: n, style: p, readOnly: g = !1, darkMode: f, loadingPanel: y, autoFocus: v = !0, frame: E, scripts: M, onStatusChange: I, ...D } = e, $ = S(),
|
|
842
|
+
const { className: n, style: p, readOnly: g = !1, darkMode: f, loadingPanel: y, autoFocus: v = !0, frame: E, scripts: M, onStatusChange: I, ...D } = e, $ = S(), A = i(null), [R, T] = s(!1), P = O(), [F] = x(["insertFunction"]), [H, U] = s({
|
|
843
843
|
message: "Loading",
|
|
844
844
|
cursor: "",
|
|
845
845
|
dirty: !1
|
|
@@ -854,7 +854,7 @@ var se = null, ae = null, ce = null, le = null, ue = !1, de = !1, pe = !1, me =
|
|
|
854
854
|
...t,
|
|
855
855
|
...e
|
|
856
856
|
};
|
|
857
|
-
return u.deepEqual(n, t) ? t : (
|
|
857
|
+
return u.deepEqual(n, t) ? t : (T(n.dirty ?? !1), n);
|
|
858
858
|
});
|
|
859
859
|
}, [I]);
|
|
860
860
|
r(() => {
|
|
@@ -869,8 +869,8 @@ var se = null, ae = null, ce = null, le = null, ue = !1, de = !1, pe = !1, me =
|
|
|
869
869
|
}
|
|
870
870
|
return t;
|
|
871
871
|
}, [M]), Y = b(async () => {
|
|
872
|
-
if (!
|
|
873
|
-
const e =
|
|
872
|
+
if (!A.current || g) return;
|
|
873
|
+
const e = A.current.editor;
|
|
874
874
|
let t;
|
|
875
875
|
if (H.dirty) {
|
|
876
876
|
const n = e.getValue();
|
|
@@ -892,7 +892,7 @@ var se = null, ae = null, ce = null, le = null, ue = !1, de = !1, pe = !1, me =
|
|
|
892
892
|
await Y();
|
|
893
893
|
},
|
|
894
894
|
onLoad: () => {
|
|
895
|
-
const e =
|
|
895
|
+
const e = A.current?.editor;
|
|
896
896
|
e && e.setValue(V(M)?.getSource() ?? "");
|
|
897
897
|
}
|
|
898
898
|
});
|
|
@@ -913,8 +913,8 @@ var se = null, ae = null, ce = null, le = null, ue = !1, de = !1, pe = !1, me =
|
|
|
913
913
|
X.showError(e);
|
|
914
914
|
}
|
|
915
915
|
}, [M, X]), [ne, ie] = s(!1), pe = b(async () => {
|
|
916
|
-
if (!
|
|
917
|
-
const e =
|
|
916
|
+
if (!A.current) return null;
|
|
917
|
+
const e = A.current, t = e.editor;
|
|
918
918
|
if (!t) return null;
|
|
919
919
|
const r = await (async (e, t, n = "export") => {
|
|
920
920
|
const r = e.getModel();
|
|
@@ -986,25 +986,25 @@ var se = null, ae = null, ce = null, le = null, ue = !1, de = !1, pe = !1, me =
|
|
|
986
986
|
warnings: o.filter((e) => "warning" === e.severity).map((e) => `${e.code}: ${e.message}`)
|
|
987
987
|
}));
|
|
988
988
|
}, [M]), be = b(d.debounce(ge, 580), []), xe = b(async (e) => {
|
|
989
|
-
if (!
|
|
990
|
-
const t =
|
|
989
|
+
if (!A.current) return;
|
|
990
|
+
const t = A.current.editor.getPosition(), n = { cursor: t ? t.toString() : "" };
|
|
991
991
|
void 0 !== e && (n.message = e), J(n);
|
|
992
992
|
}, []);
|
|
993
993
|
r(() => {}, [q]);
|
|
994
994
|
const we = i(null), ve = b(async () => {
|
|
995
995
|
await Y(), E?.close();
|
|
996
996
|
}, [E]), ke = b((e) => {
|
|
997
|
-
const t =
|
|
997
|
+
const t = A.current?.editor;
|
|
998
998
|
return !!t && (t.focus(e), !0);
|
|
999
999
|
}, [H]), Se = b(async () => {
|
|
1000
|
-
const e =
|
|
1000
|
+
const e = A.current?.editor, t = e?.getModel(), n = e?.getSelection();
|
|
1001
1001
|
if (!t || !n) return;
|
|
1002
1002
|
const r = n.isEmpty() ? t.getLineContent(n.positionLineNumber) + "\n" : t.getValueInRange(n);
|
|
1003
1003
|
try {
|
|
1004
1004
|
await navigator.clipboard?.writeText(r);
|
|
1005
1005
|
} catch {}
|
|
1006
1006
|
}, []), Ce = b(async () => {
|
|
1007
|
-
const e =
|
|
1007
|
+
const e = A.current, t = e?.editor, n = t?.getModel(), r = t?.getSelection();
|
|
1008
1008
|
if (!n || !r) return;
|
|
1009
1009
|
const o = r.isEmpty() ? new e.monaco.Range(r.positionLineNumber, 1, r.positionLineNumber + 1, 1) : r, i = n.getValueInRange(o);
|
|
1010
1010
|
try {
|
|
@@ -1018,7 +1018,7 @@ var se = null, ae = null, ce = null, le = null, ue = !1, de = !1, pe = !1, me =
|
|
|
1018
1018
|
forceMoveMarkers: !0
|
|
1019
1019
|
}]), t.pushUndoStop(), t.focus();
|
|
1020
1020
|
}, []), Ne = b(async () => {
|
|
1021
|
-
const e =
|
|
1021
|
+
const e = A.current?.editor;
|
|
1022
1022
|
if (!e) return;
|
|
1023
1023
|
let t;
|
|
1024
1024
|
try {
|
|
@@ -1034,7 +1034,7 @@ var se = null, ae = null, ce = null, le = null, ue = !1, de = !1, pe = !1, me =
|
|
|
1034
1034
|
forceMoveMarkers: !0
|
|
1035
1035
|
}]), e.pushUndoStop(), e.focus();
|
|
1036
1036
|
}, []), Ee = i(null), Le = b((e, t) => {
|
|
1037
|
-
|
|
1037
|
+
A.current = {
|
|
1038
1038
|
monaco: t,
|
|
1039
1039
|
editor: e
|
|
1040
1040
|
}, me.current = P ?? null;
|
|
@@ -1202,7 +1202,7 @@ var se = null, ae = null, ce = null, le = null, ue = !1, de = !1, pe = !1, me =
|
|
|
1202
1202
|
}, r.render(C(ye, {})), se;
|
|
1203
1203
|
})(e);
|
|
1204
1204
|
return t.props = e, t.setProps?.(e), ce = (e, t) => Le(e, t), Ie.current?.appendChild(t.hostEl), ae && (le = Le(ae.editor, ae.monaco)), () => {
|
|
1205
|
-
le?.(), le = null, ce = null,
|
|
1205
|
+
le?.(), le = null, ce = null, A.current = null, se?.stashEl.appendChild(se.hostEl);
|
|
1206
1206
|
};
|
|
1207
1207
|
}, []), r(() => {
|
|
1208
1208
|
if (!se) return;
|
|
@@ -1213,7 +1213,7 @@ var se = null, ae = null, ce = null, le = null, ue = !1, de = !1, pe = !1, me =
|
|
|
1213
1213
|
};
|
|
1214
1214
|
se.props = e, se.setProps?.(e);
|
|
1215
1215
|
}, [f, Oe]), r(() => {
|
|
1216
|
-
const e =
|
|
1216
|
+
const e = A.current, t = e?.editor;
|
|
1217
1217
|
if (!t) return;
|
|
1218
1218
|
me.current = P ?? null;
|
|
1219
1219
|
const n = V(M)?.getSource() ?? "";
|
|
@@ -1240,29 +1240,29 @@ var se = null, ae = null, ce = null, le = null, ue = !1, de = !1, pe = !1, me =
|
|
|
1240
1240
|
}), $e = w(t, () => ({
|
|
1241
1241
|
isScriptEditorElement: () => !0,
|
|
1242
1242
|
showCommandPalette: () => {
|
|
1243
|
-
|
|
1243
|
+
A.current?.editor && A.current.editor.trigger("keyboard", "editor.action.quickCommand", null);
|
|
1244
1244
|
},
|
|
1245
1245
|
getScripts: () => M,
|
|
1246
1246
|
focus: (e) => {
|
|
1247
1247
|
ke(e);
|
|
1248
1248
|
},
|
|
1249
1249
|
close: () => ve(),
|
|
1250
|
-
insertSnippet: (e) =>
|
|
1250
|
+
insertSnippet: (e) => A.current?.editor ? te(A.current.editor, A.current.monaco, e) : Promise.resolve(),
|
|
1251
1251
|
saveSource: async () => {
|
|
1252
1252
|
await Y();
|
|
1253
1253
|
},
|
|
1254
1254
|
runAction: (e) => {
|
|
1255
|
-
const t =
|
|
1255
|
+
const t = A.current?.editor;
|
|
1256
1256
|
t && (t.focus(), t.trigger("source", e, null));
|
|
1257
1257
|
},
|
|
1258
1258
|
copy: () => Se(),
|
|
1259
1259
|
cut: () => Ce(),
|
|
1260
1260
|
paste: () => Ne()
|
|
1261
|
-
}), [P]), [
|
|
1262
|
-
null !== e &&
|
|
1261
|
+
}), [P]), [Ae, Re] = s(null), Te = b((e) => {
|
|
1262
|
+
null !== e && Re(e);
|
|
1263
1263
|
}, []), Pe = h.useCommandScope();
|
|
1264
1264
|
r(() => {
|
|
1265
|
-
if (!Pe || !
|
|
1265
|
+
if (!Pe || !Ae) return;
|
|
1266
1266
|
const e = Pe.contribution();
|
|
1267
1267
|
return function(e, t) {
|
|
1268
1268
|
const n = t.scriptEditor, r = t;
|
|
@@ -1282,25 +1282,25 @@ var se = null, ae = null, ce = null, le = null, ue = !1, de = !1, pe = !1, me =
|
|
|
1282
1282
|
}
|
|
1283
1283
|
}), e.updateCommand("copy", { callback: () => n.copy() }), e.updateCommand("cut", { callback: () => n.cut() }), e.updateCommand("paste", { callback: () => n.paste() }), e.updateCommand("selectAll", { callback: () => n.runAction("editor.action.selectAll") }), e.updateCommand("find", { callback: () => n.runAction("actions.find") }), e.updateCommand("findReplace", { callback: () => n.runAction("editor.action.startFindReplaceAction") }), e.updateCommand("goto", { callback: () => n.runAction("editor.action.gotoLine") });
|
|
1284
1284
|
}(e, {
|
|
1285
|
-
scriptEditor:
|
|
1286
|
-
isDirty:
|
|
1285
|
+
scriptEditor: Ae,
|
|
1286
|
+
isDirty: R,
|
|
1287
1287
|
readOnly: g
|
|
1288
1288
|
}), () => {
|
|
1289
1289
|
e.remove();
|
|
1290
1290
|
};
|
|
1291
1291
|
}, [
|
|
1292
1292
|
Pe,
|
|
1293
|
-
|
|
1294
|
-
|
|
1293
|
+
Ae,
|
|
1294
|
+
R,
|
|
1295
1295
|
g
|
|
1296
1296
|
]), r(() => (v && requestAnimationFrame(() => {
|
|
1297
1297
|
$e.current?.focus();
|
|
1298
1298
|
}), () => {
|
|
1299
|
-
|
|
1299
|
+
A.current?.editor && requestAnimationFrame(() => {
|
|
1300
1300
|
$e.current?.contains(document.activeElement) && $e.current?.focus();
|
|
1301
1301
|
});
|
|
1302
1302
|
}), []);
|
|
1303
|
-
const Fe = l([$e,
|
|
1303
|
+
const Fe = l([$e, Te]);
|
|
1304
1304
|
return C("div", {
|
|
1305
1305
|
className: c("script-editor", W, n),
|
|
1306
1306
|
style: {
|
|
@@ -1463,8 +1463,6 @@ var Le = (e) => {
|
|
|
1463
1463
|
}, Me = () => {
|
|
1464
1464
|
E.registerTaskPane({
|
|
1465
1465
|
key: "scriptEditor",
|
|
1466
|
-
getTitle: () => "Script (Typescript)",
|
|
1467
|
-
getIcon: () => "ScriptRun",
|
|
1468
1466
|
component: Le,
|
|
1469
1467
|
keepMounted: !0
|
|
1470
1468
|
}, !0), function() {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheetxl/scripting-react",
|
|
3
3
|
"description": "Scripting React - Monaco based script editor and scripting UI for SheetXL.",
|
|
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": {
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@monaco-editor/react": "^4.7.0",
|
|
43
|
-
"@sheetxl/react": "^0.8.0-beta.
|
|
44
|
-
"@sheetxl/scripting": "^0.8.0-beta.
|
|
45
|
-
"@sheetxl/sdk": "^0.8.0-beta.
|
|
46
|
-
"@sheetxl/utils": "^0.8.0-beta.
|
|
47
|
-
"@sheetxl/utils-react": "^0.8.0-beta.
|
|
43
|
+
"@sheetxl/react": "^0.8.0-beta.19",
|
|
44
|
+
"@sheetxl/scripting": "^0.8.0-beta.19",
|
|
45
|
+
"@sheetxl/sdk": "^0.8.0-beta.19",
|
|
46
|
+
"@sheetxl/utils": "^0.8.0-beta.19",
|
|
47
|
+
"@sheetxl/utils-react": "^0.8.0-beta.19",
|
|
48
48
|
"clsx": "^2.1.1",
|
|
49
49
|
"monaco-editor": "~0.55.1",
|
|
50
50
|
"monaco-editor-auto-typings": "^0.4.6",
|