// download-page.jsx - standalone download and changelog page. const DEFAULT_RELEASE_INFO = { current: { version: "v0.1.3", channel: "公测版", date: "2024-05-28", summary: "本次更新进一步提升了长篇写作体验与稳定性,并增强了本地保存与恢复能力。", sections: [ { title: "新增", items: [ "本地项目保存:支持完整离线编辑与本地备份。", "自动恢复:在异常退出后可恢复未保存的编辑内容。", "桌面下载中心:内置下载与安装管理,更新更便捷。", ], }, { title: "优化", items: [ "大纲切换速度:大幅提升大纲视图与文档之间的切换效率。", "设置面板加载体验:优化加载流程,开启设置更顺畅。", "长篇工程稳定性:优化内存占用,提升超长文档编辑稳定性。", ], }, { title: "修复", items: [ "修复部分情况下同步失败的问题。", "修复 Windows 安装路径包含特殊字符时的安装问题。", "修复在部分字体缺失时,段落显示异常的问题。", ], }, ], }, history: [ { version: "v0.7.9", tag: "稳定版", date: "2024-04-16", note: "优化导出体验,修复部分已知问题。" }, { version: "v0.7.8", tag: "稳定版", date: "2024-03-21", note: "改进多端同步稳定性,优化编辑器性能。" }, { version: "v0.7.6", tag: "稳定版", date: "2024-02-02", note: "新增夜间模式,改进大纲与卡片视图。" }, ], releases: [ { os: "Windows", name: "x64 安装包", size: "296 MB", ext: "exe", href: "https://novel-studio-releases-1345572211.cos.ap-shanghai.myqcloud.com/desktop/Novel-Studio-Setup-0.1.3-x64.exe" }, ], plannedPlatforms: [ { os: "macOS", note: "桌面端规划中,优先补齐签名、公证与自动更新链路。" }, { os: "Linux", note: "桌面端规划中,后续按 AppImage / 包管理分发节奏推进。" }, ], releaseAllHref: "/download/#changelog", }; function normalizeReleaseInfo(payload) { const info = payload && typeof payload === "object" ? payload : {}; return { current: { ...DEFAULT_RELEASE_INFO.current, ...(info.current || {}), sections: Array.isArray(info.current?.sections) && info.current.sections.length > 0 ? info.current.sections : DEFAULT_RELEASE_INFO.current.sections, }, history: Array.isArray(info.history) && info.history.length > 0 ? info.history : DEFAULT_RELEASE_INFO.history, releases: Array.isArray(info.releases) && info.releases.length > 0 ? info.releases : DEFAULT_RELEASE_INFO.releases, plannedPlatforms: Array.isArray(info.plannedPlatforms) ? info.plannedPlatforms : DEFAULT_RELEASE_INFO.plannedPlatforms, releaseAllHref: info.releaseAllHref || DEFAULT_RELEASE_INFO.releaseAllHref, }; } function ChangeLogDrawer({ open, onClose, releaseInfo }) { const current = releaseInfo.current; React.useEffect(() => { if (!open) return undefined; const onKeyDown = (event) => { if (event.key === "Escape") onClose(); }; document.addEventListener("keydown", onKeyDown); document.body.classList.add("changelog-open"); return () => { document.removeEventListener("keydown", onKeyDown); document.body.classList.remove("changelog-open"); }; }, [open, onClose]); return (

更新日志

笔随 Novel Studio 的版本更新记录

当前版本

{current.version} · {current.channel}

{current.summary}

{current.sections.map((section) => (

{section.title}

    {section.items.map((item) =>
  • {item}
  • )}
))}

版本历史

{releaseInfo.history.map((entry) => ( {entry.version} · {entry.tag} {entry.note} ))}
查看下载与更新中心
); } function Trait({ label, text, icon }) { return (
{label} {text}
); } function DownloadPage() { const copy = (window.COPY || {}).zh; const [changelogOpen, setChangelogOpen] = React.useState(false); const [releaseInfo, setReleaseInfo] = React.useState(DEFAULT_RELEASE_INFO); React.useEffect(() => { let cancelled = false; fetch("/release-info.json", { cache: "no-store" }) .then((response) => (response.ok ? response.json() : null)) .then((data) => { if (!cancelled && data) setReleaseInfo(normalizeReleaseInfo(data)); }) .catch(() => {}); return () => { cancelled = true; }; }, []); if (!copy) return
Loading...
; const current = releaseInfo.current; const desktopReleaseHead = `桌面客户端 · ${current.version}`; const releaseCards = releaseInfo.releases.length > 0 ? releaseInfo.releases : copy.cta.releases; const primaryDownloadHref = releaseCards[0]?.href || "/download/#desktop"; const latestPreviewSections = current.sections.map((section) => ({ ...section, previewItems: section.items.slice(0, 2), hiddenCount: Math.max(0, section.items.length - 2), })); return (
); } ReactDOM.createRoot(document.getElementById("root")).render();