@fecommunity/reactpress-toolkit 3.0.4 → 3.7.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/LICENSE +1 -1
- package/README.md +194 -309
- package/dist/.source-fingerprint-toolkit +1 -0
- 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 +8 -0
- package/dist/app/createReactPressApp.js +265 -0
- package/dist/app/createThemeApp.d.ts +8 -0
- package/dist/app/createThemeApp.js +51 -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/plugin-admin.d.ts +37 -0
- package/dist/plugin/admin/plugin-admin.js +41 -0
- package/dist/plugin/admin/registry.d.ts +62 -0
- package/dist/plugin/admin/registry.js +79 -0
- package/dist/plugin/admin/slots.d.ts +36 -0
- package/dist/plugin/admin/slots.js +16 -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/extension/index.d.ts +4 -0
- package/dist/plugin/extension/index.js +20 -0
- package/dist/plugin/extension/plugin-admin-locale.d.ts +21 -0
- package/dist/plugin/extension/plugin-admin-locale.io.d.ts +2 -0
- package/dist/plugin/extension/plugin-admin-locale.io.js +54 -0
- package/dist/plugin/extension/plugin-admin-locale.js +60 -0
- package/dist/plugin/extension/plugin.d.ts +82 -0
- package/dist/plugin/extension/plugin.js +146 -0
- package/dist/plugin/extension/security.d.ts +7 -0
- package/dist/plugin/extension/security.js +74 -0
- package/dist/plugin/extension/validate.d.ts +8 -0
- package/dist/plugin/extension/validate.js +55 -0
- package/dist/plugin/index.d.ts +9 -0
- package/dist/plugin/index.js +48 -0
- package/dist/plugin/node.d.ts +2 -0
- package/dist/plugin/node.js +6 -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/plugin-admin-ui.d.ts +23 -0
- package/dist/plugin/react/plugin-admin-ui.js +38 -0
- package/dist/plugin/react/runtime.d.ts +18 -0
- package/dist/plugin/react/runtime.js +30 -0
- package/dist/plugin/server/hook-reject.d.ts +12 -0
- package/dist/plugin/server/hook-reject.js +39 -0
- package/dist/plugin/server/index.d.ts +2 -0
- package/dist/plugin/server/index.js +18 -0
- package/dist/plugin/server/types.d.ts +34 -0
- package/dist/plugin/server/types.js +3 -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 +15 -0
- package/dist/theme/build/next-config.js +63 -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 +6 -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 +11 -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 +9 -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 +8 -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 +3 -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 +16 -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 +10 -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 +4 -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 +141 -12
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ErrorObject } from 'ajv';
|
|
2
|
+
import type { ThemeConfigurationSchema } from './types';
|
|
3
|
+
export interface ConfigurationValidationResult {
|
|
4
|
+
valid: boolean;
|
|
5
|
+
errors: ErrorObject[] | null;
|
|
6
|
+
message?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function validateThemeConfiguration(schema: ThemeConfigurationSchema | null | undefined, data: unknown): ConfigurationValidationResult;
|
|
@@ -0,0 +1,21 @@
|
|
|
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.validateThemeConfiguration = validateThemeConfiguration;
|
|
7
|
+
const ajv_1 = __importDefault(require("ajv"));
|
|
8
|
+
const ajv = new ajv_1.default({ allErrors: true, strict: false, coerceTypes: false });
|
|
9
|
+
function validateThemeConfiguration(schema, data) {
|
|
10
|
+
if (!schema) {
|
|
11
|
+
return { valid: true, errors: null };
|
|
12
|
+
}
|
|
13
|
+
const validate = ajv.compile(schema);
|
|
14
|
+
const valid = validate(data) === true;
|
|
15
|
+
if (valid) {
|
|
16
|
+
return { valid: true, errors: null };
|
|
17
|
+
}
|
|
18
|
+
const errors = validate.errors ?? [];
|
|
19
|
+
const message = errors.map((e) => `${e.instancePath || '/'} ${e.message ?? ''}`.trim()).join('; ');
|
|
20
|
+
return { valid: false, errors, message: message || 'Invalid configuration' };
|
|
21
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { systemGlobalSettingDefaults } from '../config/global';
|
|
2
|
+
export * from './configuration';
|
|
3
|
+
export { TWENTYTWENTYFIVE_APPEARANCE, TWENTYTWENTYFIVE_APPEARANCE_PANELS, TWENTYTWENTYFIVE_APPEARANCE_SECTIONS, } from './presets/twentytwentyfive-appearance';
|
|
4
|
+
export * from './preview';
|
|
5
|
+
export * from './site-notices';
|
|
6
|
+
export * from './site-settings';
|
|
7
|
+
export * from './theme';
|
|
8
|
+
export * from './theme-admin-locale';
|
|
9
|
+
export { appearanceBackgroundColor, appearanceLinkColor, appearancePrimaryColorForMode, appearanceSecondaryBackgroundColor, buildTwentyTwentyFiveAppearanceCss, } from './twentytwentyfive-vars';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.buildTwentyTwentyFiveAppearanceCss = exports.appearanceSecondaryBackgroundColor = exports.appearancePrimaryColorForMode = exports.appearanceLinkColor = exports.appearanceBackgroundColor = exports.TWENTYTWENTYFIVE_APPEARANCE_SECTIONS = exports.TWENTYTWENTYFIVE_APPEARANCE_PANELS = exports.TWENTYTWENTYFIVE_APPEARANCE = exports.systemGlobalSettingDefaults = void 0;
|
|
18
|
+
var global_1 = require("../config/global");
|
|
19
|
+
Object.defineProperty(exports, "systemGlobalSettingDefaults", { enumerable: true, get: function () { return global_1.systemGlobalSettingDefaults; } });
|
|
20
|
+
__exportStar(require("./configuration"), exports);
|
|
21
|
+
var twentytwentyfive_appearance_1 = require("./presets/twentytwentyfive-appearance");
|
|
22
|
+
Object.defineProperty(exports, "TWENTYTWENTYFIVE_APPEARANCE", { enumerable: true, get: function () { return twentytwentyfive_appearance_1.TWENTYTWENTYFIVE_APPEARANCE; } });
|
|
23
|
+
Object.defineProperty(exports, "TWENTYTWENTYFIVE_APPEARANCE_PANELS", { enumerable: true, get: function () { return twentytwentyfive_appearance_1.TWENTYTWENTYFIVE_APPEARANCE_PANELS; } });
|
|
24
|
+
Object.defineProperty(exports, "TWENTYTWENTYFIVE_APPEARANCE_SECTIONS", { enumerable: true, get: function () { return twentytwentyfive_appearance_1.TWENTYTWENTYFIVE_APPEARANCE_SECTIONS; } });
|
|
25
|
+
__exportStar(require("./preview"), exports);
|
|
26
|
+
__exportStar(require("./site-notices"), exports);
|
|
27
|
+
__exportStar(require("./site-settings"), exports);
|
|
28
|
+
__exportStar(require("./theme"), exports);
|
|
29
|
+
__exportStar(require("./theme-admin-locale"), exports);
|
|
30
|
+
var twentytwentyfive_vars_1 = require("./twentytwentyfive-vars");
|
|
31
|
+
Object.defineProperty(exports, "appearanceBackgroundColor", { enumerable: true, get: function () { return twentytwentyfive_vars_1.appearanceBackgroundColor; } });
|
|
32
|
+
Object.defineProperty(exports, "appearanceLinkColor", { enumerable: true, get: function () { return twentytwentyfive_vars_1.appearanceLinkColor; } });
|
|
33
|
+
Object.defineProperty(exports, "appearancePrimaryColorForMode", { enumerable: true, get: function () { return twentytwentyfive_vars_1.appearancePrimaryColorForMode; } });
|
|
34
|
+
Object.defineProperty(exports, "appearanceSecondaryBackgroundColor", { enumerable: true, get: function () { return twentytwentyfive_vars_1.appearanceSecondaryBackgroundColor; } });
|
|
35
|
+
Object.defineProperty(exports, "buildTwentyTwentyFiveAppearanceCss", { enumerable: true, get: function () { return twentytwentyfive_vars_1.buildTwentyTwentyFiveAppearanceCss; } });
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ThemeAppearanceManifest, ThemeManifest } from './theme';
|
|
2
|
+
type RawRecord = Record<string, unknown>;
|
|
3
|
+
export declare function normalizeAppearance(raw: unknown): ThemeAppearanceManifest | undefined;
|
|
4
|
+
export declare function normalizePlatformFields(o: RawRecord): Pick<ThemeManifest, 'requires' | 'supports' | 'templates' | 'options'>;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.normalizeAppearance = normalizeAppearance;
|
|
4
|
+
exports.normalizePlatformFields = normalizePlatformFields;
|
|
5
|
+
function asRecord(value) {
|
|
6
|
+
return value && typeof value === 'object' && !Array.isArray(value) ? value : undefined;
|
|
7
|
+
}
|
|
8
|
+
function normalizeSetting(raw) {
|
|
9
|
+
return {
|
|
10
|
+
id: String(raw.id),
|
|
11
|
+
type: raw.type,
|
|
12
|
+
label: String(raw.label),
|
|
13
|
+
default: typeof raw.default === 'string' ? raw.default : undefined,
|
|
14
|
+
description: typeof raw.description === 'string' ? raw.description : undefined,
|
|
15
|
+
choices: Array.isArray(raw.choices)
|
|
16
|
+
? raw.choices
|
|
17
|
+
: undefined,
|
|
18
|
+
group: typeof raw.group === 'string' ? raw.group : undefined,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function normalizeGroup(raw) {
|
|
22
|
+
return {
|
|
23
|
+
id: String(raw.id),
|
|
24
|
+
title: String(raw.title),
|
|
25
|
+
description: typeof raw.description === 'string' ? raw.description : undefined,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function normalizePanel(raw) {
|
|
29
|
+
return {
|
|
30
|
+
id: String(raw.id),
|
|
31
|
+
title: String(raw.title),
|
|
32
|
+
description: typeof raw.description === 'string' ? raw.description : undefined,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function normalizeSection(raw) {
|
|
36
|
+
return {
|
|
37
|
+
id: String(raw.id),
|
|
38
|
+
title: String(raw.title),
|
|
39
|
+
panel: typeof raw.panel === 'string' ? raw.panel : undefined,
|
|
40
|
+
embed: raw.embed === 'options' ? 'options' : undefined,
|
|
41
|
+
description: typeof raw.description === 'string' ? raw.description : undefined,
|
|
42
|
+
groups: Array.isArray(raw.groups)
|
|
43
|
+
? raw.groups.map((item) => normalizeGroup(asRecord(item) ?? {}))
|
|
44
|
+
: undefined,
|
|
45
|
+
settings: Array.isArray(raw.settings)
|
|
46
|
+
? raw.settings.map((item) => normalizeSetting(asRecord(item) ?? {}))
|
|
47
|
+
: undefined,
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
function normalizeAppearance(raw) {
|
|
51
|
+
const source = asRecord(raw);
|
|
52
|
+
if (!source)
|
|
53
|
+
return undefined;
|
|
54
|
+
const panels = Array.isArray(source.panels)
|
|
55
|
+
? source.panels.map((item) => normalizePanel(asRecord(item) ?? {}))
|
|
56
|
+
: undefined;
|
|
57
|
+
const sections = Array.isArray(source.sections)
|
|
58
|
+
? source.sections.map((item) => normalizeSection(asRecord(item) ?? {}))
|
|
59
|
+
: [];
|
|
60
|
+
if (panels === undefined && sections.length === 0)
|
|
61
|
+
return undefined;
|
|
62
|
+
return { panels, sections };
|
|
63
|
+
}
|
|
64
|
+
function normalizePlatformFields(o) {
|
|
65
|
+
const requires = typeof o.requires === 'string' ? o.requires : undefined;
|
|
66
|
+
const supports = o.supports;
|
|
67
|
+
const templates = o.templates;
|
|
68
|
+
const options = o.options;
|
|
69
|
+
return {
|
|
70
|
+
requires,
|
|
71
|
+
supports: supports && typeof supports === 'object' ? supports : undefined,
|
|
72
|
+
templates: templates && typeof templates === 'object' ? templates : undefined,
|
|
73
|
+
options: options?.type === 'object' ? options : undefined,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.readThemeAdminLocaleFile = void 0;
|
|
4
|
+
/** Node-only extension helpers (filesystem, etc.). Do not import from browser bundles. */
|
|
5
|
+
var theme_admin_locale_io_1 = require("./theme-admin-locale.io");
|
|
6
|
+
Object.defineProperty(exports, "readThemeAdminLocaleFile", { enumerable: true, get: function () { return theme_admin_locale_io_1.readThemeAdminLocaleFile; } });
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ThemeAppearancePanel, ThemeAppearanceSection } from '../theme';
|
|
2
|
+
/** Sidebar nav panels for Twenty Twenty-Five appearance editor. */
|
|
3
|
+
export declare const TWENTYTWENTYFIVE_APPEARANCE_PANELS: ThemeAppearancePanel[];
|
|
4
|
+
/** Default appearance sections for Twenty Twenty-Five (also in `themes/.../theme.json`). */
|
|
5
|
+
export declare const TWENTYTWENTYFIVE_APPEARANCE_SECTIONS: ThemeAppearanceSection[];
|
|
6
|
+
/** Full `theme.json` → `appearance` block for Twenty Twenty-Five. */
|
|
7
|
+
export declare const TWENTYTWENTYFIVE_APPEARANCE: {
|
|
8
|
+
panels: ThemeAppearancePanel[];
|
|
9
|
+
sections: ThemeAppearanceSection[];
|
|
10
|
+
};
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TWENTYTWENTYFIVE_APPEARANCE = exports.TWENTYTWENTYFIVE_APPEARANCE_SECTIONS = exports.TWENTYTWENTYFIVE_APPEARANCE_PANELS = void 0;
|
|
4
|
+
/** Sidebar nav panels for Twenty Twenty-Five appearance editor. */
|
|
5
|
+
exports.TWENTYTWENTYFIVE_APPEARANCE_PANELS = [
|
|
6
|
+
{
|
|
7
|
+
id: 'basic',
|
|
8
|
+
title: '基础配置',
|
|
9
|
+
description: '站点信息与页脚',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
id: 'style',
|
|
13
|
+
title: '样式配置',
|
|
14
|
+
description: '颜色与背景',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
id: 'layout',
|
|
18
|
+
title: '布局配置',
|
|
19
|
+
description: '导航与页面结构',
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
/** Default appearance sections for Twenty Twenty-Five (also in `themes/.../theme.json`). */
|
|
23
|
+
exports.TWENTYTWENTYFIVE_APPEARANCE_SECTIONS = [
|
|
24
|
+
{
|
|
25
|
+
id: 'identity',
|
|
26
|
+
panel: 'basic',
|
|
27
|
+
title: '站点身份',
|
|
28
|
+
settings: [
|
|
29
|
+
{
|
|
30
|
+
id: 'displayTitle',
|
|
31
|
+
type: 'text',
|
|
32
|
+
label: '站点标题',
|
|
33
|
+
description: '留空则继承「设置 → 常规」中的站点标题',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: 'displayTagline',
|
|
37
|
+
type: 'text',
|
|
38
|
+
label: '站点副标题',
|
|
39
|
+
description: '留空则继承「设置 → 常规」中的副标题',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: 'siteLogo',
|
|
43
|
+
type: 'image',
|
|
44
|
+
label: '站点 Logo',
|
|
45
|
+
description: '留空则继承「设置 → 常规」中的站点 Logo',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 'siteFavicon',
|
|
49
|
+
type: 'image',
|
|
50
|
+
label: '站点图标',
|
|
51
|
+
description: '留空则继承「设置 → 常规」中的站点图标',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: 'siteNotice',
|
|
55
|
+
type: 'noticeList',
|
|
56
|
+
label: '站点公告',
|
|
57
|
+
description: '未自定义时继承「设置 → 常规」;可为本主题单独配置多条公告与顺序',
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: 'about',
|
|
63
|
+
panel: 'basic',
|
|
64
|
+
title: '关于我们与页脚',
|
|
65
|
+
settings: [
|
|
66
|
+
{
|
|
67
|
+
id: 'systemFooterInfo',
|
|
68
|
+
type: 'textarea',
|
|
69
|
+
label: '页脚说明',
|
|
70
|
+
description: '支持 HTML;仅本主题生效',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 'aboutUsGithubUrl',
|
|
74
|
+
type: 'text',
|
|
75
|
+
label: 'GitHub 链接',
|
|
76
|
+
description: '页头与页脚 GitHub 图标;留空不显示',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: 'aboutUsCommentQr',
|
|
80
|
+
type: 'image',
|
|
81
|
+
label: '社群/评论二维码',
|
|
82
|
+
description: '悬停展示的图片地址',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: 'aboutUsWechatQr',
|
|
86
|
+
type: 'image',
|
|
87
|
+
label: '微信二维码',
|
|
88
|
+
description: '悬停展示的图片地址',
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: 'colors',
|
|
94
|
+
panel: 'style',
|
|
95
|
+
title: '颜色',
|
|
96
|
+
description: '与访客站顶栏「日 / 夜」切换对应,可分别配置浅色与深色模式',
|
|
97
|
+
groups: [
|
|
98
|
+
{
|
|
99
|
+
id: 'light',
|
|
100
|
+
title: '浅色模式',
|
|
101
|
+
description: '访客关闭深色模式时生效',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: 'dark',
|
|
105
|
+
title: '深色模式',
|
|
106
|
+
description: '访客开启深色模式时生效',
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
settings: [
|
|
110
|
+
{ id: 'primaryColor', group: 'light', type: 'color', label: '主色', default: '#f44336' },
|
|
111
|
+
{
|
|
112
|
+
id: 'backgroundColor',
|
|
113
|
+
group: 'light',
|
|
114
|
+
type: 'color',
|
|
115
|
+
label: '背景色',
|
|
116
|
+
default: '#ffffff',
|
|
117
|
+
description: '页面与内容区背景;设置背景图后主区域会透明以露出图片',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
id: 'secondaryBackgroundColor',
|
|
121
|
+
group: 'light',
|
|
122
|
+
type: 'color',
|
|
123
|
+
label: '次要背景色',
|
|
124
|
+
default: '#f3f5f7',
|
|
125
|
+
description: '卡片间隔、侧栏等次要区域',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
id: 'linkColor',
|
|
129
|
+
group: 'light',
|
|
130
|
+
type: 'color',
|
|
131
|
+
label: '链接色',
|
|
132
|
+
default: '#4299e1',
|
|
133
|
+
description: '正文 Markdown 中的链接颜色',
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
id: 'darkPrimaryColor',
|
|
137
|
+
group: 'dark',
|
|
138
|
+
type: 'color',
|
|
139
|
+
label: '主色',
|
|
140
|
+
default: '#f44336',
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
id: 'darkBackgroundColor',
|
|
144
|
+
group: 'dark',
|
|
145
|
+
type: 'color',
|
|
146
|
+
label: '背景色',
|
|
147
|
+
default: '#1e2a36',
|
|
148
|
+
description: '页面与主内容区背景',
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
id: 'darkSecondaryBackgroundColor',
|
|
152
|
+
group: 'dark',
|
|
153
|
+
type: 'color',
|
|
154
|
+
label: '次要背景色',
|
|
155
|
+
default: '#1a242f',
|
|
156
|
+
description: '卡片、顶栏、侧栏等次要区域',
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
id: 'darkLinkColor',
|
|
160
|
+
group: 'dark',
|
|
161
|
+
type: 'color',
|
|
162
|
+
label: '链接色',
|
|
163
|
+
default: '#4299e1',
|
|
164
|
+
description: '正文 Markdown 中的链接颜色',
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
id: 'background',
|
|
170
|
+
panel: 'style',
|
|
171
|
+
title: '背景图片',
|
|
172
|
+
settings: [
|
|
173
|
+
{
|
|
174
|
+
id: 'backgroundImage',
|
|
175
|
+
type: 'image',
|
|
176
|
+
label: '背景图',
|
|
177
|
+
description: '设置后将覆盖纯色背景(宽屏可见);仅本主题生效',
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
id: 'themeConfiguration',
|
|
183
|
+
panel: 'layout',
|
|
184
|
+
title: '顶栏与网址导航',
|
|
185
|
+
embed: 'options',
|
|
186
|
+
description: '固定导航、/nav 卡片与聚合搜索',
|
|
187
|
+
},
|
|
188
|
+
];
|
|
189
|
+
/** Full `theme.json` → `appearance` block for Twenty Twenty-Five. */
|
|
190
|
+
exports.TWENTYTWENTYFIVE_APPEARANCE = {
|
|
191
|
+
panels: exports.TWENTYTWENTYFIVE_APPEARANCE_PANELS,
|
|
192
|
+
sections: exports.TWENTYTWENTYFIVE_APPEARANCE_SECTIONS,
|
|
193
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ThemeAppearancePanel, ThemeAppearanceSection } from '../theme';
|
|
2
|
+
/** Sidebar nav panels for Twenty Twenty-Five appearance editor. */
|
|
3
|
+
export declare const TWENTYTWENTYFIVE_APPEARANCE_PANELS: ThemeAppearancePanel[];
|
|
4
|
+
/** Default appearance sections for Twenty Twenty-Five (also in `themes/.../theme.json`). */
|
|
5
|
+
export declare const TWENTYTWENTYFIVE_APPEARANCE_SECTIONS: ThemeAppearanceSection[];
|
|
6
|
+
/** Full `theme.json` → `appearance` block for Twenty Twenty-Five. */
|
|
7
|
+
export declare const TWENTYTWENTYFIVE_APPEARANCE: {
|
|
8
|
+
panels: ThemeAppearancePanel[];
|
|
9
|
+
sections: ThemeAppearanceSection[];
|
|
10
|
+
};
|
|
11
|
+
/** @deprecated Use `TWENTYTWENTYFIVE_APPEARANCE_PANELS` */
|
|
12
|
+
export declare const TWENTYTWENTYFIVE_CUSTOMIZER_GROUPS: ThemeAppearancePanel[];
|
|
13
|
+
/** @deprecated Use `TWENTYTWENTYFIVE_APPEARANCE_SECTIONS` */
|
|
14
|
+
export declare const TWENTYTWENTYFIVE_CUSTOMIZER_SECTIONS: ThemeAppearanceSection[];
|
|
15
|
+
/** @deprecated Use `TWENTYTWENTYFIVE_APPEARANCE` */
|
|
16
|
+
export declare const TWENTYTWENTYFIVE_CUSTOMIZER: {
|
|
17
|
+
panels: ThemeAppearancePanel[];
|
|
18
|
+
sections: ThemeAppearanceSection[];
|
|
19
|
+
};
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TWENTYTWENTYFIVE_CUSTOMIZER = exports.TWENTYTWENTYFIVE_CUSTOMIZER_SECTIONS = exports.TWENTYTWENTYFIVE_CUSTOMIZER_GROUPS = exports.TWENTYTWENTYFIVE_APPEARANCE = exports.TWENTYTWENTYFIVE_APPEARANCE_SECTIONS = exports.TWENTYTWENTYFIVE_APPEARANCE_PANELS = void 0;
|
|
4
|
+
/** Sidebar nav panels for Twenty Twenty-Five appearance editor. */
|
|
5
|
+
exports.TWENTYTWENTYFIVE_APPEARANCE_PANELS = [
|
|
6
|
+
{
|
|
7
|
+
id: 'basic',
|
|
8
|
+
title: '基础配置',
|
|
9
|
+
description: '站点信息与页脚',
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
id: 'style',
|
|
13
|
+
title: '样式配置',
|
|
14
|
+
description: '颜色与背景',
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
id: 'layout',
|
|
18
|
+
title: '布局配置',
|
|
19
|
+
description: '导航与页面结构',
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
/** Default appearance sections for Twenty Twenty-Five (also in `themes/.../theme.json`). */
|
|
23
|
+
exports.TWENTYTWENTYFIVE_APPEARANCE_SECTIONS = [
|
|
24
|
+
{
|
|
25
|
+
id: 'identity',
|
|
26
|
+
panel: 'basic',
|
|
27
|
+
title: '站点身份',
|
|
28
|
+
settings: [
|
|
29
|
+
{
|
|
30
|
+
id: 'displayTitle',
|
|
31
|
+
type: 'text',
|
|
32
|
+
label: '站点标题',
|
|
33
|
+
description: '留空则继承「设置 → 常规」中的站点标题',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: 'displayTagline',
|
|
37
|
+
type: 'text',
|
|
38
|
+
label: '站点副标题',
|
|
39
|
+
description: '留空则继承「设置 → 常规」中的副标题',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
id: 'siteLogo',
|
|
43
|
+
type: 'image',
|
|
44
|
+
label: '站点 Logo',
|
|
45
|
+
description: '留空则继承「设置 → 常规」中的站点 Logo',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: 'siteFavicon',
|
|
49
|
+
type: 'image',
|
|
50
|
+
label: '站点图标',
|
|
51
|
+
description: '留空则继承「设置 → 常规」中的站点图标',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
id: 'siteNotice',
|
|
55
|
+
type: 'noticeList',
|
|
56
|
+
label: '站点公告',
|
|
57
|
+
description: '未自定义时继承「设置 → 常规」;可为本主题单独配置多条公告与顺序',
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: 'about',
|
|
63
|
+
panel: 'basic',
|
|
64
|
+
title: '关于我们与页脚',
|
|
65
|
+
settings: [
|
|
66
|
+
{
|
|
67
|
+
id: 'systemFooterInfo',
|
|
68
|
+
type: 'textarea',
|
|
69
|
+
label: '页脚说明',
|
|
70
|
+
description: '支持 HTML;仅本主题生效',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: 'aboutUsGithubUrl',
|
|
74
|
+
type: 'text',
|
|
75
|
+
label: 'GitHub 链接',
|
|
76
|
+
description: '页头与页脚 GitHub 图标;留空不显示',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
id: 'aboutUsCommentQr',
|
|
80
|
+
type: 'image',
|
|
81
|
+
label: '社群/评论二维码',
|
|
82
|
+
description: '悬停展示的图片地址',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
id: 'aboutUsWechatQr',
|
|
86
|
+
type: 'image',
|
|
87
|
+
label: '微信二维码',
|
|
88
|
+
description: '悬停展示的图片地址',
|
|
89
|
+
},
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
id: 'colors',
|
|
94
|
+
panel: 'style',
|
|
95
|
+
title: '颜色',
|
|
96
|
+
description: '与访客站顶栏「日 / 夜」切换对应,可分别配置浅色与深色模式',
|
|
97
|
+
groups: [
|
|
98
|
+
{
|
|
99
|
+
id: 'light',
|
|
100
|
+
title: '浅色模式',
|
|
101
|
+
description: '访客关闭深色模式时生效',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
id: 'dark',
|
|
105
|
+
title: '深色模式',
|
|
106
|
+
description: '访客开启深色模式时生效',
|
|
107
|
+
},
|
|
108
|
+
],
|
|
109
|
+
settings: [
|
|
110
|
+
{ id: 'primaryColor', group: 'light', type: 'color', label: '主色', default: '#f44336' },
|
|
111
|
+
{
|
|
112
|
+
id: 'backgroundColor',
|
|
113
|
+
group: 'light',
|
|
114
|
+
type: 'color',
|
|
115
|
+
label: '背景色',
|
|
116
|
+
default: '#ffffff',
|
|
117
|
+
description: '页面与内容区背景;设置背景图后主区域会透明以露出图片',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
id: 'secondaryBackgroundColor',
|
|
121
|
+
group: 'light',
|
|
122
|
+
type: 'color',
|
|
123
|
+
label: '次要背景色',
|
|
124
|
+
default: '#f3f5f7',
|
|
125
|
+
description: '卡片间隔、侧栏等次要区域',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
id: 'linkColor',
|
|
129
|
+
group: 'light',
|
|
130
|
+
type: 'color',
|
|
131
|
+
label: '链接色',
|
|
132
|
+
default: '#4299e1',
|
|
133
|
+
description: '正文 Markdown 中的链接颜色',
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
id: 'darkPrimaryColor',
|
|
137
|
+
group: 'dark',
|
|
138
|
+
type: 'color',
|
|
139
|
+
label: '主色',
|
|
140
|
+
default: '#f44336',
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
id: 'darkBackgroundColor',
|
|
144
|
+
group: 'dark',
|
|
145
|
+
type: 'color',
|
|
146
|
+
label: '背景色',
|
|
147
|
+
default: '#1e2a36',
|
|
148
|
+
description: '页面与主内容区背景',
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
id: 'darkSecondaryBackgroundColor',
|
|
152
|
+
group: 'dark',
|
|
153
|
+
type: 'color',
|
|
154
|
+
label: '次要背景色',
|
|
155
|
+
default: '#1a242f',
|
|
156
|
+
description: '卡片、顶栏、侧栏等次要区域',
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
id: 'darkLinkColor',
|
|
160
|
+
group: 'dark',
|
|
161
|
+
type: 'color',
|
|
162
|
+
label: '链接色',
|
|
163
|
+
default: '#4299e1',
|
|
164
|
+
description: '正文 Markdown 中的链接颜色',
|
|
165
|
+
},
|
|
166
|
+
],
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
id: 'background',
|
|
170
|
+
panel: 'style',
|
|
171
|
+
title: '背景图片',
|
|
172
|
+
settings: [
|
|
173
|
+
{
|
|
174
|
+
id: 'backgroundImage',
|
|
175
|
+
type: 'image',
|
|
176
|
+
label: '背景图',
|
|
177
|
+
description: '设置后将覆盖纯色背景(宽屏可见);仅本主题生效',
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
id: 'themeConfiguration',
|
|
183
|
+
panel: 'layout',
|
|
184
|
+
title: '顶栏与网址导航',
|
|
185
|
+
embed: 'options',
|
|
186
|
+
description: '固定导航、/nav 卡片与聚合搜索',
|
|
187
|
+
},
|
|
188
|
+
];
|
|
189
|
+
/** Full `theme.json` → `appearance` block for Twenty Twenty-Five. */
|
|
190
|
+
exports.TWENTYTWENTYFIVE_APPEARANCE = {
|
|
191
|
+
panels: exports.TWENTYTWENTYFIVE_APPEARANCE_PANELS,
|
|
192
|
+
sections: exports.TWENTYTWENTYFIVE_APPEARANCE_SECTIONS,
|
|
193
|
+
};
|
|
194
|
+
/** @deprecated Use `TWENTYTWENTYFIVE_APPEARANCE_PANELS` */
|
|
195
|
+
exports.TWENTYTWENTYFIVE_CUSTOMIZER_GROUPS = exports.TWENTYTWENTYFIVE_APPEARANCE_PANELS;
|
|
196
|
+
/** @deprecated Use `TWENTYTWENTYFIVE_APPEARANCE_SECTIONS` */
|
|
197
|
+
exports.TWENTYTWENTYFIVE_CUSTOMIZER_SECTIONS = exports.TWENTYTWENTYFIVE_APPEARANCE_SECTIONS;
|
|
198
|
+
/** @deprecated Use `TWENTYTWENTYFIVE_APPEARANCE` */
|
|
199
|
+
exports.TWENTYTWENTYFIVE_CUSTOMIZER = exports.TWENTYTWENTYFIVE_APPEARANCE;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { parsePreviewTokenFromNextCtx, type PreviewDraftPayload } from '../theme/preview-draft';
|
|
2
|
+
import type { ResolvedSiteConfig, ThemeConfigurationSchema } from './configuration/types';
|
|
3
|
+
import { type ThemeMods } from './theme';
|
|
4
|
+
/** Draft payload returned by `GET /extension/themes/preview-draft/:token`. */
|
|
5
|
+
export type PreviewDraftResponse = PreviewDraftPayload;
|
|
6
|
+
export type NextPreviewCtx = Parameters<typeof parsePreviewTokenFromNextCtx>[0];
|
|
7
|
+
export type PreviewDraftFetcher = (token: string) => Promise<PreviewDraftResponse>;
|
|
8
|
+
/** Relative API path for a preview draft token. */
|
|
9
|
+
export declare function previewDraftApiPath(token: string): string;
|
|
10
|
+
/**
|
|
11
|
+
* Normalize API or axios-interceptor output into a preview draft.
|
|
12
|
+
* Accepts either `{ success, data }` envelopes or plain draft objects.
|
|
13
|
+
*/
|
|
14
|
+
export declare function normalizePreviewDraftData(raw: unknown): PreviewDraftResponse;
|
|
15
|
+
/** Load short-lived customizer preview payload (public GET by token). */
|
|
16
|
+
export declare function fetchPreviewDraft(token: string, options?: {
|
|
17
|
+
baseURL?: string;
|
|
18
|
+
fetcher?: PreviewDraftFetcher;
|
|
19
|
+
}): Promise<PreviewDraftResponse>;
|
|
20
|
+
export type ResolveThemePreviewContextInput = {
|
|
21
|
+
globalSettingRaw: unknown;
|
|
22
|
+
setting: Record<string, unknown>;
|
|
23
|
+
locale?: string;
|
|
24
|
+
ctx?: NextPreviewCtx;
|
|
25
|
+
manifest?: {
|
|
26
|
+
options?: ThemeConfigurationSchema;
|
|
27
|
+
};
|
|
28
|
+
/** Override draft loader (e.g. theme-local axios with auth interceptors). */
|
|
29
|
+
fetchDraft?: PreviewDraftFetcher;
|
|
30
|
+
apiBaseURL?: string;
|
|
31
|
+
};
|
|
32
|
+
/** Fully resolved visitor runtime after applying optional preview draft. */
|
|
33
|
+
export type ResolvedThemePreviewContext = {
|
|
34
|
+
siteConfig: ResolvedSiteConfig;
|
|
35
|
+
setting: Record<string, unknown>;
|
|
36
|
+
colorPrimary: string;
|
|
37
|
+
effectiveMods: ThemeMods;
|
|
38
|
+
configThemeId: string;
|
|
39
|
+
isPreview: boolean;
|
|
40
|
+
draft: PreviewDraftResponse | null;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Resolve site config, setting overlays, and customizer mods for a Next.js `_app` request.
|
|
44
|
+
* Themes should call this once in `getInitialProps` and pass results into their context/provider.
|
|
45
|
+
*/
|
|
46
|
+
export declare function resolveThemePreviewContext(input: ResolveThemePreviewContextInput): Promise<ResolvedThemePreviewContext>;
|