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

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-BzPZHD9j.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-nvHsJTCm.js} +31 -32
  4. package/dist/{common-Cc-bvilP.js → common-DmnownXk.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-eXoZLGys.js} +1 -1
  7. package/dist/{error-entries-istW7Xbs.js → error-entries-kb4H6PAT.js} +533 -508
  8. package/dist/feedback-button-DDdckIvG.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-keVyefZP.js} +3 -3
  11. package/dist/{globals-Blgj9EWO.js → globals-UY7m7ERN.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-Dryq4VDA.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-BIBrITpY.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
@@ -1,371 +0,0 @@
1
- import { a as e } from "./rolldown-runtime-BPCzCO3I.js";
2
- import { h as t, t as n } from "./button-BuSV-mLI.js";
3
- import { t as r } from "./react-CHbZqgBF.js";
4
- import { t as i } from "./compiler-runtime-DNezxW8I.js";
5
- import { t as a } from "./copy-icon-oHFcxX_y.js";
6
- import { A as o, E as s, Gt as c, H as l, M as u, i as d, n as f } from "./error-entries-istW7Xbs.js";
7
- import { n as p, t as m } from "./globals-Blgj9EWO.js";
8
- import { r as h } from "./assertNever-efcK_v3t.js";
9
- import { t as g } from "./jsx-runtime-6ZiU38At.js";
10
- import { Ft as ee, p as _, yt as te } from "./use-restore-focus-DyrKLdSB.js";
11
- import { c as ne, v } from "./toDate-5qPtZ6HL.js";
12
- import { a as re, i as ie, n as ae, r as oe } from "./dialog-BIUdMLIS.js";
13
- import { t as se } from "./useAsyncData-DMBliR6D.js";
14
- import { t as ce } from "./code-visibility-DLBADpvq.js";
15
- //#region src/components/ui/skeleton.tsx
16
- var y = /* @__PURE__ */ e(r(), 1), b = i(), x = g(), le = (e) => {
17
- let n = (0, b.c)(8), r, i;
18
- n[0] === e ? (r = n[1], i = n[2]) : ({className: r, ...i} = e, n[0] = e, n[1] = r, n[2] = i);
19
- let a;
20
- n[3] === r ? a = n[4] : (a = t("animate-pulse rounded-md bg-muted", r), n[3] = r, n[4] = a);
21
- let o;
22
- return n[5] !== i || n[6] !== a ? (o = /* @__PURE__ */ (0, x.jsx)("div", {
23
- className: a,
24
- ...i
25
- }), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
26
- };
27
- //#endregion
28
- //#region src/core/diagnostics/issue-details.ts
29
- function ue(e, t) {
30
- return {
31
- ...e,
32
- Binaries: {
33
- ...e.Binaries,
34
- Browser: t
35
- }
36
- };
37
- }
38
- function de(e, t, n, r) {
39
- return {
40
- marimo: e,
41
- Locale: n || void 0,
42
- Binaries: { Browser: t },
43
- "Environment Collection Error": r
44
- };
45
- }
46
- function S(e, t) {
47
- let n = Math.max(2, ...Array.from(t.matchAll(/`+/g), (e) => e[0].length)), r = "`".repeat(n + 1);
48
- return `${r}${e}\n${t}\n${r}`;
49
- }
50
- function fe(e, t) {
51
- let n = e.includes("?") ? "&" : "?", r = [], i = e, a = 0;
52
- for (let [e, o] of Object.entries(t)) {
53
- if (o.length === 0) continue;
54
- let t = `${e}=${encodeURIComponent(o)}`, s = `${i}${a === 0 ? n : "&"}${t}`;
55
- s.length > 6e3 ? r.push(e) : (i = s, a += 1);
56
- }
57
- return {
58
- url: i,
59
- omitted: r
60
- };
61
- }
62
- function C(e, t) {
63
- return [
64
- "<details>",
65
- `<summary>${h.htmlEscape(e) ?? ""}</summary>`,
66
- "",
67
- t,
68
- "",
69
- "</details>"
70
- ].join("\n");
71
- }
72
- function pe(e) {
73
- return C("Environment", S("json", JSON.stringify(e, null, 2)));
74
- }
75
- function me(e) {
76
- return C("Errors", S("text", e.map(f).join("\n\n---\n\n")));
77
- }
78
- function he(e) {
79
- return C("Code", S("python", e));
80
- }
81
- //#endregion
82
- //#region src/hooks/useLocalStorage.ts
83
- function ge(e, t) {
84
- let n = (0, b.c)(11), r;
85
- n[0] === t ? r = n[1] : (r = new o(t), n[0] = t, n[1] = r);
86
- let i = r, a;
87
- n[2] !== e || n[3] !== i ? (a = () => i.get(e), n[2] = e, n[3] = i, n[4] = a) : a = n[4];
88
- let [s, c] = (0, y.useState)(a), l;
89
- n[5] !== e || n[6] !== i ? (l = (t) => {
90
- c(t), i.set(e, t);
91
- }, n[5] = e, n[6] = i, n[7] = l) : l = n[7];
92
- let u = l, d;
93
- return n[8] !== u || n[9] !== s ? (d = [s, u], n[8] = u, n[9] = s, n[10] = d) : d = n[10], d;
94
- }
95
- var _e = (e) => {
96
- let r = (0, b.c)(16), { content: i } = e, [a, o] = (0, y.useState)(!1), s = !a && "max-h-24 overflow-hidden", c;
97
- r[0] === s ? c = r[1] : (c = t("text-xs bg-muted rounded p-2 overflow-x-auto whitespace-pre-wrap", s), r[0] = s, r[1] = c);
98
- let l;
99
- r[2] !== i || r[3] !== c ? (l = /* @__PURE__ */ (0, x.jsx)("pre", {
100
- className: c,
101
- children: i
102
- }), r[2] = i, r[3] = c, r[4] = l) : l = r[4];
103
- let u;
104
- r[5] === a ? u = r[6] : (u = !a && /* @__PURE__ */ (0, x.jsx)("div", { className: "pointer-events-none absolute inset-x-0 bottom-0 h-10 rounded-b bg-gradient-to-b from-transparent to-muted" }), r[5] = a, r[6] = u);
105
- let d;
106
- r[7] !== l || r[8] !== u ? (d = /* @__PURE__ */ (0, x.jsxs)("div", {
107
- className: "relative",
108
- children: [l, u]
109
- }), r[7] = l, r[8] = u, r[9] = d) : d = r[9];
110
- let f;
111
- r[10] === Symbol.for("react.memo_cache_sentinel") ? (f = () => o(T), r[10] = f) : f = r[10];
112
- let p = a ? "Show less" : "Show more", m;
113
- r[11] === p ? m = r[12] : (m = /* @__PURE__ */ (0, x.jsx)(n, {
114
- type: "button",
115
- variant: "link",
116
- size: "xs",
117
- className: "self-start",
118
- onClick: f,
119
- children: p
120
- }), r[11] = p, r[12] = m);
121
- let h;
122
- return r[13] !== d || r[14] !== m ? (h = /* @__PURE__ */ (0, x.jsxs)("div", {
123
- className: "flex flex-col gap-1",
124
- children: [d, m]
125
- }), r[13] = d, r[14] = m, r[15] = h) : h = r[15], h;
126
- };
127
- function ve(e) {
128
- if (!e.hasRequestClient) return "Notebook source is unavailable.";
129
- if (e.filename === null) return "Save the notebook first.";
130
- if (!e.codeAvailable) return "Notebook source is hidden in this view.";
131
- if (e.connectionState !== v.OPEN) return "Connect the notebook to include its source.";
132
- }
133
- var w = () => {
134
- let e = (0, b.c)(56), t = ee(l), r, i;
135
- e[0] === t ? (r = e[1], i = e[2]) : (r = async () => {
136
- if (t != null) return t.getEnvironmentInfo();
137
- }, i = [t], e[0] = t, e[1] = r, e[2] = i);
138
- let o = se(r, i), h = d(te), g = ce(), v = ee(u), y = ee(ne), S = t != null, C;
139
- e[3] !== g || e[4] !== y.state || e[5] !== v || e[6] !== S ? (C = ve({
140
- hasRequestClient: S,
141
- filename: v,
142
- codeAvailable: g,
143
- connectionState: y.state
144
- }), e[3] = g, e[4] = y.state, e[5] = v, e[6] = S, e[7] = C) : C = e[7];
145
- let w = C, T = w === void 0, [E, D] = ge("marimo:issue-report:include-errors", !1), [O, be] = ge("marimo:issue-report:include-code", !1), k = o.data ? ue(o.data, navigator.userAgent) : o.status === "error" || t == null ? de(m(), navigator.userAgent, navigator.language, "Server environment information unavailable") : void 0, A, j;
146
- e[8] !== O || e[9] !== T || e[10] !== t ? (A = async () => {
147
- if (!O || !T || t == null) return;
148
- let { contents: e } = await t.readCode();
149
- return e;
150
- }, j = [
151
- O,
152
- T,
153
- t
154
- ], e[8] = O, e[9] = T, e[10] = t, e[11] = A, e[12] = j) : (A = e[11], j = e[12]);
155
- let M = se(A, j), xe = _.bugReportUrl, Se = [];
156
- if (k) {
157
- let e = { env: pe(k) };
158
- E && h.length > 0 && (e["bug-description"] = me(h)), O && M.data && (e["reproduction-code"] = he(M.data)), {url: xe, omitted: Se} = fe(_.bugReportUrl, e);
159
- }
160
- let Ce = Se.map(ye).join(", "), N;
161
- e[13] === Symbol.for("react.memo_cache_sentinel") ? (N = /* @__PURE__ */ (0, x.jsxs)(ie, { children: [/* @__PURE__ */ (0, x.jsx)(re, { children: "Report an issue" }), /* @__PURE__ */ (0, x.jsx)(oe, { children: "Open a GitHub bug report prefilled with your environment, and optionally your current errors and notebook code. Nothing is uploaded automatically; review the details before posting." })] }), e[13] = N) : N = e[13];
162
- let P;
163
- e[14] === Symbol.for("react.memo_cache_sentinel") ? (P = /* @__PURE__ */ (0, x.jsx)(c, { className: "w-4 h-4 mr-2" }), e[14] = P) : P = e[14];
164
- let F = h.length === 0, I;
165
- e[15] === D ? I = e[16] : (I = (e) => D(e === !0), e[15] = D, e[16] = I);
166
- let L;
167
- e[17] !== E || e[18] !== F || e[19] !== I ? (L = /* @__PURE__ */ (0, x.jsx)(s, {
168
- id: "issue-include-errors",
169
- checked: E,
170
- disabled: F,
171
- onCheckedChange: I,
172
- "aria-label": "Include errors"
173
- }), e[17] = E, e[18] = F, e[19] = I, e[20] = L) : L = e[20];
174
- let R;
175
- e[21] === Symbol.for("react.memo_cache_sentinel") ? (R = /* @__PURE__ */ (0, x.jsx)("label", {
176
- htmlFor: "issue-include-errors",
177
- children: "Include errors"
178
- }), e[21] = R) : R = e[21];
179
- let z;
180
- e[22] === L ? z = e[23] : (z = /* @__PURE__ */ (0, x.jsxs)("div", {
181
- className: "flex items-center gap-2 text-sm",
182
- children: [L, R]
183
- }), e[22] = L, e[23] = z);
184
- let B = !T, V;
185
- e[24] === be ? V = e[25] : (V = (e) => be(e === !0), e[24] = be, e[25] = V);
186
- let H;
187
- e[26] !== O || e[27] !== B || e[28] !== V ? (H = /* @__PURE__ */ (0, x.jsx)(s, {
188
- id: "issue-include-code",
189
- checked: O,
190
- disabled: B,
191
- onCheckedChange: V,
192
- "aria-label": "Include notebook code"
193
- }), e[26] = O, e[27] = B, e[28] = V, e[29] = H) : H = e[29];
194
- let U;
195
- e[30] === Symbol.for("react.memo_cache_sentinel") ? (U = /* @__PURE__ */ (0, x.jsx)("label", {
196
- htmlFor: "issue-include-code",
197
- children: "Include notebook code"
198
- }), e[30] = U) : U = e[30];
199
- let W;
200
- e[31] === H ? W = e[32] : (W = /* @__PURE__ */ (0, x.jsxs)("div", {
201
- className: "flex items-center gap-2 text-sm",
202
- children: [H, U]
203
- }), e[31] = H, e[32] = W);
204
- let G;
205
- e[33] === w ? G = e[34] : (G = w && /* @__PURE__ */ (0, x.jsx)("span", {
206
- className: "text-xs text-muted-foreground ml-6",
207
- children: w
208
- }), e[33] = w, e[34] = G);
209
- let K;
210
- e[35] !== M || e[36] !== O ? (K = O && M.status === "error" && /* @__PURE__ */ (0, x.jsx)("span", {
211
- className: "text-xs text-(--red-11) ml-6",
212
- children: "Notebook source could not be loaded."
213
- }), e[35] = M, e[36] = O, e[37] = K) : K = e[37];
214
- let q;
215
- e[38] !== W || e[39] !== G || e[40] !== K ? (q = /* @__PURE__ */ (0, x.jsxs)("div", {
216
- className: "flex flex-col gap-1",
217
- children: [
218
- W,
219
- G,
220
- K
221
- ]
222
- }), e[38] = W, e[39] = G, e[40] = K, e[41] = q) : q = e[41];
223
- let J;
224
- e[42] !== z || e[43] !== q ? (J = /* @__PURE__ */ (0, x.jsxs)("div", {
225
- className: "flex flex-col gap-2",
226
- children: [z, q]
227
- }), e[42] = z, e[43] = q, e[44] = J) : J = e[44];
228
- let Y;
229
- e[45] !== o.status || e[46] !== t ? (Y = o.status === "pending" && t != null && /* @__PURE__ */ (0, x.jsxs)("div", {
230
- className: "flex flex-col gap-2",
231
- children: [
232
- /* @__PURE__ */ (0, x.jsx)("span", {
233
- className: "text-sm text-muted-foreground",
234
- children: "Loading environment details…"
235
- }),
236
- /* @__PURE__ */ (0, x.jsx)(le, { className: "h-4 w-full" }),
237
- /* @__PURE__ */ (0, x.jsx)(le, { className: "h-4 w-3/4" }),
238
- /* @__PURE__ */ (0, x.jsx)(le, { className: "h-4 w-1/2" })
239
- ]
240
- }), e[45] = o.status, e[46] = t, e[47] = Y) : Y = e[47];
241
- let X;
242
- e[48] !== o || e[49] !== t ? (X = (o.status === "error" || t == null) && /* @__PURE__ */ (0, x.jsxs)("div", {
243
- className: "flex items-center gap-2 text-sm",
244
- children: [
245
- /* @__PURE__ */ (0, x.jsx)(p, { className: "w-4 h-4 text-(--yellow-11) shrink-0" }),
246
- /* @__PURE__ */ (0, x.jsx)("span", { children: "Server environment information unavailable" }),
247
- t != null && /* @__PURE__ */ (0, x.jsx)(n, {
248
- type: "button",
249
- variant: "link",
250
- size: "xs",
251
- onClick: () => o.refetch(),
252
- children: "Retry"
253
- })
254
- ]
255
- }), e[48] = o, e[49] = t, e[50] = X) : X = e[50];
256
- let Z;
257
- e[51] !== k || e[52] !== h ? (Z = k && h.length === 0 && /* @__PURE__ */ (0, x.jsx)("span", {
258
- className: "text-sm text-muted-foreground",
259
- children: "No errors detected."
260
- }), e[51] = k, e[52] = h, e[53] = Z) : Z = e[53];
261
- let Q;
262
- e[54] === Symbol.for("react.memo_cache_sentinel") ? (Q = /* @__PURE__ */ (0, x.jsx)("a", {
263
- href: _.feedbackForm,
264
- target: "_blank",
265
- rel: "noreferrer",
266
- className: "underline",
267
- children: "two-minute survey"
268
- }), e[54] = Q) : Q = e[54];
269
- let $;
270
- return e[55] === Symbol.for("react.memo_cache_sentinel") ? ($ = /* @__PURE__ */ (0, x.jsx)("div", {
271
- className: "border-t pt-3",
272
- children: /* @__PURE__ */ (0, x.jsxs)("p", {
273
- className: "text-sm text-muted-foreground",
274
- children: [
275
- "Other feedback? Take our",
276
- " ",
277
- Q,
278
- " ",
279
- "or chat with us on",
280
- " ",
281
- /* @__PURE__ */ (0, x.jsx)("a", {
282
- href: _.discordLink,
283
- target: "_blank",
284
- rel: "noreferrer",
285
- className: "underline",
286
- children: "Discord"
287
- }),
288
- "."
289
- ]
290
- })
291
- }), e[55] = $) : $ = e[55], /* @__PURE__ */ (0, x.jsxs)(ae, {
292
- className: "w-[540px] max-w-[90vw]",
293
- children: [N, /* @__PURE__ */ (0, x.jsxs)("div", {
294
- className: "flex flex-col gap-4 max-h-[60vh] overflow-y-auto",
295
- children: [
296
- /* @__PURE__ */ (0, x.jsxs)("div", {
297
- className: "flex flex-col gap-3",
298
- children: [
299
- /* @__PURE__ */ (0, x.jsx)(n, {
300
- type: "button",
301
- variant: "default",
302
- size: "xs",
303
- asChild: !0,
304
- className: "self-start",
305
- children: /* @__PURE__ */ (0, x.jsxs)("a", {
306
- href: xe,
307
- target: "_blank",
308
- rel: "noreferrer",
309
- children: [P, "Open GitHub issue"]
310
- })
311
- }),
312
- J,
313
- Ce ? /* @__PURE__ */ (0, x.jsxs)("div", {
314
- className: "flex items-start gap-2 text-xs text-(--yellow-11)",
315
- children: [/* @__PURE__ */ (0, x.jsx)(p, { className: "w-3.5 h-3.5 shrink-0 mt-0.5" }), /* @__PURE__ */ (0, x.jsxs)("span", { children: [
316
- "Too large to prefill and left out of the link: ",
317
- Ce,
318
- ". Paste them into the issue manually."
319
- ] })]
320
- }) : /* @__PURE__ */ (0, x.jsx)("p", {
321
- className: "text-xs text-muted-foreground",
322
- children: "Your environment is always included."
323
- })
324
- ]
325
- }),
326
- Y,
327
- X,
328
- k && /* @__PURE__ */ (0, x.jsxs)("div", {
329
- className: "flex flex-col gap-1",
330
- children: [/* @__PURE__ */ (0, x.jsxs)("div", {
331
- className: "flex items-center justify-between",
332
- children: [/* @__PURE__ */ (0, x.jsx)("span", {
333
- className: "text-sm font-medium",
334
- children: "Environment details"
335
- }), /* @__PURE__ */ (0, x.jsx)(a, {
336
- className: "w-3.5 h-3.5",
337
- value: JSON.stringify(k, null, 2),
338
- ariaLabel: "Copy environment JSON",
339
- toastTitle: "Environment details copied"
340
- })]
341
- }), /* @__PURE__ */ (0, x.jsx)(_e, { content: JSON.stringify(k, null, 2) })]
342
- }),
343
- k && h.length > 0 && /* @__PURE__ */ (0, x.jsxs)("div", {
344
- className: "flex flex-col gap-1",
345
- children: [/* @__PURE__ */ (0, x.jsxs)("div", {
346
- className: "flex items-center justify-between",
347
- children: [/* @__PURE__ */ (0, x.jsx)("span", {
348
- className: "text-sm font-medium",
349
- children: "Errors"
350
- }), /* @__PURE__ */ (0, x.jsx)(a, {
351
- className: "w-3.5 h-3.5",
352
- value: me(h),
353
- ariaLabel: "Copy errors",
354
- toastTitle: "Errors copied"
355
- })]
356
- }), /* @__PURE__ */ (0, x.jsx)(_e, { content: h.map(f).join("\n\n---\n\n") })]
357
- }),
358
- Z,
359
- $
360
- ]
361
- })]
362
- });
363
- };
364
- function T(e) {
365
- return !e;
366
- }
367
- function ye(e) {
368
- return e === "bug-description" ? "errors" : e === "reproduction-code" ? "code" : e;
369
- }
370
- //#endregion
371
- export { w as FeedbackModal };
@@ -1,94 +0,0 @@
1
- import { t as e } from "./compiler-runtime-DNezxW8I.js";
2
- import { Dt as t, Ft as n, Rt as r, d as i, m as a, xt as o, yt as s } from "./use-restore-focus-DyrKLdSB.js";
3
- import { t as c } from "./invariant-DLmrl-hA.js";
4
- //#region src/core/notebook/replica/connection.ts
5
- var l = {
6
- NOT_STARTED: "NOT_STARTED",
7
- CONNECTING: "CONNECTING",
8
- OPEN: "OPEN",
9
- CLOSING: "CLOSING",
10
- CLOSED: "CLOSED"
11
- }, u = {
12
- KERNEL_DISCONNECTED: "KERNEL_DISCONNECTED",
13
- KERNEL_STARTUP_ERROR: "KERNEL_STARTUP_ERROR"
14
- }, d = e();
15
- function f(e, t) {
16
- if (e == null) throw Error(t || `Expected value but got ${e}`);
17
- }
18
- //#endregion
19
- //#region src/core/mode.ts
20
- function p() {
21
- let e = s.get(h);
22
- return f(e, "internal-error: initial mode not found"), c(e !== "present", "internal-error: initial mode cannot be 'present'"), e;
23
- }
24
- var m = r({
25
- mode: i() ? "read" : "not-set",
26
- cellAnchor: null
27
- }), h = r(void 0);
28
- function g() {
29
- let e = s.get(h);
30
- return e !== "home" && e !== "gallery";
31
- }
32
- var _ = r(!1);
33
- function v() {
34
- let e = (0, d.c)(1), { mode: t } = n(m), r = n(_), i;
35
- return e[0] === Symbol.for("react.memo_cache_sentinel") ? (i = new URLSearchParams(window.location.search).get(a.kiosk), e[0] = i) : i = e[0], t !== "read" && !r && i !== "true";
36
- }
37
- //#endregion
38
- //#region src/core/network/connection.ts
39
- var y = r({ state: l.NOT_STARTED });
40
- t(null, (e, t) => t === null ? null : {
41
- phase: t.phase,
42
- logs: t.log_mode === "append" && e?.phase === t.phase ? e.logs + t.logs : t.logs
43
- });
44
- function b() {
45
- return o(y, (e) => e.state === l.OPEN);
46
- }
47
- function x() {
48
- return g() ? b() : Promise.resolve();
49
- }
50
- r((e) => e(y).state === l.CONNECTING), r((e) => e(y).state === l.OPEN), r((e) => {
51
- let t = e(y);
52
- return t.state === l.OPEN || t.state === l.NOT_STARTED;
53
- }), r((e) => e(y).state === l.CLOSED), r((e) => e(y).state === l.NOT_STARTED);
54
- //#endregion
55
- //#region src/core/static/static-state.ts
56
- function S(e) {
57
- if (typeof e != "object" || !e || Array.isArray(e)) return !1;
58
- for (let t of Object.values(e)) if (typeof t != "string") return !1;
59
- return !0;
60
- }
61
- function C(e) {
62
- if (typeof e != "object" || !e || Array.isArray(e)) return !1;
63
- let t = e;
64
- return !(!S(t.files) || t.modelNotifications !== void 0 && !Array.isArray(t.modelNotifications));
65
- }
66
- function w() {
67
- let e = typeof window > "u" ? void 0 : window.__MARIMO_STATIC__;
68
- return C(e) ? e : void 0;
69
- }
70
- function T() {
71
- return w() !== void 0;
72
- }
73
- function E() {
74
- let e = w();
75
- return c(e !== void 0, "Not a static notebook"), e.files;
76
- }
77
- //#endregion
78
- //#region src/core/wasm/utils.ts
79
- function D() {
80
- return typeof document < "u" && document.querySelector("marimo-wasm") !== null;
81
- }
82
- var O = 6048e5, k = 864e5, A = Symbol.for("constructDateFrom");
83
- //#endregion
84
- //#region ../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/constructFrom.js
85
- function j(e, t) {
86
- return typeof e == "function" ? e(t) : e && typeof e == "object" && A in e ? e[A](t) : e instanceof Date ? new e.constructor(t) : new Date(t);
87
- }
88
- //#endregion
89
- //#region ../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/toDate.js
90
- function M(e, t) {
91
- return j(t || e, e);
92
- }
93
- //#endregion
94
- export { u as _, D as a, y as c, p as d, h as f, f as g, m as h, O as i, b as l, v as m, j as n, E as o, _ as p, k as r, T as s, M as t, x as u, l as v };
@@ -1,27 +0,0 @@
1
- /* Copyright 2026 Marimo. All rights reserved. */
2
-
3
- import { useAtomValue } from "jotai";
4
- import { Button } from "@/components/ui/button";
5
- import { isNotStartedAtom } from "@/core/network/connection";
6
- import { useConnectToRuntime } from "@/core/runtime/config";
7
- import { FloatingAlert } from "./floating-alert";
8
-
9
- export const NotStartedConnectionAlert: React.FC = () => {
10
- const isNotStarted = useAtomValue(isNotStartedAtom);
11
- const connectToRuntime = useConnectToRuntime();
12
-
13
- if (isNotStarted) {
14
- return (
15
- <FloatingAlert show={isNotStarted} kind="info">
16
- <div className="flex items-center gap-2">
17
- <p>Not connected to a runtime.</p>
18
- <Button variant="link" onClick={connectToRuntime}>
19
- Click to connect
20
- </Button>
21
- </div>
22
- </FloatingAlert>
23
- );
24
- }
25
-
26
- return null;
27
- };