@marimo-team/islands 0.24.3-dev4 → 0.24.3-dev9

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.
@@ -3,12 +3,12 @@ import { c as n, g as r, h as i, t as a } from "./button-CKBkqR9J.js";
3
3
  import { t as o } from "./react-DMWcHin-.js";
4
4
  import { t as s } from "./compiler-runtime-CAH9RLw2.js";
5
5
  import { r as c } from "./copy-CD7S58CY.js";
6
- import { Cn as l, F as u, Ft as d, Gt as f, Hn as p, In as m, Pn as h, Qn as g, Un as _, Vt as v, Wt as y, Xt as b, Yn as x, Zn as S, _ as C, a as w, c as T, d as E, er as ee, f as D, g as te, gn as ne, gt as re, h as ie, hn as ae, ht as oe, in as se, l as ce, m as le, mn as ue, n as de, nn as fe, on as pe, p as me, pn as he, pt as ge, q as _e, r as ve, rn as ye, rr as be, rt as xe, t as Se, v as Ce, vn as we, x as Te, y as Ee, yt as De, zt as Oe } from "./html-to-image-BhNoIBSU.js";
6
+ import { Cn as l, F as u, Ft as d, Gt as f, Hn as p, In as m, Pn as h, Qn as g, Un as _, Vt as v, Wt as y, Xt as b, Yn as x, Zn as S, _ as C, a as w, c as T, d as E, er as ee, f as D, g as te, gn as ne, gt as re, h as ie, hn as ae, ht as oe, in as se, l as ce, m as le, mn as ue, n as de, nn as fe, on as pe, p as me, pn as he, pt as ge, q as _e, r as ve, rn as ye, rr as be, rt as xe, t as Se, v as Ce, vn as we, x as Te, y as Ee, yt as De, zt as Oe } from "./html-to-image-BtFMe_Nq.js";
7
7
  import { u as ke } from "./dist-3_o3T78I.js";
8
8
  import { C as Ae, I as je, R as Me, b as Ne } from "./select-3qHpFKF9.js";
9
9
  import { _ as Pe, f as Fe, h as Ie, i as Le, n as Re, t as ze } from "./dropdown-menu-DhCfcscX.js";
10
- import { p as Be, v as Ve } from "./toDate-D-Rx3ux5.js";
11
- import { d as He, f as Ue, i as We, n as Ge, t as Ke, u as qe } from "./process-output-CpK6fX_C.js";
10
+ import { p as Be, v as Ve } from "./toDate-CpXBeDq0.js";
11
+ import { d as He, f as Ue, i as We, n as Ge, t as Ke, u as qe } from "./process-output-CPy0YKUe.js";
12
12
  import { t as Je } from "./jsx-runtime-CpoKNRgu.js";
13
13
  import { Cn as O, Cr as Ye, In as k, It as Xe, Jn as A, Sn as Ze, Tt as Qe, Yn as $e, bt as et, cn as tt, jn as nt, kt as j, ln as M, mr as rt, un as N, vt as it, wt as at, xt as ot, zt as st } from "./schemas-DzK6U94N.js";
14
14
  import { n as ct } from "./error-banner-CsXbEEjo.js";
@@ -3,14 +3,14 @@ import { _ as n, c as r, f as i, g as a, h as o, m as s, n as c, p as l, r as u,
3
3
  import { t as f } from "./react-DMWcHin-.js";
4
4
  import { t as p } from "./compiler-runtime-CAH9RLw2.js";
5
5
  import { n as m, r as h, t as g } from "./copy-CD7S58CY.js";
6
- import { $ as _, $n as v, $t as y, A as b, An as x, At as S, Cn as C, Ct as w, D as T, E, Et as D, F as O, Gn as k, H as A, Hn as j, Ht as M, Jn as N, Kt as P, Ln as F, M as I, Mn as L, N as R, Nt as ee, Pn as z, Q as te, Qn as ne, Qt as re, Rt as ie, S as ae, T as oe, Tt as se, Un as ce, Ut as le, V as ue, Wt as de, Xt as fe, Yn as pe, Z as me, Zn as he, _ as ge, _t as _e, ar as ve, cn as ye, en as be, er as xe, g as Se, gt as Ce, ht as we, it as Te, jn as Ee, jt as De, kt as Oe, lt as ke, mt as Ae, n as je, on as Me, or as Ne, ot as Pe, pt as Fe, q as Ie, qn as Le, r as Re, rr as ze, s as Be, sr as Ve, t as He, tt as Ue, u as We, v as Ge, vt as Ke, w as qe, wn as Je, y as Ye, yn as Xe, yt as Ze } from "./html-to-image-BhNoIBSU.js";
6
+ import { $ as _, $n as v, $t as y, A as b, An as x, At as S, Cn as C, Ct as w, D as T, E, Et as D, F as O, Gn as k, H as A, Hn as j, Ht as M, Jn as N, Kt as P, Ln as F, M as I, Mn as L, N as R, Nt as ee, Pn as z, Q as te, Qn as ne, Qt as re, Rt as ie, S as ae, T as oe, Tt as se, Un as ce, Ut as le, V as ue, Wt as de, Xt as fe, Yn as pe, Z as me, Zn as he, _ as ge, _t as _e, ar as ve, cn as ye, en as be, er as xe, g as Se, gt as Ce, ht as we, it as Te, jn as Ee, jt as De, kt as Oe, lt as ke, mt as Ae, n as je, on as Me, or as Ne, ot as Pe, pt as Fe, q as Ie, qn as Le, r as Re, rr as ze, s as Be, sr as Ve, t as He, tt as Ue, u as We, v as Ge, vt as Ke, w as qe, wn as Je, y as Ye, yn as Xe, yt as Ze } from "./html-to-image-BtFMe_Nq.js";
7
7
  import { o as Qe, u as B } from "./dist-3_o3T78I.js";
8
8
  import { c as $e, i as et, r as tt } from "./useLifecycle-B4RGlyf0.js";
9
9
  import { a as nt, i as rt, n as it, o as at, r as ot, t as st } from "./useDateFormatter-Cp9Jdxls.js";
10
10
  import { t as ct } from "./check-CHig47QV.js";
11
11
  import { C as lt, E as ut, I as dt, N as ft, O as pt, P as mt, R as ht, S as gt, T 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, w as Mt, y as Nt } from "./select-3qHpFKF9.js";
12
12
  import { $ as Pt, $t as Ft, A as It, At as Lt, B as Rt, Bt as zt, Ct as Bt, D as Vt, Dt as Ht, E as Ut, Et as Wt, F as Gt, Ft as Kt, G as qt, Gt as Jt, H as Yt, Ht as Xt, I as Zt, It as Qt, Jt as $t, K as en, Kt as tn, L as nn, Lt as rn, M as an, Mt as on, N as sn, Nt as cn, O as ln, Ot as un, P as dn, Pt as fn, Q as pn, Qt as mn, R as hn, Rt as gn, S as _n, St as vn, T as yn, Tt as bn, U as xn, Ut as Sn, V as Cn, Vt as wn, W as Tn, Wt as En, X as Dn, Xt as On, Yt as kn, Z as An, Zt as jn, _ as Mn, _t as Nn, a as Pn, an as Fn, at as In, b as Ln, bt as Rn, cn as zn, ct as Bn, d as Vn, dn as Hn, dt as Un, en as Wn, et as Gn, f as Kn, fn as qn, ft as Jn, gt as Yn, h as Xn, hn as Zn, ht as Qn, i as $n, in as er, it as tr, j as nr, jt as rr, k as ir, kt as ar, l as or, ln as sr, lt as cr, mn as lr, mt as ur, n as dr, nn as fr, nt as pr, o as mr, pn as hr, pt as gr, q as _r, qt as vr, rn as yr, rt as br, s as xr, sn as Sr, st as Cr, t as wr, tn as Tr, tt as Er, u as Dr, un as Or, ut as kr, vt as Ar, w as jr, wt as Mr, x as Nr, xt as Pr, y as Fr, yt as Ir, z as Lr, zt as Rr } from "./dropdown-menu-DhCfcscX.js";
13
- import { _ as zr, a as Br, c as Vr, d as Hr, i as Ur, n as Wr, o as Gr, p as Kr, r as qr, s as Jr, t as Yr } from "./toDate-D-Rx3ux5.js";
13
+ import { _ as zr, a as Br, c as Vr, d as Hr, i as Ur, n as Wr, o as Gr, p as Kr, r as qr, s as Jr, t as Yr } from "./toDate-CpXBeDq0.js";
14
14
  import { n as Xr, t as Zr } from "./ErrorBoundary-CR-ZQN_c.js";
15
15
  import { t as Qr } from "./clsx-CoeGtWvn.js";
16
16
  import { t as $r } from "./react-dom-C94wmq5w.js";
@@ -27,7 +27,7 @@ import { t as la } from "./objects-CzUgoMIF.js";
27
27
  import { n as ua, t as da } from "./once-BtE-wKRL.js";
28
28
  import { o as fa } from "./dist-BrQGcfQ9.js";
29
29
  import { t as pa } from "./useAsyncData-CH6-CgJF.js";
30
- import { a as ma, i as ha, n as ga, t as _a } from "./formats-CJMVUfb3.js";
30
+ import { a as ma, i as ha, n as ga, t as _a } from "./formats-CslNOKy0.js";
31
31
  import { n as va, t as ya } from "./emotion-is-prop-valid.esm-M57VsT8j.js";
32
32
  import { A as ba, n as xa } from "./vega-loader.browser-DEggZzni.js";
33
33
  import { a as Sa, n as Ca, r as wa, t as Ta } from "./loader-VZ__bv4g.js";
@@ -29847,18 +29847,20 @@ var SW = ({ pagination: e, totalColumns: t, selection: n, onRowSelectionChange:
29847
29847
  children: n
29848
29848
  }), t[2] = n, t[3] = i, t[4] = a) : a = t[4], a;
