@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,251 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createThemeProviders = createThemeProviders;
|
|
4
|
+
/** Create REST provider classes bound to a theme HTTP client (axios + envelope unwrap). */
|
|
5
|
+
function createThemeProviders(http) {
|
|
6
|
+
class SettingProvider {
|
|
7
|
+
static async getSetting() {
|
|
8
|
+
return http.post('/setting/get');
|
|
9
|
+
}
|
|
10
|
+
static async updateSetting(data) {
|
|
11
|
+
return http.post('/setting', data);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
class ArticleProvider {
|
|
15
|
+
static async getArticles(params) {
|
|
16
|
+
return http.get('/article', { params });
|
|
17
|
+
}
|
|
18
|
+
static async getAllRecommendArticles() {
|
|
19
|
+
return http.get('/article/all/recommend');
|
|
20
|
+
}
|
|
21
|
+
static async getArticlesByCategory(category, params) {
|
|
22
|
+
return http.get(`/article/category/${category}`, { params });
|
|
23
|
+
}
|
|
24
|
+
static async getArticlesByTag(tag, params) {
|
|
25
|
+
return http.get(`/article/tag/${tag}`, { params });
|
|
26
|
+
}
|
|
27
|
+
static async getRecommend(articleId = null, pageSize = 6) {
|
|
28
|
+
return http.get('/article/recommend', { params: { articleId, pageSize } });
|
|
29
|
+
}
|
|
30
|
+
static async getArchives() {
|
|
31
|
+
return http.get('/article/archives');
|
|
32
|
+
}
|
|
33
|
+
static async getArticle(id) {
|
|
34
|
+
return http.get(`/article/${id}`);
|
|
35
|
+
}
|
|
36
|
+
static async addArticle(data) {
|
|
37
|
+
return http.post('/article', data);
|
|
38
|
+
}
|
|
39
|
+
static async updateArticle(id, data) {
|
|
40
|
+
return http.patch(`/article/${id}`, data);
|
|
41
|
+
}
|
|
42
|
+
static async updateArticleViews(id) {
|
|
43
|
+
return http.post(`/article/${id}/views`);
|
|
44
|
+
}
|
|
45
|
+
static async updateArticleLikes(id, type) {
|
|
46
|
+
return http.post(`/article/${id}/likes`, { type });
|
|
47
|
+
}
|
|
48
|
+
static async checkPassword(id, password) {
|
|
49
|
+
return http.post(`/article/${id}/checkPassword`, { password });
|
|
50
|
+
}
|
|
51
|
+
static async deleteArticle(id) {
|
|
52
|
+
return http.delete(`/article/${id}`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
class CategoryProvider {
|
|
56
|
+
static async getCategory(params) {
|
|
57
|
+
return http.get('/category', { params });
|
|
58
|
+
}
|
|
59
|
+
static async add(data) {
|
|
60
|
+
return http.post('/category', data);
|
|
61
|
+
}
|
|
62
|
+
static async getCategoryById(id) {
|
|
63
|
+
return http.get(`/category/${id}`);
|
|
64
|
+
}
|
|
65
|
+
static async update(id, data) {
|
|
66
|
+
return http.patch(`/category/${id}`, data);
|
|
67
|
+
}
|
|
68
|
+
static async delete(id) {
|
|
69
|
+
return http.delete(`/category/${id}`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
class TagProvider {
|
|
73
|
+
static async getTags(params) {
|
|
74
|
+
return http.get('/tag', { params });
|
|
75
|
+
}
|
|
76
|
+
static async getTagWithArticles(id, needFilter = false) {
|
|
77
|
+
return http.get(`/tag/${id}/article`, needFilter ? { params: { status: 'publish' } } : {});
|
|
78
|
+
}
|
|
79
|
+
static async addTag(data) {
|
|
80
|
+
return http.post('/tag', data);
|
|
81
|
+
}
|
|
82
|
+
static async getTagById(id) {
|
|
83
|
+
return http.get(`/tag/${id}`);
|
|
84
|
+
}
|
|
85
|
+
static async updateTag(id, data) {
|
|
86
|
+
return http.patch(`/tag/${id}`, data);
|
|
87
|
+
}
|
|
88
|
+
static async deleteTag(id) {
|
|
89
|
+
return http.delete(`/tag/${id}`);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
class PageProvider {
|
|
93
|
+
static async getPages(params) {
|
|
94
|
+
return http.get('/page', { params });
|
|
95
|
+
}
|
|
96
|
+
static async getAllPublisedPages() {
|
|
97
|
+
return http.get('/page', { params: { status: 'publish' } }).then((res) => {
|
|
98
|
+
const [pages, total] = res;
|
|
99
|
+
return [pages.sort((a, b) => -a.order + b.order), total];
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
static async getPage(id) {
|
|
103
|
+
return http.get(`/page/${id}`);
|
|
104
|
+
}
|
|
105
|
+
static async addPage(data) {
|
|
106
|
+
return http.post('/page', data);
|
|
107
|
+
}
|
|
108
|
+
static async updatePage(id, data) {
|
|
109
|
+
return http.patch(`/page/${id}`, data);
|
|
110
|
+
}
|
|
111
|
+
static async updatePageViews(id) {
|
|
112
|
+
return http.post(`/page/${id}/views`);
|
|
113
|
+
}
|
|
114
|
+
static async deletePage(id) {
|
|
115
|
+
return http.delete(`/page/${id}`);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
class CommentProvider {
|
|
119
|
+
static async getComments(params) {
|
|
120
|
+
return http.get('/comment', { params });
|
|
121
|
+
}
|
|
122
|
+
static async getComment(id) {
|
|
123
|
+
return http.get(`/comment/${id}`);
|
|
124
|
+
}
|
|
125
|
+
static async getArticleComments(hostId, params) {
|
|
126
|
+
return http.get(`/comment/host/${hostId}`, { params });
|
|
127
|
+
}
|
|
128
|
+
static async addComment(data) {
|
|
129
|
+
return http.post('/comment', data);
|
|
130
|
+
}
|
|
131
|
+
static async updateComment(id, data) {
|
|
132
|
+
return http.patch(`/comment/${id}`, data);
|
|
133
|
+
}
|
|
134
|
+
static async deleteComment(id) {
|
|
135
|
+
return http.delete(`/comment/${id}`);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
class UserProvider {
|
|
139
|
+
static async login(data) {
|
|
140
|
+
return http.post('/auth/login', data);
|
|
141
|
+
}
|
|
142
|
+
static async loginWithGithub(code) {
|
|
143
|
+
return http.post('/auth/github', { code });
|
|
144
|
+
}
|
|
145
|
+
static async register(data) {
|
|
146
|
+
return http.post('/user/register', data);
|
|
147
|
+
}
|
|
148
|
+
static getUsers(params) {
|
|
149
|
+
return http.get('/user', { params });
|
|
150
|
+
}
|
|
151
|
+
static async update(data) {
|
|
152
|
+
return http.post('/user/update', data);
|
|
153
|
+
}
|
|
154
|
+
static async updatePassword(data) {
|
|
155
|
+
return http.post('/user/password', data);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
class KnowledgeProvider {
|
|
159
|
+
static createBook(data) {
|
|
160
|
+
return http.post('/knowledge/book', data);
|
|
161
|
+
}
|
|
162
|
+
static createChapters(data) {
|
|
163
|
+
return http.post('/knowledge/chapter', data);
|
|
164
|
+
}
|
|
165
|
+
static async deleteKnowledge(id) {
|
|
166
|
+
return http.delete(`/knowledge/${id}`);
|
|
167
|
+
}
|
|
168
|
+
static async updateKnowledge(id, data) {
|
|
169
|
+
return http.patch(`/knowledge/${id}`, data);
|
|
170
|
+
}
|
|
171
|
+
static async getKnowledges(params = {}) {
|
|
172
|
+
return http.get('/knowledge', { params });
|
|
173
|
+
}
|
|
174
|
+
static async getKnowledge(id) {
|
|
175
|
+
return http.get(`/knowledge/${id}`);
|
|
176
|
+
}
|
|
177
|
+
static async updateKnowledgeViews(id) {
|
|
178
|
+
return http.post(`/knowledge/${id}/views`);
|
|
179
|
+
}
|
|
180
|
+
static async updateKnowledgeLikes(id, type) {
|
|
181
|
+
return http.post(`/knowledge/${id}/likes`, { type });
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
class SearchProvider {
|
|
185
|
+
static async searchArticles(keyword) {
|
|
186
|
+
return http.get('/search/article', { params: { keyword } });
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
class FileProvider {
|
|
190
|
+
static async uploadFile(file, unique = 0) {
|
|
191
|
+
return http.post('/file/upload', file, {
|
|
192
|
+
headers: { 'Content-Type': 'multipart/form-data' },
|
|
193
|
+
params: { unique },
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
static async getFiles(params) {
|
|
197
|
+
return http.get('/file', { params });
|
|
198
|
+
}
|
|
199
|
+
static async deleteFile(id) {
|
|
200
|
+
return http.delete(`/file/${id}`);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
class ViewProvider {
|
|
204
|
+
static async getViews(params) {
|
|
205
|
+
return http.get('/view', { params });
|
|
206
|
+
}
|
|
207
|
+
static async addView(data) {
|
|
208
|
+
return http.post('/view', data);
|
|
209
|
+
}
|
|
210
|
+
static async getViewsByUrl(url) {
|
|
211
|
+
return http.get('/view/url', { params: { url } });
|
|
212
|
+
}
|
|
213
|
+
static async deleteView(id) {
|
|
214
|
+
return http.delete(`/view/${id}`);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
class MailProvider {
|
|
218
|
+
static async getMails(params) {
|
|
219
|
+
return http.get('/mail', { params });
|
|
220
|
+
}
|
|
221
|
+
static async deleteMail(id) {
|
|
222
|
+
return http.delete(`/mail/${id}`);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
class SmtpProvider {
|
|
226
|
+
static async testSendMail(user) {
|
|
227
|
+
return http.post('/smtp/test', user);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
class PosterProvider {
|
|
231
|
+
static async createPoster(data) {
|
|
232
|
+
return http.post('/poster', data);
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return {
|
|
236
|
+
SettingProvider,
|
|
237
|
+
ArticleProvider,
|
|
238
|
+
CategoryProvider,
|
|
239
|
+
TagProvider,
|
|
240
|
+
PageProvider,
|
|
241
|
+
CommentProvider,
|
|
242
|
+
UserProvider,
|
|
243
|
+
KnowledgeProvider,
|
|
244
|
+
SearchProvider,
|
|
245
|
+
FileProvider,
|
|
246
|
+
ViewProvider,
|
|
247
|
+
MailProvider,
|
|
248
|
+
SmtpProvider,
|
|
249
|
+
PosterProvider,
|
|
250
|
+
};
|
|
251
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import type { CreateThemeAxiosClientOptions } from '../api/httpClient';
|
|
2
|
+
export type CreateThemeHttpStackOptions = CreateThemeAxiosClientOptions & {
|
|
3
|
+
onError?: (message: string) => void;
|
|
4
|
+
onUnauthorized?: () => void;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* One-call HTTP client + REST providers for theme pages.
|
|
8
|
+
* Mirrors the stack used inside `createReactPressApp`, with optional toast hooks.
|
|
9
|
+
*/
|
|
10
|
+
export declare function createThemeHttpStack(options?: CreateThemeHttpStackOptions): {
|
|
11
|
+
SettingProvider: {
|
|
12
|
+
new (): {};
|
|
13
|
+
getSetting(): Promise<import("../..").ISetting>;
|
|
14
|
+
updateSetting(data: Partial<import("../..").ISetting>): Promise<import("../..").ISetting>;
|
|
15
|
+
};
|
|
16
|
+
ArticleProvider: {
|
|
17
|
+
new (): {};
|
|
18
|
+
getArticles(params: Record<string, unknown>): Promise<[import("../..").IArticle[], number]>;
|
|
19
|
+
getAllRecommendArticles(): Promise<import("../..").IArticle[]>;
|
|
20
|
+
getArticlesByCategory(category: string, params: Record<string, unknown>): Promise<[import("../..").IArticle[], number]>;
|
|
21
|
+
getArticlesByTag(tag: string, params: Record<string, unknown>): Promise<[import("../..").IArticle[], number]>;
|
|
22
|
+
getRecommend(articleId?: string | null, pageSize?: number): Promise<import("../..").IArticle[]>;
|
|
23
|
+
getArchives(): Promise<Record<string, Record<string, import("../..").IArticle[]>>>;
|
|
24
|
+
getArticle(id: string): Promise<import("../..").IArticle>;
|
|
25
|
+
addArticle(data: Partial<import("../..").IArticle>): Promise<import("../..").IArticle>;
|
|
26
|
+
updateArticle(id: string, data: Partial<import("../..").IArticle>): Promise<import("../..").IArticle>;
|
|
27
|
+
updateArticleViews(id: string): Promise<import("../..").IArticle>;
|
|
28
|
+
updateArticleLikes(id: string, type: string): Promise<import("../..").IArticle>;
|
|
29
|
+
checkPassword(id: string, password: string): Promise<{
|
|
30
|
+
pass: boolean;
|
|
31
|
+
} & import("../..").IArticle>;
|
|
32
|
+
deleteArticle(id: string): Promise<import("../..").IArticle>;
|
|
33
|
+
};
|
|
34
|
+
CategoryProvider: {
|
|
35
|
+
new (): {};
|
|
36
|
+
getCategory(params?: Record<string, unknown>): Promise<import("../..").ICategory[]>;
|
|
37
|
+
add(data: Partial<import("../..").ICategory>): Promise<import("../..").ICategory>;
|
|
38
|
+
getCategoryById(id: string): Promise<import("../..").ICategory>;
|
|
39
|
+
update(id: string, data: Partial<import("../..").ICategory>): Promise<import("../..").ICategory>;
|
|
40
|
+
delete(id: string): Promise<import("../..").ICategory>;
|
|
41
|
+
};
|
|
42
|
+
TagProvider: {
|
|
43
|
+
new (): {};
|
|
44
|
+
getTags(params?: Record<string, unknown>): Promise<import("../..").ITag[]>;
|
|
45
|
+
getTagWithArticles(id: string, needFilter?: boolean): Promise<import("../..").ITag>;
|
|
46
|
+
addTag(data: Partial<import("../..").ITag>): Promise<import("../..").ITag>;
|
|
47
|
+
getTagById(id: string): Promise<import("../..").ITag>;
|
|
48
|
+
updateTag(id: string, data: Partial<import("../..").ITag>): Promise<import("../..").ITag>;
|
|
49
|
+
deleteTag(id: string): Promise<import("../..").ITag>;
|
|
50
|
+
};
|
|
51
|
+
PageProvider: {
|
|
52
|
+
new (): {};
|
|
53
|
+
getPages(params: Record<string, unknown>): Promise<[import("../..").IPage[], number]>;
|
|
54
|
+
getAllPublisedPages(): Promise<[import("../..").IPage[], number]>;
|
|
55
|
+
getPage(id: string): Promise<import("../..").IPage>;
|
|
56
|
+
addPage(data: Partial<import("../..").IPage>): Promise<import("../..").IPage>;
|
|
57
|
+
updatePage(id: string, data: Partial<import("../..").IPage>): Promise<import("../..").IPage>;
|
|
58
|
+
updatePageViews(id: string): Promise<import("../..").IPage>;
|
|
59
|
+
deletePage(id: string): Promise<import("../..").IPage>;
|
|
60
|
+
};
|
|
61
|
+
CommentProvider: {
|
|
62
|
+
new (): {};
|
|
63
|
+
getComments(params: Record<string, unknown>): Promise<[import("../..").IComment[], number]>;
|
|
64
|
+
getComment(id: string): Promise<import("../..").IComment>;
|
|
65
|
+
getArticleComments(hostId: string, params: Record<string, unknown>): Promise<[import("../..").IComment[], number]>;
|
|
66
|
+
addComment(data: Partial<import("../..").IComment>): Promise<import("../..").IComment>;
|
|
67
|
+
updateComment(id: string, data: Partial<import("../..").IComment>): Promise<import("../..").IComment>;
|
|
68
|
+
deleteComment(id: string): Promise<import("../..").IComment>;
|
|
69
|
+
};
|
|
70
|
+
UserProvider: {
|
|
71
|
+
new (): {};
|
|
72
|
+
login(data: Record<string, unknown>): Promise<import("../..").IUser>;
|
|
73
|
+
loginWithGithub(code: string): Promise<import("../..").IUser>;
|
|
74
|
+
register(data: Record<string, unknown>): Promise<import("../..").IUser>;
|
|
75
|
+
getUsers(params: Record<string, unknown>): Promise<[import("../..").IUser[], number]>;
|
|
76
|
+
update(data: Record<string, unknown>): Promise<import("../..").IUser>;
|
|
77
|
+
updatePassword(data: Record<string, unknown>): Promise<import("../..").IUser>;
|
|
78
|
+
};
|
|
79
|
+
KnowledgeProvider: {
|
|
80
|
+
new (): {};
|
|
81
|
+
createBook(data: Partial<import("../..").IKnowledge>): Promise<import("../..").IKnowledge>;
|
|
82
|
+
createChapters(data: Partial<import("../..").IKnowledge>[]): Promise<import("../..").IKnowledge[]>;
|
|
83
|
+
deleteKnowledge(id: string): Promise<import("../..").IKnowledge>;
|
|
84
|
+
updateKnowledge(id: string, data: Partial<import("../..").IKnowledge>): Promise<import("../..").IKnowledge>;
|
|
85
|
+
getKnowledges(params?: Record<string, unknown>): Promise<[import("../..").IKnowledge[], number]>;
|
|
86
|
+
getKnowledge(id: string): Promise<import("../..").IKnowledge>;
|
|
87
|
+
updateKnowledgeViews(id: string): Promise<import("../..").IKnowledge>;
|
|
88
|
+
updateKnowledgeLikes(id: string, type: string): Promise<import("../..").IKnowledge>;
|
|
89
|
+
};
|
|
90
|
+
SearchProvider: {
|
|
91
|
+
new (): {};
|
|
92
|
+
searchArticles(keyword: string): Promise<import("../..").IArticle[]>;
|
|
93
|
+
};
|
|
94
|
+
FileProvider: {
|
|
95
|
+
new (): {};
|
|
96
|
+
uploadFile(file: FormData, unique?: number): Promise<import("../..").IFile>;
|
|
97
|
+
getFiles(params: Record<string, unknown>): Promise<[import("../..").IFile[], number]>;
|
|
98
|
+
deleteFile(id: string): Promise<import("../..").IFile>;
|
|
99
|
+
};
|
|
100
|
+
ViewProvider: {
|
|
101
|
+
new (): {};
|
|
102
|
+
getViews(params: Record<string, unknown>): Promise<[import("../..").IView[], number]>;
|
|
103
|
+
addView(data: Record<string, unknown>): Promise<import("../..").IView>;
|
|
104
|
+
getViewsByUrl(url: string): Promise<import("../..").IView[]>;
|
|
105
|
+
deleteView(id: string): Promise<import("../..").IView>;
|
|
106
|
+
};
|
|
107
|
+
MailProvider: {
|
|
108
|
+
new (): {};
|
|
109
|
+
getMails(params: Record<string, unknown>): Promise<[Record<string, unknown>[], number]>;
|
|
110
|
+
deleteMail(id: string): Promise<Record<string, unknown>>;
|
|
111
|
+
};
|
|
112
|
+
SmtpProvider: {
|
|
113
|
+
new (): {};
|
|
114
|
+
testSendMail(user: Record<string, unknown>): Promise<import("../..").IFile>;
|
|
115
|
+
};
|
|
116
|
+
PosterProvider: {
|
|
117
|
+
new (): {};
|
|
118
|
+
createPoster(data: Record<string, unknown>): Promise<{
|
|
119
|
+
name: string;
|
|
120
|
+
url: string;
|
|
121
|
+
}>;
|
|
122
|
+
};
|
|
123
|
+
httpProvider: import("axios").AxiosInstance;
|
|
124
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createThemeHttpStack = createThemeHttpStack;
|
|
4
|
+
const authSession_1 = require("../visitor/authSession");
|
|
5
|
+
const httpClient_1 = require("../api/httpClient");
|
|
6
|
+
const index_1 = require("./index");
|
|
7
|
+
/**
|
|
8
|
+
* One-call HTTP client + REST providers for theme pages.
|
|
9
|
+
* Mirrors the stack used inside `createReactPressApp`, with optional toast hooks.
|
|
10
|
+
*/
|
|
11
|
+
function createThemeHttpStack(options = {}) {
|
|
12
|
+
const { onError, onUnauthorized, ...httpOptions } = options;
|
|
13
|
+
const httpProvider = (0, httpClient_1.createThemeAxiosClient)({
|
|
14
|
+
...httpOptions,
|
|
15
|
+
onError,
|
|
16
|
+
onUnauthorized: onUnauthorized ??
|
|
17
|
+
(() => {
|
|
18
|
+
(0, authSession_1.clearThemeSession)();
|
|
19
|
+
if (typeof window !== 'undefined') {
|
|
20
|
+
window.location.reload();
|
|
21
|
+
}
|
|
22
|
+
}),
|
|
23
|
+
});
|
|
24
|
+
const providers = (0, index_1.createThemeProviders)(httpProvider);
|
|
25
|
+
return {
|
|
26
|
+
httpProvider,
|
|
27
|
+
...providers,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { SiteThemeState, ThemeMods } from './extension/theme';
|
|
2
|
+
export interface ThemeRuntime {
|
|
3
|
+
/** Theme package id (from `theme.json` or env). */
|
|
4
|
+
themeId: string;
|
|
5
|
+
/** Published active theme on the site. */
|
|
6
|
+
activeThemeId: string;
|
|
7
|
+
/** Customizer values for `themeId`. */
|
|
8
|
+
mods: ThemeMods;
|
|
9
|
+
/** `previewThemeId` differs from `activeThemeId` in customizer preview. */
|
|
10
|
+
isPreview: boolean;
|
|
11
|
+
themeState: SiteThemeState;
|
|
12
|
+
}
|
|
13
|
+
export interface ResolveThemeRuntimeOptions {
|
|
14
|
+
themeId: string;
|
|
15
|
+
/** When true (default), use `previewThemeId` from global settings when set. */
|
|
16
|
+
honorPreview?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function resolveThemeRuntime(globalSettingRaw: unknown, options: ResolveThemeRuntimeOptions): ThemeRuntime;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveThemeRuntime = resolveThemeRuntime;
|
|
4
|
+
const theme_1 = require("./extension/theme");
|
|
5
|
+
function resolveThemeRuntime(globalSettingRaw, options) {
|
|
6
|
+
const themeState = (0, theme_1.getThemeStateFromGlobalSetting)(globalSettingRaw);
|
|
7
|
+
const activeThemeId = themeState.activeTheme;
|
|
8
|
+
const previewId = themeState.previewThemeId;
|
|
9
|
+
const honorPreview = options.honorPreview !== false;
|
|
10
|
+
const effectiveId = honorPreview && previewId ? previewId : options.themeId || activeThemeId;
|
|
11
|
+
const isPreview = Boolean(previewId && previewId !== activeThemeId);
|
|
12
|
+
return {
|
|
13
|
+
themeId: effectiveId,
|
|
14
|
+
activeThemeId,
|
|
15
|
+
mods: themeState.mods[effectiveId] ?? {},
|
|
16
|
+
isPreview,
|
|
17
|
+
themeState,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface SiteTitleSource {
|
|
2
|
+
systemTitle?: string;
|
|
3
|
+
systemSubTitle?: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function getSiteTitle(setting: SiteTitleSource, fallback?: string): string;
|
|
6
|
+
export declare function getPageTitle(pageTitle: string, setting: Pick<SiteTitleSource, 'systemTitle'>, fallback?: string): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getSiteTitle = getSiteTitle;
|
|
4
|
+
exports.getPageTitle = getPageTitle;
|
|
5
|
+
function getSiteTitle(setting, fallback = 'ReactPress') {
|
|
6
|
+
const main = setting.systemTitle || fallback;
|
|
7
|
+
return setting.systemSubTitle ? `${main} - ${setting.systemSubTitle}` : main;
|
|
8
|
+
}
|
|
9
|
+
function getPageTitle(pageTitle, setting, fallback = 'ReactPress') {
|
|
10
|
+
const site = setting.systemTitle || fallback;
|
|
11
|
+
return `${pageTitle} - ${site}`;
|
|
12
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SSR-safe theme exports for App Router / server components.
|
|
3
|
+
* Does not re-export `@fecommunity/reactpress-toolkit/ui` (React context / hooks).
|
|
4
|
+
* Client components should import UI from `@fecommunity/reactpress-toolkit/ui` directly.
|
|
5
|
+
*/
|
|
6
|
+
export type { ThemeApi } from './api/api';
|
|
7
|
+
export { createThemeApi, getThemeApiBaseUrl, resolveThemeApiBaseUrl, themeApi, } from './api/api';
|
|
8
|
+
export type { ApiEnvelope } from '../utils/api-envelope';
|
|
9
|
+
export { unpackList, unpackOne, unpackPaginated, unpackPaginatedPair, } from '../utils/api-envelope';
|
|
10
|
+
export { isLikelyValidAssetPath, isLikelyValidHeaderLogoPath, resolvePublicAssetUrl, rewriteArticleHtmlAssets } from './content/assets';
|
|
11
|
+
export type { ArchiveExcerptMode, ResolveArchiveExcerptOptions } from './content/excerpt';
|
|
12
|
+
export { resolveArchiveExcerpt, stripHtml, truncateWords, } from './content/excerpt';
|
|
13
|
+
export type { AppBootstrapResult, FetchAppBootstrapOptions } from './ssr/bootstrap';
|
|
14
|
+
export { createDefaultAppBootstrap, fetchAppBootstrap, fetchArchives, fetchCmsPage, fetchKnowledgeDetail, fetchKnowledgeList, fetchPublishedPages, fetchRecommendArticles, } from './ssr/bootstrap';
|
|
15
|
+
export type { SlimBootstrapOptions } from './ssr/slimBootstrap';
|
|
16
|
+
export { createBootstrapSlimmer, slimAppBootstrapForRoute, } from './ssr/slimBootstrap';
|
|
17
|
+
export type { CarouselArticle, ListArticle, } from './content/articleSlim';
|
|
18
|
+
export { slimArticleForCarousel, slimArticleForList, slimArticlesForCarousel, slimArticlesForList, } from './content/articleSlim';
|
|
19
|
+
export type { ArchiveArticle, ArchiveTree } from './content/archiveSlim';
|
|
20
|
+
export { countArchiveArticles, formatArchiveDay, slimArchiveTree, sortedArchiveYears, } from './content/archiveSlim';
|
|
21
|
+
export type { ResolveCarouselArticlesOptions } from './content/carouselArticles';
|
|
22
|
+
export { resolveCarouselArticles } from './content/carouselArticles';
|
|
23
|
+
export type { CategoryArchivePageProps, HomePageProps, KnowledgeIndexPageProps, SearchPageProps, TagArchivePageProps, } from './ssr/pageProps';
|
|
24
|
+
export { fetchArchivesPageProps, fetchArticleDetailProps, fetchCategoryArchivePageProps, fetchCmsPageProps, fetchHomePageProps, fetchKnowledgeBookPageProps, fetchKnowledgeChapterPageProps, fetchKnowledgeIndexPageProps, fetchSearchPageProps, fetchTagArchivePageProps, } from './ssr/pageProps';
|
|
25
|
+
export type { FetchVisitorContextOptions, ThemeArchiveKind, VisitorContextProps } from './ssr/fetch';
|
|
26
|
+
export { createArchiveGetStaticProps, createDefaultVisitorContext, fetchArticlePageProps, fetchCategoryArchive, fetchCategoryIndex, fetchSearchArticles, fetchSingleArticle, fetchSiteMeta, fetchSiteSettings, fetchTagArchive, fetchTagIndex, fetchThemeCatalog, fetchVisitorContext, resolveStaticVisitorContext, sanitizeNextProps, THEME_ISR_REVALIDATE_SECONDS, themeStaticProps, withApiRetry, withThemeStaticProps, } from './ssr/fetch';
|
|
27
|
+
export type { SettingRow } from '../utils/setting';
|
|
28
|
+
export { formatPublishDate, formatPublishDateShort, } from '../utils/date';
|
|
29
|
+
export { pickSiteSettings } from '../utils/setting';
|
|
30
|
+
export { safeJsonParse } from '../utils/json';
|
|
31
|
+
export type { ImageVariant } from '../utils/image';
|
|
32
|
+
export { resolveImageUrl } from '../utils/image';
|
|
33
|
+
export type { ThemeSessionUser, } from './visitor/authSession';
|
|
34
|
+
export { ADMIN_AUTH_STORAGE_KEY, clearThemeSession, getStoredAccessToken, persistThemeSession, resolveStoredUser, THEME_TOKEN_STORAGE_KEY, THEME_USER_STORAGE_KEY, } from './visitor/authSession';
|
|
35
|
+
export type { ThemeColorMode } from './visitor/colorMode';
|
|
36
|
+
export { applyColorModeClass, buildColorModeInitScript, COLOR_MODE_STORAGE_KEY, colorModeInitScript, persistColorMode, resolveClientThemeMode, resolveInitialColorModeState, resolvePreferredColorMode, } from './visitor/colorMode';
|
|
37
|
+
export { DEFAULT_VISITOR_LOCALES, LEGACY_LOCALE_STORAGE_KEY, persistVisitorLocale, readBrowserCookie, readRequestCookie, resolveVisitorLocale, VISITOR_LOCALE_COOKIE, } from './visitor/visitorLocale';
|
|
38
|
+
export type { CommentAuthor } from './visitor/commentAuthor';
|
|
39
|
+
export { COMMENT_AUTHOR_STORAGE_KEY, COMMENT_EMAIL_REGEXP, getCommentEmailError, isValidCommentAuthor, isValidCommentEmail, persistCommentAuthor, readCommentAuthor, } from './visitor/commentAuthor';
|
|
40
|
+
export type { SiteTitleSource } from './content/seo';
|
|
41
|
+
export { getPageTitle, getSiteTitle } from './content/seo';
|
|
42
|
+
export { jsonp } from '../utils/jsonp';
|
|
43
|
+
export type { CreateThemeAxiosClientOptions, ThemeApiEnvelope, } from './api/httpClient';
|
|
44
|
+
export { createThemeAxiosClient, encodeAxiosUrlPath, resolveThemeAxiosBaseUrl, } from './api/httpClient';
|
|
45
|
+
export type { LocaleCatalog, LocaleMessages, ParseSiteLocaleOptions, SiteLocaleState, } from './visitor/locale';
|
|
46
|
+
export { createTranslator, parseSiteLocale, resolveRequestLocale, } from './visitor/locale';
|
|
47
|
+
export { mergeVisitorI18n, slimVisitorI18nForSsr } from './visitor/i18n';
|
|
48
|
+
export type { NavItem } from './content/nav';
|
|
49
|
+
export { articlePath, categoryPath, getNavActiveId, tagPath, } from './content/nav';
|
|
50
|
+
export type { ResolveThemeRuntimeOptions, ThemeRuntime } from './visitor/runtime';
|
|
51
|
+
export { resolveThemeRuntime } from './visitor/runtime';
|
|
52
|
+
export type { SiteMeta } from './ssr/setting';
|
|
53
|
+
export { DEFAULT_SITE_META, parseSiteMeta, unwrapSetting } from './ssr/setting';
|
|
54
|
+
export { createThemeProviders } from './providers';
|
|
55
|
+
export type { ThemeProviders } from './providers';
|
|
56
|
+
export type { CreateThemeHttpStackOptions } from './providers/setup';
|
|
57
|
+
export { createThemeHttpStack } from './providers/setup';
|
|
58
|
+
export { defaultModsFromManifest } from './visitor/appearance';
|
|
59
|
+
export type ThemeManifestRef = {
|
|
60
|
+
id: string;
|
|
61
|
+
};
|
|
62
|
+
export * from './extension';
|
|
63
|
+
export { themeNotFound, themeOnDemandPaths, themeStaticNotFound } from './ssr/static';
|
|
64
|
+
export type { ThemeManifestLike, ThemeTemplateSlug } from './ssr/templates';
|
|
65
|
+
export { DEFAULT_TEMPLATE_FILES, resolveTemplateFiles, ThemeTemplate } from './ssr/templates';
|