@marimo-team/islands 0.26.1-dev47 → 0.26.1-dev49

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist/{ErrorBoundary-DdY0kgXv.js → ErrorBoundary-CLB3hXa4.js} +1 -1
  2. package/dist/{chat-ui-6qTQeEIx.js → chat-ui-NC4Kn150.js} +3 -3
  3. package/dist/{code-visibility-CsDfs1e1.js → code-visibility-DxGMKLDC.js} +2 -2
  4. package/dist/{common-BEzP29zn.js → common-DB1vkI7_.js} +91 -36
  5. package/dist/{data-grid-overlay-editor-gJb9MZVF.js → data-grid-overlay-editor-BNS8q3hF.js} +1 -1
  6. package/dist/{error-entries-8CPw0aYH.js → error-entries--aUBuKcQ.js} +25 -17
  7. package/dist/{feedback-button-BAOFQTkH.js → feedback-button-PZHN3_Sv.js} +3 -3
  8. package/dist/{glide-data-editor-BknFgsDc.js → glide-data-editor-BQtLyR6B.js} +3 -3
  9. package/dist/{globals-95am9BSj.js → globals-CxKBnTba.js} +1 -1
  10. package/dist/{html-to-image-BIom70fW.js → html-to-image-Cig4c8LO.js} +1 -1
  11. package/dist/main.js +12 -11
  12. package/dist/{number-overlay-editor-BjVZ4TjB.js → number-overlay-editor-C8dWSXhU.js} +1 -1
  13. package/dist/{process-output-ns7N5ovS.js → process-output-GwRODOnr.js} +2 -2
  14. package/dist/{reveal-component-We7t_Fnt.js → reveal-component-CoX-9hW5.js} +2 -2
  15. package/package.json +1 -1
  16. package/src/__mocks__/executions.ts +1 -1
  17. package/src/components/data-table/__tests__/export-actions.test.tsx +79 -0
  18. package/src/components/data-table/export-actions.tsx +64 -19
  19. package/src/components/data-table/schemas.ts +1 -0
  20. package/src/core/executions/__tests__/output-lifecycle.test.ts +71 -2
  21. package/src/core/executions/select.ts +3 -3
  22. package/src/core/islands/bridge.ts +1 -1
  23. package/src/core/notebook/replica/__tests__/executions.test.ts +21 -0
  24. package/src/core/notebook/replica/__tests__/results.test.ts +1 -1
  25. package/src/core/notebook/replica/replica.ts +2 -2
  26. package/src/core/notebook/replica/resources/executions.ts +34 -11
  27. package/src/core/notebook/replica/resources/results.ts +5 -10
@@ -148,7 +148,7 @@ function L(e) {
148
148
  }
149
149
  //#endregion
150
150
  //#region src/components/editor/boundary/ErrorBoundary.tsx
