@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,92 @@
|
|
|
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.previewDraftApiPath = previewDraftApiPath;
|
|
7
|
+
exports.normalizePreviewDraftData = normalizePreviewDraftData;
|
|
8
|
+
exports.fetchPreviewDraft = fetchPreviewDraft;
|
|
9
|
+
exports.resolveThemePreviewContext = resolveThemePreviewContext;
|
|
10
|
+
const axios_1 = __importDefault(require("axios"));
|
|
11
|
+
const api_1 = require("../theme/api");
|
|
12
|
+
const preview_draft_1 = require("../theme/preview-draft");
|
|
13
|
+
const preview_mods_1 = require("../theme/preview-mods");
|
|
14
|
+
const resolve_1 = require("./configuration/resolve");
|
|
15
|
+
const theme_1 = require("./theme");
|
|
16
|
+
/** Relative API path for a preview draft token. */
|
|
17
|
+
function previewDraftApiPath(token) {
|
|
18
|
+
return `/extension/themes/preview-draft/${encodeURIComponent(token.trim())}`;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Normalize API or axios-interceptor output into a preview draft.
|
|
22
|
+
* Accepts either `{ success, data }` envelopes or plain draft objects.
|
|
23
|
+
*/
|
|
24
|
+
function normalizePreviewDraftData(raw) {
|
|
25
|
+
if (!raw || typeof raw !== 'object' || Array.isArray(raw)) {
|
|
26
|
+
return {};
|
|
27
|
+
}
|
|
28
|
+
const envelope = raw;
|
|
29
|
+
if ('success' in envelope && 'data' in envelope) {
|
|
30
|
+
if (envelope.success === false)
|
|
31
|
+
return {};
|
|
32
|
+
return normalizePreviewDraftData(envelope.data);
|
|
33
|
+
}
|
|
34
|
+
const draft = raw;
|
|
35
|
+
return {
|
|
36
|
+
themeId: typeof draft.themeId === 'string' ? draft.themeId : undefined,
|
|
37
|
+
mods: draft.mods,
|
|
38
|
+
configuration: draft.configuration,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/** Load short-lived customizer preview payload (public GET by token). */
|
|
42
|
+
async function fetchPreviewDraft(token, options) {
|
|
43
|
+
const trimmed = token.trim();
|
|
44
|
+
if (!trimmed)
|
|
45
|
+
return {};
|
|
46
|
+
if (options?.fetcher) {
|
|
47
|
+
return normalizePreviewDraftData(await options.fetcher(trimmed));
|
|
48
|
+
}
|
|
49
|
+
const base = (options?.baseURL ?? (0, api_1.resolveThemeApiBaseUrl)()).replace(/\/$/, '');
|
|
50
|
+
try {
|
|
51
|
+
const { data } = await axios_1.default.get(`${base}${previewDraftApiPath(trimmed)}`, {
|
|
52
|
+
timeout: 60000,
|
|
53
|
+
});
|
|
54
|
+
return normalizePreviewDraftData(data);
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return {};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Resolve site config, setting overlays, and customizer mods for a Next.js `_app` request.
|
|
62
|
+
* Themes should call this once in `getInitialProps` and pass results into their context/provider.
|
|
63
|
+
*/
|
|
64
|
+
async function resolveThemePreviewContext(input) {
|
|
65
|
+
const locale = input.locale ?? 'zh';
|
|
66
|
+
const themeState = (0, theme_1.getThemeStateFromGlobalSetting)(input.globalSettingRaw);
|
|
67
|
+
const previewToken = input.ctx ? (0, preview_draft_1.parsePreviewTokenFromNextCtx)(input.ctx) : '';
|
|
68
|
+
let draft = null;
|
|
69
|
+
if (previewToken) {
|
|
70
|
+
draft = await fetchPreviewDraft(previewToken, {
|
|
71
|
+
baseURL: input.apiBaseURL,
|
|
72
|
+
fetcher: input.fetchDraft,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
const previewConfig = draft?.configuration ?? {};
|
|
76
|
+
const previewMods = draft?.mods ?? {};
|
|
77
|
+
const configThemeId = draft?.themeId ?? themeState.activeTheme;
|
|
78
|
+
const siteConfig = (0, resolve_1.resolveSiteConfig)(input.globalSettingRaw, configThemeId, locale, input.manifest, Object.keys(previewConfig).length > 0 ? previewConfig : undefined);
|
|
79
|
+
const savedMods = themeState.mods[configThemeId] ?? {};
|
|
80
|
+
const effectiveMods = (0, preview_mods_1.mergePreviewMods)(savedMods, previewMods);
|
|
81
|
+
const setting = (0, theme_1.applyThemeModsToSiteSetting)(input.setting, effectiveMods);
|
|
82
|
+
const colorPrimary = (0, theme_1.appearancePrimaryColor)(effectiveMods);
|
|
83
|
+
return {
|
|
84
|
+
siteConfig,
|
|
85
|
+
setting,
|
|
86
|
+
colorPrimary,
|
|
87
|
+
effectiveMods,
|
|
88
|
+
configThemeId,
|
|
89
|
+
isPreview: Boolean(previewToken),
|
|
90
|
+
draft,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Single site-wide notice (stored in `Setting.systemNoticeInfo` as JSON). */
|
|
2
|
+
export type SiteNoticeItem = {
|
|
3
|
+
id: string;
|
|
4
|
+
content: string;
|
|
5
|
+
/** Default true when omitted. */
|
|
6
|
+
enabled?: boolean;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Parse `systemNoticeInfo` from DB / API.
|
|
10
|
+
* Supports JSON array, legacy newline-separated text, or plain string.
|
|
11
|
+
*/
|
|
12
|
+
export declare function parseSiteNotices(raw: unknown): SiteNoticeItem[];
|
|
13
|
+
/** Persist notices for `Setting.systemNoticeInfo`. */
|
|
14
|
+
export declare function serializeSiteNotices(items: SiteNoticeItem[]): string;
|
|
15
|
+
/** Ordered notice HTML/text lines for the visitor banner (enabled only). */
|
|
16
|
+
export declare function siteNoticeDisplayLines(raw: unknown): string[];
|
|
17
|
+
export declare function createEmptySiteNotice(): SiteNoticeItem;
|
|
18
|
+
/** Whether theme mod `siteNotice` is empty or identical to system `systemNoticeInfo`. */
|
|
19
|
+
export declare function siteNoticeModInheritsSystem(modRaw: string | undefined, systemRaw: unknown): boolean;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseSiteNotices = parseSiteNotices;
|
|
4
|
+
exports.serializeSiteNotices = serializeSiteNotices;
|
|
5
|
+
exports.siteNoticeDisplayLines = siteNoticeDisplayLines;
|
|
6
|
+
exports.createEmptySiteNotice = createEmptySiteNotice;
|
|
7
|
+
exports.siteNoticeModInheritsSystem = siteNoticeModInheritsSystem;
|
|
8
|
+
function newNoticeId() {
|
|
9
|
+
if (typeof crypto !== 'undefined' && crypto.randomUUID) {
|
|
10
|
+
return crypto.randomUUID();
|
|
11
|
+
}
|
|
12
|
+
return `notice-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
13
|
+
}
|
|
14
|
+
function normalizeItem(raw, index) {
|
|
15
|
+
if (typeof raw === 'string') {
|
|
16
|
+
const content = raw.trim();
|
|
17
|
+
if (!content)
|
|
18
|
+
return null;
|
|
19
|
+
return { id: `legacy-${index}`, content, enabled: true };
|
|
20
|
+
}
|
|
21
|
+
if (!raw || typeof raw !== 'object')
|
|
22
|
+
return null;
|
|
23
|
+
const o = raw;
|
|
24
|
+
const content = typeof o.content === 'string' ? o.content : typeof o.text === 'string' ? o.text : '';
|
|
25
|
+
if (!content.trim())
|
|
26
|
+
return null;
|
|
27
|
+
const id = typeof o.id === 'string' && o.id.trim() ? o.id.trim() : newNoticeId();
|
|
28
|
+
const enabled = o.enabled === false ? false : true;
|
|
29
|
+
return { id, content, enabled };
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Parse `systemNoticeInfo` from DB / API.
|
|
33
|
+
* Supports JSON array, legacy newline-separated text, or plain string.
|
|
34
|
+
*/
|
|
35
|
+
function parseSiteNotices(raw) {
|
|
36
|
+
if (raw == null)
|
|
37
|
+
return [];
|
|
38
|
+
if (Array.isArray(raw)) {
|
|
39
|
+
return raw.map((item, i) => normalizeItem(item, i)).filter((x) => x != null);
|
|
40
|
+
}
|
|
41
|
+
const text = String(raw).trim();
|
|
42
|
+
if (!text)
|
|
43
|
+
return [];
|
|
44
|
+
if (text.startsWith('[')) {
|
|
45
|
+
try {
|
|
46
|
+
const parsed = JSON.parse(text);
|
|
47
|
+
if (Array.isArray(parsed)) {
|
|
48
|
+
return parsed.map((item, i) => normalizeItem(item, i)).filter((x) => x != null);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
/* fall through */
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return text
|
|
56
|
+
.split(/\r?\n/)
|
|
57
|
+
.map((line) => line.trim())
|
|
58
|
+
.filter(Boolean)
|
|
59
|
+
.map((content, i) => ({ id: `legacy-${i}`, content, enabled: true }));
|
|
60
|
+
}
|
|
61
|
+
/** Persist notices for `Setting.systemNoticeInfo`. */
|
|
62
|
+
function serializeSiteNotices(items) {
|
|
63
|
+
const cleaned = items
|
|
64
|
+
.map((item) => ({
|
|
65
|
+
id: item.id?.trim() || newNoticeId(),
|
|
66
|
+
content: item.content?.trim() ?? '',
|
|
67
|
+
enabled: item.enabled !== false,
|
|
68
|
+
}))
|
|
69
|
+
.filter((item) => item.content.length > 0);
|
|
70
|
+
return JSON.stringify(cleaned);
|
|
71
|
+
}
|
|
72
|
+
/** Ordered notice HTML/text lines for the visitor banner (enabled only). */
|
|
73
|
+
function siteNoticeDisplayLines(raw) {
|
|
74
|
+
return parseSiteNotices(raw)
|
|
75
|
+
.filter((n) => n.enabled !== false)
|
|
76
|
+
.map((n) => n.content);
|
|
77
|
+
}
|
|
78
|
+
function createEmptySiteNotice() {
|
|
79
|
+
return { id: newNoticeId(), content: '', enabled: true };
|
|
80
|
+
}
|
|
81
|
+
/** Whether theme mod `siteNotice` is empty or identical to system `systemNoticeInfo`. */
|
|
82
|
+
function siteNoticeModInheritsSystem(modRaw, systemRaw) {
|
|
83
|
+
if (!modRaw?.trim())
|
|
84
|
+
return true;
|
|
85
|
+
const modSerialized = serializeSiteNotices(parseSiteNotices(modRaw));
|
|
86
|
+
const sysSerialized = serializeSiteNotices(parseSiteNotices(systemRaw));
|
|
87
|
+
return modSerialized === sysSerialized;
|
|
88
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Site-wide vs theme-owned settings.
|
|
3
|
+
*
|
|
4
|
+
* - **System settings** (`SYSTEM_SETTING_FIELD_KEYS`): shared defaults (URLs, site identity,
|
|
5
|
+
* SEO, i18n, mail). Edited under admin → 设置.
|
|
6
|
+
* - **Theme mods** (`THEME_BRANDING_*`): per-theme overrides in `globalSetting.theme.mods[themeId]`.
|
|
7
|
+
* Empty mod → inherit the matching system setting at runtime.
|
|
8
|
+
* - **Theme-only** (footer / 关于我们): appearance only, no system setting column.
|
|
9
|
+
*/
|
|
10
|
+
import { THEME_BRANDING_DIRECT_MODS } from './branding-mods';
|
|
11
|
+
import { type GlobalSettingWithTheme } from './theme';
|
|
12
|
+
export { applyThemeModsToSiteSetting, seedThemeModsFromLegacySetting, THEME_BRANDING_DIRECT_MODS, THEME_BRANDING_MOD_TO_SETTING, } from './branding-mods';
|
|
13
|
+
/** Site identity defaults (admin → 设置 → 常规). Themes may override via customizer mods. */
|
|
14
|
+
export declare const SITE_DEFAULT_SETTING_KEYS: readonly ["systemTitle", "systemSubTitle", "systemLogo", "systemFavicon", "systemNoticeInfo"];
|
|
15
|
+
/** SEO defaults (admin → 设置 → SEO). Themes may override via customizer mods. */
|
|
16
|
+
export declare const SEO_DEFAULT_SETTING_KEYS: readonly ["seoKeyword", "seoDesc", "baiduAnalyticsId", "googleAnalyticsId"];
|
|
17
|
+
/** Theme-only appearance (no system setting column). */
|
|
18
|
+
export declare const THEME_ONLY_APPEARANCE_KEYS: readonly ["systemFooterInfo", "aboutUsGithubUrl", "aboutUsCommentQr", "aboutUsWechatQr"];
|
|
19
|
+
/** DB columns managed as system configuration (admin → 设置). */
|
|
20
|
+
export declare const SYSTEM_SETTING_FIELD_KEYS: readonly ["i18n", "systemUrl", "adminSystemUrl", "systemTitle", "systemSubTitle", "systemLogo", "systemFavicon", "systemNoticeInfo", "seoKeyword", "seoDesc", "baiduAnalyticsId", "googleAnalyticsId", "smtpHost", "smtpPort", "smtpUser", "smtpPass", "smtpFromUser"];
|
|
21
|
+
export type SystemSettingFieldKey = (typeof SYSTEM_SETTING_FIELD_KEYS)[number];
|
|
22
|
+
/** @deprecated Use SITE_DEFAULT_SETTING_KEYS + SEO_DEFAULT_SETTING_KEYS */
|
|
23
|
+
export declare const LEGACY_APPEARANCE_SETTING_KEYS: readonly ["systemTitle", "systemSubTitle", "systemLogo", "systemFavicon", "systemNoticeInfo", "seoKeyword", "seoDesc", "baiduAnalyticsId", "googleAnalyticsId", "systemFooterInfo", "aboutUsGithubUrl", "aboutUsCommentQr", "aboutUsWechatQr"];
|
|
24
|
+
export type ThemeBrandingDirectMod = (typeof THEME_BRANDING_DIRECT_MODS)[number];
|
|
25
|
+
/** Keys exposed to anonymous theme `setting/get` (plus computed appearance overlay). */
|
|
26
|
+
export declare const PUBLIC_SETTING_KEYS: readonly ["i18n", "systemUrl", "adminSystemUrl", "globalSetting", "systemTitle", "systemSubTitle", "systemLogo", "systemFavicon", "systemNoticeInfo", "seoKeyword", "seoDesc", "baiduAnalyticsId", "googleAnalyticsId", "systemFooterInfo", "aboutUsGithubUrl", "aboutUsCommentQr", "aboutUsWechatQr"];
|
|
27
|
+
/** Copy legacy appearance columns into theme mods when mods are empty. */
|
|
28
|
+
export declare function migrateLegacyAppearanceToThemeMods(globalRaw: unknown, settingRow: Record<string, unknown>): {
|
|
29
|
+
global: GlobalSettingWithTheme;
|
|
30
|
+
changed: boolean;
|
|
31
|
+
};
|
|
32
|
+
/** Strip non-system fields from admin PATCH payloads. */
|
|
33
|
+
export declare function pickSystemSettingPatch(patch: Record<string, unknown>): Record<string, unknown>;
|
|
34
|
+
/** Overlay active theme mods onto a Setting row for runtime (themes, mail templates). */
|
|
35
|
+
export declare function resolveEffectiveSettingRow<T extends Record<string, unknown>>(row: T, globalRaw?: unknown, themeId?: string): T;
|
|
36
|
+
/** Public API view: system keys + branding overlay + globalSetting. */
|
|
37
|
+
export declare function buildPublicSettingView(row: Record<string, unknown>): Record<string, unknown>;
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Site-wide vs theme-owned settings.
|
|
4
|
+
*
|
|
5
|
+
* - **System settings** (`SYSTEM_SETTING_FIELD_KEYS`): shared defaults (URLs, site identity,
|
|
6
|
+
* SEO, i18n, mail). Edited under admin → 设置.
|
|
7
|
+
* - **Theme mods** (`THEME_BRANDING_*`): per-theme overrides in `globalSetting.theme.mods[themeId]`.
|
|
8
|
+
* Empty mod → inherit the matching system setting at runtime.
|
|
9
|
+
* - **Theme-only** (footer / 关于我们): appearance only, no system setting column.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PUBLIC_SETTING_KEYS = exports.LEGACY_APPEARANCE_SETTING_KEYS = exports.SYSTEM_SETTING_FIELD_KEYS = exports.THEME_ONLY_APPEARANCE_KEYS = exports.SEO_DEFAULT_SETTING_KEYS = exports.SITE_DEFAULT_SETTING_KEYS = exports.THEME_BRANDING_MOD_TO_SETTING = exports.THEME_BRANDING_DIRECT_MODS = exports.seedThemeModsFromLegacySetting = exports.applyThemeModsToSiteSetting = void 0;
|
|
13
|
+
exports.migrateLegacyAppearanceToThemeMods = migrateLegacyAppearanceToThemeMods;
|
|
14
|
+
exports.pickSystemSettingPatch = pickSystemSettingPatch;
|
|
15
|
+
exports.resolveEffectiveSettingRow = resolveEffectiveSettingRow;
|
|
16
|
+
exports.buildPublicSettingView = buildPublicSettingView;
|
|
17
|
+
const branding_mods_1 = require("./branding-mods");
|
|
18
|
+
const theme_1 = require("./theme");
|
|
19
|
+
var branding_mods_2 = require("./branding-mods");
|
|
20
|
+
Object.defineProperty(exports, "applyThemeModsToSiteSetting", { enumerable: true, get: function () { return branding_mods_2.applyThemeModsToSiteSetting; } });
|
|
21
|
+
Object.defineProperty(exports, "seedThemeModsFromLegacySetting", { enumerable: true, get: function () { return branding_mods_2.seedThemeModsFromLegacySetting; } });
|
|
22
|
+
Object.defineProperty(exports, "THEME_BRANDING_DIRECT_MODS", { enumerable: true, get: function () { return branding_mods_2.THEME_BRANDING_DIRECT_MODS; } });
|
|
23
|
+
Object.defineProperty(exports, "THEME_BRANDING_MOD_TO_SETTING", { enumerable: true, get: function () { return branding_mods_2.THEME_BRANDING_MOD_TO_SETTING; } });
|
|
24
|
+
/** Site identity defaults (admin → 设置 → 常规). Themes may override via customizer mods. */
|
|
25
|
+
exports.SITE_DEFAULT_SETTING_KEYS = [
|
|
26
|
+
'systemTitle',
|
|
27
|
+
'systemSubTitle',
|
|
28
|
+
'systemLogo',
|
|
29
|
+
'systemFavicon',
|
|
30
|
+
'systemNoticeInfo',
|
|
31
|
+
];
|
|
32
|
+
/** SEO defaults (admin → 设置 → SEO). Themes may override via customizer mods. */
|
|
33
|
+
exports.SEO_DEFAULT_SETTING_KEYS = [
|
|
34
|
+
'seoKeyword',
|
|
35
|
+
'seoDesc',
|
|
36
|
+
'baiduAnalyticsId',
|
|
37
|
+
'googleAnalyticsId',
|
|
38
|
+
];
|
|
39
|
+
/** Theme-only appearance (no system setting column). */
|
|
40
|
+
exports.THEME_ONLY_APPEARANCE_KEYS = [
|
|
41
|
+
'systemFooterInfo',
|
|
42
|
+
'aboutUsGithubUrl',
|
|
43
|
+
'aboutUsCommentQr',
|
|
44
|
+
'aboutUsWechatQr',
|
|
45
|
+
];
|
|
46
|
+
/** DB columns managed as system configuration (admin → 设置). */
|
|
47
|
+
exports.SYSTEM_SETTING_FIELD_KEYS = [
|
|
48
|
+
'i18n',
|
|
49
|
+
'systemUrl',
|
|
50
|
+
'adminSystemUrl',
|
|
51
|
+
...exports.SITE_DEFAULT_SETTING_KEYS,
|
|
52
|
+
...exports.SEO_DEFAULT_SETTING_KEYS,
|
|
53
|
+
'smtpHost',
|
|
54
|
+
'smtpPort',
|
|
55
|
+
'smtpUser',
|
|
56
|
+
'smtpPass',
|
|
57
|
+
'smtpFromUser',
|
|
58
|
+
];
|
|
59
|
+
/** @deprecated Use SITE_DEFAULT_SETTING_KEYS + SEO_DEFAULT_SETTING_KEYS */
|
|
60
|
+
exports.LEGACY_APPEARANCE_SETTING_KEYS = [
|
|
61
|
+
...exports.SITE_DEFAULT_SETTING_KEYS,
|
|
62
|
+
...exports.SEO_DEFAULT_SETTING_KEYS,
|
|
63
|
+
...exports.THEME_ONLY_APPEARANCE_KEYS,
|
|
64
|
+
];
|
|
65
|
+
/** Keys exposed to anonymous theme `setting/get` (plus computed appearance overlay). */
|
|
66
|
+
exports.PUBLIC_SETTING_KEYS = [
|
|
67
|
+
'i18n',
|
|
68
|
+
'systemUrl',
|
|
69
|
+
'adminSystemUrl',
|
|
70
|
+
'globalSetting',
|
|
71
|
+
...exports.LEGACY_APPEARANCE_SETTING_KEYS,
|
|
72
|
+
];
|
|
73
|
+
function modHasValue(mods, modId) {
|
|
74
|
+
const v = mods[modId];
|
|
75
|
+
return v != null && String(v).trim() !== '';
|
|
76
|
+
}
|
|
77
|
+
/** Copy legacy appearance columns into theme mods when mods are empty. */
|
|
78
|
+
function migrateLegacyAppearanceToThemeMods(globalRaw, settingRow) {
|
|
79
|
+
const base = globalRaw && typeof globalRaw === 'object'
|
|
80
|
+
? { ...globalRaw }
|
|
81
|
+
: {};
|
|
82
|
+
const themeState = (0, theme_1.getThemeStateFromGlobalSetting)(base);
|
|
83
|
+
const themeIds = new Set([
|
|
84
|
+
themeState.activeTheme,
|
|
85
|
+
...themeState.installedThemes,
|
|
86
|
+
]);
|
|
87
|
+
const mods = themeState.mods && typeof themeState.mods === 'object'
|
|
88
|
+
? { ...themeState.mods }
|
|
89
|
+
: {};
|
|
90
|
+
let changed = false;
|
|
91
|
+
for (const themeId of themeIds) {
|
|
92
|
+
if (!themeId)
|
|
93
|
+
continue;
|
|
94
|
+
const current = mods[themeId] ?? {};
|
|
95
|
+
const seeded = (0, branding_mods_1.seedThemeModsFromLegacySetting)(settingRow, current);
|
|
96
|
+
const currentHasValues = Object.keys(current).some((k) => modHasValue(current, k));
|
|
97
|
+
const seededHasValues = Object.keys(seeded).some((k) => modHasValue(seeded, k));
|
|
98
|
+
if (!currentHasValues && seededHasValues) {
|
|
99
|
+
mods[themeId] = seeded;
|
|
100
|
+
changed = true;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (!changed) {
|
|
104
|
+
return { global: base, changed: false };
|
|
105
|
+
}
|
|
106
|
+
const next = { ...themeState, mods };
|
|
107
|
+
return { global: { ...base, theme: next }, changed: true };
|
|
108
|
+
}
|
|
109
|
+
/** Strip non-system fields from admin PATCH payloads. */
|
|
110
|
+
function pickSystemSettingPatch(patch) {
|
|
111
|
+
const out = {};
|
|
112
|
+
for (const key of exports.SYSTEM_SETTING_FIELD_KEYS) {
|
|
113
|
+
if (key in patch)
|
|
114
|
+
out[key] = patch[key];
|
|
115
|
+
}
|
|
116
|
+
return out;
|
|
117
|
+
}
|
|
118
|
+
/** Overlay active theme mods onto a Setting row for runtime (themes, mail templates). */
|
|
119
|
+
function resolveEffectiveSettingRow(row, globalRaw, themeId) {
|
|
120
|
+
const gs = globalRaw ?? row.globalSetting;
|
|
121
|
+
const themeState = (0, theme_1.getThemeStateFromGlobalSetting)(typeof gs === 'string'
|
|
122
|
+
? (() => {
|
|
123
|
+
try {
|
|
124
|
+
return JSON.parse(gs);
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
return {};
|
|
128
|
+
}
|
|
129
|
+
})()
|
|
130
|
+
: gs);
|
|
131
|
+
const id = themeId ?? themeState.activeTheme;
|
|
132
|
+
const mods = themeState.mods[id] ?? {};
|
|
133
|
+
return (0, branding_mods_1.applyThemeModsToSiteSetting)(row, mods);
|
|
134
|
+
}
|
|
135
|
+
/** Public API view: system keys + branding overlay + globalSetting. */
|
|
136
|
+
function buildPublicSettingView(row) {
|
|
137
|
+
const effective = resolveEffectiveSettingRow(row);
|
|
138
|
+
const out = {};
|
|
139
|
+
for (const key of exports.PUBLIC_SETTING_KEYS) {
|
|
140
|
+
if (effective[key] !== undefined)
|
|
141
|
+
out[key] = effective[key];
|
|
142
|
+
}
|
|
143
|
+
return out;
|
|
144
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ThemeConfigurationSchema } from './configuration/types';
|
|
2
|
+
/** Customizer copy shipped with the theme (`locales/{locale}.json`). */
|
|
3
|
+
export type ThemeAdminLocaleMessages = Record<string, unknown>;
|
|
4
|
+
export declare const THEME_LOCALE_DIR = "locales";
|
|
5
|
+
export declare function getNestedLocaleValue(obj: unknown, dotPath: string): unknown;
|
|
6
|
+
export declare function getNestedLocaleString(obj: unknown, dotPath: string): string | undefined;
|
|
7
|
+
/** Resolve admin copy from theme locale bundle; falls back to manifest text. */
|
|
8
|
+
export declare function resolveThemeAdminLocaleText(messages: ThemeAdminLocaleMessages | null | undefined, dotPath: string, fallback?: string): string;
|
|
9
|
+
export declare function resolveThemeAdminLocaleTags(messages: ThemeAdminLocaleMessages | null | undefined, fallback?: string[]): string[];
|
|
10
|
+
/** Apply theme admin locale messages to options JSON Schema titles/descriptions. */
|
|
11
|
+
export declare function localizeThemeConfigurationSchemaWithLocale(schema: ThemeConfigurationSchema | null | undefined, messages: ThemeAdminLocaleMessages | null | undefined): ThemeConfigurationSchema | null;
|
|
@@ -0,0 +1,54 @@
|
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.readThemeAdminLocaleFile = readThemeAdminLocaleFile;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
const theme_admin_locale_1 = require("./theme-admin-locale");
|
|
40
|
+
function readThemeAdminLocaleFile(themeDir, locale) {
|
|
41
|
+
const safeLocale = /^[a-z]{2}(?:-[a-z]{2})?$/i.test(locale) ? locale : 'en';
|
|
42
|
+
const filePath = path.join(themeDir, theme_admin_locale_1.THEME_LOCALE_DIR, `${safeLocale}.json`);
|
|
43
|
+
if (!fs.existsSync(filePath))
|
|
44
|
+
return null;
|
|
45
|
+
try {
|
|
46
|
+
const raw = JSON.parse(fs.readFileSync(filePath, 'utf8'));
|
|
47
|
+
return raw && typeof raw === 'object' && !Array.isArray(raw)
|
|
48
|
+
? raw
|
|
49
|
+
: null;
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.THEME_LOCALE_DIR = void 0;
|
|
4
|
+
exports.getNestedLocaleValue = getNestedLocaleValue;
|
|
5
|
+
exports.getNestedLocaleString = getNestedLocaleString;
|
|
6
|
+
exports.resolveThemeAdminLocaleText = resolveThemeAdminLocaleText;
|
|
7
|
+
exports.resolveThemeAdminLocaleTags = resolveThemeAdminLocaleTags;
|
|
8
|
+
exports.localizeThemeConfigurationSchemaWithLocale = localizeThemeConfigurationSchemaWithLocale;
|
|
9
|
+
exports.THEME_LOCALE_DIR = 'locales';
|
|
10
|
+
function getNestedLocaleValue(obj, dotPath) {
|
|
11
|
+
const parts = dotPath.split('.').filter(Boolean);
|
|
12
|
+
let cur = obj;
|
|
13
|
+
for (const part of parts) {
|
|
14
|
+
if (!cur || typeof cur !== 'object')
|
|
15
|
+
return undefined;
|
|
16
|
+
cur = cur[part];
|
|
17
|
+
}
|
|
18
|
+
return cur;
|
|
19
|
+
}
|
|
20
|
+
function getNestedLocaleString(obj, dotPath) {
|
|
21
|
+
const value = getNestedLocaleValue(obj, dotPath);
|
|
22
|
+
return typeof value === 'string' && value.trim() ? value : undefined;
|
|
23
|
+
}
|
|
24
|
+
/** Resolve admin copy from theme locale bundle; falls back to manifest text. */
|
|
25
|
+
function resolveThemeAdminLocaleText(messages, dotPath, fallback) {
|
|
26
|
+
const fromLocale = messages ? getNestedLocaleString(messages, dotPath) : undefined;
|
|
27
|
+
if (fromLocale)
|
|
28
|
+
return fromLocale;
|
|
29
|
+
return fallback?.trim() ?? '';
|
|
30
|
+
}
|
|
31
|
+
function resolveThemeAdminLocaleTags(messages, fallback) {
|
|
32
|
+
const raw = messages ? getNestedLocaleValue(messages, 'meta.tags') : undefined;
|
|
33
|
+
if (Array.isArray(raw) && raw.every((item) => typeof item === 'string')) {
|
|
34
|
+
return raw;
|
|
35
|
+
}
|
|
36
|
+
return fallback ?? [];
|
|
37
|
+
}
|
|
38
|
+
function localizeSchemaField(field, pathParts, resolve) {
|
|
39
|
+
if (typeof field.title === 'string') {
|
|
40
|
+
field.title = resolve([...pathParts, 'title'].join('.'), field.title);
|
|
41
|
+
}
|
|
42
|
+
if (typeof field.description === 'string') {
|
|
43
|
+
field.description = resolve([...pathParts, 'description'].join('.'), field.description);
|
|
44
|
+
}
|
|
45
|
+
if (field.properties) {
|
|
46
|
+
for (const [key, child] of Object.entries(field.properties)) {
|
|
47
|
+
localizeSchemaField(child, [...pathParts, key], resolve);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const items = field.items;
|
|
51
|
+
if (items && typeof items === 'object' && !Array.isArray(items)) {
|
|
52
|
+
const itemSchema = items;
|
|
53
|
+
if (itemSchema.properties) {
|
|
54
|
+
for (const [key, child] of Object.entries(itemSchema.properties)) {
|
|
55
|
+
localizeSchemaField(child, [...pathParts, 'items', key], resolve);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
localizeSchemaField(itemSchema, [...pathParts, 'items'], resolve);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/** Apply theme admin locale messages to options JSON Schema titles/descriptions. */
|
|
64
|
+
function localizeThemeConfigurationSchemaWithLocale(schema, messages) {
|
|
65
|
+
if (!schema)
|
|
66
|
+
return null;
|
|
67
|
+
const out = structuredClone(schema);
|
|
68
|
+
const resolve = (dotPath, fallback) => resolveThemeAdminLocaleText(messages, `options.${dotPath}`, fallback);
|
|
69
|
+
if (typeof out.title === 'string') {
|
|
70
|
+
out.title = resolve('title', out.title);
|
|
71
|
+
}
|
|
72
|
+
if (typeof out.description === 'string') {
|
|
73
|
+
out.description = resolve('description', out.description);
|
|
74
|
+
}
|
|
75
|
+
if (out.properties) {
|
|
76
|
+
for (const [key, field] of Object.entries(out.properties)) {
|
|
77
|
+
localizeSchemaField(field, [key], resolve);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
return out;
|
|
81
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/** WordPress-style theme manifest and site theme state (shared by server / web / themes). */
|
|
2
|
+
import type { ThemeConfigurationSchema } from './configuration/types';
|
|
3
|
+
export interface ThemeAppearanceChoice {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
/** Appearance control (declared in `theme.json` → `appearance.sections`). */
|
|
8
|
+
export interface ThemeAppearanceSetting {
|
|
9
|
+
id: string;
|
|
10
|
+
type: 'color' | 'text' | 'image' | 'textarea' | 'checkbox' | 'select' | 'noticeList';
|
|
11
|
+
label: string;
|
|
12
|
+
default?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
choices?: ThemeAppearanceChoice[];
|
|
15
|
+
/** Sub-group within a section (e.g. light vs dark colors). */
|
|
16
|
+
group?: string;
|
|
17
|
+
}
|
|
18
|
+
/** Sidebar nav panel (Site Identity, Colors, …). */
|
|
19
|
+
export interface ThemeAppearancePanel {
|
|
20
|
+
id: string;
|
|
21
|
+
title: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
}
|
|
24
|
+
/** Control group inside a section panel (e.g. Light / Dark). */
|
|
25
|
+
export interface ThemeAppearanceGroup {
|
|
26
|
+
id: string;
|
|
27
|
+
title: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ThemeAppearanceSection {
|
|
31
|
+
id: string;
|
|
32
|
+
title: string;
|
|
33
|
+
/** Nav panel id (`appearance.panels[].id`). */
|
|
34
|
+
panel?: string;
|
|
35
|
+
settings?: ThemeAppearanceSetting[];
|
|
36
|
+
groups?: ThemeAppearanceGroup[];
|
|
37
|
+
/** Embed the theme `options` schema form instead of inline controls. */
|
|
38
|
+
embed?: 'options';
|
|
39
|
+
description?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface ThemeAppearanceManifest {
|
|
42
|
+
panels?: ThemeAppearancePanel[];
|
|
43
|
+
sections: ThemeAppearanceSection[];
|
|
44
|
+
}
|
|
45
|
+
export type { ThemeMods } from './branding-mods';
|
|
46
|
+
export { applyThemeModsToSiteSetting, seedThemeModsFromLegacySetting, THEME_BRANDING_DIRECT_MODS, THEME_BRANDING_MOD_TO_SETTING, } from './branding-mods';
|
|
47
|
+
import type { ThemeMods } from './branding-mods';
|
|
48
|
+
export { appearancePrimaryColorForMode } from './twentytwentyfive-vars';
|
|
49
|
+
/** Primary color from appearance mods (Ant Design / CSS), light mode. */
|
|
50
|
+
export declare function appearancePrimaryColor(mods: ThemeMods, fallback?: string): string;
|
|
51
|
+
export interface ThemeManifest {
|
|
52
|
+
id: string;
|
|
53
|
+
name: string;
|
|
54
|
+
version: string;
|
|
55
|
+
description?: string;
|
|
56
|
+
author?: string;
|
|
57
|
+
authorUri?: string;
|
|
58
|
+
themeUri?: string;
|
|
59
|
+
tags?: string[];
|
|
60
|
+
/** Theme cover image path (relative to theme root). Shown in admin theme list / preview. */
|
|
61
|
+
cover?: string;
|
|
62
|
+
requires?: string;
|
|
63
|
+
supports?: Record<string, unknown>;
|
|
64
|
+
templates?: Record<string, string>;
|
|
65
|
+
options?: ThemeConfigurationSchema;
|
|
66
|
+
appearance?: ThemeAppearanceManifest;
|
|
67
|
+
}
|
|
68
|
+
export interface SiteThemeState {
|
|
69
|
+
activeTheme: string;
|
|
70
|
+
installedThemes: string[];
|
|
71
|
+
mods: Record<string, ThemeMods>;
|
|
72
|
+
previewThemeId?: string;
|
|
73
|
+
}
|
|
74
|
+
export declare const DEFAULT_ACTIVE_THEME = "twentytwentyfive";
|
|
75
|
+
export declare const defaultSiteThemeState: SiteThemeState;
|
|
76
|
+
export interface GlobalSettingWithTheme {
|
|
77
|
+
zh?: unknown;
|
|
78
|
+
en?: unknown;
|
|
79
|
+
theme?: SiteThemeState;
|
|
80
|
+
config?: Record<string, Record<string, unknown>>;
|
|
81
|
+
[key: string]: unknown;
|
|
82
|
+
}
|
|
83
|
+
export declare function parseThemeManifest(raw: unknown): ThemeManifest | null;
|
|
84
|
+
export declare function getThemeStateFromGlobalSetting(raw: unknown): SiteThemeState;
|
|
85
|
+
export { resolvePublicAssetUrl } from '../theme/assets';
|
|
86
|
+
export { appendPreviewConfigToUrl, parsePreviewConfigFromNextCtx, parsePreviewConfigFromRequestUrl, parsePreviewConfigParam, PREVIEW_CONFIG_QUERY_KEY, } from '../theme/preview-config';
|
|
87
|
+
export { appendPreviewTokenToUrl, parsePreviewTokenFromNextCtx, parsePreviewTokenFromRequestUrl, PREVIEW_TOKEN_QUERY_KEY, type PreviewDraftPayload, } from '../theme/preview-draft';
|
|
88
|
+
export { appendPreviewModsToUrl, mergePreviewMods, parsePreviewModsFromNextCtx, parsePreviewModsFromRequestUrl, parsePreviewModsParam, PREVIEW_MODS_QUERY_KEY, } from '../theme/preview-mods';
|
|
89
|
+
export declare function mergeThemeStateIntoGlobalSetting(raw: unknown, patch: Partial<SiteThemeState>): GlobalSettingWithTheme;
|