@marimo-team/islands 0.25.3-dev436 → 0.25.3-dev438
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/{ConnectedDataExplorerComponent-CoEU9snz.js → ConnectedDataExplorerComponent-LA5OtjAG.js} +11 -11
- package/dist/{ErrorBoundary-DAkJ7hwU.js → ErrorBoundary-Bvtsf3zB.js} +18 -18
- package/dist/{abnfDiagram-VCTEODGH-RbfxpmIE.js → abnfDiagram-VCTEODGH-CBntFgCZ.js} +2 -2
- package/dist/{any-language-editor-Cw4VtZvb.js → any-language-editor-gzDRWdCH.js} +2 -2
- package/dist/{architectureDiagram-5GKGNRK7-DzzNVRo4.js → architectureDiagram-5GKGNRK7-Bz6ouXl-.js} +1 -1
- package/dist/{assertNever-ChGm2jYv.js → assertNever-DOTNJ2Y4.js} +2 -2
- package/dist/{chat-ui-BEMyRpmS.js → chat-ui-ZGXdN6Vr.js} +45 -45
- package/dist/{check-BHRB6N0I.js → check-CApwK1fD.js} +1 -1
- package/dist/{chunk-IMKFNOWR-1Zy6M_oP.js → chunk-IMKFNOWR-DK_M66Dt.js} +1 -1
- package/dist/{chunk-SHT3W25Y-yAttqZEk.js → chunk-SHT3W25Y-C7Cg6zGL.js} +1 -1
- package/dist/{chunk-SVP7TREG-MKJpuJHR.js → chunk-SVP7TREG-K0lWia53.js} +1 -1
- package/dist/{chunk-TICWLB2K-BOC0OebH.js → chunk-TICWLB2K-DiKpryGp.js} +1 -1
- package/dist/{classDiagram-ZZMXUADV-BOlD7kH9.js → classDiagram-ZZMXUADV-CXX5eaxi.js} +2 -2
- package/dist/{classDiagram-v2-VYDZK3BY-C3p3seuT.js → classDiagram-v2-VYDZK3BY-Bjyy4iKL.js} +2 -2
- package/dist/{code-visibility-BMMvUEE0.js → code-visibility-CmfNaZAX.js} +17 -17
- package/dist/{common-iWYyPuv_.js → common-i_ykKLxU.js} +4881 -4842
- package/dist/{config-EJnOxh0i.js → config-C8TXSDmC.js} +18 -18
- package/dist/{copy-icon-Bv5SAA0w.js → copy-icon-CDvvlY90.js} +2 -2
- package/dist/{createReducer-BJJ0K5Tu.js → createReducer-CXqSak4H.js} +1 -1
- package/dist/{cynefinDiagram-5FMLGOSQ-BKnxm64C.js → cynefinDiagram-5FMLGOSQ-C-MlCYj4.js} +1 -1
- package/dist/{dagre-GXQ25YYZ-COBTexAI.js → dagre-GXQ25YYZ-C6e9vEKZ.js} +1 -1
- package/dist/{data-grid-overlay-editor-CkJgQaxE.js → data-grid-overlay-editor-kj617zpx.js} +1 -1
- package/dist/{diagram-S7CK7UJ4-Dyt3J6ek.js → diagram-S7CK7UJ4-DgXNq_At.js} +1 -1
- package/dist/{diagram-UQ7AKVKN-CJCsT4fA.js → diagram-UQ7AKVKN-BG5NExCt.js} +1 -1
- package/dist/{diagram-VX7I27RA-BboxCtbh.js → diagram-VX7I27RA-Da7VYCfC.js} +1 -1
- package/dist/{diagram-Z3DM3KII-DfRWWQ5t.js → diagram-Z3DM3KII-DHk6GaR5.js} +1 -1
- package/dist/{dialog-B8vU2hHC.js → dialog-rgayPemF.js} +20 -20
- package/dist/{dropdown-menu-DzhAnAhr.js → dropdown-menu-B12Nf3Zf.js} +703 -703
- package/dist/{ebnfDiagram-PWID7BFC-DYxwv-nl.js → ebnfDiagram-PWID7BFC-DdSjinXr.js} +2 -2
- package/dist/{erDiagram-RLTQ6QDP-D9e5WUw7.js → erDiagram-RLTQ6QDP-BgcwfZct.js} +1 -1
- package/dist/{error-banner-BRkKwvku.js → error-banner-DXHIN-63.js} +58 -58
- package/dist/{error-entries-BbxtqUQ4.js → error-entries-DMgIKuK1.js} +380 -380
- package/dist/{feedback-button-Bo1DzBRc.js → feedback-button-CGAe5hFZ.js} +7 -7
- package/dist/{flowDiagram-HODETNUW-tt7EepxX.js → flowDiagram-HODETNUW-CVwzkmUF.js} +2 -2
- package/dist/{formats-HRSqKdFt.js → formats-BWuAsLfw.js} +1 -1
- package/dist/{glide-data-editor-D537pcyO.js → glide-data-editor-BiU_hF9A.js} +11 -11
- package/dist/{glide-utils-BzjESEmr.js → glide-utils-D1McS0Pn.js} +2 -2
- package/dist/{globals-DyA5IC15.js → globals-jz3DTWzC.js} +3 -3
- package/dist/{html-to-image-DuNAF8H5.js → html-to-image-Dopvv40j.js} +774 -774
- package/dist/{infoDiagram-27XIBGKW-CpQH_joy.js → infoDiagram-27XIBGKW-CHkU2P-8.js} +1 -1
- package/dist/{ishikawaDiagram-5VMMS53U-d-it4xqm.js → ishikawaDiagram-5VMMS53U-B0k5UyY5.js} +1 -1
- package/dist/{kanban-definition-UXKFOSKX-DItpqTFY.js → kanban-definition-UXKFOSKX-DwQvOV0x.js} +1 -1
- package/dist/main.js +4913 -4936
- package/dist/{mermaid-BugOVfeH.js → mermaid-Bqy6f_NU.js} +34 -34
- package/dist/{mindmap-definition-YA3MSWOX-D6IpF-_J.js → mindmap-definition-YA3MSWOX-CqvvAm8I.js} +1 -1
- package/dist/{number-overlay-editor-BN8eCduk.js → number-overlay-editor-D3OSLsDB.js} +1 -1
- package/dist/{pegDiagram-XKGWAZYB-CXUu3QwE.js → pegDiagram-XKGWAZYB-Befnx4Ry.js} +2 -2
- package/dist/{pencil-DWRFEz2B.js → pencil-BC7pOv9g.js} +1 -1
- package/dist/{pieDiagram-E7YTZNPT-DoUJF0yj.js → pieDiagram-E7YTZNPT-6rYFbF7p.js} +1 -1
- package/dist/{process-output-Cl97_Reh.js → process-output-BidrKebE.js} +4 -4
- package/dist/{railroadDiagram-O6MQD6OU-BsGDhtLL.js → railroadDiagram-O6MQD6OU-SSniwYC8.js} +2 -2
- package/dist/{requirementDiagram-BXWQKSXE-BHW0qW2Z.js → requirementDiagram-BXWQKSXE-3L_xNfQr.js} +1 -1
- package/dist/{reveal-component-DEOP4BIj.js → reveal-component-CnyvRvqy.js} +900 -900
- package/dist/{select-Brvb-RwP.js → select-PQHWLm64.js} +99 -99
- package/dist/{sequenceDiagram-WJ2MYXX4-DpgYJzLl.js → sequenceDiagram-WJ2MYXX4-DvzIRlWu.js} +1 -1
- package/dist/{spec-BWpscSQi.js → spec-6shN7lEe.js} +4 -4
- package/dist/{stateDiagram-D77RDMKH-Btf1jiYb.js → stateDiagram-D77RDMKH-VsHup-Ig.js} +2 -2
- package/dist/{stateDiagram-v2-MP3YSRHH-DN9FyEf3.js → stateDiagram-v2-MP3YSRHH-BwIIR8nk.js} +2 -2
- package/dist/{static-state-BhCfPRoz.js → static-state-CWXd6dYX.js} +9 -9
- package/dist/{swimlanes-42K2YHIH-2l_tR9qL.js → swimlanes-42K2YHIH-DhSDCIWI.js} +1 -1
- package/dist/{swimlanesDiagram-VR7AAH4N-BAkmv8kE.js → swimlanesDiagram-VR7AAH4N-C2WGVm-W.js} +2 -2
- package/dist/{timeline-definition-24CTP7MA-AxSxEOhx.js → timeline-definition-24CTP7MA-DhUhNinO.js} +1 -1
- package/dist/{toast-DOWc3HtU.js → toast-BGvv7tKS.js} +153 -153
- package/dist/{tooltip-DsQZP310.js → tooltip-CiJ919pg.js} +62 -62
- package/dist/{use-restore-focus-CTa7IRP6.js → use-restore-focus-BLj45Ibw.js} +75 -75
- package/dist/{useDateFormatter-CRuBYwR6.js → useDateFormatter-C659lkax.js} +2 -2
- package/dist/{useDeepCompareMemoize-B2RNcTmn.js → useDeepCompareMemoize-CDhinwm7.js} +1 -1
- package/dist/{useLifecycle-Bw0JtmoB.js → useLifecycle-mKiMNa4V.js} +1 -1
- package/dist/{vega-component-BV9sYHhU.js → vega-component-CWvQ7wBJ.js} +6 -6
- package/dist/{vennDiagram-4TSXK5OY-oHztO7MH.js → vennDiagram-4TSXK5OY-exvBF8P5.js} +1 -1
- package/dist/{wardleyDiagram-VM6X3IG4-DWeEjZSc.js → wardleyDiagram-VM6X3IG4-BFhJmnXo.js} +1 -1
- package/dist/{xychartDiagram-S5SC5T6Z-ESBlsY9i.js → xychartDiagram-S5SC5T6Z-D_xAdG6u.js} +1 -1
- package/package.json +1 -1
- package/src/components/editor/actions/__tests__/pair-with-agent-modal.test.tsx +23 -0
- package/src/components/editor/actions/pair-with-agent-modal.tsx +4 -3
- package/src/components/editor/controls/Controls.tsx +5 -2
- package/src/components/editor/notebook-cell.tsx +7 -21
- package/src/components/editor/renderers/grid-layout/grid-layout.tsx +2 -7
- package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +2 -4
- package/src/components/slides/minimap.tsx +2 -3
- package/src/components/slides/reveal-component.tsx +2 -3
- package/src/components/slides/slide-cell-view.tsx +5 -12
- package/src/core/cells/__tests__/cell.test.ts +8 -51
- package/src/core/cells/__tests__/utils.test.ts +27 -18
- package/src/core/cells/cell.ts +6 -12
- package/src/core/cells/cells.ts +5 -3
- package/src/core/cells/utils.ts +61 -55
- package/src/core/config/config.ts +4 -0
- package/src/core/executions/__tests__/hooks.test.tsx +48 -2
- package/src/core/executions/__tests__/select.test.ts +0 -17
- package/src/core/executions/hooks.ts +24 -0
- package/src/core/executions/index.ts +2 -0
- package/src/core/executions/select.ts +0 -5
|
@@ -2,19 +2,19 @@ import { a as e } from "./rolldown-runtime-BPCzCO3I.js";
|
|
|
2
2
|
import { g as t, h as n, p as r } from "./button-qQhINE7z.js";
|
|
3
3
|
import { t as i } from "./react-Bgs_wQh3.js";
|
|
4
4
|
import { t as a } from "./compiler-runtime-C5KHtL5D.js";
|
|
5
|
-
import { i as o } from "./copy-icon-
|
|
6
|
-
import { f as s, h as c } from "./tooltip-
|
|
7
|
-
import { t as l } from "./check-
|
|
8
|
-
import { n as u, r as d } from "./assertNever-
|
|
5
|
+
import { i as o } from "./copy-icon-CDvvlY90.js";
|
|
6
|
+
import { f as s, h as c } from "./tooltip-CiJ919pg.js";
|
|
7
|
+
import { t as l } from "./check-CApwK1fD.js";
|
|
8
|
+
import { n as u, r as d } from "./assertNever-DOTNJ2Y4.js";
|
|
9
9
|
import { t as f } from "./jsx-runtime-D8btoEHk.js";
|
|
10
|
-
import {
|
|
11
|
-
import { n as se } from "./toast-
|
|
10
|
+
import { At as p, Et as m, Ft as h, Nt as g, Pt as _, Rt as v, St as y, Tt as b, Vt as x, _n as ee, f as S, fn as te, gn as ne, kt as C, mn as re, pn as ie, wt as ae, xt as oe } from "./use-restore-focus-BLj45Ibw.js";
|
|
11
|
+
import { n as se } from "./toast-BGvv7tKS.js";
|
|
12
12
|
import { t as ce } from "./objects-DCmMvZtn.js";
|
|
13
13
|
import { t as w } from "./invariant-DLmrl-hA.js";
|
|
14
14
|
import { t as le } from "./purify.es-DmnrIjg4.js";
|
|
15
|
-
import { t as ue } from "./createReducer-
|
|
15
|
+
import { t as ue } from "./createReducer-CXqSak4H.js";
|
|
16
16
|
import { H as de, N as fe, P as pe, _ as me } from "./dist-D92tYjLc.js";
|
|
17
|
-
import { a as he, i as ge, l as _e, m as ve, u as ye } from "./static-state-
|
|
17
|
+
import { a as he, i as ge, l as _e, m as ve, u as ye } from "./static-state-CWXd6dYX.js";
|
|
18
18
|
import { t as be } from "./capabilities-DKqMqBzm.js";
|
|
19
19
|
var xe = c("external-link", [
|
|
20
20
|
["path", {
|
|
@@ -35,13 +35,13 @@ var xe = c("external-link", [
|
|
|
35
35
|
}]]), T = /* @__PURE__ */ e(i(), 1), E = f(), Ce = Object.defineProperty, D = (e, t) => Ce(e, "name", {
|
|
36
36
|
value: t,
|
|
37
37
|
configurable: !0
|
|
38
|
-
}),
|
|
39
|
-
function
|
|
40
|
-
let { __scopeCheckbox: t, checked: n, children: r, defaultChecked: i, disabled: a, form: o, name: s, onCheckedChange: c, required: l, value: u = "on", internal_do_not_use_render: d } = e, [f, p] =
|
|
38
|
+
}), O = "Checkbox", [we, Te] = ne(O), [Ee, De] = we(O);
|
|
39
|
+
function Oe(e) {
|
|
40
|
+
let { __scopeCheckbox: t, checked: n, children: r, defaultChecked: i, disabled: a, form: o, name: s, onCheckedChange: c, required: l, value: u = "on", internal_do_not_use_render: d } = e, [f, p] = ie({
|
|
41
41
|
prop: n,
|
|
42
42
|
defaultProp: i ?? !1,
|
|
43
43
|
onChange: c,
|
|
44
|
-
caller:
|
|
44
|
+
caller: O
|
|
45
45
|
}), [m, h] = T.useState(null), [g, _] = T.useState(null), [v, y] = T.useState(null), b = !m || !!o || !!m.closest("form"), x = {
|
|
46
46
|
checked: f,
|
|
47
47
|
disabled: a,
|
|
@@ -54,51 +54,51 @@ function ke(e) {
|
|
|
54
54
|
userClick: v,
|
|
55
55
|
onUserClick: y,
|
|
56
56
|
required: l,
|
|
57
|
-
defaultChecked: !
|
|
57
|
+
defaultChecked: !k(i) && i,
|
|
58
58
|
isFormControl: b,
|
|
59
59
|
bubbleInput: g,
|
|
60
60
|
setBubbleInput: _
|
|
61
61
|
};
|
|
62
|
-
return /* @__PURE__ */ (0, E.jsx)(
|
|
62
|
+
return /* @__PURE__ */ (0, E.jsx)(Ee, {
|
|
63
63
|
scope: t,
|
|
64
64
|
...x,
|
|
65
|
-
children:
|
|
65
|
+
children: Ie(d) ? d(x) : r
|
|
66
66
|
});
|
|
67
67
|
}
|
|
68
|
-
D(
|
|
69
|
-
var
|
|
70
|
-
let { control: o, value: s, disabled: c, checked: l, required: u, setControl: d, setChecked: f, onUserClick: p, isFormControl: m, bubbleInput: h } =
|
|
68
|
+
D(Oe, "CheckboxProvider");
|
|
69
|
+
var ke = "CheckboxTrigger", Ae = /* @__PURE__ */ T.forwardRef(/* @__PURE__ */ D(function({ __scopeCheckbox: e, onKeyDown: t, onClick: n, ...i }, a) {
|
|
70
|
+
let { control: o, value: s, disabled: c, checked: l, required: u, setControl: d, setChecked: f, onUserClick: p, isFormControl: m, bubbleInput: h } = De(ke, e), g = r(a, d), _ = T.useRef(l);
|
|
71
71
|
return T.useEffect(() => {
|
|
72
72
|
let e = o?.form;
|
|
73
73
|
if (e) {
|
|
74
74
|
let t = /* @__PURE__ */ D(() => f(_.current), "reset");
|
|
75
75
|
return e.addEventListener("reset", t), () => e.removeEventListener("reset", t);
|
|
76
76
|
}
|
|
77
|
-
}, [o, f]), /* @__PURE__ */ (0, E.jsx)(
|
|
77
|
+
}, [o, f]), /* @__PURE__ */ (0, E.jsx)(ee.button, {
|
|
78
78
|
type: "button",
|
|
79
79
|
role: "checkbox",
|
|
80
|
-
"aria-checked":
|
|
80
|
+
"aria-checked": k(l) ? "mixed" : l,
|
|
81
81
|
"aria-required": u,
|
|
82
|
-
"data-state":
|
|
82
|
+
"data-state": Le(l),
|
|
83
83
|
"data-disabled": c ? "" : void 0,
|
|
84
84
|
disabled: c,
|
|
85
85
|
value: s,
|
|
86
86
|
...i,
|
|
87
87
|
ref: g,
|
|
88
|
-
onKeyDown:
|
|
88
|
+
onKeyDown: re(t, (e) => {
|
|
89
89
|
e.key === "Enter" && e.preventDefault();
|
|
90
90
|
}),
|
|
91
|
-
onClick:
|
|
91
|
+
onClick: re(n, (e) => {
|
|
92
92
|
let t = e.isPropagationStopped();
|
|
93
93
|
p({
|
|
94
|
-
requestedChecked:
|
|
94
|
+
requestedChecked: k(l) ? !0 : !l,
|
|
95
95
|
hasConsumerStoppedPropagation: t
|
|
96
|
-
}), f((e) =>
|
|
96
|
+
}), f((e) => k(e) ? !0 : !e), h && m && (t || e.stopPropagation());
|
|
97
97
|
})
|
|
98
98
|
});
|
|
99
|
-
}, "CheckboxTrigger")),
|
|
99
|
+
}, "CheckboxTrigger")), je = /* @__PURE__ */ T.forwardRef(/* @__PURE__ */ D(function(e, t) {
|
|
100
100
|
let { __scopeCheckbox: n, name: r, checked: i, defaultChecked: a, required: o, disabled: s, value: c, onCheckedChange: l, form: u, ...d } = e;
|
|
101
|
-
return /* @__PURE__ */ (0, E.jsx)(
|
|
101
|
+
return /* @__PURE__ */ (0, E.jsx)(Oe, {
|
|
102
102
|
__scopeCheckbox: n,
|
|
103
103
|
checked: i,
|
|
104
104
|
defaultChecked: a,
|
|
@@ -108,18 +108,18 @@ var Ae = "CheckboxTrigger", je = /* @__PURE__ */ T.forwardRef(/* @__PURE__ */ D(
|
|
|
108
108
|
name: r,
|
|
109
109
|
form: u,
|
|
110
110
|
value: c,
|
|
111
|
-
internal_do_not_use_render: ({ isFormControl: e }) => /* @__PURE__ */ (0, E.jsxs)(E.Fragment, { children: [/* @__PURE__ */ (0, E.jsx)(
|
|
111
|
+
internal_do_not_use_render: ({ isFormControl: e }) => /* @__PURE__ */ (0, E.jsxs)(E.Fragment, { children: [/* @__PURE__ */ (0, E.jsx)(Ae, {
|
|
112
112
|
...d,
|
|
113
113
|
ref: t,
|
|
114
114
|
__scopeCheckbox: n
|
|
115
|
-
}), e && /* @__PURE__ */ (0, E.jsx)(
|
|
115
|
+
}), e && /* @__PURE__ */ (0, E.jsx)(Fe, { __scopeCheckbox: n })] })
|
|
116
116
|
});
|
|
117
|
-
}, "Checkbox")),
|
|
118
|
-
let { __scopeCheckbox: n, forceMount: r, ...i } = e, a =
|
|
119
|
-
return /* @__PURE__ */ (0, E.jsx)(
|
|
120
|
-
present: r ||
|
|
121
|
-
children: /* @__PURE__ */ (0, E.jsx)(
|
|
122
|
-
"data-state":
|
|
117
|
+
}, "Checkbox")), Me = "CheckboxIndicator", Ne = /* @__PURE__ */ T.forwardRef(/* @__PURE__ */ D(function(e, t) {
|
|
118
|
+
let { __scopeCheckbox: n, forceMount: r, ...i } = e, a = De(Me, n);
|
|
119
|
+
return /* @__PURE__ */ (0, E.jsx)(te, {
|
|
120
|
+
present: r || k(a.checked) || a.checked === !0,
|
|
121
|
+
children: /* @__PURE__ */ (0, E.jsx)(ee.span, {
|
|
122
|
+
"data-state": Le(a.checked),
|
|
123
123
|
"data-disabled": a.disabled ? "" : void 0,
|
|
124
124
|
...i,
|
|
125
125
|
ref: t,
|
|
@@ -129,8 +129,8 @@ var Ae = "CheckboxTrigger", je = /* @__PURE__ */ T.forwardRef(/* @__PURE__ */ D(
|
|
|
129
129
|
}
|
|
130
130
|
})
|
|
131
131
|
});
|
|
132
|
-
}, "CheckboxIndicator")),
|
|
133
|
-
let { control: a, userClick: o, checked: c, defaultChecked: l, required: u, disabled: d, name: f, value: p, form: m, bubbleInput: h, setBubbleInput: g } =
|
|
132
|
+
}, "CheckboxIndicator")), Pe = "CheckboxBubbleInput", Fe = /* @__PURE__ */ T.forwardRef(/* @__PURE__ */ D(function({ __scopeCheckbox: e, onClick: t, ...n }, i) {
|
|
133
|
+
let { control: a, userClick: o, checked: c, defaultChecked: l, required: u, disabled: d, name: f, value: p, form: m, bubbleInput: h, setBubbleInput: g } = De(Pe, e), _ = r(i, g), v = s(a), y = T.useRef(!1), b = T.useRef(c), x = T.useRef(o), S = T.useRef(null);
|
|
134
134
|
T.useEffect(() => {
|
|
135
135
|
let e = h;
|
|
136
136
|
if (!e) return;
|
|
@@ -139,23 +139,23 @@ var Ae = "CheckboxTrigger", je = /* @__PURE__ */ T.forwardRef(/* @__PURE__ */ D(
|
|
|
139
139
|
let r = b.current !== c;
|
|
140
140
|
b.current = c;
|
|
141
141
|
let i = o !== null && o !== x.current;
|
|
142
|
-
if (x.current = o, i) S.current = r ? null : o, r && (e.indeterminate =
|
|
142
|
+
if (x.current = o, i) S.current = r ? null : o, r && (e.indeterminate = k(c), n.call(e, !k(c) && c)), e.dispatchEvent(new Event("click", { bubbles: !o.hasConsumerStoppedPropagation }));
|
|
143
143
|
else if (r) {
|
|
144
144
|
let t = S.current;
|
|
145
145
|
S.current = null;
|
|
146
146
|
let r = t?.requestedChecked === c;
|
|
147
|
-
y.current = !0, e.indeterminate =
|
|
147
|
+
y.current = !0, e.indeterminate = k(c), n.call(e, !k(c) && c), e.dispatchEvent(new Event("click", { bubbles: !(r && t.hasConsumerStoppedPropagation) })), y.current = !1;
|
|
148
148
|
}
|
|
149
149
|
}, [
|
|
150
150
|
h,
|
|
151
151
|
c,
|
|
152
152
|
o
|
|
153
153
|
]);
|
|
154
|
-
let
|
|
155
|
-
return /* @__PURE__ */ (0, E.jsx)(
|
|
154
|
+
let te = T.useRef(!k(c) && c);
|
|
155
|
+
return /* @__PURE__ */ (0, E.jsx)(ee.input, {
|
|
156
156
|
type: "checkbox",
|
|
157
157
|
"aria-hidden": !0,
|
|
158
|
-
defaultChecked: l ??
|
|
158
|
+
defaultChecked: l ?? te.current,
|
|
159
159
|
required: u,
|
|
160
160
|
disabled: d,
|
|
161
161
|
name: f,
|
|
@@ -164,7 +164,7 @@ var Ae = "CheckboxTrigger", je = /* @__PURE__ */ T.forwardRef(/* @__PURE__ */ D(
|
|
|
164
164
|
...n,
|
|
165
165
|
tabIndex: -1,
|
|
166
166
|
ref: _,
|
|
167
|
-
onClick:
|
|
167
|
+
onClick: re(t, (e) => {
|
|
168
168
|
y.current && e.stopPropagation();
|
|
169
169
|
}),
|
|
170
170
|
style: {
|
|
@@ -178,21 +178,21 @@ var Ae = "CheckboxTrigger", je = /* @__PURE__ */ T.forwardRef(/* @__PURE__ */ D(
|
|
|
178
178
|
}
|
|
179
179
|
});
|
|
180
180
|
}, "CheckboxBubbleInput"));
|
|
181
|
-
function
|
|
181
|
+
function Ie(e) {
|
|
182
182
|
return typeof e == "function";
|
|
183
183
|
}
|
|
184
|
-
D(
|
|
185
|
-
function
|
|
184
|
+
D(Ie, "isFunction");
|
|
185
|
+
function k(e) {
|
|
186
186
|
return e === "indeterminate";
|
|
187
187
|
}
|
|
188
|
-
D(
|
|
189
|
-
function
|
|
190
|
-
return
|
|
188
|
+
D(k, "isIndeterminate");
|
|
189
|
+
function Le(e) {
|
|
190
|
+
return k(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
191
191
|
}
|
|
192
|
-
D(
|
|
192
|
+
D(Le, "getState");
|
|
193
193
|
//#endregion
|
|
194
194
|
//#region src/plugins/core/sanitize-html.ts
|
|
195
|
-
var
|
|
195
|
+
var Re = /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix|zotero):|[^a-z]|[-a-z+.]+(?:[^-a-z+.:]|$))/i;
|
|
196
196
|
if (typeof document < "u") {
|
|
197
197
|
let e = "data-temp-href-target";
|
|
198
198
|
le.addHook("beforeSanitizeAttributes", (t) => {
|
|
@@ -201,7 +201,7 @@ if (typeof document < "u") {
|
|
|
201
201
|
t.tagName === "A" && t.hasAttribute(e) && (t.setAttribute("target", t.getAttribute(e) || ""), t.removeAttribute(e), t.getAttribute("target") === "_blank" && t.setAttribute("rel", "noopener noreferrer"));
|
|
202
202
|
});
|
|
203
203
|
}
|
|
204
|
-
function
|
|
204
|
+
function ze(e) {
|
|
205
205
|
let t = {
|
|
206
206
|
USE_PROFILES: {
|
|
207
207
|
html: !0,
|
|
@@ -210,7 +210,7 @@ function Be(e) {
|
|
|
210
210
|
},
|
|
211
211
|
ADD_TAGS: ["use"],
|
|
212
212
|
ADD_ATTR: ["href", "xlink:href"],
|
|
213
|
-
ALLOWED_URI_REGEXP:
|
|
213
|
+
ALLOWED_URI_REGEXP: Re,
|
|
214
214
|
FORCE_BODY: !0,
|
|
215
215
|
CUSTOM_ELEMENT_HANDLING: {
|
|
216
216
|
tagNameCheck: /^(marimo-[A-Za-z][\w-]*|iconify-icon)$/,
|
|
@@ -222,55 +222,55 @@ function Be(e) {
|
|
|
222
222
|
}
|
|
223
223
|
//#endregion
|
|
224
224
|
//#region src/core/dom/outline.ts
|
|
225
|
-
var
|
|
225
|
+
var Be = [
|
|
226
226
|
"marimo-carousel",
|
|
227
227
|
"marimo-tabs",
|
|
228
228
|
"marimo-accordion",
|
|
229
229
|
"marimo-sidebar"
|
|
230
|
-
],
|
|
231
|
-
function
|
|
230
|
+
], Ve = "h1, h2, h3, h4, h5, h6";
|
|
231
|
+
function He(e) {
|
|
232
232
|
if (typeof DOMParser > "u") return null;
|
|
233
|
-
let t = [], n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(
|
|
233
|
+
let t = [], n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(Ve);
|
|
234
234
|
for (let e of Array.from(n)) {
|
|
235
235
|
let n = e.textContent;
|
|
236
|
-
if (
|
|
236
|
+
if (Be.some((t) => e.closest(t)) || !n) continue;
|
|
237
237
|
let r = Number.parseInt(e.tagName[1], 10), i = e.innerHTML, a = {
|
|
238
238
|
name: n,
|
|
239
239
|
level: r,
|
|
240
|
-
by:
|
|
240
|
+
by: We(e)
|
|
241
241
|
};
|
|
242
|
-
i !== n && (a.html =
|
|
242
|
+
i !== n && (a.html = ze(i)), t.push(a);
|
|
243
243
|
}
|
|
244
244
|
return { items: t };
|
|
245
245
|
}
|
|
246
|
-
function
|
|
246
|
+
function Ue(e) {
|
|
247
247
|
if (!e.includes("\"")) return `"${e}"`;
|
|
248
248
|
if (!e.includes("'")) return `'${e}'`;
|
|
249
249
|
let t = e.split("\""), n = [];
|
|
250
250
|
for (let [e, r] of t.entries()) r && n.push(`"${r}"`), e < t.length - 1 && n.push("'\"'");
|
|
251
251
|
return `concat(${n.join(", ")})`;
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function We(e) {
|
|
254
254
|
let t = e.id;
|
|
255
255
|
if (t) return { id: t };
|
|
256
256
|
let n = e.textContent ?? "";
|
|
257
|
-
return { path: `//${e.tagName}[contains(., ${
|
|
257
|
+
return { path: `//${e.tagName}[contains(., ${Ue(n)})]` };
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function Ge(e) {
|
|
260
260
|
return { items: e.filter(Boolean).flatMap((e) => e.items) };
|
|
261
261
|
}
|
|
262
|
-
function
|
|
262
|
+
function Ke(e) {
|
|
263
263
|
if (e == null || e.mimetype !== "text/html" && e.mimetype !== "text/markdown" || e.data == null) return null;
|
|
264
264
|
try {
|
|
265
|
-
return w(typeof e.data == "string", "expected string"),
|
|
265
|
+
return w(typeof e.data == "string", "expected string"), He(e.data);
|
|
266
266
|
} catch {
|
|
267
267
|
return t.error("Failed to parse outline"), null;
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
|
-
function
|
|
270
|
+
function qe(e) {
|
|
271
271
|
return e != null && e.items.some((e) => e.level <= 3);
|
|
272
272
|
}
|
|
273
|
-
function
|
|
273
|
+
function Je(e, n) {
|
|
274
274
|
let r = (e) => e.items.length === 0 ? 7 : Math.min(...e.items.map((e) => e.level)), i = n[e];
|
|
275
275
|
if (i == null || i.items.length === 0) return t.warn("Failed to find a starting outline"), null;
|
|
276
276
|
let a = r(i), o = e + 1;
|
|
@@ -283,19 +283,19 @@ function Ye(e, n) {
|
|
|
283
283
|
}
|
|
284
284
|
//#endregion
|
|
285
285
|
//#region src/core/notebook/replica/connection.ts
|
|
286
|
-
var
|
|
286
|
+
var A = {
|
|
287
287
|
NOT_STARTED: "NOT_STARTED",
|
|
288
288
|
CONNECTING: "CONNECTING",
|
|
289
289
|
OPEN: "OPEN",
|
|
290
290
|
CLOSED: "CLOSED"
|
|
291
|
-
},
|
|
291
|
+
}, Ye = {
|
|
292
292
|
KERNEL_DISCONNECTED: "KERNEL_DISCONNECTED",
|
|
293
293
|
KERNEL_STARTUP_ERROR: "KERNEL_STARTUP_ERROR"
|
|
294
|
-
},
|
|
294
|
+
}, Xe = {
|
|
295
295
|
sourceChanged: !1,
|
|
296
296
|
inputsChanged: !1
|
|
297
297
|
};
|
|
298
|
-
function
|
|
298
|
+
function Ze(e) {
|
|
299
299
|
let t = /* @__PURE__ */ new Map();
|
|
300
300
|
for (let n of e.executions.values()) for (let e of n.variables.values()) {
|
|
301
301
|
let n = t.get(e.name);
|
|
@@ -303,8 +303,8 @@ function Qe(e) {
|
|
|
303
303
|
}
|
|
304
304
|
return t;
|
|
305
305
|
}
|
|
306
|
-
function
|
|
307
|
-
let t =
|
|
306
|
+
function Qe(e) {
|
|
307
|
+
let t = Ze(e.executions), n = /* @__PURE__ */ new Map(), r = (t) => e.executions.executions.get(t)?.record;
|
|
308
308
|
function i(e, n) {
|
|
309
309
|
let i = new Set(n).add(e.id);
|
|
310
310
|
for (let [n, a] of Object.entries(e.depends_on)) {
|
|
@@ -341,54 +341,54 @@ function $e(e) {
|
|
|
341
341
|
}
|
|
342
342
|
return (t) => {
|
|
343
343
|
let n = e.results.get(t)?.record;
|
|
344
|
-
return n == null ?
|
|
344
|
+
return n == null ? Xe : o(n, /* @__PURE__ */ new Set());
|
|
345
345
|
};
|
|
346
346
|
}
|
|
347
347
|
//#endregion
|
|
348
348
|
//#region src/core/executions/output.ts
|
|
349
|
-
var
|
|
350
|
-
function
|
|
349
|
+
var $e = /* @__PURE__ */ new Map(), et = "application/vnd.marimo+error";
|
|
350
|
+
function j(e) {
|
|
351
351
|
return e;
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function tt(e) {
|
|
354
354
|
return e.map(({ cell_id: e, message: t }) => ({
|
|
355
|
-
cell_id:
|
|
355
|
+
cell_id: j(e),
|
|
356
356
|
message: t
|
|
357
357
|
}));
|
|
358
358
|
}
|
|
359
|
-
function
|
|
359
|
+
function nt(e) {
|
|
360
360
|
return e === null ? 0 : Date.parse(e) / 1e3;
|
|
361
361
|
}
|
|
362
|
-
function
|
|
363
|
-
return
|
|
362
|
+
function rt(e) {
|
|
363
|
+
return nt(e.completed_at ?? e.started_at);
|
|
364
364
|
}
|
|
365
|
-
function
|
|
365
|
+
function it(e, t) {
|
|
366
366
|
return {
|
|
367
367
|
channel: "output",
|
|
368
368
|
mimetype: t.mimetype,
|
|
369
369
|
data: t.data,
|
|
370
|
-
timestamp:
|
|
370
|
+
timestamp: rt(e)
|
|
371
371
|
};
|
|
372
372
|
}
|
|
373
|
-
function
|
|
373
|
+
function M(e, t) {
|
|
374
374
|
return {
|
|
375
375
|
channel: "marimo-error",
|
|
376
|
-
mimetype:
|
|
376
|
+
mimetype: et,
|
|
377
377
|
data: t,
|
|
378
|
-
timestamp:
|
|
378
|
+
timestamp: rt(e)
|
|
379
379
|
};
|
|
380
380
|
}
|
|
381
|
-
function
|
|
381
|
+
function at(e) {
|
|
382
382
|
let t = e.related.at(0);
|
|
383
|
-
return t === void 0 ? null :
|
|
383
|
+
return t === void 0 ? null : j(t.cell_id);
|
|
384
384
|
}
|
|
385
|
-
function
|
|
385
|
+
function ot(e) {
|
|
386
386
|
switch (e.kind) {
|
|
387
387
|
case "exception": return {
|
|
388
388
|
type: "exception",
|
|
389
389
|
exception_type: e.name ?? "Exception",
|
|
390
390
|
msg: e.message,
|
|
391
|
-
raising_cell:
|
|
391
|
+
raising_cell: at(e),
|
|
392
392
|
traceback: e.traceback?.data ?? null
|
|
393
393
|
};
|
|
394
394
|
case "invalid-syntax": return {
|
|
@@ -406,78 +406,78 @@ function st(e) {
|
|
|
406
406
|
type: "diagnostic",
|
|
407
407
|
kind: e.kind,
|
|
408
408
|
msg: e.message,
|
|
409
|
-
related:
|
|
409
|
+
related: tt(e.related)
|
|
410
410
|
};
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
|
-
function
|
|
413
|
+
function st(e, t) {
|
|
414
414
|
let n = t.related[0];
|
|
415
|
-
if (n !== void 0 && t.reason === "upstream-stopped") return
|
|
415
|
+
if (n !== void 0 && t.reason === "upstream-stopped") return M(e, [{
|
|
416
416
|
type: "ancestor-stopped",
|
|
417
417
|
msg: t.message,
|
|
418
|
-
raising_cell:
|
|
418
|
+
raising_cell: j(n.cell_id)
|
|
419
419
|
}]);
|
|
420
420
|
if (n !== void 0 && t.reason === "upstream-failed") {
|
|
421
421
|
let r = t.related.slice(1).find((t) => t.cell_id !== e.cell_id);
|
|
422
|
-
return
|
|
422
|
+
return M(e, [{
|
|
423
423
|
type: "ancestor-prevented",
|
|
424
424
|
msg: t.message,
|
|
425
|
-
raising_cell:
|
|
426
|
-
blamed_cell: r === void 0 ? null :
|
|
425
|
+
raising_cell: j(n.cell_id),
|
|
426
|
+
blamed_cell: r === void 0 ? null : j(r.cell_id)
|
|
427
427
|
}]);
|
|
428
428
|
}
|
|
429
|
-
return
|
|
429
|
+
return M(e, [{
|
|
430
430
|
type: "diagnostic",
|
|
431
431
|
kind: t.reason,
|
|
432
432
|
msg: t.message,
|
|
433
|
-
related:
|
|
433
|
+
related: tt(t.related)
|
|
434
434
|
}]);
|
|
435
435
|
}
|
|
436
|
-
function
|
|
436
|
+
function ct(e, t) {
|
|
437
437
|
let n = e.cell_id === null ? void 0 : t.get(e.cell_id);
|
|
438
438
|
return n !== void 0 && n.code !== null && n.code_fingerprint === e.code_fingerprint ? n.code : void 0;
|
|
439
439
|
}
|
|
440
|
-
function
|
|
441
|
-
let n =
|
|
440
|
+
function lt(e, t = $e) {
|
|
441
|
+
let n = ut(e), r = ct(e, t);
|
|
442
442
|
return n === null || r === void 0 ? n : {
|
|
443
443
|
...n,
|
|
444
444
|
code: r
|
|
445
445
|
};
|
|
446
446
|
}
|
|
447
|
-
function
|
|
447
|
+
function ut(e) {
|
|
448
448
|
let t = e.outcome;
|
|
449
449
|
if (t === null) return null;
|
|
450
450
|
switch (t.kind) {
|
|
451
|
-
case "value": return t.display === null ? null :
|
|
452
|
-
case "error": return
|
|
453
|
-
case "interrupted": return
|
|
454
|
-
case "skipped": return
|
|
451
|
+
case "value": return t.display === null ? null : it(e, t.display);
|
|
452
|
+
case "error": return M(e, [ot(t.error)]);
|
|
453
|
+
case "interrupted": return M(e, [{ type: "interruption" }]);
|
|
454
|
+
case "skipped": return st(e, t);
|
|
455
455
|
}
|
|
456
456
|
}
|
|
457
|
-
function
|
|
457
|
+
function dt(e, t) {
|
|
458
458
|
let n = e.executions.latest.get(t), r = n === void 0 ? void 0 : e.executions.executions.get(n);
|
|
459
459
|
if (r !== void 0 && r.record.outcome !== null && r.record.status !== "completed") return r;
|
|
460
460
|
let i = e.results.get(t) ?? null;
|
|
461
461
|
return r?.record.status === "running" && i?.record.outcome?.kind === "skipped" ? null : i;
|
|
462
462
|
}
|
|
463
|
-
function
|
|
463
|
+
function ft(e, t) {
|
|
464
464
|
return e?.execution === t.record.id && e.version === t.outputVersion;
|
|
465
465
|
}
|
|
466
|
-
function
|
|
467
|
-
let n =
|
|
468
|
-
return n === null ||
|
|
466
|
+
function pt(e, t) {
|
|
467
|
+
let n = dt(e, t);
|
|
468
|
+
return n === null || ft(e.cleared.get(t), n) ? null : lt(n.record, e.cells);
|
|
469
469
|
}
|
|
470
|
-
function
|
|
470
|
+
function mt(e) {
|
|
471
471
|
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set([...e.results.keys(), ...e.executions.latest.keys()]);
|
|
472
472
|
for (let r of n) {
|
|
473
|
-
let n =
|
|
474
|
-
n !== null && t.set(
|
|
473
|
+
let n = pt(e, r);
|
|
474
|
+
n !== null && t.set(j(r), n);
|
|
475
475
|
}
|
|
476
476
|
return t;
|
|
477
477
|
}
|
|
478
478
|
//#endregion
|
|
479
479
|
//#region src/utils/time.ts
|
|
480
|
-
var
|
|
480
|
+
var ht = class e {
|
|
481
481
|
ms;
|
|
482
482
|
static fromMilliseconds(t) {
|
|
483
483
|
return t == null ? null : new e(t);
|
|
@@ -506,153 +506,152 @@ var gt = class e {
|
|
|
506
506
|
};
|
|
507
507
|
//#endregion
|
|
508
508
|
//#region src/core/executions/select.ts
|
|
509
|
-
function
|
|
509
|
+
function gt(e) {
|
|
510
510
|
let t = e.outcome;
|
|
511
511
|
return t === null ? null : t.kind;
|
|
512
512
|
}
|
|
513
|
-
function
|
|
514
|
-
return e === null ? null :
|
|
513
|
+
function _t(e) {
|
|
514
|
+
return e === null ? null : ht.parse(e).toMilliseconds();
|
|
515
515
|
}
|
|
516
|
-
function
|
|
516
|
+
function vt(e, t) {
|
|
517
517
|
let n = e.latest.get(t);
|
|
518
518
|
return n === void 0 ? null : e.executions.get(n) ?? null;
|
|
519
519
|
}
|
|
520
|
-
function
|
|
520
|
+
function yt(e, t) {
|
|
521
521
|
let n = e.cells.get(t);
|
|
522
522
|
return n !== void 0 && !n.config.disabled && !e.blocked.has(t);
|
|
523
523
|
}
|
|
524
|
-
function
|
|
525
|
-
if (!
|
|
524
|
+
function bt(e, t) {
|
|
525
|
+
if (!yt(e, t)) return !1;
|
|
526
526
|
if (e.requested.has(t)) return !0;
|
|
527
|
-
let n =
|
|
527
|
+
let n = vt(e.executions, t)?.record.run_id ?? e.results.get(t)?.record.run_id;
|
|
528
528
|
for (let r of e.executions.runs.values()) if (r.status !== "completed" && r.id !== n && r.cells.includes(t)) return !0;
|
|
529
529
|
return !1;
|
|
530
530
|
}
|
|
531
|
-
function
|
|
532
|
-
let n =
|
|
533
|
-
n !== null && n.record.status !== "completed" ? (i = n.record.status, a =
|
|
534
|
-
let
|
|
531
|
+
function xt(e, t) {
|
|
532
|
+
let n = vt(e.executions, t), r = e.results.get(t)?.record ?? null, i = "idle", a = r === null ? null : _t(r.started_at);
|
|
533
|
+
n !== null && n.record.status !== "completed" ? (i = n.record.status, a = _t(n.record.started_at) ?? a) : bt(e, t) && (i = "queued");
|
|
534
|
+
let o = i === "idle", s = o && r !== null && r.started_at !== null && r.completed_at !== null ? ht.parse(r.completed_at).since(ht.parse(r.started_at)) : null;
|
|
535
535
|
return {
|
|
536
536
|
status: i,
|
|
537
537
|
blocked: e.blocked.has(t),
|
|
538
|
-
outcome:
|
|
538
|
+
outcome: o && r !== null ? gt(r) : null,
|
|
539
539
|
live: r === null || e.runtimeId === null || r.runtime_id === e.runtimeId,
|
|
540
540
|
startedAt: a,
|
|
541
|
-
duration:
|
|
542
|
-
rendered: o
|
|
541
|
+
duration: s
|
|
543
542
|
};
|
|
544
543
|
}
|
|
545
|
-
function
|
|
544
|
+
function St(e) {
|
|
546
545
|
return [...e.executions.values()].filter((e) => e.record.status !== "completed");
|
|
547
546
|
}
|
|
548
|
-
function
|
|
549
|
-
return
|
|
547
|
+
function Ct(e) {
|
|
548
|
+
return St(e).some((e) => e.record.status === "running");
|
|
550
549
|
}
|
|
551
|
-
function
|
|
552
|
-
let t =
|
|
550
|
+
function wt(e) {
|
|
551
|
+
let t = St(e.executions), n = new Set(t.flatMap((e) => e.record.cell_id === null ? [] : [e.record.cell_id])), r = new Set(e.requested);
|
|
553
552
|
for (let t of e.executions.runs.values()) if (t.status !== "completed") for (let e of t.cells) r.add(e);
|
|
554
553
|
let i = 0;
|
|
555
|
-
for (let t of r) !n.has(t) &&
|
|
554
|
+
for (let t of r) !n.has(t) && bt(e, t) && (i += 1);
|
|
556
555
|
return t.length + i;
|
|
557
556
|
}
|
|
558
557
|
//#endregion
|
|
559
558
|
//#region src/core/executions/atoms.ts
|
|
560
|
-
var
|
|
559
|
+
var Tt = {
|
|
561
560
|
runs: /* @__PURE__ */ new Map(),
|
|
562
561
|
executions: /* @__PURE__ */ new Map(),
|
|
563
562
|
latest: /* @__PURE__ */ new Map(),
|
|
564
563
|
results: /* @__PURE__ */ new Map(),
|
|
565
564
|
scratch: null
|
|
566
|
-
},
|
|
567
|
-
function
|
|
565
|
+
}, Et = /* @__PURE__ */ new Map(), N = /* @__PURE__ */ new Map(), Dt = /* @__PURE__ */ new Set(), Ot = /* @__PURE__ */ new Set(), kt = /* @__PURE__ */ new Set(), At = /* @__PURE__ */ new Map(), P = x(null), jt = x(null);
|
|
566
|
+
function Mt(e, t, n, r) {
|
|
568
567
|
return e !== null && e.notebook.replica === t && e.notebook.id === n ? e.value : r;
|
|
569
568
|
}
|
|
570
|
-
function
|
|
571
|
-
let t = e.get(
|
|
569
|
+
function Nt(e) {
|
|
570
|
+
let t = e.get(m), n = t === null ? null : e.get(t.notebookAtom);
|
|
572
571
|
return t === null || n === null ? null : {
|
|
573
572
|
replica: t,
|
|
574
573
|
id: n.id
|
|
575
574
|
};
|
|
576
575
|
}
|
|
577
|
-
function
|
|
578
|
-
let n =
|
|
576
|
+
function Pt(e, t) {
|
|
577
|
+
let n = Nt(e);
|
|
579
578
|
return n === null ? null : {
|
|
580
579
|
notebook: n,
|
|
581
580
|
value: t
|
|
582
581
|
};
|
|
583
582
|
}
|
|
584
|
-
function
|
|
585
|
-
let n = e.get(
|
|
583
|
+
function Ft(e, t) {
|
|
584
|
+
let n = e.get(m);
|
|
586
585
|
if (n !== t.notebook.replica) return !1;
|
|
587
586
|
let r = e.get(n.notebookAtom);
|
|
588
587
|
return r === null || r.id === t.notebook.id;
|
|
589
588
|
}
|
|
590
|
-
var
|
|
591
|
-
let t = e(
|
|
592
|
-
return r.size === 0 ?
|
|
593
|
-
}),
|
|
594
|
-
let t = e(
|
|
589
|
+
var It = x((e) => {
|
|
590
|
+
let t = e(m), n = t === null ? null : e(t.notebookAtom)?.id ?? null, r = Mt(e(P), t, n, Dt);
|
|
591
|
+
return r.size === 0 ? Ot : new Set([...r].flatMap((e) => e.cells));
|
|
592
|
+
}), F = x((e) => {
|
|
593
|
+
let t = e(m), n = t === null ? null : e(t.notebookAtom)?.id ?? null, r = t === null ? null : e(t.shownDocumentAtom);
|
|
595
594
|
return {
|
|
596
|
-
executions: t === null ?
|
|
597
|
-
results: t === null ?
|
|
598
|
-
cells: r?.cells ??
|
|
599
|
-
requested: e(
|
|
600
|
-
blocked:
|
|
595
|
+
executions: t === null ? Tt : e(t.executionsAtom),
|
|
596
|
+
results: t === null ? Et : e(t.resultsAtom),
|
|
597
|
+
cells: r?.cells ?? N,
|
|
598
|
+
requested: e(It),
|
|
599
|
+
blocked: Mt(e(jt), t, n, kt),
|
|
601
600
|
runtimeId: t === null ? null : e(t.runtimeAtom)?.id ?? null
|
|
602
601
|
};
|
|
603
|
-
}),
|
|
604
|
-
let t = e(
|
|
602
|
+
}), Lt = x((e) => {
|
|
603
|
+
let t = e(m), n = t === null ? null : e(t.shownDocumentAtom);
|
|
605
604
|
return t === null || n === null ? {
|
|
606
|
-
cells:
|
|
607
|
-
executions:
|
|
608
|
-
results:
|
|
605
|
+
cells: N,
|
|
606
|
+
executions: Tt,
|
|
607
|
+
results: Et
|
|
609
608
|
} : {
|
|
610
609
|
cells: n.cells,
|
|
611
610
|
executions: e(t.executionsAtom),
|
|
612
611
|
results: e(t.resultsAtom)
|
|
613
612
|
};
|
|
614
|
-
}),
|
|
615
|
-
let t = e(
|
|
613
|
+
}), Rt = x((e) => Qe(e(Lt))), zt = x(null), Bt = x((e) => {
|
|
614
|
+
let t = e(m), n = t === null ? null : e(t.shownDocumentAtom);
|
|
616
615
|
return t === null || n === null ? null : {
|
|
617
616
|
replica: t,
|
|
618
617
|
id: n.revision.notebook_id
|
|
619
618
|
};
|
|
620
|
-
}),
|
|
621
|
-
let t = e(
|
|
619
|
+
}), Vt = x((e) => {
|
|
620
|
+
let t = e(m), n = e(Bt)?.id ?? null;
|
|
622
621
|
return {
|
|
623
|
-
executions: t === null ?
|
|
624
|
-
results: t === null ?
|
|
625
|
-
cleared:
|
|
626
|
-
cells: t === null ?
|
|
622
|
+
executions: t === null ? Tt : e(t.executionsAtom),
|
|
623
|
+
results: t === null ? Et : e(t.resultsAtom),
|
|
624
|
+
cleared: Mt(e(zt), t, n, At),
|
|
625
|
+
cells: t === null ? N : e(t.documentAtom)?.cells ?? N
|
|
627
626
|
};
|
|
628
|
-
}),
|
|
629
|
-
function
|
|
630
|
-
|
|
627
|
+
}), Ht = x((e) => mt(e(Vt))), I = C((e) => g(Ht, (t) => t.get(e) ?? null, h)), L = C((e) => x((t) => Ke(t(I(e)))));
|
|
628
|
+
function Ut(e) {
|
|
629
|
+
I.remove(e), L.remove(e);
|
|
631
630
|
}
|
|
632
|
-
function
|
|
633
|
-
let n = e.get(
|
|
631
|
+
function Wt(e, t) {
|
|
632
|
+
let n = e.get(Vt), r = new Map(n.cleared);
|
|
634
633
|
for (let e of t) {
|
|
635
|
-
let t =
|
|
634
|
+
let t = dt(n, e);
|
|
636
635
|
t?.record.outcome != null && r.set(e, {
|
|
637
636
|
execution: t.record.id,
|
|
638
637
|
version: t.outputVersion
|
|
639
638
|
});
|
|
640
639
|
}
|
|
641
|
-
let i = e.get(
|
|
642
|
-
e.set(
|
|
640
|
+
let i = e.get(Bt);
|
|
641
|
+
e.set(zt, i === null ? null : {
|
|
643
642
|
notebook: i,
|
|
644
643
|
value: r
|
|
645
644
|
});
|
|
646
645
|
}
|
|
647
|
-
var
|
|
648
|
-
let t = e(
|
|
646
|
+
var Gt = x((e) => {
|
|
647
|
+
let t = e(m);
|
|
649
648
|
return t === null ? null : e(t.runtimeAtom)?.status ?? null;
|
|
650
649
|
});
|
|
651
|
-
|
|
652
|
-
var
|
|
653
|
-
let t = e(
|
|
650
|
+
x((e) => Ct(e(F).executions)), x((e) => wt(e(F)));
|
|
651
|
+
var Kt = x((e) => {
|
|
652
|
+
let t = e(m);
|
|
654
653
|
if (t === null) return { refused: "No notebook is connected" };
|
|
655
|
-
if (e(t.connectionAtom).state ===
|
|
654
|
+
if (e(t.connectionAtom).state === A.CLOSED) return { refused: "The notebook is disconnected" };
|
|
656
655
|
if (e(t.notebookAtom) === null) return "waiting";
|
|
657
656
|
let n = e(t.runtimeAtom);
|
|
658
657
|
if (n === null) return { refused: "The notebook has no runtime" };
|
|
@@ -662,67 +661,67 @@ var qt = p((e) => {
|
|
|
662
661
|
default: return "waiting";
|
|
663
662
|
}
|
|
664
663
|
});
|
|
665
|
-
function
|
|
664
|
+
function qt(e) {
|
|
666
665
|
return new Promise((t, n) => {
|
|
667
|
-
let r = e.sub(
|
|
666
|
+
let r = e.sub(Kt, i);
|
|
668
667
|
function i() {
|
|
669
|
-
let i = e.get(
|
|
668
|
+
let i = e.get(Kt);
|
|
670
669
|
i !== "waiting" && (r(), i === "running" ? t() : n(Error(i.refused)));
|
|
671
670
|
}
|
|
672
671
|
i();
|
|
673
672
|
});
|
|
674
673
|
}
|
|
675
|
-
function
|
|
676
|
-
let n =
|
|
674
|
+
function Jt(e, t) {
|
|
675
|
+
let n = Nt(e);
|
|
677
676
|
if (n === null) return null;
|
|
678
677
|
let r = {
|
|
679
678
|
notebook: n,
|
|
680
679
|
cells: [...t]
|
|
681
|
-
}, i = e.get(
|
|
682
|
-
return e.set(
|
|
680
|
+
}, i = e.get(P), a = i !== null && i.notebook.replica === n.replica && i.notebook.id === n.id ? i.value : Dt;
|
|
681
|
+
return e.set(P, {
|
|
683
682
|
notebook: n,
|
|
684
683
|
value: new Set(a).add(r)
|
|
685
684
|
}), r;
|
|
686
685
|
}
|
|
687
|
-
function
|
|
688
|
-
let n = e.get(
|
|
686
|
+
function Yt(e, t) {
|
|
687
|
+
let n = e.get(P);
|
|
689
688
|
if (n === null || !n.value.has(t)) return;
|
|
690
689
|
let r = new Set(n.value);
|
|
691
|
-
r.delete(t), e.set(
|
|
690
|
+
r.delete(t), e.set(P, {
|
|
692
691
|
notebook: n.notebook,
|
|
693
692
|
value: r
|
|
694
693
|
});
|
|
695
694
|
}
|
|
696
|
-
function
|
|
695
|
+
function Xt(e, t, n) {
|
|
697
696
|
let { replica: r } = t.notebook, i = e.sub(r.executionsAtom, a);
|
|
698
697
|
function a() {
|
|
699
|
-
(!
|
|
698
|
+
(!Ft(e, t) || e.get(r.executionsAtom).runs.has(n.id)) && (i(), Yt(e, t));
|
|
700
699
|
}
|
|
701
700
|
a();
|
|
702
701
|
}
|
|
703
|
-
function
|
|
704
|
-
let r = e.get(
|
|
702
|
+
function Zt(e, t, n) {
|
|
703
|
+
let r = e.get(F).blocked;
|
|
705
704
|
if (r.has(t) === n) return;
|
|
706
705
|
let i = new Set(r);
|
|
707
|
-
n ? i.add(t) : i.delete(t), e.set(
|
|
706
|
+
n ? i.add(t) : i.delete(t), e.set(jt, Pt(e, i));
|
|
708
707
|
}
|
|
709
|
-
function
|
|
710
|
-
t.status != null &&
|
|
708
|
+
function Qt(e, t) {
|
|
709
|
+
t.status != null && Zt(e, t.cell_id, t.status === "disabled-transitively");
|
|
711
710
|
}
|
|
712
711
|
//#endregion
|
|
713
712
|
//#region src/core/codemirror/editing/commands.ts
|
|
714
|
-
var
|
|
715
|
-
function
|
|
713
|
+
var $t = a();
|
|
714
|
+
function en(e) {
|
|
716
715
|
return (t) => {
|
|
717
716
|
let n = !1;
|
|
718
717
|
for (let r of t) r && (n = e(r) || n);
|
|
719
718
|
return n;
|
|
720
719
|
};
|
|
721
720
|
}
|
|
722
|
-
var
|
|
721
|
+
var tn = en(me), nn = en(pe);
|
|
723
722
|
//#endregion
|
|
724
723
|
//#region src/utils/schedule-task.ts
|
|
725
|
-
function
|
|
724
|
+
function rn() {
|
|
726
725
|
let e = globalThis.scheduler;
|
|
727
726
|
if (typeof e?.postTask == "function") return (t) => {
|
|
728
727
|
e.postTask(t, { priority: "user-visible" }).catch((e) => {
|
|
@@ -743,10 +742,10 @@ function an() {
|
|
|
743
742
|
setTimeout(e, 0);
|
|
744
743
|
};
|
|
745
744
|
}
|
|
746
|
-
var
|
|
745
|
+
var an = rn();
|
|
747
746
|
//#endregion
|
|
748
747
|
//#region src/core/codemirror/editor-mount-scheduler.ts
|
|
749
|
-
function
|
|
748
|
+
function on(e = an) {
|
|
750
749
|
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = !1;
|
|
751
750
|
function i() {
|
|
752
751
|
r || t.size === 0 || (r = !0, e(o));
|
|
@@ -789,21 +788,21 @@ function sn(e = on) {
|
|
|
789
788
|
}
|
|
790
789
|
};
|
|
791
790
|
}
|
|
792
|
-
var
|
|
791
|
+
var sn = on();
|
|
793
792
|
//#endregion
|
|
794
793
|
//#region src/core/mime.ts
|
|
795
|
-
function
|
|
794
|
+
function cn(e) {
|
|
796
795
|
return e === "application/vnd.marimo+error";
|
|
797
796
|
}
|
|
798
|
-
function
|
|
797
|
+
function ln(e) {
|
|
799
798
|
return e === "application/vnd.marimo+traceback";
|
|
800
799
|
}
|
|
801
|
-
function
|
|
802
|
-
return
|
|
800
|
+
function R(e) {
|
|
801
|
+
return cn(e) || ln(e);
|
|
803
802
|
}
|
|
804
803
|
//#endregion
|
|
805
804
|
//#region src/components/editor/output/ansi-reduce.ts
|
|
806
|
-
var
|
|
805
|
+
var un = class e {
|
|
807
806
|
lines = [""];
|
|
808
807
|
cursor = {
|
|
809
808
|
row: 0,
|
|
@@ -892,7 +891,7 @@ var dn = class e {
|
|
|
892
891
|
render() {
|
|
893
892
|
return this.lines.join("\n");
|
|
894
893
|
}
|
|
895
|
-
},
|
|
894
|
+
}, dn = class {
|
|
896
895
|
ESC_REGEX = new RegExp(String.raw`\u001B(?:\[[0-9;]*[A-Za-z]|\([0-9A-Za-z])`, "gu");
|
|
897
896
|
parse(e) {
|
|
898
897
|
let t = [], n = 0;
|
|
@@ -911,9 +910,9 @@ var dn = class e {
|
|
|
911
910
|
value: e.slice(n)
|
|
912
911
|
}), t;
|
|
913
912
|
}
|
|
914
|
-
},
|
|
915
|
-
parser = new
|
|
916
|
-
buffer = new
|
|
913
|
+
}, fn = class {
|
|
914
|
+
parser = new dn();
|
|
915
|
+
buffer = new un();
|
|
917
916
|
reduce(e) {
|
|
918
917
|
return this.reset(), this.append(e), this.render();
|
|
919
918
|
}
|
|
@@ -929,7 +928,7 @@ var dn = class e {
|
|
|
929
928
|
for (let e of t) e.type === "text" ? this.processText(e.value) : this.buffer.handleEscape(e.value);
|
|
930
929
|
}
|
|
931
930
|
reset() {
|
|
932
|
-
this.buffer = new
|
|
931
|
+
this.buffer = new un();
|
|
933
932
|
}
|
|
934
933
|
render() {
|
|
935
934
|
return this.buffer.render();
|
|
@@ -972,20 +971,20 @@ var dn = class e {
|
|
|
972
971
|
for (let t of e) t >= " " && (n += t);
|
|
973
972
|
return n;
|
|
974
973
|
}
|
|
975
|
-
},
|
|
974
|
+
}, z = class e {
|
|
976
975
|
mimetype;
|
|
977
976
|
channel;
|
|
978
977
|
timestamp;
|
|
979
978
|
code;
|
|
980
979
|
id;
|
|
981
980
|
input_id;
|
|
982
|
-
ansiReducer = new
|
|
981
|
+
ansiReducer = new fn();
|
|
983
982
|
_data;
|
|
984
983
|
get data() {
|
|
985
984
|
return this._data;
|
|
986
985
|
}
|
|
987
986
|
static create(t) {
|
|
988
|
-
let n = new
|
|
987
|
+
let n = new fn();
|
|
989
988
|
return n.append(t.data), new e({
|
|
990
989
|
mimetype: t.mimetype,
|
|
991
990
|
channel: t.channel,
|
|
@@ -1022,28 +1021,28 @@ var dn = class e {
|
|
|
1022
1021
|
};
|
|
1023
1022
|
//#endregion
|
|
1024
1023
|
//#region src/core/cells/collapseConsoleOutputs.tsx
|
|
1025
|
-
function
|
|
1024
|
+
function pn(e, t = 5e3) {
|
|
1026
1025
|
let n = [...e];
|
|
1027
|
-
if (n.length < 2) return
|
|
1026
|
+
if (n.length < 2) return vn(n.map(hn), t);
|
|
1028
1027
|
let r = n[n.length - 1], i = n[n.length - 2];
|
|
1029
|
-
return
|
|
1028
|
+
return mn(r, i) && (_n(r), _n(i), n[n.length - 2] = gn(i, r), n.pop()), vn(n, t);
|
|
1030
1029
|
}
|
|
1031
|
-
function
|
|
1030
|
+
function mn(e, t) {
|
|
1032
1031
|
let n = e.mimetype === "text/plain" && t.mimetype === "text/plain";
|
|
1033
1032
|
if (!n) return !1;
|
|
1034
1033
|
let r = e.channel === t.channel, i = e.channel !== "stdin";
|
|
1035
1034
|
return n && r && i;
|
|
1036
1035
|
}
|
|
1037
|
-
function
|
|
1038
|
-
return e instanceof
|
|
1036
|
+
function hn(e) {
|
|
1037
|
+
return e instanceof z ? e : typeof e.data == "string" ? z.create(e) : e;
|
|
1039
1038
|
}
|
|
1040
|
-
function
|
|
1041
|
-
return e instanceof
|
|
1039
|
+
function gn(e, t) {
|
|
1040
|
+
return e instanceof z ? e.appendData(t.data) : z.create(e).appendData(t.data);
|
|
1042
1041
|
}
|
|
1043
|
-
function
|
|
1042
|
+
function _n(e) {
|
|
1044
1043
|
w(typeof e.data == "string", "expected string output");
|
|
1045
1044
|
}
|
|
1046
|
-
function
|
|
1045
|
+
function vn(e, t) {
|
|
1047
1046
|
let n = 0, r;
|
|
1048
1047
|
for (r = e.length - 1; r >= 0 && n < t; r--) {
|
|
1049
1048
|
let t = e[r];
|
|
@@ -1073,16 +1072,16 @@ function yn(e, t) {
|
|
|
1073
1072
|
}
|
|
1074
1073
|
//#endregion
|
|
1075
1074
|
//#region src/core/cells/cell.ts
|
|
1076
|
-
function
|
|
1075
|
+
function yn(e) {
|
|
1077
1076
|
return (e.at(-1)?.id ?? 0) + 1;
|
|
1078
1077
|
}
|
|
1079
|
-
function
|
|
1078
|
+
function bn(e) {
|
|
1080
1079
|
return e == null || e.mimetype !== "application/vnd.marimo+error" || !Array.isArray(e.data) ? [] : e.data.map((e) => e.type);
|
|
1081
1080
|
}
|
|
1082
|
-
function
|
|
1081
|
+
function xn(e, t) {
|
|
1083
1082
|
let n = { ...e };
|
|
1084
1083
|
t.status === "queued" && (n.debuggerActive = !1), t.serialization !== void 0 && (n.serialization = t.serialization);
|
|
1085
|
-
let r =
|
|
1084
|
+
let r = bn(t.output).includes("interruption"), i = e.consoleOutputs;
|
|
1086
1085
|
(r || t.status === "idle") && (n.debuggerActive = !1, i = i.map((e) => e.channel === "stdin" ? {
|
|
1087
1086
|
channel: e.channel,
|
|
1088
1087
|
mimetype: e.mimetype,
|
|
@@ -1093,26 +1092,26 @@ function Sn(e, t) {
|
|
|
1093
1092
|
response: e.response ?? ""
|
|
1094
1093
|
} : e));
|
|
1095
1094
|
let a = t.console;
|
|
1096
|
-
a != null && (i =
|
|
1095
|
+
a != null && (i = pn(Array.isArray(a) ? a.map((e, t) => ({
|
|
1097
1096
|
...e,
|
|
1098
1097
|
id: t + 1
|
|
1099
1098
|
})) : [...i, {
|
|
1100
1099
|
...a,
|
|
1101
|
-
id:
|
|
1100
|
+
id: yn(i)
|
|
1102
1101
|
}])), n.consoleOutputs = i;
|
|
1103
1102
|
let o = [t.console].flat().filter(Boolean).filter((e) => e.channel === "pdb");
|
|
1104
1103
|
return o.length > 0 && o.some((e) => e.data === "start") && (n.debuggerActive = !0), n;
|
|
1105
1104
|
}
|
|
1106
|
-
function
|
|
1105
|
+
function Sn(e) {
|
|
1107
1106
|
return e === "running" || e === "queued";
|
|
1108
1107
|
}
|
|
1109
|
-
function
|
|
1110
|
-
let { status: r, outcome: i
|
|
1111
|
-
return
|
|
1108
|
+
function Cn(e, t, n) {
|
|
1109
|
+
let { status: r, outcome: i } = e;
|
|
1110
|
+
return Sn(r) ? !1 : n && t.sourceChanged ? !0 : i !== "interrupted" && t.inputsChanged;
|
|
1112
1111
|
}
|
|
1113
1112
|
//#endregion
|
|
1114
1113
|
//#region src/core/cells/columns.ts
|
|
1115
|
-
function
|
|
1114
|
+
function wn(e) {
|
|
1116
1115
|
let t = /* @__PURE__ */ new Map(), n = 0;
|
|
1117
1116
|
for (let r of e.order) {
|
|
1118
1117
|
let i = e.cells.get(r)?.config.column;
|
|
@@ -1120,9 +1119,9 @@ function Tn(e) {
|
|
|
1120
1119
|
}
|
|
1121
1120
|
return t;
|
|
1122
1121
|
}
|
|
1123
|
-
function
|
|
1122
|
+
function Tn(e) {
|
|
1124
1123
|
let t = [[]];
|
|
1125
|
-
for (let [n, r] of
|
|
1124
|
+
for (let [n, r] of wn(e)) {
|
|
1126
1125
|
for (; t.length <= r;) t.push([]);
|
|
1127
1126
|
t[r].push(n);
|
|
1128
1127
|
}
|
|
@@ -1130,16 +1129,16 @@ function En(e) {
|
|
|
1130
1129
|
}
|
|
1131
1130
|
//#endregion
|
|
1132
1131
|
//#region src/core/dom/ui-element-constants.ts
|
|
1133
|
-
var
|
|
1132
|
+
var En = "object-id", Dn = "random-id", On = "abcdefghijklmnopqrstuvwxyz", kn = On + On.toUpperCase(), An = /* @__PURE__ */ new Set(), B = "__scratch__", jn = "setup", Mn = { create() {
|
|
1134
1133
|
let e = 0, t;
|
|
1135
1134
|
do {
|
|
1136
1135
|
let n = "";
|
|
1137
|
-
for (let e = 0; e < 4; e++) n +=
|
|
1136
|
+
for (let e = 0; e < 4; e++) n += kn[Math.floor(Math.random() * 52)];
|
|
1138
1137
|
t = n, e++;
|
|
1139
|
-
} while (
|
|
1138
|
+
} while (An.has(t) && e < 100);
|
|
1140
1139
|
if (e >= 100) throw Error("Failed to generate unique CellId after 100 attempts");
|
|
1141
|
-
return
|
|
1142
|
-
} },
|
|
1140
|
+
return An.add(t), t;
|
|
1141
|
+
} }, V = {
|
|
1143
1142
|
create(e) {
|
|
1144
1143
|
return w(e != null, "cellId is required"), `cell-${e}`;
|
|
1145
1144
|
},
|
|
@@ -1152,7 +1151,7 @@ var Dn = "object-id", On = "random-id", kn = "abcdefghijklmnopqrstuvwxyz", An =
|
|
|
1152
1151
|
findElementThroughShadowDOMs(e) {
|
|
1153
1152
|
let t = e;
|
|
1154
1153
|
for (; t;) {
|
|
1155
|
-
let e =
|
|
1154
|
+
let e = V.findElement(t);
|
|
1156
1155
|
if (e) return e;
|
|
1157
1156
|
let n = t.getRootNode();
|
|
1158
1157
|
if (t = n instanceof ShadowRoot ? n.host : t.parentElement, t === n) break;
|
|
@@ -1160,33 +1159,33 @@ var Dn = "object-id", On = "random-id", kn = "abcdefghijklmnopqrstuvwxyz", An =
|
|
|
1160
1159
|
return null;
|
|
1161
1160
|
}
|
|
1162
1161
|
};
|
|
1163
|
-
function
|
|
1164
|
-
let t = null, n =
|
|
1165
|
-
return n && (t =
|
|
1162
|
+
function Nn(e) {
|
|
1163
|
+
let t = null, n = V.findElementThroughShadowDOMs(e);
|
|
1164
|
+
return n && (t = V.parse(n.id)), t;
|
|
1166
1165
|
}
|
|
1167
|
-
var
|
|
1166
|
+
var Pn = {
|
|
1168
1167
|
parse(e) {
|
|
1169
|
-
return e.getAttribute(
|
|
1168
|
+
return e.getAttribute(En);
|
|
1170
1169
|
},
|
|
1171
1170
|
parseOrThrow(e) {
|
|
1172
|
-
let t =
|
|
1171
|
+
let t = Pn.parse(e);
|
|
1173
1172
|
return w(t, "<marimo-ui-element/> missing object-id attribute"), t;
|
|
1174
1173
|
}
|
|
1175
1174
|
}, Fn = { create(e) {
|
|
1176
1175
|
return `output-${e}`;
|
|
1177
|
-
} }, In =
|
|
1176
|
+
} }, In = x(/* @__PURE__ */ new Set()), H = x([]), U = x([]);
|
|
1178
1177
|
function Ln() {
|
|
1179
|
-
return `column-${
|
|
1178
|
+
return `column-${Mn.create()}`;
|
|
1180
1179
|
}
|
|
1181
|
-
var Rn =
|
|
1182
|
-
let r =
|
|
1180
|
+
var Rn = x(null, (e, t, n) => {
|
|
1181
|
+
let r = Tn(n).length, i = e(H);
|
|
1183
1182
|
if (i.length === r) return;
|
|
1184
1183
|
let a = e(U), o = [...i, ...a].slice(0, r);
|
|
1185
1184
|
for (; o.length < r;) o.push(Ln());
|
|
1186
1185
|
t(H, o), t(U, a.slice(Math.max(0, r - i.length)));
|
|
1187
1186
|
});
|
|
1188
1187
|
function zn(e, t, n) {
|
|
1189
|
-
return [...(e === null ? [[]] :
|
|
1188
|
+
return [...(e === null ? [[]] : Tn(e)).map((e, n) => ({
|
|
1190
1189
|
id: t[n] ?? `column-${n}`,
|
|
1191
1190
|
ids: e
|
|
1192
1191
|
})), ...n.map((e) => ({
|
|
@@ -1199,7 +1198,7 @@ function Bn(e, t, n) {
|
|
|
1199
1198
|
return e.forEach((i, a) => {
|
|
1200
1199
|
let o = t[a];
|
|
1201
1200
|
if (!n.has(i) || !o || o.items.length === 0) return;
|
|
1202
|
-
let s =
|
|
1201
|
+
let s = Je(a, t);
|
|
1203
1202
|
s !== null && r.set(i, e.slice(a + 1, s[1] + 1));
|
|
1204
1203
|
}), r;
|
|
1205
1204
|
}
|
|
@@ -1214,10 +1213,10 @@ function Vn(e, t, n) {
|
|
|
1214
1213
|
};
|
|
1215
1214
|
}) };
|
|
1216
1215
|
}
|
|
1217
|
-
var Hn =
|
|
1218
|
-
let t = e(
|
|
1216
|
+
var Hn = x((e) => {
|
|
1217
|
+
let t = e(b), n = t === null ? null : e(t.documentAtom), r = e(Ki);
|
|
1219
1218
|
return Vn(zn(n, e(H), e(U)), (e) => r[e] ?? null, e(In));
|
|
1220
|
-
}), Un = () =>
|
|
1219
|
+
}), Un = () => v(Hn), Wn = x((e) => e(Hn).columns.length);
|
|
1221
1220
|
function Gn(e, t) {
|
|
1222
1221
|
return e.columns.find((e) => e.id === t);
|
|
1223
1222
|
}
|
|
@@ -1291,7 +1290,7 @@ function rr(e) {
|
|
|
1291
1290
|
//#endregion
|
|
1292
1291
|
//#region src/core/cells/document.ts
|
|
1293
1292
|
function ir(e, t) {
|
|
1294
|
-
let n = t.code ?? e.code, r =
|
|
1293
|
+
let n = t.code ?? e.code, r = h(e.config, t.config) ? e.config : nr(t.config);
|
|
1295
1294
|
return n === e.code && t.name === e.name && r === e.config ? e : n === e.code ? {
|
|
1296
1295
|
...e,
|
|
1297
1296
|
name: t.name,
|
|
@@ -1304,7 +1303,7 @@ function ir(e, t) {
|
|
|
1304
1303
|
};
|
|
1305
1304
|
}
|
|
1306
1305
|
function ar(e, t) {
|
|
1307
|
-
let n =
|
|
1306
|
+
let n = h(t.order, e.cellIds) ? e.cellIds : [...t.order], { cellData: r, cellRuntime: i, cellHandles: a } = e;
|
|
1308
1307
|
for (let o of n) {
|
|
1309
1308
|
let n = t.cells.get(o), s = e.cellData[o];
|
|
1310
1309
|
if (n === void 0) continue;
|
|
@@ -1353,23 +1352,23 @@ function or({ store: e, model: t, reconcile: n, signal: r }) {
|
|
|
1353
1352
|
r.addEventListener("abort", a, { once: !0 }), i();
|
|
1354
1353
|
}
|
|
1355
1354
|
async function sr() {
|
|
1356
|
-
let e =
|
|
1357
|
-
e !== null &&
|
|
1355
|
+
let e = y.get(b);
|
|
1356
|
+
e !== null && y.get(e.syncStatusAtom).status !== "unavailable" && await e.flush();
|
|
1358
1357
|
}
|
|
1359
1358
|
//#endregion
|
|
1360
1359
|
//#region src/core/cells/editor.ts
|
|
1361
|
-
var W =
|
|
1360
|
+
var W = x(/* @__PURE__ */ new Set());
|
|
1362
1361
|
function cr(e, t, n) {
|
|
1363
1362
|
return !!e && !t.has(n);
|
|
1364
1363
|
}
|
|
1365
|
-
|
|
1364
|
+
x(null, (e, t, { cellId: n }) => {
|
|
1366
1365
|
t(W, (e) => /* @__PURE__ */ new Set([...e, n]));
|
|
1367
|
-
}),
|
|
1366
|
+
}), x(null, (e, t, { cellId: n }) => e(W).has(n) ? (t(W, (e) => {
|
|
1368
1367
|
let t = new Set(e);
|
|
1369
1368
|
return t.delete(n), t;
|
|
1370
1369
|
}), !0) : !1);
|
|
1371
|
-
var lr =
|
|
1372
|
-
|
|
1370
|
+
var lr = x(/* @__PURE__ */ new Map());
|
|
1371
|
+
x(null, (e, t, { cellId: n }) => {
|
|
1373
1372
|
t(lr, (e) => {
|
|
1374
1373
|
let t = new Map(e);
|
|
1375
1374
|
return t.delete(n), t;
|
|
@@ -1767,7 +1766,7 @@ function yr(e) {
|
|
|
1767
1766
|
}
|
|
1768
1767
|
//#endregion
|
|
1769
1768
|
//#region src/core/errors/traceback-atom.ts
|
|
1770
|
-
var br =
|
|
1769
|
+
var br = x(null);
|
|
1771
1770
|
//#endregion
|
|
1772
1771
|
//#region src/core/cells/logs.ts
|
|
1773
1772
|
function xr(e) {
|
|
@@ -1799,7 +1798,7 @@ function Cr(e) {
|
|
|
1799
1798
|
}
|
|
1800
1799
|
}
|
|
1801
1800
|
}
|
|
1802
|
-
if (t.forEach(wr.log), n.length === 0 &&
|
|
1801
|
+
if (t.forEach(wr.log), n.length === 0 && R(e.output?.mimetype) && Array.isArray(e.output.data)) {
|
|
1803
1802
|
e.output.data.forEach((t) => {
|
|
1804
1803
|
wr.log({
|
|
1805
1804
|
level: "stderr",
|
|
@@ -1811,7 +1810,7 @@ function Cr(e) {
|
|
|
1811
1810
|
message: JSON.stringify(t)
|
|
1812
1811
|
});
|
|
1813
1812
|
});
|
|
1814
|
-
let t = e.output.data.filter((e) => "type" in e && e.type === "exception" || e.type === "internal"), n =
|
|
1813
|
+
let t = e.output.data.filter((e) => "type" in e && e.type === "exception" || e.type === "internal"), n = y.get(ge) === "read";
|
|
1815
1814
|
if (t.length > 0 && !Sr && n) {
|
|
1816
1815
|
Sr = !0;
|
|
1817
1816
|
let e = t.find((e) => e.traceback);
|
|
@@ -1822,7 +1821,7 @@ function Cr(e) {
|
|
|
1822
1821
|
action: T.createElement(se, {
|
|
1823
1822
|
altText: "View traceback",
|
|
1824
1823
|
onClick: () => {
|
|
1825
|
-
|
|
1824
|
+
y.set(br, {
|
|
1826
1825
|
traceback: e.traceback,
|
|
1827
1826
|
errorMessage: e.msg || "An internal error occurred"
|
|
1828
1827
|
});
|
|
@@ -1856,7 +1855,7 @@ function Tr(e) {
|
|
|
1856
1855
|
//#endregion
|
|
1857
1856
|
//#region src/components/editor/navigation/focus-utils.ts
|
|
1858
1857
|
function Er(e, n) {
|
|
1859
|
-
let r = document.getElementById(
|
|
1858
|
+
let r = document.getElementById(V.create(e));
|
|
1860
1859
|
r ? Or(r, n) : t.warn(`[CellFocusManager] focusCell: element not found: ${e}`);
|
|
1861
1860
|
}
|
|
1862
1861
|
function Dr() {
|
|
@@ -1886,51 +1885,50 @@ function kr(e, n) {
|
|
|
1886
1885
|
}
|
|
1887
1886
|
//#endregion
|
|
1888
1887
|
//#region src/core/cells/utils.ts
|
|
1889
|
-
function Ar(e
|
|
1890
|
-
return Ir(e, t, n).length > 0;
|
|
1891
|
-
}
|
|
1892
|
-
function jr(e) {
|
|
1888
|
+
function Ar(e) {
|
|
1893
1889
|
return e.cellIds.map((t) => e.cellData[t]);
|
|
1894
1890
|
}
|
|
1895
|
-
function
|
|
1891
|
+
function jr(e) {
|
|
1896
1892
|
let { cellIds: t, cellData: n } = e, r = [];
|
|
1897
1893
|
for (let e of t) n[e].config.disabled && r.push(e);
|
|
1898
1894
|
return r;
|
|
1899
1895
|
}
|
|
1900
|
-
function
|
|
1896
|
+
function Mr(e) {
|
|
1901
1897
|
let { cellIds: t, cellData: n } = e, r = [];
|
|
1902
1898
|
for (let e of t) n[e].config.disabled || r.push(e);
|
|
1903
1899
|
return r;
|
|
1904
1900
|
}
|
|
1905
|
-
function
|
|
1901
|
+
function Nr(e) {
|
|
1906
1902
|
return e.history.length > 0;
|
|
1907
1903
|
}
|
|
1908
|
-
function
|
|
1904
|
+
function Pr(e) {
|
|
1909
1905
|
let t = e.history[e.history.length - 1];
|
|
1910
1906
|
return t && t.type === "move" ? "Undo move" : "Undo cell deletion";
|
|
1911
1907
|
}
|
|
1912
|
-
function
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
blocked: r.blocked
|
|
1921
|
-
}) : Lr(t.executions, e) && n(e).sourceChanged;
|
|
1922
|
-
});
|
|
1908
|
+
function Fr(e, t, n) {
|
|
1909
|
+
return e.status === "idle" ? zr(e) && n.code.trim() ? "not-run" : t.sourceChanged ? "source" : e.outcome === "interrupted" ? "interrupted" : t.inputsChanged && !n.config.disabled && !e.blocked ? "inputs" : null : null;
|
|
1910
|
+
}
|
|
1911
|
+
function* Ir(e, t, n) {
|
|
1912
|
+
for (let r of e.cellIds) {
|
|
1913
|
+
let i = xt(t, r), a = n(r), o = Fr(i, a, e.cellData[r]);
|
|
1914
|
+
o === null ? a.sourceChanged && Rr(t.executions, r) && (yield [r, "source"]) : yield [r, o];
|
|
1915
|
+
}
|
|
1923
1916
|
}
|
|
1924
|
-
function Lr(e, t) {
|
|
1917
|
+
function Lr(e, t, n) {
|
|
1918
|
+
let r = null;
|
|
1919
|
+
for (let [, i] of Ir(e, t, n)) {
|
|
1920
|
+
if (i !== "inputs") return i;
|
|
1921
|
+
r = i;
|
|
1922
|
+
}
|
|
1923
|
+
return r;
|
|
1924
|
+
}
|
|
1925
|
+
function Rr(e, t) {
|
|
1925
1926
|
let n = e.latest.get(t), r = n === void 0 ? void 0 : e.executions.get(n)?.record;
|
|
1926
1927
|
return r !== void 0 && r.status !== "completed";
|
|
1927
1928
|
}
|
|
1928
|
-
function
|
|
1929
|
+
function zr({ status: e, outcome: t, live: n }) {
|
|
1929
1930
|
return (t === null || !n) && e !== "queued" && e !== "running";
|
|
1930
1931
|
}
|
|
1931
|
-
function zr({ freshness: e, interrupted: t, disabled: n, blocked: r }) {
|
|
1932
|
-
return e.sourceChanged || t || e.inputsChanged && !(n || r);
|
|
1933
|
-
}
|
|
1934
1932
|
function Br({ errored: e, stopped: t }) {
|
|
1935
1933
|
return {
|
|
1936
1934
|
published: !0,
|
|
@@ -1939,18 +1937,18 @@ function Br({ errored: e, stopped: t }) {
|
|
|
1939
1937
|
};
|
|
1940
1938
|
}
|
|
1941
1939
|
function Vr({ errored: e, interrupted: t, stopped: n, output: r, showErrorTracebacks: i }) {
|
|
1942
|
-
let a =
|
|
1940
|
+
let a = R(r?.mimetype), o = i && a && Array.isArray(r?.data) && r.data.some((e) => e.type === "exception" && "traceback" in e && e.traceback);
|
|
1943
1941
|
return (e || t || n || a) && !o;
|
|
1944
1942
|
}
|
|
1945
1943
|
//#endregion
|
|
1946
1944
|
//#region src/core/network/requests.ts
|
|
1947
|
-
var Hr =
|
|
1945
|
+
var Hr = x(null);
|
|
1948
1946
|
function Ur() {
|
|
1949
|
-
let e =
|
|
1947
|
+
let e = v(Hr);
|
|
1950
1948
|
return w(e, "useRequestClient() requires setting requestClientAtom."), e;
|
|
1951
1949
|
}
|
|
1952
1950
|
function Wr() {
|
|
1953
|
-
let e =
|
|
1951
|
+
let e = y.get(Hr);
|
|
1954
1952
|
return w(e, "getRequestClient() requires requestClientAtom to be set."), e;
|
|
1955
1953
|
}
|
|
1956
1954
|
//#endregion
|
|
@@ -2073,11 +2071,11 @@ function si(e) {
|
|
|
2073
2071
|
return ce.mapValues(e.dataset, (e) => typeof e == "string" ? oi(e) : e);
|
|
2074
2072
|
}
|
|
2075
2073
|
function ci(e, t) {
|
|
2076
|
-
let n = e.parentElement ?
|
|
2074
|
+
let n = e.parentElement ? Pn.parse(e.parentElement) : void 0;
|
|
2077
2075
|
return n && t.has(n) ? t.lookupValue(n) : oi(e.dataset.initialValue);
|
|
2078
2076
|
}
|
|
2079
2077
|
function li() {
|
|
2080
|
-
if (
|
|
2078
|
+
if (S()) return document.title || null;
|
|
2081
2079
|
if (ve()) {
|
|
2082
2080
|
let e = ai.getFilename();
|
|
2083
2081
|
if (e) return e;
|
|
@@ -2089,10 +2087,10 @@ function li() {
|
|
|
2089
2087
|
}
|
|
2090
2088
|
//#endregion
|
|
2091
2089
|
//#region src/core/saving/file-state.ts
|
|
2092
|
-
var q =
|
|
2093
|
-
|
|
2094
|
-
var ui =
|
|
2095
|
-
|
|
2090
|
+
var q = x(li());
|
|
2091
|
+
x(null);
|
|
2092
|
+
var ui = x(null);
|
|
2093
|
+
x(void 0);
|
|
2096
2094
|
//#endregion
|
|
2097
2095
|
//#region src/utils/storage/typed.ts
|
|
2098
2096
|
var di = class {
|
|
@@ -2142,11 +2140,11 @@ var di = class {
|
|
|
2142
2140
|
filename;
|
|
2143
2141
|
unsubscribeFromFilename;
|
|
2144
2142
|
constructor(e, t, n) {
|
|
2145
|
-
let r =
|
|
2143
|
+
let r = y.get(q);
|
|
2146
2144
|
super(t, n), this.filename = r;
|
|
2147
2145
|
try {
|
|
2148
|
-
this.unsubscribeFromFilename =
|
|
2149
|
-
let t =
|
|
2146
|
+
this.unsubscribeFromFilename = y.sub(q, () => {
|
|
2147
|
+
let t = y.get(q);
|
|
2150
2148
|
this.handleFilenameChange(e, t);
|
|
2151
2149
|
});
|
|
2152
2150
|
} catch {
|
|
@@ -2435,55 +2433,55 @@ function Oi(e, t) {
|
|
|
2435
2433
|
}
|
|
2436
2434
|
//#endregion
|
|
2437
2435
|
//#region src/core/network/connection.ts
|
|
2438
|
-
var Z =
|
|
2439
|
-
|
|
2436
|
+
var Z = x({ state: A.NOT_STARTED });
|
|
2437
|
+
p(null, (e, t) => t === null ? null : {
|
|
2440
2438
|
phase: t.phase,
|
|
2441
2439
|
logs: t.log_mode === "append" && e?.phase === t.phase ? e.logs + t.logs : t.logs
|
|
2442
2440
|
});
|
|
2443
2441
|
function ki() {
|
|
2444
|
-
return
|
|
2442
|
+
return ae(Z, (e) => e.state === A.OPEN);
|
|
2445
2443
|
}
|
|
2446
2444
|
function Ai() {
|
|
2447
2445
|
return he() ? ki() : Promise.resolve();
|
|
2448
2446
|
}
|
|
2449
|
-
|
|
2447
|
+
x((e) => e(Z).state === A.CONNECTING), x((e) => e(Z).state === A.OPEN), x((e) => {
|
|
2450
2448
|
let t = e(Z);
|
|
2451
|
-
return t.state ===
|
|
2452
|
-
}),
|
|
2449
|
+
return t.state === A.OPEN || t.state === A.NOT_STARTED;
|
|
2450
|
+
}), x((e) => e(Z).state === A.CLOSED);
|
|
2453
2451
|
//#endregion
|
|
2454
2452
|
//#region src/components/ui/checkbox.tsx
|
|
2455
2453
|
var ji = T.forwardRef((e, t) => {
|
|
2456
|
-
let r = (0,
|
|
2454
|
+
let r = (0, $t.c)(13), i, a;
|
|
2457
2455
|
r[0] === e ? (i = r[1], a = r[2]) : ({className: i, ...a} = e, r[0] = e, r[1] = i, r[2] = a);
|
|
2458
2456
|
let o;
|
|
2459
2457
|
r[3] === i ? o = r[4] : (o = n("flex items-center justify-center peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground data-[state=indeterminate]:bg-primary data-[state=indeterminate]:text-primary-foreground", i), r[3] = i, r[4] = o);
|
|
2460
2458
|
let s;
|
|
2461
2459
|
r[5] === Symbol.for("react.memo_cache_sentinel") ? (s = n("flex items-center justify-center text-current max-h-[14px] overflow-hidden"), r[5] = s) : s = r[5];
|
|
2462
2460
|
let c;
|
|
2463
|
-
r[6] === a.checked ? c = r[7] : (c = /* @__PURE__ */ (0, E.jsx)(
|
|
2461
|
+
r[6] === a.checked ? c = r[7] : (c = /* @__PURE__ */ (0, E.jsx)(Ne, {
|
|
2464
2462
|
className: s,
|
|
2465
2463
|
children: a.checked === "indeterminate" ? /* @__PURE__ */ (0, E.jsx)(Se, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, E.jsx)(l, { className: "h-4 w-4" })
|
|
2466
2464
|
}), r[6] = a.checked, r[7] = c);
|
|
2467
2465
|
let u;
|
|
2468
|
-
return r[8] !== a || r[9] !== t || r[10] !== o || r[11] !== c ? (u = /* @__PURE__ */ (0, E.jsx)(
|
|
2466
|
+
return r[8] !== a || r[9] !== t || r[10] !== o || r[11] !== c ? (u = /* @__PURE__ */ (0, E.jsx)(je, {
|
|
2469
2467
|
ref: t,
|
|
2470
2468
|
className: o,
|
|
2471
2469
|
...a,
|
|
2472
2470
|
children: c
|
|
2473
2471
|
}), r[8] = a, r[9] = t, r[10] = o, r[11] = c, r[12] = u) : u = r[12], u;
|
|
2474
2472
|
});
|
|
2475
|
-
ji.displayName =
|
|
2473
|
+
ji.displayName = je.displayName;
|
|
2476
2474
|
//#endregion
|
|
2477
2475
|
//#region src/core/cells/scrollCellIntoView.ts
|
|
2478
2476
|
function Mi({ cellId: e, cell: n, isCodeHidden: r, codeFocus: i, variableName: a }) {
|
|
2479
2477
|
if (!n) return;
|
|
2480
|
-
let o = document.getElementById(
|
|
2478
|
+
let o = document.getElementById(V.create(e));
|
|
2481
2479
|
if (!o) t.warn("scrollCellIntoView: element not found");
|
|
2482
2480
|
else if (Dr()) Or(o);
|
|
2483
2481
|
else {
|
|
2484
2482
|
if (r) Or(o);
|
|
2485
2483
|
else {
|
|
2486
|
-
|
|
2484
|
+
sn.promote(e);
|
|
2487
2485
|
let r = n.current?.editorView;
|
|
2488
2486
|
if (!r) {
|
|
2489
2487
|
t.warn("scrollCellIntoView: editor not found", e);
|
|
@@ -2525,7 +2523,7 @@ function Pi() {
|
|
|
2525
2523
|
});
|
|
2526
2524
|
}
|
|
2527
2525
|
function Fi(e) {
|
|
2528
|
-
let t = document.getElementById(
|
|
2526
|
+
let t = document.getElementById(V.create(e));
|
|
2529
2527
|
return t?.scrollIntoView({
|
|
2530
2528
|
behavior: "smooth",
|
|
2531
2529
|
block: "center"
|
|
@@ -2543,18 +2541,18 @@ function Ii(e) {
|
|
|
2543
2541
|
return {
|
|
2544
2542
|
...e,
|
|
2545
2543
|
cellData: {
|
|
2546
|
-
[
|
|
2547
|
-
id:
|
|
2544
|
+
[B]: tr({
|
|
2545
|
+
id: B,
|
|
2548
2546
|
config: t
|
|
2549
2547
|
}),
|
|
2550
2548
|
...e.cellData
|
|
2551
2549
|
},
|
|
2552
2550
|
cellRuntime: {
|
|
2553
|
-
[
|
|
2551
|
+
[B]: rr(),
|
|
2554
2552
|
...e.cellRuntime
|
|
2555
2553
|
},
|
|
2556
2554
|
cellHandles: {
|
|
2557
|
-
[
|
|
2555
|
+
[B]: (0, T.createRef)(),
|
|
2558
2556
|
...e.cellHandles
|
|
2559
2557
|
}
|
|
2560
2558
|
};
|
|
@@ -2583,7 +2581,7 @@ var { reducer: Ri, createActions: zi, useActions: Bi, valueAtom: Q } = ue(Li, {
|
|
|
2583
2581
|
let n = t.cell_id, r = Hi({
|
|
2584
2582
|
state: e,
|
|
2585
2583
|
cellId: n,
|
|
2586
|
-
cellReducer: (e) =>
|
|
2584
|
+
cellReducer: (e) => xn(e, t)
|
|
2587
2585
|
});
|
|
2588
2586
|
return {
|
|
2589
2587
|
...r,
|
|
@@ -2596,7 +2594,7 @@ var { reducer: Ri, createActions: zi, useActions: Bi, valueAtom: Q } = ue(Li, {
|
|
|
2596
2594
|
}),
|
|
2597
2595
|
reconcileDocument: (e, t) => {
|
|
2598
2596
|
let n = ar(e, t);
|
|
2599
|
-
for (let t of e.cellIds) t in n.cellData ||
|
|
2597
|
+
for (let t of e.cellIds) t in n.cellData || ra(t);
|
|
2600
2598
|
return n;
|
|
2601
2599
|
},
|
|
2602
2600
|
setStdinResponse: (e, n) => {
|
|
@@ -2623,7 +2621,7 @@ var { reducer: Ri, createActions: zi, useActions: Bi, valueAtom: Q } = ue(Li, {
|
|
|
2623
2621
|
},
|
|
2624
2622
|
resetCellRuntimes: (e) => {
|
|
2625
2623
|
let t = ve(), n = { ...e.cellRuntime };
|
|
2626
|
-
for (let r of [...e.cellIds,
|
|
2624
|
+
for (let r of [...e.cellIds, B]) {
|
|
2627
2625
|
let i = e.cellRuntime[r];
|
|
2628
2626
|
n[r] = t && i !== void 0 && i.consoleOutputs.length > 0 ? i : rr();
|
|
2629
2627
|
}
|
|
@@ -2639,7 +2637,7 @@ var { reducer: Ri, createActions: zi, useActions: Bi, valueAtom: Q } = ue(Li, {
|
|
|
2639
2637
|
return Mi({
|
|
2640
2638
|
cellId: n,
|
|
2641
2639
|
cell: e.cellHandles[n],
|
|
2642
|
-
isCodeHidden: cr(e.cellData[n]?.config.hide_code,
|
|
2640
|
+
isCodeHidden: cr(e.cellData[n]?.config.hide_code, y.get(W), n),
|
|
2643
2641
|
codeFocus: void 0,
|
|
2644
2642
|
variableName: void 0
|
|
2645
2643
|
}), {
|
|
@@ -2647,8 +2645,8 @@ var { reducer: Ri, createActions: zi, useActions: Bi, valueAtom: Q } = ue(Li, {
|
|
|
2647
2645
|
scrollKey: null
|
|
2648
2646
|
};
|
|
2649
2647
|
},
|
|
2650
|
-
foldAll: (e) => (
|
|
2651
|
-
unfoldAll: (e) => (
|
|
2648
|
+
foldAll: (e) => (tn(Object.values(e.cellHandles).map((e) => e.current?.editorView)), e),
|
|
2649
|
+
unfoldAll: (e) => (nn(Object.values(e.cellHandles).map((e) => e.current?.editorView)), e),
|
|
2652
2650
|
clearLogs: (e) => ({
|
|
2653
2651
|
...e,
|
|
2654
2652
|
cellLogs: []
|
|
@@ -2680,14 +2678,16 @@ function Hi({ state: e, cellId: n, cellReducer: r }) {
|
|
|
2680
2678
|
} : (t.warn(`Cell ${n} not found in state`), e);
|
|
2681
2679
|
}
|
|
2682
2680
|
var Ui = zi((e) => {
|
|
2683
|
-
|
|
2684
|
-
}).addLogs, $ =
|
|
2685
|
-
|
|
2686
|
-
var Wi =
|
|
2681
|
+
y.set(Q, (t) => Ri(t, e));
|
|
2682
|
+
}).addLogs, $ = x((e) => e(Q).cellIds);
|
|
2683
|
+
x((e) => e($).length === 1), x((e) => jr(e(Q)).length > 0), x((e) => Mr(e(Q)).length > 0), x((e) => Nr(e(Q))), x((e) => Pr(e(Q)));
|
|
2684
|
+
var Wi = x((e) => Lr(e(Q), e(F), e(Rt)));
|
|
2685
|
+
x((e) => e(Wi) !== null);
|
|
2686
|
+
var Gi = x((e) => {
|
|
2687
2687
|
let { cellIds: t, cellData: n } = e(Q);
|
|
2688
2688
|
return t.map((t) => {
|
|
2689
|
-
let r = e(
|
|
2690
|
-
if (r !== null &&
|
|
2689
|
+
let r = e(I(t)), { name: i } = n[t];
|
|
2690
|
+
if (r !== null && R(r.mimetype)) {
|
|
2691
2691
|
w(Array.isArray(r.data), "Expected array data");
|
|
2692
2692
|
let e = r.data.filter((e) => !e.type.includes("ancestor"));
|
|
2693
2693
|
if (e.length > 0) return {
|
|
@@ -2701,66 +2701,66 @@ var Wi = p((e) => {
|
|
|
2701
2701
|
}
|
|
2702
2702
|
return null;
|
|
2703
2703
|
}).filter(Boolean);
|
|
2704
|
-
}),
|
|
2704
|
+
}), Ki = oe(x((e) => {
|
|
2705
2705
|
let t = {};
|
|
2706
2706
|
for (let n of e($)) {
|
|
2707
|
-
let r = e(
|
|
2707
|
+
let r = e(L(n));
|
|
2708
2708
|
r !== null && r.items.length > 0 && (t[n] = r);
|
|
2709
2709
|
}
|
|
2710
2710
|
return t;
|
|
2711
|
-
})),
|
|
2712
|
-
|
|
2713
|
-
var
|
|
2711
|
+
})), qi = x((e) => Ge(e($).map((t) => e(L(t)))));
|
|
2712
|
+
x((e) => e(Gi).length);
|
|
2713
|
+
var Ji = oe(x((e) => {
|
|
2714
2714
|
let { cellIds: t, cellData: n } = e(Q);
|
|
2715
2715
|
return ce.fromEntries(t.map((e) => [e, n[e]?.name]));
|
|
2716
2716
|
}));
|
|
2717
|
-
|
|
2718
|
-
var
|
|
2719
|
-
let { cellIds: e, cellData: t } =
|
|
2717
|
+
x((e) => e(Q).scrollKey);
|
|
2718
|
+
var Yi = () => v($), Xi = () => v(Ji), Zi = () => y.get(Q), Qi = () => y.get(Q).cellIds, $i = () => {
|
|
2719
|
+
let { cellIds: e, cellData: t } = y.get(Q);
|
|
2720
2720
|
return e.map((e) => t[e]?.name).filter(Boolean);
|
|
2721
2721
|
};
|
|
2722
|
-
_(g(Q, (e) => e.cellIds.map((t) => e.cellData[t]))),
|
|
2723
|
-
var
|
|
2724
|
-
function
|
|
2725
|
-
|
|
2722
|
+
_(g(Q, (e) => e.cellIds.map((t) => e.cellData[t]))), x((e) => e(Q).cellIds.length > 0);
|
|
2723
|
+
var ea = C((e) => x((t) => t(Q).cellData[e])), ta = C((e) => x((t) => t(Q).cellRuntime[e])), na = C((e) => x((t) => t(Q).cellHandles[e]));
|
|
2724
|
+
function ra(e) {
|
|
2725
|
+
ea.remove(e), ta.remove(e), na.remove(e), Ut(e);
|
|
2726
2726
|
}
|
|
2727
|
-
var
|
|
2728
|
-
let { cellHandles: t } =
|
|
2727
|
+
var ia = (e) => {
|
|
2728
|
+
let { cellHandles: t } = y.get(Q);
|
|
2729
2729
|
return t[e].current?.editorView;
|
|
2730
|
-
},
|
|
2731
|
-
function
|
|
2730
|
+
}, aa = (e) => (sn.promote(e), ia(e));
|
|
2731
|
+
function oa() {
|
|
2732
2732
|
return Bi();
|
|
2733
2733
|
}
|
|
2734
2734
|
//#endregion
|
|
2735
2735
|
//#region src/core/errors/error-entries.ts
|
|
2736
|
-
function
|
|
2737
|
-
if (
|
|
2736
|
+
function sa(e) {
|
|
2737
|
+
if (cn(e.mimetype)) {
|
|
2738
2738
|
if (!Array.isArray(e.data)) return null;
|
|
2739
2739
|
let t = e.data.filter((e) => !e.type.includes("ancestor"));
|
|
2740
2740
|
return t.length === 0 ? null : { errorData: t };
|
|
2741
2741
|
}
|
|
2742
|
-
return
|
|
2742
|
+
return ln(e.mimetype) ? typeof e.data != "string" || e.data.length === 0 ? null : {
|
|
2743
2743
|
errorData: [],
|
|
2744
2744
|
tracebackHtml: e.data
|
|
2745
2745
|
} : null;
|
|
2746
2746
|
}
|
|
2747
|
-
function
|
|
2747
|
+
function ca(e) {
|
|
2748
2748
|
return e.some((e) => "traceback" in e && e.traceback);
|
|
2749
2749
|
}
|
|
2750
|
-
function
|
|
2751
|
-
let t = e?.find((e) =>
|
|
2750
|
+
function la(e) {
|
|
2751
|
+
let t = e?.find((e) => ln(e.mimetype));
|
|
2752
2752
|
if (t && typeof t.data == "string" && t.data.length !== 0) return t.data;
|
|
2753
2753
|
}
|
|
2754
|
-
function
|
|
2754
|
+
function ua(e, t) {
|
|
2755
2755
|
if (e.tracebackHtml) return e.tracebackHtml;
|
|
2756
|
-
if (!
|
|
2756
|
+
if (!ca(e.errorData)) return la(t);
|
|
2757
2757
|
}
|
|
2758
|
-
function
|
|
2758
|
+
function da(e) {
|
|
2759
2759
|
let { cellIds: t, cellRuntime: n, cellData: r } = e.get(Q), i = [];
|
|
2760
2760
|
for (let [a, o] of t.entries()) {
|
|
2761
|
-
let t = e.get(
|
|
2762
|
-
if (t === null || !
|
|
2763
|
-
let s =
|
|
2761
|
+
let t = e.get(I(o));
|
|
2762
|
+
if (t === null || !R(t.mimetype)) continue;
|
|
2763
|
+
let s = sa(t);
|
|
2764
2764
|
if (!s) continue;
|
|
2765
2765
|
let c = $n(r[o].name, a), l = t.code ?? r[o].code;
|
|
2766
2766
|
i.push({
|
|
@@ -2768,21 +2768,21 @@ function ua(e) {
|
|
|
2768
2768
|
cellName: c,
|
|
2769
2769
|
cellCode: l,
|
|
2770
2770
|
errorData: s.errorData,
|
|
2771
|
-
tracebackHtml:
|
|
2771
|
+
tracebackHtml: ua(s, n[o].consoleOutputs)
|
|
2772
2772
|
});
|
|
2773
2773
|
}
|
|
2774
2774
|
return i;
|
|
2775
2775
|
}
|
|
2776
|
-
function
|
|
2776
|
+
function fa(e) {
|
|
2777
2777
|
return e.type === "diagnostic" ? e.msg : e.type === "setup-refs" ? "The setup cell cannot have references" : e.type === "cycle" ? "This cell is in a cycle" : e.type === "multiple-defs" ? `The variable '${e.name}' was defined by another cell` : e.type === "import-star" || e.type === "lazy-import" || e.type === "ancestor-stopped" || e.type === "ancestor-prevented" || e.type === "exception" || e.type === "strict-exception" ? e.msg : e.type === "interruption" ? "This cell was interrupted and needs to be re-run" : e.type === "syntax" || e.type === "unknown" || e.type === "sql-error" ? e.msg : e.type === "internal" ? e.msg || "An internal error occurred" : (u(e), "Unknown error");
|
|
2778
2778
|
}
|
|
2779
|
-
function
|
|
2780
|
-
let t =
|
|
2779
|
+
function pa(e) {
|
|
2780
|
+
let t = fa(e);
|
|
2781
2781
|
return "traceback" in e && e.traceback && (t += `\n\nTraceback:\n${K(e.traceback)}`), t;
|
|
2782
2782
|
}
|
|
2783
|
-
function
|
|
2783
|
+
function ma(e) {
|
|
2784
2784
|
let t = [e.cellName];
|
|
2785
|
-
return e.tracebackHtml && t.push(K(e.tracebackHtml)), e.errorData.length > 0 && t.push(e.errorData.map(
|
|
2785
|
+
return e.tracebackHtml && t.push(K(e.tracebackHtml)), e.errorData.length > 0 && t.push(e.errorData.map(pa).join("\n\n")), t.join("\n\n");
|
|
2786
2786
|
}
|
|
2787
2787
|
//#endregion
|
|
2788
|
-
export { K as $, Se as $t, Oi as A,
|
|
2788
|
+
export { K as $, Se as $t, Oi as A, Dn as At, ei as B, Wt as Bt, Ni as C, Fn as Ct, Z as D, Pn as Dt, ji as E, jn as Et, q as F, F as Ft, Hr as G, qt as Gt, Qr as H, Qt as Ht, ui as I, Rt as It, Ar as J, Ye as Jt, Ur as K, Yt as Kt, oi as L, L as Lt, pi as M, Sn as Mt, di as N, Cn as Nt, ki as O, Nn as Ot, fi as P, Xt as Pt, yr as Q, ze as Qt, si as R, I as Rt, Mi as S, Mn as St, Pi as T, B as Tt, qr as U, Jt as Ut, ti as V, Ft as Vt, Wr as W, Gt as Wt, Vr as X, qe as Xt, Br as Y, A as Yt, Er as Z, We as Zt, Ri as _, Jn as _t, Ui as a, or as at, Xi as b, Wn as bt, zi as c, er as ct, $i as d, H as dt, xe as en, fr as et, Qi as f, Kn as ft, qi as g, Yn as gt, Q as h, qn as ht, da as i, sr as it, hi as j, wn as jt, Ai as k, En as kt, aa as l, Zn as lt, Li as m, Gn as mt, ma as n, lr as nt, ea as o, $n as ot, Zi as p, U as pt, zr as q, xt as qt, pa as r, W as rt, $ as s, Qn as st, fa as t, cr as tt, ia as u, In as ut, ra as v, Hn as vt, Fi as w, V as wt, oa as x, Un as xt, Yi as y, Ln as yt, ci as z, Vt as zt };
|