151
- var R = (0, T.lazy)(() => import("./feedback-button-BAOFQTkH.js").then((e) => ({ default: e.FeedbackModal }))), z = (e) => {
151
+ var R = (0, T.lazy)(() => import("./feedback-button-PZHN3_Sv.js").then((e) => ({ default: e.FeedbackModal }))), z = (e) => {
152
152
  let t = (0, w.c)(2), n;
153
153
  return t[0] === e.children ? n = t[1] : (n = /* @__PURE__ */ (0, N.jsx)(O, {
154
154
  FallbackComponent: B,
@@ -3,13 +3,13 @@ import { g as n, h as r, r as i, t as a } from "./button-Z2R2272J.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 { i as c, t as l } from "./copy-icon-DuxRkh7T.js";
6
- import { $ as u, At as d, Bt as f, Dt as p, Et as m, Ft as h, Ht as g, Lt as _, M as v, Ot as y, Pt as b, Q as x, Rt as S, U as C, V as w, W as T, a as E, dt as D, et as O, f as k, g as A, h as j, ht as M, l as N, m as P, n as ee, p as F, q as te, r as ne, rt as re, st as ie, t as ae, u as oe, v as se, wt as ce, xt as le } from "./html-to-image-BIom70fW.js";
6
+ import { $ as u, At as d, Bt as f, Dt as p, Et as m, Ft as h, Ht as g, Lt as _, M as v, Ot as y, Pt as b, Q as x, Rt as S, U as C, V as w, W as T, a as E, dt as D, et as O, f as k, g as A, h as j, ht as M, l as N, m as P, n as ee, p as F, q as te, r as ne, rt as re, st as ie, t as ae, u as oe, v as se, wt as ce, xt as le } from "./html-to-image-Cig4c8LO.js";
7
7
  import { h as I, t as ue } from "./tooltip-BQZ-Bm6h.js";
8
8
  import { d as de } from "./select-BszV-bbI.js";
9
9
  import { Cn as fe, f as pe, g as me, i as he, n as ge, t as _e, v as ve, xn as ye } from "./dropdown-menu-BiXHfje7.js";
10
10
  import { i as be, l as xe } from "./config-D-lhQq-h.js";
11
- import { F as Se, J as Ce, R as we, Tt as Te, Ut as Ee, h as De, i as Oe, kt as ke, on as Ae, r as je, t as Me, yt as Ne } from "./error-entries-8CPw0aYH.js";
12
- import { c as Pe, d as Fe, l as Ie, n as Le, t as Re, u as ze } from "./process-output-ns7N5ovS.js";
11
+ import { F as Se, J as Ce, R as we, Tt as Te, Ut as Ee, h as De, i as Oe, kt as ke, on as Ae, r as je, t as Me, yt as Ne } from "./error-entries--aUBuKcQ.js";
12
+ import { c as Pe, d as Fe, l as Ie, n as Le, t as Re, u as ze } from "./process-output-GwRODOnr.js";
13
13
  import { t as Be } from "./pencil-FAv6JUvp.js";
14
14
  import { n as Ve, r as He, s as Ue } from "./assertNever-473SFxLt.js";
15
15
  import { t as We } from "./jsx-runtime-D8btoEHk.js";
@@ -1,5 +1,5 @@
1
1
  import { g as e } from "./button-Z2R2272J.js";
2
- import { Jt as t, j as n, tn as r } from "./error-entries-8CPw0aYH.js";
2
+ import { Jt as t, j as n, tn as r } from "./error-entries--aUBuKcQ.js";
3
3
  import { n as i } from "./assertNever-473SFxLt.js";
4
4
  import { Vt as a, Wt as o, f as s, h as c, kt as l } from "./use-restore-focus-DT1TZACX.js";
5
5
  import { c as u, m as d, n as f, o as p } from "./static-state-BtDNJuc2.js";
@@ -14,7 +14,7 @@ function y() {
14
14
  return e.warn("Failed to get version from mount config"), null;
15
15
  }
16
16
  }
17
- var b = y() || "0.26.1-dev47", x = o(b), S = o(!0);
17
+ var b = y() || "0.26.1-dev49", x = o(b), S = o(!0);
18
18
  o(null);
19
19
  //#endregion
20
20
  //#region src/core/wasm/state.ts
@@ -3,7 +3,7 @@ import { _ as t, f as n, g as r, h as i, i as a, m as o, n as s, p as c, r as l,
3
3
  import { t as d } from "./react-Bgs_wQh3.js";
4
4
  import { t as f } from "./compiler-runtime-C5KHtL5D.js";
5
5
  import { i as p, n as m, r as h, t as g } from "./copy-icon-DuxRkh7T.js";
6
- import { A as _, C as v, D as y, Et as b, Ft as x, G as S, Gt as C, H as w, Ht as T, K as E, Kt as D, L as O, Lt as k, M as A, N as j, Nt as M, Ot as N, Rt as P, S as F, Tt as I, U as L, Ut as ee, V as R, W as z, Wt as B, X as te, Y as ne, Z as V, _t as re, at as ie, bt as ae, d as oe, gt as se, jt as ce, k as le, n as ue, q as de, r as fe, s as pe, t as me, w as he, x as ge, y as _e, yt as ve, zt as ye } from "./html-to-image-BIom70fW.js";
6
+ import { A as _, C as v, D as y, Et as b, Ft as x, G as S, Gt as C, H as w, Ht as T, K as E, Kt as D, L as O, Lt as k, M as A, N as j, Nt as M, Ot as N, Rt as P, S as F, Tt as I, U as L, Ut as ee, V as R, W as z, Wt as B, X as te, Y as ne, Z as V, _t as re, at as ie, bt as ae, d as oe, gt as se, jt as ce, k as le, n as ue, q as de, r as fe, s as pe, t as me, w as he, x as ge, y as _e, yt as ve, zt as ye } from "./html-to-image-Cig4c8LO.js";
7
7
  import { a as be, f as xe, h as H, n as Se, o as Ce, r as we, t as U } from "./tooltip-BQZ-Bm6h.js";
8
8
  import { r as Te, s as Ee } from "./useLifecycle-C9UTzCY8.js";
9
9
  import { a as De, i as Oe, n as ke, o as Ae, r as je, t as Me } from "./useDateFormatter-D3gyMY-g.js";
@@ -11,7 +11,7 @@ import { t as Ne } from "./check-DmTIavbZ.js";
11
11
  import { A as Pe, C as Fe, M as Ie, S as Le, T as Re, _ as ze, b as Be, c as Ve, d as He, f as Ue, g as We, h as Ge, i as Ke, l as qe, m as Je, n as Ye, s as Xe, t as Ze, u as Qe, v as $e, x as et, y as tt } from "./select-BszV-bbI.js";
12
12
  import { $ as nt, $t as rt, A as it, At as at, B as ot, Bt as st, C as ct, Cn as lt, Ct as ut, D as dt, Dt as ft, Et as pt, F as mt, Ft as ht, G as gt, Gt as _t, H as vt, Ht as yt, I as bt, It as xt, J as St, Jt as Ct, K as wt, Kt as Tt, L as Et, Lt as Dt, M as Ot, Mt as kt, N as At, Nt as jt, O as Mt, Ot as Nt, P as Pt, Pt as Ft, Q as It, Qt as Lt, R as Rt, Rt as zt, S as Bt, Sn as Vt, St as Ht, T as Ut, Tt as Wt, U as Gt, Ut as Kt, V as qt, Vt as Jt, W as Yt, Wt as Xt, Xt as Zt, Yt as Qt, Z as $t, Zt as en, _n as tn, _t as nn, a as rn, at as an, bn as on, bt as sn, cn, ct as ln, d as un, dn, dt as fn, en as pn, et as mn, f as hn, fn as gn, ft as _n, g as vn, gn as yn, gt as bn, hn as xn, ht as Sn, i as Cn, in as wn, it as Tn, j as En, jt as Dn, k as On, kt as kn, l as An, ln as jn, lt as Mn, mn as Nn, n as Pn, nn as Fn, nt as In, o as Ln, on as Rn, ot as zn, p as Bn, pt as Vn, q as Hn, qt as Un, rn as Wn, rt as Gn, s as Kn, sn as qn, st as Jn, t as Yn, tn as Xn, tt as Zn, u as Qn, ut as $n, v as er, vn as tr, vt as nr, w as rr, wt as ir, xn as ar, xt as or, yn as sr, yt as cr, z as lr, zt as ur } from "./dropdown-menu-BiXHfje7.js";
13
13
  import { i as dr, n as fr, o as pr, t as mr } from "./config-D-lhQq-h.js";
14
- import { A as hr, At as gr, Et as _r, G as vr, Ht as yr, J as br, K as xr, Lt as Sr, O as Cr, P as wr, Q as Tr, Tt as Er, Ut as Dr, Vt as Or, W as kr, Wt as Ar, X as jr, Z as Mr, an as Nr, b as Pr, in as Fr, kt as Ir, on as Lr, t as Rr, u as zr, y as Br, yt as Vr, z as Hr, zt as Ur } from "./error-entries-8CPw0aYH.js";
14
+ import { A as hr, At as gr, Et as _r, G as vr, Ht as yr, J as br, K as xr, Lt as Sr, O as Cr, P as wr, Q as Tr, Tt as Er, Ut as Dr, Vt as Or, W as kr, Wt as Ar, X as jr, Z as Mr, an as Nr, b as Pr, in as Fr, kt as Ir, on as Lr, t as Rr, u as zr, y as Br, yt as Vr, z as Hr, zt as Ur } from "./error-entries--aUBuKcQ.js";
15
15
  import { n as Wr, o as Gr, r as Kr, s as qr, t as Jr } from "./assertNever-473SFxLt.js";
16
16
  import { t as Yr } from "./clsx-CoeGtWvn.js";
17
17
  import { t as Xr } from "./react-dom-DdqGVp5N.js";
@@ -33,7 +33,7 @@ import { a as ba, i as xa, n as Sa, o as Ca, r as wa, t as Ta } from "./dialog-C
33
33
  import { o as Ea } from "./dist-BG-7Qpaj.js";
34
34
  import { t as Da } from "./useAsyncData-P5-Oovhq.js";
35
35
  import { n as W, t as G } from "./objectWithoutPropertiesLoose-BRDcTsfB.js";
36
- import { n as Oa, t as ka } from "./ErrorBoundary-DdY0kgXv.js";
36
+ import { n as Oa, t as ka } from "./ErrorBoundary-CLB3hXa4.js";
37
37
  import { W as Aa, n as ja } from "./vega-loader.browser-Co9gYE8Z.js";
38
38
  import { a as Ma, n as Na, r as Pa, t as Fa } from "./loader-qPmiRXZd.js";
39
39
  import { t as Ia } from "./useIframeCapabilities-_0KX0nu_.js";
@@ -26482,20 +26482,24 @@ var dB = [
26482
26482
  ], gB = {
26483
26483
  csv: {
26484
26484
  separator: ",",
26485
- encoding: "utf-8"
26485
+ encoding: "utf-8",
26486
+ decimalComma: !1
26487
+ },
26488
+ tsv: {
26489
+ encoding: "utf-8",
26490
+ decimalComma: !1
26486
26491
  },
26487
- tsv: { encoding: "utf-8" },
26488
26492
  json: { ensureAscii: !0 }
26489
26493
  }, _B = (e) => e in gB;
26490
26494
  function vB(e, t, n) {
26491
26495
  let r = {};
26492
26496
  switch (t) {
26493
26497
  case "csv":
26494
- e.csv.separator !== gB.csv.separator && (r.separator = e.csv.separator), n === "download" && e.csv.encoding !== gB.csv.encoding && (r.encoding = e.csv.encoding);
26495
- break;
26496
- case "tsv":
26497
- n === "download" && e.tsv.encoding !== gB.tsv.encoding && (r.encoding = e.tsv.encoding);
26498
+ case "tsv": {
26499
+ let i = e[t];
26500
+ t === "csv" && e.csv.separator !== gB.csv.separator && (r.separator = e.csv.separator), i.decimalComma && (r.decimal_comma = !0), n === "download" && i.encoding !== gB[t].encoding && (r.encoding = i.encoding);
26498
26501
  break;
26502
+ }
26499
26503
  case "json":
26500
26504
  e.json.ensureAscii !== gB.json.ensureAscii && (r.ensure_ascii = e.json.ensureAscii);
26501
26505
  break;
@@ -26508,8 +26512,15 @@ function vB(e, t, n) {
26508
26512
  var yB = (e, t) => e.find((e) => e.value === t)?.label ?? t;
26509
26513
  function bB(e, t) {
26510
26514
  switch (t) {
26511
- case "csv": return [yB(mB, e.csv.separator), yB(hB, e.csv.encoding)].join(" · ");
26512
- case "tsv": return yB(hB, e.tsv.encoding);
26515
+ case "csv":
26516
+ case "tsv": {
26517
+ let n = e[t];
26518
+ return [
26519
+ ...t === "csv" ? [yB(mB, e.csv.separator)] : [],
26520
+ yB(hB, n.encoding),
26521
+ ...n.decimalComma ? ["Decimal comma"] : []
26522
+ ].join(" · ");
26523
+ }
26513
26524
  case "json": return e.json.ensureAscii ? "Escapes non-ASCII" : "Keeps non-ASCII";
26514
26525
  case "parquet":
26515
26526
  case "geojson":
@@ -26956,8 +26967,36 @@ var OB = (e) => {
26956
26967
  children: [Ae, Le]
26957
26968
  }), t[95] = a, t[96] = le, t[97] = Ae, t[98] = Le, t[99] = Re) : Re = t[99], Re;
26958
26969
  }, kB = (e) => {
26959
- let t = (0, J.c)(31), { format: n, settings: r, onChange: i } = e, a = K.useId(), o;
26960
- t[0] !== a || t[1] !== i ? (o = (e, t) => /* @__PURE__ */ (0, q.jsx)(AB, {
26970
+ let t = (0, J.c)(47), { format: n, settings: r, onChange: i } = e, a = K.useId(), o;
26971
+ t[0] !== a || t[1] !== i || t[2] !== r ? (o = (e) => /* @__PURE__ */ (0, q.jsx)(AB, {
26972
+ id: `${a}-decimal`,
26973
+ label: "Decimal separator",
26974
+ help: "Character between the integer and fractional parts of a number.",
26975
+ children: /* @__PURE__ */ (0, q.jsxs)(qe, {
26976
+ id: `${a}-decimal`,
26977
+ className: "mb-0 w-full",
26978
+ value: r[e].decimalComma ? "comma" : "point",
26979
+ onChange: (t) => {
26980
+ let n = t.target.value === "comma";
26981
+ i((t) => ({
26982
+ ...t,
26983
+ [e]: {
26984
+ ...t[e],
26985
+ decimalComma: n
26986
+ }
26987
+ }));
26988
+ },
26989
+ children: [/* @__PURE__ */ (0, q.jsx)("option", {
26990
+ value: "point",
26991
+ children: "Point"
26992
+ }), /* @__PURE__ */ (0, q.jsx)("option", {
26993
+ value: "comma",
26994
+ children: "Comma"
26995
+ })]
26996
+ })
26997
+ }), t[0] = a, t[1] = i, t[2] = r, t[3] = o) : o = t[3];
26998
+ let s = o, c;
26999
+ t[4] !== a || t[5] !== i ? (c = (e, t) => /* @__PURE__ */ (0, q.jsx)(AB, {
26961
27000
  id: `${a}-encoding`,
26962
27001
  label: "Encoding",
26963
27002
  help: "Text encoding of the saved file. Pick UTF-8 with BOM when Excel shows garbled accents. Copies always use UTF-8.",
@@ -26977,12 +27016,12 @@ var OB = (e) => {
26977
27016
  },
26978
27017
  children: hB.map(FB)
26979
27018
  })
26980
- }), t[0] = a, t[1] = i, t[2] = o) : o = t[2];
26981
- let s = o;
27019
+ }), t[4] = a, t[5] = i, t[6] = c) : c = t[6];
27020
+ let l = c;
26982
27021
  switch (n) {
26983
27022
  case "csv": {
26984
27023
  let e = `${a}-separator`, n = `${a}-separator`, o = r.csv.separator, c;
26985
- t[3] === i ? c = t[4] : (c = (e) => {
27024
+ t[7] === i ? c = t[8] : (c = (e) => {
26986
27025
  let t = e.target.value;
26987
27026
  i((e) => ({
26988
27027
  ...e,
@@ -26991,55 +27030,71 @@ var OB = (e) => {
26991
27030
  separator: t
26992
27031
  }
26993
27032
  }));
26994
- }, t[3] = i, t[4] = c);
26995
- let l;
26996
- t[5] === Symbol.for("react.memo_cache_sentinel") ? (l = mB.map(IB), t[5] = l) : l = t[5];
27033
+ }, t[7] = i, t[8] = c);
26997
27034
  let u;
26998
- t[6] !== r.csv.separator || t[7] !== n || t[8] !== c ? (u = /* @__PURE__ */ (0, q.jsx)(qe, {
27035
+ t[9] === Symbol.for("react.memo_cache_sentinel") ? (u = mB.map(IB), t[9] = u) : u = t[9];
27036
+ let d;
27037
+ t[10] !== r.csv.separator || t[11] !== n || t[12] !== c ? (d = /* @__PURE__ */ (0, q.jsx)(qe, {
26999
27038
  id: n,
27000
27039
  className: "mb-0 w-full",
27001
27040
  value: o,
27002
27041
  onChange: c,
27003
- children: l
27004
- }), t[6] = r.csv.separator, t[7] = n, t[8] = c, t[9] = u) : u = t[9];
27005
- let d;
27006
- t[10] !== e || t[11] !== u ? (d = /* @__PURE__ */ (0, q.jsx)(AB, {
27042
+ children: u
27043
+ }), t[10] = r.csv.separator, t[11] = n, t[12] = c, t[13] = d) : d = t[13];
27044
+ let f;
27045
+ t[14] !== e || t[15] !== d ? (f = /* @__PURE__ */ (0, q.jsx)(AB, {
27007
27046
  id: e,
27008
27047
  label: "Delimiter",
27009
27048
  help: "Character between fields. Semicolon suits spreadsheets in locales that use a comma as the decimal separator.",
27010
- children: u
27011
- }), t[10] = e, t[11] = u, t[12] = d) : d = t[12];
27012
- let f;
27013
- t[13] !== s || t[14] !== r.csv.encoding ? (f = s(r.csv.encoding, "csv"), t[13] = s, t[14] = r.csv.encoding, t[15] = f) : f = t[15];
27049
+ children: d
27050
+ }), t[14] = e, t[15] = d, t[16] = f) : f = t[16];
27014
27051
  let p;
27015
- return t[16] !== d || t[17] !== f ? (p = /* @__PURE__ */ (0, q.jsxs)(q.Fragment, { children: [d, f] }), t[16] = d, t[17] = f, t[18] = p) : p = t[18], p;
27052
+ t[17] !== l || t[18] !== r.csv.encoding ? (p = l(r.csv.encoding, "csv"), t[17] = l, t[18] = r.csv.encoding, t[19] = p) : p = t[19];
27053
+ let m;
27054
+ t[20] === s ? m = t[21] : (m = s("csv"), t[20] = s, t[21] = m);
27055
+ let h;
27056
+ t[22] !== r.csv.decimalComma || t[23] !== r.csv.separator ? (h = r.csv.separator === "," && r.csv.decimalComma && /* @__PURE__ */ (0, q.jsx)("p", {
27057
+ className: "col-span-2 text-xs text-muted-foreground",
27058
+ children: "Excel in a comma-decimal locale needs the Semicolon delimiter."
27059
+ }), t[22] = r.csv.decimalComma, t[23] = r.csv.separator, t[24] = h) : h = t[24];
27060
+ let g;
27061
+ return t[25] !== p || t[26] !== m || t[27] !== h || t[28] !== f ? (g = /* @__PURE__ */ (0, q.jsxs)(q.Fragment, { children: [
27062
+ f,
27063
+ p,
27064
+ m,
27065
+ h
27066
+ ] }), t[25] = p, t[26] = m, t[27] = h, t[28] = f, t[29] = g) : g = t[29], g;
27016
27067
  }
27017
27068
  case "tsv": {
27018
27069
  let e;
27019
- return t[19] !== s || t[20] !== r.tsv.encoding ? (e = s(r.tsv.encoding, "tsv"), t[19] = s, t[20] = r.tsv.encoding, t[21] = e) : e = t[21], e;
27070
+ t[30] !== l || t[31] !== r.tsv.encoding ? (e = l(r.tsv.encoding, "tsv"), t[30] = l, t[31] = r.tsv.encoding, t[32] = e) : e = t[32];
27071
+ let n;
27072
+ t[33] === s ? n = t[34] : (n = s("tsv"), t[33] = s, t[34] = n);
27073
+ let i;
27074
+ return t[35] !== e || t[36] !== n ? (i = /* @__PURE__ */ (0, q.jsxs)(q.Fragment, { children: [e, n] }), t[35] = e, t[36] = n, t[37] = i) : i = t[37], i;
27020
27075
  }
27021
27076
  case "json": {
27022
27077
  let e = `${a}-ensure-ascii`, n = `${a}-ensure-ascii`, o;
27023
- t[22] === i ? o = t[23] : (o = (e) => {
27078
+ t[38] === i ? o = t[39] : (o = (e) => {
27024
27079
  i((t) => ({
27025
27080
  ...t,
27026
27081
  json: { ensureAscii: e }
27027
27082
  }));
27028
- }, t[22] = i, t[23] = o);
27083
+ }, t[38] = i, t[39] = o);
27029
27084
  let s;
27030
- t[24] !== r.json.ensureAscii || t[25] !== n || t[26] !== o ? (s = /* @__PURE__ */ (0, q.jsx)(uB, {
27085
+ t[40] !== r.json.ensureAscii || t[41] !== n || t[42] !== o ? (s = /* @__PURE__ */ (0, q.jsx)(uB, {
27031
27086
  id: n,
27032
27087
  size: "xs",
27033
27088
  checked: r.json.ensureAscii,
27034
27089
  onCheckedChange: o
27035
- }), t[24] = r.json.ensureAscii, t[25] = n, t[26] = o, t[27] = s) : s = t[27];
27090
+ }), t[40] = r.json.ensureAscii, t[41] = n, t[42] = o, t[43] = s) : s = t[43];
27036
27091
  let c;
27037
- return t[28] !== e || t[29] !== s ? (c = /* @__PURE__ */ (0, q.jsx)(AB, {
27092
+ return t[44] !== e || t[45] !== s ? (c = /* @__PURE__ */ (0, q.jsx)(AB, {
27038
27093
  id: e,
27039
27094
  label: "Escape non-ASCII",
27040
27095
  help: "Write characters outside ASCII as \\\\u escapes. Turn off to keep accents and symbols readable in the file.",
27041
27096
  children: s
27042
- }), t[28] = e, t[29] = s, t[30] = c) : c = t[30], c;
27097
+ }), t[44] = e, t[45] = s, t[46] = c) : c = t[46], c;
27043
27098
  }
27044
27099
  default: return Wr(n), null;
27045
27100
  }
@@ -2,7 +2,7 @@ import { a as e } from "./rolldown-runtime-BPCzCO3I.js";
2
2
  import { t } from "./react-Bgs_wQh3.js";
3
3
  import { t as n } from "./react-dom-DdqGVp5N.js";
4
4
  import { c as r, l as i, u as a } from "./data-grid-types-DBNnjiYJ.js";
5
- import { a as o, i as s, n as c, r as l } from "./glide-data-editor-BknFgsDc.js";
5
+ import { a as o, i as s, n as c, r as l } from "./glide-data-editor-BQtLyR6B.js";
6
6
  //#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.18.1_marked@15.0.12_react-dom@19.3.1__a94b4518d090e84da26f3a68e82f2953/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",
@@ -360,24 +360,27 @@ function rt(e, t) {
360
360
  return o && M(o.record) !== null ? n : Date.parse(a) >= Date.parse(M(n.record) ?? "") ? t : n;
361
361
  }
362
362
  function it(e, t) {
363
- let { id: n, cell_id: r } = t.record;
363
+ let { id: n } = t.record;
364
364
  return {
365
365
  ...e,
366
366
  executions: new Map(e.executions).set(n, t),
367
- scratchConsole: rt(e, t),
368
- latest: r === null || e.latest.get(r) === n ? e.latest : new Map(e.latest).set(r, n)
367
+ scratchConsole: rt(e, t)
369
368
  };
370
369
  }
371
370
  function at(e, t) {
372
371
  let n = e.executions.get(t);
373
372
  if (n === void 0) return e;
374
- let r = n.record.cell_id, i = r !== null && e.latest.get(r) === t;
373
+ let r = n.record.cell_id, i = r !== null && e.latest.get(r) === t, a = P(e.executions, t), o = e.latest;
374
+ if (i) {
375
+ let t = e.results.get(r);
376
+ o = t && a.has(t.record.id) ? new Map(o).set(r, t.record.id) : P(o, r);
377
+ }
375
378
  return {
376
379
  ...e,
377
- executions: P(e.executions, t),
380
+ executions: a,
381
+ latest: o,
378
382
  variables: i ? P(e.variables, r) : e.variables,
379
- scratchConsole: e.scratchConsole?.record.id === t ? void 0 : e.scratchConsole,
380
- latest: i ? P(e.latest, r) : e.latest
383
+ scratchConsole: e.scratchConsole?.record.id === t ? void 0 : e.scratchConsole
381
384
  };
382
385
  }
383
386
  function ot(e, t) {
@@ -488,18 +491,23 @@ var pt = {
488
491
  ...e,
489
492
  runs: P(e.runs, t.id)
490
493
  } : e,
491
- execution: (e, { data: { execution: t } }) => {
492
- let n = e.executions.get(t.id), r = {
494
+ execution: (e, { data: { execution: t } }, { phase: n }) => {
495
+ let r = e.executions.get(t.id), i = {
493
496
  record: t,
494
- output: n?.output ?? null
497
+ output: r?.output ?? null
498
+ }, a = dt(e, {
499
+ ...i,
500
+ outputVersion: r === void 0 ? 0 : r.outputVersion + +!ut(r, i),
501
+ append: r?.append,
502
+ lastSeq: r?.lastSeq,
503
+ items: r?.items ?? /* @__PURE__ */ new Map()
504
+ }), o = t.cell_id;
505
+ if (o === null || r !== void 0) return a;
506
+ let s = e.latest.get(o);
507
+ return n === "snapshot" && s !== void 0 && t.state.status === "completed" && e.executions.get(s)?.record.state.status !== "completed" ? a : {
508
+ ...a,
509
+ latest: new Map(e.latest).set(o, t.id)
495
510
  };
496
- return dt(e, {
497
- ...r,
498
- outputVersion: n === void 0 ? 0 : n.outputVersion + +!ut(n, r),
499
- append: n?.append,
500
- lastSeq: n?.lastSeq,
501
- items: n?.items ?? /* @__PURE__ */ new Map()
502
- });
503
511
  },
504
512
  "execution.removed": (e, { data: t }) => at(e, t.id),
505
513
  output: (e, { data: { output: t } }) => {
@@ -3,14 +3,14 @@ import { h as t, t as n } from "./button-Z2R2272J.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-DuxRkh7T.js";
6
- import { A as o, L as s, Y as c, i as l, j as u, n as d, on as f, tn as p, z as m } from "./error-entries-8CPw0aYH.js";
7
- import { n as h, t as ee } from "./globals-95am9BSj.js";
6
+ import { A as o, L as s, Y as c, i as l, j as u, n as d, on as f, tn as p, z as m } from "./error-entries--aUBuKcQ.js";
7
+ import { n as h, t as ee } from "./globals-CxKBnTba.js";
8
8
  import { r as g } from "./assertNever-473SFxLt.js";
9
9
  import { t as _ } from "./jsx-runtime-D8btoEHk.js";
10
10
  import { Ct as te, Vt as v, m as y } from "./use-restore-focus-DT1TZACX.js";
11
11
  import { a as ne, i as re, n as ie, r as ae } from "./dialog-CvyFEwby.js";
12
12
  import { t as oe } from "./useAsyncData-P5-Oovhq.js";
13
- import { t as se } from "./code-visibility-CsDfs1e1.js";
13
+ import { t as se } from "./code-visibility-DxGMKLDC.js";
14
14
  //#region src/components/ui/skeleton.tsx
15
15
  var b = /* @__PURE__ */ e(r(), 1), x = i(), S = _(), ce = (e) => {
16
16
  let n = (0, x.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-DT1TZACX.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-DdY0kgXv.js";
17
+ import { t as ce } from "./ErrorBoundary-CLB3hXa4.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-DBNnjiYJ.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.18.1_marked@15.0.12_react-dom@19.3.1__a94b4518d090e84da26f3a68e82f2953/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-gJb9MZVF.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-BNS8q3hF.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.18.1_marked@15.0.12_react-dom@19.3.1__a94b4518d090e84da26f3a68e82f2953/node_modules/@glideapps/glide-data-grid/dist/esm/cells/number-cell.js
9287
- var Xs = W.lazy(async () => await import("./number-overlay-editor-BjVZ4TjB.js")), Zs = {
9287
+ var Xs = W.lazy(async () => await import("./number-overlay-editor-C8dWSXhU.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-BQZ-Bm6h.js";
2
2
  import { Ct as t } from "./use-restore-focus-DT1TZACX.js";
3
- import { r as n } from "./code-visibility-CsDfs1e1.js";
3
+ import { r as n } from "./code-visibility-DxGMKLDC.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 E, i as re, o as ie, r as D, s as O, t as ae } from "./useLifecycl
9
9
  import { a as oe, c as se, i as ce, n as le, o as ue, r as de, s as fe, t as pe } from "./select-BszV-bbI.js";
10
10
  import { X as me, ht as he, p as ge } from "./dropdown-menu-BiXHfje7.js";
11
11
  import { c as _e, l as ve, n as ye } from "./config-D-lhQq-h.js";
12
- import { $ as k, A, At as be, B as xe, Bt as Se, D as Ce, E as we, Gt as j, Ht as Te, I as Ee, J as De, Kt as Oe, M as ke, Mt as Ae, N as je, Ot as Me, R as Ne, Rt as Pe, St as Fe, Ut as Ie, Xt as Le, Yt as Re, Zt as ze, _ as Be, _t as Ve, a as He, at as Ue, c as We, ct as Ge, dt as Ke, et as qe, f as Je, ft as Ye, gt as Xe, h as Ze, in as Qe, it as $e, k as et, lt as tt, nn as nt, o as rt, ot as it, p as at, pt as ot, q as st, qt as ct, s as lt, st as ut, tt as dt, ut as ft, v as pt, x as mt, z as ht } from "./error-entries-8CPw0aYH.js";
12
+ import { $ as k, A, At as be, B as xe, Bt as Se, D as Ce, E as we, Gt as j, Ht as Te, I as Ee, J as De, Kt as Oe, M as ke, Mt as Ae, N as je, Ot as Me, R as Ne, Rt as Pe, St as Fe, Ut as Ie, Xt as Le, Yt as Re, Zt as ze, _ as Be, _t as Ve, a as He, at as Ue, c as We, ct as Ge, dt as Ke, et as qe, f as Je, ft as Ye, gt as Xe, h as Ze, in as Qe, it as $e, k as et, lt as tt, nn as nt, o as rt, ot as it, p as at, pt as ot, q as st, qt as ct, s as lt, st as ut, tt as dt, ut as ft, v as pt, x as mt, z as ht } from "./error-entries--aUBuKcQ.js";
13
13
  import { n as gt } from "./assertNever-473SFxLt.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-DuxRkh7T.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, J as N, L as P, Lt as F, M as I, Mt as L, O as R, Ot as z, P as B, R as ee, Rt as te, St as ne, Ut as re, Vt as ie, Wt as ae, Y as oe, _ as se, a as ce, at as le, b as ue, bt as de, c as fe, ct as pe, ft as me, ht as he, i as ge, it as _e, j as ve, kt as ye, lt as be, mt as xe, n as Se, nt as Ce, o as we, ot as Te, pt as Ee, tt as De, ut as Oe, vt as ke, z as Ae, zt as je } from "./html-to-image-BIom70fW.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, J as N, L as P, Lt as F, M as I, Mt as L, O as R, Ot as z, P as B, R as ee, Rt as te, St as ne, Ut as re, Vt as ie, Wt as ae, Y as oe, _ as se, a as ce, at as le, b as ue, bt as de, c as fe, ct as pe, ft as me, ht as he, i as ge, it as _e, j as ve, kt as ye, lt as be, mt as xe, n as Se, nt as Ce, o as we, ot as Te, pt as Ee, tt as De, ut as Oe, vt as ke, z as Ae, zt as je } from "./html-to-image-Cig4c8LO.js";
7
7
  import { a as Me, f as Ne, h as Pe, i as Fe, m as Ie, n as Le, o as Re, r as ze, t as Be } from "./tooltip-BQZ-Bm6h.js";
8
8
  import { D as Ve, E as He, S as Ue, T as We, _ as Ge, a as Ke, c as qe, d as Je, f as Ye, g as Xe, h as Ze, i as Qe, l as $e, m as et, n as tt, o as nt, p as rt, r as it, s as at, t as ot, u as st, v as ct, w as lt, x as ut, y as dt } from "./spec-CRfw-lOm.js";
9
- import { $ as ft, $t as pt, A as mt, An as ht, At as gt, B as _t, Bt as vt, C as yt, D as bt, Dn as xt, Dt as St, E as Ct, En as wt, Et as Tt, F as Et, Ft as Dt, G as Ot, Gt as kt, H as At, Ht as jt, I as Mt, It as Nt, J as Pt, Jt as Ft, K as It, Kt as Lt, L as Rt, Lt as zt, M as Bt, Mn as Vt, Mt as Ht, N as Ut, Nt as Wt, O as Gt, On as Kt, Ot as qt, P as Jt, Pt as Yt, Q as Xt, Qt as Zt, R as Qt, Rt as $t, S as en, Sn as tn, St as nn, T as rn, Tn as an, Tt as on, U as sn, Ut as cn, V as ln, Vt as un, W as dn, Wt as fn, X as pn, Xt as mn, Y as hn, Yt as gn, Z as _n, Zt as vn, _ as yn, _n as bn, _t as xn, an as Sn, at as Cn, b as wn, bn as Tn, bt as En, c as Dn, cn as On, ct as kn, d as An, dn as jn, dt as Mn, en as Nn, f as Pn, fn as Fn, ft as In, g as Ln, gn as Rn, gt as zn, h as Bn, hn as Vn, ht as Hn, in as Un, it as Wn, j as Gn, jn as Kn, jt as qn, k as Jn, kn as Yn, kt as Xn, ln as Zn, lt as Qn, m as $n, mn as er, mt as tr, nn as nr, on as rr, ot as ir, p as ar, pn as or, pt as sr, q as cr, qt as lr, r as ur, rn as dr, rt as fr, sn as pr, st as mr, t as hr, tn as gr, u as _r, un as vr, ut as yr, v as br, vn as xr, vt as Sr, w as Cr, wn as wr, x as Tr, xn as Er, xt as Dr, y as Or, yn as kr, yt as Ar, z as jr, zt as Mr } from "./common-BEzP29zn.js";
9
+ import { $ as ft, $t as pt, A as mt, An as ht, At as gt, B as _t, Bt as vt, C as yt, D as bt, Dn as xt, Dt as St, E as Ct, En as wt, Et as Tt, F as Et, Ft as Dt, G as Ot, Gt as kt, H as At, Ht as jt, I as Mt, It as Nt, J as Pt, Jt as Ft, K as It, Kt as Lt, L as Rt, Lt as zt, M as Bt, Mn as Vt, Mt as Ht, N as Ut, Nt as Wt, O as Gt, On as Kt, Ot as qt, P as Jt, Pt as Yt, Q as Xt, Qt as Zt, R as Qt, Rt as $t, S as en, Sn as tn, St as nn, T as rn, Tn as an, Tt as on, U as sn, Ut as cn, V as ln, Vt as un, W as dn, Wt as fn, X as pn, Xt as mn, Y as hn, Yt as gn, Z as _n, Zt as vn, _ as yn, _n as bn, _t as xn, an as Sn, at as Cn, b as wn, bn as Tn, bt as En, c as Dn, cn as On, ct as kn, d as An, dn as jn, dt as Mn, en as Nn, f as Pn, fn as Fn, ft as In, g as Ln, gn as Rn, gt as zn, h as Bn, hn as Vn, ht as Hn, in as Un, it as Wn, j as Gn, jn as Kn, jt as qn, k as Jn, kn as Yn, kt as Xn, ln as Zn, lt as Qn, m as $n, mn as er, mt as tr, nn as nr, on as rr, ot as ir, p as ar, pn as or, pt as sr, q as cr, qt as lr, r as ur, rn as dr, rt as fr, sn as pr, st as mr, t as hr, tn as gr, u as _r, un as vr, ut as yr, v as br, vn as xr, vt as Sr, w as Cr, wn as wr, x as Tr, xn as Er, xt as Dr, y as Or, yn as kr, yt as Ar, z as jr, zt as Mr } from "./common-DB1vkI7_.js";
10
10
  import { a as Nr, n as Pr, s as Fr, t as Ir } from "./useLifecycle-C9UTzCY8.js";
11
11
  import { t as Lr } from "./check-DmTIavbZ.js";
12
12
  import { A as Rr, C as zr, D as Br, M as Vr, O as Hr, a as Ur, c as Wr, d as Gr, i as Kr, k as qr, l as Jr, n as Yr, o as Xr, r as Zr, s as Qr, t as $r, w as ei, x as ti } from "./select-BszV-bbI.js";
13
13
  import { $ as ni, At as ri, Cn as ii, E as ai, H as oi, K as si, Nt as ci, Q as li, Sn as ui, T as di, V as fi, X as pi, Y as mi, Z as hi, _ as gi, a as _i, b as vi, c as yi, f as bi, g as xi, h as Si, i as Ci, m as wi, mt as Ti, n as Ei, r as Di, rt as Oi, s as ki, t as Ai, v as ji, vt as Mi, w as Ni, x as Pi, xn as Fi, y as Ii } from "./dropdown-menu-BiXHfje7.js";
14
14
  import { a as Li, c as Ri, l as zi, r as Bi, s as Vi, t as Hi } from "./config-D-lhQq-h.js";
15
- import { $t as Ui, A as Wi, At as Gi, Bt as Ki, C as qi, Ct as Ji, Dt as Yi, Ft as Xi, H as Zi, I as Qi, It as $i, J as ea, Jt as ta, Nt as na, Pt as ra, Qt as ia, S as aa, St as oa, T as sa, U as ca, V as la, W as ua, X as da, Y as fa, Zt as pa, _ as ma, bt as ha, d as ga, en as _a, g as va, h as ya, ht as ba, l as xa, m as Sa, mt as Ca, nt as wa, p as Ta, rn as Ea, rt as Da, s as Oa, tn as ka, vt as Aa, w as ja, xt as Ma } from "./error-entries-8CPw0aYH.js";
16
- import { a as Na, d as Pa, i as Fa, n as Ia, o as La, r as Ra, s as za, t as Ba, u as Va } from "./process-output-ns7N5ovS.js";
15
+ import { $t as Ui, A as Wi, At as Gi, Bt as Ki, C as qi, Ct as Ji, Dt as Yi, Ft as Xi, H as Zi, I as Qi, It as $i, J as ea, Jt as ta, Nt as na, Pt as ra, Qt as ia, S as aa, St as oa, T as sa, U as ca, V as la, W as ua, X as da, Y as fa, Zt as pa, _ as ma, bt as ha, d as ga, en as _a, g as va, h as ya, ht as ba, l as xa, m as Sa, mt as Ca, nt as wa, p as Ta, rn as Ea, rt as Da, s as Oa, tn as ka, vt as Aa, w as ja, xt as Ma } from "./error-entries--aUBuKcQ.js";
16
+ import { a as Na, d as Pa, i as Fa, n as Ia, o as La, r as Ra, s as za, t as Ba, u as Va } from "./process-output-GwRODOnr.js";
17
17
  import { t as Ha } from "./pencil-FAv6JUvp.js";
18
18
  import { a as Ua, c as Wa, d as Ga, f as Ka, i as qa, l as Ja, r as Ya } from "./glide-utils-iHKKQPJ8.js";
19
- import { n as Xa, t as Za } from "./globals-95am9BSj.js";
19
+ import { n as Xa, t as Za } from "./globals-CxKBnTba.js";
20
20
  import { a as Qa, i as $a, n as eo, r as to, s as no, t as ro } from "./assertNever-473SFxLt.js";
21
21
  import { t as io } from "./react-dom-DdqGVp5N.js";
22
22
  import { t as ao } from "./jsx-runtime-D8btoEHk.js";
@@ -40,10 +40,10 @@ import { i as ac } from "./dist-BG-7Qpaj.js";
40
40
  import { p as oc } from "./dist-BidYR5m4.js";
41
41
  import { t as sc } from "./useAsyncData-P5-Oovhq.js";
42
42
  import { n as cc, r as lc, t as uc } from "./useDeepCompareMemoize-CO6rO5Mq.js";
43
- import { t as dc } from "./ErrorBoundary-DdY0kgXv.js";
43
+ import { t as dc } from "./ErrorBoundary-CLB3hXa4.js";
44
44
  import { G as fc, W as pc } from "./vega-loader.browser-Co9gYE8Z.js";
45
45
  import { a as mc, n as hc } from "./loader-qPmiRXZd.js";
46
- import { a as gc, c as _c, i as vc, l as yc, o as bc, s as xc, t as Sc } from "./code-visibility-CsDfs1e1.js";
46
+ import { a as gc, c as _c, i as vc, l as yc, o as bc, s as xc, t as Sc } from "./code-visibility-DxGMKLDC.js";
47
47
  import { t as Cc } from "./esm-DY8dGAjJ.js";
48
48
  //#region ../node_modules/.pnpm/iconify-icon@2.3.0/node_modules/iconify-icon/dist/iconify-icon.mjs
49
49
  var wc = Object.freeze({
@@ -3295,7 +3295,7 @@ var qp = Rp({ offset: !0 }).describe("A date and time with its offset from UTC,
3295
3295
  revision: sh,
3296
3296
  type: Xo([K(), yo()]).describe("The runtime's label for the value's type. A host may leave it null."),
3297
3297
  preview: Xo([K(), yo()]).describe("A short rendering of the value. A host may leave it null.")
3298
- }).describe("A name a cell's execution bound in the notebook's namespace, with\nthe revision of its value. The execution binds it as it ends, and\nthe item is removed with the execution. An update, as when a\nstate setter runs or a UI element's value changes, advances the revision\nwithout binding again, and the producer sends the item again with\nthe same id. Hosts publish a cell execution's variables before its\n`completed` status, and remove a cell's previous execution\nbefore publishing the next one. A scratch execution's\nnames live only while it runs, so it publishes no variables.\n"), Oh = G({
3298
+ }).describe("A name a cell's execution bound in the notebook's namespace, with\nthe revision of its value. The execution binds it as it ends, and\nthe item is removed when the name is unbound or the execution retires. An update, as when a\nstate setter runs or a UI element's value changes, advances the revision\nwithout binding again, and the producer sends the item again with\nthe same id. Hosts publish a cell execution's variables before its\n`completed` status, and remove its bindings before publishing the cell's next execution. A scratch execution's\nnames live only while it runs, so it publishes no variables.\n"), Oh = G({
3299
3299
  request_id: K().optional().describe("The `Idempotency-Key` of the request that caused this event. Omitted when no request did, and on snapshots unless that request's work is still in progress."),
3300
3300
  time: qp.optional().describe("When the host published this event. Present on live and replayed events; omitted on snapshots."),
3301
3301
  variable: Dh
@@ -12640,7 +12640,7 @@ var GD = (e) => {
12640
12640
  output: t
12641
12641
  };
12642
12642
  } };
12643
- } }, ZD = J.lazy(() => import("./chat-ui-6qTQeEIx.js").then((e) => ({ default: e.Chatbot }))), QD = V(G({
12643
+ } }, ZD = J.lazy(() => import("./chat-ui-NC4Kn150.js").then((e) => ({ default: e.Chatbot }))), QD = V(G({
12644
12644
  id: K(),
12645
12645
  role: H([
12646
12646
  "system",
@@ -13109,7 +13109,7 @@ function XO(e, t) {
13109
13109
  }
13110
13110
  //#endregion
13111
13111
  //#region src/plugins/impl/DataEditorPlugin.tsx
13112
- var ZO = J.lazy(() => import("./glide-data-editor-BknFgsDc.js").then((e) => e.t)), QO = MD("marimo-data-editor", { cssStyles: [tO, nO] }).withData(G({
13112
+ var ZO = J.lazy(() => import("./glide-data-editor-BQtLyR6B.js").then((e) => e.t)), QO = MD("marimo-data-editor", { cssStyles: [tO, nO] }).withData(G({
13113
13113
  initialValue: G({ edits: V(G({
13114
13114
  rowIdx: W(),
13115
13115
  columnId: K(),
@@ -16635,6 +16635,7 @@ var xj = G({
16635
16635
  geometry_column: K().nullish(),
16636
16636
  options: G({
16637
16637
  separator: K().optional(),
16638
+ decimal_comma: U().optional(),
16638
16639
  encoding: K().optional(),
16639
16640
  ensure_ascii: U().optional()
16640
16641
  }).optional()
@@ -32832,7 +32833,7 @@ function $U(e) {
32832
32833
  }
32833
32834
  //#endregion
32834
32835
  //#region src/components/editor/renderers/slides-layout/slides-layout.tsx
32835
- var eW = J.lazy(() => import("./reveal-component-We7t_Fnt.js")), tW = (e) => {
32836
+ var eW = J.lazy(() => import("./reveal-component-CoX-9hW5.js")), tW = (e) => {
32836
32837
  let t = (0, X.c)(33), { layout: n, setLayout: r, cells: i, mode: a } = e, o = Io(Ys), s = a === "read" || o, c = Io(Ca) > 1, [l, u] = (0, J.useState)(null), d;
32837
32838
  t[0] !== i || t[1] !== n ? (d = Zz(i, n), t[0] = i, t[1] = n, t[2] = d) : d = t[2];
32838
32839
  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-BknFgsDc.js";
3
+ import { a as n } from "./glide-data-editor-BQtLyR6B.js";
4
4
  //#region ../node_modules/.pnpm/@glideapps+glide-data-grid@6.0.4-alpha24_lodash@4.18.1_marked@15.0.12_react-dom@19.3.1__a94b4518d090e84da26f3a68e82f2953/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-BIom70fW.js";
1
+ import { T as e } from "./html-to-image-Cig4c8LO.js";
2
2
  import { h as t } from "./tooltip-BQZ-Bm6h.js";
3
- import { Tt as n, wt as r } from "./error-entries-8CPw0aYH.js";
3
+ import { Tt as n, wt as r } from "./error-entries--aUBuKcQ.js";
4
4
  import { r as i } from "./assertNever-473SFxLt.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, m as r, r as i, t as a } from "./button-Z2R2272J.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-BQZ-Bm6h.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-BEzP29zn.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-DB1vkI7_.js";
7
7
  import { M as w } from "./select-BszV-bbI.js";
8
8
  import { X as T } from "./dropdown-menu-BiXHfje7.js";
9
9
  import { t as E } from "./jsx-runtime-D8btoEHk.js";
10
10
  import { Vt as D, Wt as O, f as k, i as ee } from "./use-restore-focus-DT1TZACX.js";
11
11
  import { t as A } from "./useEvent-BoN7U38T.js";
12
12
  import { o as te } from "./static-state-BtDNJuc2.js";
13
- import { n as ne, t as re } from "./code-visibility-CsDfs1e1.js";
13
+ import { n as ne, t as re } from "./code-visibility-DxGMKLDC.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.26.1-dev47",
3
+ "version": "0.26.1-dev49",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -108,7 +108,7 @@ function mirror(entries: ExecutionEntries): Executions {
108
108
  >();
109
109
  for (const { items = [], bindings = [], ...record } of records) {
110
110
  if (record.cell_id !== null) {
111
- // The host retains one execution per cell on the stream.
111
+ // Model a host that retires the cell's previous execution at queue time.
112
112
  const previous = latest.get(record.cell_id);
113
113
  if (previous !== undefined) {
114
114
  executions.delete(previous);
@@ -114,6 +114,85 @@ describe("ExportActions dialog", () => {
114
114
  vi.unstubAllGlobals();
115
115
  });
116
116
 
117
+ it.each(["CSV", "TSV"])(
118
+ "sends decimal comma for %s downloads and copies",
119
+ async (label) => {
120
+ vi.stubGlobal(
121
+ "fetch",
122
+ vi.fn().mockResolvedValue({
123
+ ok: true,
124
+ text: vi.fn().mockResolvedValue("3,14\n"),
125
+ }),
126
+ );
127
+ renderExportActions();
128
+ await openDialog();
129
+ const format = label.toLowerCase();
130
+ fireEvent.click(screen.getByRole("button", { name: `${label} options` }));
131
+ const select = screen.getByRole("combobox", {
132
+ name: "Decimal separator",
133
+ });
134
+ expect(select).toHaveValue("point");
135
+ expect(
136
+ screen.getByTestId(`export-summary-${format}`),
137
+ ).not.toHaveTextContent("Decimal comma");
138
+ fireEvent.click(
139
+ screen.getByRole("button", { name: `Download ${label}` }),
140
+ );
141
+ await waitFor(() => expect(downloadAs).toHaveBeenCalledWith({ format }));
142
+ downloadAs.mockClear();
143
+ fireEvent.change(select, { target: { value: "comma" } });
144
+ expect(screen.getByTestId(`export-summary-${format}`)).toHaveTextContent(
145
+ "Decimal comma",
146
+ );
147
+ fireEvent.click(
148
+ screen.getByRole("button", { name: `Download ${label}` }),
149
+ );
150
+ await waitFor(() =>
151
+ expect(downloadAs).toHaveBeenCalledWith({
152
+ format,
153
+ options: { decimal_comma: true },
154
+ }),
155
+ );
156
+ downloadAs.mockClear();
157
+ fireEvent.click(screen.getByRole("button", { name: `Copy ${label}` }));
158
+ await waitFor(() =>
159
+ expect(copyToClipboard).toHaveBeenCalledWith("3,14\n"),
160
+ );
161
+ expect(downloadAs).toHaveBeenCalledWith({
162
+ format,
163
+ options: { decimal_comma: true },
164
+ });
165
+ },
166
+ );
167
+
168
+ it("shows the Excel hint only for a comma delimiter with decimal comma", async () => {
169
+ renderExportActions();
170
+ await openDialog();
171
+ fireEvent.click(screen.getByRole("button", { name: "CSV options" }));
172
+ const hint =
173
+ "Excel in a comma-decimal locale needs the Semicolon delimiter.";
174
+ expect(screen.queryByText(hint)).not.toBeInTheDocument();
175
+ fireEvent.change(
176
+ screen.getByRole("combobox", { name: "Decimal separator" }),
177
+ {
178
+ target: { value: "comma" },
179
+ },
180
+ );
181
+ expect(screen.getByText(hint)).toBeInTheDocument();
182
+ fireEvent.change(screen.getByRole("combobox", { name: "Delimiter" }), {
183
+ target: { value: ";" },
184
+ });
185
+ expect(screen.queryByText(hint)).not.toBeInTheDocument();
186
+ fireEvent.click(screen.getByRole("button", { name: "TSV options" }));
187
+ fireEvent.change(
188
+ screen.getByRole("combobox", { name: "Decimal separator" }),
189
+ {
190
+ target: { value: "comma" },
191
+ },
192
+ );
193
+ expect(screen.queryByText(hint)).not.toBeInTheDocument();
194
+ });
195
+
117
196
  it("selects a primary geometry for GeoParquet without changing other formats", async () => {
118
197
  const getExportMetadata = vi.fn().mockResolvedValue(geometryMetadata);
119
198
  renderExportActions({ getExportMetadata });
@@ -152,15 +152,20 @@ const ENCODINGS = [
152
152
  type Separator = (typeof SEPARATORS)[number]["value"];
153
153
  type Encoding = (typeof ENCODINGS)[number]["value"];
154
154
 
155
+ interface DelimitedSettings {
156
+ encoding: Encoding;
157
+ decimalComma: boolean;
158
+ }
159
+
155
160
  interface ExportSettings {
156
- csv: { separator: Separator; encoding: Encoding };
157
- tsv: { encoding: Encoding };
161
+ csv: DelimitedSettings & { separator: Separator };
162
+ tsv: DelimitedSettings;
158
163
  json: { ensureAscii: boolean };
159
164
  }
160
165
 
161
166
  const DEFAULT_SETTINGS: ExportSettings = {
162
- csv: { separator: ",", encoding: "utf-8" },
163
- tsv: { encoding: "utf-8" },
167
+ csv: { separator: ",", encoding: "utf-8", decimalComma: false },
168
+ tsv: { encoding: "utf-8", decimalComma: false },
164
169
  json: { ensureAscii: true },
165
170
  };
166
171
 
@@ -184,24 +189,25 @@ function requestOptions(
184
189
  const options: DownloadAsOptions = {};
185
190
  switch (format) {
186
191
  case "csv":
187
- if (settings.csv.separator !== DEFAULT_SETTINGS.csv.separator) {
188
- options.separator = settings.csv.separator;
189
- }
192
+ case "tsv": {
193
+ const delimited = settings[format];
190
194
  if (
191
- destination === "download" &&
192
- settings.csv.encoding !== DEFAULT_SETTINGS.csv.encoding
195
+ format === "csv" &&
196
+ settings.csv.separator !== DEFAULT_SETTINGS.csv.separator
193
197
  ) {
194
- options.encoding = settings.csv.encoding;
198
+ options.separator = settings.csv.separator;
199
+ }
200
+ if (delimited.decimalComma) {
201
+ options.decimal_comma = true;
195
202
  }
196
- break;
197
- case "tsv":
198
203
  if (
199
204
  destination === "download" &&
200
- settings.tsv.encoding !== DEFAULT_SETTINGS.tsv.encoding
205
+ delimited.encoding !== DEFAULT_SETTINGS[format].encoding
201
206
  ) {
202
- options.encoding = settings.tsv.encoding;
207
+ options.encoding = delimited.encoding;
203
208
  }
204
209
  break;
210
+ }
205
211
  case "json":
206
212
  if (settings.json.ensureAscii !== DEFAULT_SETTINGS.json.ensureAscii) {
207
213
  options.ensure_ascii = settings.json.ensureAscii;
@@ -228,12 +234,16 @@ function settingsSummary(
228
234
  ): string | null {
229
235
  switch (format) {
230
236
  case "csv":
237
+ case "tsv": {
238
+ const delimited = settings[format];
231
239
  return [
232
- labelForValue(SEPARATORS, settings.csv.separator),
233
- labelForValue(ENCODINGS, settings.csv.encoding),
240
+ ...(format === "csv"
241
+ ? [labelForValue(SEPARATORS, settings.csv.separator)]
242
+ : []),
243
+ labelForValue(ENCODINGS, delimited.encoding),
244
+ ...(delimited.decimalComma ? ["Decimal comma"] : []),
234
245
  ].join(" · ");
235
- case "tsv":
236
- return labelForValue(ENCODINGS, settings.tsv.encoding);
246
+ }
237
247
  case "json":
238
248
  return settings.json.ensureAscii
239
249
  ? "Escapes non-ASCII"
@@ -1066,6 +1076,30 @@ const ExportSettingsFields: React.FC<ExportSettingsFieldsProps> = ({
1066
1076
  }) => {
1067
1077
  const id = React.useId();
1068
1078
 
1079
+ const decimalField = (key: "csv" | "tsv") => (
1080
+ <SettingField
1081
+ id={`${id}-decimal`}
1082
+ label="Decimal separator"
1083
+ help="Character between the integer and fractional parts of a number."
1084
+ >
1085
+ <NativeSelect
1086
+ id={`${id}-decimal`}
1087
+ className="mb-0 w-full"
1088
+ value={settings[key].decimalComma ? "comma" : "point"}
1089
+ onChange={(event) => {
1090
+ const decimalComma = event.target.value === "comma";
1091
+ onChange((current) => ({
1092
+ ...current,
1093
+ [key]: { ...current[key], decimalComma },
1094
+ }));
1095
+ }}
1096
+ >
1097
+ <option value="point">Point</option>
1098
+ <option value="comma">Comma</option>
1099
+ </NativeSelect>
1100
+ </SettingField>
1101
+ );
1102
+
1069
1103
  const encodingField = (encoding: Encoding, key: "csv" | "tsv") => (
1070
1104
  <SettingField
1071
1105
  id={`${id}-encoding`}
@@ -1122,10 +1156,21 @@ const ExportSettingsFields: React.FC<ExportSettingsFieldsProps> = ({
1122
1156
  </NativeSelect>
1123
1157
  </SettingField>
1124
1158
  {encodingField(settings.csv.encoding, "csv")}
1159
+ {decimalField("csv")}
1160
+ {settings.csv.separator === "," && settings.csv.decimalComma && (
1161
+ <p className="col-span-2 text-xs text-muted-foreground">
1162
+ Excel in a comma-decimal locale needs the Semicolon delimiter.
1163
+ </p>
1164
+ )}
1125
1165
  </>
1126
1166
  );
1127
1167
  case "tsv":
1128
- return encodingField(settings.tsv.encoding, "tsv");
1168
+ return (
1169
+ <>
1170
+ {encodingField(settings.tsv.encoding, "tsv")}
1171
+ {decimalField("tsv")}
1172
+ </>
1173
+ );
1129
1174
  case "json":
1130
1175
  return (
1131
1176
  <SettingField
@@ -8,6 +8,7 @@ const DownloadRequestSchema = z.object({
8
8
  options: z
9
9
  .object({
10
10
  separator: z.string().optional(),
11
+ decimal_comma: z.boolean().optional(),
11
12
  encoding: z.string().optional(),
12
13
  ensure_ascii: z.boolean().optional(),
13
14
  })
@@ -40,7 +40,7 @@ const text = (data: string): Protocol.Media => ({
40
40
 
41
41
  type Record = Protocol.Execution | Protocol.Output;
42
42
 
43
- async function setup() {
43
+ async function setup(advanceFrame = mockAnimationFrames()) {
44
44
  interface Attempt {
45
45
  message: Parameters<NotebookTransport>[1]["message"];
46
46
  drop(): void;
@@ -55,7 +55,6 @@ async function setup() {
55
55
  }),
56
56
  });
57
57
  const store = createStore();
58
- const advanceFrame = mockAnimationFrames();
59
58
  const lifetime = new AbortController();
60
59
  onTestFinished(() => lifetime.abort());
61
60
  const replica = createNotebookReplica(store);
@@ -170,6 +169,76 @@ describe("output lifetime", () => {
170
169
  },
171
170
  );
172
171
 
172
+ it.each(["predecessor first", "successor first"])(
173
+ "recovers a retained display with the %s in the snapshot",
174
+ async (order) => {
175
+ const { store, replica, snapshot, emit, remove } = await setup();
176
+ const [previous, output] = MockExecutions.shown(C1, text("42"));
177
+ const running = MockExecutions.running(C1);
178
+ snapshot(
179
+ order === "predecessor first"
180
+ ? [previous, output, running]
181
+ : [running, previous, output],
182
+ );
183
+ expect(store.get(cellOutputAtom(C1))?.data).toBe("42");
184
+ expect(store.get(replica.executionsAtom).latest.get(C1)).toBe(running.id);
185
+
186
+ emit(MockExecutions.output(running, null));
187
+ emit(MockExecutions.output(previous, text("late")));
188
+ expect(store.get(replica.executionsAtom).latest.get(C1)).toBe(running.id);
189
+ expect(store.get(cellOutputAtom(C1))).toBeNull();
190
+
191
+ emit(MockExecutions.output(running, text("43")));
192
+ emit({ ...MockExecutions.completed(C1), id: running.id });
193
+ remove(previous);
194
+ expect(store.get(cellOutputAtom(C1))?.data).toBe("43");
195
+ },
196
+ );
197
+
198
+ it("keeps the display through a superseded attempt and its replacement", async () => {
199
+ const advanceFrame = mockAnimationFrames();
200
+ const live = await setup(advanceFrame);
201
+ const [previous, output] = MockExecutions.shown(C1, text("42"));
202
+ live.snapshot([previous, output]);
203
+ const queued = MockExecutions.queued(C1);
204
+ live.emit(queued);
205
+ live.emit({
206
+ ...queued,
207
+ state: {
208
+ status: "completed",
209
+ started_at: null,
210
+ completed_at: MockExecutions.T1,
211
+ outcome: {
212
+ kind: "skipped",
213
+ reason: "superseded",
214
+ message: "Changed while queued",
215
+ related: [],
216
+ },
217
+ depends_on: {},
218
+ },
219
+ });
220
+ expect(live.store.get(cellOutputAtom(C1))?.data).toBe("42");
221
+ live.remove(queued);
222
+
223
+ const fresh = await setup(advanceFrame);
224
+ fresh.snapshot([previous, output]);
225
+ const replacement = MockExecutions.queued(C1);
226
+ for (const editor of [live, fresh]) {
227
+ expect(
228
+ editor.store.get(editor.replica.executionsAtom).latest.get(C1),
229
+ ).toBe(previous.id);
230
+ editor.emit(replacement);
231
+ expect(editor.store.get(cellOutputAtom(C1))?.data).toBe("42");
232
+ editor.emit({
233
+ ...replacement,
234
+ state: { status: "running", started_at: MockExecutions.T1 },
235
+ });
236
+ expect(editor.store.get(cellOutputAtom(C1))?.data).toBe("42");
237
+ editor.emit(MockExecutions.output(replacement, text("43")));
238
+ expect(editor.store.get(cellOutputAtom(C1))?.data).toBe("43");
239
+ }
240
+ });
241
+
173
242
  it("keeps a changed display visible after its execution retires", async () => {
174
243
  const { store, replica, emit, remove, snapshot } = await setup();
175
244
  const [result, output] = MockExecutions.shown(C1, text("A"));
@@ -165,9 +165,9 @@ function runnable(inputs: CellExecutionInputs, id: Protocol.CellId): boolean {
165
165
  * this happens before the kernel plans their executions. Until the cell's
166
166
  * execution in that run appears, the run itself is what makes the cell
167
167
  * queued. A request this browser has made works the same way until its
168
- * run shows up on the stream. The host keeps one execution per cell, so
169
- * the cell's latest execution, or its retained result once the stream has
170
- * let that execution go, tells which run has already planned it.
168
+ * run shows up on the stream. The cell's latest execution, or its retained
169
+ * result once the stream has let that execution go, tells which run
170
+ * has already planned it.
171
171
  */
172
172
  function awaited(inputs: CellExecutionInputs, id: Protocol.CellId): boolean {
173
173
  if (!runnable(inputs, id)) {
@@ -79,7 +79,7 @@ export class IslandsPyodideBridge implements RunRequests, EditRequests {
79
79
  private session: AppSession | undefined;
80
80
  private sessionReady = new Deferred<AppSession>();
81
81
  private nextSessionGeneration = 0;
82
- /** The host retains one execution per cell and removes it before its replacement. */
82
+ /** Retained executions by session, for routing background console writes to their cells. */
83
83
  private readonly activeSessions = new Map<number, Map<string, CellId>>();
84
84
  private appTransition = Promise.resolve();
85
85
  private workerReady = new Deferred<void>();
@@ -117,6 +117,27 @@ describe("executions resource", () => {
117
117
  ]);
118
118
  });
119
119
 
120
+ it("selects a successor first seen at completion during replay", () => {
121
+ const running = replay(runCells.slice(0, 5), replay(snapshot));
122
+ const predecessor = resource(running).latest.get(C3)!;
123
+ const completed = resource(replay(runCells, replay(snapshot))).results.get(
124
+ C3,
125
+ )!;
126
+ const successor = { ...completed.record, id: "successor" };
127
+ const resumed = replay(
128
+ [
129
+ event({
130
+ event: "execution",
131
+ id: "112",
132
+ data: { execution: successor },
133
+ }),
134
+ removed("execution", predecessor, "113"),
135
+ ],
136
+ reducer.resume(running),
137
+ );
138
+ expect(resource(resumed).latest.get(C3)).toBe(successor.id);
139
+ });
140
+
120
141
  it("applies item and variable removals to the stream's copy", () => {
121
142
  const done = replay(runCells, replay(snapshot));
122
143
  const late = {
@@ -84,7 +84,7 @@ describe("retained results", () => {
84
84
  expect(done.get(cellId("c1"))).toBeNull();
85
85
  });
86
86
 
87
- it("keeps a result when the attempt that replaced it was superseded", () => {
87
+ it("keeps the last result when a queued attempt is superseded", () => {
88
88
  const done = replay(runCells, replay(snapshot));
89
89
  const result = resource(done).get(C3)!;
90
90
  const superseded = reducer.reduce(
@@ -134,8 +134,8 @@ export interface NotebookReplica {
134
134
  */
135
135
  readonly executionsAtom: Atom<Executions>;
136
136
  /**
137
- * Each document cell's last completed execution record, kept while it
138
- * runs again and shown through a reset.
137
+ * Each document cell's last result, kept through reruns, superseded
138
+ * attempts, and resets.
139
139
  */
140
140
  readonly resultsAtom: Atom<Results>;
141
141
  /**
@@ -37,7 +37,7 @@ export interface Executions {
37
37
  readonly runs: ReadonlyMap<Protocol.RunId, Protocol.RunOutput>;
38
38
  /** Every execution on the stream, scratch included. */
39
39
  readonly executions: ReadonlyMap<Protocol.ExecutionId, Execution>;
40
- /** The execution on the stream for each cell that has one. */
40
+ /** The unfinished execution for each cell, or its latest completed one. */
41
41
  readonly latest: ReadonlyMap<Protocol.CellId, Protocol.ExecutionId>;
42
42
  /** Bindings by defining cell and item id, shared across unrelated stream updates. */
43
43
  readonly variables: ReadonlyMap<
@@ -118,17 +118,13 @@ function retainScratchConsole(
118
118
  : current;
119
119
  }
120
120
 
121
- /** Replace an execution on the stream, indexed under its cell. */
121
+ /** Replace an execution without changing which execution its cell is running. */
122
122
  function set(state: Executions, execution: Execution): Executions {
123
- const { id, cell_id: cellId } = execution.record;
123
+ const { id } = execution.record;
124
124
  return {
125
125
  ...state,
126
126
  executions: new Map(state.executions).set(id, execution),
127
127
  scratchConsole: retainScratchConsole(state, execution),
128
- latest:
129
- cellId === null || state.latest.get(cellId) === id
130
- ? state.latest
131
- : new Map(state.latest).set(cellId, id),
132
128
  };
133
129
  }
134
130
 
@@ -139,13 +135,22 @@ function remove(state: Executions, id: Protocol.ExecutionId): Executions {
139
135
  }
140
136
  const cellId = execution.record.cell_id;
141
137
  const isLatest = cellId !== null && state.latest.get(cellId) === id;
138
+ const executions = without(state.executions, id);
139
+ let latest = state.latest;
140
+ if (isLatest) {
141
+ const retained = state.results.get(cellId);
142
+ latest =
143
+ retained && executions.has(retained.record.id)
144
+ ? new Map(latest).set(cellId, retained.record.id)
145
+ : without(latest, cellId);
146
+ }
142
147
  return {
143
148
  ...state,
144
- executions: without(state.executions, id),
149
+ executions,
150
+ latest,
145
151
  variables: isLatest ? without(state.variables, cellId) : state.variables,
146
152
  scratchConsole:
147
153
  state.scratchConsole?.record.id === id ? undefined : state.scratchConsole,
148
- latest: isLatest ? without(state.latest, cellId) : state.latest,
149
154
  };
150
155
  }
151
156
 
@@ -317,10 +322,10 @@ export const executions: NotebookResource<Executions, Kind> = {
317
322
  state.runs.has(data.id)
318
323
  ? { ...state, runs: without(state.runs, data.id) }
319
324
  : state,
320
- execution: (state, { data: { execution: record } }) => {
325
+ execution: (state, { data: { execution: record } }, { phase }) => {
321
326
  const previous = state.executions.get(record.id);
322
327
  const next = { record, output: previous?.output ?? null };
323
- return update(state, {
328
+ const updated = update(state, {
324
329
  ...next,
325
330
  outputVersion:
326
331
  previous === undefined
@@ -330,6 +335,24 @@ export const executions: NotebookResource<Executions, Kind> = {
330
335
  lastSeq: previous?.lastSeq,
331
336
  items: previous?.items ?? new Map(),
332
337
  });
338
+ const cellId = record.cell_id;
339
+ if (cellId === null || previous !== undefined) {
340
+ return updated;
341
+ }
342
+ const latest = state.latest.get(cellId);
343
+ // A snapshot can deliver the completed predecessor after its successor.
344
+ if (
345
+ phase === "snapshot" &&
346
+ latest !== undefined &&
347
+ record.state.status === "completed" &&
348
+ state.executions.get(latest)?.record.state.status !== "completed"
349
+ ) {
350
+ return updated;
351
+ }
352
+ return {
353
+ ...updated,
354
+ latest: new Map(state.latest).set(cellId, record.id),
355
+ };
333
356
  },
334
357
  "execution.removed": (state, { data }) => remove(state, data.id),
335
358
  output: (state, { data: { output } }) => {
@@ -13,21 +13,16 @@ export interface Result {
13
13
  }
14
14
 
15
15
  /**
16
- * Each document cell's last completed execution record.
16
+ * Each document cell's last completed execution that was not superseded.
17
17
  *
18
- * The host removes a cell's previous execution before it publishes the
19
- * next one. A result stays until a newer execution for the cell completes
20
- * or the cell leaves the document, so a cell can show its last outcome
21
- * while it runs again. The record, its output, and the output revision are
22
- * kept; the items and variables stay with the stream's copy of the execution.
18
+ * A superseded attempt leaves the previous result visible while its replacement
19
+ * is queued or running. The result holds the record, its output, and the
20
+ * output revision. Other items stay with the stream's copy of the execution.
23
21
  *
24
22
  * A cell has an entry from its `cell` event until its removal, null until
25
- * it completes once. Cells precede their executions on the stream, so a
23
+ * it has a result. Cells precede their executions on the stream, so a
26
24
  * completion for a cell without an entry belongs to a cell the document
27
25
  * no longer has.
28
- *
29
- * An execution the host skipped as superseded never ran, and a newer one
30
- * for the same cell is on its way, so it does not replace the result.
31
26
  */
32
27
  export type Results = ReadonlyMap<Protocol.CellId, Result | null>;
33
28