@marimo-team/islands 0.23.7-dev7 → 0.23.7-dev8

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.
@@ -6,13 +6,13 @@ import { _ as Logger, c as Objects, g as cn, l as useEventListener, t as Button
6
6
  import { t as require_react } from "./react-DA-nE2FX.js";
7
7
  import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
8
8
  import { r as toast } from "./copy-TGGAUEWp.js";
9
- import { C as AccordionContent, D as ChatBubbleIcon, En as Trash2, Ft as jotaiJsonStorage, G as cellErrorsAtom, Ht as allTablesAtom, It as variablesAtom, Kt as getRequestClient, Lt as PluralWord, Nn as Info, Ot as moveToEndOfEditor, P as base64ToDataURL, Rn as CircleX, S as Accordion, T as AccordionTrigger, Tn as Wrench, Tt as createVariableInfoElement, Ut as dataSourceConnectionsAtom, V as renderHTML, Wt as getTableType, Xt as singleFacet, Y as notebookAtom, _ as Boosts, _n as atomWithStorage, b as AIContextProvider, c as Popover, d as PopoverTrigger, f as isOutputEmpty, h as DatasourceContextProvider, jn as LoaderCircle, n as MarkdownRenderer, on as CellOutputId, s as Spinner, t as toPng, tn as ZodLocalStorage, u as PopoverContent, v as Sections, vt as displayCellName, w as AccordionItem, x as AIContextRegistry, y as contextToXml, yn as Anchor2 } from "./html-to-image-hMMPiNe_.js";
9
+ import { C as AccordionContent, D as ChatBubbleIcon, En as Trash2, Ft as jotaiJsonStorage, G as cellErrorsAtom, Ht as allTablesAtom, It as variablesAtom, Kt as getRequestClient, Lt as PluralWord, Nn as Info, Ot as moveToEndOfEditor, P as base64ToDataURL, Rn as CircleX, S as Accordion, T as AccordionTrigger, Tn as Wrench, Tt as createVariableInfoElement, Ut as dataSourceConnectionsAtom, V as renderHTML, Wt as getTableType, Xt as singleFacet, Y as notebookAtom, _ as Boosts, _n as atomWithStorage, b as AIContextProvider, c as Popover, d as PopoverTrigger, f as isOutputEmpty, h as DatasourceContextProvider, jn as LoaderCircle, n as MarkdownRenderer, on as CellOutputId, s as Spinner, t as toPng, tn as ZodLocalStorage, u as PopoverContent, v as Sections, vt as displayCellName, w as AccordionItem, x as AIContextRegistry, y as contextToXml, yn as Anchor2 } from "./html-to-image-_jxGvsrc.js";
10
10
  import "./chunk-5FQGJX7Z-CO1e63h_.js";
11
11
  import { u as createLucideIcon } from "./dist-ESg7xyoD.js";
12
12
  import { F as X, S as logNever, t as Strings } from "./strings-B_FOH6eV.js";
13
13
  import { a as NumberField, b as DropdownMenuTrigger, d as DropdownMenuContent, p as DropdownMenuItem, r as Input, u as DropdownMenu } from "./input-BAOe64zx.js";
14
14
  import { v as CircleQuestionMark } from "./toDate-CHtl9vts.js";
15
- import { a as MarimoIncomingMessageEvent, d as File$1, n as blobToString, t as processOutput, u as deserializeBlob } from "./process-output-Bza_GK7Q.js";
15
+ import { a as MarimoIncomingMessageEvent, d as File$1, n as blobToString, t as processOutput, u as deserializeBlob } from "./process-output-ClDgSR3m.js";
16
16
  import "./react-dom-BWRJ_g_k.js";
17
17
  import { t as require_jsx_runtime } from "./jsx-runtime-COBk7ree.js";
18
18
  import { B as union, C as any, D as discriminatedUnion, E as custom, H as safeParseAsync, I as record, L as strictObject, M as never, N as number, O as lazy, P as object$1, R as string, S as _null, T as boolean, V as unknown, W as toJSONSchema, b as _enum, k as literal, w as array$1, x as _instanceof } from "./zod-BxdsqRPd.js";
@@ -6,7 +6,7 @@ import { _ as Logger, c as Objects, g as cn, h as Events, m as useComposedRefs,
6
6
  import { t as require_react } from "./react-DA-nE2FX.js";
7
7
  import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
8
8
  import { n as Copy, r as toast, t as copyToClipboard } from "./copy-TGGAUEWp.js";
9
- import { $ as useCellActions, $t as getTracebackInfo, A as ChevronRightIcon, An as Minus, Bn as Braces, C as AccordionContent, En as Trash2, Ft as jotaiJsonStorage, Hn as import_lib, I as base64ToUint8Array, Jt as useRequestClient, Kt as getRequestClient, Lt as PluralWord, M as PinLeftIcon, Mt as useChromeActions, N as PinRightIcon, O as CheckIcon, Pn as FileText, Pt as adaptForLocalStorage, Qt as extractAllTracebackInfo, R as extractBase64FromDataURL, Rn as CircleX, S as Accordion, St as Checkbox, T as AccordionTrigger, Tn as Wrench, V as renderHTML, Vn as esm_default, Y as notebookAtom, Zt as elementContainsMarimoCellFile, _n as atomWithStorage, _t as getCellDomProps, at as AnsiUp, bn as Close$1, c as Popover, cn as SCRATCH_CELL_ID, ct as kioskModeAtom, d as PopoverTrigger, dt as outputIsLoading, et as useCellIds, g as getDatasourceContext, gt as DATA_CELL_ID, hn as jsonToTSV, ht as sanitizeHtml, j as DotFilledIcon, jn as LoaderCircle, kn as NotebookPen, kt as goToCellLine, l as PopoverClose$1, lt as useInstallAllowed, m as useExpandedOutput, mn as jsonToMarkdown, n as MarkdownRenderer, nn as filenameAtom, on as CellOutputId, pn as jsonParseWithSpecialChar, q as getCellEditorView, s as Spinner, sn as HTMLCellId, t as toPng, tt as useCellNames, u as PopoverContent, ut as viewStateAtom, vt as displayCellName, w as AccordionItem, z as isDataURLString, zt as DATA_TYPE_ICON, __tla as __tla_0 } from "./html-to-image-hMMPiNe_.js";
9
+ import { $ as useCellActions, $t as getTracebackInfo, A as ChevronRightIcon, An as Minus, Bn as Braces, C as AccordionContent, En as Trash2, Ft as jotaiJsonStorage, Hn as import_lib, I as base64ToUint8Array, Jt as useRequestClient, Kt as getRequestClient, Lt as PluralWord, M as PinLeftIcon, Mt as useChromeActions, N as PinRightIcon, O as CheckIcon, Pn as FileText, Pt as adaptForLocalStorage, Qt as extractAllTracebackInfo, R as extractBase64FromDataURL, Rn as CircleX, S as Accordion, St as Checkbox, T as AccordionTrigger, Tn as Wrench, V as renderHTML, Vn as esm_default, Y as notebookAtom, Zt as elementContainsMarimoCellFile, _n as atomWithStorage, _t as getCellDomProps, at as AnsiUp, bn as Close$1, c as Popover, cn as SCRATCH_CELL_ID, ct as kioskModeAtom, d as PopoverTrigger, dt as outputIsLoading, et as useCellIds, g as getDatasourceContext, gt as DATA_CELL_ID, hn as jsonToTSV, ht as sanitizeHtml, j as DotFilledIcon, jn as LoaderCircle, kn as NotebookPen, kt as goToCellLine, l as PopoverClose$1, lt as useInstallAllowed, m as useExpandedOutput, mn as jsonToMarkdown, n as MarkdownRenderer, nn as filenameAtom, on as CellOutputId, pn as jsonParseWithSpecialChar, q as getCellEditorView, s as Spinner, sn as HTMLCellId, t as toPng, tt as useCellNames, u as PopoverContent, ut as viewStateAtom, vt as displayCellName, w as AccordionItem, z as isDataURLString, zt as DATA_TYPE_ICON, __tla as __tla_0 } from "./html-to-image-_jxGvsrc.js";
10
10
  import { o as useSize, u as createLucideIcon } from "./dist-ESg7xyoD.js";
11
11
  import { i as createReducerAndAtoms, r as Badge } from "./useLifecycle-CjMjllqy.js";
12
12
  import { a as ListFilter, i as Table$1, o as ChartPie, t as $896ba0a80a8f4d36$export$85fd5fdf27bacc79 } from "./useDateFormatter-B3mCQMP3.js";
@@ -25691,7 +25691,7 @@ ${_}`,
25691
25691
  return Logger.warn("Failed to get version from mount config"), null;
25692
25692
  }
25693
25693
  }
25694
- marimoVersionAtom = atom(getVersionFromMountConfig() || "0.23.7-dev7");
25694
+ marimoVersionAtom = atom(getVersionFromMountConfig() || "0.23.7-dev8");
25695
25695
  showCodeInRunModeAtom = atom(true);
25696
25696
  atom(null);
25697
25697
  var import_compiler_runtime = require_compiler_runtime();
@@ -20664,8 +20664,8 @@ ${n.sqlString}
20664
20664
  }), i;
20665
20665
  try {
20666
20666
  if (r.startsWith("data:")) {
20667
- let e2 = r.split(",")[1], n2 = prompt("We can save your image as a file. Enter a filename.", t.name), a2 = t.type.split("/")[1];
20668
- if (n2 === null) {
20667
+ let e2 = prompt("We can save your image as a file. Enter a filename.", t.name), n2 = t.type.split("/")[1];
20668
+ if (e2 === null) {
20669
20669
  let e3 = Math.round(r.length / 1024);
20670
20670
  if (e3 > MAX_BASE64_SIZE_KB) {
20671
20671
  toast({
@@ -20675,14 +20675,14 @@ ${n.sqlString}
20675
20675
  return;
20676
20676
  }
20677
20677
  } else {
20678
- n2.trim() === "" ? n2 = t.name : n2.endsWith(`.${a2}`) || (n2 = `${n2}.${a2}`);
20679
- let r2 = store.get(filenameAtom), o2 = r2 ? Paths.dirname(r2) : null, s = o2 ? `${o2}/public` : "public", c = await getRequestClient().sendCreateFileOrFolder({
20680
- path: s,
20678
+ e2.trim() === "" ? e2 = t.name : e2.endsWith(`.${n2}`) || (e2 = `${e2}.${n2}`);
20679
+ let r2 = store.get(filenameAtom), a2 = r2 ? Paths.dirname(r2) : null, o2 = a2 ? `${a2}/public` : "public", s = await getRequestClient().sendCreateFileOrFolder({
20680
+ path: o2,
20681
20681
  type: "file",
20682
- name: n2,
20683
- contents: e2
20682
+ name: e2,
20683
+ file: t
20684
20684
  });
20685
- c.success ? (i = (_a2 = c.info) == null ? void 0 : _a2.path, i && o2 && i.startsWith(o2) && (i = Paths.rest(i, o2).replaceAll("\\", "/")), toast({
20685
+ s.success ? (i = (_a2 = s.info) == null ? void 0 : _a2.path, i && a2 && i.startsWith(a2) && (i = Paths.rest(i, a2).replaceAll("\\", "/")), toast({
20686
20686
  title: "Image uploaded successfully",
20687
20687
  description: `We've uploaded your image at ${i}`
20688
20688
  })) : toast({
package/dist/main.js CHANGED
@@ -22,18 +22,18 @@ import { _ as Logger, c as Objects, g as cn, h as Events, i as NOT_SET, l as use
22
22
  import { t as require_react } from "./react-DA-nE2FX.js";
23
23
  import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
24
24
  import { n as Copy, r as toast, t as copyToClipboard } from "./copy-TGGAUEWp.js";
25
- import { $ as useCellActions, At as DeferredRequestRegistry, B as safeExtractSetUIElementMessageBuffers, Bn as Braces, Bt as getDataTypeColor, C as AccordionContent, Cn as Root2$1, Ct as customPythonLanguageSupport, Dn as Table2, Dt as Paths, E as BorderAllIcon, En as Trash2, Et as PathBuilder, F as base64ToDataView, Fn as Eye, Ft as jotaiJsonStorage, Gt as convertStatsName, H as getMarimoExportContext, In as Database, J as getCellNames, Jt as useRequestClient, K as createActions, Kt as getRequestClient, L as dataViewToBase64, Ln as Columns2, Mn as Layers, Nn as Info, Nt as repl, On as PaintRoller, Pn as FileText, Q as reducer, Rt as PluralWords, S as Accordion, Sn as Item$1, St as Checkbox, T as AccordionTrigger, U as hasTrustedExportContext, V as renderHTML, Vt as require_client, W as hasRunAnyCellAtom, X as notebookOutline, Y as notebookAtom, Yt as isUninstantiated, Z as numColumnsAtom, _n as atomWithStorage, a as useLastFocusedCellId, an as parseInitialValue, bt as isInternalCellName, ct as kioskModeAtom, dn as OBJECT_ID_ATTR, dt as outputIsLoading, en as NotebookScopedLocalStorage, et as useCellIds, f as isOutputEmpty, fn as RANDOM_ID_ATTR, ft as outputIsStale, gn as atomWithReducer, i as useCellFocusActions, in as parseDataset, jn as LoaderCircle, jt as generateUUID, k as ChevronDownIcon, ln as UIElementId, mt as headingToIdentifier, nt as createCell, o as maybeAddAltairImport, ot as getInitialAppMode, p as useExpandedConsoleOutput, pn as jsonParseWithSpecialChar, pt as isErrorMime, qt as requestClientAtom, r as LazyAnyLanguageCodeMirror, rn as parseAttrValue, s as Spinner, sn as HTMLCellId, st as initialModeAtom, un as findCellId, vn as selectAtom, w as AccordionItem, wn as Trigger2, wt as MarkdownLanguageAdapter, xn as Content2, xt as normalizeName, yt as getValidName, zn as CircleAlert, zt as DATA_TYPE_ICON, __tla as __tla_0 } from "./html-to-image-hMMPiNe_.js";
25
+ import { $ as useCellActions, At as DeferredRequestRegistry, B as safeExtractSetUIElementMessageBuffers, Bn as Braces, Bt as getDataTypeColor, C as AccordionContent, Cn as Root2$1, Ct as customPythonLanguageSupport, Dn as Table2, Dt as Paths, E as BorderAllIcon, En as Trash2, Et as PathBuilder, F as base64ToDataView, Fn as Eye, Ft as jotaiJsonStorage, Gt as convertStatsName, H as getMarimoExportContext, In as Database, J as getCellNames, Jt as useRequestClient, K as createActions, Kt as getRequestClient, L as dataViewToBase64, Ln as Columns2, Mn as Layers, Nn as Info, Nt as repl, On as PaintRoller, Pn as FileText, Q as reducer, Rt as PluralWords, S as Accordion, Sn as Item$1, St as Checkbox, T as AccordionTrigger, U as hasTrustedExportContext, V as renderHTML, Vt as require_client, W as hasRunAnyCellAtom, X as notebookOutline, Y as notebookAtom, Yt as isUninstantiated, Z as numColumnsAtom, _n as atomWithStorage, a as useLastFocusedCellId, an as parseInitialValue, bt as isInternalCellName, ct as kioskModeAtom, dn as OBJECT_ID_ATTR, dt as outputIsLoading, en as NotebookScopedLocalStorage, et as useCellIds, f as isOutputEmpty, fn as RANDOM_ID_ATTR, ft as outputIsStale, gn as atomWithReducer, i as useCellFocusActions, in as parseDataset, jn as LoaderCircle, jt as generateUUID, k as ChevronDownIcon, ln as UIElementId, mt as headingToIdentifier, nt as createCell, o as maybeAddAltairImport, ot as getInitialAppMode, p as useExpandedConsoleOutput, pn as jsonParseWithSpecialChar, pt as isErrorMime, qt as requestClientAtom, r as LazyAnyLanguageCodeMirror, rn as parseAttrValue, s as Spinner, sn as HTMLCellId, st as initialModeAtom, un as findCellId, vn as selectAtom, w as AccordionItem, wn as Trigger2, wt as MarkdownLanguageAdapter, xn as Content2, xt as normalizeName, yt as getValidName, zn as CircleAlert, zt as DATA_TYPE_ICON, __tla as __tla_0 } from "./html-to-image-_jxGvsrc.js";
26
26
  import { __tla as __tla_1 } from "./chunk-5FQGJX7Z-CO1e63h_.js";
27
27
  import { o as useSize, s as Root$2, u as createLucideIcon } from "./dist-ESg7xyoD.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-DSIuqd3f.js";
29
- import { $ as filtersToFilterGroup, A as contextAwarePanelOwner, At as Funnel, B as TableCell, Bt as ChevronLeft, C as prettifyRowCount, Ct as useOverflowDetection, D as ContextAwarePanelItem, Dt as EmotionCacheProvider, E as ComboboxItem, Et as HtmlOutput, F as Toggle, Ft as Code, G as generateColumns, H as TableHeader, I as Fill, It as ChevronsUpDown, J as ColumnChartContext, K as inferFieldTypes, L as Provider$1, Lt as ChevronsRight, M as isCellAwareAtom, N as SlotNames, Nt as Ellipsis, O as PANEL_TYPES, Ot as TextWrap, P as slotsController, Pt as Download, Q as usePrevious$1, R as Table, Rt as ChevronsLeft, S as prettifyRowColumnCount, St as LazyVegaEmbed, T as Combobox, Tt as Kbd, U as TableRow, V as TableHead, Vt as ArrowDownWideNarrow, W as NAMELESS_COLUMN_PREFIX, X as DelayMount, Y as ColumnChartSpecModel, Z as useIntersectionObserver, _ as downloadBlob, _t as TabsList, at as TOO_MANY_ROWS, b as Progress, bt as ChartInfoState, c as Slide, ct as Command, d as JsonOutput, dt as CommandItem, et as getPageIndexForRow, f as OutputArea, ft as CommandList, g as ADD_PRINTING_CLASS, gt as TabsContent, h as InstallPackageButton, ht as Tabs, it as SELECT_COLUMN_ID, j as contextAwarePanelType, jt as EyeOff, k as contextAwarePanelOpen, kt as GripHorizontal, l as RadioGroup, lt as CommandEmpty, m as DataTable, mt as Maps, n as marimoVersionAtom, nt as loadTableData, o as SLIDE_TYPE_OPTIONS_BY_VALUE, ot as toFieldTypes, p as OutputRenderer, pt as CommandSeparator, q as renderCellValue, r as showCodeInRunModeAtom, rt as INDEX_COLUMN_NAME, st as getMimeValues, t as useNotebookCodeAvailable, tt as loadTableAndRawData, u as RadioGroupItem, ut as CommandInput, v as downloadByURL, vt as TabsTrigger, w as useInternalStateWithSync, wt as RenderTextWithLinks, x as Filenames, xt as ChartLoadingState, y as downloadHTMLAsImage, yt as ChartErrorState, z as TableBody, zt as ChevronsDownUp, __tla as __tla_2 } from "./code-visibility-CiN3Xnfo.js";
29
+ import { $ as filtersToFilterGroup, A as contextAwarePanelOwner, At as Funnel, B as TableCell, Bt as ChevronLeft, C as prettifyRowCount, Ct as useOverflowDetection, D as ContextAwarePanelItem, Dt as EmotionCacheProvider, E as ComboboxItem, Et as HtmlOutput, F as Toggle, Ft as Code, G as generateColumns, H as TableHeader, I as Fill, It as ChevronsUpDown, J as ColumnChartContext, K as inferFieldTypes, L as Provider$1, Lt as ChevronsRight, M as isCellAwareAtom, N as SlotNames, Nt as Ellipsis, O as PANEL_TYPES, Ot as TextWrap, P as slotsController, Pt as Download, Q as usePrevious$1, R as Table, Rt as ChevronsLeft, S as prettifyRowColumnCount, St as LazyVegaEmbed, T as Combobox, Tt as Kbd, U as TableRow, V as TableHead, Vt as ArrowDownWideNarrow, W as NAMELESS_COLUMN_PREFIX, X as DelayMount, Y as ColumnChartSpecModel, Z as useIntersectionObserver, _ as downloadBlob, _t as TabsList, at as TOO_MANY_ROWS, b as Progress, bt as ChartInfoState, c as Slide, ct as Command, d as JsonOutput, dt as CommandItem, et as getPageIndexForRow, f as OutputArea, ft as CommandList, g as ADD_PRINTING_CLASS, gt as TabsContent, h as InstallPackageButton, ht as Tabs, it as SELECT_COLUMN_ID, j as contextAwarePanelType, jt as EyeOff, k as contextAwarePanelOpen, kt as GripHorizontal, l as RadioGroup, lt as CommandEmpty, m as DataTable, mt as Maps, n as marimoVersionAtom, nt as loadTableData, o as SLIDE_TYPE_OPTIONS_BY_VALUE, ot as toFieldTypes, p as OutputRenderer, pt as CommandSeparator, q as renderCellValue, r as showCodeInRunModeAtom, rt as INDEX_COLUMN_NAME, st as getMimeValues, t as useNotebookCodeAvailable, tt as loadTableAndRawData, u as RadioGroupItem, ut as CommandInput, v as downloadByURL, vt as TabsTrigger, w as useInternalStateWithSync, wt as RenderTextWithLinks, x as Filenames, xt as ChartLoadingState, y as downloadHTMLAsImage, yt as ChartErrorState, z as TableBody, zt as ChevronsDownUp, __tla as __tla_2 } from "./code-visibility-i-wZHH96.js";
30
30
  import { c as Calendar, i as createReducerAndAtoms, n as useOnUnmount, o as ToggleLeft, t as useOnMount } from "./useLifecycle-CjMjllqy.js";
31
31
  import { n as $fb18d541ea1ad717$export$ad991b66133851cf, r as $5a387cc49350e6db$export$722debc0e56fea39, t as $896ba0a80a8f4d36$export$85fd5fdf27bacc79 } from "./useDateFormatter-B3mCQMP3.js";
32
32
  import { t as Check } from "./check-CFM2mVDr.js";
33
33
  import { A as Trigger$1, C as $a916eb452884faea$export$b7a616150fdb9f44, D as $b5e257d569688ac6$export$535bd6ca7f90a273, E as $18f2051aff69b9bf$export$a54013f0d02a8f82, F as X, L as ChevronDown, M as usePrevious$2, N as useDirection, P as createCollection, S as logNever, T as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7, a as SelectGroup, c as SelectSeparator, d as NativeSelect, f as selectStyles, i as SelectContent, j as clamp$2, k as Icon, l as SelectTrigger, n as capitalize, o as SelectItem, r as Select, s as SelectLabel, t as Strings, u as SelectValue, w as $488c6ddbf4ef74c2$export$cc77c4ff7e8673c5, x as assertNever } from "./strings-B_FOH6eV.js";
34
34
  import { $ as $e5be200c675c3b3a$export$aca958c65c314e6c, A as $d2b4bc8c273e7be6$export$24d547caef80ccd1, At as $c87311424ea30a05$export$fedb369cb70207f1, B as $64fa3d84918910a7$export$c62b8e45d58ddad9, Bt as $431fbd86ca7dc216$export$f21a1ffae260145a, C as $a049562f99e7db0e$export$eb2fcfdbd7ba97d4, Ct as $8ae05eaa5c114e9c$export$7f54fc3180508a52, D as $ee014567cb39d3f0$export$ff05c3ac10437e03, Dt as $c87311424ea30a05$export$78551043582a6a98, E as $ee014567cb39d3f0$export$f551688fc98f2e09, Et as $c87311424ea30a05$export$6446a186d09e379e, F as $64fa3d84918910a7$export$2881499e37b75b9a, Ft as $d4ee10de306f2510$export$b4f377a2b6254582, H as $64fa3d84918910a7$export$ef03459518577ad4, Ht as $bdb11010cef70236$export$b4cc09c592e8fdb8, I as $64fa3d84918910a7$export$29f1550f4b0d4415, It as $d4ee10de306f2510$export$cd4e5573fbe2b576, J as $d2e8511e6f209edf$export$e908e06f4b8e3402, K as useDebounceControlledState, L as $64fa3d84918910a7$export$4d86445c2cf5e3, Lt as $d4ee10de306f2510$export$e58f029f0fbfdb29, M as $01b77f81d0f07f68$export$75b6ee27786ba447, Mt as $65484d02dcb7eb3e$export$457c3d6518dd4c6f, N as $01b77f81d0f07f68$export$b04be29aa201d4f5, Nt as $3ef42575df84b30b$export$9d1611c77c2fe928, O as $514c0188e459b4c0$export$5f1af8db9871e1d6, Ot as $c87311424ea30a05$export$9ac100e40613ea10, P as $f39a9eba43920ace$export$b5d7cc18bb8d2b59, Pt as $d4ee10de306f2510$export$4282f70798064fe0, Q as $e5be200c675c3b3a$export$a763b9476acd3eb, R as $64fa3d84918910a7$export$9d4c57ee4c6ffdd8, Rt as $f4e2df6bd15f8569$export$98658e8c59125e6a, S as $3985021b0ad6602f$export$f5b8910cec6cf069, St as $e9faafb641e167db$export$90fc3a17d93f704c, T as $d3e0e05bdfcf66bd$export$c24727297075ec6a, Tt as $313b98861ee5dd6c$export$d6875122194c7b44, U as $64fa3d84918910a7$export$fabf2dc03a41866e, Ut as $bdb11010cef70236$export$f680877a34711e37, V as $64fa3d84918910a7$export$df3a06d6289f983e, Vt as $ff5963eb1fccf552$export$e08e3b67e392101e, Wt as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, X as $e93e671b31057976$export$b8473d3665f3a75a, Y as $2baaea4c71418dea$export$294aa081a6c6f55d, Z as $e5be200c675c3b3a$export$75ee7c75d68f5b0e, _t as $9446cca9a3875146$export$7d15b64cf5a3a4c4, a as NumberField, at as $6c7bd7858deea686$export$cd11ab140839f11d, b as DropdownMenuTrigger, bt as $b4b717babfbb907b$export$bebd5a1431fec25d, c as prettyNumber, ct as $6db58dc88e78b024$export$2f817fcdc4b89ae0, d as DropdownMenuContent, dt as $9ab94262bd0047c7$export$420e68273165f4ec, et as $e5be200c675c3b3a$export$dad6ae84456c676a, f as DropdownMenuGroup, fn as Circle, ft as $3ad3f6e1647bc98d$export$80f3e147d781571c, g as DropdownMenuSeparator, gt as $ae1eeba8b9eafd08$export$5165eccb35aaadb5, ht as _class_private_field_init, i as OnBlurredInput, it as $701a24aa0da5b062$export$ea18c227d4417cc3, j as $d2b4bc8c273e7be6$export$353f5b6fc5456de1, jt as $7215afc6de606d6b$export$de79e2c695e052f3, k as $514c0188e459b4c0$export$9afb8bc826b033ea, kt as $c87311424ea30a05$export$a11b0059900ceec8, l as prettyScientificNumber, lt as $5b160d28a433310d$export$c17fa47878dc55b6, m as DropdownMenuLabel, mt as $f6c31cce2adf654f$export$45712eceda6fad21, n as DebouncedNumberInput, nt as $319e236875307eab$export$a9b970dcc4ae71a9, ot as $fca6afa0e843324b$export$87b761675e8eaa10, p as DropdownMenuItem, pn as ChevronRight, pt as $507fabe10e71c6fb$export$630ff653c5ada6a9, q as useDebouncedCallback, r as Input, rt as $f7dceffc5ad7768b$export$4e328f61c538687f, st as $fca6afa0e843324b$export$f12b703ca79dfbb1, t as DebouncedInput, tt as $e5be200c675c3b3a$export$fc1a364ae1f3ff10, u as DropdownMenu, ut as $6179b936705e76d3$export$ae780daf29e6d456, vt as $458b0a5536c1a7cf$export$40bfa8c7b0832715, w as $a049562f99e7db0e$export$f9c6924e160136d1, wt as $df56164dff5785e2$export$4338b53315abf666, x as $3985021b0ad6602f$export$37fb8590cf2c088c, xt as $99facab73266f662$export$5add1d006293d136, yt as $b4b717babfbb907b$export$4c063cf1350e6fed, z as $64fa3d84918910a7$export$c245e6201fed2f75, zt as $431fbd86ca7dc216$export$b204af158042fbac } from "./input-BAOe64zx.js";
35
35
  import { _ as isWasm, c as asRemoteURL, d as isStaticNotebook, f as appendQueryParams, g as Deferred, m as require_cuid2, u as getStaticVirtualFiles, v as CircleQuestionMark } from "./toDate-CHtl9vts.js";
36
- import { a as MarimoIncomingMessageEvent, c as MarimoValueUpdateEvent, d as File, i as PythonIcon, l as createInputEvent, n as blobToString, o as MarimoValueInputEvent, r as filesToBase64, s as MarimoValueReadyEvent, t as processOutput, u as deserializeBlob } from "./process-output-Bza_GK7Q.js";
36
+ import { a as MarimoIncomingMessageEvent, c as MarimoValueUpdateEvent, d as File, i as PythonIcon, l as createInputEvent, n as blobToString, o as MarimoValueInputEvent, r as filesToBase64, s as MarimoValueReadyEvent, t as processOutput, u as deserializeBlob } from "./process-output-ClDgSR3m.js";
37
37
  import { i as Pencil, n as Trash, r as Plus, t as BulkEdit } from "./types-DBtDeUKD.js";
38
38
  import { t as require_react_dom } from "./react-dom-BWRJ_g_k.js";
39
39
  import { t as require_jsx_runtime } from "./jsx-runtime-COBk7ree.js";
@@ -13569,7 +13569,7 @@ let __tla = Promise.all([
13569
13569
  };
13570
13570
  }
13571
13571
  };
13572
- var LazyChatbot = import_react.lazy(() => import("./chat-ui-B-gbqk_F.js").then((e) => ({
13572
+ var LazyChatbot = import_react.lazy(() => import("./chat-ui-D8SqlFay.js").then((e) => ({
13573
13573
  default: e.Chatbot
13574
13574
  }))), messageSchema = array(object({
13575
13575
  id: string(),
@@ -44576,7 +44576,7 @@ ${c}
44576
44576
  if (l && l !== "slide") return l;
44577
44577
  if (c == null ? void 0 : c.has(e)) return "skip";
44578
44578
  }
44579
- var LazySlidesComponent = import_react.lazy(() => import("./reveal-component-BCKa3sr-.js"));
44579
+ var LazySlidesComponent = import_react.lazy(() => import("./reveal-component-DisX89FD.js"));
44580
44580
  const SlidesLayoutPlugin = {
44581
44581
  type: "slides",
44582
44582
  name: "Slides",
@@ -1,6 +1,6 @@
1
1
  import { s as __toESM } from "./chunk-BNovOVIE.js";
2
2
  import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
3
- import { it as parseHtmlContent, rt as ansiToPlainText } from "./html-to-image-hMMPiNe_.js";
3
+ import { it as parseHtmlContent, rt as ansiToPlainText } from "./html-to-image-_jxGvsrc.js";
4
4
  import { u as createLucideIcon } from "./dist-ESg7xyoD.js";
5
5
  import { t as Strings } from "./strings-B_FOH6eV.js";
6
6
  import { t as require_jsx_runtime } from "./jsx-runtime-COBk7ree.js";
@@ -6,9 +6,9 @@ import { s as __toESM } from "./chunk-BNovOVIE.js";
6
6
  import { _ as Logger, g as cn, h as Events, l as useEventListener, t as Button } from "./button-CA5pI2YF.js";
7
7
  import { t as require_react } from "./react-DA-nE2FX.js";
8
8
  import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
9
- import "./html-to-image-hMMPiNe_.js";
9
+ import "./html-to-image-_jxGvsrc.js";
10
10
  import "./chunk-5FQGJX7Z-CO1e63h_.js";
11
- import { Ft as Code, Mt as Expand, a as DEFAULT_SLIDE_TYPE, c as Slide, i as DEFAULT_DECK_TRANSITION, jt as EyeOff, s as SlideSidebar, t as useNotebookCodeAvailable } from "./code-visibility-CiN3Xnfo.js";
11
+ import { Ft as Code, Mt as Expand, a as DEFAULT_SLIDE_TYPE, c as Slide, i as DEFAULT_DECK_TRANSITION, jt as EyeOff, s as SlideSidebar, t as useNotebookCodeAvailable } from "./code-visibility-i-wZHH96.js";
12
12
  import "./input-BAOe64zx.js";
13
13
  import "./toDate-CHtl9vts.js";
14
14
  import "./react-dom-BWRJ_g_k.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/islands",
3
- "version": "0.23.7-dev7",
3
+ "version": "0.23.7-dev8",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -3,7 +3,6 @@
3
3
  import { type DropzoneOptions, useDropzone } from "react-dropzone";
4
4
  import { toast } from "@/components/ui/use-toast";
5
5
  import { useRequestClient } from "@/core/network/requests";
6
- import { serializeBlob } from "@/utils/blob";
7
6
  import { withLoadingToast } from "@/utils/download";
8
7
  import { Logger } from "@/utils/Logger";
9
8
  import { type FilePath, PathBuilder } from "@/utils/paths";
@@ -69,17 +68,11 @@ export function useFileExplorerUpload(options: DropzoneOptions = {}) {
69
68
  PathBuilder.guessDeliminator(filePath).dirname(filePath);
70
69
  }
71
70
 
72
- // File contents are sent base64-encoded to support arbitrary
73
- // bytes data
74
- //
75
- // get the raw base64-encoded data from a string starting with
76
- // data:*/*;base64,
77
- const base64 = (await serializeBlob(file)).split(",")[1];
78
71
  await sendCreateFileOrFolder({
79
72
  path: directoryPath,
80
73
  type: "file",
81
74
  name: file.name,
82
- contents: base64,
75
+ file,
83
76
  });
84
77
  progress.increment(1);
85
78
  }
@@ -246,7 +246,7 @@ describe("insertImage", () => {
246
246
  path: "public",
247
247
  type: "file",
248
248
  name: "hello.png",
249
- contents: "AQID",
249
+ file: expect.any(File),
250
250
  });
251
251
 
252
252
  expect(view.state.doc.toString()).toMatchInlineSnapshot(
@@ -291,7 +291,7 @@ describe("insertImage", () => {
291
291
  path: "nested/public", // store in public folder of notebook directory
292
292
  type: "file",
293
293
  name: "hello.png",
294
- contents: "AQID",
294
+ file: expect.any(File),
295
295
  });
296
296
 
297
297
  expect(view.state.doc.toString()).toMatchInlineSnapshot(
@@ -337,7 +337,7 @@ describe("insertImage", () => {
337
337
  path: "/Users/user/Development/project/public",
338
338
  type: "file",
339
339
  name: "hello.png",
340
- contents: "AQID",
340
+ file: expect.any(File),
341
341
  });
342
342
 
343
343
  // Should convert absolute path to relative path
@@ -313,7 +313,6 @@ export async function insertImage(view: EditorView, file: File) {
313
313
  // If the file is base64 encoded, we can save it locally to prevent large file strings
314
314
  try {
315
315
  if (dataUrl.startsWith("data:")) {
316
- const base64 = dataUrl.split(",")[1];
317
316
  let inputFilename = prompt(
318
317
  "We can save your image as a file. Enter a filename.",
319
318
  file.name,
@@ -348,7 +347,7 @@ export async function insertImage(view: EditorView, file: File) {
348
347
  path: publicFolderPath as FilePath,
349
348
  type: "file",
350
349
  name: inputFilename,
351
- contents: base64,
350
+ file,
352
351
  });
353
352
 
354
353
  if (createFileRes.success) {
@@ -6,6 +6,19 @@ import { API, createClientWithRuntimeManager } from "./api";
6
6
  import { waitForConnectionOpen } from "./connection";
7
7
  import type { EditRequests, RunRequests } from "./types";
8
8
 
9
+ /**
10
+ * Options for POSTing FormData via openapi-fetch. openapi-fetch types
11
+ * request bodies from the JSON schema, so we bypass the body type and
12
+ * override the serializer to pass the FormData through unchanged; the
13
+ * browser then sets the multipart Content-Type with boundary.
14
+ */
15
+ function multipartInit(formData: FormData) {
16
+ return {
17
+ body: formData as never,
18
+ bodySerializer: (body: unknown) => body as never,
19
+ };
20
+ }
21
+
9
22
  const { handleResponse, handleResponseReturnNull } = API;
10
23
 
11
24
  export function createNetworkRequests(): EditRequests & RunRequests {
@@ -298,10 +311,15 @@ export function createNetworkRequests(): EditRequests & RunRequests {
298
311
  },
299
312
  sendCreateFileOrFolder: async (request) => {
300
313
  await waitForConnectionOpen();
314
+ const formData = new FormData();
315
+ formData.append("path", request.path);
316
+ formData.append("type", request.type);
317
+ formData.append("name", request.name);
318
+ if (request.file) {
319
+ formData.append("file", request.file, request.name);
320
+ }
301
321
  return getClient()
302
- .POST("/api/files/create", {
303
- body: request,
304
- })
322
+ .POST("/api/files/create", multipartInit(formData))
305
323
  .then(handleResponse);
306
324
  },
307
325
  sendDeleteFileOrFolder: async (request) => {
@@ -80,6 +80,17 @@ export type SaveUserConfigurationRequest =
80
80
  export interface SetCellConfigRequest {
81
81
  configs: Record<CellId, Partial<CellConfig>>;
82
82
  }
83
+ /**
84
+ * Client-side shape for creating a file/directory/notebook. The HTTP
85
+ * transport sends this as multipart/form-data; the WASM bridge base64-encodes
86
+ * `file` internally and crosses the JS<->Py boundary as JSON.
87
+ */
88
+ export interface FileCreateInput {
89
+ path: string;
90
+ type: "file" | "directory" | "notebook";
91
+ name: string;
92
+ file?: Blob;
93
+ }
83
94
  export type UpdateUIElementRequest = schemas["UpdateUIElementRequest"];
84
95
  export type ModelRequest = schemas["ModelRequest"];
85
96
  export type NotebookDocumentTransactionRequest =
@@ -165,7 +176,7 @@ export interface EditRequests {
165
176
  sendListFiles: (request: FileListRequest) => Promise<FileListResponse>;
166
177
  sendSearchFiles: (request: FileSearchRequest) => Promise<FileSearchResponse>;
167
178
  sendCreateFileOrFolder: (
168
- request: FileCreateRequest,
179
+ request: FileCreateInput,
169
180
  ) => Promise<FileCreateResponse>;
170
181
  sendDeleteFileOrFolder: (
171
182
  request: FileDeleteRequest,
@@ -3,6 +3,7 @@
3
3
 
4
4
  import { toast } from "@/components/ui/use-toast";
5
5
  import { userConfigAtom } from "@/core/config/config";
6
+ import { serializeBlob } from "@/utils/blob";
6
7
  import { Deferred } from "@/utils/Deferred";
7
8
  import { throwNotImplemented } from "@/utils/functions";
8
9
  import { Logger } from "@/utils/Logger";
@@ -431,9 +432,21 @@ export class PyodideBridge implements RunRequests, EditRequests {
431
432
  sendCreateFileOrFolder: EditRequests["sendCreateFileOrFolder"] = async (
432
433
  request,
433
434
  ) => {
435
+ // The WASM RPC boundary can only carry JSON, so we base64-encode the
436
+ // file bytes here. The HTTP transport uses multipart/form-data instead.
437
+ let contents: string | null = null;
438
+ if (request.file) {
439
+ const dataUrl = await serializeBlob(request.file);
440
+ contents = dataUrl.split(",")[1] ?? "";
441
+ }
434
442
  const response = await this.rpc.proxy.request.bridge({
435
443
  functionName: "create_file_or_directory",
436
- payload: request,
444
+ payload: {
445
+ path: request.path,
446
+ type: request.type,
447
+ name: request.name,
448
+ contents,
449
+ },
437
450
  });
438
451
  return response as FileCreateResponse;
439
452
  };