@marimo-team/islands 0.24.1-dev10 → 0.24.1-dev12

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.
@@ -36331,7 +36331,7 @@ ${d}`,
36331
36331
  return Logger.warn("Failed to get version from mount config"), null;
36332
36332
  }
36333
36333
  }
36334
- marimoVersionAtom = atom(getVersionFromMountConfig() || "0.24.1-dev10");
36334
+ marimoVersionAtom = atom(getVersionFromMountConfig() || "0.24.1-dev12");
36335
36335
  showCodeInRunModeAtom = atom(true);
36336
36336
  atom(null);
36337
36337
  var import_compiler_runtime = require_compiler_runtime();
package/dist/main.js CHANGED
@@ -26,7 +26,7 @@ import { $ as notebookOutline, $t as isUninstantiated, A as ChevronDownIcon, An
26
26
  import { __tla as __tla_1 } from "./chunk-5FQGJX7Z-BRZ_XYUw.js";
27
27
  import { o as useSize, s as Root$1, u as createLucideIcon } from "./dist-j30bBjjN.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, 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-BL1GSUUF.js";
29
- import { $ as CommandSeparator, $t as Kbd, A as ErrorState, At as getPageIndexForRow, B as ContextMenuTrigger, Bt as dateToLocalISODate, C as downloadHTMLAsImage, Ct as inferFieldTypes, D as ColumnName, Dt as DelayMount, E as downloadSizeLimitAtom, Et as ColumnChartSpecModel, F as getUserColumnVisibilityCounts, Ft as TOO_MANY_ROWS, G as DateRangePicker, Gt as TabsList, H as useSelectList, Ht as dateToLocalISOTime, I as ContextMenu, It as toFieldTypes, J as Command, Jt as ChartInfoState, K as Combobox, Kt as TabsTrigger, L as ContextMenuContent, Lt as getMimeValues, M as prettifyRowColumnCount, Mt as loadTableData, N as prettifyRowCount, Nt as INDEX_COLUMN_NAME, O as ColumnPreviewContainer, Ot as useIntersectionObserver, P as getColumnCountForDisplay, Pt as SELECT_COLUMN_ID, Q as CommandList, Qt as RenderTextWithLinks, R as ContextMenuItem, Rt as isNullishFilter, S as downloadExportedFile, St as generateColumns, T as Filenames, Tt as ColumnChartContext, U as CompactChipRow, Ut as Tabs, V as useInternalStateWithSync, Vt as dateToLocalISODateTime, W as DatePicker, Wt as TabsContent, X as CommandInput, Xt as LazyVegaEmbed, Y as CommandEmpty, Yt as ChartLoadingState, Z as CommandItem, Zt as useOverflowDetection, _ as DataTable, _n as ChevronLeft, _t as TableCell, an as TextWrap, at as contextAwarePanelType, b as downloadBlob, bt as TableRow, c as SLIDE_TYPE_OPTIONS_BY_VALUE, cn as EyeOff, ct as slotsController, d as Switch, dn as Download, en as HtmlOutput, et as smartMatch, f as RadioGroup, fn as Code, g as OutputRenderer, gn as ChevronsDownUp, gt as TableBody, h as OutputArea, hn as ChevronsLeft, ht as Table, i as showCodeInRunModeAtom, in as $fae977aafc393c5c$export$6b862160d295c8e, it as contextAwarePanelOwner, j as LoadingState, jt as loadTableAndRawData, k as EmptyState, kt as usePrevious$1, lt as Toggle, m as JsonOutput, mn as ChevronsRight, mt as Provider$1, n as useNotebookCodeAvailable, nn as safeLocale, nt as PANEL_TYPES, on as GripHorizontal, ot as isCellAwareAtom, p as RadioGroupItem, pn as ChevronsUpDown, pt as Fill, q as ComboboxItem, qt as ChartErrorState, r as marimoVersionAtom, rn as $fae977aafc393c5c$export$588937bcd60ade55, rt as contextAwarePanelOpen, sn as Funnel, st as SlotNames, t as cellDomProps, tn as EmotionCacheProvider, tt as ContextAwarePanelItem, u as Slide, un as Ellipsis, v as InstallPackageButton, vn as ArrowDownWideNarrow, vt as TableHead, w as Progress, wt as renderCellValue, x as downloadByURL, xt as NAMELESS_COLUMN_PREFIX, y as ADD_PRINTING_CLASS, yt as TableHeader, z as ContextMenuSeparator, zt as Maps, __tla as __tla_2 } from "./common-DRk3eWFU.js";
29
+ import { $ as CommandSeparator, $t as Kbd, A as ErrorState, At as getPageIndexForRow, B as ContextMenuTrigger, Bt as dateToLocalISODate, C as downloadHTMLAsImage, Ct as inferFieldTypes, D as ColumnName, Dt as DelayMount, E as downloadSizeLimitAtom, Et as ColumnChartSpecModel, F as getUserColumnVisibilityCounts, Ft as TOO_MANY_ROWS, G as DateRangePicker, Gt as TabsList, H as useSelectList, Ht as dateToLocalISOTime, I as ContextMenu, It as toFieldTypes, J as Command, Jt as ChartInfoState, K as Combobox, Kt as TabsTrigger, L as ContextMenuContent, Lt as getMimeValues, M as prettifyRowColumnCount, Mt as loadTableData, N as prettifyRowCount, Nt as INDEX_COLUMN_NAME, O as ColumnPreviewContainer, Ot as useIntersectionObserver, P as getColumnCountForDisplay, Pt as SELECT_COLUMN_ID, Q as CommandList, Qt as RenderTextWithLinks, R as ContextMenuItem, Rt as isNullishFilter, S as downloadExportedFile, St as generateColumns, T as Filenames, Tt as ColumnChartContext, U as CompactChipRow, Ut as Tabs, V as useInternalStateWithSync, Vt as dateToLocalISODateTime, W as DatePicker, Wt as TabsContent, X as CommandInput, Xt as LazyVegaEmbed, Y as CommandEmpty, Yt as ChartLoadingState, Z as CommandItem, Zt as useOverflowDetection, _ as DataTable, _n as ChevronLeft, _t as TableCell, an as TextWrap, at as contextAwarePanelType, b as downloadBlob, bt as TableRow, c as SLIDE_TYPE_OPTIONS_BY_VALUE, cn as EyeOff, ct as slotsController, d as Switch, dn as Download, en as HtmlOutput, et as smartMatch, f as RadioGroup, fn as Code, g as OutputRenderer, gn as ChevronsDownUp, gt as TableBody, h as OutputArea, hn as ChevronsLeft, ht as Table, i as showCodeInRunModeAtom, in as $fae977aafc393c5c$export$6b862160d295c8e, it as contextAwarePanelOwner, j as LoadingState, jt as loadTableAndRawData, k as EmptyState, kt as usePrevious$1, lt as Toggle, m as JsonOutput, mn as ChevronsRight, mt as Provider$1, n as useNotebookCodeAvailable, nn as safeLocale, nt as PANEL_TYPES, on as GripHorizontal, ot as isCellAwareAtom, p as RadioGroupItem, pn as ChevronsUpDown, pt as Fill, q as ComboboxItem, qt as ChartErrorState, r as marimoVersionAtom, rn as $fae977aafc393c5c$export$588937bcd60ade55, rt as contextAwarePanelOpen, sn as Funnel, st as SlotNames, t as cellDomProps, tn as EmotionCacheProvider, tt as ContextAwarePanelItem, u as Slide, un as Ellipsis, v as InstallPackageButton, vn as ArrowDownWideNarrow, vt as TableHead, w as Progress, wt as renderCellValue, x as downloadByURL, xt as NAMELESS_COLUMN_PREFIX, y as ADD_PRINTING_CLASS, yt as TableHeader, z as ContextMenuSeparator, zt as Maps, __tla as __tla_2 } from "./common-HOyUUAsW.js";
30
30
  import { c as Calendar, i as createReducerAndAtoms, n as useOnUnmount, o as ToggleLeft, t as useOnMount } from "./useLifecycle-Bw4wRj_O.js";
31
31
  import { t as Check } from "./check-58HHfHKy.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-DMLVGXRo.js";
@@ -38306,7 +38306,7 @@ ${c}
38306
38306
  function _temp2$2(e) {
38307
38307
  e.target === e.currentTarget && e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), e.currentTarget.click());
38308
38308
  }
38309
- var LazySlidesComponent = import_react.lazy(() => import("./reveal-component-BOG9ASed.js"));
38309
+ var LazySlidesComponent = import_react.lazy(() => import("./reveal-component-BPnJItEq.js"));
38310
38310
  const SlidesLayoutRenderer = ({ layout: e, setLayout: r, cells: c, mode: l }) => {
38311
38311
  var _a5;
38312
38312
  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-DsR6imPN.js";
9
9
  import { ut as outputIsStale } from "./html-to-image-BtNr4zrO.js";
10
10
  import "./chunk-5FQGJX7Z-BRZ_XYUw.js";
11
11
  import { u as createLucideIcon } from "./dist-j30bBjjN.js";
12
- import { a as DEFAULT_DECK_TRANSITION, cn as EyeOff, dt as PanelGroup, fn as Code, ft as PanelResizeHandle, l as SlideSidebar, ln as Expand, n as useNotebookCodeAvailable, o as DEFAULT_DECK_VERTICAL_ALIGN, s as DEFAULT_SLIDE_TYPE, t as cellDomProps, u as Slide, ut as Panel } from "./common-DRk3eWFU.js";
12
+ import { a as DEFAULT_DECK_TRANSITION, cn as EyeOff, dt as PanelGroup, fn as Code, ft as PanelResizeHandle, l as SlideSidebar, ln as Expand, n as useNotebookCodeAvailable, o as DEFAULT_DECK_VERTICAL_ALIGN, s as DEFAULT_SLIDE_TYPE, t as cellDomProps, u as Slide, ut as Panel } from "./common-HOyUUAsW.js";
13
13
  import { R as ChevronDown } from "./strings-DMLVGXRo.js";
14
14
  import { X as useDebouncedCallback } from "./input-BRE2a7Ay.js";
15
15
  import { v as kioskModeAtom } from "./toDate-CjUYDkFI.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/islands",
3
- "version": "0.24.1-dev10",
3
+ "version": "0.24.1-dev12",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -0,0 +1,78 @@
1
+ /* Copyright 2026 Marimo. All rights reserved. */
2
+
3
+ import { describe, expect, it } from "vitest";
4
+ import { isPackageRequirementInstalled } from "./optional-features";
5
+
6
+ describe("isPackageRequirementInstalled", () => {
7
+ const installedPackages = [
8
+ { name: "mcp", version: "2.0.0" },
9
+ { name: "polars", version: "1.8.2" },
10
+ ];
11
+
12
+ it("requires the package to be installed", () => {
13
+ expect(
14
+ isPackageRequirementInstalled({ name: "missing" }, installedPackages),
15
+ ).toBe(false);
16
+ });
17
+
18
+ it("accepts an installed package without a minimum version", () => {
19
+ expect(
20
+ isPackageRequirementInstalled({ name: "polars" }, installedPackages),
21
+ ).toBe(true);
22
+ });
23
+
24
+ it("rejects an installed package below the minimum version", () => {
25
+ expect(
26
+ isPackageRequirementInstalled(
27
+ { name: "mcp", minVersion: "2.1.0" },
28
+ installedPackages,
29
+ ),
30
+ ).toBe(false);
31
+ });
32
+
33
+ it.each(["2.0.0rc1", "2.0.0.dev1", "2.0.0-beta1"])(
34
+ "rejects the prerelease version %s",
35
+ (version) => {
36
+ expect(
37
+ isPackageRequirementInstalled({ name: "mcp", minVersion: "2.0.0" }, [
38
+ { name: "mcp", version },
39
+ ]),
40
+ ).toBe(false);
41
+ },
42
+ );
43
+
44
+ it.each(["2.1.0rc1", "3.0.0rc1"])(
45
+ "accepts the later prerelease version %s",
46
+ (version) => {
47
+ expect(
48
+ isPackageRequirementInstalled({ name: "mcp", minVersion: "2.0.0" }, [
49
+ { name: "mcp", version },
50
+ ]),
51
+ ).toBe(true);
52
+ },
53
+ );
54
+
55
+ it("accepts an installed package at or above the minimum version", () => {
56
+ expect(
57
+ isPackageRequirementInstalled(
58
+ { name: "mcp", minVersion: "2.0.0" },
59
+ installedPackages,
60
+ ),
61
+ ).toBe(true);
62
+ expect(
63
+ isPackageRequirementInstalled(
64
+ { name: "mcp", minVersion: "1.9.0" },
65
+ installedPackages,
66
+ ),
67
+ ).toBe(true);
68
+ });
69
+
70
+ it("normalizes extras in the requirement name", () => {
71
+ expect(
72
+ isPackageRequirementInstalled(
73
+ { name: "polars[pyarrow]" },
74
+ installedPackages,
75
+ ),
76
+ ).toBe(true);
77
+ });
78
+ });
@@ -20,6 +20,7 @@ import { isWasm } from "@/core/wasm/utils";
20
20
  import { useAsyncData } from "@/hooks/useAsyncData";
21
21
  import { ErrorBanner } from "@/plugins/impl/common/error-banner";
22
22
  import { cn } from "@/utils/cn";
23
+ import { semverSort } from "@/utils/versions";
23
24
  import { SettingSubtitle } from "./common";
24
25
 
25
26
  interface Package {
@@ -27,6 +28,35 @@ interface Package {
27
28
  minVersion?: string;
28
29
  }
29
30
 
31
+ interface InstalledPackage {
32
+ name: string;
33
+ version: string;
34
+ }
35
+
36
+ const PEP_440_PRERELEASE =
37
+ /^((?:\d+!)?\d+(?:\.\d+)*)(?:[-_.]?(?:a|b|c|rc|alpha|beta|pre|preview|dev)\d*)/i;
38
+
39
+ export function isPackageRequirementInstalled(
40
+ requirement: Package,
41
+ installedPackages: InstalledPackage[],
42
+ ): boolean {
43
+ const packageName = requirement.name.split("[")[0];
44
+ const installedPackage = installedPackages.find(
45
+ (pkg) => pkg.name === packageName,
46
+ );
47
+ if (!installedPackage) {
48
+ return false;
49
+ }
50
+ if (!requirement.minVersion) {
51
+ return true;
52
+ }
53
+ const prerelease = installedPackage.version.match(PEP_440_PRERELEASE);
54
+ if (prerelease) {
55
+ return semverSort(prerelease[1], requirement.minVersion) > 0;
56
+ }
57
+ return semverSort(installedPackage.version, requirement.minVersion) >= 0;
58
+ }
59
+
30
60
  interface OptionalFeature {
31
61
  id: string;
32
62
  /**
@@ -77,8 +107,8 @@ const OPTIONAL_DEPENDENCIES: OptionalFeature[] = [
77
107
  },
78
108
  {
79
109
  id: "mcp",
80
- packagesRequired: [{ name: "mcp", minVersion: "1" }],
81
- additionalPackageInstalls: [{ name: "pydantic", minVersion: "2" }],
110
+ packagesRequired: [{ name: "mcp", minVersion: "2.0.0" }],
111
+ additionalPackageInstalls: [],
82
112
  description: "Connect to MCP servers",
83
113
  },
84
114
  {
@@ -123,9 +153,6 @@ export const OptionalFeatures: React.FC = () => {
123
153
  }
124
154
 
125
155
  const installedPackages = data?.packages || [];
126
- const installedPackageNames = new Set(
127
- installedPackages.map((pkg) => pkg.name),
128
- );
129
156
 
130
157
  return (
131
158
  <div className="flex-1 flex flex-col overflow-hidden gap-2">
@@ -149,7 +176,7 @@ export const OptionalFeatures: React.FC = () => {
149
176
  <TableBody>
150
177
  {OPTIONAL_DEPENDENCIES.map((dep) => {
151
178
  const isInstalled = dep.packagesRequired.every((pkg) =>
152
- installedPackageNames.has(pkg.name.split("[")[0]),
179
+ isPackageRequirementInstalled(pkg, installedPackages),
153
180
  );
154
181
  const packageSpec = dep.packagesRequired
155
182
  .map((pkg) => pkg.name)