@sheetxl/scripting-mui 0.8.0-beta.2 → 0.8.0-beta.20

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,23 +1,25 @@
1
1
  /**
2
- * @license @sheetxl/scripting-mui - Scripting MUI - MUI script workspace, toolbar and run-script plugin for SheetXL. - v0.8.0-beta.2
2
+ * @license @sheetxl/scripting-mui - Scripting MUI - MUI script workspace, toolbar and run-script plugin for SheetXL. - v0.8.0-beta.20
3
3
  *
4
4
  * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
5
+ * License: MIT
6
6
  */
7
- import e, { createElement as t, forwardRef as r, memo as n, useCallback as i, useEffect as o, useMemo as a, useReducer as l, useRef as s, useState as c } from "react";
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 m, CircularProgress as u, Paper as h, Typography as f, 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 N, useImperativeElement as T, useTranslator as K } from "@sheetxl/utils-react";
11
- import { AnimatedLoadingPanel as D, CommandButton as I, CommandPopupButton as L, CommandToolbar as P, ExhibitDivider as E, ExhibitMenuItem as $, OverflowPalette as R, defaultCreatePopupPanel as z } from "@sheetxl/utils-mui";
12
- import { DefaultTaskPaneRegistry as B, InputClipboardInjector as O, useModelSync as A, useWorkbook as M } from "@sheetxl/react";
13
- import { Fragment as W, jsx as j, jsxs as H } from "react/jsx-runtime";
14
- import { alpha as U } from "@mui/system";
15
- import { ChainedError as q } from "@sheetxl/utils";
16
- import { ScriptEditor as G, ScriptingReactPlugin as J } from "@sheetxl/scripting-react";
17
- var Z = {
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
+ 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
+ import { listResources as q, releaseChannel as G } from "@sheetxl/utils";
16
+ import { VERSION as Z } from "@sheetxl/sdk";
17
+ import { ScriptEditor as _, ScriptingReactPlugin as J } from "@sheetxl/scripting-react";
18
+ var Q = {
18
19
  "insertFunction.fallbackLabel": "Function",
19
20
  "insertFunction.insertNamed": "Insert {name}",
20
21
  "insertScript.fallbackLabel": "Insert Script",
22
+ "insertScript.loadFailedRetry": "Couldn’t load templates. Retry",
21
23
  "insertScript.loading": "Loading...",
22
24
  "runScript.executeNamed": "Execute {name}",
23
25
  "runScript.fallbackLabel": "Macro",
@@ -27,41 +29,42 @@ var Z = {
27
29
  "templateSelect.intro": "Choose from a template to provide a starting point to automate tasks or create user defined functions.",
28
30
  "templateSelect.intro2": "Templates provide a foundation to customize and meet your specific needs.",
29
31
  "templateSelect.loadFailed": "Failed to load scripts",
32
+ "templateSelect.retry": "Retry",
30
33
  "templateSelect.title": "Script Template",
31
34
  "templateSelect.untitled": "Untitled"
32
- }, { DefaultCommandCatalogService: _ } = x, Q = !1;
33
- function V() {
34
- Q || (Q = !0, _.registerFromManifest("@sheetxl/scripting-mui", import.meta.url, { messages: Z }));
35
+ }, { DefaultCommandCatalogService: V } = g, X = !1;
36
+ function Y() {
37
+ X || (X = !0, V.registerFromManifest("@sheetxl/scripting-mui", import.meta.url, { messages: Q }));
35
38
  }
36
- V();
37
- var X = n(r((e, r) => {
38
- const { groupKey: n, ...i } = e, a = M(), l = K(), [s, d] = c([]), [m, u] = c(!1);
39
+ Y();
40
+ var ee = n(r((e, r) => {
41
+ const { groupKey: n, ...i } = e, l = A(), a = D(), [s, d] = c([]), [u, m] = c(!1);
39
42
  o(() => {
40
- const e = a?.getScripts();
43
+ const e = l?.getScripts();
41
44
  if (!e) return;
42
45
  (async () => {
43
- u(!0);
46
+ m(!0);
44
47
  const t = await e.searchFunctions({ type: "macro" });
45
- d(t), u(!1);
48
+ d(t), m(!1);
46
49
  })();
47
- }, [a]);
48
- const h = {
50
+ }, [l]);
51
+ const f = {
49
52
  variant: y.Menuitem,
50
53
  groupKey: "scriptsOptions",
51
54
  shortcut: void 0
52
- }, f = [], g = s ? s.length : 0;
53
- for (let e = 0; e < g; e++) {
55
+ }, h = [], x = s ? s.length : 0;
56
+ for (let e = 0; e < x; e++) {
54
57
  const t = s[e];
55
- f.push(j(I, {
56
- ...h,
58
+ h.push(W($, {
59
+ ...f,
57
60
  commandKey: "executeScript",
58
61
  commandState: { declaration: t },
59
- propsTooltip: { description: l("runScript.executeNamed", { name: t.getName() ?? l("runScript.fallbackLabel") }) },
60
- icon: j(v, { iconKey: "ScriptMacro" }),
61
- label: t.getName() ?? l("runScript.fallbackLabel")
62
+ propsTooltip: { description: a("runScript.executeNamed", { name: t.getName() ?? a("runScript.fallbackLabel") }) },
63
+ icon: W(v, { iconKey: "ScriptMacro" }),
64
+ label: t.getName() ?? a("runScript.fallbackLabel")
62
65
  }, `macro-${t.getName()}-${e}`));
63
66
  }
64
- const x = H(p, {
67
+ const g = H(p, {
65
68
  ref: r,
66
69
  sx: {
67
70
  display: "flex",
@@ -69,105 +72,100 @@ var X = n(r((e, r) => {
69
72
  flex: "1 1 100%",
70
73
  overflow: "hidden"
71
74
  },
72
- children: [f.length > 0 ? H(W, { children: [j(p, {
75
+ children: [h.length > 0 ? H(U, { children: [W(p, {
73
76
  sx: {
74
77
  overflow: "auto",
75
78
  flex: "1 1 100%"
76
79
  },
77
- children: f
78
- }), j(E, { orientation: "horizontal" })] }) : null, t(I, {
79
- ...h,
80
+ children: h
81
+ }), W(E, { orientation: "horizontal" })] }) : null, t($, {
82
+ ...f,
80
83
  key: "show-editor",
81
84
  commandKey: "showScriptEditor"
82
85
  })]
83
86
  });
84
- return z({
87
+ return M({
85
88
  ...i,
86
- children: x
89
+ children: g
87
90
  });
88
91
  }));
89
- X.displayName = "RunScriptPopupPanel";
90
- var Y = n(r((e, t) => {
91
- const { groupKey: r, disabled: n, ...o } = e, a = N(["showScriptEditor"])[0], l = F("scriptsOptions");
92
- return j(L, {
92
+ ee.displayName = "RunScriptPopupPanel";
93
+ var te = n(r((e, t) => {
94
+ const { groupKey: r, disabled: n, ...o } = e, l = K(["showScriptEditor"])[0], a = F("scriptsOptions"), s = i((e) => {
95
+ const t = W(ee, {
96
+ disabled: n,
97
+ groupKey: r,
98
+ ...e
99
+ });
100
+ return M({
101
+ ...e,
102
+ children: t
103
+ });
104
+ }, [n, r]);
105
+ return W(P, {
93
106
  ref: t,
94
107
  disabled: n,
95
- createPopupPanel: i((e) => {
96
- const t = j(X, {
97
- disabled: n,
98
- groupKey: r,
99
- ...e
100
- });
101
- return z({
102
- ...e,
103
- children: t
104
- });
105
- }, [n, r]),
106
- selected: a?.getState(),
107
- label: l?.getLabel?.(),
108
- tooltip: l?.getDescription?.(),
108
+ renderPopupPanel: s,
109
+ selected: l?.getState(),
110
+ label: a?.getLabel?.(),
111
+ tooltip: a?.getDescription?.(),
109
112
  quickCommand: "showScriptEditor",
110
113
  ...o
111
114
  });
112
- })), ee = "https://unpkg.com/@sheetxl/scripting-templates/dist", te = (e, t) => {
113
- try {
114
- return new URL(t).href;
115
- } catch {}
116
- if (t.startsWith("/") || /^[a-zA-Z]:/.test(t)) return t;
117
- let r = e.startsWith("http") ? e : `file:///${e.replace(/\\/g, "/")}`;
118
- return r.endsWith("/") || (r += "/"), new URL(t, r).href;
119
- }, re = (e) => {
120
- if (e.metadata?.name) return e.metadata.name;
121
- let t = (e.path.split("/").pop() || "").replace(/\.[^/.]+$/, "");
122
- return "formula" === e.metadata?.icon ? t.toUpperCase() : (t = t.replace(/([a-z])([A-Z])/g, "$1 $2"), t.replace(/[-_]/g, " ").trim().split(/\s+/).map((e) => e.charAt(0).toUpperCase() + e.slice(1)).join(" "));
123
- }, ne = async (e) => {
124
- const t = te(e, "./manifest.json"), r = await fetch(t);
125
- if (!r.ok) throw new q(`Failed to retrieve directory at '${e}': ${r.statusText}`);
126
- const n = await r.text();
127
- if (n.trim().toLowerCase().startsWith("<!doctype html") || n.trim().toLowerCase().startsWith("<html")) throw new q(`Failed to retrieve directory at '${e}'`);
115
+ })), re = G(Z), ne = `https://unpkg.com/@sheetxl/templates-scripting${re ? `@${re}` : ""}/dist`, ie = "templates-scripting", oe = [
116
+ "formula",
117
+ "macro",
118
+ "autostart"
119
+ ], le = (e) => "string" == typeof e && e ? e : void 0, ae = (e, t) => {
120
+ const r = (e.split("/").pop() ?? "").replace(/\.[^/.]+$/, "");
121
+ return "formula" === t ? r.toUpperCase() : r.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[-_]+/g, " ").trim().replace(/\b\w/g, (e) => e.toUpperCase());
122
+ }, se = async (e, t) => {
123
+ if (!/\.ts$/i.test(t.path)) return null;
124
+ const r = oe.includes(t.icon) ? t.icon : void 0, n = ((e, t) => {
125
+ const r = `${e}${e.endsWith("/") ? "" : "/"}${ie}/${t}`;
126
+ return "undefined" == typeof document ? r : new URL(r, document.baseURI).href;
127
+ })(e, t.path);
128
128
  let i;
129
129
  try {
130
- i = JSON.parse(n);
130
+ const e = await fetch(n);
131
+ if (!e.ok || (e.headers.get("content-type") ?? "").includes("text/html")) throw new Error(e.ok ? "not found" : e.statusText || String(e.status));
132
+ i = await e.text();
131
133
  } catch (e) {
132
- throw new Error(`Failed to parse directory: ${e.message}. Ensure the file is valid JSON.`);
134
+ return console.warn(`Script template '${n}' did not load: ${e?.message ?? e}`), null;
133
135
  }
134
- const o = i.map(async (t) => {
135
- try {
136
- const r = te(e, t.path), n = await fetch(r);
137
- if (!n.ok) throw new Error(`Failed to fetch file at '${t.path}': ${n.statusText}`);
138
- const i = await n.text();
139
- let o = t.metadata;
140
- return o?.title || (o = {
141
- title: re(t),
142
- ...o
143
- }), {
144
- path: t.path,
145
- content: i,
146
- metadata: o
147
- };
148
- } catch (e) {
149
- console.error(e.message);
150
- }
151
- return null;
152
- });
153
- return (await Promise.all(o)).filter((e) => null !== e);
154
- }, ie = { marginRight: "4px" }, oe = "1em", ae = n((e) => {
155
- const { disabled: t, snippet: r, description: n, handleInsert: i, sx: o, ...a } = e;
156
- let l;
157
- const s = r.metadata?.icon;
158
- return l = j(v, "formula" === s ? {
136
+ return {
137
+ path: t.path,
138
+ title: le(t.title) ?? ae(t.path, r),
139
+ summary: le(t.summary),
140
+ icon: r,
141
+ content: i
142
+ };
143
+ }, ce = /* @__PURE__ */ new Map(), de = (e = ne) => {
144
+ let t = ce.get(e);
145
+ return t || (t = (async () => {
146
+ const t = (await q("templates", ie, e)).find((e) => void 0 !== e.meta?.schema);
147
+ if (!t) throw new Error(`No script templates found at '${e}'.`);
148
+ return 1 !== Math.floor(Number(t.meta?.schema)) ? (console.warn(`Script template catalog at '${e}' has schema ${t.meta?.schema}; expected 1.`), []) : (await Promise.all(t.entries.map((t) => se(e, t)))).filter((e) => null !== e);
149
+ })(), ce.set(e, t), t.catch(() => {
150
+ ce.delete(e);
151
+ })), t;
152
+ }, pe = { marginRight: "4px" }, ue = "1em", me = n((e) => {
153
+ const { disabled: t, snippet: r, description: n, handleInsert: i, sx: o, ...l } = e;
154
+ let a;
155
+ const s = r.icon;
156
+ return a = W(v, "formula" === s ? {
159
157
  iconKey: "ScriptFormula",
160
- size: oe,
161
- style: ie
158
+ size: ue,
159
+ style: pe
162
160
  } : "macro" === s ? {
163
161
  iconKey: "ScriptMacro",
164
- size: oe,
165
- style: ie
162
+ size: ue,
163
+ style: pe
166
164
  } : {
167
165
  iconKey: "ScriptAutoRun",
168
- size: oe,
169
- style: ie
170
- }), j($, {
166
+ size: ue,
167
+ style: pe
168
+ }), W(L, {
171
169
  sx: {
172
170
  maxWidth: "460px",
173
171
  display: "flex",
@@ -175,7 +173,7 @@ var Y = n(r((e, t) => {
175
173
  ...o
176
174
  },
177
175
  disabled: t,
178
- icon: l,
176
+ icon: a,
179
177
  onMouseDown: (e) => {
180
178
  0 === e.button && e.preventDefault();
181
179
  },
@@ -185,7 +183,7 @@ var Y = n(r((e, t) => {
185
183
  onKeyDown: (e) => {
186
184
  e.keyCode !== w.Enter && e.keyCode !== w.Space || i(r);
187
185
  },
188
- ...a,
186
+ ...l,
189
187
  children: H(p, {
190
188
  sx: {
191
189
  display: "flex",
@@ -193,50 +191,62 @@ var Y = n(r((e, t) => {
193
191
  flexDirection: "column",
194
192
  overflow: "hidden"
195
193
  },
196
- children: [j(f, {
194
+ children: [W(h, {
197
195
  component: "div",
198
- children: r.metadata?.title ?? r.path
199
- }), j(f, {
196
+ children: r.title
197
+ }), W(h, {
200
198
  variant: "caption",
201
199
  component: "div",
202
200
  sx: {
203
- color: (e) => U(e.palette.text.secondary ?? e.palette.text.primary, .6),
201
+ color: (e) => j(e.palette.text.secondary ?? e.palette.text.primary, .6),
204
202
  overflow: "hidden",
205
203
  textOverflow: "ellipsis"
206
204
  },
207
- children: r.metadata?.summary
205
+ children: r.summary
208
206
  })]
209
207
  })
210
208
  });
211
- }), le = n(r((e, r) => {
212
- const { groupKey: n, disabled: a, scriptPath: l = ee, ...s } = e, d = K(), [m, u] = c([]), [h, f] = c(!0), [g] = N(["insertScript"]), x = a || (g?.disabled() ?? !1);
209
+ }), fe = n(r((e, r) => {
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);
213
211
  o(() => {
214
- (async () => {
215
- try {
216
- const e = await ne(l);
217
- u(e);
218
- } catch (e) {} finally {
219
- f(!1);
220
- }
221
- })();
222
- }, [l]);
223
- const S = i((e) => {
224
- if (h) return j("div", { children: d("insertScript.loading") });
212
+ let e = !1;
213
+ return h("loading"), de(a).then((t) => {
214
+ e || (m(t), h("ready"));
215
+ }, () => {
216
+ e || (m([]), h("error"));
217
+ }), () => {
218
+ e = !0;
219
+ };
220
+ }, [a, x]);
221
+ const v = i((e) => {
222
+ if ("loading" === f) return W("div", { children: d("insertScript.loading") });
225
223
  const r = {
226
224
  variant: y.Menuitem,
227
225
  groupKey: "scriptsOptions",
228
- disabled: x
226
+ disabled: b
229
227
  }, n = (t) => {
230
- g?.execute(t.content), e.closeFloat?.();
231
- }, i = [];
232
- for (let e = 0; e < m.length; e++) {
233
- const t = m[e];
234
- t && i.push(j(ae, {
228
+ S?.execute(t.content), e.closeFloat?.();
229
+ }, i = () => g((e) => e + 1), o = [];
230
+ "error" === f && o.push(W(L, {
231
+ onMouseDown: (e) => {
232
+ 0 === e.button && e.preventDefault();
233
+ },
234
+ onMouseUp: (e) => {
235
+ 0 === e.button && i();
236
+ },
237
+ onKeyDown: (e) => {
238
+ e.keyCode !== w.Enter && e.keyCode !== w.Space || i();
239
+ },
240
+ children: d("insertScript.loadFailedRetry")
241
+ }, "retry"));
242
+ for (let e = 0; e < u.length; e++) {
243
+ const t = u[e];
244
+ t && o.push(W(me, {
235
245
  handleInsert: n,
236
246
  snippet: t
237
247
  }, t.path));
238
248
  }
239
- const o = H(p, {
249
+ const l = H(p, {
240
250
  sx: {
241
251
  display: "flex",
242
252
  flexDirection: "column",
@@ -244,106 +254,105 @@ var Y = n(r((e, t) => {
244
254
  overflow: "hidden"
245
255
  },
246
256
  children: [
247
- i.length > 0 ? H(W, { children: [j(p, {
257
+ o.length > 0 ? H(U, { children: [W(p, {
248
258
  sx: {
249
259
  overflow: "auto",
250
260
  flex: "1 1 100%"
251
261
  },
252
- children: i
253
- }), j(E, { orientation: "horizontal" })] }) : null,
254
- t(I, {
262
+ children: o
263
+ }), W(E, { orientation: "horizontal" })] }) : null,
264
+ t($, {
255
265
  ...r,
256
266
  key: "showKeyboardShortcuts",
257
267
  commandKey: "showKeyboardShortcuts"
258
268
  }),
259
- t(I, {
269
+ t($, {
260
270
  ...r,
261
271
  key: "scriptingHelp",
262
272
  commandKey: "scriptingHelp"
263
273
  })
264
274
  ]
265
275
  });
266
- return z({
276
+ return M({
267
277
  ...e,
268
- children: o
278
+ children: l
269
279
  });
270
280
  }, [
271
- x,
281
+ b,
272
282
  n,
273
- h,
274
- g,
283
+ f,
284
+ u,
285
+ S,
275
286
  d
276
287
  ]);
277
- return j(L, {
288
+ return W(P, {
278
289
  ref: r,
279
- disabled: x,
290
+ disabled: b,
280
291
  groupKey: n,
281
- label: g?.getLabel(n) ?? d("insertScript.fallbackLabel"),
282
- tooltip: g?.getDescription(),
283
- createPopupPanel: S,
284
- icon: g?.getIcon() ?? "ScriptInsert",
292
+ label: S?.getLabel(n) ?? d("insertScript.fallbackLabel"),
293
+ tooltip: S?.getDescription(),
294
+ renderPopupPanel: v,
295
+ icon: S?.getIcon() ?? "ScriptInsert",
285
296
  ...s
286
297
  });
287
- })), se = n(r((e, t) => {
288
- const { propsCommandButton: r, ...n } = e;
289
- return j(P, {
298
+ })), he = n(r((e, t) => {
299
+ const { propsCommandButton: r, ...n } = e, i = C((e) => {
300
+ const { propsCommandButton: t, propsCommandPopup: r } = e;
301
+ return W(U, { children: H("div", {
302
+ style: {
303
+ display: "flex",
304
+ flex: "1 1 100%"
305
+ },
306
+ children: [
307
+ W("div", { children: W(R, {
308
+ style: {},
309
+ children: W($, {
310
+ ...t,
311
+ commandKey: "saveScripts"
312
+ })
313
+ }) }),
314
+ W("div", { style: { flex: "1 1 100%" } }),
315
+ W("div", { children: W(R, {
316
+ style: {},
317
+ children: W(fe, { ...t })
318
+ }) })
319
+ ]
320
+ }) });
321
+ }, []);
322
+ return W(I, {
290
323
  ref: t,
291
324
  propsCommandButton: r,
292
- renderToolbarPalette: C((e) => {
293
- const { propsCommandButton: t, propsCommandPopup: r } = e;
294
- return j(W, { children: H("div", {
295
- style: {
296
- display: "flex",
297
- flex: "1 1 100%"
298
- },
299
- children: [
300
- j("div", { children: j(R, {
301
- style: {},
302
- children: j(I, {
303
- ...t,
304
- commandKey: "saveScripts"
305
- })
306
- }) }),
307
- j("div", { style: { flex: "1 1 100%" } }),
308
- j("div", { children: j(R, {
309
- style: {},
310
- children: j(le, { ...t })
311
- }) })
312
- ]
313
- }) });
314
- }, []),
325
+ renderToolbarPalette: i,
315
326
  ...n
316
327
  });
317
328
  }));
318
- se.displayName = "ScriptEditorToolbar", V();
319
- var ce = n(r((e, t) => {
320
- const { scriptPath: r = ee, onScriptSelect: n, disabled: i = !1, sx: a = k.EmptyCssProperties, className: l, buttonMinWidth: s = 210, buttonMinHeight: h = 80, gap: g = 12, ...x } = e, y = K(), [S, b] = c([]), [w, C] = c(!0), [F, N] = c(null);
329
+ he.displayName = "ScriptEditorToolbar", Y();
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);
321
332
  if (o(() => {
322
- (async () => {
323
- const e = [{
324
- path: null,
325
- metadata: {
326
- title: y("templateSelect.blankTitle"),
327
- summary: y("templateSelect.blankSummary")
328
- },
329
- content: ""
330
- }];
331
- try {
332
- C(!0), N(null);
333
- const t = await ne(r);
334
- for (let r = 0; r < t.length; r++) {
335
- const n = t[r];
336
- n && e.push(n);
337
- }
338
- } catch (e) {
339
- N(e instanceof Error ? e.message : y("templateSelect.loadFailed")), e instanceof q || console.error("Error loading scripts:", e);
340
- } finally {
341
- b(e), C(!1);
342
- }
343
- })();
344
- }, [r, y]), w) return j(p, {
345
- className: d(l, "script-select"),
346
- ...x,
333
+ let e = !1;
334
+ const t = {
335
+ path: null,
336
+ title: y("templateSelect.blankTitle"),
337
+ summary: y("templateSelect.blankSummary"),
338
+ content: ""
339
+ };
340
+ return C(!0), K(null), de(r).then((r) => {
341
+ e || b([t, ...r]);
342
+ }, (r) => {
343
+ e || (b([t]), K(r instanceof Error ? r.message : y("templateSelect.loadFailed")));
344
+ }).finally(() => {
345
+ e || C(!1);
346
+ }), () => {
347
+ e = !0;
348
+ };
349
+ }, [
350
+ r,
351
+ y,
352
+ N
353
+ ]), w) return W(p, {
354
+ className: d(a, "script-select"),
355
+ ...g,
347
356
  sx: [{
348
357
  display: "flex",
349
358
  justifyContent: "center",
@@ -351,61 +360,69 @@ var ce = n(r((e, t) => {
351
360
  height: "100%",
352
361
  background: (e) => e.palette.background.paper,
353
362
  zIndex: 1e3,
354
- ...Array.isArray(a) ? {} : a
355
- }, ...Array.isArray(a) ? a : []],
356
- children: j(u, {})
363
+ ...Array.isArray(l) ? {} : l
364
+ }, ...Array.isArray(l) ? l : []],
365
+ children: W(m, {})
357
366
  });
358
- let T = null;
359
- F && (T = H(p, {
360
- className: d(l, "script-select", "error-results"),
361
- ...x,
362
- sx: [{
367
+ let $ = null;
368
+ F && ($ = H(p, {
369
+ className: "error-results",
370
+ sx: {
363
371
  display: "flex",
364
- justifyContent: "center",
365
- alignItems: "center",
366
- background: (e) => e.palette.error.light,
367
- flex: "0",
368
- zIndex: 1e3,
369
372
  flexDirection: "column",
370
- padding: (e) => e.spacing(1),
371
- border: (e) => `1px solid ${e.palette.error.main}`,
372
- borderBottomLeftRadius: 1,
373
- borderBottomRightRadius: 1
374
- }, ...Array.isArray(a) ? a : [a]],
375
- children: [j(f, {
376
- color: "error",
377
- variant: "h6",
378
- component: "div",
379
- gutterBottom: !0,
380
- children: y("templateSelect.errorTitle")
381
- }), j(f, {
382
- color: "error",
383
- component: "div",
384
- children: F
385
- })]
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: () => T((e) => e + 1),
400
+ children: y("templateSelect.retry")
401
+ })
402
+ ]
386
403
  }));
387
- const D = (e) => {
388
- const t = e.metadata?.icon;
389
- return "macro" === t ? j(v, {
404
+ const P = (e) => {
405
+ const t = e.icon;
406
+ return "macro" === t ? W(v, {
390
407
  iconKey: "ScriptMacro",
391
408
  size: "1em"
392
- }) : "formula" === t ? j(v, {
409
+ }) : "formula" === t ? W(v, {
393
410
  iconKey: "ScriptFormula",
394
411
  size: "1em"
395
- }) : "autostart" === t ? j(v, {
412
+ }) : "autostart" === t ? W(v, {
396
413
  iconKey: "ScriptAutoRun",
397
414
  size: "1em"
398
415
  }) : null;
399
416
  };
400
417
  return H(p, {
401
418
  ref: t,
402
- className: d(l, "script-select"),
419
+ className: d(a, "script-select"),
403
420
  sx: {
404
421
  background: (e) => e.palette.background.paper,
405
422
  zIndex: 1e3,
406
- ...a
423
+ ...l
407
424
  },
408
- ...x,
425
+ ...g,
409
426
  children: [H(p, {
410
427
  className: "script-select-content",
411
428
  sx: {
@@ -414,40 +431,40 @@ var ce = n(r((e, t) => {
414
431
  flex: "1 1 auto"
415
432
  },
416
433
  children: [
417
- j(f, {
434
+ W(h, {
418
435
  variant: "h6",
419
436
  gutterBottom: !0,
420
437
  children: y("templateSelect.title")
421
438
  }),
422
- j(f, {
439
+ W(h, {
423
440
  variant: "body2",
424
441
  component: "div",
425
442
  gutterBottom: !0,
426
443
  sx: { color: "text.secondary" },
427
444
  children: y("templateSelect.intro")
428
445
  }),
429
- j(f, {
446
+ W(h, {
430
447
  variant: "body2",
431
448
  component: "div",
432
449
  gutterBottom: !0,
433
450
  sx: { color: "text.secondary" },
434
451
  children: y("templateSelect.intro2")
435
452
  }),
436
- j(p, {
453
+ W(p, {
437
454
  sx: {
438
455
  display: "grid",
439
456
  gridTemplateColumns: `repeat(auto-fill, minmax(${s}px, 1fr))`,
440
- gap: `${g}px`,
457
+ gap: `${x}px`,
441
458
  padding: 2,
442
459
  paddingLeft: "0px",
443
460
  paddingRight: "0px"
444
461
  },
445
- children: S.map((e, t) => H(m, {
462
+ children: S.map((e, t) => H(u, {
446
463
  variant: "outlined",
447
464
  disabled: i,
448
465
  sx: {
449
466
  minWidth: s,
450
- minHeight: h,
467
+ minHeight: f,
451
468
  display: "flex",
452
469
  flexDirection: "column",
453
470
  justifyContent: "flex-start",
@@ -472,12 +489,12 @@ var ce = n(r((e, t) => {
472
489
  width: "100%",
473
490
  marginBottom: .5
474
491
  },
475
- children: [j(f, {
492
+ children: [W(h, {
476
493
  variant: "subtitle2",
477
494
  component: "div",
478
- children: e.metadata?.title || e.path?.split("/").pop()?.replace(/\.\w+$/, "") || y("templateSelect.untitled")
479
- }), D(e)]
480
- }), e.metadata?.summary && j(f, {
495
+ children: e.title || y("templateSelect.untitled")
496
+ }), P(e)]
497
+ }), e.summary && W(h, {
481
498
  variant: "body2",
482
499
  component: "div",
483
500
  sx: {
@@ -488,49 +505,49 @@ var ce = n(r((e, t) => {
488
505
  textOverflow: "ellipsis",
489
506
  alignItems: "flex-start"
490
507
  },
491
- children: e.metadata.summary
508
+ children: e.summary
492
509
  })]
493
510
  }, `${e.path}-${t}`))
494
511
  })
495
512
  ]
496
- }), T]
513
+ }), $]
497
514
  });
498
515
  }));
499
- ce.displayName = "TemplateSelectPanel";
500
- var de = n(r((e, t) => {
501
- const { className: r, sx: n, propsScriptEditor: l, readOnly: m = !1, frame: u, autoFocusSel: x, autoFocus: y = !0, scripts: S, ...b } = e, v = g(), [w, k] = c(!1), F = s(!1), [N, K] = 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({
502
519
  message: "Loading",
503
520
  cursor: "",
504
521
  dirty: !1
505
- }), [I, L] = c(null);
522
+ }), [$, P] = c(null);
506
523
  o(() => {
507
524
  let e = !1;
508
- return L(null), async function() {
525
+ return P(null), async function() {
509
526
  if (S && (await S.start(), !e)) {
510
527
  const e = S.getModules().getItems()[0]?.getSource();
511
- L({ source: e || null });
528
+ P({ source: e || null });
512
529
  }
513
530
  }(), () => {
514
531
  e = !0;
515
532
  };
516
533
  }, [S]);
517
- const P = i((e) => {
518
- K((t) => ({
534
+ const I = i((e) => {
535
+ D((t) => ({
519
536
  ...t,
520
537
  ...e
521
538
  }));
522
- }, []), E = s(null), [$, R] = c(null), z = s(null), B = C((e) => {
523
- if ($) return $.focus(e), !0;
524
- if (x) {
525
- 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);
526
543
  if (t && t.length > 0) return t[0]?.focus?.(e), !0;
527
544
  }
528
545
  return E.current?.focus?.(e), !1;
529
546
  }, [
530
- $,
531
- x,
547
+ L,
548
+ g,
532
549
  y
533
- ]), O = a(() => j(D, {
550
+ ]), O = l(() => W(T, {
534
551
  transitionDelay: "160ms",
535
552
  style: {
536
553
  position: "absolute",
@@ -538,7 +555,7 @@ var de = n(r((e, t) => {
538
555
  height: "100%"
539
556
  },
540
557
  transparentBackground: !1
541
- }), []), A = a(() => j(h, {
558
+ }), []), B = l(() => W(f, {
542
559
  elevation: 1,
543
560
  tabIndex: 0,
544
561
  sx: {
@@ -551,8 +568,8 @@ var de = n(r((e, t) => {
551
568
  marginTop: (e) => e.spacing(1),
552
569
  marginBottom: (e) => e.spacing(1)
553
570
  },
554
- children: j(se, {})
555
- }), [v]), M = a(() => j(p, {
571
+ children: W(he, {})
572
+ }), [v]), A = l(() => W(p, {
556
573
  className: d("script-status-panel", "status-panel"),
557
574
  sx: {
558
575
  display: "flex",
@@ -576,7 +593,7 @@ var de = n(r((e, t) => {
576
593
  justifyContent: "center"
577
594
  },
578
595
  children: [
579
- j(f, {
596
+ W(h, {
580
597
  component: "div",
581
598
  sx: {
582
599
  userSelect: "none",
@@ -587,9 +604,9 @@ var de = n(r((e, t) => {
587
604
  color: (e) => e.palette.text.secondary
588
605
  },
589
606
  variant: "caption",
590
- children: N.message
607
+ children: K.message
591
608
  }),
592
- j(f, {
609
+ W(h, {
593
610
  component: "div",
594
611
  sx: {
595
612
  userSelect: "none",
@@ -600,9 +617,9 @@ var de = n(r((e, t) => {
600
617
  color: (e) => e.palette.text.secondary
601
618
  },
602
619
  variant: "caption",
603
- children: N.dirty ? "Unsaved" : ""
620
+ children: K.dirty ? "Unsaved" : ""
604
621
  }),
605
- j(f, {
622
+ W(h, {
606
623
  component: "div",
607
624
  sx: {
608
625
  userSelect: "none",
@@ -617,11 +634,11 @@ var de = n(r((e, t) => {
617
634
  color: (e) => e.palette.text.secondary
618
635
  },
619
636
  variant: "caption",
620
- children: N.cursor
637
+ children: K.cursor
621
638
  })
622
639
  ]
623
640
  })
624
- }), [N]), W = a(() => H(p, {
641
+ }), [K]), U = l(() => H(p, {
625
642
  className: d("script-editor-content"),
626
643
  sx: {
627
644
  display: "flex",
@@ -631,8 +648,8 @@ var de = n(r((e, t) => {
631
648
  boxSizing: "border-box"
632
649
  },
633
650
  children: [
634
- A,
635
- j(p, {
651
+ B,
652
+ W(p, {
636
653
  sx: {
637
654
  display: "flex",
638
655
  flex: "1 1 100%",
@@ -641,35 +658,35 @@ var de = n(r((e, t) => {
641
658
  position: "relative",
642
659
  boxSizing: "border-box"
643
660
  },
644
- children: j(G, {
661
+ children: W(_, {
645
662
  ref: E,
646
663
  loadingPanel: O,
647
- readOnly: m,
648
- frame: u,
664
+ readOnly: u,
665
+ frame: m,
649
666
  scripts: S,
650
667
  autoFocus: y,
651
- onStatusChange: P,
668
+ onStatusChange: I,
652
669
  darkMode: "dark" === v.palette.mode,
653
- ...l
670
+ ...a
654
671
  })
655
672
  }),
656
- M
673
+ A
657
674
  ]
658
675
  }), [
659
676
  v,
677
+ B,
660
678
  A,
661
- M,
662
679
  w,
663
680
  O,
664
- m,
665
- l,
666
- y,
667
- x,
668
681
  u,
669
- P
670
- ]), U = a(() => {
682
+ a,
683
+ y,
684
+ g,
685
+ m,
686
+ I
687
+ ]), j = l(() => {
671
688
  let e;
672
- return null === I ? O : (null === I.source && (e = j(ce, {
689
+ return null === $ ? O : (null === $.source && (e = W(xe, {
673
690
  sx: {
674
691
  display: "flex",
675
692
  flex: "1 1 100%",
@@ -680,11 +697,11 @@ var de = n(r((e, t) => {
680
697
  width: "100%",
681
698
  height: "100%"
682
699
  },
683
- disabled: m,
700
+ disabled: u,
684
701
  onScriptSelect: (e) => {
685
- E.current?.insertSnippet(e.content), L({ source: e.content ?? "" }), requestAnimationFrame(() => E.current?.focus());
702
+ E.current?.insertSnippet(e.content), P({ source: e.content ?? "" }), requestAnimationFrame(() => E.current?.focus());
686
703
  }
687
- })), j(p, {
704
+ })), W(p, {
688
705
  tabIndex: 0,
689
706
  className: d("script-workspace", r),
690
707
  sx: {
@@ -706,7 +723,7 @@ var de = n(r((e, t) => {
706
723
  position: "relative",
707
724
  display: "flex"
708
725
  },
709
- children: [j(p, {
726
+ children: [W(p, {
710
727
  sx: {
711
728
  display: "flex",
712
729
  flex: "1 1 100%",
@@ -714,24 +731,24 @@ var de = n(r((e, t) => {
714
731
  minHeight: 0,
715
732
  visibility: e ? "hidden" : "visible"
716
733
  },
717
- children: W
734
+ children: U
718
735
  }), e]
719
736
  })
720
737
  }));
721
738
  }, [
722
- A,
723
- W,
739
+ B,
740
+ U,
724
741
  r,
725
- I,
742
+ $,
726
743
  O,
727
- m
728
- ]), q = T(t, () => ({
744
+ u
745
+ ]), q = N(t, () => ({
729
746
  isScriptWorkspaceElement: () => !0,
730
747
  focus: (e) => {
731
- B(e);
748
+ z(e);
732
749
  }
733
750
  }), []);
734
- return j(p, {
751
+ return W(p, {
735
752
  sx: {
736
753
  display: "flex",
737
754
  flexDirection: "row",
@@ -742,58 +759,60 @@ var de = n(r((e, t) => {
742
759
  ref: q,
743
760
  ...b,
744
761
  onFocus: (e) => {
745
- k(!0), F.current = !0, q.current?.contains(e.target) && e.target !== q.current && R(e.target), e.relatedTarget && !z.current && (z.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);
746
763
  },
747
764
  onBlur: (e) => {
748
- q?.current?.contains(e.relatedTarget) || q?.current === e.relatedTarget || (z.current = null, F.current = !1, k(!1)), b?.onBlur?.(e);
765
+ q?.current?.contains(e.relatedTarget) || q?.current === e.relatedTarget || (M.current = null, F.current = !1, k(!1)), b?.onBlur?.(e);
749
766
  },
750
- children: U
767
+ children: j
751
768
  });
752
769
  }));
753
- de.displayName = "ScriptWorkspace";
754
- var { FocusActivation: pe, CommandScopeProvider: me, CommandAnchorProvider: ue, useCommandScope: he } = x, fe = { scopeName: "scriptEditor" }, ge = ({ children: e }) => {
755
- const t = he(), r = s(null);
756
- return t ? j(me, {
757
- spec: fe,
770
+ ge.displayName = "ScriptWorkspace";
771
+ var { FocusActivation: ye, CommandScopeProvider: Se, CommandAnchorProvider: be, useCommandScope: ve } = g, we = { scopeName: "scriptEditor" }, ke = ({ children: e }) => {
772
+ const t = ve(), r = s(null);
773
+ return t ? W(Se, {
774
+ spec: we,
758
775
  elementRef: r,
759
776
  region: !0,
760
- children: j(xe, {
777
+ children: W(Ce, {
761
778
  paneRef: r,
762
779
  children: e
763
780
  })
764
781
  }) : e;
765
- }, xe = ({ paneRef: e, children: t }) => {
766
- const r = he(), n = a(() => r ? new pe(r.getRoot(), r) : null, [r]);
767
- return n ? H(ue, {
782
+ }, Ce = ({ paneRef: e, children: t }) => {
783
+ const r = ve(), n = l(() => r ? new ye(r.getRoot(), r) : null, [r]);
784
+ return n ? H(be, {
768
785
  tracker: n,
769
786
  keyBindings: !1,
770
787
  debounce: 100,
771
788
  elementRef: e,
772
- children: [j(O, {}), j("div", {
789
+ children: [W(O, {}), W("div", {
773
790
  className: "script-editor-pane",
774
791
  style: { display: "contents" },
775
792
  ref: e,
776
793
  children: t
777
794
  })]
778
795
  }) : t;
779
- }, ye = (e) => {
780
- const { model: t, entryKey: r, frame: n, ref: i, ...o } = e, a = M() ?? t;
781
- return A(a, ["onProtectionChange"]), j(ge, { children: j(de, {
796
+ }, Fe = (e) => {
797
+ const { model: t, entryKey: r, frame: n, ref: i, ...o } = e, l = A() ?? t;
798
+ B(l, ["onProtectionChange"]);
799
+ const a = l?.getScripts().isReadOnly() ?? !1;
800
+ return W(ke, { children: W(ge, {
782
801
  ref: i,
783
- readOnly: a?.getScripts().isReadOnly() ?? !1,
802
+ readOnly: a,
784
803
  frame: n,
785
- scripts: a?.getScripts(),
804
+ scripts: l?.getScripts(),
786
805
  ...o
787
806
  }) });
788
- }, Se = n((e) => {
789
- const { alwaysShow: t = !1, ...r } = e, [n, i] = l((e) => e + 1, 0), [a] = N(["showScriptEditor"], { onChange: () => i() }), s = M(), [d, p] = c(t);
807
+ }, Ke = n((e) => {
808
+ const { alwaysShow: t = !1, ...r } = e, [n, i] = a((e) => e + 1, 0), [l] = K(["showScriptEditor"], { onChange: () => i() }), s = A(), [d, p] = c(t);
790
809
  return o(() => {
791
810
  if (t) return void p(!0);
792
811
  const e = s?.getScripts();
793
- if (!e || !a) return void p(!1);
812
+ if (!e || !l) return void p(!1);
794
813
  const r = async () => {
795
814
  let t = !1;
796
- a.getState() || (t = ((await e.searchFunctions({ type: "macro" }))?.length ?? 0) > 0), p(t || !!a.getState());
815
+ l.getState() || (t = ((await e.searchFunctions({ type: "macro" }))?.length ?? 0) > 0), p(t || !!l.getState());
797
816
  };
798
817
  r();
799
818
  const n = e.addListeners({ onChange: () => {
@@ -805,13 +824,13 @@ var { FocusActivation: pe, CommandScopeProvider: me, CommandAnchorProvider: ue,
805
824
  }, [
806
825
  t,
807
826
  s,
808
- a,
827
+ l,
809
828
  n
810
- ]), d ? H(W, { children: [j(E, {}), j(Y, { ...r })] }) : null;
829
+ ]), d ? H(U, { children: [W(E, {}), W(te, { ...r })] }) : null;
811
830
  });
812
- Se.displayName = "RunScriptContribution", V();
813
- var be = n(r((e, r) => {
814
- const { ...n } = e, i = M(), a = K(), [l, s] = c([]);
831
+ Ke.displayName = "RunScriptContribution", Y();
832
+ var Ne = n(r((e, r) => {
833
+ const { ...n } = e, i = A(), l = D(), [a, s] = c([]);
815
834
  o(() => {
816
835
  const e = i?.getScripts();
817
836
  if (!e) return;
@@ -831,19 +850,19 @@ var be = n(r((e, r) => {
831
850
  const d = {
832
851
  variant: y.Menuitem,
833
852
  shortcut: void 0
834
- }, m = [], u = l ? l.length : 0;
835
- for (let e = 0; e < u; e++) {
836
- const t = l[e];
837
- m.push(j(I, {
853
+ }, u = [], m = a ? a.length : 0;
854
+ for (let e = 0; e < m; e++) {
855
+ const t = a[e];
856
+ u.push(W($, {
838
857
  ...d,
839
858
  commandKey: "insertFunction",
840
859
  commandState: t,
841
- propsTooltip: { description: a("insertFunction.insertNamed", { name: t.getName() ?? a("insertFunction.fallbackLabel") }) },
842
- icon: j(v, { iconKey: "FormulaCustom" }),
843
- label: t.getName() ?? a("insertFunction.fallbackLabel")
860
+ propsTooltip: { description: l("insertFunction.insertNamed", { name: t.getName() ?? l("insertFunction.fallbackLabel") }) },
861
+ icon: W(v, { iconKey: "FormulaCustom" }),
862
+ label: t.getName() ?? l("insertFunction.fallbackLabel")
844
863
  }, `function-${t.getName()}-${e}`));
845
864
  }
846
- const h = H(p, {
865
+ const f = H(p, {
847
866
  ref: r,
848
867
  sx: {
849
868
  display: "flex",
@@ -851,62 +870,60 @@ var be = n(r((e, r) => {
851
870
  flex: "1 1 100%",
852
871
  overflow: "hidden"
853
872
  },
854
- children: [m.length > 0 ? H(W, { children: [j(p, {
873
+ children: [u.length > 0 ? H(U, { children: [W(p, {
855
874
  sx: {
856
875
  overflow: "auto",
857
876
  flex: "1 1 100%"
858
877
  },
859
- children: m
860
- }), j(E, { orientation: "horizontal" })] }) : null, t(I, {
878
+ children: u
879
+ }), W(E, { orientation: "horizontal" })] }) : null, t($, {
861
880
  ...d,
862
881
  key: "show-editor",
863
882
  commandKey: "showScriptEditor"
864
883
  })]
865
884
  });
866
- return z({
885
+ return M({
867
886
  ...n,
868
- children: h
887
+ children: f
869
888
  });
870
889
  }));
871
- be.displayName = "InsertFunctionPopupPanel";
872
- var ve = n(r((e, t) => {
873
- const { disabled: r, groupKey: n, ...o } = e, a = F("customFunctionOptions");
874
- return j(L, {
890
+ Ne.displayName = "InsertFunctionPopupPanel";
891
+ var De = n(r((e, t) => {
892
+ const { disabled: r, groupKey: n, ...o } = e, l = F("customFunctionOptions"), a = i((e) => {
893
+ const t = W(Ne, {
894
+ disabled: r,
895
+ groupKey: n,
896
+ ...e
897
+ });
898
+ return M({
899
+ ...e,
900
+ children: t
901
+ });
902
+ }, [r, n]);
903
+ return W(P, {
875
904
  ref: t,
876
905
  disabled: r,
877
- createPopupPanel: i((e) => {
878
- const t = j(be, {
879
- disabled: r,
880
- groupKey: n,
881
- ...e
882
- });
883
- return z({
884
- ...e,
885
- children: t
886
- });
887
- }, [r, n]),
888
- label: a?.getLabel?.(),
889
- tooltip: a?.getDescription?.(),
906
+ renderPopupPanel: a,
907
+ label: l?.getLabel?.(),
908
+ tooltip: l?.getDescription?.(),
890
909
  icon: "FormulaCustom",
891
910
  ...o
892
911
  });
893
912
  }));
894
- ve.displayName = "InsertFunctionContribution";
895
- var we = () => {
896
- J(), b.register("plugin-scripts", { icons: {} }), B.registerTaskPane({
913
+ De.displayName = "InsertFunctionContribution";
914
+ var Te = () => {
915
+ J(), b.register("plugin-scripts", { icons: {} }), z.registerTaskPane({
897
916
  key: "scriptEditor",
898
- getTitle: () => "Script (Typescript)",
899
- getIcon: () => "ScriptRun",
900
- component: ye,
917
+ component: Fe,
901
918
  keepMounted: !0
902
919
  }, !0), S.register({ key: "scriptsOptions" }, !0), S.register({ key: "customFunctionOptions" }, !0), S.register({
903
920
  key: "scripting.runScript.home",
904
921
  contributions: { homeToolbar: {} },
905
- render: (t) => e.createElement(Se, { ...t })
922
+ render: (t) => e.createElement(Ke, { ...t })
906
923
  }, !0), S.register({
907
924
  key: "scripting.runScript.view",
908
925
  contributions: { viewToolbar: { order: 10 } },
909
- render: (t) => e.createElement(Se, {
926
+ render: (t) => e.createElement(Ke, {
910
927
  ...t,
911
928
  groupKey: "view",
912
929
  alwaysShow: !0
@@ -917,7 +934,7 @@ var we = () => {
917
934
  anchor: "formulaCategory.web",
918
935
  order: 1
919
936
  } },
920
- render: (t) => e.createElement(ve, { ...t })
937
+ render: (t) => e.createElement(De, { ...t })
921
938
  }, !0);
922
939
  };
923
- export { le as InsertScriptCommandButton, Y as RunScriptCommandButton, se as ScriptEditorToolbar, ye as ScriptTaskPane, de as ScriptWorkspace, we as ScriptingPlugin };
940
+ export { fe as InsertScriptCommandButton, te as RunScriptCommandButton, he as ScriptEditorToolbar, Fe as ScriptTaskPane, ge as ScriptWorkspace, Te as ScriptingPlugin };