@marimo-team/islands 0.22.1-dev2 → 0.22.1-dev20

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.
Files changed (42) hide show
  1. package/dist/{ConnectedDataExplorerComponent-Dl1grr8z.js → ConnectedDataExplorerComponent-iT7t3FxV.js} +1 -1
  2. package/dist/{chat-ui-CtqUthFR.js → chat-ui-C1HWLRKN.js} +1 -1
  3. package/dist/{loader-3c9hT4kT.js → loader-CMMa6QVT.js} +4 -1
  4. package/dist/main.js +131 -121
  5. package/dist/{process-output-KyzWazB-.js → process-output-CzWMmQcQ.js} +1 -1
  6. package/dist/style.css +1 -1
  7. package/dist/{useDeepCompareMemoize-X7clcrcQ.js → useDeepCompareMemoize-DOzKCTzc.js} +1 -1
  8. package/dist/{vega-component-A6unyUJS.js → vega-component-BaDgUvQP.js} +2 -2
  9. package/package.json +1 -1
  10. package/src/__tests__/branded.ts +6 -0
  11. package/src/components/chat/chat-panel.tsx +2 -1
  12. package/src/components/data-table/TableBottomBar.tsx +12 -1
  13. package/src/components/data-table/TableTopBar.tsx +31 -35
  14. package/src/components/data-table/charts/charts.tsx +40 -11
  15. package/src/components/data-table/column-explorer-panel/column-explorer.tsx +1 -1
  16. package/src/components/data-table/data-table.tsx +6 -1
  17. package/src/components/data-table/loading-table.tsx +4 -1
  18. package/src/components/data-table/range-focus/cell-selection-stats.tsx +3 -1
  19. package/src/components/data-table/row-viewer-panel/row-viewer.tsx +1 -1
  20. package/src/components/data-table/table-explorer-panel/table-explorer-panel.tsx +2 -2
  21. package/src/components/editor/ai/add-cell-with-ai.tsx +2 -1
  22. package/src/components/editor/chrome/panels/context-aware-panel/context-aware-panel.tsx +1 -1
  23. package/src/components/editor/chrome/wrapper/footer-items/lsp-status.tsx +2 -1
  24. package/src/core/cells/__tests__/apply-transaction.test.ts +12 -11
  25. package/src/core/cells/document-changes.ts +9 -9
  26. package/src/core/codemirror/copilot/__tests__/transport.test.ts +128 -2
  27. package/src/core/codemirror/copilot/client.ts +9 -2
  28. package/src/core/codemirror/copilot/language-server.ts +11 -0
  29. package/src/core/codemirror/copilot/transport.ts +32 -6
  30. package/src/core/islands/__tests__/bridge.test.ts +20 -10
  31. package/src/core/network/__tests__/requests-lazy.test.ts +30 -14
  32. package/src/core/websocket/useMarimoKernelConnection.tsx +5 -11
  33. package/src/core/websocket/useWebSocket.tsx +3 -1
  34. package/src/css/app/Cell.css +22 -1
  35. package/src/css/table.css +17 -0
  36. package/src/plugins/impl/DataTablePlugin.tsx +1 -0
  37. package/src/plugins/impl/vega/__tests__/utils.test.ts +68 -0
  38. package/src/plugins/impl/vega/utils.ts +14 -5
  39. package/src/plugins/impl/vega/vega.css +2 -1
  40. package/src/utils/json/base64.ts +2 -5
  41. package/src/utils/time.ts +4 -2
  42. package/src/utils/typed.ts +2 -2
