From 058336c0ea59314fea6a05115ccdc8d80682e7ad Mon Sep 17 00:00:00 2001 From: cloudneutral Date: Sun, 14 Dec 2025 14:39:17 +0800 Subject: [PATCH] Add vendored neurapress editor shell (#779) --- README.md | 5 + dashboard/src/app/dashboard/cms/page.tsx | 7 + dashboard/src/app/editor/page.tsx | 6 + dashboard/src/components/Navbar.tsx | 22 ++ .../dashboard/apps/cms-editor/EditorShell.tsx | 299 ++++++++++++++++++ .../src/dashboard/apps/cms-editor/README.md | 18 ++ .../apps/cms-editor/storage/index.ts | 25 ++ .../apps/cms-editor/storage/local.ts | 75 +++++ .../apps/cms-editor/storage/remote.ts | 16 + dashboard/vendor/neurapress/LICENSE | 21 ++ dashboard/vendor/neurapress/NOTICE | 10 + dashboard/vendor/neurapress/src/index.ts | 14 + 12 files changed, 518 insertions(+) create mode 100644 dashboard/src/app/dashboard/cms/page.tsx create mode 100644 dashboard/src/app/editor/page.tsx create mode 100644 dashboard/src/dashboard/apps/cms-editor/EditorShell.tsx create mode 100644 dashboard/src/dashboard/apps/cms-editor/README.md create mode 100644 dashboard/src/dashboard/apps/cms-editor/storage/index.ts create mode 100644 dashboard/src/dashboard/apps/cms-editor/storage/local.ts create mode 100644 dashboard/src/dashboard/apps/cms-editor/storage/remote.ts create mode 100644 dashboard/vendor/neurapress/LICENSE create mode 100644 dashboard/vendor/neurapress/NOTICE create mode 100644 dashboard/vendor/neurapress/src/index.ts diff --git a/README.md b/README.md index db971fb..e3908f5 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,11 @@ This repository contains the API server, agent code and a Next.js-based UI. - **ui-panel** - **xcontrol-cli** - **xcontrol-server** +- **markdown studio** (NeuraPress-based, MIT-licensed) available at `/editor` (public) + and `/dashboard/cms` (SaaS shell). The upstream license and NOTICE live under + `dashboard/vendor/neurapress`, keeping attribution to + [tianyaxiang](https://github.com/tianyaxiang/neurapress). + All UI components provide both Chinese and English interfaces. diff --git a/dashboard/src/app/dashboard/cms/page.tsx b/dashboard/src/app/dashboard/cms/page.tsx new file mode 100644 index 0000000..495cbae --- /dev/null +++ b/dashboard/src/app/dashboard/cms/page.tsx @@ -0,0 +1,7 @@ +import EditorShell from '../../../dashboard/apps/cms-editor/EditorShell' +import { localDraftStore } from '../../../dashboard/apps/cms-editor/storage/local' +import { remoteDraftStore } from '../../../dashboard/apps/cms-editor/storage/remote' + +export default function CmsEditorDashboardPage() { + return +} diff --git a/dashboard/src/app/editor/page.tsx b/dashboard/src/app/editor/page.tsx new file mode 100644 index 0000000..fb893f8 --- /dev/null +++ b/dashboard/src/app/editor/page.tsx @@ -0,0 +1,6 @@ +import EditorShell from '../../dashboard/apps/cms-editor/EditorShell' +import { localDraftStore } from '../../dashboard/apps/cms-editor/storage/local' + +export default function EditorPage() { + return +} diff --git a/dashboard/src/components/Navbar.tsx b/dashboard/src/components/Navbar.tsx index 27e1f8d..1c993a8 100644 --- a/dashboard/src/components/Navbar.tsx +++ b/dashboard/src/components/Navbar.tsx @@ -234,6 +234,7 @@ export default function Navbar() { docs: isChinese ? '文档' : 'Docs', download: isChinese ? '下载' : 'Download', openSource: isChinese ? '开源项目' : 'Open source', + editor: isChinese ? '编辑器' : 'Editor', moreServices: isChinese ? '更多服务' : 'More services', } @@ -274,6 +275,12 @@ export default function Navbar() { const downloadLink = { key: 'download', label: labels.download, href: '/download' } + const editorLink = { + key: 'editor', + label: labels.editor, + href: '/editor', + } + const openSourceProjects = [ { key: 'xstream', label: 'XStream', href: '/xstream' }, { key: 'xcloudflow', label: 'XCloudFlow', href: '/xcloudflow' }, @@ -350,6 +357,13 @@ export default function Navbar() { ))} + + {editorLink.label} + {serviceItems.length > 0 ? (
+
+ + +
+
+
+
+
+
+ {isChinese ? '草稿箱' : 'Drafts'} + Local +
+
+