@marimo-team/islands 0.25.3-dev272 → 0.25.3-dev275
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-eLHPh6uu.js → ConnectedDataExplorerComponent-CErm132k.js} +25 -26
- package/dist/{ErrorBoundary-vPW0qTmm.js → ErrorBoundary-BuIXiuc5.js} +43 -44
- package/dist/{abnfDiagram-VCTEODGH-hqd0IBtX.js → abnfDiagram-VCTEODGH-d-Qn2fwb.js} +2 -2
- package/dist/{any-language-editor-DnG26QXh.js → any-language-editor-6k6F12Z3.js} +3 -3
- package/dist/{architectureDiagram-5GKGNRK7-BzLAFcc0.js → architectureDiagram-5GKGNRK7-DxragHYv.js} +1 -1
- package/dist/{assertNever-DIU3JJbt.js → assertNever-B-YzWzbL.js} +14 -14
- package/dist/{button-0-RqY1DW.js → button-DZuNnIZO.js} +220 -223
- package/dist/{capabilities-B6yy_CBN.js → capabilities-D9FskwsK.js} +1 -1
- package/dist/{chat-ui-BWIkve2R.js → chat-ui-SZ6lSH52.js} +144 -145
- package/dist/{check-gUSZbRsl.js → check-XFzZeH-y.js} +1 -1
- package/dist/{chunk-IMKFNOWR-DOeVvuyE.js → chunk-IMKFNOWR-C0x0feFg.js} +1 -1
- package/dist/{chunk-SHT3W25Y-DZoFI8wR.js → chunk-SHT3W25Y-D0ZdASqB.js} +1 -1
- package/dist/{chunk-SVP7TREG-CWu86PSW.js → chunk-SVP7TREG-BHjL96zx.js} +1 -1
- package/dist/{chunk-TICWLB2K-BrM0GoP3.js → chunk-TICWLB2K-CzcrwGfp.js} +1 -1
- package/dist/{classDiagram-ZZMXUADV-DYi4V2bB.js → classDiagram-ZZMXUADV-BTqFAZTP.js} +2 -2
- package/dist/{classDiagram-v2-VYDZK3BY-tN7FIk-m.js → classDiagram-v2-VYDZK3BY-EPXb0Elt.js} +2 -2
- package/dist/{code-visibility-9gqV0vno.js → code-visibility-BEAPMrC-.js} +20 -20
- package/dist/{common-CT0KuTWr.js → common-CEmzaoJ8.js} +799 -801
- package/dist/{config-BsPruWMR.js → config-C8MFHQ2E.js} +23 -22
- package/dist/{copy-icon-C2I8sw4h.js → copy-icon-CtllOdmg.js} +3 -3
- package/dist/{createReducer-DdtT_7ji.js → createReducer-DRqwmaTc.js} +2 -2
- package/dist/{cynefinDiagram-5FMLGOSQ-D5nCnDc-.js → cynefinDiagram-5FMLGOSQ-CBSD344q.js} +1 -1
- package/dist/{dagre-GXQ25YYZ-BHkd7f_i.js → dagre-GXQ25YYZ-JItjh3Ge.js} +1 -1
- package/dist/{data-grid-overlay-editor-DKDADhfM.js → data-grid-overlay-editor-CUo25_W8.js} +1 -1
- package/dist/{diagram-S7CK7UJ4-D1ALppT2.js → diagram-S7CK7UJ4-CTD9xTVb.js} +1 -1
- package/dist/{diagram-UQ7AKVKN-DLv0b83L.js → diagram-UQ7AKVKN-DTfnFai8.js} +1 -1
- package/dist/{diagram-VX7I27RA-7XJ7J6qg.js → diagram-VX7I27RA-BcSnucV-.js} +1 -1
- package/dist/{diagram-Z3DM3KII-7M7zbHp_.js → diagram-Z3DM3KII-C2ATIE8A.js} +1 -1
- package/dist/{dialog-DzCj1qQv.js → dialog-CaYm5imE.js} +33 -33
- package/dist/{dropdown-menu-CdXE15an.js → dropdown-menu-Bb0bFOIk.js} +149 -149
- package/dist/{ebnfDiagram-PWID7BFC-DHH1qlmV.js → ebnfDiagram-PWID7BFC-B7B9JPxc.js} +2 -2
- package/dist/{erDiagram-RLTQ6QDP-fI_0dGef.js → erDiagram-RLTQ6QDP-v6hDno1O.js} +1 -1
- package/dist/{error-banner-DPc9eIw5.js → error-banner-CHCdHVFB.js} +44 -45
- package/dist/{error-entries-CxN-Nq3V.js → error-entries-B-1yUdcH.js} +406 -407
- package/dist/{feedback-button-Bo7swAlq.js → feedback-button-BqiR7zMO.js} +11 -11
- package/dist/{flowDiagram-HODETNUW-Brg9MA6i.js → flowDiagram-HODETNUW-aIFlAtOy.js} +2 -2
- package/dist/{formats-DbSvAPY-.js → formats-PzBQMUnr.js} +3 -3
- package/dist/{glide-data-editor-CSrAhQAR.js → glide-data-editor-B7dguvqk.js} +14 -16
- package/dist/{glide-utils-BSw3SSHF.js → glide-utils-BSQr4d90.js} +51 -59
- package/dist/{globals-CQZo8Fcj.js → globals-CYykXfGI.js} +3 -3
- package/dist/{html-to-image-Bc2AvXHG.js → html-to-image-DC_pmZLs.js} +546 -548
- package/dist/{infoDiagram-27XIBGKW-E9e403YT.js → infoDiagram-27XIBGKW-D6YHLeCP.js} +1 -1
- package/dist/{ishikawaDiagram-5VMMS53U-C-RlYDRo.js → ishikawaDiagram-5VMMS53U-D1ZvprOX.js} +1 -1
- package/dist/{kanban-definition-UXKFOSKX-CLFl_uqK.js → kanban-definition-UXKFOSKX-Bna_3BMr.js} +1 -1
- package/dist/{loader-BVEtQ4F3.js → loader-DZvtzQoD.js} +1 -1
- package/dist/main.js +6772 -6771
- package/dist/{mermaid-rd09e1JL.js → mermaid-A36unKXJ.js} +50 -50
- package/dist/{mindmap-definition-YA3MSWOX-BQ8TWtyB.js → mindmap-definition-YA3MSWOX-CyVCs__G.js} +1 -1
- package/dist/{number-overlay-editor-noy9X-05.js → number-overlay-editor-C4u7SJAJ.js} +1 -1
- package/dist/{pegDiagram-XKGWAZYB-CN8UHFPi.js → pegDiagram-XKGWAZYB-9hNBD2wZ.js} +2 -2
- package/dist/{pencil-DcT8AE0h.js → pencil-DYUlSKxZ.js} +1 -1
- package/dist/{pieDiagram-E7YTZNPT-DGuJ0EBd.js → pieDiagram-E7YTZNPT-8tr-NYo7.js} +1 -1
- package/dist/{process-output-qecD7Dk8.js → process-output-DYu84VfZ.js} +4 -4
- package/dist/{railroadDiagram-O6MQD6OU-BPDA8wy8.js → railroadDiagram-O6MQD6OU-Dzg1dyyp.js} +2 -2
- package/dist/{requirementDiagram-BXWQKSXE-ChzLGbGW.js → requirementDiagram-BXWQKSXE-B7sNqwGG.js} +1 -1
- package/dist/{reveal-component-C6H7NzHW.js → reveal-component-DGi-irHV.js} +589 -589
- package/dist/{select-OxgozOC8.js → select-DsoP1qe8.js} +290 -290
- package/dist/{sequenceDiagram-WJ2MYXX4-DFX-bE6O.js → sequenceDiagram-WJ2MYXX4-oP9shbaG.js} +1 -1
- package/dist/{spec-oJn0RhpQ.js → spec-BZMDxAu7.js} +4 -4
- package/dist/{stateDiagram-D77RDMKH-BR7cI3wK.js → stateDiagram-D77RDMKH-CjCv4ogv.js} +2 -2
- package/dist/{stateDiagram-v2-MP3YSRHH-oGqB5UDI.js → stateDiagram-v2-MP3YSRHH-BW9X162a.js} +2 -2
- package/dist/{static-state-CuV6Pc3a.js → static-state-D-Q-Ajaa.js} +8 -8
- package/dist/style.css +1 -1
- package/dist/{swimlanes-42K2YHIH-DwSZl1yC.js → swimlanes-42K2YHIH-Ckfs9Wrn.js} +1 -1
- package/dist/{swimlanesDiagram-VR7AAH4N-BHlcd-Ri.js → swimlanesDiagram-VR7AAH4N-DpTNG9YP.js} +2 -2
- package/dist/{swiper-component-Dvj-goaD.js → swiper-component-DQbK_ZWm.js} +7 -7
- package/dist/{timeline-definition-24CTP7MA-DMmP-G2O.js → timeline-definition-24CTP7MA-BXaBlV6U.js} +1 -1
- package/dist/{toast-DbBHmxmB.js → toast-BhjIy3Tq.js} +158 -158
- package/dist/{tooltip-BfcDQd2j.js → tooltip-DMMiOn2f.js} +64 -64
- package/dist/use-restore-focus-CosX7-gx.js +7568 -0
- package/dist/{useAsyncData-BYIAoMqn.js → useAsyncData-Ci4AvJff.js} +4 -4
- package/dist/{useDateFormatter-ButWkdcK.js → useDateFormatter-CPlava52.js} +2 -2
- package/dist/{useDeepCompareMemoize-Bz0c5GN6.js → useDeepCompareMemoize-NaaWoFlX.js} +1 -1
- package/dist/useEvent-BRH-aCqi.js +19 -0
- package/dist/{useIframeCapabilities-BIolGsF1.js → useIframeCapabilities-BXhDDoCG.js} +1 -1
- package/dist/{useLifecycle-JjxCC7Vu.js → useLifecycle-SniivYmC.js} +2 -2
- package/dist/{vega-component-rxIxAAh9.js → vega-component-DIxaDQNs.js} +40 -40
- package/dist/{vennDiagram-4TSXK5OY-Db8GtH1G.js → vennDiagram-4TSXK5OY-C-hQ4iNJ.js} +1 -1
- package/dist/{wardleyDiagram-VM6X3IG4-DmIiC3FU.js → wardleyDiagram-VM6X3IG4-C2MQ_Umv.js} +1 -1
- package/dist/{xychartDiagram-S5SC5T6Z-DS9OPrNq.js → xychartDiagram-S5SC5T6Z-BtTTBn7Q.js} +1 -1
- package/package.json +1 -1
- package/src/core/islands/components/__tests__/web-components.test.tsx +63 -0
- package/src/core/islands/components/web-components.tsx +11 -0
- package/src/css/globals.css +6 -2
- package/src/plugins/impl/DataEditorPlugin.tsx +0 -4
- package/src/plugins/impl/data-editor/__tests__/column-types.test.ts +5 -0
- package/src/plugins/impl/data-editor/__tests__/glide-data-editor.test.tsx +9 -5
- package/src/plugins/impl/data-editor/column-types.ts +3 -0
- package/src/plugins/impl/data-editor/glide-data-editor.tsx +6 -5
- package/src/plugins/impl/data-editor/glide-utils.ts +10 -32
- package/src/plugins/impl/data-editor/types.ts +0 -2
- package/src/theme/__tests__/islands-theme.test.tsx +276 -0
- package/src/theme/namespace.tsx +4 -3
- package/src/theme/useTheme.ts +71 -41
- package/dist/schemas-CdscWNy_.js +0 -4747
- package/dist/use-restore-focus-CmflVLWJ.js +0 -1672
- package/dist/useTheme-DPLobSFs.js +0 -339
- package/dist/utils-EBklsC5R.js +0 -813
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import { a as e } from "./rolldown-runtime-Cb76FRpK.js";
|
|
2
|
-
import { g as t, h as n, p as r } from "./button-
|
|
2
|
+
import { g as t, h as n, p as r } from "./button-DZuNnIZO.js";
|
|
3
3
|
import { t as i } from "./react-sHtZdjeP.js";
|
|
4
4
|
import { t as a } from "./compiler-runtime-CldRdSsv.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-CtllOdmg.js";
|
|
6
|
+
import { f as s, h as c } from "./tooltip-DMMiOn2f.js";
|
|
7
|
+
import { t as l } from "./check-XFzZeH-y.js";
|
|
8
|
+
import { n as u, r as d } from "./assertNever-B-YzWzbL.js";
|
|
9
9
|
import { t as f } from "./jsx-runtime-3BD1kT0s.js";
|
|
10
|
-
import {
|
|
11
|
-
import { n as
|
|
12
|
-
import {
|
|
13
|
-
import { t as
|
|
14
|
-
import { t as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
var _e = c("external-link", [
|
|
10
|
+
import { At as p, Ct as m, Dt as h, Et as g, Ft as _, Mt as v, Rt as y, St as b, d as x, dn as S, jt as C, ln as ee, mn as te, pn as ne, un as re, vt as ie, xt as ae, yt as w } from "./use-restore-focus-CosX7-gx.js";
|
|
11
|
+
import { n as oe } from "./toast-BhjIy3Tq.js";
|
|
12
|
+
import { t as se } from "./objects-DCmMvZtn.js";
|
|
13
|
+
import { t as T } from "./invariant-DLmrl-hA.js";
|
|
14
|
+
import { t as ce } from "./createReducer-DRqwmaTc.js";
|
|
15
|
+
import { M as le, N as ue, V as de, g as fe } from "./dist-CYeqK4Xw.js";
|
|
16
|
+
import { t as E } from "./purify.es-DMv5zIkJ.js";
|
|
17
|
+
import { a as pe, i as me, l as he, m as ge, u as _e } from "./static-state-D-Q-Ajaa.js";
|
|
18
|
+
import { t as ve } from "./capabilities-D9FskwsK.js";
|
|
19
|
+
var ye = c("external-link", [
|
|
21
20
|
["path", {
|
|
22
21
|
d: "M15 3h6v6",
|
|
23
22
|
key: "1q9fwt"
|
|
@@ -30,20 +29,20 @@ var _e = c("external-link", [
|
|
|
30
29
|
d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",
|
|
31
30
|
key: "a6xqqp"
|
|
32
31
|
}]
|
|
33
|
-
]),
|
|
32
|
+
]), be = c("minus", [["path", {
|
|
34
33
|
d: "M5 12h14",
|
|
35
34
|
key: "1ays0h"
|
|
36
|
-
}]]),
|
|
35
|
+
}]]), D = /* @__PURE__ */ e(i(), 1), O = f(), xe = Object.defineProperty, k = (e, t) => xe(e, "name", {
|
|
37
36
|
value: t,
|
|
38
37
|
configurable: !0
|
|
39
|
-
}),
|
|
40
|
-
function
|
|
41
|
-
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
|
+
}), Se = "Checkbox", [Ce, we] = ne(Se), [Te, Ee] = Ce(Se);
|
|
39
|
+
function De(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] = re({
|
|
42
41
|
prop: n,
|
|
43
42
|
defaultProp: i ?? !1,
|
|
44
43
|
onChange: c,
|
|
45
|
-
caller:
|
|
46
|
-
}), [m, h] =
|
|
44
|
+
caller: Se
|
|
45
|
+
}), [m, h] = D.useState(null), [g, _] = D.useState(null), [v, y] = D.useState(null), b = !m || !!o || !!m.closest("form"), x = {
|
|
47
46
|
checked: f,
|
|
48
47
|
disabled: a,
|
|
49
48
|
setChecked: p,
|
|
@@ -55,51 +54,51 @@ function Te(e) {
|
|
|
55
54
|
userClick: v,
|
|
56
55
|
onUserClick: y,
|
|
57
56
|
required: l,
|
|
58
|
-
defaultChecked: !
|
|
57
|
+
defaultChecked: !A(i) && i,
|
|
59
58
|
isFormControl: b,
|
|
60
59
|
bubbleInput: g,
|
|
61
60
|
setBubbleInput: _
|
|
62
61
|
};
|
|
63
|
-
return /* @__PURE__ */ (0,
|
|
62
|
+
return /* @__PURE__ */ (0, O.jsx)(Te, {
|
|
64
63
|
scope: t,
|
|
65
64
|
...x,
|
|
66
|
-
children:
|
|
65
|
+
children: Fe(d) ? d(x) : r
|
|
67
66
|
});
|
|
68
67
|
}
|
|
69
|
-
|
|
70
|
-
var
|
|
71
|
-
let { control: o, value: s, disabled: c, checked: l, required: u, setControl: d, setChecked: f, onUserClick: p, isFormControl:
|
|
72
|
-
return
|
|
68
|
+
k(De, "CheckboxProvider");
|
|
69
|
+
var Oe = "CheckboxTrigger", ke = /* @__PURE__ */ D.forwardRef(/* @__PURE__ */ k(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 } = Ee(Oe, e), g = r(a, d), _ = D.useRef(l);
|
|
71
|
+
return D.useEffect(() => {
|
|
73
72
|
let e = o?.form;
|
|
74
73
|
if (e) {
|
|
75
|
-
let t = /* @__PURE__ */
|
|
74
|
+
let t = /* @__PURE__ */ k(() => f(_.current), "reset");
|
|
76
75
|
return e.addEventListener("reset", t), () => e.removeEventListener("reset", t);
|
|
77
76
|
}
|
|
78
|
-
}, [o, f]), /* @__PURE__ */ (0,
|
|
77
|
+
}, [o, f]), /* @__PURE__ */ (0, O.jsx)(te.button, {
|
|
79
78
|
type: "button",
|
|
80
79
|
role: "checkbox",
|
|
81
|
-
"aria-checked":
|
|
80
|
+
"aria-checked": A(l) ? "mixed" : l,
|
|
82
81
|
"aria-required": u,
|
|
83
|
-
"data-state":
|
|
82
|
+
"data-state": Ie(l),
|
|
84
83
|
"data-disabled": c ? "" : void 0,
|
|
85
84
|
disabled: c,
|
|
86
85
|
value: s,
|
|
87
86
|
...i,
|
|
88
|
-
ref:
|
|
89
|
-
onKeyDown:
|
|
87
|
+
ref: g,
|
|
88
|
+
onKeyDown: S(t, (e) => {
|
|
90
89
|
e.key === "Enter" && e.preventDefault();
|
|
91
90
|
}),
|
|
92
|
-
onClick:
|
|
91
|
+
onClick: S(n, (e) => {
|
|
93
92
|
let t = e.isPropagationStopped();
|
|
94
93
|
p({
|
|
95
|
-
requestedChecked:
|
|
94
|
+
requestedChecked: A(l) ? !0 : !l,
|
|
96
95
|
hasConsumerStoppedPropagation: t
|
|
97
|
-
}), f((e) =>
|
|
96
|
+
}), f((e) => A(e) ? !0 : !e), h && m && (t || e.stopPropagation());
|
|
98
97
|
})
|
|
99
98
|
});
|
|
100
|
-
}, "CheckboxTrigger")),
|
|
99
|
+
}, "CheckboxTrigger")), Ae = /* @__PURE__ */ D.forwardRef(/* @__PURE__ */ k(function(e, t) {
|
|
101
100
|
let { __scopeCheckbox: n, name: r, checked: i, defaultChecked: a, required: o, disabled: s, value: c, onCheckedChange: l, form: u, ...d } = e;
|
|
102
|
-
return /* @__PURE__ */ (0,
|
|
101
|
+
return /* @__PURE__ */ (0, O.jsx)(De, {
|
|
103
102
|
__scopeCheckbox: n,
|
|
104
103
|
checked: i,
|
|
105
104
|
defaultChecked: a,
|
|
@@ -109,18 +108,18 @@ var Ee = "CheckboxTrigger", De = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ j(
|
|
|
109
108
|
name: r,
|
|
110
109
|
form: u,
|
|
111
110
|
value: c,
|
|
112
|
-
internal_do_not_use_render: ({ isFormControl: e }) => /* @__PURE__ */ (0,
|
|
111
|
+
internal_do_not_use_render: ({ isFormControl: e }) => /* @__PURE__ */ (0, O.jsxs)(O.Fragment, { children: [/* @__PURE__ */ (0, O.jsx)(ke, {
|
|
113
112
|
...d,
|
|
114
113
|
ref: t,
|
|
115
114
|
__scopeCheckbox: n
|
|
116
|
-
}), e && /* @__PURE__ */ (0,
|
|
115
|
+
}), e && /* @__PURE__ */ (0, O.jsx)(Pe, { __scopeCheckbox: n })] })
|
|
117
116
|
});
|
|
118
|
-
}, "Checkbox")),
|
|
119
|
-
let { __scopeCheckbox: n, forceMount: r, ...i } = e, a =
|
|
120
|
-
return /* @__PURE__ */ (0,
|
|
121
|
-
present: r ||
|
|
122
|
-
children: /* @__PURE__ */ (0,
|
|
123
|
-
"data-state":
|
|
117
|
+
}, "Checkbox")), je = "CheckboxIndicator", Me = /* @__PURE__ */ D.forwardRef(/* @__PURE__ */ k(function(e, t) {
|
|
118
|
+
let { __scopeCheckbox: n, forceMount: r, ...i } = e, a = Ee(je, n);
|
|
119
|
+
return /* @__PURE__ */ (0, O.jsx)(ee, {
|
|
120
|
+
present: r || A(a.checked) || a.checked === !0,
|
|
121
|
+
children: /* @__PURE__ */ (0, O.jsx)(te.span, {
|
|
122
|
+
"data-state": Ie(a.checked),
|
|
124
123
|
"data-disabled": a.disabled ? "" : void 0,
|
|
125
124
|
...i,
|
|
126
125
|
ref: t,
|
|
@@ -130,47 +129,47 @@ var Ee = "CheckboxTrigger", De = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ j(
|
|
|
130
129
|
}
|
|
131
130
|
})
|
|
132
131
|
});
|
|
133
|
-
}, "CheckboxIndicator")),
|
|
134
|
-
let { control: a, userClick: o, checked: c, defaultChecked: l, required: u, disabled: d, name: f, value: p, form:
|
|
135
|
-
|
|
136
|
-
let e =
|
|
132
|
+
}, "CheckboxIndicator")), Ne = "CheckboxBubbleInput", Pe = /* @__PURE__ */ D.forwardRef(/* @__PURE__ */ k(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 } = Ee(Ne, e), _ = r(i, g), v = s(a), y = D.useRef(!1), b = D.useRef(c), x = D.useRef(o), C = D.useRef(null);
|
|
134
|
+
D.useEffect(() => {
|
|
135
|
+
let e = h;
|
|
137
136
|
if (!e) return;
|
|
138
137
|
let t = window.HTMLInputElement.prototype, n = Object.getOwnPropertyDescriptor(t, "checked").set;
|
|
139
138
|
if (!n) return;
|
|
140
|
-
let r =
|
|
141
|
-
|
|
142
|
-
let i = o !== null && o !==
|
|
143
|
-
if (
|
|
139
|
+
let r = b.current !== c;
|
|
140
|
+
b.current = c;
|
|
141
|
+
let i = o !== null && o !== x.current;
|
|
142
|
+
if (x.current = o, i) C.current = r ? null : o, r && (e.indeterminate = A(c), n.call(e, !A(c) && c)), e.dispatchEvent(new Event("click", { bubbles: !o.hasConsumerStoppedPropagation }));
|
|
144
143
|
else if (r) {
|
|
145
144
|
let t = C.current;
|
|
146
145
|
C.current = null;
|
|
147
146
|
let r = t?.requestedChecked === c;
|
|
148
|
-
|
|
147
|
+
y.current = !0, e.indeterminate = A(c), n.call(e, !A(c) && c), e.dispatchEvent(new Event("click", { bubbles: !(r && t.hasConsumerStoppedPropagation) })), y.current = !1;
|
|
149
148
|
}
|
|
150
149
|
}, [
|
|
151
|
-
|
|
150
|
+
h,
|
|
152
151
|
c,
|
|
153
152
|
o
|
|
154
153
|
]);
|
|
155
|
-
let
|
|
156
|
-
return /* @__PURE__ */ (0,
|
|
154
|
+
let ee = D.useRef(!A(c) && c);
|
|
155
|
+
return /* @__PURE__ */ (0, O.jsx)(te.input, {
|
|
157
156
|
type: "checkbox",
|
|
158
157
|
"aria-hidden": !0,
|
|
159
|
-
defaultChecked: l ??
|
|
158
|
+
defaultChecked: l ?? ee.current,
|
|
160
159
|
required: u,
|
|
161
160
|
disabled: d,
|
|
162
161
|
name: f,
|
|
163
162
|
value: p,
|
|
164
|
-
form:
|
|
163
|
+
form: m,
|
|
165
164
|
...n,
|
|
166
165
|
tabIndex: -1,
|
|
167
|
-
ref:
|
|
168
|
-
onClick:
|
|
169
|
-
|
|
166
|
+
ref: _,
|
|
167
|
+
onClick: S(t, (e) => {
|
|
168
|
+
y.current && e.stopPropagation();
|
|
170
169
|
}),
|
|
171
170
|
style: {
|
|
172
171
|
...n.style,
|
|
173
|
-
...
|
|
172
|
+
...v,
|
|
174
173
|
position: "absolute",
|
|
175
174
|
pointerEvents: "none",
|
|
176
175
|
opacity: 0,
|
|
@@ -179,21 +178,21 @@ var Ee = "CheckboxTrigger", De = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ j(
|
|
|
179
178
|
}
|
|
180
179
|
});
|
|
181
180
|
}, "CheckboxBubbleInput"));
|
|
182
|
-
function
|
|
181
|
+
function Fe(e) {
|
|
183
182
|
return typeof e == "function";
|
|
184
183
|
}
|
|
185
|
-
|
|
186
|
-
function
|
|
184
|
+
k(Fe, "isFunction");
|
|
185
|
+
function A(e) {
|
|
187
186
|
return e === "indeterminate";
|
|
188
187
|
}
|
|
189
|
-
|
|
190
|
-
function
|
|
191
|
-
return
|
|
188
|
+
k(A, "isIndeterminate");
|
|
189
|
+
function Ie(e) {
|
|
190
|
+
return A(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
192
191
|
}
|
|
193
|
-
|
|
192
|
+
k(Ie, "getState");
|
|
194
193
|
//#endregion
|
|
195
194
|
//#region src/utils/time.ts
|
|
196
|
-
var
|
|
195
|
+
var Le = class e {
|
|
197
196
|
ms;
|
|
198
197
|
static fromMilliseconds(t) {
|
|
199
198
|
return t == null ? null : new e(t);
|
|
@@ -222,56 +221,56 @@ var Fe = class e {
|
|
|
222
221
|
};
|
|
223
222
|
//#endregion
|
|
224
223
|
//#region src/core/executions/select.ts
|
|
225
|
-
function
|
|
224
|
+
function Re(e) {
|
|
226
225
|
let t = e.outcome;
|
|
227
226
|
return t === null ? null : t.kind;
|
|
228
227
|
}
|
|
229
|
-
function
|
|
230
|
-
return e === null ? null :
|
|
228
|
+
function ze(e) {
|
|
229
|
+
return e === null ? null : Le.parse(e).toMilliseconds();
|
|
231
230
|
}
|
|
232
|
-
function
|
|
231
|
+
function Be(e, t) {
|
|
233
232
|
let n = e.latest.get(t);
|
|
234
233
|
return n === void 0 ? null : e.executions.get(n) ?? null;
|
|
235
234
|
}
|
|
236
|
-
function
|
|
235
|
+
function Ve(e, t) {
|
|
237
236
|
return e.executions.latest.get(t) ?? e.results.get(t)?.id ?? null;
|
|
238
237
|
}
|
|
239
|
-
function
|
|
240
|
-
let n =
|
|
241
|
-
n !== null && n.record.status !== "completed" ? (a = n.record.status, o =
|
|
242
|
-
let c = a === "idle", l = c && r !== null && r.started_at !== null && r.completed_at !== null ?
|
|
238
|
+
function He(e, t) {
|
|
239
|
+
let n = Be(e.executions, t), r = e.results.get(t) ?? null, i = e.submissions.has(t) && e.submissions.get(t) === Ve(e, t), a = "idle", o = r === null ? null : ze(r.started_at), s = !1;
|
|
240
|
+
n !== null && n.record.status !== "completed" ? (a = n.record.status, o = ze(n.record.started_at) ?? o, s = n.record.outcome !== null) : i && (a = "queued");
|
|
241
|
+
let c = a === "idle", l = c && r !== null && r.started_at !== null && r.completed_at !== null ? Le.parse(r.completed_at).since(Le.parse(r.started_at)) : null;
|
|
243
242
|
return {
|
|
244
243
|
status: a,
|
|
245
244
|
blocked: e.blocked.has(t),
|
|
246
|
-
outcome: c && r !== null ?
|
|
245
|
+
outcome: c && r !== null ? Re(r) : null,
|
|
247
246
|
startedAt: o,
|
|
248
247
|
duration: l,
|
|
249
248
|
rendered: s
|
|
250
249
|
};
|
|
251
250
|
}
|
|
252
|
-
function
|
|
251
|
+
function Ue(e) {
|
|
253
252
|
return [...e.executions.values()].filter((e) => e.record.status !== "completed");
|
|
254
253
|
}
|
|
255
|
-
function
|
|
256
|
-
return
|
|
254
|
+
function We(e) {
|
|
255
|
+
return Ue(e).some((e) => e.record.status === "running");
|
|
257
256
|
}
|
|
258
|
-
function
|
|
259
|
-
let t =
|
|
260
|
-
for (let [t, i] of e.submissions) !n.has(t) && i ===
|
|
257
|
+
function Ge(e) {
|
|
258
|
+
let t = Ue(e.executions), n = new Set(t.flatMap((e) => e.record.cell_id === null ? [] : [e.record.cell_id])), r = 0;
|
|
259
|
+
for (let [t, i] of e.submissions) !n.has(t) && i === Ve(e, t) && (r += 1);
|
|
261
260
|
return t.length + r;
|
|
262
261
|
}
|
|
263
262
|
//#endregion
|
|
264
263
|
//#region src/core/executions/atoms.ts
|
|
265
|
-
var
|
|
264
|
+
var Ke = {
|
|
266
265
|
runs: /* @__PURE__ */ new Map(),
|
|
267
266
|
executions: /* @__PURE__ */ new Map(),
|
|
268
267
|
latest: /* @__PURE__ */ new Map()
|
|
269
|
-
},
|
|
270
|
-
function
|
|
268
|
+
}, qe = /* @__PURE__ */ new Map(), Je = /* @__PURE__ */ new Map(), Ye = /* @__PURE__ */ new Set(), Xe = y(null), Ze = y(null);
|
|
269
|
+
function Qe(e, t, n, r) {
|
|
271
270
|
return e !== null && e.notebook.replica === t && e.notebook.id === n ? e.value : r;
|
|
272
271
|
}
|
|
273
|
-
function
|
|
274
|
-
let n = e.get(
|
|
272
|
+
function $e(e, t) {
|
|
273
|
+
let n = e.get(m), r = n === null ? null : e.get(n.notebookAtom);
|
|
275
274
|
return n === null || r === null ? null : {
|
|
276
275
|
notebook: {
|
|
277
276
|
replica: n,
|
|
@@ -280,51 +279,51 @@ function Ze(e, t) {
|
|
|
280
279
|
value: t
|
|
281
280
|
};
|
|
282
281
|
}
|
|
283
|
-
var
|
|
284
|
-
let t = e(
|
|
282
|
+
var j = y((e) => {
|
|
283
|
+
let t = e(m), n = t === null ? null : e(t.notebookAtom)?.id ?? null;
|
|
285
284
|
return {
|
|
286
|
-
executions: t === null ?
|
|
287
|
-
results: t === null ?
|
|
288
|
-
submissions:
|
|
289
|
-
blocked:
|
|
285
|
+
executions: t === null ? Ke : e(t.executionsAtom),
|
|
286
|
+
results: t === null ? qe : e(t.resultsAtom),
|
|
287
|
+
submissions: Qe(e(Xe), t, n, Je),
|
|
288
|
+
blocked: Qe(e(Ze), t, n, Ye)
|
|
290
289
|
};
|
|
291
|
-
}),
|
|
292
|
-
let t = e(
|
|
290
|
+
}), et = y((e) => {
|
|
291
|
+
let t = e(m);
|
|
293
292
|
return t === null ? null : e(t.runtimeAtom)?.status ?? null;
|
|
294
293
|
});
|
|
295
|
-
|
|
296
|
-
function
|
|
297
|
-
e.set(
|
|
294
|
+
y((e) => We(e(j).executions)), y((e) => Ge(e(j)));
|
|
295
|
+
function tt(e, t) {
|
|
296
|
+
e.set(Xe, $e(e, t));
|
|
298
297
|
}
|
|
299
|
-
function
|
|
300
|
-
let n = new Map(e.get(
|
|
298
|
+
function nt(e, t) {
|
|
299
|
+
let n = new Map(e.get(j).submissions);
|
|
301
300
|
for (let e of t) n.delete(e);
|
|
302
|
-
|
|
301
|
+
tt(e, n);
|
|
303
302
|
}
|
|
304
|
-
function
|
|
305
|
-
let r = e.get(
|
|
303
|
+
function rt(e, t, n) {
|
|
304
|
+
let r = e.get(j).blocked;
|
|
306
305
|
if (r.has(t) === n) return;
|
|
307
306
|
let i = new Set(r);
|
|
308
|
-
n ? i.add(t) : i.delete(t), e.set(
|
|
307
|
+
n ? i.add(t) : i.delete(t), e.set(Ze, $e(e, i));
|
|
309
308
|
}
|
|
310
|
-
function
|
|
309
|
+
function it(e, t) {
|
|
311
310
|
let n = t.cell_id, r = t.status === "disabled-transitively";
|
|
312
|
-
t.status != null &&
|
|
311
|
+
t.status != null && rt(e, n, r), (r || t.output?.mimetype === "application/vnd.marimo+error") && nt(e, [n]);
|
|
313
312
|
}
|
|
314
313
|
//#endregion
|
|
315
314
|
//#region src/core/codemirror/editing/commands.ts
|
|
316
|
-
var
|
|
317
|
-
function
|
|
315
|
+
var at = a();
|
|
316
|
+
function ot(e) {
|
|
318
317
|
return (t) => {
|
|
319
318
|
let n = !1;
|
|
320
319
|
for (let r of t) r && (n = e(r) || n);
|
|
321
320
|
return n;
|
|
322
321
|
};
|
|
323
322
|
}
|
|
324
|
-
var
|
|
323
|
+
var st = ot(fe), ct = ot(ue);
|
|
325
324
|
//#endregion
|
|
326
325
|
//#region src/utils/schedule-task.ts
|
|
327
|
-
function
|
|
326
|
+
function lt() {
|
|
328
327
|
let e = globalThis.scheduler;
|
|
329
328
|
if (typeof e?.postTask == "function") return (t) => {
|
|
330
329
|
e.postTask(t, { priority: "user-visible" }).catch((e) => {
|
|
@@ -345,10 +344,10 @@ function st() {
|
|
|
345
344
|
setTimeout(e, 0);
|
|
346
345
|
};
|
|
347
346
|
}
|
|
348
|
-
var
|
|
347
|
+
var ut = lt();
|
|
349
348
|
//#endregion
|
|
350
349
|
//#region src/core/codemirror/editor-mount-scheduler.ts
|
|
351
|
-
function
|
|
350
|
+
function dt(e = ut) {
|
|
352
351
|
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = !1;
|
|
353
352
|
function i() {
|
|
354
353
|
r || t.size === 0 || (r = !0, e(o));
|
|
@@ -391,18 +390,18 @@ function lt(e = ct) {
|
|
|
391
390
|
}
|
|
392
391
|
};
|
|
393
392
|
}
|
|
394
|
-
var
|
|
393
|
+
var ft = dt();
|
|
395
394
|
//#endregion
|
|
396
395
|
//#region src/plugins/core/sanitize-html.ts
|
|
397
396
|
if (typeof document < "u") {
|
|
398
397
|
let e = "data-temp-href-target";
|
|
399
|
-
|
|
398
|
+
E.addHook("beforeSanitizeAttributes", (t) => {
|
|
400
399
|
t.tagName === "A" && (t.hasAttribute("target") || t.setAttribute("target", "_self"), t.hasAttribute("target") && t.setAttribute(e, t.getAttribute("target") || ""));
|
|
401
|
-
}),
|
|
400
|
+
}), E.addHook("afterSanitizeAttributes", (t) => {
|
|
402
401
|
t.tagName === "A" && t.hasAttribute(e) && (t.setAttribute("target", t.getAttribute(e) || ""), t.removeAttribute(e), t.getAttribute("target") === "_blank" && t.setAttribute("rel", "noopener noreferrer"));
|
|
403
402
|
});
|
|
404
403
|
}
|
|
405
|
-
function
|
|
404
|
+
function pt(e) {
|
|
406
405
|
let t = {
|
|
407
406
|
USE_PROFILES: {
|
|
408
407
|
html: !0,
|
|
@@ -418,59 +417,59 @@ function dt(e) {
|
|
|
418
417
|
},
|
|
419
418
|
SAFE_FOR_XML: !e.includes("marimo-mermaid")
|
|
420
419
|
};
|
|
421
|
-
return
|
|
420
|
+
return E.sanitize(e, t);
|
|
422
421
|
}
|
|
423
422
|
//#endregion
|
|
424
423
|
//#region src/core/dom/outline.ts
|
|
425
|
-
var
|
|
424
|
+
var mt = [
|
|
426
425
|
"marimo-carousel",
|
|
427
426
|
"marimo-tabs",
|
|
428
427
|
"marimo-accordion",
|
|
429
428
|
"marimo-sidebar"
|
|
430
|
-
],
|
|
431
|
-
function
|
|
429
|
+
], ht = "h1, h2, h3, h4, h5, h6";
|
|
430
|
+
function gt(e) {
|
|
432
431
|
if (typeof DOMParser > "u") return null;
|
|
433
|
-
let t = [], n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(
|
|
432
|
+
let t = [], n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(ht);
|
|
434
433
|
for (let e of Array.from(n)) {
|
|
435
434
|
let n = e.textContent;
|
|
436
|
-
if (
|
|
435
|
+
if (mt.some((t) => e.closest(t)) || !n) continue;
|
|
437
436
|
let r = Number.parseInt(e.tagName[1], 10), i = e.innerHTML, a = {
|
|
438
437
|
name: n,
|
|
439
438
|
level: r,
|
|
440
|
-
by:
|
|
439
|
+
by: vt(e)
|
|
441
440
|
};
|
|
442
|
-
i !== n && (a.html =
|
|
441
|
+
i !== n && (a.html = pt(i)), t.push(a);
|
|
443
442
|
}
|
|
444
443
|
return { items: t };
|
|
445
444
|
}
|
|
446
|
-
function
|
|
445
|
+
function _t(e) {
|
|
447
446
|
if (!e.includes("\"")) return `"${e}"`;
|
|
448
447
|
if (!e.includes("'")) return `'${e}'`;
|
|
449
448
|
let t = e.split("\""), n = [];
|
|
450
449
|
for (let [e, r] of t.entries()) r && n.push(`"${r}"`), e < t.length - 1 && n.push("'\"'");
|
|
451
450
|
return `concat(${n.join(", ")})`;
|
|
452
451
|
}
|
|
453
|
-
function
|
|
452
|
+
function vt(e) {
|
|
454
453
|
let t = e.id;
|
|
455
454
|
if (t) return { id: t };
|
|
456
455
|
let n = e.textContent ?? "";
|
|
457
|
-
return { path: `//${e.tagName}[contains(., ${
|
|
456
|
+
return { path: `//${e.tagName}[contains(., ${_t(n)})]` };
|
|
458
457
|
}
|
|
459
|
-
function
|
|
458
|
+
function yt(e) {
|
|
460
459
|
return { items: e.filter(Boolean).flatMap((e) => e.items) };
|
|
461
460
|
}
|
|
462
|
-
function
|
|
461
|
+
function bt(e) {
|
|
463
462
|
if (e == null || e.mimetype !== "text/html" && e.mimetype !== "text/markdown" || e.data == null) return null;
|
|
464
463
|
try {
|
|
465
|
-
return
|
|
464
|
+
return T(typeof e.data == "string", "expected string"), gt(e.data);
|
|
466
465
|
} catch {
|
|
467
466
|
return t.error("Failed to parse outline"), null;
|
|
468
467
|
}
|
|
469
468
|
}
|
|
470
|
-
function
|
|
469
|
+
function xt(e) {
|
|
471
470
|
return e != null && e.items.some((e) => e.level <= 3);
|
|
472
471
|
}
|
|
473
|
-
function
|
|
472
|
+
function St(e, n) {
|
|
474
473
|
let r = (e) => e.items.length === 0 ? 7 : Math.min(...e.items.map((e) => e.level)), i = n[e];
|
|
475
474
|
if (i == null || i.items.length === 0) return t.warn("Failed to find a starting outline"), null;
|
|
476
475
|
let a = r(i), o = e + 1;
|
|
@@ -483,18 +482,18 @@ function bt(e, n) {
|
|
|
483
482
|
}
|
|
484
483
|
//#endregion
|
|
485
484
|
//#region src/core/mime.ts
|
|
486
|
-
function
|
|
485
|
+
function Ct(e) {
|
|
487
486
|
return e === "application/vnd.marimo+error";
|
|
488
487
|
}
|
|
489
|
-
function
|
|
488
|
+
function wt(e) {
|
|
490
489
|
return e === "application/vnd.marimo+traceback";
|
|
491
490
|
}
|
|
492
|
-
function
|
|
493
|
-
return
|
|
491
|
+
function M(e) {
|
|
492
|
+
return Ct(e) || wt(e);
|
|
494
493
|
}
|
|
495
494
|
//#endregion
|
|
496
495
|
//#region src/components/editor/output/ansi-reduce.ts
|
|
497
|
-
var
|
|
496
|
+
var Tt = class e {
|
|
498
497
|
lines = [""];
|
|
499
498
|
cursor = {
|
|
500
499
|
row: 0,
|
|
@@ -583,7 +582,7 @@ var St = class e {
|
|
|
583
582
|
render() {
|
|
584
583
|
return this.lines.join("\n");
|
|
585
584
|
}
|
|
586
|
-
},
|
|
585
|
+
}, Et = class {
|
|
587
586
|
ESC_REGEX = new RegExp(String.raw`\u001B(?:\[[0-9;]*[A-Za-z]|\([0-9A-Za-z])`, "gu");
|
|
588
587
|
parse(e) {
|
|
589
588
|
let t = [], n = 0;
|
|
@@ -602,9 +601,9 @@ var St = class e {
|
|
|
602
601
|
value: e.slice(n)
|
|
603
602
|
}), t;
|
|
604
603
|
}
|
|
605
|
-
},
|
|
606
|
-
parser = new
|
|
607
|
-
buffer = new
|
|
604
|
+
}, Dt = class {
|
|
605
|
+
parser = new Et();
|
|
606
|
+
buffer = new Tt();
|
|
608
607
|
reduce(e) {
|
|
609
608
|
return this.reset(), this.append(e), this.render();
|
|
610
609
|
}
|
|
@@ -620,7 +619,7 @@ var St = class e {
|
|
|
620
619
|
for (let e of t) e.type === "text" ? this.processText(e.value) : this.buffer.handleEscape(e.value);
|
|
621
620
|
}
|
|
622
621
|
reset() {
|
|
623
|
-
this.buffer = new
|
|
622
|
+
this.buffer = new Tt();
|
|
624
623
|
}
|
|
625
624
|
render() {
|
|
626
625
|
return this.buffer.render();
|
|
@@ -663,19 +662,19 @@ var St = class e {
|
|
|
663
662
|
for (let t of e) t >= " " && (n += t);
|
|
664
663
|
return n;
|
|
665
664
|
}
|
|
666
|
-
},
|
|
665
|
+
}, N = class e {
|
|
667
666
|
mimetype;
|
|
668
667
|
channel;
|
|
669
668
|
timestamp;
|
|
670
669
|
code;
|
|
671
670
|
id;
|
|
672
|
-
ansiReducer = new
|
|
671
|
+
ansiReducer = new Dt();
|
|
673
672
|
_data;
|
|
674
673
|
get data() {
|
|
675
674
|
return this._data;
|
|
676
675
|
}
|
|
677
676
|
static create(t) {
|
|
678
|
-
let n = new
|
|
677
|
+
let n = new Dt();
|
|
679
678
|
return n.append(t.data), new e({
|
|
680
679
|
mimetype: t.mimetype,
|
|
681
680
|
channel: t.channel,
|
|
@@ -710,32 +709,32 @@ var St = class e {
|
|
|
710
709
|
};
|
|
711
710
|
//#endregion
|
|
712
711
|
//#region src/core/cells/collapseConsoleOutputs.tsx
|
|
713
|
-
function
|
|
712
|
+
function Ot(e, t = 5e3) {
|
|
714
713
|
let n = [...e];
|
|
715
|
-
if (n.length < 2) return
|
|
714
|
+
if (n.length < 2) return Nt(n.map(At), t);
|
|
716
715
|
let r = n[n.length - 1], i = n[n.length - 2];
|
|
717
|
-
return
|
|
716
|
+
return kt(r, i) && (Mt(r), Mt(i), n[n.length - 2] = jt(i, r), n.pop()), Nt(n, t);
|
|
718
717
|
}
|
|
719
|
-
function
|
|
718
|
+
function kt(e, t) {
|
|
720
719
|
let n = e.mimetype === "text/plain" && t.mimetype === "text/plain";
|
|
721
720
|
if (!n) return !1;
|
|
722
721
|
let r = e.channel === t.channel, i = e.channel !== "stdin";
|
|
723
722
|
return n && r && i;
|
|
724
723
|
}
|
|
725
|
-
function
|
|
726
|
-
return e instanceof
|
|
724
|
+
function At(e) {
|
|
725
|
+
return e instanceof N ? e : typeof e.data == "string" ? N.create(e) : e;
|
|
727
726
|
}
|
|
728
|
-
function
|
|
729
|
-
return e instanceof
|
|
727
|
+
function jt(e, t) {
|
|
728
|
+
return e instanceof N ? e.appendData(t.data) : N.create(e).appendData(t.data);
|
|
730
729
|
}
|
|
731
|
-
function
|
|
732
|
-
|
|
730
|
+
function Mt(e) {
|
|
731
|
+
T(typeof e.data == "string", "expected string output");
|
|
733
732
|
}
|
|
734
|
-
function
|
|
733
|
+
function Nt(e, t) {
|
|
735
734
|
let n = 0, r;
|
|
736
735
|
for (r = e.length - 1; r >= 0 && n < t; r--) {
|
|
737
736
|
let t = e[r];
|
|
738
|
-
t.mimetype === "text/plain" ? (
|
|
737
|
+
t.mimetype === "text/plain" ? (T(typeof t.data == "string", "expected string"), n += t.data.split("\n").length) : n++;
|
|
739
738
|
}
|
|
740
739
|
if (n < t) return e;
|
|
741
740
|
let i = r + 1, a = {
|
|
@@ -746,7 +745,7 @@ function At(e, t) {
|
|
|
746
745
|
}, o = e[i];
|
|
747
746
|
if (o == null) return [a, ...e.slice(i + 1)];
|
|
748
747
|
if (o.mimetype === "text/plain") {
|
|
749
|
-
|
|
748
|
+
T(typeof o.data == "string", "expected string");
|
|
750
749
|
let r = o.data.split("\n"), s = t - (n - r.length);
|
|
751
750
|
return [
|
|
752
751
|
a,
|
|
@@ -761,16 +760,16 @@ function At(e, t) {
|
|
|
761
760
|
}
|
|
762
761
|
//#endregion
|
|
763
762
|
//#region src/core/cells/cell.ts
|
|
764
|
-
function
|
|
763
|
+
function Pt(e) {
|
|
765
764
|
return (e.at(-1)?.id ?? 0) + 1;
|
|
766
765
|
}
|
|
767
|
-
function
|
|
766
|
+
function Ft(e) {
|
|
768
767
|
return e == null || e.mimetype !== "application/vnd.marimo+error" || !Array.isArray(e.data) ? [] : e.data.map((e) => e.type);
|
|
769
768
|
}
|
|
770
|
-
function
|
|
769
|
+
function It(e, t) {
|
|
771
770
|
let n = { ...e };
|
|
772
|
-
t.status === "queued" && (n.debuggerActive = !1), t.status === "running" &&
|
|
773
|
-
let r =
|
|
771
|
+
t.status === "queued" && (n.debuggerActive = !1), t.status === "running" && Ft(e.output).some((e) => e.includes("ancestor")) && (n.output = null), n.output = t.output ?? n.output, n.staleInputs = t.stale_inputs ?? n.staleInputs, t.serialization !== void 0 && (n.serialization = t.serialization);
|
|
772
|
+
let r = Ft(t.output).includes("interruption"), i = e.consoleOutputs;
|
|
774
773
|
(r || t.status === "idle") && (n.debuggerActive = !1, i = i.map((e) => e.channel === "stdin" ? {
|
|
775
774
|
channel: e.channel,
|
|
776
775
|
mimetype: e.mimetype,
|
|
@@ -780,26 +779,26 @@ function Nt(e, t) {
|
|
|
780
779
|
response: e.response ?? ""
|
|
781
780
|
} : e));
|
|
782
781
|
let a = t.console;
|
|
783
|
-
a != null && (i =
|
|
782
|
+
a != null && (i = Ot(Array.isArray(a) ? a.map((e, t) => ({
|
|
784
783
|
...e,
|
|
785
784
|
id: t + 1
|
|
786
785
|
})) : [...i, {
|
|
787
786
|
...a,
|
|
788
|
-
id:
|
|
789
|
-
}])), n.consoleOutputs = i, n.outline =
|
|
787
|
+
id: Pt(i)
|
|
788
|
+
}])), n.consoleOutputs = i, n.outline = bt(n.output);
|
|
790
789
|
let o = [t.console].flat().filter(Boolean).filter((e) => e.channel === "pdb");
|
|
791
790
|
return o.length > 0 && o.some((e) => e.data === "start") && (n.debuggerActive = !0), n;
|
|
792
791
|
}
|
|
793
|
-
function
|
|
792
|
+
function Lt(e) {
|
|
794
793
|
return e === "running" || e === "queued";
|
|
795
794
|
}
|
|
796
|
-
function
|
|
795
|
+
function Rt(e, t, n) {
|
|
797
796
|
let { status: r, outcome: i, rendered: a } = e;
|
|
798
|
-
return i === "interrupted" ? !1 : n ||
|
|
797
|
+
return i === "interrupted" ? !1 : n || Lt(r) && !(r === "running" && a) ? !0 : t;
|
|
799
798
|
}
|
|
800
799
|
//#endregion
|
|
801
800
|
//#region src/core/cells/columns.ts
|
|
802
|
-
function
|
|
801
|
+
function zt(e) {
|
|
803
802
|
let t = /* @__PURE__ */ new Map(), n = 0;
|
|
804
803
|
for (let r of e.order) {
|
|
805
804
|
let i = e.cells.get(r)?.config.column;
|
|
@@ -807,9 +806,9 @@ function It(e) {
|
|
|
807
806
|
}
|
|
808
807
|
return t;
|
|
809
808
|
}
|
|
810
|
-
function
|
|
809
|
+
function Bt(e) {
|
|
811
810
|
let t = [[]];
|
|
812
|
-
for (let [n, r] of
|
|
811
|
+
for (let [n, r] of zt(e)) {
|
|
813
812
|
for (; t.length <= r;) t.push([]);
|
|
814
813
|
t[r].push(n);
|
|
815
814
|
}
|
|
@@ -817,18 +816,18 @@ function Lt(e) {
|
|
|
817
816
|
}
|
|
818
817
|
//#endregion
|
|
819
818
|
//#region src/core/dom/ui-element-constants.ts
|
|
820
|
-
var
|
|
819
|
+
var Vt = "object-id", Ht = "random-id", Ut = "abcdefghijklmnopqrstuvwxyz", Wt = Ut + Ut.toUpperCase(), Gt = /* @__PURE__ */ new Set(), P = "__scratch__", Kt = "setup", qt = { create() {
|
|
821
820
|
let e = 0, t;
|
|
822
821
|
do {
|
|
823
822
|
let n = "";
|
|
824
|
-
for (let e = 0; e < 4; e++) n +=
|
|
823
|
+
for (let e = 0; e < 4; e++) n += Wt[Math.floor(Math.random() * 52)];
|
|
825
824
|
t = n, e++;
|
|
826
|
-
} while (
|
|
825
|
+
} while (Gt.has(t) && e < 100);
|
|
827
826
|
if (e >= 100) throw Error("Failed to generate unique CellId after 100 attempts");
|
|
828
|
-
return
|
|
829
|
-
} },
|
|
827
|
+
return Gt.add(t), t;
|
|
828
|
+
} }, F = {
|
|
830
829
|
create(e) {
|
|
831
|
-
return
|
|
830
|
+
return T(e != null, "cellId is required"), `cell-${e}`;
|
|
832
831
|
},
|
|
833
832
|
parse(e) {
|
|
834
833
|
return e.slice(5);
|
|
@@ -839,7 +838,7 @@ var Rt = "object-id", zt = "random-id", Bt = "abcdefghijklmnopqrstuvwxyz", Vt =
|
|
|
839
838
|
findElementThroughShadowDOMs(e) {
|
|
840
839
|
let t = e;
|
|
841
840
|
for (; t;) {
|
|
842
|
-
let e =
|
|
841
|
+
let e = F.findElement(t);
|
|
843
842
|
if (e) return e;
|
|
844
843
|
let n = t.getRootNode();
|
|
845
844
|
if (t = n instanceof ShadowRoot ? n.host : t.parentElement, t === n) break;
|
|
@@ -847,33 +846,33 @@ var Rt = "object-id", zt = "random-id", Bt = "abcdefghijklmnopqrstuvwxyz", Vt =
|
|
|
847
846
|
return null;
|
|
848
847
|
}
|
|
849
848
|
};
|
|
850
|
-
function
|
|
851
|
-
let t = null, n =
|
|
852
|
-
return n && (t =
|
|
849
|
+
function Jt(e) {
|
|
850
|
+
let t = null, n = F.findElementThroughShadowDOMs(e);
|
|
851
|
+
return n && (t = F.parse(n.id)), t;
|
|
853
852
|
}
|
|
854
|
-
var
|
|
853
|
+
var I = {
|
|
855
854
|
parse(e) {
|
|
856
|
-
return e.getAttribute(
|
|
855
|
+
return e.getAttribute(Vt);
|
|
857
856
|
},
|
|
858
857
|
parseOrThrow(e) {
|
|
859
|
-
let t =
|
|
860
|
-
return
|
|
858
|
+
let t = I.parse(e);
|
|
859
|
+
return T(t, "<marimo-ui-element/> missing object-id attribute"), t;
|
|
861
860
|
}
|
|
862
|
-
},
|
|
861
|
+
}, Yt = { create(e) {
|
|
863
862
|
return `output-${e}`;
|
|
864
|
-
} },
|
|
865
|
-
function
|
|
866
|
-
return `column-${
|
|
863
|
+
} }, Xt = y(/* @__PURE__ */ new Set()), L = y([]), R = y([]);
|
|
864
|
+
function Zt() {
|
|
865
|
+
return `column-${qt.create()}`;
|
|
867
866
|
}
|
|
868
|
-
var
|
|
869
|
-
let r =
|
|
867
|
+
var Qt = y(null, (e, t, n) => {
|
|
868
|
+
let r = Bt(n).length, i = e(L);
|
|
870
869
|
if (i.length === r) return;
|
|
871
|
-
let a = e(
|
|
872
|
-
for (; o.length < r;) o.push(
|
|
873
|
-
t(
|
|
870
|
+
let a = e(R), o = [...i, ...a].slice(0, r);
|
|
871
|
+
for (; o.length < r;) o.push(Zt());
|
|
872
|
+
t(L, o), t(R, a.slice(Math.max(0, r - i.length)));
|
|
874
873
|
});
|
|
875
|
-
function
|
|
876
|
-
return [...(e === null ? [[]] :
|
|
874
|
+
function $t(e, t, n) {
|
|
875
|
+
return [...(e === null ? [[]] : Bt(e)).map((e, n) => ({
|
|
877
876
|
id: t[n] ?? `column-${n}`,
|
|
878
877
|
ids: e
|
|
879
878
|
})), ...n.map((e) => ({
|
|
@@ -881,18 +880,18 @@ function Zt(e, t, n) {
|
|
|
881
880
|
ids: []
|
|
882
881
|
}))];
|
|
883
882
|
}
|
|
884
|
-
function
|
|
883
|
+
function en(e, t, n) {
|
|
885
884
|
let r = /* @__PURE__ */ new Map();
|
|
886
885
|
return e.forEach((i, a) => {
|
|
887
886
|
let o = t[a];
|
|
888
887
|
if (!n.has(i) || !o || o.items.length === 0) return;
|
|
889
|
-
let s =
|
|
888
|
+
let s = St(a, t);
|
|
890
889
|
s !== null && r.set(i, e.slice(a + 1, s[1] + 1));
|
|
891
890
|
}), r;
|
|
892
891
|
}
|
|
893
|
-
function
|
|
892
|
+
function tn(e, t, n) {
|
|
894
893
|
return { columns: e.map(({ id: e, ids: r }) => {
|
|
895
|
-
let i =
|
|
894
|
+
let i = en(r, r.map(t), n), a = new Set([...i.values()].flat());
|
|
896
895
|
return {
|
|
897
896
|
id: e,
|
|
898
897
|
ids: r,
|
|
@@ -901,55 +900,55 @@ function $t(e, t, n) {
|
|
|
901
900
|
};
|
|
902
901
|
}) };
|
|
903
902
|
}
|
|
904
|
-
var
|
|
905
|
-
let t = e(
|
|
906
|
-
return $t(
|
|
907
|
-
}),
|
|
908
|
-
function
|
|
903
|
+
var nn = y((e) => {
|
|
904
|
+
let t = e(b), n = t === null ? null : e(t.documentAtom), r = e(ni);
|
|
905
|
+
return tn($t(n, e(L), e(R)), (e) => r[e] ?? null, e(Xt));
|
|
906
|
+
}), rn = () => _(nn), an = y((e) => e(nn).columns.length);
|
|
907
|
+
function on(e, t) {
|
|
909
908
|
return e.columns.find((e) => e.id === t);
|
|
910
909
|
}
|
|
911
|
-
function
|
|
910
|
+
function sn(e, t) {
|
|
912
911
|
let n = e.columns.find((e) => e.ids.includes(t));
|
|
913
912
|
if (n === void 0) throw Error(`Cell ${t} is not in the layout`);
|
|
914
913
|
return n;
|
|
915
914
|
}
|
|
916
|
-
function
|
|
915
|
+
function cn(e, t) {
|
|
917
916
|
for (let n of e.columns) {
|
|
918
917
|
let e = n.folds.get(t);
|
|
919
918
|
if (e !== void 0) return e;
|
|
920
919
|
}
|
|
921
920
|
}
|
|
922
|
-
function
|
|
921
|
+
function ln(e, t) {
|
|
923
922
|
let n = e.columns.find((e) => e.ids.includes(t));
|
|
924
923
|
return n === void 0 ? [] : [...n.folds].filter(([, e]) => e.includes(t)).map(([e]) => e);
|
|
925
924
|
}
|
|
926
|
-
function
|
|
927
|
-
let n =
|
|
928
|
-
return
|
|
925
|
+
function un(e, t) {
|
|
926
|
+
let n = ln(e, t);
|
|
927
|
+
return cn(e, t) === void 0 ? n : [...n, t];
|
|
929
928
|
}
|
|
930
|
-
var
|
|
931
|
-
function
|
|
929
|
+
var dn = /* @__PURE__ */ new Set(/* @__PURE__ */ "__*.marimo.app.False.None.True.__peg_parser__.and.as.assert.async.await.break.class.continue.def.del.elif.else.except.finally.for.from.global.if.import.in.is.lambda.nonlocal.not.or.pass.raise.return.try.while.with.yield.None.setup".split("."));
|
|
930
|
+
function fn(e, t = !0) {
|
|
932
931
|
return e = e.trim(), e ? (/^\d/.test(e) && (e = `_${e}`), e = e.replaceAll(/\W/g, "_"), t ? e.toLowerCase() : e) : "_";
|
|
933
932
|
}
|
|
934
|
-
function
|
|
935
|
-
let n = new Set(t), r = e, i = (e) => !n.has(e) && !
|
|
933
|
+
function pn(e, t) {
|
|
934
|
+
let n = new Set(t), r = e, i = (e) => !n.has(e) && !dn.has(e);
|
|
936
935
|
if (i(e)) return e;
|
|
937
936
|
let a = 1;
|
|
938
937
|
for (; !i(r);) r = `${e}_${a}`, a++;
|
|
939
938
|
return r;
|
|
940
939
|
}
|
|
941
|
-
function
|
|
942
|
-
return
|
|
940
|
+
function mn(e, t) {
|
|
941
|
+
return hn(e) ? `cell-${t}` : e;
|
|
943
942
|
}
|
|
944
|
-
function
|
|
943
|
+
function hn(e) {
|
|
945
944
|
return !e || e === "_" || e === "__";
|
|
946
945
|
}
|
|
947
946
|
//#endregion
|
|
948
947
|
//#region src/core/cells/types.ts
|
|
949
|
-
function
|
|
948
|
+
function z(e, t) {
|
|
950
949
|
return e === null ? t.trim().length > 0 : e.trim() !== t.trim();
|
|
951
950
|
}
|
|
952
|
-
function
|
|
951
|
+
function gn({ id: e, name: t = "_", code: n = "", lastCodeRun: r = null, edited: i = !1, config: a }) {
|
|
953
952
|
return {
|
|
954
953
|
id: e,
|
|
955
954
|
config: a || {
|
|
@@ -964,7 +963,7 @@ function mn({ id: e, name: t = "_", code: n = "", lastCodeRun: r = null, edited:
|
|
|
964
963
|
lastCodeRun: r
|
|
965
964
|
};
|
|
966
965
|
}
|
|
967
|
-
function
|
|
966
|
+
function _n(e) {
|
|
968
967
|
return {
|
|
969
968
|
hide_code: !1,
|
|
970
969
|
disabled: !1,
|
|
@@ -973,7 +972,7 @@ function hn(e) {
|
|
|
973
972
|
...e
|
|
974
973
|
};
|
|
975
974
|
}
|
|
976
|
-
function
|
|
975
|
+
function vn(e) {
|
|
977
976
|
return {
|
|
978
977
|
outline: null,
|
|
979
978
|
output: null,
|
|
@@ -985,8 +984,8 @@ function gn(e) {
|
|
|
985
984
|
}
|
|
986
985
|
//#endregion
|
|
987
986
|
//#region src/core/cells/document.ts
|
|
988
|
-
function
|
|
989
|
-
let n = t.code ?? e.code, r =
|
|
987
|
+
function yn(e, t) {
|
|
988
|
+
let n = t.code ?? e.code, r = v(e.config, t.config) ? e.config : _n(t.config);
|
|
990
989
|
return n === e.code && t.name === e.name && r === e.config ? e : n === e.code ? {
|
|
991
990
|
...e,
|
|
992
991
|
name: t.name,
|
|
@@ -996,11 +995,11 @@ function _n(e, t) {
|
|
|
996
995
|
code: n,
|
|
997
996
|
name: t.name,
|
|
998
997
|
config: r,
|
|
999
|
-
edited:
|
|
998
|
+
edited: z(e.lastCodeRun, n)
|
|
1000
999
|
};
|
|
1001
1000
|
}
|
|
1002
|
-
function
|
|
1003
|
-
let n =
|
|
1001
|
+
function bn(e, t) {
|
|
1002
|
+
let n = v(t.order, e.cellIds) ? e.cellIds : [...t.order], { cellData: r, cellRuntime: i, cellHandles: a } = e;
|
|
1004
1003
|
for (let o of n) {
|
|
1005
1004
|
let n = t.cells.get(o), s = e.cellData[o];
|
|
1006
1005
|
if (n === void 0) continue;
|
|
@@ -1008,23 +1007,23 @@ function vn(e, t) {
|
|
|
1008
1007
|
let e = n.code ?? "";
|
|
1009
1008
|
r = {
|
|
1010
1009
|
...r,
|
|
1011
|
-
[o]:
|
|
1010
|
+
[o]: gn({
|
|
1012
1011
|
id: o,
|
|
1013
1012
|
code: e,
|
|
1014
1013
|
name: n.name,
|
|
1015
|
-
config:
|
|
1016
|
-
edited:
|
|
1014
|
+
config: _n(n.config),
|
|
1015
|
+
edited: z(null, e)
|
|
1017
1016
|
})
|
|
1018
1017
|
}, i = {
|
|
1019
1018
|
...i,
|
|
1020
|
-
[o]: i[o] ??
|
|
1019
|
+
[o]: i[o] ?? vn()
|
|
1021
1020
|
}, a = {
|
|
1022
1021
|
...a,
|
|
1023
|
-
[o]: (0,
|
|
1022
|
+
[o]: (0, D.createRef)()
|
|
1024
1023
|
};
|
|
1025
1024
|
continue;
|
|
1026
1025
|
}
|
|
1027
|
-
let c =
|
|
1026
|
+
let c = yn(s, n);
|
|
1028
1027
|
c !== s && (r = {
|
|
1029
1028
|
...r,
|
|
1030
1029
|
[o]: c
|
|
@@ -1043,50 +1042,50 @@ function vn(e, t) {
|
|
|
1043
1042
|
cellHandles: a
|
|
1044
1043
|
};
|
|
1045
1044
|
}
|
|
1046
|
-
function
|
|
1045
|
+
function xn({ store: e, model: t, reconcile: n, signal: r }) {
|
|
1047
1046
|
let i = () => {
|
|
1048
1047
|
let r = e.get(t.documentAtom);
|
|
1049
|
-
r !== null && (n(r), e.set(
|
|
1048
|
+
r !== null && (n(r), e.set(Qt, r));
|
|
1050
1049
|
}, a = e.sub(t.documentAtom, i);
|
|
1051
1050
|
r.addEventListener("abort", a, { once: !0 }), i();
|
|
1052
1051
|
}
|
|
1053
|
-
async function
|
|
1054
|
-
let e = w.get(
|
|
1052
|
+
async function Sn() {
|
|
1053
|
+
let e = w.get(b);
|
|
1055
1054
|
e !== null && w.get(e.syncStatusAtom).status !== "unavailable" && await e.flush();
|
|
1056
1055
|
}
|
|
1057
1056
|
//#endregion
|
|
1058
1057
|
//#region src/core/cells/editor.ts
|
|
1059
|
-
var
|
|
1060
|
-
function
|
|
1058
|
+
var B = y(/* @__PURE__ */ new Set());
|
|
1059
|
+
function Cn(e, t, n) {
|
|
1061
1060
|
return !!e && !t.has(n);
|
|
1062
1061
|
}
|
|
1063
|
-
|
|
1064
|
-
t(
|
|
1065
|
-
}),
|
|
1062
|
+
y(null, (e, t, { cellId: n }) => {
|
|
1063
|
+
t(B, (e) => /* @__PURE__ */ new Set([...e, n]));
|
|
1064
|
+
}), y(null, (e, t, { cellId: n }) => e(B).has(n) ? (t(B, (e) => {
|
|
1066
1065
|
let t = new Set(e);
|
|
1067
1066
|
return t.delete(n), t;
|
|
1068
1067
|
}), !0) : !1);
|
|
1069
|
-
var
|
|
1070
|
-
|
|
1071
|
-
t(
|
|
1068
|
+
var wn = y(/* @__PURE__ */ new Map());
|
|
1069
|
+
y(null, (e, t, { cellId: n }) => {
|
|
1070
|
+
t(wn, (e) => {
|
|
1072
1071
|
let t = new Map(e);
|
|
1073
1072
|
return t.delete(n), t;
|
|
1074
1073
|
});
|
|
1075
1074
|
});
|
|
1076
1075
|
//#endregion
|
|
1077
1076
|
//#region ../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/fromUnixTime.js
|
|
1078
|
-
function
|
|
1079
|
-
return
|
|
1077
|
+
function Tn(e, t) {
|
|
1078
|
+
return _e(e * 1e3, t?.in);
|
|
1080
1079
|
}
|
|
1081
1080
|
//#endregion
|
|
1082
1081
|
//#region ../node_modules/.pnpm/ansi_up@6.0.6/node_modules/ansi_up/ansi_up.js
|
|
1083
|
-
var
|
|
1082
|
+
var En = function(e, t) {
|
|
1084
1083
|
return Object.defineProperty ? Object.defineProperty(e, "raw", { value: t }) : e.raw = t, e;
|
|
1085
|
-
},
|
|
1084
|
+
}, V;
|
|
1086
1085
|
(function(e) {
|
|
1087
1086
|
e[e.EOS = 0] = "EOS", e[e.Text = 1] = "Text", e[e.Incomplete = 2] = "Incomplete", e[e.ESC = 3] = "ESC", e[e.Unknown = 4] = "Unknown", e[e.SGR = 5] = "SGR", e[e.OSCURL = 6] = "OSCURL";
|
|
1088
|
-
})(
|
|
1089
|
-
var
|
|
1087
|
+
})(V ||= {});
|
|
1088
|
+
var Dn = class {
|
|
1090
1089
|
constructor() {
|
|
1091
1090
|
this.VERSION = "6.0.6", this.setup_palettes(), this._use_classes = !1, this.bold = !1, this.faint = !1, this.italic = !1, this.underline = !1, this.fg = this.bg = null, this._buffer = "", this._url_allowlist = {
|
|
1092
1091
|
http: 1,
|
|
@@ -1318,57 +1317,57 @@ var Tn = class {
|
|
|
1318
1317
|
}
|
|
1319
1318
|
get_next_packet() {
|
|
1320
1319
|
var e = {
|
|
1321
|
-
kind:
|
|
1320
|
+
kind: V.EOS,
|
|
1322
1321
|
text: "",
|
|
1323
1322
|
url: ""
|
|
1324
1323
|
}, t = this._buffer.length;
|
|
1325
1324
|
if (t == 0) return e;
|
|
1326
1325
|
var n = this._buffer.indexOf("\x1B");
|
|
1327
|
-
if (n == -1) return e.kind =
|
|
1328
|
-
if (n > 0) return e.kind =
|
|
1326
|
+
if (n == -1) return e.kind = V.Text, e.text = this._buffer, this._buffer = "", e;
|
|
1327
|
+
if (n > 0) return e.kind = V.Text, e.text = this._buffer.slice(0, n), this._buffer = this._buffer.slice(n), e;
|
|
1329
1328
|
if (n == 0) {
|
|
1330
|
-
if (t < 3) return e.kind =
|
|
1329
|
+
if (t < 3) return e.kind = V.Incomplete, e;
|
|
1331
1330
|
var r = this._buffer.charAt(1);
|
|
1332
|
-
if (r != "[" && r != "]" && r != "(") return e.kind =
|
|
1331
|
+
if (r != "[" && r != "]" && r != "(") return e.kind = V.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1333
1332
|
if (r == "[") {
|
|
1334
|
-
this._csi_regex ||=
|
|
1333
|
+
this._csi_regex ||= On(An ||= En(["\n ^ # beginning of line\n #\n # First attempt\n (?: # legal sequence\n \x1B[ # CSI\n ([<-?]?) # private-mode char\n ([d;]*) # any digits or semicolons\n ([ -/]? # an intermediate modifier\n [@-~]) # the command\n )\n | # alternate (second attempt)\n (?: # illegal sequence\n \x1B[ # CSI\n [ -~]* # anything legal\n ([\0-:]) # anything illegal\n )\n "], ["\n ^ # beginning of line\n #\n # First attempt\n (?: # legal sequence\n \\x1b\\[ # CSI\n ([\\x3c-\\x3f]?) # private-mode char\n ([\\d;]*) # any digits or semicolons\n ([\\x20-\\x2f]? # an intermediate modifier\n [\\x40-\\x7e]) # the command\n )\n | # alternate (second attempt)\n (?: # illegal sequence\n \\x1b\\[ # CSI\n [\\x20-\\x7e]* # anything legal\n ([\\x00-\\x1f:]) # anything illegal\n )\n "]));
|
|
1335
1334
|
let t = this._buffer.match(this._csi_regex);
|
|
1336
|
-
if (t === null) return e.kind =
|
|
1337
|
-
if (t[4]) return e.kind =
|
|
1338
|
-
e.kind = t[1] != "" || t[3] != "m" ?
|
|
1335
|
+
if (t === null) return e.kind = V.Incomplete, e;
|
|
1336
|
+
if (t[4]) return e.kind = V.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1337
|
+
e.kind = t[1] != "" || t[3] != "m" ? V.Unknown : V.SGR, e.text = t[2];
|
|
1339
1338
|
var i = t[0].length;
|
|
1340
1339
|
return this._buffer = this._buffer.slice(i), e;
|
|
1341
1340
|
}
|
|
1342
1341
|
if (r == "]") {
|
|
1343
|
-
if (t < 4) return e.kind =
|
|
1344
|
-
if (this._buffer.charAt(2) != "8" || this._buffer.charAt(3) != ";") return e.kind =
|
|
1345
|
-
this._osc_st ||=
|
|
1342
|
+
if (t < 4) return e.kind = V.Incomplete, e;
|
|
1343
|
+
if (this._buffer.charAt(2) != "8" || this._buffer.charAt(3) != ";") return e.kind = V.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1344
|
+
this._osc_st ||= kn(jn ||= En(["\n (?: # legal sequence\n (\x1B\\) # ESC | # alternate\n (\x07) # BEL (what xterm did)\n )\n | # alternate (second attempt)\n ( # illegal sequence\n [\0-] # anything illegal\n | # alternate\n [\b-] # anything illegal\n | # alternate\n [-] # anything illegal\n )\n "], ["\n (?: # legal sequence\n (\\x1b\\\\) # ESC \\\n | # alternate\n (\\x07) # BEL (what xterm did)\n )\n | # alternate (second attempt)\n ( # illegal sequence\n [\\x00-\\x06] # anything illegal\n | # alternate\n [\\x08-\\x1a] # anything illegal\n | # alternate\n [\\x1c-\\x1f] # anything illegal\n )\n "])), this._osc_st.lastIndex = 0;
|
|
1346
1345
|
{
|
|
1347
1346
|
let t = this._osc_st.exec(this._buffer);
|
|
1348
|
-
if (t === null) return e.kind =
|
|
1349
|
-
if (t[3]) return e.kind =
|
|
1347
|
+
if (t === null) return e.kind = V.Incomplete, e;
|
|
1348
|
+
if (t[3]) return e.kind = V.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1350
1349
|
}
|
|
1351
1350
|
{
|
|
1352
1351
|
let t = this._osc_st.exec(this._buffer);
|
|
1353
|
-
if (t === null) return e.kind =
|
|
1354
|
-
if (t[3]) return e.kind =
|
|
1352
|
+
if (t === null) return e.kind = V.Incomplete, e;
|
|
1353
|
+
if (t[3]) return e.kind = V.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1355
1354
|
}
|
|
1356
|
-
this._osc_regex ||=
|
|
1355
|
+
this._osc_regex ||= On(Mn ||= En(["\n ^ # beginning of line\n #\n \x1B]8; # OSC Hyperlink\n [ -:<-~]* # params (excluding ;)\n ; # end of params\n ([!-~]{0,512}) # URL capture\n (?: # ST\n (?:\x1B\\) # ESC | # alternate\n (?:\x07) # BEL (what xterm did)\n )\n ([ -~]+) # TEXT capture\n \x1B]8;; # OSC Hyperlink End\n (?: # ST\n (?:\x1B\\) # ESC | # alternate\n (?:\x07) # BEL (what xterm did)\n )\n "], ["\n ^ # beginning of line\n #\n \\x1b\\]8; # OSC Hyperlink\n [\\x20-\\x3a\\x3c-\\x7e]* # params (excluding ;)\n ; # end of params\n ([\\x21-\\x7e]{0,512}) # URL capture\n (?: # ST\n (?:\\x1b\\\\) # ESC \\\n | # alternate\n (?:\\x07) # BEL (what xterm did)\n )\n ([\\x20-\\x7e]+) # TEXT capture\n \\x1b\\]8;; # OSC Hyperlink End\n (?: # ST\n (?:\\x1b\\\\) # ESC \\\n | # alternate\n (?:\\x07) # BEL (what xterm did)\n )\n "]));
|
|
1357
1356
|
let n = this._buffer.match(this._osc_regex);
|
|
1358
|
-
if (n === null) return e.kind =
|
|
1359
|
-
e.kind =
|
|
1357
|
+
if (n === null) return e.kind = V.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1358
|
+
e.kind = V.OSCURL, e.url = n[1], e.text = n[2];
|
|
1360
1359
|
var i = n[0].length;
|
|
1361
1360
|
return this._buffer = this._buffer.slice(i), e;
|
|
1362
1361
|
}
|
|
1363
|
-
if (r == "(") return e.kind =
|
|
1362
|
+
if (r == "(") return e.kind = V.Unknown, this._buffer = this._buffer.slice(3), e;
|
|
1364
1363
|
}
|
|
1365
1364
|
}
|
|
1366
1365
|
ansi_to_html(e) {
|
|
1367
1366
|
this.append_buffer(e);
|
|
1368
1367
|
for (var t = [];;) {
|
|
1369
1368
|
var n = this.get_next_packet();
|
|
1370
|
-
if (n.kind ==
|
|
1371
|
-
n.kind !=
|
|
1369
|
+
if (n.kind == V.EOS || n.kind == V.Incomplete) break;
|
|
1370
|
+
n.kind != V.ESC && n.kind != V.Unknown && (n.kind == V.Text ? t.push(this.transform_to_html(this.with_state(n))) : n.kind == V.SGR ? this.process_ansi(n) : n.kind == V.OSCURL && t.push(this.process_hyperlink(n)));
|
|
1372
1371
|
}
|
|
1373
1372
|
return t.join("");
|
|
1374
1373
|
}
|
|
@@ -1438,16 +1437,16 @@ var Tn = class {
|
|
|
1438
1437
|
return t.length < 1 || !this._url_allowlist[t[0]] ? "" : `<a href="${this.escape_txt_for_html(e.url)}">${this.escape_txt_for_html(e.text)}</a>`;
|
|
1439
1438
|
}
|
|
1440
1439
|
};
|
|
1441
|
-
function
|
|
1440
|
+
function On(e, ...t) {
|
|
1442
1441
|
let n = e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm, "");
|
|
1443
1442
|
return new RegExp(n);
|
|
1444
1443
|
}
|
|
1445
|
-
function
|
|
1444
|
+
function kn(e, ...t) {
|
|
1446
1445
|
let n = e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm, "");
|
|
1447
1446
|
return new RegExp(n, "g");
|
|
1448
1447
|
}
|
|
1449
|
-
var
|
|
1450
|
-
function
|
|
1448
|
+
var An, jn, Mn, Nn = new Dn();
|
|
1449
|
+
function H(e) {
|
|
1451
1450
|
try {
|
|
1452
1451
|
let t = document.createElement("div");
|
|
1453
1452
|
return t.innerHTML = e, (t.textContent || t.innerText || "").split("\n").map((e) => e.trimEnd()).join("\n");
|
|
@@ -1455,24 +1454,24 @@ function W(e) {
|
|
|
1455
1454
|
return t.error("Error parsing HTML content:", n), e;
|
|
1456
1455
|
}
|
|
1457
1456
|
}
|
|
1458
|
-
function
|
|
1457
|
+
function Pn(e) {
|
|
1459
1458
|
if (!e) return "";
|
|
1460
1459
|
try {
|
|
1461
|
-
return
|
|
1460
|
+
return H(Nn.ansi_to_html(e));
|
|
1462
1461
|
} catch (n) {
|
|
1463
1462
|
return t.error("Error converting ANSI to plain text:", n), e;
|
|
1464
1463
|
}
|
|
1465
1464
|
}
|
|
1466
1465
|
//#endregion
|
|
1467
1466
|
//#region src/core/errors/traceback-atom.ts
|
|
1468
|
-
var
|
|
1467
|
+
var Fn = y(null);
|
|
1469
1468
|
//#endregion
|
|
1470
1469
|
//#region src/core/cells/logs.ts
|
|
1471
|
-
function
|
|
1470
|
+
function In(e) {
|
|
1472
1471
|
return e.type === "cell" ? e.cellId : `lsp:${e.name}`;
|
|
1473
1472
|
}
|
|
1474
|
-
var
|
|
1475
|
-
function
|
|
1473
|
+
var Ln = !1;
|
|
1474
|
+
function Rn(e) {
|
|
1476
1475
|
let t = [], n = [e.console].filter(Boolean).flat();
|
|
1477
1476
|
for (let r of n) {
|
|
1478
1477
|
let n = r.mimetype === "text/plain", i = r.mimetype === "text/html" || r.mimetype === "application/vnd.marimo+traceback";
|
|
@@ -1482,7 +1481,7 @@ function In(e) {
|
|
|
1482
1481
|
case "stdout":
|
|
1483
1482
|
case "stderr":
|
|
1484
1483
|
case "marimo-error": {
|
|
1485
|
-
let a = d.asString(r.data), o = i ?
|
|
1484
|
+
let a = d.asString(r.data), o = i ? H(a) : a;
|
|
1486
1485
|
t.push({
|
|
1487
1486
|
timestamp: r.timestamp || Date.now(),
|
|
1488
1487
|
level: n ? "stderr" : "stdout",
|
|
@@ -1497,9 +1496,9 @@ function In(e) {
|
|
|
1497
1496
|
}
|
|
1498
1497
|
}
|
|
1499
1498
|
}
|
|
1500
|
-
if (t.forEach(
|
|
1499
|
+
if (t.forEach(zn.log), n.length === 0 && M(e.output?.mimetype) && Array.isArray(e.output.data)) {
|
|
1501
1500
|
e.output.data.forEach((t) => {
|
|
1502
|
-
|
|
1501
|
+
zn.log({
|
|
1503
1502
|
level: "stderr",
|
|
1504
1503
|
source: {
|
|
1505
1504
|
type: "cell",
|
|
@@ -1509,18 +1508,18 @@ function In(e) {
|
|
|
1509
1508
|
message: JSON.stringify(t)
|
|
1510
1509
|
});
|
|
1511
1510
|
});
|
|
1512
|
-
let t = e.output.data.filter((e) => "type" in e && e.type === "exception" || e.type === "internal"), n = w.get(
|
|
1513
|
-
if (t.length > 0 && !
|
|
1514
|
-
|
|
1511
|
+
let t = e.output.data.filter((e) => "type" in e && e.type === "exception" || e.type === "internal"), n = w.get(me) === "read";
|
|
1512
|
+
if (t.length > 0 && !Ln && n) {
|
|
1513
|
+
Ln = !0;
|
|
1515
1514
|
let e = t.find((e) => e.traceback);
|
|
1516
1515
|
o(e ? {
|
|
1517
1516
|
title: "An internal error occurred",
|
|
1518
1517
|
description: e.msg || "Click 'View' to see traceback",
|
|
1519
1518
|
variant: "danger",
|
|
1520
|
-
action:
|
|
1519
|
+
action: D.createElement(oe, {
|
|
1521
1520
|
altText: "View traceback",
|
|
1522
1521
|
onClick: () => {
|
|
1523
|
-
w.set(
|
|
1522
|
+
w.set(Fn, {
|
|
1524
1523
|
traceback: e.traceback,
|
|
1525
1524
|
errorMessage: e.msg || "An internal error occurred"
|
|
1526
1525
|
});
|
|
@@ -1535,13 +1534,13 @@ function In(e) {
|
|
|
1535
1534
|
}
|
|
1536
1535
|
return t;
|
|
1537
1536
|
}
|
|
1538
|
-
var
|
|
1537
|
+
var zn = { log: (e) => {
|
|
1539
1538
|
let t = e.level === "stdout" ? "gray" : e.level === "stderr" ? "red" : "orange", n = e.level.toUpperCase();
|
|
1540
|
-
console.log(`%c[${n}]`, `color:${t}; padding:2px 0; border-radius:2px; font-weight:bold`, `[${
|
|
1539
|
+
console.log(`%c[${n}]`, `color:${t}; padding:2px 0; border-radius:2px; font-weight:bold`, `[${Bn(e.timestamp)}]`, `(${In(e.source)}) ${e.message}`);
|
|
1541
1540
|
} };
|
|
1542
|
-
function
|
|
1541
|
+
function Bn(e) {
|
|
1543
1542
|
try {
|
|
1544
|
-
return
|
|
1543
|
+
return Tn(e).toLocaleTimeString(void 0, {
|
|
1545
1544
|
hour12: !0,
|
|
1546
1545
|
hour: "numeric",
|
|
1547
1546
|
minute: "numeric",
|
|
@@ -1553,14 +1552,14 @@ function Rn(e) {
|
|
|
1553
1552
|
}
|
|
1554
1553
|
//#endregion
|
|
1555
1554
|
//#region src/components/editor/navigation/focus-utils.ts
|
|
1556
|
-
function
|
|
1557
|
-
let r = document.getElementById(
|
|
1558
|
-
r ?
|
|
1555
|
+
function Vn(e, n) {
|
|
1556
|
+
let r = document.getElementById(F.create(e));
|
|
1557
|
+
r ? U(r, n) : t.warn(`[CellFocusManager] focusCell: element not found: ${e}`);
|
|
1559
1558
|
}
|
|
1560
|
-
function
|
|
1559
|
+
function Hn() {
|
|
1561
1560
|
return document.activeElement instanceof HTMLElement && document.activeElement.classList.contains("marimo-cell");
|
|
1562
1561
|
}
|
|
1563
|
-
function
|
|
1562
|
+
function U(e, n) {
|
|
1564
1563
|
try {
|
|
1565
1564
|
e.focus(n);
|
|
1566
1565
|
} catch {
|
|
@@ -1569,7 +1568,7 @@ function Vn(e, n) {
|
|
|
1569
1568
|
}
|
|
1570
1569
|
//#endregion
|
|
1571
1570
|
//#region src/utils/timeout.ts
|
|
1572
|
-
function
|
|
1571
|
+
function Un(e, n) {
|
|
1573
1572
|
let { retries: r, delay: i, initialDelay: a = 0 } = n, o = 0, s = () => {
|
|
1574
1573
|
if (o < r) {
|
|
1575
1574
|
try {
|
|
@@ -1584,60 +1583,60 @@ function Hn(e, n) {
|
|
|
1584
1583
|
}
|
|
1585
1584
|
//#endregion
|
|
1586
1585
|
//#region src/core/cells/utils.ts
|
|
1587
|
-
function
|
|
1588
|
-
return
|
|
1586
|
+
function Wn(e, t) {
|
|
1587
|
+
return Xn(e, t).length > 0;
|
|
1589
1588
|
}
|
|
1590
|
-
function
|
|
1589
|
+
function Gn(e) {
|
|
1591
1590
|
return e.cellIds.map((t) => e.cellData[t]);
|
|
1592
1591
|
}
|
|
1593
|
-
function
|
|
1592
|
+
function Kn(e) {
|
|
1594
1593
|
let { cellIds: t, cellData: n } = e, r = [];
|
|
1595
1594
|
for (let e of t) n[e].config.disabled && r.push(e);
|
|
1596
1595
|
return r;
|
|
1597
1596
|
}
|
|
1598
|
-
function
|
|
1597
|
+
function qn(e) {
|
|
1599
1598
|
let { cellIds: t, cellData: n } = e, r = [];
|
|
1600
1599
|
for (let e of t) n[e].config.disabled || r.push(e);
|
|
1601
1600
|
return r;
|
|
1602
1601
|
}
|
|
1603
|
-
function
|
|
1602
|
+
function Jn(e) {
|
|
1604
1603
|
return e.history.length > 0;
|
|
1605
1604
|
}
|
|
1606
|
-
function
|
|
1605
|
+
function Yn(e) {
|
|
1607
1606
|
let t = e.history[e.history.length - 1];
|
|
1608
1607
|
return t && t.type === "move" ? "Undo move" : "Undo cell deletion";
|
|
1609
1608
|
}
|
|
1610
|
-
function
|
|
1609
|
+
function Xn(e, t) {
|
|
1611
1610
|
let { cellIds: n, cellData: r, cellRuntime: i } = e;
|
|
1612
1611
|
return n.filter((e) => {
|
|
1613
|
-
let n =
|
|
1614
|
-
return
|
|
1612
|
+
let n = He(t, e);
|
|
1613
|
+
return Zn(n) || r[e].edited || n.outcome === "interrupted" || i[e].staleInputs && !(n.blocked || r[e].config.disabled);
|
|
1615
1614
|
});
|
|
1616
1615
|
}
|
|
1617
|
-
function
|
|
1616
|
+
function Zn({ status: e, outcome: t }) {
|
|
1618
1617
|
return t === null && e !== "queued" && e !== "running";
|
|
1619
1618
|
}
|
|
1620
|
-
function
|
|
1619
|
+
function Qn({ errored: e, stopped: t }) {
|
|
1621
1620
|
return {
|
|
1622
1621
|
published: !0,
|
|
1623
1622
|
"has-error": e,
|
|
1624
1623
|
stopped: t
|
|
1625
1624
|
};
|
|
1626
1625
|
}
|
|
1627
|
-
function
|
|
1628
|
-
let a =
|
|
1626
|
+
function $n({ errored: e, interrupted: t, stopped: n, output: r, showErrorTracebacks: i }) {
|
|
1627
|
+
let a = M(r?.mimetype), o = i && a && Array.isArray(r?.data) && r.data.some((e) => e.type === "exception" && "traceback" in e && e.traceback);
|
|
1629
1628
|
return (e || t || n || a) && !o;
|
|
1630
1629
|
}
|
|
1631
1630
|
//#endregion
|
|
1632
1631
|
//#region src/core/network/requests.ts
|
|
1633
|
-
var
|
|
1632
|
+
var W = y(null);
|
|
1634
1633
|
function er() {
|
|
1635
|
-
let e =
|
|
1636
|
-
return
|
|
1634
|
+
let e = _(W);
|
|
1635
|
+
return T(e, "useRequestClient() requires setting requestClientAtom."), e;
|
|
1637
1636
|
}
|
|
1638
1637
|
function tr() {
|
|
1639
|
-
let e = w.get(
|
|
1640
|
-
return
|
|
1638
|
+
let e = w.get(W);
|
|
1639
|
+
return T(e, "getRequestClient() requires requestClientAtom to be set."), e;
|
|
1641
1640
|
}
|
|
1642
1641
|
//#endregion
|
|
1643
1642
|
//#region src/utils/storage/storage.ts
|
|
@@ -1663,7 +1662,7 @@ var nr = class {
|
|
|
1663
1662
|
}
|
|
1664
1663
|
};
|
|
1665
1664
|
function rr() {
|
|
1666
|
-
let { hasLocalStorage: e, hasSessionStorage: t } =
|
|
1665
|
+
let { hasLocalStorage: e, hasSessionStorage: t } = ve();
|
|
1667
1666
|
return e ? window.localStorage : t ? window.sessionStorage : new nr();
|
|
1668
1667
|
}
|
|
1669
1668
|
var ir = rr(), ar = /(https?:\/\/[^\s"<>`{}|\\^]+)/, or = /\.(png|jpe?g|gif|webp|svg|ico)(\?.*)?$/i, sr = /^data:image\//i, cr = ["avatars.githubusercontent.com"];
|
|
@@ -1756,29 +1755,29 @@ function _r(e) {
|
|
|
1756
1755
|
return dr(e ?? "");
|
|
1757
1756
|
}
|
|
1758
1757
|
function vr(e) {
|
|
1759
|
-
return
|
|
1758
|
+
return se.mapValues(e.dataset, (e) => typeof e == "string" ? _r(e) : e);
|
|
1760
1759
|
}
|
|
1761
1760
|
function yr(e, t) {
|
|
1762
|
-
let n = e.parentElement ?
|
|
1761
|
+
let n = e.parentElement ? I.parse(e.parentElement) : void 0;
|
|
1763
1762
|
return n && t.has(n) ? t.lookupValue(n) : _r(e.dataset.initialValue);
|
|
1764
1763
|
}
|
|
1765
1764
|
function br() {
|
|
1766
|
-
if (
|
|
1767
|
-
if (
|
|
1765
|
+
if (x()) return document.title || null;
|
|
1766
|
+
if (ge()) {
|
|
1768
1767
|
let e = gr.getFilename();
|
|
1769
1768
|
if (e) return e;
|
|
1770
1769
|
}
|
|
1771
1770
|
let e = document.querySelector("marimo-filename");
|
|
1772
|
-
|
|
1771
|
+
he(e, "marimo-filename tag not found");
|
|
1773
1772
|
let t = e.innerHTML;
|
|
1774
1773
|
return t.length === 0 ? null : t;
|
|
1775
1774
|
}
|
|
1776
1775
|
//#endregion
|
|
1777
1776
|
//#region src/core/saving/file-state.ts
|
|
1778
|
-
var G =
|
|
1779
|
-
|
|
1780
|
-
var xr =
|
|
1781
|
-
|
|
1777
|
+
var G = y(br());
|
|
1778
|
+
y(null);
|
|
1779
|
+
var xr = y(null);
|
|
1780
|
+
y(void 0);
|
|
1782
1781
|
//#endregion
|
|
1783
1782
|
//#region src/utils/storage/typed.ts
|
|
1784
1783
|
var Sr = class {
|
|
@@ -1928,12 +1927,12 @@ function kr(e, t) {
|
|
|
1928
1927
|
anchor: t,
|
|
1929
1928
|
head: t
|
|
1930
1929
|
},
|
|
1931
|
-
effects:
|
|
1930
|
+
effects: de.scrollIntoView(t, { y: "center" })
|
|
1932
1931
|
});
|
|
1933
1932
|
}), Dr(e);
|
|
1934
1933
|
}
|
|
1935
1934
|
function Ar(e, t) {
|
|
1936
|
-
let n =
|
|
1935
|
+
let n = le(e), r = null;
|
|
1937
1936
|
return n.iterate({ enter: (n) => {
|
|
1938
1937
|
if (r !== null) return !1;
|
|
1939
1938
|
if (n.name === K.VariableName && e.doc.sliceString(n.from, n.to) === t) return r = n.from, !1;
|
|
@@ -2108,7 +2107,7 @@ function Ir(e, t) {
|
|
|
2108
2107
|
});
|
|
2109
2108
|
}
|
|
2110
2109
|
function Lr(e, t, n) {
|
|
2111
|
-
let r =
|
|
2110
|
+
let r = le(e), i = [];
|
|
2112
2111
|
Ir(r, {
|
|
2113
2112
|
state: e,
|
|
2114
2113
|
variableName: t,
|
|
@@ -2140,67 +2139,67 @@ var Y = {
|
|
|
2140
2139
|
}, Br = {
|
|
2141
2140
|
KERNEL_DISCONNECTED: "KERNEL_DISCONNECTED",
|
|
2142
2141
|
KERNEL_STARTUP_ERROR: "KERNEL_STARTUP_ERROR"
|
|
2143
|
-
}, X =
|
|
2144
|
-
|
|
2142
|
+
}, X = y({ state: Y.NOT_STARTED });
|
|
2143
|
+
h(null, (e, t) => t === null ? null : {
|
|
2145
2144
|
phase: t.phase,
|
|
2146
2145
|
logs: t.log_mode === "append" && e?.phase === t.phase ? e.logs + t.logs : t.logs
|
|
2147
2146
|
});
|
|
2148
2147
|
function Vr() {
|
|
2149
|
-
return
|
|
2148
|
+
return ae(X, (e) => e.state === Y.OPEN);
|
|
2150
2149
|
}
|
|
2151
2150
|
function Hr() {
|
|
2152
|
-
return
|
|
2151
|
+
return pe() ? Vr() : Promise.resolve();
|
|
2153
2152
|
}
|
|
2154
|
-
|
|
2153
|
+
y((e) => e(X).state === Y.CONNECTING), y((e) => e(X).state === Y.OPEN), y((e) => {
|
|
2155
2154
|
let t = e(X);
|
|
2156
2155
|
return t.state === Y.OPEN || t.state === Y.NOT_STARTED;
|
|
2157
|
-
}),
|
|
2156
|
+
}), y((e) => e(X).state === Y.CLOSED), y((e) => e(X).state === Y.NOT_STARTED);
|
|
2158
2157
|
//#endregion
|
|
2159
2158
|
//#region src/components/ui/checkbox.tsx
|
|
2160
|
-
var Ur =
|
|
2161
|
-
let r = (0,
|
|
2159
|
+
var Ur = D.forwardRef((e, t) => {
|
|
2160
|
+
let r = (0, at.c)(13), i, a;
|
|
2162
2161
|
r[0] === e ? (i = r[1], a = r[2]) : ({className: i, ...a} = e, r[0] = e, r[1] = i, r[2] = a);
|
|
2163
2162
|
let o;
|
|
2164
2163
|
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);
|
|
2165
2164
|
let s;
|
|
2166
2165
|
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];
|
|
2167
2166
|
let c;
|
|
2168
|
-
r[6] === a.checked ? c = r[7] : (c = /* @__PURE__ */ (0,
|
|
2167
|
+
r[6] === a.checked ? c = r[7] : (c = /* @__PURE__ */ (0, O.jsx)(Me, {
|
|
2169
2168
|
className: s,
|
|
2170
|
-
children: a.checked === "indeterminate" ? /* @__PURE__ */ (0,
|
|
2169
|
+
children: a.checked === "indeterminate" ? /* @__PURE__ */ (0, O.jsx)(be, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, O.jsx)(l, { className: "h-4 w-4" })
|
|
2171
2170
|
}), r[6] = a.checked, r[7] = c);
|
|
2172
2171
|
let u;
|
|
2173
|
-
return r[8] !== a || r[9] !== t || r[10] !== o || r[11] !== c ? (u = /* @__PURE__ */ (0,
|
|
2172
|
+
return r[8] !== a || r[9] !== t || r[10] !== o || r[11] !== c ? (u = /* @__PURE__ */ (0, O.jsx)(Ae, {
|
|
2174
2173
|
ref: t,
|
|
2175
2174
|
className: o,
|
|
2176
2175
|
...a,
|
|
2177
2176
|
children: c
|
|
2178
2177
|
}), r[8] = a, r[9] = t, r[10] = o, r[11] = c, r[12] = u) : u = r[12], u;
|
|
2179
2178
|
});
|
|
2180
|
-
Ur.displayName =
|
|
2179
|
+
Ur.displayName = Ae.displayName;
|
|
2181
2180
|
//#endregion
|
|
2182
2181
|
//#region src/core/cells/scrollCellIntoView.ts
|
|
2183
2182
|
function Wr({ cellId: e, cell: n, isCodeHidden: r, codeFocus: i, variableName: a }) {
|
|
2184
2183
|
if (!n) return;
|
|
2185
|
-
let o = document.getElementById(
|
|
2184
|
+
let o = document.getElementById(F.create(e));
|
|
2186
2185
|
if (!o) {
|
|
2187
2186
|
t.warn("scrollCellIntoView: element not found");
|
|
2188
2187
|
return;
|
|
2189
2188
|
}
|
|
2190
|
-
if (
|
|
2191
|
-
|
|
2189
|
+
if (Hn()) {
|
|
2190
|
+
U(o);
|
|
2192
2191
|
return;
|
|
2193
2192
|
}
|
|
2194
|
-
if (r)
|
|
2193
|
+
if (r) U(o);
|
|
2195
2194
|
else {
|
|
2196
|
-
|
|
2195
|
+
ft.promote(e);
|
|
2197
2196
|
let r = n.current?.editorView;
|
|
2198
2197
|
if (!r) {
|
|
2199
2198
|
t.warn("scrollCellIntoView: editor not found", e);
|
|
2200
2199
|
return;
|
|
2201
2200
|
}
|
|
2202
2201
|
if (r.hasFocus || !document.hasFocus()) return;
|
|
2203
|
-
if (
|
|
2202
|
+
if (Un(() => (r.focus(), r.hasFocus), {
|
|
2204
2203
|
retries: 5,
|
|
2205
2204
|
delay: 20
|
|
2206
2205
|
}), i === "top") r.dispatch({ selection: {
|
|
@@ -2234,7 +2233,7 @@ function Kr() {
|
|
|
2234
2233
|
});
|
|
2235
2234
|
}
|
|
2236
2235
|
function qr(e) {
|
|
2237
|
-
let t = document.getElementById(
|
|
2236
|
+
let t = document.getElementById(F.create(e));
|
|
2238
2237
|
return t?.scrollIntoView({
|
|
2239
2238
|
behavior: "smooth",
|
|
2240
2239
|
block: "center"
|
|
@@ -2252,18 +2251,18 @@ function Jr(e) {
|
|
|
2252
2251
|
return {
|
|
2253
2252
|
...e,
|
|
2254
2253
|
cellData: {
|
|
2255
|
-
[
|
|
2256
|
-
id:
|
|
2254
|
+
[P]: gn({
|
|
2255
|
+
id: P,
|
|
2257
2256
|
config: t
|
|
2258
2257
|
}),
|
|
2259
2258
|
...e.cellData
|
|
2260
2259
|
},
|
|
2261
2260
|
cellRuntime: {
|
|
2262
|
-
[
|
|
2261
|
+
[P]: vn(),
|
|
2263
2262
|
...e.cellRuntime
|
|
2264
2263
|
},
|
|
2265
2264
|
cellHandles: {
|
|
2266
|
-
[
|
|
2265
|
+
[P]: (0, D.createRef)(),
|
|
2267
2266
|
...e.cellHandles
|
|
2268
2267
|
}
|
|
2269
2268
|
};
|
|
@@ -2279,18 +2278,18 @@ function Yr() {
|
|
|
2279
2278
|
cellLogs: []
|
|
2280
2279
|
});
|
|
2281
2280
|
}
|
|
2282
|
-
var { reducer: Xr, createActions: Zr, useActions: Qr, valueAtom: Z } =
|
|
2281
|
+
var { reducer: Xr, createActions: Zr, useActions: Qr, valueAtom: Z } = ce(Yr, {
|
|
2283
2282
|
codeFormatted: (e, t) => {
|
|
2284
2283
|
let { cellId: n, before: r, after: i } = t;
|
|
2285
2284
|
return e.cellData[n] ? $r({
|
|
2286
2285
|
state: e,
|
|
2287
2286
|
cellId: n,
|
|
2288
2287
|
cellReducer: (e) => {
|
|
2289
|
-
let t =
|
|
2288
|
+
let t = z(e.lastCodeRun, r) ? e.lastCodeRun : i;
|
|
2290
2289
|
return {
|
|
2291
2290
|
...e,
|
|
2292
2291
|
lastCodeRun: t,
|
|
2293
|
-
edited:
|
|
2292
|
+
edited: z(t, e.code)
|
|
2294
2293
|
};
|
|
2295
2294
|
}
|
|
2296
2295
|
}) : e;
|
|
@@ -2315,7 +2314,7 @@ var { reducer: Xr, createActions: Zr, useActions: Qr, valueAtom: Z } = ae(Yr, {
|
|
|
2315
2314
|
let n = t.cell_id, r = Q({
|
|
2316
2315
|
state: e,
|
|
2317
2316
|
cellId: n,
|
|
2318
|
-
cellReducer: (e) =>
|
|
2317
|
+
cellReducer: (e) => It(e, t)
|
|
2319
2318
|
});
|
|
2320
2319
|
return t.status === "queued" && (r = $r({
|
|
2321
2320
|
state: r,
|
|
@@ -2327,7 +2326,7 @@ var { reducer: Xr, createActions: Zr, useActions: Qr, valueAtom: Z } = ae(Yr, {
|
|
|
2327
2326
|
})
|
|
2328
2327
|
})), {
|
|
2329
2328
|
...r,
|
|
2330
|
-
cellLogs: [...r.cellLogs, ...
|
|
2329
|
+
cellLogs: [...r.cellLogs, ...Rn(t)]
|
|
2331
2330
|
};
|
|
2332
2331
|
},
|
|
2333
2332
|
addLogs: (e, t) => ({
|
|
@@ -2335,7 +2334,7 @@ var { reducer: Xr, createActions: Zr, useActions: Qr, valueAtom: Z } = ae(Yr, {
|
|
|
2335
2334
|
cellLogs: [...e.cellLogs, ...t.logs]
|
|
2336
2335
|
}),
|
|
2337
2336
|
reconcileDocument: (e, t) => {
|
|
2338
|
-
let n =
|
|
2337
|
+
let n = bn(e, t);
|
|
2339
2338
|
for (let t of e.cellIds) t in n.cellData || mi(t);
|
|
2340
2339
|
return n;
|
|
2341
2340
|
},
|
|
@@ -2368,7 +2367,7 @@ var { reducer: Xr, createActions: Zr, useActions: Qr, valueAtom: Z } = ae(Yr, {
|
|
|
2368
2367
|
n[r] = {
|
|
2369
2368
|
...i,
|
|
2370
2369
|
lastCodeRun: a,
|
|
2371
|
-
edited: a !== null &&
|
|
2370
|
+
edited: a !== null && z(a, i.code)
|
|
2372
2371
|
};
|
|
2373
2372
|
}
|
|
2374
2373
|
return {
|
|
@@ -2377,10 +2376,10 @@ var { reducer: Xr, createActions: Zr, useActions: Qr, valueAtom: Z } = ae(Yr, {
|
|
|
2377
2376
|
};
|
|
2378
2377
|
},
|
|
2379
2378
|
resetCellRuntimes: (e) => {
|
|
2380
|
-
let t =
|
|
2381
|
-
for (let r of [...e.cellIds,
|
|
2379
|
+
let t = ge(), n = { ...e.cellRuntime };
|
|
2380
|
+
for (let r of [...e.cellIds, P]) {
|
|
2382
2381
|
let i = e.cellRuntime[r];
|
|
2383
|
-
n[r] = t && i !== void 0 && (i.output != null || i.consoleOutputs.length > 0) ? i :
|
|
2382
|
+
n[r] = t && i !== void 0 && (i.output != null || i.consoleOutputs.length > 0) ? i : vn();
|
|
2384
2383
|
}
|
|
2385
2384
|
return {
|
|
2386
2385
|
...e,
|
|
@@ -2394,7 +2393,7 @@ var { reducer: Xr, createActions: Zr, useActions: Qr, valueAtom: Z } = ae(Yr, {
|
|
|
2394
2393
|
return Wr({
|
|
2395
2394
|
cellId: n,
|
|
2396
2395
|
cell: e.cellHandles[n],
|
|
2397
|
-
isCodeHidden:
|
|
2396
|
+
isCodeHidden: Cn(e.cellData[n]?.config.hide_code, w.get(B), n),
|
|
2398
2397
|
codeFocus: void 0,
|
|
2399
2398
|
variableName: void 0
|
|
2400
2399
|
}), {
|
|
@@ -2402,8 +2401,8 @@ var { reducer: Xr, createActions: Zr, useActions: Qr, valueAtom: Z } = ae(Yr, {
|
|
|
2402
2401
|
scrollKey: null
|
|
2403
2402
|
};
|
|
2404
2403
|
},
|
|
2405
|
-
foldAll: (e) => (
|
|
2406
|
-
unfoldAll: (e) => (
|
|
2404
|
+
foldAll: (e) => (st(Object.values(e.cellHandles).map((e) => e.current?.editorView)), e),
|
|
2405
|
+
unfoldAll: (e) => (ct(Object.values(e.cellHandles).map((e) => e.current?.editorView)), e),
|
|
2407
2406
|
clearLogs: (e) => ({
|
|
2408
2407
|
...e,
|
|
2409
2408
|
cellLogs: []
|
|
@@ -2464,14 +2463,14 @@ function $r({ state: e, cellId: n, cellReducer: r }) {
|
|
|
2464
2463
|
}
|
|
2465
2464
|
var ei = Zr((e) => {
|
|
2466
2465
|
w.set(Z, (t) => Xr(t, e));
|
|
2467
|
-
}).addLogs, $ =
|
|
2468
|
-
|
|
2469
|
-
var ti =
|
|
2466
|
+
}).addLogs, $ = y((e) => e(Z).cellIds);
|
|
2467
|
+
y((e) => e($).length === 1), y((e) => Kn(e(Z)).length > 0), y((e) => qn(e(Z)).length > 0), y((e) => Jn(e(Z))), y((e) => Yn(e(Z))), y((e) => Wn(e(Z), e(j)));
|
|
2468
|
+
var ti = y((e) => {
|
|
2470
2469
|
let { cellIds: t, cellRuntime: n, cellData: r } = e(Z);
|
|
2471
2470
|
return t.map((e) => {
|
|
2472
2471
|
let t = n[e], { name: i } = r[e];
|
|
2473
|
-
if (
|
|
2474
|
-
|
|
2472
|
+
if (M(t.output?.mimetype)) {
|
|
2473
|
+
T(Array.isArray(t.output.data), "Expected array data");
|
|
2475
2474
|
let n = t.output.data.filter((e) => !e.type.includes("ancestor"));
|
|
2476
2475
|
if (n.length > 0) return {
|
|
2477
2476
|
output: {
|
|
@@ -2484,47 +2483,47 @@ var ti = T((e) => {
|
|
|
2484
2483
|
}
|
|
2485
2484
|
return null;
|
|
2486
2485
|
}).filter(Boolean);
|
|
2487
|
-
}), ni = y(
|
|
2486
|
+
}), ni = ie(y((e) => {
|
|
2488
2487
|
let t = {};
|
|
2489
|
-
for (let [n, r] of
|
|
2488
|
+
for (let [n, r] of se.entries(e(Z).cellRuntime)) r.outline !== null && r.outline.items.length > 0 && (t[n] = r.outline);
|
|
2490
2489
|
return t;
|
|
2491
|
-
})), ri =
|
|
2490
|
+
})), ri = y((e) => {
|
|
2492
2491
|
let t = e($), n = e(ui);
|
|
2493
|
-
return
|
|
2492
|
+
return yt(t.map((e) => n[e].outline));
|
|
2494
2493
|
});
|
|
2495
|
-
|
|
2496
|
-
var ii = y(
|
|
2494
|
+
y((e) => e(ti).length);
|
|
2495
|
+
var ii = ie(y((e) => {
|
|
2497
2496
|
let { cellIds: t, cellData: n } = e(Z);
|
|
2498
|
-
return
|
|
2497
|
+
return se.fromEntries(t.map((e) => [e, n[e]?.name]));
|
|
2499
2498
|
}));
|
|
2500
|
-
|
|
2501
|
-
var ai = () =>
|
|
2499
|
+
y((e) => e(Z).scrollKey);
|
|
2500
|
+
var ai = () => _($), oi = () => _(ii), si = () => w.get(Z), ci = () => w.get(Z).cellIds, li = () => {
|
|
2502
2501
|
let { cellIds: e, cellData: t } = w.get(Z);
|
|
2503
2502
|
return e.map((e) => t[e]?.name).filter(Boolean);
|
|
2504
2503
|
};
|
|
2505
|
-
|
|
2506
|
-
var ui =
|
|
2507
|
-
|
|
2508
|
-
var di =
|
|
2504
|
+
C(p(Z, (e) => e.cellIds.map((t) => e.cellData[t])));
|
|
2505
|
+
var ui = y((e) => e(Z).cellRuntime);
|
|
2506
|
+
y((e) => e(Z).cellIds.length > 0);
|
|
2507
|
+
var di = g((e) => y((t) => t(Z).cellData[e])), fi = g((e) => y((t) => t(Z).cellRuntime[e])), pi = g((e) => y((t) => t(Z).cellHandles[e]));
|
|
2509
2508
|
function mi(e) {
|
|
2510
|
-
di.remove(e), fi.remove(e), pi.remove(e),
|
|
2509
|
+
di.remove(e), fi.remove(e), pi.remove(e), nt(w, [e]);
|
|
2511
2510
|
}
|
|
2512
2511
|
var hi = (e) => {
|
|
2513
2512
|
let { cellHandles: t } = w.get(Z);
|
|
2514
2513
|
return t[e].current?.editorView;
|
|
2515
|
-
}, gi = (e) => (
|
|
2514
|
+
}, gi = (e) => (ft.promote(e), hi(e));
|
|
2516
2515
|
function _i() {
|
|
2517
2516
|
return Qr();
|
|
2518
2517
|
}
|
|
2519
2518
|
//#endregion
|
|
2520
2519
|
//#region src/core/errors/error-entries.ts
|
|
2521
2520
|
function vi(e) {
|
|
2522
|
-
if (
|
|
2521
|
+
if (Ct(e.mimetype)) {
|
|
2523
2522
|
if (!Array.isArray(e.data)) return null;
|
|
2524
2523
|
let t = e.data.filter((e) => !e.type.includes("ancestor"));
|
|
2525
2524
|
return t.length === 0 ? null : { errorData: t };
|
|
2526
2525
|
}
|
|
2527
|
-
return
|
|
2526
|
+
return wt(e.mimetype) ? typeof e.data != "string" || e.data.length === 0 ? null : {
|
|
2528
2527
|
errorData: [],
|
|
2529
2528
|
tracebackHtml: e.data
|
|
2530
2529
|
} : null;
|
|
@@ -2533,7 +2532,7 @@ function yi(e) {
|
|
|
2533
2532
|
return e.some((e) => "traceback" in e && e.traceback);
|
|
2534
2533
|
}
|
|
2535
2534
|
function bi(e) {
|
|
2536
|
-
let t = e?.find((e) =>
|
|
2535
|
+
let t = e?.find((e) => wt(e.mimetype));
|
|
2537
2536
|
if (!(!t || typeof t.data != "string" || t.data.length === 0)) return t.data;
|
|
2538
2537
|
}
|
|
2539
2538
|
function xi(e, t) {
|
|
@@ -2544,10 +2543,10 @@ function Si(e) {
|
|
|
2544
2543
|
let { cellIds: t, cellRuntime: n, cellData: r } = e.get(Z), i = [];
|
|
2545
2544
|
for (let [e, a] of t.entries()) {
|
|
2546
2545
|
let t = n[a], o = t.output;
|
|
2547
|
-
if (!o || !
|
|
2546
|
+
if (!o || !M(o.mimetype)) continue;
|
|
2548
2547
|
let s = vi(o);
|
|
2549
2548
|
if (!s) continue;
|
|
2550
|
-
let c =
|
|
2549
|
+
let c = mn(r[a].name, e), l = r[a].lastCodeRun ?? r[a].code;
|
|
2551
2550
|
i.push({
|
|
2552
2551
|
cellId: a,
|
|
2553
2552
|
cellName: c,
|
|
@@ -2563,11 +2562,11 @@ function Ci(e) {
|
|
|
2563
2562
|
}
|
|
2564
2563
|
function wi(e) {
|
|
2565
2564
|
let t = Ci(e);
|
|
2566
|
-
return "traceback" in e && e.traceback && (t += `\n\nTraceback:\n${
|
|
2565
|
+
return "traceback" in e && e.traceback && (t += `\n\nTraceback:\n${H(e.traceback)}`), t;
|
|
2567
2566
|
}
|
|
2568
2567
|
function Ti(e) {
|
|
2569
2568
|
let t = [e.cellName];
|
|
2570
|
-
return e.tracebackHtml && t.push(
|
|
2569
|
+
return e.tracebackHtml && t.push(H(e.tracebackHtml)), e.errorData.length > 0 && t.push(e.errorData.map(wi).join("\n\n")), t.join("\n\n");
|
|
2571
2570
|
}
|
|
2572
2571
|
//#endregion
|
|
2573
|
-
export {
|
|
2572
|
+
export { Vn as $, Br as A, Jt as At, vr as B, it as Bt, Gr as C, rn as Ct, X as D, P as Dt, Ur as E, F as Et, Sr as F, Rt as Ft, ir as G, dr as H, He as Ht, Cr as I, xt as It, er as J, tr as K, G as L, vt as Lt, zr as M, Ht as Mt, Er as N, zt as Nt, Vr as O, Kt as Ot, wr as P, Lt as Pt, $n as Q, xr as R, pt as Rt, Wr as S, an as St, Kr as T, Yt as Tt, fr as U, be as Ut, yr as V, et as Vt, lr as W, ye as Wt, Gn as X, Zn as Y, Qn as Z, Xr as _, cn as _t, ei as a, B as at, oi as b, nn as bt, Zr as c, mn as ct, li as d, fn as dt, Pn as et, ci as f, Xt as ft, ri as g, on as gt, Z as h, R as ht, Si as i, wn as it, Y as j, Vt as jt, Hr as k, I as kt, gi as l, pn as lt, Yr as m, sn as mt, Ti as n, Dn as nt, di as o, Sn as ot, si as p, L as pt, W as q, wi as r, Cn as rt, $ as s, xn as st, Ci as t, H as tt, hi as u, hn as ut, mi as v, un as vt, qr as w, qt as wt, _i as x, Zt as xt, ai as y, ln as yt, _r as z, j as zt };
|