@marimo-team/islands 0.23.9-dev34 → 0.23.9-dev37
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/{ConnectedDataExplorerComponent-MJy-Ll40.js → ConnectedDataExplorerComponent-BQBH2XAd.js} +4 -4
- package/dist/assets/__vite-browser-external-TaZstNaH.js +1 -0
- package/dist/assets/{worker-BoAkAmaG.js → worker-CZaLU0G8.js} +2 -2
- package/dist/{chat-ui-CpX2YcGy.js → chat-ui-BQqY0W74.js} +60 -60
- package/dist/{code-visibility-y3APpJ-N.js → code-visibility-CHwUF5vX.js} +675 -556
- package/dist/{formats-BIKFEOlR.js → formats-B7_JC7Ba.js} +1 -1
- package/dist/{glide-data-editor-DjQd6fKp.js → glide-data-editor-BmM4MCbn.js} +2 -2
- package/dist/{html-to-image-QL7QveRm.js → html-to-image-BAPmFVwS.js} +2139 -2152
- package/dist/{input-Dh0iMVFM.js → input-Ld3tUgdF.js} +1 -1
- package/dist/main.js +110 -109
- package/dist/{mermaid-CAibas-0.js → mermaid-BrUZ2PpQ.js} +2 -2
- package/dist/{process-output-C657UH7t.js → process-output-B55jxGI5.js} +1 -1
- package/dist/{reveal-component-Cbw9hzrS.js → reveal-component-DQF8h6lC.js} +5 -5
- package/dist/{spec-BKuFJIDz.js → spec-nqxKYdNH.js} +1 -1
- package/dist/{toDate-BeKbrOvs.js → toDate-DLCQY32Y.js} +1 -1
- package/dist/{useAsyncData-yp6n17kh.js → useAsyncData-3f5sSgzf.js} +1 -1
- package/dist/{useDeepCompareMemoize-DJvAHUIC.js → useDeepCompareMemoize-Cu37j2QD.js} +1 -1
- package/dist/{useLifecycle-CsYXf0Ln.js → useLifecycle-DVkMZA_I.js} +1 -1
- package/dist/{useTheme-CK_R9Mn8.js → useTheme-DNcgchnA.js} +11 -2
- package/dist/{vega-component-ikfBfkZO.js → vega-component-7odw1pLZ.js} +5 -5
- package/package.json +1 -1
- package/src/components/app-config/ai-config.tsx +74 -15
- package/src/components/chat/chat-panel.tsx +2 -2
- package/src/components/data-table/__tests__/header-items.test.tsx +220 -10
- package/src/components/data-table/column-header.tsx +17 -12
- package/src/components/data-table/export-actions.tsx +19 -12
- package/src/components/data-table/header-items.tsx +40 -16
- package/src/components/data-table/schemas.ts +2 -2
- package/src/components/editor/actions/useCellActionButton.tsx +3 -3
- package/src/components/editor/cell/code/cell-editor.tsx +7 -4
- package/src/components/editor/chrome/types.ts +13 -6
- package/src/components/editor/chrome/wrapper/app-chrome.tsx +6 -4
- package/src/components/editor/chrome/wrapper/footer-items/ai-status.tsx +10 -1
- package/src/components/editor/chrome/wrapper/sidebar.tsx +7 -5
- package/src/components/editor/errors/auto-fix.tsx +3 -3
- package/src/components/editor/navigation/__tests__/navigation.test.ts +15 -0
- package/src/components/editor/navigation/navigation.ts +5 -0
- package/src/components/editor/output/MarimoTracebackOutput.tsx +4 -3
- package/src/components/editor/renderers/cell-array.tsx +27 -24
- package/src/core/config/__tests__/config-schema.test.ts +2 -0
- package/src/core/config/config-schema.ts +1 -0
- package/src/core/config/config.ts +16 -0
- package/src/utils/__tests__/json-parser.test.ts +1 -69
- package/src/utils/json/json-parser.ts +0 -30
- package/dist/assets/__vite-browser-external-BBEFRPue.js +0 -1
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
2
|
import { expect, it } from "vitest";
|
|
3
|
-
import {
|
|
4
|
-
jsonParseWithSpecialChar,
|
|
5
|
-
jsonToMarkdown,
|
|
6
|
-
jsonToTSV,
|
|
7
|
-
} from "../json/json-parser";
|
|
3
|
+
import { jsonParseWithSpecialChar, jsonToMarkdown } from "../json/json-parser";
|
|
8
4
|
|
|
9
5
|
it("can jsonParseWithSpecialChar happy path", () => {
|
|
10
6
|
expect(jsonParseWithSpecialChar('"hello"')).toEqual("hello");
|
|
@@ -72,70 +68,6 @@ it("can parse bigInts", () => {
|
|
|
72
68
|
});
|
|
73
69
|
});
|
|
74
70
|
|
|
75
|
-
it("can convert json to tsv with en-US locale", () => {
|
|
76
|
-
const locale = "en-US";
|
|
77
|
-
|
|
78
|
-
expect(jsonToTSV([], locale)).toEqual("");
|
|
79
|
-
|
|
80
|
-
expect(jsonToTSV([{ a: 1, b: 2 }], locale)).toEqual("a\tb\n1\t2");
|
|
81
|
-
|
|
82
|
-
expect(
|
|
83
|
-
jsonToTSV(
|
|
84
|
-
[
|
|
85
|
-
{ a: 1, b: 2 },
|
|
86
|
-
{ a: 3, b: 4 },
|
|
87
|
-
],
|
|
88
|
-
locale,
|
|
89
|
-
),
|
|
90
|
-
).toEqual("a\tb\n1\t2\n3\t4");
|
|
91
|
-
|
|
92
|
-
// Does not handle sparse arrays
|
|
93
|
-
expect(jsonToTSV([{ a: 1 }, { a: 2, b: 3 }], locale)).toMatchInlineSnapshot(
|
|
94
|
-
'"a\n1\n2"',
|
|
95
|
-
);
|
|
96
|
-
|
|
97
|
-
// Handles special characters
|
|
98
|
-
expect(
|
|
99
|
-
jsonToTSV([{ a: "hello\tworld", b: "new\nline" }], locale),
|
|
100
|
-
).toMatchInlineSnapshot('"a\tb\nhello\tworld\tnew\nline"');
|
|
101
|
-
|
|
102
|
-
// Handles floats with en-US locale (uses . as decimal separator)
|
|
103
|
-
expect(jsonToTSV([{ a: 1.5, b: 2.7 }], locale)).toEqual("a\tb\n1.5\t2.7");
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
it("can convert json to tsv with de-DE locale", () => {
|
|
107
|
-
const locale = "de-DE";
|
|
108
|
-
|
|
109
|
-
// Handles floats with de-DE locale (uses , as decimal separator)
|
|
110
|
-
expect(jsonToTSV([{ a: 1.5, b: 2.7 }], locale)).toEqual("a\tb\n1,5\t2,7");
|
|
111
|
-
|
|
112
|
-
// Handles integers (no change)
|
|
113
|
-
expect(jsonToTSV([{ a: 1, b: 2 }], locale)).toEqual("a\tb\n1\t2");
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
it("can convert json to tsv with fr-FR locale", () => {
|
|
117
|
-
const locale = "fr-FR";
|
|
118
|
-
|
|
119
|
-
// Handles floats with fr-FR locale (uses , as decimal separator)
|
|
120
|
-
expect(jsonToTSV([{ a: 3.14, b: 2.123_45 }], locale)).toEqual(
|
|
121
|
-
"a\tb\n3,14\t2,12345",
|
|
122
|
-
);
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
it("handles null and undefined values in TSV", () => {
|
|
126
|
-
const locale = "en-US";
|
|
127
|
-
|
|
128
|
-
expect(jsonToTSV([{ a: null, b: undefined, c: 1 }], locale)).toEqual(
|
|
129
|
-
"a\tb\tc\n\t\t1",
|
|
130
|
-
);
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
it("handles NaN values in TSV", () => {
|
|
134
|
-
const locale = "en-US";
|
|
135
|
-
|
|
136
|
-
expect(jsonToTSV([{ a: Number.NaN, b: 1 }], locale)).toEqual("a\tb\nNaN\t1");
|
|
137
|
-
});
|
|
138
|
-
|
|
139
71
|
it("can convert json to markdown - basic table", () => {
|
|
140
72
|
expect(jsonToMarkdown([])).toMatchInlineSnapshot(`""`);
|
|
141
73
|
|
|
@@ -66,36 +66,6 @@ export function jsonParseWithSpecialChar<T = unknown>(
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
/**
|
|
70
|
-
* Formats a value for TSV export, respecting user's locale for numbers
|
|
71
|
-
*/
|
|
72
|
-
function formatValueForTSV(value: unknown, locale: string): string {
|
|
73
|
-
if (value === null || value === undefined) {
|
|
74
|
-
return "";
|
|
75
|
-
}
|
|
76
|
-
if (typeof value === "number" && !Number.isNaN(value)) {
|
|
77
|
-
// Use toLocaleString to format numbers according to user's locale
|
|
78
|
-
// This will use the appropriate decimal separator (e.g., "," in European locales)
|
|
79
|
-
return value.toLocaleString(locale, {
|
|
80
|
-
useGrouping: false,
|
|
81
|
-
maximumFractionDigits: 20,
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
return String(value);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export function jsonToTSV(json: Record<string, unknown>[], locale: string) {
|
|
88
|
-
if (json.length === 0) {
|
|
89
|
-
return "";
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
const keys = Object.keys(json[0]);
|
|
93
|
-
const values = json.map((row) =>
|
|
94
|
-
keys.map((key) => formatValueForTSV(row[key], locale)).join("\t"),
|
|
95
|
-
);
|
|
96
|
-
return `${keys.join("\t")}\n${values.join("\n")}`;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
69
|
/**
|
|
100
70
|
* Converts JSON data to a Markdown table format
|
|
101
71
|
* Detects URLs and converts them to markdown links [url](url)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./worker-BoAkAmaG.js";var t=e(((e,t)=>{t.exports={}}));export default t();
|