@marimo-team/islands 0.23.17-dev31 → 0.23.17-dev33

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.
Files changed (27) hide show
  1. package/dist/{chat-ui-CnjFz0bt.js → chat-ui-Cjd9kIcO.js} +56 -56
  2. package/dist/{common-CaGHcf3w.js → common-C2Coc2Bh.js} +629 -629
  3. package/dist/{html-to-image-B8KJvlou.js → html-to-image-Bgb6aaXi.js} +2154 -2150
  4. package/dist/main.js +668 -675
  5. package/dist/{process-output-CjS9wS4l.js → process-output-D2Oxf11p.js} +1 -1
  6. package/dist/{reveal-component-Cja7Z8N3.js → reveal-component--Ln8gdbm.js} +2 -2
  7. package/package.json +1 -1
  8. package/src/components/data-table/charts/__tests__/schemas.test.ts +35 -0
  9. package/src/components/data-table/charts/schemas.ts +5 -2
  10. package/src/components/datasets/__tests__/icons.test.ts +21 -0
  11. package/src/components/datasets/icons.tsx +10 -0
  12. package/src/components/datasources/__tests__/components.test.tsx +29 -0
  13. package/src/components/datasources/components.tsx +8 -3
  14. package/src/components/editor/actions/export-dialog/export-command.ts +4 -9
  15. package/src/core/codemirror/language/languages/sql/__tests__/renderers.test.tsx +44 -0
  16. package/src/core/codemirror/language/languages/sql/renderers.tsx +3 -3
  17. package/src/core/network/__tests__/api.test.ts +132 -17
  18. package/src/core/network/__tests__/export-filename.test.ts +43 -0
  19. package/src/core/network/api.ts +47 -12
  20. package/src/core/network/export-filename.ts +37 -0
  21. package/src/core/network/markdown-export.ts +19 -0
  22. package/src/core/network/requests-network.ts +29 -5
  23. package/src/core/network/types.ts +3 -0
  24. package/src/plugins/impl/DataEditorPlugin.tsx +2 -9
  25. package/src/plugins/impl/__tests__/DataEditorPlugin.test.ts +18 -0
  26. package/src/plugins/impl/data-frames/__tests__/schema.test.ts +30 -0
  27. package/src/plugins/impl/data-frames/schema.ts +4 -1
@@ -3,6 +3,10 @@
3
3
  import { once } from "@/utils/once";
4
4
  import { getRuntimeManager } from "../runtime/config";
5
5
  import { API, createClientWithRuntimeManager } from "./api";
6
+ import {
7
+ getDefaultExportFilename,
8
+ getDefaultMarkdownExportFilename,
9
+ } from "./export-filename";
6
10
  import {
7
11
  waitForConnectionOpen,
8
12
  waitForConnectionOpenIfNotebook,
@@ -426,7 +430,11 @@ export function createNetworkRequests(): EditRequests & RunRequests {
426
430
  parseAs: "text",
427
431
  params: getParams(),
428
432
  })
429
- .then(handleExportResponse);
433
+ .then((response) =>
434
+ handleExportResponse(response, {
435
+ defaultFilename: getDefaultExportFilename("html"),
436
+ }),
437
+ );
430
438
  },
431
439
  exportAsMarkdown: async (request) => {
432
440
  return getClient()
@@ -435,7 +443,11 @@ export function createNetworkRequests(): EditRequests & RunRequests {
435
443
  parseAs: "text",
436
444
  params: getParams(),
437
445
  })
438
- .then(handleExportResponse);
446
+ .then((response) =>
447
+ handleExportResponse(response, {
448
+ defaultFilename: getDefaultMarkdownExportFilename(request.flavor),
449
+ }),
450
+ );
439
451
  },
440
452
  exportAsScript: async (request) => {
441
453
  return getClient()
@@ -444,7 +456,11 @@ export function createNetworkRequests(): EditRequests & RunRequests {
444
456
  parseAs: "text",
445
457
  params: getParams(),
446
458
  })
447
- .then(handleExportResponse);
459
+ .then((response) =>
460
+ handleExportResponse(response, {
461
+ defaultFilename: getDefaultExportFilename("script.py"),
462
+ }),
463
+ );
448
464
  },
449
465
  exportAsIPYNB: async (request) => {
450
466
  return getClient()
@@ -453,7 +469,11 @@ export function createNetworkRequests(): EditRequests & RunRequests {
453
469
  parseAs: "text",
454
470
  params: getParams(),
455
471
  })
456
- .then(handleExportResponse);
472
+ .then((response) =>
473
+ handleExportResponse(response, {
474
+ defaultFilename: getDefaultExportFilename("ipynb"),
475
+ }),
476
+ );
457
477
  },
458
478
  exportAsPDF: async (request) => {
459
479
  return getClient()
@@ -462,7 +482,11 @@ export function createNetworkRequests(): EditRequests & RunRequests {
462
482
  parseAs: "blob",
463
483
  params: getParams(),
464
484
  })
