@marimo-team/islands 0.23.14-dev53 → 0.23.14-dev55
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/{code-visibility--COhZgLs.js → code-visibility-DQX0uy8x.js} +12 -10
- package/dist/main.js +2 -2
- package/dist/{reveal-component-_OlCsMRT.js → reveal-component-wJKTADmW.js} +1 -1
- package/package.json +1 -1
- package/src/components/editor/output/ImageOutput.tsx +20 -6
- package/src/components/editor/output/__tests__/ImageOutput.test.tsx +53 -0
|
@@ -19179,19 +19179,21 @@ To suppress this warning, you need to explicitly provide the \`palette.${t}Chann
|
|
|
19179
19179
|
HtmlOutput.displayName = "HtmlOutput";
|
|
19180
19180
|
var import_compiler_runtime$66 = require_compiler_runtime();
|
|
19181
19181
|
const ImageOutput = (e) => {
|
|
19182
|
-
let t = (0, import_compiler_runtime$66.c)(
|
|
19183
|
-
t[0] !== o || t[1] !== a ? (d = {}, a
|
|
19184
|
-
let f;
|
|
19185
|
-
t[3] !== c || t[4] !== n || t[5] !== d ? (
|
|
19182
|
+
let t = (0, import_compiler_runtime$66.c)(12), { src: n, alt: i, width: a, height: o, className: s } = e, c = i === void 0 ? "" : i, d;
|
|
19183
|
+
t[0] !== o || t[1] !== a ? (d = {}, typeof a == "string" && (d.width = a), typeof o == "string" && (d.height = o), t[0] = o, t[1] = a, t[2] = d) : d = t[2];
|
|
19184
|
+
let f = typeof a == "number" ? a : void 0, h = typeof o == "number" ? o : void 0, _;
|
|
19185
|
+
t[3] !== c || t[4] !== n || t[5] !== d || t[6] !== f || t[7] !== h ? (_ = (0, import_jsx_runtime.jsx)("img", {
|
|
19186
19186
|
src: n,
|
|
19187
19187
|
alt: c,
|
|
19188
|
+
width: f,
|
|
19189
|
+
height: h,
|
|
19188
19190
|
style: d
|
|
19189
|
-
}), t[3] = c, t[4] = n, t[5] = d, t[6] = f) :
|
|
19190
|
-
let
|
|
19191
|
-
return t[
|
|
19191
|
+
}), t[3] = c, t[4] = n, t[5] = d, t[6] = f, t[7] = h, t[8] = _) : _ = t[8];
|
|
19192
|
+
let v;
|
|
19193
|
+
return t[9] !== s || t[10] !== _ ? (v = (0, import_jsx_runtime.jsx)("span", {
|
|
19192
19194
|
className: s,
|
|
19193
|
-
children:
|
|
19194
|
-
}), t[
|
|
19195
|
+
children: _
|
|
19196
|
+
}), t[9] = s, t[10] = _, t[11] = v) : v = t[11], v;
|
|
19195
19197
|
};
|
|
19196
19198
|
var import_compiler_runtime$65 = require_compiler_runtime();
|
|
19197
19199
|
Kbd = (e) => {
|
|
@@ -36207,7 +36209,7 @@ ${d}`,
|
|
|
36207
36209
|
return Logger.warn("Failed to get version from mount config"), null;
|
|
36208
36210
|
}
|
|
36209
36211
|
}
|
|
36210
|
-
marimoVersionAtom = atom(getVersionFromMountConfig() || "0.23.14-
|
|
36212
|
+
marimoVersionAtom = atom(getVersionFromMountConfig() || "0.23.14-dev55");
|
|
36211
36213
|
showCodeInRunModeAtom = atom(true);
|
|
36212
36214
|
atom(null);
|
|
36213
36215
|
var import_compiler_runtime = require_compiler_runtime();
|
package/dist/main.js
CHANGED
|
@@ -26,7 +26,7 @@ import { $ as reducer, $t as getRequestClient, A as ChevronDownIcon, An as Trigg
|
|
|
26
26
|
import { __tla as __tla_1 } from "./chunk-5FQGJX7Z-BbqSm5gU.js";
|
|
27
27
|
import { o as useSize, s as Root$1, u as createLucideIcon } from "./dist--2Bqjvs0.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-CnTgI25l.js";
|
|
29
|
-
import { $ as PANEL_TYPES, $t as HtmlOutput, A as prettifyRowCount, At as INDEX_COLUMN_NAME, B as CompactChipRow, Bt as dateToLocalISODateTime, C as downloadSizeLimitAtom, Ct as ColumnChartSpecModel, D as ErrorState, Dt as getPageIndexForRow, E as EmptyState, Et as usePrevious$1, F as ContextMenuItem, Ft as hasFunctionProperty, G as Command, Gt as TabsTrigger, H as DateRangePicker, Ht as Tabs, I as ContextMenuSeparator, It as isRecord, J as CommandItem, Jt as ChartLoadingState, K as CommandEmpty, Kt as ChartErrorState, L as ContextMenuTrigger, Lt as isNullishFilter, M as getUserColumnVisibilityCounts, Mt as TOO_MANY_ROWS, N as ContextMenu, Nt as toFieldTypes, O as LoadingState, Ot as loadTableAndRawData, P as ContextMenuContent, Pt as getMimeValues, Q as ContextAwarePanelItem, Qt as Kbd, R as useInternalStateWithSync, Rt as Maps, S as Filenames, St as ColumnChartContext, T as ColumnPreviewContainer, Tt as useIntersectionObserver, U as Combobox, Ut as TabsContent, V as DatePicker, Vt as dateToLocalISOTime, W as ComboboxItem, Wt as TabsList, X as CommandSeparator, Xt as useOverflowDetection, Y as CommandList, Yt as LazyVegaEmbed, Z as smartMatch, Zt as RenderTextWithLinks, _ as ADD_PRINTING_CLASS, _t as TableRow, an as Funnel, at as slotsController, b as downloadHTMLAsImage, bt as inferFieldTypes, c as Slide, cn as Ellipsis, d as RadioGroupItem, dn as ChevronsUpDown, dt as Provider$1, en as EmotionCacheProvider, et as contextAwarePanelOpen, f as JsonOutput, fn as ChevronsRight, ft as Table, g as InstallPackageButton, gn as ArrowDownWideNarrow, gt as TableHeader, h as DataTable, hn as ChevronLeft, ht as TableHead, in as GripHorizontal, it as SlotNames, j as getColumnCountForDisplay, jt as SELECT_COLUMN_ID, k as prettifyRowColumnCount, kt as loadTableData, l as Switch, ln as Download, m as OutputRenderer, mn as ChevronsDownUp, mt as TableCell, n as marimoVersionAtom, nn as $fae977aafc393c5c$export$6b862160d295c8e, nt as contextAwarePanelType, o as SLIDE_TYPE_OPTIONS_BY_VALUE, on as EyeOff, ot as Toggle, p as OutputArea, pn as ChevronsLeft, pt as TableBody, q as CommandInput, qt as ChartInfoState, r as showCodeInRunModeAtom, rn as TextWrap, rt as isCellAwareAtom, t as useNotebookCodeAvailable, tn as $fae977aafc393c5c$export$588937bcd60ade55, tt as contextAwarePanelOwner, u as RadioGroup, un as Code, ut as Fill, v as downloadBlob, vt as NAMELESS_COLUMN_PREFIX, w as ColumnName, wt as DelayMount, x as Progress, xt as renderCellValue, y as downloadByURL, yt as generateColumns, z as useSelectList, zt as dateToLocalISODate, __tla as __tla_2 } from "./code-visibility
|
|
29
|
+
import { $ as PANEL_TYPES, $t as HtmlOutput, A as prettifyRowCount, At as INDEX_COLUMN_NAME, B as CompactChipRow, Bt as dateToLocalISODateTime, C as downloadSizeLimitAtom, Ct as ColumnChartSpecModel, D as ErrorState, Dt as getPageIndexForRow, E as EmptyState, Et as usePrevious$1, F as ContextMenuItem, Ft as hasFunctionProperty, G as Command, Gt as TabsTrigger, H as DateRangePicker, Ht as Tabs, I as ContextMenuSeparator, It as isRecord, J as CommandItem, Jt as ChartLoadingState, K as CommandEmpty, Kt as ChartErrorState, L as ContextMenuTrigger, Lt as isNullishFilter, M as getUserColumnVisibilityCounts, Mt as TOO_MANY_ROWS, N as ContextMenu, Nt as toFieldTypes, O as LoadingState, Ot as loadTableAndRawData, P as ContextMenuContent, Pt as getMimeValues, Q as ContextAwarePanelItem, Qt as Kbd, R as useInternalStateWithSync, Rt as Maps, S as Filenames, St as ColumnChartContext, T as ColumnPreviewContainer, Tt as useIntersectionObserver, U as Combobox, Ut as TabsContent, V as DatePicker, Vt as dateToLocalISOTime, W as ComboboxItem, Wt as TabsList, X as CommandSeparator, Xt as useOverflowDetection, Y as CommandList, Yt as LazyVegaEmbed, Z as smartMatch, Zt as RenderTextWithLinks, _ as ADD_PRINTING_CLASS, _t as TableRow, an as Funnel, at as slotsController, b as downloadHTMLAsImage, bt as inferFieldTypes, c as Slide, cn as Ellipsis, d as RadioGroupItem, dn as ChevronsUpDown, dt as Provider$1, en as EmotionCacheProvider, et as contextAwarePanelOpen, f as JsonOutput, fn as ChevronsRight, ft as Table, g as InstallPackageButton, gn as ArrowDownWideNarrow, gt as TableHeader, h as DataTable, hn as ChevronLeft, ht as TableHead, in as GripHorizontal, it as SlotNames, j as getColumnCountForDisplay, jt as SELECT_COLUMN_ID, k as prettifyRowColumnCount, kt as loadTableData, l as Switch, ln as Download, m as OutputRenderer, mn as ChevronsDownUp, mt as TableCell, n as marimoVersionAtom, nn as $fae977aafc393c5c$export$6b862160d295c8e, nt as contextAwarePanelType, o as SLIDE_TYPE_OPTIONS_BY_VALUE, on as EyeOff, ot as Toggle, p as OutputArea, pn as ChevronsLeft, pt as TableBody, q as CommandInput, qt as ChartInfoState, r as showCodeInRunModeAtom, rn as TextWrap, rt as isCellAwareAtom, t as useNotebookCodeAvailable, tn as $fae977aafc393c5c$export$588937bcd60ade55, tt as contextAwarePanelOwner, u as RadioGroup, un as Code, ut as Fill, v as downloadBlob, vt as NAMELESS_COLUMN_PREFIX, w as ColumnName, wt as DelayMount, x as Progress, xt as renderCellValue, y as downloadByURL, yt as generateColumns, z as useSelectList, zt as dateToLocalISODate, __tla as __tla_2 } from "./code-visibility-DQX0uy8x.js";
|
|
30
30
|
import { c as Calendar, i as createReducerAndAtoms, n as useOnUnmount, o as ToggleLeft, t as useOnMount } from "./useLifecycle-CxffarYV.js";
|
|
31
31
|
import { t as Check } from "./check-C9OoNtR4.js";
|
|
32
32
|
import { A as Icon, C as logNever, D as $18f2051aff69b9bf$export$a54013f0d02a8f82, E as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7, F as createCollection, I as X, M as clamp$2, N as usePrevious$2, P as useDirection, R as ChevronDown, S as assertNever, a as SelectGroup, c as SelectSeparator, d as NativeSelect, i as SelectContent, j as Trigger$1, l as SelectTrigger, n as capitalize, o as SelectItem, r as Select, s as SelectLabel, t as Strings, u as SelectValue, w as $a916eb452884faea$export$b7a616150fdb9f44 } from "./strings-Dq_j3Rxw.js";
|
|
@@ -37732,7 +37732,7 @@ ${c}
|
|
|
37732
37732
|
function _temp2$2(e) {
|
|
37733
37733
|
e.target === e.currentTarget && e.key === "Enter" && (e.preventDefault(), e.stopPropagation(), e.currentTarget.click());
|
|
37734
37734
|
}
|
|
37735
|
-
var LazySlidesComponent = import_react.lazy(() => import("./reveal-component-
|
|
37735
|
+
var LazySlidesComponent = import_react.lazy(() => import("./reveal-component-wJKTADmW.js"));
|
|
37736
37736
|
const SlidesLayoutRenderer = ({ layout: e, setLayout: r, cells: c, mode: l }) => {
|
|
37737
37737
|
var _a3;
|
|
37738
37738
|
let u = useAtomValue(kioskModeAtom), d = l === "read" || u, f = useAtomValue(numColumnsAtom) > 1, [p, m] = (0, import_react.useState)(null), { slideCells: h, skippedIds: g, noOutputIds: _, slideTypes: v, startCellIndex: y } = (0, import_react.useMemo)(() => computeSlideCellsInfo(c, e), [
|
|
@@ -9,7 +9,7 @@ import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
|
9
9
|
import { lt as kioskModeAtom, pt as outputIsStale } from "./html-to-image-DOqQBSQc.js";
|
|
10
10
|
import "./chunk-5FQGJX7Z-BbqSm5gU.js";
|
|
11
11
|
import { u as createLucideIcon } from "./dist--2Bqjvs0.js";
|
|
12
|
-
import { a as DEFAULT_SLIDE_TYPE, c as Slide, ct as PanelGroup, i as DEFAULT_DECK_TRANSITION, lt as PanelResizeHandle, on as EyeOff, s as SlideSidebar, sn as Expand, st as Panel, t as useNotebookCodeAvailable, un as Code } from "./code-visibility
|
|
12
|
+
import { a as DEFAULT_SLIDE_TYPE, c as Slide, ct as PanelGroup, i as DEFAULT_DECK_TRANSITION, lt as PanelResizeHandle, on as EyeOff, s as SlideSidebar, sn as Expand, st as Panel, t as useNotebookCodeAvailable, un as Code } from "./code-visibility-DQX0uy8x.js";
|
|
13
13
|
import { X as useDebouncedCallback } from "./input-BSdZp5Ng.js";
|
|
14
14
|
import "./toDate-D1Z7ZXWh.js";
|
|
15
15
|
import "./react-dom-BTJzcVJ9.js";
|
package/package.json
CHANGED
|
@@ -17,18 +17,32 @@ export const ImageOutput = ({
|
|
|
17
17
|
height,
|
|
18
18
|
className,
|
|
19
19
|
}: Props): JSX.Element => {
|
|
20
|
-
//
|
|
20
|
+
// Numeric dimensions are set as HTML attributes rather than inline styles.
|
|
21
|
+
// Attributes give the browser the image's intrinsic size and aspect ratio,
|
|
22
|
+
// but can still be overridden by stylesheet rules (`max-width: 100%;
|
|
23
|
+
// height: auto` from preflight), so images shrink proportionally in
|
|
24
|
+
// width-constrained containers like mo.hstack. Inline styles would win
|
|
25
|
+
// over `height: auto` and distort the aspect ratio.
|
|
26
|
+
//
|
|
27
|
+
// String values like "100%" are only valid in CSS, so they go in the
|
|
28
|
+
// style attribute.
|
|
21
29
|
const style: React.CSSProperties = {};
|
|
22
|
-
if (width
|
|
23
|
-
style.width =
|
|
30
|
+
if (typeof width === "string") {
|
|
31
|
+
style.width = width;
|
|
24
32
|
}
|
|
25
|
-
if (height
|
|
26
|
-
style.height =
|
|
33
|
+
if (typeof height === "string") {
|
|
34
|
+
style.height = height;
|
|
27
35
|
}
|
|
28
36
|
|
|
29
37
|
return (
|
|
30
38
|
<span className={className}>
|
|
31
|
-
<img
|
|
39
|
+
<img
|
|
40
|
+
src={src}
|
|
41
|
+
alt={alt}
|
|
42
|
+
width={typeof width === "number" ? width : undefined}
|
|
43
|
+
height={typeof height === "number" ? height : undefined}
|
|
44
|
+
style={style}
|
|
45
|
+
/>
|
|
32
46
|
</span>
|
|
33
47
|
);
|
|
34
48
|
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import { render } from "@testing-library/react";
|
|
4
|
+
import { describe, expect, it } from "vitest";
|
|
5
|
+
import { ImageOutput } from "../ImageOutput";
|
|
6
|
+
|
|
7
|
+
const src = "data:image/png;base64,iVBORw0KGgo=";
|
|
8
|
+
|
|
9
|
+
describe("ImageOutput", () => {
|
|
10
|
+
it("renders numeric dimensions as HTML attributes", () => {
|
|
11
|
+
// Attributes (not inline styles) let stylesheet rules like
|
|
12
|
+
// `max-width: 100%; height: auto` shrink the image proportionally,
|
|
13
|
+
// preserving its aspect ratio in width-constrained containers.
|
|
14
|
+
const { container } = render(
|
|
15
|
+
<ImageOutput src={src} width={640} height={480} />,
|
|
16
|
+
);
|
|
17
|
+
const img = container.querySelector("img");
|
|
18
|
+
expect(img).toHaveAttribute("width", "640");
|
|
19
|
+
expect(img).toHaveAttribute("height", "480");
|
|
20
|
+
expect(img?.style.width).toBe("");
|
|
21
|
+
expect(img?.style.height).toBe("");
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
it("renders string dimensions as inline styles", () => {
|
|
25
|
+
const { container } = render(
|
|
26
|
+
<ImageOutput src={src} width="50%" height="100%" />,
|
|
27
|
+
);
|
|
28
|
+
const img = container.querySelector("img");
|
|
29
|
+
expect(img).not.toHaveAttribute("width");
|
|
30
|
+
expect(img).not.toHaveAttribute("height");
|
|
31
|
+
expect(img?.style.width).toBe("50%");
|
|
32
|
+
expect(img?.style.height).toBe("100%");
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("supports mixed numeric and string dimensions", () => {
|
|
36
|
+
const { container } = render(
|
|
37
|
+
<ImageOutput src={src} width={640} height="100%" />,
|
|
38
|
+
);
|
|
39
|
+
const img = container.querySelector("img");
|
|
40
|
+
expect(img).toHaveAttribute("width", "640");
|
|
41
|
+
expect(img).not.toHaveAttribute("height");
|
|
42
|
+
expect(img?.style.height).toBe("100%");
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it("renders without dimensions", () => {
|
|
46
|
+
const { container } = render(<ImageOutput src={src} />);
|
|
47
|
+
const img = container.querySelector("img");
|
|
48
|
+
expect(img).not.toBeNull();
|
|
49
|
+
expect(img).not.toHaveAttribute("width");
|
|
50
|
+
expect(img).not.toHaveAttribute("height");
|
|
51
|
+
expect(img).toHaveAttribute("src", src);
|
|
52
|
+
});
|
|
53
|
+
});
|