@marimo-team/frontend 0.25.3-dev104 → 0.25.3-dev108

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 (112) hide show
  1. package/dist/assets/{CellStatus-DVrvejMC.js → CellStatus-_Aw9_foI.js} +1 -1
  2. package/dist/assets/{ConnectedDataExplorerComponent-Dft8R6l5.js → ConnectedDataExplorerComponent-BRgqbAsc.js} +1 -1
  3. package/dist/assets/{ErrorBoundary-0akNKvJm.js → ErrorBoundary-DxSzjvbx.js} +2 -2
  4. package/dist/assets/{JsonOutput-DeUmpc_f.js → JsonOutput-B7pGj79O.js} +2 -2
  5. package/dist/assets/{MarimoErrorOutput-BazxeAYV.js → MarimoErrorOutput-Bzo6Bkp5.js} +1 -1
  6. package/dist/assets/{RenderHTML-CbAdeual.js → RenderHTML-D6AC0IhC.js} +1 -1
  7. package/dist/assets/{RunButton-CjKwgCFU.js → RunButton-BjYsPiKa.js} +1 -1
  8. package/dist/assets/{add-cell-with-ai-BKVEws3J.js → add-cell-with-ai-DlpS2-wQ.js} +4 -4
  9. package/dist/assets/{add-connection-dialog-DS7LTz1T.js → add-connection-dialog-CyNAB_W2.js} +1 -1
  10. package/dist/assets/{agent-panel-B34QcdOK.js → agent-panel-_lzeDJ1g.js} +1 -1
  11. package/dist/assets/{ai-model-dropdown-DqFJCFVR.js → ai-model-dropdown-DSTTUxpi.js} +1 -1
  12. package/dist/assets/{app-config-button-CVh4UKi9.js → app-config-button-ChYKLsLO.js} +1 -1
  13. package/dist/assets/{blob-Bw0ZQoLx.js → blob-DTYOX-m5.js} +1 -1
  14. package/dist/assets/{cell-editor-DQ0io5Ye.js → cell-editor-Beg8ahPA.js} +2 -2
  15. package/dist/assets/{cell-link-DvOIu6A3.js → cell-link-D3rkqgbU.js} +1 -1
  16. package/dist/assets/{cells-Do-63MKT.js → cells-2HETnlvE.js} +5 -5
  17. package/dist/assets/{chat-display-DnkhBxdh.js → chat-display-0GIEXLvN.js} +1 -1
  18. package/dist/assets/{chat-panel-CN3qoX9G.js → chat-panel-BuWn4Z_F.js} +1 -1
  19. package/dist/assets/{chat-ui-B54K5qqr.js → chat-ui-X0s3vvdf.js} +1 -1
  20. package/dist/assets/{column-preview-DmxzHzaW.js → column-preview-yI7-INkZ.js} +1 -1
  21. package/dist/assets/{command-palette-CciCeRhy.js → command-palette-D6WLW1Ie.js} +1 -1
  22. package/dist/assets/{common-BCyx7t1i.js → common-DgXKwblm.js} +1 -1
  23. package/dist/assets/{components-CDvWXfXq.js → components-CuMhY4Sf.js} +1 -1
  24. package/dist/assets/{datasource-DieftweT.js → datasource-D9JMcEAP.js} +1 -1
  25. package/dist/assets/{dependency-graph-panel-IfcqTHgq.js → dependency-graph-panel-BVJWPCvw.js} +3 -3
  26. package/dist/assets/{documentation-panel-DeLCgVcq.js → documentation-panel--wI4XHso.js} +1 -1
  27. package/dist/assets/{download-BzfVCqUq.js → download-Dod42wfD.js} +1 -1
  28. package/dist/assets/{edit-page-HMyk4cWw.js → edit-page-EmacXgdB.js} +4 -4
  29. package/dist/assets/{error-entries-DjjWrbt4.js → error-entries-D00nWhWE.js} +1 -1
  30. package/dist/assets/{error-panel-CiG3JJA3.js → error-panel-CcN_1PWf.js} +1 -1
  31. package/dist/assets/{feedback-button-B8zVQEi6.js → feedback-button-ByGgqUsX.js} +1 -1
  32. package/dist/assets/feedback-button-tbWwJ_t6.js +1 -0
  33. package/dist/assets/{file-explorer-panel-BPD8Q0L-.js → file-explorer-panel-eTEqtMPW.js} +1 -1
  34. package/dist/assets/{file-name-input-CdkF9K3I.js → file-name-input-D5SfTNWh.js} +1 -1
  35. package/dist/assets/{floating-outline-TfDWJXBm.js → floating-outline-B-k3P_AO.js} +1 -1
  36. package/dist/assets/{gallery-page-BJpenPdQ.js → gallery-page-BzbMhDHi.js} +1 -1
  37. package/dist/assets/{glide-data-editor-DO15Nm-R.js → glide-data-editor-BMqhUrHI.js} +1 -1
  38. package/dist/assets/{home-page-mvqldGvD.js → home-page-BvA1BCmX.js} +1 -1
  39. package/dist/assets/{hooks-C4AJfqV0.js → hooks-CaRBg2ni.js} +1 -1
  40. package/dist/assets/{index-C2XzUsS7.js → index-hwaZTQ9l.js} +9 -9
  41. package/dist/assets/{layout-1kSh6fBF.js → layout-C-NAerIZ.js} +3 -3
  42. package/dist/assets/{logs-panel--QbHo7uS.js → logs-panel-B3T1GFBk.js} +1 -1
  43. package/dist/assets/{markdown-renderer-DJ7H8Rps.js → markdown-renderer-BhiTvxtL.js} +1 -1
  44. package/dist/assets/{name-cell-input-6Gd19S8T.js → name-cell-input-CgAObR6N.js} +1 -1
  45. package/dist/assets/{outline-panel-CjKvunvX.js → outline-panel-BhBb7Vqw.js} +1 -1
  46. package/dist/assets/{packages-panel-Gyrqi-MZ.js → packages-panel-Dz8rOIrh.js} +1 -1
  47. package/dist/assets/{panel-accordion-state-D49TNCLQ.js → panel-accordion-state-ZsUdpAYn.js} +1 -1
  48. package/dist/assets/{panels-DfbxoeGa.js → panels-B0lqLcI0.js} +1 -1
  49. package/dist/assets/{process-output-CgkoeA1-.js → process-output-CeOMwE17.js} +1 -1
  50. package/dist/assets/{readonly-code-display-BMbl_4BR.js → readonly-code-display-TvOC7ESE.js} +1 -1
  51. package/dist/assets/{readonly-python-code-BnPfpOJM.js → readonly-python-code-Cqkfdeyo.js} +1 -1
  52. package/dist/assets/{reveal-component-D84yAzG7.js → reveal-component-y06O6YuH.js} +1 -1
  53. package/dist/assets/{run-page-B10s8Pre.js → run-page-DHE6ET5K.js} +1 -1
  54. package/dist/assets/{runtime-details-state-Bkmgb59p.js → runtime-details-state-CKqJSfSR.js} +1 -1
  55. package/dist/assets/{scratchpad-panel-DtyjJ3yN.js → scratchpad-panel-BW_HfG5l.js} +1 -1
  56. package/dist/assets/{session-panel-Chaq1do8.js → session-panel-CdHdKUCF.js} +1 -1
  57. package/dist/assets/{snippets-panel-BaZmddOW.js → snippets-panel-DYLWOLYw.js} +1 -1
  58. package/dist/assets/{spec-uCpVvaAR.js → spec-DlH4Mp7d.js} +1 -1
  59. package/dist/assets/{state-Db73TZVD.js → state-DAqdiGqq.js} +1 -1
  60. package/dist/assets/{state-CqnCwHhY.js → state-DZN9vZ6z.js} +1 -1
  61. package/dist/assets/{tracing-C2vQMUI0.js → tracing-B0J2ctTm.js} +1 -1
  62. package/dist/assets/{tracing-panel-B4L2S2ac.js → tracing-panel-C1OCpoeE.js} +2 -2
  63. package/dist/assets/{tree-actions-JXDiioHK.js → tree-actions-sjBxIglc.js} +1 -1
  64. package/dist/assets/{useAddCell-CP3HIjGl.js → useAddCell-CaXnFGki.js} +1 -1
  65. package/dist/assets/{useCellActionButton-yi1_-emd.js → useCellActionButton-CJ90CMEj.js} +1 -1
  66. package/dist/assets/{useDeleteCell-BPLwyClM.js → useDeleteCell-D9N85822.js} +1 -1
  67. package/dist/assets/{useDependencyPanelTab-DmBiydXO.js → useDependencyPanelTab-CzAE0cm-.js} +1 -1
  68. package/dist/assets/{useNotebookActions-CfmgcJGx.js → useNotebookActions-CTKkktJB.js} +1 -1
  69. package/dist/assets/{useRunCells-jF-7tJkw.js → useRunCells-DGakx8hj.js} +1 -1
  70. package/dist/assets/{useSplitCell-B6zWL8Zf.js → useSplitCell-AK5BKPGM.js} +1 -1
  71. package/dist/index.html +21 -21
  72. package/package.json +2 -2
  73. package/src/components/data-table/__tests__/chart-spec-model.test.ts +195 -195
  74. package/src/components/data-table/charts/__tests__/spec-snapshot.test.ts +20 -20
  75. package/src/components/data-table/charts/__tests__/spec.test.ts +78 -52
  76. package/src/components/data-table/charts/chart-spec/spec.ts +68 -43
  77. package/src/components/data-table/charts/charts.tsx +5 -5
  78. package/src/components/data-table/column-summary/chart-spec-model.tsx +23 -16
  79. package/src/components/dependency-graph/dependency-graph-tree.tsx +8 -8
  80. package/src/components/dependency-graph/elements.ts +24 -21
  81. package/src/components/dependency-graph/utils/__tests__/layout.test.ts +18 -11
  82. package/src/components/editor/output/ansi-reduce.ts +30 -23
  83. package/src/components/editor/renderers/grid-layout/grid-layout.tsx +12 -6
  84. package/src/core/ai/tools/base.ts +16 -7
  85. package/src/core/ai/tools/edit-notebook-tool.ts +47 -45
  86. package/src/core/ai/tools/registry.ts +13 -8
  87. package/src/core/ai/tools/sample-tool.ts +6 -7
  88. package/src/core/cells/__tests__/session.test.ts +117 -36
  89. package/src/core/codemirror/__tests__/setup.test.ts +28 -28
  90. package/src/core/codemirror/language/__tests__/sql.test.ts +22 -20
  91. package/src/core/codemirror/language/extension.ts +8 -8
  92. package/src/core/codemirror/language/languages/markdown.ts +8 -6
  93. package/src/core/codemirror/language/languages/python.ts +13 -7
  94. package/src/core/codemirror/language/languages/sql/sql.ts +9 -7
  95. package/src/core/codemirror/language/types.ts +7 -7
  96. package/src/core/codemirror/rtc/extension.ts +24 -12
  97. package/src/core/codemirror/rtc/loro/awareness.ts +34 -19
  98. package/src/core/codemirror/rtc/loro/sync.ts +1 -0
  99. package/src/core/codemirror/utils.ts +1 -0
  100. package/src/core/host/__tests__/static.test.ts +167 -0
  101. package/src/core/host/backend.ts +10 -0
  102. package/src/core/host/static.ts +70 -0
  103. package/src/core/islands/components/__tests__/IslandControls.test.tsx +7 -5
  104. package/src/core/static/__tests__/files.test.ts +38 -10
  105. package/src/plugins/__tests__/plugin-object-schemas.test.ts +104 -0
  106. package/src/plugins/impl/DataEditorPlugin.tsx +1 -1
  107. package/src/plugins/impl/DataTablePlugin.tsx +15 -18
  108. package/src/plugins/impl/data-frames/DataFramePlugin.tsx +1 -1
  109. package/src/plugins/impl/plotly/PlotlyPlugin.tsx +2 -5
  110. package/src/plugins/impl/plotly/selection.ts +25 -19
  111. package/src/plugins/impl/vega/VegaPlugin.tsx +2 -3
  112. package/dist/assets/feedback-button-DQdMkSvR.js +0 -1