29849
29849
  }, DW = (e) => {
29850
- let t = (0, W.c)(9), { columnName: n, dataType: r } = e, i, a;
29850
+ let t = (0, W.c)(12), { columnName: n, dataType: r, className: i } = e, a, s;
29851
29851
  if (t[0] !== r) {
29852
29852
  let e = be(r);
29853
- i = re[e], a = y(e), t[0] = r, t[1] = i, t[2] = a;
29854
- } else i = t[1], a = t[2];
29855
- let o = `w-4 h-4 p-0.5 rounded-sm stroke-card-foreground ${a}`, s;
29856
- t[3] !== i || t[4] !== o ? (s = /* @__PURE__ */ (0, U.jsx)(i, { className: o }), t[3] = i, t[4] = o, t[5] = s) : s = t[5];
29857
- let c;
29858
- return t[6] !== n || t[7] !== s ? (c = /* @__PURE__ */ (0, U.jsxs)("div", {
29859
- className: "flex flex-row items-center gap-1.5",
29860
- children: [s, n]
29861
- }), t[6] = n, t[7] = s, t[8] = c) : c = t[8], c;
29853
+ a = re[e], s = y(e), t[0] = r, t[1] = a, t[2] = s;
29854
+ } else a = t[1], s = t[2];
29855
+ let c = s, l;
29856
+ t[3] === i ? l = t[4] : (l = o("flex flex-row items-center gap-1.5", i), t[3] = i, t[4] = l);
29857
+ let u = `w-4 h-4 shrink-0 p-0.5 rounded-sm stroke-card-foreground ${c}`, d;
29858
+ t[5] !== a || t[6] !== u ? (d = /* @__PURE__ */ (0, U.jsx)(a, { className: u }), t[5] = a, t[6] = u, t[7] = d) : d = t[7];
29859
+ let f;
29860
+ return t[8] !== n || t[9] !== l || t[10] !== d ? (f = /* @__PURE__ */ (0, U.jsxs)("div", {
29861
+ className: l,
29862
+ children: [d, n]
29863
+ }), t[8] = n, t[9] = l, t[10] = d, t[11] = f) : f = t[11], f;
29862
29864
  }, OW = "Show only this column";
