@marimo-team/islands 0.23.10-dev44 → 0.23.10-dev46

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.
@@ -35981,7 +35981,7 @@ ${d}`,
35981
35981
  return Logger.warn("Failed to get version from mount config"), null;
35982
35982
  }
35983
35983
  }
35984
- marimoVersionAtom = atom(getVersionFromMountConfig() || "0.23.10-dev44");
35984
+ marimoVersionAtom = atom(getVersionFromMountConfig() || "0.23.10-dev46");
35985
35985
  showCodeInRunModeAtom = atom(true);
35986
35986
  atom(null);
35987
35987
  var import_compiler_runtime = require_compiler_runtime();
package/dist/main.js CHANGED
@@ -26,7 +26,7 @@ import { $ as reducer, B as safeExtractSetUIElementMessageBuffers, Bn as CircleA
26
26
  import { __tla as __tla_1 } from "./chunk-5FQGJX7Z-BbqSm5gU.js";
27
27
  import { o as useSize, s as Root$1, u as createLucideIcon } from "./dist-Dk6PV_d3.js";
28
28
  import { A as SquareFunction, C as DEFAULT_COLOR_SCHEME, D as SCALE_TYPE_DESCRIPTIONS, E as EMPTY_VALUE$1, O as TIME_UNIT_DESCRIPTIONS, S as DEFAULT_AGGREGATION, T as DEFAULT_TIME_UNIT, _ as AGGREGATION_TYPE_DESCRIPTIONS, a as AGGREGATION_FNS$1, b as COLOR_SCHEMES, c as COLOR_BY_FIELDS, d as NONE_VALUE, f as SELECTABLE_DATA_TYPES, g as TIME_UNITS, h as STRING_AGGREGATION_FNS, i as convertDataTypeToSelectable, j as ChartColumn, k as escapeFieldName, l as COMBINED_TIME_UNITS, m as SORT_TYPES, n as createSpecWithoutData, o as BIN_AGGREGATION, p as SINGLE_TIME_UNITS, r as isFieldSet, s as CHART_TYPES, t as augmentSpecWithData, u as ChartType, v as AGGREGATION_TYPE_ICON, w as DEFAULT_MAX_BINS_FACET, x as COUNT_FIELD, y as CHART_TYPE_ICON } from "./spec-X7FwLJni.js";
29
- import { $ as contextAwarePanelOpen, $t as $fae977aafc393c5c$export$6b862160d295c8e, A as prettifyRowCount, At as SELECT_COLUMN_ID, B as DatePicker, Bt as TabsContent, C as downloadSizeLimitAtom, Ct as DelayMount, D as ErrorState, Dt as loadTableAndRawData, E as EmptyState, Et as getPageIndexForRow, F as ContextMenuSeparator, Ft as Maps, G as CommandEmpty, Gt as ChartLoadingState, H as Combobox, Ht as TabsTrigger, I as ContextMenuTrigger, It as dateToLocalISODate, J as CommandList, Jt as RenderTextWithLinks, K as CommandInput, Kt as LazyVegaEmbed, L as useInternalStateWithSync, Lt as dateToLocalISODateTime, M as ContextMenu, Mt as toFieldTypes, N as ContextMenuContent, Nt as getMimeValues, O as LoadingState, Ot as loadTableData, P as ContextMenuItem, Pt as isNullishFilter, Q as PANEL_TYPES, Qt as $fae977aafc393c5c$export$588937bcd60ade55, R as useSelectList, Rt as dateToLocalISOTime, S as Filenames, St as ColumnChartSpecModel, T as ColumnPreviewContainer, Tt as usePrevious$1, U as ComboboxItem, Ut as ChartErrorState, V as DateRangePicker, Vt as TabsList, W as Command, Wt as ChartInfoState, X as smartMatch, Xt as HtmlOutput, Y as CommandSeparator, Yt as Kbd, Z as ContextAwarePanelItem, Zt as EmotionCacheProvider, _ as ADD_PRINTING_CLASS, _t as NAMELESS_COLUMN_PREFIX, an as Ellipsis, at as Toggle, b as downloadHTMLAsImage, bt as renderCellValue, c as Slide, cn as ChevronsUpDown, d as RadioGroupItem, dn as ChevronsDownUp, dt as Table, en as TextWrap, et as contextAwarePanelOwner, f as JsonOutput, fn as ChevronLeft, ft as TableBody, g as InstallPackageButton, gt as TableRow, h as DataTable, ht as TableHeader, it as slotsController, j as getColumnCountForDisplay, jt as TOO_MANY_ROWS, k as prettifyRowColumnCount, kt as INDEX_COLUMN_NAME, l as Switch, ln as ChevronsRight, lt as Fill, m as OutputRenderer, mt as TableHead, n as marimoVersionAtom, nn as Funnel, nt as isCellAwareAtom, o as SLIDE_TYPE_OPTIONS_BY_VALUE, on as Download, p as OutputArea, pn as ArrowDownWideNarrow, pt as TableCell, q as CommandItem, qt as useOverflowDetection, r as showCodeInRunModeAtom, rn as EyeOff, rt as SlotNames, sn as Code, t as useNotebookCodeAvailable, tn as GripHorizontal, tt as contextAwarePanelType, u as RadioGroup, un as ChevronsLeft, ut as Provider$1, v as downloadBlob, vt as generateColumns, w as ColumnName, wt as useIntersectionObserver, x as Progress, xt as ColumnChartContext, y as downloadByURL, yt as inferFieldTypes, z as CompactChipRow, zt as Tabs, __tla as __tla_2 } from "./code-visibility-CzYIDGEy.js";
29
+ import { $ as contextAwarePanelOpen, $t as $fae977aafc393c5c$export$6b862160d295c8e, A as prettifyRowCount, At as SELECT_COLUMN_ID, B as DatePicker, Bt as TabsContent, C as downloadSizeLimitAtom, Ct as DelayMount, D as ErrorState, Dt as loadTableAndRawData, E as EmptyState, Et as getPageIndexForRow, F as ContextMenuSeparator, Ft as Maps, G as CommandEmpty, Gt as ChartLoadingState, H as Combobox, Ht as TabsTrigger, I as ContextMenuTrigger, It as dateToLocalISODate, J as CommandList, Jt as RenderTextWithLinks, K as CommandInput, Kt as LazyVegaEmbed, L as useInternalStateWithSync, Lt as dateToLocalISODateTime, M as ContextMenu, Mt as toFieldTypes, N as ContextMenuContent, Nt as getMimeValues, O as LoadingState, Ot as loadTableData, P as ContextMenuItem, Pt as isNullishFilter, Q as PANEL_TYPES, Qt as $fae977aafc393c5c$export$588937bcd60ade55, R as useSelectList, Rt as dateToLocalISOTime, S as Filenames, St as ColumnChartSpecModel, T as ColumnPreviewContainer, Tt as usePrevious$1, U as ComboboxItem, Ut as ChartErrorState, V as DateRangePicker, Vt as TabsList, W as Command, Wt as ChartInfoState, X as smartMatch, Xt as HtmlOutput, Y as CommandSeparator, Yt as Kbd, Z as ContextAwarePanelItem, Zt as EmotionCacheProvider, _ as ADD_PRINTING_CLASS, _t as NAMELESS_COLUMN_PREFIX, an as Ellipsis, at as Toggle, b as downloadHTMLAsImage, bt as renderCellValue, c as Slide, cn as ChevronsUpDown, d as RadioGroupItem, dn as ChevronsDownUp, dt as Table, en as TextWrap, et as contextAwarePanelOwner, f as JsonOutput, fn as ChevronLeft, ft as TableBody, g as InstallPackageButton, gt as TableRow, h as DataTable, ht as TableHeader, it as slotsController, j as getColumnCountForDisplay, jt as TOO_MANY_ROWS, k as prettifyRowColumnCount, kt as INDEX_COLUMN_NAME, l as Switch, ln as ChevronsRight, lt as Fill, m as OutputRenderer, mt as TableHead, n as marimoVersionAtom, nn as Funnel, nt as isCellAwareAtom, o as SLIDE_TYPE_OPTIONS_BY_VALUE, on as Download, p as OutputArea, pn as ArrowDownWideNarrow, pt as TableCell, q as CommandItem, qt as useOverflowDetection, r as showCodeInRunModeAtom, rn as EyeOff, rt as SlotNames, sn as Code, t as useNotebookCodeAvailable, tn as GripHorizontal, tt as contextAwarePanelType, u as RadioGroup, un as ChevronsLeft, ut as Provider$1, v as downloadBlob, vt as generateColumns, w as ColumnName, wt as useIntersectionObserver, x as Progress, xt as ColumnChartContext, y as downloadByURL, yt as inferFieldTypes, z as CompactChipRow, zt as Tabs, __tla as __tla_2 } from "./code-visibility-TiZn-65Q.js";
30
30
  import { c as Calendar, i as createReducerAndAtoms, n as useOnUnmount, o as ToggleLeft, t as useOnMount } from "./useLifecycle-00mO3OSS.js";
31
31
  import { t as Check } from "./check-BCaJeT-J.js";
32
32
  import { A as Icon, C as logNever, D as $18f2051aff69b9bf$export$a54013f0d02a8f82, E as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7, F as createCollection, I as X, M as clamp$2, N as usePrevious$2, P as useDirection, R as ChevronDown, S as assertNever, a as SelectGroup, c as SelectSeparator, d as NativeSelect, i as SelectContent, j as Trigger$1, l as SelectTrigger, n as capitalize, o as SelectItem, r as Select, s as SelectLabel, t as Strings, u as SelectValue, w as $a916eb452884faea$export$b7a616150fdb9f44 } from "./strings-J57tzLr3.js";
@@ -36187,7 +36187,7 @@ ${c}
36187
36187
  function _temp2$2(e) {
36188
36188
  e.target === e.currentTarget && e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), e.currentTarget.click());
36189
36189
  }
36190
- var LazySlidesComponent = import_react.lazy(() => import("./reveal-component-DERGOPiW.js"));
36190
+ var LazySlidesComponent = import_react.lazy(() => import("./reveal-component-Dm3_kpaX.js"));
36191
36191
  const SlidesLayoutRenderer = ({ layout: e, setLayout: r, cells: c, mode: l }) => {
36192
36192
  var _a3;
36193
36193
  let u = useAtomValue(kioskModeAtom), d = l === "read" || u, f = useAtomValue(numColumnsAtom) > 1, [p, m] = (0, import_react.useState)(null), { slideCells: h, skippedIds: g, noOutputIds: _, slideTypes: v, startCellIndex: y } = (0, import_react.useMemo)(() => computeSlideCellsInfo(c, e), [
@@ -9,7 +9,7 @@ import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
9
9
  import { lt as kioskModeAtom } from "./html-to-image-DXSdAI_Y.js";
10
10
  import "./chunk-5FQGJX7Z-BbqSm5gU.js";
11
11
  import { u as createLucideIcon } from "./dist-Dk6PV_d3.js";
12
- import { a as DEFAULT_SLIDE_TYPE, c as Slide, ct as PanelResizeHandle, i as DEFAULT_DECK_TRANSITION, in as Expand, ot as Panel, rn as EyeOff, s as SlideSidebar, sn as Code, st as PanelGroup, t as useNotebookCodeAvailable } from "./code-visibility-CzYIDGEy.js";
12
+ import { a as DEFAULT_SLIDE_TYPE, c as Slide, ct as PanelResizeHandle, i as DEFAULT_DECK_TRANSITION, in as Expand, ot as Panel, rn as EyeOff, s as SlideSidebar, sn as Code, st as PanelGroup, t as useNotebookCodeAvailable } from "./code-visibility-TiZn-65Q.js";
13
13
  import { X as useDebouncedCallback } from "./input-OdWHkobi.js";
14
14
  import "./toDate-d8RCRrRd.js";
15
15
  import "./react-dom-BTJzcVJ9.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/islands",
3
- "version": "0.23.10-dev44",
3
+ "version": "0.23.10-dev46",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -82,10 +82,17 @@ exports[`generateStorageCode > GCS > without service account key (default creden
82
82
  store = GCSStore("my-bucket")"
83
83
  `;
84
84
 
85
- exports[`generateStorageCode > Google Drive > with browser auth (no credentials) 1`] = `
85
+ exports[`generateStorageCode > Google Drive > with default auth (no credentials) 1`] = `
86
86
  "from gdrive_fsspec import GoogleDriveFileSystem
87
87
 
88
- fs = GoogleDriveFileSystem(token="browser", use_listings_cache=False)"
88
+ fs = GoogleDriveFileSystem(use_listings_cache=False)"
89
+ `;
90
+
91
+ exports[`generateStorageCode > Google Drive > with embedded auth (no credentials) 1`] = `
92
+ "from gdrive_fsspec import GoogleDriveFileSystem
93
+
94
+ fs = GoogleDriveFileSystem(use_listings_cache=False, auth_kwargs={"use_local_webserver": False})
95
+ print("Google Drive connected! Important: Run this cell again to clear the console")"
89
96
  `;
90
97
 
91
98
  exports[`generateStorageCode > Google Drive > with service account credentials 1`] = `
@@ -43,7 +43,9 @@ describe("generateStorageCode", () => {
43
43
 
44
44
  describe("S3", () => {
45
45
  it("basic connection with all fields", () => {
46
- expect(generateStorageCode(baseS3, "obstore")).toMatchSnapshot();
46
+ expect(
47
+ generateStorageCode(baseS3, { library: "obstore" }),
48
+ ).toMatchSnapshot();
47
49
  });
48
50
 
49
51
  it("minimal connection (bucket only)", () => {
@@ -51,7 +53,9 @@ describe("generateStorageCode", () => {
51
53
  type: "s3",
52
54
  bucket: "my-bucket",
53
55
  };
54
- expect(generateStorageCode(conn, "obstore")).toMatchSnapshot();
56
+ expect(
57
+ generateStorageCode(conn, { library: "obstore" }),
58
+ ).toMatchSnapshot();
55
59
  });
56
60
 
57
61
  it("with custom endpoint", () => {
@@ -59,7 +63,9 @@ describe("generateStorageCode", () => {
59
63
  ...baseS3,
60
64
  endpoint_url: "https://minio.example.com:9000",
61
65
  };
62
- expect(generateStorageCode(conn, "obstore")).toMatchSnapshot();
66
+ expect(
67
+ generateStorageCode(conn, { library: "obstore" }),
68
+ ).toMatchSnapshot();
63
69
  });
64
70
 
65
71
  it("with secrets", () => {
@@ -70,13 +76,17 @@ describe("generateStorageCode", () => {
70
76
  access_key_id: prefixSecret("AWS_ACCESS_KEY_ID"),
71
77
  secret_access_key: prefixSecret("AWS_SECRET_ACCESS_KEY"),
72
78
  };
73
- expect(generateStorageCode(conn, "obstore")).toMatchSnapshot();
79
+ expect(
80
+ generateStorageCode(conn, { library: "obstore" }),
81
+ ).toMatchSnapshot();
74
82
  });
75
83
  });
76
84
 
77
85
  describe("GCS", () => {
78
86
  it("with service account key", () => {
79
- expect(generateStorageCode(baseGCS, "obstore")).toMatchSnapshot();
87
+ expect(
88
+ generateStorageCode(baseGCS, { library: "obstore" }),
89
+ ).toMatchSnapshot();
80
90
  });
81
91
 
82
92
  it("without service account key (default credentials)", () => {
@@ -84,13 +94,17 @@ describe("generateStorageCode", () => {
84
94
  type: "gcs",
85
95
  bucket: "my-bucket",
86
96
  };
87
- expect(generateStorageCode(conn, "obstore")).toMatchSnapshot();
97
+ expect(
98
+ generateStorageCode(conn, { library: "obstore" }),
99
+ ).toMatchSnapshot();
88
100
  });
89
101
  });
90
102
 
91
103
  describe("Azure", () => {
92
104
  it("basic connection with account key", () => {
93
- expect(generateStorageCode(baseAzure, "obstore")).toMatchSnapshot();
105
+ expect(
106
+ generateStorageCode(baseAzure, { library: "obstore" }),
107
+ ).toMatchSnapshot();
94
108
  });
95
109
 
96
110
  it("without account key", () => {
@@ -99,7 +113,9 @@ describe("generateStorageCode", () => {
99
113
  container: "my-container",
100
114
  account_name: "storageaccount",
101
115
  };
102
- expect(generateStorageCode(conn, "obstore")).toMatchSnapshot();
116
+ expect(
117
+ generateStorageCode(conn, { library: "obstore" }),
118
+ ).toMatchSnapshot();
103
119
  });
104
120
 
105
121
  it("with secrets", () => {
@@ -109,13 +125,17 @@ describe("generateStorageCode", () => {
109
125
  account_name: prefixSecret("AZURE_ACCOUNT"),
110
126
  account_key: prefixSecret("AZURE_KEY"),
111
127
  };
112
- expect(generateStorageCode(conn, "obstore")).toMatchSnapshot();
128
+ expect(
129
+ generateStorageCode(conn, { library: "obstore" }),
130
+ ).toMatchSnapshot();
113
131
  });
114
132
  });
115
133
 
116
134
  describe("CoreWeave", () => {
117
135
  it("basic connection with all fields", () => {
118
- expect(generateStorageCode(baseCoreWeave, "obstore")).toMatchSnapshot();
136
+ expect(
137
+ generateStorageCode(baseCoreWeave, { library: "obstore" }),
138
+ ).toMatchSnapshot();
119
139
  });
120
140
 
121
141
  it("minimal connection (bucket and region only)", () => {
@@ -124,7 +144,9 @@ describe("generateStorageCode", () => {
124
144
  bucket: "operator-bucket",
125
145
  region: "US-EAST-04A",
126
146
  };
127
- expect(generateStorageCode(conn, "obstore")).toMatchSnapshot();
147
+ expect(
148
+ generateStorageCode(conn, { library: "obstore" }),
149
+ ).toMatchSnapshot();
128
150
  });
129
151
 
130
152
  it("with secrets", () => {
@@ -135,39 +157,52 @@ describe("generateStorageCode", () => {
135
157
  access_key_id: prefixSecret("COREWEAVE_OBJECT_STORAGE_KEY"),
136
158
  secret_access_key: prefixSecret("COREWEAVE_OBJECT_STORAGE_SECRET"),
137
159
  };
138
- expect(generateStorageCode(conn, "obstore")).toMatchSnapshot();
160
+ expect(
161
+ generateStorageCode(conn, { library: "obstore" }),
162
+ ).toMatchSnapshot();
139
163
  });
140
164
  });
141
165
 
142
166
  describe("Google Drive", () => {
143
167
  it("with service account credentials", () => {
144
- expect(generateStorageCode(baseGDrive, "fsspec")).toMatchSnapshot();
168
+ expect(
169
+ generateStorageCode(baseGDrive, { library: "fsspec" }),
170
+ ).toMatchSnapshot();
145
171
  });
146
172
 
147
- it("with browser auth (no credentials)", () => {
173
+ it("with default auth (no credentials)", () => {
148
174
  const conn: StorageConnection = {
149
175
  type: "gdrive",
150
176
  };
151
- expect(generateStorageCode(conn, "fsspec")).toMatchSnapshot();
177
+ expect(
178
+ generateStorageCode(conn, { library: "fsspec" }),
179
+ ).toMatchSnapshot();
180
+ });
181
+
182
+ it("with embedded auth (no credentials)", () => {
183
+ const conn: StorageConnection = {
184
+ type: "gdrive",
185
+ };
186
+ expect(
187
+ generateStorageCode(conn, { library: "fsspec", isEmbedded: true }),
188
+ ).toMatchSnapshot();
152
189
  });
153
190
  });
154
191
 
155
192
  describe("invalid cases", () => {
156
193
  it("throws for empty S3 bucket", () => {
157
194
  expect(() =>
158
- generateStorageCode(
159
- { type: "s3", bucket: "" } as StorageConnection,
160
- "obstore",
161
- ),
195
+ generateStorageCode({ type: "s3", bucket: "" } as StorageConnection, {
196
+ library: "obstore",
197
+ }),
162
198
  ).toThrow();
163
199
  });
164
200
 
165
201
  it("throws for empty GCS bucket", () => {
166
202
  expect(() =>
167
- generateStorageCode(
168
- { type: "gcs", bucket: "" } as StorageConnection,
169
- "obstore",
170
- ),
203
+ generateStorageCode({ type: "gcs", bucket: "" } as StorageConnection, {
204
+ library: "obstore",
205
+ }),
171
206
  ).toThrow();
172
207
  });
173
208
 
@@ -179,7 +214,7 @@ describe("generateStorageCode", () => {
179
214
  container: "",
180
215
  account_name: "acct",
181
216
  } as StorageConnection,
182
- "obstore",
217
+ { library: "obstore" },
183
218
  ),
184
219
  ).toThrow();
185
220
  });
@@ -192,7 +227,7 @@ describe("generateStorageCode", () => {
192
227
  container: "my-container",
193
228
  account_name: "",
194
229
  } as StorageConnection,
195
- "obstore",
230
+ { library: "obstore" },
196
231
  ),
197
232
  ).toThrow();
198
233
  });
@@ -205,7 +240,7 @@ describe("generateStorageCode", () => {
205
240
  bucket: "",
206
241
  region: "US-EAST-04A",
207
242
  } as StorageConnection,
208
- "obstore",
243
+ { library: "obstore" },
209
244
  ),
210
245
  ).toThrow();
211
246
  });
@@ -218,7 +253,7 @@ describe("generateStorageCode", () => {
218
253
  bucket: "operator-bucket",
219
254
  region: "",
220
255
  } as StorageConnection,
221
- "obstore",
256
+ { library: "obstore" },
222
257
  ),
223
258
  ).toThrow();
224
259
  });
@@ -5,6 +5,7 @@ import type { FieldValues } from "react-hook-form";
5
5
  import type { z } from "zod";
6
6
  import { ProtocolIcon } from "@/components/storage/components";
7
7
  import type { KnownStorageProtocol } from "@/core/storage/types";
8
+ import { useIframeCapabilities } from "@/hooks/useIframeCapabilities";
8
9
  import { ConnectionForm, SelectorButton, SelectorGrid } from "../components";
9
10
  import {
10
11
  generateStorageCode,
@@ -108,6 +109,7 @@ export const AddStorageForm: React.FC<{
108
109
  onSubmit: () => void;
109
110
  header?: React.ReactNode;
110
111
  }> = ({ onSubmit, header }) => {
112
+ const { isEmbedded } = useIframeCapabilities();
111
113
  const [selectedSchema, setSelectedSchema] = useState<z.ZodType<
112
114
  StorageConnection,
113
115
  FieldValues
@@ -134,7 +136,9 @@ export const AddStorageForm: React.FC<{
134
136
  preferredLibrary={libs?.preferred ?? "obstore"}
135
137
  displayNames={StorageLibraryDisplayNames}
136
138
  libraryLabel="Preferred storage library"
137
- generateCode={(values, library) => generateStorageCode(values, library)}
139
+ generateCode={(values, library) =>
140
+ generateStorageCode(values, { library, isEmbedded })
141
+ }
138
142
  onSubmit={onSubmit}
139
143
  onBack={() => setSelectedSchema(null)}
140
144
  />
@@ -7,6 +7,11 @@ import { type StorageConnection, StorageConnectionSchema } from "./schemas";
7
7
 
8
8
  export type StorageLibrary = "obstore" | "fsspec";
9
9
 
10
+ export interface StorageCodeOptions {
11
+ library: StorageLibrary;
12
+ isEmbedded?: boolean;
13
+ }
14
+
10
15
  export const StorageLibraryDisplayNames: Record<StorageLibrary, string> = {
11
16
  obstore: "obstore",
12
17
  fsspec: "fsspec",
@@ -161,8 +166,9 @@ function generateCoreWeaveCode(
161
166
 
162
167
  function generateGDriveCode(
163
168
  connection: Extract<StorageConnection, { type: "gdrive" }>,
164
- secrets: SecretContainer,
169
+ options: { secrets: SecretContainer; isEmbedded?: boolean },
165
170
  ): { imports: Set<string>; code: string } {
171
+ const { secrets, isEmbedded = false } = options;
166
172
  const imports = new Set(["from gdrive_fsspec import GoogleDriveFileSystem"]);
167
173
 
168
174
  if (connection.credentials_json) {
@@ -178,15 +184,20 @@ function generateGDriveCode(
178
184
  return { imports, code };
179
185
  }
180
186
 
181
- const code = dedent(`
182
- fs = GoogleDriveFileSystem(token="browser", use_listings_cache=False)
183
- `);
187
+ const code = isEmbedded
188
+ ? dedent(`
189
+ fs = GoogleDriveFileSystem(use_listings_cache=False, auth_kwargs={"use_local_webserver": False})
190
+ print("Google Drive connected! Important: Run this cell again to clear the console")
191
+ `)
192
+ : dedent(`
193
+ fs = GoogleDriveFileSystem(use_listings_cache=False)
194
+ `);
184
195
  return { imports, code };
185
196
  }
186
197
 
187
198
  export function generateStorageCode(
188
199
  connection: StorageConnection,
189
- _library: StorageLibrary,
200
+ options: StorageCodeOptions,
190
201
  ): string {
191
202
  StorageConnectionSchema.parse(connection);
192
203
 
@@ -207,7 +218,10 @@ export function generateStorageCode(
207
218
  result = generateCoreWeaveCode(connection, secrets);
208
219
  break;
209
220
  case "gdrive":
210
- result = generateGDriveCode(connection, secrets);
221
+ result = generateGDriveCode(connection, {
222
+ secrets,
223
+ isEmbedded: options.isEmbedded,
224
+ });
211
225
  break;
212
226
  default:
213
227
  assertNever(connection);