@marimo-team/islands 0.25.3-dev413 → 0.25.3-dev416
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.
- package/dist/{ErrorBoundary-s3y6sc8K.js → ErrorBoundary-BY4PeenT.js} +1 -1
- package/dist/{code-visibility-CRGVFzTE.js → code-visibility-1wtkbKPI.js} +1 -1
- package/dist/{common-D_i-hATC.js → common-tsgJ9tSZ.js} +1 -1
- package/dist/{data-grid-overlay-editor-DS-udUg6.js → data-grid-overlay-editor-CMsUjGiE.js} +1 -1
- package/dist/{feedback-button-D175ATV-.js → feedback-button-RuYO6BFL.js} +2 -2
- package/dist/{glide-data-editor-BZczmk1g.js → glide-data-editor-Du1g3HJZ.js} +3 -3
- package/dist/{globals-CDMCoZBa.js → globals-D-pghEVY.js} +1 -1
- package/dist/main.js +153 -176
- package/dist/{number-overlay-editor-DIYw9-Ju.js → number-overlay-editor-CBmRSVfZ.js} +1 -1
- package/dist/{reveal-component-ChYfcWgk.js → reveal-component-Dg0LNdiW.js} +2 -2
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/__mocks__/requests.ts +0 -1
- package/src/components/pages/edit-page.tsx +0 -1
- package/src/components/variables/__tests__/variables-table.test.tsx +75 -0
- package/src/components/variables/variables-table.tsx +18 -10
- package/src/core/islands/bootstrap.ts +0 -2
- package/src/core/islands/bridge.ts +0 -5
- package/src/core/kernel/__tests__/handlers.test.ts +0 -2
- package/src/core/kernel/handlers.ts +3 -47
- package/src/core/network/requests-network.ts +0 -9
- package/src/core/network/requests-static.ts +0 -4
- package/src/core/network/requests-toasting.tsx +0 -1
- package/src/core/network/types.ts +0 -2
- package/src/core/run-app.tsx +0 -1
- package/src/core/session/__tests__/useNotebookSession.hook.test.tsx +0 -3
- package/src/core/session/useNotebookSession.tsx +3 -12
- package/src/core/wasm/bridge.ts +0 -4
package/dist/main.js
CHANGED
|
@@ -6,7 +6,7 @@ import { i as x, n as S, r as C, t as w } from "./copy-icon-BJpgGeTC.js";
|
|
|
6
6
|
import { B as T, Bt as E, Dt as D, E as O, F as k, Ft as A, Ht as j, I as M, It as N, L as P, Lt as F, M as I, O as L, Ot as R, P as z, Pt as B, R as ee, Rt as te, St as ne, Ut as re, X as ie, Y as ae, _ as oe, _t as se, a as ce, at as le, b as ue, c as de, ct as fe, gt as pe, i as me, it as he, j as ge, jt as _e, lt as ve, n as ye, nt as be, o as xe, pt as Se, q as Ce, rt as we, st as Te, ut as Ee, vt as De, xt as Oe, yt as ke, z as Ae, zt as je } from "./html-to-image-DRDPLn_a.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-DY2U4Rke.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-VVUHPhhG.js";
|
|
9
|
-
import { $t as ft, A as pt, At as mt, B as ht, Bt as gt, C as _t, Cn as vt, Ct 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, Mt as Vt, N as Ht, Nt as Ut, O as Wt, On as Gt, Ot as Kt, P as qt, Pt as Jt, Qt as Yt, R as Xt, Rt as Zt, S as Qt, Sn as $t, T as en, Tn as tn, Tt as nn, U as rn, Ut as an, V as on, Vt as sn, W as cn, Wt as ln, X as un, Xt as dn, Y as fn, Yt as pn, Z as mn, Zt as hn, _ as gn, _n, _t as vn, an as yn, at as bn, b as xn, bn as Sn, bt as Cn, c as wn, cn as Tn, ct as En, d as Dn, dn as On, dt as kn, en as An, f as jn, fn as Mn, ft as Nn, g as Pn, gn as Fn, gt as In, h as Ln, hn as Rn, ht as zn, in as Bn, it as Vn, j as Hn, jt as Un, k as Wn, kt as Gn, ln as Kn, lt as qn, m as Jn, mn as Yn, mt as Xn, nn as Zn, nt as Qn, on as $n, ot as er, p as tr, pn as nr, pt as rr, q as ir, qt as ar, r as or, rn as sr, rt as cr, sn as lr, st as ur, t as dr, tn as fr, tt as pr, u as mr, un as hr, ut as gr, v as _r, vn as vr, vt as yr, w as br, wn as xr, wt as Sr, x as Cr, xn as wr, y as Tr, yt as Er, z as Dr, zt as Or } from "./common-
|
|
9
|
+
import { $t as ft, A as pt, At as mt, B as ht, Bt as gt, C as _t, Cn as vt, Ct 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, Mt as Vt, N as Ht, Nt as Ut, O as Wt, On as Gt, Ot as Kt, P as qt, Pt as Jt, Qt as Yt, R as Xt, Rt as Zt, S as Qt, Sn as $t, T as en, Tn as tn, Tt as nn, U as rn, Ut as an, V as on, Vt as sn, W as cn, Wt as ln, X as un, Xt as dn, Y as fn, Yt as pn, Z as mn, Zt as hn, _ as gn, _n, _t as vn, an as yn, at as bn, b as xn, bn as Sn, bt as Cn, c as wn, cn as Tn, ct as En, d as Dn, dn as On, dt as kn, en as An, f as jn, fn as Mn, ft as Nn, g as Pn, gn as Fn, gt as In, h as Ln, hn as Rn, ht as zn, in as Bn, it as Vn, j as Hn, jt as Un, k as Wn, kt as Gn, ln as Kn, lt as qn, m as Jn, mn as Yn, mt as Xn, nn as Zn, nt as Qn, on as $n, ot as er, p as tr, pn as nr, pt as rr, q as ir, qt as ar, r as or, rn as sr, rt as cr, sn as lr, st as ur, t as dr, tn as fr, tt as pr, u as mr, un as hr, ut as gr, v as _r, vn as vr, vt as yr, w as br, wn as xr, wt as Sr, x as Cr, xn as wr, y as Tr, yt as Er, z as Dr, zt as Or } from "./common-tsgJ9tSZ.js";
|
|
10
10
|
import { a as kr, n as Ar, s as jr, t as Mr } from "./useLifecycle-CDeB28JV.js";
|
|
11
11
|
import { t as Nr } from "./check-Cy7tgHcN.js";
|
|
12
12
|
import { A as Pr, C as Fr, D as Ir, M as Lr, O as Rr, a as zr, c as Br, d as Vr, i as Hr, k as Ur, l as Wr, n as Gr, o as Kr, r as qr, s as Jr, t as Yr, w as Xr, x as Zr } from "./select-C9YSRW_M.js";
|
|
@@ -16,7 +16,7 @@ import { At as zi, B as Bi, Dt as Vi, E as Hi, Ft as Ui, G as Wi, Ht as Gi, J as
|
|
|
16
16
|
import { a as Da, d as Oa, i as ka, n as Aa, o as ja, r as Ma, s as Na, t as Pa, u as Fa } from "./process-output-Dox_yeXz.js";
|
|
17
17
|
import { t as Ia } from "./pencil-DM3KeZSc.js";
|
|
18
18
|
import { a as La, c as Ra, d as za, f as Ba, i as Va, l as Ha, r as Ua } from "./glide-utils-BRuD_rZU.js";
|
|
19
|
-
import { n as Wa, t as Ga } from "./globals-
|
|
19
|
+
import { n as Wa, t as Ga } from "./globals-D-pghEVY.js";
|
|
20
20
|
import { a as Ka, i as qa, n as Ja, r as Ya, s as Xa, t as Za } from "./assertNever-mSPR3shX.js";
|
|
21
21
|
import { t as Qa } from "./react-dom-DdqGVp5N.js";
|
|
22
22
|
import { t as $a } from "./jsx-runtime-D8btoEHk.js";
|
|
@@ -40,10 +40,10 @@ import { n as Xs, t as Zs } from "./esm-Bwp_FHP0.js";
|
|
|
40
40
|
import { p as Qs } from "./dist-DpYpG8Yc.js";
|
|
41
41
|
import { t as $s } from "./useAsyncData-P5-Oovhq.js";
|
|
42
42
|
import { n as ec, r as tc, t as nc } from "./useDeepCompareMemoize-MdvXCwAP.js";
|
|
43
|
-
import { t as rc } from "./ErrorBoundary-
|
|
43
|
+
import { t as rc } from "./ErrorBoundary-BY4PeenT.js";
|
|
44
44
|
import { G as ic, W as ac } from "./vega-loader.browser-Co9gYE8Z.js";
|
|
45
45
|
import { a as oc, n as sc } from "./loader-Bin_dutt.js";
|
|
46
|
-
import { a as cc, c as lc, i as uc, l as dc, o as fc, s as pc, t as mc } from "./code-visibility-
|
|
46
|
+
import { a as cc, c as lc, i as uc, l as dc, o as fc, s as pc, t as mc } from "./code-visibility-1wtkbKPI.js";
|
|
47
47
|
import { t as hc } 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 gc = Object.freeze({
|
|
@@ -12958,7 +12958,7 @@ function pO(e, t) {
|
|
|
12958
12958
|
}
|
|
12959
12959
|
//#endregion
|
|
12960
12960
|
//#region src/plugins/impl/DataEditorPlugin.tsx
|
|
12961
|
-
var mO = J.lazy(() => import("./glide-data-editor-
|
|
12961
|
+
var mO = J.lazy(() => import("./glide-data-editor-Du1g3HJZ.js").then((e) => e.t)), hO = YE("marimo-data-editor", { cssStyles: [vD, yD] }).withData(K({
|
|
12962
12962
|
initialValue: K({ edits: U(K({
|
|
12963
12963
|
rowIdx: G(),
|
|
12964
12964
|
columnId: W(),
|
|
@@ -32704,7 +32704,7 @@ function _U(e) {
|
|
|
32704
32704
|
}
|
|
32705
32705
|
//#endregion
|
|
32706
32706
|
//#region src/components/editor/renderers/slides-layout/slides-layout.tsx
|
|
32707
|
-
var vU = J.lazy(() => import("./reveal-component-
|
|
32707
|
+
var vU = J.lazy(() => import("./reveal-component-Dg0LNdiW.js")), yU = (e) => {
|
|
32708
32708
|
let t = (0, X.c)(33), { layout: n, setLayout: r, cells: i, mode: a } = e, o = xo(Ls), s = a === "read" || o, c = xo(la) > 1, [l, u] = (0, J.useState)(null), d;
|
|
32709
32709
|
t[0] !== i || t[1] !== n ? (d = hz(i, n), t[0] = i, t[1] = n, t[2] = d) : d = t[2];
|
|
32710
32710
|
let { slideCells: f, skippedIds: p, noOutputIds: m, slideTypes: h, startCellIndex: g } = d, _;
|
|
@@ -33805,46 +33805,26 @@ function TW(e, t, n) {
|
|
|
33805
33805
|
data: i.layoutData[i.selectedLayout]
|
|
33806
33806
|
}), i;
|
|
33807
33807
|
}
|
|
33808
|
-
function EW() {
|
|
33809
|
-
let
|
|
33810
|
-
|
|
33811
|
-
|
|
33812
|
-
|
|
33813
|
-
|
|
33814
|
-
|
|
33815
|
-
};
|
|
33816
|
-
}
|
|
33817
|
-
function DW(e, t) {
|
|
33818
|
-
let { autoInstantiate: n, cells: r, resetCellRuntimes: i, setLayoutData: a, setCapabilities: o, onError: s } = t, { resumed: c, ui_values: l, capabilities: u, auto_instantiated: d } = e;
|
|
33819
|
-
i();
|
|
33820
|
-
let f = TW(e, r, a);
|
|
33821
|
-
if (o(u), d) return f;
|
|
33822
|
-
if (c) {
|
|
33823
|
-
for (let [e, t] of ws.entries(l || {})) {
|
|
33824
|
-
let n = e;
|
|
33825
|
-
nx.set(n, t);
|
|
33826
|
-
}
|
|
33827
|
-
return f;
|
|
33808
|
+
function EW(e, t) {
|
|
33809
|
+
let { cells: n, resetCellRuntimes: r, setLayoutData: i, setCapabilities: a } = t, { resumed: o, ui_values: s, capabilities: c } = e;
|
|
33810
|
+
r();
|
|
33811
|
+
let l = TW(e, n, i);
|
|
33812
|
+
if (a(c), o) for (let [e, t] of ws.entries(s || {})) {
|
|
33813
|
+
let n = e;
|
|
33814
|
+
nx.set(n, t);
|
|
33828
33815
|
}
|
|
33829
|
-
|
|
33830
|
-
return ta().sendInstantiate({
|
|
33831
|
-
objectIds: p,
|
|
33832
|
-
values: m,
|
|
33833
|
-
autoRun: n
|
|
33834
|
-
}).catch((e) => {
|
|
33835
|
-
s(Error("Failed to instantiate", { cause: e }));
|
|
33836
|
-
}), f;
|
|
33816
|
+
return l;
|
|
33837
33817
|
}
|
|
33838
|
-
function
|
|
33818
|
+
function DW(e) {
|
|
33839
33819
|
let t = e.cell_id;
|
|
33840
33820
|
nx.removeElementsByCell(t), XU.INSTANCE.removeForCellId(t);
|
|
33841
33821
|
}
|
|
33842
|
-
function
|
|
33822
|
+
function OW(e, t) {
|
|
33843
33823
|
t(e), XU.INSTANCE.track(e);
|
|
33844
33824
|
}
|
|
33845
33825
|
//#endregion
|
|
33846
33826
|
//#region src/core/kernel/queryParamHandlers.ts
|
|
33847
|
-
var
|
|
33827
|
+
var kW = {
|
|
33848
33828
|
append: (e) => {
|
|
33849
33829
|
let t = new URL(window.location.href);
|
|
33850
33830
|
t.searchParams.append(e.key, e.value), window.history.pushState({}, "", `${t.pathname}${t.search}`);
|
|
@@ -33861,7 +33841,7 @@ var AW = {
|
|
|
33861
33841
|
let e = new URL(window.location.href);
|
|
33862
33842
|
e.search = "", window.history.pushState({}, "", `${e.pathname}${e.search}`);
|
|
33863
33843
|
}
|
|
33864
|
-
},
|
|
33844
|
+
}, AW = class e {
|
|
33865
33845
|
hasStarted = !1;
|
|
33866
33846
|
static get INSTANCE() {
|
|
33867
33847
|
let t = "_marimo_private_RuntimeState";
|
|
@@ -33893,18 +33873,18 @@ var AW = {
|
|
|
33893
33873
|
c.warn(e);
|
|
33894
33874
|
});
|
|
33895
33875
|
};
|
|
33896
|
-
},
|
|
33897
|
-
function
|
|
33898
|
-
let n = [...e.querySelectorAll(Ru.ISLAND)], r =
|
|
33876
|
+
}, jW = /* @__PURE__ */ new WeakMap();
|
|
33877
|
+
function MW(e = document, t = {}) {
|
|
33878
|
+
let n = [...e.querySelectorAll(Ru.ISLAND)], r = GW(e);
|
|
33899
33879
|
if (n.length === 0) return c.warn("No embedded marimo apps found."), [];
|
|
33900
33880
|
let i = t.materialize ?? !0;
|
|
33901
|
-
return r.length > 0 ?
|
|
33881
|
+
return r.length > 0 ? PW({
|
|
33902
33882
|
embeds: n,
|
|
33903
33883
|
materialize: i,
|
|
33904
33884
|
payloads: r
|
|
33905
|
-
}) :
|
|
33885
|
+
}) : NW(n, i);
|
|
33906
33886
|
}
|
|
33907
|
-
function
|
|
33887
|
+
function NW(e, t = !0) {
|
|
33908
33888
|
let n = /* @__PURE__ */ new Map();
|
|
33909
33889
|
for (let r of e) {
|
|
33910
33890
|
let e = r.getAttribute(Vu.APP_ID);
|
|
@@ -33913,7 +33893,7 @@ function PW(e, t = !0) {
|
|
|
33913
33893
|
continue;
|
|
33914
33894
|
}
|
|
33915
33895
|
if (r.getAttribute(Vu.REACTIVE) !== "true") continue;
|
|
33916
|
-
let i =
|
|
33896
|
+
let i = BW(r);
|
|
33917
33897
|
if (!i) {
|
|
33918
33898
|
c.warn(`Embedded marimo app ${e} missing cell output or code.`);
|
|
33919
33899
|
continue;
|
|
@@ -33932,18 +33912,18 @@ function PW(e, t = !0) {
|
|
|
33932
33912
|
}
|
|
33933
33913
|
return [...n.values()];
|
|
33934
33914
|
}
|
|
33935
|
-
function
|
|
33915
|
+
function PW({ embeds: e, materialize: t, payloads: n }) {
|
|
33936
33916
|
let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set(), o = [];
|
|
33937
33917
|
for (let r of n) {
|
|
33938
33918
|
let n = !1;
|
|
33939
33919
|
for (let o of r.cells) {
|
|
33940
|
-
let s =
|
|
33920
|
+
let s = FW({
|
|
33941
33921
|
embeds: e,
|
|
33942
33922
|
appId: r.appId,
|
|
33943
33923
|
cell: o,
|
|
33944
33924
|
consumedEmbeds: a
|
|
33945
33925
|
});
|
|
33946
|
-
s && (a.add(s), i.set(o, s), t &&
|
|
33926
|
+
s && (a.add(s), i.set(o, s), t && IW(s, o), n = !0);
|
|
33947
33927
|
}
|
|
33948
33928
|
n && o.push(r);
|
|
33949
33929
|
}
|
|
@@ -33978,38 +33958,38 @@ function FW({ embeds: e, materialize: t, payloads: n }) {
|
|
|
33978
33958
|
return !t || !s.has(t);
|
|
33979
33959
|
});
|
|
33980
33960
|
if (t) for (let e of a) e.dispatchEvent(new Event(Bu));
|
|
33981
|
-
return [...r.values(), ...
|
|
33961
|
+
return [...r.values(), ...NW(l, t)];
|
|
33982
33962
|
}
|
|
33983
|
-
function
|
|
33984
|
-
return e.find((e) => !r.has(e) && e.getAttribute(Vu.APP_ID) === t && (e.getAttribute(Vu.CELL_ID) ??
|
|
33963
|
+
function FW({ embeds: e, appId: t, cell: n, consumedEmbeds: r }) {
|
|
33964
|
+
return e.find((e) => !r.has(e) && e.getAttribute(Vu.APP_ID) === t && (e.getAttribute(Vu.CELL_ID) ?? jW.get(e)) === n.cellId);
|
|
33985
33965
|
}
|
|
33986
|
-
function
|
|
33987
|
-
|
|
33988
|
-
let n =
|
|
33966
|
+
function IW(e, t) {
|
|
33967
|
+
jW.set(e, t.cellId), e.setAttribute(Vu.REACTIVE, JSON.stringify(t.reactive)), e.removeAttribute(Vu.CELL_ID), t.reactive || e.removeAttribute(Vu.CELL_IDX);
|
|
33968
|
+
let n = LW(e, Ru.CELL_OUTPUT);
|
|
33989
33969
|
n.innerHTML = t.displayOutput ? t.outputHtml : "";
|
|
33990
|
-
let r =
|
|
33970
|
+
let r = LW(e, Ru.CELL_CODE);
|
|
33991
33971
|
r.hidden = !0, r.textContent = encodeURIComponent(t.code);
|
|
33992
33972
|
let i = e.querySelector(Ru.CODE_EDITOR);
|
|
33993
33973
|
i && i.setAttribute("data-initial-value", JSON.stringify(t.code));
|
|
33994
33974
|
}
|
|
33995
|
-
function
|
|
33975
|
+
function LW(e, t) {
|
|
33996
33976
|
let n = e.querySelector(t);
|
|
33997
33977
|
return n || (n = e.ownerDocument.createElement(t), e.appendChild(n)), n;
|
|
33998
33978
|
}
|
|
33999
|
-
var
|
|
34000
|
-
function
|
|
34001
|
-
t.code ?
|
|
33979
|
+
var RW = /* @__PURE__ */ new WeakMap();
|
|
33980
|
+
function zW(e, t) {
|
|
33981
|
+
t.code ? RW.set(e, t) : RW.delete(e);
|
|
34002
33982
|
}
|
|
34003
|
-
function
|
|
34004
|
-
let t = e.querySelector(Ru.CELL_OUTPUT), n =
|
|
33983
|
+
function BW(e) {
|
|
33984
|
+
let t = e.querySelector(Ru.CELL_OUTPUT), n = WW(e);
|
|
34005
33985
|
if (t && n) return {
|
|
34006
33986
|
output: t.innerHTML,
|
|
34007
33987
|
code: n
|
|
34008
33988
|
};
|
|
34009
|
-
let r =
|
|
33989
|
+
let r = RW.get(e);
|
|
34010
33990
|
return r?.code ? r : null;
|
|
34011
33991
|
}
|
|
34012
|
-
function
|
|
33992
|
+
function VW(e) {
|
|
34013
33993
|
let t = [
|
|
34014
33994
|
"import marimo",
|
|
34015
33995
|
"app = marimo.App()",
|
|
@@ -34020,7 +34000,7 @@ function HW(e) {
|
|
|
34020
34000
|
];
|
|
34021
34001
|
return e.dependencies?.length && t.unshift("# /// script", `# dependencies = ${JSON.stringify(e.dependencies)}`, "# ///"), t.join("\n");
|
|
34022
34002
|
}
|
|
34023
|
-
function
|
|
34003
|
+
function HW(e) {
|
|
34024
34004
|
if (!e) return "";
|
|
34025
34005
|
try {
|
|
34026
34006
|
return `${JSON.parse(e)}`;
|
|
@@ -34028,47 +34008,47 @@ function UW(e) {
|
|
|
34028
34008
|
return e;
|
|
34029
34009
|
}
|
|
34030
34010
|
}
|
|
34031
|
-
function
|
|
34011
|
+
function UW(e) {
|
|
34032
34012
|
return e ? decodeURIComponent(e).trim() : "";
|
|
34033
34013
|
}
|
|
34034
|
-
function
|
|
34014
|
+
function WW(e) {
|
|
34035
34015
|
if (e.getAttribute(Vu.REACTIVE) !== "true") return "";
|
|
34036
34016
|
let t = e.querySelector(Ru.CELL_CODE);
|
|
34037
|
-
if (t) return
|
|
34017
|
+
if (t) return UW(t.textContent);
|
|
34038
34018
|
let n = e.querySelector(Ru.CODE_EDITOR);
|
|
34039
|
-
return n ?
|
|
34019
|
+
return n ? HW(n.getAttribute("data-initial-value")) : "";
|
|
34040
34020
|
}
|
|
34041
|
-
function
|
|
34021
|
+
function GW(e) {
|
|
34042
34022
|
let t = e.querySelectorAll(`script[type="${zu}"]`), n = [];
|
|
34043
34023
|
for (let e of t) {
|
|
34044
|
-
if (
|
|
34045
|
-
let t =
|
|
34024
|
+
if (KW(e)) continue;
|
|
34025
|
+
let t = qW(e.textContent);
|
|
34046
34026
|
t && n.push(t);
|
|
34047
34027
|
}
|
|
34048
34028
|
return n;
|
|
34049
34029
|
}
|
|
34050
|
-
function
|
|
34030
|
+
function KW(e) {
|
|
34051
34031
|
return !!(e.closest(Ru.ISLAND) || e.closest(Ru.CELL_OUTPUT));
|
|
34052
34032
|
}
|
|
34053
|
-
function
|
|
34033
|
+
function qW(e) {
|
|
34054
34034
|
if (!e) return null;
|
|
34055
34035
|
try {
|
|
34056
34036
|
let t = JSON.parse(e);
|
|
34057
|
-
if (
|
|
34037
|
+
if (JW(t)) return t;
|
|
34058
34038
|
} catch {
|
|
34059
34039
|
return null;
|
|
34060
34040
|
}
|
|
34061
34041
|
return null;
|
|
34062
34042
|
}
|
|
34063
|
-
function
|
|
34064
|
-
return he(e) ? e.schemaVersion === 1 && typeof e.appId == "string" && (e.dependencies === void 0 || Array.isArray(e.dependencies) && e.dependencies.every((e) => typeof e == "string")) && Array.isArray(e.cells) && e.cells.every(
|
|
34043
|
+
function JW(e) {
|
|
34044
|
+
return he(e) ? e.schemaVersion === 1 && typeof e.appId == "string" && (e.dependencies === void 0 || Array.isArray(e.dependencies) && e.dependencies.every((e) => typeof e == "string")) && Array.isArray(e.cells) && e.cells.every(YW) : !1;
|
|
34065
34045
|
}
|
|
34066
|
-
function
|
|
34046
|
+
function YW(e) {
|
|
34067
34047
|
return he(e) ? typeof e.cellId == "string" && typeof e.code == "string" && typeof e.outputHtml == "string" && typeof e.outputMimetype == "string" && typeof e.reactive == "boolean" && typeof e.displayCode == "boolean" && typeof e.displayOutput == "boolean" : !1;
|
|
34068
34048
|
}
|
|
34069
34049
|
//#endregion
|
|
34070
34050
|
//#region src/core/islands/components/IslandControls.tsx
|
|
34071
|
-
var
|
|
34051
|
+
var XW = (e) => {
|
|
34072
34052
|
let t = (0, X.c)(6), { tooltip: n, icon: r, action: i } = e, a;
|
|
34073
34053
|
t[0] !== i || t[1] !== r ? (a = /* @__PURE__ */ (0, Y.jsx)(_, {
|
|
34074
34054
|
size: "icon",
|
|
@@ -34083,7 +34063,7 @@ var ZW = (e) => {
|
|
|
34083
34063
|
delayDuration: 200,
|
|
34084
34064
|
children: a
|
|
34085
34065
|
}), t[3] = a, t[4] = n, t[5] = o) : o = t[5], o;
|
|
34086
|
-
},
|
|
34066
|
+
}, ZW = (e) => {
|
|
34087
34067
|
let t = (0, X.c)(19), { cellId: n, codeCallback: r, visible: i } = e, a = lo(), o = xo(hs), s;
|
|
34088
34068
|
t[0] === r ? s = t[1] : (s = () => {
|
|
34089
34069
|
S(r());
|
|
@@ -34106,7 +34086,7 @@ var ZW = (e) => {
|
|
|
34106
34086
|
let m;
|
|
34107
34087
|
t[9] === Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ (0, Y.jsx)(C, { className: "size-3" }), t[9] = m) : m = t[9];
|
|
34108
34088
|
let h;
|
|
34109
|
-
t[10] === l ? h = t[11] : (h = /* @__PURE__ */ (0, Y.jsx)(
|
|
34089
|
+
t[10] === l ? h = t[11] : (h = /* @__PURE__ */ (0, Y.jsx)(XW, {
|
|
34110
34090
|
tooltip: "Copy code",
|
|
34111
34091
|
icon: m,
|
|
34112
34092
|
action: l
|
|
@@ -34114,7 +34094,7 @@ var ZW = (e) => {
|
|
|
34114
34094
|
let g;
|
|
34115
34095
|
t[12] === Symbol.for("react.memo_cache_sentinel") ? (g = /* @__PURE__ */ (0, Y.jsx)(md, { className: "size-3" }), t[12] = g) : g = t[12];
|
|
34116
34096
|
let _;
|
|
34117
|
-
t[13] === d ? _ = t[14] : (_ = /* @__PURE__ */ (0, Y.jsx)(
|
|
34097
|
+
t[13] === d ? _ = t[14] : (_ = /* @__PURE__ */ (0, Y.jsx)(XW, {
|
|
34118
34098
|
tooltip: "Re-run cell",
|
|
34119
34099
|
icon: g,
|
|
34120
34100
|
action: d
|
|
@@ -34128,9 +34108,9 @@ var ZW = (e) => {
|
|
|
34128
34108
|
};
|
|
34129
34109
|
//#endregion
|
|
34130
34110
|
//#region src/core/islands/components/useIslandControls.ts
|
|
34131
|
-
function
|
|
34111
|
+
function QW(e) {
|
|
34132
34112
|
let t = (0, X.c)(18), [n, r] = (0, J.useState)(e), i;
|
|
34133
|
-
t[0] === e ? i = t[1] : (i = (t) => e ?
|
|
34113
|
+
t[0] === e ? i = t[1] : (i = (t) => e ? $W : t, t[0] = e, t[1] = i);
|
|
34134
34114
|
let a = i, o;
|
|
34135
34115
|
t[2] === e ? o = t[3] : (o = (t) => {
|
|
34136
34116
|
!e && (t.metaKey || t.ctrlKey) && r(!0);
|
|
@@ -34152,12 +34132,12 @@ function $W(e) {
|
|
|
34152
34132
|
let m;
|
|
34153
34133
|
return t[16] === a ? m = t[17] : (m = a(p), t[16] = a, t[17] = m), u(window, "mouseleave", m), n;
|
|
34154
34134
|
}
|
|
34155
|
-
function
|
|
34135
|
+
function $W() {}
|
|
34156
34136
|
//#endregion
|
|
34157
34137
|
//#region src/core/islands/components/output-wrapper.tsx
|
|
34158
|
-
var
|
|
34159
|
-
let t = (0, X.c)(15), { cellId: n, codeCallback: r, alwaysShowRun: i, children: a } = e, o =
|
|
34160
|
-
if (
|
|
34138
|
+
var eG = (e) => {
|
|
34139
|
+
let t = (0, X.c)(15), { cellId: n, codeCallback: r, alwaysShowRun: i, children: a } = e, o = QW(i), s = (0, J.useRef)(null), c = Tn(n), l = lr(n), u = xo(cc), { status: d } = yn(n);
|
|
34140
|
+
if (tG(s, d), !u || c === null && !l) {
|
|
34161
34141
|
let e;
|
|
34162
34142
|
return t[0] === a ? e = t[1] : (e = /* @__PURE__ */ (0, Y.jsx)("div", {
|
|
34163
34143
|
ref: s,
|
|
@@ -34172,9 +34152,9 @@ var tG = (e) => {
|
|
|
34172
34152
|
let f;
|
|
34173
34153
|
t[3] === c ? f = t[4] : (f = /* @__PURE__ */ (0, Y.jsx)(tr, { message: c }), t[3] = c, t[4] = f);
|
|
34174
34154
|
let p;
|
|
34175
|
-
t[5] === d ? p = t[6] : (p = /* @__PURE__ */ (0, Y.jsx)(
|
|
34155
|
+
t[5] === d ? p = t[6] : (p = /* @__PURE__ */ (0, Y.jsx)(nG, { status: d }), t[5] = d, t[6] = p);
|
|
34176
34156
|
let m;
|
|
34177
|
-
t[7] !== n || t[8] !== r || t[9] !== o ? (m = /* @__PURE__ */ (0, Y.jsx)(
|
|
34157
|
+
t[7] !== n || t[8] !== r || t[9] !== o ? (m = /* @__PURE__ */ (0, Y.jsx)(ZW, {
|
|
34178
34158
|
cellId: n,
|
|
34179
34159
|
codeCallback: r,
|
|
34180
34160
|
visible: o
|
|
@@ -34190,29 +34170,29 @@ var tG = (e) => {
|
|
|
34190
34170
|
]
|
|
34191
34171
|
}), t[11] = f, t[12] = p, t[13] = m, t[14] = h) : h = t[14], h;
|
|
34192
34172
|
};
|
|
34193
|
-
function
|
|
34173
|
+
function tG(e, t) {
|
|
34194
34174
|
let n = (0, X.c)(4), r, i;
|
|
34195
34175
|
n[0] !== e || n[1] !== t ? (r = () => {
|
|
34196
34176
|
(e.current?.closest(Ru.ISLAND))?.setAttribute("data-status", t);
|
|
34197
34177
|
}, i = [e, t], n[0] = e, n[1] = t, n[2] = r, n[3] = i) : (r = n[2], i = n[3]), (0, J.useEffect)(r, i);
|
|
34198
34178
|
}
|
|
34199
|
-
var
|
|
34179
|
+
var nG = (e) => {
|
|
34200
34180
|
let t = (0, X.c)(1), { status: n } = e;
|
|
34201
34181
|
if (n === "running") {
|
|
34202
34182
|
let e;
|
|
34203
|
-
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, Y.jsx)(
|
|
34183
|
+
return t[0] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ (0, Y.jsx)(rG, { children: /* @__PURE__ */ (0, Y.jsx)("div", {
|
|
34204
34184
|
className: "absolute top-1 right-1",
|
|
34205
34185
|
children: /* @__PURE__ */ (0, Y.jsx)(B, { className: "animate-spin size-4" })
|
|
34206
34186
|
}) }), t[0] = e) : e = t[0], e;
|
|
34207
34187
|
}
|
|
34208
34188
|
return null;
|
|
34209
|
-
},
|
|
34189
|
+
}, rG = (e) => {
|
|
34210
34190
|
let t = (0, X.c)(2), { children: n } = e, r;
|
|
34211
34191
|
return t[0] === n ? r = t[1] : (r = /* @__PURE__ */ (0, Y.jsx)("div", {
|
|
34212
34192
|
className: "animate-delayed-show-200",
|
|
34213
34193
|
children: n
|
|
34214
34194
|
}), t[0] = n, t[1] = r), r;
|
|
34215
|
-
},
|
|
34195
|
+
}, iG = class e extends HTMLElement {
|
|
34216
34196
|
connectionGeneration = 0;
|
|
34217
34197
|
root;
|
|
34218
34198
|
renderConfig;
|
|
@@ -34243,7 +34223,7 @@ var rG = (e) => {
|
|
|
34243
34223
|
if (t) return this.getCellIdFromIndex(Number.parseInt(t, 10));
|
|
34244
34224
|
}
|
|
34245
34225
|
get code() {
|
|
34246
|
-
return
|
|
34226
|
+
return WW(this);
|
|
34247
34227
|
}
|
|
34248
34228
|
getCellIdFromIndex(e) {
|
|
34249
34229
|
let { cellIds: t } = ds.get(ma);
|
|
@@ -34270,7 +34250,7 @@ var rG = (e) => {
|
|
|
34270
34250
|
}
|
|
34271
34251
|
extractRenderConfig() {
|
|
34272
34252
|
let t = this.querySelectorOrThrow(e.outputTagName).innerHTML, n = this.getOptionalEditor(), r = this.code;
|
|
34273
|
-
|
|
34253
|
+
zW(this, {
|
|
34274
34254
|
code: r,
|
|
34275
34255
|
output: t
|
|
34276
34256
|
});
|
|
@@ -34290,7 +34270,7 @@ var rG = (e) => {
|
|
|
34290
34270
|
let { html: t, codeCallback: n, editor: r } = e, i = this.runtimeCellId, a = !!r, o = t.trim(), s = o === "<span></span>" || o === "" ? null : I({ html: o });
|
|
34291
34271
|
i ? this.root?.render(/* @__PURE__ */ (0, Y.jsx)(rc, { children: /* @__PURE__ */ (0, Y.jsx)(go, {
|
|
34292
34272
|
store: ds,
|
|
34293
|
-
children: /* @__PURE__ */ (0, Y.jsx)(ix, { children: /* @__PURE__ */ (0, Y.jsxs)(Fe, { children: [/* @__PURE__ */ (0, Y.jsx)(
|
|
34273
|
+
children: /* @__PURE__ */ (0, Y.jsx)(ix, { children: /* @__PURE__ */ (0, Y.jsxs)(Fe, { children: [/* @__PURE__ */ (0, Y.jsx)(eG, {
|
|
34294
34274
|
cellId: i,
|
|
34295
34275
|
codeCallback: n,
|
|
34296
34276
|
alwaysShowRun: a,
|
|
@@ -34318,16 +34298,16 @@ var rG = (e) => {
|
|
|
34318
34298
|
let e = this.root;
|
|
34319
34299
|
this.root = void 0, e && queueMicrotask(() => e.unmount());
|
|
34320
34300
|
}
|
|
34321
|
-
},
|
|
34322
|
-
function
|
|
34323
|
-
|
|
34301
|
+
}, aG = !1, oG;
|
|
34302
|
+
function sG() {
|
|
34303
|
+
aG || (aG = !0, oG = document.createElement("div"), oG.classList.add("marimo-islands-loading-toast"), oG.textContent = "⚡ reactivity initializing...", oG.style.position = "fixed", oG.style.top = "0.5rem", oG.style.left = "50%", oG.style.transform = "translateX(-50%)", oG.style.zIndex = "1000", oG.style.backgroundColor = "#0f172a", oG.style.color = "#f8fafc", oG.style.padding = "0.25rem 0.5rem", oG.style.borderRadius = "0.5rem", oG.style.fontSize = "0.875rem", document.body.append(oG));
|
|
34324
34304
|
}
|
|
34325
|
-
function
|
|
34326
|
-
|
|
34305
|
+
function cG() {
|
|
34306
|
+
oG && oG.remove();
|
|
34327
34307
|
}
|
|
34328
34308
|
//#endregion
|
|
34329
34309
|
//#region src/core/islands/bootstrap.ts
|
|
34330
|
-
async function
|
|
34310
|
+
async function lG(e) {
|
|
34331
34311
|
let t = e.store || ds, n = e.root || document, r = e.bridge;
|
|
34332
34312
|
t.set(Wi, r), t.set(Fs, "read"), t.set(pc, null), e.autoInitializePlugins !== !1 && KL();
|
|
34333
34313
|
let i = Array.from(n.querySelectorAll(Ru.ISLAND));
|
|
@@ -34343,14 +34323,14 @@ async function uG(e) {
|
|
|
34343
34323
|
t.sub(lc, () => {
|
|
34344
34324
|
let e = t.get(lc), r = n.querySelectorAll(Ru.ISLAND);
|
|
34345
34325
|
if (e) {
|
|
34346
|
-
|
|
34326
|
+
sG();
|
|
34347
34327
|
for (let e of r) e.style.setProperty("opacity", "0.5");
|
|
34348
34328
|
} else {
|
|
34349
|
-
|
|
34329
|
+
cG();
|
|
34350
34330
|
for (let e of r) e.style.removeProperty("opacity");
|
|
34351
34331
|
}
|
|
34352
34332
|
}), r.consumeNotifications((e, n) => {
|
|
34353
|
-
|
|
34333
|
+
uG(e, o, t, n);
|
|
34354
34334
|
});
|
|
34355
34335
|
let s = t_(t);
|
|
34356
34336
|
s.connect(r.notebookBackend, { onNotification: a.NOOP }), t.set(wo, s);
|
|
@@ -34367,9 +34347,9 @@ async function uG(e) {
|
|
|
34367
34347
|
signal: u.signal
|
|
34368
34348
|
}), document.addEventListener(Ma.TYPE, () => {
|
|
34369
34349
|
t.set(dc, !0);
|
|
34370
|
-
}, { once: !0 }),
|
|
34350
|
+
}, { once: !0 }), AW.INSTANCE.start(r.sendComponentValues);
|
|
34371
34351
|
}
|
|
34372
|
-
function
|
|
34352
|
+
function uG(e, t, n, r) {
|
|
34373
34353
|
try {
|
|
34374
34354
|
switch (c.debug("Islands received message:", e.op), e.op) {
|
|
34375
34355
|
case "banner":
|
|
@@ -34409,26 +34389,24 @@ function dG(e, t, n, r) {
|
|
|
34409
34389
|
});
|
|
34410
34390
|
return;
|
|
34411
34391
|
case "kernel-ready":
|
|
34412
|
-
|
|
34413
|
-
autoInstantiate: !0,
|
|
34392
|
+
EW(e, {
|
|
34414
34393
|
cells: Ki(n.get(ma)),
|
|
34415
34394
|
resetCellRuntimes: t.resetCellRuntimes,
|
|
34416
34395
|
setLayoutData: a.NOOP,
|
|
34417
|
-
setCapabilities: a.NOOP
|
|
34418
|
-
|
|
34419
|
-
}), window.customElements?.get(Ru.ISLAND) || sx(Ru.ISLAND, aG);
|
|
34396
|
+
setCapabilities: a.NOOP
|
|
34397
|
+
}), window.customElements?.get(Ru.ISLAND) || sx(Ru.ISLAND, iG);
|
|
34420
34398
|
return;
|
|
34421
34399
|
case "send-ui-element-message":
|
|
34422
34400
|
nx.broadcastMessage(e.ui_element, e.message, ge(e));
|
|
34423
34401
|
return;
|
|
34424
34402
|
case "remove-ui-elements":
|
|
34425
|
-
|
|
34403
|
+
DW(e);
|
|
34426
34404
|
return;
|
|
34427
34405
|
case "function-call-result":
|
|
34428
34406
|
rx.resolve(e.function_call_id, e);
|
|
34429
34407
|
return;
|
|
34430
34408
|
case "cell-op":
|
|
34431
|
-
Gi(n, e),
|
|
34409
|
+
Gi(n, e), OW(e, t.handleCellMessage);
|
|
34432
34410
|
return;
|
|
34433
34411
|
case "alert":
|
|
34434
34412
|
x({
|
|
@@ -34438,16 +34416,16 @@ function dG(e, t, n, r) {
|
|
|
34438
34416
|
});
|
|
34439
34417
|
return;
|
|
34440
34418
|
case "query-params-append":
|
|
34441
|
-
|
|
34419
|
+
kW.append(e);
|
|
34442
34420
|
return;
|
|
34443
34421
|
case "query-params-set":
|
|
34444
|
-
|
|
34422
|
+
kW.set(e);
|
|
34445
34423
|
return;
|
|
34446
34424
|
case "query-params-delete":
|
|
34447
|
-
|
|
34425
|
+
kW.delete(e);
|
|
34448
34426
|
return;
|
|
34449
34427
|
case "query-params-clear":
|
|
34450
|
-
|
|
34428
|
+
kW.clear();
|
|
34451
34429
|
return;
|
|
34452
34430
|
case "model-lifecycle":
|
|
34453
34431
|
Ab(kb, e);
|
|
@@ -34464,12 +34442,12 @@ function dG(e, t, n, r) {
|
|
|
34464
34442
|
}
|
|
34465
34443
|
//#endregion
|
|
34466
34444
|
//#region ../node_modules/.pnpm/rpc-anywhere@1.7.0/node_modules/rpc-anywhere/dist/esm/rpc.js
|
|
34467
|
-
var
|
|
34468
|
-
function
|
|
34445
|
+
var dG = 1e10, fG = 1e3;
|
|
34446
|
+
function pG(e, t) {
|
|
34469
34447
|
let n = e.map((e) => `"${e}"`).join(", ");
|
|
34470
34448
|
return /* @__PURE__ */ Error(`This RPC instance cannot ${t} because the transport did not provide one or more of these methods: ${n}`);
|
|
34471
34449
|
}
|
|
34472
|
-
function
|
|
34450
|
+
function mG(e = {}) {
|
|
34473
34451
|
let t = {};
|
|
34474
34452
|
function n(e) {
|
|
34475
34453
|
t = e;
|
|
@@ -34488,17 +34466,17 @@ function hG(e = {}) {
|
|
|
34488
34466
|
return i(t, n);
|
|
34489
34467
|
};
|
|
34490
34468
|
}
|
|
34491
|
-
let { maxRequestTime: s =
|
|
34469
|
+
let { maxRequestTime: s = fG } = e;
|
|
34492
34470
|
e.transport && i(e.transport), e.requestHandler && o(e.requestHandler), e._debugHooks && n(e._debugHooks);
|
|
34493
34471
|
let c = 0;
|
|
34494
34472
|
function l() {
|
|
34495
|
-
return c <=
|
|
34473
|
+
return c <= dG ? ++c : c = 0;
|
|
34496
34474
|
}
|
|
34497
34475
|
let u = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map();
|
|
34498
34476
|
function f(e, ...n) {
|
|
34499
34477
|
let i = n[0];
|
|
34500
34478
|
return new Promise((n, a) => {
|
|
34501
|
-
if (!r.send) throw
|
|
34479
|
+
if (!r.send) throw pG(["send"], "make requests");
|
|
34502
34480
|
let o = l(), c = {
|
|
34503
34481
|
type: "request",
|
|
34504
34482
|
id: o,
|
|
@@ -34516,7 +34494,7 @@ function hG(e = {}) {
|
|
|
34516
34494
|
let p = new Proxy(f, { get: (e, t, n) => t in e ? Reflect.get(e, t, n) : (e) => f(t, e) }), m = p;
|
|
34517
34495
|
function h(e, ...n) {
|
|
34518
34496
|
let i = n[0];
|
|
34519
|
-
if (!r.send) throw
|
|
34497
|
+
if (!r.send) throw pG(["send"], "send messages");
|
|
34520
34498
|
let a = {
|
|
34521
34499
|
type: "message",
|
|
34522
34500
|
id: e,
|
|
@@ -34526,7 +34504,7 @@ function hG(e = {}) {
|
|
|
34526
34504
|
}
|
|
34527
34505
|
let g = new Proxy(h, { get: (e, t, n) => t in e ? Reflect.get(e, t, n) : (e) => h(t, e) }), _ = g, v = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Set();
|
|
34528
34506
|
function b(e, t) {
|
|
34529
|
-
if (!r.registerHandler) throw
|
|
34507
|
+
if (!r.registerHandler) throw pG(["registerHandler"], "register message listeners");
|
|
34530
34508
|
e === "*" ? y.add(t) : (v.has(e) || v.set(e, /* @__PURE__ */ new Set()), v.get(e)?.add(t));
|
|
34531
34509
|
}
|
|
34532
34510
|
function x(e, t) {
|
|
@@ -34535,7 +34513,7 @@ function hG(e = {}) {
|
|
|
34535
34513
|
async function S(e) {
|
|
34536
34514
|
if (t.onReceive?.(e), !("type" in e)) throw Error("Message does not contain a type.");
|
|
34537
34515
|
if (e.type === "request") {
|
|
34538
|
-
if (!r.send || !a) throw
|
|
34516
|
+
if (!r.send || !a) throw pG(["send", "requestHandler"], "handle requests");
|
|
34539
34517
|
let { id: n, method: i, params: o } = e, s;
|
|
34540
34518
|
try {
|
|
34541
34519
|
s = {
|
|
@@ -34584,40 +34562,40 @@ function hG(e = {}) {
|
|
|
34584
34562
|
}
|
|
34585
34563
|
//#endregion
|
|
34586
34564
|
//#region ../node_modules/.pnpm/rpc-anywhere@1.7.0/node_modules/rpc-anywhere/dist/esm/create-rpc.js
|
|
34587
|
-
function
|
|
34588
|
-
return
|
|
34565
|
+
function hG(e) {
|
|
34566
|
+
return mG(e);
|
|
34589
34567
|
}
|
|
34590
34568
|
//#endregion
|
|
34591
34569
|
//#region ../node_modules/.pnpm/rpc-anywhere@1.7.0/node_modules/rpc-anywhere/dist/esm/transport-utils.js
|
|
34592
|
-
var
|
|
34593
|
-
function
|
|
34570
|
+
var gG = "[transport-id]";
|
|
34571
|
+
function _G(e, t) {
|
|
34594
34572
|
let { transportId: n } = t;
|
|
34595
34573
|
return n == null ? e : {
|
|
34596
|
-
[
|
|
34574
|
+
[gG]: n,
|
|
34597
34575
|
data: e
|
|
34598
34576
|
};
|
|
34599
34577
|
}
|
|
34600
|
-
function
|
|
34578
|
+
function vG(e, t) {
|
|
34601
34579
|
let { transportId: n, filter: r } = t, i = r?.();
|
|
34602
34580
|
if (n != null && i != null) throw Error("Cannot use both `transportId` and `filter` at the same time");
|
|
34603
34581
|
let a = e;
|
|
34604
34582
|
if (n) {
|
|
34605
|
-
if (e[
|
|
34583
|
+
if (e[gG] !== n) return [!0];
|
|
34606
34584
|
a = e.data;
|
|
34607
34585
|
}
|
|
34608
34586
|
return i === !1 ? [!0] : [!1, a];
|
|
34609
34587
|
}
|
|
34610
34588
|
//#endregion
|
|
34611
34589
|
//#region ../node_modules/.pnpm/rpc-anywhere@1.7.0/node_modules/rpc-anywhere/dist/esm/transports/message-port.js
|
|
34612
|
-
function
|
|
34590
|
+
function yG(e, t = {}) {
|
|
34613
34591
|
let { transportId: n, filter: r, remotePort: i } = t, a = e, o = i ?? e, s;
|
|
34614
34592
|
return {
|
|
34615
34593
|
send(e) {
|
|
34616
|
-
o.postMessage(
|
|
34594
|
+
o.postMessage(_G(e, { transportId: n }));
|
|
34617
34595
|
},
|
|
34618
34596
|
registerHandler(e) {
|
|
34619
34597
|
s = (t) => {
|
|
34620
|
-
let i = t.data, [a, o] =
|
|
34598
|
+
let i = t.data, [a, o] = vG(i, {
|
|
34621
34599
|
transportId: n,
|
|
34622
34600
|
filter: () => r?.(t)
|
|
34623
34601
|
});
|
|
@@ -34631,17 +34609,17 @@ function bG(e, t = {}) {
|
|
|
34631
34609
|
}
|
|
34632
34610
|
//#endregion
|
|
34633
34611
|
//#region ../node_modules/.pnpm/rpc-anywhere@1.7.0/node_modules/rpc-anywhere/dist/esm/transports/worker.js
|
|
34634
|
-
function
|
|
34635
|
-
return
|
|
34612
|
+
function bG(e, t) {
|
|
34613
|
+
return yG(e, t);
|
|
34636
34614
|
}
|
|
34637
34615
|
//#endregion
|
|
34638
34616
|
//#region src/core/wasm/worker/constants.ts
|
|
34639
|
-
var
|
|
34617
|
+
var xG = "marimo-transport";
|
|
34640
34618
|
//#endregion
|
|
34641
34619
|
//#region src/core/wasm/rpc.ts
|
|
34642
|
-
function
|
|
34643
|
-
return
|
|
34644
|
-
transport:
|
|
34620
|
+
function SG(e, t, n = 2e4) {
|
|
34621
|
+
return hG({
|
|
34622
|
+
transport: bG(e, { transportId: xG }),
|
|
34645
34623
|
requestHandler: t,
|
|
34646
34624
|
maxRequestTime: n,
|
|
34647
34625
|
_debugHooks: {
|
|
@@ -34656,7 +34634,7 @@ function CG(e, t, n = 2e4) {
|
|
|
34656
34634
|
}
|
|
34657
34635
|
//#endregion
|
|
34658
34636
|
//#region src/utils/worker.ts
|
|
34659
|
-
function
|
|
34637
|
+
function CG(e, t) {
|
|
34660
34638
|
if (e.origin === globalThis.origin) return new Worker(e.href, {
|
|
34661
34639
|
...t,
|
|
34662
34640
|
type: "module"
|
|
@@ -34673,25 +34651,25 @@ function wG(e, t) {
|
|
|
34673
34651
|
}
|
|
34674
34652
|
//#endregion
|
|
34675
34653
|
//#region src/core/islands/worker/worker.tsx?worker&url
|
|
34676
|
-
var
|
|
34654
|
+
var wG = "/assets/worker-ByubE6Ou.js", TG = class {
|
|
34677
34655
|
url;
|
|
34678
34656
|
name;
|
|
34679
34657
|
constructor(e = {}) {
|
|
34680
34658
|
this.url = e.workerUrl || this.getDefaultWorkerUrl(), this.name = e.workerName || Ga();
|
|
34681
34659
|
}
|
|
34682
34660
|
create() {
|
|
34683
|
-
return
|
|
34661
|
+
return CG(new URL(this.url, import.meta.url), { name: this.name });
|
|
34684
34662
|
}
|
|
34685
34663
|
getDefaultWorkerUrl() {
|
|
34686
|
-
return
|
|
34664
|
+
return EG(wG);
|
|
34687
34665
|
}
|
|
34688
34666
|
};
|
|
34689
|
-
function
|
|
34667
|
+
function EG(e) {
|
|
34690
34668
|
return e.startsWith("./") ? e : e.startsWith("/") ? `.${e}` : `./${e}`;
|
|
34691
34669
|
}
|
|
34692
34670
|
//#endregion
|
|
34693
34671
|
//#region src/core/islands/bridge.ts
|
|
34694
|
-
var
|
|
34672
|
+
var DG = class {
|
|
34695
34673
|
rpc;
|
|
34696
34674
|
notificationConsumer;
|
|
34697
34675
|
store;
|
|
@@ -34724,8 +34702,8 @@ var OG = class {
|
|
|
34724
34702
|
constructor(e = {}) {
|
|
34725
34703
|
this.store = e.store || ds, this.root = e.root || document;
|
|
34726
34704
|
try {
|
|
34727
|
-
let t = (e.workerFactory || new
|
|
34728
|
-
this.rpc =
|
|
34705
|
+
let t = (e.workerFactory || new TG()).create();
|
|
34706
|
+
this.rpc = SG(t), this.setupMessageListeners();
|
|
34729
34707
|
} catch (e) {
|
|
34730
34708
|
throw c.error("Failed to initialize IslandsPyodideBridge:", e), this.initialized.reject(e), e;
|
|
34731
34709
|
}
|
|
@@ -34755,14 +34733,14 @@ var OG = class {
|
|
|
34755
34733
|
});
|
|
34756
34734
|
}
|
|
34757
34735
|
async startApps() {
|
|
34758
|
-
let e =
|
|
34736
|
+
let e = MW(this.root, { materialize: !1 }), t = e.length === 1;
|
|
34759
34737
|
c.debug(`Starting sessions for ${e.length} app(s):`, e.map((e) => `${e.id} (${e.cells.length} cells)`));
|
|
34760
|
-
let n = (e.length === 1 && !e[0]?.payloadBacked ? z() : void 0)?.notebookCode, r = t ? e[0] : void 0, i = r ? n ||
|
|
34761
|
-
if (r && this.session?.appId === r.id && this.session.code === i)
|
|
34738
|
+
let n = (e.length === 1 && !e[0]?.payloadBacked ? z() : void 0)?.notebookCode, r = t ? e[0] : void 0, i = r ? n || VW(r) : void 0;
|
|
34739
|
+
if (r && this.session?.appId === r.id && this.session.code === i) MW(this.root);
|
|
34762
34740
|
else {
|
|
34763
|
-
e.length > 0 && (this.activeSessionGenerations.clear(), this.store.set(pc, new Set(e.map((e, t) => this.nextSessionGeneration + t + 1)))),
|
|
34741
|
+
e.length > 0 && (this.activeSessionGenerations.clear(), this.store.set(pc, new Set(e.map((e, t) => this.nextSessionGeneration + t + 1)))), MW(this.root);
|
|
34764
34742
|
for (let n of e) {
|
|
34765
|
-
let e = i ||
|
|
34743
|
+
let e = i || VW(n);
|
|
34766
34744
|
c.debug(`App ${n.id} marimo file:\n`, e);
|
|
34767
34745
|
let r = {
|
|
34768
34746
|
code: e,
|
|
@@ -34806,7 +34784,6 @@ var OG = class {
|
|
|
34806
34784
|
...e,
|
|
34807
34785
|
token: Ee()
|
|
34808
34786
|
}), null);
|
|
34809
|
-
sendInstantiate = async () => null;
|
|
34810
34787
|
sendFunctionRequest = async (e) => (await this.putControlRequest({
|
|
34811
34788
|
type: "invoke-function",
|
|
34812
34789
|
...e
|
|
@@ -34892,13 +34869,13 @@ var OG = class {
|
|
|
34892
34869
|
return await e, t ?? n.promise;
|
|
34893
34870
|
}
|
|
34894
34871
|
destroy() {}
|
|
34895
|
-
},
|
|
34896
|
-
function
|
|
34897
|
-
return
|
|
34872
|
+
}, OG = null;
|
|
34873
|
+
function kG() {
|
|
34874
|
+
return OG ||= new DG(), OG;
|
|
34898
34875
|
}
|
|
34899
34876
|
//#endregion
|
|
34900
34877
|
//#region src/core/islands/iframe-resizer.ts
|
|
34901
|
-
function
|
|
34878
|
+
function AG(e) {
|
|
34902
34879
|
function t() {
|
|
34903
34880
|
let t = e.contentWindow?.document?.documentElement;
|
|
34904
34881
|
if (!t || t.scrollHeight === t.clientHeight) return;
|
|
@@ -34909,30 +34886,30 @@ function jG(e) {
|
|
|
34909
34886
|
let n = new ResizeObserver(t), r = e.contentWindow?.document?.body;
|
|
34910
34887
|
r && n.observe(r);
|
|
34911
34888
|
}
|
|
34912
|
-
function
|
|
34913
|
-
window.__resizeIframe ??=
|
|
34889
|
+
function jG() {
|
|
34890
|
+
window.__resizeIframe ??= AG;
|
|
34914
34891
|
}
|
|
34915
34892
|
//#endregion
|
|
34916
34893
|
//#region src/core/islands/main.ts
|
|
34917
|
-
|
|
34918
|
-
var
|
|
34919
|
-
function
|
|
34920
|
-
return document.querySelector(Ru.ISLAND) ?
|
|
34894
|
+
jG();
|
|
34895
|
+
var MG = kG(), NG;
|
|
34896
|
+
function PG() {
|
|
34897
|
+
return document.querySelector(Ru.ISLAND) ? MW(document, { materialize: !1 }).length === 1 : !1;
|
|
34921
34898
|
}
|
|
34922
|
-
async function
|
|
34899
|
+
async function FG() {
|
|
34923
34900
|
let e = document.querySelectorAll(Ru.ISLAND);
|
|
34924
34901
|
if (e.length !== 0) {
|
|
34925
34902
|
for (let t of e) t.classList.add(Hu.NAMESPACE);
|
|
34926
|
-
|
|
34927
|
-
throw
|
|
34928
|
-
}), await
|
|
34903
|
+
NG ??= lG({ bridge: MG }).catch((e) => {
|
|
34904
|
+
throw NG = void 0, e;
|
|
34905
|
+
}), await NG, await MG.initializeApps();
|
|
34929
34906
|
}
|
|
34930
34907
|
}
|
|
34931
|
-
async function
|
|
34932
|
-
await
|
|
34908
|
+
async function IG(e) {
|
|
34909
|
+
await MG.stopSession(e);
|
|
34933
34910
|
}
|
|
34934
|
-
|
|
34911
|
+
FG().catch((e) => {
|
|
34935
34912
|
c.error("Failed to initialize islands:", e);
|
|
34936
34913
|
});
|
|
34937
34914
|
//#endregion
|
|
34938
|
-
export {
|
|
34915
|
+
export { PG as canReplaceApp, FG as initialize, IG as stopApp };
|