@marimo-team/islands 0.22.1-dev24 → 0.22.1-dev28
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/_basePickBy-Sow3pJjS.js +41 -0
- package/dist/{_baseUniq--7il0Js0.js → _baseUniq-C87CckHL.js} +14 -53
- package/dist/{architecture-7HQA4BMR-CSK94-xM.js → architecture-7HQA4BMR-BHdkAMvZ.js} +2 -2
- package/dist/{architectureDiagram-VXUJARFQ-Cw5_EP5P.js → architectureDiagram-VXUJARFQ-B3YQo9At.js} +9 -9
- package/dist/{blockDiagram-VD42YOAC-BiuOHEQv.js → blockDiagram-VD42YOAC-CpQ3TKEN.js} +2 -2
- package/dist/{chat-ui-MFxd7AGf.js → chat-ui-Wi1Lm6y4.js} +3 -3
- package/dist/{chunk-4F5CHEZ2-B0Jbisw2.js → chunk-4F5CHEZ2-D5mClyDv.js} +1 -1
- package/dist/{chunk-B2363JML-mJ3Q9WfR.js → chunk-B2363JML-Br0eA2T3.js} +1 -1
- package/dist/{chunk-B4BG7PRW-C4MiRcFI.js → chunk-B4BG7PRW-4BjV11Br.js} +1 -1
- package/dist/{chunk-DI55MBZ5-CMx27S12.js → chunk-DI55MBZ5-DITY3EyP.js} +1 -1
- package/dist/{chunk-FRFDVMJY-IPSTV3Ua.js → chunk-FRFDVMJY-DnEvEFRR.js} +1 -1
- package/dist/{chunk-N4CR4FBY-DYub3dan.js → chunk-N4CR4FBY-CpZSuGSU.js} +1 -1
- package/dist/{chunk-PL6DKKU2-DZiAP4HM.js → chunk-PL6DKKU2-DnId6G-x.js} +1 -1
- package/dist/{chunk-SJTYNZTY-s-hMTFeC.js → chunk-SJTYNZTY-BsBZnJUj.js} +1 -1
- package/dist/{chunk-TCCFYFTB-D7iQP6Bp.js → chunk-TCCFYFTB-Clbl-fTg.js} +5 -4
- package/dist/{chunk-TQ3KTPDO-BmFTqg51.js → chunk-TQ3KTPDO-CFkSQ30e.js} +1 -1
- package/dist/{chunk-UMXZTB3W-AUirFhbD.js → chunk-UMXZTB3W-D-A834Bq.js} +1 -1
- package/dist/{classDiagram-2ON5EDUG-BJCfK6hn.js → classDiagram-2ON5EDUG-C8-zE3Zv.js} +2 -2
- package/dist/{classDiagram-v2-WZHVMYZB-aaIrLBHp.js → classDiagram-v2-WZHVMYZB-DrmbGANl.js} +2 -2
- package/dist/{clone-BsAy1q8B.js → clone-DZFQCtFJ.js} +1 -1
- package/dist/{constants-CMDkKrpC.js → constants-CvyfaCvs.js} +1 -1
- package/dist/{dagre-6UL2VRFP-CLYtUWgC.js → dagre-6UL2VRFP-OMItEBnY.js} +5 -5
- package/dist/{dagre-oeMGMQA0.js → dagre-QVd-lCXU.js} +10 -20
- package/dist/{diagram-PSM6KHXK-D_6t-W86.js → diagram-PSM6KHXK-CkKbohWI.js} +9 -9
- package/dist/{diagram-QEK2KX5R-DyPwbpot.js → diagram-QEK2KX5R-DjUMpVcx.js} +9 -9
- package/dist/{diagram-S2PKOQOG-nwsLe-2u.js → diagram-S2PKOQOG-b-c0d-wZ.js} +9 -9
- package/dist/{erDiagram-Q2GNP2WA-C3PXcCCI.js → erDiagram-Q2GNP2WA-CDhLaOZ1.js} +1 -1
- package/dist/{flowDiagram-NV44I4VS-DFDCBPb3.js → flowDiagram-NV44I4VS-BDi4O4CL.js} +1 -1
- package/dist/{gitGraph-G5XIXVHT-CuhmzmB1.js → gitGraph-G5XIXVHT-B_c6xFJv.js} +2 -2
- package/dist/{gitGraphDiagram-V2S2FVAM-B3inBgCa.js → gitGraphDiagram-V2S2FVAM-iQnXzbPM.js} +9 -9
- package/dist/{glide-data-editor-kjT1twjd.js → glide-data-editor-D8O9AS1C.js} +2 -2
- package/dist/{graphlib-B05vp8B3.js → graphlib-BV1_gi0C.js} +2 -1
- package/dist/hasIn-DnfJcYpY.js +108 -0
- package/dist/{info-VBDWY6EO-CHQo46SB.js → info-VBDWY6EO-BTyzxmhr.js} +2 -2
- package/dist/{infoDiagram-HS3SLOUP-WHNM1sDJ.js → infoDiagram-HS3SLOUP-OYrX6uO3.js} +9 -9
- package/dist/{input-DONWC1s4.js → input-BeQSGpld.js} +1 -1
- package/dist/main.js +97 -75
- package/dist/{mermaid-BdEvqBXn.js → mermaid-808LPVim.js} +19 -19
- package/dist/{mermaid-parser.core-C2Dti_2f.js → mermaid-parser.core-ntCgyx0x.js} +8 -8
- package/dist/min-Ds3gG0Ff.js +96 -0
- package/dist/{mindmap-definition-VGOIOE7T-B02Y_l4r.js → mindmap-definition-VGOIOE7T-CxEUZZvY.js} +1 -1
- package/dist/{packet-DYOGHKS2-DjPkocnd.js → packet-DYOGHKS2-BhvnpoGi.js} +2 -2
- package/dist/{pie-VRWISCQL-B9pA8cOD.js → pie-VRWISCQL-dILuA3iG.js} +2 -2
- package/dist/{pieDiagram-ADFJNKIX-Bzhvjry9.js → pieDiagram-ADFJNKIX-U3LrUqAS.js} +9 -9
- package/dist/{process-output-LVENbROu.js → process-output-BvZAAk1w.js} +3 -3
- package/dist/{radar-ZZBFDIW7-C2obWVPx.js → radar-ZZBFDIW7-DwFrOJDj.js} +2 -2
- package/dist/range-fJeId9Ri.js +30 -0
- package/dist/{requirementDiagram-UZGBJVZJ-B7RuV-90.js → requirementDiagram-UZGBJVZJ-D0zpQnKC.js} +1 -1
- package/dist/{stateDiagram-FKZM4ZOC-QeUJrF7u.js → stateDiagram-FKZM4ZOC-B1S8jGMn.js} +4 -4
- package/dist/{stateDiagram-v2-4FDKWEC3-eOW_mDCq.js → stateDiagram-v2-4FDKWEC3-BH5ozUbc.js} +2 -2
- package/dist/{toDate-CamIA0ND.js → toDate-O4H9dZVC.js} +1 -1
- package/dist/{treemap-GDKQZRPO-DWMsd3D8.js → treemap-GDKQZRPO-bx2ngsgN.js} +2 -2
- package/dist/{types-IIG7e4M2.js → types-D_ntCXg0.js} +1 -1
- package/dist/{useDeepCompareMemoize-DAfQftmI.js → useDeepCompareMemoize-B8DwRVrX.js} +1 -1
- package/dist/{vega-component-CuWVhTG9.js → vega-component-C-fsM9rL.js} +3 -3
- 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/__tests__/SliderPlugin.test.tsx +43 -15
- package/src/plugins/impl/data-frames/forms/__tests__/form.test.tsx +7 -9
- package/src/plugins/impl/plotly/PlotlyPlugin.tsx +12 -68
- package/src/plugins/impl/plotly/__tests__/selection.test.ts +237 -0
- package/src/plugins/impl/plotly/selection.ts +118 -0
- 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/_basePickBy-CsPbmRlg.js +0 -110
- package/dist/_baseSet-Cs7YTRXk.js +0 -27
- package/dist/get-Wu1vTRhN.js +0 -68
- package/dist/range-CNXr10o1.js +0 -17
- /package/dist/{now-Dh_IQA36.js → now-nrrrOr01.js} +0 -0
|
@@ -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
|
|
|
@@ -5,36 +5,36 @@ import { formatChartTime } from "./utils";
|
|
|
5
5
|
describe("formatChartTime", () => {
|
|
6
6
|
beforeAll(() => {
|
|
7
7
|
// Mock Date to always use UTC
|
|
8
|
-
vi.spyOn(global.Date.prototype, "getFullYear").mockImplementation(
|
|
9
|
-
this: Date
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
vi.spyOn(global.Date.prototype, "getMonth").mockImplementation(
|
|
14
|
-
this: Date
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
vi.spyOn(global.Date.prototype, "getDate").mockImplementation(
|
|
19
|
-
this: Date
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
vi.spyOn(global.Date.prototype, "getHours").mockImplementation(
|
|
24
|
-
this: Date
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
vi.spyOn(global.Date.prototype, "getMinutes").mockImplementation(
|
|
29
|
-
this: Date
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
vi.spyOn(global.Date.prototype, "getSeconds").mockImplementation(
|
|
34
|
-
this: Date
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
8
|
+
vi.spyOn(global.Date.prototype, "getFullYear").mockImplementation(
|
|
9
|
+
function (this: Date) {
|
|
10
|
+
return this.getUTCFullYear();
|
|
11
|
+
},
|
|
12
|
+
);
|
|
13
|
+
vi.spyOn(global.Date.prototype, "getMonth").mockImplementation(
|
|
14
|
+
function (this: Date) {
|
|
15
|
+
return this.getUTCMonth();
|
|
16
|
+
},
|
|
17
|
+
);
|
|
18
|
+
vi.spyOn(global.Date.prototype, "getDate").mockImplementation(
|
|
19
|
+
function (this: Date) {
|
|
20
|
+
return this.getUTCDate();
|
|
21
|
+
},
|
|
22
|
+
);
|
|
23
|
+
vi.spyOn(global.Date.prototype, "getHours").mockImplementation(
|
|
24
|
+
function (this: Date) {
|
|
25
|
+
return this.getUTCHours();
|
|
26
|
+
},
|
|
27
|
+
);
|
|
28
|
+
vi.spyOn(global.Date.prototype, "getMinutes").mockImplementation(
|
|
29
|
+
function (this: Date) {
|
|
30
|
+
return this.getUTCMinutes();
|
|
31
|
+
},
|
|
32
|
+
);
|
|
33
|
+
vi.spyOn(global.Date.prototype, "getSeconds").mockImplementation(
|
|
34
|
+
function (this: Date) {
|
|
35
|
+
return this.getUTCSeconds();
|
|
36
|
+
},
|
|
37
|
+
);
|
|
38
38
|
vi.spyOn(global.Date.prototype, "getMilliseconds").mockImplementation(
|
|
39
39
|
function (this: Date) {
|
|
40
40
|
return this.getUTCMilliseconds();
|
|
@@ -29,7 +29,8 @@ const badgeVariants = cva(
|
|
|
29
29
|
);
|
|
30
30
|
|
|
31
31
|
export interface BadgeProps
|
|
32
|
-
extends
|
|
32
|
+
extends
|
|
33
|
+
React.HTMLAttributes<HTMLDivElement>,
|
|
33
34
|
VariantProps<typeof badgeVariants> {}
|
|
34
35
|
|
|
35
36
|
const Badge = ({ className, variant, ...props }: BadgeProps) => {
|
|
@@ -92,7 +92,8 @@ const buttonVariants = cva(
|
|
|
92
92
|
);
|
|
93
93
|
|
|
94
94
|
export interface ButtonProps
|
|
95
|
-
extends
|
|
95
|
+
extends
|
|
96
|
+
React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
96
97
|
Omit<VariantProps<typeof buttonVariants>, "disabled"> {
|
|
97
98
|
asChild?: boolean;
|
|
98
99
|
keyboardShortcut?: string;
|
|
@@ -183,8 +183,9 @@ const Calendar = <T extends AriaDateValue>({
|
|
|
183
183
|
);
|
|
184
184
|
};
|
|
185
185
|
|
|
186
|
-
interface RangeCalendarProps<
|
|
187
|
-
extends
|
|
186
|
+
interface RangeCalendarProps<
|
|
187
|
+
T extends AriaDateValue,
|
|
188
|
+
> extends AriaRangeCalendarProps<T> {
|
|
188
189
|
errorMessage?: string;
|
|
189
190
|
}
|
|
190
191
|
|
|
@@ -230,7 +230,8 @@ interface ComboboxItemOptions<TValue> {
|
|
|
230
230
|
}
|
|
231
231
|
|
|
232
232
|
export interface ComboboxItemProps<TValue>
|
|
233
|
-
extends
|
|
233
|
+
extends
|
|
234
|
+
ComboboxItemOptions<TValue>,
|
|
234
235
|
Omit<
|
|
235
236
|
React.ComponentProps<typeof CommandItem>,
|
|
236
237
|
keyof ComboboxItemOptions<TValue> | "onSelect" | "role"
|
|
@@ -41,8 +41,7 @@ const DateSegment = ({ className, ...props }: AriaDateSegmentProps) => {
|
|
|
41
41
|
};
|
|
42
42
|
|
|
43
43
|
interface DateInputProps
|
|
44
|
-
extends AriaDateInputProps,
|
|
45
|
-
VariantProps<typeof fieldGroupVariants> {}
|
|
44
|
+
extends AriaDateInputProps, VariantProps<typeof fieldGroupVariants> {}
|
|
46
45
|
|
|
47
46
|
const DateInput = ({
|
|
48
47
|
className,
|
|
@@ -61,8 +60,9 @@ const DateInput = ({
|
|
|
61
60
|
);
|
|
62
61
|
};
|
|
63
62
|
|
|
64
|
-
interface DateFieldProps<
|
|
65
|
-
extends
|
|
63
|
+
interface DateFieldProps<
|
|
64
|
+
T extends AriaDateValue,
|
|
65
|
+
> extends AriaDateFieldProps<T> {
|
|
66
66
|
label?: string;
|
|
67
67
|
description?: string;
|
|
68
68
|
errorMessage?: string | ((validation: AriaValidationResult) => string);
|
|
@@ -94,8 +94,9 @@ const DateField = <T extends AriaDateValue>({
|
|
|
94
94
|
);
|
|
95
95
|
};
|
|
96
96
|
|
|
97
|
-
interface TimeFieldProps<
|
|
98
|
-
extends
|
|
97
|
+
interface TimeFieldProps<
|
|
98
|
+
T extends AriaTimeValue,
|
|
99
|
+
> extends AriaTimeFieldProps<T> {
|
|
99
100
|
label?: string;
|
|
100
101
|
description?: string;
|
|
101
102
|
errorMessage?: string | ((validation: AriaValidationResult) => string);
|