@marimo-team/islands 0.24.1-dev2 → 0.24.1-dev21

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 (62) hide show
  1. package/dist/{ConnectedDataExplorerComponent-BUC1MrsF.js → ConnectedDataExplorerComponent-yEsovh7C.js} +4 -4
  2. package/dist/{chat-ui-o-tATfmW.js → chat-ui-dZ0mdOG3.js} +3 -3
  3. package/dist/{common-DjnMIXVY.js → common-DhYGWkNU.js} +14 -8
  4. package/dist/{formats-HSfYlcA8.js → formats-BZtMpeQe.js} +2 -2
  5. package/dist/{glide-data-editor-BI2i_IEE.js → glide-data-editor-BcvvJTCH.js} +2 -0
  6. package/dist/{html-to-image-BOiFHx3u.js → html-to-image-p-mxZ3_V.js} +2333 -2311
  7. package/dist/{loader-DTnbNSVZ.js → loader-Chm6nOqy.js} +1 -1
  8. package/dist/main.js +1106 -1011
  9. package/dist/{process-output-HrsM52f8.js → process-output-Bh4xztNq.js} +1 -1
  10. package/dist/{react-vega-zyfTF9SY.js → react-vega-BE2Uv1cq.js} +1 -1
  11. package/dist/{reveal-component-BufNyZPY.js → reveal-component-BzecpV7i.js} +5 -5
  12. package/dist/{spec-BL1GSUUF.js → spec-DR1CyTOo.js} +2 -0
  13. package/dist/style.css +1 -1
  14. package/dist/{toDate-BGM7kFtQ.js → toDate-CjUYDkFI.js} +2 -2
  15. package/dist/{vega-component-CJug-VdR.js → vega-component-CTiCS_5w.js} +5 -5
  16. package/dist/{vega-embed-container-BRjjqRGz.js → vega-embed-container-B1tc-DoN.js} +2 -2
  17. package/dist/{vega-loader.browser-CGb-2Kwi.js → vega-loader.browser-VFQfHaoV.js} +1 -1
  18. package/package.json +1 -1
  19. package/src/__mocks__/requests.ts +4 -0
  20. package/src/components/app-config/optional-features.test.ts +78 -0
  21. package/src/components/app-config/optional-features.tsx +33 -6
  22. package/src/components/data-table/__tests__/column_formatting.test.ts +7 -0
  23. package/src/components/data-table/charts/__tests__/schemas.test.ts +17 -2
  24. package/src/components/data-table/charts/chart-spec/types.ts +2 -0
  25. package/src/components/data-table/column-formatting/feature.ts +1 -0
  26. package/src/components/data-table/column-formatting/types.ts +1 -0
  27. package/src/components/data-table/column-summary/chart-spec-model.tsx +1 -0
  28. package/src/components/data-table/column-summary/column-summary.tsx +1 -0
  29. package/src/components/data-table/columns.tsx +4 -3
  30. package/src/components/datasets/__tests__/icons.test.ts +10 -2
  31. package/src/components/datasets/icons.tsx +4 -0
  32. package/src/components/datasources/__tests__/components.test.tsx +14 -1
  33. package/src/components/editor/actions/export-dialog/__tests__/export-dialog.test.tsx +206 -34
  34. package/src/components/editor/actions/export-dialog/export-dialog.tsx +9 -3
  35. package/src/components/editor/actions/export-dialog/format-notice.tsx +69 -24
  36. package/src/components/editor/actions/export-dialog/use-export-dialog.ts +27 -2
  37. package/src/components/ui/toaster.tsx +14 -1
  38. package/src/core/codemirror/code-lens/__tests__/popover.test.ts +13 -0
  39. package/src/core/codemirror/code-lens/popover.tsx +11 -5
  40. package/src/core/codemirror/language/languages/sql/__tests__/renderers.test.tsx +15 -4
  41. package/src/core/codemirror/language/languages/sql/renderers.tsx +1 -0
  42. package/src/core/islands/bridge.ts +1 -0
  43. package/src/core/kernel/messages.ts +1 -0
  44. package/src/core/mode.ts +6 -1
  45. package/src/core/network/__tests__/requests-lazy.test.ts +40 -0
  46. package/src/core/network/__tests__/requests-network.test.ts +13 -0
  47. package/src/core/network/requests-lazy.ts +11 -4
  48. package/src/core/network/requests-network.ts +8 -0
  49. package/src/core/network/requests-static.ts +1 -0
  50. package/src/core/network/requests-toasting.tsx +1 -0
  51. package/src/core/network/types.ts +5 -0
  52. package/src/core/wasm/bridge.ts +1 -0
  53. package/src/plugins/impl/MatrixPlugin.tsx +256 -35
  54. package/src/plugins/impl/__tests__/DataEditorPlugin.test.ts +13 -1
  55. package/src/plugins/impl/__tests__/MatrixPlugin.test.tsx +540 -3
  56. package/src/plugins/impl/data-editor/glide-data-editor.tsx +1 -0
  57. package/src/plugins/impl/data-editor/glide-utils.ts +1 -0
  58. package/src/plugins/impl/data-frames/__tests__/schema.test.ts +9 -1
  59. package/src/plugins/impl/data-frames/utils/__tests__/operators.test.ts +8 -0
  60. package/src/plugins/impl/data-frames/utils/operators.ts +1 -1
  61. package/src/plugins/impl/vega/__tests__/vega.test.ts +22 -4
  62. package/src/plugins/impl/vega/utils.ts +3 -0
