@sheetxl/scripting-mui 0.8.0-beta.11 → 0.8.0-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/browser/esm/index.mjs +170 -157
- package/node/esm/index.mjs +108 -95
- package/package.json +8 -8
- package/resources/locales/de/ui.msg.json +1 -0
- package/resources/locales/en/ui.msg.json +1 -0
package/node/esm/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license @sheetxl/scripting-mui - Scripting MUI - MUI script workspace, toolbar and run-script plugin for SheetXL. - v0.8.0-beta.
|
|
2
|
+
* @license @sheetxl/scripting-mui - Scripting MUI - MUI script workspace, toolbar and run-script plugin for SheetXL. - v0.8.0-beta.12
|
|
3
3
|
*
|
|
4
4
|
* (C) 2026-present SheetXL Inc. & Michael T. Ford
|
|
5
5
|
* License: The license can be found at https://www.sheetxl.com/license.
|
|
@@ -8,10 +8,10 @@ import e, { createElement as t, forwardRef as r, memo as n, useCallback as i, us
|
|
|
8
8
|
import d from "clsx";
|
|
9
9
|
import { Box as p, Button as u, CircularProgress as m, Paper as f, Typography as h, useTheme as g } from "@mui/material";
|
|
10
10
|
import { Command as x, CommandButtonType as y, DefaultCommandButtonRegistry as S, DefaultIconService as b, DynamicIcon as v, KeyCodes as w, ReactUtils as k, useCallbackRef as C, useCommandButtonEntry as F, useCommands as K, useImperativeElement as N, useTranslator as T } from "@sheetxl/utils-react";
|
|
11
|
-
import { AnimatedLoadingPanel as D, CommandButton as
|
|
12
|
-
import { DefaultTaskPaneRegistry as z, InputClipboardInjector as
|
|
13
|
-
import { Fragment as U, jsx as W, jsxs as
|
|
14
|
-
import { alpha as
|
|
11
|
+
import { AnimatedLoadingPanel as D, CommandButton as $, CommandPopupButton as I, CommandToolbar as P, ExhibitDivider as E, ExhibitMenuItem as R, OverflowPalette as L, defaultRenderPopupPanel as M } from "@sheetxl/utils-mui";
|
|
12
|
+
import { DefaultTaskPaneRegistry as z, InputClipboardInjector as O, useModelSync as B, useWorkbook as A } from "@sheetxl/react";
|
|
13
|
+
import { Fragment as U, jsx as W, jsxs as H } from "react/jsx-runtime";
|
|
14
|
+
import { alpha as j } from "@mui/system";
|
|
15
15
|
import { listResources as q, releaseChannel as G } from "@sheetxl/utils";
|
|
16
16
|
import { VERSION as Z } from "@sheetxl/sdk";
|
|
17
17
|
import { ScriptEditor as _, ScriptingReactPlugin as J } from "@sheetxl/scripting-react";
|
|
@@ -29,6 +29,7 @@ var Q = {
|
|
|
29
29
|
"templateSelect.intro": "Choose from a template to provide a starting point to automate tasks or create user defined functions.",
|
|
30
30
|
"templateSelect.intro2": "Templates provide a foundation to customize and meet your specific needs.",
|
|
31
31
|
"templateSelect.loadFailed": "Failed to load scripts",
|
|
32
|
+
"templateSelect.retry": "Retry",
|
|
32
33
|
"templateSelect.title": "Script Template",
|
|
33
34
|
"templateSelect.untitled": "Untitled"
|
|
34
35
|
}, { DefaultCommandCatalogService: V } = x, X = !1;
|
|
@@ -54,7 +55,7 @@ var ee = n(r((e, r) => {
|
|
|
54
55
|
}, h = [], g = s ? s.length : 0;
|
|
55
56
|
for (let e = 0; e < g; e++) {
|
|
56
57
|
const t = s[e];
|
|
57
|
-
h.push(W(
|
|
58
|
+
h.push(W($, {
|
|
58
59
|
...f,
|
|
59
60
|
commandKey: "executeScript",
|
|
60
61
|
commandState: { declaration: t },
|
|
@@ -63,7 +64,7 @@ var ee = n(r((e, r) => {
|
|
|
63
64
|
label: t.getName() ?? a("runScript.fallbackLabel")
|
|
64
65
|
}, `macro-${t.getName()}-${e}`));
|
|
65
66
|
}
|
|
66
|
-
const x =
|
|
67
|
+
const x = H(p, {
|
|
67
68
|
ref: r,
|
|
68
69
|
sx: {
|
|
69
70
|
display: "flex",
|
|
@@ -71,13 +72,13 @@ var ee = n(r((e, r) => {
|
|
|
71
72
|
flex: "1 1 100%",
|
|
72
73
|
overflow: "hidden"
|
|
73
74
|
},
|
|
74
|
-
children: [h.length > 0 ?
|
|
75
|
+
children: [h.length > 0 ? H(U, { children: [W(p, {
|
|
75
76
|
sx: {
|
|
76
77
|
overflow: "auto",
|
|
77
78
|
flex: "1 1 100%"
|
|
78
79
|
},
|
|
79
80
|
children: h
|
|
80
|
-
}), W(
|
|
81
|
+
}), W(E, { orientation: "horizontal" })] }) : null, t($, {
|
|
81
82
|
...f,
|
|
82
83
|
key: "show-editor",
|
|
83
84
|
commandKey: "showScriptEditor"
|
|
@@ -101,10 +102,10 @@ var te = n(r((e, t) => {
|
|
|
101
102
|
children: t
|
|
102
103
|
});
|
|
103
104
|
}, [n, r]);
|
|
104
|
-
return W(
|
|
105
|
+
return W(I, {
|
|
105
106
|
ref: t,
|
|
106
107
|
disabled: n,
|
|
107
|
-
|
|
108
|
+
renderPopupPanel: s,
|
|
108
109
|
selected: l?.getState(),
|
|
109
110
|
label: a?.getLabel?.(),
|
|
110
111
|
tooltip: a?.getDescription?.(),
|
|
@@ -164,7 +165,7 @@ var te = n(r((e, t) => {
|
|
|
164
165
|
iconKey: "ScriptAutoRun",
|
|
165
166
|
size: ue,
|
|
166
167
|
style: pe
|
|
167
|
-
}), W(
|
|
168
|
+
}), W(R, {
|
|
168
169
|
sx: {
|
|
169
170
|
maxWidth: "460px",
|
|
170
171
|
display: "flex",
|
|
@@ -183,7 +184,7 @@ var te = n(r((e, t) => {
|
|
|
183
184
|
e.keyCode !== w.Enter && e.keyCode !== w.Space || i(r);
|
|
184
185
|
},
|
|
185
186
|
...l,
|
|
186
|
-
children:
|
|
187
|
+
children: H(p, {
|
|
187
188
|
sx: {
|
|
188
189
|
display: "flex",
|
|
189
190
|
flex: "1 1 100%",
|
|
@@ -197,7 +198,7 @@ var te = n(r((e, t) => {
|
|
|
197
198
|
variant: "caption",
|
|
198
199
|
component: "div",
|
|
199
200
|
sx: {
|
|
200
|
-
color: (e) =>
|
|
201
|
+
color: (e) => j(e.palette.text.secondary ?? e.palette.text.primary, .6),
|
|
201
202
|
overflow: "hidden",
|
|
202
203
|
textOverflow: "ellipsis"
|
|
203
204
|
},
|
|
@@ -226,7 +227,7 @@ var te = n(r((e, t) => {
|
|
|
226
227
|
}, n = (t) => {
|
|
227
228
|
S?.execute(t.content), e.closeFloat?.();
|
|
228
229
|
}, i = () => x((e) => e + 1), o = [];
|
|
229
|
-
"error" === f && o.push(W(
|
|
230
|
+
"error" === f && o.push(W(R, {
|
|
230
231
|
onMouseDown: (e) => {
|
|
231
232
|
0 === e.button && e.preventDefault();
|
|
232
233
|
},
|
|
@@ -245,7 +246,7 @@ var te = n(r((e, t) => {
|
|
|
245
246
|
snippet: t
|
|
246
247
|
}, t.path));
|
|
247
248
|
}
|
|
248
|
-
const l =
|
|
249
|
+
const l = H(p, {
|
|
249
250
|
sx: {
|
|
250
251
|
display: "flex",
|
|
251
252
|
flexDirection: "column",
|
|
@@ -253,19 +254,19 @@ var te = n(r((e, t) => {
|
|
|
253
254
|
overflow: "hidden"
|
|
254
255
|
},
|
|
255
256
|
children: [
|
|
256
|
-
o.length > 0 ?
|
|
257
|
+
o.length > 0 ? H(U, { children: [W(p, {
|
|
257
258
|
sx: {
|
|
258
259
|
overflow: "auto",
|
|
259
260
|
flex: "1 1 100%"
|
|
260
261
|
},
|
|
261
262
|
children: o
|
|
262
|
-
}), W(
|
|
263
|
-
t(
|
|
263
|
+
}), W(E, { orientation: "horizontal" })] }) : null,
|
|
264
|
+
t($, {
|
|
264
265
|
...r,
|
|
265
266
|
key: "showKeyboardShortcuts",
|
|
266
267
|
commandKey: "showKeyboardShortcuts"
|
|
267
268
|
}),
|
|
268
|
-
t(
|
|
269
|
+
t($, {
|
|
269
270
|
...r,
|
|
270
271
|
key: "scriptingHelp",
|
|
271
272
|
commandKey: "scriptingHelp"
|
|
@@ -284,20 +285,20 @@ var te = n(r((e, t) => {
|
|
|
284
285
|
S,
|
|
285
286
|
d
|
|
286
287
|
]);
|
|
287
|
-
return W(
|
|
288
|
+
return W(I, {
|
|
288
289
|
ref: r,
|
|
289
290
|
disabled: b,
|
|
290
291
|
groupKey: n,
|
|
291
292
|
label: S?.getLabel(n) ?? d("insertScript.fallbackLabel"),
|
|
292
293
|
tooltip: S?.getDescription(),
|
|
293
|
-
|
|
294
|
+
renderPopupPanel: v,
|
|
294
295
|
icon: S?.getIcon() ?? "ScriptInsert",
|
|
295
296
|
...s
|
|
296
297
|
});
|
|
297
298
|
})), he = n(r((e, t) => {
|
|
298
299
|
const { propsCommandButton: r, ...n } = e, i = C((e) => {
|
|
299
300
|
const { propsCommandButton: t, propsCommandPopup: r } = e;
|
|
300
|
-
return W(U, { children:
|
|
301
|
+
return W(U, { children: H("div", {
|
|
301
302
|
style: {
|
|
302
303
|
display: "flex",
|
|
303
304
|
flex: "1 1 100%"
|
|
@@ -305,7 +306,7 @@ var te = n(r((e, t) => {
|
|
|
305
306
|
children: [
|
|
306
307
|
W("div", { children: W(L, {
|
|
307
308
|
style: {},
|
|
308
|
-
children: W(
|
|
309
|
+
children: W($, {
|
|
309
310
|
...t,
|
|
310
311
|
commandKey: "saveScripts"
|
|
311
312
|
})
|
|
@@ -327,7 +328,7 @@ var te = n(r((e, t) => {
|
|
|
327
328
|
}));
|
|
328
329
|
he.displayName = "ScriptEditorToolbar", Y();
|
|
329
330
|
var ge = n(r((e, t) => {
|
|
330
|
-
const { scriptPath: r = ne, onScriptSelect: n, disabled: i = !1, sx: l = k.EmptyCssProperties, className: a, buttonMinWidth: s = 210, buttonMinHeight: f = 80, gap: g = 12, ...x } = e, y = T(), [S, b] = c([]), [w, C] = c(!0), [F, K] = c(null);
|
|
331
|
+
const { scriptPath: r = ne, onScriptSelect: n, disabled: i = !1, sx: l = k.EmptyCssProperties, className: a, buttonMinWidth: s = 210, buttonMinHeight: f = 80, gap: g = 12, ...x } = e, y = T(), [S, b] = c([]), [w, C] = c(!0), [F, K] = c(null), [N, D] = c(0);
|
|
331
332
|
if (o(() => {
|
|
332
333
|
let e = !1;
|
|
333
334
|
const t = {
|
|
@@ -345,7 +346,11 @@ var ge = n(r((e, t) => {
|
|
|
345
346
|
}), () => {
|
|
346
347
|
e = !0;
|
|
347
348
|
};
|
|
348
|
-
}, [
|
|
349
|
+
}, [
|
|
350
|
+
r,
|
|
351
|
+
y,
|
|
352
|
+
N
|
|
353
|
+
]), w) return W(p, {
|
|
349
354
|
className: d(a, "script-select"),
|
|
350
355
|
...x,
|
|
351
356
|
sx: [{
|
|
@@ -359,36 +364,44 @@ var ge = n(r((e, t) => {
|
|
|
359
364
|
}, ...Array.isArray(l) ? l : []],
|
|
360
365
|
children: W(m, {})
|
|
361
366
|
});
|
|
362
|
-
let
|
|
363
|
-
F && (
|
|
364
|
-
className:
|
|
365
|
-
|
|
366
|
-
sx: [{
|
|
367
|
+
let $ = null;
|
|
368
|
+
F && ($ = H(p, {
|
|
369
|
+
className: "error-results",
|
|
370
|
+
sx: {
|
|
367
371
|
display: "flex",
|
|
368
|
-
justifyContent: "center",
|
|
369
|
-
alignItems: "center",
|
|
370
|
-
background: (e) => e.palette.error.light,
|
|
371
|
-
flex: "0",
|
|
372
|
-
zIndex: 1e3,
|
|
373
372
|
flexDirection: "column",
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
373
|
+
alignItems: "center",
|
|
374
|
+
flex: "none",
|
|
375
|
+
gap: .5,
|
|
376
|
+
padding: 1.5,
|
|
377
|
+
background: (e) => j(e.palette.error.main, "dark" === e.palette.mode ? .16 : .06),
|
|
378
|
+
borderTop: (e) => `1px solid ${j(e.palette.error.main, .4)}`
|
|
379
|
+
},
|
|
380
|
+
children: [
|
|
381
|
+
W(h, {
|
|
382
|
+
color: "error",
|
|
383
|
+
variant: "subtitle1",
|
|
384
|
+
component: "div",
|
|
385
|
+
children: y("templateSelect.errorTitle")
|
|
386
|
+
}),
|
|
387
|
+
W(h, {
|
|
388
|
+
variant: "body2",
|
|
389
|
+
component: "div",
|
|
390
|
+
sx: {
|
|
391
|
+
color: "text.secondary",
|
|
392
|
+
textAlign: "center"
|
|
393
|
+
},
|
|
394
|
+
children: F
|
|
395
|
+
}),
|
|
396
|
+
W(u, {
|
|
397
|
+
size: "small",
|
|
398
|
+
color: "error",
|
|
399
|
+
onClick: () => D((e) => e + 1),
|
|
400
|
+
children: y("templateSelect.retry")
|
|
401
|
+
})
|
|
402
|
+
]
|
|
390
403
|
}));
|
|
391
|
-
const
|
|
404
|
+
const I = (e) => {
|
|
392
405
|
const t = e.icon;
|
|
393
406
|
return "macro" === t ? W(v, {
|
|
394
407
|
iconKey: "ScriptMacro",
|
|
@@ -401,7 +414,7 @@ var ge = n(r((e, t) => {
|
|
|
401
414
|
size: "1em"
|
|
402
415
|
}) : null;
|
|
403
416
|
};
|
|
404
|
-
return
|
|
417
|
+
return H(p, {
|
|
405
418
|
ref: t,
|
|
406
419
|
className: d(a, "script-select"),
|
|
407
420
|
sx: {
|
|
@@ -410,7 +423,7 @@ var ge = n(r((e, t) => {
|
|
|
410
423
|
...l
|
|
411
424
|
},
|
|
412
425
|
...x,
|
|
413
|
-
children: [
|
|
426
|
+
children: [H(p, {
|
|
414
427
|
className: "script-select-content",
|
|
415
428
|
sx: {
|
|
416
429
|
p: 3,
|
|
@@ -446,7 +459,7 @@ var ge = n(r((e, t) => {
|
|
|
446
459
|
paddingLeft: "0px",
|
|
447
460
|
paddingRight: "0px"
|
|
448
461
|
},
|
|
449
|
-
children: S.map((e, t) =>
|
|
462
|
+
children: S.map((e, t) => H(u, {
|
|
450
463
|
variant: "outlined",
|
|
451
464
|
disabled: i,
|
|
452
465
|
sx: {
|
|
@@ -467,7 +480,7 @@ var ge = n(r((e, t) => {
|
|
|
467
480
|
...1 === t && { gridColumn: "1" }
|
|
468
481
|
},
|
|
469
482
|
onClick: () => n?.(e),
|
|
470
|
-
children: [
|
|
483
|
+
children: [H(p, {
|
|
471
484
|
sx: {
|
|
472
485
|
display: "flex",
|
|
473
486
|
flexDirection: "row",
|
|
@@ -480,7 +493,7 @@ var ge = n(r((e, t) => {
|
|
|
480
493
|
variant: "subtitle2",
|
|
481
494
|
component: "div",
|
|
482
495
|
children: e.title || y("templateSelect.untitled")
|
|
483
|
-
}),
|
|
496
|
+
}), I(e)]
|
|
484
497
|
}), e.summary && W(h, {
|
|
485
498
|
variant: "body2",
|
|
486
499
|
component: "div",
|
|
@@ -497,7 +510,7 @@ var ge = n(r((e, t) => {
|
|
|
497
510
|
}, `${e.path}-${t}`))
|
|
498
511
|
})
|
|
499
512
|
]
|
|
500
|
-
}),
|
|
513
|
+
}), $]
|
|
501
514
|
});
|
|
502
515
|
}));
|
|
503
516
|
ge.displayName = "TemplateSelectPanel";
|
|
@@ -506,13 +519,13 @@ var xe = n(r((e, t) => {
|
|
|
506
519
|
message: "Loading",
|
|
507
520
|
cursor: "",
|
|
508
521
|
dirty: !1
|
|
509
|
-
}), [I
|
|
522
|
+
}), [$, I] = c(null);
|
|
510
523
|
o(() => {
|
|
511
524
|
let e = !1;
|
|
512
|
-
return
|
|
525
|
+
return I(null), async function() {
|
|
513
526
|
if (S && (await S.start(), !e)) {
|
|
514
527
|
const e = S.getModules().getItems()[0]?.getSource();
|
|
515
|
-
|
|
528
|
+
I({ source: e || null });
|
|
516
529
|
}
|
|
517
530
|
}(), () => {
|
|
518
531
|
e = !0;
|
|
@@ -523,18 +536,18 @@ var xe = n(r((e, t) => {
|
|
|
523
536
|
...t,
|
|
524
537
|
...e
|
|
525
538
|
}));
|
|
526
|
-
}, []),
|
|
527
|
-
if (
|
|
539
|
+
}, []), E = s(null), [R, L] = c(null), M = s(null), z = C((e) => {
|
|
540
|
+
if (R) return R.focus(e), !0;
|
|
528
541
|
if (x) {
|
|
529
|
-
const t =
|
|
542
|
+
const t = E.current?.querySelectorAll?.(x);
|
|
530
543
|
if (t && t.length > 0) return t[0]?.focus?.(e), !0;
|
|
531
544
|
}
|
|
532
|
-
return
|
|
545
|
+
return E.current?.focus?.(e), !1;
|
|
533
546
|
}, [
|
|
534
|
-
|
|
547
|
+
R,
|
|
535
548
|
x,
|
|
536
549
|
y
|
|
537
|
-
]),
|
|
550
|
+
]), O = l(() => W(D, {
|
|
538
551
|
transitionDelay: "160ms",
|
|
539
552
|
style: {
|
|
540
553
|
position: "absolute",
|
|
@@ -542,7 +555,7 @@ var xe = n(r((e, t) => {
|
|
|
542
555
|
height: "100%"
|
|
543
556
|
},
|
|
544
557
|
transparentBackground: !1
|
|
545
|
-
}), []),
|
|
558
|
+
}), []), B = l(() => W(f, {
|
|
546
559
|
elevation: 1,
|
|
547
560
|
tabIndex: 0,
|
|
548
561
|
sx: {
|
|
@@ -571,7 +584,7 @@ var xe = n(r((e, t) => {
|
|
|
571
584
|
margin: 0,
|
|
572
585
|
borderTop: `solid 1px ${v.palette.divider}`
|
|
573
586
|
},
|
|
574
|
-
children:
|
|
587
|
+
children: H("div", {
|
|
575
588
|
style: {
|
|
576
589
|
flex: "1 1 100%",
|
|
577
590
|
display: "flex",
|
|
@@ -625,7 +638,7 @@ var xe = n(r((e, t) => {
|
|
|
625
638
|
})
|
|
626
639
|
]
|
|
627
640
|
})
|
|
628
|
-
}), [K]), U = l(() =>
|
|
641
|
+
}), [K]), U = l(() => H(p, {
|
|
629
642
|
className: d("script-editor-content"),
|
|
630
643
|
sx: {
|
|
631
644
|
display: "flex",
|
|
@@ -635,7 +648,7 @@ var xe = n(r((e, t) => {
|
|
|
635
648
|
boxSizing: "border-box"
|
|
636
649
|
},
|
|
637
650
|
children: [
|
|
638
|
-
|
|
651
|
+
B,
|
|
639
652
|
W(p, {
|
|
640
653
|
sx: {
|
|
641
654
|
display: "flex",
|
|
@@ -646,8 +659,8 @@ var xe = n(r((e, t) => {
|
|
|
646
659
|
boxSizing: "border-box"
|
|
647
660
|
},
|
|
648
661
|
children: W(_, {
|
|
649
|
-
ref:
|
|
650
|
-
loadingPanel:
|
|
662
|
+
ref: E,
|
|
663
|
+
loadingPanel: O,
|
|
651
664
|
readOnly: u,
|
|
652
665
|
frame: m,
|
|
653
666
|
scripts: S,
|
|
@@ -661,19 +674,19 @@ var xe = n(r((e, t) => {
|
|
|
661
674
|
]
|
|
662
675
|
}), [
|
|
663
676
|
v,
|
|
664
|
-
|
|
677
|
+
B,
|
|
665
678
|
A,
|
|
666
679
|
w,
|
|
667
|
-
|
|
680
|
+
O,
|
|
668
681
|
u,
|
|
669
682
|
a,
|
|
670
683
|
y,
|
|
671
684
|
x,
|
|
672
685
|
m,
|
|
673
686
|
P
|
|
674
|
-
]),
|
|
687
|
+
]), j = l(() => {
|
|
675
688
|
let e;
|
|
676
|
-
return null ===
|
|
689
|
+
return null === $ ? O : (null === $.source && (e = W(ge, {
|
|
677
690
|
sx: {
|
|
678
691
|
display: "flex",
|
|
679
692
|
flex: "1 1 100%",
|
|
@@ -686,7 +699,7 @@ var xe = n(r((e, t) => {
|
|
|
686
699
|
},
|
|
687
700
|
disabled: u,
|
|
688
701
|
onScriptSelect: (e) => {
|
|
689
|
-
|
|
702
|
+
E.current?.insertSnippet(e.content), I({ source: e.content ?? "" }), requestAnimationFrame(() => E.current?.focus());
|
|
690
703
|
}
|
|
691
704
|
})), W(p, {
|
|
692
705
|
tabIndex: 0,
|
|
@@ -702,9 +715,9 @@ var xe = n(r((e, t) => {
|
|
|
702
715
|
outline: "none"
|
|
703
716
|
},
|
|
704
717
|
onPointerDown: (e) => {
|
|
705
|
-
e.isDefaultPrevented() ||
|
|
718
|
+
e.isDefaultPrevented() || E.current?.focus();
|
|
706
719
|
},
|
|
707
|
-
children:
|
|
720
|
+
children: H(p, {
|
|
708
721
|
sx: {
|
|
709
722
|
flex: "1 1 100%",
|
|
710
723
|
position: "relative",
|
|
@@ -723,11 +736,11 @@ var xe = n(r((e, t) => {
|
|
|
723
736
|
})
|
|
724
737
|
}));
|
|
725
738
|
}, [
|
|
726
|
-
|
|
739
|
+
B,
|
|
727
740
|
U,
|
|
728
741
|
r,
|
|
729
|
-
|
|
730
|
-
|
|
742
|
+
$,
|
|
743
|
+
O,
|
|
731
744
|
u
|
|
732
745
|
]), q = N(t, () => ({
|
|
733
746
|
isScriptWorkspaceElement: () => !0,
|
|
@@ -751,7 +764,7 @@ var xe = n(r((e, t) => {
|
|
|
751
764
|
onBlur: (e) => {
|
|
752
765
|
q?.current?.contains(e.relatedTarget) || q?.current === e.relatedTarget || (M.current = null, F.current = !1, k(!1)), b?.onBlur?.(e);
|
|
753
766
|
},
|
|
754
|
-
children:
|
|
767
|
+
children: j
|
|
755
768
|
});
|
|
756
769
|
}));
|
|
757
770
|
xe.displayName = "ScriptWorkspace";
|
|
@@ -768,12 +781,12 @@ var { FocusActivation: ye, CommandScopeProvider: Se, CommandAnchorProvider: be,
|
|
|
768
781
|
}) : e;
|
|
769
782
|
}, Ce = ({ paneRef: e, children: t }) => {
|
|
770
783
|
const r = ve(), n = l(() => r ? new ye(r.getRoot(), r) : null, [r]);
|
|
771
|
-
return n ?
|
|
784
|
+
return n ? H(be, {
|
|
772
785
|
tracker: n,
|
|
773
786
|
keyBindings: !1,
|
|
774
787
|
debounce: 100,
|
|
775
788
|
elementRef: e,
|
|
776
|
-
children: [W(
|
|
789
|
+
children: [W(O, {}), W("div", {
|
|
777
790
|
className: "script-editor-pane",
|
|
778
791
|
style: { display: "contents" },
|
|
779
792
|
ref: e,
|
|
@@ -782,7 +795,7 @@ var { FocusActivation: ye, CommandScopeProvider: Se, CommandAnchorProvider: be,
|
|
|
782
795
|
}) : t;
|
|
783
796
|
}, Fe = (e) => {
|
|
784
797
|
const { model: t, entryKey: r, frame: n, ref: i, ...o } = e, l = A() ?? t;
|
|
785
|
-
|
|
798
|
+
B(l, ["onProtectionChange"]);
|
|
786
799
|
const a = l?.getScripts().isReadOnly() ?? !1;
|
|
787
800
|
return W(ke, { children: W(xe, {
|
|
788
801
|
ref: i,
|
|
@@ -813,7 +826,7 @@ var { FocusActivation: ye, CommandScopeProvider: Se, CommandAnchorProvider: be,
|
|
|
813
826
|
s,
|
|
814
827
|
l,
|
|
815
828
|
n
|
|
816
|
-
]), d ?
|
|
829
|
+
]), d ? H(U, { children: [W(E, {}), W(te, { ...r })] }) : null;
|
|
817
830
|
});
|
|
818
831
|
Ke.displayName = "RunScriptContribution", Y();
|
|
819
832
|
var Ne = n(r((e, r) => {
|
|
@@ -840,7 +853,7 @@ var Ne = n(r((e, r) => {
|
|
|
840
853
|
}, u = [], m = a ? a.length : 0;
|
|
841
854
|
for (let e = 0; e < m; e++) {
|
|
842
855
|
const t = a[e];
|
|
843
|
-
u.push(W(
|
|
856
|
+
u.push(W($, {
|
|
844
857
|
...d,
|
|
845
858
|
commandKey: "insertFunction",
|
|
846
859
|
commandState: t,
|
|
@@ -849,7 +862,7 @@ var Ne = n(r((e, r) => {
|
|
|
849
862
|
label: t.getName() ?? l("insertFunction.fallbackLabel")
|
|
850
863
|
}, `function-${t.getName()}-${e}`));
|
|
851
864
|
}
|
|
852
|
-
const f =
|
|
865
|
+
const f = H(p, {
|
|
853
866
|
ref: r,
|
|
854
867
|
sx: {
|
|
855
868
|
display: "flex",
|
|
@@ -857,13 +870,13 @@ var Ne = n(r((e, r) => {
|
|
|
857
870
|
flex: "1 1 100%",
|
|
858
871
|
overflow: "hidden"
|
|
859
872
|
},
|
|
860
|
-
children: [u.length > 0 ?
|
|
873
|
+
children: [u.length > 0 ? H(U, { children: [W(p, {
|
|
861
874
|
sx: {
|
|
862
875
|
overflow: "auto",
|
|
863
876
|
flex: "1 1 100%"
|
|
864
877
|
},
|
|
865
878
|
children: u
|
|
866
|
-
}), W(
|
|
879
|
+
}), W(E, { orientation: "horizontal" })] }) : null, t($, {
|
|
867
880
|
...d,
|
|
868
881
|
key: "show-editor",
|
|
869
882
|
commandKey: "showScriptEditor"
|
|
@@ -887,10 +900,10 @@ var Te = n(r((e, t) => {
|
|
|
887
900
|
children: t
|
|
888
901
|
});
|
|
889
902
|
}, [r, n]);
|
|
890
|
-
return W(
|
|
903
|
+
return W(I, {
|
|
891
904
|
ref: t,
|
|
892
905
|
disabled: r,
|
|
893
|
-
|
|
906
|
+
renderPopupPanel: a,
|
|
894
907
|
label: l?.getLabel?.(),
|
|
895
908
|
tooltip: l?.getDescription?.(),
|
|
896
909
|
icon: "FormulaCustom",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sheetxl/scripting-mui",
|
|
3
3
|
"description": "Scripting MUI - MUI script workspace, toolbar and run-script plugin for SheetXL.",
|
|
4
|
-
"version": "0.8.0-beta.
|
|
4
|
+
"version": "0.8.0-beta.12",
|
|
5
5
|
"license": "SEE LICENSE IN <LICENSE>",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
@@ -37,13 +37,13 @@
|
|
|
37
37
|
"automation"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@sheetxl/react": "^0.8.0-beta.
|
|
41
|
-
"@sheetxl/scripting-react": "^0.8.0-beta.
|
|
42
|
-
"@sheetxl/sdk": "^0.8.0-beta.
|
|
43
|
-
"@sheetxl/studio-mui": "^0.8.0-beta.
|
|
44
|
-
"@sheetxl/utils": "^0.8.0-beta.
|
|
45
|
-
"@sheetxl/utils-mui": "^0.8.0-beta.
|
|
46
|
-
"@sheetxl/utils-react": "^0.8.0-beta.
|
|
40
|
+
"@sheetxl/react": "^0.8.0-beta.12",
|
|
41
|
+
"@sheetxl/scripting-react": "^0.8.0-beta.12",
|
|
42
|
+
"@sheetxl/sdk": "^0.8.0-beta.12",
|
|
43
|
+
"@sheetxl/studio-mui": "^0.8.0-beta.12",
|
|
44
|
+
"@sheetxl/utils": "^0.8.0-beta.12",
|
|
45
|
+
"@sheetxl/utils-mui": "^0.8.0-beta.12",
|
|
46
|
+
"@sheetxl/utils-react": "^0.8.0-beta.12",
|
|
47
47
|
"clsx": "^2.1.1"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"templateSelect.intro": "Wählen Sie eine Vorlage als Ausgangspunkt, um Aufgaben zu automatisieren oder benutzerdefinierte Funktionen zu erstellen.",
|
|
13
13
|
"templateSelect.intro2": "Vorlagen bieten eine Grundlage, die Sie anpassen und auf Ihre Bedürfnisse zuschneiden können.",
|
|
14
14
|
"templateSelect.loadFailed": "Skripte konnten nicht geladen werden",
|
|
15
|
+
"templateSelect.retry": "Erneut versuchen",
|
|
15
16
|
"templateSelect.title": "Skriptvorlage",
|
|
16
17
|
"templateSelect.untitled": "Unbenannt"
|
|
17
18
|
}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"templateSelect.intro": "Choose from a template to provide a starting point to automate tasks or create user defined functions.",
|
|
13
13
|
"templateSelect.intro2": "Templates provide a foundation to customize and meet your specific needs.",
|
|
14
14
|
"templateSelect.loadFailed": "Failed to load scripts",
|
|
15
|
+
"templateSelect.retry": "Retry",
|
|
15
16
|
"templateSelect.title": "Script Template",
|
|
16
17
|
"templateSelect.untitled": "Untitled"
|
|
17
18
|
}
|