@marimo-team/islands 0.25.3-dev526 → 0.25.3-dev527

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,14 +3,14 @@ import { h as t, t as n } from "./button-qQhINE7z.js";
3
3
  import { t as r } from "./react-Bgs_wQh3.js";
4
4
  import { t as i } from "./compiler-runtime-C5KHtL5D.js";
5
5
  import { t as a } from "./copy-icon-BI7vZHEW.js";
6
- import { $t as o, D as s, I as c, K as l, O as u, P as d, i as f, in as p, n as m } from "./error-entries-BoO7a296.js";
7
- import { n as h, t as ee } from "./globals-CKy6TO_c.js";
6
+ import { $t as o, D as s, I as c, K as l, O as u, P as d, i as f, in as p, n as m } from "./error-entries-BKlEsuk4.js";
7
+ import { n as h, t as ee } from "./globals-DINJIKOa.js";
8
8
  import { r as g } from "./assertNever-DywGMo-S.js";
9
9
  import { t as _ } from "./jsx-runtime-D8btoEHk.js";
10
10
  import { Ct as te, m as v, zt as ne } from "./use-restore-focus-DaTVz6S6.js";
11
11
  import { a as re, i as ie, n as ae, r as oe } from "./dialog-Ic6dh09m.js";
12
12
  import { t as se } from "./useAsyncData-P5-Oovhq.js";
13
- import { t as ce } from "./code-visibility-BL-_Aqt5.js";
13
+ import { t as ce } from "./code-visibility-VztFTu0Q.js";
14
14
  //#region src/components/ui/skeleton.tsx
