@marimo-team/islands 0.23.10-dev16 → 0.23.10-dev17
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/{code-visibility-hyWa1mOg.js → code-visibility-D80f1Ibv.js} +1 -1
- package/dist/main.js +2 -2
- package/dist/{reveal-component-DMJJplJ7.js → reveal-component-mUdfwXMF.js} +1 -1
- package/package.json +1 -1
- package/src/components/storage/__tests__/storage-inspector.test.ts +55 -0
- package/src/components/storage/storage-inspector.tsx +55 -29
|
@@ -35274,7 +35274,7 @@ ${d}`,
|
|
|
35274
35274
|
return Logger.warn("Failed to get version from mount config"), null;
|
|
35275
35275
|
}
|
|
35276
35276
|
}
|
|
35277
|
-
marimoVersionAtom = atom(getVersionFromMountConfig() || "0.23.10-
|
|
35277
|
+
marimoVersionAtom = atom(getVersionFromMountConfig() || "0.23.10-dev17");
|
|
35278
35278
|
showCodeInRunModeAtom = atom(true);
|
|
35279
35279
|
atom(null);
|
|
35280
35280
|
var import_compiler_runtime = require_compiler_runtime();
|
package/dist/main.js
CHANGED
|
@@ -26,7 +26,7 @@ import { $ as useCellActions, An as LoaderCircle, At as DeferredRequestRegistry,
|
|
|
26
26
|
import { __tla as __tla_1 } from "./chunk-5FQGJX7Z-BNjes6Yx.js";
|
|
27
27
|
import { o as useSize, s as Root$2, u as createLucideIcon } from "./dist-C1BYNeCR.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-B96zNUEA.js";
|
|
29
|
-
import { $ as TableBody, $t as ChevronLeft, A as ComboboxItem, At as ChartErrorState, B as contextAwarePanelOpen, Bt as $fae977aafc393c5c$export$6b862160d295c8e, C as prettifyRowColumnCount, Ct as dateToLocalISODate, D as DatePicker, Dt as TabsContent, E as useInternalStateWithSync, Et as Tabs, F as CommandList, Ft as RenderTextWithLinks, G as slotsController, H as contextAwarePanelType, Ht as GripHorizontal, I as CommandSeparator, It as Kbd, Jt as Code, K as Toggle, Kt as Ellipsis, L as smartMatch, Lt as HtmlOutput, M as CommandEmpty, Mt as ChartLoadingState, N as CommandInput, Nt as LazyVegaEmbed, O as DateRangePicker, Ot as TabsList, P as CommandItem, Pt as useOverflowDetection, Q as Table, Qt as ChevronsDownUp, R as ContextAwarePanelItem, Rt as EmotionCacheProvider, S as downloadSizeLimitAtom, St as Maps, T as getColumnCountForDisplay, Tt as dateToLocalISOTime, U as isCellAwareAtom, Ut as Funnel, V as contextAwarePanelOwner, Vt as TextWrap, W as SlotNames, Wt as EyeOff, X as Fill, Xt as ChevronsRight, Yt as ChevronsUpDown, Z as Provider$1, Zt as ChevronsLeft, _ as downloadBlob, _t as SELECT_COLUMN_ID, at as generateColumns, b as Progress, bt as getMimeValues, c as Slide, ct as ColumnChartContext, d as JsonOutput, dt as useIntersectionObserver, en as ArrowDownWideNarrow, et as TableCell, f as OutputArea, ft as usePrevious$1, g as ADD_PRINTING_CLASS, gt as INDEX_COLUMN_NAME, h as InstallPackageButton, ht as loadTableData, it as NAMELESS_COLUMN_PREFIX, j as Command, jt as ChartInfoState, k as Combobox, kt as TabsTrigger, l as RadioGroup, lt as ColumnChartSpecModel, m as DataTable, mt as loadTableAndRawData, n as marimoVersionAtom, nt as TableHeader, o as SLIDE_TYPE_OPTIONS_BY_VALUE, ot as inferFieldTypes, p as OutputRenderer, pt as getPageIndexForRow, qt as Download, r as showCodeInRunModeAtom, rt as TableRow, st as renderCellValue, t as useNotebookCodeAvailable, tt as TableHead, u as RadioGroupItem, ut as DelayMount, v as downloadByURL, vt as TOO_MANY_ROWS, w as prettifyRowCount, wt as dateToLocalISODateTime, x as Filenames, xt as isNullishFilter, y as downloadHTMLAsImage, yt as toFieldTypes, z as PANEL_TYPES, zt as $fae977aafc393c5c$export$588937bcd60ade55, __tla as __tla_2 } from "./code-visibility-
|
|
29
|
+
import { $ as TableBody, $t as ChevronLeft, A as ComboboxItem, At as ChartErrorState, B as contextAwarePanelOpen, Bt as $fae977aafc393c5c$export$6b862160d295c8e, C as prettifyRowColumnCount, Ct as dateToLocalISODate, D as DatePicker, Dt as TabsContent, E as useInternalStateWithSync, Et as Tabs, F as CommandList, Ft as RenderTextWithLinks, G as slotsController, H as contextAwarePanelType, Ht as GripHorizontal, I as CommandSeparator, It as Kbd, Jt as Code, K as Toggle, Kt as Ellipsis, L as smartMatch, Lt as HtmlOutput, M as CommandEmpty, Mt as ChartLoadingState, N as CommandInput, Nt as LazyVegaEmbed, O as DateRangePicker, Ot as TabsList, P as CommandItem, Pt as useOverflowDetection, Q as Table, Qt as ChevronsDownUp, R as ContextAwarePanelItem, Rt as EmotionCacheProvider, S as downloadSizeLimitAtom, St as Maps, T as getColumnCountForDisplay, Tt as dateToLocalISOTime, U as isCellAwareAtom, Ut as Funnel, V as contextAwarePanelOwner, Vt as TextWrap, W as SlotNames, Wt as EyeOff, X as Fill, Xt as ChevronsRight, Yt as ChevronsUpDown, Z as Provider$1, Zt as ChevronsLeft, _ as downloadBlob, _t as SELECT_COLUMN_ID, at as generateColumns, b as Progress, bt as getMimeValues, c as Slide, ct as ColumnChartContext, d as JsonOutput, dt as useIntersectionObserver, en as ArrowDownWideNarrow, et as TableCell, f as OutputArea, ft as usePrevious$1, g as ADD_PRINTING_CLASS, gt as INDEX_COLUMN_NAME, h as InstallPackageButton, ht as loadTableData, it as NAMELESS_COLUMN_PREFIX, j as Command, jt as ChartInfoState, k as Combobox, kt as TabsTrigger, l as RadioGroup, lt as ColumnChartSpecModel, m as DataTable, mt as loadTableAndRawData, n as marimoVersionAtom, nt as TableHeader, o as SLIDE_TYPE_OPTIONS_BY_VALUE, ot as inferFieldTypes, p as OutputRenderer, pt as getPageIndexForRow, qt as Download, r as showCodeInRunModeAtom, rt as TableRow, st as renderCellValue, t as useNotebookCodeAvailable, tt as TableHead, u as RadioGroupItem, ut as DelayMount, v as downloadByURL, vt as TOO_MANY_ROWS, w as prettifyRowCount, wt as dateToLocalISODateTime, x as Filenames, xt as isNullishFilter, y as downloadHTMLAsImage, yt as toFieldTypes, z as PANEL_TYPES, zt as $fae977aafc393c5c$export$588937bcd60ade55, __tla as __tla_2 } from "./code-visibility-D80f1Ibv.js";
|
|
30
30
|
import { c as Calendar, i as createReducerAndAtoms, n as useOnUnmount, o as ToggleLeft, t as useOnMount } from "./useLifecycle-BBO9PIph.js";
|
|
31
31
|
import { t as Check } from "./check-DTbrK0zt.js";
|
|
32
32
|
import { A as Trigger$1, C as $a916eb452884faea$export$b7a616150fdb9f44, 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, 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, x as assertNever } from "./strings-Bu3vlb6W.js";
|
|
@@ -36116,7 +36116,7 @@ ${c}
|
|
|
36116
36116
|
if (l && l !== "slide") return l;
|
|
36117
36117
|
if (c == null ? void 0 : c.has(e)) return "skip";
|
|
36118
36118
|
}
|
|
36119
|
-
var LazySlidesComponent = import_react.lazy(() => import("./reveal-component-
|
|
36119
|
+
var LazySlidesComponent = import_react.lazy(() => import("./reveal-component-mUdfwXMF.js"));
|
|
36120
36120
|
const SlidesLayoutRenderer = ({ layout: e, setLayout: r, cells: c, mode: l }) => {
|
|
36121
36121
|
var _a3;
|
|
36122
36122
|
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 { ct as kioskModeAtom } from "./html-to-image-BqJ4c852.js";
|
|
10
10
|
import "./chunk-5FQGJX7Z-BNjes6Yx.js";
|
|
11
11
|
import { u as createLucideIcon } from "./dist-C1BYNeCR.js";
|
|
12
|
-
import { Gt as Expand, J as PanelGroup, Jt as Code, Wt as EyeOff, Y as PanelResizeHandle, a as DEFAULT_SLIDE_TYPE, c as Slide, i as DEFAULT_DECK_TRANSITION, q as Panel, s as SlideSidebar, t as useNotebookCodeAvailable } from "./code-visibility-
|
|
12
|
+
import { Gt as Expand, J as PanelGroup, Jt as Code, Wt as EyeOff, Y as PanelResizeHandle, a as DEFAULT_SLIDE_TYPE, c as Slide, i as DEFAULT_DECK_TRANSITION, q as Panel, s as SlideSidebar, t as useNotebookCodeAvailable } from "./code-visibility-D80f1Ibv.js";
|
|
13
13
|
import { q as useDebouncedCallback } from "./input-_2sjvfne.js";
|
|
14
14
|
import "./toDate-x-WRDCH7.js";
|
|
15
15
|
import "./react-dom-BTJzcVJ9.js";
|
package/package.json
CHANGED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
import type { StorageEntry } from "@/core/storage/types";
|
|
4
|
+
import { exportedForTesting } from "../storage-inspector";
|
|
5
|
+
|
|
6
|
+
const { storageEntryKey } = exportedForTesting;
|
|
7
|
+
|
|
8
|
+
function makeEntry(
|
|
9
|
+
overrides: Partial<StorageEntry> & { path: string },
|
|
10
|
+
): StorageEntry {
|
|
11
|
+
return {
|
|
12
|
+
kind: overrides.kind ?? "file",
|
|
13
|
+
lastModified: overrides.lastModified ?? null,
|
|
14
|
+
metadata: overrides.metadata ?? {},
|
|
15
|
+
path: overrides.path,
|
|
16
|
+
size: overrides.size ?? 0,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
describe("storageEntryKey", () => {
|
|
21
|
+
it("prefers the backend id when present (e.g. Google Drive)", () => {
|
|
22
|
+
const entry = makeEntry({
|
|
23
|
+
path: "Data Resume.pdf",
|
|
24
|
+
metadata: { id: "drive-file-id-123" },
|
|
25
|
+
});
|
|
26
|
+
// Two files can share a path on Drive; the id keeps keys unique.
|
|
27
|
+
expect(storageEntryKey(entry, 0)).toBe("drive-file-id-123");
|
|
28
|
+
expect(storageEntryKey(entry, 4)).toBe("drive-file-id-123");
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("falls back to path + index when there is no id", () => {
|
|
32
|
+
const entry = makeEntry({ path: "Data Resume.pdf" });
|
|
33
|
+
expect(storageEntryKey(entry, 0)).toBe("Data Resume.pdf::0");
|
|
34
|
+
expect(storageEntryKey(entry, 4)).toBe("Data Resume.pdf::4");
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
it("keeps duplicate-path entries unique via the index fallback", () => {
|
|
38
|
+
const entries = [
|
|
39
|
+
makeEntry({ path: "Data Resume.pdf" }),
|
|
40
|
+
makeEntry({ path: "Data Resume.pdf" }),
|
|
41
|
+
makeEntry({ path: "Data Resume.pdf" }),
|
|
42
|
+
];
|
|
43
|
+
const keys = entries.map((entry, index) => storageEntryKey(entry, index));
|
|
44
|
+
expect(new Set(keys).size).toBe(entries.length);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
it("ignores a non-string or empty id", () => {
|
|
48
|
+
expect(
|
|
49
|
+
storageEntryKey(makeEntry({ path: "a.pdf", metadata: { id: "" } }), 2),
|
|
50
|
+
).toBe("a.pdf::2");
|
|
51
|
+
expect(
|
|
52
|
+
storageEntryKey(makeEntry({ path: "a.pdf", metadata: { id: 5 } }), 2),
|
|
53
|
+
).toBe("a.pdf::2");
|
|
54
|
+
});
|
|
55
|
+
});
|
|
@@ -94,6 +94,18 @@ function displayName(path: string): string {
|
|
|
94
94
|
return parts[parts.length - 1] || trimmed;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
/**
|
|
98
|
+
* Stable, unique identity for an entry row. Prefer the
|
|
99
|
+
* backend's stable id when present and fall back to the list index
|
|
100
|
+
*/
|
|
101
|
+
function storageEntryKey(entry: StorageEntry, index: number): string {
|
|
102
|
+
const id = entry.metadata?.id;
|
|
103
|
+
if (typeof id === "string" && id.length > 0) {
|
|
104
|
+
return id;
|
|
105
|
+
}
|
|
106
|
+
return `${entry.path}::${index}`;
|
|
107
|
+
}
|
|
108
|
+
|
|
97
109
|
/**
|
|
98
110
|
* Recursively check whether an entry (or any of its loaded descendants)
|
|
99
111
|
* matches the search query.
|
|
@@ -213,26 +225,31 @@ const StorageEntryChildren: React.FC<{
|
|
|
213
225
|
|
|
214
226
|
return (
|
|
215
227
|
<>
|
|
216
|
-
{filtered.map((child) =>
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
228
|
+
{filtered.map((child) => {
|
|
229
|
+
const rowKey = storageEntryKey(child, children.indexOf(child));
|
|
230
|
+
return (
|
|
231
|
+
<StorageEntryRow
|
|
232
|
+
key={rowKey}
|
|
233
|
+
rowKey={rowKey}
|
|
234
|
+
entry={child}
|
|
235
|
+
namespace={namespace}
|
|
236
|
+
protocol={protocol}
|
|
237
|
+
rootPath={rootPath}
|
|
238
|
+
backendType={backendType}
|
|
239
|
+
depth={depth}
|
|
240
|
+
locale={locale}
|
|
241
|
+
searchValue={searchValue}
|
|
242
|
+
onOpenFile={onOpenFile}
|
|
243
|
+
/>
|
|
244
|
+
);
|
|
245
|
+
})}
|
|
230
246
|
</>
|
|
231
247
|
);
|
|
232
248
|
};
|
|
233
249
|
|
|
234
250
|
const StorageEntryRow: React.FC<{
|
|
235
251
|
entry: StorageEntry;
|
|
252
|
+
rowKey: string;
|
|
236
253
|
namespace: string;
|
|
237
254
|
protocol: string;
|
|
238
255
|
rootPath: string;
|
|
@@ -243,6 +260,7 @@ const StorageEntryRow: React.FC<{
|
|
|
243
260
|
onOpenFile: (info: OpenFileInfo) => void;
|
|
244
261
|
}> = ({
|
|
245
262
|
entry,
|
|
263
|
+
rowKey,
|
|
246
264
|
namespace,
|
|
247
265
|
protocol,
|
|
248
266
|
rootPath,
|
|
@@ -312,7 +330,7 @@ const StorageEntryRow: React.FC<{
|
|
|
312
330
|
isDir && "font-medium",
|
|
313
331
|
)}
|
|
314
332
|
style={indentStyle(depth)}
|
|
315
|
-
value={`${namespace}:${
|
|
333
|
+
value={`${namespace}:${rowKey}`}
|
|
316
334
|
onSelect={() => {
|
|
317
335
|
if (isDir) {
|
|
318
336
|
setIsExpanded(!effectiveExpanded);
|
|
@@ -525,20 +543,24 @@ const StorageNamespaceSection: React.FC<{
|
|
|
525
543
|
No matches
|
|
526
544
|
</div>
|
|
527
545
|
)}
|
|
528
|
-
{filtered.map((entry) =>
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
546
|
+
{filtered.map((entry) => {
|
|
547
|
+
const rowKey = storageEntryKey(entry, entries.indexOf(entry));
|
|
548
|
+
return (
|
|
549
|
+
<StorageEntryRow
|
|
550
|
+
key={rowKey}
|
|
551
|
+
rowKey={rowKey}
|
|
552
|
+
entry={entry}
|
|
553
|
+
namespace={namespaceName}
|
|
554
|
+
protocol={namespace.protocol}
|
|
555
|
+
rootPath={namespace.rootPath}
|
|
556
|
+
backendType={namespace.backendType}
|
|
557
|
+
depth={1}
|
|
558
|
+
locale={locale}
|
|
559
|
+
searchValue={searchValue}
|
|
560
|
+
onOpenFile={onOpenFile}
|
|
561
|
+
/>
|
|
562
|
+
);
|
|
563
|
+
})}
|
|
542
564
|
</>
|
|
543
565
|
)}
|
|
544
566
|
</>
|
|
@@ -652,3 +674,7 @@ export const StorageInspector: React.FC = () => {
|
|
|
652
674
|
</div>
|
|
653
675
|
);
|
|
654
676
|
};
|
|
677
|
+
|
|
678
|
+
export const exportedForTesting = {
|
|
679
|
+
storageEntryKey,
|
|
680
|
+
};
|