@@ -654,19 +654,47 @@ describe("error handling and edge cases", () => {
654
654
  unpatch();
655
655
  });
656
656
 
657
- it("should handle malformed URLs gracefully", async () => {
658
- const virtualFiles = {};
659
- const unpatch = patchFetch(virtualFiles);
657
+ it("forwards relative URLs and options to the original fetch", async () => {
658
+ const response = new Response("relative content");
659
+ const originalFetch = vi.spyOn(window, "fetch").mockResolvedValue(response);
660
+ const unpatch = patchFetch({});
661
+ const options = { headers: { Accept: "text/plain" } };
662
+
663
+ try {
664
+ expect(await window.fetch("relative-file.txt", options)).toBe(response);
665
+ expect(originalFetch).toHaveBeenCalledExactlyOnceWith(
666
+ "relative-file.txt",
667
+ options,
668
+ );
669
+ } finally {
670
+ unpatch();
671
+ originalFetch.mockRestore();
672
+ }
673
+ });
660
674
 
661
- // Mock Logger.error to avoid test output
675
+ it("preserves the original fetch rejection for malformed URLs", async () => {
676
+ const error = new TypeError("Invalid URL");
677
+ const originalFetch = vi.spyOn(window, "fetch").mockRejectedValue(error);
662
678
  const loggerSpy = vi
663
679
  .spyOn(console, "error")
664
680
  .mockImplementation(Functions.NOOP);
665
-
666
- // This should catch the error and fallback to original fetch
667
- await window.fetch("not-a-valid-url").catch(() => undefined);
668
-
669
- unpatch();
670
- loggerSpy.mockRestore();
681
+ const unpatch = patchFetch({});
682
+ const options = { headers: { Accept: "text/plain" } };
683
+
684
+ try {
685
+ await expect(window.fetch("http://[", options)).rejects.toBe(error);
686
+ expect(originalFetch).toHaveBeenCalledExactlyOnceWith(
687
+ "http://[",
688
+ options,
689
+ );
690
+ expect(loggerSpy).toHaveBeenCalledWith(
691
+ "Error parsing URL",
692
+ expect.any(TypeError),
693
+ );
694
+ } finally {
695
+ unpatch();
696
+ originalFetch.mockRestore();
697
+ loggerSpy.mockRestore();
698
+ }
671
699
  });
672
700
  });
