Your Name 1912bcd25b
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
chore: sync all remaining local workspace changes
2026-05-08 11:26:57 +08:00

151 lines
4.6 KiB
JavaScript

/*
* Extracted from browser-delivered Turbopack chunk: fd0220e4d10052af.701bdafa2d.js
* Module id: 589001
* For reading/searching only; this factory depends on the original Turbopack runtime.
*/
const moduleFactory = (e) => {
"use strict";
var t = e.i(462214),
n = e.i(358379),
i = e.i(111558),
r = e.i(41671),
a = e.i(791997),
o = e.i(41114);
function s() {
let [e, t] = (0, n.useState)(!1);
return {
isFullScreen: e,
openFullScreen: (0, n.useCallback)(() => t(!0), []),
closeFullScreen: (0, n.useCallback)(() => t(!1), []),
};
}
function c({
open: e,
onClose: s,
title: c,
headerExtra: l,
hideIdleCursor: u,
children: h,
}) {
let f = "light" === (0, a.useCanvasThemeStore)((e) => e.theme),
d = (0, n.useRef)(),
[p, g] = (0, n.useState)(!1);
(0, n.useEffect)(() => {
if (!e) return;
let t = (e) => {
"Escape" === e.key && (e.stopPropagation(), s());
};
return (
window.addEventListener("keydown", t),
() => window.removeEventListener("keydown", t)
);
}, [e, s]),
(0, n.useEffect)(() => {
if (!e) return;
let t = document.body.style.overflow;
return (
(document.body.style.overflow = "hidden"),
() => {
document.body.style.overflow = t;
}
);
}, [e]);
let b = (0, n.useCallback)(() => {
g(!1),
d.current && clearTimeout(d.current),
(d.current = setTimeout(() => g(!0), 3e3));
}, []);
if (
((0, n.useEffect)(() => {
if (!e || !u) {
g(!1), d.current && clearTimeout(d.current);
return;
}
return (
b(),
() => {
d.current && clearTimeout(d.current);
}
);
}, [e, u, b]),
!e)
)
return null;
let m = u && p;
return (0, i.createPortal)(
(0, t.jsxs)("div", {
className: (0, o.cn)(
"fixed inset-0 flex flex-col",
f && "canvas-light",
),
style: {
zIndex: 400,
background: f
? "rgba(252, 252, 252, 0.96)"
: "rgba(10, 10, 10, 0.95)",
backdropFilter: "blur(8px)",
cursor: m ? "none" : void 0,
},
onMouseMove: u ? b : void 0,
children: [
(0, t.jsxs)("div", {
className: (0, o.cn)(
"flex shrink-0 items-center justify-between border-b border-solid px-6 transition-opacity duration-300",
f ? "border-black/10 bg-white/70" : "border-white/8",
),
style: {
height: 56,
opacity: +!m,
pointerEvents: m ? "none" : void 0,
},
children: [
(0, t.jsx)("div", {
className: "flex items-center gap-3",
children:
c &&
(0, t.jsx)("span", {
className: (0, o.cn)(
"text-base font-medium",
f ? "text-neutral-900" : "text-white/90",
),
children: c,
}),
}),
(0, t.jsxs)("div", {
className: "flex items-center gap-2",
children: [
l,
(0, t.jsx)("button", {
type: "button",
onClick: s,
className: (0, o.cn)(
"flex h-7 w-7 items-center justify-center rounded-lg transition-colors",
f
? "text-neutral-500 hover:bg-black/5 hover:text-neutral-800"
: "text-white/50 hover:bg-white/10 hover:text-white/80",
),
title: "关闭 (ESC)",
children: (0, t.jsx)(r.Icons.x, {
width: 12,
height: 12,
}),
}),
],
}),
],
}),
(0, t.jsx)("div", {
className: "flex min-h-0 flex-1 flex-col overflow-y-auto",
children: h,
}),
],
}),
document.body,
);
}
e.s(["NodeFullScreenOverlay", () => c, "useNodeFullScreen", () => s]);
};
export default moduleFactory;