@lobehub/lobehub 2.0.0-next.72 → 2.0.0-next.74
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/.github/workflows/desktop-pr-build.yml +7 -3
- package/CHANGELOG.md +50 -0
- package/apps/desktop/package.json +1 -0
- package/apps/desktop/src/main/controllers/LocalFileCtr.ts +55 -11
- package/apps/desktop/src/main/controllers/__tests__/LocalFileCtr.test.ts +153 -0
- package/changelog/v1.json +18 -0
- package/locales/en-US/tool.json +12 -1
- package/locales/zh-CN/tool.json +12 -1
- package/next.config.ts +5 -5
- package/package.json +2 -1
- package/packages/electron-client-ipc/src/types/localSystem.ts +4 -0
- package/scripts/prebuild.mts +16 -6
- package/src/app/(backend)/trpc/desktop/[trpc]/route.ts +6 -6
- package/src/app/[variants]/(main)/(mobile)/me/(home)/__tests__/UserBanner.test.tsx +7 -4
- package/src/app/[variants]/(main)/(mobile)/me/(home)/__tests__/useCategory.test.tsx +4 -4
- package/src/app/[variants]/(main)/(mobile)/me/(home)/features/UserBanner.tsx +5 -6
- package/src/app/[variants]/(main)/(mobile)/me/(home)/features/useCategory.tsx +5 -8
- package/src/app/[variants]/(main)/(mobile)/me/(home)/index.tsx +25 -0
- package/src/app/[variants]/(main)/(mobile)/me/(home)/layout.tsx +13 -16
- package/src/app/[variants]/(main)/(mobile)/me/profile/features/Category.tsx +6 -6
- package/src/app/[variants]/(main)/(mobile)/me/profile/features/Header.tsx +3 -3
- package/src/app/[variants]/(main)/(mobile)/me/profile/index.tsx +16 -0
- package/src/app/[variants]/(main)/(mobile)/me/profile/layout.tsx +9 -11
- package/src/app/[variants]/(main)/(mobile)/me/settings/features/Header.tsx +3 -3
- package/src/app/[variants]/(main)/(mobile)/me/settings/features/useCategory.tsx +3 -4
- package/src/app/[variants]/(main)/(mobile)/me/settings/index.tsx +16 -0
- package/src/app/[variants]/(main)/(mobile)/me/settings/layout.tsx +15 -13
- package/src/app/[variants]/(main)/changelog/_layout/Desktop/index.tsx +6 -5
- package/src/app/[variants]/(main)/changelog/_layout/Mobile/Header.tsx +3 -3
- package/src/app/[variants]/(main)/changelog/_layout/Mobile/index.tsx +5 -5
- package/src/app/[variants]/(main)/changelog/features/Post.tsx +7 -4
- package/src/app/[variants]/(main)/changelog/index.tsx +55 -0
- package/src/app/[variants]/(main)/chat/_layout/Desktop/index.tsx +6 -7
- package/src/app/[variants]/(main)/chat/_layout/Mobile.tsx +3 -3
- package/src/app/[variants]/(main)/chat/components/WorkspaceLayout.tsx +1 -14
- package/src/app/[variants]/(main)/chat/components/conversation/features/ChatHydration/index.tsx +2 -2
- package/src/app/[variants]/(main)/chat/components/conversation/features/ChatInput/Desktop/MessageFromUrl.tsx +11 -13
- package/src/app/[variants]/(main)/chat/components/conversation/features/ChatInput/Desktop/index.tsx +0 -1
- package/src/app/[variants]/(main)/chat/components/conversation/features/ThreadHydration.tsx +2 -2
- package/src/app/[variants]/(main)/chat/components/topic/features/Topic/TopicListContent/TopicItem/TopicContent.tsx +20 -11
- package/src/app/[variants]/(main)/chat/features/PageTitle/index.tsx +1 -2
- package/src/app/[variants]/(main)/chat/index.tsx +29 -0
- package/src/app/[variants]/(main)/chat/session/features/SessionHydration.tsx +8 -6
- package/src/app/[variants]/(main)/chat/session/features/SessionListContent/Inbox/index.tsx +2 -4
- package/src/app/[variants]/(main)/chat/session/features/SessionListContent/List/index.tsx +1 -1
- package/src/app/[variants]/(main)/chat/session/layout/Mobile/SessionHeader.tsx +3 -3
- package/src/app/[variants]/(main)/chat/settings/_layout/Desktop/Header.tsx +3 -3
- package/src/app/[variants]/(main)/chat/settings/_layout/Mobile/Header.tsx +3 -3
- package/src/app/[variants]/(main)/chat/settings/features/PublishResultModal/index.tsx +3 -3
- package/src/app/[variants]/(main)/chat/{components/SettingsPage.tsx → settings/index.tsx} +6 -35
- package/src/app/[variants]/(main)/components/Link.tsx +21 -0
- package/src/app/[variants]/(main)/discover/(detail)/_layout/{Desktop.tsx → Desktop/index.tsx} +15 -7
- package/src/app/[variants]/(main)/discover/(detail)/_layout/Mobile/index.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Capabilities/Block.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Overview/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Related/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/SystemRole/index.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Versions/index.tsx +4 -4
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Header.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/ActionButton/AddAgent.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/ActionButton/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/Related/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/TocList/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/StatusPage/index.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(detail)/assistant/{AssistantDetailPage.tsx → index.tsx} +18 -11
- package/src/app/[variants]/(main)/discover/(detail)/features/Breadcrumb.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Details/Related/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Details/Versions/index.tsx +5 -5
- package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Details/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/Related/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/ServerConfig.tsx +4 -4
- package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/TocList/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/mcp/{McpDetailPage.tsx → index.tsx} +15 -7
- package/src/app/[variants]/(main)/discover/(detail)/mcp/loading.tsx +1 -0
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/Overview/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/Parameter/ParameterItem.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/Related/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Header.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/ActionButton/ChatWithModel.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/ActionButton/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/Related/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/RelatedProviders/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/model/{ModelDetailPage.tsx → index.tsx} +17 -10
- package/src/app/[variants]/(main)/discover/(detail)/model/loading.tsx +1 -0
- package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Details/Related/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Details/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/ActionButton/ProviderConfig.tsx +5 -4
- package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/ActionButton/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/Related/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/RelatedModels/index.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(detail)/provider/{ProviderDetailPage.tsx → index.tsx} +17 -10
- package/src/app/[variants]/(main)/discover/(detail)/provider/loading.tsx +1 -0
- package/src/app/[variants]/(main)/discover/(list)/(home)/{HomePage.tsx → index.tsx} +14 -0
- package/src/app/[variants]/(main)/discover/(list)/_layout/Desktop/Nav.tsx +2 -3
- package/src/app/[variants]/(main)/discover/(list)/_layout/Desktop/index.tsx +4 -3
- package/src/app/[variants]/(main)/discover/(list)/_layout/Mobile/Nav.tsx +3 -4
- package/src/app/[variants]/(main)/discover/(list)/_layout/Mobile/index.tsx +4 -3
- package/src/app/[variants]/(main)/discover/(list)/assistant/_layout/Desktop.tsx +3 -4
- package/src/app/[variants]/(main)/discover/(list)/assistant/_layout/Mobile.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(list)/assistant/features/List/Item.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(list)/assistant/{AssistantPage.tsx → index.tsx} +18 -4
- package/src/app/[variants]/(main)/discover/(list)/features/SortButton/index.tsx +2 -2
- package/src/app/[variants]/(main)/discover/(list)/mcp/_layout/Desktop.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(list)/mcp/_layout/Mobile.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(list)/mcp/features/List/Item.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(list)/mcp/{McpPage.tsx → index.tsx} +9 -2
- package/src/app/[variants]/(main)/discover/(list)/model/_layout/Desktop.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(list)/model/_layout/Mobile.tsx +3 -3
- package/src/app/[variants]/(main)/discover/(list)/model/features/List/Item.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(list)/model/{ModelPage.tsx → index.tsx} +9 -2
- package/src/app/[variants]/(main)/discover/(list)/provider/features/List/Item.tsx +1 -1
- package/src/app/[variants]/(main)/discover/(list)/provider/{Client.tsx → index.tsx} +9 -2
- package/src/app/[variants]/(main)/discover/_layout/Desktop/index.tsx +4 -4
- package/src/app/[variants]/(main)/discover/_layout/Mobile/index.tsx +3 -3
- package/src/app/[variants]/(main)/discover/components/Title.tsx +1 -1
- package/src/app/[variants]/(main)/discover/features/Search.tsx +2 -2
- package/src/app/[variants]/(main)/discover/features/useNav.tsx +11 -12
- package/src/app/[variants]/(main)/hooks/useActiveTabKey.ts +40 -0
- package/src/app/[variants]/(main)/hooks/usePathname.ts +10 -0
- package/src/app/[variants]/(main)/hooks/useQuery.ts +12 -0
- package/src/app/[variants]/(main)/hooks/useRouter.ts +22 -0
- package/src/app/[variants]/(main)/hooks/useSearchParams.ts +11 -0
- package/src/app/[variants]/(main)/image/@menu/features/ConfigPanel/components/ModelSelect/index.tsx +5 -5
- package/src/app/[variants]/(main)/image/@topic/features/Topics/TopicUrlSync.tsx +1 -1
- package/src/app/[variants]/(main)/image/ComingSoon.tsx +15 -0
- package/src/app/[variants]/(main)/image/_layout/Desktop/index.tsx +5 -2
- package/src/app/[variants]/(main)/image/_layout/DesktopWrapper.tsx +15 -0
- package/src/app/[variants]/(main)/image/_layout/Mobile/index.tsx +3 -1
- package/src/app/[variants]/(main)/image/features/ImageWorkspace/index.tsx +1 -2
- package/src/app/[variants]/(main)/image/index.tsx +18 -0
- package/src/app/[variants]/(main)/knowledge/_layout/Desktop.tsx +17 -0
- package/src/app/[variants]/(main)/knowledge/_layout/Mobile.tsx +17 -0
- package/src/app/[variants]/(main)/knowledge/components/KnowledgeBaseItem/index.tsx +1 -1
- package/src/app/[variants]/(main)/knowledge/components/modal/ModalPageClient.tsx +4 -4
- package/src/app/[variants]/(main)/knowledge/routes/KnowledgeBaseDetail/index.tsx +5 -8
- package/src/app/[variants]/(main)/knowledge/routes/KnowledgeBaseDetail/menu/Head.tsx +1 -1
- package/src/app/[variants]/(main)/knowledge/routes/KnowledgeHome/menu/CategoryMenu.tsx +2 -2
- package/src/app/[variants]/(main)/knowledge/routes/KnowledgeHome/menu/KnowledgeBase.tsx +1 -1
- package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/DesktopLayoutContainer.tsx +3 -2
- package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/SideBar/BottomActions.tsx +4 -4
- package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/SideBar/TopActions.test.tsx +9 -9
- package/src/app/[variants]/(main)/layouts/desktop/SideBar/TopActions.tsx +117 -0
- package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/index.tsx +9 -4
- package/src/app/[variants]/(main)/layouts/index.tsx +11 -0
- package/src/app/[variants]/(main)/{_layout/Mobile → layouts/mobile}/NavBar.tsx +5 -5
- package/src/app/[variants]/(main)/{_layout/Mobile → layouts/mobile}/index.tsx +10 -7
- package/src/app/[variants]/(main)/profile/(home)/desktop.tsx +26 -0
- package/src/app/[variants]/(main)/profile/(home)/index.tsx +26 -0
- package/src/app/[variants]/(main)/profile/@category/features/CategoryContent.tsx +5 -7
- package/src/app/[variants]/(main)/profile/_layout/Desktop/index.tsx +3 -2
- package/src/app/[variants]/(main)/profile/_layout/DesktopWrapper.tsx +14 -0
- package/src/app/[variants]/(main)/profile/_layout/Mobile/Header.tsx +3 -3
- package/src/app/[variants]/(main)/profile/_layout/Mobile/index.tsx +4 -3
- package/src/app/[variants]/(main)/profile/apikey/index.tsx +18 -0
- package/src/app/[variants]/(main)/profile/hooks/useCategory.tsx +6 -6
- package/src/app/[variants]/(main)/profile/security/index.tsx +29 -0
- package/src/app/[variants]/(main)/profile/stats/features/AssistantsRank.tsx +4 -4
- package/src/app/[variants]/(main)/profile/stats/features/TopicsRank.tsx +4 -4
- package/src/app/[variants]/(main)/profile/stats/index.tsx +20 -0
- package/src/app/[variants]/(main)/profile/usage/features/UsageTable.tsx +7 -9
- package/src/app/[variants]/(main)/profile/usage/index.tsx +13 -0
- package/src/app/[variants]/(main)/settings/_layout/Desktop/Header.tsx +2 -2
- package/src/app/[variants]/(main)/settings/_layout/Desktop/index.tsx +2 -2
- package/src/app/[variants]/(main)/settings/_layout/DesktopWrapper.tsx +23 -0
- package/src/app/[variants]/(main)/settings/_layout/Mobile/Header.tsx +8 -7
- package/src/app/[variants]/(main)/settings/_layout/Mobile/index.tsx +2 -5
- package/src/app/[variants]/(main)/settings/_layout/MobileWrapper.tsx +23 -0
- package/src/app/[variants]/(main)/settings/agent/AgentMenu/Menu.tsx +2 -4
- package/src/app/[variants]/(main)/settings/agent/index.tsx +2 -4
- package/src/app/[variants]/(main)/settings/provider/(list)/index.tsx +2 -3
- package/src/app/[variants]/(main)/settings/provider/ProviderMenu/All.tsx +2 -2
- package/src/app/[variants]/(main)/settings/provider/ProviderMenu/Item.tsx +38 -37
- package/src/app/[variants]/(main)/settings/provider/_layout/Mobile.tsx +2 -2
- package/src/app/[variants]/(main)/settings/provider/features/CreateNewProvider/index.tsx +3 -3
- package/src/app/[variants]/(main)/settings/provider/features/ProviderConfig/UpdateProviderInfo/SettingModal.tsx +3 -3
- package/src/app/[variants]/DesktopRouter.tsx +40 -0
- package/src/app/[variants]/MobileRouter.tsx +41 -0
- package/src/app/[variants]/desktopRouter.config.tsx +364 -0
- package/src/app/[variants]/layout.tsx +1 -3
- package/src/app/[variants]/loaders/routeParams.ts +45 -0
- package/src/app/[variants]/loading/Server/Redirect.tsx +1 -1
- package/src/app/[variants]/mobileRouter.config.tsx +396 -0
- package/src/app/[variants]/page.tsx +17 -6
- package/src/app/desktop/devtools/page.tsx +1 -1
- package/src/app/desktop/layout.tsx +1 -1
- package/src/components/BootErrorBoundary/index.tsx +129 -0
- package/src/components/mdx/constants.ts +1 -0
- package/src/features/ChangelogModal/index.tsx +3 -3
- package/src/features/Conversation/Messages/Group/Tool/Inspector/index.tsx +23 -4
- package/src/features/KnowledgeManager/FileExplorer/index.tsx +4 -4
- package/src/features/KnowledgeManager/Header/FilesSearchBar.tsx +1 -1
- package/src/features/User/UserPanel/PanelContent.tsx +4 -3
- package/src/features/User/UserPanel/useMenu.tsx +20 -14
- package/src/features/User/__tests__/PanelContent.test.tsx +13 -7
- package/src/hooks/useDiscoverTab.ts +2 -2
- package/src/hooks/useInterceptingRoutes.test.ts +23 -26
- package/src/hooks/useInterceptingRoutes.ts +5 -4
- package/src/hooks/usePinnedAgentState.ts +6 -6
- package/src/hooks/useQuery.ts +5 -0
- package/src/hooks/useQueryParam.ts +322 -0
- package/src/hooks/useQueryRoute.test.ts +2 -12
- package/src/hooks/useQueryRoute.ts +5 -5
- package/src/hooks/useShowMobileWorkspace.ts +1 -1
- package/src/hooks/useSwitchSession.ts +4 -3
- package/src/layout/GlobalProvider/ImportSettings.tsx +22 -9
- package/src/layout/GlobalProvider/StoreInitialization.tsx +9 -1
- package/src/locales/default/tool.ts +11 -0
- package/src/proxy.ts +13 -1
- package/src/services/message/index.ts +11 -2
- package/src/store/chat/agents/createAgentExecutors.ts +31 -16
- package/src/store/chat/slices/aiChat/actions/__tests__/streamingExecutor.test.ts +218 -0
- package/src/store/chat/slices/aiChat/actions/conversationControl.ts +4 -0
- package/src/store/chat/slices/aiChat/actions/conversationLifecycle.ts +9 -3
- package/src/store/chat/slices/aiChat/actions/streamingExecutor.ts +142 -61
- package/src/store/chat/slices/builtinTool/actions/__tests__/localSystem.test.ts +5 -6
- package/src/store/chat/slices/builtinTool/actions/__tests__/search.test.ts +204 -10
- package/src/store/chat/slices/builtinTool/actions/localSystem.ts +45 -182
- package/src/store/chat/slices/builtinTool/actions/search.ts +51 -26
- package/src/store/chat/slices/message/action.test.ts +182 -33
- package/src/store/chat/slices/message/actions/optimisticUpdate.ts +79 -36
- package/src/store/chat/slices/message/actions/query.ts +7 -5
- package/src/store/chat/slices/message/selectors/dbMessage.ts +11 -4
- package/src/store/chat/slices/plugin/action.test.ts +257 -54
- package/src/store/chat/slices/plugin/actions/optimisticUpdate.ts +63 -26
- package/src/store/chat/slices/plugin/actions/pluginTypes.ts +52 -19
- package/src/store/chat/slices/plugin/actions/publicApi.ts +6 -1
- package/src/store/chat/slices/plugin/actions/workflow.ts +17 -6
- package/src/store/chat/slices/thread/action.ts +2 -0
- package/src/store/global/action.test.ts +3 -3
- package/src/store/global/actions/workspacePane.ts +2 -1
- package/src/store/global/initialState.ts +10 -2
- package/src/store/user/slices/common/action.ts +4 -0
- package/src/tools/executionRuntimes.ts +3 -0
- package/src/tools/local-system/ExecutionRuntime/index.ts +407 -0
- package/src/tools/local-system/Intervention/EditLocalFile/index.tsx +89 -0
- package/src/tools/local-system/Intervention/WriteFile/index.tsx +72 -0
- package/src/tools/local-system/Intervention/index.ts +4 -0
- package/src/tools/local-system/Render/EditLocalFile/index.tsx +67 -0
- package/src/tools/local-system/Render/ReadLocalFile/ReadFileView.tsx +53 -78
- package/src/tools/local-system/Render/index.ts +2 -0
- package/src/tools/local-system/index.ts +1 -0
- package/src/tools/local-system/type.ts +4 -3
- package/src/app/[variants]/(main)/(mobile)/me/(home)/loading.tsx +0 -38
- package/src/app/[variants]/(main)/(mobile)/me/(home)/page.tsx +0 -40
- package/src/app/[variants]/(main)/(mobile)/me/profile/loading.tsx +0 -5
- package/src/app/[variants]/(main)/(mobile)/me/profile/page.tsx +0 -30
- package/src/app/[variants]/(main)/(mobile)/me/settings/loading.tsx +0 -5
- package/src/app/[variants]/(main)/(mobile)/me/settings/page.tsx +0 -30
- package/src/app/[variants]/(main)/_layout/Desktop/SideBar/TopActions.tsx +0 -106
- package/src/app/[variants]/(main)/changelog/layout.tsx +0 -10
- package/src/app/[variants]/(main)/changelog/modal/page.tsx +0 -23
- package/src/app/[variants]/(main)/changelog/page.tsx +0 -78
- package/src/app/[variants]/(main)/chat/ChatRouter.tsx +0 -83
- package/src/app/[variants]/(main)/chat/_layout/ChatLayout.tsx +0 -22
- package/src/app/[variants]/(main)/chat/components/MainChatPage.tsx +0 -25
- package/src/app/[variants]/(main)/chat/error.tsx +0 -3
- package/src/app/[variants]/(main)/chat/layout.tsx +0 -10
- package/src/app/[variants]/(main)/chat/loading.tsx +0 -3
- package/src/app/[variants]/(main)/chat/not-found.tsx +0 -1
- package/src/app/[variants]/(main)/chat/page.tsx +0 -12
- package/src/app/[variants]/(main)/chat/settings/error.tsx +0 -3
- package/src/app/[variants]/(main)/chat/settings/loading.tsx +0 -3
- package/src/app/[variants]/(main)/chat/settings/not-found.tsx +0 -1
- package/src/app/[variants]/(main)/discover/(detail)/_layout/DetailLayout.tsx +0 -22
- package/src/app/[variants]/(main)/discover/(detail)/assistant/[...slugs]/Client.tsx +0 -51
- package/src/app/[variants]/(main)/discover/(detail)/mcp/[slug]/Client.tsx +0 -43
- package/src/app/[variants]/(main)/discover/(detail)/mcp/[slug]/loading.tsx +0 -1
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/Client.tsx +0 -40
- package/src/app/[variants]/(main)/discover/(detail)/model/[...slugs]/loading.tsx +0 -1
- package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/Client.tsx +0 -40
- package/src/app/[variants]/(main)/discover/(detail)/provider/[...slugs]/loading.tsx +0 -1
- package/src/app/[variants]/(main)/discover/(list)/_layout/ListLayout.tsx +0 -22
- package/src/app/[variants]/(main)/discover/(list)/assistant/AssistantLayout.tsx +0 -21
- package/src/app/[variants]/(main)/discover/(list)/mcp/Client.tsx +0 -44
- package/src/app/[variants]/(main)/discover/(list)/mcp/McpLayout.tsx +0 -21
- package/src/app/[variants]/(main)/discover/(list)/model/Client.tsx +0 -44
- package/src/app/[variants]/(main)/discover/(list)/model/ModelLayout.tsx +0 -21
- package/src/app/[variants]/(main)/discover/(list)/provider/ProviderPage.tsx +0 -43
- package/src/app/[variants]/(main)/discover/DiscoverRouter.tsx +0 -170
- package/src/app/[variants]/(main)/discover/[[...path]]/page.tsx +0 -12
- package/src/app/[variants]/(main)/discover/_layout/DiscoverLayout.tsx +0 -22
- package/src/app/[variants]/(main)/discover/error.tsx +0 -3
- package/src/app/[variants]/(main)/discover/not-found.tsx +0 -1
- package/src/app/[variants]/(main)/error.tsx +0 -3
- package/src/app/[variants]/(main)/image/layout.tsx +0 -15
- package/src/app/[variants]/(main)/image/page.tsx +0 -45
- package/src/app/[variants]/(main)/knowledge/KnowledgeRouter.tsx +0 -74
- package/src/app/[variants]/(main)/knowledge/[[...path]]/page.tsx +0 -12
- package/src/app/[variants]/(main)/knowledge/components/modal/page.tsx +0 -13
- package/src/app/[variants]/(main)/knowledge/layout.tsx +0 -12
- package/src/app/[variants]/(main)/layout.tsx +0 -10
- package/src/app/[variants]/(main)/not-found.tsx +0 -1
- package/src/app/[variants]/(main)/profile/apikey/page.tsx +0 -32
- package/src/app/[variants]/(main)/profile/error.tsx +0 -3
- package/src/app/[variants]/(main)/profile/layout.tsx +0 -11
- package/src/app/[variants]/(main)/profile/loading.tsx +0 -3
- package/src/app/[variants]/(main)/profile/not-found.tsx +0 -1
- package/src/app/[variants]/(main)/profile/security/page.tsx +0 -28
- package/src/app/[variants]/(main)/profile/stats/page.tsx +0 -23
- package/src/app/[variants]/(main)/profile/usage/page.tsx +0 -23
- package/src/app/[variants]/@modal/(.)changelog/modal/features/Cover.tsx +0 -48
- package/src/app/[variants]/@modal/(.)changelog/modal/features/Hero.tsx +0 -29
- package/src/app/[variants]/@modal/(.)changelog/modal/features/Post.tsx +0 -57
- package/src/app/[variants]/@modal/(.)changelog/modal/features/PublishedTime.tsx +0 -50
- package/src/app/[variants]/@modal/(.)changelog/modal/features/ReadDetail.tsx +0 -72
- package/src/app/[variants]/@modal/(.)changelog/modal/features/VersionTag.tsx +0 -26
- package/src/app/[variants]/@modal/(.)changelog/modal/layout.tsx +0 -41
- package/src/app/[variants]/@modal/(.)changelog/modal/loading.tsx +0 -10
- package/src/app/[variants]/@modal/(.)changelog/modal/page.tsx +0 -38
- package/src/app/[variants]/@modal/_layout/ModalLayout.tsx +0 -63
- package/src/app/[variants]/@modal/_layout/SettingModalLayout.tsx +0 -71
- package/src/app/[variants]/@modal/default.tsx +0 -3
- package/src/app/[variants]/@modal/error.tsx +0 -3
- package/src/app/[variants]/@modal/layout.tsx +0 -7
- package/src/app/[variants]/@modal/loading.tsx +0 -5
- /package/src/app/[variants]/{@modal/(.)changelog/modal → (main)/changelog}/features/Pagination.tsx +0 -0
- /package/src/app/[variants]/{@modal/(.)changelog/modal → (main)/changelog}/features/UpdateChangelogStatus.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/DetailProvider.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Capabilities/Knowledge.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Capabilities/KnowledgeItem.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Capabilities/PluginItem.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Capabilities/Plugins.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Capabilities/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Nav.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/Overview/TagList.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Details/SystemRole/TagList.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/Related/Item.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/Summary/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/features → features}/Sidebar/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/assistant/{[...slugs]/loading.tsx → loading.tsx} +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/ActionButton/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/ConnectionTypeAlert.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/Related/Item.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/mcp/{[slug]/features → features}/Sidebar/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/DetailProvider.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/Nav.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/Overview/ProviderList/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Details/Parameter/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/Related/Item.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/RelatedProviders/Item.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/model/{[...slugs]/features → features}/Sidebar/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/DetailProvider.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Details/Guide/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Details/Nav.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Details/Overview/ModelList/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Details/Overview/index.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Header.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/Related/Item.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/RelatedModels/Item.tsx +0 -0
- /package/src/app/[variants]/(main)/discover/(detail)/provider/{[...slugs]/features → features}/Sidebar/index.tsx +0 -0
- /package/src/app/[variants]/(main)/labs/{page.tsx → index.tsx} +0 -0
- /package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/RegisterHotkeys.tsx +0 -0
- /package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/SideBar/Avatar.test.tsx +0 -0
- /package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/SideBar/Avatar.tsx +0 -0
- /package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/SideBar/PinList/index.tsx +0 -0
- /package/src/app/[variants]/(main)/{_layout/Desktop → layouts/desktop}/SideBar/index.tsx +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LocalReadFileResult } from '@lobechat/electron-client-ipc';
|
|
2
2
|
import { ActionIcon, Icon, Markdown, Text } from '@lobehub/ui';
|
|
3
3
|
import { createStyles } from 'antd-style';
|
|
4
|
-
import { AlignLeft, Asterisk,
|
|
5
|
-
import React, { memo
|
|
4
|
+
import { AlignLeft, Asterisk, ExternalLink, FolderOpen } from 'lucide-react';
|
|
5
|
+
import React, { memo } from 'react';
|
|
6
6
|
import { useTranslation } from 'react-i18next';
|
|
7
7
|
import { Flexbox } from 'react-layout-kit';
|
|
8
8
|
|
|
@@ -24,7 +24,6 @@ const useStyles = createStyles(({ css, token, cx }) => ({
|
|
|
24
24
|
container: css`
|
|
25
25
|
justify-content: space-between;
|
|
26
26
|
|
|
27
|
-
height: 64px;
|
|
28
27
|
padding: 8px;
|
|
29
28
|
border-radius: ${token.borderRadiusLG}px;
|
|
30
29
|
|
|
@@ -79,11 +78,11 @@ const useStyles = createStyles(({ css, token, cx }) => ({
|
|
|
79
78
|
|
|
80
79
|
overflow: hidden;
|
|
81
80
|
|
|
82
|
-
|
|
83
|
-
padding: 8px;
|
|
81
|
+
padding-block: 0;
|
|
82
|
+
padding-inline: 8px;
|
|
84
83
|
border-radius: 8px;
|
|
85
84
|
|
|
86
|
-
background: ${token.
|
|
85
|
+
background: ${token.colorBgContainer};
|
|
87
86
|
`,
|
|
88
87
|
previewText: css`
|
|
89
88
|
font-size: 12px;
|
|
@@ -102,11 +101,6 @@ const ReadFileView = memo<ReadFileViewProps>(
|
|
|
102
101
|
({ filename, path, fileType, charCount, content, totalLineCount, totalCharCount, loc }) => {
|
|
103
102
|
const { t } = useTranslation('tool');
|
|
104
103
|
const { styles } = useStyles();
|
|
105
|
-
const [isExpanded, setIsExpanded] = useState(false);
|
|
106
|
-
|
|
107
|
-
const handleToggleExpand = () => {
|
|
108
|
-
setIsExpanded(!isExpanded);
|
|
109
|
-
};
|
|
110
104
|
|
|
111
105
|
const handleOpenFile = (e: React.MouseEvent) => {
|
|
112
106
|
e.stopPropagation();
|
|
@@ -121,89 +115,70 @@ const ReadFileView = memo<ReadFileViewProps>(
|
|
|
121
115
|
const displayPath = useElectronStore(desktopStateSelectors.displayRelativePath(path));
|
|
122
116
|
|
|
123
117
|
return (
|
|
124
|
-
<Flexbox className={styles.container}>
|
|
125
|
-
<Flexbox
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
118
|
+
<Flexbox className={styles.container} gap={12}>
|
|
119
|
+
<Flexbox>
|
|
120
|
+
<Flexbox
|
|
121
|
+
align={'center'}
|
|
122
|
+
className={styles.header}
|
|
123
|
+
gap={12}
|
|
124
|
+
horizontal
|
|
125
|
+
justify={'space-between'}
|
|
126
|
+
>
|
|
127
|
+
<Flexbox align={'center'} flex={1} gap={0} horizontal style={{ overflow: 'hidden' }}>
|
|
128
|
+
<FileIcon fileName={filename} fileType={fileType} size={16} variant={'raw'} />
|
|
129
|
+
<Flexbox horizontal>
|
|
130
|
+
<Text className={styles.fileName} ellipsis>
|
|
131
|
+
{filename}
|
|
132
|
+
</Text>
|
|
133
|
+
{/* Actions on Hover */}
|
|
134
|
+
<Flexbox className={styles.actions} gap={2} horizontal style={{ marginLeft: 8 }}>
|
|
135
|
+
<ActionIcon
|
|
136
|
+
icon={ExternalLink}
|
|
137
|
+
onClick={handleOpenFile}
|
|
138
|
+
size="small"
|
|
139
|
+
title={t('localFiles.openFile')}
|
|
140
|
+
/>
|
|
141
|
+
<ActionIcon
|
|
142
|
+
icon={FolderOpen}
|
|
143
|
+
onClick={handleOpenFolder}
|
|
144
|
+
size="small"
|
|
145
|
+
title={t('localFiles.openFolder')}
|
|
146
|
+
/>
|
|
147
|
+
</Flexbox>
|
|
153
148
|
</Flexbox>
|
|
154
149
|
</Flexbox>
|
|
155
|
-
|
|
156
|
-
<Flexbox align={'center'} className={styles.meta} gap={8} horizontal>
|
|
157
|
-
{isExpanded && (
|
|
150
|
+
<Flexbox align={'center'} className={styles.meta} gap={16} horizontal>
|
|
158
151
|
<Flexbox align={'center'} gap={4} horizontal>
|
|
159
152
|
<Icon icon={Asterisk} size={'small'} />
|
|
160
153
|
<span>
|
|
161
154
|
{charCount} / <span className={styles.lineCount}>{totalCharCount}</span>
|
|
162
155
|
</span>
|
|
163
156
|
</Flexbox>
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
<Icon icon={AlignLeft} size={'small'} />
|
|
167
|
-
{isExpanded ? (
|
|
157
|
+
<Flexbox align={'center'} gap={4} horizontal>
|
|
158
|
+
<Icon icon={AlignLeft} size={'small'} />
|
|
168
159
|
<span>
|
|
169
160
|
L{loc?.[0]}-{loc?.[1]} /{' '}
|
|
170
161
|
<span className={styles.lineCount}>{totalLineCount}</span>
|
|
171
162
|
</span>
|
|
172
|
-
|
|
173
|
-
<span>
|
|
174
|
-
L{loc?.[0]}-{loc?.[1]}
|
|
175
|
-
</span>
|
|
176
|
-
)}
|
|
163
|
+
</Flexbox>
|
|
177
164
|
</Flexbox>
|
|
178
|
-
<ActionIcon
|
|
179
|
-
active={isExpanded}
|
|
180
|
-
icon={ChevronDownIcon}
|
|
181
|
-
onClick={handleToggleExpand}
|
|
182
|
-
size="small"
|
|
183
|
-
style={{
|
|
184
|
-
transform: isExpanded ? 'rotate(180deg)' : 'rotate(0deg)',
|
|
185
|
-
transition: 'transform 0.2s',
|
|
186
|
-
}}
|
|
187
|
-
/>
|
|
188
165
|
</Flexbox>
|
|
166
|
+
|
|
167
|
+
{/* Path */}
|
|
168
|
+
<Text className={styles.path} ellipsis type={'secondary'}>
|
|
169
|
+
{displayPath}
|
|
170
|
+
</Text>
|
|
189
171
|
</Flexbox>
|
|
190
172
|
|
|
191
|
-
{
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
) : (
|
|
201
|
-
<div className={styles.previewText} style={{ width: '100%' }}>
|
|
202
|
-
{content}
|
|
203
|
-
</div>
|
|
204
|
-
)}
|
|
205
|
-
</Flexbox>
|
|
206
|
-
)}
|
|
173
|
+
<Flexbox className={styles.previewBox} style={{ maxHeight: 240 }}>
|
|
174
|
+
{fileType === 'md' ? (
|
|
175
|
+
<Markdown style={{ overflow: 'auto' }}>{content}</Markdown>
|
|
176
|
+
) : (
|
|
177
|
+
<div className={styles.previewText} style={{ width: '100%' }}>
|
|
178
|
+
{content}
|
|
179
|
+
</div>
|
|
180
|
+
)}
|
|
181
|
+
</Flexbox>
|
|
207
182
|
</Flexbox>
|
|
208
183
|
);
|
|
209
184
|
},
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LocalSystemApiName } from '../index';
|
|
2
|
+
import EditLocalFile from './EditLocalFile';
|
|
2
3
|
import ListFiles from './ListFiles';
|
|
3
4
|
import MoveLocalFiles from './MoveLocalFiles';
|
|
4
5
|
import ReadLocalFile from './ReadLocalFile';
|
|
@@ -11,6 +12,7 @@ import WriteFile from './WriteFile';
|
|
|
11
12
|
* Local System Render Components Registry
|
|
12
13
|
*/
|
|
13
14
|
export const LocalSystemRenders = {
|
|
15
|
+
[LocalSystemApiName.editLocalFile]: EditLocalFile,
|
|
14
16
|
[LocalSystemApiName.listLocalFiles]: ListFiles,
|
|
15
17
|
[LocalSystemApiName.moveLocalFiles]: MoveLocalFiles,
|
|
16
18
|
[LocalSystemApiName.readLocalFile]: ReadLocalFile,
|
|
@@ -206,6 +206,7 @@ export const LocalSystemManifest: BuiltinToolManifest = {
|
|
|
206
206
|
{
|
|
207
207
|
description:
|
|
208
208
|
'Perform exact string replacements in files. Must read the file first before editing.',
|
|
209
|
+
humanIntervention: 'required',
|
|
209
210
|
name: LocalSystemApiName.editLocalFile,
|
|
210
211
|
parameters: {
|
|
211
212
|
properties: {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
EditLocalFileResult,
|
|
3
2
|
GetCommandOutputResult,
|
|
4
3
|
GlobFilesResult,
|
|
5
4
|
GrepContentResult,
|
|
@@ -85,6 +84,8 @@ export interface GlobFilesState {
|
|
|
85
84
|
|
|
86
85
|
// Edit State
|
|
87
86
|
export interface EditLocalFileState {
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
diffText?: string;
|
|
88
|
+
linesAdded?: number;
|
|
89
|
+
linesDeleted?: number;
|
|
90
|
+
replacements: number;
|
|
90
91
|
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { Skeleton } from 'antd';
|
|
4
|
-
import { memo } from 'react';
|
|
5
|
-
import { Flexbox } from 'react-layout-kit';
|
|
6
|
-
|
|
7
|
-
import Divider from '@/components/Cell/Divider';
|
|
8
|
-
import SkeletonLoading from '@/components/Loading/SkeletonLoading';
|
|
9
|
-
|
|
10
|
-
const Loading = memo(() => {
|
|
11
|
-
return (
|
|
12
|
-
<>
|
|
13
|
-
<Flexbox align={'center'} gap={12} horizontal paddingBlock={12} paddingInline={12}>
|
|
14
|
-
<Skeleton.Avatar active shape={'circle'} size={48} />
|
|
15
|
-
<Skeleton.Button active block />
|
|
16
|
-
</Flexbox>
|
|
17
|
-
<Flexbox gap={4} horizontal paddingBlock={12} paddingInline={16}>
|
|
18
|
-
<Skeleton.Button active block />
|
|
19
|
-
<Skeleton.Button active block />
|
|
20
|
-
<Skeleton.Button active block />
|
|
21
|
-
</Flexbox>
|
|
22
|
-
<Divider />
|
|
23
|
-
<SkeletonLoading
|
|
24
|
-
active
|
|
25
|
-
paragraph={{ rows: 6, style: { marginBottom: 0 }, width: '100%' }}
|
|
26
|
-
title={false}
|
|
27
|
-
/>
|
|
28
|
-
<Divider />
|
|
29
|
-
<SkeletonLoading
|
|
30
|
-
active
|
|
31
|
-
paragraph={{ rows: 3, style: { marginBottom: 0 }, width: '100%' }}
|
|
32
|
-
title={false}
|
|
33
|
-
/>
|
|
34
|
-
</>
|
|
35
|
-
);
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
export default Loading;
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { redirect } from 'next/navigation';
|
|
2
|
-
import { Center } from 'react-layout-kit';
|
|
3
|
-
|
|
4
|
-
import BrandWatermark from '@/components/BrandWatermark';
|
|
5
|
-
import { metadataModule } from '@/server/metadata';
|
|
6
|
-
import { translation } from '@/server/translation';
|
|
7
|
-
import { DynamicLayoutProps } from '@/types/next';
|
|
8
|
-
import { RouteVariants } from '@/utils/server/routeVariants';
|
|
9
|
-
|
|
10
|
-
import Category from './features/Category';
|
|
11
|
-
import UserBanner from './features/UserBanner';
|
|
12
|
-
|
|
13
|
-
export const generateMetadata = async (props: DynamicLayoutProps) => {
|
|
14
|
-
const locale = await RouteVariants.getLocale(props);
|
|
15
|
-
const { t } = await translation('common', locale);
|
|
16
|
-
return metadataModule.generate({
|
|
17
|
-
title: t('tab.me'),
|
|
18
|
-
url: '/me',
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
const Page = async (props: DynamicLayoutProps) => {
|
|
23
|
-
const isMobile = await RouteVariants.getIsMobile(props);
|
|
24
|
-
|
|
25
|
-
if (!isMobile) return redirect('/chat');
|
|
26
|
-
|
|
27
|
-
return (
|
|
28
|
-
<>
|
|
29
|
-
<UserBanner />
|
|
30
|
-
<Category />
|
|
31
|
-
<Center padding={16}>
|
|
32
|
-
<BrandWatermark />
|
|
33
|
-
</Center>
|
|
34
|
-
</>
|
|
35
|
-
);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
Page.displayName = 'Me';
|
|
39
|
-
|
|
40
|
-
export default Page;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { redirect } from 'next/navigation';
|
|
2
|
-
|
|
3
|
-
import { metadataModule } from '@/server/metadata';
|
|
4
|
-
import { translation } from '@/server/translation';
|
|
5
|
-
import { DynamicLayoutProps } from '@/types/next';
|
|
6
|
-
import { RouteVariants } from '@/utils/server/routeVariants';
|
|
7
|
-
|
|
8
|
-
import Category from './features/Category';
|
|
9
|
-
|
|
10
|
-
export const generateMetadata = async (props: DynamicLayoutProps) => {
|
|
11
|
-
const locale = await RouteVariants.getLocale(props);
|
|
12
|
-
const { t } = await translation('auth', locale);
|
|
13
|
-
return metadataModule.generate({
|
|
14
|
-
description: t('header.desc'),
|
|
15
|
-
title: t('header.title'),
|
|
16
|
-
url: '/me/profile',
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const Page = async (props: DynamicLayoutProps) => {
|
|
21
|
-
const isMobile = await RouteVariants.getIsMobile(props);
|
|
22
|
-
|
|
23
|
-
if (!isMobile) return redirect('/profile');
|
|
24
|
-
|
|
25
|
-
return <Category />;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
Page.displayName = 'MeProfile';
|
|
29
|
-
|
|
30
|
-
export default Page;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { redirect } from 'next/navigation';
|
|
2
|
-
|
|
3
|
-
import { metadataModule } from '@/server/metadata';
|
|
4
|
-
import { translation } from '@/server/translation';
|
|
5
|
-
import { DynamicLayoutProps } from '@/types/next';
|
|
6
|
-
import { RouteVariants } from '@/utils/server/routeVariants';
|
|
7
|
-
|
|
8
|
-
import Category from './features/Category';
|
|
9
|
-
|
|
10
|
-
export const generateMetadata = async (props: DynamicLayoutProps) => {
|
|
11
|
-
const locale = await RouteVariants.getLocale(props);
|
|
12
|
-
const { t } = await translation('setting', locale);
|
|
13
|
-
return metadataModule.generate({
|
|
14
|
-
description: t('header.desc'),
|
|
15
|
-
title: t('header.title'),
|
|
16
|
-
url: '/me/settings',
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
const Page = async (props: DynamicLayoutProps) => {
|
|
21
|
-
const isMobile = await RouteVariants.getIsMobile(props);
|
|
22
|
-
|
|
23
|
-
if (!isMobile) return redirect('/settings');
|
|
24
|
-
|
|
25
|
-
return <Category />;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
Page.displayName = 'MeSettings';
|
|
29
|
-
|
|
30
|
-
export default Page;
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import { ActionIcon, ActionIconProps, Hotkey } from '@lobehub/ui';
|
|
2
|
-
import { Compass, FolderClosed, MessageSquare, Palette } from 'lucide-react';
|
|
3
|
-
import Link from 'next/link';
|
|
4
|
-
import { memo } from 'react';
|
|
5
|
-
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import { Flexbox } from 'react-layout-kit';
|
|
7
|
-
|
|
8
|
-
import { useGlobalStore } from '@/store/global';
|
|
9
|
-
import { SidebarTabKey } from '@/store/global/initialState';
|
|
10
|
-
import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
|
|
11
|
-
import { useSessionStore } from '@/store/session';
|
|
12
|
-
import { useUserStore } from '@/store/user';
|
|
13
|
-
import { settingsSelectors } from '@/store/user/selectors';
|
|
14
|
-
import { HotkeyEnum } from '@/types/hotkey';
|
|
15
|
-
|
|
16
|
-
const ICON_SIZE: ActionIconProps['size'] = {
|
|
17
|
-
blockSize: 40,
|
|
18
|
-
size: 24,
|
|
19
|
-
strokeWidth: 2,
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export interface TopActionProps {
|
|
23
|
-
isPinned?: boolean | null;
|
|
24
|
-
tab?: SidebarTabKey;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
// TODO Change icons
|
|
28
|
-
const TopActions = memo<TopActionProps>(({ tab, isPinned }) => {
|
|
29
|
-
const { t } = useTranslation('common');
|
|
30
|
-
const switchBackToChat = useGlobalStore((s) => s.switchBackToChat);
|
|
31
|
-
const { showMarket, enableKnowledgeBase, showAiImage } =
|
|
32
|
-
useServerConfigStore(featureFlagsSelectors);
|
|
33
|
-
const hotkey = useUserStore(settingsSelectors.getHotkeyById(HotkeyEnum.NavigateToChat));
|
|
34
|
-
|
|
35
|
-
const isChatActive = tab === SidebarTabKey.Chat && !isPinned;
|
|
36
|
-
const isFilesActive = tab === SidebarTabKey.Files;
|
|
37
|
-
const isDiscoverActive = tab === SidebarTabKey.Discover;
|
|
38
|
-
const isImageActive = tab === SidebarTabKey.Image;
|
|
39
|
-
|
|
40
|
-
return (
|
|
41
|
-
<Flexbox gap={8}>
|
|
42
|
-
<Link
|
|
43
|
-
aria-label={t('tab.chat')}
|
|
44
|
-
href={'/chat'}
|
|
45
|
-
onClick={(e) => {
|
|
46
|
-
// If Cmd key is pressed, let the default link behavior happen (open in new tab)
|
|
47
|
-
if (e.metaKey || e.ctrlKey) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// Otherwise, prevent default and switch session within the current tab
|
|
52
|
-
e.preventDefault();
|
|
53
|
-
switchBackToChat(useSessionStore.getState().activeId);
|
|
54
|
-
}}
|
|
55
|
-
>
|
|
56
|
-
<ActionIcon
|
|
57
|
-
active={isChatActive}
|
|
58
|
-
icon={MessageSquare}
|
|
59
|
-
size={ICON_SIZE}
|
|
60
|
-
title={
|
|
61
|
-
<Flexbox align={'center'} gap={8} horizontal justify={'space-between'}>
|
|
62
|
-
<span>{t('tab.chat')}</span>
|
|
63
|
-
<Hotkey inverseTheme keys={hotkey} />
|
|
64
|
-
</Flexbox>
|
|
65
|
-
}
|
|
66
|
-
tooltipProps={{ placement: 'right' }}
|
|
67
|
-
/>
|
|
68
|
-
</Link>
|
|
69
|
-
{enableKnowledgeBase && (
|
|
70
|
-
<Link aria-label={t('tab.knowledgeBase')} href={'/knowledge'}>
|
|
71
|
-
<ActionIcon
|
|
72
|
-
active={isFilesActive}
|
|
73
|
-
icon={FolderClosed}
|
|
74
|
-
size={ICON_SIZE}
|
|
75
|
-
title={t('tab.knowledgeBase')}
|
|
76
|
-
tooltipProps={{ placement: 'right' }}
|
|
77
|
-
/>
|
|
78
|
-
</Link>
|
|
79
|
-
)}
|
|
80
|
-
{showAiImage && (
|
|
81
|
-
<Link aria-label={t('tab.aiImage')} href={'/image'}>
|
|
82
|
-
<ActionIcon
|
|
83
|
-
active={isImageActive}
|
|
84
|
-
icon={Palette}
|
|
85
|
-
size={ICON_SIZE}
|
|
86
|
-
title={t('tab.aiImage')}
|
|
87
|
-
tooltipProps={{ placement: 'right' }}
|
|
88
|
-
/>
|
|
89
|
-
</Link>
|
|
90
|
-
)}
|
|
91
|
-
{showMarket && (
|
|
92
|
-
<Link aria-label={t('tab.discover')} href={'/discover'}>
|
|
93
|
-
<ActionIcon
|
|
94
|
-
active={isDiscoverActive}
|
|
95
|
-
icon={Compass}
|
|
96
|
-
size={ICON_SIZE}
|
|
97
|
-
title={t('tab.discover')}
|
|
98
|
-
tooltipProps={{ placement: 'right' }}
|
|
99
|
-
/>
|
|
100
|
-
</Link>
|
|
101
|
-
)}
|
|
102
|
-
</Flexbox>
|
|
103
|
-
);
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
export default TopActions;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import ServerLayout from '@/components/server/ServerLayout';
|
|
2
|
-
|
|
3
|
-
import Desktop from './_layout/Desktop';
|
|
4
|
-
import Mobile from './_layout/Mobile';
|
|
5
|
-
|
|
6
|
-
const MainLayout = ServerLayout({ Desktop, Mobile });
|
|
7
|
-
|
|
8
|
-
MainLayout.displayName = 'ChangelogLayout';
|
|
9
|
-
|
|
10
|
-
export default MainLayout;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
|
|
3
|
-
import { useEffect } from 'react';
|
|
4
|
-
|
|
5
|
-
import { useQueryRoute } from '@/hooks/useQueryRoute';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* @description: Changelog Modal (intercepting routes fallback when hard refresh)
|
|
9
|
-
* @example: /changelog/modal => /changelog
|
|
10
|
-
* @refs: https://github.com/lobehub/lobe-chat/discussions/2295#discussioncomment-9290942
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
const ChangelogModal = () => {
|
|
14
|
-
const router = useQueryRoute();
|
|
15
|
-
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
router.replace('/changelog');
|
|
18
|
-
}, []);
|
|
19
|
-
|
|
20
|
-
return null;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export default ChangelogModal;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { Divider, Skeleton } from 'antd';
|
|
2
|
-
import { notFound } from 'next/navigation';
|
|
3
|
-
import { Fragment, Suspense } from 'react';
|
|
4
|
-
import { Flexbox } from 'react-layout-kit';
|
|
5
|
-
import urlJoin from 'url-join';
|
|
6
|
-
|
|
7
|
-
import Pagination from '@/app/[variants]/@modal/(.)changelog/modal/features/Pagination';
|
|
8
|
-
import UpdateChangelogStatus from '@/app/[variants]/@modal/(.)changelog/modal/features/UpdateChangelogStatus';
|
|
9
|
-
import StructuredData from '@/components/StructuredData';
|
|
10
|
-
import { serverFeatureFlags } from '@/config/featureFlags';
|
|
11
|
-
import { BRANDING_NAME } from '@/const/branding';
|
|
12
|
-
import { OFFICIAL_SITE } from '@/const/url';
|
|
13
|
-
import { ldModule } from '@/server/ld';
|
|
14
|
-
import { metadataModule } from '@/server/metadata';
|
|
15
|
-
import { ChangelogService } from '@/server/services/changelog';
|
|
16
|
-
import { translation } from '@/server/translation';
|
|
17
|
-
import { DynamicLayoutProps } from '@/types/next';
|
|
18
|
-
import { RouteVariants } from '@/utils/server/routeVariants';
|
|
19
|
-
|
|
20
|
-
import GridLayout from './features/GridLayout';
|
|
21
|
-
import Post from './features/Post';
|
|
22
|
-
|
|
23
|
-
export const generateMetadata = async (props: DynamicLayoutProps) => {
|
|
24
|
-
const locale = await RouteVariants.getLocale(props);
|
|
25
|
-
const { t } = await translation('metadata', locale);
|
|
26
|
-
return metadataModule.generate({
|
|
27
|
-
canonical: urlJoin(OFFICIAL_SITE, 'changelog'),
|
|
28
|
-
description: t('changelog.description', { appName: BRANDING_NAME }),
|
|
29
|
-
title: t('changelog.title'),
|
|
30
|
-
url: '/changelog',
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const Page = async (props: DynamicLayoutProps) => {
|
|
35
|
-
const hideDocs = serverFeatureFlags().hideDocs;
|
|
36
|
-
if (hideDocs) return notFound();
|
|
37
|
-
|
|
38
|
-
const { isMobile, locale } = await RouteVariants.getVariantsFromProps(props);
|
|
39
|
-
const { t } = await translation('metadata', locale);
|
|
40
|
-
const changelogService = new ChangelogService();
|
|
41
|
-
const data = await changelogService.getChangelogIndex();
|
|
42
|
-
|
|
43
|
-
if (!data) return notFound();
|
|
44
|
-
|
|
45
|
-
const ld = ldModule.generate({
|
|
46
|
-
description: t('changelog.description', { appName: BRANDING_NAME }),
|
|
47
|
-
title: t('changelog.title', { appName: BRANDING_NAME }),
|
|
48
|
-
url: '/changelog',
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
return (
|
|
52
|
-
<>
|
|
53
|
-
<StructuredData ld={ld} />
|
|
54
|
-
<Flexbox gap={isMobile ? 16 : 48}>
|
|
55
|
-
{data?.map((item) => (
|
|
56
|
-
<Fragment key={item.id}>
|
|
57
|
-
<Suspense
|
|
58
|
-
fallback={
|
|
59
|
-
<GridLayout>
|
|
60
|
-
<Divider />
|
|
61
|
-
<Skeleton active paragraph={{ rows: 5 }} />
|
|
62
|
-
</GridLayout>
|
|
63
|
-
}
|
|
64
|
-
>
|
|
65
|
-
<Post locale={locale} mobile={isMobile} {...item} />
|
|
66
|
-
</Suspense>
|
|
67
|
-
</Fragment>
|
|
68
|
-
))}
|
|
69
|
-
</Flexbox>
|
|
70
|
-
<GridLayout>
|
|
71
|
-
<Pagination />
|
|
72
|
-
</GridLayout>
|
|
73
|
-
<UpdateChangelogStatus currentId={data[0]?.id} />
|
|
74
|
-
</>
|
|
75
|
-
);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
export default Page;
|