@@ -0,0 +1,104 @@
1
+ /* Copyright 2026 Marimo. All rights reserved. */
2
+
3
+ import { describe, expect, it } from "vitest";
4
+ import { DataEditorPlugin } from "../impl/DataEditorPlugin";
5
+ import { DataTablePlugin } from "../impl/DataTablePlugin";
6
+ import { DataFramePlugin } from "../impl/data-frames/DataFramePlugin";
7
+ import { PlotlyPlugin } from "../impl/plotly/PlotlyPlugin";
8
+ import { VegaPlugin } from "../impl/vega/VegaPlugin";
9
+
10
+ describe("plugin object schemas", () => {
11
+ const rows = [{ value: 1, extra: { nested: true } }];
12
+ const styles = { "0": { value: { color: "red", customProperty: 1 } } };
13
+ const tableData = {
14
+ initialValue: [],
15
+ label: null,
16
+ data: rows,
17
+ totalRows: 1,
18
+ totalColumns: 1,
19
+ rowHeaders: [],
20
+ cellStyles: styles,
21
+ };
22
+
23
+ it("preserves table rows and arbitrary cell style fields", () => {
24
+ expect(DataTablePlugin.validator.parse(tableData)).toMatchObject({
25
+ data: rows,
26
+ cellStyles: styles,
27
+ pageSize: 10,
28
+ });
29
+ });
30
+
31
+ it("preserves data editor row fields", () => {
32
+ expect(
33
+ DataEditorPlugin.validator.parse({
34
+ initialValue: { edits: [] },
35
+ label: null,
36
+ data: rows,
37
+ editableColumns: "all",
38
+ }),
39
+ ).toMatchObject({ data: rows, columnNames: [] });
40
+ });
41
+
42
+ it("preserves table RPC payload fields", () => {
43
+ const functions = DataTablePlugin.functions!;
44
+ const searchResult = {
45
+ data: rows,
46
+ total_rows: 1,
47
+ cell_styles: styles,
48
+ cell_hover_texts: null,
49
+ };
50
+ expect(functions.search.output.parse(searchResult)).toEqual(searchResult);
51
+ expect(functions.get_row_ids!.input.parse({ custom: true })).toEqual({
52
+ custom: true,
53
+ });
54
+ expect(functions.get_data_url!.input.parse({ custom: true })).toEqual({
55
+ custom: true,
56
+ });
57
+ expect(
58
+ functions.get_data_url!.output.parse({ data_url: rows, format: "json" }),
59
+ ).toEqual({ data_url: rows, format: "json" });
60
+ });
61
+
62
+ it("preserves dataframe search row fields", () => {
63
+ const result = { data: rows, total_rows: 1 };
64
+ expect(DataFramePlugin.functions!.search.output.parse(result)).toEqual(
65
+ result,
66
+ );
67
+ });
68
+
69
+ it("preserves Plotly figure and config fields", () => {
70
+ const data = {
71
+ figure: { data: [], layout: { title: "Chart" } },
72
+ config: { responsive: true },
73
+ };
74
+ expect(new PlotlyPlugin().validator.parse(data)).toEqual(data);
75
+ });
76
+
77
+ it("preserves Vega spec and embed options fields and defaults", () => {
78
+ const spec = { mark: "bar", encoding: { x: { field: "value" } } };
79
+ const validator = new VegaPlugin().validator;
80
+ expect(validator.parse({ spec })).toEqual({
81
+ spec,
82
+ chartSelection: true,
83
+ fieldSelection: true,
84
+ embedOptions: {},
85
+ });
86
+ expect(
87
+ validator.parse({ spec, embedOptions: { actions: false } }).embedOptions,
88
+ ).toEqual({ actions: false });
89
+ });
90
+
91
+ it("rejects scalar values where plugin objects are required", () => {
92
+ expect(
93
+ DataTablePlugin.validator.safeParse({ ...tableData, data: [42] }).success,
94
+ ).toBe(false);
95
+ expect(
96
+ new PlotlyPlugin().validator.safeParse({ figure: 42, config: {} })
97
+ .success,
98
+ ).toBe(false);
99
+ expect(
100
+ new VegaPlugin().validator.safeParse({ spec: {}, embedOptions: 42 })
101
+ .success,
102
+ ).toBe(false);
103
+ });
104
+ });
@@ -44,7 +44,7 @@ export const DataEditorPlugin = createPlugin<Edits>("marimo-data-editor", {
44
44
  ),
45
45
  }),
