@qlover/create-app 0.7.15 → 0.9.0
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/CHANGELOG.md +21 -0
- package/dist/configs/_common/.github/workflows/general-check.yml +1 -1
- package/dist/configs/_common/.github/workflows/release.yml +2 -2
- package/dist/configs/_common/.gitignore.template +6 -0
- package/dist/configs/_common/.prettierignore +17 -5
- package/dist/configs/_common/.vscode/settings.json +6 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/templates/next-app/.env.template +1 -1
- package/dist/templates/next-app/README.en.md +0 -1
- package/dist/templates/next-app/README.md +0 -1
- package/dist/templates/next-app/config/Identifier/api.ts +5 -5
- package/dist/templates/next-app/config/Identifier/common/admint.table.ts +69 -0
- package/dist/templates/next-app/config/Identifier/common/common.ts +76 -0
- package/dist/templates/next-app/config/Identifier/common/index.ts +3 -0
- package/dist/templates/next-app/config/Identifier/{validator.ts → common/validators.ts} +5 -5
- package/dist/templates/next-app/config/Identifier/index.ts +2 -12
- package/dist/templates/next-app/config/Identifier/pages/index.ts +6 -0
- package/dist/templates/next-app/config/Identifier/pages/page.admin.home.ts +27 -0
- package/dist/templates/next-app/config/Identifier/pages/page.admin.locales.ts +266 -0
- package/dist/templates/next-app/config/Identifier/pages/page.admin.user.ts +293 -0
- package/dist/templates/{react-app/config/Identifier → next-app/config/Identifier/pages}/page.home.ts +15 -22
- package/dist/templates/next-app/config/Identifier/{page.login.ts → pages/page.login.ts} +28 -34
- package/dist/templates/next-app/config/Identifier/{page.register.ts → pages/page.register.ts} +30 -29
- package/dist/templates/next-app/config/adminNavs.ts +19 -0
- package/dist/templates/next-app/config/common.ts +22 -13
- package/dist/templates/next-app/config/i18n/HomeI18n.ts +5 -5
- package/dist/templates/next-app/config/i18n/admin18n.ts +61 -19
- package/dist/templates/next-app/config/i18n/i18nConfig.ts +2 -0
- package/dist/templates/next-app/config/i18n/i18nKeyScheam.ts +36 -0
- package/dist/templates/next-app/config/i18n/loginI18n.ts +22 -22
- package/dist/templates/next-app/config/i18n/register18n.ts +23 -24
- package/dist/templates/next-app/docs/en/index.md +0 -1
- package/dist/templates/next-app/docs/en/project-structure.md +0 -1
- package/dist/templates/next-app/docs/zh/index.md +0 -1
- package/dist/templates/next-app/docs/zh/project-structure.md +0 -1
- package/dist/templates/next-app/make/generateLocales.ts +19 -12
- package/dist/templates/next-app/migrations/schema/LocalesSchema.ts +15 -0
- package/dist/templates/next-app/migrations/sql/1694244000000.sql +11 -0
- package/dist/templates/next-app/package.json +7 -3
- package/dist/templates/next-app/public/locales/en.json +172 -207
- package/dist/templates/next-app/public/locales/zh.json +172 -207
- package/dist/templates/next-app/src/app/[locale]/admin/locales/page.tsx +153 -0
- package/dist/templates/next-app/src/app/[locale]/admin/users/page.tsx +48 -50
- package/dist/templates/next-app/src/app/[locale]/login/LoginForm.tsx +2 -2
- package/dist/templates/next-app/src/app/api/admin/locales/create/route.ts +34 -0
- package/dist/templates/next-app/src/app/api/admin/locales/import/route.ts +40 -0
- package/dist/templates/next-app/src/app/api/admin/locales/route.ts +42 -0
- package/dist/templates/next-app/src/app/api/admin/locales/update/route.ts +32 -0
- package/dist/templates/next-app/src/app/api/locales/json/route.ts +44 -0
- package/dist/templates/next-app/src/base/cases/AdminPageManager.ts +1 -13
- package/dist/templates/next-app/src/base/cases/Datetime.ts +18 -0
- package/dist/templates/next-app/src/base/cases/DialogErrorPlugin.ts +12 -6
- package/dist/templates/next-app/src/base/cases/ResourceState.ts +17 -0
- package/dist/templates/next-app/src/base/cases/TranslateI18nInterface.ts +25 -0
- package/dist/templates/next-app/src/base/cases/ZodColumnBuilder.ts +200 -0
- package/dist/templates/next-app/src/base/port/ZodBuilderInterface.ts +8 -0
- package/dist/templates/next-app/src/base/services/AdminLocalesService.ts +20 -0
- package/dist/templates/next-app/src/base/services/AdminPageEvent.ts +26 -0
- package/dist/templates/next-app/src/base/services/AdminPageScheduler.ts +42 -0
- package/dist/templates/next-app/src/base/services/ResourceService.ts +122 -0
- package/dist/templates/next-app/src/base/services/adminApi/AdminLocalesApi.ts +104 -0
- package/dist/templates/next-app/src/base/services/adminApi/AdminUserApi.ts +38 -5
- package/dist/templates/next-app/src/base/services/appApi/AppApiPlugin.ts +1 -1
- package/dist/templates/next-app/src/i18n/request.ts +30 -1
- package/dist/templates/next-app/src/server/PageParams.ts +2 -10
- package/dist/templates/next-app/src/server/port/DBBridgeInterface.ts +5 -0
- package/dist/templates/next-app/src/server/port/DBTableInterface.ts +2 -0
- package/dist/templates/next-app/src/server/port/LocalesRepositoryInterface.ts +43 -0
- package/dist/templates/next-app/src/server/repositorys/LocalesRepository.ts +197 -0
- package/dist/templates/next-app/src/server/services/ApiLocaleService.ts +122 -0
- package/dist/templates/next-app/src/server/sqlBridges/SupabaseBridge.ts +60 -11
- package/dist/templates/next-app/src/server/validators/ExtendedExecutorError.ts +6 -0
- package/dist/templates/next-app/src/server/validators/LocalesValidator.ts +131 -0
- package/dist/templates/next-app/src/server/validators/LoginValidator.ts +2 -5
- package/dist/templates/next-app/src/server/validators/PaginationValidator.ts +32 -16
- package/dist/templates/next-app/src/styles/css/antd-themes/pagination/_default.css +2 -1
- package/dist/templates/next-app/src/styles/css/antd-themes/pagination/dark.css +28 -29
- package/dist/templates/next-app/src/styles/css/antd-themes/pagination/pink.css +2 -1
- package/dist/templates/next-app/src/uikit/components/AdminLayout.tsx +17 -3
- package/dist/templates/next-app/src/uikit/components/BaseHeader.tsx +5 -4
- package/dist/templates/next-app/src/uikit/components/BaseLayout.tsx +5 -4
- package/dist/templates/next-app/src/uikit/components/BootstrapsProvider.tsx +3 -2
- package/dist/templates/next-app/src/uikit/components/ComboProvider.tsx +1 -1
- package/dist/templates/next-app/src/uikit/components/EditableCell.tsx +118 -0
- package/dist/templates/next-app/src/uikit/components/LogoutButton.tsx +5 -6
- package/dist/templates/next-app/src/uikit/components/ThemeSwitcher.tsx +1 -1
- package/dist/templates/next-app/src/uikit/components/With.tsx +2 -2
- package/dist/templates/next-app/src/uikit/components/localesImportButton/LocalesImportButton.tsx +62 -0
- package/dist/templates/next-app/src/uikit/components/localesImportButton/LocalesImportEvent.ts +28 -0
- package/dist/templates/next-app/src/uikit/components/localesImportButton/import.module.css +6 -0
- package/dist/templates/next-app/src/uikit/hook/useI18nInterface.ts +8 -14
- package/dist/templates/next-app/src/uikit/hook/useWarnTranslations.ts +25 -0
- package/dist/templates/react-app/.prettierignore +17 -0
- package/dist/templates/react-app/README.en.md +71 -54
- package/dist/templates/react-app/README.md +35 -18
- package/dist/templates/react-app/__tests__/__mocks__/BootstrapTest.ts +14 -0
- package/dist/templates/react-app/__tests__/__mocks__/MockAppConfit.ts +1 -1
- package/dist/templates/react-app/__tests__/__mocks__/MockDialogHandler.ts +2 -2
- package/dist/templates/react-app/__tests__/__mocks__/MockLogger.ts +1 -1
- package/dist/templates/react-app/__tests__/__mocks__/components/TestApp.tsx +45 -0
- package/dist/templates/react-app/__tests__/__mocks__/components/TestBootstrapsProvider.tsx +34 -0
- package/dist/templates/react-app/__tests__/__mocks__/components/TestRouter.tsx +46 -0
- package/dist/templates/react-app/__tests__/__mocks__/components/index.ts +12 -0
- package/dist/templates/react-app/__tests__/__mocks__/createMockGlobals.ts +1 -2
- package/dist/templates/react-app/__tests__/__mocks__/testIOC/TestIOC.ts +51 -0
- package/dist/templates/react-app/__tests__/__mocks__/testIOC/TestIOCRegister.ts +69 -0
- package/dist/templates/react-app/__tests__/setup/index.ts +1 -51
- package/dist/templates/react-app/__tests__/setup/setupGlobal.ts +51 -0
- package/dist/templates/react-app/__tests__/src/App.structure.test.tsx +115 -0
- package/dist/templates/react-app/__tests__/src/base/cases/AppConfig.test.ts +2 -2
- package/dist/templates/react-app/__tests__/src/base/cases/AppError.test.ts +1 -1
- package/dist/templates/react-app/__tests__/src/base/cases/DialogHandler.test.ts +3 -5
- package/dist/templates/react-app/__tests__/src/base/cases/I18nKeyErrorPlugin.test.ts +13 -2
- package/dist/templates/react-app/__tests__/src/base/cases/InversifyContainer.test.ts +1 -1
- package/dist/templates/react-app/__tests__/src/base/cases/PublicAssetsPath.test.ts +1 -1
- package/dist/templates/react-app/__tests__/src/base/cases/RequestLogger.test.ts +5 -5
- package/dist/templates/react-app/__tests__/src/base/cases/RequestStatusCatcher.test.ts +1 -2
- package/dist/templates/react-app/__tests__/src/base/cases/RouterLoader.test.ts +25 -15
- package/dist/templates/react-app/__tests__/src/base/services/I18nService.test.ts +29 -15
- package/dist/templates/react-app/__tests__/src/core/IOC.test.ts +19 -9
- package/dist/templates/react-app/__tests__/src/core/bootstraps/BootstrapClient.test.ts +153 -0
- package/dist/templates/react-app/__tests__/src/core/bootstraps/BootstrapsApp.test.ts +9 -7
- package/dist/templates/react-app/__tests__/src/main.integration.test.tsx +4 -5
- package/dist/templates/react-app/__tests__/src/main.test.tsx +4 -4
- package/dist/templates/react-app/__tests__/src/uikit/components/BaseHeader.test.tsx +68 -59
- package/dist/templates/react-app/__tests__/src/uikit/components/chatMessage/ChatRoot.test.tsx +274 -0
- package/dist/templates/react-app/config/IOCIdentifier.ts +11 -8
- package/dist/templates/react-app/config/Identifier/{common.error.ts → common/common.error.ts} +5 -5
- package/dist/templates/react-app/config/Identifier/{common.ts → common/common.ts} +9 -9
- package/dist/templates/react-app/config/Identifier/common/index.ts +2 -0
- package/dist/templates/react-app/config/Identifier/components/component.chatMessage.ts +56 -0
- package/dist/templates/react-app/config/Identifier/components/component.messageBaseList.ts +103 -0
- package/dist/templates/react-app/config/Identifier/index.ts +1 -9
- package/dist/templates/react-app/config/Identifier/pages/index.ts +9 -0
- package/dist/templates/react-app/config/Identifier/{page.about.ts → pages/page.about.ts} +34 -26
- package/dist/templates/react-app/config/Identifier/{page.executor.ts → pages/page.executor.ts} +47 -39
- package/dist/templates/{next-app/config/Identifier → react-app/config/Identifier/pages}/page.home.ts +24 -23
- package/dist/templates/react-app/config/Identifier/pages/page.identifiter.ts +102 -0
- package/dist/templates/react-app/config/Identifier/{page.jsonStorage.ts → pages/page.jsonStorage.ts} +18 -11
- package/dist/templates/react-app/config/Identifier/{page.login.ts → pages/page.login.ts} +37 -27
- package/dist/templates/react-app/config/Identifier/pages/page.message.ts +20 -0
- package/dist/templates/react-app/config/Identifier/{page.register.ts → pages/page.register.ts} +37 -25
- package/dist/templates/react-app/config/Identifier/{page.request.ts → pages/page.request.ts} +34 -44
- package/dist/templates/react-app/config/app.router.ts +81 -61
- package/dist/templates/react-app/config/i18n/PageI18nInterface.ts +51 -0
- package/dist/templates/react-app/config/i18n/aboutI18n.ts +42 -0
- package/dist/templates/react-app/config/i18n/chatMessageI18n.ts +17 -0
- package/dist/templates/react-app/config/i18n/executorI18n.ts +51 -0
- package/dist/templates/react-app/config/i18n/homeI18n.ts +24 -0
- package/dist/templates/react-app/config/i18n/i18nConfig.ts +30 -0
- package/dist/templates/react-app/config/i18n/identifiter18n.ts +30 -0
- package/dist/templates/react-app/config/i18n/jsonStorage18n.ts +27 -0
- package/dist/templates/react-app/config/i18n/login18n.ts +42 -0
- package/dist/templates/react-app/config/i18n/messageBaseListI18n.ts +22 -0
- package/dist/templates/react-app/config/i18n/messageI18n.ts +14 -0
- package/dist/templates/react-app/config/i18n/notFoundI18n.ts +34 -0
- package/dist/templates/react-app/config/i18n/register18n.ts +40 -0
- package/dist/templates/react-app/config/i18n/request18n.ts +41 -0
- package/dist/templates/react-app/config/theme.ts +14 -4
- package/dist/templates/react-app/docs/en/bootstrap.md +1670 -341
- package/dist/templates/react-app/docs/en/components/chat-message-component.md +314 -0
- package/dist/templates/react-app/docs/en/components/chat-message-refactor.md +270 -0
- package/dist/templates/react-app/docs/en/components/message-base-list-component.md +172 -0
- package/dist/templates/react-app/docs/en/development-guide.md +1021 -345
- package/dist/templates/react-app/docs/en/env.md +1132 -278
- package/dist/templates/react-app/docs/en/i18n.md +858 -147
- package/dist/templates/react-app/docs/en/index.md +733 -104
- package/dist/templates/react-app/docs/en/ioc.md +1228 -287
- package/dist/templates/react-app/docs/en/playwright/e2e-tests.md +321 -0
- package/dist/templates/react-app/docs/en/playwright/index.md +19 -0
- package/dist/templates/react-app/docs/en/playwright/installation-summary.md +332 -0
- package/dist/templates/react-app/docs/en/playwright/overview.md +222 -0
- package/dist/templates/react-app/docs/en/playwright/quickstart.md +325 -0
- package/dist/templates/react-app/docs/en/playwright/reorganization-notes.md +340 -0
- package/dist/templates/react-app/docs/en/playwright/setup-complete.md +290 -0
- package/dist/templates/react-app/docs/en/playwright/testing-guide.md +565 -0
- package/dist/templates/react-app/docs/en/store.md +1194 -184
- package/dist/templates/react-app/docs/en/why-no-globals.md +797 -0
- package/dist/templates/react-app/docs/zh/bootstrap.md +1670 -341
- package/dist/templates/react-app/docs/zh/components/chat-message-component.md +314 -0
- package/dist/templates/react-app/docs/zh/components/chat-message-refactor.md +270 -0
- package/dist/templates/react-app/docs/zh/components/message-base-list-component.md +172 -0
- package/dist/templates/react-app/docs/zh/development-guide.md +1021 -345
- package/dist/templates/react-app/docs/zh/env.md +1132 -275
- package/dist/templates/react-app/docs/zh/i18n.md +858 -147
- package/dist/templates/react-app/docs/zh/index.md +717 -104
- package/dist/templates/react-app/docs/zh/ioc.md +1229 -287
- package/dist/templates/react-app/docs/zh/playwright/e2e-tests.md +321 -0
- package/dist/templates/react-app/docs/zh/playwright/index.md +19 -0
- package/dist/templates/react-app/docs/zh/playwright/installation-summary.md +332 -0
- package/dist/templates/react-app/docs/zh/playwright/overview.md +222 -0
- package/dist/templates/react-app/docs/zh/playwright/quickstart.md +325 -0
- package/dist/templates/react-app/docs/zh/playwright/reorganization-notes.md +340 -0
- package/dist/templates/react-app/docs/zh/playwright/setup-complete.md +290 -0
- package/dist/templates/react-app/docs/zh/playwright/testing-guide.md +565 -0
- package/dist/templates/react-app/docs/zh/store.md +1192 -184
- package/dist/templates/react-app/docs/zh/why-no-globals.md +797 -0
- package/dist/templates/react-app/e2e/App.spec.ts +319 -0
- package/dist/templates/react-app/e2e/fixtures/base.fixture.ts +40 -0
- package/dist/templates/react-app/e2e/main.spec.ts +20 -0
- package/dist/templates/react-app/e2e/utils/test-helpers.ts +19 -0
- package/dist/templates/react-app/eslint.config.mjs +247 -0
- package/dist/templates/react-app/makes/eslint-utils.mjs +195 -0
- package/dist/templates/react-app/makes/generateTs2LocalesOptions.ts +26 -0
- package/dist/templates/react-app/package.json +31 -3
- package/dist/templates/react-app/playwright.config.ts +79 -0
- package/dist/templates/react-app/public/locales/en/common.json +233 -179
- package/dist/templates/react-app/public/locales/zh/common.json +233 -179
- package/dist/templates/react-app/src/App.tsx +15 -42
- package/dist/templates/react-app/src/base/apis/AiApi.ts +5 -5
- package/dist/templates/react-app/src/base/apis/feApi/FeApi.ts +1 -1
- package/dist/templates/react-app/src/base/apis/feApi/FeApiAdapter.ts +1 -1
- package/dist/templates/react-app/src/base/apis/feApi/FeApiBootstarp.ts +8 -8
- package/dist/templates/react-app/src/base/apis/feApi/FeApiType.ts +1 -1
- package/dist/templates/react-app/src/base/apis/userApi/UserApi.ts +6 -6
- package/dist/templates/react-app/src/base/apis/userApi/UserApiAdapter.ts +1 -1
- package/dist/templates/react-app/src/base/apis/userApi/UserApiBootstarp.ts +12 -14
- package/dist/templates/react-app/src/base/apis/userApi/UserApiType.ts +1 -1
- package/dist/templates/react-app/src/base/cases/DialogHandler.ts +5 -2
- package/dist/templates/react-app/src/base/cases/I18nKeyErrorPlugin.ts +3 -3
- package/dist/templates/react-app/src/base/cases/InversifyContainer.ts +3 -3
- package/dist/templates/react-app/src/base/cases/RequestLanguages.ts +2 -2
- package/dist/templates/react-app/src/base/cases/RequestLogger.ts +4 -4
- package/dist/templates/react-app/src/base/cases/RequestStatusCatcher.ts +1 -1
- package/dist/templates/react-app/src/base/cases/ResourceState.ts +23 -0
- package/dist/templates/react-app/src/base/cases/RouterLoader.ts +4 -4
- package/dist/templates/react-app/src/base/cases/TranslateI18nInterface.ts +26 -0
- package/dist/templates/react-app/src/base/port/ExecutorPageBridgeInterface.ts +2 -3
- package/dist/templates/react-app/src/base/port/I18nServiceInterface.ts +1 -1
- package/dist/templates/react-app/src/base/port/IOCInterface.ts +36 -0
- package/dist/templates/react-app/src/base/port/JSONStoragePageBridgeInterface.ts +2 -1
- package/dist/templates/react-app/src/base/port/ProcesserExecutorInterface.ts +1 -1
- package/dist/templates/react-app/src/base/port/RequestPageBridgeInterface.ts +2 -2
- package/dist/templates/react-app/src/base/port/RouteServiceInterface.ts +9 -5
- package/dist/templates/react-app/src/base/port/UserServiceInterface.ts +1 -1
- package/dist/templates/react-app/src/base/services/I18nService.ts +29 -29
- package/dist/templates/react-app/src/base/services/IdentifierService.ts +143 -0
- package/dist/templates/react-app/src/base/services/ProcesserExecutor.ts +3 -3
- package/dist/templates/react-app/src/base/services/RouteService.ts +27 -8
- package/dist/templates/react-app/src/base/services/UserService.ts +8 -8
- package/dist/templates/react-app/src/base/types/Page.ts +14 -2
- package/dist/templates/react-app/src/base/types/global.d.ts +1 -1
- package/dist/templates/react-app/src/core/IOC.ts +5 -46
- package/dist/templates/react-app/src/core/bootstraps/{BootstrapApp.ts → BootstrapClient.ts} +44 -17
- package/dist/templates/react-app/src/core/bootstraps/BootstrapsRegistry.ts +14 -7
- package/dist/templates/react-app/src/core/bootstraps/IocIdentifierTest.ts +1 -1
- package/dist/templates/react-app/src/core/bootstraps/PrintBootstrap.ts +1 -1
- package/dist/templates/react-app/src/core/clientIoc/ClientIOC.ts +40 -0
- package/dist/templates/react-app/src/core/{IocRegisterImpl.ts → clientIoc/ClientIOCRegister.ts} +35 -24
- package/dist/templates/react-app/src/core/globals.ts +9 -9
- package/dist/templates/react-app/src/main.tsx +4 -4
- package/dist/templates/react-app/src/pages/404.tsx +6 -3
- package/dist/templates/react-app/src/pages/500.tsx +5 -2
- package/dist/templates/react-app/src/pages/NoRouteFound.tsx +5 -0
- package/dist/templates/react-app/src/pages/auth/Layout.tsx +9 -6
- package/dist/templates/react-app/src/pages/auth/LoginPage.tsx +46 -56
- package/dist/templates/react-app/src/pages/auth/RegisterPage.tsx +46 -58
- package/dist/templates/react-app/src/pages/base/AboutPage.tsx +35 -40
- package/dist/templates/react-app/src/pages/base/ExecutorPage.tsx +51 -51
- package/dist/templates/react-app/src/pages/base/HomePage.tsx +14 -15
- package/dist/templates/react-app/src/pages/base/IdentifierPage.tsx +70 -11
- package/dist/templates/react-app/src/pages/base/JSONStoragePage.tsx +24 -25
- package/dist/templates/react-app/src/pages/base/Layout.tsx +2 -2
- package/dist/templates/react-app/src/pages/base/MessagePage.tsx +40 -0
- package/dist/templates/react-app/src/pages/base/RedirectPathname.tsx +3 -2
- package/dist/templates/react-app/src/pages/base/RequestPage.tsx +41 -59
- package/dist/templates/react-app/src/styles/css/antd-themes/{_default.css → _common/_default.css} +85 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/{dark.css → _common/dark.css} +99 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/_common/index.css +3 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/{pink.css → _common/pink.css} +86 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/index.css +4 -3
- package/dist/templates/react-app/src/styles/css/antd-themes/menu/_default.css +108 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/menu/dark.css +67 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/menu/index.css +3 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/menu/pink.css +67 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/pagination/_default.css +34 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/pagination/dark.css +31 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/pagination/index.css +3 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/pagination/pink.css +36 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/table/_default.css +44 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/table/dark.css +43 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/table/index.css +3 -0
- package/dist/templates/react-app/src/styles/css/antd-themes/table/pink.css +43 -0
- package/dist/templates/react-app/src/styles/css/page.css +4 -3
- package/dist/templates/react-app/src/styles/css/themes/_default.css +1 -0
- package/dist/templates/react-app/src/styles/css/themes/dark.css +1 -0
- package/dist/templates/react-app/src/styles/css/themes/pink.css +1 -0
- package/dist/templates/react-app/src/styles/css/zIndex.css +1 -1
- package/dist/templates/react-app/src/uikit/bridges/ExecutorPageBridge.ts +3 -3
- package/dist/templates/react-app/src/uikit/bridges/JSONStoragePageBridge.ts +2 -2
- package/dist/templates/react-app/src/uikit/bridges/NavigateBridge.ts +1 -1
- package/dist/templates/react-app/src/uikit/bridges/RequestPageBridge.ts +3 -3
- package/dist/templates/react-app/src/uikit/components/AppRouterProvider.tsx +35 -0
- package/dist/templates/react-app/src/uikit/components/BaseHeader.tsx +15 -11
- package/dist/templates/react-app/src/uikit/components/BaseRouteProvider.tsx +14 -11
- package/dist/templates/react-app/src/uikit/components/BaseRouteSeo.tsx +18 -0
- package/dist/templates/react-app/src/uikit/components/BootstrapsProvider.tsx +13 -0
- package/dist/templates/react-app/src/uikit/components/ClientSeo.tsx +62 -0
- package/dist/templates/react-app/src/uikit/components/ComboProvider.tsx +38 -0
- package/dist/templates/react-app/src/uikit/components/LanguageSwitcher.tsx +48 -27
- package/dist/templates/react-app/src/uikit/components/Loading.tsx +4 -2
- package/dist/templates/react-app/src/uikit/components/LocaleLink.tsx +4 -5
- package/dist/templates/react-app/src/uikit/components/LogoutButton.tsx +34 -11
- package/dist/templates/react-app/src/uikit/components/MessageBaseList.tsx +240 -0
- package/dist/templates/react-app/src/uikit/components/ProcessExecutorProvider.tsx +9 -5
- package/dist/templates/react-app/src/uikit/components/RouterRenderComponent.tsx +6 -3
- package/dist/templates/react-app/src/uikit/components/ThemeSwitcher.tsx +97 -40
- package/dist/templates/react-app/src/uikit/components/UserAuthProvider.tsx +5 -5
- package/dist/templates/react-app/src/uikit/components/With.tsx +17 -0
- package/dist/templates/react-app/src/uikit/components/chatMessage/ChatMessageBridge.ts +176 -0
- package/dist/templates/react-app/src/uikit/components/chatMessage/ChatRoot.tsx +21 -0
- package/dist/templates/react-app/src/uikit/components/chatMessage/FocusBar.tsx +106 -0
- package/dist/templates/react-app/src/uikit/components/chatMessage/MessageApi.ts +271 -0
- package/dist/templates/react-app/src/uikit/components/chatMessage/MessageItem.tsx +102 -0
- package/dist/templates/react-app/src/uikit/components/chatMessage/MessagesList.tsx +86 -0
- package/dist/templates/react-app/src/uikit/contexts/BaseRouteContext.ts +17 -11
- package/dist/templates/react-app/src/uikit/contexts/IOCContext.ts +13 -0
- package/dist/templates/react-app/src/uikit/hooks/useAppTranslation.ts +26 -0
- package/dist/templates/react-app/src/uikit/hooks/useI18nGuard.ts +8 -11
- package/dist/templates/react-app/src/uikit/hooks/useI18nInterface.ts +25 -0
- package/dist/templates/react-app/src/uikit/hooks/useIOC.ts +35 -0
- package/dist/templates/react-app/src/uikit/hooks/useNavigateBridge.ts +3 -3
- package/dist/templates/react-app/src/uikit/hooks/useStrictEffect.ts +0 -1
- package/dist/templates/react-app/tsconfig.e2e.json +21 -0
- package/dist/templates/react-app/tsconfig.json +8 -1
- package/dist/templates/react-app/tsconfig.node.json +1 -1
- package/dist/templates/react-app/tsconfig.test.json +3 -1
- package/dist/templates/react-app/vite.config.ts +50 -34
- package/package.json +2 -1
- package/dist/configs/react-app/eslint.config.js +0 -94
- package/dist/templates/next-app/config/Identifier/common.error.ts +0 -41
- package/dist/templates/next-app/config/Identifier/common.ts +0 -69
- package/dist/templates/next-app/config/Identifier/page.about.ts +0 -181
- package/dist/templates/next-app/config/Identifier/page.admin.ts +0 -48
- package/dist/templates/next-app/config/Identifier/page.executor.ts +0 -272
- package/dist/templates/next-app/config/Identifier/page.identifiter.ts +0 -39
- package/dist/templates/next-app/config/Identifier/page.jsonStorage.ts +0 -72
- package/dist/templates/next-app/config/Identifier/page.request.ts +0 -182
- package/dist/templates/next-app/src/base/cases/ChatAction.ts +0 -21
- package/dist/templates/next-app/src/base/cases/FocusBarAction.ts +0 -36
- package/dist/templates/next-app/src/base/cases/RequestState.ts +0 -20
- package/dist/templates/next-app/src/base/port/AdminPageInterface.ts +0 -85
- package/dist/templates/next-app/src/base/port/AsyncStateInterface.ts +0 -7
- package/dist/templates/next-app/src/base/services/AdminUserService.ts +0 -45
- package/dist/templates/next-app/src/uikit/components/ChatRoot.tsx +0 -17
- package/dist/templates/next-app/src/uikit/components/chat/ChatActionInterface.ts +0 -30
- package/dist/templates/next-app/src/uikit/components/chat/ChatFocusBar.tsx +0 -65
- package/dist/templates/next-app/src/uikit/components/chat/ChatMessages.tsx +0 -59
- package/dist/templates/next-app/src/uikit/components/chat/ChatWrap.tsx +0 -28
- package/dist/templates/next-app/src/uikit/components/chat/FocusBarActionInterface.ts +0 -19
- package/dist/templates/next-app/src/uikit/hook/useMountedClient.ts +0 -17
- package/dist/templates/next-app/src/uikit/hook/useStore.ts +0 -15
- package/dist/templates/react-app/__tests__/__mocks__/I18nService.ts +0 -13
- package/dist/templates/react-app/__tests__/src/App.test.tsx +0 -139
- package/dist/templates/react-app/config/Identifier/page.identifiter.ts +0 -39
- package/dist/templates/react-app/config/i18n.ts +0 -15
- package/dist/templates/react-app/docs/en/project-structure.md +0 -434
- package/dist/templates/react-app/docs/zh/project-structure.md +0 -434
- package/dist/templates/react-app/src/base/cases/RequestState.ts +0 -20
- package/dist/templates/react-app/src/base/port/AsyncStateInterface.ts +0 -7
- package/dist/templates/react-app/src/uikit/hooks/useDocumentTitle.ts +0 -15
- package/dist/templates/react-app/src/uikit/hooks/useStore.ts +0 -15
|
@@ -1,209 +1,174 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
"
|
|
96
|
-
"
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
"
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"
|
|
112
|
-
"
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
"
|
|
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
|
-
"
|
|
153
|
-
"
|
|
154
|
-
"
|
|
155
|
-
"
|
|
156
|
-
"
|
|
157
|
-
"
|
|
158
|
-
"
|
|
159
|
-
"
|
|
160
|
-
"
|
|
161
|
-
"
|
|
162
|
-
"
|
|
163
|
-
"
|
|
164
|
-
"
|
|
165
|
-
"
|
|
166
|
-
"
|
|
167
|
-
"
|
|
168
|
-
"
|
|
169
|
-
"
|
|
170
|
-
"
|
|
171
|
-
"
|
|
172
|
-
"
|
|
173
|
-
"
|
|
174
|
-
"page__request__random_user__description": "RequestTransaction 类式 api, 使用了 FetchURLPlugin, RequestCommonPlugin, ApiMockPlugin, FetchAbortPlugin, RequestLogger, ApiCatchPlugin 插件, 其中 FetchAbortPlugin 可以中止请求, ApiCatchPlugin 可以将捕获的错误统一到 apiCatchResult 字段",
|
|
175
|
-
"page__request__api_catch__title": "UserApi: Api Catch Result",
|
|
176
|
-
"page__request__abort__title": "UserApi: Abort Request",
|
|
177
|
-
"page__request__trigger_abort": "触发中止请求",
|
|
178
|
-
"page__request__stop_abort": "停止中止请求",
|
|
179
|
-
"page__request__trigger_api_catch": "触发 API 捕获结果",
|
|
180
|
-
"page__request__stop_api_catch": "停止 API 捕获结果",
|
|
181
|
-
"page__login__content": "登录页面内容",
|
|
182
|
-
"page__login__keywords": "登录页面关键词",
|
|
183
|
-
"err__server__auth__error": "服务器认证错误",
|
|
184
|
-
"page__home__keywords": "现代前端实用库, 实用工具, 组件",
|
|
185
|
-
"api__user__not_found": "用户未找到",
|
|
186
|
-
"api__user__already_exists": "用户已存在",
|
|
187
|
-
"RESPONSE_NOT_OK": "响应不正确",
|
|
188
|
-
"v_login_params_required": "不是一个有效的登录参数",
|
|
189
|
-
"validator_email_invalid": "邮箱格式无效的验证消息",
|
|
190
|
-
"validator_password_min_length": "密码最小长度验证消息(6)",
|
|
191
|
-
"validator_password_max_length": "密码最大长度验证消息(50)",
|
|
192
|
-
"validator_password_special_chars": "密码不能包含空格的验证消息",
|
|
193
|
-
"page__register__content": "创建账号页面内容",
|
|
194
|
-
"page__register__keywords": "创建账号页面关键词",
|
|
195
|
-
"register__welcome": "欢迎来到我们的平台",
|
|
196
|
-
"register__feature__ai_paths": "AI路径",
|
|
197
|
-
"register__feature__smart_recommendations": "智能推荐",
|
|
198
|
-
"register__feature__progress_tracking": "进度跟踪",
|
|
199
|
-
"page__head__admin__title": "管理后台",
|
|
200
|
-
"api__not_authorized": "未授权",
|
|
201
|
-
"api__page__invalid": "页码不正确",
|
|
202
|
-
"page__admin__title": "管理员页面",
|
|
203
|
-
"page__admin__description": "管理员页面",
|
|
204
|
-
"page__admin__keywords": "管理员页面关键词",
|
|
205
|
-
"admin__welcome": "欢迎来到管理员页面",
|
|
206
|
-
"page__admin__users__title": "后台管理 - 管理员用户页面",
|
|
207
|
-
"page__admin__users__description": "后台管理 - 管理员用户页面",
|
|
208
|
-
"page__admin__users__keywords": "后台管理 - 管理员用户页面关键词"
|
|
2
|
+
"api:user__not_found": "用户未找到",
|
|
3
|
+
"api:user__already_exists": "用户已存在",
|
|
4
|
+
"api:RESPONSE_NOT_OK": "响应不正确",
|
|
5
|
+
"api:not_authorized": "未授权",
|
|
6
|
+
"api:page__invalid": "页码不正确",
|
|
7
|
+
"common:admin_table__create": "新建",
|
|
8
|
+
"common:admin_table__refresh": "刷新",
|
|
9
|
+
"common:admin_table__search": "搜索",
|
|
10
|
+
"common:admin_table__reset": "重置",
|
|
11
|
+
"common:admin_table__export": "导出",
|
|
12
|
+
"common:admin_table__settings": "设置",
|
|
13
|
+
"common:admin_table__action": "操作",
|
|
14
|
+
"common:admin_table__edit": "编辑",
|
|
15
|
+
"common:admin_table__delete": "删除",
|
|
16
|
+
"common:admin_table__detail": "详情",
|
|
17
|
+
"common:save": "保存",
|
|
18
|
+
"common:cancel": "取消",
|
|
19
|
+
"common:create": "创建",
|
|
20
|
+
"common:detail": "详情",
|
|
21
|
+
"common:theme__default": "默认主题",
|
|
22
|
+
"common:theme__dark": "暗色主题",
|
|
23
|
+
"common:theme__pink": "粉色主题",
|
|
24
|
+
"common:admin__title": "管理后台",
|
|
25
|
+
"common:logout__dialog__title": "登出",
|
|
26
|
+
"common:logout__dialog__content": "确定要登出吗?",
|
|
27
|
+
"common:i18n_key_invalid": "i18n 键格式不正确",
|
|
28
|
+
"common:v:login_params_required": "不是一个有效的登录参数",
|
|
29
|
+
"common:v:email_invalid": "邮箱格式无效的验证消息",
|
|
30
|
+
"common:v:password_min_length": "密码最小长度验证消息(6)",
|
|
31
|
+
"common:v:password_max_length": "密码最大长度验证消息(50)",
|
|
32
|
+
"common:v:password_special_chars": "密码不能包含空格的验证消息",
|
|
33
|
+
"admin_home:title": "管理员页面",
|
|
34
|
+
"admin_home:description": "管理员页面",
|
|
35
|
+
"admin_home:keywords": "管理员页面关键词",
|
|
36
|
+
"admin_home:welcome": "欢迎来到管理员页面",
|
|
37
|
+
"admin_locales:title": "后台管理 - 管理员语言页面",
|
|
38
|
+
"admin_locales:description": "后台管理 - 管理员语言页面",
|
|
39
|
+
"admin_locales:keywords": "后台管理 - 管理员语言页面关键词",
|
|
40
|
+
"admin_locales:id__title": "id 标题",
|
|
41
|
+
"admin_locales:id__description": "后台管理 - 管理员语言页面 id 描述",
|
|
42
|
+
"admin_locales:id__label": "后台管理 - 管理员语言页面 id 标签",
|
|
43
|
+
"admin_locales:id__placeholder": "id 占位符",
|
|
44
|
+
"admin_locales:id__error": "id 错误",
|
|
45
|
+
"admin_locales:value__title": "value 标题",
|
|
46
|
+
"admin_locales:value__label": "value 标签",
|
|
47
|
+
"admin_locales:value__placeholder": "value 占位符",
|
|
48
|
+
"admin_locales:en__title": "en 标题",
|
|
49
|
+
"admin_locales:en__label": "en 标签",
|
|
50
|
+
"admin_locales:en__placeholder": "en 占位符",
|
|
51
|
+
"admin_locales:zh__title": "zh 标题",
|
|
52
|
+
"admin_locales:zh__label": "zh 标签",
|
|
53
|
+
"admin_locales:zh__placeholder": "zh 占位符",
|
|
54
|
+
"admin_locales:description__title": "description 标题",
|
|
55
|
+
"admin_locales:description__label": "description 标签",
|
|
56
|
+
"admin_locales:description__placeholder": "description 占位符",
|
|
57
|
+
"admin_locales:namespace__title": "namespace 标题",
|
|
58
|
+
"admin_locales:namespace__label": "namespace 标签",
|
|
59
|
+
"admin_locales:namespace__placeholder": "namespace 占位符",
|
|
60
|
+
"admin_locales:created_at__title": "created at 标题",
|
|
61
|
+
"admin_locales:created_at__label": "created at 标签",
|
|
62
|
+
"admin_locales:created_at__placeholder": "created at 占位符",
|
|
63
|
+
"admin_locales:updated_at__title": "updated at 标题",
|
|
64
|
+
"admin_locales:updated_at__label": "updated at 标签",
|
|
65
|
+
"admin_locales:updated_at__placeholder": "updated at 占位符",
|
|
66
|
+
"admin_locales:import__title": "导入国际化数据",
|
|
67
|
+
"admin_locales:import__zh__title": "导入中文数据",
|
|
68
|
+
"admin_locales:import__en__title": "导入英文数据",
|
|
69
|
+
"admin_locales:create__title": "创建国际化数据",
|
|
70
|
+
"admin_locales:edit__title": "编辑国际化数据",
|
|
71
|
+
"admin_locales:detail__title": "查看国际化数据",
|
|
72
|
+
"admin_locales:delete__title": "删除国际化数据",
|
|
73
|
+
"admin_locales:delete__content": "删除国际化数据内容",
|
|
74
|
+
"admin_users:title": "后台管理 - 管理员用户页面",
|
|
75
|
+
"admin_users:description": "后台管理 - 管理员用户页面",
|
|
76
|
+
"admin_users:keywords": "后台管理 - 管理员用户页面关键词",
|
|
77
|
+
"admin_users:create__title": "创建用户",
|
|
78
|
+
"admin_users:edit__title": "编辑用户",
|
|
79
|
+
"admin_users:detail__title": "查看用户",
|
|
80
|
+
"admin_users:delete__title": "删除用户",
|
|
81
|
+
"admin_users:delete__content": "删除用户内容",
|
|
82
|
+
"admin_users:id__title": "标题",
|
|
83
|
+
"admin_users:id__description": "ID 描述",
|
|
84
|
+
"admin_users:id__label": "ID 标签",
|
|
85
|
+
"admin_users:id__placeholder": "ID 占位符",
|
|
86
|
+
"admin_users:role__title": "角色",
|
|
87
|
+
"admin_users:role__description": "角色描述",
|
|
88
|
+
"admin_users:role__label": "角色标签",
|
|
89
|
+
"admin_users:role__placeholder": "角色占位符",
|
|
90
|
+
"admin_users:email__title": "邮箱",
|
|
91
|
+
"admin_users:email__description": "邮箱描述",
|
|
92
|
+
"admin_users:email__label": "邮箱标签",
|
|
93
|
+
"admin_users:email__placeholder": "邮箱占位符",
|
|
94
|
+
"admin_users:password__title": "密码",
|
|
95
|
+
"admin_users:password__description": "用户密码",
|
|
96
|
+
"admin_users:password__label": "密码",
|
|
97
|
+
"admin_users:password__placeholder": "请输入密码",
|
|
98
|
+
"admin_users:credential_token__title": "凭证令牌",
|
|
99
|
+
"admin_users:credential_token__description": "用户凭证令牌",
|
|
100
|
+
"admin_users:credential_token__label": "凭证令牌",
|
|
101
|
+
"admin_users:credential_token__placeholder": "凭证令牌",
|
|
102
|
+
"admin_users:email_confirmed_at__title": "邮箱确认时间",
|
|
103
|
+
"admin_users:email_confirmed_at__description": "邮箱确认时间",
|
|
104
|
+
"admin_users:email_confirmed_at__label": "邮箱确认时间",
|
|
105
|
+
"admin_users:email_confirmed_at__placeholder": "邮箱确认时间",
|
|
106
|
+
"admin_users:created_at__title": "创建时间",
|
|
107
|
+
"admin_users:created_at__description": "用户创建时间",
|
|
108
|
+
"admin_users:created_at__label": "创建时间",
|
|
109
|
+
"admin_users:created_at__placeholder": "创建时间",
|
|
110
|
+
"admin_users:updated_at__title": "更新时间",
|
|
111
|
+
"admin_users:updated_at__description": "用户更新时间",
|
|
112
|
+
"admin_users:updated_at__label": "更新时间",
|
|
113
|
+
"admin_users:updated_at__placeholder": "更新时间",
|
|
114
|
+
"page_home:title": "首页",
|
|
115
|
+
"page_home:description": "一个现代前端实用库集合,提供各种实用工具和组件",
|
|
116
|
+
"page_home:keywords": "现代前端实用库, 实用工具, 组件",
|
|
117
|
+
"page_home:welcome": "欢迎来到主页",
|
|
118
|
+
"page_home:introduction": "一个现代前端实用库集合,提供各种实用工具和组件",
|
|
119
|
+
"page_home:get_started": "准备开始使用?",
|
|
120
|
+
"page_home:get_started__description": "加入我们,探索实用工具的力量",
|
|
121
|
+
"page_home:get_started__button": "立即开始",
|
|
122
|
+
"page_login:title": "登录",
|
|
123
|
+
"page_login:description": "登录页面描述",
|
|
124
|
+
"page_login:content": "登录页面内容",
|
|
125
|
+
"page_login:keywords": "登录页面关键词",
|
|
126
|
+
"page_login:email": "邮箱",
|
|
127
|
+
"page_login:username": "用户名",
|
|
128
|
+
"page_login:password": "密码",
|
|
129
|
+
"page_login:login": "登录",
|
|
130
|
+
"page_login:welcome": "欢迎来到未来学习",
|
|
131
|
+
"page_login:subtitle": "解锁个性化 AI 驱动的学习体验,加速您的知识旅程。",
|
|
132
|
+
"page_login:forgot_password": "忘记密码?",
|
|
133
|
+
"page_login:continue_with": "或继续使用",
|
|
134
|
+
"page_login:with_google": "使用 Google 登录",
|
|
135
|
+
"page_login:no_account": "还没有账号?",
|
|
136
|
+
"page_login:create_account": "在此创建",
|
|
137
|
+
"page_login:email_required": "请输入正确的邮箱!",
|
|
138
|
+
"page_login:password_required": "请输入您的密码!",
|
|
139
|
+
"page_login:feature__ai_paths": "AI驱动的个性化学习路径",
|
|
140
|
+
"page_login:feature__smart": "智能内容推荐",
|
|
141
|
+
"page_login:tracking": "实时进度追踪",
|
|
142
|
+
"page_login:email2": "输入邮箱",
|
|
143
|
+
"page_login:password2": "输入密码",
|
|
144
|
+
"page_login:forgot_password2": "重置密码",
|
|
145
|
+
"page_login:button2": "登录账号",
|
|
146
|
+
"page_login:with_google2": "使用Google账号登录",
|
|
147
|
+
"page_login:create_account2": "创建新账号",
|
|
148
|
+
"page_register:title": "创建账号",
|
|
149
|
+
"page_register:description": "创建账号页面描述",
|
|
150
|
+
"page_register:content": "创建账号页面内容",
|
|
151
|
+
"page_register:keywords": "创建账号页面关键词",
|
|
152
|
+
"page_register:welcome": "欢迎来到我们的平台",
|
|
153
|
+
"page_register:subtitle": "开始您的学习之旅",
|
|
154
|
+
"page_register:ai_paths": "AI路径",
|
|
155
|
+
"page_register:recommendations": "智能推荐",
|
|
156
|
+
"page_register:tracking": "进度跟踪",
|
|
157
|
+
"page_register:username": "用户名",
|
|
158
|
+
"page_register:username_required": "请输入用户名!",
|
|
159
|
+
"page_register:email": "邮箱",
|
|
160
|
+
"page_register:email_required": "请输入邮箱!",
|
|
161
|
+
"page_register:password": "密码",
|
|
162
|
+
"page_register:password_required": "请输入密码!",
|
|
163
|
+
"page_register:confirm_password": "确认密码",
|
|
164
|
+
"page_register:confirm_password_required": "请确认密码!",
|
|
165
|
+
"page_register:password_mismatch": "两次输入的密码不匹配!",
|
|
166
|
+
"page_register:button": "注册",
|
|
167
|
+
"page_register:terms_prefix": "注册即表示您同意我们的",
|
|
168
|
+
"page_register:terms_link": "服务条款",
|
|
169
|
+
"page_register:terms_and": "和",
|
|
170
|
+
"page_register:privacy_link": "隐私政策",
|
|
171
|
+
"page_register:have_account": "已有账号?",
|
|
172
|
+
"page_register:login_link": "登录",
|
|
173
|
+
"page_register:terms_required": "请同意服务条款和隐私政策"
|
|
209
174
|
}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
ResourceTable,
|
|
5
|
+
ResourceTableHeader,
|
|
6
|
+
ResourceTablePopup,
|
|
7
|
+
ResourceTableSchemaForm
|
|
8
|
+
} from '@brain-toolkit/antd-blocks/resourceTable';
|
|
9
|
+
import { useFactory, useLifecycle } from '@brain-toolkit/react-kit';
|
|
10
|
+
import { Form, Input } from 'antd';
|
|
11
|
+
import { useCallback, useMemo } from 'react';
|
|
12
|
+
import { ZodColumnBuilder } from '@/base/cases/ZodColumnBuilder';
|
|
13
|
+
import type { AdminLocalesApi } from '@/base/services/adminApi/AdminLocalesApi';
|
|
14
|
+
import { AdminLocalesService } from '@/base/services/AdminLocalesService';
|
|
15
|
+
import { AdminPageEvent } from '@/base/services/AdminPageEvent';
|
|
16
|
+
import { ClientSeo } from '@/uikit/components/ClientSeo';
|
|
17
|
+
import { EditableCell } from '@/uikit/components/EditableCell';
|
|
18
|
+
import { LocalesImportButton } from '@/uikit/components/localesImportButton/LocalesImportButton';
|
|
19
|
+
import { LocalesImportEvent } from '@/uikit/components/localesImportButton/LocalesImportEvent';
|
|
20
|
+
import { useI18nInterface } from '@/uikit/hook/useI18nInterface';
|
|
21
|
+
import { useIOC } from '@/uikit/hook/useIOC';
|
|
22
|
+
import { useWarnTranslations } from '@/uikit/hook/useWarnTranslations';
|
|
23
|
+
import {
|
|
24
|
+
localesSchema,
|
|
25
|
+
type LocalesSchema
|
|
26
|
+
} from '@migrations/schema/LocalesSchema';
|
|
27
|
+
import { adminLocales18n, adminTableI18n, i18nConfig } from '@config/i18n';
|
|
28
|
+
import { I } from '@config/IOCIdentifier';
|
|
29
|
+
|
|
30
|
+
const localesTT = {
|
|
31
|
+
...adminLocales18n,
|
|
32
|
+
...adminTableI18n
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export default function LocalesPage() {
|
|
36
|
+
const tt = useI18nInterface(localesTT);
|
|
37
|
+
const t = useWarnTranslations();
|
|
38
|
+
const [schemaFormRef] = Form.useForm();
|
|
39
|
+
|
|
40
|
+
const pageService = useIOC(AdminLocalesService);
|
|
41
|
+
const uiDialog = useIOC(I.DialogHandler);
|
|
42
|
+
const ns = pageService.serviceName;
|
|
43
|
+
|
|
44
|
+
const zodColumnBuilder = useFactory(ZodColumnBuilder, ns, localesSchema);
|
|
45
|
+
const pageEvent = useFactory(
|
|
46
|
+
AdminPageEvent,
|
|
47
|
+
ns,
|
|
48
|
+
pageService,
|
|
49
|
+
schemaFormRef,
|
|
50
|
+
uiDialog
|
|
51
|
+
);
|
|
52
|
+
const localesImportEvent = useFactory(
|
|
53
|
+
LocalesImportEvent,
|
|
54
|
+
pageService.resourceApi as AdminLocalesApi
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
const importTT = {
|
|
58
|
+
zh: {
|
|
59
|
+
title: tt.importZhTitle
|
|
60
|
+
},
|
|
61
|
+
en: {
|
|
62
|
+
title: tt.importEnTitle
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
useLifecycle(pageEvent);
|
|
67
|
+
|
|
68
|
+
const renderCell = useCallback(
|
|
69
|
+
(key: string) => {
|
|
70
|
+
const renderEditableCell = (
|
|
71
|
+
value: unknown,
|
|
72
|
+
record: LocalesSchema,
|
|
73
|
+
_index: number
|
|
74
|
+
) => {
|
|
75
|
+
return (
|
|
76
|
+
<EditableCell
|
|
77
|
+
data-testid={`editable-cell-${key}`}
|
|
78
|
+
value={value as string}
|
|
79
|
+
onSave={(value) =>
|
|
80
|
+
pageService.update({
|
|
81
|
+
id: record.id,
|
|
82
|
+
[key]: value
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
/>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
renderEditableCell.displayName = `EditableCellWrapper-${key}`;
|
|
90
|
+
|
|
91
|
+
return renderEditableCell;
|
|
92
|
+
},
|
|
93
|
+
[pageService]
|
|
94
|
+
);
|
|
95
|
+
|
|
96
|
+
const options = useMemo(() => {
|
|
97
|
+
i18nConfig.supportedLngs.forEach((locale) => {
|
|
98
|
+
zodColumnBuilder.render(locale, renderCell(locale));
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
return zodColumnBuilder.translate(t).buildAll();
|
|
102
|
+
}, [t, zodColumnBuilder, renderCell]);
|
|
103
|
+
|
|
104
|
+
return (
|
|
105
|
+
<div data-testid="LocalesPage">
|
|
106
|
+
<ClientSeo i18nInterface={tt} />
|
|
107
|
+
|
|
108
|
+
<ResourceTableHeader
|
|
109
|
+
settings={tt}
|
|
110
|
+
tableEvent={pageEvent}
|
|
111
|
+
actionLeft={
|
|
112
|
+
<>
|
|
113
|
+
<LocalesImportButton
|
|
114
|
+
event={localesImportEvent}
|
|
115
|
+
title={tt.importTitle}
|
|
116
|
+
tt={importTT}
|
|
117
|
+
/>
|
|
118
|
+
</>
|
|
119
|
+
}
|
|
120
|
+
/>
|
|
121
|
+
|
|
122
|
+
<ResourceTable
|
|
123
|
+
columns={options}
|
|
124
|
+
tableEvent={pageEvent}
|
|
125
|
+
actionProps={{
|
|
126
|
+
title: tt.action,
|
|
127
|
+
editText: tt.editText,
|
|
128
|
+
deleteText: tt.deleteText,
|
|
129
|
+
detailText: tt.detailText
|
|
130
|
+
}}
|
|
131
|
+
/>
|
|
132
|
+
|
|
133
|
+
<ResourceTablePopup
|
|
134
|
+
tableEvent={pageEvent}
|
|
135
|
+
tt={{
|
|
136
|
+
create: tt.createTitle,
|
|
137
|
+
edit: tt.editTitle,
|
|
138
|
+
detail: tt.detailTitle
|
|
139
|
+
}}
|
|
140
|
+
>
|
|
141
|
+
<ResourceTableSchemaForm
|
|
142
|
+
formComponents={{
|
|
143
|
+
input: Input
|
|
144
|
+
}}
|
|
145
|
+
formRef={schemaFormRef}
|
|
146
|
+
options={options}
|
|
147
|
+
tt={tt}
|
|
148
|
+
tableEvent={pageEvent}
|
|
149
|
+
/>
|
|
150
|
+
</ResourceTablePopup>
|
|
151
|
+
</div>
|
|
152
|
+
);
|
|
153
|
+
}
|