chore: replace all cn comments of fe to en version by volc api (#320)
This commit is contained in:
@@ -83,7 +83,7 @@ const mergedConfig = defineConfig({
|
||||
source: {
|
||||
define: {
|
||||
'process.env.IS_REACT18': JSON.stringify(true),
|
||||
// arcosite editor sdk 内部使用
|
||||
// Arcosite editor sdk internal use
|
||||
'process.env.ARCOSITE_SDK_REGION': JSON.stringify(
|
||||
GLOBAL_ENVS.IS_OVERSEA ? 'VA' : 'CN',
|
||||
),
|
||||
@@ -99,7 +99,7 @@ const mergedConfig = defineConfig({
|
||||
include: [
|
||||
path.resolve(__dirname, '../../packages'),
|
||||
path.resolve(__dirname, '../../infra/flags-devtool'),
|
||||
// 以下几个包包含未降级的 ES 2022 语法(private methods)需要参与打包
|
||||
// The following packages contain undegraded ES 2022 syntax (private methods) that need to be packaged
|
||||
/\/node_modules\/(marked|@dagrejs|@tanstack)\//,
|
||||
],
|
||||
alias: {
|
||||
|
||||
@@ -31,15 +31,15 @@ const initFlags = () => {
|
||||
};
|
||||
|
||||
const main = () => {
|
||||
// 初始化功能开关的值
|
||||
// Initialize the value of the function switch
|
||||
initFlags();
|
||||
// 初始化i18n
|
||||
// Initialize i18n
|
||||
initI18nInstance({
|
||||
lng: (localStorage.getItem('i18next') ?? (IS_OVERSEA ? 'en' : 'zh-CN')) as
|
||||
| 'en'
|
||||
| 'zh-CN',
|
||||
});
|
||||
// 动态导入mdbox 样式
|
||||
// Import mdbox styles dynamically
|
||||
dynamicImportMdBoxStyle();
|
||||
|
||||
const $root = document.getElementById('root');
|
||||
|
||||
@@ -16,128 +16,128 @@
|
||||
|
||||
import { lazy } from 'react';
|
||||
|
||||
// 登录页面
|
||||
// login page
|
||||
export const LoginPage = lazy(() =>
|
||||
import('@coze-foundation/account-ui-adapter').then(res => ({
|
||||
default: res.LoginPage,
|
||||
})),
|
||||
);
|
||||
|
||||
// 文档页面
|
||||
// documentation page
|
||||
export const Redirect = lazy(() => import('../pages/redirect'));
|
||||
|
||||
// 工作空间侧边栏组件
|
||||
// Workspace Sidebar Component
|
||||
export const spaceSubMenu = lazy(() =>
|
||||
import('@coze-foundation/space-ui-adapter').then(exps => ({
|
||||
default: exps.WorkspaceSubMenu,
|
||||
})),
|
||||
);
|
||||
|
||||
// 工作空间布局组件
|
||||
// Workspace Layout Component
|
||||
export const SpaceLayout = lazy(() =>
|
||||
import('@coze-foundation/space-ui-adapter').then(exps => ({
|
||||
default: exps.SpaceLayout,
|
||||
})),
|
||||
);
|
||||
|
||||
// 某个具体的工作空间布局组件
|
||||
// A specific workspace layout component
|
||||
export const SpaceIdLayout = lazy(() =>
|
||||
import('@coze-foundation/space-ui-base').then(exps => ({
|
||||
default: exps.SpaceIdLayout,
|
||||
})),
|
||||
);
|
||||
|
||||
// 项目开发页面
|
||||
// project development page
|
||||
export const Develop = lazy(() => import('../pages/develop'));
|
||||
|
||||
// 资源库页面
|
||||
// resource library page
|
||||
export const Library = lazy(() => import('../pages/library'));
|
||||
|
||||
// Agent IDE布局组件
|
||||
// Agent IDE Layout Component
|
||||
export const AgentIDELayout = lazy(
|
||||
() => import('@coze-agent-ide/layout-adapter'),
|
||||
);
|
||||
|
||||
// Agent IDE页面
|
||||
// Agent IDE page
|
||||
export const AgentIDE = lazy(() =>
|
||||
import('@coze-agent-ide/entry-adapter').then(res => ({
|
||||
default: res.BotEditor,
|
||||
})),
|
||||
);
|
||||
|
||||
// Agent IDE发布页面
|
||||
// Agent IDE Release Page
|
||||
export const AgentPublishPage = lazy(() =>
|
||||
import('@coze-agent-ide/agent-publish').then(exps => ({
|
||||
default: exps.AgentPublishPage,
|
||||
})),
|
||||
);
|
||||
|
||||
// Project IDE页面
|
||||
// Project IDE Page
|
||||
export const ProjectIDE = lazy(() =>
|
||||
import('@coze-project-ide/main').then(exps => ({
|
||||
default: exps.IDELayout,
|
||||
})),
|
||||
);
|
||||
|
||||
// Project IDE发布页面
|
||||
// Project IDE Release Page
|
||||
export const ProjectIDEPublish = lazy(() =>
|
||||
import('@coze-studio/project-publish').then(exps => ({
|
||||
default: exps.ProjectPublish,
|
||||
})),
|
||||
);
|
||||
|
||||
// 知识库预览页面
|
||||
// Knowledge Base Preview Page
|
||||
export const KnowledgePreview = lazy(() =>
|
||||
import('@coze-studio/workspace-base/knowledge-preview').then(exps => ({
|
||||
default: exps.KnowledgePreviewPage,
|
||||
})),
|
||||
);
|
||||
|
||||
// 知识库上传页面
|
||||
// Knowledge base upload page
|
||||
export const KnowledgeUpload = lazy(() =>
|
||||
import('@coze-studio/workspace-base/knowledge-upload').then(exps => ({
|
||||
default: exps.KnowledgeUploadPage,
|
||||
})),
|
||||
);
|
||||
|
||||
// 数据库资源页面
|
||||
// database resource page
|
||||
export const DatabaseDetail = lazy(() =>
|
||||
import('@coze-studio/workspace-base').then(exps => ({
|
||||
default: exps.DatabaseDetailPage,
|
||||
})),
|
||||
);
|
||||
|
||||
// 工作流页面
|
||||
// workflow page
|
||||
export const WorkflowPage = lazy(() =>
|
||||
import('@coze-workflow/playground-adapter').then(res => ({
|
||||
default: res.WorkflowPage,
|
||||
})),
|
||||
);
|
||||
|
||||
// 插件资源页面布局组件
|
||||
// plugin resource page layout component
|
||||
export const PluginLayout = lazy(() => import('../pages/plugin/layout'));
|
||||
|
||||
// 插件资源页面
|
||||
// plugin resource page
|
||||
export const PluginPage = lazy(() => import('../pages/plugin/page'));
|
||||
|
||||
// 插件工具页面
|
||||
// plugin tool page
|
||||
export const PluginToolPage = lazy(() => import('../pages/plugin/tool/page'));
|
||||
|
||||
// 探索体验页面二级导航组件
|
||||
// Explore the experience page secondary navigation component
|
||||
export const exploreSubMenu = lazy(() =>
|
||||
import('@coze-community/explore').then(exps => ({
|
||||
default: exps.ExploreSubMenu,
|
||||
})),
|
||||
);
|
||||
|
||||
// 模版页面
|
||||
// template page
|
||||
export const ExploreTemplatePage = lazy(() =>
|
||||
import('@coze-community/explore').then(exps => ({
|
||||
default: exps.TemplatePage,
|
||||
})),
|
||||
);
|
||||
|
||||
// 插件商店页面
|
||||
// plugin store page
|
||||
export const ExplorePluginPage = lazy(() =>
|
||||
import('@coze-community/explore').then(exps => ({
|
||||
default: exps.PluginPage,
|
||||
|
||||
@@ -48,7 +48,7 @@ import {
|
||||
|
||||
export const router: ReturnType<typeof createBrowserRouter> =
|
||||
createBrowserRouter([
|
||||
// 文档路由
|
||||
// Document routing
|
||||
{
|
||||
path: '/open/docs/*',
|
||||
Component: Redirect,
|
||||
@@ -73,7 +73,7 @@ export const router: ReturnType<typeof createBrowserRouter> =
|
||||
requireAuth: false,
|
||||
}),
|
||||
},
|
||||
// 主应用路由
|
||||
// main application route
|
||||
{
|
||||
path: '/',
|
||||
Component: Layout,
|
||||
@@ -83,7 +83,7 @@ export const router: ReturnType<typeof createBrowserRouter> =
|
||||
index: true,
|
||||
element: <Navigate to="/space" replace />,
|
||||
},
|
||||
// 登录页路由
|
||||
// login page routing
|
||||
{
|
||||
path: 'sign',
|
||||
Component: LoginPage,
|
||||
@@ -94,7 +94,7 @@ export const router: ReturnType<typeof createBrowserRouter> =
|
||||
}),
|
||||
},
|
||||
|
||||
// 工作空间路由
|
||||
// Workspace Routing
|
||||
{
|
||||
path: 'space',
|
||||
Component: SpaceLayout,
|
||||
@@ -114,7 +114,7 @@ export const router: ReturnType<typeof createBrowserRouter> =
|
||||
element: <Navigate to="develop" replace />,
|
||||
},
|
||||
|
||||
// 项目开发
|
||||
// Project Development
|
||||
{
|
||||
path: 'develop',
|
||||
Component: Develop,
|
||||
@@ -171,7 +171,7 @@ export const router: ReturnType<typeof createBrowserRouter> =
|
||||
}),
|
||||
},
|
||||
|
||||
// 资源库
|
||||
// resource library
|
||||
{
|
||||
path: 'library',
|
||||
Component: Library,
|
||||
@@ -180,7 +180,7 @@ export const router: ReturnType<typeof createBrowserRouter> =
|
||||
}),
|
||||
},
|
||||
|
||||
// 知识库资源
|
||||
// Knowledge Base Resources
|
||||
{
|
||||
path: 'knowledge',
|
||||
children: [
|
||||
@@ -198,7 +198,7 @@ export const router: ReturnType<typeof createBrowserRouter> =
|
||||
}),
|
||||
},
|
||||
|
||||
// 数据库资源
|
||||
// database resources
|
||||
{
|
||||
path: 'database',
|
||||
children: [
|
||||
@@ -213,7 +213,7 @@ export const router: ReturnType<typeof createBrowserRouter> =
|
||||
}),
|
||||
},
|
||||
|
||||
// 插件资源
|
||||
// plugin resources
|
||||
{
|
||||
path: 'plugin/:plugin_id',
|
||||
Component: PluginLayout,
|
||||
@@ -238,7 +238,7 @@ export const router: ReturnType<typeof createBrowserRouter> =
|
||||
],
|
||||
},
|
||||
|
||||
// 工作流路由
|
||||
// workflow routing
|
||||
{
|
||||
path: 'work_flow',
|
||||
Component: WorkflowPage,
|
||||
@@ -248,7 +248,7 @@ export const router: ReturnType<typeof createBrowserRouter> =
|
||||
}),
|
||||
},
|
||||
|
||||
// 探索
|
||||
// explore
|
||||
{
|
||||
path: 'explore',
|
||||
Component: null,
|
||||
@@ -263,7 +263,7 @@ export const router: ReturnType<typeof createBrowserRouter> =
|
||||
index: true,
|
||||
element: <Navigate to="plugin" replace />,
|
||||
},
|
||||
// 插件商店
|
||||
// plugin store
|
||||
{
|
||||
path: 'plugin',
|
||||
element: <ExplorePluginPage />,
|
||||
@@ -271,7 +271,7 @@ export const router: ReturnType<typeof createBrowserRouter> =
|
||||
type: 'plugin',
|
||||
}),
|
||||
},
|
||||
// 模版
|
||||
// template
|
||||
{
|
||||
path: 'template',
|
||||
element: <ExploreTemplatePage />,
|
||||
|
||||
@@ -27,7 +27,7 @@ console.log(`Got ${contents.length} contents for tailwind`);
|
||||
|
||||
export default {
|
||||
content: contents,
|
||||
// safelist的内容可以允许动态生成tailwind className
|
||||
// Safelist content can allow dynamic tailwind className
|
||||
safelist: [
|
||||
{
|
||||
pattern: /(gap-|grid-).+/,
|
||||
@@ -47,7 +47,7 @@ export default {
|
||||
},
|
||||
},
|
||||
corePlugins: {
|
||||
preflight: false, // 关闭@tailwind base默认样式,避免对现有样式影响
|
||||
preflight: false, // Turn off @tailwind base default styles to avoid affecting existing styles
|
||||
},
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
plugins: [require('@coze-arch/tailwind-config/coze')],
|
||||
|
||||
Reference in New Issue
Block a user