@marimo-team/islands 0.25.3-dev481 → 0.25.3-dev485

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 (38) hide show
  1. package/dist/{ErrorBoundary-VEwPi06B.js → ErrorBoundary-CodLzVG5.js} +1 -1
  2. package/dist/assets/__vite-browser-external-DZv_7F5P.js +1 -0
  3. package/dist/assets/{worker-DFvnFhLF.js → worker-cHYZNFD4.js} +2 -2
  4. package/dist/{chat-ui-LeUI9zli.js → chat-ui-Covffkhg.js} +7 -7
  5. package/dist/{code-visibility-D3Fzysn4.js → code-visibility-BauZWifR.js} +11 -11
  6. package/dist/{common-rNx_NjSU.js → common-DeBx86ld.js} +14 -14
  7. package/dist/{data-grid-overlay-editor-JtuxaR3K.js → data-grid-overlay-editor-BzEmIb3z.js} +1 -1
  8. package/dist/{error-entries--YT1ZOUW.js → error-entries-C4OopOce.js} +81 -62
  9. package/dist/{feedback-button-DLq5Sxk0.js → feedback-button-BTYGJiow.js} +135 -135
  10. package/dist/{glide-data-editor-DTvqUeZ9.js → glide-data-editor-Bcy2IE3H.js} +3 -3
  11. package/dist/{globals-DVNWDe7Y.js → globals-9AyCoAnh.js} +1 -1
  12. package/dist/{html-to-image-BMt1erSy.js → html-to-image-95V1hWZu.js} +32 -32
  13. package/dist/main.js +6048 -6020
  14. package/dist/{number-overlay-editor-CZ_t156n.js → number-overlay-editor-aEdDUAzH.js} +1 -1
  15. package/dist/{process-output-CNBGRz3r.js → process-output-DPHxrq7D.js} +2 -2
  16. package/dist/{reveal-component-glqW2Ys5.js → reveal-component-_1Vpg1lV.js} +2 -2
  17. package/package.json +1 -1
  18. package/src/__mocks__/executions.ts +2 -0
  19. package/src/__tests__/CellStatus.test.tsx +3 -3
  20. package/src/components/editor/cell/CellStatus.tsx +23 -38
  21. package/src/components/editor/notebook-cell.tsx +1 -1
  22. package/src/components/slides/slide-cell-view.tsx +1 -1
  23. package/src/core/executions/__tests__/atoms.test.ts +1 -41
  24. package/src/core/executions/__tests__/output-lifecycle.test.ts +1 -5
  25. package/src/core/executions/__tests__/select.test.ts +34 -2
  26. package/src/core/executions/atoms.ts +16 -31
  27. package/src/core/executions/hooks.ts +2 -3
  28. package/src/core/executions/index.ts +0 -1
  29. package/src/core/executions/select.ts +55 -2
  30. package/src/core/islands/bootstrap.ts +0 -8
  31. package/src/core/notebook/replica/replica.ts +50 -3
  32. package/src/core/notebook/replica/resources/analysis.ts +9 -0
  33. package/src/core/session/__tests__/backend.test.ts +3 -12
  34. package/src/core/session/__tests__/useNotebookSession.hook.test.tsx +84 -0
  35. package/src/core/session/backend.ts +4 -4
  36. package/src/core/session/useNotebookSession.tsx +0 -8
  37. package/src/stories/cell-status.stories.tsx +6 -6
  38. package/dist/assets/__vite-browser-external-DoIBUY2I.js +0 -1
@@ -747,51 +747,75 @@ function It(e, t) {
747
747
  return n === void 0 ? null : e.executions.get(n) ?? null;
748
748
  }
