@marimo-team/islands 0.23.7-dev9 → 0.23.7-dev90

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 (153) hide show
  1. package/dist/{ConnectedDataExplorerComponent-DnRhpPMJ.js → ConnectedDataExplorerComponent-2lBNiUv6.js} +13 -13
  2. package/dist/{ErrorBoundary-Da4UeYxT.js → ErrorBoundary-D3wrPNma.js} +1 -1
  3. package/dist/{any-language-editor-DDubl8YH.js → any-language-editor-VWs_7v27.js} +5 -5
  4. package/dist/assets/__vite-browser-external-CAdMKBac.js +1 -0
  5. package/dist/assets/worker-CpBbwbQo.js +73 -0
  6. package/dist/{button-CA5pI2YF.js → button-Dj4BTre0.js} +5 -0
  7. package/dist/{capabilities-6laDasij.js → capabilities-C9rrYCzf.js} +1 -1
  8. package/dist/{chat-ui-BmWZZ3mE.js → chat-ui-D3XBept8.js} +625 -233
  9. package/dist/{check-CFM2mVDr.js → check-BcUIXnUT.js} +1 -1
  10. package/dist/{code-visibility-CRHzv49w.js → code-visibility-C5NrPsUC.js} +11480 -1992
  11. package/dist/{copy-TGGAUEWp.js → copy-DLf4aN7I.js} +2 -2
  12. package/dist/{dist-ESg7xyoD.js → dist-D3ZI9nhS.js} +2 -2
  13. package/dist/{error-banner-DnBPzEWg.js → error-banner-CVkfBUT3.js} +2 -2
  14. package/dist/{esm-Dd1z1auZ.js → esm-CWp0KQeK.js} +1 -1
  15. package/dist/{extends-CzJgxo2J.js → extends-vAi97cpa.js} +4 -4
  16. package/dist/{formats-CgaK7Gmx.js → formats-Dsy9kkZu.js} +3 -3
  17. package/dist/{glide-data-editor-B-3A3G02.js → glide-data-editor-DucgdjRo.js} +9 -9
  18. package/dist/{html-to-image-BwZL1Pkk.js → html-to-image-CpggM7u1.js} +2667 -2408
  19. package/dist/{input-BAOe64zx.js → input-D4kjoQUB.js} +8 -6
  20. package/dist/{label-BCWi-Oqu.js → label-BLqV33b1.js} +2 -2
  21. package/dist/{loader-BvW0-YWZ.js → loader-Dr8Qem8p.js} +1 -1
  22. package/dist/main.js +1697 -10282
  23. package/dist/{mermaid-cXSZ1pfD.js → mermaid-DO-Daq7u.js} +5 -5
  24. package/dist/{process-output-lpVrk7d5.js → process-output-X8TR20AK.js} +3 -3
  25. package/dist/reveal-component-kMIwe09M.js +7447 -0
  26. package/dist/{spec-DSIuqd3f.js → spec-hVaaZsY5.js} +4 -4
  27. package/dist/{strings-B_FOH6eV.js → strings-BiIhGaI8.js} +4 -4
  28. package/dist/style.css +1 -1
  29. package/dist/{swiper-component-BHs0PWwp.js → swiper-component-DlD2GU2g.js} +2 -2
  30. package/dist/{toDate-CHtl9vts.js → toDate-CIpC_34u.js} +33 -20
  31. package/dist/{tooltip-B0mtKTXm.js → tooltip-DRaMBu06.js} +3 -3
  32. package/dist/{types-DBtDeUKD.js → types-Dzuoc3LN.js} +1 -1
  33. package/dist/{useAsyncData-B6hCGywC.js → useAsyncData-C56Khv_R.js} +1 -1
  34. package/dist/{useDateFormatter-B3mCQMP3.js → useDateFormatter-B_9k85Ex.js} +2 -2
  35. package/dist/{useDeepCompareMemoize-CmwDuYUH.js → useDeepCompareMemoize-Dt98v2ua.js} +1 -1
  36. package/dist/{useIframeCapabilities-DbdLoEDm.js → useIframeCapabilities-BkYHTrss.js} +1 -1
  37. package/dist/{useLifecycle-CjMjllqy.js → useLifecycle-BF6-z62y.js} +3 -3
  38. package/dist/{useTheme-CByZUW0p.js → useTheme-DykuNHR2.js} +2 -2
  39. package/dist/{vega-component-C2BYPkfd.js → vega-component-cSdqoAxe.js} +10 -10
  40. package/dist/{zod-BxdsqRPd.js → zod-BWkcDORu.js} +1 -1
  41. package/package.json +3 -3
  42. package/src/components/chat/chat-components.tsx +47 -0
  43. package/src/components/chat/chat-display.tsx +41 -7
  44. package/src/components/chat/chat-panel.tsx +37 -10
  45. package/src/components/chat/chat-utils.ts +42 -20
  46. package/src/components/chat/reasoning-accordion.tsx +14 -3
  47. package/src/components/chat/tool-call/shared.ts +13 -0
  48. package/src/components/chat/tool-call/tool-approval-card.tsx +62 -0
  49. package/src/components/chat/tool-call/tool-args.tsx +26 -0
  50. package/src/components/chat/tool-call/tool-call-view.tsx +99 -0
  51. package/src/components/chat/tool-call/tool-error-card.tsx +81 -0
  52. package/src/components/chat/tool-call/tool-history-row.tsx +153 -0
  53. package/src/components/chat/tool-call/tool-result.tsx +101 -0
  54. package/src/components/data-table/__tests__/column-header.test.ts +3 -1
  55. package/src/components/data-table/__tests__/column-header.test.tsx +308 -0
  56. package/src/components/data-table/__tests__/filter-by-values-picker.test.tsx +112 -0
  57. package/src/components/data-table/__tests__/filter-pill-editor.test.tsx +261 -0
  58. package/src/components/data-table/__tests__/filters.test.ts +196 -49
  59. package/src/components/data-table/charts/components/form-fields.tsx +1 -0
  60. package/src/components/data-table/column-header.tsx +349 -170
  61. package/src/components/data-table/date-filter-inputs.tsx +325 -0
  62. package/src/components/data-table/filter-by-values-picker.tsx +70 -9
  63. package/src/components/data-table/filter-pill-editor.tsx +410 -156
  64. package/src/components/data-table/filter-pills.tsx +69 -54
  65. package/src/components/data-table/filters.ts +218 -101
  66. package/src/components/data-table/header-items.tsx +8 -1
  67. package/src/components/data-table/operator-labels.ts +25 -0
  68. package/src/components/data-table/regex-input.tsx +61 -0
  69. package/src/components/dependency-graph/minimap-content.tsx +14 -3
  70. package/src/components/editor/actions/pair-with-agent-modal.tsx +140 -49
  71. package/src/components/editor/actions/useNotebookActions.tsx +3 -1
  72. package/src/components/editor/app-container.tsx +7 -1
  73. package/src/components/editor/chrome/panels/context-aware-panel/context-aware-panel.tsx +10 -2
  74. package/src/components/editor/chrome/wrapper/app-chrome.tsx +1 -0
  75. package/src/components/editor/chrome/wrapper/footer-items/backend-status.tsx +1 -1
  76. package/src/components/editor/chrome/wrapper/footer.tsx +4 -1
  77. package/src/components/editor/chrome/wrapper/panels.tsx +4 -1
  78. package/src/components/editor/chrome/wrapper/sidebar.tsx +4 -1
  79. package/src/components/editor/controls/Controls.tsx +11 -3
  80. package/src/components/editor/file-tree/file-explorer.tsx +12 -2
  81. package/src/components/editor/header/__tests__/status.test.tsx +108 -0
  82. package/src/components/editor/header/status.tsx +44 -10
  83. package/src/components/editor/navigation/__tests__/clipboard.test.ts +106 -0
  84. package/src/components/editor/navigation/__tests__/navigation.test.ts +70 -0
  85. package/src/components/editor/navigation/clipboard.ts +99 -25
  86. package/src/components/editor/navigation/navigation.ts +15 -1
  87. package/src/components/editor/notebook-cell.tsx +5 -0
  88. package/src/components/editor/output/console/ConsoleOutput.tsx +23 -5
  89. package/src/components/editor/output/console/__tests__/ConsoleOutput.test.tsx +114 -0
  90. package/src/components/editor/renderers/slides-layout/__tests__/compute-slide-cells.test.ts +5 -4
  91. package/src/components/editor/renderers/slides-layout/__tests__/plugin.test.ts +55 -15
  92. package/src/components/editor/renderers/slides-layout/plugin.tsx +8 -25
  93. package/src/components/editor/renderers/slides-layout/slides-layout.tsx +19 -6
  94. package/src/components/editor/renderers/slides-layout/types.ts +40 -31
  95. package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +1 -0
  96. package/src/components/home/components.tsx +6 -0
  97. package/src/components/pages/run-page.tsx +4 -1
  98. package/src/components/scratchpad/scratchpad.tsx +1 -0
  99. package/src/components/slides/__tests__/slide-notes.test.ts +131 -0
  100. package/src/components/slides/reveal-component.tsx +252 -147
  101. package/src/components/slides/slide-notes-editor.tsx +127 -0
  102. package/src/components/slides/slide-notes.ts +64 -0
  103. package/src/components/slides/slides.css +14 -0
  104. package/src/components/ui/combobox.tsx +24 -5
  105. package/src/components/ui/number-field.tsx +2 -0
  106. package/src/core/ai/tools/__tests__/registry.test.ts +10 -12
  107. package/src/core/ai/tools/registry.ts +9 -5
  108. package/src/core/cells/__tests__/cells.test.ts +187 -0
  109. package/src/core/cells/__tests__/pending-cut-service.test.tsx +123 -0
  110. package/src/core/cells/cells.ts +102 -17
  111. package/src/core/cells/document-changes.ts +6 -1
  112. package/src/core/cells/pending-cut-service.ts +55 -0
  113. package/src/core/cells/utils.ts +11 -0
  114. package/src/core/codemirror/cells/extensions.ts +10 -0
  115. package/src/core/codemirror/go-to-definition/__tests__/commands.test.ts +152 -0
  116. package/src/core/codemirror/go-to-definition/__tests__/utils.test.ts +99 -0
  117. package/src/core/codemirror/go-to-definition/commands.ts +382 -22
  118. package/src/core/codemirror/go-to-definition/utils.ts +23 -5
  119. package/src/core/edit-app.tsx +3 -2
  120. package/src/core/hotkeys/hotkeys.ts +5 -0
  121. package/src/core/islands/worker/worker.tsx +3 -2
  122. package/src/core/run-app.tsx +2 -1
  123. package/src/core/runtime/__tests__/runtime.test.ts +38 -17
  124. package/src/core/runtime/runtime.ts +57 -34
  125. package/src/core/wasm/__tests__/utils.test.ts +34 -0
  126. package/src/core/wasm/utils.ts +14 -0
  127. package/src/core/wasm/worker/bootstrap.ts +3 -2
  128. package/src/core/wasm/worker/worker.ts +3 -2
  129. package/src/core/websocket/__tests__/useMarimoKernelConnection.hook.test.tsx +156 -0
  130. package/src/core/websocket/__tests__/useMarimoKernelConnection.test.ts +101 -0
  131. package/src/core/websocket/transports/__tests__/ws.test.ts +125 -0
  132. package/src/core/websocket/transports/basic.ts +1 -1
  133. package/src/core/websocket/transports/ws.ts +96 -0
  134. package/src/core/websocket/useMarimoKernelConnection.tsx +133 -54
  135. package/src/core/websocket/useWebSocket.tsx +3 -15
  136. package/src/css/app/Cell.css +10 -0
  137. package/src/plugins/core/__test__/sanitize.test.ts +30 -0
  138. package/src/plugins/impl/DropdownPlugin.tsx +12 -1
  139. package/src/plugins/impl/MultiselectPlugin.tsx +4 -0
  140. package/src/plugins/impl/SearchableSelect.tsx +11 -1
  141. package/src/plugins/impl/TabsPlugin.tsx +35 -7
  142. package/src/plugins/impl/__tests__/DropdownPlugin.test.tsx +56 -0
  143. package/src/plugins/impl/__tests__/TabsPlugin.test.tsx +154 -0
  144. package/src/plugins/impl/data-frames/forms/__tests__/__snapshots__/form.test.tsx.snap +48 -36
  145. package/src/plugins/impl/data-frames/schema.ts +4 -1
  146. package/src/plugins/layout/DownloadPlugin.tsx +9 -7
  147. package/src/utils/__tests__/id-tree.test.ts +71 -0
  148. package/src/utils/download.ts +4 -2
  149. package/src/utils/id-tree.tsx +89 -0
  150. package/dist/assets/__vite-browser-external-rrUYDKRl.js +0 -1
  151. package/dist/assets/worker-Bfy15ViQ.js +0 -73
  152. package/dist/reveal-component-C97Ceb7e.js +0 -4863
  153. package/src/components/chat/tool-call-accordion.tsx +0 -247
