@sheetxl/scripting-mui 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.
@@ -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.17
2
+ * @license @sheetxl/scripting-mui - Scripting MUI - MUI script workspace, toolbar and run-script plugin for SheetXL. - v0.8.0-beta.19
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
5
  * License: MIT
@@ -922,8 +922,6 @@ ke.displayName = "InsertFunctionContribution";
922
922
  var Ae = () => {
923
923
  ie(), y.register("plugin-scripts", { icons: {} }), F.registerTaskPane({
924
924
  key: "scriptEditor",
925
- getTitle: () => "Script (Typescript)",
926
- getIcon: () => "ScriptRun",
927
925
  component: De,
928
926
  keepMounted: !0
929
927
  }, !0), v.register({ key: "scriptsOptions" }, !0), v.register({ key: "customFunctionOptions" }, !0), v.register({
@@ -1,14 +1,14 @@
1
1
  /**
2
- * @license @sheetxl/scripting-mui - Scripting MUI - MUI script workspace, toolbar and run-script plugin for SheetXL. - v0.8.0-beta.17
2
+ * @license @sheetxl/scripting-mui - Scripting MUI - MUI script workspace, toolbar and run-script plugin for SheetXL. - v0.8.0-beta.19
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
5
  * License: MIT
6
6
  */
7
7
  import e, { createElement as t, forwardRef as r, memo as n, useCallback as i, useEffect as o, useMemo as l, useReducer as a, useRef as s, useState as c } from "react";
8
8
  import d from "clsx";
9
- import { Box as p, Button as u, CircularProgress as m, Paper as f, Typography as h, useTheme as g } from "@mui/material";
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 $, CommandPopupButton as I, CommandToolbar as P, ExhibitDivider as E, ExhibitMenuItem as R, OverflowPalette as L, defaultRenderPopupPanel as M } from "@sheetxl/utils-mui";
9
+ import { Box as p, Button as u, CircularProgress as m, Paper as f, Typography as h, useTheme as x } from "@mui/material";
10
+ import { Command as g, 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 D } from "@sheetxl/utils-react";
11
+ import { AnimatedLoadingPanel as T, CommandButton as $, CommandPopupButton as P, CommandToolbar as I, ExhibitDivider as E, ExhibitMenuItem as L, OverflowPalette as R, defaultRenderPopupPanel as M } from "@sheetxl/utils-mui";
12
12
  import { DefaultTaskPaneRegistry as z, InputClipboardInjector as O, useModelSync as B, useWorkbook as A } from "@sheetxl/react";
13
13
  import { Fragment as U, jsx as W, jsxs as H } from "react/jsx-runtime";
14
14
  import { alpha as j } from "@mui/system";
@@ -32,13 +32,13 @@ var Q = {
32
32
  "templateSelect.retry": "Retry",
33
33
  "templateSelect.title": "Script Template",
34
34
  "templateSelect.untitled": "Untitled"
35
- }, { DefaultCommandCatalogService: V } = x, X = !1;
35
+ }, { DefaultCommandCatalogService: V } = g, X = !1;
36
36
  function Y() {
37
37
  X || (X = !0, V.registerFromManifest("@sheetxl/scripting-mui", import.meta.url, { messages: Q }));
38
38
  }
39
39
  Y();
40
40
  var ee = n(r((e, r) => {
41
- const { groupKey: n, ...i } = e, l = A(), a = T(), [s, d] = c([]), [u, m] = c(!1);
41
+ const { groupKey: n, ...i } = e, l = A(), a = D(), [s, d] = c([]), [u, m] = c(!1);
42
42
  o(() => {
43
43
  const e = l?.getScripts();
44
44
  if (!e) return;
@@ -52,8 +52,8 @@ var ee = n(r((e, r) => {
52
52
  variant: y.Menuitem,
53
53
  groupKey: "scriptsOptions",
54
54
  shortcut: void 0
55
- }, h = [], g = s ? s.length : 0;
56
- for (let e = 0; e < g; e++) {
55
+ }, h = [], x = s ? s.length : 0;
56
+ for (let e = 0; e < x; e++) {
57
57
  const t = s[e];
58
58
  h.push(W($, {
59
59
  ...f,
@@ -64,7 +64,7 @@ var ee = n(r((e, r) => {
64
64
  label: t.getName() ?? a("runScript.fallbackLabel")
65
65
  }, `macro-${t.getName()}-${e}`));
66
66
  }
67
- const x = H(p, {
67
+ const g = H(p, {
68
68
  ref: r,
69
69
  sx: {
70
70
  display: "flex",
@@ -86,7 +86,7 @@ var ee = n(r((e, r) => {
86
86
  });
87
87
  return M({
88
88
  ...i,
89
- children: x
89
+ children: g
90
90
  });
91
91
  }));
92
92
  ee.displayName = "RunScriptPopupPanel";
@@ -102,7 +102,7 @@ var te = n(r((e, t) => {
102
102
  children: t
103
103
  });
104
104
  }, [n, r]);
105
- return W(I, {
105
+ return W(P, {
106
106
  ref: t,
107
107
  disabled: n,
108
108
  renderPopupPanel: s,
@@ -165,7 +165,7 @@ var te = n(r((e, t) => {
165
165
  iconKey: "ScriptAutoRun",
166
166
  size: ue,
167
167
  style: pe
168
- }), W(R, {
168
+ }), W(L, {
169
169
  sx: {
170
170
  maxWidth: "460px",
171
171
  display: "flex",
@@ -207,7 +207,7 @@ var te = n(r((e, t) => {
207
207
  })
208
208
  });
209
209
  }), fe = n(r((e, r) => {
210
- const { groupKey: n, disabled: l, scriptPath: a = ne, ...s } = e, d = T(), [u, m] = c([]), [f, h] = c("loading"), [g, x] = c(0), [S] = K(["insertScript"]), b = l || (S?.disabled() ?? !1);
210
+ const { groupKey: n, disabled: l, scriptPath: a = ne, ...s } = e, d = D(), [u, m] = c([]), [f, h] = c("loading"), [x, g] = c(0), [S] = K(["insertScript"]), b = l || (S?.disabled() ?? !1);
211
211
  o(() => {
212
212
  let e = !1;
213
213
  return h("loading"), de(a).then((t) => {
@@ -217,7 +217,7 @@ var te = n(r((e, t) => {
217
217
  }), () => {
218
218
  e = !0;
219
219
  };
220
- }, [a, g]);
220
+ }, [a, x]);
221
221
  const v = i((e) => {
222
222
  if ("loading" === f) return W("div", { children: d("insertScript.loading") });
223
223
  const r = {
@@ -226,8 +226,8 @@ var te = n(r((e, t) => {
226
226
  disabled: b
227
227
  }, n = (t) => {
228
228
  S?.execute(t.content), e.closeFloat?.();
229
- }, i = () => x((e) => e + 1), o = [];
230
- "error" === f && o.push(W(R, {
229
+ }, i = () => g((e) => e + 1), o = [];
230
+ "error" === f && o.push(W(L, {
231
231
  onMouseDown: (e) => {
232
232
  0 === e.button && e.preventDefault();
233
233
  },
@@ -285,7 +285,7 @@ var te = n(r((e, t) => {
285
285
  S,
286
286
  d
287
287
  ]);
288
- return W(I, {
288
+ return W(P, {
289
289
  ref: r,
290
290
  disabled: b,
291
291
  groupKey: n,
@@ -304,7 +304,7 @@ var te = n(r((e, t) => {
304
304
  flex: "1 1 100%"
305
305
  },
306
306
  children: [
307
- W("div", { children: W(L, {
307
+ W("div", { children: W(R, {
308
308
  style: {},
309
309
  children: W($, {
310
310
  ...t,
@@ -312,14 +312,14 @@ var te = n(r((e, t) => {
312
312
  })
313
313
  }) }),
314
314
  W("div", { style: { flex: "1 1 100%" } }),
315
- W("div", { children: W(L, {
315
+ W("div", { children: W(R, {
316
316
  style: {},
317
317
  children: W(fe, { ...t })
318
318
  }) })
319
319
  ]
320
320
  }) });
321
321
  }, []);
322
- return W(P, {
322
+ return W(I, {
323
323
  ref: t,
324
324
  propsCommandButton: r,
325
325
  renderToolbarPalette: i,
@@ -327,8 +327,8 @@ var te = n(r((e, t) => {
327
327
  });
328
328
  }));
329
329
  he.displayName = "ScriptEditorToolbar", Y();
330
- var ge = n(r((e, t) => {
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);
330
+ var xe = n(r((e, t) => {
331
+ const { scriptPath: r = ne, onScriptSelect: n, disabled: i = !1, sx: l = k.EmptyCssProperties, className: a, buttonMinWidth: s = 210, buttonMinHeight: f = 80, gap: x = 12, ...g } = e, y = D(), [S, b] = c([]), [w, C] = c(!0), [F, K] = c(null), [N, T] = c(0);
332
332
  if (o(() => {
333
333
  let e = !1;
334
334
  const t = {
@@ -352,7 +352,7 @@ var ge = n(r((e, t) => {
352
352
  N
353
353
  ]), w) return W(p, {
354
354
  className: d(a, "script-select"),
355
- ...x,
355
+ ...g,
356
356
  sx: [{
357
357
  display: "flex",
358
358
  justifyContent: "center",
@@ -396,12 +396,12 @@ var ge = n(r((e, t) => {
396
396
  W(u, {
397
397
  size: "small",
398
398
  color: "error",
399
- onClick: () => D((e) => e + 1),
399
+ onClick: () => T((e) => e + 1),
400
400
  children: y("templateSelect.retry")
401
401
  })
402
402
  ]
403
403
  }));
404
- const I = (e) => {
404
+ const P = (e) => {
405
405
  const t = e.icon;
406
406
  return "macro" === t ? W(v, {
407
407
  iconKey: "ScriptMacro",
@@ -422,7 +422,7 @@ var ge = n(r((e, t) => {
422
422
  zIndex: 1e3,
423
423
  ...l
424
424
  },
425
- ...x,
425
+ ...g,
426
426
  children: [H(p, {
427
427
  className: "script-select-content",
428
428
  sx: {
@@ -454,7 +454,7 @@ var ge = n(r((e, t) => {
454
454
  sx: {
455
455
  display: "grid",
456
456
  gridTemplateColumns: `repeat(auto-fill, minmax(${s}px, 1fr))`,
457
- gap: `${g}px`,
457
+ gap: `${x}px`,
458
458
  padding: 2,
459
459
  paddingLeft: "0px",
460
460
  paddingRight: "0px"
@@ -493,7 +493,7 @@ var ge = n(r((e, t) => {
493
493
  variant: "subtitle2",
494
494
  component: "div",
495
495
  children: e.title || y("templateSelect.untitled")
496
- }), I(e)]
496
+ }), P(e)]
497
497
  }), e.summary && W(h, {
498
498
  variant: "body2",
499
499
  component: "div",
@@ -513,41 +513,41 @@ var ge = n(r((e, t) => {
513
513
  }), $]
514
514
  });
515
515
  }));
516
- ge.displayName = "TemplateSelectPanel";
517
- var xe = n(r((e, t) => {
518
- const { className: r, sx: n, propsScriptEditor: a, readOnly: u = !1, frame: m, autoFocusSel: x, autoFocus: y = !0, scripts: S, ...b } = e, v = g(), [w, k] = c(!1), F = s(!1), [K, T] = c({
516
+ xe.displayName = "TemplateSelectPanel";
517
+ var ge = n(r((e, t) => {
518
+ const { className: r, sx: n, propsScriptEditor: a, readOnly: u = !1, frame: m, autoFocusSel: g, autoFocus: y = !0, scripts: S, ...b } = e, v = x(), [w, k] = c(!1), F = s(!1), [K, D] = c({
519
519
  message: "Loading",
520
520
  cursor: "",
521
521
  dirty: !1
522
- }), [$, I] = c(null);
522
+ }), [$, P] = c(null);
523
523
  o(() => {
524
524
  let e = !1;
525
- return I(null), async function() {
525
+ return P(null), async function() {
526
526
  if (S && (await S.start(), !e)) {
527
527
  const e = S.getModules().getItems()[0]?.getSource();
528
- I({ source: e || null });
528
+ P({ source: e || null });
529
529
  }
530
530
  }(), () => {
531
531
  e = !0;
532
532
  };
533
533
  }, [S]);
534
- const P = i((e) => {
535
- T((t) => ({
534
+ const I = i((e) => {
535
+ D((t) => ({
536
536
  ...t,
537
537
  ...e
538
538
  }));
539
- }, []), E = s(null), [R, L] = c(null), M = s(null), z = C((e) => {
540
- if (R) return R.focus(e), !0;
541
- if (x) {
542
- const t = E.current?.querySelectorAll?.(x);
539
+ }, []), E = s(null), [L, R] = c(null), M = s(null), z = C((e) => {
540
+ if (L) return L.focus(e), !0;
541
+ if (g) {
542
+ const t = E.current?.querySelectorAll?.(g);
543
543
  if (t && t.length > 0) return t[0]?.focus?.(e), !0;
544
544
  }
545
545
  return E.current?.focus?.(e), !1;
546
546
  }, [
547
- R,
548
- x,
547
+ L,
548
+ g,
549
549
  y
550
- ]), O = l(() => W(D, {
550
+ ]), O = l(() => W(T, {
551
551
  transitionDelay: "160ms",
552
552
  style: {
553
553
  position: "absolute",
@@ -665,7 +665,7 @@ var xe = n(r((e, t) => {
665
665
  frame: m,
666
666
  scripts: S,
667
667
  autoFocus: y,
668
- onStatusChange: P,
668
+ onStatusChange: I,
669
669
  darkMode: "dark" === v.palette.mode,
670
670
  ...a
671
671
  })
@@ -681,12 +681,12 @@ var xe = n(r((e, t) => {
681
681
  u,
682
682
  a,
683
683
  y,
684
- x,
684
+ g,
685
685
  m,
686
- P
686
+ I
687
687
  ]), j = l(() => {
688
688
  let e;
689
- return null === $ ? O : (null === $.source && (e = W(ge, {
689
+ return null === $ ? O : (null === $.source && (e = W(xe, {
690
690
  sx: {
691
691
  display: "flex",
692
692
  flex: "1 1 100%",
@@ -699,7 +699,7 @@ var xe = n(r((e, t) => {
699
699
  },
700
700
  disabled: u,
701
701
  onScriptSelect: (e) => {
702
- E.current?.insertSnippet(e.content), I({ source: e.content ?? "" }), requestAnimationFrame(() => E.current?.focus());
702
+ E.current?.insertSnippet(e.content), P({ source: e.content ?? "" }), requestAnimationFrame(() => E.current?.focus());
703
703
  }
704
704
  })), W(p, {
705
705
  tabIndex: 0,
@@ -759,7 +759,7 @@ var xe = n(r((e, t) => {
759
759
  ref: q,
760
760
  ...b,
761
761
  onFocus: (e) => {
762
- k(!0), F.current = !0, q.current?.contains(e.target) && e.target !== q.current && L(e.target), e.relatedTarget && !M.current && (M.current = e.relatedTarget), b?.onFocus?.(e);
762
+ k(!0), F.current = !0, q.current?.contains(e.target) && e.target !== q.current && R(e.target), e.relatedTarget && !M.current && (M.current = e.relatedTarget), b?.onFocus?.(e);
763
763
  },
764
764
  onBlur: (e) => {
765
765
  q?.current?.contains(e.relatedTarget) || q?.current === e.relatedTarget || (M.current = null, F.current = !1, k(!1)), b?.onBlur?.(e);
@@ -767,8 +767,8 @@ var xe = n(r((e, t) => {
767
767
  children: j
768
768
  });
769
769
  }));
770
- xe.displayName = "ScriptWorkspace";
771
- var { FocusActivation: ye, CommandScopeProvider: Se, CommandAnchorProvider: be, useCommandScope: ve } = x, we = { scopeName: "scriptEditor" }, ke = ({ children: e }) => {
770
+ ge.displayName = "ScriptWorkspace";
771
+ var { FocusActivation: ye, CommandScopeProvider: Se, CommandAnchorProvider: be, useCommandScope: ve } = g, we = { scopeName: "scriptEditor" }, ke = ({ children: e }) => {
772
772
  const t = ve(), r = s(null);
773
773
  return t ? W(Se, {
774
774
  spec: we,
@@ -797,7 +797,7 @@ var { FocusActivation: ye, CommandScopeProvider: Se, CommandAnchorProvider: be,
797
797
  const { model: t, entryKey: r, frame: n, ref: i, ...o } = e, l = A() ?? t;
798
798
  B(l, ["onProtectionChange"]);
799
799
  const a = l?.getScripts().isReadOnly() ?? !1;
800
- return W(ke, { children: W(xe, {
800
+ return W(ke, { children: W(ge, {
801
801
  ref: i,
802
802
  readOnly: a,
803
803
  frame: n,
@@ -830,7 +830,7 @@ var { FocusActivation: ye, CommandScopeProvider: Se, CommandAnchorProvider: be,
830
830
  });
831
831
  Ke.displayName = "RunScriptContribution", Y();
832
832
  var Ne = n(r((e, r) => {
833
- const { ...n } = e, i = A(), l = T(), [a, s] = c([]);
833
+ const { ...n } = e, i = A(), l = D(), [a, s] = c([]);
834
834
  o(() => {
835
835
  const e = i?.getScripts();
836
836
  if (!e) return;
@@ -888,7 +888,7 @@ var Ne = n(r((e, r) => {
888
888
  });
889
889
  }));
890
890
  Ne.displayName = "InsertFunctionPopupPanel";
891
- var Te = n(r((e, t) => {
891
+ var De = n(r((e, t) => {
892
892
  const { disabled: r, groupKey: n, ...o } = e, l = F("customFunctionOptions"), a = i((e) => {
893
893
  const t = W(Ne, {
894
894
  disabled: r,
@@ -900,7 +900,7 @@ var Te = n(r((e, t) => {
900
900
  children: t
901
901
  });
902
902
  }, [r, n]);
903
- return W(I, {
903
+ return W(P, {
904
904
  ref: t,
905
905
  disabled: r,
906
906
  renderPopupPanel: a,
@@ -910,12 +910,10 @@ var Te = n(r((e, t) => {
910
910
  ...o
911
911
  });
912
912
  }));
913
- Te.displayName = "InsertFunctionContribution";
914
- var De = () => {
913
+ De.displayName = "InsertFunctionContribution";
914
+ var Te = () => {
915
915
  J(), b.register("plugin-scripts", { icons: {} }), z.registerTaskPane({
916
916
  key: "scriptEditor",
917
- getTitle: () => "Script (Typescript)",
918
- getIcon: () => "ScriptRun",
919
917
  component: Fe,
920
918
  keepMounted: !0
921
919
  }, !0), S.register({ key: "scriptsOptions" }, !0), S.register({ key: "customFunctionOptions" }, !0), S.register({
@@ -936,7 +934,7 @@ var De = () => {
936
934
  anchor: "formulaCategory.web",
937
935
  order: 1
938
936
  } },
939
- render: (t) => e.createElement(Te, { ...t })
937
+ render: (t) => e.createElement(De, { ...t })
940
938
  }, !0);
941
939
  };
942
- export { fe as InsertScriptCommandButton, te as RunScriptCommandButton, he as ScriptEditorToolbar, Fe as ScriptTaskPane, xe as ScriptWorkspace, De as ScriptingPlugin };
940
+ export { fe as InsertScriptCommandButton, te as RunScriptCommandButton, he as ScriptEditorToolbar, Fe as ScriptTaskPane, ge as ScriptWorkspace, Te as ScriptingPlugin };
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.17",
4
+ "version": "0.8.0-beta.19",
5
5
  "license": "MIT",
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.17",
41
- "@sheetxl/scripting-react": "^0.8.0-beta.17",
42
- "@sheetxl/sdk": "^0.8.0-beta.17",
43
- "@sheetxl/studio-mui": "^0.8.0-beta.17",
44
- "@sheetxl/utils": "^0.8.0-beta.17",
45
- "@sheetxl/utils-mui": "^0.8.0-beta.17",
46
- "@sheetxl/utils-react": "^0.8.0-beta.17",
40
+ "@sheetxl/react": "^0.8.0-beta.19",
41
+ "@sheetxl/scripting-react": "^0.8.0-beta.19",
42
+ "@sheetxl/sdk": "^0.8.0-beta.19",
43
+ "@sheetxl/studio-mui": "^0.8.0-beta.19",
44
+ "@sheetxl/utils": "^0.8.0-beta.19",
45
+ "@sheetxl/utils-mui": "^0.8.0-beta.19",
46
+ "@sheetxl/utils-react": "^0.8.0-beta.19",
47
47
  "clsx": "^2.1.1"
48
48
  },
49
49
  "peerDependencies": {