@marimo-team/frontend 0.25.2-dev56 → 0.25.2-dev61
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/ConnectedDataExplorerComponent-C5UW0p9I.js +1 -0
- package/dist/assets/JsonOutput-nqqzL-n0.js +11 -0
- package/dist/assets/{agent-panel-9FeJ9hAg.js → agent-panel-Bkcf1sED.js} +1 -1
- package/dist/assets/{cell-editor-BNIogYsY.js → cell-editor-Cmqe3QmM.js} +1 -1
- package/dist/assets/{column-preview-D2Um0Qe3.js → column-preview-DtrgJzVI.js} +1 -1
- package/dist/assets/{command-palette-ChCapZF9.js → command-palette-DUPyVGsq.js} +1 -1
- package/dist/assets/{edit-page-DIBiWEli.js → edit-page-DMsRAPsr.js} +4 -4
- package/dist/assets/{file-explorer-panel-CxBxvZDk.js → file-explorer-panel-BQi88S1o.js} +1 -1
- package/dist/assets/{hooks-5owWOOnf.js → hooks-BHoInJWN.js} +1 -1
- package/dist/assets/{index-D9fmFCuc.js → index-C968xQuz.js} +7 -7
- package/dist/assets/index-CF8Gfz1R.css +2 -0
- package/dist/assets/{layout-giNu7tsO.js → layout-CzNq5YtR.js} +3 -3
- package/dist/assets/{panels-DftjTXK1.js → panels-Dsf6yEsA.js} +1 -1
- package/dist/assets/{reveal-component-C72HbbmJ.js → reveal-component-CJxdWpbj.js} +1 -1
- package/dist/assets/{run-page-BOSkpSu_.js → run-page-DCu4YGwW.js} +1 -1
- package/dist/assets/{scratchpad-panel-C3gu3_1_.js → scratchpad-panel-BSlnM0TK.js} +1 -1
- package/dist/assets/{session-panel-CNK8FDu3.js → session-panel-BdN43Lzi.js} +1 -1
- package/dist/assets/spec-D9d9nT0z.js +1 -0
- package/dist/assets/{list-filter-CTg19675.js → table-B7KYyTxw.js} +1 -1
- package/dist/assets/{useNotebookActions-ByyEgzc-.js → useNotebookActions-BDD321Hs.js} +1 -1
- package/dist/index.html +6 -6
- package/package.json +1 -1
- package/src/components/data-table/TableTopBar.tsx +4 -0
- package/src/components/data-table/__tests__/export-actions.test.tsx +1111 -14
- package/src/components/data-table/__tests__/schemas.test.ts +57 -0
- package/src/components/data-table/data-table.tsx +3 -0
- package/src/components/data-table/export-actions.tsx +365 -81
- package/src/components/data-table/schemas.ts +90 -14
- package/src/plugins/impl/DataTablePlugin.tsx +23 -2
- package/src/plugins/impl/__tests__/DataTablePlugin.test.tsx +65 -8
- package/src/plugins/impl/data-frames/DataFramePlugin.tsx +15 -3
- package/src/stories/dataframe.stories.tsx +7 -0
- package/dist/assets/ConnectedDataExplorerComponent-Jv_dljLQ.js +0 -1
- package/dist/assets/JsonOutput-Dmq_45PS.js +0 -11
- package/dist/assets/index-BGdpHNhZ.css +0 -2
- package/dist/assets/spec-SOFn9xEK.js +0 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import { describe, expect, it } from "vitest";
|
|
4
|
+
import {
|
|
5
|
+
DownloadAsSchema,
|
|
6
|
+
DownloadGeoJSONSchema,
|
|
7
|
+
GetExportMetadataSchema,
|
|
8
|
+
} from "../schemas";
|
|
9
|
+
|
|
10
|
+
describe("geometry export contracts", () => {
|
|
11
|
+
it("keeps the existing download_as formats unchanged", () => {
|
|
12
|
+
for (const format of ["csv", "tsv", "json", "parquet"]) {
|
|
13
|
+
expect(DownloadAsSchema.input.parse({ format })).toEqual({ format });
|
|
14
|
+
}
|
|
15
|
+
expect(
|
|
16
|
+
DownloadAsSchema.input.safeParse({ format: "geojson" }).success,
|
|
17
|
+
).toBe(false);
|
|
18
|
+
});
|
|
19
|
+
it.each([undefined, "geom_b", ""])(
|
|
20
|
+
"accepts a GeoJSON request with geometry %s",
|
|
21
|
+
(geometry_column) => {
|
|
22
|
+
const request = { format: "geojson", geometry_column };
|
|
23
|
+
expect(DownloadGeoJSONSchema.input.parse(request)).toEqual(request);
|
|
24
|
+
},
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
it("accepts a missing CRS response for an unnamed geometry", () => {
|
|
28
|
+
const response = {
|
|
29
|
+
url: "",
|
|
30
|
+
filename: "",
|
|
31
|
+
code: "missing_crs",
|
|
32
|
+
column: "",
|
|
33
|
+
error: "Declare a CRS.",
|
|
34
|
+
};
|
|
35
|
+
expect(DownloadGeoJSONSchema.output.parse(response)).toEqual(response);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
it("accepts GeoJSON support when the default geometry has no CRS", () => {
|
|
39
|
+
const metadata = {
|
|
40
|
+
geometry_columns: [
|
|
41
|
+
{ name: "", encoding: "objects", crs: null },
|
|
42
|
+
{ name: "alternate", encoding: "objects", crs: "EPSG:4326" },
|
|
43
|
+
],
|
|
44
|
+
primary_geometry_column: "",
|
|
45
|
+
default_geometry_column: "",
|
|
46
|
+
formats: {
|
|
47
|
+
geojson: { available: true, reason: null, missing_packages: [] },
|
|
48
|
+
parquet: {
|
|
49
|
+
available: false,
|
|
50
|
+
reason: "GeoParquet export requires pyarrow.",
|
|
51
|
+
missing_packages: ["pyarrow"],
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
expect(GetExportMetadataSchema.output.parse(metadata)).toEqual(metadata);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
@@ -155,6 +155,7 @@ const DataTableInternal = <TData,>({
|
|
|
155
155
|
paginationState,
|
|
156
156
|
setPaginationState,
|
|
157
157
|
downloadAs,
|
|
158
|
+
getExportMetadata,
|
|
158
159
|
manualPagination = false,
|
|
159
160
|
pagination = false,
|
|
160
161
|
onRowSelectionChange,
|
|
@@ -376,6 +377,8 @@ const DataTableInternal = <TData,>({
|
|
|
376
377
|
togglePanel={togglePanel}
|
|
377
378
|
isAnyPanelOpen={isAnyPanelOpen}
|
|
378
379
|
downloadAs={downloadAs}
|
|
380
|
+
getExportMetadata={getExportMetadata}
|
|
381
|
+
metadataSource={data}
|
|
379
382
|
sizeBytes={sizeBytes}
|
|
380
383
|
sizeBytesIsLoading={sizeBytesIsLoading}
|
|
381
384
|
/>
|