@sheetxl/scripting-react 0.8.0-beta.1 → 0.8.0-beta.10

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-react - Scripting React - Monaco based script editor and scripting UI for SheetXL. - v0.8.0-beta.1
2
+ * @license @sheetxl/scripting-react - Scripting React - Monaco based script editor and scripting UI for SheetXL. - v0.8.0-beta.10
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.
@@ -193,15 +193,15 @@ function O(e) {
193
193
  return t = !0;
194
194
  }, n;
195
195
  }
196
- var k, A, j = ["monaco"], M = (k = x.create({
196
+ var k, A, j = ["monaco"], M = x.create({
197
197
  config: { paths: { vs: "https://cdn.jsdelivr.net/npm/monaco-editor@0.55.1/min/vs" } },
198
198
  isInitialized: !1,
199
199
  resolve: null,
200
200
  reject: null,
201
201
  monaco: null
202
- }), A = 2, function(e) {
202
+ }), N = (A = 2, function(e) {
203
203
  if (Array.isArray(e)) return e;
204
- }(k) || function(e, t) {
204
+ }(k = M) || function(e, t) {
205
205
  var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
206
206
  if (n != null) {
207
207
  var r, i, a, o, s = [], c = !0, l = !1;
@@ -226,12 +226,12 @@ var k, A, j = ["monaco"], M = (k = x.create({
226
226
  }
227
227
  }(k, A) || function() {
228
228
  throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
229
- }()), N = M[0], P = M[1];
230
- function F(e) {
229
+ }()), P = N[0], F = N[1];
230
+ function I(e) {
231
231
  return document.body.appendChild(e);
232
232
  }
233
- function I(e) {
234
- var t, n, r = N(function(e) {
233
+ function L(e) {
234
+ var t, n, r = P(function(e) {
235
235
  return {
236
236
  config: e.config,
237
237
  reject: e.reject
@@ -241,8 +241,8 @@ function I(e) {
241
241
  return e();
242
242
  }, i.onerror = r.reject, i;
243
243
  }
244
- function L() {
245
- var e = N(function(e) {
244
+ function R() {
245
+ var e = P(function(e) {
246
246
  return {
247
247
  config: e.config,
248
248
  resolve: e.resolve,
@@ -251,20 +251,20 @@ function L() {
251
251
  }), t = window.require;
252
252
  t.config(e.config), t(["vs/editor/editor.main"], function(t) {
253
253
  var n = t.m || t;
254
- R(n), e.resolve(n);
254
+ z(n), e.resolve(n);
255
255
  }, function(t) {
256
256
  e.reject(t);
257
257
  });
258
258
  }
259
- function R(e) {
260
- N().monaco || P({ monaco: e });
259
+ function z(e) {
260
+ P().monaco || F({ monaco: e });
261
261
  }
262
- var z = new Promise(function(e, t) {
263
- return P({
262
+ var B = new Promise(function(e, t) {
263
+ return F({
264
264
  resolve: e,
265
265
  reject: t
266
266
  });
267
- }), B = {
267
+ }), V = {
268
268
  config: function(e) {
269
269
  var t = T.config(e), n = t.monaco, r = function(e, t) {
270
270
  if (e == null) return {};
@@ -283,7 +283,7 @@ var z = new Promise(function(e, t) {
283
283
  }
284
284
  return i;
285
285
  }(t, j);
286
- P(function(e) {
286
+ F(function(e) {
287
287
  return {
288
288
  config: E(e.config, r),
289
289
  monaco: n
@@ -291,7 +291,7 @@ var z = new Promise(function(e, t) {
291
291
  });
292
292
  },
293
293
  init: function() {
294
- var e = N(function(e) {
294
+ var e = P(function(e) {
295
295
  return {
296
296
  monaco: e.monaco,
297
297
  isInitialized: e.isInitialized,
@@ -299,8 +299,8 @@ var z = new Promise(function(e, t) {
299
299
  };
300
300
  });
301
301
  if (!e.isInitialized) {
302
- if (P({ isInitialized: !0 }), e.monaco) return e.resolve(e.monaco), O(z);
303
- if (window.monaco && window.monaco.editor) return R(window.monaco), e.resolve(window.monaco), O(z);
302
+ if (F({ isInitialized: !0 }), e.monaco) return e.resolve(e.monaco), O(B);
303
+ if (window.monaco && window.monaco.editor) return z(window.monaco), e.resolve(window.monaco), O(B);
304
304
  (function() {
305
305
  var e = [...arguments];
306
306
  return function(t) {
@@ -308,40 +308,40 @@ var z = new Promise(function(e, t) {
308
308
  return t(e);
309
309
  }, t);
310
310
  };
311
- })(F, I)(L);
311
+ })(I, L)(R);
312
312
  }
313
- return O(z);
313
+ return O(B);
314
314
  },
315
315
  __getMonacoInstance: function() {
316
- return N(function(e) {
316
+ return P(function(e) {
317
317
  return e.monaco;
318
318
  });
319
319
  }
320
- }, V = {
320
+ }, H = {
321
321
  display: "flex",
322
322
  position: "relative",
323
323
  textAlign: "initial"
324
- }, H = { width: "100%" }, U = { display: "none" }, W = { container: {
324
+ }, U = { width: "100%" }, W = { display: "none" }, G = { container: {
325
325
  display: "flex",
326
326
  height: "100%",
327
327
  width: "100%",
328
328
  justifyContent: "center",
329
329
  alignItems: "center"
330
- } }, G = function({ children: t }) {
331
- return e.createElement("div", { style: W.container }, t);
330
+ } }, ee = function({ children: t }) {
331
+ return e.createElement("div", { style: G.container }, t);
332
332
  }, K = t(function({ width: t, height: n, isEditorReady: r, loading: i, _ref: a, className: o, wrapperProps: s }) {
333
333
  return e.createElement("section", {
334
334
  style: {
335
- ...V,
335
+ ...H,
336
336
  width: t,
337
337
  height: n
338
338
  },
339
339
  ...s
340
- }, !r && e.createElement(G, null, i), e.createElement("div", {
340
+ }, !r && e.createElement(ee, null, i), e.createElement("div", {
341
341
  ref: a,
342
342
  style: {
343
- ...H,
344
- ...!r && U
343
+ ...U,
344
+ ...!r && W
345
345
  },
346
346
  className: o
347
347
  }));
@@ -364,10 +364,10 @@ function X(e, t, n, r) {
364
364
  function Z(e, t) {
365
365
  return e.Uri.parse(t);
366
366
  }
367
- var ee = t(function({ original: t, modified: o, language: s, originalLanguage: c, modifiedLanguage: l, originalModelPath: u, modifiedModelPath: d, keepCurrentOriginalModel: f = !1, keepCurrentModifiedModel: p = !1, theme: m = "light", loading: h = "Loading...", options: g = {}, height: _ = "100%", width: v = "100%", className: y, wrapperProps: b = {}, beforeMount: x = Y, onMount: S = Y }) {
367
+ var te = t(function({ original: t, modified: o, language: s, originalLanguage: c, modifiedLanguage: l, originalModelPath: u, modifiedModelPath: d, keepCurrentOriginalModel: f = !1, keepCurrentModifiedModel: p = !1, theme: m = "light", loading: h = "Loading...", options: g = {}, height: _ = "100%", width: v = "100%", className: y, wrapperProps: b = {}, beforeMount: x = Y, onMount: S = Y }) {
368
368
  let [C, w] = a(!1), [T, E] = a(!0), D = i(null), O = i(null), k = i(null), A = i(S), j = i(x), M = i(!1);
369
369
  q(() => {
370
- let e = B.init();
370
+ let e = V.init();
371
371
  return e.then((e) => (O.current = e) && E(!1)).catch((e) => e?.type !== "cancelation" && console.error("Monaco initialization: error:", e)), () => D.current ? function() {
372
372
  let e = D.current?.getModel();
373
373
  f || e?.original?.dispose(), p || e?.modified?.dispose(), D.current?.dispose();
@@ -446,23 +446,23 @@ var ee = t(function({ original: t, modified: o, language: s, originalLanguage: c
446
446
  className: y,
447
447
  wrapperProps: b
448
448
  });
449
- }), te = function() {
450
- let [e, t] = a(B.__getMonacoInstance());
449
+ }), ne = function() {
450
+ let [e, t] = a(V.__getMonacoInstance());
451
451
  return q(() => {
452
452
  let n;
453
- return e || (n = B.init(), n.then((e) => {
453
+ return e || (n = V.init(), n.then((e) => {
454
454
  t(e);
455
455
  })), () => n?.cancel();
456
456
  }), e;
457
- }, ne = function(e) {
457
+ }, re = function(e) {
458
458
  let t = i();
459
459
  return r(() => {
460
460
  t.current = e;
461
461
  }, [e]), t.current;
462
462
  }, Q = /* @__PURE__ */ new Map(), $ = t(function({ defaultValue: t, defaultLanguage: o, defaultPath: s, value: c, language: l, path: u, theme: d = "light", line: f, loading: p = "Loading...", options: m = {}, overrideServices: h = {}, saveViewState: g = !0, keepCurrentModel: _ = !1, width: v = "100%", height: y = "100%", className: b, wrapperProps: x = {}, beforeMount: S = Y, onMount: C = Y, onChange: w, onValidate: T = Y }) {
463
- let [E, D] = a(!1), [O, k] = a(!0), A = i(null), j = i(null), M = i(null), N = i(C), P = i(S), F = i(), I = i(c), L = ne(u), R = i(!1), z = i(!1);
463
+ let [E, D] = a(!1), [O, k] = a(!0), A = i(null), j = i(null), M = i(null), N = i(C), P = i(S), F = i(), I = i(c), L = re(u), R = i(!1), z = i(!1);
464
464
  q(() => {
465
- let e = B.init();
465
+ let e = V.init();
466
466
  return e.then((e) => (A.current = e) && k(!1)).catch((e) => e?.type !== "cancelation" && console.error("Monaco initialization: error:", e)), () => j.current ? (F.current?.dispose(), _ ? g && Q.set(u, j.current.saveViewState()) : j.current.getModel()?.dispose(), void j.current.dispose()) : e.cancel();
467
467
  }), J(() => {
468
468
  let e = X(A.current, t || c || "", o || l || "", u || s || "");
@@ -483,7 +483,7 @@ var ee = t(function({ original: t, modified: o, language: s, originalLanguage: c
483
483
  }, [f], E), J(() => {
484
484
  A.current?.editor.setTheme(d);
485
485
  }, [d], E);
486
- let V = n(() => {
486
+ let B = n(() => {
487
487
  if (M.current && A.current && !R.current) {
488
488
  P.current(A.current);
489
489
  let e = u || s, n = X(A.current, c || t || "", o || l || "", e || "");
@@ -509,11 +509,11 @@ var ee = t(function({ original: t, modified: o, language: s, originalLanguage: c
509
509
  return r(() => {
510
510
  E && N.current(j.current, A.current);
511
511
  }, [E]), r(() => {
512
- !O && !E && V();
512
+ !O && !E && B();
513
513
  }, [
514
514
  O,
515
515
  E,
516
- V
516
+ B
517
517
  ]), I.current = c, r(() => {
518
518
  E && w && (F.current?.dispose(), F.current = j.current?.onDidChangeModelContent((e) => {
519
519
  z.current || w(j.current.getValue(), e);
@@ -541,5 +541,5 @@ var ee = t(function({ original: t, modified: o, language: s, originalLanguage: c
541
541
  className: b,
542
542
  wrapperProps: x
543
543
  });
544
- }), re = $;
545
- export { ee as DiffEditor, $ as Editor, re as default, B as loader, te as useMonaco };
544
+ }), ie = $;
545
+ export { te as DiffEditor, $ as Editor, ie as default, V as loader, ne as useMonaco };
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license @sheetxl/scripting-react - Scripting React - Monaco based script editor and scripting UI for SheetXL. - v0.8.0-beta.1
2
+ * @license @sheetxl/scripting-react - Scripting React - Monaco based script editor and scripting UI for SheetXL. - v0.8.0-beta.10
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.
@@ -10,7 +10,7 @@ var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescr
10
10
  enumerable: !(s = n(i, c)) || s.enumerable
11
11
  });
12
12
  return e;
13
- })(!s && o && o.__esModule ? c : t(c, "default", {
13
+ })(!s && o && o.__esModule && a.call(o, "default") ? c : t(c, "default", {
14
14
  value: o,
15
15
  enumerable: !0
16
16
  }), o));