@marimo-team/islands 0.21.2-dev37 → 0.21.2-dev40
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/main.js +21 -3
- package/package.json +1 -1
- package/src/__mocks__/notebook.ts +9 -9
- package/src/__tests__/branded.ts +20 -0
- package/src/components/data-table/charts/__tests__/storage.test.ts +7 -7
- package/src/components/editor/__tests__/data-attributes.test.tsx +8 -8
- package/src/components/editor/ai/__tests__/completion-utils.test.ts +15 -15
- package/src/components/editor/navigation/__tests__/clipboard.test.ts +2 -2
- package/src/components/editor/navigation/__tests__/selection.test.ts +7 -6
- package/src/components/editor/navigation/__tests__/state.test.ts +8 -7
- package/src/components/editor/output/MarimoErrorOutput.tsx +7 -7
- package/src/components/editor/output/__tests__/traceback.test.tsx +4 -4
- package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +4 -4
- package/src/components/editor/renderers/vertical-layout/useFocusFirstEditor.ts +8 -1
- package/src/components/storage/storage-inspector.tsx +1 -2
- package/src/components/tracing/tracing.tsx +3 -1
- package/src/core/ai/__tests__/staged-cells.test.ts +9 -8
- package/src/core/ai/context/providers/__tests__/cell-output.test.ts +31 -31
- package/src/core/ai/context/providers/__tests__/datasource.test.ts +3 -3
- package/src/core/ai/context/providers/__tests__/tables.test.ts +3 -2
- package/src/core/ai/context/providers/__tests__/variable.test.ts +84 -63
- package/src/core/ai/tools/__tests__/edit-notebook-tool.test.ts +10 -9
- package/src/core/ai/tools/__tests__/run-cells-tool.test.ts +6 -6
- package/src/core/ai/tools/edit-notebook-tool.ts +3 -3
- package/src/core/cells/__tests__/add-missing-import.test.ts +3 -3
- package/src/core/cells/__tests__/cells.test.ts +192 -135
- package/src/core/cells/__tests__/focus.test.ts +5 -4
- package/src/core/cells/__tests__/logs.test.ts +13 -12
- package/src/core/cells/__tests__/pending-delete-service.test.tsx +3 -3
- package/src/core/cells/__tests__/runs.test.ts +22 -21
- package/src/core/cells/__tests__/scrollCellIntoView.test.ts +8 -7
- package/src/core/cells/__tests__/session.test.ts +23 -22
- package/src/core/cells/cells.ts +1 -1
- package/src/core/cells/ids.ts +5 -5
- package/src/core/cells/logs.ts +2 -2
- package/src/core/cells/runs.ts +6 -8
- package/src/core/codemirror/__tests__/format.test.ts +34 -36
- package/src/core/codemirror/__tests__/setup.test.ts +2 -2
- package/src/core/codemirror/cells/__tests__/extensions.test.ts +114 -0
- package/src/core/codemirror/cells/__tests__/traceback-decorations.test.ts +33 -32
- package/src/core/codemirror/cells/extensions.ts +66 -23
- package/src/core/codemirror/copilot/__tests__/getCodes.test.ts +12 -13
- package/src/core/codemirror/language/__tests__/utils.test.ts +3 -3
- package/src/core/codemirror/language/embedded/__tests__/embedded-python.test.ts +7 -8
- package/src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts +4 -3
- package/src/core/codemirror/reactive-references/__tests__/analyzer.test.ts +7 -6
- package/src/core/codemirror/reactive-references/analyzer.ts +2 -2
- package/src/core/codemirror/rtc/loro/__tests__/sync.test.ts +52 -0
- package/src/core/codemirror/rtc/loro/sync.ts +1 -0
- package/src/core/datasets/__tests__/data-source.test.ts +5 -6
- package/src/core/datasets/state.ts +1 -1
- package/src/core/errors/__tests__/errors.test.ts +2 -1
- package/src/core/export/__tests__/hooks.test.ts +37 -36
- package/src/core/islands/main.ts +2 -7
- package/src/core/kernel/__tests__/handlers.test.ts +5 -4
- package/src/core/kernel/handlers.ts +7 -4
- package/src/core/network/DeferredRequestRegistry.ts +2 -2
- package/src/core/network/__tests__/CachingRequestRegistry.test.ts +9 -10
- package/src/core/network/__tests__/DeferredRequestRegistry.test.ts +4 -6
- package/src/core/static/__tests__/virtual-file-tracker.test.ts +8 -8
- package/src/core/static/virtual-file-tracker.ts +1 -1
- package/src/core/storage/__tests__/state.test.ts +31 -21
- package/src/core/storage/state.ts +1 -1
- package/src/core/variables/__tests__/state.test.ts +6 -6
- package/src/core/variables/types.ts +2 -2
- package/src/core/wasm/__tests__/state.test.ts +8 -8
- package/src/core/websocket/useMarimoKernelConnection.tsx +12 -15
- package/src/plugins/impl/anywidget/model.ts +1 -2
- package/src/stories/cell.stories.tsx +8 -8
- package/src/stories/layout/vertical/one-column.stories.tsx +9 -8
- package/src/stories/log-viewer.stories.tsx +8 -8
- package/src/stories/variables.stories.tsx +2 -2
- package/src/utils/__tests__/download.test.tsx +19 -18
- package/src/utils/json/base64.ts +3 -3
- package/src/utils/traceback.ts +5 -3
|
@@ -90,7 +90,7 @@ export class EditNotebookTool
|
|
|
90
90
|
switch (edit.type) {
|
|
91
91
|
case "update_cell": {
|
|
92
92
|
const { position, code } = edit;
|
|
93
|
-
const cellId = position.cellId as CellId;
|
|
93
|
+
const cellId = position.cellId as CellId | undefined;
|
|
94
94
|
|
|
95
95
|
if (!cellId) {
|
|
96
96
|
throw new ToolExecutionError(
|
|
@@ -152,7 +152,7 @@ export class EditNotebookTool
|
|
|
152
152
|
|
|
153
153
|
switch (position.type) {
|
|
154
154
|
case "relative": {
|
|
155
|
-
const cellId = position.cellId as CellId;
|
|
155
|
+
const cellId = position.cellId as CellId | undefined;
|
|
156
156
|
if (!cellId) {
|
|
157
157
|
throw new ToolExecutionError(
|
|
158
158
|
"Cell ID is required for add_cell with relative position",
|
|
@@ -214,7 +214,7 @@ export class EditNotebookTool
|
|
|
214
214
|
}
|
|
215
215
|
case "delete_cell": {
|
|
216
216
|
const { position } = edit;
|
|
217
|
-
const cellId = position.cellId as CellId;
|
|
217
|
+
const cellId = position.cellId as CellId | undefined;
|
|
218
218
|
|
|
219
219
|
if (!cellId) {
|
|
220
220
|
throw new ToolExecutionError(
|
|
@@ -4,6 +4,7 @@ import { createStore } from "jotai";
|
|
|
4
4
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
5
5
|
import { MockNotebook } from "@/__mocks__/notebook";
|
|
6
6
|
import { MockRequestClient } from "@/__mocks__/requests";
|
|
7
|
+
import { cellId } from "@/__tests__/branded";
|
|
7
8
|
import { store } from "@/core/state/jotai";
|
|
8
9
|
import { variablesAtom } from "@/core/variables/state";
|
|
9
10
|
import type { Variables } from "@/core/variables/types";
|
|
@@ -13,7 +14,6 @@ import {
|
|
|
13
14
|
maybeAddMissingImport,
|
|
14
15
|
} from "../add-missing-import";
|
|
15
16
|
import { notebookAtom } from "../cells";
|
|
16
|
-
import type { CellId } from "../ids";
|
|
17
17
|
|
|
18
18
|
// Mock the getRequestClient function
|
|
19
19
|
const mockRequestClient = MockRequestClient.create();
|
|
@@ -21,8 +21,8 @@ vi.mock("@/core/network/requests", () => ({
|
|
|
21
21
|
getRequestClient: () => mockRequestClient,
|
|
22
22
|
}));
|
|
23
23
|
|
|
24
|
-
const Cell1 = "1"
|
|
25
|
-
const Cell2 = "2"
|
|
24
|
+
const Cell1 = cellId("1");
|
|
25
|
+
const Cell2 = cellId("2");
|
|
26
26
|
|
|
27
27
|
describe("maybeAddMissingImport", () => {
|
|
28
28
|
beforeEach(() => {
|