465
- .then(handleExportResponse);
485
+ .then((response) =>
486
+ handleExportResponse(response, {
487
+ defaultFilename: getDefaultExportFilename("pdf"),
488
+ }),
489
+ );
466
490
  },
467
491
  autoExportAsHTML: async (request) => {
468
492
  return getClient()
@@ -22,6 +22,9 @@ export type AutoExportAsMarkdownRequest =
22
22
  schemas["AutoExportAsMarkdownRequest"];
23
23
  export type ExportAsHTMLRequest = schemas["ExportAsHTMLRequest"];
24
24
  export type ExportAsMarkdownRequest = schemas["ExportAsMarkdownRequest"];
25
+ export type MarkdownExportFlavor = NonNullable<
26
+ ExportAsMarkdownRequest["flavor"]
27
+ >;
25
28
  export type ExportAsIPYNBRequest = schemas["ExportAsIPYNBRequest"];
26
29
  export type ExportAsScriptRequest = schemas["ExportAsScriptRequest"];
27
30
  export type ExportAsPDFRequest = schemas["ExportAsPDFRequest"];
@@ -8,10 +8,10 @@ import { LoadingTable } from "@/components/data-table/loading-table";
8
8
  import { type FieldTypes, toFieldTypes } from "@/components/data-table/types";
9
9
  import { Alert, AlertTitle } from "@/components/ui/alert";
10
10
  import { DelayMount } from "@/components/utils/delay-mount";
11
- import { DATA_TYPES } from "@/core/kernel/messages";
12
11
  import { useAsyncData } from "@/hooks/useAsyncData";
13
12
  import { createPlugin } from "../core/builder";
14
13
  import type { Setter } from "../types";
14
+ import { columnToFieldTypesSchema } from "./data-frames/schema";
15
15
  import {
16
16
  BulkEdit,
17
17
  type DataEditorProps,
@@ -44,14 +44,7 @@ export const DataEditorPlugin = createPlugin<Edits>("marimo-data-editor", {
44
44
  }),
45
45
  label: z.string().nullable(),
46
46
  data: z.union([z.string(), z.array(z.object({}).passthrough())]),
47
- fieldTypes: z
48
- .array(
49
- z.tuple([
50
- z.coerce.string(),
51
- z.tuple([z.enum(DATA_TYPES), z.string()]),
52
- ]),
53
- )
54
- .nullish(),
47
+ fieldTypes: columnToFieldTypesSchema.nullish(),
55
48
  editableColumns: z.union([z.array(z.string()), z.literal("all")]),
56
49
  columnSizingMode: z.enum(["auto", "fit"]).default("auto"), // TODO: Remove this
57
50
  }),
@@ -0,0 +1,18 @@
1
+ /* Copyright 2026 Marimo. All rights reserved. */
2
+
3
+ import { describe, expect, it } from "vitest";
4
+ import { DataEditorPlugin } from "../DataEditorPlugin";
5
+
6
+ describe("DataEditorPlugin", () => {
7
+ it("normalizes an unrecognized field type", () => {
8
+ const result = DataEditorPlugin.validator.parse({
9
+ initialValue: { edits: [] },
10
+ label: null,
11
+ data: [],
12
+ fieldTypes: [["geom", ["geometry", "geometry"]]],
13
+ editableColumns: "all",
14
+ });
15
+
16
+ expect(result.fieldTypes).toEqual([["geom", ["unknown", "geometry"]]]);
17
+ });
18
+ });
@@ -0,0 +1,30 @@
1
+ /* Copyright 2026 Marimo. All rights reserved. */
2
+
3
+ import { describe, expect, it } from "vitest";
4
+ import { columnToFieldTypesSchema } from "../schema";
5
+
6
+ describe("columnToFieldTypesSchema", () => {
7
+ it("keeps known field types", () => {
8
+ const result = columnToFieldTypesSchema.parse([
9
+ ["count", ["integer", "int64"]],
10
+ ["label", ["string", "object"]],
11
+ ]);
12
+
13
+ expect(result).toEqual([
14
+ ["count", ["integer", "int64"]],
15
+ ["label", ["string", "object"]],
16
+ ]);
17
+ });
18
+
19
+ it("normalizes an unrecognized field type without discarding other fields", () => {
20
+ const result = columnToFieldTypesSchema.parse([
21
+ ["geom", ["geometry", "geometry"]],
22
+ ["label", ["string", "object"]],
23
+ ]);
24
+
25
+ expect(result).toEqual([
26
+ ["geom", ["unknown", "geometry"]],
27
+ ["label", ["string", "object"]],
28
+ ]);
29
+ });
30
+ });
@@ -15,7 +15,10 @@ import {
15
15
  } from "./utils/operators";
16
16
 
17
17
  export const columnToFieldTypesSchema = z.array(
18
- z.tuple([z.coerce.string(), z.tuple([z.enum(DATA_TYPES), z.string()])]),
18
+ z.tuple([
19
+ z.coerce.string(),
20
+ z.tuple([z.enum(DATA_TYPES).catch("unknown"), z.string()]),
21
+ ]),
19
22
  );
20
23
 
21
24
  export const column_id = z