@marimo-team/islands 0.25.3-dev267 → 0.25.3-dev269
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-C4yCN38h.js → ConnectedDataExplorerComponent-eLHPh6uu.js} +8 -8
- package/dist/{ErrorBoundary-CewXPyL5.js → ErrorBoundary-DCtynjHZ.js} +4 -4
- package/dist/{abnfDiagram-VCTEODGH-o6Ay6Q63.js → abnfDiagram-VCTEODGH-hqd0IBtX.js} +2 -2
- package/dist/{architectureDiagram-5GKGNRK7-BhiwwlVg.js → architectureDiagram-5GKGNRK7-BzLAFcc0.js} +1 -1
- package/dist/{strings-BCKpLFNU.js → assertNever-DIU3JJbt.js} +14 -14
- package/dist/{chat-ui-CbgR5ivy.js → chat-ui-BWIkve2R.js} +17 -17
- package/dist/{chunk-IMKFNOWR-WMSMf4Nj.js → chunk-IMKFNOWR-DOeVvuyE.js} +1 -1
- package/dist/{chunk-SHT3W25Y-BRfADrzD.js → chunk-SHT3W25Y-DZoFI8wR.js} +1 -1
- package/dist/{chunk-SVP7TREG-CuK5QFre.js → chunk-SVP7TREG-CWu86PSW.js} +1 -1
- package/dist/{chunk-TICWLB2K-Bcun_jhJ.js → chunk-TICWLB2K-BrM0GoP3.js} +1 -1
- package/dist/{classDiagram-ZZMXUADV-CgWDbUDT.js → classDiagram-ZZMXUADV-DYi4V2bB.js} +2 -2
- package/dist/{classDiagram-v2-VYDZK3BY-DYmc9SFU.js → classDiagram-v2-VYDZK3BY-tN7FIk-m.js} +2 -2
- package/dist/{code-visibility-BKBl9Rh6.js → code-visibility-CMF5tcNj.js} +44 -47
- package/dist/{common-N3Jd_6m9.js → common-DYAjQ1bK.js} +4866 -4857
- package/dist/{config-CmeG_Pb6.js → config-BsPruWMR.js} +2 -2
- package/dist/{createReducer-C_syF8Td.js → createReducer-DdtT_7ji.js} +1 -1
- package/dist/{cynefinDiagram-5FMLGOSQ-PPKWipjT.js → cynefinDiagram-5FMLGOSQ-D5nCnDc-.js} +1 -1
- package/dist/{dagre-GXQ25YYZ-niRBZh--.js → dagre-GXQ25YYZ-BHkd7f_i.js} +1 -1
- package/dist/{data-grid-overlay-editor-Cp59CrqZ.js → data-grid-overlay-editor-B6oND8pX.js} +1 -1
- package/dist/{diagram-S7CK7UJ4-DPiP9rot.js → diagram-S7CK7UJ4-D1ALppT2.js} +1 -1
- package/dist/{diagram-UQ7AKVKN-B0WZuaxV.js → diagram-UQ7AKVKN-DLv0b83L.js} +1 -1
- package/dist/{diagram-VX7I27RA-Rn42WBuN.js → diagram-VX7I27RA-7XJ7J6qg.js} +1 -1
- package/dist/{diagram-Z3DM3KII-BB93--ry.js → diagram-Z3DM3KII-7M7zbHp_.js} +1 -1
- package/dist/{dialog-BtprQCUw.js → dialog-DzCj1qQv.js} +1 -1
- package/dist/{dropdown-menu-BpImEfn3.js → dropdown-menu-CdXE15an.js} +3 -3
- package/dist/{ebnfDiagram-PWID7BFC-V4t5h6mZ.js → ebnfDiagram-PWID7BFC-DHH1qlmV.js} +2 -2
- package/dist/{erDiagram-RLTQ6QDP-C1MsAKXd.js → erDiagram-RLTQ6QDP-fI_0dGef.js} +1 -1
- package/dist/{error-entries-CJGdD2ky.js → error-entries-CxN-Nq3V.js} +519 -458
- package/dist/{feedback-button-Qc1f9iPq.js → feedback-button-BelKx6R5.js} +22 -22
- package/dist/{flowDiagram-HODETNUW-DHjeJP96.js → flowDiagram-HODETNUW-Brg9MA6i.js} +2 -2
- package/dist/{formats-gGospKWJ.js → formats-DbSvAPY-.js} +1 -1
- package/dist/{glide-data-editor-hCq3K0sd.js → glide-data-editor-CMZ-kv0S.js} +11 -11
- package/dist/{glide-utils-DC3sk6EX.js → glide-utils-BSw3SSHF.js} +1 -1
- package/dist/{globals-B2_uMYDY.js → globals-DV77npCG.js} +2 -2
- package/dist/{html-to-image-S7spRQCi.js → html-to-image-Bc2AvXHG.js} +5121 -5121
- package/dist/{infoDiagram-27XIBGKW-Dovv6iKx.js → infoDiagram-27XIBGKW-E9e403YT.js} +1 -1
- package/dist/{ishikawaDiagram-5VMMS53U-D2nyygsc.js → ishikawaDiagram-5VMMS53U-C-RlYDRo.js} +1 -1
- package/dist/{kanban-definition-UXKFOSKX-KyVx0uTY.js → kanban-definition-UXKFOSKX-CLFl_uqK.js} +1 -1
- package/dist/main.js +5972 -6003
- package/dist/{mermaid-B-jKSwGt.js → mermaid-rd09e1JL.js} +34 -34
- package/dist/{mindmap-definition-YA3MSWOX-Bz9tKQFl.js → mindmap-definition-YA3MSWOX-BQ8TWtyB.js} +1 -1
- package/dist/{number-overlay-editor-CfNYvbdz.js → number-overlay-editor-CFTuKnrY.js} +1 -1
- package/dist/{pegDiagram-XKGWAZYB-C_qpq6Tv.js → pegDiagram-XKGWAZYB-CN8UHFPi.js} +2 -2
- package/dist/{pieDiagram-E7YTZNPT-Bp9ucgI4.js → pieDiagram-E7YTZNPT-DGuJ0EBd.js} +1 -1
- package/dist/{process-output-f34bkXTm.js → process-output-qecD7Dk8.js} +3 -3
- package/dist/{railroadDiagram-O6MQD6OU-tq-VEH6j.js → railroadDiagram-O6MQD6OU-BPDA8wy8.js} +2 -2
- package/dist/{requirementDiagram-BXWQKSXE-DW-vHadb.js → requirementDiagram-BXWQKSXE-ChzLGbGW.js} +1 -1
- package/dist/{reveal-component-CUxv-kkP.js → reveal-component-Doix35eL.js} +1094 -1094
- package/dist/{select-C33FVPPN.js → select-OxgozOC8.js} +1 -1
- package/dist/{sequenceDiagram-WJ2MYXX4-Dv9U9qRP.js → sequenceDiagram-WJ2MYXX4-DFX-bE6O.js} +1 -1
- package/dist/{spec-DH1lmF7Q.js → spec-oJn0RhpQ.js} +2 -2
- package/dist/{stateDiagram-D77RDMKH-DTmPQ0EB.js → stateDiagram-D77RDMKH-BR7cI3wK.js} +2 -2
- package/dist/{stateDiagram-v2-MP3YSRHH-CkCif0Iw.js → stateDiagram-v2-MP3YSRHH-oGqB5UDI.js} +2 -2
- package/dist/{static-state-BldGd99T.js → static-state-CuV6Pc3a.js} +1 -1
- package/dist/{swimlanes-42K2YHIH-21kCq6l8.js → swimlanes-42K2YHIH-DwSZl1yC.js} +1 -1
- package/dist/{swimlanesDiagram-VR7AAH4N-BpRJP6KU.js → swimlanesDiagram-VR7AAH4N-BHlcd-Ri.js} +2 -2
- package/dist/{timeline-definition-24CTP7MA-Ckgh4lS4.js → timeline-definition-24CTP7MA-DMmP-G2O.js} +1 -1
- package/dist/{toast-DpczUryP.js → toast-DbBHmxmB.js} +1 -1
- package/dist/{useAsyncData-DsZMvNXn.js → useAsyncData-BYIAoMqn.js} +1 -1
- package/dist/{useDateFormatter-Dk_xFci4.js → useDateFormatter-ButWkdcK.js} +1 -1
- package/dist/{useDeepCompareMemoize-KMBBux8C.js → useDeepCompareMemoize-Bz0c5GN6.js} +1 -1
- package/dist/{useTheme-BZ2GGLgm.js → useTheme-DPLobSFs.js} +7 -7
- package/dist/{utils-DXkj82sK.js → utils-EBklsC5R.js} +31 -31
- package/dist/{vega-component-CF9kI6C4.js → vega-component-rxIxAAh9.js} +6 -6
- package/dist/{vennDiagram-4TSXK5OY-CDei2Bt3.js → vennDiagram-4TSXK5OY-Db8GtH1G.js} +1 -1
- package/dist/{wardleyDiagram-VM6X3IG4-CXavT601.js → wardleyDiagram-VM6X3IG4-DmIiC3FU.js} +1 -1
- package/dist/{xychartDiagram-S5SC5T6Z-CvJhcZri.js → xychartDiagram-S5SC5T6Z-DS9OPrNq.js} +1 -1
- package/package.json +1 -1
- package/src/__mocks__/executions.ts +195 -0
- package/src/__mocks__/notebook.ts +0 -1
- package/src/__tests__/CellStatus.test.tsx +19 -20
- package/src/components/dependency-graph/minimap-content.tsx +3 -2
- package/src/components/editor/__tests__/data-attributes.test.tsx +0 -7
- package/src/components/editor/__tests__/output-persistence.test.tsx +2 -2
- package/src/components/editor/actions/__tests__/useCellActionButton.test.tsx +1 -0
- package/src/components/editor/actions/useCellActionButton.tsx +7 -3
- package/src/components/editor/alerts/stdin-blocking-alert.tsx +3 -1
- package/src/components/editor/cell/CellStatus.tsx +23 -19
- package/src/components/editor/cell/RunButton.tsx +16 -6
- package/src/components/editor/cell/__tests__/useRunCells.test.ts +45 -0
- package/src/components/editor/cell/cell-context-menu.tsx +4 -1
- package/src/components/editor/cell/code/cell-editor.tsx +7 -5
- package/src/components/editor/cell/collapse.tsx +4 -0
- package/src/components/editor/cell/useRunCells.ts +18 -3
- package/src/components/editor/chrome/wrapper/sidebar.tsx +2 -4
- package/src/components/editor/header/status.tsx +4 -2
- package/src/components/editor/navigation/navigation.ts +3 -2
- package/src/components/editor/notebook-cell.tsx +82 -83
- package/src/components/editor/renderers/grid-layout/__tests__/grid-layout.test.tsx +75 -0
- package/src/components/editor/renderers/grid-layout/grid-layout.tsx +22 -16
- package/src/components/editor/renderers/slides-layout/__tests__/plugin.test.ts +0 -1
- package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +12 -33
- package/src/components/editor/stdin-blocking-alert.tsx +3 -1
- package/src/components/scratchpad/scratchpad.tsx +4 -1
- package/src/components/slides/minimap.tsx +4 -2
- package/src/components/slides/reveal-component.tsx +14 -10
- package/src/components/slides/slide-cell-view.tsx +28 -24
- package/src/components/slides/slide.tsx +3 -4
- package/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap +0 -389
- package/src/core/cells/__tests__/cell.test.ts +49 -154
- package/src/core/cells/__tests__/cells.test.ts +18 -127
- package/src/core/cells/__tests__/pending-delete-service.test.tsx +11 -20
- package/src/core/cells/__tests__/utils.test.ts +75 -247
- package/src/core/cells/actions.ts +5 -2
- package/src/core/cells/cell.ts +31 -133
- package/src/core/cells/cells.ts +14 -29
- package/src/core/cells/document.ts +3 -3
- package/src/core/cells/focus.ts +27 -6
- package/src/core/cells/layout.ts +1 -1
- package/src/core/cells/pending-delete-service.ts +5 -7
- package/src/core/cells/types.ts +13 -36
- package/src/core/cells/utils.ts +37 -68
- package/src/core/edit-app.tsx +2 -1
- package/src/core/executions/__tests__/atoms.test.ts +99 -0
- package/src/core/executions/__tests__/select.test.ts +268 -0
- package/src/core/executions/atoms.ts +206 -0
- package/src/core/executions/hooks.ts +31 -0
- package/src/core/executions/index.ts +31 -0
- package/src/core/executions/select.ts +175 -0
- package/src/core/export/__tests__/hooks.test.ts +0 -5
- package/src/core/islands/bootstrap.ts +4 -1
- package/src/core/islands/components/output-wrapper.tsx +5 -5
- package/src/core/kernel/handlers.ts +2 -11
- package/src/core/kernel/state.ts +0 -15
- package/src/core/lifecycle/render-policy.ts +12 -26
- package/src/core/network/__tests__/requests-lazy.test.ts +5 -5
- package/src/core/network/requests-lazy.ts +3 -3
- package/src/core/notebook/operations.ts +1 -1
- package/src/core/run-app.tsx +2 -1
- package/src/core/runtime/__tests__/adapter.test.ts +3 -3
- package/src/core/runtime/adapter.ts +4 -4
- package/src/core/session/useNotebookSession.tsx +3 -3
- package/src/core/wasm/bridge.ts +1 -1
- package/src/plugins/core/RenderHTML.tsx +3 -5
- package/src/plugins/core/__test__/RenderHTML-copy.test.tsx +60 -0
- package/src/plugins/core/registerReactComponent.tsx +4 -13
- package/src/stories/cell-status.stories.tsx +17 -10
- package/src/stories/cell.stories.tsx +0 -31
- package/src/stories/layout/vertical/one-column.stories.tsx +0 -9
- package/src/utils/time.ts +10 -0
|
@@ -5,17 +5,17 @@ import { t as a } from "./compiler-runtime-CldRdSsv.js";
|
|
|
5
5
|
import { i as o } from "./copy-icon-C2I8sw4h.js";
|
|
6
6
|
import { f as s, h as c } from "./tooltip-BfcDQd2j.js";
|
|
7
7
|
import { t as l } from "./check-gUSZbRsl.js";
|
|
8
|
-
import {
|
|
8
|
+
import { n as u, r as d } from "./assertNever-DIU3JJbt.js";
|
|
9
9
|
import { t as f } from "./jsx-runtime-3BD1kT0s.js";
|
|
10
10
|
import { F as p, I as m, M as ee, N as h, j as g } from "./use-restore-focus-CmflVLWJ.js";
|
|
11
|
-
import { n as _ } from "./toast-
|
|
12
|
-
import { _ as v, a as y, c as b, d as x,
|
|
11
|
+
import { n as _ } from "./toast-DbBHmxmB.js";
|
|
12
|
+
import { _ as v, a as y, c as b, d as x, l as S, m as C, o as w, p as te, t as ne, u as re, v as ie, w as T, x as E } from "./utils-EBklsC5R.js";
|
|
13
13
|
import { t as D } from "./invariant-DLmrl-hA.js";
|
|
14
|
-
import { t as
|
|
15
|
-
import { t as ae } from "./createReducer-
|
|
14
|
+
import { t as O } from "./objects-DCmMvZtn.js";
|
|
15
|
+
import { t as ae } from "./createReducer-DdtT_7ji.js";
|
|
16
16
|
import { M as oe, N as se, V as ce, g as le } from "./dist-CYeqK4Xw.js";
|
|
17
17
|
import { t as ue } from "./purify.es-DMv5zIkJ.js";
|
|
18
|
-
import { a as de, i as fe, l as pe, m as me, u as he } from "./static-state-
|
|
18
|
+
import { a as de, i as fe, l as pe, m as me, u as he } from "./static-state-CuV6Pc3a.js";
|
|
19
19
|
import { t as ge } from "./capabilities-B6yy_CBN.js";
|
|
20
20
|
var _e = c("external-link", [
|
|
21
21
|
["path", {
|
|
@@ -33,7 +33,7 @@ var _e = c("external-link", [
|
|
|
33
33
|
]), ve = c("minus", [["path", {
|
|
34
34
|
d: "M5 12h14",
|
|
35
35
|
key: "1ays0h"
|
|
36
|
-
}]]),
|
|
36
|
+
}]]), k = /* @__PURE__ */ e(i(), 1), A = f(), ye = Object.defineProperty, j = (e, t) => ye(e, "name", {
|
|
37
37
|
value: t,
|
|
38
38
|
configurable: !0
|
|
39
39
|
}), be = "Checkbox", [xe, Se] = p(be), [Ce, we] = xe(be);
|
|
@@ -43,7 +43,7 @@ function Te(e) {
|
|
|
43
43
|
defaultProp: i ?? !1,
|
|
44
44
|
onChange: c,
|
|
45
45
|
caller: be
|
|
46
|
-
}), [m, h] =
|
|
46
|
+
}), [m, h] = k.useState(null), [g, _] = k.useState(null), [v, y] = k.useState(null), b = !m || !!o || !!m.closest("form"), x = {
|
|
47
47
|
checked: f,
|
|
48
48
|
disabled: a,
|
|
49
49
|
setChecked: p,
|
|
@@ -55,30 +55,30 @@ function Te(e) {
|
|
|
55
55
|
userClick: v,
|
|
56
56
|
onUserClick: y,
|
|
57
57
|
required: l,
|
|
58
|
-
defaultChecked: !
|
|
58
|
+
defaultChecked: !M(i) && i,
|
|
59
59
|
isFormControl: b,
|
|
60
60
|
bubbleInput: g,
|
|
61
61
|
setBubbleInput: _
|
|
62
62
|
};
|
|
63
|
-
return /* @__PURE__ */ (0,
|
|
63
|
+
return /* @__PURE__ */ (0, A.jsx)(Ce, {
|
|
64
64
|
scope: t,
|
|
65
65
|
...x,
|
|
66
66
|
children: Ne(d) ? d(x) : r
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
|
|
70
|
-
var Ee = "CheckboxTrigger", De = /* @__PURE__ */
|
|
71
|
-
let { control: o, value: s, disabled: c, checked: l, required: u, setControl: d, setChecked: f, onUserClick: p, isFormControl: ee, bubbleInput: g } = we(Ee, e), _ = r(a, d), v =
|
|
72
|
-
return
|
|
69
|
+
j(Te, "CheckboxProvider");
|
|
70
|
+
var Ee = "CheckboxTrigger", De = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ j(function({ __scopeCheckbox: e, onKeyDown: t, onClick: n, ...i }, a) {
|
|
71
|
+
let { control: o, value: s, disabled: c, checked: l, required: u, setControl: d, setChecked: f, onUserClick: p, isFormControl: ee, bubbleInput: g } = we(Ee, e), _ = r(a, d), v = k.useRef(l);
|
|
72
|
+
return k.useEffect(() => {
|
|
73
73
|
let e = o?.form;
|
|
74
74
|
if (e) {
|
|
75
|
-
let t = /* @__PURE__ */
|
|
75
|
+
let t = /* @__PURE__ */ j(() => f(v.current), "reset");
|
|
76
76
|
return e.addEventListener("reset", t), () => e.removeEventListener("reset", t);
|
|
77
77
|
}
|
|
78
|
-
}, [o, f]), /* @__PURE__ */ (0,
|
|
78
|
+
}, [o, f]), /* @__PURE__ */ (0, A.jsx)(m.button, {
|
|
79
79
|
type: "button",
|
|
80
80
|
role: "checkbox",
|
|
81
|
-
"aria-checked":
|
|
81
|
+
"aria-checked": M(l) ? "mixed" : l,
|
|
82
82
|
"aria-required": u,
|
|
83
83
|
"data-state": Pe(l),
|
|
84
84
|
"data-disabled": c ? "" : void 0,
|
|
@@ -92,14 +92,14 @@ var Ee = "CheckboxTrigger", De = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ A(
|
|
|
92
92
|
onClick: h(n, (e) => {
|
|
93
93
|
let t = e.isPropagationStopped();
|
|
94
94
|
p({
|
|
95
|
-
requestedChecked:
|
|
95
|
+
requestedChecked: M(l) ? !0 : !l,
|
|
96
96
|
hasConsumerStoppedPropagation: t
|
|
97
|
-
}), f((e) =>
|
|
97
|
+
}), f((e) => M(e) ? !0 : !e), g && ee && (t || e.stopPropagation());
|
|
98
98
|
})
|
|
99
99
|
});
|
|
100
|
-
}, "CheckboxTrigger")), Oe = /* @__PURE__ */
|
|
100
|
+
}, "CheckboxTrigger")), Oe = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ j(function(e, t) {
|
|
101
101
|
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,
|
|
102
|
+
return /* @__PURE__ */ (0, A.jsx)(Te, {
|
|
103
103
|
__scopeCheckbox: n,
|
|
104
104
|
checked: i,
|
|
105
105
|
defaultChecked: a,
|
|
@@ -109,17 +109,17 @@ var Ee = "CheckboxTrigger", De = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ A(
|
|
|
109
109
|
name: r,
|
|
110
110
|
form: u,
|
|
111
111
|
value: c,
|
|
112
|
-
internal_do_not_use_render: ({ isFormControl: e }) => /* @__PURE__ */ (0,
|
|
112
|
+
internal_do_not_use_render: ({ isFormControl: e }) => /* @__PURE__ */ (0, A.jsxs)(A.Fragment, { children: [/* @__PURE__ */ (0, A.jsx)(De, {
|
|
113
113
|
...d,
|
|
114
114
|
ref: t,
|
|
115
115
|
__scopeCheckbox: n
|
|
116
|
-
}), e && /* @__PURE__ */ (0,
|
|
116
|
+
}), e && /* @__PURE__ */ (0, A.jsx)(Me, { __scopeCheckbox: n })] })
|
|
117
117
|
});
|
|
118
|
-
}, "Checkbox")), ke = "CheckboxIndicator", Ae = /* @__PURE__ */
|
|
118
|
+
}, "Checkbox")), ke = "CheckboxIndicator", Ae = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ j(function(e, t) {
|
|
119
119
|
let { __scopeCheckbox: n, forceMount: r, ...i } = e, a = we(ke, n);
|
|
120
|
-
return /* @__PURE__ */ (0,
|
|
121
|
-
present: r ||
|
|
122
|
-
children: /* @__PURE__ */ (0,
|
|
120
|
+
return /* @__PURE__ */ (0, A.jsx)(g, {
|
|
121
|
+
present: r || M(a.checked) || a.checked === !0,
|
|
122
|
+
children: /* @__PURE__ */ (0, A.jsx)(m.span, {
|
|
123
123
|
"data-state": Pe(a.checked),
|
|
124
124
|
"data-disabled": a.disabled ? "" : void 0,
|
|
125
125
|
...i,
|
|
@@ -130,9 +130,9 @@ var Ee = "CheckboxTrigger", De = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ A(
|
|
|
130
130
|
}
|
|
131
131
|
})
|
|
132
132
|
});
|
|
133
|
-
}, "CheckboxIndicator")), je = "CheckboxBubbleInput", Me = /* @__PURE__ */
|
|
134
|
-
let { control: a, userClick: o, checked: c, defaultChecked: l, required: u, disabled: d, name: f, value: p, form: ee, bubbleInput: g, setBubbleInput: _ } = we(je, e), v = r(i, _), y = s(a), b =
|
|
135
|
-
|
|
133
|
+
}, "CheckboxIndicator")), je = "CheckboxBubbleInput", Me = /* @__PURE__ */ k.forwardRef(/* @__PURE__ */ j(function({ __scopeCheckbox: e, onClick: t, ...n }, i) {
|
|
134
|
+
let { control: a, userClick: o, checked: c, defaultChecked: l, required: u, disabled: d, name: f, value: p, form: ee, bubbleInput: g, setBubbleInput: _ } = we(je, e), v = r(i, _), y = s(a), b = k.useRef(!1), x = k.useRef(c), S = k.useRef(o), C = k.useRef(null);
|
|
135
|
+
k.useEffect(() => {
|
|
136
136
|
let e = g;
|
|
137
137
|
if (!e) return;
|
|
138
138
|
let t = window.HTMLInputElement.prototype, n = Object.getOwnPropertyDescriptor(t, "checked").set;
|
|
@@ -140,23 +140,23 @@ var Ee = "CheckboxTrigger", De = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ A(
|
|
|
140
140
|
let r = x.current !== c;
|
|
141
141
|
x.current = c;
|
|
142
142
|
let i = o !== null && o !== S.current;
|
|
143
|
-
if (S.current = o, i) C.current = r ? null : o, r && (e.indeterminate =
|
|
143
|
+
if (S.current = o, i) C.current = r ? null : o, r && (e.indeterminate = M(c), n.call(e, !M(c) && c)), e.dispatchEvent(new Event("click", { bubbles: !o.hasConsumerStoppedPropagation }));
|
|
144
144
|
else if (r) {
|
|
145
145
|
let t = C.current;
|
|
146
146
|
C.current = null;
|
|
147
147
|
let r = t?.requestedChecked === c;
|
|
148
|
-
b.current = !0, e.indeterminate =
|
|
148
|
+
b.current = !0, e.indeterminate = M(c), n.call(e, !M(c) && c), e.dispatchEvent(new Event("click", { bubbles: !(r && t.hasConsumerStoppedPropagation) })), b.current = !1;
|
|
149
149
|
}
|
|
150
150
|
}, [
|
|
151
151
|
g,
|
|
152
152
|
c,
|
|
153
153
|
o
|
|
154
154
|
]);
|
|
155
|
-
let
|
|
156
|
-
return /* @__PURE__ */ (0,
|
|
155
|
+
let w = k.useRef(!M(c) && c);
|
|
156
|
+
return /* @__PURE__ */ (0, A.jsx)(m.input, {
|
|
157
157
|
type: "checkbox",
|
|
158
158
|
"aria-hidden": !0,
|
|
159
|
-
defaultChecked: l ??
|
|
159
|
+
defaultChecked: l ?? w.current,
|
|
160
160
|
required: u,
|
|
161
161
|
disabled: d,
|
|
162
162
|
name: f,
|
|
@@ -182,29 +182,149 @@ var Ee = "CheckboxTrigger", De = /* @__PURE__ */ O.forwardRef(/* @__PURE__ */ A(
|
|
|
182
182
|
function Ne(e) {
|
|
183
183
|
return typeof e == "function";
|
|
184
184
|
}
|
|
185
|
-
|
|
186
|
-
function
|
|
185
|
+
j(Ne, "isFunction");
|
|
186
|
+
function M(e) {
|
|
187
187
|
return e === "indeterminate";
|
|
188
188
|
}
|
|
189
|
-
|
|
189
|
+
j(M, "isIndeterminate");
|
|
190
190
|
function Pe(e) {
|
|
191
|
-
return
|
|
191
|
+
return M(e) ? "indeterminate" : e ? "checked" : "unchecked";
|
|
192
192
|
}
|
|
193
|
-
|
|
193
|
+
j(Pe, "getState");
|
|
194
194
|
//#endregion
|
|
195
|
-
//#region src/
|
|
196
|
-
var Fe =
|
|
195
|
+
//#region src/utils/time.ts
|
|
196
|
+
var Fe = class e {
|
|
197
|
+
ms;
|
|
198
|
+
static fromMilliseconds(t) {
|
|
199
|
+
return t == null ? null : new e(t);
|
|
200
|
+
}
|
|
201
|
+
static fromSeconds(t) {
|
|
202
|
+
return t == null ? null : new e(t * 1e3);
|
|
203
|
+
}
|
|
204
|
+
static now() {
|
|
205
|
+
return new e(Date.now());
|
|
206
|
+
}
|
|
207
|
+
static parse(t) {
|
|
208
|
+
return new e(Date.parse(t));
|
|
209
|
+
}
|
|
210
|
+
constructor(e) {
|
|
211
|
+
this.ms = e;
|
|
212
|
+
}
|
|
213
|
+
toMilliseconds() {
|
|
214
|
+
return this.ms;
|
|
215
|
+
}
|
|
216
|
+
since(e) {
|
|
217
|
+
return this.ms - e.ms;
|
|
218
|
+
}
|
|
219
|
+
toSeconds() {
|
|
220
|
+
return this.ms / 1e3;
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region src/core/executions/select.ts
|
|
197
225
|
function Ie(e) {
|
|
226
|
+
let t = e.outcome;
|
|
227
|
+
return t === null ? null : t.kind;
|
|
228
|
+
}
|
|
229
|
+
function Le(e) {
|
|
230
|
+
return e === null ? null : Fe.parse(e).toMilliseconds();
|
|
231
|
+
}
|
|
232
|
+
function Re(e, t) {
|
|
233
|
+
let n = e.latest.get(t);
|
|
234
|
+
return n === void 0 ? null : e.executions.get(n) ?? null;
|
|
235
|
+
}
|
|
236
|
+
function ze(e, t) {
|
|
237
|
+
return e.executions.latest.get(t) ?? e.results.get(t)?.id ?? null;
|
|
238
|
+
}
|
|
239
|
+
function Be(e, t) {
|
|
240
|
+
let n = Re(e.executions, t), r = e.results.get(t) ?? null, i = e.submissions.has(t) && e.submissions.get(t) === ze(e, t), a = "idle", o = r === null ? null : Le(r.started_at), s = !1;
|
|
241
|
+
n !== null && n.record.status !== "completed" ? (a = n.record.status, o = Le(n.record.started_at) ?? o, s = n.record.outcome !== null) : i && (a = "queued");
|
|
242
|
+
let c = a === "idle", l = c && r !== null && r.started_at !== null && r.completed_at !== null ? Fe.parse(r.completed_at).since(Fe.parse(r.started_at)) : null;
|
|
243
|
+
return {
|
|
244
|
+
status: a,
|
|
245
|
+
blocked: e.blocked.has(t),
|
|
246
|
+
outcome: c && r !== null ? Ie(r) : null,
|
|
247
|
+
startedAt: o,
|
|
248
|
+
duration: l,
|
|
249
|
+
rendered: s
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
function Ve(e) {
|
|
253
|
+
return [...e.executions.values()].filter((e) => e.record.status !== "completed");
|
|
254
|
+
}
|
|
255
|
+
function He(e) {
|
|
256
|
+
return Ve(e).some((e) => e.record.status === "running");
|
|
257
|
+
}
|
|
258
|
+
function Ue(e) {
|
|
259
|
+
let t = Ve(e.executions), n = new Set(t.flatMap((e) => e.record.cell_id === null ? [] : [e.record.cell_id])), r = 0;
|
|
260
|
+
for (let [t, i] of e.submissions) !n.has(t) && i === ze(e, t) && (r += 1);
|
|
261
|
+
return t.length + r;
|
|
262
|
+
}
|
|
263
|
+
//#endregion
|
|
264
|
+
//#region src/core/executions/atoms.ts
|
|
265
|
+
var We = {
|
|
266
|
+
runs: /* @__PURE__ */ new Map(),
|
|
267
|
+
executions: /* @__PURE__ */ new Map(),
|
|
268
|
+
latest: /* @__PURE__ */ new Map()
|
|
269
|
+
}, Ge = /* @__PURE__ */ new Map(), Ke = /* @__PURE__ */ new Map(), qe = /* @__PURE__ */ new Set(), Je = T(null), Ye = T(null);
|
|
270
|
+
function Xe(e, t, n, r) {
|
|
271
|
+
return e !== null && e.notebook.replica === t && e.notebook.id === n ? e.value : r;
|
|
272
|
+
}
|
|
273
|
+
function Ze(e, t) {
|
|
274
|
+
let n = e.get(x), r = n === null ? null : e.get(n.notebookAtom);
|
|
275
|
+
return n === null || r === null ? null : {
|
|
276
|
+
notebook: {
|
|
277
|
+
replica: n,
|
|
278
|
+
id: r.id
|
|
279
|
+
},
|
|
280
|
+
value: t
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
var N = T((e) => {
|
|
284
|
+
let t = e(x), n = t === null ? null : e(t.notebookAtom)?.id ?? null;
|
|
285
|
+
return {
|
|
286
|
+
executions: t === null ? We : e(t.executionsAtom),
|
|
287
|
+
results: t === null ? Ge : e(t.resultsAtom),
|
|
288
|
+
submissions: Xe(e(Je), t, n, Ke),
|
|
289
|
+
blocked: Xe(e(Ye), t, n, qe)
|
|
290
|
+
};
|
|
291
|
+
}), Qe = T((e) => {
|
|
292
|
+
let t = e(x);
|
|
293
|
+
return t === null ? null : e(t.runtimeAtom)?.status ?? null;
|
|
294
|
+
});
|
|
295
|
+
T((e) => He(e(N).executions)), T((e) => Ue(e(N)));
|
|
296
|
+
function $e(e, t) {
|
|
297
|
+
e.set(Je, Ze(e, t));
|
|
298
|
+
}
|
|
299
|
+
function et(e, t) {
|
|
300
|
+
let n = new Map(e.get(N).submissions);
|
|
301
|
+
for (let e of t) n.delete(e);
|
|
302
|
+
$e(e, n);
|
|
303
|
+
}
|
|
304
|
+
function tt(e, t, n) {
|
|
305
|
+
let r = e.get(N).blocked;
|
|
306
|
+
if (r.has(t) === n) return;
|
|
307
|
+
let i = new Set(r);
|
|
308
|
+
n ? i.add(t) : i.delete(t), e.set(Ye, Ze(e, i));
|
|
309
|
+
}
|
|
310
|
+
function nt(e, t) {
|
|
311
|
+
let n = t.cell_id, r = t.status === "disabled-transitively";
|
|
312
|
+
t.status != null && tt(e, n, r), (r || t.output?.mimetype === "application/vnd.marimo+error") && et(e, [n]);
|
|
313
|
+
}
|
|
314
|
+
//#endregion
|
|
315
|
+
//#region src/core/codemirror/editing/commands.ts
|
|
316
|
+
var rt = a();
|
|
317
|
+
function it(e) {
|
|
198
318
|
return (t) => {
|
|
199
319
|
let n = !1;
|
|
200
320
|
for (let r of t) r && (n = e(r) || n);
|
|
201
321
|
return n;
|
|
202
322
|
};
|
|
203
323
|
}
|
|
204
|
-
var
|
|
324
|
+
var at = it(le), ot = it(se);
|
|
205
325
|
//#endregion
|
|
206
326
|
//#region src/utils/schedule-task.ts
|
|
207
|
-
function
|
|
327
|
+
function st() {
|
|
208
328
|
let e = globalThis.scheduler;
|
|
209
329
|
if (typeof e?.postTask == "function") return (t) => {
|
|
210
330
|
e.postTask(t, { priority: "user-visible" }).catch((e) => {
|
|
@@ -225,10 +345,10 @@ function ze() {
|
|
|
225
345
|
setTimeout(e, 0);
|
|
226
346
|
};
|
|
227
347
|
}
|
|
228
|
-
var
|
|
348
|
+
var ct = st();
|
|
229
349
|
//#endregion
|
|
230
350
|
//#region src/core/codemirror/editor-mount-scheduler.ts
|
|
231
|
-
function
|
|
351
|
+
function lt(e = ct) {
|
|
232
352
|
let t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Set(), r = !1;
|
|
233
353
|
function i() {
|
|
234
354
|
r || t.size === 0 || (r = !0, e(o));
|
|
@@ -271,7 +391,7 @@ function Ve(e = Be) {
|
|
|
271
391
|
}
|
|
272
392
|
};
|
|
273
393
|
}
|
|
274
|
-
var
|
|
394
|
+
var ut = lt();
|
|
275
395
|
//#endregion
|
|
276
396
|
//#region src/plugins/core/sanitize-html.ts
|
|
277
397
|
if (typeof document < "u") {
|
|
@@ -282,7 +402,7 @@ if (typeof document < "u") {
|
|
|
282
402
|
t.tagName === "A" && t.hasAttribute(e) && (t.setAttribute("target", t.getAttribute(e) || ""), t.removeAttribute(e), t.getAttribute("target") === "_blank" && t.setAttribute("rel", "noopener noreferrer"));
|
|
283
403
|
});
|
|
284
404
|
}
|
|
285
|
-
function
|
|
405
|
+
function dt(e) {
|
|
286
406
|
let t = {
|
|
287
407
|
USE_PROFILES: {
|
|
288
408
|
html: !0,
|
|
@@ -302,55 +422,55 @@ function Ue(e) {
|
|
|
302
422
|
}
|
|
303
423
|
//#endregion
|
|
304
424
|
//#region src/core/dom/outline.ts
|
|
305
|
-
var
|
|
425
|
+
var ft = [
|
|
306
426
|
"marimo-carousel",
|
|
307
427
|
"marimo-tabs",
|
|
308
428
|
"marimo-accordion",
|
|
309
429
|
"marimo-sidebar"
|
|
310
|
-
],
|
|
311
|
-
function
|
|
430
|
+
], pt = "h1, h2, h3, h4, h5, h6";
|
|
431
|
+
function mt(e) {
|
|
312
432
|
if (typeof DOMParser > "u") return null;
|
|
313
|
-
let t = [], n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(
|
|
433
|
+
let t = [], n = new DOMParser().parseFromString(e, "text/html").querySelectorAll(pt);
|
|
314
434
|
for (let e of Array.from(n)) {
|
|
315
435
|
let n = e.textContent;
|
|
316
|
-
if (
|
|
436
|
+
if (ft.some((t) => e.closest(t)) || !n) continue;
|
|
317
437
|
let r = Number.parseInt(e.tagName[1], 10), i = e.innerHTML, a = {
|
|
318
438
|
name: n,
|
|
319
439
|
level: r,
|
|
320
|
-
by:
|
|
440
|
+
by: gt(e)
|
|
321
441
|
};
|
|
322
|
-
i !== n && (a.html =
|
|
442
|
+
i !== n && (a.html = dt(i)), t.push(a);
|
|
323
443
|
}
|
|
324
444
|
return { items: t };
|
|
325
445
|
}
|
|
326
|
-
function
|
|
446
|
+
function ht(e) {
|
|
327
447
|
if (!e.includes("\"")) return `"${e}"`;
|
|
328
448
|
if (!e.includes("'")) return `'${e}'`;
|
|
329
449
|
let t = e.split("\""), n = [];
|
|
330
450
|
for (let [e, r] of t.entries()) r && n.push(`"${r}"`), e < t.length - 1 && n.push("'\"'");
|
|
331
451
|
return `concat(${n.join(", ")})`;
|
|
332
452
|
}
|
|
333
|
-
function
|
|
453
|
+
function gt(e) {
|
|
334
454
|
let t = e.id;
|
|
335
455
|
if (t) return { id: t };
|
|
336
456
|
let n = e.textContent ?? "";
|
|
337
|
-
return { path: `//${e.tagName}[contains(., ${
|
|
457
|
+
return { path: `//${e.tagName}[contains(., ${ht(n)})]` };
|
|
338
458
|
}
|
|
339
|
-
function
|
|
459
|
+
function _t(e) {
|
|
340
460
|
return { items: e.filter(Boolean).flatMap((e) => e.items) };
|
|
341
461
|
}
|
|
342
|
-
function
|
|
462
|
+
function vt(e) {
|
|
343
463
|
if (e == null || e.mimetype !== "text/html" && e.mimetype !== "text/markdown" || e.data == null) return null;
|
|
344
464
|
try {
|
|
345
|
-
return D(typeof e.data == "string", "expected string"),
|
|
465
|
+
return D(typeof e.data == "string", "expected string"), mt(e.data);
|
|
346
466
|
} catch {
|
|
347
467
|
return t.error("Failed to parse outline"), null;
|
|
348
468
|
}
|
|
349
469
|
}
|
|
350
|
-
function
|
|
470
|
+
function yt(e) {
|
|
351
471
|
return e != null && e.items.some((e) => e.level <= 3);
|
|
352
472
|
}
|
|
353
|
-
function
|
|
473
|
+
function bt(e, n) {
|
|
354
474
|
let r = (e) => e.items.length === 0 ? 7 : Math.min(...e.items.map((e) => e.level)), i = n[e];
|
|
355
475
|
if (i == null || i.items.length === 0) return t.warn("Failed to find a starting outline"), null;
|
|
356
476
|
let a = r(i), o = e + 1;
|
|
@@ -363,38 +483,18 @@ function Qe(e, n) {
|
|
|
363
483
|
}
|
|
364
484
|
//#endregion
|
|
365
485
|
//#region src/core/mime.ts
|
|
366
|
-
function
|
|
486
|
+
function xt(e) {
|
|
367
487
|
return e === "application/vnd.marimo+error";
|
|
368
488
|
}
|
|
369
|
-
function
|
|
489
|
+
function P(e) {
|
|
370
490
|
return e === "application/vnd.marimo+traceback";
|
|
371
491
|
}
|
|
372
|
-
function
|
|
373
|
-
return
|
|
492
|
+
function F(e) {
|
|
493
|
+
return xt(e) || P(e);
|
|
374
494
|
}
|
|
375
495
|
//#endregion
|
|
376
|
-
//#region src/
|
|
377
|
-
var
|
|
378
|
-
ms;
|
|
379
|
-
static fromMilliseconds(t) {
|
|
380
|
-
return t == null ? null : new e(t);
|
|
381
|
-
}
|
|
382
|
-
static fromSeconds(t) {
|
|
383
|
-
return t == null ? null : new e(t * 1e3);
|
|
384
|
-
}
|
|
385
|
-
static now() {
|
|
386
|
-
return new e(Date.now());
|
|
387
|
-
}
|
|
388
|
-
constructor(e) {
|
|
389
|
-
this.ms = e;
|
|
390
|
-
}
|
|
391
|
-
toMilliseconds() {
|
|
392
|
-
return this.ms;
|
|
393
|
-
}
|
|
394
|
-
toSeconds() {
|
|
395
|
-
return this.ms / 1e3;
|
|
396
|
-
}
|
|
397
|
-
}, nt = class e {
|
|
496
|
+
//#region src/components/editor/output/ansi-reduce.ts
|
|
497
|
+
var St = class e {
|
|
398
498
|
lines = [""];
|
|
399
499
|
cursor = {
|
|
400
500
|
row: 0,
|
|
@@ -483,7 +583,7 @@ var tt = class e {
|
|
|
483
583
|
render() {
|
|
484
584
|
return this.lines.join("\n");
|
|
485
585
|
}
|
|
486
|
-
},
|
|
586
|
+
}, Ct = class {
|
|
487
587
|
ESC_REGEX = new RegExp(String.raw`\u001B(?:\[[0-9;]*[A-Za-z]|\([0-9A-Za-z])`, "gu");
|
|
488
588
|
parse(e) {
|
|
489
589
|
let t = [], n = 0;
|
|
@@ -502,9 +602,9 @@ var tt = class e {
|
|
|
502
602
|
value: e.slice(n)
|
|
503
603
|
}), t;
|
|
504
604
|
}
|
|
505
|
-
},
|
|
506
|
-
parser = new
|
|
507
|
-
buffer = new
|
|
605
|
+
}, wt = class {
|
|
606
|
+
parser = new Ct();
|
|
607
|
+
buffer = new St();
|
|
508
608
|
reduce(e) {
|
|
509
609
|
return this.reset(), this.append(e), this.render();
|
|
510
610
|
}
|
|
@@ -520,7 +620,7 @@ var tt = class e {
|
|
|
520
620
|
for (let e of t) e.type === "text" ? this.processText(e.value) : this.buffer.handleEscape(e.value);
|
|
521
621
|
}
|
|
522
622
|
reset() {
|
|
523
|
-
this.buffer = new
|
|
623
|
+
this.buffer = new St();
|
|
524
624
|
}
|
|
525
625
|
render() {
|
|
526
626
|
return this.buffer.render();
|
|
@@ -563,19 +663,19 @@ var tt = class e {
|
|
|
563
663
|
for (let t of e) t >= " " && (n += t);
|
|
564
664
|
return n;
|
|
565
665
|
}
|
|
566
|
-
},
|
|
666
|
+
}, I = class e {
|
|
567
667
|
mimetype;
|
|
568
668
|
channel;
|
|
569
669
|
timestamp;
|
|
570
670
|
code;
|
|
571
671
|
id;
|
|
572
|
-
ansiReducer = new
|
|
672
|
+
ansiReducer = new wt();
|
|
573
673
|
_data;
|
|
574
674
|
get data() {
|
|
575
675
|
return this._data;
|
|
576
676
|
}
|
|
577
677
|
static create(t) {
|
|
578
|
-
let n = new
|
|
678
|
+
let n = new wt();
|
|
579
679
|
return n.append(t.data), new e({
|
|
580
680
|
mimetype: t.mimetype,
|
|
581
681
|
channel: t.channel,
|
|
@@ -610,28 +710,28 @@ var tt = class e {
|
|
|
610
710
|
};
|
|
611
711
|
//#endregion
|
|
612
712
|
//#region src/core/cells/collapseConsoleOutputs.tsx
|
|
613
|
-
function
|
|
713
|
+
function Tt(e, t = 5e3) {
|
|
614
714
|
let n = [...e];
|
|
615
|
-
if (n.length < 2) return
|
|
715
|
+
if (n.length < 2) return At(n.map(Dt), t);
|
|
616
716
|
let r = n[n.length - 1], i = n[n.length - 2];
|
|
617
|
-
return
|
|
717
|
+
return Et(r, i) && (kt(r), kt(i), n[n.length - 2] = Ot(i, r), n.pop()), At(n, t);
|
|
618
718
|
}
|
|
619
|
-
function
|
|
719
|
+
function Et(e, t) {
|
|
620
720
|
let n = e.mimetype === "text/plain" && t.mimetype === "text/plain";
|
|
621
721
|
if (!n) return !1;
|
|
622
722
|
let r = e.channel === t.channel, i = e.channel !== "stdin";
|
|
623
723
|
return n && r && i;
|
|
624
724
|
}
|
|
625
|
-
function
|
|
626
|
-
return e instanceof
|
|
725
|
+
function Dt(e) {
|
|
726
|
+
return e instanceof I ? e : typeof e.data == "string" ? I.create(e) : e;
|
|
627
727
|
}
|
|
628
|
-
function
|
|
629
|
-
return e instanceof
|
|
728
|
+
function Ot(e, t) {
|
|
729
|
+
return e instanceof I ? e.appendData(t.data) : I.create(e).appendData(t.data);
|
|
630
730
|
}
|
|
631
|
-
function
|
|
731
|
+
function kt(e) {
|
|
632
732
|
D(typeof e.data == "string", "expected string output");
|
|
633
733
|
}
|
|
634
|
-
function
|
|
734
|
+
function At(e, t) {
|
|
635
735
|
let n = 0, r;
|
|
636
736
|
for (r = e.length - 1; r >= 0 && n < t; r--) {
|
|
637
737
|
let t = e[r];
|
|
@@ -661,30 +761,16 @@ function ut(e, t) {
|
|
|
661
761
|
}
|
|
662
762
|
//#endregion
|
|
663
763
|
//#region src/core/cells/cell.ts
|
|
664
|
-
function
|
|
764
|
+
function jt(e) {
|
|
665
765
|
return (e.at(-1)?.id ?? 0) + 1;
|
|
666
766
|
}
|
|
667
|
-
function
|
|
767
|
+
function Mt(e) {
|
|
768
|
+
return e == null || e.mimetype !== "application/vnd.marimo+error" || !Array.isArray(e.data) ? [] : e.data.map((e) => e.type);
|
|
769
|
+
}
|
|
770
|
+
function Nt(e, t) {
|
|
668
771
|
let n = { ...e };
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
n.interrupted = !1, n.errored = !1, n.runElapsedTimeMs = null, n.debuggerActive = !1;
|
|
672
|
-
break;
|
|
673
|
-
case "running":
|
|
674
|
-
n.interrupted = !1, e.stopped && (n.output = null), n.status === "queued" && (n.consoleOutputs = []), n.stopped = !1, n.runStartTimestamp = t.timestamp, n.lastRunStartTimestamp = t.timestamp;
|
|
675
|
-
break;
|
|
676
|
-
case "idle":
|
|
677
|
-
e.runStartTimestamp && (n.runElapsedTimeMs = tt.fromSeconds((t.timestamp ?? 0) - e.runStartTimestamp).toMilliseconds(), n.runStartTimestamp = null, n.staleInputs = !1), !e.lastRunStartTimestamp && t.timestamp && (n.lastRunStartTimestamp = t.timestamp), n.debuggerActive = !1;
|
|
678
|
-
break;
|
|
679
|
-
case null: break;
|
|
680
|
-
case "disabled-transitively": break;
|
|
681
|
-
case void 0: break;
|
|
682
|
-
default: u(t.status);
|
|
683
|
-
}
|
|
684
|
-
n.output = t.output ?? n.output, n.staleInputs = t.stale_inputs ?? n.staleInputs, n.status = t.status ?? n.status, t.serialization !== void 0 && (n.serialization = t.serialization);
|
|
685
|
-
let r = !1;
|
|
686
|
-
t.output != null && t.output.mimetype === "application/vnd.marimo+error" && ((n.status === "queued" || n.status === "running") && (n.status = "idle"), D(Array.isArray(t.output.data), "Expected error output data to be an array"), t.output.data.some((e) => e.type === "interruption") ? (n.interrupted = !0, r = !0) : t.output.data.some((e) => e.type.includes("ancestor")) ? n.stopped = !0 : n.errored = !0);
|
|
687
|
-
let i = e.consoleOutputs;
|
|
772
|
+
t.status === "queued" && (n.debuggerActive = !1), t.status === "running" && Mt(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);
|
|
773
|
+
let r = Mt(t.output).includes("interruption"), i = e.consoleOutputs;
|
|
688
774
|
(r || t.status === "idle") && (n.debuggerActive = !1, i = i.map((e) => e.channel === "stdin" ? {
|
|
689
775
|
channel: e.channel,
|
|
690
776
|
mimetype: e.mimetype,
|
|
@@ -694,33 +780,26 @@ function ft(e, t) {
|
|
|
694
780
|
response: e.response ?? ""
|
|
695
781
|
} : e));
|
|
696
782
|
let a = t.console;
|
|
697
|
-
a != null && (i =
|
|
783
|
+
a != null && (i = Tt(Array.isArray(a) ? a.map((e, t) => ({
|
|
698
784
|
...e,
|
|
699
785
|
id: t + 1
|
|
700
786
|
})) : [...i, {
|
|
701
787
|
...a,
|
|
702
|
-
id:
|
|
703
|
-
}])), n.consoleOutputs = i, n.outline =
|
|
788
|
+
id: jt(i)
|
|
789
|
+
}])), n.consoleOutputs = i, n.outline = vt(n.output);
|
|
704
790
|
let o = [t.console].flat().filter(Boolean).filter((e) => e.channel === "pdb");
|
|
705
791
|
return o.length > 0 && o.some((e) => e.data === "start") && (n.debuggerActive = !0), n;
|
|
706
792
|
}
|
|
707
|
-
function
|
|
708
|
-
let t = { ...e };
|
|
709
|
-
return e.status !== "disabled-transitively" && (t.status = "queued"), t.interrupted = !1, t.errored = !1, t.runElapsedTimeMs = null, t.debuggerActive = !1, t;
|
|
710
|
-
}
|
|
711
|
-
function mt(e) {
|
|
793
|
+
function Pt(e) {
|
|
712
794
|
return e === "running" || e === "queued";
|
|
713
795
|
}
|
|
714
|
-
function
|
|
715
|
-
let { status:
|
|
716
|
-
|
|
717
|
-
if (t) return !0;
|
|
718
|
-
let s = mt(n), c = n === "running" && r !== null && i !== null && (r.timestamp ?? 0) > i;
|
|
719
|
-
return s && !c ? !0 : o;
|
|
796
|
+
function Ft(e, t, n) {
|
|
797
|
+
let { status: r, outcome: i, rendered: a } = e;
|
|
798
|
+
return i === "interrupted" ? !1 : n || Pt(r) && !(r === "running" && a) ? !0 : t;
|
|
720
799
|
}
|
|
721
800
|
//#endregion
|
|
722
801
|
//#region src/core/cells/columns.ts
|
|
723
|
-
function
|
|
802
|
+
function It(e) {
|
|
724
803
|
let t = /* @__PURE__ */ new Map(), n = 0;
|
|
725
804
|
for (let r of e.order) {
|
|
726
805
|
let i = e.cells.get(r)?.config.column;
|
|
@@ -728,9 +807,9 @@ function gt(e) {
|
|
|
728
807
|
}
|
|
729
808
|
return t;
|
|
730
809
|
}
|
|
731
|
-
function
|
|
810
|
+
function Lt(e) {
|
|
732
811
|
let t = [[]];
|
|
733
|
-
for (let [n, r] of
|
|
812
|
+
for (let [n, r] of It(e)) {
|
|
734
813
|
for (; t.length <= r;) t.push([]);
|
|
735
814
|
t[r].push(n);
|
|
736
815
|
}
|
|
@@ -738,16 +817,16 @@ function _t(e) {
|
|
|
738
817
|
}
|
|
739
818
|
//#endregion
|
|
740
819
|
//#region src/core/dom/ui-element-constants.ts
|
|
741
|
-
var
|
|
820
|
+
var Rt = "object-id", zt = "random-id", Bt = "abcdefghijklmnopqrstuvwxyz", Vt = Bt + Bt.toUpperCase(), Ht = /* @__PURE__ */ new Set(), L = "__scratch__", Ut = "setup", Wt = { create() {
|
|
742
821
|
let e = 0, t;
|
|
743
822
|
do {
|
|
744
823
|
let n = "";
|
|
745
|
-
for (let e = 0; e < 4; e++) n +=
|
|
824
|
+
for (let e = 0; e < 4; e++) n += Vt[Math.floor(Math.random() * 52)];
|
|
746
825
|
t = n, e++;
|
|
747
|
-
} while (
|
|
826
|
+
} while (Ht.has(t) && e < 100);
|
|
748
827
|
if (e >= 100) throw Error("Failed to generate unique CellId after 100 attempts");
|
|
749
|
-
return
|
|
750
|
-
} },
|
|
828
|
+
return Ht.add(t), t;
|
|
829
|
+
} }, R = {
|
|
751
830
|
create(e) {
|
|
752
831
|
return D(e != null, "cellId is required"), `cell-${e}`;
|
|
753
832
|
},
|
|
@@ -760,7 +839,7 @@ var vt = "object-id", yt = "random-id", bt = "abcdefghijklmnopqrstuvwxyz", xt =
|
|
|
760
839
|
findElementThroughShadowDOMs(e) {
|
|
761
840
|
let t = e;
|
|
762
841
|
for (; t;) {
|
|
763
|
-
let e =
|
|
842
|
+
let e = R.findElement(t);
|
|
764
843
|
if (e) return e;
|
|
765
844
|
let n = t.getRootNode();
|
|
766
845
|
if (t = n instanceof ShadowRoot ? n.host : t.parentElement, t === n) break;
|
|
@@ -768,33 +847,33 @@ var vt = "object-id", yt = "random-id", bt = "abcdefghijklmnopqrstuvwxyz", xt =
|
|
|
768
847
|
return null;
|
|
769
848
|
}
|
|
770
849
|
};
|
|
771
|
-
function
|
|
772
|
-
let t = null, n =
|
|
773
|
-
return n && (t =
|
|
850
|
+
function Gt(e) {
|
|
851
|
+
let t = null, n = R.findElementThroughShadowDOMs(e);
|
|
852
|
+
return n && (t = R.parse(n.id)), t;
|
|
774
853
|
}
|
|
775
|
-
var
|
|
854
|
+
var Kt = {
|
|
776
855
|
parse(e) {
|
|
777
|
-
return e.getAttribute(
|
|
856
|
+
return e.getAttribute(Rt);
|
|
778
857
|
},
|
|
779
858
|
parseOrThrow(e) {
|
|
780
|
-
let t =
|
|
859
|
+
let t = Kt.parse(e);
|
|
781
860
|
return D(t, "<marimo-ui-element/> missing object-id attribute"), t;
|
|
782
861
|
}
|
|
783
|
-
},
|
|
862
|
+
}, qt = { create(e) {
|
|
784
863
|
return `output-${e}`;
|
|
785
|
-
} },
|
|
786
|
-
function
|
|
787
|
-
return `column-${
|
|
864
|
+
} }, Jt = T(/* @__PURE__ */ new Set()), z = T([]), B = T([]);
|
|
865
|
+
function Yt() {
|
|
866
|
+
return `column-${Wt.create()}`;
|
|
788
867
|
}
|
|
789
|
-
var
|
|
790
|
-
let r =
|
|
868
|
+
var Xt = T(null, (e, t, n) => {
|
|
869
|
+
let r = Lt(n).length, i = e(z);
|
|
791
870
|
if (i.length === r) return;
|
|
792
|
-
let a = e(
|
|
793
|
-
for (; o.length < r;) o.push(
|
|
794
|
-
t(
|
|
871
|
+
let a = e(B), o = [...i, ...a].slice(0, r);
|
|
872
|
+
for (; o.length < r;) o.push(Yt());
|
|
873
|
+
t(z, o), t(B, a.slice(Math.max(0, r - i.length)));
|
|
795
874
|
});
|
|
796
|
-
function
|
|
797
|
-
return [...(e === null ? [[]] :
|
|
875
|
+
function Zt(e, t, n) {
|
|
876
|
+
return [...(e === null ? [[]] : Lt(e)).map((e, n) => ({
|
|
798
877
|
id: t[n] ?? `column-${n}`,
|
|
799
878
|
ids: e
|
|
800
879
|
})), ...n.map((e) => ({
|
|
@@ -802,18 +881,18 @@ function At(e, t, n) {
|
|
|
802
881
|
ids: []
|
|
803
882
|
}))];
|
|
804
883
|
}
|
|
805
|
-
function
|
|
884
|
+
function Qt(e, t, n) {
|
|
806
885
|
let r = /* @__PURE__ */ new Map();
|
|
807
886
|
return e.forEach((i, a) => {
|
|
808
887
|
let o = t[a];
|
|
809
888
|
if (!n.has(i) || !o || o.items.length === 0) return;
|
|
810
|
-
let s =
|
|
889
|
+
let s = bt(a, t);
|
|
811
890
|
s !== null && r.set(i, e.slice(a + 1, s[1] + 1));
|
|
812
891
|
}), r;
|
|
813
892
|
}
|
|
814
|
-
function
|
|
893
|
+
function $t(e, t, n) {
|
|
815
894
|
return { columns: e.map(({ id: e, ids: r }) => {
|
|
816
|
-
let i =
|
|
895
|
+
let i = Qt(r, r.map(t), n), a = new Set([...i.values()].flat());
|
|
817
896
|
return {
|
|
818
897
|
id: e,
|
|
819
898
|
ids: r,
|
|
@@ -822,58 +901,58 @@ function Mt(e, t, n) {
|
|
|
822
901
|
};
|
|
823
902
|
}) };
|
|
824
903
|
}
|
|
825
|
-
var
|
|
826
|
-
let t = e(
|
|
827
|
-
return
|
|
828
|
-
}),
|
|
829
|
-
function
|
|
904
|
+
var en = T((e) => {
|
|
905
|
+
let t = e(re), n = t === null ? null : e(t.documentAtom), r = e(ni);
|
|
906
|
+
return $t(Zt(n, e(z), e(B)), (e) => r[e] ?? null, e(Jt));
|
|
907
|
+
}), tn = () => E(en), nn = T((e) => e(en).columns.length);
|
|
908
|
+
function rn(e, t) {
|
|
830
909
|
return e.columns.find((e) => e.id === t);
|
|
831
910
|
}
|
|
832
|
-
function
|
|
911
|
+
function an(e, t) {
|
|
833
912
|
let n = e.columns.find((e) => e.ids.includes(t));
|
|
834
913
|
if (n === void 0) throw Error(`Cell ${t} is not in the layout`);
|
|
835
914
|
return n;
|
|
836
915
|
}
|
|
837
|
-
function
|
|
916
|
+
function on(e, t) {
|
|
838
917
|
for (let n of e.columns) {
|
|
839
918
|
let e = n.folds.get(t);
|
|
840
919
|
if (e !== void 0) return e;
|
|
841
920
|
}
|
|
842
921
|
}
|
|
843
|
-
function
|
|
922
|
+
function sn(e, t) {
|
|
844
923
|
let n = e.columns.find((e) => e.ids.includes(t));
|
|
845
924
|
return n === void 0 ? [] : [...n.folds].filter(([, e]) => e.includes(t)).map(([e]) => e);
|
|
846
925
|
}
|
|
847
|
-
function
|
|
848
|
-
let n =
|
|
849
|
-
return
|
|
926
|
+
function cn(e, t) {
|
|
927
|
+
let n = sn(e, t);
|
|
928
|
+
return on(e, t) === void 0 ? n : [...n, t];
|
|
850
929
|
}
|
|
851
|
-
var
|
|
852
|
-
function
|
|
930
|
+
var ln = /* @__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("."));
|
|
931
|
+
function un(e, t = !0) {
|
|
853
932
|
return e = e.trim(), e ? (/^\d/.test(e) && (e = `_${e}`), e = e.replaceAll(/\W/g, "_"), t ? e.toLowerCase() : e) : "_";
|
|
854
933
|
}
|
|
855
|
-
function
|
|
856
|
-
let n = new Set(t), r = e, i = (e) => !n.has(e) && !
|
|
934
|
+
function dn(e, t) {
|
|
935
|
+
let n = new Set(t), r = e, i = (e) => !n.has(e) && !ln.has(e);
|
|
857
936
|
if (i(e)) return e;
|
|
858
937
|
let a = 1;
|
|
859
938
|
for (; !i(r);) r = `${e}_${a}`, a++;
|
|
860
939
|
return r;
|
|
861
940
|
}
|
|
862
|
-
function
|
|
863
|
-
return
|
|
941
|
+
function fn(e, t) {
|
|
942
|
+
return pn(e) ? `cell-${t}` : e;
|
|
864
943
|
}
|
|
865
|
-
function
|
|
944
|
+
function pn(e) {
|
|
866
945
|
return !e || e === "_" || e === "__";
|
|
867
946
|
}
|
|
868
947
|
//#endregion
|
|
869
948
|
//#region src/core/cells/types.ts
|
|
870
|
-
function
|
|
949
|
+
function V(e, t) {
|
|
871
950
|
return e === null ? t.trim().length > 0 : e.trim() !== t.trim();
|
|
872
951
|
}
|
|
873
|
-
function
|
|
952
|
+
function mn({ id: e, name: t = "_", code: n = "", lastCodeRun: r = null, edited: i = !1, config: a }) {
|
|
874
953
|
return {
|
|
875
954
|
id: e,
|
|
876
|
-
config:
|
|
955
|
+
config: a || {
|
|
877
956
|
hide_code: !1,
|
|
878
957
|
disabled: !1,
|
|
879
958
|
column: null,
|
|
@@ -881,12 +960,11 @@ function Gt({ id: e, name: t = "_", code: n = "", lastCodeRun: r = null, lastExe
|
|
|
881
960
|
},
|
|
882
961
|
name: t,
|
|
883
962
|
code: n,
|
|
884
|
-
edited:
|
|
885
|
-
lastCodeRun: r
|
|
886
|
-
lastExecutionTime: i
|
|
963
|
+
edited: i,
|
|
964
|
+
lastCodeRun: r
|
|
887
965
|
};
|
|
888
966
|
}
|
|
889
|
-
function
|
|
967
|
+
function hn(e) {
|
|
890
968
|
return {
|
|
891
969
|
hide_code: !1,
|
|
892
970
|
disabled: !1,
|
|
@@ -895,27 +973,20 @@ function Kt(e) {
|
|
|
895
973
|
...e
|
|
896
974
|
};
|
|
897
975
|
}
|
|
898
|
-
function
|
|
976
|
+
function gn(e) {
|
|
899
977
|
return {
|
|
900
978
|
outline: null,
|
|
901
979
|
output: null,
|
|
902
980
|
consoleOutputs: [],
|
|
903
|
-
status: "idle",
|
|
904
981
|
staleInputs: !1,
|
|
905
|
-
interrupted: !1,
|
|
906
|
-
errored: !1,
|
|
907
|
-
stopped: !1,
|
|
908
|
-
runElapsedTimeMs: null,
|
|
909
|
-
runStartTimestamp: null,
|
|
910
|
-
lastRunStartTimestamp: null,
|
|
911
982
|
debuggerActive: !1,
|
|
912
983
|
...e
|
|
913
984
|
};
|
|
914
985
|
}
|
|
915
986
|
//#endregion
|
|
916
987
|
//#region src/core/cells/document.ts
|
|
917
|
-
function
|
|
918
|
-
let n = t.code ?? e.code, r = S(e.config, t.config) ? e.config :
|
|
988
|
+
function _n(e, t) {
|
|
989
|
+
let n = t.code ?? e.code, r = S(e.config, t.config) ? e.config : hn(t.config);
|
|
919
990
|
return n === e.code && t.name === e.name && r === e.config ? e : n === e.code ? {
|
|
920
991
|
...e,
|
|
921
992
|
name: t.name,
|
|
@@ -925,10 +996,10 @@ function qt(e, t) {
|
|
|
925
996
|
code: n,
|
|
926
997
|
name: t.name,
|
|
927
998
|
config: r,
|
|
928
|
-
edited:
|
|
999
|
+
edited: V(e.lastCodeRun, n)
|
|
929
1000
|
};
|
|
930
1001
|
}
|
|
931
|
-
function
|
|
1002
|
+
function vn(e, t) {
|
|
932
1003
|
let n = S(t.order, e.cellIds) ? e.cellIds : [...t.order], { cellData: r, cellRuntime: i, cellHandles: a } = e;
|
|
933
1004
|
for (let o of n) {
|
|
934
1005
|
let n = t.cells.get(o), s = e.cellData[o];
|
|
@@ -937,23 +1008,23 @@ function Jt(e, t) {
|
|
|
937
1008
|
let e = n.code ?? "";
|
|
938
1009
|
r = {
|
|
939
1010
|
...r,
|
|
940
|
-
[o]:
|
|
1011
|
+
[o]: mn({
|
|
941
1012
|
id: o,
|
|
942
1013
|
code: e,
|
|
943
1014
|
name: n.name,
|
|
944
|
-
config:
|
|
945
|
-
edited:
|
|
1015
|
+
config: hn(n.config),
|
|
1016
|
+
edited: V(null, e)
|
|
946
1017
|
})
|
|
947
1018
|
}, i = {
|
|
948
1019
|
...i,
|
|
949
|
-
[o]: i[o] ??
|
|
1020
|
+
[o]: i[o] ?? gn()
|
|
950
1021
|
}, a = {
|
|
951
1022
|
...a,
|
|
952
|
-
[o]: (0,
|
|
1023
|
+
[o]: (0, k.createRef)()
|
|
953
1024
|
};
|
|
954
1025
|
continue;
|
|
955
1026
|
}
|
|
956
|
-
let c =
|
|
1027
|
+
let c = _n(s, n);
|
|
957
1028
|
c !== s && (r = {
|
|
958
1029
|
...r,
|
|
959
1030
|
[o]: c
|
|
@@ -972,21 +1043,21 @@ function Jt(e, t) {
|
|
|
972
1043
|
cellHandles: a
|
|
973
1044
|
};
|
|
974
1045
|
}
|
|
975
|
-
function
|
|
1046
|
+
function yn({ store: e, model: t, reconcile: n, signal: r }) {
|
|
976
1047
|
let i = () => {
|
|
977
1048
|
let r = e.get(t.documentAtom);
|
|
978
|
-
r !== null && (n(r), e.set(
|
|
1049
|
+
r !== null && (n(r), e.set(Xt, r));
|
|
979
1050
|
}, a = e.sub(t.documentAtom, i);
|
|
980
1051
|
r.addEventListener("abort", a, { once: !0 }), i();
|
|
981
1052
|
}
|
|
982
|
-
async function
|
|
983
|
-
let e =
|
|
984
|
-
e !== null &&
|
|
1053
|
+
async function bn() {
|
|
1054
|
+
let e = w.get(re);
|
|
1055
|
+
e !== null && w.get(e.syncStatusAtom).status !== "unavailable" && await e.flush();
|
|
985
1056
|
}
|
|
986
1057
|
//#endregion
|
|
987
1058
|
//#region src/core/cells/editor.ts
|
|
988
1059
|
var H = T(/* @__PURE__ */ new Set());
|
|
989
|
-
function
|
|
1060
|
+
function xn(e, t, n) {
|
|
990
1061
|
return !!e && !t.has(n);
|
|
991
1062
|
}
|
|
992
1063
|
T(null, (e, t, { cellId: n }) => {
|
|
@@ -995,27 +1066,27 @@ T(null, (e, t, { cellId: n }) => {
|
|
|
995
1066
|
let t = new Set(e);
|
|
996
1067
|
return t.delete(n), t;
|
|
997
1068
|
}), !0) : !1);
|
|
998
|
-
var
|
|
1069
|
+
var Sn = T(/* @__PURE__ */ new Map());
|
|
999
1070
|
T(null, (e, t, { cellId: n }) => {
|
|
1000
|
-
t(
|
|
1071
|
+
t(Sn, (e) => {
|
|
1001
1072
|
let t = new Map(e);
|
|
1002
1073
|
return t.delete(n), t;
|
|
1003
1074
|
});
|
|
1004
1075
|
});
|
|
1005
1076
|
//#endregion
|
|
1006
1077
|
//#region ../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/fromUnixTime.js
|
|
1007
|
-
function
|
|
1078
|
+
function Cn(e, t) {
|
|
1008
1079
|
return he(e * 1e3, t?.in);
|
|
1009
1080
|
}
|
|
1010
1081
|
//#endregion
|
|
1011
1082
|
//#region ../node_modules/.pnpm/ansi_up@6.0.6/node_modules/ansi_up/ansi_up.js
|
|
1012
|
-
var
|
|
1083
|
+
var wn = function(e, t) {
|
|
1013
1084
|
return Object.defineProperty ? Object.defineProperty(e, "raw", { value: t }) : e.raw = t, e;
|
|
1014
1085
|
}, U;
|
|
1015
1086
|
(function(e) {
|
|
1016
1087
|
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";
|
|
1017
1088
|
})(U ||= {});
|
|
1018
|
-
var
|
|
1089
|
+
var Tn = class {
|
|
1019
1090
|
constructor() {
|
|
1020
1091
|
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 = {
|
|
1021
1092
|
http: 1,
|
|
@@ -1260,7 +1331,7 @@ var tn = class {
|
|
|
1260
1331
|
var r = this._buffer.charAt(1);
|
|
1261
1332
|
if (r != "[" && r != "]" && r != "(") return e.kind = U.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1262
1333
|
if (r == "[") {
|
|
1263
|
-
this._csi_regex ||=
|
|
1334
|
+
this._csi_regex ||= En(On ||= wn(["\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 "]));
|
|
1264
1335
|
let t = this._buffer.match(this._csi_regex);
|
|
1265
1336
|
if (t === null) return e.kind = U.Incomplete, e;
|
|
1266
1337
|
if (t[4]) return e.kind = U.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
@@ -1271,7 +1342,7 @@ var tn = class {
|
|
|
1271
1342
|
if (r == "]") {
|
|
1272
1343
|
if (t < 4) return e.kind = U.Incomplete, e;
|
|
1273
1344
|
if (this._buffer.charAt(2) != "8" || this._buffer.charAt(3) != ";") return e.kind = U.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1274
|
-
this._osc_st ||=
|
|
1345
|
+
this._osc_st ||= Dn(kn ||= wn(["\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;
|
|
1275
1346
|
{
|
|
1276
1347
|
let t = this._osc_st.exec(this._buffer);
|
|
1277
1348
|
if (t === null) return e.kind = U.Incomplete, e;
|
|
@@ -1282,7 +1353,7 @@ var tn = class {
|
|
|
1282
1353
|
if (t === null) return e.kind = U.Incomplete, e;
|
|
1283
1354
|
if (t[3]) return e.kind = U.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1284
1355
|
}
|
|
1285
|
-
this._osc_regex ||=
|
|
1356
|
+
this._osc_regex ||= En(An ||= wn(["\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 "]));
|
|
1286
1357
|
let n = this._buffer.match(this._osc_regex);
|
|
1287
1358
|
if (n === null) return e.kind = U.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
1288
1359
|
e.kind = U.OSCURL, e.url = n[1], e.text = n[2];
|
|
@@ -1367,15 +1438,15 @@ var tn = class {
|
|
|
1367
1438
|
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>`;
|
|
1368
1439
|
}
|
|
1369
1440
|
};
|
|
1370
|
-
function
|
|
1441
|
+
function En(e, ...t) {
|
|
1371
1442
|
let n = e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm, "");
|
|
1372
1443
|
return new RegExp(n);
|
|
1373
1444
|
}
|
|
1374
|
-
function
|
|
1445
|
+
function Dn(e, ...t) {
|
|
1375
1446
|
let n = e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm, "");
|
|
1376
1447
|
return new RegExp(n, "g");
|
|
1377
1448
|
}
|
|
1378
|
-
var
|
|
1449
|
+
var On, kn, An, jn = new Tn();
|
|
1379
1450
|
function W(e) {
|
|
1380
1451
|
try {
|
|
1381
1452
|
let t = document.createElement("div");
|
|
@@ -1384,24 +1455,24 @@ function W(e) {
|
|
|
1384
1455
|
return t.error("Error parsing HTML content:", n), e;
|
|
1385
1456
|
}
|
|
1386
1457
|
}
|
|
1387
|
-
function
|
|
1458
|
+
function Mn(e) {
|
|
1388
1459
|
if (!e) return "";
|
|
1389
1460
|
try {
|
|
1390
|
-
return W(
|
|
1461
|
+
return W(jn.ansi_to_html(e));
|
|
1391
1462
|
} catch (n) {
|
|
1392
1463
|
return t.error("Error converting ANSI to plain text:", n), e;
|
|
1393
1464
|
}
|
|
1394
1465
|
}
|
|
1395
1466
|
//#endregion
|
|
1396
1467
|
//#region src/core/errors/traceback-atom.ts
|
|
1397
|
-
var
|
|
1468
|
+
var Nn = T(null);
|
|
1398
1469
|
//#endregion
|
|
1399
1470
|
//#region src/core/cells/logs.ts
|
|
1400
|
-
function
|
|
1471
|
+
function Pn(e) {
|
|
1401
1472
|
return e.type === "cell" ? e.cellId : `lsp:${e.name}`;
|
|
1402
1473
|
}
|
|
1403
|
-
var
|
|
1404
|
-
function
|
|
1474
|
+
var Fn = !1;
|
|
1475
|
+
function In(e) {
|
|
1405
1476
|
let t = [], n = [e.console].filter(Boolean).flat();
|
|
1406
1477
|
for (let r of n) {
|
|
1407
1478
|
let n = r.mimetype === "text/plain", i = r.mimetype === "text/html" || r.mimetype === "application/vnd.marimo+traceback";
|
|
@@ -1426,9 +1497,9 @@ function pn(e) {
|
|
|
1426
1497
|
}
|
|
1427
1498
|
}
|
|
1428
1499
|
}
|
|
1429
|
-
if (t.forEach(
|
|
1500
|
+
if (t.forEach(Ln.log), n.length === 0 && F(e.output?.mimetype) && Array.isArray(e.output.data)) {
|
|
1430
1501
|
e.output.data.forEach((t) => {
|
|
1431
|
-
|
|
1502
|
+
Ln.log({
|
|
1432
1503
|
level: "stderr",
|
|
1433
1504
|
source: {
|
|
1434
1505
|
type: "cell",
|
|
@@ -1438,18 +1509,18 @@ function pn(e) {
|
|
|
1438
1509
|
message: JSON.stringify(t)
|
|
1439
1510
|
});
|
|
1440
1511
|
});
|
|
1441
|
-
let t = e.output.data.filter((e) => "type" in e && e.type === "exception" || e.type === "internal"), n =
|
|
1442
|
-
if (t.length > 0 && !
|
|
1443
|
-
|
|
1512
|
+
let t = e.output.data.filter((e) => "type" in e && e.type === "exception" || e.type === "internal"), n = w.get(fe) === "read";
|
|
1513
|
+
if (t.length > 0 && !Fn && n) {
|
|
1514
|
+
Fn = !0;
|
|
1444
1515
|
let e = t.find((e) => e.traceback);
|
|
1445
1516
|
o(e ? {
|
|
1446
1517
|
title: "An internal error occurred",
|
|
1447
1518
|
description: e.msg || "Click 'View' to see traceback",
|
|
1448
1519
|
variant: "danger",
|
|
1449
|
-
action:
|
|
1520
|
+
action: k.createElement(_, {
|
|
1450
1521
|
altText: "View traceback",
|
|
1451
1522
|
onClick: () => {
|
|
1452
|
-
|
|
1523
|
+
w.set(Nn, {
|
|
1453
1524
|
traceback: e.traceback,
|
|
1454
1525
|
errorMessage: e.msg || "An internal error occurred"
|
|
1455
1526
|
});
|
|
@@ -1464,13 +1535,13 @@ function pn(e) {
|
|
|
1464
1535
|
}
|
|
1465
1536
|
return t;
|
|
1466
1537
|
}
|
|
1467
|
-
var
|
|
1538
|
+
var Ln = { log: (e) => {
|
|
1468
1539
|
let t = e.level === "stdout" ? "gray" : e.level === "stderr" ? "red" : "orange", n = e.level.toUpperCase();
|
|
1469
|
-
console.log(`%c[${n}]`, `color:${t}; padding:2px 0; border-radius:2px; font-weight:bold`, `[${
|
|
1540
|
+
console.log(`%c[${n}]`, `color:${t}; padding:2px 0; border-radius:2px; font-weight:bold`, `[${Rn(e.timestamp)}]`, `(${Pn(e.source)}) ${e.message}`);
|
|
1470
1541
|
} };
|
|
1471
|
-
function
|
|
1542
|
+
function Rn(e) {
|
|
1472
1543
|
try {
|
|
1473
|
-
return
|
|
1544
|
+
return Cn(e).toLocaleTimeString(void 0, {
|
|
1474
1545
|
hour12: !0,
|
|
1475
1546
|
hour: "numeric",
|
|
1476
1547
|
minute: "numeric",
|
|
@@ -1482,14 +1553,14 @@ function hn(e) {
|
|
|
1482
1553
|
}
|
|
1483
1554
|
//#endregion
|
|
1484
1555
|
//#region src/components/editor/navigation/focus-utils.ts
|
|
1485
|
-
function
|
|
1486
|
-
let r = document.getElementById(
|
|
1487
|
-
r ?
|
|
1556
|
+
function zn(e, n) {
|
|
1557
|
+
let r = document.getElementById(R.create(e));
|
|
1558
|
+
r ? Vn(r, n) : t.warn(`[CellFocusManager] focusCell: element not found: ${e}`);
|
|
1488
1559
|
}
|
|
1489
|
-
function
|
|
1560
|
+
function Bn() {
|
|
1490
1561
|
return document.activeElement instanceof HTMLElement && document.activeElement.classList.contains("marimo-cell");
|
|
1491
1562
|
}
|
|
1492
|
-
function
|
|
1563
|
+
function Vn(e, n) {
|
|
1493
1564
|
try {
|
|
1494
1565
|
e.focus(n);
|
|
1495
1566
|
} catch {
|
|
@@ -1498,7 +1569,7 @@ function vn(e, n) {
|
|
|
1498
1569
|
}
|
|
1499
1570
|
//#endregion
|
|
1500
1571
|
//#region src/utils/timeout.ts
|
|
1501
|
-
function
|
|
1572
|
+
function Hn(e, n) {
|
|
1502
1573
|
let { retries: r, delay: i, initialDelay: a = 0 } = n, o = 0, s = () => {
|
|
1503
1574
|
if (o < r) {
|
|
1504
1575
|
try {
|
|
@@ -1513,73 +1584,64 @@ function yn(e, n) {
|
|
|
1513
1584
|
}
|
|
1514
1585
|
//#endregion
|
|
1515
1586
|
//#region src/core/cells/utils.ts
|
|
1516
|
-
function
|
|
1517
|
-
return
|
|
1587
|
+
function Un(e, t) {
|
|
1588
|
+
return Yn(e, t).length > 0;
|
|
1518
1589
|
}
|
|
1519
|
-
function
|
|
1520
|
-
return Object.values(e.cellRuntime).filter((e) => e.status === "running" || e.status === "queued").length;
|
|
1521
|
-
}
|
|
1522
|
-
function Sn(e) {
|
|
1523
|
-
return On(e).length > 0;
|
|
1524
|
-
}
|
|
1525
|
-
function Cn(e) {
|
|
1590
|
+
function Wn(e) {
|
|
1526
1591
|
return e.cellIds.map((t) => e.cellData[t]);
|
|
1527
1592
|
}
|
|
1528
|
-
function
|
|
1593
|
+
function Gn(e) {
|
|
1529
1594
|
let { cellIds: t, cellData: n } = e, r = [];
|
|
1530
1595
|
for (let e of t) n[e].config.disabled && r.push(e);
|
|
1531
1596
|
return r;
|
|
1532
1597
|
}
|
|
1533
|
-
function
|
|
1598
|
+
function Kn(e) {
|
|
1534
1599
|
let { cellIds: t, cellData: n } = e, r = [];
|
|
1535
1600
|
for (let e of t) n[e].config.disabled || r.push(e);
|
|
1536
1601
|
return r;
|
|
1537
1602
|
}
|
|
1538
|
-
function
|
|
1603
|
+
function qn(e) {
|
|
1539
1604
|
return e.history.length > 0;
|
|
1540
1605
|
}
|
|
1541
|
-
function
|
|
1606
|
+
function Jn(e) {
|
|
1542
1607
|
let t = e.history[e.history.length - 1];
|
|
1543
1608
|
return t && t.type === "move" ? "Undo move" : "Undo cell deletion";
|
|
1544
1609
|
}
|
|
1545
|
-
function
|
|
1546
|
-
let { cellIds:
|
|
1547
|
-
return
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
interrupted: r[e].interrupted,
|
|
1552
|
-
stopped: r[e].stopped
|
|
1553
|
-
}) || n[e].edited || r[e].interrupted || r[e].staleInputs && !(r[e].status === "disabled-transitively" || n[e].config.disabled));
|
|
1610
|
+
function Yn(e, t) {
|
|
1611
|
+
let { cellIds: n, cellData: r, cellRuntime: i } = e;
|
|
1612
|
+
return n.filter((e) => {
|
|
1613
|
+
let n = Be(t, e);
|
|
1614
|
+
return Xn(n) || r[e].edited || n.outcome === "interrupted" || i[e].staleInputs && !(n.blocked || r[e].config.disabled);
|
|
1615
|
+
});
|
|
1554
1616
|
}
|
|
1555
|
-
function
|
|
1556
|
-
return
|
|
1617
|
+
function Xn({ status: e, outcome: t }) {
|
|
1618
|
+
return t === null && e !== "queued" && e !== "running";
|
|
1557
1619
|
}
|
|
1558
|
-
function
|
|
1620
|
+
function Zn({ errored: e, stopped: t }) {
|
|
1559
1621
|
return {
|
|
1560
1622
|
published: !0,
|
|
1561
1623
|
"has-error": e,
|
|
1562
1624
|
stopped: t
|
|
1563
1625
|
};
|
|
1564
1626
|
}
|
|
1565
|
-
function
|
|
1566
|
-
let a =
|
|
1627
|
+
function Qn({ errored: e, interrupted: t, stopped: n, output: r, showErrorTracebacks: i }) {
|
|
1628
|
+
let a = F(r?.mimetype), o = i && a && Array.isArray(r?.data) && r.data.some((e) => e.type === "exception" && "traceback" in e && e.traceback);
|
|
1567
1629
|
return (e || t || n || a) && !o;
|
|
1568
1630
|
}
|
|
1569
1631
|
//#endregion
|
|
1570
1632
|
//#region src/core/network/requests.ts
|
|
1571
|
-
var
|
|
1572
|
-
function
|
|
1573
|
-
let e = E(
|
|
1633
|
+
var $n = T(null);
|
|
1634
|
+
function er() {
|
|
1635
|
+
let e = E($n);
|
|
1574
1636
|
return D(e, "useRequestClient() requires setting requestClientAtom."), e;
|
|
1575
1637
|
}
|
|
1576
|
-
function
|
|
1577
|
-
let e =
|
|
1638
|
+
function tr() {
|
|
1639
|
+
let e = w.get($n);
|
|
1578
1640
|
return D(e, "getRequestClient() requires requestClientAtom to be set."), e;
|
|
1579
1641
|
}
|
|
1580
1642
|
//#endregion
|
|
1581
1643
|
//#region src/utils/storage/storage.ts
|
|
1582
|
-
var
|
|
1644
|
+
var nr = class {
|
|
1583
1645
|
store = /* @__PURE__ */ new Map();
|
|
1584
1646
|
get length() {
|
|
1585
1647
|
return this.store.size;
|
|
@@ -1600,16 +1662,16 @@ var Fn = class {
|
|
|
1600
1662
|
this.store.set(e, t);
|
|
1601
1663
|
}
|
|
1602
1664
|
};
|
|
1603
|
-
function
|
|
1665
|
+
function rr() {
|
|
1604
1666
|
let { hasLocalStorage: e, hasSessionStorage: t } = ge();
|
|
1605
|
-
return e ? window.localStorage : t ? window.sessionStorage : new
|
|
1667
|
+
return e ? window.localStorage : t ? window.sessionStorage : new nr();
|
|
1606
1668
|
}
|
|
1607
|
-
var
|
|
1608
|
-
function
|
|
1609
|
-
return
|
|
1669
|
+
var ir = rr(), ar = /(https?:\/\/[^\s"<>`{}|\\^]+)/, or = /\.(png|jpe?g|gif|webp|svg|ico)(\?.*)?$/i, sr = /^data:image\//i, cr = ["avatars.githubusercontent.com"];
|
|
1670
|
+
function lr(e) {
|
|
1671
|
+
return sr.test(e) ? [{
|
|
1610
1672
|
type: "image",
|
|
1611
1673
|
url: e
|
|
1612
|
-
}] : e.split(
|
|
1674
|
+
}] : e.split(ar).filter((e) => e !== "").map((e) => ar.test(e) ? or.test(e) || sr.test(e) || cr.some((t) => e.includes(t)) ? {
|
|
1613
1675
|
type: "image",
|
|
1614
1676
|
url: e
|
|
1615
1677
|
} : {
|
|
@@ -1622,48 +1684,48 @@ function Hn(e) {
|
|
|
1622
1684
|
}
|
|
1623
1685
|
//#endregion
|
|
1624
1686
|
//#region src/utils/json/json-parser.ts
|
|
1625
|
-
var
|
|
1687
|
+
var ur = new RegExp(ar.source, "g");
|
|
1626
1688
|
BigInt.prototype.toJSON = function() {
|
|
1627
1689
|
return JSON.rawJSON(this.toString());
|
|
1628
1690
|
};
|
|
1629
|
-
function
|
|
1691
|
+
function dr(e) {
|
|
1630
1692
|
try {
|
|
1631
|
-
return JSON.parse(e, (e, t) =>
|
|
1693
|
+
return JSON.parse(e, (e, t) => hr(t));
|
|
1632
1694
|
} catch {}
|
|
1633
1695
|
if (e == null || e === "") return {};
|
|
1634
1696
|
try {
|
|
1635
|
-
return e ??= "", e = e.replaceAll(/(?<=\s|^|\[|,|:)(NaN|-Infinity|Infinity)(?=(?:[^"'\\]*(\\.|'([^'\\]*\\.)*[^'\\]*'|"([^"\\]*\\.)*[^"\\]*"))*[^"']*$)/g, "\"◐$1◐\""), JSON.parse(e, (e, t) => typeof t == "string" ? t === "◐NaN◐" ? NaN : t === "◐Infinity◐" ? Infinity : t === "◐-Infinity◐" ? -Infinity :
|
|
1697
|
+
return e ??= "", e = e.replaceAll(/(?<=\s|^|\[|,|:)(NaN|-Infinity|Infinity)(?=(?:[^"'\\]*(\\.|'([^'\\]*\\.)*[^'\\]*'|"([^"\\]*\\.)*[^"\\]*"))*[^"']*$)/g, "\"◐$1◐\""), JSON.parse(e, (e, t) => typeof t == "string" ? t === "◐NaN◐" ? NaN : t === "◐Infinity◐" ? Infinity : t === "◐-Infinity◐" ? -Infinity : hr(t) : hr(t));
|
|
1636
1698
|
} catch {
|
|
1637
1699
|
return {};
|
|
1638
1700
|
}
|
|
1639
1701
|
}
|
|
1640
|
-
function
|
|
1702
|
+
function fr(e) {
|
|
1641
1703
|
if (e.length === 0) return "";
|
|
1642
1704
|
let t = Object.keys(e[0]);
|
|
1643
1705
|
return [
|
|
1644
1706
|
`| ${t.join(" | ")} |`,
|
|
1645
1707
|
`|${t.map(() => "---").join("|")}|`,
|
|
1646
|
-
...e.map((e) => `| ${t.map((t) =>
|
|
1708
|
+
...e.map((e) => `| ${t.map((t) => pr(e[t])).join(" | ")} |`)
|
|
1647
1709
|
].join("\n");
|
|
1648
1710
|
}
|
|
1649
|
-
function
|
|
1711
|
+
function pr(e) {
|
|
1650
1712
|
if (e == null) return "";
|
|
1651
|
-
if (Array.isArray(e) || typeof e == "object") return
|
|
1713
|
+
if (Array.isArray(e) || typeof e == "object") return mr(JSON.stringify(e));
|
|
1652
1714
|
let t = String(e), n = /\[([^\]]+)]\((https?:\/\/[^)]+)\)/g, r = /* @__PURE__ */ new Map(), i = 0;
|
|
1653
1715
|
t = t.replaceAll(n, (e) => {
|
|
1654
1716
|
let t = `__MDLINK_${i++}__`;
|
|
1655
1717
|
return r.set(t, e), t;
|
|
1656
|
-
}), t = t.replaceAll(
|
|
1718
|
+
}), t = t.replaceAll(ur, "[$1]($1)");
|
|
1657
1719
|
for (let [e, n] of r) t = t.replace(e, n);
|
|
1658
|
-
return
|
|
1720
|
+
return mr(t);
|
|
1659
1721
|
}
|
|
1660
|
-
function
|
|
1722
|
+
function mr(e) {
|
|
1661
1723
|
return e.replaceAll("\\", "\\\\").replaceAll("|", "\\|").replaceAll("\n", " ").replaceAll("\r", "");
|
|
1662
1724
|
}
|
|
1663
|
-
function
|
|
1725
|
+
function hr(e) {
|
|
1664
1726
|
return typeof e == "object" && e && "$bigint" in e && typeof e.$bigint == "string" ? BigInt(e.$bigint) : e;
|
|
1665
1727
|
}
|
|
1666
|
-
var
|
|
1728
|
+
var gr = new class {
|
|
1667
1729
|
getFilename() {
|
|
1668
1730
|
return this.getSearchParam("filename");
|
|
1669
1731
|
}
|
|
@@ -1690,20 +1752,20 @@ var Yn = new class {
|
|
|
1690
1752
|
}();
|
|
1691
1753
|
//#endregion
|
|
1692
1754
|
//#region src/core/dom/htmlUtils.ts
|
|
1693
|
-
function
|
|
1694
|
-
return
|
|
1755
|
+
function _r(e) {
|
|
1756
|
+
return dr(e ?? "");
|
|
1695
1757
|
}
|
|
1696
|
-
function
|
|
1697
|
-
return
|
|
1758
|
+
function vr(e) {
|
|
1759
|
+
return O.mapValues(e.dataset, (e) => typeof e == "string" ? _r(e) : e);
|
|
1698
1760
|
}
|
|
1699
|
-
function
|
|
1700
|
-
let n = e.parentElement ?
|
|
1701
|
-
return n && t.has(n) ? t.lookupValue(n) :
|
|
1761
|
+
function yr(e, t) {
|
|
1762
|
+
let n = e.parentElement ? Kt.parse(e.parentElement) : void 0;
|
|
1763
|
+
return n && t.has(n) ? t.lookupValue(n) : _r(e.dataset.initialValue);
|
|
1702
1764
|
}
|
|
1703
|
-
function
|
|
1765
|
+
function br() {
|
|
1704
1766
|
if (ne()) return document.title || null;
|
|
1705
1767
|
if (me()) {
|
|
1706
|
-
let e =
|
|
1768
|
+
let e = gr.getFilename();
|
|
1707
1769
|
if (e) return e;
|
|
1708
1770
|
}
|
|
1709
1771
|
let e = document.querySelector("marimo-filename");
|
|
@@ -1713,16 +1775,16 @@ function $n() {
|
|
|
1713
1775
|
}
|
|
1714
1776
|
//#endregion
|
|
1715
1777
|
//#region src/core/saving/file-state.ts
|
|
1716
|
-
var G = T(
|
|
1778
|
+
var G = T(br());
|
|
1717
1779
|
T(null);
|
|
1718
|
-
var
|
|
1780
|
+
var xr = T(null);
|
|
1719
1781
|
T(void 0);
|
|
1720
1782
|
//#endregion
|
|
1721
1783
|
//#region src/utils/storage/typed.ts
|
|
1722
|
-
var
|
|
1784
|
+
var Sr = class {
|
|
1723
1785
|
defaultValue;
|
|
1724
1786
|
storage;
|
|
1725
|
-
constructor(e, t =
|
|
1787
|
+
constructor(e, t = ir) {
|
|
1726
1788
|
this.defaultValue = e, this.storage = t;
|
|
1727
1789
|
}
|
|
1728
1790
|
get(e) {
|
|
@@ -1739,11 +1801,11 @@ var tr = class {
|
|
|
1739
1801
|
remove(e) {
|
|
1740
1802
|
this.storage.removeItem(e);
|
|
1741
1803
|
}
|
|
1742
|
-
},
|
|
1804
|
+
}, Cr = class {
|
|
1743
1805
|
schema;
|
|
1744
1806
|
getDefaultValue;
|
|
1745
1807
|
storage;
|
|
1746
|
-
constructor(e, t, n =
|
|
1808
|
+
constructor(e, t, n = ir) {
|
|
1747
1809
|
this.schema = e, this.getDefaultValue = t, this.storage = n;
|
|
1748
1810
|
}
|
|
1749
1811
|
get(e) {
|
|
@@ -1762,15 +1824,15 @@ var tr = class {
|
|
|
1762
1824
|
remove(e) {
|
|
1763
1825
|
this.storage.removeItem(e);
|
|
1764
1826
|
}
|
|
1765
|
-
},
|
|
1827
|
+
}, wr = class extends Cr {
|
|
1766
1828
|
filename;
|
|
1767
1829
|
unsubscribeFromFilename;
|
|
1768
1830
|
constructor(e, t, n) {
|
|
1769
|
-
let r =
|
|
1831
|
+
let r = w.get(G);
|
|
1770
1832
|
super(t, n), this.filename = r;
|
|
1771
1833
|
try {
|
|
1772
|
-
this.unsubscribeFromFilename =
|
|
1773
|
-
let t =
|
|
1834
|
+
this.unsubscribeFromFilename = w.sub(G, () => {
|
|
1835
|
+
let t = w.get(G);
|
|
1774
1836
|
this.handleFilenameChange(e, t);
|
|
1775
1837
|
});
|
|
1776
1838
|
} catch {
|
|
@@ -1828,7 +1890,7 @@ var tr = class {
|
|
|
1828
1890
|
In: "in",
|
|
1829
1891
|
As: "as",
|
|
1830
1892
|
Import: "import"
|
|
1831
|
-
},
|
|
1893
|
+
}, Tr = /* @__PURE__ */ new Set([
|
|
1832
1894
|
K.FunctionDefinition,
|
|
1833
1895
|
K.LambdaExpression,
|
|
1834
1896
|
K.ArrayComprehensionExpression,
|
|
@@ -1840,13 +1902,13 @@ var tr = class {
|
|
|
1840
1902
|
K.Comment, K.String, K.FormatString;
|
|
1841
1903
|
//#endregion
|
|
1842
1904
|
//#region src/core/codemirror/utils.ts
|
|
1843
|
-
function
|
|
1905
|
+
function Er(e) {
|
|
1844
1906
|
e && e.dispatch({ selection: {
|
|
1845
1907
|
anchor: e.state.doc.length,
|
|
1846
1908
|
head: e.state.doc.length
|
|
1847
1909
|
} });
|
|
1848
1910
|
}
|
|
1849
|
-
function
|
|
1911
|
+
function Dr(e) {
|
|
1850
1912
|
let t = e.dom.closest(".marimo-cell");
|
|
1851
1913
|
t && requestAnimationFrame(() => {
|
|
1852
1914
|
t.scrollIntoView({
|
|
@@ -1858,8 +1920,8 @@ function or(e) {
|
|
|
1858
1920
|
}
|
|
1859
1921
|
//#endregion
|
|
1860
1922
|
//#region src/core/codemirror/go-to-definition/commands.ts
|
|
1861
|
-
var
|
|
1862
|
-
function
|
|
1923
|
+
var Or = /* @__PURE__ */ new Set([K.ClassDefinition]);
|
|
1924
|
+
function kr(e, t) {
|
|
1863
1925
|
requestAnimationFrame(() => {
|
|
1864
1926
|
e.focus(), e.dispatch({
|
|
1865
1927
|
selection: {
|
|
@@ -1868,9 +1930,9 @@ function cr(e, t) {
|
|
|
1868
1930
|
},
|
|
1869
1931
|
effects: ce.scrollIntoView(t, { y: "center" })
|
|
1870
1932
|
});
|
|
1871
|
-
}),
|
|
1933
|
+
}), Dr(e);
|
|
1872
1934
|
}
|
|
1873
|
-
function
|
|
1935
|
+
function Ar(e, t) {
|
|
1874
1936
|
let n = oe(e), r = null;
|
|
1875
1937
|
return n.iterate({ enter: (n) => {
|
|
1876
1938
|
if (r !== null) return !1;
|
|
@@ -1878,9 +1940,9 @@ function lr(e, t) {
|
|
|
1878
1940
|
if (n.name === K.Comment || n.name === K.String) return !1;
|
|
1879
1941
|
} }), r;
|
|
1880
1942
|
}
|
|
1881
|
-
function
|
|
1943
|
+
function jr(e, t) {
|
|
1882
1944
|
let n = [], r = e.resolveInner(t, 0);
|
|
1883
|
-
for (; r;)
|
|
1945
|
+
for (; r;) Tr.has(r.name) && (n.some((e) => e.type === K.FunctionDefinition || e.type === K.LambdaExpression) && r.name === K.ClassDefinition || n.push({
|
|
1884
1946
|
id: r.from,
|
|
1885
1947
|
type: r.name
|
|
1886
1948
|
})), r = r.parent;
|
|
@@ -1895,12 +1957,12 @@ function J(e, t, n) {
|
|
|
1895
1957
|
from: n
|
|
1896
1958
|
});
|
|
1897
1959
|
}
|
|
1898
|
-
function
|
|
1960
|
+
function Mr(e, t) {
|
|
1899
1961
|
if (e.firstChild()) do
|
|
1900
1962
|
t(e.node);
|
|
1901
1963
|
while (e.nextSibling());
|
|
1902
1964
|
}
|
|
1903
|
-
function
|
|
1965
|
+
function Nr(e, t) {
|
|
1904
1966
|
let { state: n, variableName: r, scopeId: i, declarations: a } = t;
|
|
1905
1967
|
switch (e.name) {
|
|
1906
1968
|
case K.VariableName:
|
|
@@ -1911,13 +1973,13 @@ function fr(e, t) {
|
|
|
1911
1973
|
let n = e.node.cursor();
|
|
1912
1974
|
n.firstChild();
|
|
1913
1975
|
do
|
|
1914
|
-
|
|
1976
|
+
Nr(n, t);
|
|
1915
1977
|
while (n.nextSibling());
|
|
1916
1978
|
break;
|
|
1917
1979
|
}
|
|
1918
1980
|
}
|
|
1919
1981
|
}
|
|
1920
|
-
function
|
|
1982
|
+
function Pr(e, t) {
|
|
1921
1983
|
let { state: n, variableName: r, scopeId: i, declarations: a } = t, o = e.cursor();
|
|
1922
1984
|
o.firstChild();
|
|
1923
1985
|
do {
|
|
@@ -1929,18 +1991,18 @@ function pr(e, t) {
|
|
|
1929
1991
|
while (e.nextSibling());
|
|
1930
1992
|
} while (o.nextSibling());
|
|
1931
1993
|
}
|
|
1932
|
-
function
|
|
1994
|
+
function Fr(e, t) {
|
|
1933
1995
|
let n = e.cursor();
|
|
1934
1996
|
n.firstChild();
|
|
1935
1997
|
let r = !1;
|
|
1936
1998
|
do
|
|
1937
1999
|
if (n.name === q.For) r = !0;
|
|
1938
2000
|
else if (r && n.name === q.In) break;
|
|
1939
|
-
else r &&
|
|
2001
|
+
else r && Nr(n, t);
|
|
1940
2002
|
while (n.nextSibling());
|
|
1941
2003
|
}
|
|
1942
|
-
function
|
|
1943
|
-
let { state: n, variableName: r, scopeStack: i, declarations: a } = t, o = e.cursor(), s = o.name, c = o.from, l =
|
|
2004
|
+
function Ir(e, t) {
|
|
2005
|
+
let { state: n, variableName: r, scopeStack: i, declarations: a } = t, o = e.cursor(), s = o.name, c = o.from, l = Tr.has(s) ? [...i, c] : i, u = l[l.length - 1] ?? -1;
|
|
1944
2006
|
switch (s) {
|
|
1945
2007
|
case K.FunctionDefinition:
|
|
1946
2008
|
case K.ClassDefinition: {
|
|
@@ -1952,7 +2014,7 @@ function hr(e, t) {
|
|
|
1952
2014
|
break;
|
|
1953
2015
|
}
|
|
1954
2016
|
while (t.nextSibling());
|
|
1955
|
-
s === K.FunctionDefinition &&
|
|
2017
|
+
s === K.FunctionDefinition && Pr(e, {
|
|
1956
2018
|
state: n,
|
|
1957
2019
|
variableName: r,
|
|
1958
2020
|
scopeId: c,
|
|
@@ -1961,7 +2023,7 @@ function hr(e, t) {
|
|
|
1961
2023
|
break;
|
|
1962
2024
|
}
|
|
1963
2025
|
case K.LambdaExpression:
|
|
1964
|
-
|
|
2026
|
+
Pr(e, {
|
|
1965
2027
|
state: n,
|
|
1966
2028
|
variableName: r,
|
|
1967
2029
|
scopeId: c,
|
|
@@ -1973,7 +2035,7 @@ function hr(e, t) {
|
|
|
1973
2035
|
case K.SetComprehensionExpression:
|
|
1974
2036
|
case K.ComprehensionExpression:
|
|
1975
2037
|
case K.ForStatement:
|
|
1976
|
-
|
|
2038
|
+
Fr(e, {
|
|
1977
2039
|
state: n,
|
|
1978
2040
|
variableName: r,
|
|
1979
2041
|
scopeId: u,
|
|
@@ -1991,7 +2053,7 @@ function hr(e, t) {
|
|
|
1991
2053
|
let s = e.cursor();
|
|
1992
2054
|
s.firstChild();
|
|
1993
2055
|
do
|
|
1994
|
-
s.from < o &&
|
|
2056
|
+
s.from < o && Nr(s, {
|
|
1995
2057
|
state: n,
|
|
1996
2058
|
variableName: r,
|
|
1997
2059
|
scopeId: u,
|
|
@@ -2036,8 +2098,8 @@ function hr(e, t) {
|
|
|
2036
2098
|
break;
|
|
2037
2099
|
}
|
|
2038
2100
|
}
|
|
2039
|
-
|
|
2040
|
-
|
|
2101
|
+
Mr(o, (e) => {
|
|
2102
|
+
Ir(e, {
|
|
2041
2103
|
state: n,
|
|
2042
2104
|
variableName: r,
|
|
2043
2105
|
scopeStack: l,
|
|
@@ -2045,27 +2107,27 @@ function hr(e, t) {
|
|
|
2045
2107
|
});
|
|
2046
2108
|
});
|
|
2047
2109
|
}
|
|
2048
|
-
function
|
|
2110
|
+
function Lr(e, t, n) {
|
|
2049
2111
|
let r = oe(e), i = [];
|
|
2050
|
-
|
|
2112
|
+
Ir(r, {
|
|
2051
2113
|
state: e,
|
|
2052
2114
|
variableName: t,
|
|
2053
2115
|
scopeStack: [],
|
|
2054
2116
|
declarations: i
|
|
2055
2117
|
});
|
|
2056
2118
|
let a = Math.max(0, Math.min(n, e.doc.length));
|
|
2057
|
-
for (let e of
|
|
2058
|
-
let t = i.filter((t) => t.scopeId === e.id).filter((t) => !
|
|
2119
|
+
for (let e of jr(r, a)) {
|
|
2120
|
+
let t = i.filter((t) => t.scopeId === e.id).filter((t) => !Or.has(e.type) || t.from <= a).toSorted((e, t) => e.from - t.from)[0];
|
|
2059
2121
|
if (t) return t.from;
|
|
2060
2122
|
}
|
|
2061
2123
|
return null;
|
|
2062
2124
|
}
|
|
2063
|
-
function
|
|
2064
|
-
let { state: r } = e, i = n === void 0 ?
|
|
2065
|
-
return i !== null && (
|
|
2125
|
+
function Rr(e, t, n) {
|
|
2126
|
+
let { state: r } = e, i = n === void 0 ? Ar(r, t) : Lr(r, t, n);
|
|
2127
|
+
return i !== null && (kr(e, i), !0);
|
|
2066
2128
|
}
|
|
2067
|
-
function
|
|
2068
|
-
return
|
|
2129
|
+
function zr(e, t) {
|
|
2130
|
+
return kr(e, e.state.doc.line(t).from), !0;
|
|
2069
2131
|
}
|
|
2070
2132
|
//#endregion
|
|
2071
2133
|
//#region src/core/notebook/replica/connection.ts
|
|
@@ -2075,19 +2137,19 @@ var Y = {
|
|
|
2075
2137
|
OPEN: "OPEN",
|
|
2076
2138
|
CLOSING: "CLOSING",
|
|
2077
2139
|
CLOSED: "CLOSED"
|
|
2078
|
-
},
|
|
2140
|
+
}, Br = {
|
|
2079
2141
|
KERNEL_DISCONNECTED: "KERNEL_DISCONNECTED",
|
|
2080
2142
|
KERNEL_STARTUP_ERROR: "KERNEL_STARTUP_ERROR"
|
|
2081
2143
|
}, X = T({ state: Y.NOT_STARTED });
|
|
2082
|
-
|
|
2144
|
+
C(null, (e, t) => t === null ? null : {
|
|
2083
2145
|
phase: t.phase,
|
|
2084
2146
|
logs: t.log_mode === "append" && e?.phase === t.phase ? e.logs + t.logs : t.logs
|
|
2085
2147
|
});
|
|
2086
|
-
function
|
|
2087
|
-
return
|
|
2148
|
+
function Vr() {
|
|
2149
|
+
return b(X, (e) => e.state === Y.OPEN);
|
|
2088
2150
|
}
|
|
2089
|
-
function
|
|
2090
|
-
return de() ?
|
|
2151
|
+
function Hr() {
|
|
2152
|
+
return de() ? Vr() : Promise.resolve();
|
|
2091
2153
|
}
|
|
2092
2154
|
T((e) => e(X).state === Y.CONNECTING), T((e) => e(X).state === Y.OPEN), T((e) => {
|
|
2093
2155
|
let t = e(X);
|
|
@@ -2095,50 +2157,50 @@ T((e) => e(X).state === Y.CONNECTING), T((e) => e(X).state === Y.OPEN), T((e) =>
|
|
|
2095
2157
|
}), T((e) => e(X).state === Y.CLOSED), T((e) => e(X).state === Y.NOT_STARTED);
|
|
2096
2158
|
//#endregion
|
|
2097
2159
|
//#region src/components/ui/checkbox.tsx
|
|
2098
|
-
var
|
|
2099
|
-
let r = (0,
|
|
2160
|
+
var Ur = k.forwardRef((e, t) => {
|
|
2161
|
+
let r = (0, rt.c)(13), i, a;
|
|
2100
2162
|
r[0] === e ? (i = r[1], a = r[2]) : ({className: i, ...a} = e, r[0] = e, r[1] = i, r[2] = a);
|
|
2101
2163
|
let o;
|
|
2102
2164
|
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);
|
|
2103
2165
|
let s;
|
|
2104
2166
|
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];
|
|
2105
2167
|
let c;
|
|
2106
|
-
r[6] === a.checked ? c = r[7] : (c = /* @__PURE__ */ (0,
|
|
2168
|
+
r[6] === a.checked ? c = r[7] : (c = /* @__PURE__ */ (0, A.jsx)(Ae, {
|
|
2107
2169
|
className: s,
|
|
2108
|
-
children: a.checked === "indeterminate" ? /* @__PURE__ */ (0,
|
|
2170
|
+
children: a.checked === "indeterminate" ? /* @__PURE__ */ (0, A.jsx)(ve, { className: "h-4 w-4" }) : /* @__PURE__ */ (0, A.jsx)(l, { className: "h-4 w-4" })
|
|
2109
2171
|
}), r[6] = a.checked, r[7] = c);
|
|
2110
2172
|
let u;
|
|
2111
|
-
return r[8] !== a || r[9] !== t || r[10] !== o || r[11] !== c ? (u = /* @__PURE__ */ (0,
|
|
2173
|
+
return r[8] !== a || r[9] !== t || r[10] !== o || r[11] !== c ? (u = /* @__PURE__ */ (0, A.jsx)(Oe, {
|
|
2112
2174
|
ref: t,
|
|
2113
2175
|
className: o,
|
|
2114
2176
|
...a,
|
|
2115
2177
|
children: c
|
|
2116
2178
|
}), r[8] = a, r[9] = t, r[10] = o, r[11] = c, r[12] = u) : u = r[12], u;
|
|
2117
2179
|
});
|
|
2118
|
-
|
|
2180
|
+
Ur.displayName = Oe.displayName;
|
|
2119
2181
|
//#endregion
|
|
2120
2182
|
//#region src/core/cells/scrollCellIntoView.ts
|
|
2121
|
-
function
|
|
2183
|
+
function Wr({ cellId: e, cell: n, isCodeHidden: r, codeFocus: i, variableName: a }) {
|
|
2122
2184
|
if (!n) return;
|
|
2123
|
-
let o = document.getElementById(
|
|
2185
|
+
let o = document.getElementById(R.create(e));
|
|
2124
2186
|
if (!o) {
|
|
2125
2187
|
t.warn("scrollCellIntoView: element not found");
|
|
2126
2188
|
return;
|
|
2127
2189
|
}
|
|
2128
|
-
if (
|
|
2129
|
-
|
|
2190
|
+
if (Bn()) {
|
|
2191
|
+
Vn(o);
|
|
2130
2192
|
return;
|
|
2131
2193
|
}
|
|
2132
|
-
if (r)
|
|
2194
|
+
if (r) Vn(o);
|
|
2133
2195
|
else {
|
|
2134
|
-
|
|
2196
|
+
ut.promote(e);
|
|
2135
2197
|
let r = n.current?.editorView;
|
|
2136
2198
|
if (!r) {
|
|
2137
2199
|
t.warn("scrollCellIntoView: editor not found", e);
|
|
2138
2200
|
return;
|
|
2139
2201
|
}
|
|
2140
2202
|
if (r.hasFocus || !document.hasFocus()) return;
|
|
2141
|
-
if (
|
|
2203
|
+
if (Hn(() => (r.focus(), r.hasFocus), {
|
|
2142
2204
|
retries: 5,
|
|
2143
2205
|
delay: 20
|
|
2144
2206
|
}), i === "top") r.dispatch({ selection: {
|
|
@@ -2151,28 +2213,28 @@ function Cr({ cellId: e, cell: n, isCodeHidden: r, codeFocus: i, variableName: a
|
|
|
2151
2213
|
anchor: e.from,
|
|
2152
2214
|
head: e.from
|
|
2153
2215
|
} });
|
|
2154
|
-
} else a &&
|
|
2216
|
+
} else a && Rr(r, a);
|
|
2155
2217
|
}
|
|
2156
2218
|
o.scrollIntoView({
|
|
2157
2219
|
behavior: "smooth",
|
|
2158
2220
|
block: "nearest"
|
|
2159
2221
|
});
|
|
2160
2222
|
}
|
|
2161
|
-
function
|
|
2223
|
+
function Gr() {
|
|
2162
2224
|
let e = document.getElementById("App");
|
|
2163
2225
|
e?.scrollTo({
|
|
2164
2226
|
top: e.scrollHeight,
|
|
2165
2227
|
behavior: "smooth"
|
|
2166
2228
|
});
|
|
2167
2229
|
}
|
|
2168
|
-
function
|
|
2230
|
+
function Kr() {
|
|
2169
2231
|
document.getElementById("App")?.scrollTo({
|
|
2170
2232
|
top: 0,
|
|
2171
2233
|
behavior: "smooth"
|
|
2172
2234
|
});
|
|
2173
2235
|
}
|
|
2174
|
-
function
|
|
2175
|
-
let t = document.getElementById(
|
|
2236
|
+
function qr(e) {
|
|
2237
|
+
let t = document.getElementById(R.create(e));
|
|
2176
2238
|
return t?.scrollIntoView({
|
|
2177
2239
|
behavior: "smooth",
|
|
2178
2240
|
block: "center"
|
|
@@ -2180,7 +2242,7 @@ function Er(e) {
|
|
|
2180
2242
|
}
|
|
2181
2243
|
//#endregion
|
|
2182
2244
|
//#region src/core/cells/cells.ts
|
|
2183
|
-
function
|
|
2245
|
+
function Jr(e) {
|
|
2184
2246
|
let t = {
|
|
2185
2247
|
column: 0,
|
|
2186
2248
|
hide_code: !1,
|
|
@@ -2190,24 +2252,24 @@ function Dr(e) {
|
|
|
2190
2252
|
return {
|
|
2191
2253
|
...e,
|
|
2192
2254
|
cellData: {
|
|
2193
|
-
[
|
|
2194
|
-
id:
|
|
2255
|
+
[L]: mn({
|
|
2256
|
+
id: L,
|
|
2195
2257
|
config: t
|
|
2196
2258
|
}),
|
|
2197
2259
|
...e.cellData
|
|
2198
2260
|
},
|
|
2199
2261
|
cellRuntime: {
|
|
2200
|
-
[
|
|
2262
|
+
[L]: gn(),
|
|
2201
2263
|
...e.cellRuntime
|
|
2202
2264
|
},
|
|
2203
2265
|
cellHandles: {
|
|
2204
|
-
[
|
|
2266
|
+
[L]: (0, k.createRef)(),
|
|
2205
2267
|
...e.cellHandles
|
|
2206
2268
|
}
|
|
2207
2269
|
};
|
|
2208
2270
|
}
|
|
2209
|
-
function
|
|
2210
|
-
return
|
|
2271
|
+
function Yr() {
|
|
2272
|
+
return Jr({
|
|
2211
2273
|
cellIds: [],
|
|
2212
2274
|
cellData: {},
|
|
2213
2275
|
cellRuntime: {},
|
|
@@ -2217,27 +2279,30 @@ function Or() {
|
|
|
2217
2279
|
cellLogs: []
|
|
2218
2280
|
});
|
|
2219
2281
|
}
|
|
2220
|
-
var { reducer:
|
|
2282
|
+
var { reducer: Xr, createActions: Zr, useActions: Qr, valueAtom: Z } = ae(Yr, {
|
|
2221
2283
|
codeFormatted: (e, t) => {
|
|
2222
2284
|
let { cellId: n, before: r, after: i } = t;
|
|
2223
|
-
return e.cellData[n] ?
|
|
2285
|
+
return e.cellData[n] ? $r({
|
|
2224
2286
|
state: e,
|
|
2225
2287
|
cellId: n,
|
|
2226
2288
|
cellReducer: (e) => {
|
|
2227
|
-
let t =
|
|
2289
|
+
let t = V(e.lastCodeRun, r) ? e.lastCodeRun : i;
|
|
2228
2290
|
return {
|
|
2229
2291
|
...e,
|
|
2230
2292
|
lastCodeRun: t,
|
|
2231
|
-
edited:
|
|
2293
|
+
edited: V(t, e.code)
|
|
2232
2294
|
};
|
|
2233
2295
|
}
|
|
2234
2296
|
}) : e;
|
|
2235
2297
|
},
|
|
2236
|
-
prepareForRun: (e, t) =>
|
|
2298
|
+
prepareForRun: (e, t) => $r({
|
|
2237
2299
|
state: Q({
|
|
2238
2300
|
state: e,
|
|
2239
2301
|
cellId: t.cellId,
|
|
2240
|
-
cellReducer: (e) =>
|
|
2302
|
+
cellReducer: (e) => ({
|
|
2303
|
+
...e,
|
|
2304
|
+
debuggerActive: !1
|
|
2305
|
+
})
|
|
2241
2306
|
}),
|
|
2242
2307
|
cellId: t.cellId,
|
|
2243
2308
|
cellReducer: (e) => ({
|
|
@@ -2250,9 +2315,9 @@ var { reducer: kr, createActions: Ar, useActions: jr, valueAtom: Z } = ae(Or, {
|
|
|
2250
2315
|
let n = t.cell_id, r = Q({
|
|
2251
2316
|
state: e,
|
|
2252
2317
|
cellId: n,
|
|
2253
|
-
cellReducer: (e) =>
|
|
2318
|
+
cellReducer: (e) => Nt(e, t)
|
|
2254
2319
|
});
|
|
2255
|
-
return t.status === "queued" && (r =
|
|
2320
|
+
return t.status === "queued" && (r = $r({
|
|
2256
2321
|
state: r,
|
|
2257
2322
|
cellId: n,
|
|
2258
2323
|
cellReducer: (e) => ({
|
|
@@ -2262,7 +2327,7 @@ var { reducer: kr, createActions: Ar, useActions: jr, valueAtom: Z } = ae(Or, {
|
|
|
2262
2327
|
})
|
|
2263
2328
|
})), {
|
|
2264
2329
|
...r,
|
|
2265
|
-
cellLogs: [...r.cellLogs, ...
|
|
2330
|
+
cellLogs: [...r.cellLogs, ...In(t)]
|
|
2266
2331
|
};
|
|
2267
2332
|
},
|
|
2268
2333
|
addLogs: (e, t) => ({
|
|
@@ -2270,8 +2335,8 @@ var { reducer: kr, createActions: Ar, useActions: jr, valueAtom: Z } = ae(Or, {
|
|
|
2270
2335
|
cellLogs: [...e.cellLogs, ...t.logs]
|
|
2271
2336
|
}),
|
|
2272
2337
|
reconcileDocument: (e, t) => {
|
|
2273
|
-
let n =
|
|
2274
|
-
for (let t of e.cellIds) t in n.cellData ||
|
|
2338
|
+
let n = vn(e, t);
|
|
2339
|
+
for (let t of e.cellIds) t in n.cellData || mi(t);
|
|
2275
2340
|
return n;
|
|
2276
2341
|
},
|
|
2277
2342
|
setStdinResponse: (e, n) => {
|
|
@@ -2303,8 +2368,7 @@ var { reducer: kr, createActions: Ar, useActions: jr, valueAtom: Z } = ae(Or, {
|
|
|
2303
2368
|
n[r] = {
|
|
2304
2369
|
...i,
|
|
2305
2370
|
lastCodeRun: a,
|
|
2306
|
-
|
|
2307
|
-
edited: a !== null && B(a, i.code)
|
|
2371
|
+
edited: a !== null && V(a, i.code)
|
|
2308
2372
|
};
|
|
2309
2373
|
}
|
|
2310
2374
|
return {
|
|
@@ -2314,9 +2378,9 @@ var { reducer: kr, createActions: Ar, useActions: jr, valueAtom: Z } = ae(Or, {
|
|
|
2314
2378
|
},
|
|
2315
2379
|
resetCellRuntimes: (e) => {
|
|
2316
2380
|
let t = me(), n = { ...e.cellRuntime };
|
|
2317
|
-
for (let r of [...e.cellIds,
|
|
2381
|
+
for (let r of [...e.cellIds, L]) {
|
|
2318
2382
|
let i = e.cellRuntime[r];
|
|
2319
|
-
n[r] = t && i !== void 0 && (i.output != null || i.consoleOutputs.length > 0) ? i :
|
|
2383
|
+
n[r] = t && i !== void 0 && (i.output != null || i.consoleOutputs.length > 0) ? i : gn();
|
|
2320
2384
|
}
|
|
2321
2385
|
return {
|
|
2322
2386
|
...e,
|
|
@@ -2327,10 +2391,10 @@ var { reducer: kr, createActions: Ar, useActions: jr, valueAtom: Z } = ae(Or, {
|
|
|
2327
2391
|
let t = e.scrollKey;
|
|
2328
2392
|
if (t === null) return e;
|
|
2329
2393
|
let n = t;
|
|
2330
|
-
return
|
|
2394
|
+
return Wr({
|
|
2331
2395
|
cellId: n,
|
|
2332
2396
|
cell: e.cellHandles[n],
|
|
2333
|
-
isCodeHidden:
|
|
2397
|
+
isCodeHidden: xn(e.cellData[n]?.config.hide_code, w.get(H), n),
|
|
2334
2398
|
codeFocus: void 0,
|
|
2335
2399
|
variableName: void 0
|
|
2336
2400
|
}), {
|
|
@@ -2338,8 +2402,8 @@ var { reducer: kr, createActions: Ar, useActions: jr, valueAtom: Z } = ae(Or, {
|
|
|
2338
2402
|
scrollKey: null
|
|
2339
2403
|
};
|
|
2340
2404
|
},
|
|
2341
|
-
foldAll: (e) => (
|
|
2342
|
-
unfoldAll: (e) => (
|
|
2405
|
+
foldAll: (e) => (at(Object.values(e.cellHandles).map((e) => e.current?.editorView)), e),
|
|
2406
|
+
unfoldAll: (e) => (ot(Object.values(e.cellHandles).map((e) => e.current?.editorView)), e),
|
|
2343
2407
|
clearLogs: (e) => ({
|
|
2344
2408
|
...e,
|
|
2345
2409
|
cellLogs: []
|
|
@@ -2389,7 +2453,7 @@ function Q({ state: e, cellId: n, cellReducer: r }) {
|
|
|
2389
2453
|
}
|
|
2390
2454
|
} : (t.warn(`Cell ${n} not found in state`), e);
|
|
2391
2455
|
}
|
|
2392
|
-
function
|
|
2456
|
+
function $r({ state: e, cellId: n, cellReducer: r }) {
|
|
2393
2457
|
return n in e.cellData ? {
|
|
2394
2458
|
...e,
|
|
2395
2459
|
cellData: {
|
|
@@ -2398,15 +2462,15 @@ function Mr({ state: e, cellId: n, cellReducer: r }) {
|
|
|
2398
2462
|
}
|
|
2399
2463
|
} : (t.warn(`Cell ${n} not found in state`), e);
|
|
2400
2464
|
}
|
|
2401
|
-
var
|
|
2402
|
-
|
|
2465
|
+
var ei = Zr((e) => {
|
|
2466
|
+
w.set(Z, (t) => Xr(t, e));
|
|
2403
2467
|
}).addLogs, $ = T((e) => e(Z).cellIds);
|
|
2404
|
-
T((e) => e($).length === 1), T((e) =>
|
|
2405
|
-
var
|
|
2468
|
+
T((e) => e($).length === 1), T((e) => Gn(e(Z)).length > 0), T((e) => Kn(e(Z)).length > 0), T((e) => qn(e(Z))), T((e) => Jn(e(Z))), T((e) => Un(e(Z), e(N)));
|
|
2469
|
+
var ti = T((e) => {
|
|
2406
2470
|
let { cellIds: t, cellRuntime: n, cellData: r } = e(Z);
|
|
2407
2471
|
return t.map((e) => {
|
|
2408
2472
|
let t = n[e], { name: i } = r[e];
|
|
2409
|
-
if (
|
|
2473
|
+
if (F(t.output?.mimetype)) {
|
|
2410
2474
|
D(Array.isArray(t.output.data), "Expected array data");
|
|
2411
2475
|
let n = t.output.data.filter((e) => !e.type.includes("ancestor"));
|
|
2412
2476
|
if (n.length > 0) return {
|
|
@@ -2420,93 +2484,90 @@ var Pr = T((e) => {
|
|
|
2420
2484
|
}
|
|
2421
2485
|
return null;
|
|
2422
2486
|
}).filter(Boolean);
|
|
2423
|
-
}),
|
|
2487
|
+
}), ni = y(T((e) => {
|
|
2424
2488
|
let t = {};
|
|
2425
|
-
for (let [n, r] of
|
|
2489
|
+
for (let [n, r] of O.entries(e(Z).cellRuntime)) r.outline !== null && r.outline.items.length > 0 && (t[n] = r.outline);
|
|
2426
2490
|
return t;
|
|
2427
|
-
})),
|
|
2428
|
-
let t = e($), n = e(
|
|
2429
|
-
return
|
|
2491
|
+
})), ri = T((e) => {
|
|
2492
|
+
let t = e($), n = e(ui);
|
|
2493
|
+
return _t(t.map((e) => n[e].outline));
|
|
2430
2494
|
});
|
|
2431
|
-
T((e) => e(
|
|
2432
|
-
var
|
|
2495
|
+
T((e) => e(ti).length);
|
|
2496
|
+
var ii = y(T((e) => {
|
|
2433
2497
|
let { cellIds: t, cellData: n } = e(Z);
|
|
2434
|
-
return
|
|
2498
|
+
return O.fromEntries(t.map((e) => [e, n[e]?.name]));
|
|
2435
2499
|
}));
|
|
2436
2500
|
T((e) => e(Z).scrollKey);
|
|
2437
|
-
var
|
|
2438
|
-
let { cellIds: e, cellData: t } =
|
|
2501
|
+
var ai = () => E($), oi = () => E(ii), si = () => w.get(Z), ci = () => w.get(Z).cellIds, li = () => {
|
|
2502
|
+
let { cellIds: e, cellData: t } = w.get(Z);
|
|
2439
2503
|
return e.map((e) => t[e]?.name).filter(Boolean);
|
|
2440
2504
|
};
|
|
2441
|
-
|
|
2442
|
-
var
|
|
2443
|
-
T((e) =>
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
}
|
|
2451
|
-
var Jr = (e) => {
|
|
2452
|
-
let { cellHandles: t } = C.get(Z);
|
|
2505
|
+
ie(v(Z, (e) => e.cellIds.map((t) => e.cellData[t])));
|
|
2506
|
+
var ui = T((e) => e(Z).cellRuntime);
|
|
2507
|
+
T((e) => e(Z).cellIds.length > 0);
|
|
2508
|
+
var di = te((e) => T((t) => t(Z).cellData[e])), fi = te((e) => T((t) => t(Z).cellRuntime[e])), pi = te((e) => T((t) => t(Z).cellHandles[e]));
|
|
2509
|
+
function mi(e) {
|
|
2510
|
+
di.remove(e), fi.remove(e), pi.remove(e), et(w, [e]);
|
|
2511
|
+
}
|
|
2512
|
+
var hi = (e) => {
|
|
2513
|
+
let { cellHandles: t } = w.get(Z);
|
|
2453
2514
|
return t[e].current?.editorView;
|
|
2454
|
-
},
|
|
2455
|
-
function
|
|
2456
|
-
return
|
|
2515
|
+
}, gi = (e) => (ut.promote(e), hi(e));
|
|
2516
|
+
function _i() {
|
|
2517
|
+
return Qr();
|
|
2457
2518
|
}
|
|
2458
2519
|
//#endregion
|
|
2459
2520
|
//#region src/core/errors/error-entries.ts
|
|
2460
|
-
function
|
|
2461
|
-
if (
|
|
2521
|
+
function vi(e) {
|
|
2522
|
+
if (xt(e.mimetype)) {
|
|
2462
2523
|
if (!Array.isArray(e.data)) return null;
|
|
2463
2524
|
let t = e.data.filter((e) => !e.type.includes("ancestor"));
|
|
2464
2525
|
return t.length === 0 ? null : { errorData: t };
|
|
2465
2526
|
}
|
|
2466
|
-
return
|
|
2527
|
+
return P(e.mimetype) ? typeof e.data != "string" || e.data.length === 0 ? null : {
|
|
2467
2528
|
errorData: [],
|
|
2468
2529
|
tracebackHtml: e.data
|
|
2469
2530
|
} : null;
|
|
2470
2531
|
}
|
|
2471
|
-
function
|
|
2532
|
+
function yi(e) {
|
|
2472
2533
|
return e.some((e) => "traceback" in e && e.traceback);
|
|
2473
2534
|
}
|
|
2474
|
-
function
|
|
2475
|
-
let t = e?.find((e) =>
|
|
2535
|
+
function bi(e) {
|
|
2536
|
+
let t = e?.find((e) => P(e.mimetype));
|
|
2476
2537
|
if (!(!t || typeof t.data != "string" || t.data.length === 0)) return t.data;
|
|
2477
2538
|
}
|
|
2478
|
-
function
|
|
2539
|
+
function xi(e, t) {
|
|
2479
2540
|
if (e.tracebackHtml) return e.tracebackHtml;
|
|
2480
|
-
if (!
|
|
2541
|
+
if (!yi(e.errorData)) return bi(t);
|
|
2481
2542
|
}
|
|
2482
|
-
function
|
|
2543
|
+
function Si(e) {
|
|
2483
2544
|
let { cellIds: t, cellRuntime: n, cellData: r } = e.get(Z), i = [];
|
|
2484
2545
|
for (let [e, a] of t.entries()) {
|
|
2485
2546
|
let t = n[a], o = t.output;
|
|
2486
|
-
if (!o || !
|
|
2487
|
-
let s =
|
|
2547
|
+
if (!o || !F(o.mimetype)) continue;
|
|
2548
|
+
let s = vi(o);
|
|
2488
2549
|
if (!s) continue;
|
|
2489
|
-
let c =
|
|
2550
|
+
let c = fn(r[a].name, e), l = r[a].lastCodeRun ?? r[a].code;
|
|
2490
2551
|
i.push({
|
|
2491
2552
|
cellId: a,
|
|
2492
2553
|
cellName: c,
|
|
2493
2554
|
cellCode: l,
|
|
2494
2555
|
errorData: s.errorData,
|
|
2495
|
-
tracebackHtml:
|
|
2556
|
+
tracebackHtml: xi(s, t.consoleOutputs)
|
|
2496
2557
|
});
|
|
2497
2558
|
}
|
|
2498
2559
|
return i;
|
|
2499
2560
|
}
|
|
2500
|
-
function
|
|
2561
|
+
function Ci(e) {
|
|
2501
2562
|
return 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");
|
|
2502
2563
|
}
|
|
2503
|
-
function
|
|
2504
|
-
let t =
|
|
2564
|
+
function wi(e) {
|
|
2565
|
+
let t = Ci(e);
|
|
2505
2566
|
return "traceback" in e && e.traceback && (t += `\n\nTraceback:\n${W(e.traceback)}`), t;
|
|
2506
2567
|
}
|
|
2507
|
-
function
|
|
2568
|
+
function Ti(e) {
|
|
2508
2569
|
let t = [e.cellName];
|
|
2509
|
-
return e.tracebackHtml && t.push(W(e.tracebackHtml)), e.errorData.length > 0 && t.push(e.errorData.map(
|
|
2570
|
+
return e.tracebackHtml && t.push(W(e.tracebackHtml)), e.errorData.length > 0 && t.push(e.errorData.map(wi).join("\n\n")), t.join("\n\n");
|
|
2510
2571
|
}
|
|
2511
2572
|
//#endregion
|
|
2512
|
-
export {
|
|
2573
|
+
export { zn as $, Br as A, Gt as At, vr as B, nt as Bt, Gr as C, tn as Ct, X as D, L as Dt, Ur as E, R as Et, Sr as F, Ft, ir as G, dr as H, Be as Ht, Cr as I, yt as It, er as J, tr as K, G as L, gt as Lt, zr as M, zt as Mt, Er as N, It as Nt, Vr as O, Ut as Ot, wr as P, Pt, Qn as Q, xr as R, dt as Rt, Wr as S, nn as St, Kr as T, qt as Tt, fr as U, ve as Ut, yr as V, Qe as Vt, lr as W, _e as Wt, Wn as X, Xn as Y, Zn as Z, Xr as _, on as _t, ei as a, H as at, oi as b, en as bt, Zr as c, fn as ct, li as d, un as dt, Mn as et, ci as f, Jt as ft, ri as g, rn as gt, Z as h, B as ht, Si as i, Sn as it, Y as j, Rt as jt, Hr as k, Kt as kt, gi as l, dn as lt, Yr as m, an as mt, Ti as n, Tn as nt, di as o, bn as ot, si as p, z as pt, $n as q, wi as r, xn as rt, $ as s, yn as st, Ci as t, W as tt, hi as u, pn as ut, mi as v, cn as vt, qr as w, Wt as wt, _i as x, Yt as xt, ai as y, sn as yt, _r as z, N as zt };
|