@marimo-team/islands 0.26.1-dev104 → 0.26.1-dev108
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-BJBdnd0O.js → ConnectedDataExplorerComponent-DQaiOY7w.js} +15 -15
- package/dist/{ErrorBoundary-DLR6xE2E.js → ErrorBoundary-BW4TciqU.js} +19 -19
- package/dist/{abnfDiagram-VCTEODGH-Ba0MYVW8.js → abnfDiagram-VCTEODGH-Df80tEYq.js} +2 -2
- package/dist/{any-language-editor-BNe8do3C.js → any-language-editor-BW-gNmbk.js} +2 -2
- package/dist/{architectureDiagram-5GKGNRK7-7MqAehef.js → architectureDiagram-5GKGNRK7-DNNMvKkY.js} +1 -1
- package/dist/{assertNever-5vhHGKOK.js → assertNever-B9_7z-dW.js} +13 -13
- package/dist/{chat-ui-Bs3rgm2m.js → chat-ui-Be9X-W22.js} +49 -49
- package/dist/{check-DUIc04aK.js → check-BqF09bSG.js} +1 -1
- package/dist/{chunk-IMKFNOWR-CAWA0HGB.js → chunk-IMKFNOWR-pXqnQ_fj.js} +1 -1
- package/dist/{chunk-SHT3W25Y-BIwVQjG5.js → chunk-SHT3W25Y-BWrxB3I2.js} +1 -1
- package/dist/{chunk-SVP7TREG-Cux251TB.js → chunk-SVP7TREG-CPdQP8_U.js} +1 -1
- package/dist/{chunk-TICWLB2K-DJVQ6khO.js → chunk-TICWLB2K-C5MYCwBz.js} +1 -1
- package/dist/{circle-question-mark-evCnVIut.js → circle-question-mark-YmLYXyvS.js} +1 -1
- package/dist/{classDiagram-ZZMXUADV-Cwve77ev.js → classDiagram-ZZMXUADV-Ba0SRm01.js} +2 -2
- package/dist/{classDiagram-v2-VYDZK3BY-BAeHKXmD.js → classDiagram-v2-VYDZK3BY-DSSzL_Dk.js} +2 -2
- package/dist/{code-visibility-BhWW3jkv.js → code-visibility-BKmktPMd.js} +18 -18
- package/dist/{common-i4mVHMGl.js → common-CSJAjJGa.js} +169 -169
- package/dist/{copy-icon-CmNLxT5_.js → copy-icon-zP4__HPI.js} +2 -2
- package/dist/{createReducer-BUQhgLOI.js → createReducer-CArOwUaJ.js} +16 -19
- package/dist/{cynefinDiagram-5FMLGOSQ-t4eEkPJh.js → cynefinDiagram-5FMLGOSQ-BOtNvA04.js} +1 -1
- package/dist/{dagre-GXQ25YYZ-IuZuI28B.js → dagre-GXQ25YYZ-FpCEOTxX.js} +1 -1
- package/dist/{data-grid-overlay-editor-7durYJXa.js → data-grid-overlay-editor-DTibdR4H.js} +1 -1
- package/dist/{diagram-S7CK7UJ4-D8R5Q_ok.js → diagram-S7CK7UJ4-Cm1HaBuu.js} +1 -1
- package/dist/{diagram-UQ7AKVKN-BGuMPsr-.js → diagram-UQ7AKVKN-D1lA7Ggu.js} +1 -1
- package/dist/{diagram-VX7I27RA-BkTtpO8P.js → diagram-VX7I27RA-BX3e-Rue.js} +1 -1
- package/dist/{diagram-Z3DM3KII-C0__Mxfm.js → diagram-Z3DM3KII-Dgoj7bPf.js} +1 -1
- package/dist/{dialog-BvjfalZ9.js → dialog-DfKgafXJ.js} +30 -30
- package/dist/{dropdown-menu-D0DeN-aL.js → dropdown-menu-Dge_SmqE.js} +168 -168
- package/dist/{ebnfDiagram-PWID7BFC-CSESPZoz.js → ebnfDiagram-PWID7BFC-B0xWiXrz.js} +2 -2
- package/dist/{erDiagram-RLTQ6QDP-DsDTtabH.js → erDiagram-RLTQ6QDP-Cm-GO31-.js} +1 -1
- package/dist/{error-banner-CXLjTW24.js → error-banner-CfYrJaIb.js} +91 -91
- package/dist/{error-entries-BcAyFIeh.js → error-entries-23Z_1oDM.js} +586 -595
- package/dist/{export-context-CkgZeARR.js → export-context-B1jdxzHF.js} +21 -21
- package/dist/{feedback-button-CeuzSBrq.js → feedback-button-CPu5SV3b.js} +72 -72
- package/dist/{flowDiagram-HODETNUW-qxDPYbfV.js → flowDiagram-HODETNUW-CH6xMlW_.js} +2 -2
- package/dist/{formats-CcQrzFo8.js → formats-Y52bg800.js} +1 -1
- package/dist/{glide-data-editor-BLGr2vQF.js → glide-data-editor-CC9_NDNi.js} +11 -11
- package/dist/{glide-utils-CD8BaFTm.js → glide-utils-BRcuSTCx.js} +2 -2
- package/dist/{globals-DorvG5dC.js → globals-BFlYTNoR.js} +3 -3
- package/dist/{html-to-image-BmLTjaGw.js → html-to-image-Cw7o1IbE.js} +4300 -4296
- package/dist/{infoDiagram-27XIBGKW-B5hq8RM_.js → infoDiagram-27XIBGKW-DbUO63CX.js} +1 -1
- package/dist/{ishikawaDiagram-5VMMS53U-DkHc_9ET.js → ishikawaDiagram-5VMMS53U-CfQrrELH.js} +1 -1
- package/dist/{kanban-definition-UXKFOSKX-CqkTFXmU.js → kanban-definition-UXKFOSKX-C5SJcu1W.js} +1 -1
- package/dist/{loader-CGrYn73j.js → loader-C9-qRO3m.js} +2 -2
- package/dist/main.js +6698 -6604
- package/dist/{mermaid-pmVHDUQA.js → mermaid-C2alqcd8.js} +34 -34
- package/dist/{mindmap-definition-YA3MSWOX-D6cNa__z.js → mindmap-definition-YA3MSWOX-ByVHE0Ax.js} +1 -1
- package/dist/{number-overlay-editor-DQAdvZrn.js → number-overlay-editor-qDcRKPE0.js} +1 -1
- package/dist/{pegDiagram-XKGWAZYB-CmWJX_s1.js → pegDiagram-XKGWAZYB-DF5FBKZi.js} +2 -2
- package/dist/{pencil-CxMgOe04.js → pencil-D7jyZPnP.js} +1 -1
- package/dist/{pieDiagram-E7YTZNPT-CAQAxHah.js → pieDiagram-E7YTZNPT-B5n9nBQN.js} +1 -1
- package/dist/{process-output-CcNpl5Qu.js → process-output-DdBM0lmd.js} +4 -4
- package/dist/{railroadDiagram-O6MQD6OU-jlSsiQg3.js → railroadDiagram-O6MQD6OU-r5t7OYNE.js} +2 -2
- package/dist/{requirementDiagram-BXWQKSXE-DkDjfPhn.js → requirementDiagram-BXWQKSXE-D4QtEyZQ.js} +1 -1
- package/dist/{reveal-component-B6xeeht1.js → reveal-component-BE1xhtNc.js} +1008 -1008
- package/dist/{select-CEnB18uc.js → select-Buk3aXi1.js} +341 -341
- package/dist/{sequenceDiagram-WJ2MYXX4-DLywsGCW.js → sequenceDiagram-WJ2MYXX4-CK3Atn-z.js} +1 -1
- package/dist/{spec-Dz-Avv1m.js → spec-BEp9O9dy.js} +4 -4
- package/dist/{stateDiagram-D77RDMKH-DUmlKwYU.js → stateDiagram-D77RDMKH-C1SxRI8V.js} +2 -2
- package/dist/{stateDiagram-v2-MP3YSRHH-D646KiXs.js → stateDiagram-v2-MP3YSRHH-DK5X6bsr.js} +2 -2
- package/dist/{static-state-iw0PrHK4.js → static-state-D-aT9dOr.js} +9 -9
- package/dist/{swimlanes-42K2YHIH-L7B1GphF.js → swimlanes-42K2YHIH-DdH5TZdu.js} +1 -1
- package/dist/{swimlanesDiagram-VR7AAH4N-DEu2wxtC.js → swimlanesDiagram-VR7AAH4N-CWBIvzgR.js} +2 -2
- package/dist/{timeline-definition-24CTP7MA-DDPyx1yG.js → timeline-definition-24CTP7MA-DE7-o2zU.js} +1 -1
- package/dist/{toast-BTjH6fIf.js → toast-b3k4YxaT.js} +54 -54
- package/dist/{tooltip-DyLdBIM4.js → tooltip-D-9pDheN.js} +62 -62
- package/dist/{use-restore-focus-DJ_-uSn_.js → use-restore-focus-CCfk-ey2.js} +1 -1
- package/dist/{useDateFormatter-HpKD0jEC.js → useDateFormatter-DH0uFwfL.js} +2 -2
- package/dist/{useDeepCompareMemoize-CHx-NxMl.js → useDeepCompareMemoize-Dn-ZJVTd.js} +1 -1
- package/dist/{useLifecycle-tPpAt-OE.js → useLifecycle-yjK7JsRL.js} +1 -1
- package/dist/{vega-component-BzNDFvQf.js → vega-component-BIq0qzhQ.js} +8 -8
- package/dist/{vennDiagram-4TSXK5OY-CRwWeb7g.js → vennDiagram-4TSXK5OY-D7yfNz0d.js} +1 -1
- package/dist/{wardleyDiagram-VM6X3IG4-DVlG9eoq.js → wardleyDiagram-VM6X3IG4-m5Jcz26Z.js} +1 -1
- package/dist/{xychartDiagram-S5SC5T6Z-CM32AISp.js → xychartDiagram-S5SC5T6Z-CA3zV3RW.js} +1 -1
- package/package.json +1 -1
- package/src/__mocks__/intersection-observer.ts +13 -12
- package/src/components/editor/Output.tsx +1 -1
- package/src/components/editor/__tests__/cell-renders.test.tsx +17 -1
- package/src/components/editor/cell/__tests__/cell-actions.test.tsx +74 -0
- package/src/components/editor/cell/cell-action-body.tsx +28 -0
- package/src/components/editor/cell/cell-actions.tsx +60 -72
- package/src/components/editor/cell/cell-context-menu.tsx +36 -62
- package/src/components/editor/chrome/panels/outline/__tests__/outline-keyboard.test.tsx +517 -68
- package/src/components/editor/chrome/panels/outline/__tests__/useActiveOutline.test.ts +17 -5
- package/src/components/editor/chrome/panels/outline/floating-outline.tsx +29 -59
- package/src/components/editor/chrome/panels/outline/useActiveOutline.tsx +333 -133
- package/src/components/editor/chrome/panels/outline-panel.tsx +5 -19
- package/src/components/editor/navigation/navigation.ts +1 -1
- package/src/components/editor/notebook-cell.tsx +263 -267
- package/src/core/cells/__tests__/layout.test.ts +1 -1
- package/src/core/cells/__tests__/notebook-outline.test.ts +31 -3
- package/src/core/cells/__tests__/use-cell-actions.test.tsx +48 -0
- package/src/core/cells/actions.ts +68 -89
- package/src/core/cells/cells.ts +23 -14
- package/src/core/cells/outline.ts +8 -8
- package/src/core/codemirror/language/extension.ts +6 -3
- package/src/core/codemirror/language/panel/panel.test.tsx +144 -0
- package/src/core/codemirror/language/panel/panel.tsx +9 -6
- package/src/core/codemirror/react-dom/createPanel.tsx +15 -15
- package/src/core/dom/__tests__/outline.test.ts +29 -170
- package/src/core/dom/outline.ts +21 -61
- package/src/core/executions/atoms.ts +12 -4
- package/src/core/islands/components/output-wrapper.tsx +7 -2
- package/src/plugins/layout/OutlinePlugin.tsx +5 -17
- package/src/utils/__tests__/createReducer.test.tsx +4 -3
- package/src/utils/createReducer.ts +19 -12
|
@@ -4,7 +4,7 @@ import { t as i } from "./react-Bgs_wQh3.js";
|
|
|
4
4
|
import { t as a } from "./compiler-runtime-C5KHtL5D.js";
|
|
5
5
|
import { t as o } from "./react-dom-DdqGVp5N.js";
|
|
6
6
|
import { t as s } from "./jsx-runtime-D8btoEHk.js";
|
|
7
|
-
import {
|
|
7
|
+
import { Cn as c, Sn as l, _n as u, bn as d, fn as f, gn as p, ln as m, mn as h, o as g, s as _, u as v, vn as y, xn as b, yn as x } from "./use-restore-focus-CCfk-ey2.js";
|
|
8
8
|
//#region ../node_modules/.pnpm/lucide-react@0.577.0_react@19.3.1/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
|
|
9
9
|
var S = /* @__PURE__ */ e(i()), C = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), w = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), T = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), E = (e) => {
|
|
10
10
|
let t = T(e);
|
|
@@ -69,7 +69,7 @@ var S = /* @__PURE__ */ e(i()), C = (...e) => e.filter((e, t, n) => !!e && e.tri
|
|
|
69
69
|
});
|
|
70
70
|
function ie(e) {
|
|
71
71
|
let [t, n] = S.useState(void 0);
|
|
72
|
-
return
|
|
72
|
+
return b(() => {
|
|
73
73
|
if (e) {
|
|
74
74
|
n({
|
|
75
75
|
width: e.offsetWidth,
|
|
@@ -1191,7 +1191,7 @@ var Xt = (e) => {
|
|
|
1191
1191
|
}, sn = {
|
|
1192
1192
|
Optimized: "optimized",
|
|
1193
1193
|
Always: "always"
|
|
1194
|
-
}, cn = "Popper", [ln, un] =
|
|
1194
|
+
}, cn = "Popper", [ln, un] = l(cn), [dn, fn] = ln(cn), pn = /* @__PURE__ */ Q((e) => {
|
|
1195
1195
|
let { __scopePopper: t, children: n } = e, [r, i] = S.useState(null), [a, o] = S.useState(void 0);
|
|
1196
1196
|
return /* @__PURE__ */ (0, j.jsx)(dn, {
|
|
1197
1197
|
scope: t,
|
|
@@ -1218,33 +1218,33 @@ var Xt = (e) => {
|
|
|
1218
1218
|
ref: d
|
|
1219
1219
|
});
|
|
1220
1220
|
}, "PopperAnchor")), gn = "PopperContent", [_n, vn] = ln(gn), yn = /* @__PURE__ */ S.forwardRef(/* @__PURE__ */ Q(function(e, t) {
|
|
1221
|
-
let { __scopePopper: n, side: i = "bottom", sideOffset: a = 0, align: o = "center", alignOffset: s = 0, arrowPadding: l = 0, avoidCollisions:
|
|
1221
|
+
let { __scopePopper: n, side: i = "bottom", sideOffset: a = 0, align: o = "center", alignOffset: s = 0, arrowPadding: l = 0, avoidCollisions: u = !0, collisionBoundary: d = [], collisionPadding: f = 0, sticky: m = on.Partial, hideWhenDetached: h = !1, updatePositionStrategy: g = sn.Optimized, onPlaced: _, ...v } = e, y = fn(gn, n), [x, C] = S.useState(null), w = r(t, C), [T, E] = S.useState(null), D = ie(T), O = D?.width ?? 0, k = D?.height ?? 0, A = i + (o === "center" ? "" : "-" + o), ee = typeof f == "number" ? f : {
|
|
1222
1222
|
top: 0,
|
|
1223
1223
|
right: 0,
|
|
1224
1224
|
bottom: 0,
|
|
1225
1225
|
left: 0,
|
|
1226
|
-
...
|
|
1227
|
-
}, M = Array.isArray(
|
|
1226
|
+
...f
|
|
1227
|
+
}, M = Array.isArray(d) ? d : [d], N = M.length > 0, P = {
|
|
1228
1228
|
padding: ee,
|
|
1229
1229
|
boundary: M.filter(bn),
|
|
1230
1230
|
altBoundary: N
|
|
1231
1231
|
}, { refs: te, floatingStyles: ne, placement: re, isPositioned: ae, middlewareData: F } = Yt({
|
|
1232
1232
|
strategy: "fixed",
|
|
1233
1233
|
placement: A,
|
|
1234
|
-
whileElementsMounted: /* @__PURE__ */ Q((...e) => Ft(...e, { animationFrame:
|
|
1235
|
-
elements: { reference:
|
|
1234
|
+
whileElementsMounted: /* @__PURE__ */ Q((...e) => Ft(...e, { animationFrame: g === sn.Always }), "whileElementsMounted"),
|
|
1235
|
+
elements: { reference: y.anchor },
|
|
1236
1236
|
middleware: [
|
|
1237
1237
|
Zt({
|
|
1238
1238
|
mainAxis: a + k,
|
|
1239
1239
|
alignmentAxis: s
|
|
1240
1240
|
}),
|
|
1241
|
-
|
|
1241
|
+
u && Qt({
|
|
1242
1242
|
mainAxis: !0,
|
|
1243
1243
|
crossAxis: !1,
|
|
1244
|
-
...
|
|
1244
|
+
...m === on.Partial ? { limiter: $t() } : {},
|
|
1245
1245
|
...P
|
|
1246
1246
|
}),
|
|
1247
|
-
|
|
1247
|
+
u && en({ ...P }),
|
|
1248
1248
|
tn({
|
|
1249
1249
|
...P,
|
|
1250
1250
|
apply: /* @__PURE__ */ Q(({ elements: e, rects: t, availableWidth: n, availableHeight: r }) => {
|
|
@@ -1260,7 +1260,7 @@ var Xt = (e) => {
|
|
|
1260
1260
|
arrowWidth: O,
|
|
1261
1261
|
arrowHeight: k
|
|
1262
1262
|
}),
|
|
1263
|
-
|
|
1263
|
+
h && nn(N ? {
|
|
1264
1264
|
strategy: "referenceHidden",
|
|
1265
1265
|
...P
|
|
1266
1266
|
} : {
|
|
@@ -1269,16 +1269,16 @@ var Xt = (e) => {
|
|
|
1269
1269
|
altBoundary: P.altBoundary
|
|
1270
1270
|
})
|
|
1271
1271
|
]
|
|
1272
|
-
}), I =
|
|
1273
|
-
|
|
1272
|
+
}), I = y.setPlacementState;
|
|
1273
|
+
b(() => (I(re), () => {
|
|
1274
1274
|
I(void 0);
|
|
1275
1275
|
}), [re, I]);
|
|
1276
|
-
let [L, R] = Sn(re), z =
|
|
1277
|
-
|
|
1276
|
+
let [L, R] = Sn(re), z = p(_);
|
|
1277
|
+
b(() => {
|
|
1278
1278
|
ae && z?.();
|
|
1279
1279
|
}, [ae, z]);
|
|
1280
1280
|
let oe = F.arrow?.x, se = F.arrow?.y, ce = F.arrow?.centerOffset !== 0, [B, V] = S.useState();
|
|
1281
|
-
return
|
|
1281
|
+
return b(() => {
|
|
1282
1282
|
x && V(window.getComputedStyle(x).zIndex);
|
|
1283
1283
|
}, [x]), /* @__PURE__ */ (0, j.jsx)("div", {
|
|
1284
1284
|
ref: te.setFloating,
|
|
@@ -1306,11 +1306,11 @@ var Xt = (e) => {
|
|
|
1306
1306
|
children: /* @__PURE__ */ (0, j.jsx)(c.div, {
|
|
1307
1307
|
"data-side": L,
|
|
1308
1308
|
"data-align": R,
|
|
1309
|
-
...
|
|
1309
|
+
...v,
|
|
1310
1310
|
ref: w,
|
|
1311
1311
|
style: {
|
|
1312
|
-
...
|
|
1313
|
-
animation: ae ?
|
|
1312
|
+
...v.style,
|
|
1313
|
+
animation: ae ? v.style?.animation : "none"
|
|
1314
1314
|
}
|
|
1315
1315
|
})
|
|
1316
1316
|
})
|
|
@@ -1345,7 +1345,7 @@ Q(Sn, "getSideAndAlignFromPlacement");
|
|
|
1345
1345
|
var Cn = Object.defineProperty, $ = (e, t) => Cn(e, "name", {
|
|
1346
1346
|
value: t,
|
|
1347
1347
|
configurable: !0
|
|
1348
|
-
}), [wn, Tn] =
|
|
1348
|
+
}), [wn, Tn] = l("Tooltip", [un]), En = un(), Dn = "TooltipProvider", On = 700, kn = "tooltip.open", [An, jn] = wn(Dn), Mn = /* @__PURE__ */ $((e) => {
|
|
1349
1349
|
let { __scopeTooltip: t, delayDuration: n = On, skipDelayDuration: r = 300, disableHoverableContent: i = !1, children: a } = e, o = S.useRef(!0), s = S.useRef(!1), c = S.useRef(0);
|
|
1350
1350
|
return S.useEffect(() => {
|
|
1351
1351
|
let e = c.current;
|
|
@@ -1368,36 +1368,36 @@ var Cn = Object.defineProperty, $ = (e, t) => Cn(e, "name", {
|
|
|
1368
1368
|
children: a
|
|
1369
1369
|
});
|
|
1370
1370
|
}, "TooltipProvider"), Nn = "Tooltip", [Pn, Fn] = wn(Nn), In = /* @__PURE__ */ $((e) => {
|
|
1371
|
-
let { __scopeTooltip: t, children: n, open: r, defaultOpen: i, onOpenChange: a, disableHoverableContent: o, delayDuration: s } = e, c = jn(Nn, e.__scopeTooltip), l = En(t), [
|
|
1371
|
+
let { __scopeTooltip: t, children: n, open: r, defaultOpen: i, onOpenChange: a, disableHoverableContent: o, delayDuration: s } = e, c = jn(Nn, e.__scopeTooltip), l = En(t), [d, f] = S.useState(null), [p, m] = S.useState(void 0), h = u(), g = S.useRef(0), _ = o ?? c.disableHoverableContent, v = s ?? c.delayDuration, y = S.useRef(!1), [b, C] = x({
|
|
1372
1372
|
prop: r,
|
|
1373
1373
|
defaultProp: i ?? !1,
|
|
1374
1374
|
onChange: /* @__PURE__ */ $((e) => {
|
|
1375
1375
|
e ? (c.onOpen(), document.dispatchEvent(new CustomEvent(kn))) : c.onClose(), a?.(e);
|
|
1376
1376
|
}, "onChange"),
|
|
1377
1377
|
caller: Nn
|
|
1378
|
-
}), w = S.useMemo(() =>
|
|
1379
|
-
window.clearTimeout(g.current), g.current = 0,
|
|
1378
|
+
}), w = S.useMemo(() => b ? y.current ? "delayed-open" : "instant-open" : "closed", [b]), T = S.useCallback(() => {
|
|
1379
|
+
window.clearTimeout(g.current), g.current = 0, y.current = !1, C(!0);
|
|
1380
1380
|
}, [C]), E = S.useCallback(() => {
|
|
1381
1381
|
window.clearTimeout(g.current), g.current = 0, C(!1);
|
|
1382
1382
|
}, [C]), D = S.useCallback(() => {
|
|
1383
1383
|
window.clearTimeout(g.current), g.current = window.setTimeout(() => {
|
|
1384
|
-
|
|
1384
|
+
y.current = !0, C(!0), g.current = 0;
|
|
1385
1385
|
}, v);
|
|
1386
1386
|
}, [v, C]);
|
|
1387
1387
|
S.useEffect(() => () => {
|
|
1388
1388
|
g.current &&= (window.clearTimeout(g.current), 0);
|
|
1389
1389
|
}, []);
|
|
1390
|
-
let O =
|
|
1390
|
+
let O = p ?? h;
|
|
1391
1391
|
return /* @__PURE__ */ (0, j.jsx)(pn, {
|
|
1392
1392
|
...l,
|
|
1393
1393
|
children: /* @__PURE__ */ (0, j.jsx)(Pn, {
|
|
1394
1394
|
scope: t,
|
|
1395
1395
|
contentId: O,
|
|
1396
1396
|
setContentId: m,
|
|
1397
|
-
open:
|
|
1397
|
+
open: b,
|
|
1398
1398
|
stateAttribute: w,
|
|
1399
|
-
trigger:
|
|
1400
|
-
onTriggerChange:
|
|
1399
|
+
trigger: d,
|
|
1400
|
+
onTriggerChange: f,
|
|
1401
1401
|
onTriggerEnter: S.useCallback(() => {
|
|
1402
1402
|
c.isOpenDelayedRef.current ? D() : T();
|
|
1403
1403
|
}, [
|
|
@@ -1415,29 +1415,29 @@ var Cn = Object.defineProperty, $ = (e, t) => Cn(e, "name", {
|
|
|
1415
1415
|
})
|
|
1416
1416
|
});
|
|
1417
1417
|
}, "Tooltip"), Ln = "TooltipTrigger", Rn = /* @__PURE__ */ S.forwardRef(/* @__PURE__ */ $(function(e, t) {
|
|
1418
|
-
let { __scopeTooltip: n, "aria-describedby": i, ...a } = e, o = Fn(Ln, n), s = jn(Ln, n), l = En(n), u = S.useRef(null),
|
|
1419
|
-
return S.useEffect(() => () => document.removeEventListener("pointerup",
|
|
1418
|
+
let { __scopeTooltip: n, "aria-describedby": i, ...a } = e, o = Fn(Ln, n), s = jn(Ln, n), l = En(n), u = S.useRef(null), f = r(t, u, o.onTriggerChange), p = S.useRef(!1), m = S.useRef(!1), h = S.useCallback(() => p.current = !1, []);
|
|
1419
|
+
return S.useEffect(() => () => document.removeEventListener("pointerup", h), [h]), /* @__PURE__ */ (0, j.jsx)(hn, {
|
|
1420
1420
|
asChild: !0,
|
|
1421
1421
|
...l,
|
|
1422
1422
|
children: /* @__PURE__ */ (0, j.jsx)(c.button, {
|
|
1423
1423
|
"aria-describedby": o.open ? er(i, o.contentId) : i,
|
|
1424
1424
|
"data-state": o.stateAttribute,
|
|
1425
1425
|
...a,
|
|
1426
|
-
ref:
|
|
1427
|
-
onPointerMove:
|
|
1428
|
-
e.pointerType !== "touch" && !
|
|
1426
|
+
ref: f,
|
|
1427
|
+
onPointerMove: d(e.onPointerMove, (e) => {
|
|
1428
|
+
e.pointerType !== "touch" && !m.current && !s.isPointerInTransitRef.current && (o.onTriggerEnter(), m.current = !0);
|
|
1429
1429
|
}),
|
|
1430
|
-
onPointerLeave:
|
|
1431
|
-
o.onTriggerLeave(),
|
|
1430
|
+
onPointerLeave: d(e.onPointerLeave, () => {
|
|
1431
|
+
o.onTriggerLeave(), m.current = !1;
|
|
1432
1432
|
}),
|
|
1433
|
-
onPointerDown:
|
|
1434
|
-
o.open && o.onClose(),
|
|
1433
|
+
onPointerDown: d(e.onPointerDown, () => {
|
|
1434
|
+
o.open && o.onClose(), p.current = !0, document.addEventListener("pointerup", h, { once: !0 });
|
|
1435
1435
|
}),
|
|
1436
|
-
onFocus:
|
|
1437
|
-
|
|
1436
|
+
onFocus: d(e.onFocus, () => {
|
|
1437
|
+
p.current || o.onOpen();
|
|
1438
1438
|
}),
|
|
1439
|
-
onBlur:
|
|
1440
|
-
onClick:
|
|
1439
|
+
onBlur: d(e.onBlur, o.onClose),
|
|
1440
|
+
onClick: d(e.onClick, o.onClose)
|
|
1441
1441
|
})
|
|
1442
1442
|
});
|
|
1443
1443
|
}, "TooltipTrigger")), zn = "TooltipPortal", [Bn, Vn] = wn(zn, { forceMount: void 0 }), Hn = /* @__PURE__ */ $((e) => {
|
|
@@ -1445,9 +1445,9 @@ var Cn = Object.defineProperty, $ = (e, t) => Cn(e, "name", {
|
|
|
1445
1445
|
return /* @__PURE__ */ (0, j.jsx)(Bn, {
|
|
1446
1446
|
scope: t,
|
|
1447
1447
|
forceMount: n,
|
|
1448
|
-
children: /* @__PURE__ */ (0, j.jsx)(
|
|
1448
|
+
children: /* @__PURE__ */ (0, j.jsx)(y, {
|
|
1449
1449
|
present: n || a.open,
|
|
1450
|
-
children: /* @__PURE__ */ (0, j.jsx)(
|
|
1450
|
+
children: /* @__PURE__ */ (0, j.jsx)(m, {
|
|
1451
1451
|
asChild: !0,
|
|
1452
1452
|
container: i,
|
|
1453
1453
|
children: r
|
|
@@ -1456,7 +1456,7 @@ var Cn = Object.defineProperty, $ = (e, t) => Cn(e, "name", {
|
|
|
1456
1456
|
});
|
|
1457
1457
|
}, "TooltipPortal"), Un = "TooltipContent", Wn = /* @__PURE__ */ S.forwardRef(/* @__PURE__ */ $(function(e, t) {
|
|
1458
1458
|
let n = Vn(Un, e.__scopeTooltip), { forceMount: r = n.forceMount, side: i = "top", ...a } = e, o = Fn(Un, e.__scopeTooltip);
|
|
1459
|
-
return /* @__PURE__ */ (0, j.jsx)(
|
|
1459
|
+
return /* @__PURE__ */ (0, j.jsx)(y, {
|
|
1460
1460
|
present: r || o.open,
|
|
1461
1461
|
children: o.disableHoverableContent ? /* @__PURE__ */ (0, j.jsx)(qn, {
|
|
1462
1462
|
side: i,
|
|
@@ -1512,32 +1512,32 @@ var Cn = Object.defineProperty, $ = (e, t) => Cn(e, "name", {
|
|
|
1512
1512
|
ref: o
|
|
1513
1513
|
});
|
|
1514
1514
|
}, "TooltipContentHoverable")), Kn = t("TooltipContent"), qn = /* @__PURE__ */ S.forwardRef(/* @__PURE__ */ $(function(e, t) {
|
|
1515
|
-
let { __scopeTooltip: n, children: i, "aria-label": a, id: o, onEscapeKeyDown: s, onPointerDownOutside: c, ...l } = e,
|
|
1516
|
-
f(
|
|
1517
|
-
if (
|
|
1515
|
+
let { __scopeTooltip: n, children: i, "aria-label": a, id: o, onEscapeKeyDown: s, onPointerDownOutside: c, ...l } = e, u = Fn(Un, n), d = En(n), { onClose: p } = u, [m, g] = S.useState(null), _ = r(t, g);
|
|
1516
|
+
f(m), S.useEffect(() => (document.addEventListener(kn, p), () => document.removeEventListener(kn, p)), [p]), S.useEffect(() => {
|
|
1517
|
+
if (u.trigger) {
|
|
1518
1518
|
let e = /* @__PURE__ */ $((e) => {
|
|
1519
|
-
e.target instanceof Node && e.target.contains(
|
|
1519
|
+
e.target instanceof Node && e.target.contains(u.trigger) && p();
|
|
1520
1520
|
}, "handleScroll");
|
|
1521
1521
|
return window.addEventListener("scroll", e, { capture: !0 }), () => window.removeEventListener("scroll", e, { capture: !0 });
|
|
1522
1522
|
}
|
|
1523
|
-
}, [
|
|
1524
|
-
let { setContentId:
|
|
1525
|
-
return
|
|
1526
|
-
|
|
1527
|
-
}), [o,
|
|
1523
|
+
}, [u.trigger, p]);
|
|
1524
|
+
let { setContentId: v } = u;
|
|
1525
|
+
return b(() => (v(o), () => {
|
|
1526
|
+
v(void 0);
|
|
1527
|
+
}), [o, v]), /* @__PURE__ */ (0, j.jsx)(h, {
|
|
1528
1528
|
asChild: !0,
|
|
1529
1529
|
disableOutsidePointerEvents: !1,
|
|
1530
1530
|
onEscapeKeyDown: s,
|
|
1531
1531
|
onPointerDownOutside: c,
|
|
1532
1532
|
onFocusOutside: (e) => e.preventDefault(),
|
|
1533
|
-
onDismiss:
|
|
1533
|
+
onDismiss: p,
|
|
1534
1534
|
children: /* @__PURE__ */ (0, j.jsxs)(yn, {
|
|
1535
|
-
"data-state":
|
|
1535
|
+
"data-state": u.stateAttribute,
|
|
1536
1536
|
role: a ? void 0 : "tooltip",
|
|
1537
|
-
id: a ? void 0 :
|
|
1538
|
-
...
|
|
1537
|
+
id: a ? void 0 : u.contentId,
|
|
1538
|
+
...d,
|
|
1539
1539
|
...l,
|
|
1540
|
-
ref:
|
|
1540
|
+
ref: _,
|
|
1541
1541
|
style: {
|
|
1542
1542
|
...l.style,
|
|
1543
1543
|
"--radix-tooltip-content-transform-origin": "var(--radix-popper-transform-origin)",
|
|
@@ -1547,7 +1547,7 @@ var Cn = Object.defineProperty, $ = (e, t) => Cn(e, "name", {
|
|
|
1547
1547
|
"--radix-tooltip-trigger-height": "var(--radix-popper-anchor-height)"
|
|
1548
1548
|
},
|
|
1549
1549
|
children: [/* @__PURE__ */ (0, j.jsx)(Kn, { children: i }), a ? /* @__PURE__ */ (0, j.jsx)(te, {
|
|
1550
|
-
id:
|
|
1550
|
+
id: u.contentId,
|
|
1551
1551
|
role: "tooltip",
|
|
1552
1552
|
children: a
|
|
1553
1553
|
}) : null]
|
|
@@ -1684,13 +1684,13 @@ var tr = a(), nr = (e) => {
|
|
|
1684
1684
|
delayDuration: i,
|
|
1685
1685
|
...n
|
|
1686
1686
|
}), t[3] = i, t[4] = n, t[5] = a) : a = t[5], a;
|
|
1687
|
-
}, rr = g(Hn), ir = In, ar =
|
|
1687
|
+
}, rr = g(Hn), ir = In, ar = _(Wn), or = Rn, sr = S.forwardRef((e, t) => {
|
|
1688
1688
|
let r = (0, tr.c)(11), i, a, o;
|
|
1689
1689
|
r[0] === e ? (i = r[1], a = r[2], o = r[3]) : ({className: i, sideOffset: o, ...a} = e, r[0] = e, r[1] = i, r[2] = a, r[3] = o);
|
|
1690
1690
|
let s = o === void 0 ? 4 : o, c;
|
|
1691
1691
|
r[4] === i ? c = r[5] : (c = n("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-xs data-[side=bottom]:slide-in-from-top-1 data-[side=left]:slide-in-from-right-1 data-[side=right]:slide-in-from-left-1 data-[side=top]:slide-in-from-bottom-1", i), r[4] = i, r[5] = c);
|
|
1692
1692
|
let l;
|
|
1693
|
-
return r[6] !== a || r[7] !== t || r[8] !== s || r[9] !== c ? (l = /* @__PURE__ */ (0, j.jsx)(
|
|
1693
|
+
return r[6] !== a || r[7] !== t || r[8] !== s || r[9] !== c ? (l = /* @__PURE__ */ (0, j.jsx)(v, { children: /* @__PURE__ */ (0, j.jsx)(ar, {
|
|
1694
1694
|
ref: t,
|
|
1695
1695
|
sideOffset: s,
|
|
1696
1696
|
className: c,
|
|
@@ -7678,4 +7678,4 @@ function Yh() {
|
|
|
7678
7678
|
}, e[1] = t, e[2] = a), a;
|
|
7679
7679
|
}
|
|
7680
7680
|
//#endregion
|
|
7681
|
-
export {
|
|
7681
|
+
export { Np as $, Sr as $t, Pp as A, Zi as At, Tm as B, Ui as Bt, lh as C, x as Cn, sa as Ct, Qm as D, ea as Dt, ah as E, ia as Et, cp as F, Mi as Ft, Z as G, wi as Gt, em as H, _i as Ht, am as I, ji as It, Rp as J, fi as Jt, Im as K, gi as Kt, jp as L, qi as Lt, hm as M, na as Mt, Xp as N, $i as Nt, Lp as O, Qi as Ot, im as P, Yi as Pt, Zp as Q, _r as Qt, Gp as R, Gi as Rt, oh as S, ae as Sn, Po as St, $ as T, aa as Tt, W as U, Ti as Ut, sp as V, ki as Vt, Jp as W, Ci as Wt, J as X, ar as Xt, Y, Dr as Yt, Mm as Z, wr as Zt, ih as _, Ve as _n, Vf as _t, Wh as a, $n as an, Hp as at, th as b, ue as bn, fu as bt, Rh as c, Nt as cn, um as ct, Mh as d, ft as dn, G as dt, pr as en, Lm as et, Nh as f, mt as fn, tm as ft, _h as g, Ge as gn, Gf as gt, gh as h, $e as hn, Yf as ht, Hh as i, rr as in, wm as it, Up as j, Xi as jt, Wp as k, ta as kt, Lh as l, Dt as ln, rm as lt, vh as m, Qe as mn, Bp as mt, Bh as n, xr as nn, om as nt, Kh as o, Wn as on, q as ot, yh as p, pt as pn, Yp as pt, Ip as q, O as qt, Vh as r, sr as rn, X as rt, qh as s, Lt as sn, Kp as st, Yh as t, dr as tn, Am as tt, Fh as u, ut as un, qp as ut, ch as v, je as vn, qu as vt, Zm as w, ne as wn, ra as wt, eh as x, C as xn, Fu as xt, sh as y, Ce as yn, Bu as yt, lm as z, Ii as zt };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { a as e } from "./rolldown-runtime-BPCzCO3I.js";
|
|
2
2
|
import { t } from "./react-Bgs_wQh3.js";
|
|
3
|
-
import { h as n } from "./tooltip-
|
|
4
|
-
import { C as r } from "./select-
|
|
3
|
+
import { h as n } from "./tooltip-D-9pDheN.js";
|
|
4
|
+
import { C as r } from "./select-Buk3aXi1.js";
|
|
5
5
|
var i = n("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 { a as e } from "./rolldown-runtime-BPCzCO3I.js";
|
|
2
2
|
import { t } from "./react-Bgs_wQh3.js";
|
|
3
|
-
import {
|
|
3
|
+
import { Vt as n } from "./use-restore-focus-CCfk-ey2.js";
|
|
4
4
|
//#region src/utils/semaphore.ts
|
|
5
5
|
var r = class {
|
|
6
6
|
maxPermits;
|
|
@@ -2,7 +2,7 @@ import { a as e } from "./rolldown-runtime-BPCzCO3I.js";
|
|
|
2
2
|
import { h as t, i as n } from "./button-Z2R2272J.js";
|
|
3
3
|
import { t as r } from "./react-Bgs_wQh3.js";
|
|
4
4
|
import { t as i } from "./compiler-runtime-C5KHtL5D.js";
|
|
5
|
-
import { h as a } from "./tooltip-
|
|
5
|
+
import { h as a } from "./tooltip-D-9pDheN.js";
|
|
6
6
|
import { t as o } from "./jsx-runtime-D8btoEHk.js";
|
|
7
7
|
var s = a("calendar", [
|
|
8
8
|
["path", {
|
|
@@ -2,20 +2,20 @@ import { a as e } from "./rolldown-runtime-BPCzCO3I.js";
|
|
|
2
2
|
import { g as t, h as n, m as r, s as i } from "./button-Z2R2272J.js";
|
|
3
3
|
import { t as a } from "./react-Bgs_wQh3.js";
|
|
4
4
|
import { t as o } from "./compiler-runtime-C5KHtL5D.js";
|
|
5
|
-
import { t as s } from "./tooltip-
|
|
6
|
-
import { t as c } from "./circle-question-mark-
|
|
5
|
+
import { t as s } from "./tooltip-D-9pDheN.js";
|
|
6
|
+
import { t as c } from "./circle-question-mark-YmLYXyvS.js";
|
|
7
7
|
import { t as l } from "./jsx-runtime-D8btoEHk.js";
|
|
8
|
-
import {
|
|
9
|
-
import { n as d } from "./error-banner-
|
|
8
|
+
import { f as u } from "./use-restore-focus-CCfk-ey2.js";
|
|
9
|
+
import { n as d } from "./error-banner-CfYrJaIb.js";
|
|
10
10
|
import { t as f } from "./debounce-DrhhziJv.js";
|
|
11
11
|
import { t as p } from "./objects-DCmMvZtn.js";
|
|
12
12
|
import { t as ee } from "./useEvent-BoN7U38T.js";
|
|
13
13
|
import { a as m, t as te } from "./arrays-DoQ-AILx.js";
|
|
14
|
-
import { a as h, i as ne, n as re, t as ie } from "./formats-
|
|
15
|
-
import { a as g } from "./export-context-
|
|
14
|
+
import { a as h, i as ne, n as re, t as ie } from "./formats-Y52bg800.js";
|
|
15
|
+
import { a as g } from "./export-context-B1jdxzHF.js";
|
|
16
16
|
import { t as ae } from "./useAsyncData-P5-Oovhq.js";
|
|
17
|
-
import { n as _, t as oe } from "./useDeepCompareMemoize-
|
|
18
|
-
import { o as se, r as ce, t as le } from "./loader-
|
|
17
|
+
import { n as _, t as oe } from "./useDeepCompareMemoize-Dn-ZJVTd.js";
|
|
18
|
+
import { o as se, r as ce, t as le } from "./loader-C9-qRO3m.js";
|
|
19
19
|
import { W as ue, n as v } from "./vega-loader.browser-Co9gYE8Z.js";
|
|
20
20
|
import { t as de } from "./react-vega-CGgQEf0O.js";
|
|
21
21
|
import { t as fe } from "./use-vega-container-remeasure-BrUpWQfF.js";
|
|
@@ -3,7 +3,7 @@ import { t } from "./src-D5uZaZib.js";
|
|
|
3
3
|
import { n } from "./chunk-Y2CYZVJY-DKKS1VyV.js";
|
|
4
4
|
import { $ as r, H as i, K as a, U as o, a as s, b as c, c as l, et as u, f as d, nt as f, tt as p, v as m, w as h, y as g } from "./chunk-DU6HZSFF-4SDIhUTY.js";
|
|
5
5
|
import { t as _ } from "./rough.esm-CtV9AnV1.js";
|
|
6
|
-
import { p as v } from "./mermaid-
|
|
6
|
+
import { p as v } from "./mermaid-C2alqcd8.js";
|
|
7
7
|
//#region ../node_modules/.pnpm/khroma@2.1.0/node_modules/khroma/dist/methods/transparentize.js
|
|
8
8
|
var y = (e, t) => p(e, "a", -t), b = 1e-10;
|
|
9
9
|
function x(e, t) {
|
|
@@ -2,7 +2,7 @@ import { i as e } from "./chunk-75Z2AOVW-76L6My3P.js";
|
|
|
2
2
|
import { n as t } from "./src-D5uZaZib.js";
|
|
3
3
|
import { n } from "./chunk-Y2CYZVJY-DKKS1VyV.js";
|
|
4
4
|
import { D as r, H as i, K as a, U as o, a as s, b as c, c as l, v as u, w as d, x as f, y as p } from "./chunk-DU6HZSFF-4SDIhUTY.js";
|
|
5
|
-
import { p as m } from "./mermaid-
|
|
5
|
+
import { p as m } from "./mermaid-C2alqcd8.js";
|
|
6
6
|
import { n as h } from "./mermaid-parser.core-DtOnl7m4.js";
|
|
7
7
|
import { t as g } from "./chunk-JWPE2WC7-DJvv1t8U.js";
|
|
8
8
|
//#region ../node_modules/.pnpm/mermaid@11.17.2/node_modules/mermaid/dist/chunks/mermaid.core/wardleyDiagram-VM6X3IG4.mjs
|
|
@@ -9,7 +9,7 @@ import { n as s } from "./chunk-Y2CYZVJY-DKKS1VyV.js";
|
|
|
9
9
|
import { D as c, H as l, K as u, U as d, a as f, b as p, c as m, f as h, v as g, w as _, y as v, z as y } from "./chunk-DU6HZSFF-4SDIhUTY.js";
|
|
10
10
|
import "./chunk-PWAF6VOD-CRu_RGP2.js";
|
|
11
11
|
import { t as b } from "./chunk-GMAD6QVW-BJGF8QZL.js";
|
|
12
|
-
import { p as x } from "./mermaid-
|
|
12
|
+
import { p as x } from "./mermaid-C2alqcd8.js";
|
|
13
13
|
//#region ../node_modules/.pnpm/d3-scale@4.0.2/node_modules/d3-scale/src/band.js
|
|
14
14
|
function S() {
|
|
15
15
|
var e = t().unknown(void 0), r = e.domain, i = e.range, o = 0, s = 1, c, l, u = !1, d = 0, f = 0, p = .5;
|
package/package.json
CHANGED
|
@@ -9,24 +9,25 @@ export function mockIntersectionObservers() {
|
|
|
9
9
|
rootMargin: "0px",
|
|
10
10
|
scrollMargin: "0px",
|
|
11
11
|
thresholds: [0],
|
|
12
|
-
observe: vi.fn(),
|
|
12
|
+
observe: vi.fn<(target: Element) => void>(),
|
|
13
13
|
unobserve: vi.fn(),
|
|
14
14
|
disconnect: vi.fn(),
|
|
15
15
|
takeRecords: () => [],
|
|
16
16
|
emit(target: Element, visible: boolean) {
|
|
17
|
+
observer.emitBatch([[target, visible]]);
|
|
18
|
+
},
|
|
19
|
+
emitBatch(changes: [Element, boolean][]) {
|
|
17
20
|
const rect = new DOMRect();
|
|
18
21
|
callback(
|
|
19
|
-
[
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
],
|
|
22
|
+
changes.map(([target, isIntersecting]) => ({
|
|
23
|
+
target,
|
|
24
|
+
isIntersecting,
|
|
25
|
+
intersectionRatio: isIntersecting ? 1 : 0,
|
|
26
|
+
time: 0,
|
|
27
|
+
boundingClientRect: rect,
|
|
28
|
+
intersectionRect: rect,
|
|
29
|
+
rootBounds: rect,
|
|
30
|
+
})),
|
|
30
31
|
observer,
|
|
31
32
|
);
|
|
32
33
|
},
|
|
@@ -400,6 +400,7 @@ export const OutputArea = React.memo(
|
|
|
400
400
|
cellId={cellId}
|
|
401
401
|
forceExpand={forceExpand}
|
|
402
402
|
id={CellOutputId.create(cellId)}
|
|
403
|
+
data-cell-role="output"
|
|
403
404
|
className={cn(
|
|
404
405
|
stale && "marimo-output-stale",
|
|
405
406
|
loading && "marimo-output-loading",
|
|
@@ -505,7 +506,6 @@ const ExpandableOutput = React.memo(
|
|
|
505
506
|
</div>
|
|
506
507
|
<div
|
|
507
508
|
{...props}
|
|
508
|
-
data-cell-role="output"
|
|
509
509
|
className={cn(
|
|
510
510
|
"relative fullscreen:bg-background fullscreen:flex fullscreen:items-center fullscreen:justify-center",
|
|
511
511
|
"fullscreen:items-center-safe",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
-
import { act, render } from "@testing-library/react";
|
|
2
|
+
import { act, fireEvent, render, screen, within } from "@testing-library/react";
|
|
3
3
|
import { Profiler } from "react";
|
|
4
4
|
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
|
|
5
5
|
import { DocumentWrapper } from "@/__mocks__/document";
|
|
@@ -66,6 +66,22 @@ async function setup(count: number) {
|
|
|
66
66
|
return { ...notebook, replica, renders };
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
it("shares the tooltip hover delay across cells", async () => {
|
|
70
|
+
await setup(2);
|
|
71
|
+
const [first, second] = screen
|
|
72
|
+
.getAllByTestId("cell-tray")
|
|
73
|
+
.map((tray) => within(tray).getByRole("button", { name: "Delete cell" }));
|
|
74
|
+
|
|
75
|
+
fireEvent.pointerMove(first, { pointerType: "mouse" });
|
|
76
|
+
expect(first).toHaveAttribute("data-state", "closed");
|
|
77
|
+
await act(async () => vi.advanceTimersByTimeAsync(400));
|
|
78
|
+
expect(first).toHaveAttribute("data-state", "delayed-open");
|
|
79
|
+
|
|
80
|
+
fireEvent.pointerLeave(first, { pointerType: "mouse" });
|
|
81
|
+
fireEvent.pointerMove(second, { pointerType: "mouse" });
|
|
82
|
+
expect(second).toHaveAttribute("data-state", "instant-open");
|
|
83
|
+
});
|
|
84
|
+
|
|
69
85
|
describe.each([2, 25])("cell render isolation with %i cells", (count) => {
|
|
70
86
|
it("does not re-render other cells on a keystroke", async () => {
|
|
71
87
|
const { store, model, renders } = await setup(count);
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
act,
|
|
5
|
+
fireEvent,
|
|
6
|
+
render,
|
|
7
|
+
screen,
|
|
8
|
+
waitFor,
|
|
9
|
+
} from "@testing-library/react";
|
|
10
|
+
import { createRef } from "react";
|
|
11
|
+
import { expect, it, vi } from "vitest";
|
|
12
|
+
import { cellId } from "@/__tests__/branded";
|
|
13
|
+
import { useCellActionButtons } from "../../actions/useCellActionButton";
|
|
14
|
+
import {
|
|
15
|
+
CellActionsDropdown,
|
|
16
|
+
type CellActionsDropdownHandle,
|
|
17
|
+
} from "../cell-actions";
|
|
18
|
+
|
|
19
|
+
vi.mock("../../actions/useCellActionButton", () => ({
|
|
20
|
+
useCellActionButtons: vi.fn(),
|
|
21
|
+
}));
|
|
22
|
+
|
|
23
|
+
it("builds actions only for the open cell and restores focus on dismissal", async () => {
|
|
24
|
+
HTMLElement.prototype.scrollIntoView = vi.fn();
|
|
25
|
+
const dropdown = createRef<CellActionsDropdownHandle>();
|
|
26
|
+
const select = vi.fn(() => document.activeElement);
|
|
27
|
+
vi.mocked(useCellActionButtons).mockReturnValue([
|
|
28
|
+
[{ label: "Run cell", handle: select }],
|
|
29
|
+
]);
|
|
30
|
+
render(
|
|
31
|
+
<>
|
|
32
|
+
{Array.from({ length: 20 }, (_, i) => (
|
|
33
|
+
<CellActionsDropdown
|
|
34
|
+
key={i}
|
|
35
|
+
ref={i === 7 ? dropdown : undefined}
|
|
36
|
+
cellId={cellId(String(i))}
|
|
37
|
+
name=""
|
|
38
|
+
config={{}}
|
|
39
|
+
status="idle"
|
|
40
|
+
blocked={false}
|
|
41
|
+
hasOutput={false}
|
|
42
|
+
hasConsoleOutput={false}
|
|
43
|
+
getEditorView={() => null}
|
|
44
|
+
showTooltip={false}
|
|
45
|
+
>
|
|
46
|
+
<button type="button">Actions {i}</button>
|
|
47
|
+
</CellActionsDropdown>
|
|
48
|
+
))}
|
|
49
|
+
</>,
|
|
50
|
+
);
|
|
51
|
+
expect(useCellActionButtons).not.toHaveBeenCalled();
|
|
52
|
+
|
|
53
|
+
const trigger = screen.getByRole("button", { name: "Actions 7" });
|
|
54
|
+
trigger.focus();
|
|
55
|
+
act(() => dropdown.current?.toggle());
|
|
56
|
+
const search = await screen.findByRole("combobox");
|
|
57
|
+
expect(search).toHaveFocus();
|
|
58
|
+
fireEvent.keyDown(search, { key: "Escape" });
|
|
59
|
+
await waitFor(() => expect(trigger).toHaveFocus());
|
|
60
|
+
expect(select).not.toHaveBeenCalled();
|
|
61
|
+
|
|
62
|
+
fireEvent.click(trigger);
|
|
63
|
+
fireEvent.click(await screen.findByRole("option", { name: "Run cell" }));
|
|
64
|
+
await waitFor(() => expect(select).toHaveBeenCalledTimes(1));
|
|
65
|
+
expect(select).toHaveReturnedWith(trigger);
|
|
66
|
+
expect(screen.queryByRole("dialog")).toBeNull();
|
|
67
|
+
expect(
|
|
68
|
+
new Set(
|
|
69
|
+
vi
|
|
70
|
+
.mocked(useCellActionButtons)
|
|
71
|
+
.mock.calls.map(([{ cell }]) => cell?.cellId),
|
|
72
|
+
),
|
|
73
|
+
).toEqual(new Set([cellId("7")]));
|
|
74
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
+
|
|
3
|
+
import { renderMinimalShortcut } from "@/components/shortcuts/renderShortcut";
|
|
4
|
+
import { Tooltip } from "@/components/ui/tooltip";
|
|
5
|
+
import type { ActionButton } from "../actions/types";
|
|
6
|
+
|
|
7
|
+
export function CellActionBody({ action }: { action: ActionButton }) {
|
|
8
|
+
const body = (
|
|
9
|
+
<div className="flex items-center flex-1">
|
|
10
|
+
{action.icon && (
|
|
11
|
+
<div className="mr-2 w-5 text-muted-foreground">{action.icon}</div>
|
|
12
|
+
)}
|
|
13
|
+
<div className="flex-1">{action.label}</div>
|
|
14
|
+
<div className="shrink-0 text-sm">
|
|
15
|
+
{action.hotkey && renderMinimalShortcut(action.hotkey)}
|
|
16
|
+
{action.rightElement}
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
return action.tooltip ? (
|
|
22
|
+
<Tooltip content={action.tooltip} delayDuration={100}>
|
|
23
|
+
{body}
|
|
24
|
+
</Tooltip>
|
|
25
|
+
) : (
|
|
26
|
+
body
|
|
27
|
+
);
|
|
28
|
+
}
|