15
15
  var y = /* @__PURE__ */ e(r(), 1), b = i(), x = _(), le = (e) => {
16
16
  let n = (0, b.c)(8), r, i;
@@ -14,7 +14,7 @@ import { t as F } from "./jsx-runtime-D8btoEHk.js";
14
14
  import { d as ae, r as I } from "./use-restore-focus-DaTVz6S6.js";
15
15
  import { t as oe } from "./useEvent-BoN7U38T.js";
16
16
  import { n as L, t as se } from "./objectWithoutPropertiesLoose-BRDcTsfB.js";
17
- import { t as ce } from "./ErrorBoundary-BWKznbDE.js";
17
+ import { t as ce } from "./ErrorBoundary-CmQmjRni.js";
18
18
  import { A as le, C as ue, D as de, E as fe, F as pe, I as me, L as he, M as ge, N as R, O as z, P as _e, R as ve, S as ye, T as be, _ as xe, a as Se, b as B, c as Ce, d as we, f as V, g as Te, h as Ee, i as De, j as H, k as Oe, l as ke, m as Ae, n as je, o as Me, p as Ne, r as U, s as Pe, t as Fe, u as Ie, v as Le, w as Re, x as ze, y as Be, z as Ve } from "./data-grid-types-DIX_pCco.js";
19
19
  //#region ../node_modules/.pnpm/@emotion+memoize@0.9.0/node_modules/@emotion/memoize/dist/emotion-memoize.esm.js
20
20
  function He(e) {
@@ -7061,7 +7061,7 @@ function ds(e, t, n, r, i) {
7061
7061
  }
7062
7062
  //#endregion
7063
7063
  //#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.17.21_marked@15.0.12_react-dom@19.3.1_57c124ac5a994dbbf13fd11838cf9ba9/node_modules/@glideapps/glide-data-grid/dist/esm/data-editor/data-editor.js
7064
- var fs = /* @__PURE__ */ e(Tr(), 1), ps = /* @__PURE__ */ e(kr(), 1), ms = W.lazy(async () => await import("./data-grid-overlay-editor-DhoaVlcZ.js")), hs = 0;
7064
+ var fs = /* @__PURE__ */ e(Tr(), 1), ps = /* @__PURE__ */ e(kr(), 1), ms = W.lazy(async () => await import("./data-grid-overlay-editor-DobPpzpl.js")), hs = 0;
7065
7065
  function gs(e) {
7066
7066
  return (0, fs.default)((0, ps.default)((0, ps.default)(e).filter((e) => e.span !== void 0).map((e) => (0, ao.default)((e.span?.[0] ?? 0) + 1, (e.span?.[1] ?? 0) + 1))));
7067
7067
  }
@@ -9284,7 +9284,7 @@ function Ys(e, t, n, r, i) {
9284
9284
  }
9285
9285
  //#endregion
9286
9286
  //#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.17.21_marked@15.0.12_react-dom@19.3.1_57c124ac5a994dbbf13fd11838cf9ba9/node_modules/@glideapps/glide-data-grid/dist/esm/cells/number-cell.js
9287
- var Xs = W.lazy(async () => await import("./number-overlay-editor-DOQnFTnc.js")), Zs = {
9287
+ var Xs = W.lazy(async () => await import("./number-overlay-editor-BHPYSTMI.js")), Zs = {
9288
9288
  getAccessibilityString: (e) => e.data?.toString() ?? "",
9289
9289
  kind: U.Number,
9290
9290
  needsHover: (e) => e.hoverEffect === !0,
@@ -1,6 +1,6 @@
1
1
  import { h as e } from "./tooltip-UzJukb3F.js";
2
2
  import { Ct as t } from "./use-restore-focus-DaTVz6S6.js";
3
- import { r as n } from "./code-visibility-BL-_Aqt5.js";
3
+ import { r as n } from "./code-visibility-VztFTu0Q.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",
@@ -9,7 +9,7 @@ import { a as D, i as ne, o as re, r as O, s as k, t as ie } from "./useLifecycl
9
9
  import { a as ae, c as oe, i as se, n as ce, o as le, r as ue, s as de, t as fe } from "./select-CDUxhHZg.js";
10
10
  import { J as pe, X as me, ht as he } from "./dropdown-menu-Dhv4fcNl.js";
11
11
  import { c as ge, l as _e, n as ve } from "./config-qTaTHnpE.js";
12
- import { $ as A, A as j, At as ye, Bt as be, C as xe, D as Se, E as Ce, F as we, G as Te, Gt as Ee, I as De, Jt as Oe, L as ke, Lt as Ae, Mt as je, N as Me, Ot as Ne, Rt as Pe, S as Fe, St as Ie, Ut as Le, Vt as Re, W as ze, Wt as Be, Yt as Ve, _t as He, a as Ue, at as We, c as Ge, ct as Ke, dt as qe, en as Je, et as Ye, ft as Xe, g as Ze, gt as Qe, it as $e, k as et, lt as tt, m as nt, nn as rt, o as it, ot as at, p as ot, pt as st, qt as ct, s as lt, st as ut, tt as dt, ut as ft, v as pt, w as mt, y as ht } from "./error-entries-BoO7a296.js";
12
+ import { $ as A, A as j, At as ye, Bt as be, C as xe, D as Se, E as Ce, F as we, G as Te, Gt as Ee, I as De, Jt as Oe, L as ke, Lt as Ae, Mt as je, N as Me, Ot as Ne, Rt as Pe, S as Fe, St as Ie, Ut as Le, Vt as Re, W as ze, Wt as Be, Yt as Ve, _t as He, a as Ue, at as We, c as Ge, ct as Ke, dt as qe, en as Je, et as Ye, ft as Xe, g as Ze, gt as Qe, it as $e, k as et, lt as tt, m as nt, nn as rt, o as it, ot as at, p as ot, pt as st, qt as ct, s as lt, st as ut, tt as dt, ut as ft, v as pt, w as mt, y as ht } from "./error-entries-BKlEsuk4.js";
13
13
  import { n as gt } from "./assertNever-DywGMo-S.js";
14
14
  import { t as _t } from "./react-dom-DdqGVp5N.js";
15
15
  import { t as vt } from "./jsx-runtime-D8btoEHk.js";
package/dist/main.js CHANGED
@@ -3,20 +3,20 @@ import { _ as a, a as o, d 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-Bgs_wQh3.js";
4
4
  import { t as b } from "./compiler-runtime-C5KHtL5D.js";
5
5
  import { i as x, n as S, r as C, t as w } from "./copy-icon-BI7vZHEW.js";
6
- import { B as T, Bt as E, Ct as D, E as O, F as k, Ft as A, I as j, It as M, L as N, Lt as P, M as F, Mt as I, O as L, Ot as R, P as z, R as B, Rt as ee, St as V, Ut as te, Vt as ne, Wt as re, X as ie, Z as ae, _ as oe, _t as se, a as ce, at as le, b as ue, bt as de, c as fe, ct as pe, dt as me, i as he, it as ge, j as _e, kt as ve, lt as ye, mt as be, n as xe, o as Se, ot as Ce, q as we, rt as Te, ut as Ee, vt as De, yt as Oe, z as ke, zt as Ae } from "./html-to-image-rvMfQD46.js";
6
+ import { B as T, Bt as E, Ct as D, E as O, F as k, Ft as A, I as j, It as M, L as N, Lt as P, M as F, Mt as I, O as L, Ot as R, P as z, R as B, Rt as ee, St as V, Ut as te, Vt as ne, Wt as re, X as ie, Z as ae, _ as oe, _t as se, a as ce, at as le, b as ue, bt as de, c as fe, ct as pe, dt as me, i as he, it as ge, j as _e, kt as ve, lt as ye, mt as be, n as xe, o as Se, ot as Ce, q as we, rt as Te, ut as Ee, vt as De, yt as Oe, z as ke, zt as Ae } from "./html-to-image-CNM0ZSFD.js";
7
7
  import { a as je, f as Me, h as Ne, i as Pe, m as Fe, n as Ie, o as Le, r as Re, t as ze } from "./tooltip-UzJukb3F.js";
8
8
  import { D as Be, E as Ve, S as He, T as Ue, _ as We, a as Ge, c as Ke, d as qe, f as Je, g as Ye, h as Xe, i as Ze, l as Qe, m as $e, n as et, o as tt, p as nt, r as rt, s as it, t as at, u as ot, v as st, w as ct, x as lt, y as ut } from "./spec-ZAt4P01J.js";
9
- import { $ as dt, $t as ft, A as pt, An as mt, At as ht, B as gt, Bt as _t, C as vt, D as yt, Dn as bt, Dt as xt, E as St, En as Ct, Et as wt, F as Tt, Ft as Et, G as Dt, Gt as Ot, H as kt, Ht as At, I as jt, It as Mt, J as Nt, Jt as Pt, K as Ft, Kt as It, L as Lt, Lt as Rt, M as zt, Mn as Bt, Mt as Vt, N as Ht, Nt as Ut, O as Wt, On as Gt, Ot as Kt, P as qt, Pt as Jt, Q as Yt, Qt as Xt, R as Zt, Rt as Qt, S as $t, Sn as en, St as tn, T as nn, Tn as rn, Tt as an, U as on, Ut as sn, V as cn, Vt as ln, W as un, Wt as dn, X as fn, Xt as pn, Y as mn, Yt as hn, Z as gn, Zt as _n, _ as vn, _n as yn, _t as bn, an as xn, at as Sn, b as Cn, bn as wn, bt as Tn, c as En, cn as Dn, ct as On, d as kn, dn as An, dt as jn, en as Mn, f as Nn, fn as Pn, ft as Fn, g as In, gn as Ln, gt as Rn, h as zn, hn as Bn, ht as Vn, in as Hn, it as Un, j as Wn, jn as Gn, jt as Kn, k as qn, kn as Jn, kt as Yn, ln as Xn, lt as Zn, m as Qn, mn as $n, mt as er, nn as tr, on as nr, ot as rr, p as ir, pn as ar, pt as or, q as sr, qt as cr, r as lr, rn as ur, rt as dr, sn as fr, st as pr, t as mr, tn as hr, u as gr, un as _r, ut as vr, v as yr, vn as br, vt as xr, w as Sr, wn as Cr, x as wr, xn as Tr, xt as Er, y as Dr, yn as Or, yt as kr, z as Ar, zt as jr } from "./common-YLSZXvrL.js";
9
+ import { $ as dt, $t as ft, A as pt, An as mt, At as ht, B as gt, Bt as _t, C as vt, D as yt, Dn as bt, Dt as xt, E as St, En as Ct, Et as wt, F as Tt, Ft as Et, G as Dt, Gt as Ot, H as kt, Ht as At, I as jt, It as Mt, J as Nt, Jt as Pt, K as Ft, Kt as It, L as Lt, Lt as Rt, M as zt, Mn as Bt, Mt as Vt, N as Ht, Nt as Ut, O as Wt, On as Gt, Ot as Kt, P as qt, Pt as Jt, Q as Yt, Qt as Xt, R as Zt, Rt as Qt, S as $t, Sn as en, St as tn, T as nn, Tn as rn, Tt as an, U as on, Ut as sn, V as cn, Vt as ln, W as un, Wt as dn, X as fn, Xt as pn, Y as mn, Yt as hn, Z as gn, Zt as _n, _ as vn, _n as yn, _t as bn, an as xn, at as Sn, b as Cn, bn as wn, bt as Tn, c as En, cn as Dn, ct as On, d as kn, dn as An, dt as jn, en as Mn, f as Nn, fn as Pn, ft as Fn, g as In, gn as Ln, gt as Rn, h as zn, hn as Bn, ht as Vn, in as Hn, it as Un, j as Wn, jn as Gn, jt as Kn, k as qn, kn as Jn, kt as Yn, ln as Xn, lt as Zn, m as Qn, mn as $n, mt as er, nn as tr, on as nr, ot as rr, p as ir, pn as ar, pt as or, q as sr, qt as cr, r as lr, rn as ur, rt as dr, sn as fr, st as pr, t as mr, tn as hr, u as gr, un as _r, ut as vr, v as yr, vn as br, vt as xr, w as Sr, wn as Cr, x as wr, xn as Tr, xt as Er, y as Dr, yn as Or, yt as kr, z as Ar, zt as jr } from "./common-CvUqRXW6.js";
10
10
  import { a as Mr, n as Nr, s as Pr, t as Fr } from "./useLifecycle-DTMczKkf.js";
11
11
  import { t as Ir } from "./check-jchHMCfs.js";
12
12
  import { A as Lr, C as Rr, D as zr, M as Br, O as Vr, a as Hr, c as Ur, d as Wr, i as Gr, k as Kr, l as qr, n as Jr, o as Yr, r as Xr, s as Zr, t as Qr, w as $r, x as ei } from "./select-CDUxhHZg.js";
13
13
  import { $ as ti, At as ni, B as ri, C as ii, Cn as ai, G as oi, Nt as si, Q as ci, Sn as li, T as ui, V as di, X as fi, Y as pi, Z as mi, _ as hi, a as gi, b as _i, c as vi, f as yi, g as bi, h as xi, i as Si, m as Ci, mt as wi, n as Ti, p as Ei, r as Di, rt as Oi, s as ki, t as Ai, v as ji, vt as Mi, w as Ni, xn as Pi, y as Fi } from "./dropdown-menu-Dhv4fcNl.js";
14
14
  import { c as Ii, i as Li, l as Ri, o as zi, s as Bi, t as Vi } from "./config-qTaTHnpE.js";
15
- import { $t as Hi, At as Ui, B as Wi, Ct as Gi, D as Ki, Dt as qi, Ft as Ji, G as Yi, It as Xi, J as Zi, K as Qi, Kt as $i, N as ea, Nt as ta, Pt as na, Qt as ra, R as ia, Rt as aa, St as oa, V as sa, X as ca, Xt as la, Y as ua, Yt as da, Z as fa, Zt as pa, _ as ma, bt as ha, f as ga, g as _a, h as va, ht as ya, l as ba, m as xa, mt as Sa, nt as Ca, q as wa, rt as Ta, s as Ea, tn as Da, v as Oa, vt as ka, xt as Aa, z as ja } from "./error-entries-BoO7a296.js";
16
- import { a as Ma, d as Na, i as Pa, n as Fa, o as Ia, r as La, s as Ra, t as za, u as Ba } from "./process-output-BXff1USQ.js";
15
+ import { $t as Hi, At as Ui, B as Wi, Ct as Gi, D as Ki, Dt as qi, Ft as Ji, G as Yi, It as Xi, J as Zi, K as Qi, Kt as $i, N as ea, Nt as ta, Pt as na, Qt as ra, R as ia, Rt as aa, St as oa, V as sa, X as ca, Xt as la, Y as ua, Yt as da, Z as fa, Zt as pa, _ as ma, bt as ha, f as ga, g as _a, h as va, ht as ya, l as ba, m as xa, mt as Sa, nt as Ca, q as wa, rt as Ta, s as Ea, tn as Da, v as Oa, vt as ka, xt as Aa, z as ja } from "./error-entries-BKlEsuk4.js";
16
+ import { a as Ma, d as Na, i as Pa, n as Fa, o as Ia, r as La, s as Ra, t as za, u as Ba } from "./process-output-DthYR2Te.js";
17
17
  import { t as Va } from "./pencil-DVYzq-iR.js";
18
18
  import { a as Ha, c as Ua, d as Wa, f as Ga, i as Ka, l as qa, r as Ja } from "./glide-utils-Cn2_NadX.js";
19
- import { n as Ya, t as Xa } from "./globals-CKy6TO_c.js";
19
+ import { n as Ya, t as Xa } from "./globals-DINJIKOa.js";
20
20
  import { a as Za, i as Qa, n as $a, r as eo, s as to, t as no } from "./assertNever-DywGMo-S.js";
21
21
  import { t as ro } from "./react-dom-DdqGVp5N.js";
22
22
  import { t as io } from "./jsx-runtime-D8btoEHk.js";
@@ -40,10 +40,10 @@ import { n as nc, t as rc } from "./esm-Bwp_FHP0.js";
40
40
  import { p as ic } from "./dist-DpYpG8Yc.js";
41
41
  import { t as ac } from "./useAsyncData-P5-Oovhq.js";
42
42
  import { n as oc, r as sc, t as cc } from "./useDeepCompareMemoize-CmNbQ9TT.js";
43
- import { t as lc } from "./ErrorBoundary-BWKznbDE.js";
43
+ import { t as lc } from "./ErrorBoundary-CmQmjRni.js";
44
44
  import { G as uc, W as dc } from "./vega-loader.browser-Co9gYE8Z.js";
45
45
  import { a as fc, n as pc } from "./loader-Bin_dutt.js";
46
- import { a as mc, c as hc, i as gc, l as _c, o as vc, s as yc, t as bc } from "./code-visibility-BL-_Aqt5.js";
46
+ import { a as mc, c as hc, i as gc, l as _c, o as vc, s as yc, t as bc } from "./code-visibility-VztFTu0Q.js";
47
47
  import { t as xc } from "./esm-B9n0caHs.js";
48
48
  //#region ../node_modules/.pnpm/iconify-icon@2.3.0/node_modules/iconify-icon/dist/iconify-icon.mjs
49
49
  var Sc = Object.freeze({
@@ -12545,7 +12545,7 @@ var PD = (e) => {
12545
12545
  output: t
12546
12546
  };
12547
12547
  } };
12548
- } }, BD = Y.lazy(() => import("./chat-ui-CCmVFbcB.js").then((e) => ({ default: e.Chatbot }))), VD = H(K({
12548
+ } }, BD = Y.lazy(() => import("./chat-ui-D5YPIONI.js").then((e) => ({ default: e.Chatbot }))), VD = H(K({
12549
12549
  id: q(),
12550
12550
  role: U([
12551
12551
  "system",
@@ -13014,7 +13014,7 @@ function zO(e, t) {
13014
13014
  }
13015
13015
  //#endregion
13016
13016
  //#region src/plugins/impl/DataEditorPlugin.tsx
13017
- var BO = Y.lazy(() => import("./glide-data-editor-Dq0HGXj0.js").then((e) => e.t)), VO = xD("marimo-data-editor", { cssStyles: [WD, GD] }).withData(K({
13017
+ var BO = Y.lazy(() => import("./glide-data-editor-Bo2oD3LT.js").then((e) => e.t)), VO = xD("marimo-data-editor", { cssStyles: [WD, GD] }).withData(K({
13018
13018
  initialValue: K({ edits: H(K({
13019
13019
  rowIdx: G(),
13020
13020
  columnId: q(),
@@ -32737,7 +32737,7 @@ function HU(e) {
32737
32737
  }
32738
32738
  //#endregion
32739
32739
  //#region src/components/editor/renderers/slides-layout/slides-layout.tsx
32740
- var UU = Y.lazy(() => import("./reveal-component-lmXC9Dvs.js")), WU = (e) => {
32740
+ var UU = Y.lazy(() => import("./reveal-component-BClzE2il.js")), WU = (e) => {
32741
32741
  let t = (0, Z.c)(33), { layout: n, setLayout: r, cells: i, mode: a } = e, o = ws(Ws), s = a === "read" || o, c = ws(Sa) > 1, [l, u] = (0, Y.useState)(null), d;
32742
32742
  t[0] !== i || t[1] !== n ? (d = Bz(i, n), t[0] = i, t[1] = n, t[2] = d) : d = t[2];
32743
32743
  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-BPCzCO3I.js";
2
2
  import { t } from "./react-Bgs_wQh3.js";
3
- import { a as n } from "./glide-data-editor-Dq0HGXj0.js";
3
+ import { a as n } from "./glide-data-editor-Bo2oD3LT.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.3.1_57c124ac5a994dbbf13fd11838cf9ba9/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",
@@ -1,6 +1,6 @@
1
- import { T as e } from "./html-to-image-rvMfQD46.js";
1
+ import { T as e } from "./html-to-image-CNM0ZSFD.js";
2
2
  import { h as t } from "./tooltip-UzJukb3F.js";
3
- import { Tt as n, wt as r } from "./error-entries-BoO7a296.js";
3
+ import { Tt as n, wt as r } from "./error-entries-BKlEsuk4.js";
4
4
  import { r as i } from "./assertNever-DywGMo-S.js";
5
5
  var a = t("file", [["path", {
6
6
  d: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",
@@ -3,14 +3,14 @@ import { g as t, h as n, i as r, m as i, t as a } from "./button-qQhINE7z.js";
3
3
  import { t as o } from "./react-Bgs_wQh3.js";
4
4
  import { t as s } from "./compiler-runtime-C5KHtL5D.js";
5
5
  import { h as c, t as l } from "./tooltip-UzJukb3F.js";
6
- import { Cn as u, En as d, Sn as f, dn as p, et as m, f as h, i as g, l as _, n as v, nt as y, r as b, t as x, tt as S, u as C } from "./common-YLSZXvrL.js";
6
+ import { Cn as u, En as d, Sn as f, dn as p, et as m, f as h, i as g, l as _, n as v, nt as y, r as b, t as x, tt as S, u as C } from "./common-CvUqRXW6.js";
7
7
  import { M as w } from "./select-CDUxhHZg.js";
8
8
  import { X as T } from "./dropdown-menu-Dhv4fcNl.js";
9
9
  import { t as E } from "./jsx-runtime-D8btoEHk.js";
10
10
  import { Ht as D, f as O, i as k, zt as A } from "./use-restore-focus-DaTVz6S6.js";
11
11
  import { t as j } from "./useEvent-BoN7U38T.js";
12
12
  import { o as ee } from "./static-state-C4bAlKTU.js";
13
- import { n as te, t as ne } from "./code-visibility-BL-_Aqt5.js";
13
+ import { n as te, t as ne } from "./code-visibility-VztFTu0Q.js";
14
14
  /* empty css */
15
15
  var M = 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.25.3-dev526",
3
+ "version": "0.25.3-dev527",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -7,7 +7,7 @@ import {
7
7
  } from "@dnd-kit/sortable";
8
8
  import { useAtomValue } from "jotai";
9
9
  import { DatabaseIcon, SquareCodeIcon, SquareMIcon } from "lucide-react";
10
- import { useEffect } from "react";
10
+ import { useEffect, useMemo } from "react";
11
11
  import { StartupLogsAlert } from "@/components/editor/alerts/startup-logs-alert";
12
12
  import { Cell } from "@/components/editor/notebook-cell";
13
13
  import { PackageAlert } from "@/components/editor/package-alert";
@@ -45,7 +45,11 @@ interface CellArrayProps {
45
45
  }
46
46
 
47
47
  export const CellArray: React.FC<CellArrayProps> = (props) => {
48
- const columnIds = useLayout().columns.map((column) => column.id);
48
+ const { columns } = useLayout();
49
+ const columnIds = useMemo(
50
+ () => columns.map((column) => column.id),
51
+ [columns],
52
+ );
49
53
 
50
54
  // Setup context for sorting
51
55
  return (
@@ -173,6 +177,8 @@ const CellColumn: React.FC<{
173
177
  const cellIds = useCellIds();
174
178
  const column = findColumn(useLayout(), columnId);
175
179
  invariant(column, `Expected column for: ${columnId}`);
180
+ // dnd-kit takes a mutable array.
181
+ const sortableItems = useMemo(() => [...column.visible], [column.visible]);
176
182
 
177
183
  const hasOnlyOneCell = cellIds.length === 1;
178
184
  const hasSetupCell = cellIds.includes(SETUP_CELL_ID);
@@ -201,7 +207,7 @@ const CellColumn: React.FC<{
201
207
  >
202
208
  <SortableContext
203
209
  id={`column-${index + 1}`}
204
- items={[...column.visible]}
210
+ items={sortableItems}
205
211
  strategy={verticalListSortingStrategy}
206
212
  >
207
213
  {/* Render the setup cell first, always */}
@@ -148,6 +148,19 @@ describe("layoutAtom", () => {
148
148
  };
149
149
  }
150
150
 
151
+ it("keeps the layout on a code edit and updates it on a column edit", () => {
152
+ const { store, model } = setupNotebook(stops);
153
+ const layout = store.get(layoutAtom);
154
+
155
+ store.set(model.editAtom, (tx) => tx.setCode(c2, "y = 3"));
156
+ expect(store.get(layoutAtom)).toBe(layout);
157
+
158
+ store.set(model.editAtom, (tx) => tx.updateConfig(c2, { column: 1 }));
159
+ expect(
160
+ store.get(layoutAtom).columns.map((column) => column.visible),
161
+ ).toEqual([[c1], [c2]]);
162
+ });
163
+
151
164
  it("is the same layout after output that changes no heading", () => {
152
165
  const { store } = setupNotebook(stops);
153
166
  const output = reporter(store);
@@ -2,7 +2,9 @@
2
2
 
3
3
  /** The cells as they appear on the page: by column, with folded sections hidden. */
4
4
 
5
+ import { dequal } from "dequal";
5
6
  import { atom, useAtomValue } from "jotai";
7
+ import { selectAtom } from "jotai/vanilla/utils";
6
8
  import type { EditableDocument } from "@/core/notebook/document";
7
9
  import { findCollapseRange } from "../dom/outline";
8
10
  import { activeDocumentModelAtom } from "../session/active-notebook";
@@ -63,13 +65,21 @@ export const followColumnsAtom = atom(
63
65
  },
64
66
  );
65
67
 
68
+ /** Only changes when cells move within or between columns, appear, or disappear. */
69
+ const documentColumnsAtom = selectAtom(
70
+ atom((get) => {
71
+ const model = get(activeDocumentModelAtom);
72
+ return model === null ? null : get(model.documentAtom);
73
+ }),
74
+ (document) => (document === null ? [[]] : groupByColumn(document)),
75
+ dequal,
76
+ );
77
+
66
78
  /** The document's columns, each with its id, then the empty ones the page keeps. */
67
- function columnsOf(
68
- document: EditableDocument | null,
69
- ids: readonly CellColumnId[],
70
- empty: readonly CellColumnId[],
71
- ): Array<{ id: CellColumnId; ids: CellId[] }> {
72
- const groups = document === null ? [[]] : groupByColumn(document);
79
+ const columnsAtom = atom((get) => {
80
+ const groups = get(documentColumnsAtom);
81
+ const ids = get(columnIdsAtom);
82
+ const empty = get(emptyColumnIdsAtom);
73
83
  return [
74
84
  ...groups.map((cells, index) => ({
75
85
  // Before the first document names them, columns go by position.
@@ -78,7 +88,7 @@ function columnsOf(
78
88
  })),
79
89
  ...empty.map((id) => ({ id, ids: [] as CellId[] })),
80
90
  ];
81
- }
91
+ });
82
92
 
83
93
  export interface LayoutColumn {
84
94
  readonly id: CellColumnId;
@@ -142,11 +152,9 @@ export function deriveLayout(
142
152
  * output.
143
153
  */
144
154
  export const layoutAtom = atom((get): Layout => {
145
- const model = get(activeDocumentModelAtom);
146
- const document = model === null ? null : get(model.documentAtom);
147
155
  const outlines = get(cellOutlinesAtom);
148
156
  return deriveLayout(
149
- columnsOf(document, get(columnIdsAtom), get(emptyColumnIdsAtom)),
157
+ get(columnsAtom),
150
158
  (id) => outlines[id] ?? null,
151
159
  get(collapsedAtom),
152
160
  );
@@ -105,6 +105,11 @@ export function useNotebookDocumentEdit() {
105
105
  return useSetAtom(useDocumentModel().editAtom);
106
106
  }
107
107
 
108
+ /** Wait for the host to confirm this client's edits. */
109
+ export function useNotebookDocumentFlush() {
110
+ return useDocumentModel().flush;
111
+ }
112
+
108
113
  /**
109
114
  * Sync status and explicit recovery. flush waits for edits, including newer
110
115
  * typing, to reach the confirmed source and returns the revision for Run/Save.
@@ -10,6 +10,7 @@ export {
10
10
  useNotebookCellName,
11
11
  useNotebookCellOrder,
12
12
  useNotebookDocumentEdit,
13
+ useNotebookDocumentFlush,
13
14
  useNotebookDocumentSync,
14
15
  } from "./hooks";
15
16
  export {
@@ -7,10 +7,7 @@ import type { PropsWithChildren } from "react";
7
7
  import { describe, expect, it, vi } from "vitest";
8
8
  import { DocumentWrapper } from "@/__mocks__/document";
9
9
  import { partial } from "@/__mocks__/partial";
10
- import type {
11
- DocumentModel,
12
- DocumentSyncStatus,
13
- } from "@/core/notebook/document";
10
+ import type { DocumentModel } from "@/core/notebook/document";
14
11
  import type { NotebookReplica } from "@/core/notebook/replica";
15
12
  import {
16
13
  type FakeSave,
@@ -47,14 +44,7 @@ function setup({
47
44
  connected?: boolean;
48
45
  } = {}) {
49
46
  const store = createStore();
50
- const model = partial<DocumentModel>(
51
- {
52
- flush,
53
- retry: vi.fn(),
54
- syncStatusAtom: atom<DocumentSyncStatus>({ status: "idle" }),
55
- },
56
- "model",
57
- );
47
+ const model = partial<DocumentModel>({ flush }, "model");
58
48
  if (connected) {
59
49
  store.set(
60
50
  activeNotebookReplicaAtom,
@@ -4,7 +4,7 @@
4
4
 
5
5
  import { useAtomValue } from "jotai";
6
6
  import { useCallback } from "react";
7
- import { useNotebookDocumentSync } from "@/core/notebook/document";
7
+ import { useNotebookDocumentFlush } from "@/core/notebook/document";
8
8
  import { activeNotebookBackendAtom } from "../session/active-notebook";
9
9
 
10
10
  /**
@@ -18,7 +18,7 @@ import { activeNotebookBackendAtom } from "../session/active-notebook";
18
18
  * ```
19
19
  */
20
20
  export function useNotebookDocumentSave() {
21
- const { flush } = useNotebookDocumentSync();
21
+ const flush = useNotebookDocumentFlush();
22
22
  const backend = useAtomValue(activeNotebookBackendAtom);
23
23
  return useCallback(async () => {
24
24
  if (backend === null) {