From 42ad3f83364c309376402deec604548b1954f5d9 Mon Sep 17 00:00:00 2001 From: MT-Fire <798521692@qq.com> Date: Sat, 28 Mar 2026 22:23:00 +0800 Subject: [PATCH] merge(frontend): sync frontend files from github/main into feat/originui-frontend-integration --- frontend/.gitignore | 2 - frontend/.vscode/settings.json | 66 +- frontend/AGENTS.md | 6 + frontend/Dockerfile | 55 +- frontend/Dockerfile.prod | 18 - frontend/README.md | 12 +- frontend/package.json | 11 +- frontend/pnpm-lock.yaml | 940 +++++++----------- frontend/pnpm-workspace.yaml | 1 + frontend/src/app/layout.tsx | 13 +- frontend/src/app/mock/api/models/route.ts | 4 + .../src/app/mock/api/threads/search/route.ts | 77 +- .../[agent_name]/chats/[thread_id]/layout.tsx | 19 + .../[agent_name]/chats/[thread_id]/page.tsx | 191 ++++ .../src/app/workspace/agents/new/page.tsx | 252 +++++ frontend/src/app/workspace/agents/page.tsx | 5 + .../app/workspace/chats/[thread_id]/page.tsx | 610 ++---------- frontend/src/app/workspace/layout.tsx | 42 +- .../src/components/ai-elements/artifact.tsx | 19 +- .../ai-elements/chain-of-thought.tsx | 8 +- .../src/components/ai-elements/checkpoint.tsx | 5 +- .../src/components/ai-elements/code-block.tsx | 13 +- .../src/components/ai-elements/context.tsx | 10 +- .../src/components/ai-elements/controls.tsx | 6 +- .../components/ai-elements/conversation.tsx | 4 +- frontend/src/components/ai-elements/edge.tsx | 10 +- frontend/src/components/ai-elements/image.tsx | 2 +- .../src/components/ai-elements/loader.tsx | 2 +- .../src/components/ai-elements/message.tsx | 15 +- frontend/src/components/ai-elements/node.tsx | 6 +- frontend/src/components/ai-elements/panel.tsx | 4 +- .../components/ai-elements/prompt-input.tsx | 244 ++--- frontend/src/components/ai-elements/queue.tsx | 32 +- .../src/components/ai-elements/reasoning.tsx | 27 +- .../src/components/ai-elements/shimmer.tsx | 8 +- .../src/components/ai-elements/sources.tsx | 6 +- .../src/components/ai-elements/suggestion.tsx | 8 +- frontend/src/components/ai-elements/task.tsx | 12 +- .../src/components/ai-elements/toolbar.tsx | 4 +- .../components/ai-elements/web-preview.tsx | 16 +- .../landing/sections/case-study-section.tsx | 2 +- frontend/src/components/ui/alert.tsx | 22 +- frontend/src/components/ui/aurora-text.tsx | 26 +- frontend/src/components/ui/avatar.tsx | 20 +- frontend/src/components/ui/badge.tsx | 18 +- frontend/src/components/ui/breadcrumb.tsx | 30 +- frontend/src/components/ui/button-group.tsx | 28 +- frontend/src/components/ui/button.tsx | 2 +- frontend/src/components/ui/card.tsx | 30 +- frontend/src/components/ui/carousel.tsx | 136 +-- frontend/src/components/ui/command.tsx | 52 +- frontend/src/components/ui/dev-dialog.tsx | 148 --- frontend/src/components/ui/dialog.tsx | 40 +- frontend/src/components/ui/dropdown-menu.tsx | 74 +- .../src/components/ui/dropdown-selector.tsx | 106 -- frontend/src/components/ui/empty.tsx | 30 +- frontend/src/components/ui/galaxy.jsx | 25 +- frontend/src/components/ui/hover-card.tsx | 18 +- frontend/src/components/ui/input-group.tsx | 10 +- frontend/src/components/ui/item.tsx | 52 +- frontend/src/components/ui/magic-bento.css | 4 +- frontend/src/components/ui/progress.tsx | 14 +- frontend/src/components/ui/resizable.tsx | 2 +- frontend/src/components/ui/scroll-area.tsx | 16 +- frontend/src/components/ui/separator.tsx | 14 +- frontend/src/components/ui/sheet.tsx | 38 +- frontend/src/components/ui/shine-border.tsx | 16 +- frontend/src/components/ui/sidebar.tsx | 5 +- frontend/src/components/ui/skeleton.tsx | 6 +- frontend/src/components/ui/sonner.tsx | 26 +- frontend/src/components/ui/spotlight-card.css | 8 +- frontend/src/components/ui/switch.tsx | 16 +- frontend/src/components/ui/tabs.tsx | 28 +- frontend/src/components/ui/toggle-group.tsx | 4 +- frontend/src/components/ui/toggle.tsx | 18 +- frontend/src/components/ui/tooltip.tsx | 2 +- .../components/workspace/agent-welcome.tsx | 36 + .../workspace/agents/agent-card.tsx | 140 +++ .../workspace/agents/agent-gallery.tsx | 69 ++ .../artifacts/artifact-file-detail.tsx | 555 ++--------- .../artifacts/artifact-file-list.tsx | 12 +- .../workspace/artifacts/artifact-trigger.tsx | 30 + .../workspace/artifacts/context.tsx | 41 +- .../components/workspace/artifacts/index.ts | 1 + .../components/workspace/chats/chat-box.tsx | 180 ++++ .../src/components/workspace/chats/index.ts | 3 + .../workspace/{ => chats}/use-chat-mode.ts | 3 +- .../workspace/chats/use-thread-chat.ts | 29 + .../workspace/citations/artifact-link.tsx | 33 + .../workspace/citations/citation-link.tsx | 12 +- .../src/components/workspace/code-editor.tsx | 4 - .../components/workspace/command-palette.tsx | 130 +++ .../src/components/workspace/copy-button.tsx | 3 +- .../components/workspace/dev-todo-list.tsx | 69 -- .../components/workspace/export-trigger.tsx | 81 ++ .../workspace/iframe-test-panel.tsx | 270 ----- .../src/components/workspace/input-box.tsx | 882 ++++++++++------ .../components/workspace/messages/context.ts | 6 +- .../workspace/messages/markdown-content.tsx | 20 +- .../workspace/messages/message-group.tsx | 2 +- .../workspace/messages/message-list-item.tsx | 242 +++-- .../workspace/messages/message-list.tsx | 38 +- .../components/workspace/mode-hover-guide.tsx | 5 +- .../components/workspace/recent-chat-list.tsx | 72 +- .../components/workspace/settings/about.md | 3 - .../settings/appearance-settings-page.tsx | 8 +- .../src/components/workspace/thread-title.tsx | 45 +- .../src/components/workspace/todo-list.tsx | 19 +- .../workspace/token-usage-indicator.tsx | 74 ++ frontend/src/components/workspace/welcome.tsx | 22 +- .../workspace/workspace-nav-chat-list.tsx | 13 +- frontend/src/core/agents/api.ts | 67 ++ frontend/src/core/agents/hooks.ts | 64 ++ frontend/src/core/agents/index.ts | 3 + frontend/src/core/agents/types.ts | 22 + frontend/src/core/api/api-client.ts | 41 +- frontend/src/core/api/stream-mode.test.ts | 43 + frontend/src/core/api/stream-mode.ts | 68 ++ frontend/src/core/artifacts/hooks.ts | 7 +- frontend/src/core/artifacts/loader.ts | 8 +- frontend/src/core/artifacts/utils.ts | 5 + frontend/src/core/config/index.ts | 25 +- frontend/src/core/i18n/hooks.ts | 27 +- frontend/src/core/i18n/index.ts | 28 +- frontend/src/core/i18n/locale.ts | 36 + frontend/src/core/i18n/locales/en-US.ts | 57 +- frontend/src/core/i18n/locales/types.ts | 32 +- frontend/src/core/i18n/locales/zh-CN.ts | 71 +- frontend/src/core/i18n/server.ts | 14 +- frontend/src/core/iframe-messages.ts | 59 -- frontend/src/core/mcp/api.ts | 14 +- frontend/src/core/messages/usage.ts | 62 ++ frontend/src/core/messages/utils.ts | 284 +++--- frontend/src/core/models/api.ts | 4 +- frontend/src/core/models/hooks.ts | 1 + frontend/src/core/models/types.ts | 2 + frontend/src/core/settings/hooks.ts | 11 +- frontend/src/core/settings/local.ts | 2 + frontend/src/core/skills/api.ts | 80 -- frontend/src/core/threads/export.ts | 142 +++ frontend/src/core/threads/hooks.ts | 598 ++++++++--- frontend/src/core/threads/types.ts | 7 +- frontend/src/core/threads/utils.ts | 16 +- frontend/src/core/uploads/api.ts | 26 +- .../core/utils/markdown-download/converter.ts | 464 --------- .../src/core/utils/markdown-download/index.ts | 47 - .../use-markdown-download.ts | 127 --- frontend/src/hooks/use-global-shortcuts.ts | 53 + frontend/src/hooks/use-iframe-skill.ts | 78 -- frontend/src/hooks/use-mobile.ts | 24 +- .../src/hooks/use-selected-skill-listener.ts | 152 --- frontend/src/lib/utils.ts | 69 -- frontend/src/styles/globals.css | 81 +- 153 files changed, 4914 insertions(+), 5130 deletions(-) delete mode 100644 frontend/Dockerfile.prod create mode 100644 frontend/src/app/workspace/agents/[agent_name]/chats/[thread_id]/layout.tsx create mode 100644 frontend/src/app/workspace/agents/[agent_name]/chats/[thread_id]/page.tsx create mode 100644 frontend/src/app/workspace/agents/new/page.tsx create mode 100644 frontend/src/app/workspace/agents/page.tsx delete mode 100644 frontend/src/components/ui/dev-dialog.tsx delete mode 100644 frontend/src/components/ui/dropdown-selector.tsx create mode 100644 frontend/src/components/workspace/agent-welcome.tsx create mode 100644 frontend/src/components/workspace/agents/agent-card.tsx create mode 100644 frontend/src/components/workspace/agents/agent-gallery.tsx create mode 100644 frontend/src/components/workspace/artifacts/artifact-trigger.tsx create mode 100644 frontend/src/components/workspace/chats/chat-box.tsx create mode 100644 frontend/src/components/workspace/chats/index.ts rename frontend/src/components/workspace/{ => chats}/use-chat-mode.ts (91%) create mode 100644 frontend/src/components/workspace/chats/use-thread-chat.ts create mode 100644 frontend/src/components/workspace/citations/artifact-link.tsx create mode 100644 frontend/src/components/workspace/command-palette.tsx delete mode 100644 frontend/src/components/workspace/dev-todo-list.tsx create mode 100644 frontend/src/components/workspace/export-trigger.tsx delete mode 100644 frontend/src/components/workspace/iframe-test-panel.tsx create mode 100644 frontend/src/components/workspace/token-usage-indicator.tsx create mode 100644 frontend/src/core/agents/api.ts create mode 100644 frontend/src/core/agents/hooks.ts create mode 100644 frontend/src/core/agents/index.ts create mode 100644 frontend/src/core/agents/types.ts create mode 100644 frontend/src/core/api/stream-mode.test.ts create mode 100644 frontend/src/core/api/stream-mode.ts create mode 100644 frontend/src/core/i18n/locale.ts delete mode 100644 frontend/src/core/iframe-messages.ts create mode 100644 frontend/src/core/messages/usage.ts create mode 100644 frontend/src/core/threads/export.ts delete mode 100644 frontend/src/core/utils/markdown-download/converter.ts delete mode 100644 frontend/src/core/utils/markdown-download/index.ts delete mode 100644 frontend/src/core/utils/markdown-download/use-markdown-download.ts create mode 100644 frontend/src/hooks/use-global-shortcuts.ts delete mode 100644 frontend/src/hooks/use-iframe-skill.ts delete mode 100644 frontend/src/hooks/use-selected-skill-listener.ts diff --git a/frontend/.gitignore b/frontend/.gitignore index 1a0009e8..c24a8359 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -21,8 +21,6 @@ next-env.d.ts # production /build -docs - # misc .DS_Store *.pem diff --git a/frontend/.vscode/settings.json b/frontend/.vscode/settings.json index f06ac9c4..19bd6ebc 100644 --- a/frontend/.vscode/settings.json +++ b/frontend/.vscode/settings.json @@ -1,67 +1,3 @@ { - "window.title": "${activeEditorShort}${separator}${separator}deer-flow/frontend", - "todo-tree.regex.regex": "((%|#|//|