46
46
  label: z.string().nullable(),
47
- data: z.union([z.string(), z.array(z.object({}).passthrough())]),
47
+ data: z.union([z.string(), z.array(z.looseObject({}))]),
48
48
  fieldTypes: columnToFieldTypesSchema.nullish(),
49
49
  columnNames: z.array(z.string()).default([]),
50
50
  editableColumns: z.union([z.array(z.string()), z.literal("all")]),
@@ -258,7 +258,7 @@ export const DataTablePlugin = createPlugin<S>("marimo-table")
258
258
  z.array(z.object({ rowId: z.string(), columnName: z.string() })),
259
259
  ]),
260
260
  label: z.string().nullable(),
261
- data: z.union([z.string(), z.array(z.object({}).passthrough())]),
261
+ data: z.union([z.string(), z.array(z.looseObject({}))]),
262
262
  rawData: z.union([z.string(), z.array(z.looseObject({}))]).nullish(),
263
263
  totalRows: z.union([z.number(), z.literal(TOO_MANY_ROWS)]),
264
264
  pagination: z.boolean().default(false),
@@ -296,7 +296,7 @@ export const DataTablePlugin = createPlugin<S>("marimo-table")
296
296
  hasStableRowId: z.boolean().default(false),
297
297
  maxHeight: z.number().optional(),
