@marimo-team/frontend 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/assets/{CellStatus-Dm3YCiM6.js → CellStatus-Bps_s-zo.js} +1 -1
- package/dist/assets/{ConnectedDataExplorerComponent-CduY7ZLg.js → ConnectedDataExplorerComponent-DJhqEvUc.js} +1 -1
- package/dist/assets/JsonOutput-CdS7HujD.js +53 -0
- package/dist/assets/{MarimoErrorOutput-XPsNfvEO.js → MarimoErrorOutput-d7MmTwXt.js} +2 -2
- package/dist/assets/{RenderHTML-BvW-obUg.js → RenderHTML-CyFI3m7e.js} +1 -1
- package/dist/assets/{RunButton-BUq1ZIzv.js → RunButton-BpQQEGB4.js} +1 -1
- package/dist/assets/{add-cell-with-ai-C4H664zc.js → add-cell-with-ai-D7ZKFW63.js} +1 -1
- package/dist/assets/{add-connection-dialog-DdJBM1-Q.js → add-connection-dialog-BRxxT-05.js} +1 -1
- package/dist/assets/{agent-panel-BB1ZRQse.js → agent-panel-DpRKqFQC.js} +1 -1
- package/dist/assets/{ai-model-dropdown-9UrkfG-1.js → ai-model-dropdown-DuiTgBtv.js} +4 -4
- package/dist/assets/{app-config-button-N_G5k5XW.js → app-config-button-C_znCHcu.js} +1 -1
- package/dist/assets/cell-editor-C-hrktFN.js +20 -0
- package/dist/assets/{cell-link-Bkd6QnOS.js → cell-link-BeLd0Zdq.js} +1 -1
- package/dist/assets/{cells-BP6kg4iF.js → cells-CxUPU-1-.js} +52 -54
- package/dist/assets/{chat-display-76m4LMD2.js → chat-display-Bx1Eb_Ue.js} +1 -1
- package/dist/assets/{chat-panel-BAIgHYyO.js → chat-panel-BhkDEUkZ.js} +1 -1
- package/dist/assets/{chat-ui-BggP20am.js → chat-ui-Cj6aFsnJ.js} +1 -1
- package/dist/assets/{column-preview-9_vf_vQt.js → column-preview-BD8Wx8Cc.js} +1 -1
- package/dist/assets/{command-palette-drFTNlvg.js → command-palette-CoT8fRUn.js} +1 -1
- package/dist/assets/{common-G2mwxgr_.js → common-DFZ8mLB0.js} +1 -1
- package/dist/assets/{components-DvggA56E.js → components-4xonnM8n.js} +1 -1
- package/dist/assets/{components-D2tmc0KN.js → components-zzQU0vyD.js} +1 -1
- package/dist/assets/{config-hed0CaQL.js → config-BG-ACF7_.js} +1 -1
- package/dist/assets/{datasource-BjfZ5rCV.js → datasource-IcYyVhfZ.js} +2 -2
- package/dist/assets/{dependency-graph-panel-BQlFSqu5.js → dependency-graph-panel-Cj10Hs1R.js} +1 -1
- package/dist/assets/{documentation-panel-BbVMQHz5.js → documentation-panel-BVOPBcur.js} +1 -1
- package/dist/assets/{download-DrC3sFE3.js → download-C_pd9g8c.js} +1 -1
- package/dist/assets/{edit-page-ClIQhScA.js → edit-page-CCQPTLrI.js} +6 -6
- package/dist/assets/{error-panel-aaHrLkBh.js → error-panel-CenEt2SE.js} +1 -1
- package/dist/assets/{file-explorer-panel-BQ9nMxks.js → file-explorer-panel-BYAzefP8.js} +3 -3
- package/dist/assets/{file-icons-pUZ3DUy5.js → file-icons-BigaIDLY.js} +1 -1
- package/dist/assets/{floating-outline-CDjyi71K.js → floating-outline-CedBuM8P.js} +1 -1
- package/dist/assets/{focus-D2kXD_rc.js → focus-xnXZiybq.js} +1 -1
- package/dist/assets/{form-COQrUWdR.js → form-JCMOrFsE.js} +1 -1
- package/dist/assets/{glide-data-editor-7_pHQtPX.js → glide-data-editor-Dg0e0Gop.js} +1 -1
- package/dist/assets/{globals-Dd7eo1nD.js → globals-CYbHM4QS.js} +1 -1
- package/dist/assets/{home-page-DNFOElFw.js → home-page-3shnx9Mc.js} +2 -2
- package/dist/assets/{hooks-DjKf5pQ9.js → hooks-DKwZ0Cko.js} +1 -1
- package/dist/assets/{html-to-image-EYrNFuGt.js → html-to-image-CXSjyW2C.js} +1 -1
- package/dist/assets/{index-DsF3qFAR.js → index-CNzWtmcb.js} +6 -6
- package/dist/assets/{kiosk-mode-Ht1DwVD4.js → kiosk-mode-BFZZ8jC9.js} +1 -1
- package/dist/assets/{layout-CwCyg6Oq.js → layout-CMjyZr_k.js} +3 -3
- package/dist/assets/{logs-panel-8V1eZbE7.js → logs-panel-ChNt4-nd.js} +1 -1
- package/dist/assets/{markdown-renderer-d9Lol4Mr.js → markdown-renderer-RdKbZs0c.js} +1 -1
- package/dist/assets/{mermaid-DAflnvW9.js → mermaid-C1kGbsPj.js} +1 -1
- package/dist/assets/{name-cell-input-DDR4EexG.js → name-cell-input-CzWKkZN0.js} +1 -1
- package/dist/assets/{outline-panel-B-fr1jRf.js → outline-panel-DE3RxsnG.js} +1 -1
- package/dist/assets/{packages-panel-B4MR9Vnv.js → packages-panel-LKogc_RK.js} +1 -1
- package/dist/assets/{pair-with-agent-modal-Derso4uY.js → pair-with-agent-modal-Cg38WIJM.js} +1 -1
- package/dist/assets/{panels-DsbaLR3B.js → panels-By-lqwVZ.js} +1 -1
- package/dist/assets/{process-output-CJeKhzqO.js → process-output-Do-k247p.js} +1 -1
- package/dist/assets/{radio-group-cvI-M2aa.js → radio-group-BPlyeUit.js} +1 -1
- package/dist/assets/{readonly-python-code-BmZ0KZKm.js → readonly-python-code-DVBUomh3.js} +1 -1
- package/dist/assets/renderShortcut-CUc_HCHW.js +1 -0
- package/dist/assets/{reveal-component-Bff44fKv.js → reveal-component-D4ZXoJmg.js} +1 -1
- package/dist/assets/{run-page-4im7P8v3.js → run-page-Yeue1INt.js} +1 -1
- package/dist/assets/{scratchpad-panel-BFvydb89.js → scratchpad-panel-DDEryB2X.js} +1 -1
- package/dist/assets/{session-panel-CwggjKWr.js → session-panel-BX8DGJv9.js} +1 -1
- package/dist/assets/{snippets-panel-BmWXl5GE.js → snippets-panel-CG-0Co9Y.js} +1 -1
- package/dist/assets/{state-G8Xj60GT.js → state-BzhLi49F.js} +3 -3
- package/dist/assets/{state-d_LoPKHg.js → state-CMTSC5UB.js} +1 -1
- package/dist/assets/{switch-YcZLs0mS.js → switch-Z7gfNPvp.js} +1 -1
- package/dist/assets/{terminal-BydBi1dE.js → terminal-ChwnouBc.js} +1 -1
- package/dist/assets/{textarea-DV6LIVoz.js → textarea-CrkE2Vz1.js} +1 -1
- package/dist/assets/{tracing-CvLPM0Wh.js → tracing-DnqXWZ3X.js} +1 -1
- package/dist/assets/{tracing-panel-iTdY5N_y.js → tracing-panel-Dn6EJyTn.js} +2 -2
- package/dist/assets/{useBoolean-oqDq5zze.js → useBoolean-Begogf9u.js} +1 -1
- package/dist/assets/{useCellActionButton-CsyGJEYN.js → useCellActionButton-dkRpoUta.js} +1 -1
- package/dist/assets/{useDeleteCell-BQA5MqKt.js → useDeleteCell-D0lC6Pn2.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-CIH_2h1J.js → useDependencyPanelTab-BwDEu9T8.js} +1 -1
- package/dist/assets/{useHotkey-BtqYcnxQ.js → useHotkey-CvaNHTub.js} +1 -1
- package/dist/assets/{useNotebookActions-jRhy52S-.js → useNotebookActions-Dbo9QAvm.js} +1 -1
- package/dist/assets/{useRunCells-rD6HJnx6.js → useRunCells-CYnXLwuY.js} +1 -1
- package/dist/assets/{useSplitCell-CqznVs7m.js → useSplitCell-CQRIN0yM.js} +1 -1
- package/dist/assets/useTheme-DJn91dnL.js +1 -0
- package/dist/assets/utils-Df7TLCkF.js +1 -0
- package/dist/assets/{vega-component-DOlcjhuV.js → vega-component-BcDGvncM.js} +1 -1
- package/dist/index.html +29 -29
- 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/JsonOutput-DzATTBoP.js +0 -53
- package/dist/assets/cell-editor-B-9MV21_.js +0 -20
- package/dist/assets/renderShortcut-CzUfgpdJ.js +0 -1
- package/dist/assets/useTheme-KJ1rGmnj.js +0 -1
- package/dist/assets/utils-Bok_hGT2.js +0 -1
|
@@ -46,6 +46,7 @@ test("default UserConfig - empty", () => {
|
|
|
46
46
|
{
|
|
47
47
|
"ai": {
|
|
48
48
|
"custom_providers": {},
|
|
49
|
+
"enabled": true,
|
|
49
50
|
"inline_tooltip": false,
|
|
50
51
|
"mode": "manual",
|
|
51
52
|
"models": {
|
|
@@ -118,6 +119,7 @@ test("default UserConfig - one level", () => {
|
|
|
118
119
|
{
|
|
119
120
|
"ai": {
|
|
120
121
|
"custom_providers": {},
|
|
122
|
+
"enabled": true,
|
|
121
123
|
"inline_tooltip": false,
|
|
122
124
|
"mode": "manual",
|
|
123
125
|
"models": {
|
|
@@ -158,6 +158,7 @@ export const UserConfigSchema = z
|
|
|
158
158
|
.prefault({}),
|
|
159
159
|
ai: z
|
|
160
160
|
.looseObject({
|
|
161
|
+
enabled: z.boolean().prefault(true),
|
|
161
162
|
rules: z.string().prefault(""),
|
|
162
163
|
max_tokens: z.number().int().positive().nullable().optional(),
|
|
163
164
|
mode: z.enum(COPILOT_MODES).prefault("manual"),
|
|
@@ -78,6 +78,14 @@ export const aiEnabledAtom = atom<boolean>((get) => {
|
|
|
78
78
|
return isAiEnabled(get(resolvedMarimoConfigAtom));
|
|
79
79
|
});
|
|
80
80
|
|
|
81
|
+
export const aiModelConfiguredAtom = atom<boolean>((get) => {
|
|
82
|
+
return isAiModelConfigured(get(resolvedMarimoConfigAtom));
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
export const aiFeaturesEnabledAtom = atom<boolean>((get) => {
|
|
86
|
+
return isAiFeatureEnabled(get(resolvedMarimoConfigAtom));
|
|
87
|
+
});
|
|
88
|
+
|
|
81
89
|
export const editorFontSizeAtom = atom<number>((get) => {
|
|
82
90
|
return get(resolvedMarimoConfigAtom).display.code_editor_font_size;
|
|
83
91
|
});
|
|
@@ -87,6 +95,10 @@ export const localeAtom = atom<string | null | undefined>((get) => {
|
|
|
87
95
|
});
|
|
88
96
|
|
|
89
97
|
export function isAiEnabled(config: UserConfig) {
|
|
98
|
+
return config.ai?.enabled !== false;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function isAiModelConfigured(config: UserConfig) {
|
|
90
102
|
return (
|
|
91
103
|
Boolean(config.ai?.models?.chat_model) ||
|
|
92
104
|
Boolean(config.ai?.models?.edit_model) ||
|
|
@@ -94,6 +106,10 @@ export function isAiEnabled(config: UserConfig) {
|
|
|
94
106
|
);
|
|
95
107
|
}
|
|
96
108
|
|
|
109
|
+
export function isAiFeatureEnabled(config: UserConfig) {
|
|
110
|
+
return isAiEnabled(config) && isAiModelConfigured(config);
|
|
111
|
+
}
|
|
112
|
+
|
|
97
113
|
/**
|
|
98
114
|
* Atom for storing the app config.
|
|
99
115
|
*/
|
|
@@ -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)
|