@marimo-team/islands 0.23.7-dev48 → 0.23.7-dev50
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-An0P9cL_.js → code-visibility-DjsEQuRb.js} +220 -215
- package/dist/main.js +126 -120
- package/dist/{reveal-component-B23qYh6r.js → reveal-component-pQBz0vEK.js} +1 -1
- package/package.json +1 -1
- package/src/components/data-table/charts/components/form-fields.tsx +1 -0
- package/src/components/ui/combobox.tsx +21 -3
- package/src/plugins/core/__test__/sanitize.test.ts +30 -0
- package/src/plugins/impl/DropdownPlugin.tsx +12 -1
- package/src/plugins/impl/MultiselectPlugin.tsx +4 -0
- package/src/plugins/impl/SearchableSelect.tsx +11 -1
- package/src/plugins/impl/__tests__/DropdownPlugin.test.tsx +56 -0
- package/src/plugins/impl/data-frames/forms/__tests__/__snapshots__/form.test.tsx.snap +24 -12
package/dist/main.js
CHANGED
|
@@ -26,7 +26,7 @@ import { $ as useCellActions, At as DeferredRequestRegistry, B as safeExtractSet
|
|
|
26
26
|
import { __tla as __tla_1 } from "./chunk-5FQGJX7Z-BOg95xG5.js";
|
|
27
27
|
import { o as useSize, s as Root$2, u as createLucideIcon } from "./dist-D3ZI9nhS.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-hVaaZsY5.js";
|
|
29
|
-
import { $ as filtersToFilterGroup, A as contextAwarePanelOwner, At as Funnel, B as TableCell, Bt as ChevronLeft, C as prettifyRowCount, Ct as useOverflowDetection, D as ContextAwarePanelItem, Dt as EmotionCacheProvider, E as ComboboxItem, Et as HtmlOutput, F as Toggle, Ft as Code, G as generateColumns, H as TableHeader, I as Fill, It as ChevronsUpDown, J as ColumnChartContext, K as inferFieldTypes, L as Provider$1, Lt as ChevronsRight, M as isCellAwareAtom, N as SlotNames, Nt as Ellipsis, O as PANEL_TYPES, Ot as TextWrap, P as slotsController, Pt as Download, Q as usePrevious$1, R as Table, Rt as ChevronsLeft, S as prettifyRowColumnCount, St as LazyVegaEmbed, T as Combobox, Tt as Kbd, U as TableRow, V as TableHead, Vt as ArrowDownWideNarrow, W as NAMELESS_COLUMN_PREFIX, X as DelayMount, Y as ColumnChartSpecModel, Z as useIntersectionObserver, _ as downloadBlob, _t as TabsList, at as TOO_MANY_ROWS, b as Progress, bt as ChartInfoState, c as Slide, ct as Command, d as JsonOutput, dt as CommandItem, et as getPageIndexForRow, f as OutputArea, ft as CommandList, g as ADD_PRINTING_CLASS, gt as TabsContent, h as InstallPackageButton, ht as Tabs, it as SELECT_COLUMN_ID, j as contextAwarePanelType, jt as EyeOff, k as contextAwarePanelOpen, kt as GripHorizontal, l as RadioGroup, lt as CommandEmpty, m as DataTable, mt as Maps, n as marimoVersionAtom, nt as loadTableData, o as SLIDE_TYPE_OPTIONS_BY_VALUE, ot as toFieldTypes, p as OutputRenderer, pt as CommandSeparator, q as renderCellValue, r as showCodeInRunModeAtom, rt as INDEX_COLUMN_NAME, st as getMimeValues, t as useNotebookCodeAvailable, tt as loadTableAndRawData, u as RadioGroupItem, ut as CommandInput, v as downloadByURL, vt as TabsTrigger, w as useInternalStateWithSync, wt as RenderTextWithLinks, x as Filenames, xt as ChartLoadingState, y as downloadHTMLAsImage, yt as ChartErrorState, z as TableBody, zt as ChevronsDownUp, __tla as __tla_2 } from "./code-visibility-
|
|
29
|
+
import { $ as filtersToFilterGroup, A as contextAwarePanelOwner, At as Funnel, B as TableCell, Bt as ChevronLeft, C as prettifyRowCount, Ct as useOverflowDetection, D as ContextAwarePanelItem, Dt as EmotionCacheProvider, E as ComboboxItem, Et as HtmlOutput, F as Toggle, Ft as Code, G as generateColumns, H as TableHeader, I as Fill, It as ChevronsUpDown, J as ColumnChartContext, K as inferFieldTypes, L as Provider$1, Lt as ChevronsRight, M as isCellAwareAtom, N as SlotNames, Nt as Ellipsis, O as PANEL_TYPES, Ot as TextWrap, P as slotsController, Pt as Download, Q as usePrevious$1, R as Table, Rt as ChevronsLeft, S as prettifyRowColumnCount, St as LazyVegaEmbed, T as Combobox, Tt as Kbd, U as TableRow, V as TableHead, Vt as ArrowDownWideNarrow, W as NAMELESS_COLUMN_PREFIX, X as DelayMount, Y as ColumnChartSpecModel, Z as useIntersectionObserver, _ as downloadBlob, _t as TabsList, at as TOO_MANY_ROWS, b as Progress, bt as ChartInfoState, c as Slide, ct as Command, d as JsonOutput, dt as CommandItem, et as getPageIndexForRow, f as OutputArea, ft as CommandList, g as ADD_PRINTING_CLASS, gt as TabsContent, h as InstallPackageButton, ht as Tabs, it as SELECT_COLUMN_ID, j as contextAwarePanelType, jt as EyeOff, k as contextAwarePanelOpen, kt as GripHorizontal, l as RadioGroup, lt as CommandEmpty, m as DataTable, mt as Maps, n as marimoVersionAtom, nt as loadTableData, o as SLIDE_TYPE_OPTIONS_BY_VALUE, ot as toFieldTypes, p as OutputRenderer, pt as CommandSeparator, q as renderCellValue, r as showCodeInRunModeAtom, rt as INDEX_COLUMN_NAME, st as getMimeValues, t as useNotebookCodeAvailable, tt as loadTableAndRawData, u as RadioGroupItem, ut as CommandInput, v as downloadByURL, vt as TabsTrigger, w as useInternalStateWithSync, wt as RenderTextWithLinks, x as Filenames, xt as ChartLoadingState, y as downloadHTMLAsImage, yt as ChartErrorState, z as TableBody, zt as ChevronsDownUp, __tla as __tla_2 } from "./code-visibility-DjsEQuRb.js";
|
|
30
30
|
import { c as Calendar, i as createReducerAndAtoms, n as useOnUnmount, o as ToggleLeft, t as useOnMount } from "./useLifecycle-BF6-z62y.js";
|
|
31
31
|
import { n as $fb18d541ea1ad717$export$ad991b66133851cf, r as $5a387cc49350e6db$export$722debc0e56fea39, t as $896ba0a80a8f4d36$export$85fd5fdf27bacc79 } from "./useDateFormatter-B_9k85Ex.js";
|
|
32
32
|
import { t as Check } from "./check-BcUIXnUT.js";
|
|
@@ -18651,7 +18651,8 @@ ${c}
|
|
|
18651
18651
|
label: string().nullable(),
|
|
18652
18652
|
options: array(string()),
|
|
18653
18653
|
fullWidth: boolean().default(false),
|
|
18654
|
-
maxSelections: number().optional()
|
|
18654
|
+
maxSelections: number().optional(),
|
|
18655
|
+
disabled: boolean().default(false)
|
|
18655
18656
|
}));
|
|
18656
18657
|
}
|
|
18657
18658
|
render(e) {
|
|
@@ -18663,21 +18664,21 @@ ${c}
|
|
|
18663
18664
|
}
|
|
18664
18665
|
}, SELECT_ALL_KEY = "__select_all__", DESELECT_ALL_KEY = "__deselect_all__";
|
|
18665
18666
|
const Multiselect = (e) => {
|
|
18666
|
-
let r = (0, import_compiler_runtime$81.c)(
|
|
18667
|
+
let r = (0, import_compiler_runtime$81.c)(46), { options: c, label: l, value: u, setValue: d, fullWidth: f, maxSelections: m, disabled: h } = e, g = (0, import_react.useId)(), [_, v] = (0, import_react.useState)(""), y;
|
|
18667
18668
|
bb0: {
|
|
18668
|
-
if (!
|
|
18669
|
-
|
|
18669
|
+
if (!_) {
|
|
18670
|
+
y = c;
|
|
18670
18671
|
break bb0;
|
|
18671
18672
|
}
|
|
18672
18673
|
let e2;
|
|
18673
|
-
if (r[0] !== c || r[1] !==
|
|
18674
|
+
if (r[0] !== c || r[1] !== _) {
|
|
18674
18675
|
let l2;
|
|
18675
|
-
r[3] ===
|
|
18676
|
+
r[3] === _ ? l2 = r[4] : (l2 = (e3) => multiselectFilterFn(e3, _) === 1, r[3] = _, r[4] = l2), e2 = c.filter(l2), r[0] = c, r[1] = _, r[2] = e2;
|
|
18676
18677
|
} else e2 = r[2];
|
|
18677
|
-
|
|
18678
|
+
y = e2;
|
|
18678
18679
|
}
|
|
18679
|
-
let
|
|
18680
|
-
r[5] !== m || r[6] !== d ? (
|
|
18680
|
+
let b = y, S;
|
|
18681
|
+
r[5] !== m || r[6] !== d ? (S = (e2) => {
|
|
18681
18682
|
if (!e2 || e2.length === 0) {
|
|
18682
18683
|
d([]);
|
|
18683
18684
|
return;
|
|
@@ -18689,96 +18690,97 @@ ${c}
|
|
|
18689
18690
|
return;
|
|
18690
18691
|
}
|
|
18691
18692
|
m != null && e2.length > m && (e2 = e2.slice(-m)), d(e2);
|
|
18692
|
-
}, r[5] = m, r[6] = d, r[7] =
|
|
18693
|
-
let
|
|
18694
|
-
r[8] !== c || r[9] !== d ? (
|
|
18693
|
+
}, r[5] = m, r[6] = d, r[7] = S) : S = r[7];
|
|
18694
|
+
let w = S, T;
|
|
18695
|
+
r[8] !== c || r[9] !== d ? (T = () => {
|
|
18695
18696
|
d(c);
|
|
18696
|
-
}, r[8] = c, r[9] = d, r[10] =
|
|
18697
|
-
let
|
|
18698
|
-
r[11] === d ?
|
|
18697
|
+
}, r[8] = c, r[9] = d, r[10] = T) : T = r[10];
|
|
18698
|
+
let E = T, O;
|
|
18699
|
+
r[11] === d ? O = r[12] : (O = () => {
|
|
18699
18700
|
d([]);
|
|
18700
|
-
}, r[11] = d, r[12] =
|
|
18701
|
-
let
|
|
18702
|
-
if (r[13] !==
|
|
18703
|
-
|
|
18701
|
+
}, r[11] = d, r[12] = O);
|
|
18702
|
+
let j = O, M;
|
|
18703
|
+
if (r[13] !== j || r[14] !== E || r[15] !== m || r[16] !== c.length || r[17] !== u) {
|
|
18704
|
+
M = [];
|
|
18704
18705
|
let e2 = c.length > 0 && u.length < c.length, l2 = c.length > 0 && u.length > 0;
|
|
18705
18706
|
if (c.length > 2 && m == null) {
|
|
18706
18707
|
let c2 = !e2, l3;
|
|
18707
|
-
r[19] !==
|
|
18708
|
+
r[19] !== E || r[20] !== c2 ? (l3 = (0, import_jsx_runtime.jsx)(ComboboxItem, {
|
|
18708
18709
|
value: SELECT_ALL_KEY,
|
|
18709
|
-
onSelect:
|
|
18710
|
+
onSelect: E,
|
|
18710
18711
|
disabled: c2,
|
|
18711
18712
|
children: "Select all"
|
|
18712
|
-
}, SELECT_ALL_KEY), r[19] =
|
|
18713
|
+
}, SELECT_ALL_KEY), r[19] = E, r[20] = c2, r[21] = l3) : l3 = r[21], M.push(l3);
|
|
18713
18714
|
}
|
|
18714
18715
|
if (c.length > 2) {
|
|
18715
18716
|
let e3 = !l2, c2 = m === 1 ? "Deselect" : "Deselect all", u2;
|
|
18716
|
-
r[22] !==
|
|
18717
|
+
r[22] !== j || r[23] !== e3 || r[24] !== c2 ? (u2 = (0, import_jsx_runtime.jsx)(ComboboxItem, {
|
|
18717
18718
|
value: DESELECT_ALL_KEY,
|
|
18718
|
-
onSelect:
|
|
18719
|
+
onSelect: j,
|
|
18719
18720
|
disabled: e3,
|
|
18720
18721
|
children: c2
|
|
18721
|
-
}, DESELECT_ALL_KEY), r[22] =
|
|
18722
|
+
}, DESELECT_ALL_KEY), r[22] = j, r[23] = e3, r[24] = c2, r[25] = u2) : u2 = r[25];
|
|
18722
18723
|
let d2;
|
|
18723
|
-
r[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d2 = (0, import_jsx_runtime.jsx)(CommandSeparator, {}, "_separator"), r[26] = d2) : d2 = r[26],
|
|
18724
|
+
r[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d2 = (0, import_jsx_runtime.jsx)(CommandSeparator, {}, "_separator"), r[26] = d2) : d2 = r[26], M.push(u2, d2);
|
|
18724
18725
|
}
|
|
18725
|
-
r[13] =
|
|
18726
|
-
} else
|
|
18727
|
-
let
|
|
18728
|
-
r[27] !==
|
|
18729
|
-
if (
|
|
18726
|
+
r[13] = j, r[14] = E, r[15] = m, r[16] = c.length, r[17] = u, r[18] = M;
|
|
18727
|
+
} else M = r[18];
|
|
18728
|
+
let I;
|
|
18729
|
+
r[27] !== M || r[28] !== b ? (I = () => {
|
|
18730
|
+
if (b.length > 200) return (0, import_jsx_runtime.jsx)(Yr, {
|
|
18730
18731
|
style: {
|
|
18731
18732
|
height: "200px"
|
|
18732
18733
|
},
|
|
18733
|
-
totalCount:
|
|
18734
|
+
totalCount: b.length,
|
|
18734
18735
|
overscan: 50,
|
|
18735
18736
|
itemContent: (e3) => {
|
|
18736
18737
|
let r2 = (0, import_jsx_runtime.jsx)(ComboboxItem, {
|
|
18737
|
-
value:
|
|
18738
|
-
children:
|
|
18739
|
-
},
|
|
18738
|
+
value: b[e3],
|
|
18739
|
+
children: b[e3]
|
|
18740
|
+
}, b[e3]);
|
|
18740
18741
|
return e3 === 0 ? (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
18741
18742
|
children: [
|
|
18742
|
-
|
|
18743
|
+
M,
|
|
18743
18744
|
r2
|
|
18744
18745
|
]
|
|
18745
18746
|
}) : r2;
|
|
18746
18747
|
}
|
|
18747
18748
|
});
|
|
18748
|
-
let e2 =
|
|
18749
|
+
let e2 = b.map(_temp2$19);
|
|
18749
18750
|
return (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
18750
18751
|
children: [
|
|
18751
|
-
|
|
18752
|
+
M,
|
|
18752
18753
|
e2
|
|
18753
18754
|
]
|
|
18754
18755
|
});
|
|
18755
|
-
}, r[27] =
|
|
18756
|
-
let
|
|
18757
|
-
r[30] === f ?
|
|
18756
|
+
}, r[27] = M, r[28] = b, r[29] = I) : I = r[29];
|
|
18757
|
+
let L = I, R;
|
|
18758
|
+
r[30] === f ? R = r[31] : (R = cn({
|
|
18758
18759
|
"w-full": f
|
|
18759
|
-
}), r[30] = f, r[31] =
|
|
18760
|
-
let R;
|
|
18761
|
-
r[32] === I ? R = r[33] : (R = I(), r[32] = I, r[33] = R);
|
|
18760
|
+
}), r[30] = f, r[31] = R);
|
|
18762
18761
|
let z;
|
|
18763
|
-
r[
|
|
18762
|
+
r[32] === L ? z = r[33] : (z = L(), r[32] = L, r[33] = z);
|
|
18763
|
+
let B;
|
|
18764
|
+
r[34] !== h || r[35] !== w || r[36] !== _ || r[37] !== R || r[38] !== z || r[39] !== u ? (B = (0, import_jsx_runtime.jsx)(Combobox, {
|
|
18764
18765
|
displayValue: _temp3$14,
|
|
18765
18766
|
placeholder: "Select...",
|
|
18766
18767
|
multiple: true,
|
|
18767
|
-
className:
|
|
18768
|
+
className: R,
|
|
18768
18769
|
value: u,
|
|
18769
|
-
onValueChange:
|
|
18770
|
+
onValueChange: w,
|
|
18770
18771
|
shouldFilter: false,
|
|
18771
|
-
search:
|
|
18772
|
-
onSearchChange:
|
|
18773
|
-
|
|
18774
|
-
|
|
18775
|
-
|
|
18776
|
-
|
|
18772
|
+
search: _,
|
|
18773
|
+
onSearchChange: v,
|
|
18774
|
+
disabled: h,
|
|
18775
|
+
children: z
|
|
18776
|
+
}), r[34] = h, r[35] = w, r[36] = _, r[37] = R, r[38] = z, r[39] = u, r[40] = B) : B = r[40];
|
|
18777
|
+
let H;
|
|
18778
|
+
return r[41] !== f || r[42] !== g || r[43] !== l || r[44] !== B ? (H = (0, import_jsx_runtime.jsx)(Labeled, {
|
|
18777
18779
|
label: l,
|
|
18778
|
-
id:
|
|
18780
|
+
id: g,
|
|
18779
18781
|
fullWidth: f,
|
|
18780
|
-
children:
|
|
18781
|
-
}), r[
|
|
18782
|
+
children: B
|
|
18783
|
+
}), r[41] = f, r[42] = g, r[43] = l, r[44] = B, r[45] = H) : H = r[45], H;
|
|
18782
18784
|
};
|
|
18783
18785
|
function _temp$26(e) {
|
|
18784
18786
|
return e !== SELECT_ALL_KEY && e !== DESELECT_ALL_KEY;
|
|
@@ -19570,6 +19572,7 @@ ${c}
|
|
|
19570
19572
|
children: (0, import_jsx_runtime.jsx)(FormControl, {
|
|
19571
19573
|
children: (0, import_jsx_runtime.jsx)(Multiselect, {
|
|
19572
19574
|
options: (d == null ? void 0 : d.map(_temp0)) ?? [],
|
|
19575
|
+
disabled: false,
|
|
19573
19576
|
value: c2,
|
|
19574
19577
|
setValue: (e3) => {
|
|
19575
19578
|
let c3 = (typeof e3 == "function" ? e3([]) : e3).map((e4) => f(e4, d));
|
|
@@ -23516,37 +23519,37 @@ ${c}
|
|
|
23516
23519
|
], r[0] = c, r[1] = l, r[2] = d, r[3] = f) : (d = r[2], f = r[3]), (0, import_react.useEffect)(d, f), u;
|
|
23517
23520
|
}, import_compiler_runtime$53 = require_compiler_runtime(), NONE_KEY = "__none__";
|
|
23518
23521
|
const SearchableSelect = (e) => {
|
|
23519
|
-
let r = (0, import_compiler_runtime$53.c)(
|
|
23522
|
+
let r = (0, import_compiler_runtime$53.c)(26), { options: c, value: l, setValue: u, label: d, allowSelectNone: f, fullWidth: m, disabled: h } = e, g = (0, import_react.useId)(), [_, v] = (0, import_react.useState)(""), y;
|
|
23520
23523
|
bb0: {
|
|
23521
|
-
if (!
|
|
23522
|
-
|
|
23524
|
+
if (!_) {
|
|
23525
|
+
y = c;
|
|
23523
23526
|
break bb0;
|
|
23524
23527
|
}
|
|
23525
23528
|
let e2;
|
|
23526
|
-
if (r[0] !== c || r[1] !==
|
|
23529
|
+
if (r[0] !== c || r[1] !== _) {
|
|
23527
23530
|
let l2;
|
|
23528
|
-
r[3] ===
|
|
23531
|
+
r[3] === _ ? l2 = r[4] : (l2 = (e3) => multiselectFilterFn(e3, _) === 1, r[3] = _, r[4] = l2), e2 = c.filter(l2), r[0] = c, r[1] = _, r[2] = e2;
|
|
23529
23532
|
} else e2 = r[2];
|
|
23530
|
-
|
|
23533
|
+
y = e2;
|
|
23531
23534
|
}
|
|
23532
|
-
let
|
|
23533
|
-
r[5] === u ?
|
|
23535
|
+
let b = y, S;
|
|
23536
|
+
r[5] === u ? S = r[6] : (S = (e2) => {
|
|
23534
23537
|
e2 != null && u(e2 === NONE_KEY ? null : e2);
|
|
23535
|
-
}, r[5] = u, r[6] =
|
|
23536
|
-
let
|
|
23537
|
-
r[7] !== f || r[8] !==
|
|
23538
|
+
}, r[5] = u, r[6] = S);
|
|
23539
|
+
let w = S, T;
|
|
23540
|
+
r[7] !== f || r[8] !== b ? (T = () => {
|
|
23538
23541
|
let e2 = f ? (0, import_jsx_runtime.jsx)(ComboboxItem, {
|
|
23539
23542
|
value: NONE_KEY,
|
|
23540
23543
|
children: "--"
|
|
23541
23544
|
}, NONE_KEY) : null;
|
|
23542
|
-
return
|
|
23545
|
+
return b.length > 200 ? (0, import_jsx_runtime.jsx)(Yr, {
|
|
23543
23546
|
style: {
|
|
23544
23547
|
height: "200px"
|
|
23545
23548
|
},
|
|
23546
|
-
totalCount:
|
|
23549
|
+
totalCount: b.length,
|
|
23547
23550
|
overscan: 50,
|
|
23548
23551
|
itemContent: (r2) => {
|
|
23549
|
-
let c2 =
|
|
23552
|
+
let c2 = b[r2], l2 = (0, import_jsx_runtime.jsx)(ComboboxItem, {
|
|
23550
23553
|
value: c2,
|
|
23551
23554
|
children: c2
|
|
23552
23555
|
}, c2);
|
|
@@ -23560,37 +23563,38 @@ ${c}
|
|
|
23560
23563
|
}) : (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
23561
23564
|
children: [
|
|
23562
23565
|
e2,
|
|
23563
|
-
|
|
23566
|
+
b.map(_temp$16)
|
|
23564
23567
|
]
|
|
23565
23568
|
});
|
|
23566
|
-
}, r[7] = f, r[8] =
|
|
23567
|
-
let
|
|
23568
|
-
r[10] === m ?
|
|
23569
|
+
}, r[7] = f, r[8] = b, r[9] = T) : T = r[9];
|
|
23570
|
+
let E = T, O;
|
|
23571
|
+
r[10] === m ? O = r[11] : (O = cn({
|
|
23569
23572
|
"w-full": m
|
|
23570
|
-
}), r[10] = m, r[11] =
|
|
23571
|
-
let
|
|
23572
|
-
r[12] ===
|
|
23573
|
-
let
|
|
23574
|
-
r[14] !==
|
|
23573
|
+
}), r[10] = m, r[11] = O);
|
|
23574
|
+
let j = l ?? NONE_KEY, M;
|
|
23575
|
+
r[12] === E ? M = r[13] : (M = E(), r[12] = E, r[13] = M);
|
|
23576
|
+
let I;
|
|
23577
|
+
r[14] !== h || r[15] !== w || r[16] !== _ || r[17] !== O || r[18] !== j || r[19] !== M ? (I = (0, import_jsx_runtime.jsx)(Combobox, {
|
|
23575
23578
|
displayValue: _temp2$10,
|
|
23576
23579
|
placeholder: "Select...",
|
|
23577
23580
|
multiple: false,
|
|
23578
|
-
className:
|
|
23579
|
-
value:
|
|
23580
|
-
onValueChange:
|
|
23581
|
+
className: O,
|
|
23582
|
+
value: j,
|
|
23583
|
+
onValueChange: w,
|
|
23581
23584
|
shouldFilter: false,
|
|
23582
|
-
search:
|
|
23583
|
-
onSearchChange:
|
|
23585
|
+
search: _,
|
|
23586
|
+
onSearchChange: v,
|
|
23587
|
+
disabled: h,
|
|
23584
23588
|
"data-testid": "marimo-plugin-searchable-dropdown",
|
|
23585
|
-
children:
|
|
23586
|
-
}), r[14] =
|
|
23587
|
-
let
|
|
23588
|
-
return r[
|
|
23589
|
+
children: M
|
|
23590
|
+
}), r[14] = h, r[15] = w, r[16] = _, r[17] = O, r[18] = j, r[19] = M, r[20] = I) : I = r[20];
|
|
23591
|
+
let L;
|
|
23592
|
+
return r[21] !== m || r[22] !== g || r[23] !== d || r[24] !== I ? (L = (0, import_jsx_runtime.jsx)(Labeled, {
|
|
23589
23593
|
label: d,
|
|
23590
|
-
id:
|
|
23594
|
+
id: g,
|
|
23591
23595
|
fullWidth: m,
|
|
23592
|
-
children:
|
|
23593
|
-
}), r[
|
|
23596
|
+
children: I
|
|
23597
|
+
}), r[21] = m, r[22] = g, r[23] = d, r[24] = I, r[25] = L) : L = r[25], L;
|
|
23594
23598
|
};
|
|
23595
23599
|
function _temp$16(e) {
|
|
23596
23600
|
return (0, import_jsx_runtime.jsx)(ComboboxItem, {
|
|
@@ -23610,7 +23614,8 @@ ${c}
|
|
|
23610
23614
|
options: array(string()),
|
|
23611
23615
|
allowSelectNone: boolean(),
|
|
23612
23616
|
fullWidth: boolean().default(false),
|
|
23613
|
-
searchable: boolean().default(false)
|
|
23617
|
+
searchable: boolean().default(false),
|
|
23618
|
+
disabled: boolean().default(false)
|
|
23614
23619
|
}));
|
|
23615
23620
|
}
|
|
23616
23621
|
render(e) {
|
|
@@ -23631,51 +23636,52 @@ ${c}
|
|
|
23631
23636
|
});
|
|
23632
23637
|
}
|
|
23633
23638
|
}, EMPTY_VALUE = "--", Dropdown = (e) => {
|
|
23634
|
-
let r = (0, import_compiler_runtime$52.c)(
|
|
23635
|
-
r[0] === d ?
|
|
23639
|
+
let r = (0, import_compiler_runtime$52.c)(25), { label: c, options: l, value: u, setValue: d, allowSelectNone: f, fullWidth: m, disabled: h } = e, g = (0, import_react.useId)(), _ = f ? EMPTY_VALUE : l[0], v = u.length === 0 ? _ : u[0], y;
|
|
23640
|
+
r[0] === d ? y = r[1] : (y = (e2) => {
|
|
23636
23641
|
let r2 = e2.target.value;
|
|
23637
23642
|
d(r2 === EMPTY_VALUE ? [] : [
|
|
23638
23643
|
r2
|
|
23639
23644
|
]);
|
|
23640
|
-
}, r[0] = d, r[1] =
|
|
23641
|
-
let y;
|
|
23642
|
-
r[2] === m ? y = r[3] : (y = cn({
|
|
23643
|
-
"w-full": m
|
|
23644
|
-
}), r[2] = m, r[3] = y);
|
|
23645
|
+
}, r[0] = d, r[1] = y);
|
|
23645
23646
|
let b;
|
|
23646
|
-
r[
|
|
23647
|
+
r[2] === m ? b = r[3] : (b = cn({
|
|
23648
|
+
"w-full": m
|
|
23649
|
+
}), r[2] = m, r[3] = b);
|
|
23650
|
+
let S;
|
|
23651
|
+
r[4] !== f || r[5] !== u.length ? (S = f ? (0, import_jsx_runtime.jsx)("option", {
|
|
23647
23652
|
value: EMPTY_VALUE,
|
|
23648
23653
|
selected: u.length === 0,
|
|
23649
23654
|
children: "--"
|
|
23650
|
-
}) : null, r[4] = f, r[5] = u.length, r[6] =
|
|
23651
|
-
let
|
|
23655
|
+
}) : null, r[4] = f, r[5] = u.length, r[6] = S) : S = r[6];
|
|
23656
|
+
let w;
|
|
23652
23657
|
if (r[7] !== l || r[8] !== u) {
|
|
23653
23658
|
let e2;
|
|
23654
23659
|
r[10] === u ? e2 = r[11] : (e2 = (e3) => (0, import_jsx_runtime.jsx)("option", {
|
|
23655
23660
|
value: e3,
|
|
23656
23661
|
selected: u.includes(e3),
|
|
23657
23662
|
children: e3
|
|
23658
|
-
}, e3), r[10] = u, r[11] = e2),
|
|
23659
|
-
} else
|
|
23660
|
-
let
|
|
23661
|
-
r[12] !== h || r[13] !==
|
|
23663
|
+
}, e3), r[10] = u, r[11] = e2), w = l.map(e2), r[7] = l, r[8] = u, r[9] = w;
|
|
23664
|
+
} else w = r[9];
|
|
23665
|
+
let T;
|
|
23666
|
+
r[12] !== h || r[13] !== g || r[14] !== v || r[15] !== y || r[16] !== b || r[17] !== S || r[18] !== w ? (T = (0, import_jsx_runtime.jsxs)(NativeSelect, {
|
|
23662
23667
|
"data-testid": "marimo-plugin-dropdown",
|
|
23663
|
-
onChange:
|
|
23664
|
-
className:
|
|
23665
|
-
value:
|
|
23666
|
-
id:
|
|
23668
|
+
onChange: y,
|
|
23669
|
+
className: b,
|
|
23670
|
+
value: v,
|
|
23671
|
+
id: g,
|
|
23672
|
+
disabled: h,
|
|
23667
23673
|
children: [
|
|
23668
|
-
|
|
23669
|
-
|
|
23674
|
+
S,
|
|
23675
|
+
w
|
|
23670
23676
|
]
|
|
23671
|
-
}), r[12] = h, r[13] =
|
|
23672
|
-
let
|
|
23673
|
-
return r[
|
|
23677
|
+
}), r[12] = h, r[13] = g, r[14] = v, r[15] = y, r[16] = b, r[17] = S, r[18] = w, r[19] = T) : T = r[19];
|
|
23678
|
+
let E;
|
|
23679
|
+
return r[20] !== m || r[21] !== g || r[22] !== c || r[23] !== T ? (E = (0, import_jsx_runtime.jsx)(Labeled, {
|
|
23674
23680
|
label: c,
|
|
23675
|
-
id:
|
|
23681
|
+
id: g,
|
|
23676
23682
|
fullWidth: m,
|
|
23677
|
-
children:
|
|
23678
|
-
}), r[
|
|
23683
|
+
children: T
|
|
23684
|
+
}), r[20] = m, r[21] = g, r[22] = c, r[23] = T, r[24] = E) : E = r[24], E;
|
|
23679
23685
|
}, LazyDataExplorerComponent = import_react.lazy(() => import("./ConnectedDataExplorerComponent-2lBNiUv6.js"));
|
|
23680
23686
|
const DataExplorerPlugin = createPlugin("marimo-data-explorer").withData(object({
|
|
23681
23687
|
label: string().nullish(),
|
|
@@ -44600,7 +44606,7 @@ ${c}
|
|
|
44600
44606
|
if (l && l !== "slide") return l;
|
|
44601
44607
|
if (c == null ? void 0 : c.has(e)) return "skip";
|
|
44602
44608
|
}
|
|
44603
|
-
var LazySlidesComponent = import_react.lazy(() => import("./reveal-component-
|
|
44609
|
+
var LazySlidesComponent = import_react.lazy(() => import("./reveal-component-pQBz0vEK.js"));
|
|
44604
44610
|
const SlidesLayoutPlugin = {
|
|
44605
44611
|
type: "slides",
|
|
44606
44612
|
name: "Slides",
|
|
@@ -8,7 +8,7 @@ import { t as require_react } from "./react-DA-nE2FX.js";
|
|
|
8
8
|
import { t as require_compiler_runtime } from "./compiler-runtime-CEbnTgxf.js";
|
|
9
9
|
import "./html-to-image-DaPPaVDP.js";
|
|
10
10
|
import "./chunk-5FQGJX7Z-BOg95xG5.js";
|
|
11
|
-
import { Ft as Code, Mt as Expand, a as DEFAULT_SLIDE_TYPE, c as Slide, i as DEFAULT_DECK_TRANSITION, jt as EyeOff, s as SlideSidebar, t as useNotebookCodeAvailable } from "./code-visibility-
|
|
11
|
+
import { Ft as Code, Mt as Expand, a as DEFAULT_SLIDE_TYPE, c as Slide, i as DEFAULT_DECK_TRANSITION, jt as EyeOff, s as SlideSidebar, t as useNotebookCodeAvailable } from "./code-visibility-DjsEQuRb.js";
|
|
12
12
|
import "./input-D4kjoQUB.js";
|
|
13
13
|
import "./toDate-CJWlVNGD.js";
|
|
14
14
|
import "./react-dom-BWRJ_g_k.js";
|
package/package.json
CHANGED
|
@@ -39,6 +39,7 @@ interface ComboboxCommonProps<TValue> {
|
|
|
39
39
|
className?: string;
|
|
40
40
|
id?: string;
|
|
41
41
|
keepPopoverOpenOnSelect?: boolean;
|
|
42
|
+
disabled?: boolean;
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
type ComboboxFilterProps =
|
|
@@ -95,6 +96,7 @@ export const Combobox = <TValue,>({
|
|
|
95
96
|
chipsClassName,
|
|
96
97
|
keepPopoverOpenOnSelect,
|
|
97
98
|
id,
|
|
99
|
+
disabled = false,
|
|
98
100
|
...rest
|
|
99
101
|
}: ComboboxProps<TValue>) => {
|
|
100
102
|
const [open = false, setOpen] = useControllableState({
|
|
@@ -168,16 +170,26 @@ export const Combobox = <TValue,>({
|
|
|
168
170
|
|
|
169
171
|
return (
|
|
170
172
|
<div className={cn("relative")} {...rest}>
|
|
171
|
-
<Popover
|
|
173
|
+
<Popover
|
|
174
|
+
open={open}
|
|
175
|
+
onOpenChange={(v) => {
|
|
176
|
+
if (disabled && v) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
setOpen(v);
|
|
180
|
+
}}
|
|
181
|
+
>
|
|
172
182
|
<PopoverTrigger asChild={true}>
|
|
173
183
|
<button
|
|
174
184
|
id={id}
|
|
175
185
|
type="button"
|
|
176
186
|
className={cn(
|
|
177
|
-
"flex h-6 w-fit mb-1 shadow-xs-solid items-center justify-between rounded-sm border border-input bg-transparent px-2 text-sm font-prose ring-offset-background placeholder:text-muted-foreground hover:shadow-sm-solid focus:outline-hidden focus:ring-1 focus:ring-ring focus:border-primary focus:shadow-md-solid
|
|
187
|
+
"flex h-6 w-fit mb-1 shadow-xs-solid items-center justify-between rounded-sm border border-input bg-transparent px-2 text-sm font-prose ring-offset-background placeholder:text-muted-foreground hover:shadow-sm-solid focus:outline-hidden focus:ring-1 focus:ring-ring focus:border-primary focus:shadow-md-solid",
|
|
188
|
+
disabled && "cursor-not-allowed opacity-50",
|
|
178
189
|
className,
|
|
179
190
|
)}
|
|
180
191
|
aria-expanded={open}
|
|
192
|
+
aria-disabled={disabled}
|
|
181
193
|
>
|
|
182
194
|
<span className="truncate flex-1 min-w-0">{renderValue()}</span>
|
|
183
195
|
<ChevronDownIcon className="ml-3 w-4 h-4 opacity-50 shrink-0" />
|
|
@@ -216,9 +228,15 @@ export const Combobox = <TValue,>({
|
|
|
216
228
|
{displayValue?.(val) ?? String(val)}
|
|
217
229
|
<XCircle
|
|
218
230
|
onClick={() => {
|
|
231
|
+
if (disabled) {
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
219
234
|
handleSelect(val);
|
|
220
235
|
}}
|
|
221
|
-
className=
|
|
236
|
+
className={cn(
|
|
237
|
+
"w-3 h-3 opacity-50 hover:opacity-100 ml-1 cursor-pointer",
|
|
238
|
+
disabled && "pointer-events-none",
|
|
239
|
+
)}
|
|
222
240
|
/>
|
|
223
241
|
</Badge>
|
|
224
242
|
);
|
|
@@ -557,4 +557,34 @@ describe("sanitizeHtml", () => {
|
|
|
557
557
|
const html = "<some-custom-element>Content</some-custom-element>";
|
|
558
558
|
expect(sanitizeHtml(html)).toMatchInlineSnapshot(`"Content"`);
|
|
559
559
|
});
|
|
560
|
+
|
|
561
|
+
// DOMPurify SAFE_FOR_XML strips attribute values containing `]>`, `-->`,
|
|
562
|
+
// `--!>`, or `</(style|script|...)`. `_build_attr` JSON-escapes `<`/`>`
|
|
563
|
+
// (`<`/`>`) before HTML-escaping so the parsed attribute value
|
|
564
|
+
// never matches. These tests pin that contract.
|
|
565
|
+
test("preserves data-* attribute with JSON-escaped ]> payload", () => {
|
|
566
|
+
const html =
|
|
567
|
+
"<marimo-table data-data='[{"x":"]\u003e"}]'></marimo-table>";
|
|
568
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
569
|
+
`"<marimo-table data-data="[{"x":"]\\u003e"}]"></marimo-table>"`,
|
|
570
|
+
);
|
|
571
|
+
});
|
|
572
|
+
|
|
573
|
+
test("preserves data-* attribute with JSON-escaped </script> payload", () => {
|
|
574
|
+
const html =
|
|
575
|
+
"<marimo-table data-data='[{"x":"\u003c/script\u003e"}]'></marimo-table>";
|
|
576
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
577
|
+
`"<marimo-table data-data="[{"x":"\\u003c/script\\u003e"}]"></marimo-table>"`,
|
|
578
|
+
);
|
|
579
|
+
});
|
|
580
|
+
|
|
581
|
+
// Regression sentinel: confirms DOMPurify still strips an UN-escaped `]>`,
|
|
582
|
+
// which is precisely the condition `_build_attr` exists to prevent.
|
|
583
|
+
test("strips data-* attribute when raw ]> leaks through", () => {
|
|
584
|
+
const html =
|
|
585
|
+
"<marimo-table data-data='[{"x":"]>"}]'></marimo-table>";
|
|
586
|
+
expect(sanitizeHtml(html)).toMatchInlineSnapshot(
|
|
587
|
+
`"<marimo-table></marimo-table>"`,
|
|
588
|
+
);
|
|
589
|
+
});
|
|
560
590
|
});
|
|
@@ -13,6 +13,7 @@ interface Data {
|
|
|
13
13
|
allowSelectNone: boolean;
|
|
14
14
|
fullWidth: boolean;
|
|
15
15
|
searchable: boolean;
|
|
16
|
+
disabled: boolean;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
export class DropdownPlugin implements IPlugin<string[], Data> {
|
|
@@ -25,6 +26,7 @@ export class DropdownPlugin implements IPlugin<string[], Data> {
|
|
|
25
26
|
allowSelectNone: z.boolean(),
|
|
26
27
|
fullWidth: z.boolean().default(false),
|
|
27
28
|
searchable: z.boolean().default(false),
|
|
29
|
+
disabled: z.boolean().default(false),
|
|
28
30
|
});
|
|
29
31
|
|
|
30
32
|
render(props: IPluginProps<string[], Data>): JSX.Element {
|
|
@@ -61,7 +63,15 @@ interface DropdownProps extends Data {
|
|
|
61
63
|
const EMPTY_VALUE = "--";
|
|
62
64
|
|
|
63
65
|
const Dropdown = (props: DropdownProps): JSX.Element => {
|
|
64
|
-
const {
|
|
66
|
+
const {
|
|
67
|
+
label,
|
|
68
|
+
options,
|
|
69
|
+
value,
|
|
70
|
+
setValue,
|
|
71
|
+
allowSelectNone,
|
|
72
|
+
fullWidth,
|
|
73
|
+
disabled,
|
|
74
|
+
} = props;
|
|
65
75
|
|
|
66
76
|
const id = useId();
|
|
67
77
|
|
|
@@ -85,6 +95,7 @@ const Dropdown = (props: DropdownProps): JSX.Element => {
|
|
|
85
95
|
})}
|
|
86
96
|
value={singleValue}
|
|
87
97
|
id={id}
|
|
98
|
+
disabled={disabled}
|
|
88
99
|
>
|
|
89
100
|
{allowSelectNone ? (
|
|
90
101
|
<option value={EMPTY_VALUE} selected={value.length === 0}>
|
|
@@ -14,6 +14,7 @@ interface Data {
|
|
|
14
14
|
options: string[];
|
|
15
15
|
fullWidth: boolean;
|
|
16
16
|
maxSelections?: number | undefined;
|
|
17
|
+
disabled: boolean;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
type T = string[];
|
|
@@ -27,6 +28,7 @@ export class MultiselectPlugin implements IPlugin<T, Data> {
|
|
|
27
28
|
options: z.array(z.string()),
|
|
28
29
|
fullWidth: z.boolean().default(false),
|
|
29
30
|
maxSelections: z.number().optional(),
|
|
31
|
+
disabled: z.boolean().default(false),
|
|
30
32
|
});
|
|
31
33
|
|
|
32
34
|
render(props: IPluginProps<string[], Data>): JSX.Element {
|
|
@@ -63,6 +65,7 @@ export const Multiselect = ({
|
|
|
63
65
|
setValue,
|
|
64
66
|
fullWidth,
|
|
65
67
|
maxSelections,
|
|
68
|
+
disabled,
|
|
66
69
|
}: MultiselectProps): JSX.Element => {
|
|
67
70
|
const id = useId();
|
|
68
71
|
const [searchQuery, setSearchQuery] = useState<string>("");
|
|
@@ -199,6 +202,7 @@ export const Multiselect = ({
|
|
|
199
202
|
shouldFilter={false}
|
|
200
203
|
search={searchQuery}
|
|
201
204
|
onSearchChange={setSearchQuery}
|
|
205
|
+
disabled={disabled}
|
|
202
206
|
>
|
|
203
207
|
{renderList()}
|
|
204
208
|
</Combobox>
|
|
@@ -13,12 +13,21 @@ interface SearchableSelectProps {
|
|
|
13
13
|
label: string | null;
|
|
14
14
|
allowSelectNone: boolean;
|
|
15
15
|
fullWidth: boolean;
|
|
16
|
+
disabled: boolean;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
const NONE_KEY = "__none__";
|
|
19
20
|
|
|
20
21
|
export const SearchableSelect = (props: SearchableSelectProps): JSX.Element => {
|
|
21
|
-
const {
|
|
22
|
+
const {
|
|
23
|
+
options,
|
|
24
|
+
value,
|
|
25
|
+
setValue,
|
|
26
|
+
label,
|
|
27
|
+
allowSelectNone,
|
|
28
|
+
fullWidth,
|
|
29
|
+
disabled,
|
|
30
|
+
} = props;
|
|
22
31
|
const id = useId();
|
|
23
32
|
const [searchQuery, setSearchQuery] = useState<string>("");
|
|
24
33
|
|
|
@@ -113,6 +122,7 @@ export const SearchableSelect = (props: SearchableSelectProps): JSX.Element => {
|
|
|
113
122
|
shouldFilter={false}
|
|
114
123
|
search={searchQuery}
|
|
115
124
|
onSearchChange={setSearchQuery}
|
|
125
|
+
disabled={disabled}
|
|
116
126
|
data-testid="marimo-plugin-searchable-dropdown"
|
|
117
127
|
>
|
|
118
128
|
{renderList()}
|