@fecommunity/reactpress-toolkit 3.0.0 → 3.1.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/README.md +194 -309
- package/dist/admin/index.d.ts +2 -0
- package/dist/admin/index.js +18 -0
- package/dist/admin/permissions.d.ts +5 -0
- package/dist/admin/permissions.js +33 -0
- package/dist/admin/registry.d.ts +62 -0
- package/dist/admin/registry.js +79 -0
- package/dist/api/HttpClient.d.ts +2 -2
- package/dist/api/HttpClient.js +1 -1
- package/dist/api/Smtp.d.ts +17 -0
- package/dist/api/Smtp.js +15 -0
- package/dist/api/instance.d.ts +1 -1
- package/dist/api/instance.js +3 -3
- package/dist/app/createReactPressApp.d.ts +88 -0
- package/dist/app/createReactPressApp.js +262 -0
- package/dist/app/createThemeApp.d.ts +6 -0
- package/dist/app/createThemeApp.js +47 -0
- package/dist/app/devChunkRecovery.d.ts +2 -0
- package/dist/app/devChunkRecovery.js +68 -0
- package/dist/app/index.d.ts +39 -0
- package/dist/app/index.js +11 -0
- package/dist/config/env.js +29 -15
- package/dist/config/global.d.ts +7 -1
- package/dist/config/global.js +9 -3
- package/dist/config/i18n.js +27 -11
- package/dist/config/index.d.ts +3 -3
- package/dist/config/index.js +6 -5
- package/dist/{locales → config/locales}/en.json +31 -3
- package/dist/{locales → config/locales}/zh.json +31 -3
- package/dist/dev/index.d.ts +3 -0
- package/dist/dev/index.js +12 -0
- package/dist/dev/portRedirect.d.ts +20 -0
- package/dist/dev/portRedirect.js +93 -0
- package/dist/dev/vitePortRedirectPlugin.d.ts +24 -0
- package/dist/dev/vitePortRedirectPlugin.js +40 -0
- package/dist/extension/branding-mods.d.ts +10 -0
- package/dist/extension/branding-mods.js +65 -0
- package/dist/extension/configuration/defaults.d.ts +3 -0
- package/dist/extension/configuration/defaults.js +32 -0
- package/dist/extension/configuration/formily.d.ts +10 -0
- package/dist/extension/configuration/formily.js +170 -0
- package/dist/extension/configuration/index.d.ts +7 -0
- package/dist/extension/configuration/index.js +28 -0
- package/dist/extension/configuration/paths.d.ts +4 -0
- package/dist/extension/configuration/paths.js +50 -0
- package/dist/extension/configuration/presets/twentytwentyfive.d.ts +7 -0
- package/dist/extension/configuration/presets/twentytwentyfive.js +94 -0
- package/dist/extension/configuration/resolve.d.ts +24 -0
- package/dist/extension/configuration/resolve.js +98 -0
- package/dist/extension/configuration/types.d.ts +68 -0
- package/dist/extension/configuration/types.js +3 -0
- package/dist/extension/configuration/validate.d.ts +8 -0
- package/dist/extension/configuration/validate.js +21 -0
- package/dist/extension/index.d.ts +9 -0
- package/dist/extension/index.js +35 -0
- package/dist/extension/manifest-normalize.d.ts +5 -0
- package/dist/extension/manifest-normalize.js +75 -0
- package/dist/extension/node.d.ts +2 -0
- package/dist/extension/node.js +6 -0
- package/dist/extension/presets/twentytwentyfive-appearance.d.ts +10 -0
- package/dist/extension/presets/twentytwentyfive-appearance.js +193 -0
- package/dist/extension/presets/twentytwentyfive-customizer.d.ts +19 -0
- package/dist/extension/presets/twentytwentyfive-customizer.js +199 -0
- package/dist/extension/preview.d.ts +46 -0
- package/dist/extension/preview.js +92 -0
- package/dist/extension/site-notices.d.ts +19 -0
- package/dist/extension/site-notices.js +88 -0
- package/dist/extension/site-settings.d.ts +37 -0
- package/dist/extension/site-settings.js +144 -0
- package/dist/extension/theme-admin-locale.d.ts +11 -0
- package/dist/extension/theme-admin-locale.io.d.ts +2 -0
- package/dist/extension/theme-admin-locale.io.js +54 -0
- package/dist/extension/theme-admin-locale.js +81 -0
- package/dist/extension/theme.d.ts +89 -0
- package/dist/extension/theme.js +93 -0
- package/dist/extension/twentytwentyfive-vars.d.ts +7 -0
- package/dist/extension/twentytwentyfive-vars.js +100 -0
- package/dist/index.d.ts +15 -7
- package/dist/index.js +44 -22
- package/dist/plugin/admin/index.d.ts +2 -0
- package/dist/plugin/admin/index.js +18 -0
- package/dist/plugin/admin/permissions.d.ts +5 -0
- package/dist/plugin/admin/permissions.js +33 -0
- package/dist/plugin/admin/registry.d.ts +62 -0
- package/dist/plugin/admin/registry.js +79 -0
- package/dist/plugin/client/client.d.ts +14 -0
- package/dist/plugin/client/client.js +95 -0
- package/dist/plugin/client/index.d.ts +4 -0
- package/dist/plugin/client/index.js +11 -0
- package/dist/plugin/client/runtime.d.ts +18 -0
- package/dist/plugin/client/runtime.js +30 -0
- package/dist/plugin/dev/index.d.ts +4 -0
- package/dist/plugin/dev/index.js +16 -0
- package/dist/plugin/dev/portRedirect.d.ts +26 -0
- package/dist/plugin/dev/portRedirect.js +111 -0
- package/dist/plugin/dev/vitePortRedirectPlugin.d.ts +24 -0
- package/dist/plugin/dev/vitePortRedirectPlugin.js +40 -0
- package/dist/plugin/index.d.ts +9 -0
- package/dist/plugin/index.js +48 -0
- package/dist/plugin/react/client.d.ts +14 -0
- package/dist/plugin/react/client.js +95 -0
- package/dist/plugin/react/index.d.ts +2 -0
- package/dist/plugin/react/index.js +18 -0
- package/dist/plugin/react/runtime.d.ts +18 -0
- package/dist/plugin/react/runtime.js +30 -0
- package/dist/primitives/AntdStyleTransitionFix.d.ts +2 -0
- package/dist/primitives/AntdStyleTransitionFix.js +16 -0
- package/dist/primitives/Badge.d.ts +7 -0
- package/dist/primitives/Badge.js +9 -0
- package/dist/primitives/Button.d.ts +10 -0
- package/dist/primitives/Button.js +38 -0
- package/dist/primitives/ColorModeToggle.d.ts +8 -0
- package/dist/primitives/ColorModeToggle.js +13 -0
- package/dist/primitives/IconButton.d.ts +7 -0
- package/dist/primitives/IconButton.js +13 -0
- package/dist/primitives/ScrollToTarget.d.ts +9 -0
- package/dist/primitives/ScrollToTarget.js +48 -0
- package/dist/primitives/Separator.d.ts +7 -0
- package/dist/primitives/Separator.js +9 -0
- package/dist/primitives/Skeleton.d.ts +7 -0
- package/dist/primitives/Skeleton.js +9 -0
- package/dist/primitives/Slot.d.ts +10 -0
- package/dist/primitives/Slot.js +25 -0
- package/dist/primitives/Spinner.d.ts +6 -0
- package/dist/primitives/Spinner.js +9 -0
- package/dist/primitives/animation/ConditionTransition.d.ts +8 -0
- package/dist/primitives/animation/ConditionTransition.js +13 -0
- package/dist/primitives/animation/ListTrail.d.ts +10 -0
- package/dist/primitives/animation/ListTrail.js +14 -0
- package/dist/primitives/animation/Opacity.d.ts +3 -0
- package/dist/primitives/animation/Opacity.js +10 -0
- package/dist/primitives/animation/Spring.d.ts +9 -0
- package/dist/primitives/animation/Spring.js +29 -0
- package/dist/primitives/animation/index.d.ts +7 -0
- package/dist/primitives/animation/index.js +11 -0
- package/dist/primitives/cn.d.ts +4 -0
- package/dist/primitives/cn.js +7 -0
- package/dist/primitives/icons.d.ts +4 -0
- package/dist/primitives/icons.js +15 -0
- package/dist/primitives/index.d.ts +22 -0
- package/dist/primitives/index.js +44 -0
- package/dist/react/client.d.ts +14 -0
- package/dist/react/client.js +95 -0
- package/dist/react/index.d.ts +4 -0
- package/dist/react/index.js +11 -0
- package/dist/react/runtime.d.ts +18 -0
- package/dist/react/runtime.js +30 -0
- package/dist/theme/antdDocument.d.ts +18 -0
- package/dist/theme/antdDocument.js +59 -0
- package/dist/theme/api/api-data.d.ts +2 -0
- package/dist/theme/api/api-data.js +8 -0
- package/dist/theme/api/api.d.ts +28 -0
- package/dist/theme/api/api.js +27 -0
- package/dist/theme/api/httpClient.d.ts +24 -0
- package/dist/theme/api/httpClient.js +83 -0
- package/dist/theme/api/json.d.ts +1 -0
- package/dist/theme/api/json.js +5 -0
- package/dist/theme/api/jsonp.d.ts +1 -0
- package/dist/theme/api/jsonp.js +5 -0
- package/dist/theme/api-data.d.ts +12 -0
- package/dist/theme/api-data.js +22 -0
- package/dist/theme/api.d.ts +28 -0
- package/dist/theme/api.js +27 -0
- package/dist/theme/appearance.d.ts +4 -0
- package/dist/theme/appearance.js +16 -0
- package/dist/theme/assets.d.ts +2 -0
- package/dist/theme/assets.js +27 -0
- package/dist/theme/authSession.d.ts +16 -0
- package/dist/theme/authSession.js +92 -0
- package/dist/theme/build/antdDocument.d.ts +145 -0
- package/dist/theme/build/antdDocument.js +70 -0
- package/dist/theme/build/next-config.d.ts +17 -0
- package/dist/theme/build/next-config.js +100 -0
- package/dist/theme/build/node.d.ts +2 -0
- package/dist/theme/build/node.js +6 -0
- package/dist/theme/colorMode.d.ts +12 -0
- package/dist/theme/colorMode.js +45 -0
- package/dist/theme/commentAuthor.d.ts +17 -0
- package/dist/theme/commentAuthor.js +48 -0
- package/dist/theme/content/archiveSlim.d.ts +7 -0
- package/dist/theme/content/archiveSlim.js +38 -0
- package/dist/theme/content/articleSlim.d.ts +10 -0
- package/dist/theme/content/articleSlim.js +35 -0
- package/dist/theme/content/assets.d.ts +8 -0
- package/dist/theme/content/assets.js +74 -0
- package/dist/theme/content/carouselArticles.d.ts +10 -0
- package/dist/theme/content/carouselArticles.js +39 -0
- package/dist/theme/content/excerpt.d.ts +15 -0
- package/dist/theme/content/excerpt.js +42 -0
- package/dist/theme/content/nav.d.ts +10 -0
- package/dist/theme/content/nav.js +30 -0
- package/dist/theme/content/seo.d.ts +6 -0
- package/dist/theme/content/seo.js +12 -0
- package/dist/theme/createAntdApp.d.ts +106 -0
- package/dist/theme/createAntdApp.js +175 -0
- package/dist/theme/createApp.d.ts +10 -0
- package/dist/theme/createApp.js +141 -0
- package/dist/theme/createCatalogApp.d.ts +108 -0
- package/dist/theme/createCatalogApp.js +168 -0
- package/dist/theme/customizer.d.ts +1 -0
- package/dist/theme/customizer.js +5 -0
- package/dist/theme/excerpt.d.ts +16 -0
- package/dist/theme/excerpt.js +31 -0
- package/dist/theme/extension/branding-mods.d.ts +10 -0
- package/dist/theme/extension/branding-mods.js +65 -0
- package/dist/theme/extension/configuration/defaults.d.ts +3 -0
- package/dist/theme/extension/configuration/defaults.js +32 -0
- package/dist/theme/extension/configuration/formily.d.ts +10 -0
- package/dist/theme/extension/configuration/formily.js +170 -0
- package/dist/theme/extension/configuration/index.d.ts +7 -0
- package/dist/theme/extension/configuration/index.js +28 -0
- package/dist/theme/extension/configuration/paths.d.ts +1 -0
- package/dist/theme/extension/configuration/paths.js +7 -0
- package/dist/theme/extension/configuration/presets/twentytwentyfive.d.ts +7 -0
- package/dist/theme/extension/configuration/presets/twentytwentyfive.js +94 -0
- package/dist/theme/extension/configuration/resolve.d.ts +24 -0
- package/dist/theme/extension/configuration/resolve.js +98 -0
- package/dist/theme/extension/configuration/types.d.ts +68 -0
- package/dist/theme/extension/configuration/types.js +3 -0
- package/dist/theme/extension/configuration/validate.d.ts +8 -0
- package/dist/theme/extension/configuration/validate.js +21 -0
- package/dist/theme/extension/index.d.ts +11 -0
- package/dist/theme/extension/index.js +38 -0
- package/dist/theme/extension/manifest-normalize.d.ts +5 -0
- package/dist/theme/extension/manifest-normalize.js +75 -0
- package/dist/theme/extension/presets/twentytwentyfive-appearance.d.ts +10 -0
- package/dist/theme/extension/presets/twentytwentyfive-appearance.js +193 -0
- package/dist/theme/extension/preview.d.ts +46 -0
- package/dist/theme/extension/preview.js +92 -0
- package/dist/theme/extension/site-notices.d.ts +19 -0
- package/dist/theme/extension/site-notices.js +88 -0
- package/dist/theme/extension/site-settings.d.ts +37 -0
- package/dist/theme/extension/site-settings.js +144 -0
- package/dist/theme/extension/siteNav.d.ts +18 -0
- package/dist/theme/extension/siteNav.js +17 -0
- package/dist/theme/extension/theme-admin-locale.d.ts +11 -0
- package/dist/theme/extension/theme-admin-locale.io.d.ts +2 -0
- package/dist/theme/extension/theme-admin-locale.io.js +54 -0
- package/dist/theme/extension/theme-admin-locale.js +68 -0
- package/dist/theme/extension/theme.d.ts +89 -0
- package/dist/theme/extension/theme.js +93 -0
- package/dist/theme/extension/twentytwentyfive-vars.d.ts +9 -0
- package/dist/theme/extension/twentytwentyfive-vars.js +103 -0
- package/dist/theme/fetch.d.ts +134 -0
- package/dist/theme/fetch.js +241 -0
- package/dist/theme/format.d.ts +16 -0
- package/dist/theme/format.js +48 -0
- package/dist/theme/httpClient.d.ts +20 -0
- package/dist/theme/httpClient.js +89 -0
- package/dist/theme/index.d.ts +63 -0
- package/dist/theme/index.js +226 -0
- package/dist/theme/json.d.ts +1 -0
- package/dist/theme/json.js +17 -0
- package/dist/theme/jsonp.d.ts +8 -0
- package/dist/theme/jsonp.js +27 -0
- package/dist/theme/locale.d.ts +23 -0
- package/dist/theme/locale.js +55 -0
- package/dist/theme/nav.d.ts +10 -0
- package/dist/theme/nav.js +30 -0
- package/dist/theme/next-config.d.ts +2 -0
- package/dist/theme/next-config.js +18 -0
- package/dist/theme/node.d.ts +2 -0
- package/dist/theme/node.js +18 -0
- package/dist/theme/preview/preview-config.d.ts +13 -0
- package/dist/theme/preview/preview-config.js +65 -0
- package/dist/theme/preview/preview-draft.d.ts +19 -0
- package/dist/theme/preview/preview-draft.js +51 -0
- package/dist/theme/preview/preview-mods.d.ts +16 -0
- package/dist/theme/preview/preview-mods.js +78 -0
- package/dist/theme/preview-config.d.ts +13 -0
- package/dist/theme/preview-config.js +65 -0
- package/dist/theme/preview-draft.d.ts +19 -0
- package/dist/theme/preview-draft.js +51 -0
- package/dist/theme/preview-mods.d.ts +16 -0
- package/dist/theme/preview-mods.js +78 -0
- package/dist/theme/providers/index.d.ts +118 -0
- package/dist/theme/providers/index.js +251 -0
- package/dist/theme/providers/setup.d.ts +124 -0
- package/dist/theme/providers/setup.js +29 -0
- package/dist/theme/runtime.d.ts +18 -0
- package/dist/theme/runtime.js +19 -0
- package/dist/theme/seo.d.ts +6 -0
- package/dist/theme/seo.js +12 -0
- package/dist/theme/server.d.ts +65 -0
- package/dist/theme/server.js +177 -0
- package/dist/theme/setting.d.ts +12 -0
- package/dist/theme/setting.js +42 -0
- package/dist/theme/ssr/bootstrap.d.ts +48 -0
- package/dist/theme/ssr/bootstrap.js +112 -0
- package/dist/theme/ssr/fetch.d.ts +134 -0
- package/dist/theme/ssr/fetch.js +264 -0
- package/dist/theme/ssr/format.d.ts +3 -0
- package/dist/theme/ssr/format.js +8 -0
- package/dist/theme/ssr/pageProps.d.ts +62 -0
- package/dist/theme/ssr/pageProps.js +138 -0
- package/dist/theme/ssr/setting.d.ts +12 -0
- package/dist/theme/ssr/setting.js +42 -0
- package/dist/theme/ssr/slimBootstrap.d.ts +11 -0
- package/dist/theme/ssr/slimBootstrap.js +75 -0
- package/dist/theme/ssr/static.d.ts +10 -0
- package/dist/theme/ssr/static.js +17 -0
- package/dist/theme/ssr/templates.d.ts +35 -0
- package/dist/theme/ssr/templates.js +50 -0
- package/dist/theme/static.d.ts +10 -0
- package/dist/theme/static.js +17 -0
- package/dist/theme/templates.d.ts +27 -0
- package/dist/theme/templates.js +38 -0
- package/dist/theme/ui-optional.d.ts +1 -0
- package/dist/theme/ui-optional.js +21 -0
- package/dist/theme/visitor/appearance.d.ts +4 -0
- package/dist/theme/visitor/appearance.js +16 -0
- package/dist/theme/visitor/authSession.d.ts +16 -0
- package/dist/theme/visitor/authSession.js +92 -0
- package/dist/theme/visitor/colorMode.d.ts +17 -0
- package/dist/theme/visitor/colorMode.js +59 -0
- package/dist/theme/visitor/commentAuthor.d.ts +16 -0
- package/dist/theme/visitor/commentAuthor.js +45 -0
- package/dist/theme/visitor/i18n.d.ts +4 -0
- package/dist/theme/visitor/i18n.js +28 -0
- package/dist/theme/visitor/locale.d.ts +23 -0
- package/dist/theme/visitor/locale.js +72 -0
- package/dist/theme/visitor/runtime.d.ts +18 -0
- package/dist/theme/visitor/runtime.js +19 -0
- package/dist/theme/visitor/visitorLocale.d.ts +11 -0
- package/dist/theme/visitor/visitorLocale.js +56 -0
- package/dist/theme/visitorLocale.d.ts +6 -0
- package/dist/theme/visitorLocale.js +39 -0
- package/dist/types/index.d.ts +79 -68
- package/dist/ui/AntdStyleTransitionFix.d.ts +5 -0
- package/dist/ui/AntdStyleTransitionFix.js +16 -0
- package/dist/ui/ArchiveEmptyState.d.ts +13 -0
- package/dist/ui/ArchiveEmptyState.js +8 -0
- package/dist/ui/ArchivePageLayout.d.ts +10 -0
- package/dist/ui/ArchivePageLayout.js +8 -0
- package/dist/ui/ArticleCard.d.ts +27 -0
- package/dist/ui/ArticleCard.js +16 -0
- package/dist/ui/ArticleList.d.ts +14 -0
- package/dist/ui/ArticleList.js +16 -0
- package/dist/ui/BaseGlobalStyles.d.ts +5 -0
- package/dist/ui/BaseGlobalStyles.js +18 -0
- package/dist/ui/LocaleSwitcher.d.ts +7 -0
- package/dist/ui/LocaleSwitcher.js +15 -0
- package/dist/ui/NavMenu.d.ts +16 -0
- package/dist/ui/NavMenu.js +8 -0
- package/dist/ui/NotFoundPanel.d.ts +11 -0
- package/dist/ui/NotFoundPanel.js +8 -0
- package/dist/ui/PageHeader.d.ts +10 -0
- package/dist/ui/PageHeader.js +8 -0
- package/dist/ui/SiteBranding.d.ts +10 -0
- package/dist/ui/SiteBranding.js +14 -0
- package/dist/ui/SiteDocument.d.ts +20 -0
- package/dist/ui/SiteDocument.js +13 -0
- package/dist/ui/SiteDocumentFallback.d.ts +8 -0
- package/dist/ui/SiteDocumentFallback.js +9 -0
- package/dist/ui/SiteLogo.d.ts +6 -0
- package/dist/ui/SiteLogo.js +16 -0
- package/dist/ui/SiteTagline.d.ts +7 -0
- package/dist/ui/SiteTagline.js +15 -0
- package/dist/ui/TaxonomyList.d.ts +25 -0
- package/dist/ui/TaxonomyList.js +30 -0
- package/dist/ui/ThemeCssVars.d.ts +2 -0
- package/dist/ui/ThemeCssVars.js +85 -0
- package/dist/ui/ThemeLayout.d.ts +13 -0
- package/dist/ui/ThemeLayout.js +11 -0
- package/dist/ui/components/AntdStyleTransitionFix.d.ts +5 -0
- package/dist/ui/components/AntdStyleTransitionFix.js +16 -0
- package/dist/ui/components/ArchiveEmptyState.d.ts +13 -0
- package/dist/ui/components/ArchiveEmptyState.js +8 -0
- package/dist/ui/components/ArchivePageLayout.d.ts +10 -0
- package/dist/ui/components/ArchivePageLayout.js +8 -0
- package/dist/ui/components/ArticleCard.d.ts +27 -0
- package/dist/ui/components/ArticleCard.js +16 -0
- package/dist/ui/components/ArticleList.d.ts +14 -0
- package/dist/ui/components/ArticleList.js +16 -0
- package/dist/ui/components/BaseGlobalStyles.d.ts +5 -0
- package/dist/ui/components/BaseGlobalStyles.js +18 -0
- package/dist/ui/components/LocaleSwitcher.d.ts +10 -0
- package/dist/ui/components/LocaleSwitcher.js +11 -0
- package/dist/ui/components/NavMenu.d.ts +16 -0
- package/dist/ui/components/NavMenu.js +8 -0
- package/dist/ui/components/NotFoundPanel.d.ts +11 -0
- package/dist/ui/components/NotFoundPanel.js +8 -0
- package/dist/ui/components/PageHeader.d.ts +10 -0
- package/dist/ui/components/PageHeader.js +8 -0
- package/dist/ui/components/RouteProgress.d.ts +9 -0
- package/dist/ui/components/RouteProgress.js +40 -0
- package/dist/ui/components/SiteAnalytics.d.ts +5 -0
- package/dist/ui/components/SiteAnalytics.js +42 -0
- package/dist/ui/components/SiteBranding.d.ts +10 -0
- package/dist/ui/components/SiteBranding.js +14 -0
- package/dist/ui/components/SiteDocument.d.ts +20 -0
- package/dist/ui/components/SiteDocument.js +13 -0
- package/dist/ui/components/SiteDocumentFallback.d.ts +8 -0
- package/dist/ui/components/SiteDocumentFallback.js +9 -0
- package/dist/ui/components/SiteLogo.d.ts +8 -0
- package/dist/ui/components/SiteLogo.js +23 -0
- package/dist/ui/components/SiteSeo.d.ts +13 -0
- package/dist/ui/components/SiteSeo.js +19 -0
- package/dist/ui/components/SiteTagline.d.ts +7 -0
- package/dist/ui/components/SiteTagline.js +15 -0
- package/dist/ui/components/TaxonomyList.d.ts +25 -0
- package/dist/ui/components/TaxonomyList.js +30 -0
- package/dist/ui/components/ThemeCssVars.d.ts +2 -0
- package/dist/ui/components/ThemeCssVars.js +85 -0
- package/dist/ui/components/ThemeLayout.d.ts +13 -0
- package/dist/ui/components/ThemeLayout.js +11 -0
- package/dist/ui/components/content/ArticleReader.d.ts +45 -0
- package/dist/ui/components/content/ArticleReader.js +23 -0
- package/dist/ui/components/content/ArticleToc.d.ts +21 -0
- package/dist/ui/components/content/ArticleToc.js +75 -0
- package/dist/ui/components/content/HtmlContent.d.ts +15 -0
- package/dist/ui/components/content/HtmlContent.js +237 -0
- package/dist/ui/components/content/Image.d.ts +9 -0
- package/dist/ui/components/content/Image.js +13 -0
- package/dist/ui/components/content/ImageViewer.d.ts +8 -0
- package/dist/ui/components/content/ImageViewer.js +33 -0
- package/dist/ui/components/content/LocaleTime.d.ts +9 -0
- package/dist/ui/components/content/LocaleTime.js +63 -0
- package/dist/ui/components/content/index.d.ts +14 -0
- package/dist/ui/components/content/index.js +18 -0
- package/dist/ui/components/toolbar/LocaleToggleButton.d.ts +8 -0
- package/dist/ui/components/toolbar/LocaleToggleButton.js +18 -0
- package/dist/ui/components/toolbar/ThemeToggleButton.d.ts +7 -0
- package/dist/ui/components/toolbar/ThemeToggleButton.js +10 -0
- package/dist/ui/components/toolbar/ToolbarIconButton.d.ts +7 -0
- package/dist/ui/components/toolbar/ToolbarIconButton.js +22 -0
- package/dist/ui/components/toolbar/constants.d.ts +5 -0
- package/dist/ui/components/toolbar/constants.js +8 -0
- package/dist/ui/components/toolbar/icons.d.ts +17 -0
- package/dist/ui/components/toolbar/icons.js +44 -0
- package/dist/ui/components/toolbar/index.d.ts +9 -0
- package/dist/ui/components/toolbar/index.js +25 -0
- package/dist/ui/components/toolbar/locale-label.d.ts +3 -0
- package/dist/ui/components/toolbar/locale-label.js +19 -0
- package/dist/ui/context/LocaleContext.d.ts +15 -0
- package/dist/ui/context/LocaleContext.js +59 -0
- package/dist/ui/context/ReactPressProvider.d.ts +3 -0
- package/dist/ui/context/ReactPressProvider.js +10 -0
- package/dist/ui/context/SiteCatalogContext.d.ts +41 -0
- package/dist/ui/context/SiteCatalogContext.js +60 -0
- package/dist/ui/context/ThemeRuntimeContext.d.ts +21 -0
- package/dist/ui/context/ThemeRuntimeContext.js +59 -0
- package/dist/ui/context/index.d.ts +8 -0
- package/dist/ui/context/index.js +26 -0
- package/dist/ui/context/siteCatalogTypes.d.ts +64 -0
- package/dist/ui/context/siteCatalogTypes.js +20 -0
- package/dist/ui/context/types.d.ts +34 -0
- package/dist/ui/context/types.js +2 -0
- package/dist/ui/hooks/index.d.ts +12 -0
- package/dist/ui/hooks/index.js +29 -0
- package/dist/ui/hooks/useAsyncLoading.d.ts +4 -0
- package/dist/ui/hooks/useAsyncLoading.js +31 -0
- package/dist/ui/hooks/useForceUpdate.d.ts +2 -0
- package/dist/ui/hooks/useForceUpdate.js +11 -0
- package/dist/ui/hooks/useNavActive.d.ts +5 -0
- package/dist/ui/hooks/useNavActive.js +11 -0
- package/dist/ui/hooks/usePagination.d.ts +34 -0
- package/dist/ui/hooks/usePagination.js +55 -0
- package/dist/ui/hooks/useReportArticleView.d.ts +4 -0
- package/dist/ui/hooks/useReportArticleView.js +40 -0
- package/dist/ui/hooks/useReportPageView.d.ts +11 -0
- package/dist/ui/hooks/useReportPageView.js +28 -0
- package/dist/ui/hooks/useRouteParam.d.ts +5 -0
- package/dist/ui/hooks/useRouteParam.js +15 -0
- package/dist/ui/hooks/useToggle.d.ts +2 -0
- package/dist/ui/hooks/useToggle.js +17 -0
- package/dist/ui/hooks/useWarningOnExit.d.ts +5 -0
- package/dist/ui/hooks/useWarningOnExit.js +59 -0
- package/dist/ui/index.d.ts +43 -0
- package/dist/ui/index.js +87 -0
- package/dist/utils/api-envelope.d.ts +14 -0
- package/dist/utils/api-envelope.js +31 -0
- package/dist/utils/clipboard.d.ts +2 -0
- package/dist/utils/clipboard.js +24 -0
- package/dist/utils/cookie.d.ts +2 -0
- package/dist/utils/cookie.js +15 -0
- package/dist/utils/date.d.ts +4 -0
- package/dist/utils/date.js +45 -0
- package/dist/utils/email.d.ts +3 -0
- package/dist/utils/email.js +9 -0
- package/dist/utils/error.d.ts +7 -0
- package/dist/utils/error.js +26 -0
- package/dist/utils/image.d.ts +7 -0
- package/dist/utils/image.js +34 -0
- package/dist/utils/index.d.ts +15 -33
- package/dist/utils/index.js +37 -57
- package/dist/utils/json.d.ts +2 -0
- package/dist/utils/json.js +18 -0
- package/dist/utils/jsonp.d.ts +8 -0
- package/dist/utils/jsonp.js +27 -0
- package/dist/utils/object.d.ts +7 -0
- package/dist/utils/object.js +63 -0
- package/dist/utils/setting.d.ts +12 -0
- package/dist/utils/setting.js +13 -0
- package/dist/utils/string.d.ts +4 -0
- package/dist/utils/string.js +15 -0
- package/dist/utils/viewport.d.ts +3 -0
- package/dist/utils/viewport.js +14 -0
- package/package.json +129 -16
- package/LICENSE +0 -21
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const React = require('react');
|
|
3
|
+
/** Dev-only: recover from stale webpack chunks after on-demand page compilation. */
|
|
4
|
+
function DevChunkRecovery() {
|
|
5
|
+
React.useEffect(() => {
|
|
6
|
+
if (process.env.NODE_ENV !== 'development')
|
|
7
|
+
return undefined;
|
|
8
|
+
const storageKey = '__reactpress_dev_chunk_recover';
|
|
9
|
+
const maxAttempts = 2;
|
|
10
|
+
const isChunkMismatch = (message) => {
|
|
11
|
+
const msg = String(message || '');
|
|
12
|
+
return (msg.includes("reading 'call'") ||
|
|
13
|
+
msg.includes('ChunkLoadError') ||
|
|
14
|
+
msg.includes('Loading chunk') ||
|
|
15
|
+
msg.includes('__webpack_modules__') ||
|
|
16
|
+
msg.includes('is not a function') ||
|
|
17
|
+
msg.includes('/_next/undefined'));
|
|
18
|
+
};
|
|
19
|
+
const recover = () => {
|
|
20
|
+
const attempts = Number(window.sessionStorage.getItem(storageKey) || 0);
|
|
21
|
+
if (attempts >= maxAttempts)
|
|
22
|
+
return;
|
|
23
|
+
window.sessionStorage.setItem(storageKey, String(attempts + 1));
|
|
24
|
+
window.location.reload();
|
|
25
|
+
};
|
|
26
|
+
const onError = (event) => {
|
|
27
|
+
const msg = event?.message || event?.reason?.message || event?.reason || '';
|
|
28
|
+
if (!isChunkMismatch(msg))
|
|
29
|
+
return;
|
|
30
|
+
if (typeof event.preventDefault === 'function')
|
|
31
|
+
event.preventDefault();
|
|
32
|
+
recover();
|
|
33
|
+
};
|
|
34
|
+
window.addEventListener('error', onError);
|
|
35
|
+
window.addEventListener('unhandledrejection', onError);
|
|
36
|
+
const clearRecoveries = () => window.sessionStorage.removeItem(storageKey);
|
|
37
|
+
window.addEventListener('load', clearRecoveries);
|
|
38
|
+
let routerCleanup = () => { };
|
|
39
|
+
try {
|
|
40
|
+
const Router = require('next/router').default;
|
|
41
|
+
if (Router?.events?.on) {
|
|
42
|
+
const onRouteError = (err) => {
|
|
43
|
+
if (err?.cancelled)
|
|
44
|
+
return;
|
|
45
|
+
if (isChunkMismatch(err?.message))
|
|
46
|
+
recover();
|
|
47
|
+
};
|
|
48
|
+
Router.events.on('routeChangeComplete', clearRecoveries);
|
|
49
|
+
Router.events.on('routeChangeError', onRouteError);
|
|
50
|
+
routerCleanup = () => {
|
|
51
|
+
Router.events.off('routeChangeComplete', clearRecoveries);
|
|
52
|
+
Router.events.off('routeChangeError', onRouteError);
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
// App Router themes rely on window error listeners only.
|
|
58
|
+
}
|
|
59
|
+
return () => {
|
|
60
|
+
window.removeEventListener('error', onError);
|
|
61
|
+
window.removeEventListener('unhandledrejection', onError);
|
|
62
|
+
window.removeEventListener('load', clearRecoveries);
|
|
63
|
+
routerCleanup();
|
|
64
|
+
};
|
|
65
|
+
}, []);
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
module.exports = { DevChunkRecovery };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** Type declarations for `@fecommunity/reactpress-toolkit/app` JS factories. */
|
|
2
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
3
|
+
import type { ThemeMods } from '../theme/extension/branding-mods';
|
|
4
|
+
export type CreateThemeApp = (manifest: {
|
|
5
|
+
id: string;
|
|
6
|
+
}) => unknown;
|
|
7
|
+
export type CreateReactPressAppOptions = {
|
|
8
|
+
Layout: ComponentType<{
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
needFooter?: boolean;
|
|
11
|
+
hasBg?: boolean;
|
|
12
|
+
needHeader?: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
/** i18n root provider (e.g. next-intl NextIntlProvider). */
|
|
15
|
+
IntlProvider: ComponentType<Record<string, unknown>>;
|
|
16
|
+
buildAppearanceCss?: (mods: ThemeMods) => string;
|
|
17
|
+
httpClientOptions?: Record<string, unknown>;
|
|
18
|
+
wrapContent?: (content: ReactNode, runtime: {
|
|
19
|
+
locale: string;
|
|
20
|
+
isDark: boolean;
|
|
21
|
+
colorPrimary?: string;
|
|
22
|
+
themeMods: ThemeMods;
|
|
23
|
+
colorMode: string;
|
|
24
|
+
}) => unknown;
|
|
25
|
+
scrollToTopOnRouteChange?: boolean;
|
|
26
|
+
transformBootstrap?: (bootstrap: Record<string, unknown>, ctx: {
|
|
27
|
+
pathname?: string;
|
|
28
|
+
asPath?: string;
|
|
29
|
+
}) => Record<string, unknown>;
|
|
30
|
+
};
|
|
31
|
+
export type CreateReactPressApp = (manifest: {
|
|
32
|
+
id: string;
|
|
33
|
+
options?: unknown;
|
|
34
|
+
}, options: CreateReactPressAppOptions) => unknown;
|
|
35
|
+
export declare const createThemeApp: CreateThemeApp;
|
|
36
|
+
export declare const DevChunkRecovery: ComponentType;
|
|
37
|
+
export declare const createReactPressApp: CreateReactPressApp;
|
|
38
|
+
/** @deprecated Use `createReactPressApp`. */
|
|
39
|
+
export declare const createCatalogThemeApp: CreateReactPressApp;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createCatalogThemeApp = exports.createReactPressApp = exports.DevChunkRecovery = exports.createThemeApp = void 0;
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
5
|
+
exports.createThemeApp = require('./createThemeApp').createThemeApp;
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
7
|
+
exports.DevChunkRecovery = require('./devChunkRecovery').DevChunkRecovery;
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
9
|
+
exports.createReactPressApp = require('./createReactPressApp').createReactPressApp;
|
|
10
|
+
/** @deprecated Use `createReactPressApp`. */
|
|
11
|
+
exports.createCatalogThemeApp = exports.createReactPressApp;
|
package/dist/config/env.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -11,19 +15,29 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
11
15
|
}) : function(o, v) {
|
|
12
16
|
o["default"] = v;
|
|
13
17
|
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
21
35
|
var _a;
|
|
22
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
37
|
exports.config = exports.file = void 0;
|
|
38
|
+
const dotenv = __importStar(require("dotenv"));
|
|
24
39
|
const fs = __importStar(require("fs-extra"));
|
|
25
40
|
const path = __importStar(require("path"));
|
|
26
|
-
const dotenv = __importStar(require("dotenv"));
|
|
27
41
|
const isProd = process.env.NODE_ENV === 'production';
|
|
28
42
|
// 获取项目根目录的函数
|
|
29
43
|
function getProjectRoot() {
|
|
@@ -39,12 +53,12 @@ function parseEnv() {
|
|
|
39
53
|
// 使用改进的项目根目录查找
|
|
40
54
|
const projectRoot = getProjectRoot();
|
|
41
55
|
const possibleBasePaths = [
|
|
42
|
-
projectRoot,
|
|
43
|
-
path.resolve(__dirname, '../../'),
|
|
44
|
-
path.resolve(__dirname, '../../../'),
|
|
45
|
-
path.resolve(__dirname, '../'),
|
|
46
|
-
process.cwd(),
|
|
47
|
-
path.resolve(process.cwd(), '../'),
|
|
56
|
+
projectRoot, // Project root directory
|
|
57
|
+
path.resolve(__dirname, '../../'), // From config/lib to project root
|
|
58
|
+
path.resolve(__dirname, '../../../'), // From node_modules to project root
|
|
59
|
+
path.resolve(__dirname, '../'), // From client directory to project root
|
|
60
|
+
process.cwd(), // Current working directory
|
|
61
|
+
path.resolve(process.cwd(), '../'), // From client directory to project root
|
|
48
62
|
];
|
|
49
63
|
let foundEnvFiles = [];
|
|
50
64
|
// Search for .env files in all possible locations
|
package/dist/config/global.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { SiteThemeState } from '../theme/extension/theme';
|
|
1
2
|
interface NavItem {
|
|
2
3
|
label: string;
|
|
3
4
|
key: string;
|
|
@@ -28,7 +29,12 @@ interface LanguageConfig {
|
|
|
28
29
|
interface GlobalSetting {
|
|
29
30
|
zh: LanguageConfig;
|
|
30
31
|
en: LanguageConfig;
|
|
32
|
+
theme: SiteThemeState;
|
|
31
33
|
}
|
|
32
34
|
declare const globalSetting: GlobalSetting;
|
|
33
|
-
|
|
35
|
+
/** Persisted in DB `Setting.globalSetting` — theme runtime only (nav/content lives in `config[themeId]`). */
|
|
36
|
+
export declare const systemGlobalSettingDefaults: {
|
|
37
|
+
theme: SiteThemeState;
|
|
38
|
+
};
|
|
39
|
+
export type { GlobalConfig, GlobalSetting, LanguageConfig, NavConfig, NavItem, SiteThemeState, UrlCategory };
|
|
34
40
|
export { globalSetting };
|
package/dist/config/global.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.globalSetting = void 0;
|
|
3
|
+
exports.globalSetting = exports.systemGlobalSettingDefaults = void 0;
|
|
4
|
+
const theme_1 = require("../theme/extension/theme");
|
|
4
5
|
const navConfig = {
|
|
5
6
|
categories: [
|
|
6
7
|
{
|
|
@@ -231,8 +232,8 @@ const urlConfig = [
|
|
|
231
232
|
label: 'Excel转换JSON',
|
|
232
233
|
type: '数据转换工具',
|
|
233
234
|
description: '用于将Excel文件转换为JSON格式的在线工具,便于在Web应用程序中使用。',
|
|
234
|
-
icon: 'https://www.convertio.co/favicon.ico',
|
|
235
|
-
url: 'https://www.convertio.co/zh/excel-json/',
|
|
235
|
+
icon: 'https://www.convertio.co/favicon.ico', // 假设的图标链接,因为convertio可能支持多种转换,不一定有专门的favicon
|
|
236
|
+
url: 'https://www.convertio.co/zh/excel-json/', // 真实的Excel转JSON工具网址(convertio可能是一个综合转换工具,但支持Excel到JSON的转换)
|
|
236
237
|
},
|
|
237
238
|
{
|
|
238
239
|
key: 'chuangkit',
|
|
@@ -386,5 +387,10 @@ const en = {
|
|
|
386
387
|
const globalSetting = {
|
|
387
388
|
zh,
|
|
388
389
|
en,
|
|
390
|
+
theme: theme_1.defaultSiteThemeState,
|
|
389
391
|
};
|
|
390
392
|
exports.globalSetting = globalSetting;
|
|
393
|
+
/** Persisted in DB `Setting.globalSetting` — theme runtime only (nav/content lives in `config[themeId]`). */
|
|
394
|
+
exports.systemGlobalSettingDefaults = {
|
|
395
|
+
theme: theme_1.defaultSiteThemeState,
|
|
396
|
+
};
|
package/dist/config/i18n.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -11,25 +15,37 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
11
15
|
}) : function(o, v) {
|
|
12
16
|
o["default"] = v;
|
|
13
17
|
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
21
35
|
var _a;
|
|
22
36
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
37
|
exports.defaultLocale = exports.locales = exports.messages = void 0;
|
|
24
38
|
const fs = __importStar(require("fs-extra"));
|
|
25
39
|
const path = __importStar(require("path"));
|
|
26
40
|
function parseI18n() {
|
|
27
|
-
|
|
28
|
-
const localesDir = path.join(__dirname, '../locales');
|
|
41
|
+
const localesDir = path.join(__dirname, 'locales');
|
|
29
42
|
if (!fs.existsSync(localesDir)) {
|
|
30
43
|
return { messages: {}, locales: [], defaultLocale: '' };
|
|
31
44
|
}
|
|
32
|
-
const files = fs.readdirSync(localesDir)
|
|
45
|
+
const files = fs.readdirSync(localesDir).filter((file) => {
|
|
46
|
+
const filePath = path.join(localesDir, file);
|
|
47
|
+
return file.endsWith('.json') && fs.statSync(filePath).isFile();
|
|
48
|
+
});
|
|
33
49
|
const messages = files.reduce((i18n, file) => {
|
|
34
50
|
const language = file.replace(path.extname(file), '');
|
|
35
51
|
const json = fs.readJsonSync(path.join(localesDir, file));
|
package/dist/config/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* 环境变量配置
|
|
3
3
|
*/
|
|
4
4
|
import { file } from './env';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { globalSetting, systemGlobalSettingDefaults } from './global';
|
|
6
|
+
import { defaultLocale, locales, messages } from './i18n';
|
|
7
7
|
declare const config: {
|
|
8
8
|
locales: string[];
|
|
9
9
|
defaultLocale: string;
|
|
@@ -11,5 +11,5 @@ declare const config: {
|
|
|
11
11
|
globalSetting: import("./global").GlobalSetting;
|
|
12
12
|
file: string;
|
|
13
13
|
};
|
|
14
|
-
export { config, file,
|
|
14
|
+
export { config, defaultLocale, file, globalSetting, locales, messages, systemGlobalSettingDefaults };
|
|
15
15
|
export default config;
|
package/dist/config/index.js
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.systemGlobalSettingDefaults = exports.messages = exports.locales = exports.globalSetting = exports.file = exports.defaultLocale = exports.config = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* 环境变量配置
|
|
6
6
|
*/
|
|
7
7
|
const env_1 = require("./env");
|
|
8
8
|
Object.defineProperty(exports, "file", { enumerable: true, get: function () { return env_1.file; } });
|
|
9
|
-
const i18n_1 = require("./i18n");
|
|
10
|
-
Object.defineProperty(exports, "messages", { enumerable: true, get: function () { return i18n_1.messages; } });
|
|
11
|
-
Object.defineProperty(exports, "locales", { enumerable: true, get: function () { return i18n_1.locales; } });
|
|
12
|
-
Object.defineProperty(exports, "defaultLocale", { enumerable: true, get: function () { return i18n_1.defaultLocale; } });
|
|
13
9
|
const global_1 = require("./global");
|
|
14
10
|
Object.defineProperty(exports, "globalSetting", { enumerable: true, get: function () { return global_1.globalSetting; } });
|
|
11
|
+
Object.defineProperty(exports, "systemGlobalSettingDefaults", { enumerable: true, get: function () { return global_1.systemGlobalSettingDefaults; } });
|
|
12
|
+
const i18n_1 = require("./i18n");
|
|
13
|
+
Object.defineProperty(exports, "defaultLocale", { enumerable: true, get: function () { return i18n_1.defaultLocale; } });
|
|
14
|
+
Object.defineProperty(exports, "locales", { enumerable: true, get: function () { return i18n_1.locales; } });
|
|
15
|
+
Object.defineProperty(exports, "messages", { enumerable: true, get: function () { return i18n_1.messages; } });
|
|
15
16
|
// Create a unified config object that includes all configuration properties
|
|
16
17
|
const config = {
|
|
17
18
|
...env_1.config,
|
|
@@ -69,12 +69,17 @@
|
|
|
69
69
|
"openAuth": "Use third-party login",
|
|
70
70
|
"areYouHasAccount": "Do you already have an account?",
|
|
71
71
|
"loginNow": "Login now",
|
|
72
|
-
"toggleNeedSetInfo": "Incomplete email information, please complete personal information."
|
|
72
|
+
"toggleNeedSetInfo": "Incomplete email information, please complete personal information.",
|
|
73
|
+
"guestCommentLead": "Enter your name and email to comment — no login required.",
|
|
74
|
+
"commentingAs": "Commenting as {name}"
|
|
73
75
|
},
|
|
74
76
|
"loading": "Loading",
|
|
75
|
-
"copySuccess": "
|
|
77
|
+
"copySuccess": "Copied",
|
|
78
|
+
"shareLinkCopied": "Share link copied",
|
|
76
79
|
"copy": "copy",
|
|
77
80
|
"article": "Articles",
|
|
81
|
+
"skipToContent": "Skip to content",
|
|
82
|
+
"search": "Search",
|
|
78
83
|
"searchArticle": "Search Articles",
|
|
79
84
|
"searchArticlePlaceholder": "Enter keywords, search articles",
|
|
80
85
|
"shareNamespace": {
|
|
@@ -93,5 +98,28 @@
|
|
|
93
98
|
"rssSubscribe": "RSS Subscription",
|
|
94
99
|
"aboutUs": "About Us",
|
|
95
100
|
"nav": "Navigation",
|
|
96
|
-
"suggestions": "Suggestions"
|
|
101
|
+
"suggestions": "Suggestions",
|
|
102
|
+
"theme": {
|
|
103
|
+
"toggle": "Toggle theme"
|
|
104
|
+
},
|
|
105
|
+
"locale": {
|
|
106
|
+
"switch": "Switch language",
|
|
107
|
+
"switchToEn": "Switch to English",
|
|
108
|
+
"switchToZh": "Switch to Chinese"
|
|
109
|
+
},
|
|
110
|
+
"pageTitleNavSite": "Site Navigation",
|
|
111
|
+
"pageTitleLogin": "Login",
|
|
112
|
+
"pageTitleTag": "Tag: {label}",
|
|
113
|
+
"pageTitleCategory": "Category: {label}",
|
|
114
|
+
"pageTitleNavDetail": "Navigation: {label}",
|
|
115
|
+
"navPreviewDisclaimer": "This site only provides content previews and does not store any information. Please protect your account and property. If content cannot be previewed, click \"Open site\" to view it externally.",
|
|
116
|
+
"navOpenSite": "Open site ›",
|
|
117
|
+
"commentShowMore": "Show more ↓",
|
|
118
|
+
"commentShowLess": "Collapse ↑",
|
|
119
|
+
"navExpandMenu": "Expand menu",
|
|
120
|
+
"navCollapseMenu": "Collapse menu",
|
|
121
|
+
"navCategoryMenu": "Navigation categories",
|
|
122
|
+
"carouselPrev": "Previous slide, {current} of {total}",
|
|
123
|
+
"carouselNext": "Next slide, {current} of {total}",
|
|
124
|
+
"aboutUsFallback": "ReactPress — Modern blog publishing platform"
|
|
97
125
|
}
|
|
@@ -67,14 +67,19 @@
|
|
|
67
67
|
"openAuth": "第三方登录",
|
|
68
68
|
"areYouHasAccount": "已有账号?",
|
|
69
69
|
"loginNow": "立即登录",
|
|
70
|
-
"toggleNeedSetInfo": "邮箱信息不完整,请完善个人资料。"
|
|
70
|
+
"toggleNeedSetInfo": "邮箱信息不完整,请完善个人资料。",
|
|
71
|
+
"guestCommentLead": "填写昵称与邮箱即可评论,无需登录。",
|
|
72
|
+
"commentingAs": "以 {name} 的身份发表评论"
|
|
71
73
|
},
|
|
72
74
|
"loading": "加载中",
|
|
73
|
-
"copySuccess": "
|
|
75
|
+
"copySuccess": "已复制",
|
|
76
|
+
"shareLinkCopied": "分享链接复制成功",
|
|
74
77
|
"copy": "复制",
|
|
75
78
|
"article": "文章",
|
|
76
79
|
"home": "首页",
|
|
80
|
+
"skipToContent": "跳到正文",
|
|
77
81
|
"knowledge": "专辑",
|
|
82
|
+
"search": "搜索",
|
|
78
83
|
"searchArticle": "文章搜索",
|
|
79
84
|
"searchArticlePlaceholder": "输入关键字,搜索文章",
|
|
80
85
|
"shareNamespace": {
|
|
@@ -93,5 +98,28 @@
|
|
|
93
98
|
"rssSubscribe": "RSS 订阅",
|
|
94
99
|
"aboutUs": "关于我们",
|
|
95
100
|
"nav": "导航",
|
|
96
|
-
"suggestions": "建议"
|
|
101
|
+
"suggestions": "建议",
|
|
102
|
+
"theme": {
|
|
103
|
+
"toggle": "切换主题"
|
|
104
|
+
},
|
|
105
|
+
"locale": {
|
|
106
|
+
"switch": "切换语言",
|
|
107
|
+
"switchToEn": "切换到 English",
|
|
108
|
+
"switchToZh": "切换到中文"
|
|
109
|
+
},
|
|
110
|
+
"pageTitleNavSite": "网址导航",
|
|
111
|
+
"pageTitleLogin": "登录",
|
|
112
|
+
"pageTitleTag": "标签:{label}",
|
|
113
|
+
"pageTitleCategory": "分类:{label}",
|
|
114
|
+
"pageTitleNavDetail": "导航:{label}",
|
|
115
|
+
"navPreviewDisclaimer": "本站只做内容预览,不做任何信息存储,请注意您的账号和财产安全。如遇内容无法预览,请点击「打开网站」按钮预览。",
|
|
116
|
+
"navOpenSite": "打开网站 ›",
|
|
117
|
+
"commentShowMore": "查看更多 ↓",
|
|
118
|
+
"commentShowLess": "收起 ↑",
|
|
119
|
+
"navExpandMenu": "展开目录",
|
|
120
|
+
"navCollapseMenu": "收起目录",
|
|
121
|
+
"navCategoryMenu": "导航分类",
|
|
122
|
+
"carouselPrev": "上一张,第 {current} 张,共 {total} 张",
|
|
123
|
+
"carouselNext": "下一张,第 {current} 张,共 {total} 张",
|
|
124
|
+
"aboutUsFallback": "ReactPress — 现代化博客发布平台"
|
|
97
125
|
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { DevPortRedirectOptions, DevPortRole } from './portRedirect';
|
|
2
|
+
export { buildDevPortRedirectUrl, isDirectDevPortAccess, isNginxDevRedirectEnabled, resolveDevPortRole, resolveNginxEntryUrl, shouldRedirectDevPortToNginx, } from './portRedirect';
|
|
3
|
+
export { devPortRedirectPlugin } from './vitePortRedirectPlugin';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.devPortRedirectPlugin = exports.shouldRedirectDevPortToNginx = exports.resolveNginxEntryUrl = exports.resolveDevPortRole = exports.isNginxDevRedirectEnabled = exports.isDirectDevPortAccess = exports.buildDevPortRedirectUrl = void 0;
|
|
4
|
+
var portRedirect_1 = require("./portRedirect");
|
|
5
|
+
Object.defineProperty(exports, "buildDevPortRedirectUrl", { enumerable: true, get: function () { return portRedirect_1.buildDevPortRedirectUrl; } });
|
|
6
|
+
Object.defineProperty(exports, "isDirectDevPortAccess", { enumerable: true, get: function () { return portRedirect_1.isDirectDevPortAccess; } });
|
|
7
|
+
Object.defineProperty(exports, "isNginxDevRedirectEnabled", { enumerable: true, get: function () { return portRedirect_1.isNginxDevRedirectEnabled; } });
|
|
8
|
+
Object.defineProperty(exports, "resolveDevPortRole", { enumerable: true, get: function () { return portRedirect_1.resolveDevPortRole; } });
|
|
9
|
+
Object.defineProperty(exports, "resolveNginxEntryUrl", { enumerable: true, get: function () { return portRedirect_1.resolveNginxEntryUrl; } });
|
|
10
|
+
Object.defineProperty(exports, "shouldRedirectDevPortToNginx", { enumerable: true, get: function () { return portRedirect_1.shouldRedirectDevPortToNginx; } });
|
|
11
|
+
var vitePortRedirectPlugin_1 = require("./vitePortRedirectPlugin");
|
|
12
|
+
Object.defineProperty(exports, "devPortRedirectPlugin", { enumerable: true, get: function () { return vitePortRedirectPlugin_1.devPortRedirectPlugin; } });
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export type DevPortRole = 'visitor' | 'admin' | 'api';
|
|
2
|
+
export declare function resolveDevPortRole(directPort: number): DevPortRole;
|
|
3
|
+
export declare function isNginxDevRedirectEnabled(): boolean;
|
|
4
|
+
export declare function resolveNginxEntryUrl(): string;
|
|
5
|
+
export declare function isDirectDevPortAccess(host: string | null | undefined, port: number): boolean;
|
|
6
|
+
export interface DevPortRedirectOptions {
|
|
7
|
+
host?: string | null;
|
|
8
|
+
method?: string;
|
|
9
|
+
accept?: string | null;
|
|
10
|
+
directPort: number;
|
|
11
|
+
pathname?: string;
|
|
12
|
+
skipPathPrefixes?: string[];
|
|
13
|
+
}
|
|
14
|
+
export declare function shouldRedirectDevPortToNginx(options: DevPortRedirectOptions): boolean;
|
|
15
|
+
export declare function buildDevPortRedirectUrl(options: {
|
|
16
|
+
directPort: number;
|
|
17
|
+
pathname?: string;
|
|
18
|
+
search?: string;
|
|
19
|
+
nginxEntryUrl?: string;
|
|
20
|
+
}): string;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveDevPortRole = resolveDevPortRole;
|
|
4
|
+
exports.isNginxDevRedirectEnabled = isNginxDevRedirectEnabled;
|
|
5
|
+
exports.resolveNginxEntryUrl = resolveNginxEntryUrl;
|
|
6
|
+
exports.isDirectDevPortAccess = isDirectDevPortAccess;
|
|
7
|
+
exports.shouldRedirectDevPortToNginx = shouldRedirectDevPortToNginx;
|
|
8
|
+
exports.buildDevPortRedirectUrl = buildDevPortRedirectUrl;
|
|
9
|
+
const DEFAULT_NGINX_PORT = 80;
|
|
10
|
+
function readPortEnv(key, fallback) {
|
|
11
|
+
const raw = process.env[key]?.trim();
|
|
12
|
+
if (!raw)
|
|
13
|
+
return fallback;
|
|
14
|
+
const parsed = parseInt(raw, 10);
|
|
15
|
+
return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback;
|
|
16
|
+
}
|
|
17
|
+
function resolveDevPortRole(directPort) {
|
|
18
|
+
const apiPort = readPortEnv('SERVER_PORT', 3002);
|
|
19
|
+
const adminPort = readPortEnv('WEB_ADMIN_PORT', 3000);
|
|
20
|
+
if (directPort === apiPort)
|
|
21
|
+
return 'api';
|
|
22
|
+
if (directPort === adminPort)
|
|
23
|
+
return 'admin';
|
|
24
|
+
return 'visitor';
|
|
25
|
+
}
|
|
26
|
+
function isNginxDevRedirectEnabled() {
|
|
27
|
+
return Boolean(process.env.REACTPRESS_NGINX_ENTRY_URL?.trim());
|
|
28
|
+
}
|
|
29
|
+
function resolveNginxEntryUrl() {
|
|
30
|
+
const override = process.env.REACTPRESS_NGINX_ENTRY_URL?.trim();
|
|
31
|
+
if (override) {
|
|
32
|
+
return override.replace(/\/$/, '');
|
|
33
|
+
}
|
|
34
|
+
const rawPort = process.env.NGINX_PORT?.trim();
|
|
35
|
+
const port = rawPort ? parseInt(rawPort, 10) : DEFAULT_NGINX_PORT;
|
|
36
|
+
if (Number.isFinite(port) && port > 0 && port !== DEFAULT_NGINX_PORT) {
|
|
37
|
+
return `http://localhost:${port}`;
|
|
38
|
+
}
|
|
39
|
+
return 'http://localhost';
|
|
40
|
+
}
|
|
41
|
+
function isDirectDevPortAccess(host, port) {
|
|
42
|
+
if (!host || !Number.isFinite(port) || port <= 0)
|
|
43
|
+
return false;
|
|
44
|
+
const normalized = host.toLowerCase();
|
|
45
|
+
return (normalized === `localhost:${port}` ||
|
|
46
|
+
normalized === `127.0.0.1:${port}` ||
|
|
47
|
+
normalized === `[::1]:${port}`);
|
|
48
|
+
}
|
|
49
|
+
function acceptsHtmlNavigation(accept) {
|
|
50
|
+
if (!accept)
|
|
51
|
+
return false;
|
|
52
|
+
return accept.includes('text/html');
|
|
53
|
+
}
|
|
54
|
+
function shouldRedirectDevPortToNginx(options) {
|
|
55
|
+
if (process.env.NODE_ENV === 'production')
|
|
56
|
+
return false;
|
|
57
|
+
if (process.env.REACTPRESS_SKIP_DEV_PORT_REDIRECT === '1')
|
|
58
|
+
return false;
|
|
59
|
+
if (!isNginxDevRedirectEnabled())
|
|
60
|
+
return false;
|
|
61
|
+
const method = (options.method || 'GET').toUpperCase();
|
|
62
|
+
if (method !== 'GET' && method !== 'HEAD')
|
|
63
|
+
return false;
|
|
64
|
+
if (!isDirectDevPortAccess(options.host, options.directPort))
|
|
65
|
+
return false;
|
|
66
|
+
if (!acceptsHtmlNavigation(options.accept))
|
|
67
|
+
return false;
|
|
68
|
+
const pathname = options.pathname || '/';
|
|
69
|
+
if (options.skipPathPrefixes?.some((prefix) => pathname.startsWith(prefix))) {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
function buildDevPortRedirectUrl(options) {
|
|
75
|
+
const entry = (options.nginxEntryUrl || resolveNginxEntryUrl()).replace(/\/$/, '');
|
|
76
|
+
const pathname = options.pathname || '/';
|
|
77
|
+
const search = options.search || '';
|
|
78
|
+
const role = resolveDevPortRole(options.directPort);
|
|
79
|
+
if (role === 'api') {
|
|
80
|
+
if (pathname === '/' || pathname === '') {
|
|
81
|
+
return `${entry}/api${search}`;
|
|
82
|
+
}
|
|
83
|
+
return `${entry}${pathname}${search}`;
|
|
84
|
+
}
|
|
85
|
+
if (role === 'admin') {
|
|
86
|
+
let adminPath = pathname;
|
|
87
|
+
if (!adminPath.startsWith('/admin')) {
|
|
88
|
+
adminPath = adminPath === '/' ? '/admin/' : `/admin${adminPath.startsWith('/') ? adminPath : `/${adminPath}`}`;
|
|
89
|
+
}
|
|
90
|
+
return `${entry}${adminPath}${search}`;
|
|
91
|
+
}
|
|
92
|
+
return `${entry}${pathname}${search}`;
|
|
93
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
type DevServer = {
|
|
2
|
+
middlewares: {
|
|
3
|
+
use: (handler: (req: DevRequest, res: DevResponse, next: () => void) => void) => void;
|
|
4
|
+
};
|
|
5
|
+
};
|
|
6
|
+
type DevRequest = {
|
|
7
|
+
url?: string;
|
|
8
|
+
method?: string;
|
|
9
|
+
headers: {
|
|
10
|
+
host?: string;
|
|
11
|
+
accept?: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
type DevResponse = {
|
|
15
|
+
statusCode: number;
|
|
16
|
+
setHeader: (name: string, value: string) => void;
|
|
17
|
+
end: () => void;
|
|
18
|
+
};
|
|
19
|
+
/** Redirect direct :3000 browser hits to nginx entry when REACTPRESS_NGINX_ENTRY_URL is set. */
|
|
20
|
+
export declare function devPortRedirectPlugin(port: number): {
|
|
21
|
+
name: string;
|
|
22
|
+
configureServer(server: DevServer): void;
|
|
23
|
+
};
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.devPortRedirectPlugin = devPortRedirectPlugin;
|
|
4
|
+
const portRedirect_1 = require("./portRedirect");
|
|
5
|
+
const VITE_DEV_SKIP_PREFIXES = ['/@vite', '/@fs', '/@id', '/node_modules'];
|
|
6
|
+
function createRedirectMiddleware(port) {
|
|
7
|
+
return (req, res, next) => {
|
|
8
|
+
const url = req.url || '/';
|
|
9
|
+
const pathname = url.split('?')[0] || '/';
|
|
10
|
+
const search = url.includes('?') ? url.slice(url.indexOf('?')) : '';
|
|
11
|
+
if (!(0, portRedirect_1.shouldRedirectDevPortToNginx)({
|
|
12
|
+
host: req.headers.host,
|
|
13
|
+
method: req.method,
|
|
14
|
+
accept: req.headers.accept,
|
|
15
|
+
directPort: port,
|
|
16
|
+
pathname,
|
|
17
|
+
skipPathPrefixes: VITE_DEV_SKIP_PREFIXES,
|
|
18
|
+
})) {
|
|
19
|
+
next();
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const target = (0, portRedirect_1.buildDevPortRedirectUrl)({
|
|
23
|
+
directPort: port,
|
|
24
|
+
pathname,
|
|
25
|
+
search,
|
|
26
|
+
});
|
|
27
|
+
res.statusCode = 302;
|
|
28
|
+
res.setHeader('Location', target);
|
|
29
|
+
res.end();
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/** Redirect direct :3000 browser hits to nginx entry when REACTPRESS_NGINX_ENTRY_URL is set. */
|
|
33
|
+
function devPortRedirectPlugin(port) {
|
|
34
|
+
return {
|
|
35
|
+
name: 'reactpress-dev-port-redirect',
|
|
36
|
+
configureServer(server) {
|
|
37
|
+
server.middlewares.use(createRedirectMiddleware(port));
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
}
|