@marimo-team/islands 0.23.16-dev6 → 0.23.16-dev62
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.
- package/dist/{ConnectedDataExplorerComponent-CJaUI-S-.js → ConnectedDataExplorerComponent-f9vLjQiF.js} +13 -13
- package/dist/{ErrorBoundary-DXlxsrTF.js → ErrorBoundary-DhLqwSWA.js} +3 -3
- package/dist/{any-language-editor-P9tjkj4n.js → any-language-editor-DifE-fl7.js} +5 -5
- package/dist/{button-BcSml68y.js → button-BSm8IXRU.js} +2 -4
- package/dist/{capabilities-BYLFYTYv.js → capabilities-C6OQ5YBO.js} +1 -1
- package/dist/{chat-ui-BdSDiVjk.js → chat-ui-DsZJj75A.js} +3117 -3120
- package/dist/{check-Cs-KV5XY.js → check-DP7U0H0G.js} +1 -1
- package/dist/{code-visibility-CfBftiVM.js → common-Bpnmu1Yz.js} +1085 -1053
- package/dist/{copy-Cs3yt6Vt.js → copy-DNq8q3zw.js} +2 -2
- package/dist/{dist-B96tMAst.js → dist-DIlxLFXG.js} +2 -2
- package/dist/{error-banner-DR7o3CbX.js → error-banner-B_GQfxxD.js} +2 -2
- package/dist/{esm-k8PIvuZW.js → esm-DzZVaNH4.js} +1 -1
- package/dist/{extends-Cq2JYHKy.js → extends-w2_S44bV.js} +4 -4
- package/dist/{formats-BFhkZJwd.js → formats-Dwq1THhr.js} +3 -3
- package/dist/{glide-data-editor--CaN-f27.js → glide-data-editor-B9K6-MJe.js} +9 -9
- package/dist/{html-to-image-DDENewl2.js → html-to-image-CZ1kLKkq.js} +7350 -6356
- package/dist/{input-DStQIuqD.js → input-C5K4VBvB.js} +7 -7
- package/dist/{label-DIk0QoFe.js → label-DjoYwqmj.js} +2 -2
- package/dist/{loader-CTHCI-qe.js → loader-DX-IDS7n.js} +1 -1
- package/dist/main.js +259 -194
- package/dist/{mermaid-CdSvixW2.js → mermaid-hv6IckVw.js} +5 -5
- package/dist/{node-sql-parser-DLl_zNw0.js → node-sql-parser-v1Vi-Fft.js} +16867 -16665
- package/dist/{process-output-2QPcgBQg.js → process-output-bVfbcx5_.js} +32 -28
- package/dist/{reveal-component-BclLkYnV.js → reveal-component-JIt3oSeU.js} +642 -634
- package/dist/{spec-CnaxwDqy.js → spec-CQKL_D3i.js} +4 -4
- package/dist/{strings-BYAhZnQi.js → strings-DIy9NAmg.js} +4 -4
- package/dist/style.css +1 -1
- package/dist/{swiper-component-DE94711u.js → swiper-component-CEdAYjb7.js} +2 -2
- package/dist/toDate-CqhBWjvO.js +713 -0
- package/dist/{tooltip-B-qh7UPB.js → tooltip-f-qR0iUx.js} +3 -3
- package/dist/{types-DQl7jVYK.js → types-DicH9Oi0.js} +1 -1
- package/dist/{useAsyncData-CvO8WUy3.js → useAsyncData-CYOQb1EW.js} +1 -1
- package/dist/{useDateFormatter-BSoGim-G.js → useDateFormatter-Bt2qr_XS.js} +2 -2
- package/dist/{useDeepCompareMemoize-J3MKRdA4.js → useDeepCompareMemoize-CSHQeQEI.js} +1 -1
- package/dist/{useIframeCapabilities-POcFXHbw.js → useIframeCapabilities-kA09ykNq.js} +1 -1
- package/dist/{useLifecycle-DqPxHgAN.js → useLifecycle-CMJGqBaY.js} +3 -3
- package/dist/{useTheme-XMq9mNf_.js → useTheme-DYfby65G.js} +2 -2
- package/dist/{vega-component-CrFoZT1S.js → vega-component-C7nO5zcf.js} +10 -10
- package/dist/{zod-D0yOqoGe.js → zod-BUcyXSdR.js} +1 -1
- package/package.json +3 -4
- package/src/__mocks__/requests.ts +56 -4
- package/src/components/data-table/__tests__/__snapshots__/chart-spec-model.test.ts.snap +174 -21
- package/src/components/data-table/__tests__/chart-spec-model.test.ts +102 -1
- package/src/components/data-table/__tests__/columns.test.tsx +9 -1
- package/src/components/data-table/column-summary/chart-spec-model.tsx +163 -103
- package/src/components/data-table/column-summary/legacy-chart-spec.ts +15 -7
- package/src/components/data-table/column-summary/utils.ts +26 -7
- package/src/components/data-table/columns.tsx +11 -1
- package/src/components/data-table/types.ts +1 -1
- package/src/components/editor/__tests__/viewer-banner.test.tsx +14 -0
- package/src/components/editor/actions/__tests__/pair-with-agent-commands.test.ts +99 -18
- package/src/components/editor/actions/__tests__/pdf-export.test.ts +32 -13
- package/src/components/editor/actions/pair-with-agent-commands.ts +21 -10
- package/src/components/editor/actions/pair-with-agent-modal.tsx +2 -2
- package/src/components/editor/actions/pdf-export.ts +11 -14
- package/src/components/editor/actions/useNotebookActions.tsx +28 -19
- package/src/components/editor/cell/code/__tests__/cell-editor-activity-lifecycle.test.ts +250 -0
- package/src/components/editor/cell/code/cell-editor.tsx +13 -7
- package/src/components/editor/chrome/__tests__/state.test.ts +7 -1
- package/src/components/editor/chrome/panels/__tests__/logs-panel.test.tsx +25 -0
- package/src/components/editor/chrome/panels/__tests__/panel-accordion-state.test.ts +42 -0
- package/src/components/editor/chrome/panels/file-explorer-panel.tsx +6 -17
- package/src/components/editor/chrome/panels/logs-panel.tsx +12 -2
- package/src/components/editor/chrome/panels/panel-accordion-state.ts +51 -0
- package/src/components/editor/chrome/panels/session-panel.tsx +5 -16
- package/src/components/editor/chrome/panels/write-secret-modal.tsx +40 -12
- package/src/components/editor/chrome/state.ts +10 -0
- package/src/components/editor/connections/__tests__/json-credentials.test.ts +114 -0
- package/src/components/editor/connections/__tests__/paths.test.ts +39 -0
- package/src/components/editor/connections/__tests__/quick-add-data-sources.test.tsx +113 -0
- package/src/components/editor/connections/add-connection-dialog.tsx +2 -0
- package/src/components/editor/connections/components.tsx +6 -2
- package/src/components/editor/connections/database/__tests__/__snapshots__/as-code.test.ts.snap +27 -5
- package/src/components/editor/connections/database/__tests__/as-code.test.ts +33 -0
- package/src/components/editor/connections/database/as-code.ts +37 -13
- package/src/components/editor/connections/database/schemas.ts +6 -5
- package/src/components/editor/connections/form-renderers.tsx +99 -1
- package/src/components/editor/connections/json-credentials.ts +57 -0
- package/src/components/editor/connections/paths.ts +21 -0
- package/src/components/editor/connections/quick-add-data-sources.tsx +106 -0
- package/src/components/editor/connections/secret-combobox.tsx +41 -20
- package/src/components/editor/connections/storage/__tests__/__snapshots__/as-code.test.ts.snap +88 -2
- package/src/components/editor/connections/storage/__tests__/as-code.test.ts +128 -8
- package/src/components/editor/connections/storage/as-code.ts +79 -36
- package/src/components/editor/connections/storage/schemas.ts +85 -44
- package/src/components/editor/file-tree/__tests__/renderers.test.ts +31 -0
- package/src/components/editor/file-tree/file-viewer.tsx +11 -7
- package/src/components/editor/file-tree/renderers.tsx +21 -0
- package/src/components/editor/renderers/vertical-layout/vertical-layout.tsx +2 -2
- package/src/components/editor/viewer-banner.tsx +6 -1
- package/src/components/forms/form.tsx +59 -24
- package/src/components/forms/options.ts +2 -1
- package/src/components/slides/__tests__/cell-output-block.test.tsx +40 -0
- package/src/components/slides/__tests__/slide-cell-view.test.tsx +33 -0
- package/src/components/slides/reveal-component.tsx +22 -17
- package/src/components/slides/slide-cell-view.tsx +1 -1
- package/src/components/slides/slides.css +4 -2
- package/src/components/static-html/share-modal.tsx +1 -1
- package/src/components/ui/input.tsx +1 -1
- package/src/core/ai/context/providers/file.ts +8 -29
- package/src/core/cells/__tests__/cells.test.ts +12 -2
- package/src/core/cells/__tests__/logs.test.ts +5 -5
- package/src/core/cells/cells.ts +17 -4
- package/src/core/cells/document-changes.ts +1 -0
- package/src/core/cells/logs.ts +14 -4
- package/src/core/codemirror/cm.ts +3 -0
- package/src/core/codemirror/code-lens/__tests__/actions.test.ts +68 -0
- package/src/core/codemirror/code-lens/__tests__/analyzer.test.ts +224 -0
- package/src/core/codemirror/code-lens/__tests__/entities.test.ts +175 -0
- package/src/core/codemirror/code-lens/__tests__/extension.test.ts +325 -0
- package/src/core/codemirror/code-lens/__tests__/perf.test.ts +121 -0
- package/src/core/codemirror/code-lens/__tests__/popover.test.ts +93 -0
- package/src/core/codemirror/code-lens/actions.ts +33 -0
- package/src/core/codemirror/code-lens/analyzer.ts +284 -0
- package/src/core/codemirror/code-lens/entities.ts +123 -0
- package/src/core/codemirror/code-lens/extension.ts +298 -0
- package/src/core/codemirror/code-lens/icons.ts +36 -0
- package/src/core/codemirror/code-lens/popover.tsx +240 -0
- package/src/core/codemirror/copilot/__tests__/language-server.test.ts +396 -100
- package/src/core/codemirror/copilot/__tests__/transport.test.ts +128 -540
- package/src/core/codemirror/copilot/language-server.ts +182 -70
- package/src/core/codemirror/copilot/transport.ts +15 -207
- package/src/core/codemirror/copilot/types.ts +9 -2
- package/src/core/codemirror/find-replace/__tests__/navigate.test.ts +42 -30
- package/src/core/codemirror/find-replace/navigate.ts +2 -0
- package/src/core/codemirror/go-to-definition/__tests__/commands.test.ts +24 -3
- package/src/core/codemirror/go-to-definition/commands.ts +93 -90
- package/src/core/codemirror/keymaps/__tests__/keymaps.test.ts +31 -2
- package/src/core/codemirror/keymaps/keymaps.ts +12 -0
- package/src/core/codemirror/language/__tests__/sql.test.ts +627 -61
- package/src/core/codemirror/language/languages/python.ts +23 -11
- package/src/core/codemirror/language/languages/sql/completion-store.ts +5 -1
- package/src/core/codemirror/language/languages/sql/renderers.tsx +3 -3
- package/src/core/codemirror/language/languages/sql/sql.ts +251 -16
- package/src/core/codemirror/lsp/__tests__/federated-lsp.test.ts +161 -0
- package/src/core/codemirror/lsp/__tests__/log-messages.test.ts +53 -0
- package/src/core/codemirror/lsp/__tests__/normalize-markdown-math.test.ts +25 -0
- package/src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts +598 -156
- package/src/core/codemirror/lsp/__tests__/transports.test.ts +112 -0
- package/src/core/codemirror/lsp/federated-lsp.ts +76 -23
- package/src/core/codemirror/lsp/log-messages.ts +37 -0
- package/src/core/codemirror/lsp/normalize-markdown-math.ts +8 -4
- package/src/core/codemirror/lsp/notebook-lsp.ts +220 -56
- package/src/core/codemirror/lsp/transports.ts +8 -1
- package/src/core/codemirror/lsp/types.ts +68 -8
- package/src/core/codemirror/lsp/utils.ts +14 -0
- package/src/core/codemirror/python-node-names.ts +90 -0
- package/src/core/codemirror/reactive-references/analyzer.ts +52 -57
- package/src/core/codemirror/utils.ts +28 -0
- package/src/core/config/feature-flag.tsx +3 -1
- package/src/core/datasets/data-source-discovery.ts +5 -0
- package/src/core/datasets/request-registry.ts +11 -0
- package/src/core/edit-app.tsx +1 -2
- package/src/core/export/__tests__/hooks.test.ts +2 -4
- package/src/core/export/hooks.ts +4 -3
- package/src/core/hotkeys/hotkeys.ts +0 -2
- package/src/core/islands/__tests__/bridge.test.ts +107 -0
- package/src/core/islands/bootstrap.ts +1 -0
- package/src/core/islands/bridge.ts +18 -0
- package/src/core/kernel/messages.ts +2 -0
- package/src/core/lsp/__tests__/transport.test.ts +509 -337
- package/src/core/lsp/transport.ts +304 -132
- package/src/core/mode.ts +10 -0
- package/src/core/network/__tests__/api.test.ts +42 -0
- package/src/core/network/__tests__/connection.test.ts +45 -0
- package/src/core/network/__tests__/requests-lazy.test.ts +47 -1
- package/src/core/network/__tests__/requests-network.test.ts +48 -0
- package/src/core/network/api.ts +27 -0
- package/src/core/network/connection.ts +15 -0
- package/src/core/network/requests-lazy.ts +3 -0
- package/src/core/network/requests-network.ts +31 -8
- package/src/core/network/requests-static.ts +3 -0
- package/src/core/network/requests-toasting.tsx +3 -0
- package/src/core/network/types.ts +27 -6
- package/src/core/rtc/state.ts +9 -0
- package/src/core/static/download-html.ts +5 -14
- package/src/core/wasm/__tests__/bridge.test.ts +99 -5
- package/src/core/wasm/bridge.ts +42 -9
- package/src/core/wasm/worker/types.ts +10 -3
- package/src/core/wasm/worker/worker.ts +7 -8
- package/src/core/websocket/useMarimoKernelConnection.tsx +4 -0
- package/src/css/app/codemirror.css +16 -2
- package/src/hooks/__tests__/useDataSourceDiscovery.test.ts +80 -0
- package/src/hooks/useDataSourceDiscovery.ts +18 -0
- package/src/plugins/impl/DataTablePlugin.tsx +4 -1
- package/src/plugins/impl/FormPlugin.tsx +1 -1
- package/src/plugins/impl/__tests__/DataTablePlugin.test.tsx +158 -0
- package/src/plugins/impl/__tests__/FormPlugin.test.tsx +162 -0
- package/src/plugins/impl/anywidget/__tests__/model.test.ts +55 -0
- package/src/plugins/impl/anywidget/model.ts +20 -5
- package/src/plugins/impl/data-frames/forms/__tests__/__snapshots__/form.test.tsx.snap +33 -21
- package/src/plugins/impl/data-frames/forms/renderers.tsx +11 -8
- package/src/stories/log-viewer.stories.tsx +12 -6
- package/src/utils/__tests__/blob.test.ts +27 -1
- package/src/utils/__tests__/download.test.tsx +44 -4
- package/src/utils/blob.ts +24 -1
- package/src/utils/download.ts +14 -15
- package/dist/toDate-B3IRfHhw.js +0 -692
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
2
|
-
import { d as createSlottable, h as cn, p as useComposedRefs } from "./button-
|
|
2
|
+
import { d as createSlottable, h as cn, p as useComposedRefs } from "./button-BSm8IXRU.js";
|
|
3
3
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
4
4
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
5
|
-
import { a as createPopperScope, i as Root2, n as Arrow, r as Content, s as Root, t as Anchor } from "./dist-
|
|
5
|
+
import { a as createPopperScope, i as Root2, n as Arrow, r as Content, s as Root, t as Anchor } from "./dist-DIlxLFXG.js";
|
|
6
6
|
import { t as require_jsx_runtime } from "./jsx-runtime-DebpN0FN.js";
|
|
7
|
-
import { Q as withSmartCollisionBoundary, Z as withFullScreenAsRoot, _t as createContextScope, at as Portal, ct as DismissableLayer, dt as useId, et as StyleNamespace, ft as Presence, ht as composeEventHandlers, pt as useControllableState, vt as Primitive } from "./zod-
|
|
7
|
+
import { Q as withSmartCollisionBoundary, Z as withFullScreenAsRoot, _t as createContextScope, at as Portal, ct as DismissableLayer, dt as useId, et as StyleNamespace, ft as Presence, ht as composeEventHandlers, pt as useControllableState, vt as Primitive } from "./zod-BUcyXSdR.js";
|
|
8
8
|
var import_react = /* @__PURE__ */ __toESM(require_react(), 1), import_jsx_runtime = /* @__PURE__ */ __toESM(require_jsx_runtime(), 1), [createTooltipContext, createTooltipScope] = createContextScope("Tooltip", [createPopperScope]), usePopperScope = createPopperScope(), PROVIDER_NAME = "TooltipProvider", DEFAULT_DELAY_DURATION = 700, TOOLTIP_OPEN = "tooltip.open", [TooltipProviderContextProvider, useTooltipProviderContext] = createTooltipContext(PROVIDER_NAME), TooltipProvider$1 = (n) => {
|
|
9
9
|
let { __scopeTooltip: j, delayDuration: M = DEFAULT_DELAY_DURATION, skipDelayDuration: N = 300, disableHoverableContent: P = false, children: F } = n, I = import_react.useRef(true), L = import_react.useRef(false), R = import_react.useRef(0);
|
|
10
10
|
return import_react.useEffect(() => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as createLucideIcon } from "./dist-
|
|
1
|
+
import { u as createLucideIcon } from "./dist-DIlxLFXG.js";
|
|
2
2
|
var Pencil = createLucideIcon("pencil", [["path", {
|
|
3
3
|
d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",
|
|
4
4
|
key: "1a8usu"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
2
2
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
3
3
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
4
|
-
import { A as useEvent_default } from "./useTheme-
|
|
4
|
+
import { A as useEvent_default } from "./useTheme-DYfby65G.js";
|
|
5
5
|
import { t as invariant } from "./invariant-wRzNXIsJ.js";
|
|
6
6
|
var import_compiler_runtime = require_compiler_runtime(), import_react = /* @__PURE__ */ __toESM(require_react(), 1), Result = {
|
|
7
7
|
error(e, s) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
2
2
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
3
|
-
import { u as createLucideIcon } from "./dist-
|
|
4
|
-
import { E as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./strings-
|
|
3
|
+
import { u as createLucideIcon } from "./dist-DIlxLFXG.js";
|
|
4
|
+
import { E as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./strings-DIy9NAmg.js";
|
|
5
5
|
var ChartPie = createLucideIcon("chart-pie", [["path", {
|
|
6
6
|
d: "M21 12c.552 0 1.005-.449.95-.998a10 10 0 0 0-8.953-8.951c-.55-.055-.998.398-.998.95v8a1 1 0 0 0 1 1z",
|
|
7
7
|
key: "pzmjnu"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
2
2
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
3
|
-
import { k as dequal } from "./useTheme-
|
|
3
|
+
import { k as dequal } from "./useTheme-DYfby65G.js";
|
|
4
4
|
var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
5
5
|
function useDeepCompareMemoize(e) {
|
|
6
6
|
let i = import_react.useRef(e);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
2
2
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
3
3
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
4
|
-
import { t as getIframeCapabilities } from "./capabilities-
|
|
4
|
+
import { t as getIframeCapabilities } from "./capabilities-C6OQ5YBO.js";
|
|
5
5
|
var import_compiler_runtime = require_compiler_runtime();
|
|
6
6
|
require_react();
|
|
7
7
|
function useIframeCapabilities() {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
2
|
-
import { g as Logger, h as cn, r as cva } from "./button-
|
|
2
|
+
import { g as Logger, h as cn, r as cva } from "./button-BSm8IXRU.js";
|
|
3
3
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
4
4
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
5
|
-
import { u as createLucideIcon } from "./dist-
|
|
5
|
+
import { u as createLucideIcon } from "./dist-DIlxLFXG.js";
|
|
6
6
|
import { t as require_jsx_runtime } from "./jsx-runtime-DebpN0FN.js";
|
|
7
|
-
import { C as useSetAtom, T as atom } from "./useTheme-
|
|
7
|
+
import { C as useSetAtom, T as atom } from "./useTheme-DYfby65G.js";
|
|
8
8
|
var Calendar = createLucideIcon("calendar", [
|
|
9
9
|
["path", {
|
|
10
10
|
d: "M8 2v4",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
2
|
-
import { a as OverridingHotkeyProvider, g as Logger, s as resolvePlatform } from "./button-
|
|
2
|
+
import { a as OverridingHotkeyProvider, g as Logger, s as resolvePlatform } from "./button-BSm8IXRU.js";
|
|
3
3
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
4
4
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
5
|
-
import { A as looseObject, B as union, I as record, N as number, P as object, R as string, T as boolean, b as _enum, w as array } from "./zod-
|
|
5
|
+
import { A as looseObject, B as union, I as record, N as number, P as object, R as string, T as boolean, b as _enum, w as array } from "./zod-BUcyXSdR.js";
|
|
6
6
|
import { t as merge_default } from "./merge-Be1CqGnU.js";
|
|
7
7
|
var import_react = /* @__PURE__ */ __toESM(require_react()), useInsertionEffect = typeof window < "u" ? import_react.useInsertionEffect || import_react.useLayoutEffect : () => {
|
|
8
8
|
};
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { s as __toESM } from "./chunk-BNovOVIE.js";
|
|
2
|
-
import { g as Logger, h as cn, m as Events } from "./button-
|
|
2
|
+
import { g as Logger, h as cn, m as Events } from "./button-BSm8IXRU.js";
|
|
3
3
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
4
4
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
5
|
-
import { c as asRemoteURL,
|
|
5
|
+
import { c as asRemoteURL, w as CircleQuestionMark } from "./toDate-CqhBWjvO.js";
|
|
6
6
|
import "./react-dom-BTJzcVJ9.js";
|
|
7
7
|
import { t as require_jsx_runtime } from "./jsx-runtime-DebpN0FN.js";
|
|
8
|
-
import "./zod-
|
|
9
|
-
import { n as ErrorBanner } from "./error-banner-
|
|
10
|
-
import { t as Tooltip } from "./tooltip-
|
|
8
|
+
import "./zod-BUcyXSdR.js";
|
|
9
|
+
import { n as ErrorBanner } from "./error-banner-B_GQfxxD.js";
|
|
10
|
+
import { t as Tooltip } from "./tooltip-f-qR0iUx.js";
|
|
11
11
|
import { t as debounce_default } from "./debounce-BOD3DbfP.js";
|
|
12
|
-
import { A as useEvent_default, n as useTheme } from "./useTheme-
|
|
12
|
+
import { A as useEvent_default, n as useTheme } from "./useTheme-DYfby65G.js";
|
|
13
13
|
import { s as uniq } from "./arrays-sEtDRoG4.js";
|
|
14
14
|
import { t as Objects } from "./objects-De59twF-.js";
|
|
15
|
-
import { a as isValid, i as AlertTitle, n as Alert, t as arrow } from "./formats-
|
|
15
|
+
import { a as isValid, i as AlertTitle, n as Alert, t as arrow } from "./formats-Dwq1THhr.js";
|
|
16
16
|
import { V as getContainerWidth, n as formats } from "./vega-loader.browser-DmpxCJqx.js";
|
|
17
|
-
import { a as tooltipHandler, n as vegaLoadData } from "./loader-
|
|
17
|
+
import { a as tooltipHandler, n as vegaLoadData } from "./loader-DX-IDS7n.js";
|
|
18
18
|
import { t as j } from "./react-vega-BazDALhI.js";
|
|
19
19
|
import "./defaultLocale-BpsHxBd7.js";
|
|
20
20
|
import "./defaultLocale-DoeErsX2.js";
|
|
21
|
-
import { t as useAsyncData } from "./useAsyncData-
|
|
22
|
-
import { t as useDeepCompareMemoize } from "./useDeepCompareMemoize-
|
|
21
|
+
import { t as useAsyncData } from "./useAsyncData-CYOQb1EW.js";
|
|
22
|
+
import { t as useDeepCompareMemoize } from "./useDeepCompareMemoize-CSHQeQEI.js";
|
|
23
23
|
import { t as Semaphore } from "./semaphore-C8rmHdhj.js";
|
|
24
24
|
import { t as useVegaContainerRemeasure } from "./use-vega-container-remeasure-DGNrIQSk.js";
|
|
25
25
|
var import_compiler_runtime = require_compiler_runtime(), import_react = /* @__PURE__ */ __toESM(require_react(), 1);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as __export, s as __toESM } from "./chunk-BNovOVIE.js";
|
|
2
|
-
import { c as useEventListener, p as useComposedRefs, u as createSlot } from "./button-
|
|
2
|
+
import { c as useEventListener, p as useComposedRefs, u as createSlot } from "./button-BSm8IXRU.js";
|
|
3
3
|
import { t as require_react } from "./react-DA-nE2FX.js";
|
|
4
4
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
5
5
|
import { t as require_react_dom } from "./react-dom-BTJzcVJ9.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marimo-team/islands",
|
|
3
|
-
"version": "0.23.16-
|
|
3
|
+
"version": "0.23.16-dev62",
|
|
4
4
|
"main": "dist/main.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"type": "module",
|
|
@@ -55,15 +55,14 @@
|
|
|
55
55
|
"@lezer/markdown": "^1.6.3",
|
|
56
56
|
"@lezer/python": "^1.1.18",
|
|
57
57
|
"@marimo-team/codemirror-ai": "^0.3.7",
|
|
58
|
-
"@marimo-team/codemirror-languageserver": "^
|
|
58
|
+
"@marimo-team/codemirror-languageserver": "^2.0.0",
|
|
59
59
|
"@marimo-team/codemirror-mcp": "^0.1.7",
|
|
60
|
-
"@marimo-team/codemirror-sql": "^0.
|
|
60
|
+
"@marimo-team/codemirror-sql": "^0.3.0",
|
|
61
61
|
"@marimo-team/llm-info": "workspace:*",
|
|
62
62
|
"@marimo-team/marimo-api": "workspace:*",
|
|
63
63
|
"@marimo-team/react-slotz": "^0.2.0",
|
|
64
64
|
"@marimo-team/smart-cells": "workspace:*",
|
|
65
65
|
"@mui/material": "^6.5.0",
|
|
66
|
-
"@open-rpc/client-js": "^1.8.1",
|
|
67
66
|
"@paralleldrive/cuid2": "^2.3.1",
|
|
68
67
|
"@radix-ui/colors": "^3.0.0",
|
|
69
68
|
"@radix-ui/react-icons": "~1.3.2",
|
|
@@ -41,6 +41,7 @@ export const MockRequestClient = {
|
|
|
41
41
|
previewSQLTableList: vi.fn().mockResolvedValue({ tables: [] }),
|
|
42
42
|
previewSQLSchemaList: vi.fn().mockResolvedValue({ schemas: [] }),
|
|
43
43
|
previewDataSourceConnection: vi.fn().mockResolvedValue({}),
|
|
44
|
+
discoverDataSources: vi.fn().mockResolvedValue({}),
|
|
44
45
|
validateSQL: vi.fn().mockResolvedValue({}),
|
|
45
46
|
openFile: vi.fn().mockResolvedValue({}),
|
|
46
47
|
getUsageStats: vi.fn().mockResolvedValue({}),
|
|
@@ -64,10 +65,61 @@ export const MockRequestClient = {
|
|
|
64
65
|
getWorkspaceFiles: vi.fn().mockResolvedValue({ files: [] }),
|
|
65
66
|
getRunningNotebooks: vi.fn().mockResolvedValue({ files: [] }),
|
|
66
67
|
shutdownSession: vi.fn().mockResolvedValue({}),
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
getExportAvailability: vi.fn().mockResolvedValue({
|
|
69
|
+
source: "server",
|
|
70
|
+
formats: [
|
|
71
|
+
{
|
|
72
|
+
format: "html",
|
|
73
|
+
dependenciesAvailable: true,
|
|
74
|
+
missingPackages: [],
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
format: "markdown",
|
|
78
|
+
dependenciesAvailable: true,
|
|
79
|
+
missingPackages: [],
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
format: "ipynb",
|
|
83
|
+
dependenciesAvailable: true,
|
|
84
|
+
missingPackages: [],
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
format: "pdf",
|
|
88
|
+
dependenciesAvailable: true,
|
|
89
|
+
missingPackages: [],
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
format: "script",
|
|
93
|
+
dependenciesAvailable: true,
|
|
94
|
+
missingPackages: [],
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
}),
|
|
98
|
+
exportAsHTML: vi.fn().mockResolvedValue({
|
|
99
|
+
contents: "",
|
|
100
|
+
filename: "notebook.html",
|
|
101
|
+
mediaType: "text/html; charset=utf-8",
|
|
102
|
+
}),
|
|
103
|
+
exportAsIPYNB: vi.fn().mockResolvedValue({
|
|
104
|
+
contents: "",
|
|
105
|
+
filename: "notebook.ipynb",
|
|
106
|
+
mediaType: "text/plain; charset=utf-8",
|
|
107
|
+
}),
|
|
108
|
+
exportAsMarkdown: vi.fn().mockResolvedValue({
|
|
109
|
+
contents: "",
|
|
110
|
+
filename: "notebook.md",
|
|
111
|
+
mediaType: "text/plain; charset=utf-8",
|
|
112
|
+
}),
|
|
113
|
+
exportAsScript: vi.fn().mockResolvedValue({
|
|
114
|
+
contents: "",
|
|
115
|
+
filename: "notebook.script.py",
|
|
116
|
+
mediaType: "text/plain; charset=utf-8",
|
|
117
|
+
}),
|
|
118
|
+
exportAsPDF: vi.fn().mockResolvedValue({
|
|
119
|
+
contents: new Blob(),
|
|
120
|
+
filename: "notebook.pdf",
|
|
121
|
+
mediaType: "application/pdf",
|
|
122
|
+
}),
|
|
71
123
|
autoExportAsHTML: vi.fn().mockResolvedValue({}),
|
|
72
124
|
autoExportAsMarkdown: vi.fn().mockResolvedValue({}),
|
|
73
125
|
autoExportAsIPYNB: vi.fn().mockResolvedValue({}),
|
|
@@ -109,9 +109,10 @@ exports[`ColumnChartSpecModel > file URL handling > should handle arrow data 1`]
|
|
|
109
109
|
"type": "temporal",
|
|
110
110
|
},
|
|
111
111
|
"y": {
|
|
112
|
-
"
|
|
113
|
-
|
|
114
|
-
|
|
112
|
+
"value": 0,
|
|
113
|
+
},
|
|
114
|
+
"y2": {
|
|
115
|
+
"value": 100,
|
|
115
116
|
},
|
|
116
117
|
},
|
|
117
118
|
"mark": {
|
|
@@ -222,9 +223,10 @@ exports[`ColumnChartSpecModel > should expect bin values to be used for number a
|
|
|
222
223
|
"field": "bin_end_extended",
|
|
223
224
|
},
|
|
224
225
|
"y": {
|
|
225
|
-
"
|
|
226
|
-
|
|
227
|
-
|
|
226
|
+
"value": 0,
|
|
227
|
+
},
|
|
228
|
+
"y2": {
|
|
229
|
+
"value": 30,
|
|
228
230
|
},
|
|
229
231
|
},
|
|
230
232
|
"mark": {
|
|
@@ -486,9 +488,10 @@ exports[`ColumnChartSpecModel > should handle datetime bin values 1`] = `
|
|
|
486
488
|
"type": "ordinal",
|
|
487
489
|
},
|
|
488
490
|
"y": {
|
|
489
|
-
"
|
|
490
|
-
|
|
491
|
-
|
|
491
|
+
"value": 0,
|
|
492
|
+
},
|
|
493
|
+
"y2": {
|
|
494
|
+
"value": 30,
|
|
492
495
|
},
|
|
493
496
|
},
|
|
494
497
|
"mark": {
|
|
@@ -633,6 +636,152 @@ exports[`ColumnChartSpecModel > should handle string value counts 1`] = `
|
|
|
633
636
|
}
|
|
634
637
|
`;
|
|
635
638
|
|
|
639
|
+
exports[`ColumnChartSpecModel > should render a null bar for all-null temporal columns 1`] = `
|
|
640
|
+
{
|
|
641
|
+
"background": "transparent",
|
|
642
|
+
"config": {
|
|
643
|
+
"axis": {
|
|
644
|
+
"domain": false,
|
|
645
|
+
},
|
|
646
|
+
"view": {
|
|
647
|
+
"stroke": "transparent",
|
|
648
|
+
},
|
|
649
|
+
},
|
|
650
|
+
"data": {
|
|
651
|
+
"name": "bin_values",
|
|
652
|
+
"values": [
|
|
653
|
+
{
|
|
654
|
+
"bin_end": null,
|
|
655
|
+
"bin_start": null,
|
|
656
|
+
"count": 12,
|
|
657
|
+
},
|
|
658
|
+
],
|
|
659
|
+
},
|
|
660
|
+
"height": 30,
|
|
661
|
+
"layer": [
|
|
662
|
+
{
|
|
663
|
+
"encoding": {
|
|
664
|
+
"x": {
|
|
665
|
+
"axis": null,
|
|
666
|
+
"field": "bin_start",
|
|
667
|
+
"type": "nominal",
|
|
668
|
+
},
|
|
669
|
+
"y": {
|
|
670
|
+
"axis": null,
|
|
671
|
+
"field": "count",
|
|
672
|
+
"type": "quantitative",
|
|
673
|
+
},
|
|
674
|
+
},
|
|
675
|
+
"mark": {
|
|
676
|
+
"color": "#cc4e00",
|
|
677
|
+
"type": "bar",
|
|
678
|
+
},
|
|
679
|
+
},
|
|
680
|
+
{
|
|
681
|
+
"encoding": {
|
|
682
|
+
"tooltip": [
|
|
683
|
+
{
|
|
684
|
+
"field": "count",
|
|
685
|
+
"format": ",d",
|
|
686
|
+
"title": "nulls",
|
|
687
|
+
"type": "quantitative",
|
|
688
|
+
},
|
|
689
|
+
],
|
|
690
|
+
"x": {
|
|
691
|
+
"axis": null,
|
|
692
|
+
"field": "bin_start",
|
|
693
|
+
"type": "nominal",
|
|
694
|
+
},
|
|
695
|
+
"y": {
|
|
696
|
+
"value": 0,
|
|
697
|
+
},
|
|
698
|
+
"y2": {
|
|
699
|
+
"value": 30,
|
|
700
|
+
},
|
|
701
|
+
},
|
|
702
|
+
"mark": {
|
|
703
|
+
"opacity": 0,
|
|
704
|
+
"type": "bar",
|
|
705
|
+
},
|
|
706
|
+
},
|
|
707
|
+
],
|
|
708
|
+
"width": 70,
|
|
709
|
+
}
|
|
710
|
+
`;
|
|
711
|
+
|
|
712
|
+
exports[`ColumnChartSpecModel > should render only a null bar for all-null numeric columns 1`] = `
|
|
713
|
+
{
|
|
714
|
+
"background": "transparent",
|
|
715
|
+
"config": {
|
|
716
|
+
"axis": {
|
|
717
|
+
"domain": false,
|
|
718
|
+
},
|
|
719
|
+
"view": {
|
|
720
|
+
"stroke": "transparent",
|
|
721
|
+
},
|
|
722
|
+
},
|
|
723
|
+
"data": {
|
|
724
|
+
"name": "bin_values",
|
|
725
|
+
"values": [
|
|
726
|
+
{
|
|
727
|
+
"bin_end": null,
|
|
728
|
+
"bin_start": null,
|
|
729
|
+
"count": 12,
|
|
730
|
+
},
|
|
731
|
+
],
|
|
732
|
+
},
|
|
733
|
+
"height": 30,
|
|
734
|
+
"layer": [
|
|
735
|
+
{
|
|
736
|
+
"encoding": {
|
|
737
|
+
"x": {
|
|
738
|
+
"axis": null,
|
|
739
|
+
"field": "bin_start",
|
|
740
|
+
"type": "nominal",
|
|
741
|
+
},
|
|
742
|
+
"y": {
|
|
743
|
+
"axis": null,
|
|
744
|
+
"field": "count",
|
|
745
|
+
"type": "quantitative",
|
|
746
|
+
},
|
|
747
|
+
},
|
|
748
|
+
"mark": {
|
|
749
|
+
"color": "#cc4e00",
|
|
750
|
+
"type": "bar",
|
|
751
|
+
},
|
|
752
|
+
},
|
|
753
|
+
{
|
|
754
|
+
"encoding": {
|
|
755
|
+
"tooltip": [
|
|
756
|
+
{
|
|
757
|
+
"field": "count",
|
|
758
|
+
"format": ",d",
|
|
759
|
+
"title": "nulls",
|
|
760
|
+
"type": "quantitative",
|
|
761
|
+
},
|
|
762
|
+
],
|
|
763
|
+
"x": {
|
|
764
|
+
"axis": null,
|
|
765
|
+
"field": "bin_start",
|
|
766
|
+
"type": "nominal",
|
|
767
|
+
},
|
|
768
|
+
"y": {
|
|
769
|
+
"value": 0,
|
|
770
|
+
},
|
|
771
|
+
"y2": {
|
|
772
|
+
"value": 30,
|
|
773
|
+
},
|
|
774
|
+
},
|
|
775
|
+
"mark": {
|
|
776
|
+
"opacity": 0,
|
|
777
|
+
"type": "bar",
|
|
778
|
+
},
|
|
779
|
+
},
|
|
780
|
+
],
|
|
781
|
+
"width": 70,
|
|
782
|
+
}
|
|
783
|
+
`;
|
|
784
|
+
|
|
636
785
|
exports[`ColumnChartSpecModel > snapshot with legacy data spec > array 1`] = `
|
|
637
786
|
{
|
|
638
787
|
"background": "transparent",
|
|
@@ -700,9 +849,10 @@ exports[`ColumnChartSpecModel > snapshot with legacy data spec > array 1`] = `
|
|
|
700
849
|
"type": "quantitative",
|
|
701
850
|
},
|
|
702
851
|
"y": {
|
|
703
|
-
"
|
|
704
|
-
|
|
705
|
-
|
|
852
|
+
"value": 0,
|
|
853
|
+
},
|
|
854
|
+
"y2": {
|
|
855
|
+
"value": 100,
|
|
706
856
|
},
|
|
707
857
|
},
|
|
708
858
|
"mark": {
|
|
@@ -788,9 +938,10 @@ exports[`ColumnChartSpecModel > snapshot with legacy data spec > csv data 1`] =
|
|
|
788
938
|
"type": "quantitative",
|
|
789
939
|
},
|
|
790
940
|
"y": {
|
|
791
|
-
"
|
|
792
|
-
|
|
793
|
-
|
|
941
|
+
"value": 0,
|
|
942
|
+
},
|
|
943
|
+
"y2": {
|
|
944
|
+
"value": 100,
|
|
794
945
|
},
|
|
795
946
|
},
|
|
796
947
|
"mark": {
|
|
@@ -876,9 +1027,10 @@ exports[`ColumnChartSpecModel > snapshot with legacy data spec > csv string 1`]
|
|
|
876
1027
|
"type": "quantitative",
|
|
877
1028
|
},
|
|
878
1029
|
"y": {
|
|
879
|
-
"
|
|
880
|
-
|
|
881
|
-
|
|
1030
|
+
"value": 0,
|
|
1031
|
+
},
|
|
1032
|
+
"y2": {
|
|
1033
|
+
"value": 100,
|
|
882
1034
|
},
|
|
883
1035
|
},
|
|
884
1036
|
"mark": {
|
|
@@ -988,9 +1140,10 @@ exports[`ColumnChartSpecModel > snapshot with legacy data spec > url data 1`] =
|
|
|
988
1140
|
"type": "temporal",
|
|
989
1141
|
},
|
|
990
1142
|
"y": {
|
|
991
|
-
"
|
|
992
|
-
|
|
993
|
-
|
|
1143
|
+
"value": 0,
|
|
1144
|
+
},
|
|
1145
|
+
"y2": {
|
|
1146
|
+
"value": 100,
|
|
994
1147
|
},
|
|
995
1148
|
},
|
|
996
1149
|
"mark": {
|
|
@@ -178,6 +178,104 @@ describe("ColumnChartSpecModel", () => {
|
|
|
178
178
|
expect(summary2.spec?.data?.values).toEqual(mockBinValues.integer);
|
|
179
179
|
});
|
|
180
180
|
|
|
181
|
+
it("should render only a null bar for all-null numeric columns", () => {
|
|
182
|
+
const allNullStats: Record<ColumnName, Partial<ColumnHeaderStats>> = {
|
|
183
|
+
number: { nulls: 12, total: 12 },
|
|
184
|
+
};
|
|
185
|
+
const allNullBins: Record<ColumnName, BinValues> = {
|
|
186
|
+
number: [],
|
|
187
|
+
};
|
|
188
|
+
const model = new ColumnChartSpecModel(
|
|
189
|
+
[],
|
|
190
|
+
mockFieldTypes,
|
|
191
|
+
allNullStats,
|
|
192
|
+
allNullBins,
|
|
193
|
+
{},
|
|
194
|
+
{ includeCharts: true },
|
|
195
|
+
);
|
|
196
|
+
const summary = model.getHeaderSummary("number");
|
|
197
|
+
expect(summary.spec).toBeDefined();
|
|
198
|
+
// @ts-expect-error hconcat should be available
|
|
199
|
+
expect(summary.spec?.hconcat).toBeUndefined();
|
|
200
|
+
// @ts-expect-error data.values should be available
|
|
201
|
+
expect(summary.spec?.data?.values).toEqual([
|
|
202
|
+
{ bin_start: null, bin_end: null, count: 12 },
|
|
203
|
+
]);
|
|
204
|
+
// Full-width null-only chart (not the thin hconcat null strip)
|
|
205
|
+
expect(summary.spec?.width).toBe(70);
|
|
206
|
+
// Full-height tooltip hit area uses pixel y/y2 (no aggregate:max)
|
|
207
|
+
// @ts-expect-error layer should be available
|
|
208
|
+
expect(summary.spec?.layer?.[1]?.encoding?.y).toEqual({ value: 0 });
|
|
209
|
+
// @ts-expect-error layer should be available
|
|
210
|
+
expect(summary.spec?.layer?.[1]?.encoding?.y2).toEqual({ value: 30 });
|
|
211
|
+
expect(summary.spec).toMatchSnapshot();
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
it("should ignore NaN bins and not mutate stored bin values", () => {
|
|
215
|
+
const nanOnlyBins: Record<ColumnName, BinValues> = {
|
|
216
|
+
number: [
|
|
217
|
+
{ bin_start: Number.NaN, bin_end: 0.1, count: 0 },
|
|
218
|
+
{ bin_start: Number.NaN, bin_end: 1, count: 0 },
|
|
219
|
+
],
|
|
220
|
+
};
|
|
221
|
+
const stats: Record<ColumnName, Partial<ColumnHeaderStats>> = {
|
|
222
|
+
number: { nulls: 12, total: 12 },
|
|
223
|
+
};
|
|
224
|
+
const model = new ColumnChartSpecModel(
|
|
225
|
+
[],
|
|
226
|
+
mockFieldTypes,
|
|
227
|
+
stats,
|
|
228
|
+
nanOnlyBins,
|
|
229
|
+
{},
|
|
230
|
+
{ includeCharts: true },
|
|
231
|
+
);
|
|
232
|
+
const first = model.getHeaderSummary("number");
|
|
233
|
+
const second = model.getHeaderSummary("number");
|
|
234
|
+
// All NaN bins are invalid → null-only chart
|
|
235
|
+
// @ts-expect-error hconcat should be available
|
|
236
|
+
expect(first.spec?.hconcat).toBeUndefined();
|
|
237
|
+
expect(first.spec?.width).toBe(70);
|
|
238
|
+
// Stored bins must not grow across getHeaderSummary calls
|
|
239
|
+
expect(nanOnlyBins.number).toHaveLength(2);
|
|
240
|
+
expect(second.spec).toEqual(first.spec);
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
it("should render a null bar for all-null temporal columns", () => {
|
|
244
|
+
const model = new ColumnChartSpecModel(
|
|
245
|
+
[],
|
|
246
|
+
mockFieldTypes,
|
|
247
|
+
{ datetime: { nulls: 12, total: 12 } },
|
|
248
|
+
{ datetime: [] },
|
|
249
|
+
{},
|
|
250
|
+
{ includeCharts: true },
|
|
251
|
+
);
|
|
252
|
+
const summary = model.getHeaderSummary("datetime");
|
|
253
|
+
expect(summary.spec).toBeDefined();
|
|
254
|
+
// @ts-expect-error data.values
|
|
255
|
+
expect(summary.spec?.data?.values).toEqual([
|
|
256
|
+
{ bin_start: null, bin_end: null, count: 12 },
|
|
257
|
+
]);
|
|
258
|
+
expect(summary.spec?.width).toBe(70);
|
|
259
|
+
// Same full-height hover hit area as numeric all-null charts
|
|
260
|
+
// @ts-expect-error layer should be available
|
|
261
|
+
expect(summary.spec?.layer?.[1]?.encoding?.y).toEqual({ value: 0 });
|
|
262
|
+
// @ts-expect-error layer should be available
|
|
263
|
+
expect(summary.spec?.layer?.[1]?.encoding?.y2).toEqual({ value: 30 });
|
|
264
|
+
expect(summary.spec).toMatchSnapshot();
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
it("should return null when numeric bins are empty and there are no nulls", () => {
|
|
268
|
+
const model = new ColumnChartSpecModel(
|
|
269
|
+
[],
|
|
270
|
+
mockFieldTypes,
|
|
271
|
+
{ number: { min: 0, max: 1 } },
|
|
272
|
+
{ number: [] },
|
|
273
|
+
{},
|
|
274
|
+
{ includeCharts: true },
|
|
275
|
+
);
|
|
276
|
+
expect(model.getHeaderSummary("number").spec).toBeNull();
|
|
277
|
+
});
|
|
278
|
+
|
|
181
279
|
it("should handle datetime bin values", () => {
|
|
182
280
|
const model = new ColumnChartSpecModel(
|
|
183
281
|
[],
|
|
@@ -191,7 +289,10 @@ describe("ColumnChartSpecModel", () => {
|
|
|
191
289
|
const summary = model.getHeaderSummary("datetime");
|
|
192
290
|
expect(summary.spec).toBeDefined();
|
|
193
291
|
// @ts-expect-error data.values should be available
|
|
194
|
-
expect(summary.spec?.data?.values).toEqual(
|
|
292
|
+
expect(summary.spec?.data?.values).toEqual([
|
|
293
|
+
...mockBinValues.datetime,
|
|
294
|
+
{ bin_start: null, bin_end: null, count: 10 },
|
|
295
|
+
]);
|
|
195
296
|
|
|
196
297
|
expect(summary.spec).toMatchSnapshot();
|
|
197
298
|
|
|
@@ -5,6 +5,7 @@ import { fireEvent, render } from "@testing-library/react";
|
|
|
5
5
|
import { I18nProvider } from "react-aria";
|
|
6
6
|
import { describe, expect, it, test, vi } from "vitest";
|
|
7
7
|
import { TooltipProvider } from "@/components/ui/tooltip";
|
|
8
|
+
import { Logger } from "@/utils/Logger";
|
|
8
9
|
import { parseContent } from "@/utils/url-parser";
|
|
9
10
|
import {
|
|
10
11
|
generateColumns,
|
|
@@ -174,16 +175,23 @@ describe("generateColumns", () => {
|
|
|
174
175
|
];
|
|
175
176
|
|
|
176
177
|
it("should generate columns with row headers", () => {
|
|
178
|
+
const loggerWarn = vi.spyOn(Logger, "warn").mockImplementation(() => {});
|
|
179
|
+
// "name" intentionally appears in both inputs; the row header takes precedence.
|
|
177
180
|
const columns = generateColumns({
|
|
178
181
|
rowHeaders: [["name", ["string", "text"]]],
|
|
179
182
|
selection: null,
|
|
180
183
|
fieldTypes,
|
|
181
184
|
});
|
|
182
185
|
|
|
183
|
-
expect(columns).toHaveLength(
|
|
186
|
+
expect(columns).toHaveLength(2);
|
|
187
|
+
expect(columns.map((column) => column.id)).toEqual(["name", "age"]);
|
|
184
188
|
expect(columns[0].id).toBe("name");
|
|
185
189
|
expect(columns[0].meta?.rowHeader).toBe(true);
|
|
186
190
|
expect(columns[0].enableSorting).toBe(true);
|
|
191
|
+
expect(loggerWarn).toHaveBeenCalledWith(
|
|
192
|
+
"Skipping field type for row header column name",
|
|
193
|
+
);
|
|
194
|
+
loggerWarn.mockRestore();
|
|
187
195
|
});
|
|
188
196
|
|
|
189
197
|
it("should generate columns with nameless row headers", () => {
|