@@ -7,6 +7,7 @@ import {
7
7
  vegaLoadData,
8
8
  vegaLoader,
9
9
  } from "../loader";
10
+ import { getVegaFieldTypes } from "../utils";
10
11
 
11
12
  const { ZERO_WIDTH_SPACE, replacePeriodsInColumnNames, uniquifyColumnNames } =
12
13
  exportedForTesting;
@@ -102,15 +103,32 @@ yield_error,yield_center
102
103
  `);
103
104
  });
104
105
 
105
- it.each(DATA_TYPES)("should handle %s data-type", async (type) => {
106
- const csvData = "name,value_column\nAlice,1";
106
+ it.each(DATA_TYPES.filter((type) => type !== "geometry"))(
107
+ "should handle %s data-type",
108
+ async (type) => {
109
+ const csvData = "name,value_column\nAlice,1";
110
+ vi.spyOn(vegaLoader, "load").mockReturnValue(Promise.resolve(csvData));
111
+
112
+ const result = await vegaLoadData(csvData, {
113
+ type: "csv",
114
+ parse: { value_column: type },
115
+ });
116
+ expect(result.length).toEqual(1);
117
+ },
118
+ );
119
+
120
+ it("should parse geometry as a WKT string", async () => {
121
+ const csvData = "name,value_column\nAlice,POINT (0 0)";
107
122
  vi.spyOn(vegaLoader, "load").mockReturnValue(Promise.resolve(csvData));
108
123
 
124
+ const fieldTypes = getVegaFieldTypes({ value_column: "geometry" });
125
+ expect(fieldTypes).toEqual({ value_column: "string" });
126
+
109
127
  const result = await vegaLoadData(csvData, {
110
128
  type: "csv",
111
- parse: { value_column: type },
129
+ parse: fieldTypes,
112
130
  });
113
- expect(result.length).toEqual(1);
131
+ expect(result).toEqual([{ name: "Alice", value_column: "POINT (0 0)" }]);
114
132
  });
115
133
 
116
134
  it("should parse csv data with out of bound integers", async () => {
@@ -55,6 +55,9 @@ export function getVegaFieldTypes(
55
55
  // the correct formatting. For example, a date like '2024-01-01' will
56
56
  // be formatted to '2024-01-01T00:00:00.000Z'.
57
57
  return Objects.mapValues(types, (type): VegaDataType => {
58
+ if (type === "geometry") {
59
+ return "string";
60
+ }
58
61
  if (type === "date") {
59
62
  return "string";
60
63
  }