@malette/agent-sdk 0.1.3-beta.11 → 0.1.3-beta.12
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/index.js +276 -78
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +277 -79
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -26944,19 +26944,57 @@ function ShareReplayPage({ shareId, onNavigateBack }) {
|
|
|
26944
26944
|
] });
|
|
26945
26945
|
}
|
|
26946
26946
|
var typeConfig = {
|
|
26947
|
-
html: { icon: lucideReact.Globe, label: "HTML", color: "
|
|
26948
|
-
svg: { icon: lucideReact.Globe, label: "SVG", color: "
|
|
26949
|
-
markdown: { icon: lucideReact.FileText, label: "Markdown", color: "
|
|
26950
|
-
json: { icon: lucideReact.FileJson, label: "JSON", color: "
|
|
26951
|
-
code: { icon: lucideReact.FileCode, label: "Code", color: "
|
|
26952
|
-
text: { icon: lucideReact.FileText, label: "Text", color: "
|
|
26953
|
-
image: { icon: lucideReact.FileImage, label: "Image", color: "
|
|
26954
|
-
video: { icon: lucideReact.Video, label: "Video", color: "
|
|
26947
|
+
html: { icon: lucideReact.Globe, label: "HTML", color: "#fb923c" },
|
|
26948
|
+
svg: { icon: lucideReact.Globe, label: "SVG", color: "#fb923c" },
|
|
26949
|
+
markdown: { icon: lucideReact.FileText, label: "Markdown", color: "#60a5fa" },
|
|
26950
|
+
json: { icon: lucideReact.FileJson, label: "JSON", color: "#facc15" },
|
|
26951
|
+
code: { icon: lucideReact.FileCode, label: "Code", color: "#c084fc" },
|
|
26952
|
+
text: { icon: lucideReact.FileText, label: "Text", color: "#a1a1aa" },
|
|
26953
|
+
image: { icon: lucideReact.FileImage, label: "Image", color: "#4ade80" },
|
|
26954
|
+
video: { icon: lucideReact.Video, label: "Video", color: "#f472b6" }
|
|
26955
26955
|
};
|
|
26956
|
+
function FullscreenHtmlPreview({ content }) {
|
|
26957
|
+
const blobUrl = React16.useMemo(() => {
|
|
26958
|
+
const styleInjection = `
|
|
26959
|
+
<style>
|
|
26960
|
+
html, body { margin: 0; padding: 0; width: 100%; min-height: 100%; box-sizing: border-box; }
|
|
26961
|
+
* { box-sizing: border-box; }
|
|
26962
|
+
</style>`;
|
|
26963
|
+
let modified = content;
|
|
26964
|
+
if (content.includes("<head>")) {
|
|
26965
|
+
modified = content.replace("<head>", "<head>" + styleInjection);
|
|
26966
|
+
} else if (content.includes("<html>")) {
|
|
26967
|
+
modified = content.replace("<html>", "<html><head>" + styleInjection + "</head>");
|
|
26968
|
+
} else if (/<!(DOCTYPE|doctype)/i.test(content)) {
|
|
26969
|
+
modified = content.replace(/(<!DOCTYPE[^>]*>|<!doctype[^>]*>)/i, "$1<html><head>" + styleInjection + "</head><body>") + "</body></html>";
|
|
26970
|
+
} else {
|
|
26971
|
+
modified = `<!DOCTYPE html><html><head>${styleInjection}</head><body>${content}</body></html>`;
|
|
26972
|
+
}
|
|
26973
|
+
const blob = new Blob([modified], { type: "text/html" });
|
|
26974
|
+
return URL.createObjectURL(blob);
|
|
26975
|
+
}, [content]);
|
|
26976
|
+
React16.useEffect(() => {
|
|
26977
|
+
return () => URL.revokeObjectURL(blobUrl);
|
|
26978
|
+
}, [blobUrl]);
|
|
26979
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
26980
|
+
"iframe",
|
|
26981
|
+
{
|
|
26982
|
+
src: blobUrl,
|
|
26983
|
+
style: { display: "block", width: "100%", height: "100%", border: "none", background: "white" },
|
|
26984
|
+
sandbox: "allow-scripts allow-same-origin allow-popups allow-forms allow-modals",
|
|
26985
|
+
title: "HTML Preview"
|
|
26986
|
+
}
|
|
26987
|
+
);
|
|
26988
|
+
}
|
|
26956
26989
|
function PublicArtifactPage({ shareToken, onNavigateBack }) {
|
|
26957
26990
|
const [pageState, setPageState] = React16.useState("loading");
|
|
26958
26991
|
const [error, setError] = React16.useState(null);
|
|
26959
26992
|
const [artifact, setArtifact] = React16.useState(null);
|
|
26993
|
+
const [isTheaterMode, setIsTheaterMode] = React16.useState(false);
|
|
26994
|
+
const [isBrowserFullscreen, setIsBrowserFullscreen] = React16.useState(false);
|
|
26995
|
+
const [showTheaterControls, setShowTheaterControls] = React16.useState(true);
|
|
26996
|
+
const theaterTimerRef = React16.useRef(null);
|
|
26997
|
+
const isFullscreenSupported = typeof document !== "undefined" && typeof document.documentElement?.requestFullscreen === "function";
|
|
26960
26998
|
React16.useEffect(() => {
|
|
26961
26999
|
if (!shareToken) {
|
|
26962
27000
|
setPageState("not-found");
|
|
@@ -26980,31 +27018,13 @@ function PublicArtifactPage({ shareToken, onNavigateBack }) {
|
|
|
26980
27018
|
}
|
|
26981
27019
|
load();
|
|
26982
27020
|
}, [shareToken]);
|
|
26983
|
-
const handleShare = React16.useCallback(() => {
|
|
26984
|
-
const url = window.location.href;
|
|
26985
|
-
navigator.clipboard.writeText(url);
|
|
26986
|
-
toast.success("\u94FE\u63A5\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F");
|
|
26987
|
-
}, []);
|
|
26988
27021
|
const handleDownload = React16.useCallback(() => {
|
|
26989
27022
|
if (!artifact) return;
|
|
26990
|
-
const
|
|
26991
|
-
|
|
26992
|
-
|
|
26993
|
-
|
|
26994
|
-
|
|
26995
|
-
code: artifact.language || "txt",
|
|
26996
|
-
text: "txt"
|
|
26997
|
-
};
|
|
26998
|
-
const ext = extMap[artifact.type] || "txt";
|
|
26999
|
-
const mimeMap = {
|
|
27000
|
-
html: "text/html",
|
|
27001
|
-
svg: "image/svg+xml",
|
|
27002
|
-
markdown: "text/markdown",
|
|
27003
|
-
json: "application/json",
|
|
27004
|
-
code: "text/plain",
|
|
27005
|
-
text: "text/plain"
|
|
27006
|
-
};
|
|
27007
|
-
const mime = mimeMap[artifact.type] || "text/plain";
|
|
27023
|
+
const type = artifact.type?.toLowerCase() ?? "text";
|
|
27024
|
+
const extMap = { html: "html", svg: "svg", markdown: "md", json: "json", code: artifact.language || "txt", text: "txt" };
|
|
27025
|
+
const ext = extMap[type] || "txt";
|
|
27026
|
+
const mimeMap = { html: "text/html", svg: "image/svg+xml", markdown: "text/markdown", json: "application/json", code: "text/plain", text: "text/plain" };
|
|
27027
|
+
const mime = mimeMap[type] || "text/plain";
|
|
27008
27028
|
const blob = new Blob([artifact.content], { type: mime });
|
|
27009
27029
|
const url = URL.createObjectURL(blob);
|
|
27010
27030
|
const link2 = document.createElement("a");
|
|
@@ -27015,15 +27035,85 @@ function PublicArtifactPage({ shareToken, onNavigateBack }) {
|
|
|
27015
27035
|
document.body.removeChild(link2);
|
|
27016
27036
|
URL.revokeObjectURL(url);
|
|
27017
27037
|
}, [artifact]);
|
|
27038
|
+
const toggleTheaterMode = React16.useCallback(() => {
|
|
27039
|
+
setIsTheaterMode((prev) => !prev);
|
|
27040
|
+
setShowTheaterControls(true);
|
|
27041
|
+
}, []);
|
|
27042
|
+
const exitTheaterMode = React16.useCallback(() => {
|
|
27043
|
+
setIsTheaterMode(false);
|
|
27044
|
+
setShowTheaterControls(true);
|
|
27045
|
+
}, []);
|
|
27046
|
+
const toggleBrowserFullscreen = React16.useCallback(() => {
|
|
27047
|
+
if (!document.fullscreenElement) {
|
|
27048
|
+
document.documentElement.requestFullscreen().catch(() => {
|
|
27049
|
+
});
|
|
27050
|
+
} else {
|
|
27051
|
+
document.exitFullscreen().catch(() => {
|
|
27052
|
+
});
|
|
27053
|
+
}
|
|
27054
|
+
}, []);
|
|
27055
|
+
React16.useEffect(() => {
|
|
27056
|
+
const handleFullscreenChange = () => {
|
|
27057
|
+
const isFs = !!document.fullscreenElement;
|
|
27058
|
+
setIsBrowserFullscreen(isFs);
|
|
27059
|
+
if (isFs) {
|
|
27060
|
+
setIsTheaterMode(true);
|
|
27061
|
+
setShowTheaterControls(true);
|
|
27062
|
+
} else {
|
|
27063
|
+
setIsTheaterMode(false);
|
|
27064
|
+
}
|
|
27065
|
+
};
|
|
27066
|
+
document.addEventListener("fullscreenchange", handleFullscreenChange);
|
|
27067
|
+
return () => document.removeEventListener("fullscreenchange", handleFullscreenChange);
|
|
27068
|
+
}, []);
|
|
27069
|
+
React16.useEffect(() => {
|
|
27070
|
+
if (!isTheaterMode) return;
|
|
27071
|
+
const handleInteraction = () => {
|
|
27072
|
+
setShowTheaterControls(true);
|
|
27073
|
+
if (theaterTimerRef.current) clearTimeout(theaterTimerRef.current);
|
|
27074
|
+
theaterTimerRef.current = setTimeout(() => setShowTheaterControls(false), 3e3);
|
|
27075
|
+
};
|
|
27076
|
+
theaterTimerRef.current = setTimeout(() => setShowTheaterControls(false), 3e3);
|
|
27077
|
+
window.addEventListener("mousemove", handleInteraction);
|
|
27078
|
+
window.addEventListener("touchstart", handleInteraction);
|
|
27079
|
+
return () => {
|
|
27080
|
+
window.removeEventListener("mousemove", handleInteraction);
|
|
27081
|
+
window.removeEventListener("touchstart", handleInteraction);
|
|
27082
|
+
if (theaterTimerRef.current) clearTimeout(theaterTimerRef.current);
|
|
27083
|
+
};
|
|
27084
|
+
}, [isTheaterMode]);
|
|
27085
|
+
React16.useEffect(() => {
|
|
27086
|
+
const handleKeyDown = (e) => {
|
|
27087
|
+
const tag = e.target?.tagName;
|
|
27088
|
+
if (tag === "INPUT" || tag === "TEXTAREA" || tag === "SELECT") return;
|
|
27089
|
+
if (e.key === "Escape") {
|
|
27090
|
+
if (document.fullscreenElement) return;
|
|
27091
|
+
if (isTheaterMode) exitTheaterMode();
|
|
27092
|
+
return;
|
|
27093
|
+
}
|
|
27094
|
+
if ((e.key === "f" || e.key === "F") && !e.ctrlKey && !e.metaKey && !e.altKey) {
|
|
27095
|
+
e.preventDefault();
|
|
27096
|
+
if (isFullscreenSupported) toggleBrowserFullscreen();
|
|
27097
|
+
return;
|
|
27098
|
+
}
|
|
27099
|
+
if ((e.key === "t" || e.key === "T") && !e.ctrlKey && !e.metaKey && !e.altKey) {
|
|
27100
|
+
e.preventDefault();
|
|
27101
|
+
toggleTheaterMode();
|
|
27102
|
+
}
|
|
27103
|
+
};
|
|
27104
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
27105
|
+
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
27106
|
+
}, [isTheaterMode, isFullscreenSupported, exitTheaterMode, toggleBrowserFullscreen, toggleTheaterMode]);
|
|
27018
27107
|
const renderContent = () => {
|
|
27019
27108
|
if (!artifact) return null;
|
|
27020
27109
|
const content = artifact.content;
|
|
27021
|
-
|
|
27110
|
+
const type = artifact.type?.toLowerCase() ?? "text";
|
|
27111
|
+
switch (type) {
|
|
27022
27112
|
case "html":
|
|
27023
27113
|
case "svg":
|
|
27024
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27114
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FullscreenHtmlPreview, { content });
|
|
27025
27115
|
case "markdown":
|
|
27026
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-6 max-w-4xl mx-auto", children: /* @__PURE__ */ jsxRuntime.jsx(MarkdownPreview, { content }) });
|
|
27116
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "agent-sdk-theme", style: { background: "transparent", height: "100%", overflow: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-6 max-w-4xl mx-auto", children: /* @__PURE__ */ jsxRuntime.jsx(MarkdownPreview, { content }) }) });
|
|
27027
27117
|
case "image":
|
|
27028
27118
|
return /* @__PURE__ */ jsxRuntime.jsx(ImageArtifactPreview, { content });
|
|
27029
27119
|
case "video":
|
|
@@ -27032,73 +27122,90 @@ function PublicArtifactPage({ shareToken, onNavigateBack }) {
|
|
|
27032
27122
|
case "code":
|
|
27033
27123
|
case "text":
|
|
27034
27124
|
default:
|
|
27035
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
27036
|
-
CodeBlock3,
|
|
27037
|
-
{
|
|
27038
|
-
code: content,
|
|
27039
|
-
language: artifact.language || artifact.type
|
|
27040
|
-
}
|
|
27041
|
-
);
|
|
27125
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "agent-sdk-theme", style: { background: "transparent", height: "100%", overflow: "auto" }, children: /* @__PURE__ */ jsxRuntime.jsx(CodeBlock3, { code: content, language: artifact.language || type }) });
|
|
27042
27126
|
}
|
|
27043
27127
|
};
|
|
27044
27128
|
if (pageState === "loading") {
|
|
27045
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
27129
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { display: "flex", alignItems: "center", justifyContent: "center", height: "100vh", background: "#09090b" }, children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { size: 32, style: { color: "#d8ff00" }, className: "animate-spin" }) });
|
|
27046
27130
|
}
|
|
27047
27131
|
if (pageState === "not-found") {
|
|
27048
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
27049
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { size: 48,
|
|
27050
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", {
|
|
27051
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", {
|
|
27132
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: "100vh", background: "#09090b", gap: 16 }, children: [
|
|
27133
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { size: 48, style: { color: "#52525b" } }),
|
|
27134
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: { color: "#a1a1aa", fontSize: 18, margin: 0 }, children: "\u4EA7\u7269\u4E0D\u5B58\u5728\u6216\u5DF2\u8BBE\u4E3A\u79C1\u6709" }),
|
|
27135
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: { color: "#52525b", fontSize: 14, margin: 0 }, children: "\u8BF7\u68C0\u67E5\u94FE\u63A5\u662F\u5426\u6B63\u786E\uFF0C\u6216\u8054\u7CFB\u4F5C\u8005\u91CD\u65B0\u5206\u4EAB" }),
|
|
27052
27136
|
onNavigateBack && /* @__PURE__ */ jsxRuntime.jsx(
|
|
27053
27137
|
"button",
|
|
27054
27138
|
{
|
|
27055
27139
|
onClick: onNavigateBack,
|
|
27056
|
-
|
|
27140
|
+
style: { marginTop: 16, padding: "8px 16px", fontSize: 14, background: "#27272a", color: "white", border: "none", borderRadius: 8, cursor: "pointer" },
|
|
27057
27141
|
children: "\u8FD4\u56DE"
|
|
27058
27142
|
}
|
|
27059
27143
|
)
|
|
27060
27144
|
] });
|
|
27061
27145
|
}
|
|
27062
27146
|
if (pageState === "error") {
|
|
27063
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
27064
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { size: 48,
|
|
27065
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", {
|
|
27147
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", height: "100vh", background: "#09090b", gap: 16 }, children: [
|
|
27148
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { size: 48, style: { color: "#f87171" } }),
|
|
27149
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { style: { color: "#f87171", fontSize: 18, margin: 0 }, children: error || "\u52A0\u8F7D\u5931\u8D25" }),
|
|
27066
27150
|
onNavigateBack && /* @__PURE__ */ jsxRuntime.jsx(
|
|
27067
27151
|
"button",
|
|
27068
27152
|
{
|
|
27069
27153
|
onClick: onNavigateBack,
|
|
27070
|
-
|
|
27154
|
+
style: { marginTop: 16, padding: "8px 16px", fontSize: 14, background: "#27272a", color: "white", border: "none", borderRadius: 8, cursor: "pointer" },
|
|
27071
27155
|
children: "\u8FD4\u56DE"
|
|
27072
27156
|
}
|
|
27073
27157
|
)
|
|
27074
27158
|
] });
|
|
27075
27159
|
}
|
|
27076
27160
|
if (!artifact) return null;
|
|
27077
|
-
const
|
|
27161
|
+
const normalizedType = artifact.type?.toLowerCase() ?? "text";
|
|
27162
|
+
const config = typeConfig[normalizedType] || typeConfig.text;
|
|
27078
27163
|
const TypeIcon = config.icon;
|
|
27079
|
-
const canDownload = ["html", "svg", "markdown", "json", "code", "text"].includes(
|
|
27080
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
27081
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
27082
|
-
|
|
27164
|
+
const canDownload = ["html", "svg", "markdown", "json", "code", "text"].includes(normalizedType);
|
|
27165
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", flexDirection: "column", height: "100vh", background: "#09090b" }, children: [
|
|
27166
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: {
|
|
27167
|
+
display: "flex",
|
|
27168
|
+
alignItems: "center",
|
|
27169
|
+
justifyContent: "space-between",
|
|
27170
|
+
padding: isTheaterMode ? "0 16px" : "10px 16px",
|
|
27171
|
+
maxHeight: isTheaterMode ? 0 : 200,
|
|
27172
|
+
overflow: "hidden",
|
|
27173
|
+
opacity: isTheaterMode ? 0 : 1,
|
|
27174
|
+
borderBottom: isTheaterMode ? "none" : "1px solid rgba(39, 39, 42, 0.5)",
|
|
27175
|
+
background: "rgba(9, 9, 11, 0.8)",
|
|
27176
|
+
backdropFilter: "blur(8px)",
|
|
27177
|
+
flexShrink: 0,
|
|
27178
|
+
transition: "max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease"
|
|
27179
|
+
}, children: [
|
|
27180
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 12, minWidth: 0 }, children: [
|
|
27083
27181
|
onNavigateBack && /* @__PURE__ */ jsxRuntime.jsx(
|
|
27084
27182
|
"button",
|
|
27085
27183
|
{
|
|
27086
27184
|
onClick: onNavigateBack,
|
|
27087
|
-
|
|
27185
|
+
style: { padding: 6, color: "#a1a1aa", background: "none", border: "none", borderRadius: 8, cursor: "pointer", flexShrink: 0 },
|
|
27088
27186
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowLeft, { size: 18 })
|
|
27089
27187
|
}
|
|
27090
27188
|
),
|
|
27091
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
27092
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
27093
|
-
|
|
27094
|
-
|
|
27095
|
-
|
|
27096
|
-
|
|
27097
|
-
|
|
27189
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 10, minWidth: 0 }, children: [
|
|
27190
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: {
|
|
27191
|
+
width: 28,
|
|
27192
|
+
height: 28,
|
|
27193
|
+
borderRadius: 8,
|
|
27194
|
+
display: "flex",
|
|
27195
|
+
alignItems: "center",
|
|
27196
|
+
justifyContent: "center",
|
|
27197
|
+
flexShrink: 0,
|
|
27198
|
+
background: `color-mix(in srgb, ${config.color} 15%, transparent)`
|
|
27199
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsx(TypeIcon, { size: 14, style: { color: config.color } }) }),
|
|
27200
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { minWidth: 0 }, children: [
|
|
27201
|
+
/* @__PURE__ */ jsxRuntime.jsx("h1", { style: { fontSize: 14, fontWeight: 500, color: "white", margin: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: artifact.title }),
|
|
27202
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 10, fontSize: 11, color: "#71717a", marginTop: 2 }, children: [
|
|
27203
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: config.color }, children: config.label }),
|
|
27204
|
+
artifact.sharedAt && /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
27098
27205
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Calendar, { size: 10 }),
|
|
27099
27206
|
new Date(artifact.sharedAt).toLocaleDateString()
|
|
27100
27207
|
] }),
|
|
27101
|
-
artifact.viewCount !== void 0 && artifact.viewCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", {
|
|
27208
|
+
artifact.viewCount !== void 0 && artifact.viewCount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("span", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
27102
27209
|
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Eye, { size: 10 }),
|
|
27103
27210
|
artifact.viewCount
|
|
27104
27211
|
] })
|
|
@@ -27106,29 +27213,120 @@ function PublicArtifactPage({ shareToken, onNavigateBack }) {
|
|
|
27106
27213
|
] })
|
|
27107
27214
|
] })
|
|
27108
27215
|
] }),
|
|
27109
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
27110
|
-
|
|
27216
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 4 }, children: [
|
|
27217
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
27111
27218
|
"button",
|
|
27112
27219
|
{
|
|
27113
|
-
onClick:
|
|
27114
|
-
|
|
27115
|
-
title: "\
|
|
27116
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.
|
|
27220
|
+
onClick: toggleTheaterMode,
|
|
27221
|
+
style: { padding: 8, color: "#a1a1aa", background: "none", border: "none", borderRadius: 8, cursor: "pointer" },
|
|
27222
|
+
title: "\u6C89\u6D78\u6A21\u5F0F (T)",
|
|
27223
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MonitorPlay, { size: 16 })
|
|
27117
27224
|
}
|
|
27118
27225
|
),
|
|
27119
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
27226
|
+
isFullscreenSupported && /* @__PURE__ */ jsxRuntime.jsx(
|
|
27120
27227
|
"button",
|
|
27121
27228
|
{
|
|
27122
|
-
onClick:
|
|
27123
|
-
|
|
27124
|
-
title: "\
|
|
27125
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.
|
|
27229
|
+
onClick: toggleBrowserFullscreen,
|
|
27230
|
+
style: { padding: 8, color: "#a1a1aa", background: "none", border: "none", borderRadius: 8, cursor: "pointer" },
|
|
27231
|
+
title: isBrowserFullscreen ? "\u9000\u51FA\u5168\u5C4F (F)" : "\u5168\u5C4F (F)",
|
|
27232
|
+
children: isBrowserFullscreen ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Minimize2, { size: 16 }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Maximize2, { size: 16 })
|
|
27233
|
+
}
|
|
27234
|
+
),
|
|
27235
|
+
canDownload && /* @__PURE__ */ jsxRuntime.jsx(
|
|
27236
|
+
"button",
|
|
27237
|
+
{
|
|
27238
|
+
onClick: handleDownload,
|
|
27239
|
+
style: { padding: 8, color: "#a1a1aa", background: "none", border: "none", borderRadius: 8, cursor: "pointer" },
|
|
27240
|
+
title: "\u4E0B\u8F7D",
|
|
27241
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Download, { size: 16 })
|
|
27126
27242
|
}
|
|
27127
27243
|
)
|
|
27128
27244
|
] })
|
|
27129
27245
|
] }),
|
|
27130
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
27131
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
27246
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1, overflow: "hidden" }, children: renderContent() }),
|
|
27247
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { style: {
|
|
27248
|
+
display: "flex",
|
|
27249
|
+
alignItems: "center",
|
|
27250
|
+
justifyContent: "center",
|
|
27251
|
+
padding: isTheaterMode ? "0" : "8px 0",
|
|
27252
|
+
maxHeight: isTheaterMode ? 0 : 50,
|
|
27253
|
+
overflow: "hidden",
|
|
27254
|
+
opacity: isTheaterMode ? 0 : 1,
|
|
27255
|
+
borderTop: isTheaterMode ? "none" : "1px solid rgba(39, 39, 42, 0.3)",
|
|
27256
|
+
background: "rgba(9, 9, 11, 0.5)",
|
|
27257
|
+
flexShrink: 0,
|
|
27258
|
+
transition: "max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease"
|
|
27259
|
+
}, children: /* @__PURE__ */ jsxRuntime.jsx("span", { style: { fontSize: 10, color: "#52525b" }, children: "Powered by BISHAN Agent" }) }),
|
|
27260
|
+
isTheaterMode && /* @__PURE__ */ jsxRuntime.jsx(
|
|
27261
|
+
"div",
|
|
27262
|
+
{
|
|
27263
|
+
onMouseEnter: () => setShowTheaterControls(true),
|
|
27264
|
+
style: {
|
|
27265
|
+
position: "fixed",
|
|
27266
|
+
top: 0,
|
|
27267
|
+
left: 0,
|
|
27268
|
+
right: 0,
|
|
27269
|
+
height: 40,
|
|
27270
|
+
zIndex: 99
|
|
27271
|
+
}
|
|
27272
|
+
}
|
|
27273
|
+
),
|
|
27274
|
+
isTheaterMode && /* @__PURE__ */ jsxRuntime.jsxs("div", { style: {
|
|
27275
|
+
position: "fixed",
|
|
27276
|
+
top: 16,
|
|
27277
|
+
right: 16,
|
|
27278
|
+
zIndex: 100,
|
|
27279
|
+
display: "flex",
|
|
27280
|
+
alignItems: "center",
|
|
27281
|
+
gap: 8,
|
|
27282
|
+
opacity: showTheaterControls ? 1 : 0,
|
|
27283
|
+
transform: showTheaterControls ? "translateY(0)" : "translateY(-8px)",
|
|
27284
|
+
transition: "opacity 0.3s ease, transform 0.3s ease",
|
|
27285
|
+
pointerEvents: showTheaterControls ? "auto" : "none"
|
|
27286
|
+
}, children: [
|
|
27287
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
27288
|
+
"button",
|
|
27289
|
+
{
|
|
27290
|
+
onClick: exitTheaterMode,
|
|
27291
|
+
style: {
|
|
27292
|
+
display: "flex",
|
|
27293
|
+
alignItems: "center",
|
|
27294
|
+
gap: 6,
|
|
27295
|
+
padding: "8px 12px",
|
|
27296
|
+
background: "rgba(39, 39, 42, 0.9)",
|
|
27297
|
+
backdropFilter: "blur(8px)",
|
|
27298
|
+
border: "1px solid rgba(63, 63, 70, 0.5)",
|
|
27299
|
+
borderRadius: 8,
|
|
27300
|
+
color: "#a1a1aa",
|
|
27301
|
+
fontSize: 12,
|
|
27302
|
+
cursor: "pointer",
|
|
27303
|
+
whiteSpace: "nowrap"
|
|
27304
|
+
},
|
|
27305
|
+
title: "\u9000\u51FA\u6C89\u6D78\u6A21\u5F0F (ESC)",
|
|
27306
|
+
children: [
|
|
27307
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { size: 14 }),
|
|
27308
|
+
"\u9000\u51FA\u6C89\u6D78"
|
|
27309
|
+
]
|
|
27310
|
+
}
|
|
27311
|
+
),
|
|
27312
|
+
isFullscreenSupported && /* @__PURE__ */ jsxRuntime.jsx(
|
|
27313
|
+
"button",
|
|
27314
|
+
{
|
|
27315
|
+
onClick: toggleBrowserFullscreen,
|
|
27316
|
+
style: {
|
|
27317
|
+
padding: 8,
|
|
27318
|
+
background: "rgba(39, 39, 42, 0.9)",
|
|
27319
|
+
backdropFilter: "blur(8px)",
|
|
27320
|
+
border: "1px solid rgba(63, 63, 70, 0.5)",
|
|
27321
|
+
borderRadius: 8,
|
|
27322
|
+
color: "#a1a1aa",
|
|
27323
|
+
cursor: "pointer"
|
|
27324
|
+
},
|
|
27325
|
+
title: isBrowserFullscreen ? "\u9000\u51FA\u5168\u5C4F (F)" : "\u5168\u5C4F (F)",
|
|
27326
|
+
children: isBrowserFullscreen ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Minimize2, { size: 14 }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Maximize2, { size: 14 })
|
|
27327
|
+
}
|
|
27328
|
+
)
|
|
27329
|
+
] })
|
|
27132
27330
|
] });
|
|
27133
27331
|
}
|
|
27134
27332
|
var AgentSDKProvider = ({
|