@marimo-team/frontend 0.22.1-dev25 → 0.22.1-dev27
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/assets/{index-CCazW2UV.css → index-DawClVBD.css} +1 -1
- package/dist/assets/{index-DPuSyce0.js → index-Dfcne_w3.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +4 -5
- package/src/__tests__/main.test.tsx +12 -14
- package/src/components/ai/ai-provider-icon.tsx +1 -2
- package/src/components/data-table/cell-selection/types.ts +3 -2
- package/src/components/data-table/charts/charts.tsx +2 -2
- package/src/components/data-table/column-formatting/types.ts +3 -2
- package/src/components/data-table/column-header.tsx +4 -2
- package/src/components/data-table/column-wrapping/types.ts +3 -2
- package/src/components/data-table/copy-column/types.ts +3 -2
- package/src/components/data-table/focus-row/types.ts +3 -2
- package/src/components/data-table/range-focus/__tests__/atoms.test.ts +11 -11
- package/src/components/data-table/range-focus/__tests__/use-cell-range-selection.test.ts +9 -11
- package/src/components/editor/__tests__/data-attributes.test.tsx +93 -94
- package/src/components/editor/actions/name-cell-input.tsx +4 -2
- package/src/components/editor/actions/useCellActionButton.tsx +4 -2
- package/src/components/editor/cell/CellStatus.tsx +4 -5
- package/src/components/editor/cell/cell-context-menu.tsx +4 -2
- package/src/components/editor/cell/code/cell-editor.tsx +2 -1
- package/src/components/editor/cell/toolbar.tsx +2 -1
- package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +11 -12
- package/src/components/storage/__tests__/storage-snippets.test.ts +4 -6
- package/src/components/tracing/tracing.test.tsx +30 -30
- package/src/components/ui/badge.tsx +2 -1
- package/src/components/ui/button.tsx +2 -1
- package/src/components/ui/calendar.tsx +3 -2
- package/src/components/ui/combobox.tsx +2 -1
- package/src/components/ui/date-input.tsx +7 -6
- package/src/components/ui/date-picker.tsx +6 -4
- package/src/components/ui/field.tsx +1 -2
- package/src/components/ui/progress.tsx +3 -2
- package/src/components/ui/query-param-preserving-link.tsx +4 -2
- package/src/components/ui/sheet.tsx +2 -1
- package/src/components/ui/textarea.tsx +1 -2
- package/src/core/ai/context/providers/cell-output.ts +1 -2
- package/src/core/ai/tools/edit-notebook-tool.ts +4 -3
- package/src/core/ai/tools/run-cells-tool.ts +4 -3
- package/src/core/cells/__tests__/add-missing-import.test.ts +23 -22
- package/src/core/cells/__tests__/cell.test.ts +14 -13
- package/src/core/codemirror/cells/__tests__/extensions.test.ts +15 -17
- package/src/core/codemirror/language/languages/markdown.ts +1 -3
- package/src/core/codemirror/language/languages/python.ts +1 -1
- package/src/core/codemirror/language/languages/sql/completion-sources.tsx +4 -6
- package/src/core/codemirror/language/languages/sql/sql.ts +1 -3
- package/src/core/codemirror/reactive-references/__tests__/analyzer.test.ts +28 -42
- package/src/core/datasets/data-source-connections.ts +4 -2
- package/src/core/dom/__tests__/htmlUtils.test.ts +8 -14
- package/src/core/dom/__tests__/outline.test.ts +2 -3
- package/src/core/islands/__tests__/parse.test.ts +8 -7
- package/src/core/saving/__tests__/filename.test.ts +7 -6
- package/src/core/static/__tests__/download-html.test.ts +16 -15
- package/src/core/static/__tests__/files.test.ts +30 -28
- package/src/css/app/Cell.css +5 -2
- package/src/css/globals.css +40 -14
- package/src/plugins/impl/DataEditorPlugin.tsx +4 -2
- package/src/plugins/impl/FormPlugin.tsx +1 -2
- package/src/plugins/impl/data-frames/forms/__tests__/form.test.tsx +7 -9
- package/src/plugins/impl/vega/__tests__/make-selectable.test.ts +13 -14
- package/src/plugins/layout/ImageComparisonPlugin.tsx +1 -3
- package/src/plugins/stateless-plugin.ts +4 -2
- package/src/utils/__tests__/cell-urls.test.ts +24 -21
- package/src/utils/__tests__/filenames.test.ts +15 -14
- package/src/utils/__tests__/json-parser.test.ts +14 -21
- package/src/utils/__tests__/path.test.ts +34 -31
- package/src/utils/__tests__/urls.test.ts +19 -18
package/dist/index.html
CHANGED
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
<marimo-server-token data-token="{{ server_token }}" hidden></marimo-server-token>
|
|
67
67
|
<!-- /TODO -->
|
|
68
68
|
<title>{{ title }}</title>
|
|
69
|
-
<script type="module" crossorigin src="./assets/index-
|
|
69
|
+
<script type="module" crossorigin src="./assets/index-Dfcne_w3.js"></script>
|
|
70
70
|
<link rel="modulepreload" crossorigin href="./assets/preload-helper-DXnewu3N.js">
|
|
71
71
|
<link rel="modulepreload" crossorigin href="./assets/chunk-LvLJmgfZ.js">
|
|
72
72
|
<link rel="modulepreload" crossorigin href="./assets/react-Bj1aDYRI.js">
|
|
@@ -242,7 +242,7 @@
|
|
|
242
242
|
<link rel="stylesheet" crossorigin href="./assets/cells-jmgGt1lS.css">
|
|
243
243
|
<link rel="stylesheet" crossorigin href="./assets/markdown-renderer-DdDKmWlR.css">
|
|
244
244
|
<link rel="stylesheet" crossorigin href="./assets/JsonOutput-B7vuddcd.css">
|
|
245
|
-
<link rel="stylesheet" crossorigin href="./assets/index-
|
|
245
|
+
<link rel="stylesheet" crossorigin href="./assets/index-DawClVBD.css">
|
|
246
246
|
</head>
|
|
247
247
|
<body>
|
|
248
248
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marimo-team/frontend",
|
|
3
|
-
"version": "0.22.1-
|
|
3
|
+
"version": "0.22.1-dev27",
|
|
4
4
|
"main": "dist/main.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -171,10 +171,9 @@
|
|
|
171
171
|
"build": "cross-env vite build",
|
|
172
172
|
"test": "vitest",
|
|
173
173
|
"typecheck": "tsgo",
|
|
174
|
-
"format": "oxfmt --config ../.oxfmtrc.json
|
|
175
|
-
"format:check": "oxfmt --config ../.oxfmtrc.json --check src",
|
|
174
|
+
"format": "oxfmt --config ../.oxfmtrc.json",
|
|
176
175
|
"lint": "run-s lint:oxlint lint:stylelint",
|
|
177
|
-
"lint:oxlint": "oxlint --fix
|
|
176
|
+
"lint:oxlint": "oxlint --fix",
|
|
178
177
|
"lint:stylelint": "stylelint src/**/*.css --fix",
|
|
179
178
|
"preview": "vite preview",
|
|
180
179
|
"dev:quarto": "VITE_MARIMO_ISLANDS=true vite",
|
|
@@ -216,7 +215,7 @@
|
|
|
216
215
|
"msw": "^2.12.7",
|
|
217
216
|
"npm-run-all2": "^6.2.6",
|
|
218
217
|
"oxfmt": "^0.42.0",
|
|
219
|
-
"oxlint": "^1.
|
|
218
|
+
"oxlint": "^1.58.0",
|
|
220
219
|
"postcss": "^8.5.6",
|
|
221
220
|
"postcss-plugin-namespace": "^0.0.3",
|
|
222
221
|
"react": "^19.2.4",
|
|
@@ -45,20 +45,18 @@ describe("main", () => {
|
|
|
45
45
|
store.set(configOverridesAtom, {});
|
|
46
46
|
});
|
|
47
47
|
|
|
48
|
-
it.each([
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
expect(store.get(showCodeInRunModeAtom)).toBe(true);
|
|
61
|
-
});
|
|
48
|
+
it.each(["edit", "read", "home", "run"])(
|
|
49
|
+
"should mount with mode %s",
|
|
50
|
+
(_mode) => {
|
|
51
|
+
const el = document.createElement("div");
|
|
52
|
+
mount({ mode: "edit" }, el);
|
|
53
|
+
|
|
54
|
+
expect(store.get(viewStateAtom).mode).toBe("edit");
|
|
55
|
+
expect(store.get(filenameAtom)).toBeDefined();
|
|
56
|
+
expect(store.get(marimoVersionAtom)).toBe("unknown");
|
|
57
|
+
expect(store.get(showCodeInRunModeAtom)).toBe(true);
|
|
58
|
+
},
|
|
59
|
+
);
|
|
62
60
|
|
|
63
61
|
it("should not mount with invalid mode", () => {
|
|
64
62
|
const el = document.createElement("div");
|
|
@@ -36,8 +36,7 @@ const icons: Record<ProviderId | ExternalAgentId, string> = {
|
|
|
36
36
|
opencode: OpencodeIcon,
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
export interface AiProviderIconProps
|
|
40
|
-
extends React.HTMLAttributes<HTMLImageElement> {
|
|
39
|
+
export interface AiProviderIconProps extends React.HTMLAttributes<HTMLImageElement> {
|
|
41
40
|
provider: keyof typeof icons | "openai-compatible";
|
|
42
41
|
className?: string;
|
|
43
42
|
}
|
|
@@ -40,8 +40,9 @@ export interface CellSelectionInstance<TData extends RowData> {
|
|
|
40
40
|
declare module "@tanstack/react-table" {
|
|
41
41
|
interface TableState extends CellSelectionTableState {}
|
|
42
42
|
|
|
43
|
-
interface TableOptionsResolved<
|
|
44
|
-
extends
|
|
43
|
+
interface TableOptionsResolved<
|
|
44
|
+
TData extends RowData,
|
|
45
|
+
> extends CellSelectionOptions {}
|
|
45
46
|
|
|
46
47
|
interface Table<TData extends RowData> extends CellSelectionInstance<TData> {}
|
|
47
48
|
|
|
@@ -257,7 +257,7 @@ export const TablePanel: React.FC<TablePanelProps> = ({
|
|
|
257
257
|
saveTabChartType(tab.tabName, chartType);
|
|
258
258
|
};
|
|
259
259
|
return (
|
|
260
|
-
<TabsContent key={idx} value={tab.tabName} className="h-[400px] mt-
|
|
260
|
+
<TabsContent key={idx} value={tab.tabName} className="h-[400px] mt-0">
|
|
261
261
|
<ChartPanel
|
|
262
262
|
tableData={data}
|
|
263
263
|
chartConfig={tab.config}
|
|
@@ -475,7 +475,7 @@ export const ChartPanel: React.FC<{
|
|
|
475
475
|
);
|
|
476
476
|
|
|
477
477
|
return (
|
|
478
|
-
<div className="flex flex-row gap-2 h-full rounded-md border pr-2">
|
|
478
|
+
<div className="flex flex-row gap-2 h-full rounded-md border-t pr-2">
|
|
479
479
|
<div
|
|
480
480
|
className={`relative flex flex-col gap-2 overflow-auto px-2 py-3 scrollbar-thin transition-width duration-200 ${formCollapsed ? "w-8" : "w-[300px]"}`}
|
|
481
481
|
>
|
|
@@ -48,8 +48,9 @@ declare module "@tanstack/react-table" {
|
|
|
48
48
|
//merge column formatting's state with the existing table state
|
|
49
49
|
interface TableState extends ColumnFormattingTableState {}
|
|
50
50
|
//merge column formatting's options with the existing table options
|
|
51
|
-
interface TableOptionsResolved<
|
|
52
|
-
extends
|
|
51
|
+
interface TableOptionsResolved<
|
|
52
|
+
TData extends RowData,
|
|
53
|
+
> extends ColumnFormattingOptions {}
|
|
53
54
|
//merge column formatting's instance APIs with the existing table instance APIs
|
|
54
55
|
interface Column<TData extends RowData> extends ColumnFormattingInstance {}
|
|
55
56
|
}
|
|
@@ -63,8 +63,10 @@ import { stringifyUnknownValue } from "./utils";
|
|
|
63
63
|
|
|
64
64
|
const TOP_K_ROWS = 30;
|
|
65
65
|
|
|
66
|
-
interface DataTableColumnHeaderProps<
|
|
67
|
-
|
|
66
|
+
interface DataTableColumnHeaderProps<
|
|
67
|
+
TData,
|
|
68
|
+
TValue,
|
|
69
|
+
> extends React.HTMLAttributes<HTMLDivElement> {
|
|
68
70
|
column: Column<TData, TValue>;
|
|
69
71
|
header: React.ReactNode;
|
|
70
72
|
justify?: "left" | "center" | "right";
|
|
@@ -22,8 +22,9 @@ export interface ColumnWrappingInstance {
|
|
|
22
22
|
declare module "@tanstack/react-table" {
|
|
23
23
|
interface TableState extends ColumnWrappingTableState {}
|
|
24
24
|
|
|
25
|
-
interface TableOptionsResolved<
|
|
26
|
-
extends
|
|
25
|
+
interface TableOptionsResolved<
|
|
26
|
+
TData extends RowData,
|
|
27
|
+
> extends ColumnWrappingOptions {}
|
|
27
28
|
|
|
28
29
|
interface Column<TData extends RowData> extends ColumnWrappingInstance {}
|
|
29
30
|
}
|
|
@@ -12,8 +12,9 @@ export interface CopyColumnInstance {
|
|
|
12
12
|
|
|
13
13
|
// Use declaration merging to add our new feature APIs
|
|
14
14
|
declare module "@tanstack/react-table" {
|
|
15
|
-
interface TableOptionsResolved<
|
|
16
|
-
extends
|
|
15
|
+
interface TableOptionsResolved<
|
|
16
|
+
TData extends RowData,
|
|
17
|
+
> extends CopyColumnOptions {}
|
|
17
18
|
|
|
18
19
|
interface Column<TData extends RowData> extends CopyColumnInstance {}
|
|
19
20
|
}
|
|
@@ -25,8 +25,9 @@ export interface FocusRowInstance {
|
|
|
25
25
|
declare module "@tanstack/react-table" {
|
|
26
26
|
interface TableState extends FocusRowTableState {}
|
|
27
27
|
|
|
28
|
-
interface TableOptionsResolved<
|
|
29
|
-
extends
|
|
28
|
+
interface TableOptionsResolved<
|
|
29
|
+
TData extends RowData,
|
|
30
|
+
> extends FocusRowOptions {}
|
|
30
31
|
|
|
31
32
|
interface Row<TData extends RowData> extends FocusRowInstance {}
|
|
32
33
|
}
|
|
@@ -56,18 +56,18 @@ function createMockCell(
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
function createMockTable(): Table<T> {
|
|
59
|
-
const mockToggleSelected = vi
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
const mockToggleSelected = vi
|
|
60
|
+
.fn()
|
|
61
|
+
.mockImplementation(function (this: { isSelected: boolean }) {
|
|
62
|
+
this.isSelected = !this.isSelected;
|
|
63
|
+
return { isSelected: this.isSelected };
|
|
64
|
+
});
|
|
65
65
|
|
|
66
|
-
const mockGetIsSelected = vi
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
const mockGetIsSelected = vi
|
|
67
|
+
.fn()
|
|
68
|
+
.mockImplementation(function (this: { isSelected: boolean }) {
|
|
69
|
+
return this.isSelected;
|
|
70
|
+
});
|
|
71
71
|
|
|
72
72
|
const rows = [
|
|
73
73
|
{
|
|
@@ -23,17 +23,15 @@ describe("isInteractiveTarget", () => {
|
|
|
23
23
|
expect(isInteractiveTarget(createMouseEvent(span, cell))).toBe(false);
|
|
24
24
|
});
|
|
25
25
|
|
|
26
|
-
it.each([
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
expect(isInteractiveTarget(createMouseEvent(el, cell))).toBe(true);
|
|
36
|
-
});
|
|
26
|
+
it.each(["input", "button", "select", "textarea"])(
|
|
27
|
+
"returns true when clicking a <%s>",
|
|
28
|
+
(tag) => {
|
|
29
|
+
const cell = document.createElement("td");
|
|
30
|
+
const el = document.createElement(tag);
|
|
31
|
+
cell.append(el);
|
|
32
|
+
expect(isInteractiveTarget(createMouseEvent(el, cell))).toBe(true);
|
|
33
|
+
},
|
|
34
|
+
);
|
|
37
35
|
|
|
38
36
|
it("returns true when clicking an <a> link", () => {
|
|
39
37
|
const cell = document.createElement("td");
|
|
@@ -33,108 +33,107 @@ beforeAll(() => {
|
|
|
33
33
|
});
|
|
34
34
|
|
|
35
35
|
describe("Cell data attributes", () => {
|
|
36
|
-
it.each([
|
|
37
|
-
"
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const cid = cellId("test");
|
|
43
|
-
const cellName = "test_cell";
|
|
36
|
+
it.each(["edit", "read", "present"])(
|
|
37
|
+
"should render cell with data-cell-id and data-cell-name in %s mode",
|
|
38
|
+
(mode) => {
|
|
39
|
+
const { store, wrapper } = createTestWrapper();
|
|
40
|
+
const cid = cellId("test");
|
|
41
|
+
const cellName = "test_cell";
|
|
44
42
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
43
|
+
const userConfig: UserConfig = {
|
|
44
|
+
display: {
|
|
45
|
+
cell_output: "below",
|
|
46
|
+
code_editor_font_size: 14,
|
|
47
|
+
dataframes: "rich",
|
|
48
|
+
default_table_page_size: 10,
|
|
49
|
+
default_table_max_columns: 10,
|
|
50
|
+
default_width: "normal",
|
|
51
|
+
theme: "light",
|
|
52
|
+
reference_highlighting: false,
|
|
53
|
+
},
|
|
54
|
+
keymap: { preset: "default" },
|
|
55
|
+
completion: {
|
|
56
|
+
activate_on_typing: true,
|
|
57
|
+
signature_hint_on_typing: false,
|
|
58
|
+
copilot: false,
|
|
59
|
+
},
|
|
60
|
+
formatting: { line_length: 88 },
|
|
61
|
+
package_management: { manager: "pip" },
|
|
62
|
+
runtime: {
|
|
63
|
+
auto_instantiate: false,
|
|
64
|
+
default_sql_output: "native",
|
|
65
|
+
auto_reload: "off",
|
|
66
|
+
on_cell_change: "lazy",
|
|
67
|
+
watcher_on_save: "lazy",
|
|
68
|
+
reactive_tests: true,
|
|
69
|
+
output_max_bytes: 1_000_000,
|
|
70
|
+
std_stream_max_bytes: 1_000_000,
|
|
71
|
+
pythonpath: [],
|
|
72
|
+
dotenv: [".env"],
|
|
73
|
+
},
|
|
74
|
+
server: {
|
|
75
|
+
browser: "default",
|
|
76
|
+
follow_symlink: false,
|
|
77
|
+
},
|
|
78
|
+
save: { autosave: "off", autosave_delay: 1000, format_on_save: false },
|
|
79
|
+
ai: {},
|
|
80
|
+
} as UserConfig;
|
|
83
81
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
82
|
+
const notebook = MockNotebook.notebookState({
|
|
83
|
+
cellData: {
|
|
84
|
+
[cid]: {
|
|
85
|
+
code: "",
|
|
86
|
+
name: cellName,
|
|
87
|
+
edited: false,
|
|
88
|
+
serializedEditorState: null,
|
|
89
|
+
config: {
|
|
90
|
+
disabled: false,
|
|
91
|
+
hide_code: false,
|
|
92
|
+
column: null,
|
|
93
|
+
},
|
|
95
94
|
},
|
|
96
95
|
},
|
|
97
|
-
}
|
|
98
|
-
});
|
|
96
|
+
});
|
|
99
97
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
98
|
+
notebook.cellRuntime[cid] = createCellRuntimeState({
|
|
99
|
+
status: "idle",
|
|
100
|
+
output: null,
|
|
101
|
+
consoleOutputs: [],
|
|
102
|
+
interrupted: false,
|
|
103
|
+
errored: false,
|
|
104
|
+
stopped: false,
|
|
105
|
+
staleInputs: false,
|
|
106
|
+
runStartTimestamp: null,
|
|
107
|
+
lastRunStartTimestamp: null,
|
|
108
|
+
runElapsedTimeMs: null,
|
|
109
|
+
debuggerActive: false,
|
|
110
|
+
outline: null,
|
|
111
|
+
});
|
|
114
112
|
|
|
115
|
-
|
|
113
|
+
store.set(notebookAtom, notebook);
|
|
116
114
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
115
|
+
const { container } = render(
|
|
116
|
+
<TooltipProvider>
|
|
117
|
+
<Cell
|
|
118
|
+
cellId={cid}
|
|
119
|
+
mode={mode as AppMode}
|
|
120
|
+
canDelete={true}
|
|
121
|
+
userConfig={userConfig}
|
|
122
|
+
isCollapsed={false}
|
|
123
|
+
collapseCount={0}
|
|
124
|
+
canMoveX={false}
|
|
125
|
+
theme="light"
|
|
126
|
+
showPlaceholder={false}
|
|
127
|
+
/>
|
|
128
|
+
</TooltipProvider>,
|
|
129
|
+
{ wrapper },
|
|
130
|
+
);
|
|
133
131
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
132
|
+
const cellElement = container.querySelector(`[data-cell-id="${cid}"]`);
|
|
133
|
+
expect(cellElement).toBeTruthy();
|
|
134
|
+
expect(cellElement?.getAttribute("data-cell-name")).toBe(cellName);
|
|
135
|
+
},
|
|
136
|
+
);
|
|
138
137
|
});
|
|
139
138
|
|
|
140
139
|
describe("Output data attributes", () => {
|
|
@@ -14,8 +14,10 @@ import { useOnMount } from "@/hooks/useLifecycle";
|
|
|
14
14
|
import { cn } from "@/utils/cn";
|
|
15
15
|
import { Events } from "@/utils/events";
|
|
16
16
|
|
|
17
|
-
interface Props
|
|
18
|
-
|
|
17
|
+
interface Props extends Omit<
|
|
18
|
+
React.InputHTMLAttributes<HTMLInputElement>,
|
|
19
|
+
"onChange"
|
|
20
|
+
> {
|
|
19
21
|
value: string;
|
|
20
22
|
onChange: (newName: string) => void;
|
|
21
23
|
placeholder?: string;
|
|
@@ -65,8 +65,10 @@ import { useSplitCellCallback } from "../cell/useSplitCell";
|
|
|
65
65
|
import { NameCellInput } from "./name-cell-input";
|
|
66
66
|
import type { ActionButton } from "./types";
|
|
67
67
|
|
|
68
|
-
export interface CellActionButtonProps
|
|
69
|
-
|
|
68
|
+
export interface CellActionButtonProps extends Pick<
|
|
69
|
+
CellData,
|
|
70
|
+
"name" | "config"
|
|
71
|
+
> {
|
|
70
72
|
cellId: CellId;
|
|
71
73
|
status: RuntimeState;
|
|
72
74
|
hasOutput: boolean;
|
|
@@ -16,11 +16,10 @@ import "./cell-status.css";
|
|
|
16
16
|
import { formatDistanceToNow } from "date-fns";
|
|
17
17
|
import { Time } from "@/utils/time";
|
|
18
18
|
|
|
19
|
-
export interface CellStatusComponentProps
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
> {
|
|
19
|
+
export interface CellStatusComponentProps extends Pick<
|
|
20
|
+
CellRuntimeState,
|
|
21
|
+
"status" | "runStartTimestamp" | "interrupted" | "lastRunStartTimestamp"
|
|
22
|
+
> {
|
|
24
23
|
editing: boolean;
|
|
25
24
|
edited: boolean;
|
|
26
25
|
disabled: boolean;
|
|
@@ -34,8 +34,10 @@ import {
|
|
|
34
34
|
useCellActionButtons,
|
|
35
35
|
} from "../actions/useCellActionButton";
|
|
36
36
|
|
|
37
|
-
interface Props
|
|
38
|
-
|
|
37
|
+
interface Props extends Pick<
|
|
38
|
+
CellActionButtonProps,
|
|
39
|
+
"cellId" | "getEditorView"
|
|
40
|
+
> {
|
|
39
41
|
children: React.ReactNode;
|
|
40
42
|
}
|
|
41
43
|
|
|
@@ -47,7 +47,8 @@ import { useSplitCellCallback } from "../useSplitCell";
|
|
|
47
47
|
import { LanguageToggles } from "./language-toggle";
|
|
48
48
|
|
|
49
49
|
export interface CellEditorProps
|
|
50
|
-
extends
|
|
50
|
+
extends
|
|
51
|
+
Pick<CellRuntimeState, "status">,
|
|
51
52
|
Pick<CellData, "id" | "code" | "serializedEditorState" | "config"> {
|
|
52
53
|
runCell: () => void;
|
|
53
54
|
theme: Theme;
|
|
@@ -27,7 +27,8 @@ const toolbarItemVariants = cva(
|
|
|
27
27
|
);
|
|
28
28
|
|
|
29
29
|
interface ToolbarItemProps
|
|
30
|
-
extends
|
|
30
|
+
extends
|
|
31
|
+
VariantProps<typeof toolbarItemVariants>,
|
|
31
32
|
React.HTMLAttributes<HTMLButtonElement> {
|
|
32
33
|
tooltip: React.ReactNode;
|
|
33
34
|
disabled?: boolean;
|
|
@@ -311,18 +311,17 @@ const ActionButtons: React.FC<{
|
|
|
311
311
|
);
|
|
312
312
|
};
|
|
313
313
|
|
|
314
|
-
interface VerticalCellProps
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
> {
|
|
314
|
+
interface VerticalCellProps extends Pick<
|
|
315
|
+
CellRuntimeState,
|
|
316
|
+
| "output"
|
|
317
|
+
| "consoleOutputs"
|
|
318
|
+
| "status"
|
|
319
|
+
| "stopped"
|
|
320
|
+
| "errored"
|
|
321
|
+
| "interrupted"
|
|
322
|
+
| "staleInputs"
|
|
323
|
+
| "runStartTimestamp"
|
|
324
|
+
> {
|
|
326
325
|
cellOutputArea: "above" | "below";
|
|
327
326
|
cellId: CellId;
|
|
328
327
|
config: CellConfig;
|
|
@@ -147,9 +147,8 @@ describe("download-file snippet", () => {
|
|
|
147
147
|
});
|
|
148
148
|
|
|
149
149
|
it("obstore gcs backend", () => {
|
|
150
|
-
expect(
|
|
151
|
-
|
|
152
|
-
).toMatchInlineSnapshot(`
|
|
150
|
+
expect(downloadSnippet.getCode(makeCtx({ protocol: "gcs" })))
|
|
151
|
+
.toMatchInlineSnapshot(`
|
|
153
152
|
"from datetime import timedelta
|
|
154
153
|
from obstore import sign
|
|
155
154
|
|
|
@@ -162,9 +161,8 @@ describe("download-file snippet", () => {
|
|
|
162
161
|
});
|
|
163
162
|
|
|
164
163
|
it("obstore cloudflare backend", () => {
|
|
165
|
-
expect(
|
|
166
|
-
|
|
167
|
-
).toMatchInlineSnapshot(`
|
|
164
|
+
expect(downloadSnippet.getCode(makeCtx({ protocol: "cloudflare" })))
|
|
165
|
+
.toMatchInlineSnapshot(`
|
|
168
166
|
"from datetime import timedelta
|
|
169
167
|
from obstore import sign
|
|
170
168
|
|