@@ -24,7 +24,6 @@ describe("filterToFilterCondition", () => {
24
24
  {
25
25
  column_id: "col",
26
26
  operator: "is_null",
27
- value: undefined,
28
27
  type: "condition",
29
28
  negate: false,
30
29
  },
@@ -40,45 +39,53 @@ describe("filterToFilterCondition", () => {
40
39
  {
41
40
  column_id: "col",
42
41
  operator: "is_not_null",
43
- value: undefined,
44
42
  type: "condition",
45
43
  negate: false,
46
44
  },
47
45
  ]);
48
46
  });
49
47
 
50
- it("handles number filter with min only", () => {
51
- const result = filterToFilterCondition("age", Filter.number({ min: 18 }));
52
- expect(result).toHaveLength(1);
53
- expect(result[0]).toMatchObject({
54
- column_id: "age",
55
- operator: ">=",
56
- value: 18,
57
- type: "condition",
58
- negate: false,
59
- });
48
+ it("handles number filter with == operator", () => {
49
+ const result = filterToFilterCondition(
50
+ "age",
51
+ Filter.number({ operator: "==", value: 42 }),
52
+ );
53
+ expect(result).toEqual([
54
+ {
55
+ column_id: "age",
56
+ operator: "==",
57
+ value: 42,
58
+ type: "condition",
59
+ negate: false,
60
+ },
61
+ ]);
60
62
  });
61
63
 
62
- it("handles number filter with max only", () => {
63
- const result = filterToFilterCondition("age", Filter.number({ max: 65 }));
64
- expect(result).toHaveLength(1);
65
- expect(result[0]).toMatchObject({
66
- column_id: "age",
67
- operator: "<=",
68
- value: 65,
69
- type: "condition",
70
- negate: false,
71
- });
64
+ it("handles number filter with all comparison operators", () => {
65
+ for (const op of ["==", "!=", ">", ">=", "<", "<="] as const) {
66
+ const result = filterToFilterCondition(
67
+ "x",
68
+ Filter.number({ operator: op, value: 5 }),
69
+ );
70
+ expect(result).toHaveLength(1);
71
+ expect(result[0]).toMatchObject({ operator: op, value: 5 });
72
+ }
72
73
  });
73
74
 
74
- it("handles number filter with min and max", () => {
75
+ it("number / between emits a single between condition", () => {
75
76
  const result = filterToFilterCondition(
76
77
  "age",
77
- Filter.number({ min: 18, max: 65 }),
78
+ Filter.number({ operator: "between", min: 18, max: 65 }),
78
79
  );
79
- expect(result).toHaveLength(2);
80
- expect(result[0]).toMatchObject({ operator: ">=", value: 18 });
81
- expect(result[1]).toMatchObject({ operator: "<=", value: 65 });
80
+ expect(result).toEqual([
81
+ {
82
+ column_id: "age",
83
+ operator: "between",
84
+ value: { min: 18, max: 65 },
85
+ type: "condition",
86
+ negate: false,
87
+ },
88
+ ]);
82
89
  });
83
90
 
84
91
  it("handles text filter", () => {
@@ -97,6 +104,71 @@ describe("filterToFilterCondition", () => {
97
104
  ]);
98
105
  });
99
106
 
107
+ it("handles text filter with all single-string operators", () => {
108
+ for (const op of [
109
+ "contains",
110
+ "equals",
111
+ "does_not_equal",
112
+ "regex",
113
+ "starts_with",
114
+ "ends_with",
115
+ ] as const) {
116
+ const result = filterToFilterCondition(
117
+ "col",
118
+ Filter.text({ operator: op, text: "x" }),
119
+ );
120
+ expect(result).toHaveLength(1);
121
+ expect(result[0]).toMatchObject({ operator: op, value: "x" });
122
+ }
123
+ });
124
+
125
+ it("handles text filter with in operator", () => {
126
+ const result = filterToFilterCondition(
127
+ "name",
128
+ Filter.text({ operator: "in", values: ["alice", "bob"] }),
129
+ );
130
+ expect(result).toEqual([
131
+ {
132
+ column_id: "name",
133
+ operator: "in",
134
+ value: ["alice", "bob"],
135
+ type: "condition",
136
+ negate: false,
137
+ },
138
+ ]);
139
+ });
140
+
141
+ it("handles text filter with not_in operator", () => {
142
+ const result = filterToFilterCondition(
143
+ "name",
144
+ Filter.text({ operator: "not_in", values: ["alice"] }),
145
+ );
146
+ expect(result).toEqual([
147
+ {
148
+ column_id: "name",
149
+ operator: "not_in",
150
+ value: ["alice"],
151
+ type: "condition",
152
+ negate: false,
153
+ },
154
+ ]);
155
+ });
156
+
157
+ it("handles text filter with is_empty operator", () => {
158
+ const result = filterToFilterCondition(
159
+ "name",
160
+ Filter.text({ operator: "is_empty" }),
161
+ );
162
+ expect(result).toEqual([
163
+ {
164
+ column_id: "name",
165
+ operator: "is_empty",
166
+ type: "condition",
167
+ negate: false,
168
+ },
169
+ ]);
170
+ });
171
+
100
172
  it("handles boolean true filter", () => {
101
173
  const result = filterToFilterCondition(
102
174
  "active",
@@ -106,7 +178,6 @@ describe("filterToFilterCondition", () => {
106
178
  {
107
179
  column_id: "active",
108
180
  operator: "is_true",
109
- value: undefined,
110
181
  type: "condition",
111
182
  negate: false,
112
183
  },
@@ -122,7 +193,6 @@ describe("filterToFilterCondition", () => {
122
193
  {
123
194
  column_id: "active",
124
195
  operator: "is_false",
125
- value: undefined,
126
196
  type: "condition",
127
197
  negate: false,
128
198
  },
@@ -145,28 +215,99 @@ describe("filterToFilterCondition", () => {
145
215
  ]);
146
216
  });
147
217
 
148
- it("handles date filter with min and max", () => {
149
- const min = new Date("2024-01-01");
150
- const max = new Date("2024-12-31");
218
+ it("handles date between filter", () => {
219
+ const min = new Date(2024, 0, 1);
220
+ const max = new Date(2024, 11, 31);
151
221
  const result = filterToFilterCondition(
152
222
  "created",
153
- Filter.date({ min, max }),
223
+ Filter.date({ operator: "between", min, max }),
154
224
  );
155
- expect(result).toHaveLength(2);
156
- expect(result[0]).toMatchObject({
157
- operator: ">=",
158
- value: min.toISOString(),
159
- });
160
- expect(result[1]).toMatchObject({
161
- operator: "<=",
162
- value: max.toISOString(),
163
- });
225
+ expect(result).toEqual([
226
+ {
227
+ column_id: "created",
228
+ operator: "between",
229
+ value: { min: "2024-01-01", max: "2024-12-31" },
230
+ type: "condition",
231
+ negate: false,
232
+ },
233
+ ]);
234
+ });
235
+
236
+ it("handles date comparison filter", () => {
237
+ const value = new Date(2024, 5, 15);
238
+ const result = filterToFilterCondition(
239
+ "created",
240
+ Filter.date({ operator: ">=", value }),
241
+ );
242
+ expect(result).toEqual([
243
+ {
244
+ column_id: "created",
245
+ operator: ">=",
246
+ value: "2024-06-15",
247
+ type: "condition",
248
+ negate: false,
249
+ },
250
+ ]);
251
+ });
252
+
253
+ it("handles datetime between filter as local ISO string without TZ", () => {
254
+ const min = new Date(2024, 0, 1, 0, 0, 0);
255
+ const max = new Date(2024, 11, 31, 23, 59, 59);
256
+ const result = filterToFilterCondition(
257
+ "created",
258
+ Filter.datetime({ operator: "between", min, max }),
259
+ );
260
+ expect(result).toEqual([
261
+ {
262
+ column_id: "created",
263
+ operator: "between",
264
+ value: {
265
+ min: "2024-01-01T00:00:00",
266
+ max: "2024-12-31T23:59:59",
267
+ },
268
+ type: "condition",
269
+ negate: false,
270
+ },
271
+ ]);
272
+ });
273
+
274
+ it("handles time between filter as HH:MM:SS", () => {
275
+ const min = new Date(2024, 0, 1, 9, 30, 0);
276
+ const max = new Date(2024, 0, 1, 17, 45, 15);
277
+ const result = filterToFilterCondition(
278
+ "start",
279
+ Filter.time({ operator: "between", min, max }),
280
+ );
281
+ expect(result).toEqual([
282
+ {
283
+ column_id: "start",
284
+ operator: "between",
285
+ value: { min: "09:30:00", max: "17:45:15" },
286
+ type: "condition",
287
+ negate: false,
288
+ },
289
+ ]);
290
+ });
291
+
292
+ it("handles date is_null filter", () => {
293
+ const result = filterToFilterCondition(
294
+ "created",
295
+ Filter.date({ operator: "is_null" }),
296
+ );
297
+ expect(result).toEqual([
298
+ {
299
+ column_id: "created",
300
+ operator: "is_null",
301
+ type: "condition",
302
+ negate: false,
303
+ },
304
+ ]);
164
305
  });
165
306
 
166
307
  it("every condition has type and negate fields", () => {
167
308
  const result = filterToFilterCondition(
168
309
  "col",
169
- Filter.number({ min: 1, max: 10 }),
310
+ Filter.number({ operator: "between", min: 1, max: 10 }),
170
311
  );
171
312
  for (const condition of result) {
172
313
  expect(condition).toHaveProperty("type", "condition");
@@ -188,7 +329,7 @@ describe("filtersToFilterGroup", () => {
188
329
 
189
330
  it("wraps single filter in AND group", () => {
190
331
  const result = filtersToFilterGroup([
191
- { id: "age", value: Filter.number({ min: 18 }) },
332
+ { id: "age", value: Filter.number({ operator: ">=", value: 18 }) },
192
333
  ]);
193
334
  expect(result.type).toBe("group");
194
335
  expect(result.operator).toBe("and");
@@ -198,19 +339,25 @@ describe("filtersToFilterGroup", () => {
198
339
 
199
340
  it("wraps multiple filters in AND group", () => {
200
341
  const result = filtersToFilterGroup([
201
- { id: "age", value: Filter.number({ min: 18 }) },
342
+ { id: "age", value: Filter.number({ operator: ">=", value: 18 }) },
202
343
  { id: "name", value: Filter.text({ text: "foo", operator: "contains" }) },
203
344
  ]);
204
345
  expect(result.children).toHaveLength(2);
205
346
  expect(result.operator).toBe("and");
206
347
  });
207
348
 
208
- it("flattens multi-condition filters", () => {
349
+ it("between filter emits a single between condition", () => {
209
350
  const result = filtersToFilterGroup([
210
- { id: "age", value: Filter.number({ min: 18, max: 65 }) },
351
+ {
352
+ id: "age",
353
+ value: Filter.number({ operator: "between", min: 18, max: 65 }),
354
+ },
211
355
  ]);
212
- // min + max = 2 conditions
213
- expect(result.children).toHaveLength(2);
356
+ expect(result.children).toHaveLength(1);
357
+ expect(result.children[0]).toMatchObject({
358
+ operator: "between",
359
+ value: { min: 18, max: 65 },
360
+ });
214
361
  });
215
362
  });
216
363
 
@@ -789,6 +789,7 @@ export const TooltipSelect = ({
789
789
  <FormControl>
790
790
  <Multiselect
791
791
  options={fields?.map((field) => field.name) ?? []}
792
+ disabled={false}
792
793
  value={values}
793
794
  setValue={(values) => {
794
795
  const selectedValues =