@marimo-team/islands 0.21.2-dev79 → 0.21.2-dev80
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/{chat-ui-D4ay_SFE.js → chat-ui-Dbn0M4Oo.js} +1 -1
- package/dist/main.js +3 -5
- package/dist/{process-output-Cv8vQ4At.js → process-output-BD2HO0W_.js} +1 -1
- package/package.json +1 -1
- package/src/__mocks__/requests.ts +0 -1
- package/src/core/cells/cells.ts +3 -1
- package/src/core/edit-app.tsx +0 -5
- package/src/core/islands/bridge.ts +0 -1
- package/src/core/islands/main.ts +0 -1
- package/src/core/network/requests-lazy.ts +0 -1
- package/src/core/network/requests-network.ts +0 -9
- package/src/core/network/requests-static.ts +0 -1
- package/src/core/network/requests-toasting.tsx +0 -1
- package/src/core/network/types.ts +0 -2
- package/src/core/wasm/bridge.ts +0 -1
- package/src/core/websocket/useMarimoKernelConnection.tsx +1 -4
- package/src/core/cells/effects.ts +0 -42
|
@@ -5,7 +5,7 @@ import { s as __toESM, t as __commonJSMin } from "./chunk-BNovOVIE.js";
|
|
|
5
5
|
import { t as require_react } from "./react-Bs6Z0kvn.js";
|
|
6
6
|
import { t as require_compiler_runtime } from "./compiler-runtime-B_OLMU9S.js";
|
|
7
7
|
import { r as toast } from "./copy-B7XqFjF_.js";
|
|
8
|
-
import { $t as getTableType, A as AccordionItem, C as Boosts, D as AIContextRegistry, Dt as displayCellName, E as AIContextProvider, En as atomWithStorage, Fn as Info, Gt as variablesAtom, H as ChatBubbleIcon, I as MarimoIncomingMessageEvent, In as File$1, Kt as PluralWord, Lt as moveToEndOfEditor, Nn as LoaderCircle, O as Accordion, On as Wrench, Pt as createVariableInfoElement, Qt as dataSourceConnectionsAtom, T as contextToXml, Vn as CircleX, Wt as jotaiJsonStorage, X as base64ToDataURL, Y as deserializeBlob, Zt as allTablesAtom, a as toPng, an as singleFacet, ct as notebookAtom, d as Spinner, f as Popover, g as PopoverAnchor, h as PopoverTrigger, hn as CellOutputId, it as cellErrorsAtom, j as AccordionTrigger, k as AccordionContent, kn as Trash2, m as PopoverContent, n as blobToString, o as MarkdownRenderer, rt as renderHTML, t as processOutput, tn as getRequestClient, un as ZodLocalStorage, v as isOutputEmpty, w as Sections, x as DatasourceContextProvider } from "./process-output-
|
|
8
|
+
import { $t as getTableType, A as AccordionItem, C as Boosts, D as AIContextRegistry, Dt as displayCellName, E as AIContextProvider, En as atomWithStorage, Fn as Info, Gt as variablesAtom, H as ChatBubbleIcon, I as MarimoIncomingMessageEvent, In as File$1, Kt as PluralWord, Lt as moveToEndOfEditor, Nn as LoaderCircle, O as Accordion, On as Wrench, Pt as createVariableInfoElement, Qt as dataSourceConnectionsAtom, T as contextToXml, Vn as CircleX, Wt as jotaiJsonStorage, X as base64ToDataURL, Y as deserializeBlob, Zt as allTablesAtom, a as toPng, an as singleFacet, ct as notebookAtom, d as Spinner, f as Popover, g as PopoverAnchor, h as PopoverTrigger, hn as CellOutputId, it as cellErrorsAtom, j as AccordionTrigger, k as AccordionContent, kn as Trash2, m as PopoverContent, n as blobToString, o as MarkdownRenderer, rt as renderHTML, t as processOutput, tn as getRequestClient, un as ZodLocalStorage, v as isOutputEmpty, w as Sections, x as DatasourceContextProvider } from "./process-output-BD2HO0W_.js";
|
|
9
9
|
import "./chunk-5FQGJX7Z-Cz2QbNIw.js";
|
|
10
10
|
import { l as createLucideIcon } from "./dist-BiNtCiQ9.js";
|
|
11
11
|
import { a as startCase_default } from "./useLifecycle-Be1LUuEg.js";
|
package/dist/main.js
CHANGED
|
@@ -21,7 +21,7 @@ import { a as __toCommonJS, n as __esmMin, r as __export, s as __toESM, t as __c
|
|
|
21
21
|
import { t as require_react } from "./react-Bs6Z0kvn.js";
|
|
22
22
|
import { t as require_compiler_runtime } from "./compiler-runtime-B_OLMU9S.js";
|
|
23
23
|
import { n as Copy, r as toast, t as copyToClipboard } from "./copy-B7XqFjF_.js";
|
|
24
|
-
import { $ as dataViewToBase64, A as AccordionItem, An as Table2, At as normalizeName, B as createInputEvent, Bn as Columns2, Bt as generateUUID, Cn as jsonToMarkdown, Ct as isErrorMime, Dn as selectAtom, Dt as displayCellName, En as atomWithStorage, Et as getCellDomProps, F as AccordionTrigger$1, Fn as Info, Ft as PathBuilder, G as ChevronRightIcon, Gn as import_lib, Hn as CircleAlert, Ht as repl, I as MarimoIncomingMessageEvent, In as File, It as Paths, J as PinRightIcon, Jt as DATA_TYPE_ICON, K as DotFilledIcon, Kt as PluralWord, L as MarimoValueInputEvent, Ln as FileText, M as Accordion$1, Mn as NotebookPen, Mt as customPythonLanguageSupport, N as AccordionContent$1, Nn as LoaderCircle, Nt as MarkdownLanguageAdapter, O as Accordion, On as Wrench, Ot as getValidName, P as AccordionItem$1, Pn as Layers, Q as base64ToUint8Array, R as MarimoValueReadyEvent, Rn as Eye, Rt as goToCellLine, S as getDatasourceContext, Sn as jsonParseWithSpecialChar, St as outputIsStale, Tn as atomWithReducer, Tt as DATA_CELL_ID, U as CheckIcon, Un as Braces, Ut as adaptForLocalStorage, V as BorderAllIcon, Vn as CircleX, Vt as useChromeActions, W as ChevronDownIcon, Wn as esm_default$1, Wt as jotaiJsonStorage, Xt as require_client, Y as deserializeBlob, Yt as getDataTypeColor, Z as base64ToDataView, _ as PopoverClose, _n as SCRATCH_CELL_ID, _t as getInitialAppMode, a as toPng, at as createActions, b as useExpandedOutput, bn as OBJECT_ID_ATTR, bt as viewStateAtom, c as useCellFocusActions, cn as getTracebackInfo, ct as notebookAtom, d as Spinner, dn as filenameAtom, dt as useCellActions, en as convertStatsName, et as extractBase64FromDataURL, f as Popover$1, fn as parseAttrValue, ft as useCellIds, gn as HTMLCellId, gt as AnsiUp, h as PopoverTrigger, hn as CellOutputId, ht as Strings, i as PythonIcon, in as isUninstantiated, j as AccordionTrigger, jn as PaintRoller, jt as Checkbox, k as AccordionContent, kn as Trash2, kt as isInternalCellName, l as useLastFocusedCellId, ln as NotebookScopedLocalStorage, lt as notebookOutline, m as PopoverContent, mn as parseInitialValue, mt as createCell, n as blobToString, nn as requestClientAtom, nt as safeExtractSetUIElementMessageBuffers, o as MarkdownRenderer, on as elementContainsMarimoCellFile, ot as getCellEditorView, p as PopoverClose$1, pn as parseDataset, pt as useCellNames, q as PinLeftIcon, qt as PluralWords, r as filesToBase64, rn as useRequestClient, rt as renderHTML, s as LazyAnyLanguageCodeMirror, sn as extractAllTracebackInfo, st as getCellNames, t as processOutput, tn as getRequestClient, tt as isDataURLString, u as maybeAddAltairImport, ut as reducer, v as isOutputEmpty, vn as UIElementId, vt as initialModeAtom, wn as jsonToTSV, wt as headingToIdentifier, xn as RANDOM_ID_ATTR, xt as outputIsLoading, y as useExpandedConsoleOutput, yn as findCellId, yt as kioskModeAtom, z as MarimoValueUpdateEvent, zn as Database, zt as DeferredRequestRegistry, __tla as __tla_0 } from "./process-output-
|
|
24
|
+
import { $ as dataViewToBase64, A as AccordionItem, An as Table2, At as normalizeName, B as createInputEvent, Bn as Columns2, Bt as generateUUID, Cn as jsonToMarkdown, Ct as isErrorMime, Dn as selectAtom, Dt as displayCellName, En as atomWithStorage, Et as getCellDomProps, F as AccordionTrigger$1, Fn as Info, Ft as PathBuilder, G as ChevronRightIcon, Gn as import_lib, Hn as CircleAlert, Ht as repl, I as MarimoIncomingMessageEvent, In as File, It as Paths, J as PinRightIcon, Jt as DATA_TYPE_ICON, K as DotFilledIcon, Kt as PluralWord, L as MarimoValueInputEvent, Ln as FileText, M as Accordion$1, Mn as NotebookPen, Mt as customPythonLanguageSupport, N as AccordionContent$1, Nn as LoaderCircle, Nt as MarkdownLanguageAdapter, O as Accordion, On as Wrench, Ot as getValidName, P as AccordionItem$1, Pn as Layers, Q as base64ToUint8Array, R as MarimoValueReadyEvent, Rn as Eye, Rt as goToCellLine, S as getDatasourceContext, Sn as jsonParseWithSpecialChar, St as outputIsStale, Tn as atomWithReducer, Tt as DATA_CELL_ID, U as CheckIcon, Un as Braces, Ut as adaptForLocalStorage, V as BorderAllIcon, Vn as CircleX, Vt as useChromeActions, W as ChevronDownIcon, Wn as esm_default$1, Wt as jotaiJsonStorage, Xt as require_client, Y as deserializeBlob, Yt as getDataTypeColor, Z as base64ToDataView, _ as PopoverClose, _n as SCRATCH_CELL_ID, _t as getInitialAppMode, a as toPng, at as createActions, b as useExpandedOutput, bn as OBJECT_ID_ATTR, bt as viewStateAtom, c as useCellFocusActions, cn as getTracebackInfo, ct as notebookAtom, d as Spinner, dn as filenameAtom, dt as useCellActions, en as convertStatsName, et as extractBase64FromDataURL, f as Popover$1, fn as parseAttrValue, ft as useCellIds, gn as HTMLCellId, gt as AnsiUp, h as PopoverTrigger, hn as CellOutputId, ht as Strings, i as PythonIcon, in as isUninstantiated, j as AccordionTrigger, jn as PaintRoller, jt as Checkbox, k as AccordionContent, kn as Trash2, kt as isInternalCellName, l as useLastFocusedCellId, ln as NotebookScopedLocalStorage, lt as notebookOutline, m as PopoverContent, mn as parseInitialValue, mt as createCell, n as blobToString, nn as requestClientAtom, nt as safeExtractSetUIElementMessageBuffers, o as MarkdownRenderer, on as elementContainsMarimoCellFile, ot as getCellEditorView, p as PopoverClose$1, pn as parseDataset, pt as useCellNames, q as PinLeftIcon, qt as PluralWords, r as filesToBase64, rn as useRequestClient, rt as renderHTML, s as LazyAnyLanguageCodeMirror, sn as extractAllTracebackInfo, st as getCellNames, t as processOutput, tn as getRequestClient, tt as isDataURLString, u as maybeAddAltairImport, ut as reducer, v as isOutputEmpty, vn as UIElementId, vt as initialModeAtom, wn as jsonToTSV, wt as headingToIdentifier, xn as RANDOM_ID_ATTR, xt as outputIsLoading, y as useExpandedConsoleOutput, yn as findCellId, yt as kioskModeAtom, z as MarimoValueUpdateEvent, zn as Database, zt as DeferredRequestRegistry, __tla as __tla_0 } from "./process-output-BD2HO0W_.js";
|
|
25
25
|
import { __tla as __tla_1 } from "./chunk-5FQGJX7Z-Cz2QbNIw.js";
|
|
26
26
|
import { c as useSize, l as createLucideIcon, t as Root$4 } from "./dist-BiNtCiQ9.js";
|
|
27
27
|
import { A as $896ba0a80a8f4d36$export$85fd5fdf27bacc79, C as DEFAULT_COLOR_SCHEME, D as SCALE_TYPE_DESCRIPTIONS, E as EMPTY_VALUE$1, F as ListFilter, I as ChartPie, L as ChartColumn, M as $5a387cc49350e6db$export$722debc0e56fea39, N as Table$1, O as TIME_UNIT_DESCRIPTIONS, P as SquareFunction, S as DEFAULT_AGGREGATION, T as DEFAULT_TIME_UNIT, _ as AGGREGATION_TYPE_DESCRIPTIONS, a as AGGREGATION_FNS$1, b as COLOR_SCHEMES, c as COLOR_BY_FIELDS, d as NONE_VALUE, f as SELECTABLE_DATA_TYPES, g as TIME_UNITS, h as STRING_AGGREGATION_FNS, i as convertDataTypeToSelectable, j as $fb18d541ea1ad717$export$ad991b66133851cf, k as escapeFieldName, l as COMBINED_TIME_UNITS, m as SORT_TYPES, n as createSpecWithoutData, o as BIN_AGGREGATION, p as SINGLE_TIME_UNITS, r as isFieldSet, s as CHART_TYPES, t as augmentSpecWithData, u as ChartType, v as AGGREGATION_TYPE_ICON, w as DEFAULT_MAX_BINS_FACET, x as COUNT_FIELD, y as CHART_TYPE_ICON } from "./spec-UGFYIDJb.js";
|
|
@@ -35175,7 +35175,7 @@ ${O}`,
|
|
|
35175
35175
|
};
|
|
35176
35176
|
}
|
|
35177
35177
|
};
|
|
35178
|
-
var LazyChatbot = import_react.lazy(() => import("./chat-ui-
|
|
35178
|
+
var LazyChatbot = import_react.lazy(() => import("./chat-ui-Dbn0M4Oo.js").then((e) => ({
|
|
35179
35179
|
default: e.Chatbot
|
|
35180
35180
|
}))), messageSchema = array(object({
|
|
35181
35181
|
id: string(),
|
|
@@ -65381,7 +65381,7 @@ ${c}
|
|
|
65381
65381
|
return Logger.warn("Failed to get version from mount config"), null;
|
|
65382
65382
|
}
|
|
65383
65383
|
}
|
|
65384
|
-
const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.21.2-
|
|
65384
|
+
const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.21.2-dev80"), showCodeInRunModeAtom = atom(true);
|
|
65385
65385
|
atom(null);
|
|
65386
65386
|
var VIRTUAL_FILE_REGEX = /\/@file\/([^\s"&'/]+)\.([\dA-Za-z]+)/g, VirtualFileTracker = class e {
|
|
65387
65387
|
constructor() {
|
|
@@ -66517,7 +66517,6 @@ ${r}
|
|
|
66517
66517
|
__publicField(this, "saveAppConfig", throwNotImplemented);
|
|
66518
66518
|
__publicField(this, "saveCellConfig", throwNotImplemented);
|
|
66519
66519
|
__publicField(this, "sendRestart", throwNotImplemented);
|
|
66520
|
-
__publicField(this, "syncCellIds", throwNotImplemented);
|
|
66521
66520
|
__publicField(this, "sendDocumentTransaction", throwNotImplemented);
|
|
66522
66521
|
__publicField(this, "readCode", throwNotImplemented);
|
|
66523
66522
|
__publicField(this, "readSnippets", throwNotImplemented);
|
|
@@ -66641,7 +66640,6 @@ ${r}
|
|
|
66641
66640
|
case "installing-package-alert":
|
|
66642
66641
|
case "completion-result":
|
|
66643
66642
|
case "reload":
|
|
66644
|
-
case "update-cell-ids":
|
|
66645
66643
|
case "focus-cell":
|
|
66646
66644
|
case "variables":
|
|
66647
66645
|
case "variable-values":
|
|
@@ -24978,7 +24978,7 @@ ${n.sqlString}
|
|
|
24978
24978
|
let s = (_b2 = (_a2 = e.cellHandles[n].current) == null ? void 0 : _a2.editorView) == null ? void 0 : _b2.state.toJSON({
|
|
24979
24979
|
history: historyField
|
|
24980
24980
|
});
|
|
24981
|
-
s.doc = e.cellData[n].code, releaseCellAtoms(n);
|
|
24981
|
+
s && (s.doc = e.cellData[n].code), releaseCellAtoms(n);
|
|
24982
24982
|
let c = e.cellData[n];
|
|
24983
24983
|
return {
|
|
24984
24984
|
...e,
|
package/package.json
CHANGED
|
@@ -17,7 +17,6 @@ export const MockRequestClient = {
|
|
|
17
17
|
sendModelValue: vi.fn().mockResolvedValue({}),
|
|
18
18
|
sendRename: vi.fn().mockResolvedValue({}),
|
|
19
19
|
sendRestart: vi.fn().mockResolvedValue({}),
|
|
20
|
-
syncCellIds: vi.fn().mockResolvedValue({}),
|
|
21
20
|
sendDocumentTransaction: vi.fn().mockResolvedValue({}),
|
|
22
21
|
sendSave: vi.fn().mockResolvedValue({}),
|
|
23
22
|
sendCopy: vi.fn().mockResolvedValue({}),
|
package/src/core/cells/cells.ts
CHANGED
|
@@ -589,7 +589,9 @@ const {
|
|
|
589
589
|
const serializedEditorState = editorView?.state.toJSON({
|
|
590
590
|
history: historyField,
|
|
591
591
|
});
|
|
592
|
-
serializedEditorState
|
|
592
|
+
if (serializedEditorState) {
|
|
593
|
+
serializedEditorState.doc = state.cellData[cellId].code;
|
|
594
|
+
}
|
|
593
595
|
|
|
594
596
|
// release the granular atom(s) created for this cell
|
|
595
597
|
releaseCellAtoms(cellId);
|
package/src/core/edit-app.tsx
CHANGED
|
@@ -20,13 +20,11 @@ import { CellArray } from "../components/editor/renderers/cell-array";
|
|
|
20
20
|
import { CellsRenderer } from "../components/editor/renderers/cells-renderer";
|
|
21
21
|
import { useHotkey } from "../hooks/useHotkey";
|
|
22
22
|
import {
|
|
23
|
-
cellIdsAtom,
|
|
24
23
|
hasCellsAtom,
|
|
25
24
|
notebookIsRunningAtom,
|
|
26
25
|
numColumnsAtom,
|
|
27
26
|
useCellActions,
|
|
28
27
|
} from "./cells/cells";
|
|
29
|
-
import { CellEffects } from "./cells/effects";
|
|
30
28
|
import type { AppConfig, UserConfig } from "./config/config-schema";
|
|
31
29
|
import { RuntimeState } from "./kernel/RuntimeState";
|
|
32
30
|
import { getSessionId } from "./kernel/session";
|
|
@@ -35,7 +33,6 @@ import { viewStateAtom } from "./mode";
|
|
|
35
33
|
import { useRequestClient } from "./network/requests";
|
|
36
34
|
import { useFilename } from "./saving/filename";
|
|
37
35
|
import { lastSavedNotebookAtom } from "./saving/state";
|
|
38
|
-
import { useJotaiEffect } from "./state/jotai";
|
|
39
36
|
import { useMarimoKernelConnection } from "./websocket/useMarimoKernelConnection";
|
|
40
37
|
|
|
41
38
|
interface AppProps {
|
|
@@ -58,8 +55,6 @@ export const EditApp: React.FC<AppProps> = ({
|
|
|
58
55
|
appConfig,
|
|
59
56
|
hideControls = false,
|
|
60
57
|
}) => {
|
|
61
|
-
useJotaiEffect(cellIdsAtom, CellEffects.onCellIdsChange);
|
|
62
|
-
|
|
63
58
|
const { setCells, mergeAllColumns, collapseAllCells, expandAllCells } =
|
|
64
59
|
useCellActions();
|
|
65
60
|
const viewState = useAtomValue(viewStateAtom);
|
|
@@ -162,7 +162,6 @@ export class IslandsPyodideBridge implements RunRequests, EditRequests {
|
|
|
162
162
|
saveAppConfig = throwNotImplemented;
|
|
163
163
|
saveCellConfig = throwNotImplemented;
|
|
164
164
|
sendRestart = throwNotImplemented;
|
|
165
|
-
syncCellIds = throwNotImplemented;
|
|
166
165
|
sendDocumentTransaction = throwNotImplemented;
|
|
167
166
|
readCode = throwNotImplemented;
|
|
168
167
|
readSnippets = throwNotImplemented;
|
package/src/core/islands/main.ts
CHANGED
|
@@ -119,7 +119,6 @@ const ACTIONS: Record<keyof AllRequests, Action> = {
|
|
|
119
119
|
downloadStorage: "waitForConnectionOpen",
|
|
120
120
|
|
|
121
121
|
// Sync operations that wait for connection
|
|
122
|
-
syncCellIds: "waitForConnectionOpen",
|
|
123
122
|
sendDocumentTransaction: "waitForConnectionOpen",
|
|
124
123
|
sendCodeCompletionRequest: "waitForConnectionOpen",
|
|
125
124
|
};
|
|
@@ -49,15 +49,6 @@ export function createNetworkRequests(): EditRequests & RunRequests {
|
|
|
49
49
|
})
|
|
50
50
|
.then(handleResponseReturnNull);
|
|
51
51
|
},
|
|
52
|
-
syncCellIds: async (request) => {
|
|
53
|
-
await waitForConnectionOpen();
|
|
54
|
-
return getClient()
|
|
55
|
-
.POST("/api/kernel/sync/cell_ids", {
|
|
56
|
-
body: request,
|
|
57
|
-
params: getParams(),
|
|
58
|
-
})
|
|
59
|
-
.then(handleResponseReturnNull);
|
|
60
|
-
},
|
|
61
52
|
sendDocumentTransaction: async (request) => {
|
|
62
53
|
await waitForConnectionOpen();
|
|
63
54
|
return getClient()
|
|
@@ -36,7 +36,6 @@ export function createStaticRequests(): EditRequests & RunRequests {
|
|
|
36
36
|
return null;
|
|
37
37
|
},
|
|
38
38
|
sendRestart: throwNotInEditMode,
|
|
39
|
-
syncCellIds: throwNotInEditMode,
|
|
40
39
|
sendDocumentTransaction: throwNotInEditMode,
|
|
41
40
|
sendRun: throwNotInEditMode,
|
|
42
41
|
sendRunScratchpad: throwNotInEditMode,
|
|
@@ -21,7 +21,6 @@ export function createErrorToastingRequests(
|
|
|
21
21
|
sendInstantiate: "Failed to instantiate",
|
|
22
22
|
sendFunctionRequest: "Failed to send function request",
|
|
23
23
|
sendRestart: "Failed to restart",
|
|
24
|
-
syncCellIds: "Failed to sync cell IDs",
|
|
25
24
|
sendDocumentTransaction: "Failed to sync document transaction",
|
|
26
25
|
sendRun: "Failed to run",
|
|
27
26
|
sendRunScratchpad: "Failed to run scratchpad",
|
|
@@ -80,7 +80,6 @@ export interface SetCellConfigRequest {
|
|
|
80
80
|
}
|
|
81
81
|
export type UpdateUIElementRequest = schemas["UpdateUIElementRequest"];
|
|
82
82
|
export type ModelRequest = schemas["ModelRequest"];
|
|
83
|
-
export type UpdateCellIdsRequest = schemas["UpdateCellIdsRequest"];
|
|
84
83
|
export type NotebookDocumentTransactionRequest =
|
|
85
84
|
schemas["NotebookDocumentTransactionRequest"];
|
|
86
85
|
export type UpdateUserConfigRequest = schemas["UpdateUserConfigRequest"];
|
|
@@ -140,7 +139,6 @@ export interface EditRequests {
|
|
|
140
139
|
saveAppConfig: (request: SaveAppConfigurationRequest) => Promise<null>;
|
|
141
140
|
saveCellConfig: (request: SetCellConfigRequest) => Promise<null>;
|
|
142
141
|
sendRestart: () => Promise<null>;
|
|
143
|
-
syncCellIds: (request: UpdateCellIdsRequest) => Promise<null>;
|
|
144
142
|
sendDocumentTransaction: (
|
|
145
143
|
request: NotebookDocumentTransactionRequest,
|
|
146
144
|
) => Promise<null>;
|
package/src/core/wasm/bridge.ts
CHANGED
|
@@ -558,7 +558,6 @@ export class PyodideBridge implements RunRequests, EditRequests {
|
|
|
558
558
|
return null;
|
|
559
559
|
};
|
|
560
560
|
|
|
561
|
-
syncCellIds = () => Promise.resolve(null);
|
|
562
561
|
sendDocumentTransaction = () => Promise.resolve(null);
|
|
563
562
|
|
|
564
563
|
addPackage: EditRequests["addPackage"] = async (request) => {
|
|
@@ -97,7 +97,7 @@ export function useMarimoKernelConnection(opts: {
|
|
|
97
97
|
const { autoInstantiate, sessionId, setCells } = opts;
|
|
98
98
|
const { showBoundary } = useErrorBoundary();
|
|
99
99
|
|
|
100
|
-
const { handleCellMessage
|
|
100
|
+
const { handleCellMessage } = useCellActions();
|
|
101
101
|
const actionsWithoutMiddleware = useCellActions({ skipMiddleware: true });
|
|
102
102
|
|
|
103
103
|
const handleDocumentTransaction = (
|
|
@@ -328,9 +328,6 @@ export function useMarimoKernelConnection(opts: {
|
|
|
328
328
|
case "focus-cell":
|
|
329
329
|
focusAndScrollCellOutputIntoView(msg.data.cell_id);
|
|
330
330
|
return;
|
|
331
|
-
case "update-cell-ids":
|
|
332
|
-
setCellIds({ cellIds: msg.data.cell_ids });
|
|
333
|
-
return;
|
|
334
331
|
case "notebook-document-transaction":
|
|
335
332
|
handleDocumentTransaction(msg.data.transaction);
|
|
336
333
|
return;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
-
|
|
3
|
-
import { debounce, isEqual } from "lodash-es";
|
|
4
|
-
import type { MultiColumn } from "@/utils/id-tree";
|
|
5
|
-
import { kioskModeAtom } from "../mode";
|
|
6
|
-
import { getRequestClient } from "../network/requests";
|
|
7
|
-
import type { UpdateCellIdsRequest } from "../network/types";
|
|
8
|
-
import { store } from "../state/jotai";
|
|
9
|
-
import type { CellId } from "./ids";
|
|
10
|
-
|
|
11
|
-
const debounceSyncCellIds = debounce((request: UpdateCellIdsRequest) => {
|
|
12
|
-
return getRequestClient().syncCellIds(request);
|
|
13
|
-
}, 400);
|
|
14
|
-
|
|
15
|
-
export const CellEffects = {
|
|
16
|
-
onCellIdsChange: (
|
|
17
|
-
cellIds: MultiColumn<CellId>,
|
|
18
|
-
prevCellIds: MultiColumn<CellId>,
|
|
19
|
-
) => {
|
|
20
|
-
const kioskMode = store.get(kioskModeAtom);
|
|
21
|
-
if (kioskMode) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
// If cellIds is empty, return early
|
|
25
|
-
if (cellIds.isEmpty()) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
// If prevCellIds is empty, also return early
|
|
29
|
-
// this means that the notebook was just created
|
|
30
|
-
if (prevCellIds.isEmpty()) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// If they are different references, send an update to the server
|
|
35
|
-
if (!isEqual(cellIds.inOrderIds, prevCellIds.inOrderIds)) {
|
|
36
|
-
// "name" property is not actually required
|
|
37
|
-
void debounceSyncCellIds({
|
|
38
|
-
cellIds: cellIds.inOrderIds,
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
};
|