@marimo-team/islands 0.23.9-dev43 → 0.23.9-dev45

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.
@@ -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.9-dev43");
35123
+ marimoVersionAtom = atom(getVersionFromMountConfig() || "0.23.9-dev45");
35124
35124
  showCodeInRunModeAtom = atom(true);
35125
35125
  atom(null);
35126
35126
  var import_compiler_runtime = require_compiler_runtime();
package/dist/main.js CHANGED
@@ -26,7 +26,7 @@ import { $ as useCellActions, An as LoaderCircle, At as DeferredRequestRegistry,
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-BaESJOBg.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-CDsEg2QC.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";
@@ -36094,7 +36094,7 @@ ${c}
36094
36094
  if (l && l !== "slide") return l;
36095
36095
  if (c == null ? void 0 : c.has(e)) return "skip";
36096
36096
  }
36097
- var LazySlidesComponent = import_react.lazy(() => import("./reveal-component-B6dilxTq.js"));
36097
+ var LazySlidesComponent = import_react.lazy(() => import("./reveal-component-X3DvD8Y2.js"));
36098
36098
  const SlidesLayoutRenderer = ({ layout: e, setLayout: r, cells: c, mode: l }) => {
36099
36099
  var _a3;
36100
36100
  let u = useAtomValue(kioskModeAtom), d = l === "read" || u, f = useAtomValue(numColumnsAtom) > 1, [p, m] = (0, import_react.useState)(null), { cellsWithOutput: h, skippedIds: g, slideTypes: _, startCellIndex: v } = (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 { ct as kioskModeAtom } from "./html-to-image-BHv7CEU_.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-BaESJOBg.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-CDsEg2QC.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.9-dev43",
3
+ "version": "0.23.9-dev45",
4
4
  "main": "dist/main.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",
@@ -65,6 +65,11 @@ export interface CellEditorProps
65
65
  hasOutput?: boolean;
66
66
  languageAdapter: LanguageAdapterType | undefined;
67
67
  showLanguageToggles?: boolean;
68
+ /**
69
+ * Override for the inline "Edit with AI" tooltip. Defaults to the user's
70
+ * `ai.inline_tooltip` config. Set to `false` to force-disable it.
71
+ */
72
+ inlineAiTooltip?: boolean;
68
73
  setLanguageAdapter: React.Dispatch<
69
74
  React.SetStateAction<LanguageAdapterType | undefined>
70
75
  >;
@@ -73,6 +78,12 @@ export interface CellEditorProps
73
78
  editorViewParentRef?: React.RefObject<HTMLDivElement | null>;
74
79
  showHiddenCode: (opts?: { focus?: boolean }) => void;
75
80
  outputArea?: "above" | "below";
81
+ /**
82
+ * CSS selector for the element that editor tooltips (completions, hover,
83
+ * signature help) are appended to. Useful for fullscreen/dialog containers;
84
+ * defaults to `#App`.
85
+ */
86
+ tooltipParentSelector?: string;
76
87
  }
77
88
 
78
89
  const CellEditorInternal = ({
@@ -94,7 +105,9 @@ const CellEditorInternal = ({
94
105
  languageAdapter,
95
106
  setLanguageAdapter,
96
107
  showLanguageToggles = true,
108
+ inlineAiTooltip,
97
109
  outputArea,
110
+ tooltipParentSelector,
98
111
  }: CellEditorProps) => {
99
112
  const [aiCompletionCell, setAiCompletionCell] = useAtom(aiCompletionCellAtom);
100
113
  const deleteCell = useDeleteCellCallback();
@@ -224,7 +237,9 @@ const CellEditorInternal = ({
224
237
  hotkeys: new OverridingHotkeyProvider(userConfig.keymap.overrides ?? {}),
225
238
  diagnosticsConfig: userConfig.diagnostics,
226
239
  displayConfig: userConfig.display,
227
- inlineAiTooltip: userConfig.ai?.inline_tooltip ?? false,
240
+ inlineAiTooltip:
241
+ inlineAiTooltip ?? userConfig.ai?.inline_tooltip ?? false,
242
+ tooltipParentSelector,
228
243
  });
229
244
 
230
245
  extensions.push(
@@ -274,6 +289,8 @@ const CellEditorInternal = ({
274
289
  userConfig.display,
275
290
  userConfig.diagnostics,
276
291
  userConfig.ai?.inline_tooltip,
292
+ inlineAiTooltip,
293
+ tooltipParentSelector,
277
294
  aiFeaturesEnabled,
278
295
  theme,
279
296
  showPlaceholder,
@@ -3,6 +3,7 @@
3
3
  import { useMemo, useRef, useState } from "react";
4
4
  import type { EditorView } from "@codemirror/view";
5
5
  import { useAtomValue } from "jotai";
6
+ import { cellDomProps } from "@/components/editor/common";
6
7
  import { CellEditor } from "@/components/editor/cell/code/cell-editor";
7
8
  import { CellStatusComponent } from "@/components/editor/cell/CellStatus";
8
9
  import { RunButton } from "@/components/editor/cell/RunButton";
@@ -111,7 +112,10 @@ export const SlideCellView = ({ cell }: { cell: RuntimeCell }) => {
111
112
  );
112
113
 
113
114
  const editor = (
114
- <div className={editorWrapperClassName}>
115
+ <div
116
+ className={editorWrapperClassName}
117
+ {...cellDomProps(cell.id, cell.name)}
118
+ >
115
119
  <CellEditor
116
120
  theme={theme}
117
121
  showPlaceholder={false}
@@ -134,7 +138,14 @@ export const SlideCellView = ({ cell }: { cell: RuntimeCell }) => {
134
138
  languageAdapter={languageAdapter}
135
139
  setLanguageAdapter={setLanguageAdapter}
136
140
  showLanguageToggles={false}
141
+ // The reveal.js transforms in slides view break the inline AI
142
+ // tooltip's fixed positioning, so disable it here.
143
+ inlineAiTooltip={false}
137
144
  outputArea={cellOutputPosition}
145
+ // Parent tooltips (completions, hover, signature help) to the Reveal
146
+ // viewport so they stay visible when presenting fullscreen; `#App` sits
147
+ // outside the fullscreened subtree and would never paint.
148
+ tooltipParentSelector=".reveal-viewport"
138
149
  />
139
150
  {toolbar}
140
151
  </div>
@@ -83,6 +83,11 @@ export interface CodeMirrorSetupOpts {
83
83
  diagnosticsConfig: DiagnosticsConfig;
84
84
  displayConfig: Pick<DisplayConfig, "reference_highlighting">;
85
85
  inlineAiTooltip: boolean;
86
+ /**
87
+ * CSS selector for the element that CodeMirror tooltips (completions, hover,
88
+ * signature help) should be appended to. Defaults to `#App`.
89
+ */
90
+ tooltipParentSelector?: string;
86
91
  }
87
92
 
88
93
  function getPlaceholderType(opts: CodeMirrorSetupOpts) {
@@ -90,6 +95,46 @@ function getPlaceholderType(opts: CodeMirrorSetupOpts) {
90
95
  return showPlaceholder ? "marimo-import" : enableAI ? "ai" : "none";
91
96
  }
92
97
 
98
+ const CODEMIRROR_TOOLTIP_PORTAL_CLASS = "cm-tooltip-portal";
99
+
100
+ /**
101
+ * Resolve the element that editor tooltips (completions, hover, signature help)
102
+ * should be appended to.
103
+ *
104
+ * The default `#App` parent is returned directly. Custom parents are useful
105
+ * when editors live inside a fullscreen subtree, dialog, or scoped typography
106
+ * region. In those cases we append tooltips to a dedicated `not-prose` portal
107
+ * inside the requested parent, reusing it across cells so surrounding typography
108
+ * styles don't leak into editor popups.
109
+ */
110
+ function resolveCodeMirrorTooltipParent(
111
+ selector: string | undefined,
112
+ ): HTMLElement | undefined {
113
+ if (selector == null) {
114
+ return document.querySelector<HTMLElement>("#App") ?? undefined;
115
+ }
116
+
117
+ const host = document.querySelector<HTMLElement>(selector);
118
+ if (host == null) {
119
+ return undefined;
120
+ }
121
+
122
+ const existing = host.querySelector<HTMLElement>(
123
+ `:scope > .${CODEMIRROR_TOOLTIP_PORTAL_CLASS}`,
124
+ );
125
+ if (existing != null) {
126
+ return existing;
127
+ }
128
+
129
+ const portal = document.createElement("div");
130
+ // `not-prose` escapes scoped typography; `contents` keeps the wrapper
131
+ // layout-neutral. Tooltips are `position: fixed`, so the wrapper having no
132
+ // box doesn't affect positioning.
133
+ portal.className = `${CODEMIRROR_TOOLTIP_PORTAL_CLASS} not-prose contents`;
134
+ host.append(portal);
135
+ return portal;
136
+ }
137
+
93
138
  /**
94
139
  * Setup CodeMirror for a cell
95
140
  */
@@ -180,6 +225,7 @@ export const basicBundle = (opts: CodeMirrorSetupOpts): Extension[] => {
180
225
  cellId,
181
226
  lspConfig,
182
227
  diagnosticsConfig,
228
+ tooltipParentSelector,
183
229
  } = opts;
184
230
  const placeholderType = getPlaceholderType(opts);
185
231
  const autoClosePairs = completionConfig.auto_close_pairs !== false;
@@ -200,7 +246,7 @@ export const basicBundle = (opts: CodeMirrorSetupOpts): Extension[] => {
200
246
  position: "fixed",
201
247
  // This the z-index multiple tooltips being stacked
202
248
  // For example, if we have a hover tooltip and a completion tooltip
203
- parent: document.querySelector<HTMLElement>("#App") ?? undefined,
249
+ parent: resolveCodeMirrorTooltipParent(tooltipParentSelector),
204
250
  }),
205
251
  scrollActiveLineIntoViewExtension(),
206
252
  theme === "dark" ? darkTheme : lightTheme,