@marimo-team/frontend 0.20.5-dev1 → 0.20.5-dev11
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/{JsonOutput-BSyDxU0G.js → JsonOutput-BW2KjuuO.js} +10 -10
- package/dist/assets/{add-cell-with-ai--4VOMvH8.js → add-cell-with-ai-CjNE3wDD.js} +1 -1
- package/dist/assets/{add-connection-dialog-D4U9I7ze.js → add-connection-dialog-9CzjZlY9.js} +43 -38
- package/dist/assets/{agent-panel-ZBBeZzCj.js → agent-panel-Bs4U7zuM.js} +1 -1
- package/dist/assets/{ai-model-dropdown-C3Y44M85.js → ai-model-dropdown-BvC7PrEP.js} +4 -4
- package/dist/assets/{app-config-button-bnipxY5L.js → app-config-button-Ah2MpPwh.js} +1 -1
- package/dist/assets/{cell-editor-E00pyx5t.js → cell-editor-BEiX1UeB.js} +1 -1
- package/dist/assets/{chat-display-Co6iGNSx.js → chat-display-D9cwUpnQ.js} +1 -1
- package/dist/assets/{chat-panel-70sjqZuy.js → chat-panel-DsThKBAA.js} +1 -1
- package/dist/assets/{column-preview-BQP0K_pZ.js → column-preview-Bd1U8JUS.js} +1 -1
- package/dist/assets/{command-palette-CqTN1VKY.js → command-palette-D0TGx7YC.js} +1 -1
- package/dist/assets/{context-aware-panel-D7ygyp92.js → context-aware-panel-C1uqjYZU.js} +1 -1
- package/dist/assets/{edit-page-lJN42JGx.js → edit-page-CTQGyajl.js} +3 -3
- package/dist/assets/{file-explorer-panel-BU69ZByp.js → file-explorer-panel-UQLj2Iiw.js} +1 -1
- package/dist/assets/{home-page-BXQp6S6h.js → home-page-WDj2x_g2.js} +1 -1
- package/dist/assets/{hooks-FnmFpagQ.js → hooks-BllYlfDO.js} +1 -1
- package/dist/assets/{index-DyRdaW9o.js → index-6w6yEdfY.js} +3 -3
- package/dist/assets/index-Dzwe9vKA.css +2 -0
- package/dist/assets/{layout-DnAy5Tn0.js → layout-DcfIrJXW.js} +1 -1
- package/dist/assets/{packages-panel-D8d46YWc.js → packages-panel-JdLxEG_7.js} +1 -1
- package/dist/assets/{panels-h8gAGYxu.js → panels-BN71Cgvz.js} +1 -1
- package/dist/assets/{run-page-hoKz5ZHk.js → run-page-aSmNe5eg.js} +1 -1
- package/dist/assets/{scratchpad-panel-BJOVrgA9.js → scratchpad-panel-DRCYEcZM.js} +1 -1
- package/dist/assets/{session-panel-Bpv4DUGh.js → session-panel-B5JEvDHe.js} +1 -1
- package/dist/assets/{useNotebookActions-B17g4RO8.js → useNotebookActions-B2BTRuJb.js} +1 -1
- package/dist/index.html +8 -8
- package/package.json +1 -1
- package/src/components/app-config/ai-config.tsx +10 -0
- package/src/components/data-table/pagination.tsx +36 -30
- package/src/components/data-table/range-focus/__tests__/cell-selection-stats.test.tsx +14 -9
- package/src/components/data-table/range-focus/cell-selection-stats.tsx +44 -13
- package/src/components/editor/connections/storage/__tests__/__snapshots__/as-code.test.ts.snap +37 -0
- package/src/components/editor/connections/storage/__tests__/as-code.test.ts +60 -0
- package/src/components/editor/connections/storage/add-storage-form.tsx +20 -13
- package/src/components/editor/connections/storage/as-code.ts +37 -0
- package/src/components/editor/connections/storage/schemas.ts +45 -1
- package/src/components/storage/components.tsx +6 -2
- package/src/components/ui/links.tsx +1 -0
- package/dist/assets/index-DrPzoH7F.css +0 -2
|
@@ -4,6 +4,7 @@ import { useState } from "react";
|
|
|
4
4
|
import type { FieldValues } from "react-hook-form";
|
|
5
5
|
import type { z } from "zod";
|
|
6
6
|
import { ProtocolIcon } from "@/components/storage/components";
|
|
7
|
+
import type { KnownStorageProtocol } from "@/core/storage/types";
|
|
7
8
|
import { ConnectionForm, SelectorButton, SelectorGrid } from "../components";
|
|
8
9
|
import {
|
|
9
10
|
generateStorageCode,
|
|
@@ -12,6 +13,7 @@ import {
|
|
|
12
13
|
} from "./as-code";
|
|
13
14
|
import {
|
|
14
15
|
AzureStorageSchema,
|
|
16
|
+
CoreWeaveStorageSchema,
|
|
15
17
|
GCSStorageSchema,
|
|
16
18
|
GoogleDriveStorageSchema,
|
|
17
19
|
S3StorageSchema,
|
|
@@ -21,7 +23,6 @@ import {
|
|
|
21
23
|
interface StorageProviderSchema {
|
|
22
24
|
name: string;
|
|
23
25
|
schema: z.ZodType<StorageConnection, FieldValues>;
|
|
24
|
-
color: string;
|
|
25
26
|
protocol: string;
|
|
26
27
|
storageLibraries: {
|
|
27
28
|
libraries: StorageLibrary[];
|
|
@@ -29,11 +30,12 @@ interface StorageProviderSchema {
|
|
|
29
30
|
};
|
|
30
31
|
}
|
|
31
32
|
|
|
33
|
+
const BACKGROUND_COLOR = "#232F3E";
|
|
34
|
+
|
|
32
35
|
const STORAGE_PROVIDERS = [
|
|
33
36
|
{
|
|
34
37
|
name: "Amazon S3",
|
|
35
38
|
schema: S3StorageSchema,
|
|
36
|
-
color: "#232F3E",
|
|
37
39
|
protocol: "s3",
|
|
38
40
|
storageLibraries: {
|
|
39
41
|
libraries: ["obstore"],
|
|
@@ -43,7 +45,6 @@ const STORAGE_PROVIDERS = [
|
|
|
43
45
|
{
|
|
44
46
|
name: "Google Cloud Storage",
|
|
45
47
|
schema: GCSStorageSchema,
|
|
46
|
-
color: "#4285F4",
|
|
47
48
|
protocol: "gcs",
|
|
48
49
|
storageLibraries: {
|
|
49
50
|
libraries: ["obstore"],
|
|
@@ -53,17 +54,24 @@ const STORAGE_PROVIDERS = [
|
|
|
53
54
|
{
|
|
54
55
|
name: "Azure Blob Storage",
|
|
55
56
|
schema: AzureStorageSchema,
|
|
56
|
-
color: "#0062AD",
|
|
57
57
|
protocol: "azure",
|
|
58
58
|
storageLibraries: {
|
|
59
59
|
libraries: ["obstore"],
|
|
60
60
|
preferred: "obstore",
|
|
61
61
|
},
|
|
62
62
|
},
|
|
63
|
+
{
|
|
64
|
+
name: "CoreWeave",
|
|
65
|
+
schema: CoreWeaveStorageSchema,
|
|
66
|
+
protocol: "coreweave",
|
|
67
|
+
storageLibraries: {
|
|
68
|
+
libraries: ["obstore"],
|
|
69
|
+
preferred: "obstore",
|
|
70
|
+
},
|
|
71
|
+
},
|
|
63
72
|
{
|
|
64
73
|
name: "Google Drive",
|
|
65
74
|
schema: GoogleDriveStorageSchema,
|
|
66
|
-
color: "#177834",
|
|
67
75
|
protocol: "gdrive",
|
|
68
76
|
storageLibraries: {
|
|
69
77
|
libraries: ["fsspec"],
|
|
@@ -77,18 +85,17 @@ const StorageProviderSelector: React.FC<{
|
|
|
77
85
|
}> = ({ onSelect }) => {
|
|
78
86
|
return (
|
|
79
87
|
<SelectorGrid>
|
|
80
|
-
{STORAGE_PROVIDERS.map(({ name, schema,
|
|
88
|
+
{STORAGE_PROVIDERS.map(({ name, schema, protocol }) => (
|
|
81
89
|
<SelectorButton
|
|
82
90
|
key={name}
|
|
83
91
|
name={name}
|
|
84
|
-
color={
|
|
92
|
+
color={BACKGROUND_COLOR}
|
|
85
93
|
icon={
|
|
86
|
-
<
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
</span>
|
|
94
|
+
<ProtocolIcon
|
|
95
|
+
protocol={protocol as KnownStorageProtocol}
|
|
96
|
+
forceDark={true}
|
|
97
|
+
className="w-7.5 h-7.5"
|
|
98
|
+
/>
|
|
92
99
|
}
|
|
93
100
|
onSelect={() => onSelect(schema)}
|
|
94
101
|
/>
|
|
@@ -125,6 +125,40 @@ function generateAzureCode(
|
|
|
125
125
|
return { imports, code };
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
+
function generateCoreWeaveCode(
|
|
129
|
+
connection: Extract<StorageConnection, { type: "coreweave" }>,
|
|
130
|
+
secrets: SecretContainer,
|
|
131
|
+
): { imports: Set<string>; code: string } {
|
|
132
|
+
const bucket = secrets.print("bucket", connection.bucket);
|
|
133
|
+
const imports = new Set(["from obstore.store import S3Store"]);
|
|
134
|
+
const params: string[] = [
|
|
135
|
+
` region=${secrets.print("region", connection.region)},`,
|
|
136
|
+
];
|
|
137
|
+
|
|
138
|
+
if (connection.access_key_id) {
|
|
139
|
+
params.push(
|
|
140
|
+
` access_key_id=${secrets.print("access_key_id", connection.access_key_id)},`,
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
if (connection.secret_access_key) {
|
|
144
|
+
params.push(
|
|
145
|
+
` secret_access_key=${secrets.print("secret_access_key", connection.secret_access_key)},`,
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
params.push(
|
|
150
|
+
` endpoint="https://${connection.bucket}.cwobject.com",`,
|
|
151
|
+
" virtual_hosted_style_request=True,",
|
|
152
|
+
);
|
|
153
|
+
|
|
154
|
+
const paramsStr = `\n${params.join("\n")}\n`;
|
|
155
|
+
|
|
156
|
+
const code = dedent(`
|
|
157
|
+
store = S3Store(${bucket},${paramsStr})
|
|
158
|
+
`);
|
|
159
|
+
return { imports, code };
|
|
160
|
+
}
|
|
161
|
+
|
|
128
162
|
function generateGDriveCode(
|
|
129
163
|
connection: Extract<StorageConnection, { type: "gdrive" }>,
|
|
130
164
|
secrets: SecretContainer,
|
|
@@ -169,6 +203,9 @@ export function generateStorageCode(
|
|
|
169
203
|
case "azure":
|
|
170
204
|
result = generateAzureCode(connection, secrets);
|
|
171
205
|
break;
|
|
206
|
+
case "coreweave":
|
|
207
|
+
result = generateCoreWeaveCode(connection, secrets);
|
|
208
|
+
break;
|
|
172
209
|
case "gdrive":
|
|
173
210
|
result = generateGDriveCode(connection, secrets);
|
|
174
211
|
break;
|
|
@@ -21,7 +21,6 @@ export const S3StorageSchema = z
|
|
|
21
21
|
FieldOptions.of({
|
|
22
22
|
label: "Region",
|
|
23
23
|
placeholder: "us-east-1",
|
|
24
|
-
optionRegex: ".*region.*",
|
|
25
24
|
}),
|
|
26
25
|
),
|
|
27
26
|
access_key_id: z
|
|
@@ -115,6 +114,50 @@ export const AzureStorageSchema = z
|
|
|
115
114
|
})
|
|
116
115
|
.describe(FieldOptions.of({ direction: "two-columns" }));
|
|
117
116
|
|
|
117
|
+
export const CoreWeaveStorageSchema = z
|
|
118
|
+
.object({
|
|
119
|
+
type: z.literal("coreweave"),
|
|
120
|
+
bucket: z
|
|
121
|
+
.string()
|
|
122
|
+
.nonempty()
|
|
123
|
+
.describe(
|
|
124
|
+
FieldOptions.of({
|
|
125
|
+
label: "Bucket",
|
|
126
|
+
placeholder: "bucket-name",
|
|
127
|
+
}),
|
|
128
|
+
),
|
|
129
|
+
region: z
|
|
130
|
+
.string()
|
|
131
|
+
.nonempty()
|
|
132
|
+
.describe(
|
|
133
|
+
FieldOptions.of({
|
|
134
|
+
label: "Region",
|
|
135
|
+
placeholder: "US-EAST-04A",
|
|
136
|
+
}),
|
|
137
|
+
),
|
|
138
|
+
access_key_id: z
|
|
139
|
+
.string()
|
|
140
|
+
.optional()
|
|
141
|
+
.describe(
|
|
142
|
+
FieldOptions.of({
|
|
143
|
+
label: "Access Key ID",
|
|
144
|
+
inputType: "password",
|
|
145
|
+
optionRegex: ".*object_storage_key.*",
|
|
146
|
+
}),
|
|
147
|
+
),
|
|
148
|
+
secret_access_key: z
|
|
149
|
+
.string()
|
|
150
|
+
.optional()
|
|
151
|
+
.describe(
|
|
152
|
+
FieldOptions.of({
|
|
153
|
+
label: "Secret Access Key",
|
|
154
|
+
inputType: "password",
|
|
155
|
+
optionRegex: ".*object_storage_secret.*",
|
|
156
|
+
}),
|
|
157
|
+
),
|
|
158
|
+
})
|
|
159
|
+
.describe(FieldOptions.of({ direction: "two-columns" }));
|
|
160
|
+
|
|
118
161
|
export const GoogleDriveStorageSchema = z
|
|
119
162
|
.object({
|
|
120
163
|
type: z.literal("gdrive"),
|
|
@@ -135,6 +178,7 @@ export const StorageConnectionSchema = z.discriminatedUnion("type", [
|
|
|
135
178
|
S3StorageSchema,
|
|
136
179
|
GCSStorageSchema,
|
|
137
180
|
AzureStorageSchema,
|
|
181
|
+
CoreWeaveStorageSchema,
|
|
138
182
|
GoogleDriveStorageSchema,
|
|
139
183
|
]);
|
|
140
184
|
|
|
@@ -75,15 +75,19 @@ const PROTOCOL_ICONS: Record<KnownStorageProtocol, IconEntry> = {
|
|
|
75
75
|
|
|
76
76
|
export const ProtocolIcon: React.FC<{
|
|
77
77
|
protocol: KnownStorageProtocol | (string & {});
|
|
78
|
+
forceDark?: boolean;
|
|
78
79
|
className?: string;
|
|
79
|
-
}> = ({ protocol, className }) => {
|
|
80
|
+
}> = ({ protocol, forceDark, className }) => {
|
|
80
81
|
const { theme } = useTheme();
|
|
81
82
|
const entry =
|
|
82
83
|
PROTOCOL_ICONS[protocol.toLowerCase() as KnownStorageProtocol] ??
|
|
83
84
|
HardDriveIcon;
|
|
84
85
|
|
|
85
86
|
if ("src" in entry) {
|
|
86
|
-
|
|
87
|
+
let src = entry.src;
|
|
88
|
+
if (entry.dark && (forceDark || theme === "dark")) {
|
|
89
|
+
src = entry.dark;
|
|
90
|
+
}
|
|
87
91
|
return (
|
|
88
92
|
<img src={src} alt={protocol} className={cn("h-3.5 w-3.5", className)} />
|
|
89
93
|
);
|
|
@@ -8,6 +8,7 @@ export const ExternalLink = ({
|
|
|
8
8
|
| `https://console.anthropic.com/${string}`
|
|
9
9
|
| `https://aistudio.google.com/${string}`
|
|
10
10
|
| `https://github.com/${string}`
|
|
11
|
+
| `https://docs.github.com/${string}`
|
|
11
12
|
| `https://openrouter.ai/${string}`
|
|
12
13
|
| `https://docs.marimo.io/${string}`
|
|
13
14
|
| `https://docs.python.org/${string}`
|