@marimo-team/islands 0.24.3-dev83 → 0.24.3-dev87

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.
@@ -135,7 +135,7 @@ function F(e) {
135
135
  }
136
136
  //#endregion
137
137
  //#region src/components/editor/boundary/ErrorBoundary.tsx
138
- var I = (0, T.lazy)(() => import("./feedback-button-AZcBqfoV.js").then((e) => ({ default: e.FeedbackModal }))), L = (e) => {
138
+ var I = (0, T.lazy)(() => import("./feedback-button-B7KS_3RP.js").then((e) => ({ default: e.FeedbackModal }))), L = (e) => {
139
139
  let t = (0, w.c)(2), n;
140
140
  return t[0] === e.children ? n = t[1] : (n = /* @__PURE__ */ (0, j.jsx)(O, {
141
141
  FallbackComponent: R,
@@ -18,7 +18,7 @@ function x() {
18
18
  return e.warn("Failed to get version from mount config"), null;
19
19
  }
20
20
  }
21
- var S = x() || "0.24.3-dev83", C = u(S), w = u(!0);
21
+ var S = x() || "0.24.3-dev87", C = u(S), w = u(!0);
22
22
  u(null);
23
23
  //#endregion
24
24
  //#region src/core/wasm/state.ts
@@ -12,7 +12,7 @@ import { t as dt } from "./check-B7cIK6gb.js";
12
12
  import { A as ft, C as pt, D as mt, M as ht, O as gt, S as _t, _ as vt, b as yt, c as bt, d as xt, g as St, h as Ct, i as wt, m as Tt, n as Et, p as Dt, s as Ot, t as kt, u as At, v as jt, y as Mt } from "./select-C6plhmZr.js";
13
13
  import { $ as Nt, $t as Pt, A as Ft, At as It, B as Lt, Bt as Rt, Ct as zt, D as Bt, Dt as Vt, E as Ht, Et as Ut, F as Wt, Ft as Gt, G as Kt, Gt as qt, H as Jt, Ht as Yt, I as Xt, It as Zt, Jt as Qt, K as $t, Kt as en, L as tn, Lt as nn, M as rn, Mt as an, N as on, Nt as sn, O as cn, Ot as ln, P as un, Pt as dn, Q as fn, Qt as pn, R as mn, Rt as hn, S as gn, St as _n, T as vn, Tt as yn, U as bn, Ut as xn, V as Sn, Vt as Cn, W as wn, Wt as Tn, X as En, Xt as Dn, Y as On, Yt as kn, Z as An, Zt as jn, _ as Mn, _t as Nn, a as Pn, an as Fn, b as In, bt as Ln, cn as Rn, ct as zn, d as Bn, dn as Vn, dt as Hn, en as Un, et as Wn, f as Gn, fn as Kn, ft as qn, gt as Jn, h as Yn, ht as Xn, i as Zn, it as Qn, j as $n, jt as er, k as tr, kt as nr, l as rr, ln as ir, lt as ar, mt as or, n as sr, nn as cr, nt as lr, o as ur, on as dr, ot as fr, pn as pr, pt as mr, qt as hr, rn as gr, rt as _r, s as vr, sn as yr, st as br, t as xr, tn as Sr, tt as Cr, u as wr, un as Tr, ut as Er, vt as Dr, w as Or, wt as kr, x as Ar, xt as jr, y as Mr, yt as Nr, z as Pr, zt as Fr } from "./dropdown-menu-CZgjYSAh.js";
14
14
  import { _ as Ir, a as Lr, c as Rr, d as zr, i as Br, n as Vr, o as Hr, p as Ur, r as Wr, s as Gr, t as Kr } from "./toDate-WXg1yLcI.js";
15
- import { n as qr, t as Jr } from "./ErrorBoundary-Uf_LvjvY.js";
15
+ import { n as qr, t as Jr } from "./ErrorBoundary-Bc52FkKN.js";
16
16
  import { t as Yr } from "./clsx-CoeGtWvn.js";
17
17
  import { t as Xr } from "./react-dom-BUgJ-ab_.js";
18
18
  import { t as Zr } from "./jsx-runtime-DgDPJV9S.js";
@@ -2,7 +2,7 @@ import { a as e } from "./rolldown-runtime-Cb76FRpK.js";
2
2
  import { t } from "./react-ofJbxM4x.js";
3
3
  import { t as n } from "./react-dom-BUgJ-ab_.js";
4
4
  import { c as r, l as i, u as a } from "./data-grid-types-BucVmDDp.js";
5
- import { a as o, i as s, n as c, r as l } from "./glide-data-editor-BJdZncJk.js";
5
+ import { a as o, i as s, n as c, r as l } from "./glide-data-editor-DtckYC_c.js";
6
6
  //#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.17.21_marked@15.0.12_react-dom@19.2.8_b9e6aec46d952f631ce71b0585d2a8e5/node_modules/@glideapps/glide-data-grid/dist/esm/internal/data-grid-overlay-editor/data-grid-overlay-editor-style.js
7
7
  var u = /* @__PURE__ */ e(t(), 1), d = /* @__PURE__ */ e(n(), 1), f = /*#__PURE__*/ o("div")({
8
8
  name: "DataGridOverlayEditorStyle",
@@ -5,12 +5,12 @@ import { t as i } from "./compiler-runtime-Cj8ZWiNS.js";
5
5
  import { t as a } from "./copy-icon-CLdENY__.js";
6
6
  import { Bt as o, H as s, Ht as c, L as l, Ot as u, V as d, d as f, hn as p } from "./cells-DYIkSxs6.js";
7
7
  import { b as m } from "./select-C6plhmZr.js";
8
- import { n as h, t as ee } from "./globals-yWarpyN4.js";
8
+ import { n as h, t as ee } from "./globals-CruHzAUQ.js";
9
9
  import { t as g } from "./jsx-runtime-DgDPJV9S.js";
10
10
  import { C as _, _ as te, i as v } from "./useTheme-DzXmYZ5V.js";
11
11
  import { a as ne, i as re, n as ie, r as ae } from "./dialog-CgNq6y9-.js";
12
12
  import { t as oe } from "./useAsyncData-BD6AStMt.js";
13
- import { t as se } from "./code-visibility-DxgQWu1j.js";
13
+ import { t as se } from "./code-visibility-CI3ySb6F.js";
14
14
  import { i as ce, n as le } from "./error-entries-C0NsUqXl.js";
15
15
  //#region src/components/ui/skeleton.tsx
16
16
  var y = /* @__PURE__ */ e(r(), 1), b = i(), x = g(), ue = (e) => {
@@ -6,7 +6,7 @@ import { i as s, n as c, r as l } from "./copy-icon-CLdENY__.js";
6
6
  import { C as u, c as d, i as f, n as p, s as m, t as h, x as g } from "./select-C6plhmZr.js";
7
7
  import { d as _, h as v, i as y, l as b, n as x, o as S, s as C, t as w, u as T } from "./dropdown-menu-CZgjYSAh.js";
8
8
  import { c as E, d as D, l as O, n as k, o as A, s as ee, t as j, u as te } from "./glide-utils-B3rUT5PI.js";
9
- import { n as ne, t as re } from "./ErrorBoundary-Uf_LvjvY.js";
9
+ import { n as ne, t as re } from "./ErrorBoundary-Bc52FkKN.js";
10
10
  import { t as M } from "./react-dom-BUgJ-ab_.js";
11
11
  import { t as N } from "./jsx-runtime-DgDPJV9S.js";
12
12
  import { t as ie } from "./label-BJ49YTvk.js";
@@ -7062,7 +7062,7 @@ function rs(e, t, n, r, i) {
7062
7062
  }
7063
7063
  //#endregion
7064
7064
  //#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.17.21_marked@15.0.12_react-dom@19.2.8_b9e6aec46d952f631ce71b0585d2a8e5/node_modules/@glideapps/glide-data-grid/dist/esm/data-editor/data-editor.js
7065
- var is = /* @__PURE__ */ e(_r(), 1), as = /* @__PURE__ */ e(xr(), 1), os = K.lazy(async () => await import("./data-grid-overlay-editor-DL_blFyL.js")), ss = 0;
7065
+ var is = /* @__PURE__ */ e(_r(), 1), as = /* @__PURE__ */ e(xr(), 1), os = K.lazy(async () => await import("./data-grid-overlay-editor-BsT4_auq.js")), ss = 0;
7066
7066
  function cs(e) {
7067
7067
  return (0, is.default)((0, as.default)((0, as.default)(e).filter((e) => e.span !== void 0).map((e) => (0, Za.default)((e.span?.[0] ?? 0) + 1, (e.span?.[1] ?? 0) + 1))));
7068
7068
  }
@@ -9293,7 +9293,7 @@ function Vs(e, t, n, r, i) {
9293
9293
  }
9294
9294
  //#endregion
9295
9295
  //#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.17.21_marked@15.0.12_react-dom@19.2.8_b9e6aec46d952f631ce71b0585d2a8e5/node_modules/@glideapps/glide-data-grid/dist/esm/cells/number-cell.js
9296
- var Hs = K.lazy(async () => await import("./number-overlay-editor-BatBVYxr.js")), Us = {
9296
+ var Hs = K.lazy(async () => await import("./number-overlay-editor-CV1RN5Cg.js")), Us = {
9297
9297
  getAccessibilityString: (e) => e.data?.toString() ?? "",
9298
9298
  kind: W.Number,
9299
9299
  needsHover: (e) => e.hoverEffect === !0,
@@ -1,6 +1,6 @@
1
1
  import { g as e } from "./tooltip-qB8NlSqV.js";
2
2
  import { _ as t } from "./useTheme-DzXmYZ5V.js";
3
- import { r as n } from "./code-visibility-DxgQWu1j.js";
3
+ import { r as n } from "./code-visibility-CI3ySb6F.js";
4
4
  var r = e("triangle-alert", [
5
5
  ["path", {
6
6
  d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
package/dist/main.js CHANGED
@@ -7,7 +7,7 @@ import { C as T, F as E, G as D, I as O, J as k, K as A, L as j, P as M, R as N,
7
7
  import { a as se, f as ce, g as V, i as le, n as ue, o as de, p as fe, r as pe, t as me } from "./tooltip-qB8NlSqV.js";
8
8
  import { $ as he, $t as ge, At as _e, B as ve, C as ye, D as be, Dt as xe, F as Se, G as Ce, Gt as we, I as Te, J as Ee, L as De, Mt as Oe, Nt as ke, O as Ae, Ot as je, P as Me, Q as Ne, Qt as Pe, S as Fe, T as Ie, Tt as Le, U as Re, Ut as ze, W as Be, Wt as Ve, X as He, Xt as Ue, Y as We, Yt as Ge, Zt as Ke, _n as qe, _t as Je, an as Ye, bn as Xe, c as Ze, cn as Qe, ct as $e, d as et, dn as tt, dt as nt, f as rt, fn as it, ft as at, g as ot, gn as st, gt as ct, h as lt, in as ut, it as dt, jt as ft, k as pt, kt as mt, l as ht, m as gt, mn as _t, n as vt, o as yt, on as bt, p as xt, pn as St, pt as Ct, q as wt, qt as Tt, r as Et, rn as Dt, rt as Ot, u as kt, v as At, w as jt, xt as Mt, yn as Nt, zt as Pt } from "./cells-DYIkSxs6.js";
9
9
  import { D as Ft, E as It, O as Lt, S as Rt, T as zt, _ as Bt, a as Vt, c as Ht, d as Ut, f as Wt, g as Gt, h as Kt, i as qt, l as Jt, m as Yt, n as Xt, o as Zt, p as Qt, r as $t, s as en, t as tn, u as nn, v as rn, w as an, x as on, y as sn } from "./spec-CAYwFeV6.js";
10
- import { $t as cn, A as ln, At as un, B as dn, Bt as fn, C as pn, Ct as mn, D as hn, Dt as gn, E as _n, Et as vn, F as yn, Ft as bn, G as xn, Gt as Sn, H as Cn, Ht as wn, I as Tn, It as En, J as Dn, Jt as On, K as kn, Kt as An, L as jn, Lt as Mn, M as Nn, Mt as Pn, N as Fn, Nt as In, O as Ln, Ot as Rn, P as zn, Pt as Bn, Qt as Vn, R as Hn, Rt as Un, S as Wn, St as Gn, T as Kn, Tt as qn, U as Jn, Ut as Yn, V as Xn, Vt as Zn, W as Qn, Wt as $n, X as er, Xt as tr, Y as nr, Yt as rr, Zt as ir, _ as ar, _t as or, an as sr, at as cr, b as lr, c as ur, cn as dr, ct as fr, d as pr, dn as mr, dt as hr, en as gr, et as _r, f as vr, fn as yr, ft as br, g as xr, gt as Sr, h as Cr, hn as wr, ht as Tr, in as Er, it as Dr, j as Or, jt as kr, k as Ar, kt as jr, ln as Mr, lt as Nr, m as Pr, mn as Fr, mt as Ir, nn as Lr, nt as Rr, ot as zr, p as Br, pn as Vr, pt as Hr, q as Ur, qt as Wr, r as Gr, rn as Kr, rt as qr, sn as Jr, st as Yr, t as Xr, tn as Zr, tt as Qr, u as $r, un as ei, ut as ti, v as ni, vt as ri, w as ii, wt as ai, x as oi, y as si, yt as ci, z as li, zt as ui } from "./common-ByAtncLr.js";
10
+ import { $t as cn, A as ln, At as un, B as dn, Bt as fn, C as pn, Ct as mn, D as hn, Dt as gn, E as _n, Et as vn, F as yn, Ft as bn, G as xn, Gt as Sn, H as Cn, Ht as wn, I as Tn, It as En, J as Dn, Jt as On, K as kn, Kt as An, L as jn, Lt as Mn, M as Nn, Mt as Pn, N as Fn, Nt as In, O as Ln, Ot as Rn, P as zn, Pt as Bn, Qt as Vn, R as Hn, Rt as Un, S as Wn, St as Gn, T as Kn, Tt as qn, U as Jn, Ut as Yn, V as Xn, Vt as Zn, W as Qn, Wt as $n, X as er, Xt as tr, Y as nr, Yt as rr, Zt as ir, _ as ar, _t as or, an as sr, at as cr, b as lr, c as ur, cn as dr, ct as fr, d as pr, dn as mr, dt as hr, en as gr, et as _r, f as vr, fn as yr, ft as br, g as xr, gt as Sr, h as Cr, hn as wr, ht as Tr, in as Er, it as Dr, j as Or, jt as kr, k as Ar, kt as jr, ln as Mr, lt as Nr, m as Pr, mn as Fr, mt as Ir, nn as Lr, nt as Rr, ot as zr, p as Br, pn as Vr, pt as Hr, q as Ur, qt as Wr, r as Gr, rn as Kr, rt as qr, sn as Jr, st as Yr, t as Xr, tn as Zr, tt as Qr, u as $r, un as ei, ut as ti, v as ni, vt as ri, w as ii, wt as ai, x as oi, y as si, yt as ci, z as li, zt as ui } from "./common-BOJoCp6P.js";
11
11
  import { c as di, i as fi, n as pi, o as mi, t as hi } from "./useLifecycle-DPgiiwwU.js";
12
12
  import { t as gi } from "./check-B7cIK6gb.js";
13
13
  import { A as _i, C as vi, D as yi, E as bi, M as xi, O as Si, S as Ci, T as wi, a as Ti, b as Ei, c as Di, i as Oi, k as ki, l as Ai, n as ji, o as Mi, r as Ni, s as Pi, t as Fi, w as Ii, x as Li } from "./select-C6plhmZr.js";
@@ -15,8 +15,8 @@ import { B as Ri, C as zi, J as Bi, Mt as Vi, Nt as Hi, S as Ui, Vt as Wi, W as
15
15
  import { _ as ha, c as ga, d as _a, f as va, g as ya, h as ba, m as xa, u as Sa, v as Ca } from "./toDate-WXg1yLcI.js";
16
16
  import { a as wa, c as Ta, d as Ea, f as Da, i as Oa, l as ka, n as Aa, o as ja, r as Ma, s as Na, t as Pa } from "./process-output-BCTjlyuH.js";
17
17
  import { a as Fa, c as Ia, d as La, i as Ra, l as za, r as Ba, u as Va } from "./glide-utils-B3rUT5PI.js";
18
- import { n as Ha, t as Ua } from "./ErrorBoundary-Uf_LvjvY.js";
19
- import { n as Wa, t as Ga } from "./globals-yWarpyN4.js";
18
+ import { n as Ha, t as Ua } from "./ErrorBoundary-Bc52FkKN.js";
19
+ import { n as Wa, t as Ga } from "./globals-CruHzAUQ.js";
20
20
  import { t as Ka } from "./react-dom-BUgJ-ab_.js";
21
21
  import { t as qa } from "./jsx-runtime-DgDPJV9S.js";
22
22
  import { B as Ja, C as H, Ct as Ya, D as Xa, E as Za, Et as Qa, F as U, G as $a, H as eo, I as to, L as no, M as W, N as ro, O as io, P as ao, Q as oo, R as so, S as G, St as co, Tt as lo, U as uo, W as fo, Y as po, Z as mo, _ as ho, a as go, b as _o, bt as vo, c as yo, d as bo, dt as xo, f as So, g as Co, gt as wo, h as To, i as Eo, j as K, k as Do, l as Oo, m as ko, n as Ao, o as jo, p as Mo, r as No, s as Po, u as Fo, v as Io, vt as Lo, w as Ro, wt as zo, x as Bo, xt as Vo, y as Ho, yt as Uo } from "./use-restore-focus-D5D9xEjZ.js";
@@ -40,7 +40,7 @@ import { t as Ns } from "./useAsyncData-BD6AStMt.js";
40
40
  import { i as Ps, n as Fs, r as Is } from "./formats-BR5iGb4s.js";
41
41
  import { M as Ls, N as Rs } from "./vega-loader.browser-D95WfUcj.js";
42
42
  import { a as zs, n as Bs } from "./loader-D2W4oM-3.js";
43
- import { c as Vs, d as Hs, i as Us, l as Ws, o as Gs, s as Ks, t as qs, u as Js } from "./code-visibility-DxgQWu1j.js";
43
+ import { c as Vs, d as Hs, i as Us, l as Ws, o as Gs, s as Ks, t as qs, u as Js } from "./code-visibility-CI3ySb6F.js";
44
44
  import { t as Ys } from "./useDeepCompareMemoize-D_HNdyvI.js";
45
45
  import { t as Xs } from "./esm-BElI3qKH.js";
46
46
  //#region ../node_modules/.pnpm/iconify-icon@2.3.0/node_modules/iconify-icon/dist/iconify-icon.mjs
@@ -10458,7 +10458,7 @@ function RC(e, t) {
10458
10458
  }
10459
10459
  //#endregion
10460
10460
  //#region src/plugins/impl/DataEditorPlugin.tsx
10461
- var zC = J.lazy(() => import("./glide-data-editor-BJdZncJk.js").then((e) => e.t)), BC = xS("marimo-data-editor", { cssStyles: [WS] }).withData(W({
10461
+ var zC = J.lazy(() => import("./glide-data-editor-DtckYC_c.js").then((e) => e.t)), BC = xS("marimo-data-editor", { cssStyles: [WS] }).withData(W({
10462
10462
  initialValue: W({ edits: G(W({
10463
10463
  rowIdx: K(),
10464
10464
  columnId: U(),
@@ -16360,7 +16360,11 @@ function ID(e) {
16360
16360
  }), t[18] = a, t[19] = s), s;
16361
16361
  }
16362
16362
  var LD = ({ value: e, setValue: t, initialPath: n, selectionMode: r, multiple: i, label: a, restrictNavigation: o, list_directory: s, host: c }) => {
16363
- let [u, d] = Cn(n), [f, p] = (0, J.useState)(!1), [m, h] = (0, J.useState)(!1), [g, v] = (0, J.useState)(0), y = (0, J.useRef)([]), b = (0, J.useRef)(null), S = (0, J.useRef)(!1), C = c.closest(`[${Pe}]`)?.getAttribute(Pe), { data: w, error: T, isPending: D } = Ns(() => s({ path: u }), [u, C]);
16363
+ let [u, d] = Cn(n), [f, p] = (0, J.useState)(!1), [m, h] = (0, J.useState)(!1), [g, v] = (0, J.useState)(0), y = (0, J.useRef)([]), b = (0, J.useRef)(null), S = (0, J.useRef)(!1), C = c.closest(`[${Pe}]`)?.getAttribute(Pe), { data: w, error: T, isPending: D } = Ns(() => s({ path: u }), [
16364
+ u,
16365
+ C,
16366
+ s
16367
+ ]);
16364
16368
  (0, J.useEffect)(() => {
16365
16369
  if (!D) {
16366
16370
  h(!1);
@@ -16373,8 +16377,14 @@ var LD = ({ value: e, setValue: t, initialPath: n, selectionMode: r, multiple: i
16373
16377
  window.clearTimeout(e);
16374
16378
  };
16375
16379
  }, [D]);
16376
- let O = `${u}::${C}`, [k, A] = (0, J.useState)(O);
16377
- k !== O && (A(O), v(0)), (0, J.useLayoutEffect)(() => {
16380
+ let O = `${u}::${C}`, [k, A] = (0, J.useState)({
16381
+ listingKey: O,
16382
+ list_directory: s
16383
+ });
16384
+ (k.listingKey !== O || k.list_directory !== s) && (A({
16385
+ listingKey: O,
16386
+ list_directory: s
16387
+ }), v(0)), (0, J.useLayoutEffect)(() => {
16378
16388
  S.current && (S.current = !1, y.current[0]?.focus());
16379
16389
  }, [O]);
16380
16390
  let j = w?.files ?? [], M = new Set(e.map((e) => e.path)), N = r === "directory" || r === "all", P = r === "file" || r === "all", F = j.filter((e) => N && e.is_directory || P && !e.is_directory), I = F.length > 0 && F.every((e) => M.has(e.path));
@@ -29922,7 +29932,7 @@ function bR(e) {
29922
29932
  }
29923
29933
  //#endregion
29924
29934
  //#region src/components/editor/renderers/slides-layout/slides-layout.tsx
29925
- var xR = J.lazy(() => import("./reveal-component-D02jcpiJ.js")), SR = (e) => {
29935
+ var xR = J.lazy(() => import("./reveal-component-C47L1uNq.js")), SR = (e) => {
29926
29936
  let t = (0, X.c)(33), { layout: n, setLayout: r, cells: i, mode: a } = e, o = rs(Ce), s = a === "read" || o, c = rs(xt) > 1, [l, u] = (0, J.useState)(null), d;
29927
29937
  t[0] !== i || t[1] !== n ? (d = vP(i, n), t[0] = i, t[1] = n, t[2] = d) : d = t[2];
29928
29938
  let { slideCells: f, skippedIds: p, noOutputIds: m, slideTypes: h, startCellIndex: g } = d, _;
@@ -1,6 +1,6 @@
1
1
  import { a as e } from "./rolldown-runtime-Cb76FRpK.js";
2
2
  import { t } from "./react-ofJbxM4x.js";
3
- import { a as n } from "./glide-data-editor-BJdZncJk.js";
3
+ import { a as n } from "./glide-data-editor-DtckYC_c.js";
4
4
  //#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.17.21_marked@15.0.12_react-dom@19.2.8_b9e6aec46d952f631ce71b0585d2a8e5/node_modules/@glideapps/glide-data-grid/dist/esm/internal/data-grid-overlay-editor/private/number-overlay-editor-style.js
5
5
  var r = /* @__PURE__ */ e(t()), i = /*#__PURE__*/ n("div")({
6
6
  name: "NumberOverlayEditorStyle",
@@ -4,13 +4,13 @@ import { t as o } from "./react-ofJbxM4x.js";
4
4
  import { t as s } from "./compiler-runtime-Cj8ZWiNS.js";
5
5
  import { g as c, t as l } from "./tooltip-qB8NlSqV.js";
6
6
  import { G as u, w as d } from "./cells-DYIkSxs6.js";
7
- import { $ as f, Q as p, Z as m, an as h, i as g, l as _, ln as v, n as y, on as b, r as x, t as S, u as C } from "./common-ByAtncLr.js";
7
+ import { $ as f, Q as p, Z as m, an as h, i as g, l as _, ln as v, n as y, on as b, r as x, t as S, u as C } from "./common-BOJoCp6P.js";
8
8
  import { M as w } from "./select-C6plhmZr.js";
9
9
  import { J as T } from "./dropdown-menu-CZgjYSAh.js";
10
10
  import { t as E } from "./jsx-runtime-DgDPJV9S.js";
11
11
  import { q as ee } from "./use-restore-focus-D5D9xEjZ.js";
12
12
  import { A as D, C as O, b as k } from "./useTheme-DzXmYZ5V.js";
13
- import { a as A, n as te, t as ne } from "./code-visibility-DxgQWu1j.js";
13
+ import { a as A, n as te, t as ne } from "./code-visibility-CI3ySb6F.js";
14
14
  /* empty css */
15
15
  var j = c("sticky-note", [["path", {
16
16
  d: "M21 9a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 15 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2z",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/islands",
3
- "version": "0.24.3-dev83",
3
+ "version": "0.24.3-dev87",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -6,7 +6,7 @@ import { pairPreviewSchema } from "@/core/config/pair";
6
6
 
7
7
  // Read the Python-owned resource only in tests to check the shared contract.
8
8
  export const PAIR_PREVIEW = pairPreviewSchema.parse({
9
- command: "uv run marimo",
9
+ command: "uvx marimo@latest",
10
10
  templates: JSON.parse(
11
11
  readFileSync(
12
12
  path.resolve(
@@ -129,7 +129,7 @@ describe("getTerminalCommand", () => {
129
129
  PAIR_PREVIEW,
130
130
  ),
131
131
  ).toBe(
132
- String.raw`codex "$(MARIMO_PAIR_NEXT=1 uv run marimo pair prompt \
132
+ String.raw`codex "$(MARIMO_PAIR_NEXT=1 uvx marimo@latest pair prompt \
133
133
  --url http://localhost:8000)"`,
134
134
  );
135
135
  } finally {
@@ -152,7 +152,7 @@ describe("getTerminalCommand", () => {
152
152
  PAIR_PREVIEW,
153
153
  ),
154
154
  ).toBe(
155
- String.raw`${cli} "$(MARIMO_PAIR_NEXT=1 uv run marimo pair prompt \
155
+ String.raw`${cli} "$(MARIMO_PAIR_NEXT=1 uvx marimo@latest pair prompt \
156
156
  --url http://localhost:8000 \
157
157
  --file notebooks/example.py \
158
158
  --session s_ab12cd \
@@ -264,8 +264,8 @@ describe("getRawPrompt", () => {
264
264
  expect(getRawPrompt(connection, null, PAIR_PREVIEW)).toBe(
265
265
  "Pair with me on this running marimo notebook.\n\n" +
266
266
  `URL: http://localhost:8000\n${fields}\n` +
267
- "Run `uv run marimo pair --help` first.\n" +
268
- "Use `uv run marimo` for all marimo commands.\n\n" +
267
+ "Run `uvx marimo@latest pair --help` first.\n" +
268
+ "Use `uvx marimo@latest` for all marimo commands.\n\n" +
269
269
  "Once connected, send a fun toast using `mo.status.toast(...)` (`import marimo as mo`).",
270
270
  );
271
271
  });
@@ -278,8 +278,8 @@ describe("getRawPrompt", () => {
278
278
  "URL: http://localhost:8000\n" +
279
279
  "File: notebooks/example.py\n" +
280
280
  "Session: s_ab12cd\n\n" +
281
- "Run `uv run marimo pair --help` first.\n" +
282
- "Use `uv run marimo` for all marimo commands.\n\n" +
281
+ "Run `uvx marimo@latest pair --help` first.\n" +
282
+ "Use `uvx marimo@latest` for all marimo commands.\n\n" +
283
283
  "Once connected, send a fun toast using `mo.status.toast(...)` (`import marimo as mo`).",
284
284
  );
285
285
  });
@@ -203,7 +203,7 @@ describe("PairWithAgentModal", () => {
203
203
  );
204
204
  await waitFor(() =>
205
205
  expect(copyToClipboard).toHaveBeenCalledWith(
206
- String.raw`claude "$(MARIMO_PAIR_NEXT=1 uv run marimo pair prompt \
206
+ String.raw`claude "$(MARIMO_PAIR_NEXT=1 uvx marimo@latest pair prompt \
207
207
  --url http://localhost:8000/ \
208
208
  --file notebook.py \
209
209
  --session ${getSessionId()} \
@@ -218,7 +218,7 @@ export const FileBrowser = ({
218
218
 
219
219
  const { data, error, isPending } = useAsyncData(() => {
220
220
  return list_directory({ path: path });
221
- }, [path, randomId]);
221
+ }, [path, randomId, list_directory]);
222
222
 
223
223
  useEffect(() => {
224
224
  if (!isPending) {
@@ -238,9 +238,15 @@ export const FileBrowser = ({
238
238
  // Reset the roving tabindex whenever the listing reloads (a new path or a
239
239
  // same-path refresh) so activeIndex never points past the current rows.
240
240
  const listingKey = `${path}::${randomId}`;
241
- const [prevListingKey, setPrevListingKey] = useState(listingKey);
242
- if (prevListingKey !== listingKey) {
243
- setPrevListingKey(listingKey);
241
+ const [prevListing, setPrevListing] = useState({
242
+ listingKey,
243
+ list_directory,
244
+ });
245
+ if (
246
+ prevListing.listingKey !== listingKey ||
247
+ prevListing.list_directory !== list_directory
248
+ ) {
249
+ setPrevListing({ listingKey, list_directory });
244
250
  setActiveIndex(0);
245
251
  }
246
252
 
@@ -5,8 +5,9 @@ import { beforeAll, describe, expect, it, vi } from "vitest";
5
5
  import { SetupMocks } from "@/__mocks__/common";
6
6
  import { initialModeAtom } from "@/core/mode";
7
7
  import { store } from "@/core/state/jotai";
8
+ import { CellNotInitializedError } from "@/utils/errors";
8
9
  import type { IPluginProps } from "../../types";
9
- import { FileBrowserPlugin } from "../FileBrowserPlugin";
10
+ import { FileBrowser, FileBrowserPlugin } from "../FileBrowserPlugin";
10
11
 
11
12
  interface MockFile {
12
13
  id: string;
@@ -80,6 +81,54 @@ beforeAll(() => {
80
81
  store.set(initialModeAtom, "edit");
81
82
  });
82
83
 
84
+ describe("FileBrowserPlugin session cache recovery", () => {
85
+ it("retries a failed cached listing when the plugin resets", async () => {
86
+ const host = document.createElement("marimo-file-browser");
87
+ const wrapper = document.createElement("marimo-ui-element");
88
+ wrapper.setAttribute("random-id", "cached-id");
89
+ wrapper.append(host);
90
+
91
+ const props = {
92
+ initialPath: "/home/user",
93
+ filetypes: [],
94
+ selectionMode: "directory",
95
+ multiple: false,
96
+ label: "Pick folder",
97
+ restrictNavigation: false,
98
+ value: [],
99
+ setValue: vi.fn(),
100
+ host,
101
+ };
102
+ const error = new CellNotInitializedError();
103
+ const cachedListDirectory = vi.fn().mockRejectedValue(error);
104
+ const { rerender } = render(
105
+ <FileBrowser {...props} list_directory={cachedListDirectory} />,
106
+ );
107
+ expect(await screen.findByText(error.message)).toBeInTheDocument();
108
+
109
+ // PluginSlot recreates the RPC functions on reset, even when the path
110
+ // and the host's attributes are unchanged.
111
+ const liveListDirectory = mockListDirectory(FILES);
112
+ rerender(<FileBrowser {...props} list_directory={liveListDirectory} />);
113
+
114
+ expect(await screen.findByText("docs")).toBeInTheDocument();
115
+ expect(screen.queryByText(error.message)).not.toBeInTheDocument();
116
+ expect(liveListDirectory.mock.calls).toEqual([[{ path: "/home/user" }]]);
117
+
118
+ fireEvent.click(screen.getByRole("checkbox", { name: "Select docs" }));
119
+ expect(props.setValue).toHaveBeenCalledWith([
120
+ { ...FILES[0], id: FILES[0].path },
121
+ ]);
122
+
123
+ fireEvent.keyDown(screen.getAllByRole("row")[0], { key: "End" });
124
+ rerender(
125
+ <FileBrowser {...props} list_directory={mockListDirectory([FILES[0]])} />,
126
+ );
127
+ await waitFor(() => expect(screen.getAllByRole("row")).toHaveLength(2));
128
+ expect(screen.getAllByRole("row")[0]).toHaveAttribute("tabindex", "0");
129
+ });
130
+ });
131
+
83
132
  describe("FileBrowserPlugin keyboard accessibility", () => {
84
133
  it("renders a row per file plus the parent row", async () => {
85
134
  renderBrowser();