@sheetxl/scripting-mui 0.8.0-beta.1 → 0.8.0-beta.11

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