@marimo-team/islands 0.23.11-dev21 → 0.23.11-dev23
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-DvrnpkbY.js → code-visibility-elFBcBvs.js} +14 -14
- package/dist/main.js +2 -2
- package/dist/{reveal-component-BsmfWYqg.js → reveal-component-BcklswWX.js} +1 -1
- package/package.json +1 -1
- package/src/components/datasources/__tests__/install-package-button.test.tsx +11 -0
- package/src/components/datasources/install-package-button.tsx +3 -1
|
@@ -33696,28 +33696,28 @@ Database schema: ${n}`), (_a3 = t2.aiFix) == null ? void 0 : _a3.setAiCompletion
|
|
|
33696
33696
|
};
|
|
33697
33697
|
var import_compiler_runtime$11 = require_compiler_runtime();
|
|
33698
33698
|
InstallPackageButton = (e) => {
|
|
33699
|
-
let t = (0, import_compiler_runtime$11.c)(13), { packages: n, showMaxPackages: i, className: o, onInstall: s } = e, { handleInstallPackages: c } = useInstallPackages();
|
|
33700
|
-
if (!n || n.length === 0) return null;
|
|
33701
|
-
let d;
|
|
33702
|
-
t[0] !== c || t[1] !== s || t[2] !== n ? (d = () => {
|
|
33703
|
-
c(n, s);
|
|
33704
|
-
}, t[0] = c, t[1] = s, t[2] = n, t[3] = d) : d = t[3];
|
|
33699
|
+
let t = (0, import_compiler_runtime$11.c)(13), { packages: n, showMaxPackages: i, className: o, onInstall: s } = e, { handleInstallPackages: c } = useInstallPackages(), d = useInstallAllowed();
|
|
33700
|
+
if (!n || n.length === 0 || !d) return null;
|
|
33705
33701
|
let f;
|
|
33706
|
-
t[
|
|
33702
|
+
t[0] !== c || t[1] !== s || t[2] !== n ? (f = () => {
|
|
33703
|
+
c(n, s);
|
|
33704
|
+
}, t[0] = c, t[1] = s, t[2] = n, t[3] = f) : f = t[3];
|
|
33707
33705
|
let _;
|
|
33708
|
-
t[
|
|
33706
|
+
t[4] === o ? _ = t[5] : (_ = cn("ml-2", o), t[4] = o, t[5] = _);
|
|
33709
33707
|
let v;
|
|
33710
|
-
|
|
33708
|
+
t[6] !== n || t[7] !== i ? (v = i ? n.slice(0, i).join(", ") : n.join(", "), t[6] = n, t[7] = i, t[8] = v) : v = t[8];
|
|
33709
|
+
let y;
|
|
33710
|
+
return t[9] !== f || t[10] !== _ || t[11] !== v ? (y = (0, import_jsx_runtime.jsxs)(Button, {
|
|
33711
33711
|
variant: "outline",
|
|
33712
33712
|
size: "xs",
|
|
33713
|
-
onClick:
|
|
33714
|
-
className:
|
|
33713
|
+
onClick: f,
|
|
33714
|
+
className: _,
|
|
33715
33715
|
children: [
|
|
33716
33716
|
"Install",
|
|
33717
33717
|
" ",
|
|
33718
|
-
|
|
33718
|
+
v
|
|
33719
33719
|
]
|
|
33720
|
-
}), t[9] =
|
|
33720
|
+
}), t[9] = f, t[10] = _, t[11] = v, t[12] = y) : y = t[12], y;
|
|
33721
33721
|
};
|
|
33722
33722
|
var import_compiler_runtime$10 = require_compiler_runtime();
|
|
33723
33723
|
const MissingPackagePrompt = (e) => {
|
|
@@ -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-dev23");
|
|
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-f8-xgaui.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-elFBcBvs.js";
|
|
30
30
|
import { c as Calendar, i as createReducerAndAtoms, n as useOnUnmount, o as ToggleLeft, t as useOnMount } from "./useLifecycle-B3NOEiY5.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-BcklswWX.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-BJbLjZyG.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-elFBcBvs.js";
|
|
13
13
|
import { X as useDebouncedCallback } from "./input-Cn-SZdXY.js";
|
|
14
14
|
import "./toDate-B4-pUFYh.js";
|
|
15
15
|
import "./react-dom-BTJzcVJ9.js";
|
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@ import { Provider } from "jotai";
|
|
|
5
5
|
import React from "react";
|
|
6
6
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
7
7
|
import { MockRequestClient } from "@/__mocks__/requests";
|
|
8
|
+
import { viewStateAtom } from "@/core/mode";
|
|
8
9
|
import { requestClientAtom } from "@/core/network/requests";
|
|
9
10
|
import { store } from "@/core/state/jotai";
|
|
10
11
|
import { InstallPackageButton } from "../install-package-button";
|
|
@@ -48,6 +49,7 @@ describe("InstallPackageButton", () => {
|
|
|
48
49
|
beforeEach(() => {
|
|
49
50
|
vi.clearAllMocks();
|
|
50
51
|
store.set(requestClientAtom, MockRequestClient.create());
|
|
52
|
+
store.set(viewStateAtom, { mode: "edit", cellAnchor: null });
|
|
51
53
|
});
|
|
52
54
|
|
|
53
55
|
it("should not render when packages is undefined", () => {
|
|
@@ -82,4 +84,13 @@ describe("InstallPackageButton", () => {
|
|
|
82
84
|
);
|
|
83
85
|
expect(screen.getByText("Install altair")).toBeInTheDocument();
|
|
84
86
|
});
|
|
87
|
+
|
|
88
|
+
it("should not render in read mode, where installs are not allowed", () => {
|
|
89
|
+
store.set(viewStateAtom, { mode: "read", cellAnchor: null });
|
|
90
|
+
const { container } = render(
|
|
91
|
+
<InstallPackageButton packages={["altair"]} />,
|
|
92
|
+
{ wrapper },
|
|
93
|
+
);
|
|
94
|
+
expect(container.firstChild).toBeNull();
|
|
95
|
+
});
|
|
85
96
|
});
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { Button } from "@/components/ui/button";
|
|
5
|
+
import { useInstallAllowed } from "@/core/mode";
|
|
5
6
|
import { useInstallPackages } from "@/core/packages/useInstallPackage";
|
|
6
7
|
import { cn } from "@/utils/cn";
|
|
7
8
|
|
|
@@ -23,8 +24,9 @@ export const InstallPackageButton: React.FC<InstallPackageButtonProps> = ({
|
|
|
23
24
|
onInstall,
|
|
24
25
|
}) => {
|
|
25
26
|
const { handleInstallPackages } = useInstallPackages();
|
|
27
|
+
const installAllowed = useInstallAllowed();
|
|
26
28
|
|
|
27
|
-
if (!packages || packages.length === 0) {
|
|
29
|
+
if (!packages || packages.length === 0 || !installAllowed) {
|
|
28
30
|
return null;
|
|
29
31
|
}
|
|
30
32
|
|