@marimo-team/islands 0.25.3-dev312 → 0.25.3-dev316

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.
Files changed (53) hide show
  1. package/dist/{ErrorBoundary-CCrWQ8Zi.js → ErrorBoundary-C3G05Nb1.js} +1 -1
  2. package/dist/{chat-ui-DkuxGEDp.js → chat-ui-DASKYW38.js} +13 -13
  3. package/dist/{code-visibility-DLBADpvq.js → code-visibility-B3_gXvem.js} +31 -32
  4. package/dist/{common-Cc-bvilP.js → common-Vd6TgXHQ.js} +5074 -5074
  5. package/dist/{config-BVYA1P0C.js → config-CL7mwGLX.js} +87 -129
  6. package/dist/{data-grid-overlay-editor-CAEih52I.js → data-grid-overlay-editor-DLEPVcX1.js} +1 -1
  7. package/dist/{error-entries-istW7Xbs.js → error-entries-kb4H6PAT.js} +533 -508
  8. package/dist/feedback-button-gqE30Uez.js +370 -0
  9. package/dist/{formats-CMa7L3E8.js → formats-qhBmYb0l.js} +1 -1
  10. package/dist/{glide-data-editor-hsf5AOwE.js → glide-data-editor-BmtEcZoo.js} +3 -3
  11. package/dist/{globals-Blgj9EWO.js → globals-BIt_qRYC.js} +1 -1
  12. package/dist/{html-to-image-pPbR2cDx.js → html-to-image-DR8VPB7E.js} +4018 -4021
  13. package/dist/main.js +606 -607
  14. package/dist/{number-overlay-editor-BgNsDtQP.js → number-overlay-editor-Bbxt9i1c.js} +1 -1
  15. package/dist/{process-output-BySO1nIs.js → process-output-BDMtqL6K.js} +2 -2
  16. package/dist/{reveal-component-MUD9gGln.js → reveal-component-DXFsIk5S.js} +4 -4
  17. package/dist/static-state-Dtocd9UO.js +68 -0
  18. package/dist/{vega-component-Bly2lDhz.js → vega-component-CeN8zClP.js} +9 -9
  19. package/package.json +1 -1
  20. package/src/__tests__/mount.test.ts +17 -58
  21. package/src/components/editor/actions/useRestartKernel.tsx +0 -5
  22. package/src/components/editor/cell/__tests__/useRunCells.test.tsx +0 -3
  23. package/src/components/editor/cell/useRunCells.ts +2 -2
  24. package/src/components/editor/chrome/wrapper/footer-items/backend-status.tsx +2 -16
  25. package/src/components/editor/renderers/cell-array.tsx +0 -3
  26. package/src/core/edit-app.tsx +2 -7
  27. package/src/core/executions/__tests__/run.test.ts +0 -3
  28. package/src/core/executions/index.ts +1 -1
  29. package/src/core/executions/run.ts +1 -14
  30. package/src/core/islands/bootstrap.ts +0 -1
  31. package/src/core/network/__tests__/requests-network.test.ts +0 -16
  32. package/src/core/network/connection.ts +0 -5
  33. package/src/core/network/requests-toasting.tsx +1 -49
  34. package/src/core/network/resolve.ts +1 -5
  35. package/src/core/notebook/replica/__tests__/replica.test.ts +3 -3
  36. package/src/core/notebook/replica/connection.ts +1 -5
  37. package/src/core/runtime/__tests__/createWsUrl.test.ts +4 -16
  38. package/src/core/runtime/__tests__/runtime.test.ts +58 -168
  39. package/src/core/runtime/adapter.ts +1 -8
  40. package/src/core/runtime/config.ts +4 -59
  41. package/src/core/runtime/runtime.ts +1 -31
  42. package/src/core/runtime/types.ts +0 -5
  43. package/src/core/session/__tests__/useNotebookReplica.hook.test.tsx +5 -5
  44. package/src/core/session/__tests__/useNotebookSession.hook.test.tsx +125 -29
  45. package/src/core/session/connection-utils.ts +2 -14
  46. package/src/core/session/useNotebookSession.tsx +19 -12
  47. package/src/mount.tsx +3 -9
  48. package/src/utils/errors.ts +0 -7
  49. package/dist/feedback-button-BJvIOw-c.js +0 -371
  50. package/dist/toDate-5qPtZ6HL.js +0 -94
  51. package/src/components/editor/alerts/connecting-alert.tsx +0 -27
  52. package/src/core/network/__tests__/requests-lazy.test.ts +0 -322
  53. package/src/core/network/requests-lazy.ts +0 -222
