@marimo-team/islands 0.22.1-dev23 → 0.22.1-dev27
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/main.js +3 -3
- package/package.json +6 -17
- package/src/__tests__/main.test.tsx +12 -14
- package/src/components/ai/ai-provider-icon.tsx +1 -2
- package/src/components/data-table/cell-selection/types.ts +3 -2
- package/src/components/data-table/charts/charts.tsx +2 -2
- package/src/components/data-table/column-formatting/types.ts +3 -2
- package/src/components/data-table/column-header.tsx +4 -2
- package/src/components/data-table/column-wrapping/types.ts +3 -2
- package/src/components/data-table/copy-column/types.ts +3 -2
- package/src/components/data-table/focus-row/types.ts +3 -2
- package/src/components/data-table/range-focus/__tests__/atoms.test.ts +11 -11
- package/src/components/data-table/range-focus/__tests__/use-cell-range-selection.test.ts +9 -11
- package/src/components/editor/__tests__/data-attributes.test.tsx +93 -94
- package/src/components/editor/actions/name-cell-input.tsx +4 -2
- package/src/components/editor/actions/useCellActionButton.tsx +4 -2
- package/src/components/editor/cell/CellStatus.tsx +4 -5
- package/src/components/editor/cell/cell-context-menu.tsx +4 -2
- package/src/components/editor/cell/code/cell-editor.tsx +2 -1
- package/src/components/editor/cell/toolbar.tsx +2 -1
- package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +11 -12
- package/src/components/storage/__tests__/storage-snippets.test.ts +4 -6
- package/src/components/tracing/tracing.test.tsx +30 -30
- package/src/components/ui/badge.tsx +2 -1
- package/src/components/ui/button.tsx +2 -1
- package/src/components/ui/calendar.tsx +3 -2
- package/src/components/ui/combobox.tsx +2 -1
- package/src/components/ui/date-input.tsx +7 -6
- package/src/components/ui/date-picker.tsx +6 -4
- package/src/components/ui/field.tsx +1 -2
- package/src/components/ui/progress.tsx +3 -2
- package/src/components/ui/query-param-preserving-link.tsx +4 -2
- package/src/components/ui/sheet.tsx +2 -1
- package/src/components/ui/textarea.tsx +1 -2
- package/src/core/ai/context/providers/cell-output.ts +1 -2
- package/src/core/ai/tools/edit-notebook-tool.ts +4 -3
- package/src/core/ai/tools/run-cells-tool.ts +4 -3
- package/src/core/cells/__tests__/add-missing-import.test.ts +23 -22
- package/src/core/cells/__tests__/cell.test.ts +14 -13
- package/src/core/cells/logs.ts +1 -1
- package/src/core/codemirror/cells/__tests__/extensions.test.ts +15 -17
- package/src/core/codemirror/copilot/transport.ts +1 -2
- package/src/core/codemirror/language/languages/markdown.ts +1 -3
- package/src/core/codemirror/language/languages/python.ts +4 -0
- package/src/core/codemirror/language/languages/sql/completion-sources.tsx +4 -6
- package/src/core/codemirror/language/languages/sql/sql.ts +1 -3
- package/src/core/codemirror/reactive-references/__tests__/analyzer.test.ts +28 -42
- package/src/core/datasets/data-source-connections.ts +4 -2
- package/src/core/dom/__tests__/htmlUtils.test.ts +8 -14
- package/src/core/dom/__tests__/outline.test.ts +2 -3
- package/src/core/islands/__tests__/parse.test.ts +8 -7
- package/src/core/saving/__tests__/filename.test.ts +7 -6
- package/src/core/static/__tests__/download-html.test.ts +16 -15
- package/src/core/static/__tests__/files.test.ts +30 -28
- package/src/css/app/Cell.css +5 -2
- package/src/css/globals.css +40 -14
- package/src/plugins/impl/DataEditorPlugin.tsx +4 -2
- package/src/plugins/impl/FormPlugin.tsx +1 -2
- package/src/plugins/impl/data-frames/forms/__tests__/form.test.tsx +7 -9
- package/src/plugins/impl/vega/__tests__/make-selectable.test.ts +13 -14
- package/src/plugins/layout/ImageComparisonPlugin.tsx +1 -3
- package/src/plugins/stateless-plugin.ts +4 -2
- package/src/utils/__tests__/cell-urls.test.ts +24 -21
- package/src/utils/__tests__/filenames.test.ts +15 -14
- package/src/utils/__tests__/json-parser.test.ts +14 -21
- package/src/utils/__tests__/path.test.ts +34 -31
- package/src/utils/__tests__/urls.test.ts +19 -18
- package/src/utils/tracer.ts +1 -0
|
@@ -45,9 +45,8 @@ def foo(x):
|
|
|
45
45
|
});
|
|
46
46
|
|
|
47
47
|
test("should handle lambda parameters", () => {
|
|
48
|
-
expect(
|
|
49
|
-
|
|
50
|
-
).toMatchInlineSnapshot(`
|
|
48
|
+
expect(runHighlight(["a", "b"], "result = lambda a: a + b"))
|
|
49
|
+
.toMatchInlineSnapshot(`
|
|
51
50
|
"
|
|
52
51
|
result = lambda a: a + b
|
|
53
52
|
^
|
|
@@ -56,9 +55,8 @@ def foo(x):
|
|
|
56
55
|
});
|
|
57
56
|
|
|
58
57
|
test("should handle comprehension variables", () => {
|
|
59
|
-
expect(
|
|
60
|
-
|
|
61
|
-
).toMatchInlineSnapshot(`
|
|
58
|
+
expect(runHighlight(["a", "data"], "result = [a for a in data]"))
|
|
59
|
+
.toMatchInlineSnapshot(`
|
|
62
60
|
"
|
|
63
61
|
result = [a for a in data]
|
|
64
62
|
^^^^
|
|
@@ -146,9 +144,8 @@ def factorial(n):
|
|
|
146
144
|
});
|
|
147
145
|
|
|
148
146
|
test("function param vs global", () => {
|
|
149
|
-
expect(
|
|
150
|
-
|
|
151
|
-
).toMatchInlineSnapshot(`
|
|
147
|
+
expect(runHighlight(["a", "b"], "def foo(a): return a + b"))
|
|
148
|
+
.toMatchInlineSnapshot(`
|
|
152
149
|
"
|
|
153
150
|
def foo(a): return a + b
|
|
154
151
|
^
|
|
@@ -157,9 +154,8 @@ def factorial(n):
|
|
|
157
154
|
});
|
|
158
155
|
|
|
159
156
|
test("lambda param vs global", () => {
|
|
160
|
-
expect(
|
|
161
|
-
|
|
162
|
-
).toMatchInlineSnapshot(`
|
|
157
|
+
expect(runHighlight(["x", "b"], "func = lambda x: x + b"))
|
|
158
|
+
.toMatchInlineSnapshot(`
|
|
163
159
|
"
|
|
164
160
|
func = lambda x: x + b
|
|
165
161
|
^
|
|
@@ -168,9 +164,8 @@ def factorial(n):
|
|
|
168
164
|
});
|
|
169
165
|
|
|
170
166
|
test("lambda with multiple params", () => {
|
|
171
|
-
expect(
|
|
172
|
-
|
|
173
|
-
).toMatchInlineSnapshot(`
|
|
167
|
+
expect(runHighlight(["x", "y", "z"], "f = lambda x, y: x + y + z"))
|
|
168
|
+
.toMatchInlineSnapshot(`
|
|
174
169
|
"
|
|
175
170
|
f = lambda x, y: x + y + z
|
|
176
171
|
^
|
|
@@ -187,9 +182,8 @@ def factorial(n):
|
|
|
187
182
|
});
|
|
188
183
|
|
|
189
184
|
test("nested comprehension", () => {
|
|
190
|
-
expect(
|
|
191
|
-
|
|
192
|
-
).toMatchInlineSnapshot(`
|
|
185
|
+
expect(runHighlight(["a", "b"], "[(a + b) for a, b in [(1,2), (3,4)]]"))
|
|
186
|
+
.toMatchInlineSnapshot(`
|
|
193
187
|
"
|
|
194
188
|
[(a + b) for a, b in [(1,2), (3,4)]]
|
|
195
189
|
"
|
|
@@ -225,9 +219,8 @@ def factorial(n):
|
|
|
225
219
|
});
|
|
226
220
|
|
|
227
221
|
test("class body using globals", () => {
|
|
228
|
-
expect(
|
|
229
|
-
|
|
230
|
-
).toMatchInlineSnapshot(`
|
|
222
|
+
expect(runHighlight(["a", "b"], "class MyClass:\n value = a + b"))
|
|
223
|
+
.toMatchInlineSnapshot(`
|
|
231
224
|
"
|
|
232
225
|
class MyClass:
|
|
233
226
|
value = a + b
|
|
@@ -237,9 +230,8 @@ def factorial(n):
|
|
|
237
230
|
});
|
|
238
231
|
|
|
239
232
|
test("decorator using global", () => {
|
|
240
|
-
expect(
|
|
241
|
-
|
|
242
|
-
).toMatchInlineSnapshot(`
|
|
233
|
+
expect(runHighlight(["logger"], "@logger\ndef decorated(): pass"))
|
|
234
|
+
.toMatchInlineSnapshot(`
|
|
243
235
|
"
|
|
244
236
|
@logger
|
|
245
237
|
^^^^^^
|
|
@@ -317,9 +309,8 @@ ${" ".repeat(8)}
|
|
|
317
309
|
});
|
|
318
310
|
|
|
319
311
|
test("multiple assignment", () => {
|
|
320
|
-
expect(
|
|
321
|
-
|
|
322
|
-
).toMatchInlineSnapshot(`
|
|
312
|
+
expect(runHighlight(["x", "y", "z", "a"], "x = y = z + a"))
|
|
313
|
+
.toMatchInlineSnapshot(`
|
|
323
314
|
"
|
|
324
315
|
x = y = z + a
|
|
325
316
|
^ ^
|
|
@@ -353,9 +344,8 @@ ${" ".repeat(8)}
|
|
|
353
344
|
});
|
|
354
345
|
|
|
355
346
|
test("global in return", () => {
|
|
356
|
-
expect(
|
|
357
|
-
|
|
358
|
-
).toMatchInlineSnapshot(`
|
|
347
|
+
expect(runHighlight(["config"], "def get_config(): return config"))
|
|
348
|
+
.toMatchInlineSnapshot(`
|
|
359
349
|
"
|
|
360
350
|
def get_config(): return config
|
|
361
351
|
^^^^^^
|
|
@@ -410,9 +400,8 @@ class Configurable:
|
|
|
410
400
|
});
|
|
411
401
|
|
|
412
402
|
test("comprehension shadows global 2", () => {
|
|
413
|
-
expect(
|
|
414
|
-
|
|
415
|
-
).toMatchInlineSnapshot(`
|
|
403
|
+
expect(runHighlight(["i"], "squares = [i**2 for i in range(10)]"))
|
|
404
|
+
.toMatchInlineSnapshot(`
|
|
416
405
|
"
|
|
417
406
|
squares = [i**2 for i in range(10)]
|
|
418
407
|
"
|
|
@@ -420,9 +409,8 @@ class Configurable:
|
|
|
420
409
|
});
|
|
421
410
|
|
|
422
411
|
test("comprehension with global in condition", () => {
|
|
423
|
-
expect(
|
|
424
|
-
|
|
425
|
-
).toMatchInlineSnapshot(`
|
|
412
|
+
expect(runHighlight(["x", "z"], "filtered = [x for x in [] if x > z]"))
|
|
413
|
+
.toMatchInlineSnapshot(`
|
|
426
414
|
"
|
|
427
415
|
filtered = [x for x in [] if x > z]
|
|
428
416
|
^
|
|
@@ -459,9 +447,8 @@ def make_adder(x):
|
|
|
459
447
|
});
|
|
460
448
|
|
|
461
449
|
test("rebinding in list comprehension", () => {
|
|
462
|
-
expect(
|
|
463
|
-
|
|
464
|
-
).toMatchInlineSnapshot(`
|
|
450
|
+
expect(runHighlight(["x"], "rebinding = [x for x in range(5)]"))
|
|
451
|
+
.toMatchInlineSnapshot(`
|
|
465
452
|
"
|
|
466
453
|
rebinding = [x for x in range(5)]
|
|
467
454
|
"
|
|
@@ -644,9 +631,8 @@ def run(polars):
|
|
|
644
631
|
});
|
|
645
632
|
|
|
646
633
|
test("mixed comprehension and outer globals", () => {
|
|
647
|
-
expect(
|
|
648
|
-
|
|
649
|
-
).toMatchInlineSnapshot(`
|
|
634
|
+
expect(runHighlight(["y", "z"], "values = [y + z for y in range(5)]"))
|
|
635
|
+
.toMatchInlineSnapshot(`
|
|
650
636
|
"
|
|
651
637
|
values = [y + z for y in range(5)]
|
|
652
638
|
^
|
|
@@ -32,8 +32,10 @@ const initialConnections: ConnectionsMap = new Map([
|
|
|
32
32
|
]);
|
|
33
33
|
|
|
34
34
|
// Extend the backend type but override the name property with the strongly typed ConnectionName
|
|
35
|
-
export interface DataSourceConnection
|
|
36
|
-
|
|
35
|
+
export interface DataSourceConnection extends Omit<
|
|
36
|
+
DataSourceConnectionType,
|
|
37
|
+
"name"
|
|
38
|
+
> {
|
|
37
39
|
name: ConnectionName;
|
|
38
40
|
}
|
|
39
41
|
|
|
@@ -6,20 +6,14 @@ import { UIElementRegistry } from "../uiregistry";
|
|
|
6
6
|
const registry = UIElementRegistry.INSTANCE;
|
|
7
7
|
|
|
8
8
|
describe("htmlUtils", () => {
|
|
9
|
-
it.each([
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"",
|
|
18
|
-
])("can parse element.dataset.initialValue", (initialValue) => {
|
|
19
|
-
const div = document.createElement("div");
|
|
20
|
-
div.dataset.initialValue = JSON.stringify(initialValue);
|
|
21
|
-
expect(parseInitialValue(div, registry)).toEqual(initialValue);
|
|
22
|
-
});
|
|
9
|
+
it.each([false, { a: 1 }, true, 0, 1, [{ a: 1 }, { b: 2 }], "hello", ""])(
|
|
10
|
+
"can parse element.dataset.initialValue",
|
|
11
|
+
(initialValue) => {
|
|
12
|
+
const div = document.createElement("div");
|
|
13
|
+
div.dataset.initialValue = JSON.stringify(initialValue);
|
|
14
|
+
expect(parseInitialValue(div, registry)).toEqual(initialValue);
|
|
15
|
+
},
|
|
16
|
+
);
|
|
23
17
|
|
|
24
18
|
it("can parse an element with no initialValue", () => {
|
|
25
19
|
const div = document.createElement("div");
|
|
@@ -439,9 +439,8 @@ const OUTLINE_2: Outline = {
|
|
|
439
439
|
};
|
|
440
440
|
|
|
441
441
|
it("mergeOutlines", () => {
|
|
442
|
-
expect(
|
|
443
|
-
|
|
444
|
-
).toMatchInlineSnapshot(`
|
|
442
|
+
expect(mergeOutlines([OUTLINE_1, null, OUTLINE_2, null]))
|
|
443
|
+
.toMatchInlineSnapshot(`
|
|
445
444
|
{
|
|
446
445
|
"items": [
|
|
447
446
|
{
|
|
@@ -78,11 +78,12 @@ describe("parseIslandCode", () => {
|
|
|
78
78
|
|
|
79
79
|
codes = [...codes, ...codes.map(encodeURIComponent)];
|
|
80
80
|
|
|
81
|
-
it.each(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
81
|
+
it.each(codes)(
|
|
82
|
+
"should return the code without leading or trailing whitespace",
|
|
83
|
+
(code) => {
|
|
84
|
+
const result = parseIslandCode(code);
|
|
85
|
+
const expected = 'def __():\n print("Hello, World!")\n return';
|
|
86
|
+
expect(result).toBe(expected);
|
|
87
|
+
},
|
|
88
|
+
);
|
|
88
89
|
});
|
|
@@ -5,12 +5,13 @@ import { EDGE_CASE_FILENAMES } from "../../../__tests__/mocks";
|
|
|
5
5
|
import { Paths } from "../../../utils/paths";
|
|
6
6
|
|
|
7
7
|
describe("filename handling logic", () => {
|
|
8
|
-
it.each(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
it.each(EDGE_CASE_FILENAMES)(
|
|
9
|
+
"should extract basename correctly for document title: %s",
|
|
10
|
+
(filename) => {
|
|
11
|
+
const basename = Paths.basename(filename);
|
|
12
|
+
expect(basename).toBe(filename); // Since no path separator
|
|
13
|
+
},
|
|
14
|
+
);
|
|
14
15
|
|
|
15
16
|
it("should handle full paths with unicode filenames", () => {
|
|
16
17
|
EDGE_CASE_FILENAMES.forEach((filename) => {
|
|
@@ -44,23 +44,24 @@ describe("updateAssetUrl", () => {
|
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
describe("filename handling for downloads", () => {
|
|
47
|
-
it.each(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
it.each(EDGE_CASE_FILENAMES)(
|
|
48
|
+
"should handle edge case filenames in download operations: %s",
|
|
49
|
+
(filename) => {
|
|
50
|
+
// Test that basename extraction works correctly for downloads
|
|
51
|
+
const basename = Paths.basename(filename);
|
|
52
|
+
expect(basename).toBe(filename);
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
// Test filename conversion for HTML downloads
|
|
55
|
+
const htmlFilename = Filenames.toHTML(filename);
|
|
56
|
+
expect(htmlFilename).toMatch(/\.html$/);
|
|
57
|
+
expect(htmlFilename).toContain(Filenames.withoutExtension(filename));
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
// Ensure unicode and spaces are preserved in basename
|
|
60
|
+
const withoutExt = Filenames.withoutExtension(filename);
|
|
61
|
+
expect(withoutExt).not.toBe("");
|
|
62
|
+
expect(typeof withoutExt).toBe("string");
|
|
63
|
+
},
|
|
64
|
+
);
|
|
64
65
|
|
|
65
66
|
it("should handle blob download filename generation", () => {
|
|
66
67
|
// Mock URL.createObjectURL for blob testing
|
|
@@ -192,20 +192,21 @@ describe("patchVegaLoader - loader.http", () => {
|
|
|
192
192
|
"http://foo.com/virtual-file.json",
|
|
193
193
|
];
|
|
194
194
|
|
|
195
|
-
it.each(
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
195
|
+
it.each(pathsToTest)(
|
|
196
|
+
"should return file content for virtual files for %s",
|
|
197
|
+
async (s) => {
|
|
198
|
+
const virtualFiles = {
|
|
199
|
+
"/virtual-file.json":
|
|
200
|
+
"data:application/json;base64,eyJrZXkiOiAidmFsdWUifQ==" as DataURLString,
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
const loader = createLoader();
|
|
204
|
+
const unpatch = patchVegaLoader(loader, virtualFiles);
|
|
205
|
+
const content = await loader.http(s);
|
|
206
|
+
unpatch();
|
|
207
|
+
expect(content).toBe('{"key": "value"}');
|
|
208
|
+
},
|
|
209
|
+
);
|
|
209
210
|
|
|
210
211
|
it("should fallback to original http method for non-virtual files", async () => {
|
|
211
212
|
const loader = createLoader();
|
|
@@ -236,20 +237,21 @@ describe("patchVegaLoader - loader.load", () => {
|
|
|
236
237
|
"http://foo.com/virtual-file.json",
|
|
237
238
|
];
|
|
238
239
|
|
|
239
|
-
it.each(
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
240
|
+
it.each(pathsToTest)(
|
|
241
|
+
"should return file content for virtual files for %s",
|
|
242
|
+
async (s) => {
|
|
243
|
+
const virtualFiles = {
|
|
244
|
+
"/virtual-file.json":
|
|
245
|
+
"data:application/json;base64,eyJrZXkiOiAidmFsdWUifQ==" as DataURLString,
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
const loader = createLoader();
|
|
249
|
+
const unpatch = patchVegaLoader(loader, virtualFiles);
|
|
250
|
+
const content = await loader.load(s);
|
|
251
|
+
unpatch();
|
|
252
|
+
expect(content).toBe('{"key": "value"}');
|
|
253
|
+
},
|
|
254
|
+
);
|
|
253
255
|
|
|
254
256
|
it("should fallback to original load method for non-virtual files", async () => {
|
|
255
257
|
const loader = createLoader();
|
package/src/css/app/Cell.css
CHANGED
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
border: 1px solid var(--gray-4);
|
|
16
16
|
|
|
17
17
|
@apply divide-y divide-(--gray-5);
|
|
18
|
+
|
|
18
19
|
&:hover {
|
|
19
20
|
border-color: var(--gray-6);
|
|
20
21
|
}
|
|
@@ -99,8 +100,8 @@
|
|
|
99
100
|
/* Special case for particular components */
|
|
100
101
|
|
|
101
102
|
.output-area:has(
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
> .output:only-child > marimo-ui-element:only-child > marimo-table
|
|
104
|
+
) {
|
|
104
105
|
padding: 0 0 5px;
|
|
105
106
|
max-height: none;
|
|
106
107
|
overflow: hidden;
|
|
@@ -112,6 +113,7 @@
|
|
|
112
113
|
margin-top: 0.25rem;
|
|
113
114
|
border: none;
|
|
114
115
|
border-radius: 0;
|
|
116
|
+
border-top-left-radius: 9px;
|
|
115
117
|
}
|
|
116
118
|
|
|
117
119
|
marimo-table::part(table-wrapper) {
|
|
@@ -385,6 +387,7 @@
|
|
|
385
387
|
border-top-left-radius: 9px;
|
|
386
388
|
border-top-right-radius: 9px;
|
|
387
389
|
}
|
|
390
|
+
|
|
388
391
|
div[data-ai-input-open="true"] .cm-editor {
|
|
389
392
|
border-top-left-radius: 0;
|
|
390
393
|
border-top-right-radius: 0;
|
package/src/css/globals.css
CHANGED
|
@@ -148,46 +148,72 @@
|
|
|
148
148
|
--shadow-xxs: 0px 0px 2px 0px var(--base-shadow-darker);
|
|
149
149
|
|
|
150
150
|
/* biome-ignore format: definition needs to be oneline or breaks variants */
|
|
151
|
-
--shadow-xs:
|
|
151
|
+
--shadow-xs:
|
|
152
|
+
1px 1px 2px 0px var(--base-shadow),
|
|
153
|
+
0px 0px 2px 0px hsl(0deg 0% 25% / var(--base-shadow-opacity));
|
|
152
154
|
|
|
153
155
|
/* biome-ignore format: definition needs to be oneline or breaks variants */
|
|
154
|
-
--shadow-sm:
|
|
156
|
+
--shadow-sm:
|
|
157
|
+
2px 2px 2px 0px var(--base-shadow),
|
|
158
|
+
0px 0px 2px 0px hsl(0deg 0% 25% / var(--base-shadow-opacity));
|
|
155
159
|
|
|
156
160
|
/* biome-ignore format: definition needs to be oneline or breaks variants */
|
|
157
|
-
--shadow-md:
|
|
161
|
+
--shadow-md:
|
|
162
|
+
4px 4px 4px 0px var(--base-shadow),
|
|
163
|
+
0 0px 4px 0px hsl(0deg 0% 60% / var(--base-shadow-opacity));
|
|
158
164
|
|
|
159
165
|
/* biome-ignore format: definition needs to be oneline or breaks variants */
|
|
160
|
-
--shadow-lg:
|
|
166
|
+
--shadow-lg:
|
|
167
|
+
5px 6px 4px 0px var(--base-shadow),
|
|
168
|
+
0 0px 4px 0px hsl(0deg 0% 75% / var(--base-shadow-opacity));
|
|
161
169
|
|
|
162
170
|
/* biome-ignore format: definition needs to be oneline or breaks variants */
|
|
163
|
-
--shadow-xl:
|
|
171
|
+
--shadow-xl:
|
|
172
|
+
8px 9px 4px 0px var(--base-shadow),
|
|
173
|
+
0 0px 6px 0px hsl(0deg 0% 85% / var(--base-shadow-opacity));
|
|
164
174
|
|
|
165
175
|
/* biome-ignore format: definition needs to be oneline or breaks variants */
|
|
166
|
-
--shadow-2xl:
|
|
176
|
+
--shadow-2xl:
|
|
177
|
+
10px 12px 10px 0px var(--base-shadow),
|
|
178
|
+
0 0px 8px 0px hsl(0deg 0% 90% / var(--base-shadow-opacity));
|
|
167
179
|
|
|
168
180
|
/* biome-ignore format: definition needs to be oneline or breaks variants */
|
|
169
|
-
--shadow-xs-solid:
|
|
181
|
+
--shadow-xs-solid:
|
|
182
|
+
1px 1px 0px 0px var(--base-shadow-darker),
|
|
183
|
+
0px 0px 2px 0px hsl(0deg 0% 50% / 20%);
|
|
170
184
|
|
|
171
185
|
/* biome-ignore format: definition needs to be oneline or breaks variants */
|
|
172
|
-
--shadow-sm-solid:
|
|
186
|
+
--shadow-sm-solid:
|
|
187
|
+
2px 2px 0px 0px var(--base-shadow-darker),
|
|
188
|
+
0px 0px 2px 0px hsl(0deg 0% 50% / 20%);
|
|
173
189
|
|
|
174
190
|
/* biome-ignore format: definition needs to be oneline or breaks variants */
|
|
175
|
-
--shadow-md-solid:
|
|
191
|
+
--shadow-md-solid:
|
|
192
|
+
4px 4px 0px 0px var(--base-shadow-darker),
|
|
193
|
+
0 0px 2px 0px hsl(0deg 0% 60% / 50%);
|
|
176
194
|
|
|
177
195
|
/* biome-ignore format: definition needs to be oneline or breaks variants */
|
|
178
|
-
--shadow-lg-solid:
|
|
196
|
+
--shadow-lg-solid:
|
|
197
|
+
5px 6px 0px 0px var(--base-shadow-darker),
|
|
198
|
+
0 0px 4px 0px hsl(0deg 0% 75% / 50%);
|
|
179
199
|
|
|
180
200
|
/* biome-ignore format: definition needs to be oneline or breaks variants */
|
|
181
|
-
--shadow-xl-solid:
|
|
201
|
+
--shadow-xl-solid:
|
|
202
|
+
7px 8px 0px 0px var(--base-shadow-darker),
|
|
203
|
+
0 0px 4px 0px hsl(0deg 0% 85% / 50%);
|
|
182
204
|
|
|
183
205
|
/* biome-ignore format: definition needs to be oneline or breaks variants */
|
|
184
|
-
--shadow-2xl-solid:
|
|
206
|
+
--shadow-2xl-solid:
|
|
207
|
+
10px 12px 0px 0px var(--base-shadow-darker),
|
|
208
|
+
0 0px 8px 0px hsl(0deg 0% 90% / 50%);
|
|
185
209
|
|
|
186
210
|
/* Solid shadows with lighter shade color */
|
|
187
211
|
|
|
188
212
|
/* biome-ignore format: definition needs to be oneline or breaks variants */
|
|
189
|
-
--shadow-sm-solid-shade:
|
|
213
|
+
--shadow-sm-solid-shade:
|
|
214
|
+
2px 2px 0px 0px var(--base-shadow), 0px 0px 2px 0px hsl(0deg 0% 50% / 20%);
|
|
190
215
|
|
|
191
216
|
/* biome-ignore format: definition needs to be oneline or breaks variants */
|
|
192
|
-
--shadow-md-solid-shade:
|
|
217
|
+
--shadow-md-solid-shade:
|
|
218
|
+
4px 4px 0px 0px var(--base-shadow), 0 0px 2px 0px hsl(0deg 0% 60% / 50%);
|
|
193
219
|
}
|
|
@@ -76,8 +76,10 @@ export const DataEditorPlugin = createPlugin<Edits>("marimo-data-editor", {
|
|
|
76
76
|
);
|
|
77
77
|
});
|
|
78
78
|
|
|
79
|
-
interface Props
|
|
80
|
-
|
|
79
|
+
interface Props extends Omit<
|
|
80
|
+
DataEditorProps<object>,
|
|
81
|
+
"data" | "onAddEdits" | "onAddRows"
|
|
82
|
+
> {
|
|
81
83
|
data: TableData<object>;
|
|
82
84
|
edits: Edits;
|
|
83
85
|
onEdits: Setter<Edits>;
|
|
@@ -80,8 +80,7 @@ export const FormPlugin = createPlugin("marimo-form")
|
|
|
80
80
|
});
|
|
81
81
|
|
|
82
82
|
export interface FormWrapperProps<T>
|
|
83
|
-
extends Omit<Data, "elementId">,
|
|
84
|
-
Functions {
|
|
83
|
+
extends Omit<Data, "elementId">, Functions {
|
|
85
84
|
children: React.ReactNode;
|
|
86
85
|
currentValue: T;
|
|
87
86
|
newValue: T;
|
|
@@ -44,16 +44,14 @@ describe("renderZodSchema", () => {
|
|
|
44
44
|
[...TransformTypeSchema.options],
|
|
45
45
|
(z) => getUnionLiteral(z).value,
|
|
46
46
|
);
|
|
47
|
-
it.each(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
FieldValues
|
|
52
|
-
>) => {
|
|
53
|
-
const expected = render(<Subject schema={schema} />);
|
|
47
|
+
it.each(Object.entries(options))(
|
|
48
|
+
"should render a form %s",
|
|
49
|
+
(name, schema: z.ZodType<unknown, FieldValues>) => {
|
|
50
|
+
const expected = render(<Subject schema={schema} />);
|
|
54
51
|
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
expect(expected.asFragment()).toMatchSnapshot();
|
|
53
|
+
},
|
|
54
|
+
);
|
|
57
55
|
});
|
|
58
56
|
|
|
59
57
|
const options = [
|
|
@@ -578,20 +578,19 @@ describe("makeSelectable", () => {
|
|
|
578
578
|
`);
|
|
579
579
|
});
|
|
580
580
|
|
|
581
|
-
it.each([
|
|
582
|
-
"
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
});
|
|
581
|
+
it.each(["errorbar", "errorband", "boxplot"])(
|
|
582
|
+
"should return the same spec if mark is %s",
|
|
583
|
+
(mark) => {
|
|
584
|
+
const spec = {
|
|
585
|
+
mark,
|
|
586
|
+
} as unknown as VegaLiteSpec;
|
|
587
|
+
const newSpec = makeSelectable(spec, {});
|
|
588
|
+
expect(newSpec).toEqual(spec);
|
|
589
|
+
expect(getSelectionParamNames(newSpec)).toEqual([]);
|
|
590
|
+
expect(newSpec).toMatchSnapshot();
|
|
591
|
+
expect(parse(newSpec)).toBeDefined();
|
|
592
|
+
},
|
|
593
|
+
);
|
|
595
594
|
|
|
596
595
|
it("should add legend selection to composite charts (issue #6676)", () => {
|
|
597
596
|
// Test case from https://github.com/marimo-team/marimo/issues/6676
|
|
@@ -11,9 +11,7 @@ const LazyImageComparisonComponent = React.lazy(
|
|
|
11
11
|
() => import("../impl/image-comparison/ImageComparisonComponent"),
|
|
12
12
|
);
|
|
13
13
|
|
|
14
|
-
export class ImageComparisonPlugin
|
|
15
|
-
implements IStatelessPlugin<ImageComparisonData>
|
|
16
|
-
{
|
|
14
|
+
export class ImageComparisonPlugin implements IStatelessPlugin<ImageComparisonData> {
|
|
17
15
|
tagName = "marimo-image-comparison";
|
|
18
16
|
|
|
19
17
|
validator = z.object({
|
|
@@ -20,8 +20,10 @@ export interface IStatelessPluginProps<D> {
|
|
|
20
20
|
children?: React.ReactNode | undefined;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export interface IStatelessPlugin<D>
|
|
24
|
-
|
|
23
|
+
export interface IStatelessPlugin<D> extends Omit<
|
|
24
|
+
IPlugin<never, D>,
|
|
25
|
+
"render" | "functions"
|
|
26
|
+
> {
|
|
25
27
|
/**
|
|
26
28
|
* Render the plugin.
|
|
27
29
|
*/
|