@marimo-team/islands 0.23.11-dev7 → 0.23.11-dev9
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-DNDxmvUS.js → code-visibility-0vPSjYnM.js} +1 -1
- package/dist/main.js +2 -2
- package/dist/{reveal-component-hVgYu-_f.js → reveal-component-BZpDHGsk.js} +1 -1
- package/package.json +1 -1
- package/src/components/datasources/__tests__/column-preview.test.tsx +97 -0
- package/src/components/datasources/column-preview.tsx +2 -4
|
@@ -35983,7 +35983,7 @@ ${d}`,
|
|
|
35983
35983
|
return Logger.warn("Failed to get version from mount config"), null;
|
|
35984
35984
|
}
|
|
35985
35985
|
}
|
|
35986
|
-
marimoVersionAtom = atom(getVersionFromMountConfig() || "0.23.11-
|
|
35986
|
+
marimoVersionAtom = atom(getVersionFromMountConfig() || "0.23.11-dev9");
|
|
35987
35987
|
showCodeInRunModeAtom = atom(true);
|
|
35988
35988
|
atom(null);
|
|
35989
35989
|
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-
|
|
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-0vPSjYnM.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-
|
|
36190
|
+
var LazySlidesComponent = import_react.lazy(() => import("./reveal-component-BZpDHGsk.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-D5-EpALB.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-
|
|
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-0vPSjYnM.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
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import { render } from "@testing-library/react";
|
|
4
|
+
import { Provider } from "jotai";
|
|
5
|
+
import type React from "react";
|
|
6
|
+
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
7
|
+
import { MockRequestClient } from "@/__mocks__/requests";
|
|
8
|
+
import type { SQLTableContext } from "@/core/datasets/data-source-connections";
|
|
9
|
+
import type { DataTable, DataTableColumn } from "@/core/kernel/messages";
|
|
10
|
+
import { requestClientAtom } from "@/core/network/requests";
|
|
11
|
+
import { store } from "@/core/state/jotai";
|
|
12
|
+
import { DatasetColumnPreview } from "../column-preview";
|
|
13
|
+
|
|
14
|
+
const wrapper = ({ children }: { children: React.ReactNode }) => (
|
|
15
|
+
<Provider store={store}>{children}</Provider>
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
const table: DataTable = {
|
|
19
|
+
name: "users",
|
|
20
|
+
columns: [],
|
|
21
|
+
source: "my_engine",
|
|
22
|
+
// Not "connection"/"catalog", so a preview is requested on mount.
|
|
23
|
+
source_type: "duckdb",
|
|
24
|
+
type: "table",
|
|
25
|
+
engine: "my_engine" as DataTable["engine"],
|
|
26
|
+
indexes: null,
|
|
27
|
+
num_columns: null,
|
|
28
|
+
num_rows: null,
|
|
29
|
+
variable_name: null,
|
|
30
|
+
primary_keys: null,
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const column = { name: "email" } as DataTableColumn;
|
|
34
|
+
|
|
35
|
+
function renderPreview(sqlTableContext?: SQLTableContext) {
|
|
36
|
+
const client = MockRequestClient.create();
|
|
37
|
+
store.set(requestClientAtom, client);
|
|
38
|
+
render(
|
|
39
|
+
<DatasetColumnPreview
|
|
40
|
+
table={table}
|
|
41
|
+
column={column}
|
|
42
|
+
preview={undefined}
|
|
43
|
+
onAddColumnChart={vi.fn()}
|
|
44
|
+
sqlTableContext={sqlTableContext}
|
|
45
|
+
/>,
|
|
46
|
+
{ wrapper },
|
|
47
|
+
);
|
|
48
|
+
return client;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const ctx = (
|
|
52
|
+
overrides: Partial<SQLTableContext> & { database: string; schema: string },
|
|
53
|
+
): SQLTableContext => ({
|
|
54
|
+
engine: "my_engine",
|
|
55
|
+
dialect: "duckdb",
|
|
56
|
+
...overrides,
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
describe("DatasetColumnPreview fullyQualifiedTableName", () => {
|
|
60
|
+
beforeEach(() => {
|
|
61
|
+
vi.clearAllMocks();
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
it("uses just the table name without a SQL context", () => {
|
|
65
|
+
const client = renderPreview(undefined);
|
|
66
|
+
expect(client.previewDatasetColumn).toHaveBeenCalledWith(
|
|
67
|
+
expect.objectContaining({ fullyQualifiedTableName: "users" }),
|
|
68
|
+
);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it("qualifies with database and schema for flat engines", () => {
|
|
72
|
+
const client = renderPreview(ctx({ database: "db", schema: "public" }));
|
|
73
|
+
expect(client.previewDatasetColumn).toHaveBeenCalledWith(
|
|
74
|
+
expect.objectContaining({ fullyQualifiedTableName: "db.public.users" }),
|
|
75
|
+
);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it("does not emit a double dot for schemaless tables", () => {
|
|
79
|
+
// Regression: previously produced "db..users".
|
|
80
|
+
const client = renderPreview(ctx({ database: "db", schema: "" }));
|
|
81
|
+
expect(client.previewDatasetColumn).toHaveBeenCalledWith(
|
|
82
|
+
expect.objectContaining({ fullyQualifiedTableName: "db.users" }),
|
|
83
|
+
);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it("includes the full schema path for nested namespaces", () => {
|
|
87
|
+
// Regression: previously dropped schemaPath and emitted "top.deep.users".
|
|
88
|
+
const client = renderPreview(
|
|
89
|
+
ctx({ database: "top", schema: "deep", schemaPath: ["nested", "deep"] }),
|
|
90
|
+
);
|
|
91
|
+
expect(client.previewDatasetColumn).toHaveBeenCalledWith(
|
|
92
|
+
expect.objectContaining({
|
|
93
|
+
fullyQualifiedTableName: "top.nested.deep.users",
|
|
94
|
+
}),
|
|
95
|
+
);
|
|
96
|
+
});
|
|
97
|
+
});
|
|
@@ -29,7 +29,7 @@ import { Button } from "../ui/button";
|
|
|
29
29
|
import { Tooltip } from "../ui/tooltip";
|
|
30
30
|
import { ColumnPreviewContainer } from "./components";
|
|
31
31
|
import { InstallPackageButton } from "./install-package-button";
|
|
32
|
-
import { convertStatsName, sqlCode } from "./utils";
|
|
32
|
+
import { convertStatsName, sqlCode, tableUniqueId } from "./utils";
|
|
33
33
|
|
|
34
34
|
export const DatasetColumnPreview: React.FC<{
|
|
35
35
|
table: DataTable;
|
|
@@ -48,9 +48,7 @@ export const DatasetColumnPreview: React.FC<{
|
|
|
48
48
|
tableName: table.name,
|
|
49
49
|
columnName: column.name,
|
|
50
50
|
sourceType: table.source_type,
|
|
51
|
-
fullyQualifiedTableName: sqlTableContext
|
|
52
|
-
? `${sqlTableContext.database}.${sqlTableContext.schema}.${table.name}`
|
|
53
|
-
: table.name,
|
|
51
|
+
fullyQualifiedTableName: tableUniqueId(sqlTableContext, table.name),
|
|
54
52
|
});
|
|
55
53
|
};
|
|
56
54
|
|