@@ -129,7 +129,7 @@ function N(e) {
129
129
  }
130
130
  //#endregion
131
131
  //#region src/components/editor/boundary/ErrorBoundary.tsx
132
- var P = (0, C.lazy)(() => import("./feedback-button-BJvIOw-c.js").then((e) => ({ default: e.FeedbackModal }))), F = (e) => {
132
+ var P = (0, C.lazy)(() => import("./feedback-button-gqE30Uez.js").then((e) => ({ default: e.FeedbackModal }))), F = (e) => {
133
133
  let t = (0, S.c)(2), n;
134
134
  return t[0] === e.children ? n = t[1] : (n = /* @__PURE__ */ (0, k.jsx)(E, {
135
135
  FallbackComponent: I,
@@ -3,13 +3,13 @@ import { g as n, h as r, i, t as a } from "./button-BuSV-mLI.js";
3
3
  import { t as o } from "./react-CHbZqgBF.js";
4
4
  import { t as s } from "./compiler-runtime-DNezxW8I.js";
5
5
  import { i as c, t as l } from "./copy-icon-oHFcxX_y.js";
6
- import { At as u, Bt as d, Dt as f, Et as p, Ft as m, Ht as h, J as g, Lt as _, M as v, Ot as y, Pt as b, Rt as x, U as S, V as C, W as w, Y as T, a as E, dt as D, et as ee, f as O, g as k, h as A, ht as j, l as te, m as M, n as ne, nt as re, p as ie, r as ae, st as oe, t as se, tt as ce, u as le, v as ue, wt as de, xt as fe } from "./html-to-image-pPbR2cDx.js";
6
+ import { At as u, Bt as d, Dt as f, Et as p, Ft as m, Ht as h, J as g, Lt as _, M as v, Ot as y, Pt as b, Rt as x, U as S, V as C, W as w, Y as T, a as E, dt as D, et as ee, f as O, g as k, h as A, ht as j, l as te, m as M, n as ne, nt as re, p as ie, r as ae, st as oe, t as se, tt as ce, u as le, v as ue, wt as de, xt as fe } from "./html-to-image-DR8VPB7E.js";
7
7
  import { h as N, t as pe } from "./tooltip-BekOCQ3v.js";
8
8
  import { d as me } from "./select-XmXyen3r.js";
9
9
  import { Sn as he, _ as ge, bn as _e, f as ve, h as ye, i as be, n as xe, t as Se } from "./dropdown-menu-CAejOChE.js";
10
- import { o as Ce, u as we } from "./config-BVYA1P0C.js";
11
- import { Gt as Te, O as Ee, V as De, X as Oe, bt as ke, h as Ae, i as je, j as Me, r as Ne, rt as Pe, t as Fe } from "./error-entries-istW7Xbs.js";
12
- import { d as Ie, f as Le, i as Re, n as ze, t as Be, u as Ve } from "./process-output-BySO1nIs.js";
10
+ import { a as Ce, l as we } from "./config-CL7mwGLX.js";
11
+ import { $ as Te, Ct as Ee, P as De, W as Oe, Xt as ke, h as Ae, i as je, j as Me, ot as Ne, r as Pe, t as Fe } from "./error-entries-kb4H6PAT.js";
12
+ import { d as Ie, f as Le, i as Re, n as ze, t as Be, u as Ve } from "./process-output-BDMtqL6K.js";
13
13
  import { t as He } from "./pencil-BUfnNZAE.js";
14
14
  import { n as Ue, r as We, s as Ge } from "./assertNever-efcK_v3t.js";
15
15
  import { t as Ke } from "./jsx-runtime-6ZiU38At.js";
@@ -3811,7 +3811,7 @@ var Co = class extends A {
3811
3811
  let r = e.cellData[t];
3812
3812
  return {
3813
3813
  uri: this.asURI(t),
3814
- name: Pe(r.name, n),
3814
+ name: Ne(r.name, n),
3815
3815
  type: this.contextType,
3816
3816
  description: "Cell code",
3817
3817
  data: {
@@ -3943,7 +3943,7 @@ async function Eo(e, t, r) {
3943
3943
  let i = e.filter((e) => e.shouldDownloadImage && e.outputType === "media");
3944
3944
  if (i.length === 0) return [];
3945
3945
  let a = i.flatMap((e) => {
3946
- let i = document.getElementById(ke.create(t));
3946
+ let i = document.getElementById(Ee.create(t));
3947
3947
  return i ? {
3948
3948
  cellId: t,
3949
3949
  cellName: r,
@@ -3974,7 +3974,7 @@ function Do(e) {
3974
3974
  };
3975
3975
  }
3976
3976
  function Oo(e, t, n) {
3977
- let { includeConsoleOutput: r = !1 } = n || {}, i = t.cellRuntime[e], a = t.cellData[e], o = t.cellIds.indexOf(e), s = Pe(a.name, o), c;
3977
+ let { includeConsoleOutput: r = !1 } = n || {}, i = t.cellRuntime[e], a = t.cellData[e], o = t.cellIds.indexOf(e), s = Ne(a.name, o), c;
3978
3978
  r && (c = i.consoleOutputs.map((e) => Do(e)).filter((e) => e !== null));
3979
3979
  let l, u = i.output;
3980
3980
  return u && !E(u) && (l = Do(u) ?? void 0), {
@@ -3989,7 +3989,7 @@ function Oo(e, t, n) {
3989
3989
  //#region src/core/ai/context/providers/error.ts
3990
3990
  function ko(e, t) {
3991
3991
  let n = [`Code:\n${e.cellCode}`];
3992
- if (e.tracebackHtml && n.push(`Traceback:\n${Oe(e.tracebackHtml)}`), e.errorData.length > 0 && n.push(e.errorData.map((e) => Ne(e)).join("\n\n")), e.errorData.some((e) => e.type === "sql-error")) {
3992
+ if (e.tracebackHtml && n.push(`Traceback:\n${Te(e.tracebackHtml)}`), e.errorData.length > 0 && n.push(e.errorData.map((e) => Pe(e)).join("\n\n")), e.errorData.some((e) => e.type === "sql-error")) {
3993
3993
  let r = le(e.cellId, t);
3994
3994
  r && n.push(`Database schema:\n${r}`);
3995
3995
  }
@@ -4006,7 +4006,7 @@ function Ao(e, t) {
4006
4006
  });
4007
4007
  }
4008
4008
  function jo(e) {
4009
- return e.errorData.length === 1 ? Fe(e.errorData[0]) : e.errorData.length > 1 ? `${e.errorData.length} errors` : e.tracebackHtml ? Oe(e.tracebackHtml).trim().split("\n").find((e) => e.trim())?.trim() || "traceback" : "error";
4009
+ return e.errorData.length === 1 ? Fe(e.errorData[0]) : e.errorData.length > 1 ? `${e.errorData.length} errors` : e.tracebackHtml ? Te(e.tracebackHtml).trim().split("\n").find((e) => e.trim())?.trim() || "traceback" : "error";
4010
4010
  }
4011
4011
  function Mo(e) {
4012
4012
  return `Error: ${e.cellName || `Cell ${e.cellId}`}`;
@@ -4398,7 +4398,7 @@ function Bo(e) {
4398
4398
  return new k().register(new Ro(n)).register(new zo(r, n)).register(new Po(e)).register(new To(e)).register(new Co(e)).register(new te(t.connectionsMap, n));
4399
4399
  }
4400
4400
  function Vo() {
4401
- return new Lo(De());
4401
+ return new Lo(Oe());
4402
4402
  }
4403
4403
  //#endregion
4404
4404
  //#region src/components/editor/ai/completion-utils.ts
@@ -5001,7 +5001,7 @@ var ps = (e) => {
5001
5001
  subtitle: e.filename
5002
5002
  }, t);
5003
5003
  case "source-url": return /* @__PURE__ */ (0, J.jsx)(Ko, {
5004
- icon: /* @__PURE__ */ (0, J.jsx)(Te, { className: "h-3 w-3 shrink-0" }),
5004
+ icon: /* @__PURE__ */ (0, J.jsx)(ke, { className: "h-3 w-3 shrink-0" }),
5005
5005
  title: e.title ?? e.url,
5006
5006
  subtitle: e.title ? e.url : void 0,
5007
5007
  href: e.url
@@ -5593,7 +5593,7 @@ function sc(e) {
5593
5593
  }
5594
5594
  //#endregion
5595
5595
  //#region src/components/editor/ai/prompt-input.tsx
5596
- var cc = "marimo:ai-prompt-history", lc = new Me(Qe(dt()), () => []), uc = (e) => {
5596
+ var cc = "marimo:ai-prompt-history", lc = new De(Qe(dt()), () => []), uc = (e) => {
5597
5597
  let t = (0, P.c)(28), { value: n, placeholder: i, placeholderAction: a, inputRef: o, className: s, onChange: c, onSubmit: l, onKeyDown: u, onClose: d, onAddFiles: f, additionalCompletions: p, maxHeight: m } = e, h = bt(l), _ = bt(d), v = $e(), { theme: y } = ht(), b;
5598
5598
  t[0] === p ? b = t[1] : (b = (e) => p ? Ho([p.triggerCompletionRegex], p.completions)(e) : null, t[0] = p, t[1] = b);
5599
5599
  let x = bt(b), S;
@@ -5919,7 +5919,7 @@ var gc = (e) => {
5919
5919
  onSelect: (e) => {
5920
5920
  o(e), requestAnimationFrame(() => {
5921
5921
  let e = g.current?.view;
5922
- e?.focus(), Ee(e);
5922
+ e?.focus(), Me(e);
5923
5923
  });
5924
5924
  }
5925
5925
  }),
@@ -1,10 +1,10 @@
1
1
  import { g as e } from "./button-BuSV-mLI.js";
2
- import { Bt as t } from "./error-entries-istW7Xbs.js";
3
- import { n } from "./assertNever-efcK_v3t.js";
4
- import { Ft as r, Rt as i, d as a, m as o, wt as s } from "./use-restore-focus-DyrKLdSB.js";
5
- import { a as c, c as l, h as u, p as d, s as f, v as p } from "./toDate-5qPtZ6HL.js";
2
+ import { D as t, Jt as n, Ut as r } from "./error-entries-kb4H6PAT.js";
3
+ import { n as i } from "./assertNever-efcK_v3t.js";
4
+ import { Ft as a, Rt as o, d as s, m as c, wt as l } from "./use-restore-focus-DyrKLdSB.js";
5
+ import { c as u, m as d, n as f, o as p } from "./static-state-Dtocd9UO.js";
6
6
  //#region src/core/islands/state.ts
7
- var m = i(!1), h = i(/* @__PURE__ */ new Set()), g = i((e) => e(h)?.size === 0), _ = i(!1), v = i((e) => e(_) && e(m) === !1);
7
+ var m = o(!1), h = o(/* @__PURE__ */ new Set()), g = o((e) => e(h)?.size === 0), _ = o(!1), v = o((e) => e(_) && e(m) === !1);
8
8
  //#endregion
9
9
  //#region src/core/meta/state.ts
10
10
  function y() {
@@ -14,11 +14,11 @@ function y() {
14
14
  return e.warn("Failed to get version from mount config"), null;
15
15
  }
16
16
  }
17
- var b = y() || "0.25.3-dev312", x = i(b), S = i(!0);
18
- i(null);
17
+ var b = y() || "0.25.3-dev316", x = o(b), S = o(!0);
18
+ o(null);
19
19
  //#endregion
20
20
  //#region src/core/wasm/state.ts
21
- var C = i({
21
+ var C = o({
22
22
  kind: "loading",
23
23
  message: "Initializing..."
24
24
  }), w = {
@@ -30,7 +30,7 @@ var C = i({
30
30
  kind: "wasm",
31
31
  label: "Pyodide",
32
32
  capabilities: w,
33
- state: i((e) => {
33
+ state: o((e) => {
34
34
  let t = e(C);
35
35
  switch (t.kind) {
36
36
  case "loading": return {
@@ -56,23 +56,22 @@ var C = i({
56
56
  canRestart: !0,
57
57
  supportsLsp: !0
58
58
  },
59
- state: i((e) => {
60
- let t = e(l);
61
- switch (t.state) {
62
- case p.OPEN: return { kind: "ready" };
63
- case p.CONNECTING: return {
59
+ state: o((e) => {
60
+ let r = e(t);
61
+ switch (r.state) {
62
+ case n.OPEN: return { kind: "ready" };
63
+ case n.CONNECTING: return {
64
64
  kind: "connecting",
65
65
  progress: { label: "Connecting…" }
66
66
  };
67
- case p.NOT_STARTED: return {
67
+ case n.NOT_STARTED: return {
68
68
  kind: "connecting",
69
69
  progress: { label: "Not connected" }
70
70
  };
71
- case p.CLOSING:
72
- case p.CLOSED: return {
71
+ case n.CLOSED: return {
73
72
  kind: "failed",
74
73
  error: {
75
- message: t.state === p.CLOSED ? t.reason : "Disconnecting",
74
+ message: r.reason,
76
75
  errorKind: "runtime"
77
76
  }
78
77
  };
@@ -82,12 +81,12 @@ var C = i({
82
81
  kind: "static",
83
82
  label: "Static",
84
83
  capabilities: w,
85
- state: i({ kind: "ready" })
84
+ state: o({ kind: "ready" })
86
85
  }, O = {
87
86
  kind: "islands",
88
87
  label: "Islands",
89
88
  capabilities: w,
90
- state: i((e) => {
89
+ state: o((e) => {
91
90
  let t = e(m);
92
91
  return t === !0 ? { kind: "ready" } : typeof t == "string" ? {
93
92
  kind: "failed",
@@ -102,29 +101,29 @@ var C = i({
102
101
  })
103
102
  };
104
103
  function k() {
105
- return f() ? D : a() ? O : c() ? T : E;
104
+ return f() ? D : s() ? O : d() ? T : E;
106
105
  }
107
- var A = i(k());
108
- i((e) => {
109
- let n = e(A);
110
- return e(n.state).kind !== "ready" || n.kind === "static" ? !1 : n.kind !== "remote" || e(t) === "running";
106
+ var A = o(k());
107
+ o((e) => {
108
+ let t = e(A);
109
+ return e(t.state).kind !== "ready" || t.kind === "static" ? !1 : t.kind !== "remote" || e(r) === "running";
111
110
  });
112
111
  //#endregion
113
112
  //#region src/core/meta/code-visibility.ts
114
- var j = i((e) => {
115
- let t = e(s);
113
+ var j = o((e) => {
114
+ let t = e(l);
116
115
  return t !== null && [...t.cells.values()].some((e) => e.code !== null);
117
116
  });
118
117
  function M() {
119
- let e = r(j), t = r(d), { mode: i } = r(u), a = r(S), s = r(A).kind;
120
- if (t && s === "remote") return !0;
121
- switch (i) {
118
+ let e = a(j), t = a(p), { mode: n } = a(u), r = a(S), o = a(A).kind;
119
+ if (t && o === "remote") return !0;
120
+ switch (n) {
122
121
  case "edit":
123
122
  case "present": return !0;
124
123
  case "home":
125
124
  case "gallery": return !1;
126
- case "read": return !a || new URLSearchParams(window.location.search).get(o.includeCode) === "false" ? !1 : e;
127
- default: return n(i), !1;
125
+ case "read": return !r || new URLSearchParams(window.location.search).get(c.includeCode) === "false" ? !1 : e;
126
+ default: return i(n), !1;
128
127
  }
129
128
  }
130
129
  //#endregion