298
298
  cellStyles: z
299
- .record(z.string(), z.record(z.string(), z.object({}).passthrough()))
299
+ .record(z.string(), z.record(z.string(), z.looseObject({})))
300
300
  .optional(),
301
301
  hoverTemplate: z.string().optional(),
302
302
  cellHoverTexts: cellHoverTextSchema,
@@ -341,28 +341,25 @@ export const DataTablePlugin = createPlugin<S>("marimo-table")
341
341
  )
342
342
  .output(
343
343
  z.object({
344
- data: z.union([z.string(), z.array(z.object({}).passthrough())]),
344
+ data: z.union([z.string(), z.array(z.looseObject({}))]),
345
345
  total_rows: z.union([z.number(), z.literal(TOO_MANY_ROWS)]),
346
346
  cell_styles: z
347
- .record(
348
- z.string(),
349
- z.record(z.string(), z.object({}).passthrough()),
350
- )
347
+ .record(z.string(), z.record(z.string(), z.looseObject({})))
351
348
  .nullable(),
352
349
  cell_hover_texts: cellHoverTextSchema.nullable(),
353
350
  raw_data: z.union([z.string(), z.array(z.looseObject({}))]).nullish(),
354
351
  }),
355
352
  ),
356
- get_row_ids: rpc.input(z.object({}).passthrough()).output(
353
+ get_row_ids: rpc.input(z.looseObject({})).output(
357
354
  z.object({
358
355
  row_ids: z.array(z.number()),
359
356
  all_rows: z.boolean(),
360
357
  error: z.string().nullable(),
361
358
  }),
362
359
  ),
363
- get_data_url: rpc.input(z.object({}).passthrough()).output(
360
+ get_data_url: rpc.input(z.looseObject({})).output(
364
361
  z.object({
365
- data_url: z.union([z.string(), z.array(z.object({}).passthrough())]),
362
+ data_url: z.union([z.string(), z.array(z.looseObject({}))]),
366
363
  format: z.enum(["csv", "json", "arrow"]),
367
364
  }),
368
365
  ),
@@ -919,16 +916,16 @@ const DataTableComponent = ({
919
916
  }
920
917
  const fieldTypesWithoutExternalTypes = toFieldTypes(fieldTypes);
921
918
 
922
- return new ColumnChartSpecModel(
923
- columnSummaries.data || [],
924
- fieldTypesWithoutExternalTypes,
925
- columnSummaries.stats,
926
- columnSummaries.bin_values,
927
- columnSummaries.value_counts,
928
- {
919
+ return new ColumnChartSpecModel({
920
+ data: columnSummaries.data || [],
921
+ fieldTypes: fieldTypesWithoutExternalTypes,
922
+ stats: columnSummaries.stats,
923
+ binValues: columnSummaries.bin_values,
924
+ valueCounts: columnSummaries.value_counts,
925
+ opts: {
929
926
  includeCharts: columnSummaries.show_charts,
930
927
  },
931
- );
928
+ });
932
929
  }, [fieldTypes, columnSummaries]);
933
930
 
934
931
  const rowHeaderNames = new Set(rowHeaders.map(([name]) => name));
@@ -154,7 +154,7 @@ export const DataFramePlugin = createPlugin<S>("marimo-dataframe")
154
154
  )
155
155
  .output(
156
156
  z.object({
157
- data: z.union([z.string(), z.array(z.object({}).passthrough())]),
157
+ data: z.union([z.string(), z.array(z.looseObject({}))]),
158
158
  total_rows: z.number(),
159
159
  }),
160
160
  ),
@@ -58,11 +58,8 @@ export class PlotlyPlugin implements IPlugin<T, Data> {
58
58
  public tagName = "marimo-plotly";
59
59
 
60
60
  public validator = z.object({
61
- figure: z
62
- .object({})
63
- .passthrough()
64
- .transform((spec) => spec as unknown as Figure),
65
- config: z.object({}).passthrough(),
61
+ figure: z.looseObject({}).transform((spec) => spec as unknown as Figure),
62
+ config: z.looseObject({}),
66
63
  });
67
64
 
68
65
  public render(props: IPluginProps<T, Data>): JSX.Element {
@@ -208,13 +208,19 @@ export function hasAreaTrace(
208
208
  });
209
209
  }
210
210
 
211
- function createDragmodeButton(
212
- name: string,
213
- title: string,
214
- svg: string,
215
- dragmode: Plotly.Layout["dragmode"],
216
- setDragmode: (dragmode: Plotly.Layout["dragmode"]) => void,
217
- ): ModeBarButton {
211
+ function createDragmodeButton({
212
+ name,
213
+ title,
214
+ svg,
215
+ dragmode,
216
+ setDragmode,
217
+ }: {
218
+ name: string;
219
+ title: string;
220
+ svg: string;
221
+ dragmode: Plotly.Layout["dragmode"];
222
+ setDragmode: (dragmode: Plotly.Layout["dragmode"]) => void;
223
+ }): ModeBarButton {
218
224
  return {
219
225
  name,
220
226
  title,
@@ -227,27 +233,27 @@ export function lineSelectionButtons(
227
233
  setDragmode: (dragmode: Plotly.Layout["dragmode"]) => void,
228
234
  ): ModeBarButton[] {
229
235
  return [
230
- createDragmodeButton(
231
- "line-box-select",
232
- "Box select",
233
- `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
236
+ createDragmodeButton({
237
+ name: "line-box-select",
238
+ title: "Box select",
239
+ svg: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
234
240
  stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
235
241
  <rect x="4" y="4" width="16" height="16" stroke-dasharray="2 2" />
236
242
  </svg>`,
237
- "select",
243
+ dragmode: "select",
238
244
  setDragmode,
239
- ),
240
- createDragmodeButton(
241
- "line-lasso-select",
242
- "Lasso select",
243
- `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
245
+ }),
246
+ createDragmodeButton({
247
+ name: "line-lasso-select",
248
+ title: "Lasso select",
249
+ svg: `<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor"
244
250
  stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
245
251
  <path d="M6 8c0-2.2 2.2-4 5-4s5 1.8 5 4-2.2 4-5 4-5 1.8-5 4 2.2 4 5 4" />
246
252
  <circle cx="17.5" cy="16.5" r="1.5" />
247
253
  </svg>`,
248
- "lasso",
254
+ dragmode: "lasso",
249
255
  setDragmode,
250
- ),
256
+ }),
251
257
  ];
252
258
  }
253
259
 
@@ -16,14 +16,13 @@ export class VegaPlugin implements IPlugin<VegaComponentState, Data> {
16
16
 
17
17
  public validator = z.object({
18
18
  spec: z
19
- .object({})
20
- .passthrough()
19
+ .looseObject({})
21
20
  .transform((spec) => spec as unknown as VegaLiteSpec),
22
21
  chartSelection: z
23
22
  .union([z.boolean(), z.literal("point"), z.literal("interval")])
24
23
  .default(true),
25
24
  fieldSelection: z.union([z.boolean(), z.array(z.string())]).default(true),
26
- embedOptions: z.object({}).passthrough().default({}),
25
+ embedOptions: z.looseObject({}).default({}),
27
26
  });
28
27
 
29
28
  public render(props: IPluginProps<VegaComponentState, Data>): JSX.Element {
@@ -1 +0,0 @@
1
- import{n as e}from"./feedback-button-B8zVQEi6.js";export{e as FeedbackModal};