@marimo-team/islands 0.23.10-dev2 → 0.23.10-dev4

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.
@@ -6,13 +6,13 @@ import { _ as Logger, c as Objects, g as cn, l as useEventListener, t as Button
6
6
  import { t as require_react } from "./react-DA-nE2FX.js";
7
7
  import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
8
8
  import { r as toast } from "./copy-BuQpJEzp.js";
9
- import { An as LoaderCircle, C as AccordionContent, D as ChatBubbleIcon, Fn as ExternalLink, Ft as jotaiJsonStorage, G as cellErrorsAtom, Ht as allTablesAtom, It as variablesAtom, Kt as getRequestClient, Lt as PluralWord, Mn as Info, Nn as FileText, Ot as moveToEndOfEditor, P as base64ToDataURL, Rn as CircleX, S as Accordion, T as AccordionTrigger, Tn as Trash2, Tt as createVariableInfoElement, Ut as dataSourceConnectionsAtom, V as renderHTML, Wt as getTableType, Xt as singleFacet, Y as notebookAtom, _ as Boosts, b as AIContextProvider, c as Popover, d as PopoverTrigger, f as isOutputEmpty, gn as atomWithStorage, h as DatasourceContextProvider, jt as generateUUID, n as Spinner, on as CellOutputId, r as MarkdownRenderer, t as toPng, tn as ZodLocalStorage, u as PopoverContent, v as Sections, vn as Anchor2, vt as displayCellName, w as AccordionItem, wn as Wrench, x as AIContextRegistry, y as contextToXml } from "./html-to-image-Cp8O1OWB.js";
9
+ import { An as LoaderCircle, C as AccordionContent, D as ChatBubbleIcon, Fn as ExternalLink, Ft as jotaiJsonStorage, G as cellErrorsAtom, Ht as allTablesAtom, It as variablesAtom, Kt as getRequestClient, Lt as PluralWord, Mn as Info, Nn as FileText, Ot as moveToEndOfEditor, P as base64ToDataURL, Rn as CircleX, S as Accordion, T as AccordionTrigger, Tn as Trash2, Tt as createVariableInfoElement, Ut as dataSourceConnectionsAtom, V as renderHTML, Wt as getTableType, Xt as singleFacet, Y as notebookAtom, _ as Boosts, b as AIContextProvider, c as Popover, d as PopoverTrigger, f as isOutputEmpty, gn as atomWithStorage, h as DatasourceContextProvider, jt as generateUUID, n as Spinner, on as CellOutputId, r as MarkdownRenderer, t as toPng, tn as ZodLocalStorage, u as PopoverContent, v as Sections, vn as Anchor2, vt as displayCellName, w as AccordionItem, wn as Wrench, x as AIContextRegistry, y as contextToXml } from "./html-to-image-DS-GYb0Y.js";
10
10
  import "./chunk-5FQGJX7Z-BNjes6Yx.js";
11
11
  import { u as createLucideIcon } from "./dist-C1BYNeCR.js";
12
12
  import { F as X, L as ChevronDown, S as logNever, t as Strings } from "./strings-Bu3vlb6W.js";
13
13
  import { a as NumberField, b as DropdownMenuTrigger, d as DropdownMenuContent, p as DropdownMenuItem, r as Input, u as DropdownMenu } from "./input-_2sjvfne.js";
14
14
  import { p as isUrl, v as CircleQuestionMark } from "./toDate-x-WRDCH7.js";
15
- import { a as MarimoIncomingMessageEvent, d as Square, f as File$1, n as blobToString, t as processOutput, u as deserializeBlob } from "./process-output-CaUUWhh8.js";
15
+ import { a as MarimoIncomingMessageEvent, d as Square, f as File$1, n as blobToString, t as processOutput, u as deserializeBlob } from "./process-output-BdlB3Vhy.js";
16
16
  import "./react-dom-BTJzcVJ9.js";
17
17
  import { t as require_jsx_runtime } from "./jsx-runtime-DebpN0FN.js";
18
18
  import { A as looseObject, B as union, C as any, D as discriminatedUnion, E as custom, H as safeParseAsync, I as record, L as strictObject, M as never, N as number, O as lazy, P as object$1, R as string, S as _null, T as boolean, V as unknown, W as toJSONSchema, b as _enum, k as literal, w as array$1, x as _instanceof } from "./zod-CoBiJ5v4.js";
@@ -6,7 +6,7 @@ import { _ as Logger, c as Objects, g as cn, h as Events, m as useComposedRefs,
6
6
  import { t as require_react } from "./react-DA-nE2FX.js";
7
7
  import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
8
8
  import { n as Copy, r as toast, t as copyToClipboard } from "./copy-BuQpJEzp.js";
9
- import { $ as useCellActions, $t as getTracebackInfo, A as ChevronRightIcon, An as LoaderCircle, Bn as Braces, C as AccordionContent, Fn as ExternalLink, Ft as jotaiJsonStorage, Hn as import_lib, I as base64ToUint8Array, Jt as useRequestClient, Kt as getRequestClient, Lt as PluralWord, M as PinLeftIcon, Mn as Info, Mt as useChromeActions, N as PinRightIcon, Nn as FileText, O as CheckIcon, On as NotebookPen, Pt as adaptForLocalStorage, Qt as extractAllTracebackInfo, R as extractBase64FromDataURL, Rn as CircleX, S as Accordion, St as Checkbox, T as AccordionTrigger, Tn as Trash2, V as renderHTML, Vn as esm_default, Y as notebookAtom, Zt as elementContainsMarimoCellFile, _t as getCellDomProps, at as AnsiUp, c as Popover, cn as SCRATCH_CELL_ID, ct as kioskModeAtom, d as PopoverTrigger, dt as outputIsLoading, et as useCellIds, g as getDatasourceContext, gn as atomWithStorage, gt as DATA_CELL_ID, ht as sanitizeHtml, j as DotFilledIcon, kn as Minus, kt as goToCellLine, l as PopoverClose, lt as useInstallAllowed, m as useExpandedOutput, mn as jsonToMarkdown, n as Spinner, nn as filenameAtom, on as CellOutputId, pn as jsonParseWithSpecialChar, q as getCellEditorView, r as MarkdownRenderer, sn as HTMLCellId, t as toPng, tt as useCellNames, u as PopoverContent, ut as viewStateAtom, vt as displayCellName, w as AccordionItem, wn as Wrench, yn as Close$1, z as isDataURLString, zt as DATA_TYPE_ICON, __tla as __tla_0 } from "./html-to-image-Cp8O1OWB.js";
9
+ import { $ as useCellActions, $t as getTracebackInfo, A as ChevronRightIcon, An as LoaderCircle, Bn as Braces, C as AccordionContent, Fn as ExternalLink, Ft as jotaiJsonStorage, Hn as import_lib, I as base64ToUint8Array, Jt as useRequestClient, Kt as getRequestClient, Lt as PluralWord, M as PinLeftIcon, Mn as Info, Mt as useChromeActions, N as PinRightIcon, Nn as FileText, O as CheckIcon, On as NotebookPen, Pt as adaptForLocalStorage, Qt as extractAllTracebackInfo, R as extractBase64FromDataURL, Rn as CircleX, S as Accordion, St as Checkbox, T as AccordionTrigger, Tn as Trash2, V as renderHTML, Vn as esm_default, Y as notebookAtom, Zt as elementContainsMarimoCellFile, _t as getCellDomProps, at as AnsiUp, c as Popover, cn as SCRATCH_CELL_ID, ct as kioskModeAtom, d as PopoverTrigger, dt as outputIsLoading, et as useCellIds, g as getDatasourceContext, gn as atomWithStorage, gt as DATA_CELL_ID, ht as sanitizeHtml, j as DotFilledIcon, kn as Minus, kt as goToCellLine, l as PopoverClose, lt as useInstallAllowed, m as useExpandedOutput, mn as jsonToMarkdown, n as Spinner, nn as filenameAtom, on as CellOutputId, pn as jsonParseWithSpecialChar, q as getCellEditorView, r as MarkdownRenderer, sn as HTMLCellId, t as toPng, tt as useCellNames, u as PopoverContent, ut as viewStateAtom, vt as displayCellName, w as AccordionItem, wn as Wrench, yn as Close$1, z as isDataURLString, zt as DATA_TYPE_ICON, __tla as __tla_0 } from "./html-to-image-DS-GYb0Y.js";
10
10
  import { o as useSize, u as createLucideIcon } from "./dist-C1BYNeCR.js";
11
11
  import { c as Calendar, i as createReducerAndAtoms, r as Badge } from "./useLifecycle-BBO9PIph.js";
12
12
  import { a as ListFilter, i as Table$1, n as $fb18d541ea1ad717$export$ad991b66133851cf, o as ChartPie, r as $5a387cc49350e6db$export$722debc0e56fea39, t as $896ba0a80a8f4d36$export$85fd5fdf27bacc79 } from "./useDateFormatter-BA4FCquG.js";
@@ -35120,7 +35120,7 @@ ${d}`,
35120
35120
  return Logger.warn("Failed to get version from mount config"), null;
35121
35121
  }
35122
35122
  }
35123
- marimoVersionAtom = atom(getVersionFromMountConfig() || "0.23.10-dev2");
35123
+ marimoVersionAtom = atom(getVersionFromMountConfig() || "0.23.10-dev4");
35124
35124
  showCodeInRunModeAtom = atom(true);
35125
35125
  atom(null);
35126
35126
  var import_compiler_runtime = require_compiler_runtime();
@@ -19838,8 +19838,8 @@ ${n.sqlString}
19838
19838
  "ClassDefinition"
19839
19839
  ]);
19840
19840
  function goToPosition(e, t) {
19841
- e.focus(), requestAnimationFrame(() => {
19842
- e.dispatch({
19841
+ requestAnimationFrame(() => {
19842
+ e.focus(), e.dispatch({
19843
19843
  selection: {
19844
19844
  anchor: t,
19845
19845
  head: t
@@ -20010,9 +20010,9 @@ ${n.sqlString}
20010
20010
  }
20011
20011
  return null;
20012
20012
  }
20013
- function goToVariableDefinition(e, t, n) {
20014
- let { state: r } = e, i = (n === void 0 ? null : findScopedDefinitionPosition(r, t, n)) ?? findFirstMatchingVariable(r, t);
20015
- return i === null ? false : (goToPosition(e, i), true);
20013
+ function goToVariableDefinition(e, t, n, r = true) {
20014
+ let { state: i } = e, a = null;
20015
+ return n !== void 0 && (a = findScopedDefinitionPosition(i, t, n)), a === null && r && (a = findFirstMatchingVariable(i, t)), a === null ? false : (goToPosition(e, a), true);
20016
20016
  }
20017
20017
  function goToLine(e, t) {
20018
20018
  return goToPosition(e, e.state.doc.line(t).from), true;
package/dist/main.js CHANGED
@@ -22,17 +22,17 @@ import { _ as Logger, c as Objects, g as cn, h as Events, i as NOT_SET, l as use
22
22
  import { t as require_react } from "./react-DA-nE2FX.js";
23
23
  import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
24
24
  import { n as Copy, r as toast, t as copyToClipboard } from "./copy-BuQpJEzp.js";
25
- import { $ as useCellActions, An as LoaderCircle, At as DeferredRequestRegistry, B as safeExtractSetUIElementMessageBuffers, Bn as Braces, Bt as getDataTypeColor, C as AccordionContent, Cn as Trigger2, Ct as customPythonLanguageSupport, Dn as PaintRoller, Dt as Paths, E as BorderAllIcon, En as Table2, Et as PathBuilder, F as base64ToDataView, Ft as jotaiJsonStorage, Gt as convertStatsName, H as getMarimoExportContext, In as Database, J as getCellNames, Jt as useRequestClient, K as createActions, Kt as getRequestClient, L as dataViewToBase64, Ln as Columns2, Mn as Info, Nn as FileText, Nt as repl, Pn as Eye, Q as reducer, Rt as PluralWords, S as Accordion, Sn as Root2$1, St as Checkbox, T as AccordionTrigger, Tn as Trash2, U as hasTrustedExportContext, V as renderHTML, Vt as require_client, W as hasRunAnyCellAtom, X as notebookOutline, Y as notebookAtom, Yt as isUninstantiated, Z as numColumnsAtom, _n as selectAtom, a as useCellFocusActions, an as parseInitialValue, bn as Content2, bt as isInternalCellName, ct as kioskModeAtom, dn as OBJECT_ID_ATTR, dt as outputIsLoading, en as NotebookScopedLocalStorage, et as useCellIds, f as isOutputEmpty, fn as RANDOM_ID_ATTR, ft as outputIsStale, gn as atomWithStorage, hn as atomWithReducer, i as LazyAnyLanguageCodeMirror, in as parseDataset, jn as Layers, jt as generateUUID, k as ChevronDownIcon, ln as UIElementId, mt as headingToIdentifier, n as Spinner, nt as createCell, o as useLastFocusedCellId, ot as getInitialAppMode, p as useExpandedConsoleOutput, pn as jsonParseWithSpecialChar, pt as isErrorMime, qt as requestClientAtom, rn as parseAttrValue, s as maybeAddAltairImport, sn as HTMLCellId, st as initialModeAtom, un as findCellId, w as AccordionItem, wt as MarkdownLanguageAdapter, xn as Item$1, xt as normalizeName, yt as getValidName, zn as CircleAlert, zt as DATA_TYPE_ICON, __tla as __tla_0 } from "./html-to-image-Cp8O1OWB.js";
25
+ import { $ as useCellActions, An as LoaderCircle, At as DeferredRequestRegistry, B as safeExtractSetUIElementMessageBuffers, Bn as Braces, Bt as getDataTypeColor, C as AccordionContent, Cn as Trigger2, Ct as customPythonLanguageSupport, Dn as PaintRoller, Dt as Paths, E as BorderAllIcon, En as Table2, Et as PathBuilder, F as base64ToDataView, Ft as jotaiJsonStorage, Gt as convertStatsName, H as getMarimoExportContext, In as Database, J as getCellNames, Jt as useRequestClient, K as createActions, Kt as getRequestClient, L as dataViewToBase64, Ln as Columns2, Mn as Info, Nn as FileText, Nt as repl, Pn as Eye, Q as reducer, Rt as PluralWords, S as Accordion, Sn as Root2$1, St as Checkbox, T as AccordionTrigger, Tn as Trash2, U as hasTrustedExportContext, V as renderHTML, Vt as require_client, W as hasRunAnyCellAtom, X as notebookOutline, Y as notebookAtom, Yt as isUninstantiated, Z as numColumnsAtom, _n as selectAtom, a as useCellFocusActions, an as parseInitialValue, bn as Content2, bt as isInternalCellName, ct as kioskModeAtom, dn as OBJECT_ID_ATTR, dt as outputIsLoading, en as NotebookScopedLocalStorage, et as useCellIds, f as isOutputEmpty, fn as RANDOM_ID_ATTR, ft as outputIsStale, gn as atomWithStorage, hn as atomWithReducer, i as LazyAnyLanguageCodeMirror, in as parseDataset, jn as Layers, jt as generateUUID, k as ChevronDownIcon, ln as UIElementId, mt as headingToIdentifier, n as Spinner, nt as createCell, o as useLastFocusedCellId, ot as getInitialAppMode, p as useExpandedConsoleOutput, pn as jsonParseWithSpecialChar, pt as isErrorMime, qt as requestClientAtom, rn as parseAttrValue, s as maybeAddAltairImport, sn as HTMLCellId, st as initialModeAtom, un as findCellId, w as AccordionItem, wt as MarkdownLanguageAdapter, xn as Item$1, xt as normalizeName, yt as getValidName, zn as CircleAlert, zt as DATA_TYPE_ICON, __tla as __tla_0 } from "./html-to-image-DS-GYb0Y.js";
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-B88v1No3.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-Dly0oW20.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";
33
33
  import { I as $64fa3d84918910a7$export$29f1550f4b0d4415, K as useDebounceControlledState, L as $64fa3d84918910a7$export$4d86445c2cf5e3, Mt as $65484d02dcb7eb3e$export$457c3d6518dd4c6f, Nt as $3ef42575df84b30b$export$9d1611c77c2fe928, V as $64fa3d84918910a7$export$df3a06d6289f983e, Vt as $ff5963eb1fccf552$export$e08e3b67e392101e, a as NumberField, b as DropdownMenuTrigger, c as prettyNumber, d as DropdownMenuContent, f as DropdownMenuGroup, fn as Circle, g as DropdownMenuSeparator, i as OnBlurredInput, it as $701a24aa0da5b062$export$ea18c227d4417cc3, l as prettyScientificNumber, m as DropdownMenuLabel, n as DebouncedNumberInput, p as DropdownMenuItem, pn as ChevronRight, q as useDebouncedCallback, r as Input, rt as $f7dceffc5ad7768b$export$4e328f61c538687f, t as DebouncedInput, u as DropdownMenu, ut as $6179b936705e76d3$export$ae780daf29e6d456, vt as $458b0a5536c1a7cf$export$40bfa8c7b0832715 } from "./input-_2sjvfne.js";
34
34
  import { _ as isWasm, c as asRemoteURL, d as isStaticNotebook, f as appendQueryParams, g as Deferred, m as require_cuid2, u as getStaticVirtualFiles, v as CircleQuestionMark } from "./toDate-x-WRDCH7.js";
35
- import { a as MarimoIncomingMessageEvent, c as MarimoValueUpdateEvent, d as Square, f as File, i as PythonIcon, l as createInputEvent, n as blobToString, o as MarimoValueInputEvent, r as filesToBase64, s as MarimoValueReadyEvent, t as processOutput, u as deserializeBlob } from "./process-output-CaUUWhh8.js";
35
+ import { a as MarimoIncomingMessageEvent, c as MarimoValueUpdateEvent, d as Square, f as File, i as PythonIcon, l as createInputEvent, n as blobToString, o as MarimoValueInputEvent, r as filesToBase64, s as MarimoValueReadyEvent, t as processOutput, u as deserializeBlob } from "./process-output-BdlB3Vhy.js";
36
36
  import { n as Trash, r as Pencil, t as BulkEdit } from "./types-CVvp1fKr.js";
37
37
  import { n as require_prop_types, r as Plus, t as ErrorBoundary } from "./ErrorBoundary-rULOrC_p.js";
38
38
  import { t as require_react_dom } from "./react-dom-BTJzcVJ9.js";
@@ -5590,7 +5590,7 @@ let __tla = Promise.all([
5590
5590
  };
5591
5591
  }
5592
5592
  };
5593
- var LazyChatbot = import_react.lazy(() => import("./chat-ui-ar37brtL.js").then((e) => ({
5593
+ var LazyChatbot = import_react.lazy(() => import("./chat-ui-TL2w0gQI.js").then((e) => ({
5594
5594
  default: e.Chatbot
5595
5595
  }))), messageSchema = array(object({
5596
5596
  id: string(),
@@ -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-CfFoUPFg.js"));
36119
+ var LazySlidesComponent = import_react.lazy(() => import("./reveal-component-Dj7ybE5_.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), [
@@ -1,6 +1,6 @@
1
1
  import { s as __toESM } from "./chunk-BNovOVIE.js";
2
2
  import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
3
- import { it as parseHtmlContent, rt as ansiToPlainText } from "./html-to-image-Cp8O1OWB.js";
3
+ import { it as parseHtmlContent, rt as ansiToPlainText } from "./html-to-image-DS-GYb0Y.js";
4
4
  import { u as createLucideIcon } from "./dist-C1BYNeCR.js";
5
5
  import { t as Strings } from "./strings-Bu3vlb6W.js";
6
6
  import { t as require_jsx_runtime } from "./jsx-runtime-DebpN0FN.js";
@@ -6,10 +6,10 @@ import { s as __toESM } from "./chunk-BNovOVIE.js";
6
6
  import { _ as Logger, g as cn, h as Events, l as useEventListener, t as Button } from "./button-C5K9fIPF.js";
7
7
  import { t as require_react } from "./react-DA-nE2FX.js";
8
8
  import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
9
- import { ct as kioskModeAtom } from "./html-to-image-Cp8O1OWB.js";
9
+ import { ct as kioskModeAtom } from "./html-to-image-DS-GYb0Y.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-B88v1No3.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-Dly0oW20.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marimo-team/islands",
3
- "version": "0.23.10-dev2",
3
+ "version": "0.23.10-dev4",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -61,6 +61,7 @@ export const CellActionsContextMenu = ({
61
61
  });
62
62
  const [imageRightClicked, setImageRightClicked] =
63
63
  React.useState<HTMLImageElement>();
64
+ const suppressCloseAutoFocus = React.useRef(false);
64
65
 
65
66
  const DEFAULT_CONTEXT_MENU_ITEMS: ActionButton[] = [
66
67
  {
@@ -166,7 +167,10 @@ export const CellActionsContextMenu = ({
166
167
  handle: () => {
167
168
  const editorView = getEditorView();
168
169
  if (editorView) {
169
- goToDefinitionAtCursorPosition(editorView);
170
+ // Only suppress focus restoration when we actually navigated;
171
+ // otherwise let Radix return focus to the trigger cell.
172
+ suppressCloseAutoFocus.current =
173
+ goToDefinitionAtCursorPosition(editorView);
170
174
  }
171
175
  },
172
176
  },
@@ -194,7 +198,16 @@ export const CellActionsContextMenu = ({
194
198
  >
195
199
  {children}
196
200
  </ContextMenuTrigger>
197
- <ContextMenuContent className="w-[300px]" scrollable={true}>
201
+ <ContextMenuContent
202
+ className="w-[300px]"
203
+ scrollable={true}
204
+ onCloseAutoFocus={(evt) => {
205
+ if (suppressCloseAutoFocus.current) {
206
+ evt.preventDefault();
207
+ suppressCloseAutoFocus.current = false;
208
+ }
209
+ }}
210
+ >
198
211
  {visibleActions.map((group, i) => (
199
212
  <Fragment key={i}>
200
213
  {group.map((action) => {
@@ -39,6 +39,43 @@ afterEach(() => {
39
39
  });
40
40
 
41
41
  describe("goToDefinitionAtCursorPosition", () => {
42
+ test("jumps to a reactive variable definition in another cell", async () => {
43
+ const definingCell = cellId("defining-cell");
44
+ const usageCell = cellId("usage-cell");
45
+ const definingCode = "a = 10";
46
+ const usageCode = "print(a)";
47
+
48
+ const definingView = createEditor(definingCode, definingCode.length);
49
+ const usageView = createEditor(usageCode, usageCode.indexOf("a"));
50
+ views.push(definingView, usageView);
51
+
52
+ const notebook = initialNotebookState();
53
+ notebook.cellHandles[definingCell] = {
54
+ current: { editorView: definingView, editorViewOrNull: definingView },
55
+ };
56
+ notebook.cellHandles[usageCell] = {
57
+ current: { editorView: usageView, editorViewOrNull: usageView },
58
+ };
59
+
60
+ store.set(notebookAtom, notebook);
61
+ store.set(variablesAtom, {
62
+ [variableName("a")]: {
63
+ dataType: "int",
64
+ declaredBy: [definingCell],
65
+ name: variableName("a"),
66
+ usedBy: [usageCell],
67
+ value: "10",
68
+ },
69
+ });
70
+
71
+ const result = goToDefinitionAtCursorPosition(usageView);
72
+
73
+ expect(result).toBe(true);
74
+ await tick();
75
+ expect(definingView.state.selection.main.head).toBe(0);
76
+ expect(usageView.state.selection.main.head).toBe(usageCode.indexOf("a"));
77
+ });
78
+
42
79
  test("prefers the current-cell local definition over a reactive global", async () => {
43
80
  const globalCell = cellId("global-cell");
44
81
  const localCell = cellId("local-cell");
@@ -28,10 +28,11 @@ interface VariableDeclaration {
28
28
  }
29
29
 
30
30
  function goToPosition(view: EditorView, from: number): void {
31
- view.focus();
32
- // Wait for the next frame, otherwise codemirror will
33
- // add a cursor from a pointer click.
31
+ // Focus on the next frame: a synchronous focus is a no-op while a Radix
32
+ // context menu still owns focus, and codemirror would otherwise add a
33
+ // cursor from the pointer click.
34
34
  requestAnimationFrame(() => {
35
+ view.focus();
35
36
  view.dispatch({
36
37
  selection: {
37
38
  anchor: from,
@@ -403,22 +404,29 @@ function findScopedDefinitionPosition(
403
404
  }
404
405
 
405
406
  /**
406
- * This function will select the first occurrence of the given variable name,
407
- * for a given editor view.
407
+ * This function selects a scoped definition for the given variable name, when
408
+ * a usage position is available, or optionally falls back to the first matching
409
+ * variable name in the given editor view.
408
410
  * @param view The editor view which contains the variable name.
409
411
  * @param variableName The name of the variable to select, if found in the editor.
410
412
  * @param usagePosition The position of the variable usage, if available.
413
+ * @param fallbackToFirstMatch Whether to fall back to the first matching
414
+ * variable name when no scoped definition is found. Defaults to true.
411
415
  */
412
416
  export function goToVariableDefinition(
413
417
  view: EditorView,
414
418
  variableName: string,
415
419
  usagePosition?: number,
420
+ fallbackToFirstMatch = true,
416
421
  ): boolean {
417
422
  const { state } = view;
418
- const from =
419
- (usagePosition !== undefined
420
- ? findScopedDefinitionPosition(state, variableName, usagePosition)
421
- : null) ?? findFirstMatchingVariable(state, variableName);
423
+ let from: number | null = null;
424
+ if (usagePosition !== undefined) {
425
+ from = findScopedDefinitionPosition(state, variableName, usagePosition);
426
+ }
427
+ if (from === null && fallbackToFirstMatch) {
428
+ from = findFirstMatchingVariable(state, variableName);
429
+ }
422
430
 
423
431
  if (from === null) {
424
432
  return false;
@@ -82,6 +82,7 @@ export function goToDefinition(
82
82
  view,
83
83
  variableName,
84
84
  usagePosition,
85
+ false,
85
86
  );
86
87
  if (foundLocally) {
87
88
  return true;