749
749
  function Lt(e, t) {
750
+ let n = /* @__PURE__ */ new Set(), r = [...t].filter((e) => e.config.disabled);
751
+ if (r.length === 0) return n;
752
+ let i = /* @__PURE__ */ new Map();
753
+ for (let t of Object.keys(e.cells)) i.set(t, []);
754
+ for (let [t, { parents: r }] of Object.entries(e.cells)) {
755
+ if (r === void 0) return n;
756
+ for (let e of r) i.get(e)?.push(t);
757
+ }
758
+ let a = /* @__PURE__ */ new Map();
759
+ for (let e of r) {
760
+ let t = /* @__PURE__ */ new Set([e.id]);
761
+ for (let r of t) {
762
+ r !== e.id && n.add(r);
763
+ let o = a.get(r) ?? 0;
764
+ if (o !== 2) {
765
+ a.set(r, o + 1);
766
+ for (let e of i.get(r) ?? []) t.add(e);
767
+ }
768
+ }
769
+ }
770
+ return n;
771
+ }
772
+ function Rt(e, t) {
750
773
  let n = e.cells.get(t);
751
774
  return n !== void 0 && !n.config.disabled && !e.blocked.has(t);
752
775
  }
753
- function Rt(e, t) {
754
- if (!Lt(e, t)) return !1;
776
+ function zt(e, t) {
777
+ if (!Rt(e, t)) return !1;
755
778
  if (e.requested.has(t)) return !0;
756
779
  let n = It(e.executions, t)?.record.run_id ?? e.results.get(t)?.record.run_id;
757
780
  for (let r of e.executions.runs.values()) if (r.state.status !== "completed" && r.id !== n && r.origin.kind === "cells" && r.origin.cell_ids.includes(t)) return !0;
758
781
  return !1;
759
782
  }
760
- function zt(e, t) {
783
+ function Bt(e, t) {
761
784
  let n = It(e.executions, t), r = e.results.get(t)?.record ?? null, i = "idle", a = r === null ? null : A(r), o = r === null ? null : j(r), s = Ft(a);
762
- n !== null && n.record.state.status !== "completed" ? (i = n.record.state.status, s = Ft(A(n.record)) ?? s) : Rt(e, t) && (i = "queued");
763
- let c = i === "idle", l = c && a !== null && o !== null ? Nt.parse(o).since(Nt.parse(a)) : null;
785
+ n !== null && n.record.state.status !== "completed" ? (i = n.record.state.status, s = Ft(A(n.record)) ?? s) : zt(e, t) && (i = "queued");
786
+ let c = i === "idle", l = c && a !== null && o !== null ? Nt.parse(o).since(Nt.parse(a)) : null, u = e.blocked.has(t);
764
787
  return {
765
788
  status: i,
766
- blocked: e.blocked.has(t),
789
+ blocked: u,
790
+ shownBlock: u ? "current" : e.shownBlocked.has(t) ? "stale" : null,
767
791
  outcome: c && r !== null ? Pt(r) : null,
768
792
  live: r === null || e.runtimeId === null || r.runtime_id === e.runtimeId,
769
793
  startedAt: s,
770
794
  duration: l
771
795
  };
772
796
  }
773
- function Bt(e) {
774
- return [...e.executions.values()].filter((e) => e.record.state.status !== "completed");
775
- }
776
797
  function Vt(e) {
777
- return Bt(e).some((e) => e.record.state.status === "running");
798
+ return [...e.executions.values()].filter((e) => e.record.state.status !== "completed");
778
799
  }
779
800
  function Ht(e) {
780
- let t = Bt(e.executions), n = new Set(t.flatMap((e) => e.record.cell_id === null ? [] : [e.record.cell_id])), r = new Set(e.requested);
801
+ return Vt(e).some((e) => e.record.state.status === "running");
802
+ }
803
+ function Ut(e) {
804
+ let t = Vt(e.executions), n = new Set(t.flatMap((e) => e.record.cell_id === null ? [] : [e.record.cell_id])), r = new Set(e.requested);
781
805
  for (let t of e.executions.runs.values()) if (t.state.status !== "completed" && t.origin.kind === "cells") for (let e of t.origin.cell_ids) r.add(e);
782
806
  let i = 0;
783
- for (let t of r) !n.has(t) && Rt(e, t) && (i += 1);
807
+ for (let t of r) !n.has(t) && zt(e, t) && (i += 1);
784
808
  return t.length + i;
785
809
  }
786
810
  //#endregion
787
811
  //#region src/core/executions/atoms.ts
788
- var Ut = {
812
+ var Wt = {
789
813
  runs: /* @__PURE__ */ new Map(),
790
814
  executions: /* @__PURE__ */ new Map(),
791
815
  latest: /* @__PURE__ */ new Map(),
792
816
  results: /* @__PURE__ */ new Map(),
793
817
  scratch: null
794
- }, Wt = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Map(), Gt = /* @__PURE__ */ new Set(), Kt = /* @__PURE__ */ new Set(), qt = /* @__PURE__ */ new Set(), Jt = /* @__PURE__ */ new Map(), L = x(null), Yt = x(null);
818
+ }, Gt = /* @__PURE__ */ new Map(), I = /* @__PURE__ */ new Map(), Kt = /* @__PURE__ */ new Set(), qt = /* @__PURE__ */ new Set(), Jt = /* @__PURE__ */ new Set(), Yt = /* @__PURE__ */ new Map(), L = x(null);
795
819
  function Xt(e, t) {
796
820
  return t !== null && e.replica === t.replica && e.id === t.id && e.generation === t.generation;
797
821
  }
@@ -810,50 +834,56 @@ function Qt(e, t) {
810
834
  return Xt(t.notebook, e.get(R));
811
835
  }
812
836
  var $t = x((e) => {
813
- let t = Zt(e(L), e(R), Gt);
814
- return t.size === 0 ? Kt : new Set([...t].flatMap((e) => e.cells));
837
+ let t = Zt(e(L), e(R), Kt);
838
+ return t.size === 0 ? qt : new Set([...t].flatMap((e) => e.cells));
839
+ }), en = x((e) => {
840
+ let t = e(h), n = t && e(t.analysisAtom), r = n ? Lt(n.analysis, n.document.cells.values()) : Jt;
841
+ return {
842
+ shownBlocked: r,
843
+ blocked: n?.freshness === "current" ? r : Jt
844
+ };
815
845
  }), z = x((e) => {
816
846
  let t = e(h), n = t === null ? null : e(t.shownDocumentAtom);
817
847
  return {
818
- executions: t === null ? Ut : e(t.executionsAtom),
819
- results: t === null ? Wt : e(t.resultsAtom),
848
+ executions: t === null ? Wt : e(t.executionsAtom),
849
+ results: t === null ? Gt : e(t.resultsAtom),
820
850
  cells: n?.cells ?? I,
821
851
  requested: e($t),
822
- blocked: Zt(e(Yt), e(R), qt),
852
+ ...e(en),
823
853
  runtimeId: t === null ? null : e(t.runtimeAtom)?.id ?? null
824
854
  };
825
- }), en = x((e) => {
855
+ }), tn = x((e) => {
826
856
  let t = e(h), n = t === null ? null : e(t.shownDocumentAtom);
827
857
  return t === null || n === null ? {
828
858
  cells: I,
829
- executions: Ut,
830
- results: Wt
859
+ executions: Wt,
860
+ results: Gt
831
861
  } : {
832
862
  cells: n.cells,
833
863
  executions: e(t.executionsAtom),
834
864
  results: e(t.resultsAtom)
835
865
  };
836
- }), tn = x((e) => gt(e(en))), nn = x(null), rn = x((e) => {
866
+ }), nn = x((e) => gt(e(tn))), rn = x(null), an = x((e) => {
837
867
  let t = e(h), n = t === null ? null : e(t.shownDocumentAtom);
838
868
  return t === null || n === null ? null : {
839
869
  replica: t,
840
870
  id: n.revision.notebook_id,
841
871
  generation: e(t.generationAtom)
842
872
  };
843
- }), an = x((e) => {
873
+ }), on = x((e) => {
844
874
  let t = e(h);
845
875
  return {
846
- executions: t === null ? Ut : e(t.executionsAtom),
847
- results: t === null ? Wt : e(t.resultsAtom),
848
- cleared: Zt(e(nn), e(rn), Jt),
876
+ executions: t === null ? Wt : e(t.executionsAtom),
877
+ results: t === null ? Gt : e(t.resultsAtom),
878
+ cleared: Zt(e(rn), e(an), Yt),
849
879
  cells: t === null ? I : e(t.documentAtom)?.cells ?? I
850
880
  };
851
- }), on = x((e) => Mt(e(an))), B = S((e) => _(on, (t) => t.get(e) ?? null, g)), sn = S((e) => x((t) => Ye(t(B(e)))));
852
- function cn(e) {
853
- B.remove(e), sn.remove(e);
881
+ }), sn = x((e) => Mt(e(on))), B = S((e) => _(sn, (t) => t.get(e) ?? null, g)), cn = S((e) => x((t) => Ye(t(B(e)))));
882
+ function ln(e) {
883
+ B.remove(e), cn.remove(e);
854
884
  }
855
- function ln(e, t) {
856
- let n = e.get(an), r = new Map(n.cleared);
885
+ function un(e, t) {
886
+ let n = e.get(on), r = new Map(n.cleared);
857
887
  for (let e of t) {
858
888
  let t = kt(n, e);
859
889
  t != null && k(t) !== null && r.set(e, {
@@ -861,18 +891,18 @@ function ln(e, t) {
861
891
  version: t.outputVersion
862
892
  });
863
893
  }
864
- let i = e.get(rn);
865
- e.set(nn, i === null ? null : {
894
+ let i = e.get(an);
895
+ e.set(rn, i === null ? null : {
866
896
  notebook: i,
867
897
  value: r
868
898
  });
869
899
  }
870
- var un = x((e) => {
900
+ var dn = x((e) => {
871
901
  let t = e(h);
872
902
  return t === null ? null : e(t.runtimeAtom)?.state.status ?? null;
873
903
  });
874
- x((e) => Vt(e(z).executions)), x((e) => Ht(e(z)));
875
- var dn = x((e) => {
904
+ x((e) => Ht(e(z).executions)), x((e) => Ut(e(z)));
905
+ var fn = x((e) => {
876
906
  let t = e(h);
877
907
  if (t === null) return { refused: "No notebook is connected" };
878
908
  if (e(t.connectionAtom).state === O.CLOSED) return { refused: "The notebook is disconnected" };
@@ -888,29 +918,29 @@ var dn = x((e) => {
888
918
  default: return "waiting";
889
919
  }
890
920
  });
891
- function fn(e) {
921
+ function pn(e) {
892
922
  return new Promise((t, n) => {
893
- let r = e.sub(dn, i);
923
+ let r = e.sub(fn, i);
894
924
  function i() {
895
- let i = e.get(dn);
925
+ let i = e.get(fn);
896
926
  i !== "waiting" && (r(), i === "running" ? t() : n(Error(i.refused)));
897
927
  }
898
928
  i();
899
929
  });
900
930
  }
901
- function pn(e, t) {
931
+ function mn(e, t) {
902
932
  let n = e.get(R);
903
933
  if (n === null) return null;
904
934
  let r = {
905
935
  notebook: n,
906
936
  cells: [...t]
907
- }, i = Zt(e.get(L), n, Gt);
937
+ }, i = Zt(e.get(L), n, Kt);
908
938
  return e.set(L, {
909
939
  notebook: n,
910
940
  value: new Set(i).add(r)
911
941
  }), r;
912
942
  }
913
- function mn(e, t) {
943
+ function hn(e, t) {
914
944
  let n = e.get(L);
915
945
  if (n === null || !n.value.has(t)) return;
916
946
  let r = new Set(n.value);
@@ -919,24 +949,13 @@ function mn(e, t) {
919
949
  value: r
920
950
  });
921
951
  }
922
- function hn(e, t, n) {
952
+ function gn(e, t, n) {
923
953
  let r = x((e) => Xt(t.notebook, e(R)) && !e(t.notebook.replica.executionsAtom).runs.has(n.id)), i = e.sub(r, a);
924
954
  function a() {
925
- e.get(r) || (i(), mn(e, t));
955
+ e.get(r) || (i(), hn(e, t));
926
956
  }
927
957
  a();
928
958
  }
929
- function gn(e, t, n) {
930
- let r = e.get(z).blocked;
931
- if (r.has(t) === n) return;
932
- let i = new Set(r);
933
- n ? i.add(t) : i.delete(t);
934
- let a = e.get(R);
935
- a !== null && e.set(Yt, {
936
- notebook: a,
937
- value: i
938
- });
939
- }
940
959
  //#endregion
941
960
  //#region src/core/codemirror/editing/commands.ts
942
961
  var _n = a();
@@ -2313,7 +2332,7 @@ function ci(e, t, n) {
2313
2332
  }
2314
2333
  function* li(e, t, n) {
2315
2334
  for (let r of e.cellIds) {
2316
- let i = zt(t, r), a = n(r), o = ci(i, a, e.cellData[r]);
2335
+ let i = Bt(t, r), a = n(r), o = ci(i, a, e.cellData[r]);
2317
2336
  o === null ? a.sourceChanged && di(t.executions, r) && (yield [r, "source"]) : yield [r, o];
2318
2337
  }
2319
2338
  }
@@ -3125,7 +3144,7 @@ var ha = pa((e) => {
3125
3144
  y.set(Z, (t) => fa(t, e));
3126
3145
  }).addLogs, $ = x((e) => e(Z).cellIds);
3127
3146
  x((e) => e($).length === 1), x((e) => ii(e(Z)).length > 0), x((e) => ai(e(Z)).length > 0), x((e) => oi(e(Z))), x((e) => si(e(Z)));
3128
- var ga = x((e) => ui(e(Z), e(z), e(tn)));
3147
+ var ga = x((e) => ui(e(Z), e(z), e(nn)));
3129
3148
  x((e) => e(ga) !== null);
3130
3149
  var _a = x((e) => {
3131
3150
  let { cellIds: t, cellData: n } = e(Z);
@@ -3148,11 +3167,11 @@ var _a = x((e) => {
3148
3167
  }), va = ce(x((e) => {
3149
3168
  let t = {};
3150
3169
  for (let n of e($)) {
3151
- let r = e(sn(n));
3170
+ let r = e(cn(n));
3152
3171
  r !== null && r.items.length > 0 && (t[n] = r);
3153
3172
  }
3154
3173
  return t;
3155
- })), ya = x((e) => Je(e($).map((t) => e(sn(t)))));
3174
+ })), ya = x((e) => Je(e($).map((t) => e(cn(t)))));
3156
3175
  x((e) => e(_a).length);
3157
3176
  var ba = ce(x((e) => {
3158
3177
  let { cellIds: t, cellData: n } = e(Z);
@@ -3176,7 +3195,7 @@ var Ea = S((e) => x((t) => t(Z).cellData[e])), Da = wr(), Oa = S((e) => {
3176
3195
  return x((e) => e(n).rendered);
3177
3196
  }), ka = S((e) => x((t) => t(Z).cellHandles[e]));
3178
3197
  function Aa(e) {
3179
- Ea.remove(e), Oa.remove(e), ka.remove(e), cn(e);
3198
+ Ea.remove(e), Oa.remove(e), ka.remove(e), ln(e);
3180
3199
  }
3181
3200
  var ja = (e) => {
3182
3201
  let { cellHandles: t } = y.get(Z);
@@ -3244,4 +3263,4 @@ function Va(e) {
3244
3263
  return e.tracebackHtml && t.push(G(e.tracebackHtml)), e.errorData.length > 0 && t.push(e.errorData.map(Ba).join("\n\n")), t.join("\n\n");
3245
3264
  }
3246
3265
  //#endregion
3247
- export { Zr as $, Qe as $t, ia as A, H as At, Fi as B, sn as Bt, oa as C, mr as Ct, aa as D, Bn as Dt, ca as E, rr as Et, Bi as F, kn as Ft, _i as G, pn as Gt, Oi as H, an as Ht, Li as I, An as It, fi as J, fn as Jt, hi as K, un as Kt, Ri as L, hn as Lt, Ui as M, Pn as Mt, Vi as N, Ln as Nt, X as O, Fn as Ot, zi as P, In as Pt, $r as Q, ft as Qt, Ni as R, z as Rt, Na as S, vr as St, la as T, G as Tt, Ti as U, ln as Ut, Di as V, B as Vt, bi as W, Qt as Wt, pi as X, zt as Xt, ri as Y, mn as Yt, mi as Z, pt as Zt, ya as _, Dr as _t, ha as a, Ce as an, Mr as at, xa as b, yr as bt, Oa as c, Hr as ct, ja as d, Gr as dt, O as en, Qr as et, Ta as f, zr as ft, Z as g, kr as gt, da as h, Br as ht, Ra as i, we as in, jr as it, na as j, V as jt, ra as k, Rn as kt, pa as l, Wr as lt, Ca as m, Vr as mt, Va as n, qe as nn, Xr as nt, Ea as o, Ur as ot, wa as p, Pr as pt, gi as q, gn as qt, Ba as r, He as rn, Yr as rt, $ as s, Nr as st, za as t, Xe as tn, K as tt, Ma as u, Kr as ut, fa as v, Er as vt, sa as w, ur as wt, Sa as x, xr as xt, Aa as y, br as yt, Pi as z, tn as zt };
3266
+ export { Zr as $, O as $t, ia as A, H as At, Fi as B, cn as Bt, oa as C, mr as Ct, aa as D, Bn as Dt, ca as E, rr as Et, Bi as F, kn as Ft, _i as G, mn as Gt, Oi as H, on as Ht, Li as I, An as It, fi as J, hn as Jt, hi as K, dn as Kt, Ri as L, gn as Lt, Ui as M, Pn as Mt, Vi as N, Ln as Nt, X as O, Fn as Ot, zi as P, In as Pt, $r as Q, Qe as Qt, Ni as R, z as Rt, Na as S, vr as St, la as T, G as Tt, Ti as U, un as Ut, Di as V, B as Vt, bi as W, Qt as Wt, pi as X, pt as Xt, ri as Y, Bt as Yt, mi as Z, ft as Zt, ya as _, Dr as _t, ha as a, Mr as at, xa as b, yr as bt, Oa as c, Hr as ct, ja as d, Gr as dt, Xe as en, Qr as et, Ta as f, zr as ft, Z as g, kr as gt, da as h, Br as ht, Ra as i, Ce as in, jr as it, na as j, V as jt, ra as k, Rn as kt, pa as l, Wr as lt, Ca as m, Vr as mt, Va as n, He as nn, Xr as nt, Ea as o, Ur as ot, wa as p, Pr as pt, gi as q, pn as qt, Ba as r, we as rn, Yr as rt, $ as s, Nr as st, za as t, qe as tn, K as tt, Ma as u, Kr as ut, fa as v, Er as vt, sa as w, ur as wt, Sa as x, xr as xt, Aa as y, br as yt, Pi as z, nn as zt };