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

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-CNa5ok96.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-DKr4f1di.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-CNa5ok96.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-dev3");
35124
35124
  showCodeInRunModeAtom = atom(true);
35125
35125
  atom(null);
35126
35126
  var import_compiler_runtime = require_compiler_runtime();
@@ -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-CNa5ok96.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-DfnO0DcH.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-DKr4f1di.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-C1tL1pML.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-UdMnCK5U.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-CNa5ok96.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-CNa5ok96.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-DfnO0DcH.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-dev3",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -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");
@@ -403,22 +403,29 @@ function findScopedDefinitionPosition(
403
403
  }
404
404
 
405
405
  /**
406
- * This function will select the first occurrence of the given variable name,
407
- * for a given editor view.
406
+ * This function selects a scoped definition for the given variable name, when
407
+ * a usage position is available, or optionally falls back to the first matching
408
+ * variable name in the given editor view.
408
409
  * @param view The editor view which contains the variable name.
409
410
  * @param variableName The name of the variable to select, if found in the editor.
410
411
  * @param usagePosition The position of the variable usage, if available.
412
+ * @param fallbackToFirstMatch Whether to fall back to the first matching
413
+ * variable name when no scoped definition is found. Defaults to true.
411
414
  */
412
415
  export function goToVariableDefinition(
413
416
  view: EditorView,
414
417
  variableName: string,
415
418
  usagePosition?: number,
419
+ fallbackToFirstMatch = true,
416
420
  ): boolean {
417
421
  const { state } = view;
418
- const from =
419
- (usagePosition !== undefined
420
- ? findScopedDefinitionPosition(state, variableName, usagePosition)
421
- : null) ?? findFirstMatchingVariable(state, variableName);
422
+ let from: number | null = null;
423
+ if (usagePosition !== undefined) {
424
+ from = findScopedDefinitionPosition(state, variableName, usagePosition);
425
+ }
426
+ if (from === null && fallbackToFirstMatch) {
427
+ from = findFirstMatchingVariable(state, variableName);
428
+ }
422
429
 
423
430
  if (from === null) {
424
431
  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;