29863
29865
  function kW({ table: e, columnIds: t, disabled: n, className: r, iconClassName: i = "h-3 w-3" }) {
29864
29866
  return /* @__PURE__ */ (0, U.jsx)(Li, {
@@ -29983,17 +29985,22 @@ var jW = ({ table: e }) => {
29983
29985
  /* @__PURE__ */ (0, U.jsx)(V_, {})
29984
29986
  ] }),
29985
29987
  l.visibleOptions.map((t, n) => {
29986
- let r = l.isChecked(t.value), { dataType: i } = t.data, a = n === l.pinnedCount && l.pinnedCount > 0 && l.pinnedCount < l.visibleOptions.length;
29988
+ let r = l.isChecked(t.value), { dataType: i } = t.data, a = n === l.pinnedCount && l.pinnedCount > 0 && l.pinnedCount < l.visibleOptions.length, s = /* @__PURE__ */ (0, U.jsx)("span", {
29989
+ className: "truncate",
29990
+ title: t.label,
29991
+ children: t.label
29992
+ });
29987
29993
  return /* @__PURE__ */ (0, U.jsxs)(H.Fragment, { children: [a && /* @__PURE__ */ (0, U.jsx)(V_, {}), /* @__PURE__ */ (0, U.jsxs)(H_, {
29988
29994
  value: t.value,
29989
29995
  disabled: t.disabled,
29990
29996
  onSelect: () => l.toggle(t.value),
29991
29997
  className: "flex items-center gap-1.5 cursor-pointer",
29992
- children: [i === void 0 ? /* @__PURE__ */ (0, U.jsx)("span", { children: t.label }) : /* @__PURE__ */ (0, U.jsx)(DW, {
29993
- columnName: t.label,
29998
+ children: [i === void 0 ? s : /* @__PURE__ */ (0, U.jsx)(DW, {
29999
+ className: "min-w-0",
30000
+ columnName: s,
29994
30001
  dataType: i
29995
30002
  }), !t.disabled && /* @__PURE__ */ (0, U.jsxs)("span", {
29996
- className: "ml-auto flex items-center gap-0.5",
30003
+ className: "ml-auto flex shrink-0 items-center gap-0.5",
29997
30004
  children: [/* @__PURE__ */ (0, U.jsx)(kW, {
29998
30005
  table: e,
29999
30006
  columnIds: [t.value],
@@ -32157,7 +32164,7 @@ function XK() {
32157
32164
  return a.warn("Failed to get version from mount config"), null;
32158
32165
  }
32159
32166
  }
32160
- var ZK = XK() || "0.24.3-dev4", QK = V(ZK), $K = V(!0);
32167
+ var ZK = XK() || "0.24.3-dev9", QK = V(ZK), $K = V(!0);
32161
32168
  V(null);
32162
32169
  //#endregion
32163
32170
  //#region src/core/wasm/state.ts
@@ -2,7 +2,7 @@ import { a as e } from "./rolldown-runtime-Cb76FRpK.js";
2
2
  import { h as t, r as n } from "./button-CKBkqR9J.js";
3
3
  import { t as r } from "./react-DMWcHin-.js";
4
4
  import { t as i } from "./compiler-runtime-CAH9RLw2.js";
5
- import { t as a } from "./toDate-D-Rx3ux5.js";
5
+ import { t as a } from "./toDate-CpXBeDq0.js";
6
6
  import { t as o } from "./jsx-runtime-CpoKNRgu.js";
7
7
  import { i as s } from "./loader-VZ__bv4g.js";
8
8
  //#region ../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isDate.js
@@ -9,7 +9,7 @@ import { a as ne, c as re, i as D, o as ie, r as O, s as k, t as A } from "./use
9
9
  import { t as ae } from "./check-CHig47QV.js";
10
10
  import { C as oe, F as se, I as j, N as ce, P as M, R as le, S as ue, a as de, b as fe, c as pe, i as me, n as he, o as ge, r as _e, s as ve, t as ye } from "./select-3qHpFKF9.js";
11
11
  import { Y as be, gt as xe, q as Se } from "./dropdown-menu-DhCfcscX.js";
12
- import { _ as Ce, g as we, l as Te, t as Ee, v as De } from "./toDate-D-Rx3ux5.js";
12
+ import { _ as Ce, g as we, l as Te, t as Ee, v as De } from "./toDate-CpXBeDq0.js";
13
13
  import { t as Oe } from "./react-dom-C94wmq5w.js";
14
14
  import { t as ke } from "./jsx-runtime-CpoKNRgu.js";
15
15
  import { Ac as Ae, Bc as je, Cn as Me, Dc as Ne, Fc as Pe, Gc as N, Hc as Fe, Ic as Ie, In as Le, Jc as Re, Jn as ze, Lc as Be, Mc as Ve, Oc as He, Pc as Ue, Rc as We, Sn as Ge, Tt as Ke, Uc as qe, Vc as Je, Wc as Ye, Yc as Xe, jc as Ze, kt as Qe, ln as $e, qc as et, wc as tt, zc as nt } from "./schemas-DzK6U94N.js";
package/dist/main.js CHANGED
@@ -3,16 +3,16 @@ import { _ as a, c as o, f as s, g as c, h as l, i as u, l as d, m as f, n as p,
3
3
  import { t as y } from "./react-DMWcHin-.js";
4
4
  import { t as b } from "./compiler-runtime-CAH9RLw2.js";
5
5
  import { n as x, r as S, t as C } from "./copy-CD7S58CY.js";
6
- import { $n as w, An as T, B as E, Bn as D, Bt as O, C as k, Ct as A, Dn as j, Dt as M, En as N, F as P, Fn as F, G as I, I as L, It as ee, J as te, Jt as R, K as ne, Kn as z, L as re, Lt as ie, Mt as ae, Nn as oe, Nt as se, On as ce, Ot as le, P as ue, Pn as de, Pt as fe, Q as pe, Qn as me, Qt as he, R as ge, Rn as _e, Sn as ve, St as ye, U as be, Un as xe, Vn as Se, Vt as Ce, W as we, Wn as Te, Wt as Ee, X as De, Xn as Oe, Y as ke, Yn as Ae, Yt as je, Z as Me, Zn as Ne, Zt as Pe, _ as Fe, _n as Ie, a as Le, an as Re, ar as ze, at as Be, b as Ve, bn as He, bt as Ue, cn as We, ct as Ge, dn as Ke, dt as qe, et as Je, fn as Ye, ft as Xe, g as Ze, i as Qe, ir as $e, j as et, jt as tt, k as nt, kn as rt, kt as it, ln as at, n as ot, nr as st, o as ct, on as lt, ot as ut, q as dt, qt as ft, sn as pt, st as mt, tn as ht, tr as gt, un as _t, ut as vt, v as yt, wn as bt, wt as xt, xn as St, xt as Ct, y as wt, z as Tt, zn as Et } from "./html-to-image-BhNoIBSU.js";
6
+ import { $n as w, An as T, B as E, Bn as D, Bt as O, C as k, Ct as A, Dn as j, Dt as M, En as N, F as P, Fn as F, G as I, I as L, It as ee, J as te, Jt as R, K as ne, Kn as z, L as re, Lt as ie, Mt as ae, Nn as oe, Nt as se, On as ce, Ot as le, P as ue, Pn as de, Pt as fe, Q as pe, Qn as me, Qt as he, R as ge, Rn as _e, Sn as ve, St as ye, U as be, Un as xe, Vn as Se, Vt as Ce, W as we, Wn as Te, Wt as Ee, X as De, Xn as Oe, Y as ke, Yn as Ae, Yt as je, Z as Me, Zn as Ne, Zt as Pe, _ as Fe, _n as Ie, a as Le, an as Re, ar as ze, at as Be, b as Ve, bn as He, bt as Ue, cn as We, ct as Ge, dn as Ke, dt as qe, et as Je, fn as Ye, ft as Xe, g as Ze, i as Qe, ir as $e, j as et, jt as tt, k as nt, kn as rt, kt as it, ln as at, n as ot, nr as st, o as ct, on as lt, ot as ut, q as dt, qt as ft, sn as pt, st as mt, tn as ht, tr as gt, un as _t, ut as vt, v as yt, wn as bt, wt as xt, xn as St, xt as Ct, y as wt, z as Tt, zn as Et } from "./html-to-image-BtFMe_Nq.js";
7
7
  import { o as Dt, s as Ot, u as kt } from "./dist-3_o3T78I.js";
8
8
  import { D as At, E as jt, O as Mt, S as Nt, T as Pt, _ as Ft, a as It, c as Lt, d as Rt, f as zt, g as Bt, h as Vt, i as Ht, l as Ut, m as Wt, n as Gt, o as Kt, p as qt, r as Jt, s as Yt, t as Xt, u as Zt, v as Qt, w as $t, x as en, y as tn } from "./spec-CutWdqo3.js";
9
- import { $ as nn, $t as rn, A as an, At as on, B as sn, Bt as cn, C as ln, Cn as un, Ct as dn, D as fn, Dn as pn, Dt as mn, E as hn, En as gn, Et as _n, F as vn, Ft as yn, G as bn, Gt as xn, H as Sn, Ht as Cn, I as wn, It as Tn, J as En, Jt as Dn, K as On, Kt as kn, L as An, Lt as jn, M as Mn, N as Nn, Nt as Pn, O as Fn, Ot as In, P as Ln, Pt as Rn, Q as zn, Qt as Bn, R as Vn, Rt as Hn, S as Un, Sn as Wn, St as Gn, T as Kn, Tn as qn, Tt as Jn, U as Yn, Ut as Xn, V as Zn, Vt as Qn, W as $n, Wt as er, X as tr, Xt as nr, Y as rr, Yt as ir, Z as ar, Zt as or, _ as sr, _n as cr, _t as lr, a as ur, an as dr, at as fr, b as pr, bn as mr, bt as hr, cn as gr, dn as _r, dt as vr, en as yr, et as br, fn as xr, ft as Sr, g as Cr, gn as wr, gt as Tr, hn as Er, ht as Dr, i as Or, in as kr, it as Ar, j as jr, k as Mr, kt as Nr, l as Pr, ln as Fr, m as Ir, mn as Lr, mt as Rr, n as zr, nn as Br, nt as Vr, on as Hr, ot as Ur, pn as Wr, pt as Gr, q as Kr, qt as qr, rn as Jr, rt as Yr, s as Xr, sn as Zr, st as Qr, t as $r, tn as ei, tt as ti, un as ni, v as ri, vt as ii, w as ai, wn as oi, wt as si, x as ci, xn as li, xt as ui, y as di, yn as fi, yt as pi, z as mi, zt as hi } from "./common-BDlauhCU.js";
9
+ import { $ as nn, $t as rn, A as an, At as on, B as sn, Bt as cn, C as ln, Cn as un, Ct as dn, D as fn, Dn as pn, Dt as mn, E as hn, En as gn, Et as _n, F as vn, Ft as yn, G as bn, Gt as xn, H as Sn, Ht as Cn, I as wn, It as Tn, J as En, Jt as Dn, K as On, Kt as kn, L as An, Lt as jn, M as Mn, N as Nn, Nt as Pn, O as Fn, Ot as In, P as Ln, Pt as Rn, Q as zn, Qt as Bn, R as Vn, Rt as Hn, S as Un, Sn as Wn, St as Gn, T as Kn, Tn as qn, Tt as Jn, U as Yn, Ut as Xn, V as Zn, Vt as Qn, W as $n, Wt as er, X as tr, Xt as nr, Y as rr, Yt as ir, Z as ar, Zt as or, _ as sr, _n as cr, _t as lr, a as ur, an as dr, at as fr, b as pr, bn as mr, bt as hr, cn as gr, dn as _r, dt as vr, en as yr, et as br, fn as xr, ft as Sr, g as Cr, gn as wr, gt as Tr, hn as Er, ht as Dr, i as Or, in as kr, it as Ar, j as jr, k as Mr, kt as Nr, l as Pr, ln as Fr, m as Ir, mn as Lr, mt as Rr, n as zr, nn as Br, nt as Vr, on as Hr, ot as Ur, pn as Wr, pt as Gr, q as Kr, qt as qr, rn as Jr, rt as Yr, s as Xr, sn as Zr, st as Qr, t as $r, tn as ei, tt as ti, un as ni, v as ri, vt as ii, w as ai, wn as oi, wt as si, x as ci, xn as li, xt as ui, y as di, yn as fi, yt as pi, z as mi, zt as hi } from "./common-Cv-4hMa0.js";
10
10
  import { c as gi, i as _i, n as vi, o as yi, t as bi } from "./useLifecycle-B4RGlyf0.js";
11
11
  import { t as xi } from "./check-CHig47QV.js";
12
12
  import { A as Si, C as Ci, D as wi, E as Ti, F as Ei, I as Di, M as Oi, N as ki, P as Ai, R as ji, S as Mi, a as Ni, b as Pi, c as Fi, i as Ii, j as Li, l as Ri, n as zi, o as Bi, r as Vi, s as Hi, t as Ui, w as Wi, x as Gi } from "./select-3qHpFKF9.js";
13
13
  import { B as Ki, C as qi, Ft as Ji, J as Yi, Pt as Xi, S as Zi, Ut as Qi, W as $i, Y as ea, _ as ta, a as na, at as ra, bt as ia, c as aa, f as oa, ft as sa, g as ca, h as la, hn as ua, i as da, m as fa, mn as pa, n as ma, ot as ha, p as ga, r as _a, s as va, t as ya, v as ba, x as xa, z as Sa } from "./dropdown-menu-DhCfcscX.js";
14
- import { _ as Ca, c as wa, d as Ta, f as Ea, g as Da, h as Oa, m as ka, u as Aa, v as ja } from "./toDate-D-Rx3ux5.js";
15
- import { a as Ma, c as Na, d as Pa, f as Fa, i as Ia, l as La, n as Ra, o as za, r as Ba, s as Va, t as Ha } from "./process-output-CpK6fX_C.js";
14
+ import { _ as Ca, c as wa, d as Ta, f as Ea, g as Da, h as Oa, m as ka, u as Aa, v as ja } from "./toDate-CpXBeDq0.js";
15
+ import { a as Ma, c as Na, d as Pa, f as Fa, i as Ia, l as La, n as Ra, o as za, r as Ba, s as Va, t as Ha } from "./process-output-CPy0YKUe.js";
16
16
  import { a as Ua, c as Wa, d as Ga, i as Ka, l as qa, r as Ja, u as Ya } from "./glide-utils-NShAPPtn.js";
17
17
  import { n as Xa, t as Za } from "./ErrorBoundary-CR-ZQN_c.js";
18
18
  import { t as Qa } from "./react-dom-C94wmq5w.js";
@@ -36,7 +36,7 @@ import { n as Sh } from "./dist-CRjAdnqF.js";
36
36
  import { i as Ch } from "./dist-BrQGcfQ9.js";
37
37
  import { n as wh, t as Th } from "./esm-CesmlDrs.js";
38
38
  import { t as Eh } from "./useAsyncData-CH6-CgJF.js";
39
- import { i as Dh, n as Oh, r as kh } from "./formats-CJMVUfb3.js";
39
+ import { i as Dh, n as Oh, r as kh } from "./formats-CslNOKy0.js";
40
40
  import { A as Ah, j as jh } from "./vega-loader.browser-DEggZzni.js";
41
41
  import { a as Mh, n as Nh } from "./loader-VZ__bv4g.js";
42
42
  import { t as Ph } from "./useDeepCompareMemoize-JC87C_jO.js";
@@ -15392,7 +15392,7 @@ var CM = (e) => {
15392
15392
  output: t
15393
15393
  };
15394
15394
  } };
15395
- } }, kM = q.lazy(() => import("./chat-ui-DjTMZRVP.js").then((e) => ({ default: e.Chatbot }))), AM = U(B({
15395
+ } }, kM = q.lazy(() => import("./chat-ui-BSwr409J.js").then((e) => ({ default: e.Chatbot }))), AM = U(B({
15396
15396
  id: V(),
15397
15397
  role: Qp([
15398
15398
  "system",
@@ -27043,7 +27043,7 @@ function PV(e, t) {
27043
27043
  }
27044
27044
  //#endregion
27045
27045
  //#region src/plugins/impl/vega/VegaPlugin.tsx
27046
- var FV = q.lazy(() => import("./vega-component-CPehZbUb.js")), IV = class {
27046
+ var FV = q.lazy(() => import("./vega-component-ovBXgp91.js")), IV = class {
27047
27047
  tagName = "marimo-vega";
27048
27048
  validator = B({
27049
27049
  spec: B({}).passthrough().transform((e) => e),
@@ -35311,7 +35311,7 @@ function lJ(e) {
35311
35311
  }
35312
35312
  //#endregion
35313
35313
  //#region src/components/editor/renderers/slides-layout/slides-layout.tsx
35314
- var uJ = q.lazy(() => import("./reveal-component-BthxSdRc.js")), dJ = (e) => {
35314
+ var uJ = q.lazy(() => import("./reveal-component-CVsYlb9J.js")), dJ = (e) => {
35315
35315
  let t = (0, Y.c)(33), { layout: n, setLayout: r, cells: i, mode: a } = e, o = Xm(it), s = a === "read" || o, c = Xm(ke) > 1, [l, u] = (0, q.useState)(null), d;
35316
35316
  t[0] !== i || t[1] !== n ? (d = sW(i, n), t[0] = i, t[1] = n, t[2] = d) : d = t[2];
35317
35317
  let { slideCells: f, skippedIds: p, noOutputIds: m, slideTypes: h, startCellIndex: g } = d, _;
@@ -36589,22 +36589,26 @@ function OY({ embeds: e, materialize: t, payloads: n }) {
36589
36589
  n && o.push(r);
36590
36590
  }
36591
36591
  let s = new Set(o.map((e) => e.appId)), c = new Set(o.filter((e) => e.cells.some((e) => e.reactive)).map((e) => e.appId));
36592
- for (let e of o) for (let n of e.cells) {
36593
- let a = i.get(n);
36594
- if (!c.has(e.appId)) continue;
36595
- let o = r.get(e.appId);
36596
- o || (o = {
36597
- id: e.appId,
36598
- payloadBacked: !0,
36599
- cells: []
36600
- }, r.set(e.appId, o));
36601
- let s = o.cells.length, l = {
36602
- cellId: n.cellId,
36603
- output: n.outputHtml,
36604
- code: n.reactive ? n.code : "",
36605
- idx: s
36606
- };
36607
- n.reactive || (l.disabled = !0), o.cells.push(l), t && n.reactive && a?.setAttribute(sv.CELL_IDX, s.toString());
36592
+ for (let e of o) {
36593
+ for (let n of e.cells) {
36594
+ let a = i.get(n);
36595
+ if (!c.has(e.appId)) continue;
36596
+ let o = r.get(e.appId);
36597
+ o || (o = {
36598
+ id: e.appId,
36599
+ payloadBacked: !0,
36600
+ cells: []
36601
+ }, r.set(e.appId, o));
36602
+ let s = o.cells.length, l = {
36603
+ cellId: n.cellId,
36604
+ output: n.outputHtml,
36605
+ code: n.reactive ? n.code : "",
36606
+ idx: s
36607
+ };
36608
+ n.reactive || (l.disabled = !0), o.cells.push(l), t && n.reactive && a?.setAttribute(sv.CELL_IDX, s.toString());
36609
+ }
36610
+ let n = r.get(e.appId);
36611
+ n && e.dependencies?.length && (n.dependencies = [.../* @__PURE__ */ new Set([...n.dependencies ?? [], ...e.dependencies])]);
36608
36612
  }
36609
36613
  if (t) for (let t of e) {
36610
36614
  let e = t.getAttribute(sv.APP_ID);
@@ -36647,14 +36651,15 @@ function PY(e) {
36647
36651
  return r?.code ? r : null;
36648
36652
  }
36649
36653
  function FY(e) {
36650
- return [
36654
+ let t = [
36651
36655
  "import marimo",
36652
36656
  "app = marimo.App()",
36653
36657
  e.cells.map((e) => {
36654
36658
  let t = e.disabled ? "" : e.code, n = t ? t.split("\n").map((e) => ` ${e}`).join("\n") : " pass", r = n.includes("await ") ? "async def" : "def";
36655
36659
  return `${e.disabled ? "@app.cell(disabled=True)" : "@app.cell"}\n${r} __():\n${n}\n return`;
36656
36660
  }).join("\n")
36657
- ].join("\n");
36661
+ ];
36662
+ return e.dependencies?.length && t.unshift("# /// script", `# dependencies = ${JSON.stringify(e.dependencies)}`, "# ///"), t.join("\n");
36658
36663
  }
36659
36664
  function IY(e) {
36660
36665
  if (!e) return "";
@@ -36697,7 +36702,7 @@ function VY(e) {
36697
36702
  return null;
36698
36703
  }
36699
36704
  function HY(e) {
36700
- return se(e) ? e.schemaVersion === 1 && typeof e.appId == "string" && Array.isArray(e.cells) && e.cells.every(UY) : !1;
36705
+ return se(e) ? e.schemaVersion === 1 && typeof e.appId == "string" && (e.dependencies === void 0 || Array.isArray(e.dependencies) && e.dependencies.every((e) => typeof e == "string")) && Array.isArray(e.cells) && e.cells.every(UY) : !1;
36701
36706
  }
36702
36707
  function UY(e) {
36703
36708
  return se(e) ? typeof e.cellId == "string" && typeof e.code == "string" && typeof e.outputHtml == "string" && typeof e.outputMimetype == "string" && typeof e.reactive == "boolean" && typeof e.displayCode == "boolean" && typeof e.displayOutput == "boolean" : !1;
@@ -1,4 +1,4 @@
1
- import { O as e, nt as t, rt as n } from "./html-to-image-BhNoIBSU.js";
1
+ import { O as e, nt as t, rt as n } from "./html-to-image-BtFMe_Nq.js";
2
2
  import { u as r } from "./dist-3_o3T78I.js";
3
3
  import { b as i } from "./select-3qHpFKF9.js";
4
4
  import { n as a } from "./semaphore-89jsoHtS.js";
@@ -2,9 +2,9 @@ import { a as e } from "./rolldown-runtime-Cb76FRpK.js";
2
2
  import { c as t, g as n, h as r, m as i, t as a } from "./button-CKBkqR9J.js";
3
3
  import { t as o } from "./react-DMWcHin-.js";
4
4
  import { t as s } from "./compiler-runtime-CAH9RLw2.js";
5
- import { kt as c, st as l } from "./html-to-image-BhNoIBSU.js";
5
+ import { kt as c, st as l } from "./html-to-image-BtFMe_Nq.js";
6
6
  import { u } from "./dist-3_o3T78I.js";
7
- import { _n as d, c as f, ct as p, g as m, h, l as g, lt as _, n as v, o as y, r as b, t as x, u as S, ut as C, vn as w, xn as T } from "./common-BDlauhCU.js";
7
+ import { _n as d, c as f, ct as p, g as m, h, l as g, lt as _, n as v, o as y, r as b, t as x, u as S, ut as C, vn as w, xn as T } from "./common-Cv-4hMa0.js";
8
8
  import { R as E } from "./select-3qHpFKF9.js";
9
9
  import { Y as D } from "./dropdown-menu-DhCfcscX.js";
10
10
  import { t as O } from "./jsx-runtime-CpoKNRgu.js";
@@ -554,8 +554,9 @@ var P = class {
554
554
  getWsSyncURL(e) {
555
555
  return this.formatWsURL("/ws_sync", this.getSessionSearchParams(e));
556
556
  }
557
- getTerminalWsURL() {
558
- return this.formatWsURL("/terminal/ws");
557
+ getTerminalWsURL(e) {
558
+ let t = this.formatWsURL("/terminal/ws");
559
+ return e && (t.searchParams.set("rows", String(e.rows)), t.searchParams.set("cols", String(e.cols))), t;
559
560
  }
560
561
  getLSPURL(e) {
561
562
  if (e === "copilot") {
@@ -2,7 +2,7 @@ import { a as e } from "./rolldown-runtime-Cb76FRpK.js";
2
2
  import { g as t, h as n, m as r, o as i } from "./button-CKBkqR9J.js";
3
3
  import { t as a } from "./react-DMWcHin-.js";
4
4
  import { t as o } from "./compiler-runtime-CAH9RLw2.js";
5
- import { c as s, v as c } from "./toDate-D-Rx3ux5.js";
5
+ import { c as s, v as c } from "./toDate-CpXBeDq0.js";
6
6
  import { t as l } from "./jsx-runtime-CpoKNRgu.js";
7
7
  import { n as u } from "./error-banner-CsXbEEjo.js";
8
8
  import { t as d } from "./tooltip-Dt77sBeT.js";
@@ -11,7 +11,7 @@ import { j as p, n as ee } from "./useTheme-CVJ0UOf2.js";
11
11
  import { c as m } from "./arrays-CN1djC4k.js";
12
12
  import { t as te } from "./objects-CzUgoMIF.js";
13
13
  import { t as h } from "./useAsyncData-CH6-CgJF.js";
14
- import { a as ne, i as re, n as ie, t as g } from "./formats-CJMVUfb3.js";
14
+ import { a as ne, i as re, n as ie, t as g } from "./formats-CslNOKy0.js";
15
15
  import { A as ae, n as oe } from "./vega-loader.browser-DEggZzni.js";
16
16
  import { t as se } from "./react-vega-DSD5aT7_.js";
17
17
  import { a as ce, n as _ } from "./loader-VZ__bv4g.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/islands",
3
- "version": "0.24.3-dev4",
3
+ "version": "0.24.3-dev9",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -215,6 +215,11 @@ export const ColumnVisibilityDropdown = <TData,>({
215
215
  index === list.pinnedCount &&
216
216
  list.pinnedCount > 0 &&
217
217
  list.pinnedCount < list.visibleOptions.length;
218
+ const label = (
219
+ <span className="truncate" title={option.label}>
220
+ {option.label}
221
+ </span>
222
+ );
218
223
  return (
219
224
  <React.Fragment key={option.value}>
220
225
  {isSectionBoundary && <CommandSeparator />}
@@ -225,15 +230,16 @@ export const ColumnVisibilityDropdown = <TData,>({
225
230
  className="flex items-center gap-1.5 cursor-pointer"
226
231
  >
227
232
  {dataType === undefined ? (
228
- <span>{option.label}</span>
233
+ label
229
234
  ) : (
230
235
  <ColumnName
231
- columnName={option.label}
236
+ className="min-w-0"
237
+ columnName={label}
232
238
  dataType={dataType}
233
239
  />
234
240
  )}
235
241
  {!option.disabled && (
236
- <span className="ml-auto flex items-center gap-0.5">
242
+ <span className="ml-auto flex shrink-0 items-center gap-0.5">
237
243
  <ShowOnlyColumnButton
238
244
  table={table}
239
245
  columnIds={[option.value]}
@@ -101,18 +101,20 @@ export const ColumnPreviewContainer: React.FC<{
101
101
  export const ColumnName = ({
102
102
  columnName,
103
103
  dataType,
104
+ className,
104
105
  }: {
105
106
  columnName: React.ReactNode;
106
107
  dataType: DataType;
108
+ className?: string;
107
109
  }) => {
108
110
  const resolvedDataType = resolveDataType(dataType);
109
111
  const Icon = DATA_TYPE_ICON[resolvedDataType];
110
112
  const color = getDataTypeColor(resolvedDataType);
111
113
 
112
114
  return (
113
- <div className="flex flex-row items-center gap-1.5">
115
+ <div className={cn("flex flex-row items-center gap-1.5", className)}>
114
116
  <Icon
115
- className={`w-4 h-4 p-0.5 rounded-sm stroke-card-foreground ${color}`}
117
+ className={`w-4 h-4 shrink-0 p-0.5 rounded-sm stroke-card-foreground ${color}`}
116
118
  />
117
119
  {columnName}
118
120
  </div>
@@ -31,6 +31,7 @@ import {
31
31
  import { Constants } from "@/core/constants";
32
32
  import { useRequestClient } from "@/core/network/requests";
33
33
  import type { TutorialId } from "@/core/network/types";
34
+ import { Banner } from "@/plugins/impl/common/error-banner";
34
35
  import { openNotebook } from "@/utils/links";
35
36
  import { Objects } from "@/utils/objects";
36
37
  import { MarimoPlusIcon } from "../icons/marimo-icons";
@@ -186,6 +187,22 @@ export const ResourceLinks: React.FC = () => {
186
187
  );
187
188
  };
188
189
 
190
+ /**
191
+ * Shown when the workspace scan stopped early, so the file list the user is
192
+ * looking at is missing files and folders.
193
+ */
194
+ export const TruncatedWorkspaceBanner: React.FC<{
195
+ fileCount: number | undefined;
196
+ }> = ({ fileCount }) => {
197
+ return (
198
+ <Banner kind="warn" className="rounded p-4">
199
+ Showing {fileCount} files. Some files and folders were skipped because
200
+ your workspace is large or deeply nested. Start marimo from a subfolder to
201
+ see them.
202
+ </Banner>
203
+ );
204
+ };
205
+
189
206
  export const Header: React.FC<{
190
207
  Icon: React.FC<React.SVGProps<SVGSVGElement>>;
191
208
  control?: React.ReactNode;
@@ -4,6 +4,7 @@ import { SearchIcon } from "lucide-react";
4
4
  import type React from "react";
5
5
  import { Suspense, useMemo, useState } from "react";
6
6
  import { ErrorBoundary } from "@/components/editor/boundary/ErrorBoundary";
7
+ import { TruncatedWorkspaceBanner } from "@/components/home/components";
7
8
  import { Spinner } from "@/components/icons/spinner";
8
9
  import { Card, CardContent } from "@/components/ui/card";
9
10
  import { Input } from "@/components/ui/input";
@@ -119,10 +120,7 @@ const GalleryPage: React.FC = () => {
119
120
  <ErrorBoundary>
120
121
  <div className="flex flex-col gap-2">
121
122
  {workspace.hasMore && (
122
- <Banner kind="warn" className="rounded p-4">
123
- Showing first {workspace.fileCount} files. Your workspace has
124
- more files.
125
- </Banner>
123
+ <TruncatedWorkspaceBanner fileCount={workspace.fileCount} />
126
124
  )}
127
125
  {formattedFiles.length > SEARCH_THRESHOLD && (
128
126
  <Input
@@ -67,6 +67,7 @@ import {
67
67
  Header,
68
68
  OpenTutorialDropDown,
69
69
  ResourceLinks,
70
+ TruncatedWorkspaceBanner,
70
71
  } from "../home/components";
71
72
  import {
72
73
  expandedFoldersAtom,
@@ -196,10 +197,7 @@ const WorkspaceNotebooks: React.FC<{ onRefreshRecents: () => void }> = ({
196
197
  <WorkspaceContext value={workspaceContextValue}>
197
198
  <div className="flex flex-col gap-2">
198
199
  {workspace.hasMore && (
199
- <Banner kind="warn" className="rounded p-4">
200
- Showing first {workspace.fileCount} files. Your workspace has more
201
- files.
202
- </Banner>
200
+ <TruncatedWorkspaceBanner fileCount={workspace.fileCount} />
203
201
  )}
204
202
  <Header
205
203
  Icon={BookTextIcon}
@@ -254,7 +254,9 @@ const TerminalComponent: React.FC<TerminalComponentProps> = ({
254
254
  try {
255
255
  await waitForConnectionOpen();
256
256
 
257
- const socket = new WebSocket(runtimeManager.getTerminalWsURL());
257
+ // Size the PTY before the shell draws its first prompt.
258
+ fitAddon.fit();
259
+ const socket = new WebSocket(runtimeManager.getTerminalWsURL(terminal));
258
260
  const attachAddon = new AttachAddon(socket);
259
261
  terminal.loadAddon(attachAddon);
260
262
  wsRef.current = socket;
@@ -270,9 +272,7 @@ const TerminalComponent: React.FC<TerminalComponentProps> = ({
270
272
 
271
273
  const handleOpen = () => {
272
274
  updateReadyState();
273
- // Send initial dimensions: the mount-time fit() may have fired
274
- // before the WS was OPEN, dropping the resize message and leaving
275
- // the PTY at its default 0x0 winsize.
275
+ // The container may have resized while the connection was opening.
276
276
  fitAddon.fit();
277
277
  if (terminal.cols > 0 && terminal.rows > 0) {
278
278
  socket.send(
@@ -19,6 +19,13 @@ import {
19
19
  } from "../parse";
20
20
  import { createMockIslandElement, createMockIslands } from "./test-utils.tsx";
21
21
 
22
+ function islandSnapshotPath(filename: string): string {
23
+ return new URL(
24
+ `../../../../../tests/_islands/snapshots/${filename}`,
25
+ import.meta.url,
26
+ ).pathname.replace(/^\/@fs/, "");
27
+ }
28
+
22
29
  function createPayloadCell(
23
30
  overrides: Partial<{
24
31
  cellId: string;
@@ -47,6 +54,7 @@ function appendPayload(
47
54
  payload: {
48
55
  schemaVersion: number;
49
56
  appId: string;
57
+ dependencies?: unknown;
50
58
  cells: ReturnType<typeof createPayloadCell>[];
51
59
  },
52
60
  ) {
@@ -58,6 +66,33 @@ function appendPayload(
58
66
  }
59
67
 
60
68
  describe("createMarimoFile", () => {
69
+ it("should serialize dependencies as top-level script metadata", () => {
70
+ const file = createMarimoFile({
71
+ dependencies: ['cowsay==6.1; sys_platform == "emscripten"'],
72
+ cells: [{ code: "import cowsay" }],
73
+ });
74
+ expect(file).toBe(
75
+ [
76
+ "# /// script",
77
+ '# dependencies = ["cowsay==6.1; sys_platform == \\"emscripten\\""]',
78
+ "# ///",
79
+ "import marimo",
80
+ "app = marimo.App()",
81
+ "@app.cell",
82
+ "def __():",
83
+ " import cowsay",
84
+ " return",
85
+ ].join("\n"),
86
+ );
87
+ });
88
+
89
+ it("should omit metadata for empty dependencies", () => {
90
+ const cells = [{ code: "import cowsay" }];
91
+ expect(createMarimoFile({ cells, dependencies: [] })).toBe(
92
+ createMarimoFile({ cells }),
93
+ );
94
+ });
95
+
61
96
  it("should return a string", () => {
62
97
  const app = {
63
98
  cells: [
@@ -736,13 +771,7 @@ describe("parseMarimoIslandApps", () => {
736
771
  });
737
772
 
738
773
  it("should parse Python-generated island payload snapshots", () => {
739
- const html = readFileSync(
740
- new URL(
741
- "../../../../../tests/_islands/snapshots/html-payload.txt",
742
- import.meta.url,
743
- ).pathname.replace(/^\/@fs/, ""),
744
- "utf8",
745
- );
774
+ const html = readFileSync(islandSnapshotPath("html-payload.txt"), "utf8");
746
775
  container.innerHTML = html;
747
776
 
748
777
  const result = parseMarimoIslandApps(container);
@@ -775,6 +804,108 @@ describe("parseMarimoIslandApps", () => {
775
804
  expect(islands[2].getAttribute(ISLAND_DATA_ATTRIBUTES.CELL_IDX)).toBe("1");
776
805
  });
777
806
 
807
+ it("should restore metadata from a Python-generated dependency payload", () => {
808
+ container.innerHTML = readFileSync(
809
+ islandSnapshotPath("body-dependencies.txt"),
810
+ "utf8",
811
+ );
812
+
813
+ const probed = parseMarimoIslandApps(container, { materialize: false });
814
+ const apps = parseMarimoIslandApps(container);
815
+
816
+ expect(probed).toEqual(apps);
817
+ expect(apps).toEqual([
818
+ {
819
+ id: "main",
820
+ payloadBacked: true,
821
+ dependencies: [
822
+ 'cowsay==6.1; sys_platform == "emscripten"',
823
+ "rich[jupyter]>=13",
824
+ "desktop; sys_platform != 'emscripten'",
825
+ "older-python; python_version < '3.13'",
826
+ "newer-python; python_version >= '3.13'",
827
+ ],
828
+ cells: [{ cellId: "Hbol", code: "import cowsay", output: "", idx: 0 }],
829
+ },
830
+ ]);
831
+ // The Python Pyodide test reads this file with the real metadata parser.
832
+ expect(createMarimoFile(apps[0])).toBe(
833
+ readFileSync(islandSnapshotPath("notebook-dependencies.txt"), "utf8"),
834
+ );
835
+ });
836
+
837
+ it("should carry dependencies from payloads into each generated notebook", () => {
838
+ for (const [appId, dependencies] of [
839
+ ["app1", ["cowsay==6.1"]],
840
+ ["app2", ["rich[jupyter]>=13"]],
841
+ ] as const) {
842
+ container.appendChild(
843
+ createMockIslandElement({ appId, cellId: "cell-1" }),
844
+ );
845
+ appendPayload(container, {
846
+ schemaVersion: 1,
847
+ appId,
848
+ dependencies,
849
+ cells: [createPayloadCell()],
850
+ });
851
+ }
852
+
853
+ const apps = parseMarimoIslandApps(container);
854
+ expect(apps.map((app) => [app.id, app.dependencies])).toEqual([
855
+ ["app1", ["cowsay==6.1"]],
856
+ ["app2", ["rich[jupyter]>=13"]],
857
+ ]);
858
+ expect(createMarimoFile(apps[0])).toContain(
859
+ '# /// script\n# dependencies = ["cowsay==6.1"]\n# ///\n',
860
+ );
861
+ });
862
+
863
+ it.each([null, "cowsay", [123], ["cowsay", null]])(
864
+ "should ignore payloads with malformed dependencies: %j",
865
+ (dependencies) => {
866
+ const island = createMockIslandElement({
867
+ appId: "app1",
868
+ cellId: "cell-1",
869
+ code: "import cowsay",
870
+ innerHTML: "<div>dom</div>",
871
+ });
872
+ island.setAttribute(ISLAND_DATA_ATTRIBUTES.REACTIVE, "true");
873
+ container.appendChild(island);
874
+ appendPayload(container, {
875
+ schemaVersion: 1,
876
+ appId: "app1",
877
+ dependencies,
878
+ cells: [createPayloadCell()],
879
+ });
880
+
881
+ expect(parseMarimoIslandApps(container)).toEqual([
882
+ {
883
+ id: "app1",
884
+ cells: [{ code: "import cowsay", output: "<div>dom</div>", idx: 0 }],
885
+ },
886
+ ]);
887
+ },
888
+ );
889
+
890
+ it("should merge dependencies from payloads belonging to the same app", () => {
891
+ for (const [cellId, dependencies] of [
892
+ ["cell-1", ["cowsay"]],
893
+ ["cell-2", ["cowsay", "rich"]],
894
+ ] as const) {
895
+ container.appendChild(createMockIslandElement({ appId: "app1", cellId }));
896
+ appendPayload(container, {
897
+ schemaVersion: 1,
898
+ appId: "app1",
899
+ dependencies,
900
+ cells: [createPayloadCell({ cellId })],
901
+ });
902
+ }
903
+
904
+ expect(
905
+ parseMarimoIslandApps(container).map((app) => app.dependencies),
906
+ ).toEqual([["cowsay", "rich"]]);
907
+ });
908
+
778
909
  it("should fall back to DOM islands for unsupported payload versions", () => {
779
910
  const island = createMockIslandElement({
780
911
  appId: "app1",
@@ -990,6 +1121,7 @@ describe("parseMarimoIslandApps", () => {
990
1121
  outputHtml: "<div>payload only</div>",
991
1122
  }),
992
1123
  ],
1124
+ dependencies: ["cowsay"],
993
1125
  });
994
1126
 
995
1127
  const result = parseMarimoIslandApps(container);
@@ -1076,6 +1208,7 @@ describe("parseMarimoIslandApps", () => {
1076
1208
  reactive: false,
1077
1209
  }),
1078
1210
  ],
1211
+ dependencies: ["cowsay"],
1079
1212
  });
1080
1213
 
1081
1214
  const result = parseMarimoIslandApps(container);
@@ -30,6 +30,8 @@ export interface MarimoIslandApp {
30
30
  * Whether cells came from a supported JSON payload instead of DOM parsing.
31
31
  */
32
32
  payloadBacked?: boolean;
33
+ /** Explicit notebook dependencies to install before starting the app. */
34
+ dependencies?: string[];
33
35
  /**
34
36
  * Cells in the app.
35
37
  */
@@ -62,6 +64,7 @@ interface MarimoIslandCell {
62
64
  interface MarimoIslandPayload {
63
65
  schemaVersion: 1;
64
66
  appId: string;
67
+ dependencies?: string[];
65
68
  cells: MarimoIslandPayloadCell[];
66
69
  }
67
70
 
@@ -235,6 +238,12 @@ function parsePayloadBackedApps({
235
238
  embed?.setAttribute(ISLAND_DATA_ATTRIBUTES.CELL_IDX, idx.toString());
236
239
  }
237
240
  }
241
+ const app = apps.get(payload.appId);
242
+ if (app && payload.dependencies?.length) {
243
+ app.dependencies = [
244
+ ...new Set([...(app.dependencies ?? []), ...payload.dependencies]),
245
+ ];
246
+ }
238
247
  }
239
248
 
240
249
  // A supported payload is the runtime source for its app. Extra same-app DOM
@@ -371,6 +380,7 @@ export function parseIslandElement(
371
380
 
372
381
  export function createMarimoFile(app: {
373
382
  cells: { code: string; disabled?: boolean }[];
383
+ dependencies?: string[];
374
384
  }): string {
375
385
  const lines = [
376
386
  "import marimo",
@@ -402,6 +412,13 @@ export function createMarimoFile(app: {
402
412
  .join("\n"),
403
413
  ];
404
414
 
415
+ if (app.dependencies?.length) {
416
+ lines.unshift(
417
+ "# /// script",
418
+ `# dependencies = ${JSON.stringify(app.dependencies)}`,
419
+ "# ///",
420
+ );
421
+ }
405
422
  return lines.join("\n");
406
423
  }
407
424
 
@@ -507,6 +524,9 @@ function isMarimoIslandPayload(
507
524
  return (
508
525
  payload.schemaVersion === 1 &&
509
526
  typeof payload.appId === "string" &&
527
+ (payload.dependencies === undefined ||
528
+ (Array.isArray(payload.dependencies) &&
529
+ payload.dependencies.every((dep) => typeof dep === "string"))) &&
510
530
  Array.isArray(payload.cells) &&
511
531
  payload.cells.every(isMarimoIslandPayloadCell)
512
532
  );
@@ -276,6 +276,17 @@ describe("RuntimeManager", () => {
276
276
  });
277
277
 
278
278
  describe("getTerminalWsURL", () => {
279
+ it("should include dimensions in the terminal handshake", () => {
280
+ const runtime = new RuntimeManager(mockConfig);
281
+ const url = runtime.getTerminalWsURL({ rows: 30, cols: 140 });
282
+
283
+ expect(Object.fromEntries(url.searchParams)).toEqual({
284
+ access_token: "test-token",
285
+ rows: "30",
286
+ cols: "140",
287
+ });
288
+ });
289
+
279
290
  it("should return terminal WebSocket URL", () => {
280
291
  const runtime = new RuntimeManager(mockConfig);
281
292
  const url = runtime.getTerminalWsURL();
@@ -183,8 +183,13 @@ export class RuntimeManager {
183
183
  /**
184
184
  * The WebSocket URL of the terminal.
185
185
  */
186
- getTerminalWsURL(): URL {
187
- return this.formatWsURL("/terminal/ws");
186
+ getTerminalWsURL(size?: { rows: number; cols: number }): URL {
187
+ const url = this.formatWsURL("/terminal/ws");
188
+ if (size) {
189
+ url.searchParams.set("rows", String(size.rows));
190
+ url.searchParams.set("cols", String(size.cols));
191
+ }
192
+ return url;
188
193
  }
189
194
 
190
195
  /**