@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,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type SiteDocumentProps } from './SiteDocument';
|
|
3
|
+
export interface SiteDocumentFallbackProps extends Omit<SiteDocumentProps, 'children'> {
|
|
4
|
+
message?: React.ReactNode;
|
|
5
|
+
messageClassName?: string;
|
|
6
|
+
}
|
|
7
|
+
/** Standard ISR fallback shell while on-demand pages compile. */
|
|
8
|
+
export declare function SiteDocumentFallback({ message, messageClassName, ...shell }: SiteDocumentFallbackProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SiteDocumentFallback = SiteDocumentFallback;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const SiteDocument_1 = require("./SiteDocument");
|
|
6
|
+
/** Standard ISR fallback shell while on-demand pages compile. */
|
|
7
|
+
function SiteDocumentFallback({ message = 'Loading…', messageClassName = 'empty-state', ...shell }) {
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)(SiteDocument_1.SiteDocument, { ...shell, children: (0, jsx_runtime_1.jsx)("p", { className: messageClassName, children: message }) }));
|
|
9
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface SiteLogoProps {
|
|
2
|
+
className?: string;
|
|
3
|
+
alt?: string;
|
|
4
|
+
}
|
|
5
|
+
/** Site logo: customizer `siteLogo` when set, otherwise `systemLogo` from site settings. */
|
|
6
|
+
export declare function SiteLogo({ className, alt }: SiteLogoProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SiteLogo = SiteLogo;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const assets_1 = require("../theme/assets");
|
|
6
|
+
const ThemeRuntimeContext_1 = require("./context/ThemeRuntimeContext");
|
|
7
|
+
/** Site logo: customizer `siteLogo` when set, otherwise `systemLogo` from site settings. */
|
|
8
|
+
function SiteLogo({ className, alt }) {
|
|
9
|
+
const mod = (0, ThemeRuntimeContext_1.useThemeMod)('siteLogo', '').trim();
|
|
10
|
+
const { siteLogo } = (0, ThemeRuntimeContext_1.useSiteMeta)();
|
|
11
|
+
const raw = mod || siteLogo?.trim() || '';
|
|
12
|
+
const src = (0, assets_1.resolvePublicAssetUrl)(raw);
|
|
13
|
+
if (!src)
|
|
14
|
+
return null;
|
|
15
|
+
return (0, jsx_runtime_1.jsx)("img", { src: src, alt: alt ?? '', className: className });
|
|
16
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface SiteTaglineProps {
|
|
2
|
+
/** Used when customizer tagline and site subtitle are both empty. */
|
|
3
|
+
fallback?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
/** Site tagline: customizer `displayTagline` when set, otherwise `systemSubTitle`. */
|
|
7
|
+
export declare function SiteTagline({ fallback, className }: SiteTaglineProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SiteTagline = SiteTagline;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const context_1 = require("./context");
|
|
6
|
+
const ThemeRuntimeContext_1 = require("./context/ThemeRuntimeContext");
|
|
7
|
+
/** Site tagline: customizer `displayTagline` when set, otherwise `systemSubTitle`. */
|
|
8
|
+
function SiteTagline({ fallback = '', className = 'site-tagline' }) {
|
|
9
|
+
const mod = (0, ThemeRuntimeContext_1.useThemeMod)('displayTagline', '');
|
|
10
|
+
const { siteDescription } = (0, context_1.useSiteMeta)();
|
|
11
|
+
const text = mod.trim() || siteDescription.trim() || fallback.trim();
|
|
12
|
+
if (!text)
|
|
13
|
+
return null;
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)("p", { className: className, "data-rp-component": "site-tagline", children: text }));
|
|
15
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface TaxonomyItem {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
articleCount?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface TaxonomyListRenderLinkProps {
|
|
8
|
+
item: TaxonomyItem;
|
|
9
|
+
href: string;
|
|
10
|
+
active: boolean;
|
|
11
|
+
}
|
|
12
|
+
export type TaxonomyListVariant = 'inline' | 'list';
|
|
13
|
+
export interface TaxonomyListProps {
|
|
14
|
+
items: TaxonomyItem[];
|
|
15
|
+
kind: 'category' | 'tag';
|
|
16
|
+
/** `list` → `ul`/`li` (sidebar); `inline` → flex-friendly wrappers (tag cloud). */
|
|
17
|
+
variant?: TaxonomyListVariant;
|
|
18
|
+
currentValue?: string;
|
|
19
|
+
className?: string;
|
|
20
|
+
itemClassName?: string;
|
|
21
|
+
hrefFor?: (item: TaxonomyItem) => string;
|
|
22
|
+
renderLink: (props: TaxonomyListRenderLinkProps) => React.ReactNode;
|
|
23
|
+
}
|
|
24
|
+
/** Headless category/tag list (sidebar, footer, tag cloud). */
|
|
25
|
+
export declare function TaxonomyList({ items, kind, variant, currentValue, className, itemClassName, hrefFor, renderLink, }: TaxonomyListProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TaxonomyList = TaxonomyList;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const nav_1 = require("../theme/nav");
|
|
6
|
+
function defaultHref(kind, item) {
|
|
7
|
+
return kind === 'category' ? (0, nav_1.categoryPath)(item.value) : (0, nav_1.tagPath)(item.value);
|
|
8
|
+
}
|
|
9
|
+
/** Headless category/tag list (sidebar, footer, tag cloud). */
|
|
10
|
+
function TaxonomyList({ items, kind, variant = 'inline', currentValue, className, itemClassName, hrefFor, renderLink, }) {
|
|
11
|
+
const safeItems = Array.isArray(items) ? items : [];
|
|
12
|
+
const resolveHref = hrefFor ?? ((item) => defaultHref(kind, item));
|
|
13
|
+
const component = `${kind}-list`;
|
|
14
|
+
const nodes = safeItems.map((item) => {
|
|
15
|
+
const href = resolveHref(item);
|
|
16
|
+
const link = renderLink({
|
|
17
|
+
item,
|
|
18
|
+
href,
|
|
19
|
+
active: currentValue === item.value,
|
|
20
|
+
});
|
|
21
|
+
if (variant === 'list') {
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)("li", { className: itemClassName, children: link }, item.value));
|
|
23
|
+
}
|
|
24
|
+
return ((0, jsx_runtime_1.jsx)("span", { className: itemClassName, children: link }, item.value));
|
|
25
|
+
});
|
|
26
|
+
if (variant === 'list') {
|
|
27
|
+
return ((0, jsx_runtime_1.jsx)("ul", { className: className, "data-rp-component": component, children: nodes }));
|
|
28
|
+
}
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: className, "data-rp-component": component, children: nodes }));
|
|
30
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ThemeCssVars = ThemeCssVars;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const assets_1 = require("../theme/assets");
|
|
7
|
+
const ThemeRuntimeContext_1 = require("./context/ThemeRuntimeContext");
|
|
8
|
+
function BgImageHtmlClass({ enabled }) {
|
|
9
|
+
(0, react_1.useEffect)(() => {
|
|
10
|
+
if (typeof document === 'undefined')
|
|
11
|
+
return;
|
|
12
|
+
document.documentElement.classList.toggle('rp-has-bg-image', enabled);
|
|
13
|
+
return () => document.documentElement.classList.remove('rp-has-bg-image');
|
|
14
|
+
}, [enabled]);
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
function escapeCssValue(value) {
|
|
18
|
+
return value.replace(/\\/g, '\\\\').replace(/"/g, '\\"');
|
|
19
|
+
}
|
|
20
|
+
/** Injects Customizer colors, background, dark mode, and extra CSS (WP `theme_mod` → `:root`). */
|
|
21
|
+
function ThemeCssVars() {
|
|
22
|
+
const primary = (0, ThemeRuntimeContext_1.useThemeMod)('primaryColor', '#3b82f6');
|
|
23
|
+
const accent = (0, ThemeRuntimeContext_1.useThemeMod)('accentColor', '#8b5cf6');
|
|
24
|
+
const background = (0, ThemeRuntimeContext_1.useThemeMod)('backgroundColor', '#f8f9fa');
|
|
25
|
+
const backgroundImage = (0, assets_1.resolvePublicAssetUrl)((0, ThemeRuntimeContext_1.useThemeMod)('backgroundImage', ''));
|
|
26
|
+
const darkMode = (0, ThemeRuntimeContext_1.useThemeModBool)('darkMode', false);
|
|
27
|
+
const additionalCss = (0, ThemeRuntimeContext_1.useThemeMod)('additionalCss', '').trim();
|
|
28
|
+
const hasBgImage = Boolean(backgroundImage);
|
|
29
|
+
const bgLayer = hasBgImage
|
|
30
|
+
? `background-image: url("${escapeCssValue(backgroundImage)}"); background-size: cover; background-position: center center; background-repeat: no-repeat; background-attachment: fixed;`
|
|
31
|
+
: '';
|
|
32
|
+
const darkVars = darkMode
|
|
33
|
+
? `
|
|
34
|
+
--rp-background: #1a1a1a;
|
|
35
|
+
--rp-text: #e8e8e8;
|
|
36
|
+
--rp-muted: #a3a3a3;
|
|
37
|
+
color-scheme: dark;
|
|
38
|
+
`
|
|
39
|
+
: `
|
|
40
|
+
--rp-text: #1d2327;
|
|
41
|
+
--rp-muted: #646970;
|
|
42
|
+
color-scheme: light;
|
|
43
|
+
`;
|
|
44
|
+
const css = `
|
|
45
|
+
:root {
|
|
46
|
+
--rp-primary: ${primary};
|
|
47
|
+
--rp-accent: ${accent};
|
|
48
|
+
--rp-background: ${background};
|
|
49
|
+
${hasBgImage ? '--rp-has-bg-image: 1;' : ''}
|
|
50
|
+
${darkVars}
|
|
51
|
+
}
|
|
52
|
+
html${hasBgImage ? '.rp-has-bg-image' : ''} {
|
|
53
|
+
${bgLayer}
|
|
54
|
+
}
|
|
55
|
+
html,
|
|
56
|
+
body {
|
|
57
|
+
background-color: var(--rp-background, #f8f9fa) !important;
|
|
58
|
+
}
|
|
59
|
+
html.rp-has-bg-image,
|
|
60
|
+
html.rp-has-bg-image body,
|
|
61
|
+
html.rp-has-bg-image .container,
|
|
62
|
+
html.rp-has-bg-image [data-rp-component='layout'],
|
|
63
|
+
html.rp-has-bg-image [data-rp-component='main'] {
|
|
64
|
+
background-color: transparent !important;
|
|
65
|
+
}
|
|
66
|
+
.container,
|
|
67
|
+
[data-rp-component='layout'],
|
|
68
|
+
[data-rp-component='main'] {
|
|
69
|
+
background-color: ${hasBgImage ? 'transparent' : 'var(--rp-background, #f8f9fa)'} !important;
|
|
70
|
+
}
|
|
71
|
+
[data-rp-component='layout'][data-rp-dark='true'],
|
|
72
|
+
[data-rp-component='layout'][data-rp-dark='true'] .container {
|
|
73
|
+
background-color: var(--rp-background, #1a1a1a) !important;
|
|
74
|
+
color: var(--rp-text, #e8e8e8);
|
|
75
|
+
}
|
|
76
|
+
[data-rp-component='layout'][data-rp-dark='true'] a {
|
|
77
|
+
color: var(--rp-primary);
|
|
78
|
+
}
|
|
79
|
+
[data-rp-component='layout'] {
|
|
80
|
+
color: var(--rp-text, #1d2327);
|
|
81
|
+
}
|
|
82
|
+
${additionalCss}
|
|
83
|
+
`;
|
|
84
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(BgImageHtmlClass, { enabled: hasBgImage }), (0, jsx_runtime_1.jsx)("style", { dangerouslySetInnerHTML: { __html: css } })] }));
|
|
85
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ThemeLayoutProps {
|
|
3
|
+
header?: React.ReactNode;
|
|
4
|
+
footer?: React.ReactNode;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
mainClassName?: string;
|
|
8
|
+
contentClassName?: string;
|
|
9
|
+
/** When true, wraps children in an inner content container (`data-rp-part="content"`). */
|
|
10
|
+
wrapContent?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** Unstyled page shell: header + main (+ optional content wrapper) + footer. */
|
|
13
|
+
export declare function ThemeLayout({ header, footer, children, className, mainClassName, contentClassName, wrapContent, }: ThemeLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ThemeLayout = ThemeLayout;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const ThemeRuntimeContext_1 = require("./context/ThemeRuntimeContext");
|
|
6
|
+
/** Unstyled page shell: header + main (+ optional content wrapper) + footer. */
|
|
7
|
+
function ThemeLayout({ header, footer, children, className, mainClassName, contentClassName, wrapContent = false, }) {
|
|
8
|
+
const darkMode = (0, ThemeRuntimeContext_1.useThemeModBool)('darkMode', false);
|
|
9
|
+
const mainContent = wrapContent ? ((0, jsx_runtime_1.jsx)("div", { className: contentClassName, "data-rp-part": "content", children: children })) : (children);
|
|
10
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: className, "data-rp-component": "layout", ...(darkMode ? { 'data-rp-dark': 'true' } : {}), children: [header, (0, jsx_runtime_1.jsx)("main", { className: mainClassName, "data-rp-component": "main", children: mainContent }), footer] }));
|
|
11
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export interface AntdStyleTransitionFixProps {
|
|
2
|
+
id?: string;
|
|
3
|
+
}
|
|
4
|
+
/** Disable Ant Design CSS transitions during hydration to avoid style flash. */
|
|
5
|
+
export declare function AntdStyleTransitionFix({ id, }: AntdStyleTransitionFixProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AntdStyleTransitionFix = AntdStyleTransitionFix;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const STYLE_ELEMENT_ID = 'reactpress-antd-style-transition-fix';
|
|
7
|
+
/** Disable Ant Design CSS transitions during hydration to avoid style flash. */
|
|
8
|
+
function AntdStyleTransitionFix({ id = STYLE_ELEMENT_ID, }) {
|
|
9
|
+
(0, react_1.useEffect)(() => {
|
|
10
|
+
const el = document.querySelector(`#${id}`);
|
|
11
|
+
el?.parentNode?.removeChild(el);
|
|
12
|
+
}, [id]);
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)("style", { id: id, dangerouslySetInnerHTML: {
|
|
14
|
+
__html: `[class^="ant-"], [class*=" ant-"] { transition: none !important; }`,
|
|
15
|
+
} }));
|
|
16
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ArchiveEmptyStateProps {
|
|
3
|
+
message: React.ReactNode;
|
|
4
|
+
backHref?: string;
|
|
5
|
+
backLabel?: React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
renderBackLink?: (props: {
|
|
8
|
+
href: string;
|
|
9
|
+
label: React.ReactNode;
|
|
10
|
+
}) => React.ReactNode;
|
|
11
|
+
}
|
|
12
|
+
/** Headless empty archive/search state with optional back link slot. */
|
|
13
|
+
export declare function ArchiveEmptyState({ message, backHref, backLabel, className, renderBackLink, }: ArchiveEmptyStateProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArchiveEmptyState = ArchiveEmptyState;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
/** Headless empty archive/search state with optional back link slot. */
|
|
6
|
+
function ArchiveEmptyState({ message, backHref = '/', backLabel = '← Back to archives', className = 'empty-state', renderBackLink, }) {
|
|
7
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("p", { className: className, "data-rp-component": "archive-empty", children: message }), renderBackLink ? ((0, jsx_runtime_1.jsx)("p", { children: renderBackLink({ href: backHref, label: backLabel }) })) : null] }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ArchivePageLayoutProps {
|
|
3
|
+
main: React.ReactNode;
|
|
4
|
+
sidebar?: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
mainClassName?: string;
|
|
7
|
+
sidebarClassName?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Two-column archive layout (main list + sidebar widgets). */
|
|
10
|
+
export declare function ArchivePageLayout({ main, sidebar, className, mainClassName, sidebarClassName, }: ArchivePageLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArchivePageLayout = ArchivePageLayout;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
/** Two-column archive layout (main list + sidebar widgets). */
|
|
6
|
+
function ArchivePageLayout({ main, sidebar, className = 'content-layout', mainClassName = 'articles-section', sidebarClassName = 'sidebar', }) {
|
|
7
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: className, "data-rp-component": "archive-layout", children: [(0, jsx_runtime_1.jsx)("section", { className: mainClassName, children: main }), sidebar ? (0, jsx_runtime_1.jsx)("aside", { className: sidebarClassName, children: sidebar }) : null] }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ArticleCardArticle {
|
|
3
|
+
id: string;
|
|
4
|
+
title: string;
|
|
5
|
+
summary?: string;
|
|
6
|
+
cover?: string;
|
|
7
|
+
publishAt?: string;
|
|
8
|
+
category?: {
|
|
9
|
+
label: string;
|
|
10
|
+
value: string;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export interface ArticleCardLinkProps {
|
|
14
|
+
href: string;
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export interface ArticleCardProps {
|
|
18
|
+
article: ArticleCardArticle;
|
|
19
|
+
className?: string;
|
|
20
|
+
titleTag?: 'h2' | 'h3';
|
|
21
|
+
showCategory?: boolean;
|
|
22
|
+
renderTitleLink: (props: ArticleCardLinkProps) => React.ReactNode;
|
|
23
|
+
renderCategoryLink?: (props: ArticleCardLinkProps) => React.ReactNode;
|
|
24
|
+
renderDate?: (publishAt: string) => React.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
/** Headless article card — theme supplies Link markup and CSS. */
|
|
27
|
+
export declare function ArticleCard({ article, className, titleTag, showCategory, renderTitleLink, renderCategoryLink, renderDate, }: ArticleCardProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArticleCard = ArticleCard;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const date_1 = require("../../utils/date");
|
|
6
|
+
const nav_1 = require("../../theme/content/nav");
|
|
7
|
+
/** Headless article card — theme supplies Link markup and CSS. */
|
|
8
|
+
function ArticleCard({ article, className, titleTag = 'h3', showCategory = true, renderTitleLink, renderCategoryLink, renderDate, }) {
|
|
9
|
+
const TitleTag = titleTag;
|
|
10
|
+
const dateNode = article.publishAt &&
|
|
11
|
+
(renderDate ? renderDate(article.publishAt) : (0, date_1.formatPublishDate)(article.publishAt));
|
|
12
|
+
return ((0, jsx_runtime_1.jsxs)("article", { className: className, "data-rp-component": "article-card", children: [article.cover ? ((0, jsx_runtime_1.jsx)("div", { className: "article-image", "data-rp-part": "cover", children: (0, jsx_runtime_1.jsx)("img", { src: article.cover, alt: article.title, loading: "lazy" }) })) : null, (0, jsx_runtime_1.jsxs)("div", { className: "article-content", "data-rp-part": "content", children: [(0, jsx_runtime_1.jsx)(TitleTag, { className: "article-title", children: renderTitleLink({ href: (0, nav_1.articlePath)(article.id), children: article.title }) }), article.summary ? (0, jsx_runtime_1.jsx)("p", { className: "article-summary", children: article.summary }) : null, dateNode || (showCategory && article.category && renderCategoryLink) ? ((0, jsx_runtime_1.jsxs)("div", { className: "article-meta", children: [dateNode ? (0, jsx_runtime_1.jsx)("span", { className: "publish-date", children: dateNode }) : null, showCategory && article.category && renderCategoryLink ? ((0, jsx_runtime_1.jsx)("span", { className: "article-category", children: renderCategoryLink({
|
|
13
|
+
href: (0, nav_1.categoryPath)(article.category.value),
|
|
14
|
+
children: article.category.label,
|
|
15
|
+
}) })) : null] })) : null] })] }));
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ArticleListProps<T extends {
|
|
3
|
+
id: string;
|
|
4
|
+
}> {
|
|
5
|
+
articles: T[];
|
|
6
|
+
limit?: number;
|
|
7
|
+
className?: string;
|
|
8
|
+
empty?: React.ReactNode;
|
|
9
|
+
renderArticle: (article: T, index: number) => React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/** Headless article grid/list — theme supplies markup and styles per item. */
|
|
12
|
+
export declare function ArticleList<T extends {
|
|
13
|
+
id: string;
|
|
14
|
+
}>({ articles, limit, className, empty, renderArticle, }: ArticleListProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.ArticleList = ArticleList;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const react_1 = __importDefault(require("react"));
|
|
9
|
+
/** Headless article grid/list — theme supplies markup and styles per item. */
|
|
10
|
+
function ArticleList({ articles, limit, className, empty = null, renderArticle, }) {
|
|
11
|
+
const list = limit != null ? articles.slice(0, limit) : articles;
|
|
12
|
+
if (!list.length) {
|
|
13
|
+
return (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: empty });
|
|
14
|
+
}
|
|
15
|
+
return ((0, jsx_runtime_1.jsx)("div", { className: className, "data-rp-component": "article-list", children: list.map((article, index) => ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: renderArticle(article, index) }, article.id))) }));
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseGlobalStyles = BaseGlobalStyles;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
/** Shared reset used by starter themes (override via `extra` CSS). */
|
|
6
|
+
function BaseGlobalStyles({ extra }) {
|
|
7
|
+
const css = `
|
|
8
|
+
html, body {
|
|
9
|
+
padding: 0;
|
|
10
|
+
margin: 0;
|
|
11
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu,
|
|
12
|
+
Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
|
13
|
+
}
|
|
14
|
+
* { box-sizing: border-box; }
|
|
15
|
+
${extra ?? ''}
|
|
16
|
+
`;
|
|
17
|
+
return (0, jsx_runtime_1.jsx)("style", { dangerouslySetInnerHTML: { __html: css } });
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface LocaleSwitcherProps {
|
|
2
|
+
className?: string;
|
|
3
|
+
buttonClassName?: string;
|
|
4
|
+
/** @deprecated No longer used; kept for backward compatibility. */
|
|
5
|
+
activeClassName?: string;
|
|
6
|
+
size?: number;
|
|
7
|
+
ariaLabel?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Click to cycle locales — same control as admin and theme headers. */
|
|
10
|
+
export declare function LocaleSwitcher({ className, buttonClassName, size, ariaLabel, }: LocaleSwitcherProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LocaleSwitcher = LocaleSwitcher;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const LocaleToggleButton_1 = require("./toolbar/LocaleToggleButton");
|
|
6
|
+
const LocaleContext_1 = require("../context/LocaleContext");
|
|
7
|
+
/** Click to cycle locales — same control as admin and theme headers. */
|
|
8
|
+
function LocaleSwitcher({ className, buttonClassName, size = 20, ariaLabel, }) {
|
|
9
|
+
const { locale, locales, setLocale } = (0, LocaleContext_1.useLocale)();
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)(LocaleToggleButton_1.LocaleToggleButton, { locale: locale, locales: locales, onLocaleChange: setLocale, size: size, className: buttonClassName ?? className, "aria-label": ariaLabel }));
|
|
11
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { NavItem } from '../../theme/content/nav';
|
|
3
|
+
export interface NavMenuRenderLinkProps {
|
|
4
|
+
item: NavItem;
|
|
5
|
+
active: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface NavMenuProps {
|
|
8
|
+
items: NavItem[];
|
|
9
|
+
activeId?: string;
|
|
10
|
+
className?: string;
|
|
11
|
+
listClassName?: string;
|
|
12
|
+
itemClassName?: string;
|
|
13
|
+
renderLink: (props: NavMenuRenderLinkProps) => React.ReactNode;
|
|
14
|
+
}
|
|
15
|
+
/** Headless site navigation — styling via theme `renderLink` (e.g. Next.js `Link`). */
|
|
16
|
+
export declare function NavMenu({ items, activeId, className, listClassName, itemClassName, renderLink, }: NavMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NavMenu = NavMenu;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
/** Headless site navigation — styling via theme `renderLink` (e.g. Next.js `Link`). */
|
|
6
|
+
function NavMenu({ items, activeId, className, listClassName, itemClassName, renderLink, }) {
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)("nav", { className: className, "data-rp-component": "nav", "aria-label": "Site", children: (0, jsx_runtime_1.jsx)("ul", { className: listClassName, children: items.map((item) => ((0, jsx_runtime_1.jsx)("li", { className: itemClassName, children: renderLink({ item, active: item.id === activeId }) }, item.id))) }) }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface NotFoundPanelProps {
|
|
3
|
+
title?: React.ReactNode;
|
|
4
|
+
subtitle?: React.ReactNode;
|
|
5
|
+
description?: React.ReactNode;
|
|
6
|
+
illustration?: React.ReactNode;
|
|
7
|
+
actions?: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
/** Headless 404 / not-found content block (theme supplies styles). */
|
|
11
|
+
export declare function NotFoundPanel({ title, subtitle, description, illustration, actions, className, }: NotFoundPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NotFoundPanel = NotFoundPanel;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
/** Headless 404 / not-found content block (theme supplies styles). */
|
|
6
|
+
function NotFoundPanel({ title = 'Not found', subtitle, description, illustration, actions, className, }) {
|
|
7
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: className, "data-rp-component": "not-found-panel", children: [illustration ? (0, jsx_runtime_1.jsx)("div", { "data-rp-part": "illustration", children: illustration }) : null, (0, jsx_runtime_1.jsx)("h1", { "data-rp-part": "title", children: title }), subtitle != null && subtitle !== '' ? (0, jsx_runtime_1.jsx)("h2", { "data-rp-part": "subtitle", children: subtitle }) : null, description != null && description !== '' ? ((0, jsx_runtime_1.jsx)("p", { "data-rp-part": "description", children: description })) : null, actions ? (0, jsx_runtime_1.jsx)("div", { "data-rp-part": "actions", children: actions }) : null] }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface PageHeaderProps {
|
|
3
|
+
title: React.ReactNode;
|
|
4
|
+
description?: React.ReactNode;
|
|
5
|
+
className?: string;
|
|
6
|
+
titleClassName?: string;
|
|
7
|
+
descriptionClassName?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Unstyled archive / page title block (WP `the_archive_title` pattern). */
|
|
10
|
+
export declare function PageHeader({ title, description, className, titleClassName, descriptionClassName, }: PageHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PageHeader = PageHeader;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
/** Unstyled archive / page title block (WP `the_archive_title` pattern). */
|
|
6
|
+
function PageHeader({ title, description, className, titleClassName, descriptionClassName, }) {
|
|
7
|
+
return ((0, jsx_runtime_1.jsxs)("header", { className: className, "data-rp-component": "page-header", children: [(0, jsx_runtime_1.jsx)("h1", { className: titleClassName, children: title }), description != null && description !== '' ? ((0, jsx_runtime_1.jsx)("p", { className: descriptionClassName, children: description })) : null] }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface RouteProgressProps {
|
|
2
|
+
/** Delay before showing the bar (ms). */
|
|
3
|
+
delay?: number;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Next.js route transition progress bar.
|
|
7
|
+
* Requires `nprogress` as a peer dependency in the theme package.
|
|
8
|
+
*/
|
|
9
|
+
export declare function RouteProgress({ delay }: RouteProgressProps): null;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RouteProgress = RouteProgress;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
/**
|
|
6
|
+
* Next.js route transition progress bar.
|
|
7
|
+
* Requires `nprogress` as a peer dependency in the theme package.
|
|
8
|
+
*/
|
|
9
|
+
function RouteProgress({ delay = 100 }) {
|
|
10
|
+
(0, react_1.useEffect)(() => {
|
|
11
|
+
let nprogress = null;
|
|
12
|
+
try {
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
14
|
+
nprogress = require('nprogress');
|
|
15
|
+
}
|
|
16
|
+
catch {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
let timeout;
|
|
20
|
+
const Router = require('next/router').default;
|
|
21
|
+
const start = () => {
|
|
22
|
+
timeout = setTimeout(() => nprogress?.start(), delay);
|
|
23
|
+
};
|
|
24
|
+
const done = () => {
|
|
25
|
+
if (timeout)
|
|
26
|
+
clearTimeout(timeout);
|
|
27
|
+
nprogress?.done();
|
|
28
|
+
};
|
|
29
|
+
Router.events.on('routeChangeStart', start);
|
|
30
|
+
Router.events.on('routeChangeComplete', done);
|
|
31
|
+
Router.events.on('routeChangeError', done);
|
|
32
|
+
return () => {
|
|
33
|
+
Router.events.off('routeChangeStart', start);
|
|
34
|
+
Router.events.off('routeChangeComplete', done);
|
|
35
|
+
Router.events.off('routeChangeError', done);
|
|
36
|
+
nprogress?.done();
|
|
37
|
+
};
|
|
38
|
+
}, [delay]);
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export interface SiteAnalyticsProps {
|
|
2
|
+
children?: React.ReactNode;
|
|
3
|
+
}
|
|
4
|
+
/** Inject Google Analytics / Baidu Tongji scripts from site settings. */
|
|
5
|
+
export declare function SiteAnalytics({ children }: SiteAnalyticsProps): string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | import("react").ReactPortal | null;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SiteAnalytics = SiteAnalytics;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const SiteCatalogContext_1 = require("../context/SiteCatalogContext");
|
|
6
|
+
/** Inject Google Analytics / Baidu Tongji scripts from site settings. */
|
|
7
|
+
function SiteAnalytics({ children = null }) {
|
|
8
|
+
const setting = (0, SiteCatalogContext_1.useSiteSetting)();
|
|
9
|
+
(0, react_1.useEffect)(() => {
|
|
10
|
+
const googleAnalyticsId = setting.googleAnalyticsId;
|
|
11
|
+
if (!googleAnalyticsId)
|
|
12
|
+
return undefined;
|
|
13
|
+
const w = window;
|
|
14
|
+
w.dataLayer = w.dataLayer || [];
|
|
15
|
+
function gtag(...args) {
|
|
16
|
+
w.dataLayer?.push(args);
|
|
17
|
+
}
|
|
18
|
+
w.gtag = gtag;
|
|
19
|
+
gtag('js', new Date());
|
|
20
|
+
gtag('config', googleAnalyticsId);
|
|
21
|
+
const script = document.createElement('script');
|
|
22
|
+
script.src = `https://www.googletagmanager.com/gtag/js?id=${googleAnalyticsId}`;
|
|
23
|
+
script.async = true;
|
|
24
|
+
document.body?.appendChild(script);
|
|
25
|
+
return () => {
|
|
26
|
+
script.remove();
|
|
27
|
+
};
|
|
28
|
+
}, [setting.googleAnalyticsId]);
|
|
29
|
+
(0, react_1.useEffect)(() => {
|
|
30
|
+
const baiduAnalyticsId = setting.baiduAnalyticsId;
|
|
31
|
+
if (!baiduAnalyticsId)
|
|
32
|
+
return undefined;
|
|
33
|
+
const hm = document.createElement('script');
|
|
34
|
+
hm.src = `https://hm.baidu.com/hm.js?${baiduAnalyticsId}`;
|
|
35
|
+
const s = document.getElementsByTagName('script')[0];
|
|
36
|
+
s?.parentNode?.insertBefore(hm, s);
|
|
37
|
+
return () => {
|
|
38
|
+
hm.remove();
|
|
39
|
+
};
|
|
40
|
+
}, [setting.baiduAnalyticsId]);
|
|
41
|
+
return children;
|
|
42
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface SiteBrandingProps {
|
|
2
|
+
/** Last-resort title when customizer mod and site settings are both empty. */
|
|
3
|
+
fallback?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
as?: 'h1' | 'span' | 'div';
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Site title: customizer `displayTitle` when set, otherwise `systemTitle` from site settings.
|
|
9
|
+
*/
|
|
10
|
+
export declare function SiteBranding({ fallback, className, as: Tag }: SiteBrandingProps): import("react/jsx-runtime").JSX.Element;
|