@marimo-team/islands 0.25.3-dev95 → 0.25.3-dev97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ErrorBoundary-Cghv7nv2.js → ErrorBoundary-DrRRjQqE.js} +1 -1
- package/dist/{chat-ui-D0jT6WV3.js → chat-ui-BIgPxfPP.js} +5 -4
- package/dist/{code-visibility-CLLrmROz.js → code-visibility-B72H-y9s.js} +2 -2
- package/dist/{common-BUSxx69_.js → common-Cm_wLVIe.js} +27 -26
- package/dist/{data-grid-overlay-editor-CWCIs2Mn.js → data-grid-overlay-editor-DWrrVdAU.js} +1 -1
- package/dist/{error-entries-BZiemZfD.js → error-entries-TAO6kEhF.js} +243 -230
- package/dist/{feedback-button-Ct9dNjaH.js → feedback-button--tVNH0ec.js} +3 -3
- package/dist/{glide-data-editor-D30nP9Xm.js → glide-data-editor-DWkgIB7l.js} +3 -3
- package/dist/{globals-B7SyAmCL.js → globals-D3_nrphz.js} +1 -1
- package/dist/{html-to-image-DBOTlHF9.js → html-to-image-CWdayGZU.js} +1 -1
- package/dist/main.js +1872 -1852
- package/dist/{number-overlay-editor-8Y4ehcLw.js → number-overlay-editor-DYj-4eDE.js} +1 -1
- package/dist/{process-output-BKLVbFnU.js → process-output-DD-oSvZk.js} +2 -2
- package/dist/{reveal-component-D8VAiQY5.js → reveal-component-pH1bfDAz.js} +7 -7
- package/package.json +1 -1
- package/src/components/app-config/ai-config.tsx +1 -0
- package/src/components/chat/acp/blocks.tsx +2 -2
- package/src/components/chat/chat-components.tsx +2 -0
- package/src/components/chat/chat-panel.tsx +6 -1
- package/src/components/data-table/__tests__/column-explorer.test.tsx +27 -1
- package/src/components/data-table/charts/__tests__/chart-panel.test.tsx +74 -1
- package/src/components/data-table/charts/__tests__/storage.test.ts +4 -1
- package/src/components/data-table/charts/charts.tsx +21 -6
- package/src/components/data-table/charts/storage.ts +16 -5
- package/src/components/data-table/column-explorer-panel/column-explorer.tsx +1 -1
- package/src/components/datasources/__tests__/column-actions.test.tsx +97 -0
- package/src/components/datasources/__tests__/column-preview.test.tsx +63 -2
- package/src/components/datasources/column-preview.tsx +8 -2
- package/src/components/datasources/datasources.tsx +12 -14
- package/src/components/debugger/debugger-code.tsx +5 -0
- package/src/components/dependency-graph/panels.tsx +2 -1
- package/src/components/editor/ai/ai-completion-editor.tsx +1 -0
- package/src/components/editor/alerts/startup-logs-alert.tsx +1 -0
- package/src/components/editor/cell/DeleteButton.tsx +1 -0
- package/src/components/editor/chrome/panels/cache-panel.tsx +1 -0
- package/src/components/editor/chrome/wrapper/__tests__/pending-ai-cells.test.tsx +58 -1
- package/src/components/editor/chrome/wrapper/pending-ai-cells.tsx +12 -2
- package/src/components/editor/notebook-banner.tsx +1 -0
- package/src/components/editor/output/ansi-reduce.ts +6 -0
- package/src/components/editor/output/console/ConsoleOutput.tsx +11 -7
- package/src/components/editor/package-alert.tsx +6 -4
- package/src/components/editor/renderers/vertical-layout/sidebar/toggle.tsx +7 -1
- package/src/components/mcp/mcp-status-indicator.tsx +1 -1
- package/src/components/scratchpad/scratchpad.tsx +2 -2
- package/src/components/slides/reveal-component.tsx +4 -2
- package/src/components/slides/slide-form.tsx +1 -0
- package/src/core/cells/__tests__/__snapshots__/cells.test.ts.snap +4 -0
- package/src/core/cells/__tests__/cell.test.ts +39 -0
- package/src/core/cells/__tests__/cells.test.ts +3 -1
- package/src/core/cells/__tests__/collapseConsoleOutputs.test.ts +54 -0
- package/src/core/cells/cell.ts +14 -3
- package/src/core/cells/cells.ts +1 -0
- package/src/core/cells/types.ts +10 -1
- package/src/core/codemirror/language/panel/panel.tsx +1 -0
- package/src/plugins/impl/RefreshPlugin.tsx +1 -0
- package/src/plugins/impl/chat/chat-ui.tsx +2 -1
- package/src/stories/button.stories.tsx +1 -0
|
@@ -21943,7 +21943,7 @@ function Sp(e) {
|
|
|
21943
21943
|
//#endregion
|
|
21944
21944
|
//#region src/core/codemirror/lsp/utils.ts
|
|
21945
21945
|
function Cp(e) {
|
|
21946
|
-
return bp.is(e) ? j.get(
|
|
21946
|
+
return bp.is(e) ? j.get(yx).inOrderIds.includes(bp.parse(e)) : !1;
|
|
21947
21947
|
}
|
|
21948
21948
|
function wp() {
|
|
21949
21949
|
return j.get(ii)?.rootUri ?? "file:///";
|
|
@@ -22406,7 +22406,7 @@ var cm = class {
|
|
|
22406
22406
|
return Bp(e, t);
|
|
22407
22407
|
}
|
|
22408
22408
|
}, lm = () => {
|
|
22409
|
-
let e =
|
|
22409
|
+
let e = Ex().cellHandles;
|
|
22410
22410
|
return Pt.mapValues(e, (e) => e.current?.editorViewOrNull);
|
|
22411
22411
|
};
|
|
22412
22412
|
function um(e) {
|
|
@@ -22946,7 +22946,7 @@ var Dm = /* @__PURE__ */ new Set([1, 2]);
|
|
|
22946
22946
|
function Om(e, t) {
|
|
22947
22947
|
if (!("method" in t) || t.method !== "window/logMessage") return;
|
|
22948
22948
|
let n = t.params;
|
|
22949
|
-
!Np(n) || typeof n.message != "string" ||
|
|
22949
|
+
!Np(n) || typeof n.message != "string" || vx({ logs: [{
|
|
22950
22950
|
timestamp: Date.now() / 1e3,
|
|
22951
22951
|
level: Dm.has(n.type) ? "stderr" : "stdout",
|
|
22952
22952
|
message: n.message,
|
|
@@ -26077,7 +26077,7 @@ function Gv(e, t) {
|
|
|
26077
26077
|
//#endregion
|
|
26078
26078
|
//#region src/components/editor/connections/components.tsx
|
|
26079
26079
|
function Kv() {
|
|
26080
|
-
let e = (0, Tr.c)(4), { createNewCell: t } =
|
|
26080
|
+
let e = (0, Tr.c)(4), { createNewCell: t } = Lx(), n = Wv(), r = Me(Fe), i;
|
|
26081
26081
|
return e[0] !== r || e[1] !== t || e[2] !== n ? (i = (e) => {
|
|
26082
26082
|
/\bmo\./.test(e) && Iv({
|
|
26083
26083
|
autoInstantiate: r,
|
|
@@ -26513,6 +26513,7 @@ var ky = () => {
|
|
|
26513
26513
|
t[41] === w ? ee = t[42] : (ee = /* @__PURE__ */ (0, I.jsx)(g, {
|
|
26514
26514
|
content: "Format SQL",
|
|
26515
26515
|
children: /* @__PURE__ */ (0, I.jsx)(l, {
|
|
26516
|
+
"aria-label": "Format SQL",
|
|
26516
26517
|
variant: "text",
|
|
26517
26518
|
size: "icon",
|
|
26518
26519
|
onClick: w,
|
|
@@ -26966,6 +26967,7 @@ var Zy = class e {
|
|
|
26966
26967
|
channel;
|
|
26967
26968
|
timestamp;
|
|
26968
26969
|
code;
|
|
26970
|
+
id;
|
|
26969
26971
|
ansiReducer = new $y();
|
|
26970
26972
|
_data;
|
|
26971
26973
|
get data() {
|
|
@@ -26973,13 +26975,13 @@ var Zy = class e {
|
|
|
26973
26975
|
}
|
|
26974
26976
|
static create(t) {
|
|
26975
26977
|
let n = new $y();
|
|
26976
|
-
return n.append(t.data), new e(t.mimetype, t.channel, t.timestamp, n, t.code);
|
|
26978
|
+
return n.append(t.data), new e(t.mimetype, t.channel, t.timestamp, n, t.code, t.id);
|
|
26977
26979
|
}
|
|
26978
|
-
constructor(e, t, n, r, i) {
|
|
26979
|
-
this.mimetype = e, this.channel = t, this.timestamp = n, this.code = i, this.ansiReducer = r, this._data = this.ansiReducer.render();
|
|
26980
|
+
constructor(e, t, n, r, i, a) {
|
|
26981
|
+
this.mimetype = e, this.channel = t, this.timestamp = n, this.code = i, this.id = a, this.ansiReducer = r, this._data = this.ansiReducer.render();
|
|
26980
26982
|
}
|
|
26981
26983
|
appendData(t) {
|
|
26982
|
-
return this.ansiReducer.append(t), new e(this.mimetype, this.channel, this.timestamp, this.ansiReducer, this.code);
|
|
26984
|
+
return this.ansiReducer.append(t), new e(this.mimetype, this.channel, this.timestamp, this.ansiReducer, this.code, this.id);
|
|
26983
26985
|
}
|
|
26984
26986
|
toJSON() {
|
|
26985
26987
|
return {
|
|
@@ -27044,7 +27046,10 @@ function ob(e, t) {
|
|
|
27044
27046
|
}
|
|
27045
27047
|
//#endregion
|
|
27046
27048
|
//#region src/core/cells/cell.ts
|
|
27047
|
-
function sb(e
|
|
27049
|
+
function sb(e) {
|
|
27050
|
+
return (e.at(-1)?.id ?? 0) + 1;
|
|
27051
|
+
}
|
|
27052
|
+
function cb(e, t) {
|
|
27048
27053
|
let n = { ...e };
|
|
27049
27054
|
switch (t.status) {
|
|
27050
27055
|
case "queued":
|
|
@@ -27070,30 +27075,37 @@ function sb(e, t) {
|
|
|
27070
27075
|
mimetype: e.mimetype,
|
|
27071
27076
|
data: e.data,
|
|
27072
27077
|
timestamp: e.timestamp,
|
|
27078
|
+
id: e.id,
|
|
27073
27079
|
response: e.response ?? ""
|
|
27074
27080
|
} : e));
|
|
27075
27081
|
let a = t.console;
|
|
27076
|
-
a != null && (i = tb(Array.isArray(a) ? a
|
|
27082
|
+
a != null && (i = tb(Array.isArray(a) ? a.map((e, t) => ({
|
|
27083
|
+
...e,
|
|
27084
|
+
id: t + 1
|
|
27085
|
+
})) : [...i, {
|
|
27086
|
+
...a,
|
|
27087
|
+
id: sb(i)
|
|
27088
|
+
}])), n.consoleOutputs = i, n.outline = qy(n.output);
|
|
27077
27089
|
let o = [t.console].flat().filter(Boolean).filter((e) => e.channel === "pdb");
|
|
27078
27090
|
return o.length > 0 && o.some((e) => e.data === "start") && (n.debuggerActive = !0), n;
|
|
27079
27091
|
}
|
|
27080
|
-
function
|
|
27092
|
+
function lb(e) {
|
|
27081
27093
|
let t = { ...e };
|
|
27082
27094
|
return e.status !== "disabled-transitively" && (t.status = "queued"), t.interrupted = !1, t.errored = !1, t.runElapsedTimeMs = null, t.debuggerActive = !1, t;
|
|
27083
27095
|
}
|
|
27084
|
-
function
|
|
27096
|
+
function ub(e) {
|
|
27085
27097
|
return e === "running" || e === "queued";
|
|
27086
27098
|
}
|
|
27087
|
-
function
|
|
27099
|
+
function db(e, t) {
|
|
27088
27100
|
let { status: n, output: r, runStartTimestamp: i, interrupted: a, staleInputs: o } = e;
|
|
27089
27101
|
if (a) return !1;
|
|
27090
27102
|
if (t) return !0;
|
|
27091
|
-
let s =
|
|
27103
|
+
let s = ub(n), c = n === "running" && r !== null && i !== null && (r.timestamp ?? 0) > i;
|
|
27092
27104
|
return s && !c ? !0 : o;
|
|
27093
27105
|
}
|
|
27094
27106
|
//#endregion
|
|
27095
27107
|
//#region src/core/cells/document-changes.ts
|
|
27096
|
-
function
|
|
27108
|
+
function fb(e, t) {
|
|
27097
27109
|
if (!e) {
|
|
27098
27110
|
a.warn("getCell: cellId is undefined");
|
|
27099
27111
|
return;
|
|
@@ -27105,32 +27117,32 @@ function db(e, t) {
|
|
|
27105
27117
|
}
|
|
27106
27118
|
return n;
|
|
27107
27119
|
}
|
|
27108
|
-
function
|
|
27120
|
+
function pb(e, t) {
|
|
27109
27121
|
let n = t.cellIds.inOrderIds, r = n.indexOf(e);
|
|
27110
27122
|
if (r > 0) return { after: n[r - 1] };
|
|
27111
27123
|
if (r === 0 && n.length > 1) return { before: n[1] };
|
|
27112
27124
|
}
|
|
27113
|
-
function
|
|
27125
|
+
function mb(e) {
|
|
27114
27126
|
let t = /* @__PURE__ */ new Map(), n = e.cellIds.getColumns();
|
|
27115
27127
|
for (let [e, r] of n.entries()) for (let n of r.inOrderIds) t.set(n, e);
|
|
27116
27128
|
return t;
|
|
27117
27129
|
}
|
|
27118
|
-
function
|
|
27130
|
+
function hb(e, t) {
|
|
27119
27131
|
let n = new Set(e.cellIds.inOrderIds), r = [];
|
|
27120
27132
|
for (let e of t.cellIds.inOrderIds) if (!n.has(e)) {
|
|
27121
|
-
let n =
|
|
27133
|
+
let n = fb(e, t);
|
|
27122
27134
|
n && r.push({
|
|
27123
27135
|
type: "create-cell",
|
|
27124
27136
|
cellId: n.id,
|
|
27125
27137
|
code: n.code,
|
|
27126
27138
|
name: n.name,
|
|
27127
27139
|
config: n.config,
|
|
27128
|
-
...
|
|
27140
|
+
...pb(n.id, t)
|
|
27129
27141
|
});
|
|
27130
27142
|
}
|
|
27131
27143
|
return r;
|
|
27132
27144
|
}
|
|
27133
|
-
function
|
|
27145
|
+
function gb(e, t) {
|
|
27134
27146
|
let n = new Set(t.cellIds.inOrderIds), r = [];
|
|
27135
27147
|
for (let t of e.cellIds.inOrderIds) n.has(t) || r.push({
|
|
27136
27148
|
type: "delete-cell",
|
|
@@ -27138,10 +27150,10 @@ function hb(e, t) {
|
|
|
27138
27150
|
});
|
|
27139
27151
|
return r;
|
|
27140
27152
|
}
|
|
27141
|
-
function
|
|
27142
|
-
let n =
|
|
27153
|
+
function _b(e, t) {
|
|
27154
|
+
let n = mb(e), r = mb(t), i = [];
|
|
27143
27155
|
for (let [e, a] of r) if (n.get(e) !== a) {
|
|
27144
|
-
let n =
|
|
27156
|
+
let n = fb(e, t);
|
|
27145
27157
|
i.push({
|
|
27146
27158
|
type: "set-config",
|
|
27147
27159
|
cellId: e,
|
|
@@ -27156,9 +27168,9 @@ function gb(e, t) {
|
|
|
27156
27168
|
cellIds: t.cellIds.inOrderIds
|
|
27157
27169
|
}), i;
|
|
27158
27170
|
}
|
|
27159
|
-
function
|
|
27171
|
+
function vb(e, t, n) {
|
|
27160
27172
|
switch (n.type) {
|
|
27161
|
-
case "createNewCell": return
|
|
27173
|
+
case "createNewCell": return hb(e, t);
|
|
27162
27174
|
case "deleteCell": return [{
|
|
27163
27175
|
type: "delete-cell",
|
|
27164
27176
|
cellId: n.payload.cellId
|
|
@@ -27170,15 +27182,15 @@ function _b(e, t, n) {
|
|
|
27170
27182
|
return [{
|
|
27171
27183
|
type: "move-cell",
|
|
27172
27184
|
cellId: e,
|
|
27173
|
-
...
|
|
27185
|
+
...pb(e, t)
|
|
27174
27186
|
}];
|
|
27175
27187
|
}
|
|
27176
27188
|
case "dropCellOverCell":
|
|
27177
27189
|
case "dropCellOverColumn":
|
|
27178
27190
|
case "moveCellToIndex":
|
|
27179
|
-
case "moveCellsRelativeTo": return
|
|
27191
|
+
case "moveCellsRelativeTo": return _b(e, t);
|
|
27180
27192
|
case "updateCellCode": {
|
|
27181
|
-
let e =
|
|
27193
|
+
let e = fb(n.payload.cellId, t);
|
|
27182
27194
|
return e ? [{
|
|
27183
27195
|
type: "set-code",
|
|
27184
27196
|
cellId: e.id,
|
|
@@ -27186,7 +27198,7 @@ function _b(e, t, n) {
|
|
|
27186
27198
|
}] : [];
|
|
27187
27199
|
}
|
|
27188
27200
|
case "updateCellName": {
|
|
27189
|
-
let e =
|
|
27201
|
+
let e = fb(n.payload.cellId, t);
|
|
27190
27202
|
return e ? [{
|
|
27191
27203
|
type: "set-name",
|
|
27192
27204
|
cellId: e.id,
|
|
@@ -27194,7 +27206,7 @@ function _b(e, t, n) {
|
|
|
27194
27206
|
}] : [];
|
|
27195
27207
|
}
|
|
27196
27208
|
case "updateCellConfig": {
|
|
27197
|
-
let { cellId: e } = n.payload, r =
|
|
27209
|
+
let { cellId: e } = n.payload, r = fb(e, t);
|
|
27198
27210
|
return r ? [{
|
|
27199
27211
|
type: "set-config",
|
|
27200
27212
|
cellId: e,
|
|
@@ -27209,30 +27221,30 @@ function _b(e, t, n) {
|
|
|
27209
27221
|
case "addColumnBreakpoint":
|
|
27210
27222
|
case "deleteColumn":
|
|
27211
27223
|
case "mergeAllColumns":
|
|
27212
|
-
case "compactColumns": return
|
|
27213
|
-
case "addColumn": return [...
|
|
27224
|
+
case "compactColumns": return _b(e, t);
|
|
27225
|
+
case "addColumn": return [...hb(e, t), ..._b(e, t)];
|
|
27214
27226
|
case "undoDeleteCell": {
|
|
27215
|
-
let n =
|
|
27227
|
+
let n = hb(e, t), r = _b(e, t);
|
|
27216
27228
|
return n.length === 0 ? r : r.length > 1 ? [...n, ...r] : n;
|
|
27217
27229
|
}
|
|
27218
27230
|
case "splitCell": {
|
|
27219
|
-
let { cellId: r } = n.payload, i =
|
|
27231
|
+
let { cellId: r } = n.payload, i = fb(r, t);
|
|
27220
27232
|
return i ? [{
|
|
27221
27233
|
type: "set-code",
|
|
27222
27234
|
cellId: r,
|
|
27223
27235
|
code: i.code
|
|
27224
|
-
}, ...
|
|
27236
|
+
}, ...hb(e, t)] : [];
|
|
27225
27237
|
}
|
|
27226
27238
|
case "undoSplitCell": {
|
|
27227
|
-
let { cellId: r } = n.payload, i =
|
|
27239
|
+
let { cellId: r } = n.payload, i = fb(r, t);
|
|
27228
27240
|
return i ? [{
|
|
27229
27241
|
type: "set-code",
|
|
27230
27242
|
cellId: r,
|
|
27231
27243
|
code: i.code
|
|
27232
|
-
}, ...
|
|
27244
|
+
}, ...gb(e, t)] : [];
|
|
27233
27245
|
}
|
|
27234
|
-
case "moveToNextCell": return
|
|
27235
|
-
case "addSetupCellIfDoesntExist": return
|
|
27246
|
+
case "moveToNextCell": return hb(e, t);
|
|
27247
|
+
case "addSetupCellIfDoesntExist": return hb(e, t);
|
|
27236
27248
|
case "focusCell":
|
|
27237
27249
|
case "focusTopCell":
|
|
27238
27250
|
case "focusBottomCell":
|
|
@@ -27262,88 +27274,88 @@ function _b(e, t, n) {
|
|
|
27262
27274
|
default: ee(n);
|
|
27263
27275
|
}
|
|
27264
27276
|
}
|
|
27265
|
-
var
|
|
27277
|
+
var yb = /* @__PURE__ */ new Set([
|
|
27266
27278
|
"set-code",
|
|
27267
27279
|
"set-name",
|
|
27268
27280
|
"set-config"
|
|
27269
|
-
]),
|
|
27281
|
+
]), bb = /* @__PURE__ */ new Set([
|
|
27270
27282
|
"set-code",
|
|
27271
27283
|
"set-name",
|
|
27272
27284
|
"set-config",
|
|
27273
27285
|
"move-cell"
|
|
27274
27286
|
]);
|
|
27275
|
-
function
|
|
27287
|
+
function xb(e) {
|
|
27276
27288
|
let t = /* @__PURE__ */ new Set();
|
|
27277
27289
|
for (let n of e) n.type === "delete-cell" && t.add(n.cellId);
|
|
27278
|
-
let n = e.filter((e) => !(
|
|
27290
|
+
let n = e.filter((e) => !(bb.has(e.type) && "cellId" in e && t.has(e.cellId))), r = /* @__PURE__ */ new Map();
|
|
27279
27291
|
return n.forEach((e, t) => {
|
|
27280
|
-
|
|
27281
|
-
}), n.filter((e, t) =>
|
|
27282
|
-
}
|
|
27283
|
-
var
|
|
27284
|
-
function
|
|
27285
|
-
if (
|
|
27286
|
-
let e =
|
|
27287
|
-
|
|
27288
|
-
}
|
|
27289
|
-
async function
|
|
27290
|
-
if (e ===
|
|
27291
|
-
if (
|
|
27292
|
-
for (;
|
|
27293
|
-
let t =
|
|
27292
|
+
yb.has(e.type) && "cellId" in e && r.set(`${e.type}:${e.cellId}`, t);
|
|
27293
|
+
}), n.filter((e, t) => yb.has(e.type) && "cellId" in e ? r.get(`${e.type}:${e.cellId}`) === t : !0);
|
|
27294
|
+
}
|
|
27295
|
+
var Sb = [], Cb = [], wb = Promise.resolve(), Tb = 0, Eb = null, Db = { status: "synchronized" };
|
|
27296
|
+
function Ob() {
|
|
27297
|
+
if (Db.status === "failed") return;
|
|
27298
|
+
let e = xb(Sb);
|
|
27299
|
+
Sb = [], e.length > 0 && Cb.push(e);
|
|
27300
|
+
}
|
|
27301
|
+
async function kb(e) {
|
|
27302
|
+
if (e === Tb) {
|
|
27303
|
+
if (Db.status === "failed") throw Db.error;
|
|
27304
|
+
for (; Cb.length > 0;) {
|
|
27305
|
+
let t = Cb[0];
|
|
27294
27306
|
try {
|
|
27295
27307
|
await nl().sendDocumentTransaction({ changes: t });
|
|
27296
27308
|
} catch (t) {
|
|
27297
|
-
if (e !==
|
|
27298
|
-
throw
|
|
27309
|
+
if (e !== Tb) return;
|
|
27310
|
+
throw Db = {
|
|
27299
27311
|
status: "failed",
|
|
27300
27312
|
error: t
|
|
27301
|
-
},
|
|
27313
|
+
}, Cb = Cb.slice(1), t;
|
|
27302
27314
|
}
|
|
27303
|
-
if (e !==
|
|
27304
|
-
|
|
27315
|
+
if (e !== Tb) return;
|
|
27316
|
+
Cb.shift();
|
|
27305
27317
|
}
|
|
27306
27318
|
}
|
|
27307
27319
|
}
|
|
27308
|
-
function
|
|
27309
|
-
let e =
|
|
27310
|
-
return
|
|
27320
|
+
function Ab() {
|
|
27321
|
+
let e = Tb, t = Eb?.promise ?? Promise.resolve(), n = Promise.all([wb.catch(() => void 0), t]).then(() => kb(e));
|
|
27322
|
+
return wb = n, n;
|
|
27311
27323
|
}
|
|
27312
|
-
var
|
|
27313
|
-
|
|
27324
|
+
var jb = je(() => {
|
|
27325
|
+
Ob(), Ab().catch(() => void 0);
|
|
27314
27326
|
}, 400);
|
|
27315
|
-
async function
|
|
27316
|
-
if (
|
|
27317
|
-
|
|
27318
|
-
let e =
|
|
27327
|
+
async function Mb() {
|
|
27328
|
+
if (Db.status === "failed") throw Db.error;
|
|
27329
|
+
jb.cancel(), Ob();
|
|
27330
|
+
let e = Ab();
|
|
27319
27331
|
for (;;) {
|
|
27320
|
-
if (await e,
|
|
27321
|
-
e =
|
|
27332
|
+
if (await e, jb.cancel(), Ob(), Sb.length === 0 && Cb.length === 0 && wb === e) return;
|
|
27333
|
+
e = wb === e ? Ab() : wb;
|
|
27322
27334
|
}
|
|
27323
27335
|
}
|
|
27324
|
-
function
|
|
27336
|
+
function Nb(e) {
|
|
27325
27337
|
return "cellId" in e && e.cellId === "__scratch__";
|
|
27326
27338
|
}
|
|
27327
|
-
function
|
|
27328
|
-
j.get(fe) ||
|
|
27339
|
+
function Pb(e) {
|
|
27340
|
+
j.get(fe) || Nb(e) || (Sb.push(e), Db.status === "synchronized" && jb());
|
|
27329
27341
|
}
|
|
27330
|
-
function
|
|
27331
|
-
for (let r of
|
|
27342
|
+
function Fb(e, t, n) {
|
|
27343
|
+
for (let r of vb(e, t, n)) Pb(r);
|
|
27332
27344
|
}
|
|
27333
27345
|
//#endregion
|
|
27334
27346
|
//#region ../node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/fromUnixTime.js
|
|
27335
|
-
function
|
|
27347
|
+
function Ib(e, t) {
|
|
27336
27348
|
return ge(e * 1e3, t?.in);
|
|
27337
27349
|
}
|
|
27338
27350
|
//#endregion
|
|
27339
27351
|
//#region ../node_modules/.pnpm/ansi_up@6.0.6/node_modules/ansi_up/ansi_up.js
|
|
27340
|
-
var
|
|
27352
|
+
var Lb = function(e, t) {
|
|
27341
27353
|
return Object.defineProperty ? Object.defineProperty(e, "raw", { value: t }) : e.raw = t, e;
|
|
27342
|
-
},
|
|
27354
|
+
}, Rb;
|
|
27343
27355
|
(function(e) {
|
|
27344
27356
|
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";
|
|
27345
|
-
})(
|
|
27346
|
-
var
|
|
27357
|
+
})(Rb ||= {});
|
|
27358
|
+
var zb = class {
|
|
27347
27359
|
constructor() {
|
|
27348
27360
|
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 = {
|
|
27349
27361
|
http: 1,
|
|
@@ -27575,57 +27587,57 @@ var Rb = class {
|
|
|
27575
27587
|
}
|
|
27576
27588
|
get_next_packet() {
|
|
27577
27589
|
var e = {
|
|
27578
|
-
kind:
|
|
27590
|
+
kind: Rb.EOS,
|
|
27579
27591
|
text: "",
|
|
27580
27592
|
url: ""
|
|
27581
27593
|
}, t = this._buffer.length;
|
|
27582
27594
|
if (t == 0) return e;
|
|
27583
27595
|
var n = this._buffer.indexOf("\x1B");
|
|
27584
|
-
if (n == -1) return e.kind =
|
|
27585
|
-
if (n > 0) return e.kind =
|
|
27596
|
+
if (n == -1) return e.kind = Rb.Text, e.text = this._buffer, this._buffer = "", e;
|
|
27597
|
+
if (n > 0) return e.kind = Rb.Text, e.text = this._buffer.slice(0, n), this._buffer = this._buffer.slice(n), e;
|
|
27586
27598
|
if (n == 0) {
|
|
27587
|
-
if (t < 3) return e.kind =
|
|
27599
|
+
if (t < 3) return e.kind = Rb.Incomplete, e;
|
|
27588
27600
|
var r = this._buffer.charAt(1);
|
|
27589
|
-
if (r != "[" && r != "]" && r != "(") return e.kind =
|
|
27601
|
+
if (r != "[" && r != "]" && r != "(") return e.kind = Rb.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
27590
27602
|
if (r == "[") {
|
|
27591
|
-
this._csi_regex ||=
|
|
27603
|
+
this._csi_regex ||= Bb(Hb ||= Lb(["\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 "]));
|
|
27592
27604
|
let t = this._buffer.match(this._csi_regex);
|
|
27593
|
-
if (t === null) return e.kind =
|
|
27594
|
-
if (t[4]) return e.kind =
|
|
27595
|
-
e.kind = t[1] != "" || t[3] != "m" ?
|
|
27605
|
+
if (t === null) return e.kind = Rb.Incomplete, e;
|
|
27606
|
+
if (t[4]) return e.kind = Rb.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
27607
|
+
e.kind = t[1] != "" || t[3] != "m" ? Rb.Unknown : Rb.SGR, e.text = t[2];
|
|
27596
27608
|
var i = t[0].length;
|
|
27597
27609
|
return this._buffer = this._buffer.slice(i), e;
|
|
27598
27610
|
}
|
|
27599
27611
|
if (r == "]") {
|
|
27600
|
-
if (t < 4) return e.kind =
|
|
27601
|
-
if (this._buffer.charAt(2) != "8" || this._buffer.charAt(3) != ";") return e.kind =
|
|
27602
|
-
this._osc_st ||=
|
|
27612
|
+
if (t < 4) return e.kind = Rb.Incomplete, e;
|
|
27613
|
+
if (this._buffer.charAt(2) != "8" || this._buffer.charAt(3) != ";") return e.kind = Rb.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
27614
|
+
this._osc_st ||= Vb(Ub ||= Lb(["\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;
|
|
27603
27615
|
{
|
|
27604
27616
|
let t = this._osc_st.exec(this._buffer);
|
|
27605
|
-
if (t === null) return e.kind =
|
|
27606
|
-
if (t[3]) return e.kind =
|
|
27617
|
+
if (t === null) return e.kind = Rb.Incomplete, e;
|
|
27618
|
+
if (t[3]) return e.kind = Rb.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
27607
27619
|
}
|
|
27608
27620
|
{
|
|
27609
27621
|
let t = this._osc_st.exec(this._buffer);
|
|
27610
|
-
if (t === null) return e.kind =
|
|
27611
|
-
if (t[3]) return e.kind =
|
|
27622
|
+
if (t === null) return e.kind = Rb.Incomplete, e;
|
|
27623
|
+
if (t[3]) return e.kind = Rb.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
27612
27624
|
}
|
|
27613
|
-
this._osc_regex ||=
|
|
27625
|
+
this._osc_regex ||= Bb(Wb ||= Lb(["\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 "]));
|
|
27614
27626
|
let n = this._buffer.match(this._osc_regex);
|
|
27615
|
-
if (n === null) return e.kind =
|
|
27616
|
-
e.kind =
|
|
27627
|
+
if (n === null) return e.kind = Rb.ESC, e.text = this._buffer.slice(0, 1), this._buffer = this._buffer.slice(1), e;
|
|
27628
|
+
e.kind = Rb.OSCURL, e.url = n[1], e.text = n[2];
|
|
27617
27629
|
var i = n[0].length;
|
|
27618
27630
|
return this._buffer = this._buffer.slice(i), e;
|
|
27619
27631
|
}
|
|
27620
|
-
if (r == "(") return e.kind =
|
|
27632
|
+
if (r == "(") return e.kind = Rb.Unknown, this._buffer = this._buffer.slice(3), e;
|
|
27621
27633
|
}
|
|
27622
27634
|
}
|
|
27623
27635
|
ansi_to_html(e) {
|
|
27624
27636
|
this.append_buffer(e);
|
|
27625
27637
|
for (var t = [];;) {
|
|
27626
27638
|
var n = this.get_next_packet();
|
|
27627
|
-
if (n.kind ==
|
|
27628
|
-
n.kind !=
|
|
27639
|
+
if (n.kind == Rb.EOS || n.kind == Rb.Incomplete) break;
|
|
27640
|
+
n.kind != Rb.ESC && n.kind != Rb.Unknown && (n.kind == Rb.Text ? t.push(this.transform_to_html(this.with_state(n))) : n.kind == Rb.SGR ? this.process_ansi(n) : n.kind == Rb.OSCURL && t.push(this.process_hyperlink(n)));
|
|
27629
27641
|
}
|
|
27630
27642
|
return t.join("");
|
|
27631
27643
|
}
|
|
@@ -27695,16 +27707,16 @@ var Rb = class {
|
|
|
27695
27707
|
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>`;
|
|
27696
27708
|
}
|
|
27697
27709
|
};
|
|
27698
|
-
function
|
|
27710
|
+
function Bb(e, ...t) {
|
|
27699
27711
|
let n = e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm, "");
|
|
27700
27712
|
return new RegExp(n);
|
|
27701
27713
|
}
|
|
27702
|
-
function
|
|
27714
|
+
function Vb(e, ...t) {
|
|
27703
27715
|
let n = e.raw[0].replace(/^\s+|\s+\n|\s*#[\s\S]*?\n|\n/gm, "");
|
|
27704
27716
|
return new RegExp(n, "g");
|
|
27705
27717
|
}
|
|
27706
|
-
var
|
|
27707
|
-
function
|
|
27718
|
+
var Hb, Ub, Wb, Gb = new zb();
|
|
27719
|
+
function Kb(e) {
|
|
27708
27720
|
try {
|
|
27709
27721
|
let t = document.createElement("div");
|
|
27710
27722
|
return t.innerHTML = e, (t.textContent || t.innerText || "").split("\n").map((e) => e.trimEnd()).join("\n");
|
|
@@ -27712,24 +27724,24 @@ function Gb(e) {
|
|
|
27712
27724
|
return a.error("Error parsing HTML content:", t), e;
|
|
27713
27725
|
}
|
|
27714
27726
|
}
|
|
27715
|
-
function
|
|
27727
|
+
function qb(e) {
|
|
27716
27728
|
if (!e) return "";
|
|
27717
27729
|
try {
|
|
27718
|
-
return Gb
|
|
27730
|
+
return Kb(Gb.ansi_to_html(e));
|
|
27719
27731
|
} catch (t) {
|
|
27720
27732
|
return a.error("Error converting ANSI to plain text:", t), e;
|
|
27721
27733
|
}
|
|
27722
27734
|
}
|
|
27723
27735
|
//#endregion
|
|
27724
27736
|
//#region src/core/errors/traceback-atom.ts
|
|
27725
|
-
var
|
|
27737
|
+
var Jb = A(null);
|
|
27726
27738
|
//#endregion
|
|
27727
27739
|
//#region src/core/cells/logs.ts
|
|
27728
|
-
function
|
|
27740
|
+
function Yb(e) {
|
|
27729
27741
|
return e.type === "cell" ? e.cellId : `lsp:${e.name}`;
|
|
27730
27742
|
}
|
|
27731
|
-
var
|
|
27732
|
-
function
|
|
27743
|
+
var Xb = !1;
|
|
27744
|
+
function Zb(e) {
|
|
27733
27745
|
let t = [], n = [e.console].filter(Boolean).flat();
|
|
27734
27746
|
for (let r of n) {
|
|
27735
27747
|
let n = r.mimetype === "text/plain", i = r.mimetype === "text/html" || r.mimetype === "application/vnd.marimo+traceback";
|
|
@@ -27739,7 +27751,7 @@ function Xb(e) {
|
|
|
27739
27751
|
case "stdout":
|
|
27740
27752
|
case "stderr":
|
|
27741
27753
|
case "marimo-error": {
|
|
27742
|
-
let a = ne.asString(r.data), o = i ?
|
|
27754
|
+
let a = ne.asString(r.data), o = i ? Kb(a) : a;
|
|
27743
27755
|
t.push({
|
|
27744
27756
|
timestamp: r.timestamp || Date.now(),
|
|
27745
27757
|
level: n ? "stderr" : "stdout",
|
|
@@ -27754,9 +27766,9 @@ function Xb(e) {
|
|
|
27754
27766
|
}
|
|
27755
27767
|
}
|
|
27756
27768
|
}
|
|
27757
|
-
if (t.forEach(
|
|
27769
|
+
if (t.forEach(Qb.log), n.length === 0 && Vc(e.output?.mimetype) && Array.isArray(e.output.data)) {
|
|
27758
27770
|
e.output.data.forEach((t) => {
|
|
27759
|
-
|
|
27771
|
+
Qb.log({
|
|
27760
27772
|
level: "stderr",
|
|
27761
27773
|
source: {
|
|
27762
27774
|
type: "cell",
|
|
@@ -27767,8 +27779,8 @@ function Xb(e) {
|
|
|
27767
27779
|
});
|
|
27768
27780
|
});
|
|
27769
27781
|
let t = e.output.data.filter((e) => "type" in e && e.type === "exception" || e.type === "internal"), n = j.get(E) === "read";
|
|
27770
|
-
if (t.length > 0 && !
|
|
27771
|
-
|
|
27782
|
+
if (t.length > 0 && !Xb && n) {
|
|
27783
|
+
Xb = !0;
|
|
27772
27784
|
let e = t.find((e) => e.traceback);
|
|
27773
27785
|
f(e ? {
|
|
27774
27786
|
title: "An internal error occurred",
|
|
@@ -27777,7 +27789,7 @@ function Xb(e) {
|
|
|
27777
27789
|
action: F.createElement(Ae, {
|
|
27778
27790
|
altText: "View traceback",
|
|
27779
27791
|
onClick: () => {
|
|
27780
|
-
j.set(
|
|
27792
|
+
j.set(Jb, {
|
|
27781
27793
|
traceback: e.traceback,
|
|
27782
27794
|
errorMessage: e.msg || "An internal error occurred"
|
|
27783
27795
|
});
|
|
@@ -27792,13 +27804,13 @@ function Xb(e) {
|
|
|
27792
27804
|
}
|
|
27793
27805
|
return t;
|
|
27794
27806
|
}
|
|
27795
|
-
var
|
|
27807
|
+
var Qb = { log: (e) => {
|
|
27796
27808
|
let t = e.level === "stdout" ? "gray" : e.level === "stderr" ? "red" : "orange", n = e.level.toUpperCase();
|
|
27797
|
-
console.log(`%c[${n}]`, `color:${t}; padding:2px 0; border-radius:2px; font-weight:bold`, `[${
|
|
27809
|
+
console.log(`%c[${n}]`, `color:${t}; padding:2px 0; border-radius:2px; font-weight:bold`, `[${$b(e.timestamp)}]`, `(${Yb(e.source)}) ${e.message}`);
|
|
27798
27810
|
} };
|
|
27799
|
-
function
|
|
27811
|
+
function $b(e) {
|
|
27800
27812
|
try {
|
|
27801
|
-
return
|
|
27813
|
+
return Ib(e).toLocaleTimeString(void 0, {
|
|
27802
27814
|
hour12: !0,
|
|
27803
27815
|
hour: "numeric",
|
|
27804
27816
|
minute: "numeric",
|
|
@@ -27810,10 +27822,10 @@ function Qb(e) {
|
|
|
27810
27822
|
}
|
|
27811
27823
|
//#endregion
|
|
27812
27824
|
//#region src/components/editor/navigation/focus-utils.ts
|
|
27813
|
-
function
|
|
27825
|
+
function ex() {
|
|
27814
27826
|
return document.activeElement instanceof HTMLElement && document.activeElement.classList.contains("marimo-cell");
|
|
27815
27827
|
}
|
|
27816
|
-
function
|
|
27828
|
+
function tx(e) {
|
|
27817
27829
|
try {
|
|
27818
27830
|
e.focus();
|
|
27819
27831
|
} catch {
|
|
@@ -27822,7 +27834,7 @@ function ex(e) {
|
|
|
27822
27834
|
}
|
|
27823
27835
|
//#endregion
|
|
27824
27836
|
//#region src/utils/timeout.ts
|
|
27825
|
-
function
|
|
27837
|
+
function nx(e, t) {
|
|
27826
27838
|
let { retries: n, delay: r, initialDelay: i = 0 } = t, o = 0, s = () => {
|
|
27827
27839
|
if (o < n) {
|
|
27828
27840
|
try {
|
|
@@ -27837,18 +27849,18 @@ function tx(e, t) {
|
|
|
27837
27849
|
}
|
|
27838
27850
|
//#endregion
|
|
27839
27851
|
//#region src/core/cells/scrollCellIntoView.ts
|
|
27840
|
-
function
|
|
27852
|
+
function rx({ cellId: e, cell: t, isCodeHidden: n, codeFocus: r, variableName: i }) {
|
|
27841
27853
|
if (!t) return;
|
|
27842
27854
|
let o = document.getElementById(Jr.create(e));
|
|
27843
27855
|
if (!o) {
|
|
27844
27856
|
a.warn("scrollCellIntoView: element not found");
|
|
27845
27857
|
return;
|
|
27846
27858
|
}
|
|
27847
|
-
if (
|
|
27848
|
-
|
|
27859
|
+
if (ex()) {
|
|
27860
|
+
tx(o);
|
|
27849
27861
|
return;
|
|
27850
27862
|
}
|
|
27851
|
-
if (n)
|
|
27863
|
+
if (n) tx(o);
|
|
27852
27864
|
else {
|
|
27853
27865
|
Ei.promote(e);
|
|
27854
27866
|
let n = t.current?.editorView;
|
|
@@ -27857,7 +27869,7 @@ function nx({ cellId: e, cell: t, isCodeHidden: n, codeFocus: r, variableName: i
|
|
|
27857
27869
|
return;
|
|
27858
27870
|
}
|
|
27859
27871
|
if (n.hasFocus || !document.hasFocus()) return;
|
|
27860
|
-
if (
|
|
27872
|
+
if (nx(() => (n.focus(), n.hasFocus), {
|
|
27861
27873
|
retries: 5,
|
|
27862
27874
|
delay: 20
|
|
27863
27875
|
}), r === "top") n.dispatch({ selection: {
|
|
@@ -27877,14 +27889,14 @@ function nx({ cellId: e, cell: t, isCodeHidden: n, codeFocus: r, variableName: i
|
|
|
27877
27889
|
block: "nearest"
|
|
27878
27890
|
});
|
|
27879
27891
|
}
|
|
27880
|
-
function
|
|
27892
|
+
function ix() {
|
|
27881
27893
|
let e = document.getElementById("App");
|
|
27882
27894
|
e?.scrollTo({
|
|
27883
27895
|
top: e.scrollHeight,
|
|
27884
27896
|
behavior: "smooth"
|
|
27885
27897
|
});
|
|
27886
27898
|
}
|
|
27887
|
-
function
|
|
27899
|
+
function ax() {
|
|
27888
27900
|
document.getElementById("App")?.scrollTo({
|
|
27889
27901
|
top: 0,
|
|
27890
27902
|
behavior: "smooth"
|
|
@@ -27892,7 +27904,7 @@ function ix() {
|
|
|
27892
27904
|
}
|
|
27893
27905
|
//#endregion
|
|
27894
27906
|
//#region src/core/cells/types.ts
|
|
27895
|
-
function
|
|
27907
|
+
function ox({ id: e, name: t = "_", code: n = "", lastCodeRun: r = null, lastExecutionTime: i = null, edited: a = !1, config: o, serializedEditorState: s = null }) {
|
|
27896
27908
|
return {
|
|
27897
27909
|
id: e,
|
|
27898
27910
|
config: o || {
|
|
@@ -27909,7 +27921,7 @@ function ax({ id: e, name: t = "_", code: n = "", lastCodeRun: r = null, lastExe
|
|
|
27909
27921
|
serializedEditorState: s
|
|
27910
27922
|
};
|
|
27911
27923
|
}
|
|
27912
|
-
function
|
|
27924
|
+
function sx(e) {
|
|
27913
27925
|
return {
|
|
27914
27926
|
hide_code: !1,
|
|
27915
27927
|
disabled: !1,
|
|
@@ -27918,7 +27930,7 @@ function ox(e) {
|
|
|
27918
27930
|
...e
|
|
27919
27931
|
};
|
|
27920
27932
|
}
|
|
27921
|
-
function
|
|
27933
|
+
function cx(e) {
|
|
27922
27934
|
return {
|
|
27923
27935
|
outline: null,
|
|
27924
27936
|
output: null,
|
|
@@ -27937,7 +27949,7 @@ function sx(e) {
|
|
|
27937
27949
|
}
|
|
27938
27950
|
//#endregion
|
|
27939
27951
|
//#region src/core/cells/cells.ts
|
|
27940
|
-
function
|
|
27952
|
+
function lx(e) {
|
|
27941
27953
|
let t = {
|
|
27942
27954
|
column: 0,
|
|
27943
27955
|
hide_code: !1,
|
|
@@ -27947,14 +27959,14 @@ function cx(e) {
|
|
|
27947
27959
|
return {
|
|
27948
27960
|
...e,
|
|
27949
27961
|
cellData: {
|
|
27950
|
-
[Gr]:
|
|
27962
|
+
[Gr]: ox({
|
|
27951
27963
|
id: Gr,
|
|
27952
27964
|
config: t
|
|
27953
27965
|
}),
|
|
27954
27966
|
...e.cellData
|
|
27955
27967
|
},
|
|
27956
27968
|
cellRuntime: {
|
|
27957
|
-
[Gr]:
|
|
27969
|
+
[Gr]: cx(),
|
|
27958
27970
|
...e.cellRuntime
|
|
27959
27971
|
},
|
|
27960
27972
|
cellHandles: {
|
|
@@ -27963,8 +27975,8 @@ function cx(e) {
|
|
|
27963
27975
|
}
|
|
27964
27976
|
};
|
|
27965
27977
|
}
|
|
27966
|
-
function
|
|
27967
|
-
return
|
|
27978
|
+
function ux() {
|
|
27979
|
+
return lx({
|
|
27968
27980
|
cellIds: yi.from([]),
|
|
27969
27981
|
cellData: {},
|
|
27970
27982
|
cellRuntime: {},
|
|
@@ -27975,7 +27987,7 @@ function lx() {
|
|
|
27975
27987
|
untouchedNewCells: /* @__PURE__ */ new Set()
|
|
27976
27988
|
});
|
|
27977
27989
|
}
|
|
27978
|
-
var { reducer:
|
|
27990
|
+
var { reducer: dx, addMiddleware: fx, createActions: px, useActions: mx, valueAtom: $ } = y(ux, {
|
|
27979
27991
|
createNewCell: (e, t) => {
|
|
27980
27992
|
let { cellId: n, before: r, code: i, name: a, config: o, lastCodeRun: s = null, lastExecutionTime: c = null, autoFocus: l = !0, skipIfCodeExists: u = !1, hideCode: d = void 0 } = t, f, p;
|
|
27981
27993
|
if (u) {
|
|
@@ -27997,12 +28009,12 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
27997
28009
|
cellIds: e.cellIds.insertId(m, f, h),
|
|
27998
28010
|
cellData: {
|
|
27999
28011
|
...e.cellData,
|
|
28000
|
-
[m]:
|
|
28012
|
+
[m]: ox({
|
|
28001
28013
|
id: m,
|
|
28002
28014
|
code: i,
|
|
28003
28015
|
name: a,
|
|
28004
28016
|
lastCodeRun: s,
|
|
28005
|
-
config:
|
|
28017
|
+
config: sx({
|
|
28006
28018
|
...o,
|
|
28007
28019
|
...d != null && { hide_code: d }
|
|
28008
28020
|
}),
|
|
@@ -28012,7 +28024,7 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28012
28024
|
},
|
|
28013
28025
|
cellRuntime: {
|
|
28014
28026
|
...e.cellRuntime,
|
|
28015
|
-
[m]:
|
|
28027
|
+
[m]: cx()
|
|
28016
28028
|
},
|
|
28017
28029
|
cellHandles: {
|
|
28018
28030
|
...e.cellHandles,
|
|
@@ -28114,10 +28126,10 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28114
28126
|
let { cellId: r, where: i } = t, a = n.indexOfOrThrow(r), o;
|
|
28115
28127
|
o = i === "before" ? Nt(a - 1, 0, n.length - 1) : i === "after" ? Nt(a + 1, 0, n.length - 1) : a;
|
|
28116
28128
|
let s = n.atOrThrow(o);
|
|
28117
|
-
return
|
|
28129
|
+
return rx({
|
|
28118
28130
|
cellId: s,
|
|
28119
28131
|
cell: e.cellHandles[s],
|
|
28120
|
-
isCodeHidden:
|
|
28132
|
+
isCodeHidden: hx(e, s),
|
|
28121
28133
|
codeFocus: i === "after" ? "top" : "bottom",
|
|
28122
28134
|
variableName: void 0
|
|
28123
28135
|
}), e;
|
|
@@ -28126,25 +28138,25 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28126
28138
|
let t = e.cellIds.getColumns().at(0);
|
|
28127
28139
|
if (t === void 0 || t.length === 0) return e;
|
|
28128
28140
|
let n = t.first();
|
|
28129
|
-
return
|
|
28141
|
+
return rx({
|
|
28130
28142
|
cellId: n,
|
|
28131
28143
|
cell: e.cellHandles[n],
|
|
28132
|
-
isCodeHidden:
|
|
28144
|
+
isCodeHidden: hx(e, n),
|
|
28133
28145
|
codeFocus: void 0,
|
|
28134
28146
|
variableName: void 0
|
|
28135
|
-
}),
|
|
28147
|
+
}), ax(), e;
|
|
28136
28148
|
},
|
|
28137
28149
|
focusBottomCell: (e) => {
|
|
28138
28150
|
let t = e.cellIds.getColumns().at(-1);
|
|
28139
28151
|
if (t === void 0 || t.length === 0) return e;
|
|
28140
28152
|
let n = t.last();
|
|
28141
|
-
return
|
|
28153
|
+
return rx({
|
|
28142
28154
|
cellId: n,
|
|
28143
28155
|
cell: e.cellHandles[n],
|
|
28144
|
-
isCodeHidden:
|
|
28156
|
+
isCodeHidden: hx(e, n),
|
|
28145
28157
|
codeFocus: void 0,
|
|
28146
28158
|
variableName: void 0
|
|
28147
|
-
}),
|
|
28159
|
+
}), ix(), e;
|
|
28148
28160
|
},
|
|
28149
28161
|
sendToTop: (e, t) => {
|
|
28150
28162
|
let n = e.cellIds.findWithId(t.cellId);
|
|
@@ -28173,11 +28185,11 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28173
28185
|
cellIds: e.cellIds.addColumn(t.columnId, [n]),
|
|
28174
28186
|
cellData: {
|
|
28175
28187
|
...e.cellData,
|
|
28176
|
-
[n]:
|
|
28188
|
+
[n]: ox({ id: n })
|
|
28177
28189
|
},
|
|
28178
28190
|
cellRuntime: {
|
|
28179
28191
|
...e.cellRuntime,
|
|
28180
|
-
[n]:
|
|
28192
|
+
[n]: cx()
|
|
28181
28193
|
},
|
|
28182
28194
|
cellHandles: {
|
|
28183
28195
|
...e.cellHandles,
|
|
@@ -28223,7 +28235,7 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28223
28235
|
let i = r.indexOfOrThrow(n), o = i === 0 ? 1 : i - 1, s = null;
|
|
28224
28236
|
r.length > 1 && (s = r.atOrThrow(o));
|
|
28225
28237
|
let c = (e.cellHandles[n].current?.editorView)?.state.toJSON({ history: Tt });
|
|
28226
|
-
c && (c.doc = e.cellData[n].code),
|
|
28238
|
+
c && (c.doc = e.cellData[n].code), Px(n);
|
|
28227
28239
|
let l = e.cellData[n];
|
|
28228
28240
|
return {
|
|
28229
28241
|
...e,
|
|
@@ -28261,7 +28273,7 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28261
28273
|
scrollKey: n[0] ?? null
|
|
28262
28274
|
};
|
|
28263
28275
|
}
|
|
28264
|
-
let { name: n, serializedEditorState: r = { doc: "" }, column: i, index: a, isSetupCell: o, config: s } = t, c = o ? Kr : qr.create(), l =
|
|
28276
|
+
let { name: n, serializedEditorState: r = { doc: "" }, column: i, index: a, isSetupCell: o, config: s } = t, c = o ? Kr : qr.create(), l = ox({
|
|
28265
28277
|
id: c,
|
|
28266
28278
|
name: n,
|
|
28267
28279
|
code: r.doc,
|
|
@@ -28278,7 +28290,7 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28278
28290
|
},
|
|
28279
28291
|
cellRuntime: {
|
|
28280
28292
|
...e.cellRuntime,
|
|
28281
|
-
[c]:
|
|
28293
|
+
[c]: cx()
|
|
28282
28294
|
},
|
|
28283
28295
|
cellHandles: {
|
|
28284
28296
|
...e.cellHandles,
|
|
@@ -28290,7 +28302,7 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28290
28302
|
},
|
|
28291
28303
|
clearSerializedEditorState: (e, t) => {
|
|
28292
28304
|
let { cellId: n } = t;
|
|
28293
|
-
return
|
|
28305
|
+
return _x({
|
|
28294
28306
|
state: e,
|
|
28295
28307
|
cellId: n,
|
|
28296
28308
|
cellReducer: (e) => ({
|
|
@@ -28301,7 +28313,7 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28301
28313
|
},
|
|
28302
28314
|
updateCellCode: (e, t) => {
|
|
28303
28315
|
let { cellId: n, code: r, formattingChange: i } = t;
|
|
28304
|
-
return e.cellData[n] ?
|
|
28316
|
+
return e.cellData[n] ? _x({
|
|
28305
28317
|
state: e,
|
|
28306
28318
|
cellId: n,
|
|
28307
28319
|
cellReducer: (e) => i ? {
|
|
@@ -28317,7 +28329,7 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28317
28329
|
},
|
|
28318
28330
|
updateCellName: (e, t) => {
|
|
28319
28331
|
let { cellId: n, name: r } = t;
|
|
28320
|
-
return
|
|
28332
|
+
return _x({
|
|
28321
28333
|
state: e,
|
|
28322
28334
|
cellId: n,
|
|
28323
28335
|
cellReducer: (e) => ({
|
|
@@ -28328,23 +28340,23 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28328
28340
|
},
|
|
28329
28341
|
updateCellConfig: (e, t) => {
|
|
28330
28342
|
let { cellId: n, config: r } = t;
|
|
28331
|
-
return
|
|
28343
|
+
return _x({
|
|
28332
28344
|
state: e,
|
|
28333
28345
|
cellId: n,
|
|
28334
28346
|
cellReducer: (e) => ({
|
|
28335
28347
|
...e,
|
|
28336
|
-
config:
|
|
28348
|
+
config: sx({
|
|
28337
28349
|
...e.config,
|
|
28338
28350
|
...r
|
|
28339
28351
|
})
|
|
28340
28352
|
})
|
|
28341
28353
|
});
|
|
28342
28354
|
},
|
|
28343
|
-
prepareForRun: (e, t) =>
|
|
28344
|
-
state:
|
|
28355
|
+
prepareForRun: (e, t) => _x({
|
|
28356
|
+
state: gx({
|
|
28345
28357
|
state: e,
|
|
28346
28358
|
cellId: t.cellId,
|
|
28347
|
-
cellReducer: (e) =>
|
|
28359
|
+
cellReducer: (e) => lb(e)
|
|
28348
28360
|
}),
|
|
28349
28361
|
cellId: t.cellId,
|
|
28350
28362
|
cellReducer: (e) => ({
|
|
@@ -28354,12 +28366,12 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28354
28366
|
})
|
|
28355
28367
|
}),
|
|
28356
28368
|
handleCellMessage: (e, t) => {
|
|
28357
|
-
let n = t.cell_id, r =
|
|
28369
|
+
let n = t.cell_id, r = gx({
|
|
28358
28370
|
state: e,
|
|
28359
28371
|
cellId: n,
|
|
28360
|
-
cellReducer: (e) =>
|
|
28372
|
+
cellReducer: (e) => cb(e, t)
|
|
28361
28373
|
});
|
|
28362
|
-
return t.status === "queued" && (r =
|
|
28374
|
+
return t.status === "queued" && (r = _x({
|
|
28363
28375
|
state: r,
|
|
28364
28376
|
cellId: n,
|
|
28365
28377
|
cellReducer: (e) => ({
|
|
@@ -28369,7 +28381,7 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28369
28381
|
})
|
|
28370
28382
|
})), {
|
|
28371
28383
|
...r,
|
|
28372
|
-
cellLogs: [...r.cellLogs, ...
|
|
28384
|
+
cellLogs: [...r.cellLogs, ...Zb(t)]
|
|
28373
28385
|
};
|
|
28374
28386
|
},
|
|
28375
28387
|
addLogs: (e, t) => ({
|
|
@@ -28379,7 +28391,7 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28379
28391
|
setCellIds: (e, t) => {
|
|
28380
28392
|
if (Le(e.cellIds.inOrderIds, t.cellIds)) return e;
|
|
28381
28393
|
let n = { ...e.cellData }, r = { ...e.cellRuntime }, i = { ...e.cellHandles };
|
|
28382
|
-
for (let a of t.cellIds) a in e.cellData || (n[a] =
|
|
28394
|
+
for (let a of t.cellIds) a in e.cellData || (n[a] = ox({ id: a })), a in e.cellRuntime || (r[a] = cx()), a in e.cellHandles || (i[a] = (0, F.createRef)());
|
|
28383
28395
|
return {
|
|
28384
28396
|
...e,
|
|
28385
28397
|
cellIds: yi.fromWithPreviousShape(t.cellIds, e.cellIds),
|
|
@@ -28398,7 +28410,7 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28398
28410
|
setCellCodes: (e, t) => {
|
|
28399
28411
|
N(t.codes.length === t.ids.length, "Expected codes and ids to have the same length");
|
|
28400
28412
|
let n = { ...e }, r = ({ cell: e, code: r, cellId: i, name: a, config: o }) => {
|
|
28401
|
-
if (!e) return
|
|
28413
|
+
if (!e) return ox({
|
|
28402
28414
|
id: i,
|
|
28403
28415
|
code: r,
|
|
28404
28416
|
name: a,
|
|
@@ -28450,7 +28462,7 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28450
28462
|
},
|
|
28451
28463
|
setStdinResponse: (e, t) => {
|
|
28452
28464
|
let { cellId: n, response: r, outputIndex: i } = t;
|
|
28453
|
-
return
|
|
28465
|
+
return gx({
|
|
28454
28466
|
state: e,
|
|
28455
28467
|
cellId: n,
|
|
28456
28468
|
cellReducer: (e) => {
|
|
@@ -28460,6 +28472,7 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28460
28472
|
mimetype: n.mimetype,
|
|
28461
28473
|
data: n.data,
|
|
28462
28474
|
timestamp: n.timestamp,
|
|
28475
|
+
id: n.id,
|
|
28463
28476
|
response: n.mimetype === "text/password" ? "" : r
|
|
28464
28477
|
}, {
|
|
28465
28478
|
...e,
|
|
@@ -28471,11 +28484,11 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28471
28484
|
},
|
|
28472
28485
|
setCells: (e, t) => {
|
|
28473
28486
|
let n = Object.fromEntries(t.map((e) => [e.id, e])), r = _e(), i = (t) => {
|
|
28474
|
-
if (!r) return
|
|
28487
|
+
if (!r) return cx();
|
|
28475
28488
|
let n = e.cellRuntime[t];
|
|
28476
|
-
return n && (n.output != null || n.consoleOutputs.length > 0) ? n :
|
|
28489
|
+
return n && (n.output != null || n.consoleOutputs.length > 0) ? n : cx();
|
|
28477
28490
|
}, a = Object.fromEntries(t.map((e) => [e.id, i(e.id)]));
|
|
28478
|
-
return
|
|
28491
|
+
return lx({
|
|
28479
28492
|
...e,
|
|
28480
28493
|
cellIds: yi.fromIdsAndColumns(t.map((e) => [e.id, e.config.column])),
|
|
28481
28494
|
cellData: n,
|
|
@@ -28494,11 +28507,11 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28494
28507
|
cellIds: e.cellIds.insertId(t, a.id, s),
|
|
28495
28508
|
cellData: {
|
|
28496
28509
|
...e.cellData,
|
|
28497
|
-
[t]:
|
|
28510
|
+
[t]: ox({ id: t })
|
|
28498
28511
|
},
|
|
28499
28512
|
cellRuntime: {
|
|
28500
28513
|
...e.cellRuntime,
|
|
28501
|
-
[t]:
|
|
28514
|
+
[t]: cx()
|
|
28502
28515
|
},
|
|
28503
28516
|
cellHandles: {
|
|
28504
28517
|
...e.cellHandles,
|
|
@@ -28514,11 +28527,11 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28514
28527
|
cellIds: e.cellIds.insertId(t, a.id, 0),
|
|
28515
28528
|
cellData: {
|
|
28516
28529
|
...e.cellData,
|
|
28517
|
-
[t]:
|
|
28530
|
+
[t]: ox({ id: t })
|
|
28518
28531
|
},
|
|
28519
28532
|
cellRuntime: {
|
|
28520
28533
|
...e.cellRuntime,
|
|
28521
|
-
[t]:
|
|
28534
|
+
[t]: cx()
|
|
28522
28535
|
},
|
|
28523
28536
|
cellHandles: {
|
|
28524
28537
|
...e.cellHandles,
|
|
@@ -28530,10 +28543,10 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28530
28543
|
if ((c || l) && i) return e;
|
|
28531
28544
|
if (s >= 0 && s < a.length) {
|
|
28532
28545
|
let t = a.atOrThrow(s);
|
|
28533
|
-
|
|
28546
|
+
rx({
|
|
28534
28547
|
cellId: t,
|
|
28535
28548
|
cell: e.cellHandles[t],
|
|
28536
|
-
isCodeHidden:
|
|
28549
|
+
isCodeHidden: hx(e, t),
|
|
28537
28550
|
codeFocus: r ? "bottom" : "top",
|
|
28538
28551
|
variableName: void 0
|
|
28539
28552
|
});
|
|
@@ -28566,10 +28579,10 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28566
28579
|
let t = e.scrollKey;
|
|
28567
28580
|
if (t === null) return e;
|
|
28568
28581
|
let n = e.cellIds.findWithId(t), r = n.indexOfOrThrow(t), i = r === n.length - 1 ? n.last() : n.atOrThrow(r);
|
|
28569
|
-
return
|
|
28582
|
+
return rx({
|
|
28570
28583
|
cellId: i,
|
|
28571
28584
|
cell: e.cellHandles[i],
|
|
28572
|
-
isCodeHidden:
|
|
28585
|
+
isCodeHidden: hx(e, i),
|
|
28573
28586
|
codeFocus: void 0,
|
|
28574
28587
|
variableName: void 0
|
|
28575
28588
|
}), {
|
|
@@ -28649,7 +28662,7 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28649
28662
|
code: s,
|
|
28650
28663
|
edited: !!s && s.trim() !== a.lastCodeRun?.trim()
|
|
28651
28664
|
},
|
|
28652
|
-
[l]:
|
|
28665
|
+
[l]: ox({
|
|
28653
28666
|
id: l,
|
|
28654
28667
|
code: c,
|
|
28655
28668
|
edited: !!c
|
|
@@ -28662,7 +28675,7 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28662
28675
|
output: null,
|
|
28663
28676
|
consoleOutputs: []
|
|
28664
28677
|
},
|
|
28665
|
-
[l]:
|
|
28678
|
+
[l]: cx()
|
|
28666
28679
|
},
|
|
28667
28680
|
cellHandles: {
|
|
28668
28681
|
...e.cellHandles,
|
|
@@ -28700,7 +28713,7 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28700
28713
|
},
|
|
28701
28714
|
clearCellOutput: (e, t) => {
|
|
28702
28715
|
let { cellId: n } = t;
|
|
28703
|
-
return
|
|
28716
|
+
return gx({
|
|
28704
28717
|
state: e,
|
|
28705
28718
|
cellId: n,
|
|
28706
28719
|
cellReducer: (e) => ({
|
|
@@ -28712,7 +28725,7 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28712
28725
|
},
|
|
28713
28726
|
clearCellConsoleOutput: (e, t) => {
|
|
28714
28727
|
let { cellId: n } = t;
|
|
28715
|
-
return
|
|
28728
|
+
return gx({
|
|
28716
28729
|
state: e,
|
|
28717
28730
|
cellId: n,
|
|
28718
28731
|
cellReducer: (e) => ({
|
|
@@ -28743,7 +28756,7 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28743
28756
|
cellIds: e.cellIds.insertId(Kr, e.cellIds.atOrThrow(0).id, 0),
|
|
28744
28757
|
cellData: {
|
|
28745
28758
|
...e.cellData,
|
|
28746
|
-
[Kr]:
|
|
28759
|
+
[Kr]: ox({
|
|
28747
28760
|
id: Kr,
|
|
28748
28761
|
name: Kr,
|
|
28749
28762
|
code: n,
|
|
@@ -28752,7 +28765,7 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28752
28765
|
},
|
|
28753
28766
|
cellRuntime: {
|
|
28754
28767
|
...e.cellRuntime,
|
|
28755
|
-
[Kr]:
|
|
28768
|
+
[Kr]: cx()
|
|
28756
28769
|
},
|
|
28757
28770
|
cellHandles: {
|
|
28758
28771
|
...e.cellHandles,
|
|
@@ -28762,11 +28775,11 @@ var { reducer: ux, addMiddleware: dx, createActions: fx, useActions: px, valueAt
|
|
|
28762
28775
|
};
|
|
28763
28776
|
}
|
|
28764
28777
|
});
|
|
28765
|
-
|
|
28766
|
-
function
|
|
28778
|
+
fx(Fb);
|
|
28779
|
+
function hx(e, t) {
|
|
28767
28780
|
return !!e.cellData[t].config.hide_code && !e.untouchedNewCells.has(t);
|
|
28768
28781
|
}
|
|
28769
|
-
function
|
|
28782
|
+
function gx({ state: e, cellId: t, cellReducer: n }) {
|
|
28770
28783
|
return t in e.cellRuntime ? {
|
|
28771
28784
|
...e,
|
|
28772
28785
|
cellRuntime: {
|
|
@@ -28775,7 +28788,7 @@ function hx({ state: e, cellId: t, cellReducer: n }) {
|
|
|
28775
28788
|
}
|
|
28776
28789
|
} : (a.warn(`Cell ${t} not found in state`), e);
|
|
28777
28790
|
}
|
|
28778
|
-
function
|
|
28791
|
+
function _x({ state: e, cellId: t, cellReducer: n }) {
|
|
28779
28792
|
return t in e.cellData ? {
|
|
28780
28793
|
...e,
|
|
28781
28794
|
cellData: {
|
|
@@ -28784,11 +28797,11 @@ function gx({ state: e, cellId: t, cellReducer: n }) {
|
|
|
28784
28797
|
}
|
|
28785
28798
|
} : (a.warn(`Cell ${t} not found in state`), e);
|
|
28786
28799
|
}
|
|
28787
|
-
var
|
|
28788
|
-
j.set($, (t) =>
|
|
28789
|
-
}).addLogs,
|
|
28800
|
+
var vx = px((e) => {
|
|
28801
|
+
j.set($, (t) => dx(t, e));
|
|
28802
|
+
}).addLogs, yx = A((e) => e($).cellIds), bx = A((e) => e(yx).hasOnlyOneId());
|
|
28790
28803
|
A((e) => Kc(e($)).length > 0), A((e) => qc(e($)).length > 0), A((e) => Jc(e($))), A((e) => Yc(e($))), A((e) => Wc(e($)));
|
|
28791
|
-
var
|
|
28804
|
+
var xx = A((e) => {
|
|
28792
28805
|
let { cellIds: t, cellRuntime: n, cellData: r } = e($);
|
|
28793
28806
|
return t.inOrderIds.map((e) => {
|
|
28794
28807
|
let t = n[e], { name: i } = r[e];
|
|
@@ -28806,43 +28819,43 @@ var bx = A((e) => {
|
|
|
28806
28819
|
}
|
|
28807
28820
|
return null;
|
|
28808
28821
|
}).filter(Boolean);
|
|
28809
|
-
}),
|
|
28810
|
-
let t = e(
|
|
28822
|
+
}), Sx = A((e) => {
|
|
28823
|
+
let t = e(yx), n = e(kx);
|
|
28811
28824
|
return Ky(t.inOrderIds.map((e) => n[e].outline));
|
|
28812
28825
|
});
|
|
28813
|
-
A((e) => e(
|
|
28814
|
-
var
|
|
28826
|
+
A((e) => e(xx).length);
|
|
28827
|
+
var Cx = Ie(A((e) => {
|
|
28815
28828
|
let { cellIds: t, cellData: n } = e($);
|
|
28816
28829
|
return Pt.fromEntries(t.inOrderIds.map((e) => [e, n[e]?.name]));
|
|
28817
28830
|
}));
|
|
28818
28831
|
A((e) => e($).scrollKey);
|
|
28819
|
-
var
|
|
28832
|
+
var wx = () => Me(yx), Tx = () => Me(Cx), Ex = () => j.get($), Dx = () => j.get($).cellIds, Ox = () => {
|
|
28820
28833
|
let { cellIds: e, cellData: t } = j.get($);
|
|
28821
28834
|
return e.inOrderIds.map((e) => t[e]?.name).filter(Boolean);
|
|
28822
28835
|
};
|
|
28823
28836
|
br(pr($, (e) => e.cellIds.inOrderIds.map((t) => e.cellData[t])));
|
|
28824
|
-
var
|
|
28837
|
+
var kx = A((e) => e($).cellRuntime);
|
|
28825
28838
|
A((e) => Hc(e($))), A((e) => {
|
|
28826
28839
|
let { cellRuntime: t } = e($);
|
|
28827
28840
|
return Object.entries(t).every(([e, t]) => t.status !== "running" || e === "__scratch__");
|
|
28828
28841
|
}), A((e) => Uc(e($)));
|
|
28829
|
-
var
|
|
28842
|
+
var Ax = A((e) => e($).cellIds.colLength);
|
|
28830
28843
|
A((e) => e($).cellIds.idLength > 0), A((e) => e($).cellIds.getColumnIds());
|
|
28831
|
-
var
|
|
28832
|
-
function
|
|
28833
|
-
|
|
28844
|
+
var jx = lr((e) => A((t) => t($).cellData[e])), Mx = lr((e) => A((t) => t($).cellRuntime[e])), Nx = lr((e) => A((t) => t($).cellHandles[e]));
|
|
28845
|
+
function Px(e) {
|
|
28846
|
+
jx.remove(e), Mx.remove(e), Nx.remove(e);
|
|
28834
28847
|
}
|
|
28835
|
-
var
|
|
28848
|
+
var Fx = (e) => {
|
|
28836
28849
|
let { cellHandles: t } = j.get($);
|
|
28837
28850
|
return t[e].current?.editorView;
|
|
28838
|
-
},
|
|
28839
|
-
function
|
|
28851
|
+
}, Ix = (e) => (Ei.promote(e), Fx(e));
|
|
28852
|
+
function Lx(e) {
|
|
28840
28853
|
let t = (0, Tr.c)(2), n;
|
|
28841
|
-
return t[0] === e ? n = t[1] : (n = e === void 0 ? {} : e, t[0] = e, t[1] = n),
|
|
28854
|
+
return t[0] === e ? n = t[1] : (n = e === void 0 ? {} : e, t[0] = e, t[1] = n), mx(n);
|
|
28842
28855
|
}
|
|
28843
28856
|
//#endregion
|
|
28844
28857
|
//#region src/core/errors/error-entries.ts
|
|
28845
|
-
function
|
|
28858
|
+
function Rx(e) {
|
|
28846
28859
|
if (zc(e.mimetype)) {
|
|
28847
28860
|
if (!Array.isArray(e.data)) return null;
|
|
28848
28861
|
let t = e.data.filter((e) => !e.type.includes("ancestor"));
|
|
@@ -28853,23 +28866,23 @@ function Lx(e) {
|
|
|
28853
28866
|
tracebackHtml: e.data
|
|
28854
28867
|
} : null;
|
|
28855
28868
|
}
|
|
28856
|
-
function
|
|
28869
|
+
function zx(e) {
|
|
28857
28870
|
return e.some((e) => "traceback" in e && e.traceback);
|
|
28858
28871
|
}
|
|
28859
|
-
function
|
|
28872
|
+
function Bx(e) {
|
|
28860
28873
|
let t = e?.find((e) => Bc(e.mimetype));
|
|
28861
28874
|
if (!(!t || typeof t.data != "string" || t.data.length === 0)) return t.data;
|
|
28862
28875
|
}
|
|
28863
|
-
function
|
|
28876
|
+
function Vx(e, t) {
|
|
28864
28877
|
if (e.tracebackHtml) return e.tracebackHtml;
|
|
28865
|
-
if (!
|
|
28878
|
+
if (!zx(e.errorData)) return Bx(t);
|
|
28866
28879
|
}
|
|
28867
|
-
function
|
|
28880
|
+
function Hx(e) {
|
|
28868
28881
|
let { cellIds: t, cellRuntime: n, cellData: r } = e.get($), i = [];
|
|
28869
28882
|
for (let [e, a] of t.inOrderIds.entries()) {
|
|
28870
28883
|
let t = n[a], o = t.output;
|
|
28871
28884
|
if (!o || !Vc(o.mimetype)) continue;
|
|
28872
|
-
let s =
|
|
28885
|
+
let s = Rx(o);
|
|
28873
28886
|
if (!s) continue;
|
|
28874
28887
|
let c = hv(r[a].name, e), l = r[a].lastCodeRun ?? r[a].code;
|
|
28875
28888
|
i.push({
|
|
@@ -28877,21 +28890,21 @@ function Vx(e) {
|
|
|
28877
28890
|
cellName: c,
|
|
28878
28891
|
cellCode: l,
|
|
28879
28892
|
errorData: s.errorData,
|
|
28880
|
-
tracebackHtml:
|
|
28893
|
+
tracebackHtml: Vx(s, t.consoleOutputs)
|
|
28881
28894
|
});
|
|
28882
28895
|
}
|
|
28883
28896
|
return i;
|
|
28884
28897
|
}
|
|
28885
|
-
function Hx(e) {
|
|
28886
|
-
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 === "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" : (T(e), "Unknown error");
|
|
28887
|
-
}
|
|
28888
28898
|
function Ux(e) {
|
|
28889
|
-
|
|
28890
|
-
return "traceback" in e && e.traceback && (t += `\n\nTraceback:\n${Gb(e.traceback)}`), t;
|
|
28899
|
+
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 === "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" : (T(e), "Unknown error");
|
|
28891
28900
|
}
|
|
28892
28901
|
function Wx(e) {
|
|
28902
|
+
let t = Ux(e);
|
|
28903
|
+
return "traceback" in e && e.traceback && (t += `\n\nTraceback:\n${Kb(e.traceback)}`), t;
|
|
28904
|
+
}
|
|
28905
|
+
function Gx(e) {
|
|
28893
28906
|
let t = [e.cellName];
|
|
28894
|
-
return e.tracebackHtml && t.push(
|
|
28907
|
+
return e.tracebackHtml && t.push(Kb(e.tracebackHtml)), e.errorData.length > 0 && t.push(e.errorData.map(Wx).join("\n\n")), t.join("\n\n");
|
|
28895
28908
|
}
|
|
28896
28909
|
//#endregion
|
|
28897
|
-
export { bf as $, cr as $t, By as A, Gc as At, pv as B, ei as Bt,
|
|
28910
|
+
export { bf as $, cr as $t, By as A, Gc as At, pv as B, ei as Bt, qb as C, Fl as Ct, ub as D, el as Dt, Mb as E, nl as Et, bv as F, ui as Ft, wm as G, Xr as Gt, uv as H, Zr as Ht, xv as I, ci as It, Np as J, Vr as Jt, Cm as K, Yr as Kt, hv as L, li as Lt, Wv as M, $c as Mt, Lv as N, Mc as Nt, db as O, tl as Ot, Iv as P, hi as Pt, Vf as Q, Er as Qt, mv as R, ri as Rt, ox as S, Al as St, zb as T, hl as Tt, U_ as U, Jr as Ut, dv as V, ti as Vt, Vm as W, Gr as Wt, np as X, Ir as Xt, yp as Y, Fr as Yt, Hf as Z, Nr as Zt, Ax as _, Kl as _t, jx as a, Nn as an, zd as at, wx as b, Bl as bt, Ix as c, En as cn, Cd as ct, Dx as d, Sn as dn, dd as dt, wr as en, sf as et, Ex as f, xn as fn, cd as ft, Sx as g, pn as gn, Wl as gt, $ as h, hn, Jl as ht, Hx as i, Pn as in, Hd as it, Hv as j, Qc as jt, Gy as k, Zc as kt, Fx as l, wn as ln, vd as lt, ux as m, gn as mn, ql as mt, Gx as n, Bn as nn, Xd as nt, yx as o, jn as on, Td as ot, bx as p, yn as pn, hu as pt, Pp as q, Br as qt, Wx as r, Ln as rn, Jd as rt, px as s, kn as sn, Ed as st, Ux as t, pr as tn, Qd as tt, Ox as u, Cn as un, gd as ut, dx as v, Gl as vt, Kb as w, _l as wt, Tx as x, Pl as xt, Lx as y, Hl as yt, gv as z, $r as zt };
|