@marimo-team/islands 0.23.15-dev44 → 0.23.15-dev48

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.
@@ -36290,7 +36290,7 @@ ${d}`,
36290
36290
  return Logger.warn("Failed to get version from mount config"), null;
36291
36291
  }
36292
36292
  }
36293
- marimoVersionAtom = atom(getVersionFromMountConfig() || "0.23.15-dev44");
36293
+ marimoVersionAtom = atom(getVersionFromMountConfig() || "0.23.15-dev48");
36294
36294
  showCodeInRunModeAtom = atom(true);
36295
36295
  atom(null);
36296
36296
  var import_compiler_runtime = require_compiler_runtime();
package/dist/main.js CHANGED
@@ -26,7 +26,7 @@ import { $ as notebookOutline, $t as requestClientAtom, A as ChevronDownIcon, Bt
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--2Bqjvs0.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-DSs9v0xx.js";
29
- import { $ as ContextAwarePanelItem, $t as EmotionCacheProvider, A as prettifyRowColumnCount, At as loadTableData, B as useSelectList, Bt as dateToLocalISOTime, C as Filenames, Ct as ColumnChartContext, D as EmptyState, Dt as usePrevious$1, E as ColumnPreviewContainer, Et as useIntersectionObserver, F as ContextMenuContent, Ft as getMimeValues, G as ComboboxItem, Gt as ChartErrorState, H as DatePicker, Ht as TabsContent, I as ContextMenuItem, It as isNullishFilter, J as CommandInput, Jt as LazyVegaEmbed, K as Command, Kt as ChartInfoState, L as ContextMenuSeparator, Lt as Maps, M as getColumnCountForDisplay, Mt as SELECT_COLUMN_ID, N as getUserColumnVisibilityCounts, Nt as TOO_MANY_ROWS, O as ErrorState, Ot as getPageIndexForRow, P as ContextMenu, Pt as toFieldTypes, Q as smartMatch, Qt as HtmlOutput, R as ContextMenuTrigger, Rt as dateToLocalISODate, S as Progress, St as renderCellValue, T as ColumnName, Tt as DelayMount, U as DateRangePicker, Ut as TabsList, V as CompactChipRow, Vt as Tabs, W as Combobox, Wt as TabsTrigger, X as CommandList, Xt as RenderTextWithLinks, Y as CommandItem, Yt as useOverflowDetection, Z as CommandSeparator, Zt as Kbd, _ as InstallPackageButton, _n as ArrowDownWideNarrow, _t as TableHeader, an as GripHorizontal, at as SlotNames, b as downloadByURL, bt as generateColumns, d as RadioGroup, dn as Code, dt as Fill, en as hasFunctionProperty, et as PANEL_TYPES, f as RadioGroupItem, fn as ChevronsUpDown, ft as Provider$1, g as DataTable, gn as ChevronLeft, gt as TableHead, h as OutputRenderer, hn as ChevronsDownUp, ht as TableCell, in as TextWrap, it as isCellAwareAtom, j as prettifyRowCount, jt as INDEX_COLUMN_NAME, k as LoadingState, kt as loadTableAndRawData, l as Slide, ln as Ellipsis, m as OutputArea, mn as ChevronsLeft, mt as TableBody, n as marimoVersionAtom, nn as $fae977aafc393c5c$export$588937bcd60ade55, nt as contextAwarePanelOwner, on as Funnel, ot as slotsController, p as JsonOutput, pn as ChevronsRight, pt as Table, q as CommandEmpty, qt as ChartLoadingState, r as showCodeInRunModeAtom, rn as $fae977aafc393c5c$export$6b862160d295c8e, rt as contextAwarePanelType, s as SLIDE_TYPE_OPTIONS_BY_VALUE, sn as EyeOff, st as Toggle, t as useNotebookCodeAvailable, tn as isRecord, tt as contextAwarePanelOpen, u as Switch, un as Download, v as ADD_PRINTING_CLASS, vt as TableRow, w as downloadSizeLimitAtom, wt as ColumnChartSpecModel, x as downloadHTMLAsImage, xt as inferFieldTypes, y as downloadBlob, yt as NAMELESS_COLUMN_PREFIX, z as useInternalStateWithSync, zt as dateToLocalISODateTime, __tla as __tla_2 } from "./code-visibility-Bo6BTjEk.js";
29
+ import { $ as ContextAwarePanelItem, $t as EmotionCacheProvider, A as prettifyRowColumnCount, At as loadTableData, B as useSelectList, Bt as dateToLocalISOTime, C as Filenames, Ct as ColumnChartContext, D as EmptyState, Dt as usePrevious$1, E as ColumnPreviewContainer, Et as useIntersectionObserver, F as ContextMenuContent, Ft as getMimeValues, G as ComboboxItem, Gt as ChartErrorState, H as DatePicker, Ht as TabsContent, I as ContextMenuItem, It as isNullishFilter, J as CommandInput, Jt as LazyVegaEmbed, K as Command, Kt as ChartInfoState, L as ContextMenuSeparator, Lt as Maps, M as getColumnCountForDisplay, Mt as SELECT_COLUMN_ID, N as getUserColumnVisibilityCounts, Nt as TOO_MANY_ROWS, O as ErrorState, Ot as getPageIndexForRow, P as ContextMenu, Pt as toFieldTypes, Q as smartMatch, Qt as HtmlOutput, R as ContextMenuTrigger, Rt as dateToLocalISODate, S as Progress, St as renderCellValue, T as ColumnName, Tt as DelayMount, U as DateRangePicker, Ut as TabsList, V as CompactChipRow, Vt as Tabs, W as Combobox, Wt as TabsTrigger, X as CommandList, Xt as RenderTextWithLinks, Y as CommandItem, Yt as useOverflowDetection, Z as CommandSeparator, Zt as Kbd, _ as InstallPackageButton, _n as ArrowDownWideNarrow, _t as TableHeader, an as GripHorizontal, at as SlotNames, b as downloadByURL, bt as generateColumns, d as RadioGroup, dn as Code, dt as Fill, en as hasFunctionProperty, et as PANEL_TYPES, f as RadioGroupItem, fn as ChevronsUpDown, ft as Provider$1, g as DataTable, gn as ChevronLeft, gt as TableHead, h as OutputRenderer, hn as ChevronsDownUp, ht as TableCell, in as TextWrap, it as isCellAwareAtom, j as prettifyRowCount, jt as INDEX_COLUMN_NAME, k as LoadingState, kt as loadTableAndRawData, l as Slide, ln as Ellipsis, m as OutputArea, mn as ChevronsLeft, mt as TableBody, n as marimoVersionAtom, nn as $fae977aafc393c5c$export$588937bcd60ade55, nt as contextAwarePanelOwner, on as Funnel, ot as slotsController, p as JsonOutput, pn as ChevronsRight, pt as Table, q as CommandEmpty, qt as ChartLoadingState, r as showCodeInRunModeAtom, rn as $fae977aafc393c5c$export$6b862160d295c8e, rt as contextAwarePanelType, s as SLIDE_TYPE_OPTIONS_BY_VALUE, sn as EyeOff, st as Toggle, t as useNotebookCodeAvailable, tn as isRecord, tt as contextAwarePanelOpen, u as Switch, un as Download, v as ADD_PRINTING_CLASS, vt as TableRow, w as downloadSizeLimitAtom, wt as ColumnChartSpecModel, x as downloadHTMLAsImage, xt as inferFieldTypes, y as downloadBlob, yt as NAMELESS_COLUMN_PREFIX, z as useInternalStateWithSync, zt as dateToLocalISODateTime, __tla as __tla_2 } from "./code-visibility-Dq5x0TzR.js";
30
30
  import { c as Calendar, i as createReducerAndAtoms, n as useOnUnmount, o as ToggleLeft, t as useOnMount } from "./useLifecycle-C6wHjkhW.js";
31
31
  import { t as Check } from "./check-C9OoNtR4.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-Dq_j3Rxw.js";
@@ -3742,6 +3742,9 @@ let __tla = Promise.all([
3742
3742
  });
3743
3743
  return __privateGet(this, _e3).set(c, d), d;
3744
3744
  }
3745
+ invalidate(e) {
3746
+ __privateGet(this, _e3).delete(e);
3747
+ }
3745
3748
  }, _e3 = new WeakMap(), _WidgetDefRegistry_instances = new WeakSet(), t_fn = async function(e, r = {}) {
3746
3749
  if (!(isTrustedVirtualFileUrl(e) || r.kernelAuthored === true && /^(https?:|data:)/.test(e))) throw Error(`Refusing to load anywidget module from untrusted URL: ${String(e)}`);
3747
3750
  let c = asRemoteURL(e).toString();
@@ -3960,7 +3963,7 @@ let __tla = Promise.all([
3960
3963
  jsHash: r.hash,
3961
3964
  kernelAuthored: true
3962
3965
  }), d = resolveAnyWidget(u, r.url);
3963
- if (!d) throw getInvalidAnyWidgetModuleError(u, r.url);
3966
+ if (!d) throw WIDGET_DEF_REGISTRY.invalidate(r.hash), getInvalidAnyWidgetModuleError(u, r.url);
3964
3967
  return WidgetBinding.create({
3965
3968
  widgetDef: d,
3966
3969
  model: c,
@@ -38024,7 +38027,7 @@ ${c}
38024
38027
  function _temp2$2(e) {
38025
38028
  e.target === e.currentTarget && e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), e.currentTarget.click());
38026
38029
  }
38027
- var LazySlidesComponent = import_react.lazy(() => import("./reveal-component-BwAYTO0n.js"));
38030
+ var LazySlidesComponent = import_react.lazy(() => import("./reveal-component-DH_Zpz4T.js"));
38028
38031
  const SlidesLayoutRenderer = ({ layout: e, setLayout: r, cells: c, mode: l }) => {
38029
38032
  var _a5;
38030
38033
  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 { dt as kioskModeAtom, ht as outputIsStale } from "./html-to-image-CEo5pRYw.js";
10
10
  import "./chunk-5FQGJX7Z-BbqSm5gU.js";
11
11
  import { u as createLucideIcon } from "./dist--2Bqjvs0.js";
12
- import { a as DEFAULT_DECK_VERTICAL_ALIGN, c as SlideSidebar, cn as Expand, ct as Panel, dn as Code, i as DEFAULT_DECK_TRANSITION, l as Slide, lt as PanelGroup, o as DEFAULT_SLIDE_TYPE, sn as EyeOff, t as useNotebookCodeAvailable, ut as PanelResizeHandle } from "./code-visibility-Bo6BTjEk.js";
12
+ import { a as DEFAULT_DECK_VERTICAL_ALIGN, c as SlideSidebar, cn as Expand, ct as Panel, dn as Code, i as DEFAULT_DECK_TRANSITION, l as Slide, lt as PanelGroup, o as DEFAULT_SLIDE_TYPE, sn as EyeOff, t as useNotebookCodeAvailable, ut as PanelResizeHandle } from "./code-visibility-Dq5x0TzR.js";
13
13
  import { X as useDebouncedCallback } from "./input-BGPrFH3g.js";
14
14
  import "./toDate-BRJgtOGm.js";
15
15
  import "./react-dom-BTJzcVJ9.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/islands",
3
- "version": "0.23.15-dev44",
3
+ "version": "0.23.15-dev48",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -210,7 +210,7 @@ describe("WidgetRegistry.getWidget", () => {
210
210
  });
211
211
 
212
212
  afterEach(() => {
213
- getModuleSpy.mockRestore();
213
+ vi.restoreAllMocks();
214
214
  });
215
215
 
216
216
  it("binds an undisplayed widget from its ESM spec", async () => {
@@ -309,6 +309,7 @@ describe("WidgetRegistry.getWidget", () => {
309
309
  });
310
310
 
311
311
  it("rejects with the AFM error when the module has no usable exports", async () => {
312
+ const invalidateSpy = vi.spyOn(WIDGET_DEF_REGISTRY, "invalidate");
312
313
  getModuleSpy.mockResolvedValue({ notAWidget: true });
313
314
 
314
315
  const model = new Model<ModelState>({ count: 0 }, createMockComm());
@@ -318,6 +319,7 @@ describe("WidgetRegistry.getWidget", () => {
318
319
  await expect(registry.getWidget(testId)).rejects.toThrow(
319
320
  /missing a default export/,
320
321
  );
322
+ expect(invalidateSpy).toHaveBeenCalledWith(SPEC.hash);
321
323
  });
322
324
 
323
325
  it("rejects when the model never arrives", async () => {
@@ -95,6 +95,16 @@ describe("WidgetDefRegistry", () => {
95
95
  promise1.catch(() => undefined);
96
96
  });
97
97
 
98
+ it("should retry a new URL after invalidating the same hash", () => {
99
+ const promise1 = getModule(registry, "http://localhost/a.js", "same-hash");
100
+ registry.invalidate("same-hash");
101
+ const promise2 = getModule(registry, "http://localhost/b.js", "same-hash");
102
+
103
+ expect(promise1).not.toBe(promise2);
104
+ promise1.catch(() => undefined);
105
+ promise2.catch(() => undefined);
106
+ });
107
+
98
108
  it("should create different promises for different hashes", () => {
99
109
  const promise1 = getModule(registry, "http://localhost/a.js", "hash-a");
100
110
  const promise2 = getModule(registry, "http://localhost/b.js", "hash-b");
@@ -211,6 +211,7 @@ export class WidgetRuntime {
211
211
  });
212
212
  const widget = resolveAnyWidget(mod, spec.url);
213
213
  if (!widget) {
214
+ WIDGET_DEF_REGISTRY.invalidate(spec.hash);
214
215
  throw getInvalidAnyWidgetModuleError(mod, spec.url);
215
216
  }
216
217
  return WidgetBinding.create({
@@ -80,6 +80,10 @@ class WidgetDefRegistry {
80
80
  return promise;
81
81
  }
82
82
 
83
+ invalidate(jsHash: string): void {
84
+ this.#cache.delete(jsHash);
85
+ }
86
+
83
87
  async #doImport(
84
88
  jsUrl: string,
85
89
  opts: { kernelAuthored?: boolean } = {},