@@ -14,7 +14,7 @@ import { b as createStore, g as useAtomValue, m as Provider, n as useTheme, y as
14
14
  import { t as invariant } from "./invariant-D4hPsZFI.js";
15
15
  import { n as ErrorBanner } from "./error-banner-Bx9kIgrs.js";
16
16
  import "./vega-loader.browser-DqEcFOPD.js";
17
- import { a as getContainerWidth, n as vegaLoadData, s as tooltipHandler } from "./loader-3c9hT4kT.js";
17
+ import { a as getContainerWidth, n as vegaLoadData, s as tooltipHandler } from "./loader-CMMa6QVT.js";
18
18
  import { t as useAsyncData } from "./useAsyncData-Cd4Urlww.js";
19
19
  import { n as q, r as contains } from "./react-vega-CzRAIHrv.js";
20
20
  import "./defaultLocale-qS7DaAmi.js";
@@ -5,7 +5,7 @@ import { s as __toESM, t as __commonJSMin } from "./chunk-BNovOVIE.js";
5
5
  import { t as require_react } from "./react-Bs6Z0kvn.js";
6
6
  import { t as require_compiler_runtime } from "./compiler-runtime-B_OLMU9S.js";
7
7
  import { r as toast } from "./copy-CBo9JcJW.js";
8
- import { A as AccordionItem, Bn as CircleX, C as Boosts, D as AIContextRegistry, Dn as Wrench, E as AIContextProvider, Et as displayCellName, Fn as File$1, Gt as PluralWord, H as ChatBubbleIcon, I as MarimoIncomingMessageEvent, It as moveToEndOfEditor, Mn as LoaderCircle, Nt as createVariableInfoElement, O as Accordion, On as Trash2, Pn as Info, Qt as getTableType, T as contextToXml, Tn as atomWithStorage, Ut as jotaiJsonStorage, Wt as variablesAtom, X as base64ToDataURL, Xt as allTablesAtom, Y as deserializeBlob, Zt as dataSourceConnectionsAtom, a as toPng, ct as notebookAtom, d as Spinner, en as getRequestClient, f as Popover, g as PopoverAnchor, h as PopoverTrigger, in as singleFacet, it as cellErrorsAtom, j as AccordionTrigger, k as AccordionContent, ln as ZodLocalStorage, m as PopoverContent, mn as CellOutputId, n as blobToString, o as MarkdownRenderer, rt as renderHTML, t as processOutput, v as isOutputEmpty, w as Sections, x as DatasourceContextProvider } from "./process-output-KyzWazB-.js";
8
+ import { A as AccordionItem, Bn as CircleX, C as Boosts, D as AIContextRegistry, Dn as Wrench, E as AIContextProvider, Et as displayCellName, Fn as File$1, Gt as PluralWord, H as ChatBubbleIcon, I as MarimoIncomingMessageEvent, It as moveToEndOfEditor, Mn as LoaderCircle, Nt as createVariableInfoElement, O as Accordion, On as Trash2, Pn as Info, Qt as getTableType, T as contextToXml, Tn as atomWithStorage, Ut as jotaiJsonStorage, Wt as variablesAtom, X as base64ToDataURL, Xt as allTablesAtom, Y as deserializeBlob, Zt as dataSourceConnectionsAtom, a as toPng, ct as notebookAtom, d as Spinner, en as getRequestClient, f as Popover, g as PopoverAnchor, h as PopoverTrigger, in as singleFacet, it as cellErrorsAtom, j as AccordionTrigger, k as AccordionContent, ln as ZodLocalStorage, m as PopoverContent, mn as CellOutputId, n as blobToString, o as MarkdownRenderer, rt as renderHTML, t as processOutput, v as isOutputEmpty, w as Sections, x as DatasourceContextProvider } from "./process-output-CzWMmQcQ.js";
9
9
  import "./chunk-5FQGJX7Z-C428iZBW.js";
10
10
  import { l as createLucideIcon } from "./dist-D2Rk1j4R.js";
11
11
  import { A as logNever, L as X, r as Strings, t as Label } from "./label-DTNqw9tv.js";
@@ -166,7 +166,10 @@ var Handler = class {
166
166
  pkg.version;
167
167
  const tooltipHandler = new Handler();
168
168
  function getContainerWidth(m2) {
169
- if (typeof m2 == "object" && m2 && "width" in m2) return m2.width;
169
+ if (typeof m2 == "object" && m2) {
170
+ if ("width" in m2) return m2.width;
171
+ if ("spec" in m2) return getContainerWidth(m2.spec);
172
+ }
170
173
  }
171
174
  function getVegaFieldTypes(m2) {
172
175
  return !m2 || Object.keys(m2).length === 0 ? "auto" : Objects.mapValues(m2, (m3) => m3 === "date" || m3 === "time" ? "string" : m3 === "datetime" ? "date" : m3);
package/dist/main.js CHANGED
@@ -21,7 +21,7 @@ import { a as __toCommonJS, n as __esmMin, r as __export, s as __toESM, t as __c
21
21
  import { t as require_react } from "./react-Bs6Z0kvn.js";
22
22
  import { t as require_compiler_runtime } from "./compiler-runtime-B_OLMU9S.js";
23
23
  import { n as Copy, r as toast, t as copyToClipboard } from "./copy-CBo9JcJW.js";
24
- import { $ as dataViewToBase64, $t as convertStatsName, A as AccordionItem, An as PaintRoller, At as Checkbox, B as createInputEvent, Bn as CircleX, Bt as useChromeActions, Cn as jsonToTSV, Ct as headingToIdentifier, Dn as Wrench, Dt as getValidName, En as selectAtom, Et as displayCellName, F as AccordionTrigger$1, Fn as File, Ft as Paths, G as ChevronRightIcon, Gt as PluralWord, Hn as Braces, Ht as adaptForLocalStorage, I as MarimoIncomingMessageEvent, In as FileText, J as PinRightIcon, Jt as getDataTypeColor, K as DotFilledIcon, Kt as PluralWords, L as MarimoValueInputEvent, Ln as Eye, Lt as goToCellLine, M as Accordion$1, Mn as LoaderCircle, Mt as MarkdownLanguageAdapter, N as AccordionContent$1, Nn as Layers, O as Accordion, On as Trash2, Ot as isInternalCellName, P as AccordionItem$1, Pn as Info, Pt as PathBuilder, Q as base64ToUint8Array, R as MarimoValueReadyEvent, Rn as Database, Rt as DeferredRequestRegistry, S as getDatasourceContext, Sn as jsonToMarkdown, St as isErrorMime, Tn as atomWithStorage, Tt as getCellDomProps, U as CheckIcon, Un as esm_default$1, Ut as jotaiJsonStorage, V as BorderAllIcon, Vn as CircleAlert, Vt as repl, W as ChevronDownIcon, Wn as import_lib, Y as deserializeBlob, Yt as require_client, Z as base64ToDataView, _ as PopoverClose, _n as UIElementId, _t as initialModeAtom, a as toPng, an as elementContainsMarimoCellFile, at as createActions, b as useExpandedOutput, bn as RANDOM_ID_ATTR, bt as outputIsLoading, c as useCellFocusActions, cn as NotebookScopedLocalStorage, ct as notebookAtom, d as Spinner, dn as parseAttrValue, dt as useCellActions, en as getRequestClient, et as extractBase64FromDataURL, f as Popover$1, fn as parseDataset, ft as useCellIds, gn as SCRATCH_CELL_ID, gt as getInitialAppMode, h as PopoverTrigger, hn as HTMLCellId, ht as AnsiUp, i as PythonIcon, j as AccordionTrigger, jn as NotebookPen, jt as customPythonLanguageSupport, k as AccordionContent, kn as Table2, kt as normalizeName, l as useLastFocusedCellId, lt as notebookOutline, m as PopoverContent, mn as CellOutputId, mt as createCell, n as blobToString, nn as useRequestClient, nt as safeExtractSetUIElementMessageBuffers, o as MarkdownRenderer, on as extractAllTracebackInfo, ot as getCellEditorView, p as PopoverClose$1, pn as parseInitialValue, pt as useCellNames, q as PinLeftIcon, qt as DATA_TYPE_ICON, r as filesToBase64, rn as isUninstantiated, rt as renderHTML, s as LazyAnyLanguageCodeMirror, sn as getTracebackInfo, st as getCellNames, t as processOutput, tn as requestClientAtom, tt as isDataURLString, u as maybeAddAltairImport, un as filenameAtom, ut as reducer, v as isOutputEmpty, vn as findCellId, vt as kioskModeAtom, wn as atomWithReducer, wt as DATA_CELL_ID, xn as jsonParseWithSpecialChar, xt as outputIsStale, y as useExpandedConsoleOutput, yn as OBJECT_ID_ATTR, yt as viewStateAtom, z as MarimoValueUpdateEvent, zn as Columns2, zt as generateUUID, __tla as __tla_0 } from "./process-output-KyzWazB-.js";
24
+ import { $ as dataViewToBase64, $t as convertStatsName, A as AccordionItem, An as PaintRoller, At as Checkbox, B as createInputEvent, Bn as CircleX, Bt as useChromeActions, Cn as jsonToTSV, Ct as headingToIdentifier, Dn as Wrench, Dt as getValidName, En as selectAtom, Et as displayCellName, F as AccordionTrigger$1, Fn as File, Ft as Paths, G as ChevronRightIcon, Gt as PluralWord, Hn as Braces, Ht as adaptForLocalStorage, I as MarimoIncomingMessageEvent, In as FileText, J as PinRightIcon, Jt as getDataTypeColor, K as DotFilledIcon, Kt as PluralWords, L as MarimoValueInputEvent, Ln as Eye, Lt as goToCellLine, M as Accordion$1, Mn as LoaderCircle, Mt as MarkdownLanguageAdapter, N as AccordionContent$1, Nn as Layers, O as Accordion, On as Trash2, Ot as isInternalCellName, P as AccordionItem$1, Pn as Info, Pt as PathBuilder, Q as base64ToUint8Array, R as MarimoValueReadyEvent, Rn as Database, Rt as DeferredRequestRegistry, S as getDatasourceContext, Sn as jsonToMarkdown, St as isErrorMime, Tn as atomWithStorage, Tt as getCellDomProps, U as CheckIcon, Un as esm_default$1, Ut as jotaiJsonStorage, V as BorderAllIcon, Vn as CircleAlert, Vt as repl, W as ChevronDownIcon, Wn as import_lib, Y as deserializeBlob, Yt as require_client, Z as base64ToDataView, _ as PopoverClose, _n as UIElementId, _t as initialModeAtom, a as toPng, an as elementContainsMarimoCellFile, at as createActions, b as useExpandedOutput, bn as RANDOM_ID_ATTR, bt as outputIsLoading, c as useCellFocusActions, cn as NotebookScopedLocalStorage, ct as notebookAtom, d as Spinner, dn as parseAttrValue, dt as useCellActions, en as getRequestClient, et as extractBase64FromDataURL, f as Popover$1, fn as parseDataset, ft as useCellIds, gn as SCRATCH_CELL_ID, gt as getInitialAppMode, h as PopoverTrigger, hn as HTMLCellId, ht as AnsiUp, i as PythonIcon, j as AccordionTrigger, jn as NotebookPen, jt as customPythonLanguageSupport, k as AccordionContent, kn as Table2, kt as normalizeName, l as useLastFocusedCellId, lt as notebookOutline, m as PopoverContent, mn as CellOutputId, mt as createCell, n as blobToString, nn as useRequestClient, nt as safeExtractSetUIElementMessageBuffers, o as MarkdownRenderer, on as extractAllTracebackInfo, ot as getCellEditorView, p as PopoverClose$1, pn as parseInitialValue, pt as useCellNames, q as PinLeftIcon, qt as DATA_TYPE_ICON, r as filesToBase64, rn as isUninstantiated, rt as renderHTML, s as LazyAnyLanguageCodeMirror, sn as getTracebackInfo, st as getCellNames, t as processOutput, tn as requestClientAtom, tt as isDataURLString, u as maybeAddAltairImport, un as filenameAtom, ut as reducer, v as isOutputEmpty, vn as findCellId, vt as kioskModeAtom, wn as atomWithReducer, wt as DATA_CELL_ID, xn as jsonParseWithSpecialChar, xt as outputIsStale, y as useExpandedConsoleOutput, yn as OBJECT_ID_ATTR, yt as viewStateAtom, z as MarimoValueUpdateEvent, zn as Columns2, zt as generateUUID, __tla as __tla_0 } from "./process-output-CzWMmQcQ.js";
25
25
  import { __tla as __tla_1 } from "./chunk-5FQGJX7Z-C428iZBW.js";
26
26
  import { c as useSize, l as createLucideIcon, t as Root$4 } from "./dist-D2Rk1j4R.js";
27
27
  import { A as $896ba0a80a8f4d36$export$85fd5fdf27bacc79, C as DEFAULT_COLOR_SCHEME, D as SCALE_TYPE_DESCRIPTIONS, E as EMPTY_VALUE$1, F as ListFilter, I as ChartPie, L as ChartColumn, M as $5a387cc49350e6db$export$722debc0e56fea39, N as Table$1, O as TIME_UNIT_DESCRIPTIONS, P as SquareFunction, 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 $fb18d541ea1ad717$export$ad991b66133851cf, 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-DYaR1rJh.js";
@@ -55,11 +55,11 @@ import "./dist-C0XYIHKJ.js";
55
55
  import "./dist-C9qF7MRB.js";
56
56
  import { a as parser, r as python } from "./dist-qoCY8giM.js";
57
57
  import "./purify.es-ukiMXY-F.js";
58
- import { a as AlertTitle, i as AlertDescription, n as arrow, o as isValid, r as Alert, t as useDeepCompareMemoize } from "./useDeepCompareMemoize-X7clcrcQ.js";
58
+ import { a as AlertTitle, i as AlertDescription, n as arrow, o as isValid, r as Alert, t as useDeepCompareMemoize } from "./useDeepCompareMemoize-DOzKCTzc.js";
59
59
  import { a as Portal$1, c as prettyError, i as Overlay, n as ErrorBanner, o as Root$6, r as Content$2, s as CellNotInitializedError, t as Banner } from "./error-banner-Bx9kIgrs.js";
60
60
  import { n as memoize$1, t as isPropValid } from "./emotion-is-prop-valid.esm-CJVjyntJ.js";
61
61
  import { n as formats } from "./vega-loader.browser-DqEcFOPD.js";
62
- import { a as getContainerWidth, n as vegaLoadData, o as getVegaFieldTypes, r as createBatchedLoader, s as tooltipHandler, t as parseCsvData } from "./loader-3c9hT4kT.js";
62
+ import { a as getContainerWidth, n as vegaLoadData, o as getVegaFieldTypes, r as createBatchedLoader, s as tooltipHandler, t as parseCsvData } from "./loader-CMMa6QVT.js";
63
63
  import { t as useIframeCapabilities } from "./useIframeCapabilities-BVQrlRBd.js";
64
64
  import { t as useAsyncData } from "./useAsyncData-Cd4Urlww.js";
65
65
  import "./defaultLocale-qS7DaAmi.js";
@@ -33407,7 +33407,7 @@ Database schema: ${c}`), (_a4 = r2.aiFix) == null ? void 0 : _a4.setAiCompletion
33407
33407
  let r = (0, import_compiler_runtime$98.c)(21), { table: c, className: d } = e, { locale: f } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7(), h = useAtomValue(selectedCellsAtom), _ = countDataCellsInSelection(h);
33408
33408
  if (_ < 2) {
33409
33409
  let e2;
33410
- r[0] === d ? e2 = r[1] : (e2 = cn("text-sm text-muted-foreground italic", d), r[0] = d, r[1] = e2);
33410
+ r[0] === d ? e2 = r[1] : (e2 = cn("text-xs text-muted-foreground/80 italic", d), r[0] = d, r[1] = e2);
33411
33411
  let c2;
33412
33412
  return r[2] === e2 ? c2 = r[3] : (c2 = (0, import_jsx_runtime.jsx)(Tooltip, {
33413
33413
  content: "Select multiple cells to see stats",
@@ -33496,8 +33496,8 @@ Database schema: ${c}`), (_a4 = r2.aiFix) == null ? void 0 : _a4.setAiCompletion
33496
33496
  function _temp2$23(e, r) {
33497
33497
  return e + r;
33498
33498
  }
33499
- const TableBottomBar = ({ pagination: e, totalColumns: r, selection: c, onRowSelectionChange: d, table: f, getRowIds: h, showPageSizeSelector: _, tableLoading: v }) => {
33500
- let { locale: S } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7(), w = (e2) => {
33499
+ const TableBottomBar = ({ pagination: e, totalColumns: r, selection: c, onRowSelectionChange: d, table: f, getRowIds: h, showPageSizeSelector: _, tableLoading: v, part: S, className: w }) => {
33500
+ let { locale: E } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7(), O = (e2) => {
33501
33501
  if (!d) return;
33502
33502
  if (!e2) {
33503
33503
  d({});
@@ -33532,7 +33532,8 @@ Database schema: ${c}`), (_a4 = r2.aiFix) == null ? void 0 : _a4.setAiCompletion
33532
33532
  });
33533
33533
  };
33534
33534
  return (0, import_jsx_runtime.jsxs)("div", {
33535
- className: "flex lg:grid lg:grid-cols-[1fr_auto_1fr] items-center shrink-0 pt-1",
33535
+ part: S,
33536
+ className: cn("flex lg:grid lg:grid-cols-[1fr_auto_1fr] items-center shrink-0", w),
33536
33537
  children: [
33537
33538
  (0, import_jsx_runtime.jsxs)("div", {
33538
33539
  className: "flex flex-col text-sm text-muted-foreground px-2 shrink-0",
@@ -33540,12 +33541,12 @@ Database schema: ${c}`), (_a4 = r2.aiFix) == null ? void 0 : _a4.setAiCompletion
33540
33541
  (0, import_jsx_runtime.jsx)("div", {
33541
33542
  className: "flex items-center gap-1",
33542
33543
  children: (() => {
33543
- let { rowSelection: e2, cellSelection: d2 } = f.getState(), h2 = Object.keys(e2).length, _2 = f.getIsAllPageRowsSelected(), v2 = f.getRowCount(), y = h2 === v2, E = c === "single-cell" || c === "multi-cell";
33544
- return E && (h2 = d2.length, _2 = false, y = false), _2 && !y ? (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
33544
+ let { rowSelection: e2, cellSelection: d2 } = f.getState(), h2 = Object.keys(e2).length, _2 = f.getIsAllPageRowsSelected(), v2 = f.getRowCount(), y = h2 === v2, S2 = c === "single-cell" || c === "multi-cell";
33545
+ return S2 && (h2 = d2.length, _2 = false, y = false), _2 && !y ? (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
33545
33546
  children: [
33546
33547
  (0, import_jsx_runtime.jsxs)("span", {
33547
33548
  children: [
33548
- prettyNumber(h2, S),
33549
+ prettyNumber(h2, E),
33549
33550
  " selected"
33550
33551
  ]
33551
33552
  }),
@@ -33555,10 +33556,10 @@ Database schema: ${c}`), (_a4 = r2.aiFix) == null ? void 0 : _a4.setAiCompletion
33555
33556
  variant: "link",
33556
33557
  className: "h-4 print:hidden",
33557
33558
  onMouseDown: Events.preventFocus,
33558
- onClick: () => w(true),
33559
+ onClick: () => O(true),
33559
33560
  children: [
33560
33561
  "Select all ",
33561
- prettyNumber(v2, S)
33562
+ prettyNumber(v2, E)
33562
33563
  ]
33563
33564
  })
33564
33565
  ]
@@ -33566,7 +33567,7 @@ Database schema: ${c}`), (_a4 = r2.aiFix) == null ? void 0 : _a4.setAiCompletion
33566
33567
  children: [
33567
33568
  (0, import_jsx_runtime.jsxs)("span", {
33568
33569
  children: [
33569
- prettyNumber(h2, S),
33570
+ prettyNumber(h2, E),
33570
33571
  " selected"
33571
33572
  ]
33572
33573
  }),
@@ -33577,13 +33578,13 @@ Database schema: ${c}`), (_a4 = r2.aiFix) == null ? void 0 : _a4.setAiCompletion
33577
33578
  className: "h-4 print:hidden",
33578
33579
  onMouseDown: Events.preventFocus,
33579
33580
  onClick: () => {
33580
- E ? f.resetCellSelection && f.resetCellSelection() : w(false);
33581
+ S2 ? f.resetCellSelection && f.resetCellSelection() : O(false);
33581
33582
  },
33582
33583
  children: "Clear selection"
33583
33584
  })
33584
33585
  ]
33585
33586
  }) : (0, import_jsx_runtime.jsx)("span", {
33586
- children: prettifyRowColumnCount(f.getRowCount(), r, S)
33587
+ children: prettifyRowColumnCount(f.getRowCount(), r, E)
33587
33588
  });
33588
33589
  })()
33589
33590
  }),
@@ -34034,45 +34035,42 @@ Defaulting to \`null\`.`;
34034
34035
  M,
34035
34036
  I
34036
34037
  ]), e && c || f || v || w ? (0, import_jsx_runtime.jsxs)("div", {
34037
- className: "flex items-center h-10 px-2 border-b gap-3",
34038
+ className: "flex items-center h-10 px-2 border-b gap-2",
34038
34039
  children: [
34039
- c && e && (0, import_jsx_runtime.jsx)("div", {
34040
- className: "flex items-center",
34041
- children: (0, import_jsx_runtime.jsxs)("div", {
34042
- className: "flex items-center gap-1 rounded-full border px-2 w-56",
34043
- children: [
34044
- (0, import_jsx_runtime.jsx)(Search, {
34045
- className: "w-4 h-4 text-muted-foreground shrink-0"
34046
- }),
34047
- (0, import_jsx_runtime.jsx)("input", {
34048
- ref: z,
34049
- type: "text",
34050
- className: "h-6 border-none bg-transparent focus:outline-hidden text-sm w-full min-w-0",
34051
- value: E,
34052
- onKeyDown: (e2) => {
34053
- var _a3;
34054
- e2.key === "Escape" && (O(""), (_a3 = z.current) == null ? void 0 : _a3.blur());
34055
- },
34056
- onChange: (e2) => O(e2.target.value),
34057
- placeholder: "Search..."
34058
- }),
34059
- d && (0, import_jsx_runtime.jsx)(Spinner, {
34060
- size: "small"
34061
- }),
34062
- E && (0, import_jsx_runtime.jsx)(Button, {
34063
- variant: "text",
34064
- size: "xs",
34065
- className: "h-5 w-5 p-0 shrink-0",
34066
- onClick: () => O(""),
34067
- children: (0, import_jsx_runtime.jsx)(X, {
34068
- className: "w-3 h-3 text-muted-foreground"
34069
- })
34040
+ c && e && (0, import_jsx_runtime.jsxs)("div", {
34041
+ className: "flex flex-1 items-center gap-1 px-2 rounded-sm focus-within:ring-1 focus-within:ring-border transition-shadow",
34042
+ children: [
34043
+ (0, import_jsx_runtime.jsx)(Search, {
34044
+ className: "w-4 h-4 text-muted-foreground shrink-0"
34045
+ }),
34046
+ (0, import_jsx_runtime.jsx)("input", {
34047
+ ref: z,
34048
+ type: "text",
34049
+ className: "h-6 border-none bg-transparent focus:outline-hidden text-sm w-full min-w-0",
34050
+ value: E,
34051
+ onKeyDown: (e2) => {
34052
+ var _a3;
34053
+ e2.key === "Escape" && (O(""), (_a3 = z.current) == null ? void 0 : _a3.blur());
34054
+ },
34055
+ onChange: (e2) => O(e2.target.value),
34056
+ placeholder: "Search..."
34057
+ }),
34058
+ d && (0, import_jsx_runtime.jsx)(Spinner, {
34059
+ size: "small"
34060
+ }),
34061
+ E && (0, import_jsx_runtime.jsx)(Button, {
34062
+ variant: "text",
34063
+ size: "xs",
34064
+ className: "h-5 w-5 p-0 shrink-0",
34065
+ onClick: () => O(""),
34066
+ children: (0, import_jsx_runtime.jsx)(X, {
34067
+ className: "w-3 h-3 text-muted-foreground"
34070
34068
  })
34071
- ]
34072
- })
34069
+ })
34070
+ ]
34073
34071
  }),
34074
34072
  (0, import_jsx_runtime.jsxs)("div", {
34075
- className: "flex items-center gap-1 shrink-0",
34073
+ className: "flex items-center shrink-0",
34076
34074
  children: [
34077
34075
  f && (0, import_jsx_runtime.jsxs)(Button, {
34078
34076
  variant: "text",
@@ -34083,7 +34081,7 @@ Defaulting to \`null\`.`;
34083
34081
  (0, import_jsx_runtime.jsx)(ChartSpline, {
34084
34082
  className: "w-3.5 h-3.5"
34085
34083
  }),
34086
- "Chart Builder"
34084
+ "Visualize"
34087
34085
  ]
34088
34086
  }),
34089
34087
  v && y && (0, import_jsx_runtime.jsxs)(Button, {
@@ -34095,7 +34093,7 @@ Defaulting to \`null\`.`;
34095
34093
  (0, import_jsx_runtime.jsx)(PanelRight, {
34096
34094
  className: "w-3.5 h-3.5"
34097
34095
  }),
34098
- "Table Explorer"
34096
+ "Explorer"
34099
34097
  ]
34100
34098
  }),
34101
34099
  w && (0, import_jsx_runtime.jsx)(ExportMenu, {
@@ -34202,6 +34200,7 @@ Defaulting to \`null\`.`;
34202
34200
  (0, import_jsx_runtime.jsxs)(CellSelectionProvider, {
34203
34201
  children: [
34204
34202
  (0, import_jsx_runtime.jsxs)("div", {
34203
+ part: "table-wrapper",
34205
34204
  className: cn(r || "rounded-md border overflow-hidden"),
34206
34205
  children: [
34207
34206
  (0, import_jsx_runtime.jsx)(TableTopBar, {
@@ -34238,6 +34237,8 @@ Defaulting to \`null\`.`;
34238
34237
  ]
34239
34238
  }),
34240
34239
  (0, import_jsx_runtime.jsx)(TableBottomBar, {
34240
+ part: "table-footer",
34241
+ className: "border-t border-border pt-1.5 pb-0.5",
34241
34242
  totalColumns: v,
34242
34243
  pagination: e9,
34243
34244
  selection: _,
@@ -36345,7 +36346,7 @@ ${E}`,
36345
36346
  };
36346
36347
  }
36347
36348
  };
36348
- var LazyChatbot = import_react.lazy(() => import("./chat-ui-CtqUthFR.js").then((e) => ({
36349
+ var LazyChatbot = import_react.lazy(() => import("./chat-ui-C1HWLRKN.js").then((e) => ({
36349
36350
  default: e.Chatbot
36350
36351
  }))), messageSchema = array(object({
36351
36352
  id: string(),
@@ -36436,6 +36437,7 @@ ${E}`,
36436
36437
  }), r[5] = h, r[6] = w);
36437
36438
  let E;
36438
36439
  r[7] !== y || r[8] !== w ? (E = (0, import_jsx_runtime.jsx)("div", {
36440
+ part: "table-wrapper",
36439
36441
  className: y,
36440
36442
  children: w
36441
36443
  }), r[7] = y, r[8] = w, r[9] = E) : E = r[9];
@@ -43990,68 +43992,71 @@ ${c}
43990
43992
  return r ? r.length > 0 : false;
43991
43993
  }
43992
43994
  var import_compiler_runtime$69 = require_compiler_runtime(), NEW_CHART_TYPE = "bar", DEFAULT_TAB_NAME = "table", CHART_HEIGHT = 290, CHART_MAX_ROWS = 5e4, CHART_MAX_COLUMNS = 50;
43993
- const TablePanel = (e) => {
43994
- let r = (0, import_compiler_runtime$69.c)(7), { cellId: c, data: d, dataTable: f, totalRows: h, columns: _, getDataUrl: v, fieldTypes: y, displayHeader: S } = e, [w, E] = useAtom(tabsStorageAtom), O = c ? w.get(c) ?? [] : [], [M, I] = (0, import_react.useState)(0), [z, G] = (0, import_react.useState)(DEFAULT_TAB_NAME);
43995
- if (!S || O.length === 0 && !S) return f;
43995
+ const TablePanel = ({ cellId: e, data: r, dataTable: c, totalRows: d, columns: f, getDataUrl: h, fieldTypes: _, displayHeader: v, onCloseChartBuilder: y }) => {
43996
+ let [S, w] = useAtom(tabsStorageAtom), E = e ? S.get(e) ?? [] : [], [O, M] = (0, import_react.useState)(DEFAULT_TAB_NAME), [I, z] = (0, import_react.useState)(E.length), G = (0, import_react.useRef)(v);
43997
+ if (v && !G.current && E.length === 0 && e) {
43998
+ G.current = v;
43999
+ let r2 = getChartTabName(0, NEW_CHART_TYPE), c2 = new Map(S);
44000
+ c2.set(e, [
44001
+ {
44002
+ tabName: r2,
44003
+ chartType: NEW_CHART_TYPE,
44004
+ config: getChartDefaults()
44005
+ }
44006
+ ]), w(c2), z(1), M(r2);
44007
+ }
44008
+ if (G.current = v, !v || E.length === 0 && !v) return c;
43996
44009
  let q = () => {
43997
- if (!c) return;
43998
- let e2 = getChartTabName(M, NEW_CHART_TYPE), r2 = new Map(w);
43999
- r2.set(c, [
44000
- ...O,
44010
+ if (!e) return;
44011
+ let r2 = getChartTabName(I, NEW_CHART_TYPE), c2 = new Map(S);
44012
+ c2.set(e, [
44013
+ ...E,
44001
44014
  {
44002
- tabName: e2,
44015
+ tabName: r2,
44003
44016
  chartType: NEW_CHART_TYPE,
44004
44017
  config: getChartDefaults()
44005
44018
  }
44006
- ]), E(r2), I(M + 1), G(e2);
44007
- }, Z7 = (e2) => {
44008
- if (!c) return;
44009
- let r2 = new Map(w);
44010
- r2.set(c, O.filter((r3) => r3.tabName !== e2)), E(r2), G(DEFAULT_TAB_NAME), I(M - 1);
44011
- }, Q7 = (e2) => {
44012
- let { tabName: r2, chartType: d2, chartConfig: f2 } = e2;
44013
- if (!c) return;
44014
- let h2 = new Map(w);
44015
- h2.set(c, O.map((e3) => e3.tabName === r2 ? {
44016
- ...e3,
44017
- chartType: d2,
44018
- config: f2
44019
- } : e3)), E(h2);
44020
- }, $7;
44021
- r[0] !== c || r[1] !== E || r[2] !== w ? ($7 = (e2, r2) => {
44022
- if (!c) return;
44023
- let d2 = w.get(c) ?? [], f2 = d2.findIndex((r3) => r3.tabName === e2);
44019
+ ]), w(c2), z(I + 1), M(r2);
44020
+ }, Z7 = (r2) => {
44021
+ if (!e) return;
44022
+ let c2 = E.findIndex((e2) => e2.tabName === r2), d2 = E.filter((e2) => e2.tabName !== r2), f2 = new Map(S);
44023
+ f2.set(e, d2), w(f2), d2.length === 0 ? y == null ? void 0 : y() : r2 === O && (c2 < d2.length ? M(d2[c2].tabName) : M(d2[d2.length - 1].tabName));
44024
+ }, Q7 = ({ tabName: r2, chartType: c2, chartConfig: d2 }) => {
44025
+ if (!e) return;
44026
+ let f2 = new Map(S);
44027
+ f2.set(e, E.map((e2) => e2.tabName === r2 ? {
44028
+ ...e2,
44029
+ chartType: c2,
44030
+ config: d2
44031
+ } : e2)), w(f2);
44032
+ }, $7 = (r2, c2) => {
44033
+ if (!e) return;
44034
+ let d2 = S.get(e) ?? [], f2 = d2.findIndex((e2) => e2.tabName === r2);
44024
44035
  if (f2 === -1) return;
44025
- let h2 = d2.map((c2) => c2.tabName === e2 ? {
44026
- ...c2,
44027
- chartType: r2,
44028
- tabName: getChartTabName(f2, r2)
44029
- } : c2);
44030
- E(new Map(w).set(c, h2)), G(h2[f2].tabName);
44031
- }, r[0] = c, r[1] = E, r[2] = w, r[3] = $7) : $7 = r[3];
44032
- let e9 = $7, t9 = h === "too_many" || h > CHART_MAX_ROWS || _ > CHART_MAX_COLUMNS, n9;
44033
- r[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n9 = (0, import_jsx_runtime.jsx)(TabsTrigger, {
44034
- className: "text-xs",
44035
- value: DEFAULT_TAB_NAME,
44036
- onClick: () => G(DEFAULT_TAB_NAME),
44037
- children: "Table"
44038
- }), r[4] = n9) : n9 = r[4];
44039
- let r9;
44040
- return r[5] === f ? r9 = r[6] : (r9 = (0, import_jsx_runtime.jsx)(TabsContent, {
44041
- className: "mt-1 overflow-hidden",
44042
- value: DEFAULT_TAB_NAME,
44043
- children: f
44044
- }), r[5] = f, r[6] = r9), (0, import_jsx_runtime.jsxs)(Tabs, {
44045
- value: z,
44036
+ let h2 = d2.map((e2) => e2.tabName === r2 ? {
44037
+ ...e2,
44038
+ chartType: c2,
44039
+ tabName: getChartTabName(f2, c2)
44040
+ } : e2);
44041
+ w(new Map(S).set(e, h2)), M(h2[f2].tabName);
44042
+ }, e9 = d === "too_many" || d > CHART_MAX_ROWS || f > CHART_MAX_COLUMNS;
44043
+ return (0, import_jsx_runtime.jsxs)(Tabs, {
44044
+ value: O,
44046
44045
  className: "-mt-1",
44047
44046
  children: [
44048
44047
  (0, import_jsx_runtime.jsxs)(TabsList, {
44048
+ part: "table-tabs",
44049
44049
  children: [
44050
- n9,
44051
- O.map((e2, r2) => (0, import_jsx_runtime.jsxs)(TabsTrigger, {
44050
+ (0, import_jsx_runtime.jsx)(TabsTrigger, {
44051
+ className: "text-xs",
44052
+ value: DEFAULT_TAB_NAME,
44053
+ onClick: () => M(DEFAULT_TAB_NAME),
44054
+ children: "Table"
44055
+ }),
44056
+ E.map((e2, r2) => (0, import_jsx_runtime.jsxs)(TabsTrigger, {
44052
44057
  className: "text-xs",
44053
44058
  value: e2.tabName,
44054
- onClick: () => G(e2.tabName),
44059
+ onClick: () => M(e2.tabName),
44055
44060
  children: [
44056
44061
  e2.tabName,
44057
44062
  (0, import_jsx_runtime.jsx)(X, {
@@ -44071,29 +44076,33 @@ ${c}
44071
44076
  })
44072
44077
  ]
44073
44078
  }),
44074
- r9,
44075
- O.map((e2, r2) => (0, import_jsx_runtime.jsx)(TabsContent, {
44079
+ (0, import_jsx_runtime.jsx)(TabsContent, {
44080
+ className: "mt-1 overflow-hidden",
44081
+ value: DEFAULT_TAB_NAME,
44082
+ children: c
44083
+ }),
44084
+ E.map((e2, d2) => (0, import_jsx_runtime.jsx)(TabsContent, {
44076
44085
  value: e2.tabName,
44077
44086
  className: "h-[400px] mt-1",
44078
44087
  children: (0, import_jsx_runtime.jsx)(ChartPanel, {
44079
- tableData: d,
44088
+ tableData: r,
44080
44089
  chartConfig: e2.config,
44081
44090
  chartType: e2.chartType,
44082
- saveChart: (r3) => {
44091
+ saveChart: (r2) => {
44083
44092
  Q7({
44084
44093
  tabName: e2.tabName,
44085
44094
  chartType: e2.chartType,
44086
- chartConfig: r3
44095
+ chartConfig: r2
44087
44096
  });
44088
44097
  },
44089
- saveChartType: (r3) => {
44090
- e9(e2.tabName, r3);
44098
+ saveChartType: (r2) => {
44099
+ $7(e2.tabName, r2);
44091
44100
  },
44092
- getDataUrl: v,
44093
- fieldTypes: y ?? inferFieldTypes(f.props.data),
44094
- isLargeDataset: t9
44101
+ getDataUrl: h,
44102
+ fieldTypes: _ ?? inferFieldTypes(c.props.data),
44103
+ isLargeDataset: e9
44095
44104
  })
44096
- }, r2))
44105
+ }, d2))
44097
44106
  ]
44098
44107
  });
44099
44108
  };
@@ -44591,7 +44600,7 @@ ${c}
44591
44600
  let [r2] = e3;
44592
44601
  return r2.toLowerCase().includes(v.toLowerCase());
44593
44602
  });
44594
- Z7 = "mt-5 mb-3";
44603
+ Z7 = "mb-3";
44595
44604
  let e92;
44596
44605
  r[17] !== S || r[18] !== h || r[19] !== f ? (e92 = prettifyRowColumnCount(f, h, S), r[17] = S, r[18] = h, r[19] = f, r[20] = e92) : e92 = r[20], Q7 = (0, import_jsx_runtime.jsxs)("span", {
44597
44606
  className: "text-xs font-semibold ml-2 flex",
@@ -44919,7 +44928,7 @@ ${c}
44919
44928
  });
44920
44929
  };
44921
44930
  return (0, import_jsx_runtime.jsxs)("div", {
44922
- className: "flex flex-col gap-3 mt-4 focus:outline-hidden",
44931
+ className: "flex flex-col gap-3 focus:outline-hidden",
44923
44932
  ref: w,
44924
44933
  tabIndex: -1,
44925
44934
  onKeyDown: Q7,
@@ -45033,7 +45042,7 @@ ${c}
45033
45042
  _
45034
45043
  ]
45035
45044
  }), r[4] = c, r[5] = h, r[6] = _, r[7] = v) : v = r[7], v;
45036
- }, import_compiler_runtime$62 = require_compiler_runtime(), tabTriggerClassName = "text-xs uppercase tracking-wide font-semibold cursor-pointer transition-colors", activeClassName = "text-primary", inactiveClassName = "hover:text-foreground";
45045
+ }, import_compiler_runtime$62 = require_compiler_runtime(), tabTriggerClassName = "text-[13px] uppercase tracking-wide font-semibold cursor-pointer transition-colors", activeClassName = "text-primary", inactiveClassName = "hover:text-foreground";
45037
45046
  const TableExplorerPanel = (e) => {
45038
45047
  let r = (0, import_compiler_runtime$62.c)(45), { rowIdx: c, setRowIdx: d, totalRows: f, fieldTypes: h, getRow: _, isSelectable: v, isRowSelected: y, handleRowSelectionChange: S, previewColumn: w, totalColumns: E, tableId: O, showRowExplorer: M, showColumnExplorer: I, activeTab: z, onTabChange: G } = e, q = M && I, Z7;
45039
45048
  r[0] !== h || r[1] !== _ || r[2] !== S || r[3] !== y || r[4] !== v || r[5] !== c || r[6] !== d || r[7] !== f ? (Z7 = (0, import_jsx_runtime.jsx)(RowViewerPanel, {
@@ -45115,7 +45124,7 @@ ${c}
45115
45124
  return r[39] !== t9 || r[40] !== f9 || r[41] !== p9 || r[42] !== m9 || r[43] !== n9 ? (h9 = (0, import_jsx_runtime.jsxs)(Tabs, {
45116
45125
  value: t9,
45117
45126
  onValueChange: n9,
45118
- className: "h-full flex flex-col min-w-[350px]",
45127
+ className: "flex flex-col min-w-[350px]",
45119
45128
  children: [
45120
45129
  f9,
45121
45130
  p9,
@@ -45918,6 +45927,7 @@ ${c}
45918
45927
  let j9 = A9, M9;
45919
45928
  r[91] !== d || r[92] !== j9 || r[93] !== (o9 == null ? void 0 : o9.rows) || r[94] !== Z7 || r[95] !== e.fieldTypes || r[96] !== e.get_data_url || r[97] !== e.showChartBuilder || r[98] !== e.totalColumns || r[99] !== e.totalRows ? (M9 = e.showChartBuilder ? (0, import_jsx_runtime.jsx)(TablePanel, {
45920
45929
  displayHeader: Z7,
45930
+ onCloseChartBuilder: () => Q7(false),
45921
45931
  data: (o9 == null ? void 0 : o9.rows) || [],
45922
45932
  columns: e.totalColumns,
45923
45933
  totalRows: e.totalRows,
@@ -47037,7 +47047,7 @@ ${c}
47037
47047
  fullWidth: v,
47038
47048
  children: z
47039
47049
  }), r[19] = v, r[20] = y, r[21] = c, r[22] = z, r[23] = G) : G = r[23], G;
47040
- }, LazyDataExplorerComponent = import_react.lazy(() => import("./ConnectedDataExplorerComponent-Dl1grr8z.js"));
47050
+ }, LazyDataExplorerComponent = import_react.lazy(() => import("./ConnectedDataExplorerComponent-iT7t3FxV.js"));
47041
47051
  const DataExplorerPlugin = createPlugin("marimo-data-explorer").withData(object({
47042
47052
  label: string().nullish(),
47043
47053
  data: string()
@@ -58391,7 +58401,7 @@ ${c}
58391
58401
  return true;
58392
58402
  }
58393
58403
  }
58394
- var LazyVegaComponent = import_react.lazy(() => import("./vega-component-A6unyUJS.js")), VegaPlugin = class {
58404
+ var LazyVegaComponent = import_react.lazy(() => import("./vega-component-BaDgUvQP.js")), VegaPlugin = class {
58395
58405
  constructor() {
58396
58406
  __publicField(this, "tagName", "marimo-vega");
58397
58407
  __publicField(this, "validator", object({
@@ -65415,7 +65425,7 @@ ${c}
65415
65425
  return Logger.warn("Failed to get version from mount config"), null;
65416
65426
  }
65417
65427
  }
65418
- const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.22.1-dev2"), showCodeInRunModeAtom = atom(true);
65428
+ const marimoVersionAtom = atom(getVersionFromMountConfig() || "0.22.1-dev20"), showCodeInRunModeAtom = atom(true);
65419
65429
  atom(null);
65420
65430
  var VIRTUAL_FILE_REGEX = /\/@file\/([^\s"&'/]+)\.([\dA-Za-z]+)/g, VirtualFileTracker = class e {
65421
65431
  constructor() {
@@ -25818,7 +25818,7 @@ ${n.sqlString}
25818
25818
  for (let r = 0; r < n; r++) t += String.fromCharCode(e[r]);
25819
25819
  return globalThis.btoa(t);
25820
25820
  }
25821
- const uint8ArrayToBase64 = Uint8Array.prototype.toBase64 ? (e) => e.toBase64() : uint8ArrayToBase64Fallback;
25821
+ const uint8ArrayToBase64 = "toBase64" in Uint8Array.prototype ? (e) => e.toBase64() : uint8ArrayToBase64Fallback;
25822
25822
  dataViewToBase64 = function(e) {
25823
25823
  return uint8ArrayToBase64(new Uint8Array(e.buffer, e.byteOffset, e.byteLength));
25824
25824
  };