@fecommunity/reactpress 4.0.0-beta.0 → 4.0.0-beta.10

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.
Files changed (954) hide show
  1. package/dist/utils/server-bundle.js +7 -0
  2. package/out/bin/reactpress-theme-client.js +64 -1
  3. package/out/bin/reactpress.js +94 -482
  4. package/out/core/services/config.js +4 -1
  5. package/out/core/services/database/index.js +18 -5
  6. package/out/core/services/database/sqlite.js +28 -5
  7. package/out/core/services/init.js +1 -53
  8. package/out/core/services/local-site.js +15 -10
  9. package/out/core/services/theme-bootstrap.js +50 -0
  10. package/out/core/utils/env-file.js +99 -0
  11. package/out/core/utils/paths.js +5 -4
  12. package/out/lib/api-dev.js +11 -1
  13. package/out/lib/bootstrap.js +13 -40
  14. package/out/lib/cli-events.js +54 -0
  15. package/out/lib/command-palette.js +53 -0
  16. package/out/lib/context-status.js +154 -0
  17. package/out/lib/create-site.js +187 -0
  18. package/out/lib/database-mode.js +45 -0
  19. package/out/lib/design-tokens.js +55 -0
  20. package/out/lib/dev-banner.js +10 -5
  21. package/out/lib/dev-session.js +9 -2
  22. package/out/lib/dev.js +117 -66
  23. package/out/lib/docker.js +12 -0
  24. package/out/lib/doctor.js +131 -10
  25. package/out/lib/http.js +20 -0
  26. package/out/lib/i18n/index.js +5 -1
  27. package/out/lib/i18n/strings.js +184 -52
  28. package/out/lib/lifecycle.js +21 -1
  29. package/out/lib/menu-actions.js +418 -0
  30. package/out/lib/nginx.js +5 -2
  31. package/out/lib/paths.js +11 -0
  32. package/out/lib/pm2.js +9 -2
  33. package/out/lib/ports.js +134 -13
  34. package/out/lib/project-type.js +18 -0
  35. package/out/lib/publish.js +3 -0
  36. package/out/lib/remote-dev.js +5 -1
  37. package/out/lib/server-bundle.js +84 -0
  38. package/out/lib/shell-mode.js +23 -0
  39. package/out/lib/theme-warmup.js +1 -1
  40. package/out/shell/app.js +384 -0
  41. package/out/shell/components/brand-banner.js +93 -0
  42. package/out/shell/components/command-palette.js +77 -0
  43. package/out/shell/components/dev-stepper.js +54 -0
  44. package/out/shell/components/ink-theme.js +86 -0
  45. package/out/shell/components/menu-list.js +49 -0
  46. package/out/shell/components/pulse-bar.js +55 -0
  47. package/out/shell/components/status-rack.js +47 -0
  48. package/out/shell/hooks/use-terminal-size.js +27 -0
  49. package/out/shell/ink-shell.mjs +12056 -0
  50. package/out/shell/lib/shell-layout.js +60 -0
  51. package/out/shell/runtime/render-ink.js +89 -0
  52. package/out/ui/banner-startup.js +117 -0
  53. package/out/ui/banner.js +404 -277
  54. package/out/ui/interactive.js +199 -125
  55. package/out/ui/prompts.js +91 -0
  56. package/out/ui/startup-splash.js +185 -0
  57. package/out/ui/theme.js +62 -10
  58. package/package.json +5 -3
  59. package/server/bin/reactpress-server.js +10 -2
  60. package/server/dist/app.module.js +13 -25
  61. package/server/dist/filters/http-exception.filter.js +1 -1
  62. package/server/dist/generate-swagger.js +12 -11
  63. package/server/dist/interceptors/transform.interceptor.js +10 -5
  64. package/server/dist/logger/index.js +5 -4
  65. package/server/dist/main.js +45 -23
  66. package/server/dist/modules/article/article-revision.entity.js +1 -1
  67. package/server/dist/modules/article/article.controller.js +103 -48
  68. package/server/dist/modules/article/article.entity.js +61 -41
  69. package/server/dist/modules/article/article.module.js +18 -3
  70. package/server/dist/modules/article/article.service.js +151 -29
  71. package/server/dist/modules/auth/auth.controller.js +11 -11
  72. package/server/dist/modules/auth/auth.module.js +4 -4
  73. package/server/dist/modules/auth/auth.service.js +8 -7
  74. package/server/dist/modules/auth/jwt-auth.guard.js +4 -3
  75. package/server/dist/modules/auth/jwt.strategy.js +4 -3
  76. package/server/dist/modules/auth/roles.guard.js +2 -2
  77. package/server/dist/modules/category/category.controller.js +21 -20
  78. package/server/dist/modules/category/category.entity.js +13 -13
  79. package/server/dist/modules/category/category.module.js +1 -1
  80. package/server/dist/modules/category/category.service.js +5 -4
  81. package/server/dist/modules/comment/comment.controller.js +24 -20
  82. package/server/dist/modules/comment/comment.entity.js +31 -31
  83. package/server/dist/modules/comment/comment.module.js +11 -2
  84. package/server/dist/modules/comment/comment.service.js +43 -16
  85. package/server/dist/modules/comment/html.js +3 -3
  86. package/server/dist/modules/file/file.controller.js +22 -20
  87. package/server/dist/modules/file/file.entity.js +20 -15
  88. package/server/dist/modules/file/file.module.js +16 -4
  89. package/server/dist/modules/file/file.service.js +70 -24
  90. package/server/dist/modules/install/install.controller.js +5 -5
  91. package/server/dist/modules/install/install.module.js +1 -1
  92. package/server/dist/modules/install/install.service.js +2 -2
  93. package/server/dist/modules/knowledge/knowledge.controller.js +35 -33
  94. package/server/dist/modules/knowledge/knowledge.entity.js +33 -33
  95. package/server/dist/modules/knowledge/knowledge.module.js +1 -1
  96. package/server/dist/modules/knowledge/knowledge.service.js +12 -11
  97. package/server/dist/modules/page/page.controller.js +24 -23
  98. package/server/dist/modules/page/page.entity.js +27 -27
  99. package/server/dist/modules/page/page.module.js +1 -1
  100. package/server/dist/modules/page/page.service.js +12 -12
  101. package/server/dist/modules/search/search.controller.js +12 -12
  102. package/server/dist/modules/search/search.entity.js +13 -13
  103. package/server/dist/modules/search/search.module.js +1 -1
  104. package/server/dist/modules/search/search.service.js +2 -2
  105. package/server/dist/modules/setting/setting.constant.js +3 -19
  106. package/server/dist/modules/setting/setting.controller.js +11 -11
  107. package/server/dist/modules/setting/setting.entity.js +64 -49
  108. package/server/dist/modules/setting/setting.module.js +2 -2
  109. package/server/dist/modules/setting/setting.service.js +169 -24
  110. package/server/dist/modules/smtp/mail.util.js +5 -9
  111. package/server/dist/modules/smtp/smtp.controller.js +27 -14
  112. package/server/dist/modules/smtp/smtp.entity.js +15 -15
  113. package/server/dist/modules/smtp/smtp.module.js +2 -2
  114. package/server/dist/modules/smtp/smtp.service.js +40 -12
  115. package/server/dist/modules/tag/tag.controller.js +24 -22
  116. package/server/dist/modules/tag/tag.entity.js +12 -12
  117. package/server/dist/modules/tag/tag.module.js +1 -1
  118. package/server/dist/modules/tag/tag.service.js +5 -4
  119. package/server/dist/modules/user/user.controller.js +39 -28
  120. package/server/dist/modules/user/user.entity.js +22 -22
  121. package/server/dist/modules/user/user.module.js +2 -2
  122. package/server/dist/modules/user/user.service.js +16 -12
  123. package/server/dist/modules/view/view.controller.js +20 -19
  124. package/server/dist/modules/view/view.entity.js +24 -24
  125. package/server/dist/modules/view/view.module.js +1 -1
  126. package/server/dist/modules/view/view.service.js +4 -4
  127. package/server/dist/node-polyfills.js +24 -0
  128. package/server/dist/starter.js +202 -14
  129. package/server/dist/utils/date.util.js +1 -1
  130. package/server/dist/utils/markdown.util.js +1 -1
  131. package/server/dist/utils/oss/aliyun-oss-client.js +5 -0
  132. package/server/dist/utils/oss.util.js +6 -1
  133. package/server/dist/utils/theme-placeholder-cover.js +94 -0
  134. package/server/dist/utils/uniqueid.util.js +1 -1
  135. package/server/dist/utils/upload.util.js +23 -8
  136. package/server/dist/utils/user.util.js +6 -2
  137. package/server/package-lock.json +21077 -0
  138. package/server/package.json +13 -10
  139. package/server/public/favicon.png +0 -0
  140. package/templates/config.local.json +1 -1
  141. package/templates/env.local.default +1 -1
  142. package/toolkit/dist/.source-fingerprint-toolkit +1 -0
  143. package/toolkit/dist/admin/index.js +18 -0
  144. package/toolkit/dist/admin/permissions.js +33 -0
  145. package/toolkit/dist/admin/registry.js +79 -0
  146. package/toolkit/dist/api/Article.js +188 -0
  147. package/toolkit/dist/api/Auth.js +58 -0
  148. package/toolkit/dist/api/Category.js +84 -0
  149. package/toolkit/dist/api/Comment.js +97 -0
  150. package/toolkit/dist/api/File.js +71 -0
  151. package/toolkit/dist/api/HttpClient.js +96 -0
  152. package/toolkit/dist/api/Knowledge.js +123 -0
  153. package/toolkit/dist/api/Page.js +97 -0
  154. package/toolkit/dist/api/Search.js +58 -0
  155. package/toolkit/dist/api/Setting.js +45 -0
  156. package/toolkit/dist/api/Smtp.js +73 -0
  157. package/toolkit/dist/api/Tag.js +97 -0
  158. package/toolkit/dist/api/User.js +72 -0
  159. package/toolkit/dist/api/View.js +84 -0
  160. package/toolkit/dist/api/index.js +30 -0
  161. package/toolkit/dist/api/instance.js +71 -0
  162. package/toolkit/dist/app/createReactPressApp.js +265 -0
  163. package/toolkit/dist/app/createThemeApp.js +51 -0
  164. package/toolkit/dist/app/devChunkRecovery.js +68 -0
  165. package/toolkit/dist/app/index.js +11 -0
  166. package/toolkit/dist/config/env.js +103 -0
  167. package/toolkit/dist/config/global.js +396 -0
  168. package/toolkit/dist/config/i18n.js +59 -0
  169. package/toolkit/dist/config/index.js +26 -0
  170. package/toolkit/dist/config/locales/en.json +125 -0
  171. package/toolkit/dist/config/locales/zh.json +125 -0
  172. package/toolkit/dist/dev/index.js +12 -0
  173. package/toolkit/dist/dev/portRedirect.js +93 -0
  174. package/toolkit/dist/dev/vitePortRedirectPlugin.js +40 -0
  175. package/toolkit/dist/extension/branding-mods.js +65 -0
  176. package/toolkit/dist/extension/configuration/defaults.js +32 -0
  177. package/toolkit/dist/extension/configuration/formily.js +170 -0
  178. package/toolkit/dist/extension/configuration/index.js +28 -0
  179. package/toolkit/dist/extension/configuration/paths.js +50 -0
  180. package/toolkit/dist/extension/configuration/presets/twentytwentyfive.js +94 -0
  181. package/toolkit/dist/extension/configuration/resolve.js +98 -0
  182. package/toolkit/dist/extension/configuration/types.js +3 -0
  183. package/toolkit/dist/extension/configuration/validate.js +21 -0
  184. package/toolkit/dist/extension/index.js +35 -0
  185. package/toolkit/dist/extension/manifest-normalize.js +75 -0
  186. package/toolkit/dist/extension/node.js +6 -0
  187. package/toolkit/dist/extension/presets/twentytwentyfive-appearance.js +193 -0
  188. package/toolkit/dist/extension/presets/twentytwentyfive-customizer.js +199 -0
  189. package/toolkit/dist/extension/preview.js +92 -0
  190. package/toolkit/dist/extension/site-notices.js +88 -0
  191. package/toolkit/dist/extension/site-settings.js +144 -0
  192. package/toolkit/dist/extension/theme-admin-locale.io.js +54 -0
  193. package/toolkit/dist/extension/theme-admin-locale.js +81 -0
  194. package/toolkit/dist/extension/theme.js +93 -0
  195. package/toolkit/dist/extension/twentytwentyfive-vars.js +100 -0
  196. package/toolkit/dist/index.js +60 -0
  197. package/toolkit/dist/plugin/admin/index.js +20 -0
  198. package/toolkit/dist/plugin/admin/permissions.js +33 -0
  199. package/toolkit/dist/plugin/admin/plugin-admin.js +41 -0
  200. package/toolkit/dist/plugin/admin/registry.js +79 -0
  201. package/toolkit/dist/plugin/admin/slots.js +16 -0
  202. package/toolkit/dist/plugin/client/client.js +95 -0
  203. package/toolkit/dist/plugin/client/index.js +11 -0
  204. package/toolkit/dist/plugin/client/runtime.js +30 -0
  205. package/toolkit/dist/plugin/dev/index.js +16 -0
  206. package/toolkit/dist/plugin/dev/portRedirect.js +111 -0
  207. package/toolkit/dist/plugin/dev/vitePortRedirectPlugin.js +40 -0
  208. package/toolkit/dist/plugin/extension/index.js +20 -0
  209. package/toolkit/dist/plugin/extension/plugin-admin-locale.io.js +54 -0
  210. package/toolkit/dist/plugin/extension/plugin-admin-locale.js +60 -0
  211. package/toolkit/dist/plugin/extension/plugin.js +146 -0
  212. package/toolkit/dist/plugin/extension/security.js +74 -0
  213. package/toolkit/dist/plugin/extension/validate.js +55 -0
  214. package/toolkit/dist/plugin/index.js +52 -0
  215. package/toolkit/dist/plugin/node.js +6 -0
  216. package/toolkit/dist/plugin/react/client.js +95 -0
  217. package/toolkit/dist/plugin/react/index.js +19 -0
  218. package/toolkit/dist/plugin/react/plugin-admin-ui.js +38 -0
  219. package/toolkit/dist/plugin/react/runtime.js +30 -0
  220. package/toolkit/dist/plugin/server/hook-reject.js +39 -0
  221. package/toolkit/dist/plugin/server/index.js +18 -0
  222. package/toolkit/dist/plugin/server/types.js +3 -0
  223. package/toolkit/dist/primitives/AntdStyleTransitionFix.js +16 -0
  224. package/toolkit/dist/primitives/Badge.js +9 -0
  225. package/toolkit/dist/primitives/Button.js +38 -0
  226. package/toolkit/dist/primitives/ColorModeToggle.js +13 -0
  227. package/toolkit/dist/primitives/IconButton.js +13 -0
  228. package/toolkit/dist/primitives/ScrollToTarget.js +48 -0
  229. package/toolkit/dist/primitives/Separator.js +9 -0
  230. package/toolkit/dist/primitives/Skeleton.js +9 -0
  231. package/toolkit/dist/primitives/Slot.js +25 -0
  232. package/toolkit/dist/primitives/Spinner.js +9 -0
  233. package/toolkit/dist/primitives/animation/ConditionTransition.js +13 -0
  234. package/toolkit/dist/primitives/animation/ListTrail.js +14 -0
  235. package/toolkit/dist/primitives/animation/Opacity.js +10 -0
  236. package/toolkit/dist/primitives/animation/Spring.js +29 -0
  237. package/toolkit/dist/primitives/animation/index.js +11 -0
  238. package/toolkit/dist/primitives/cn.js +7 -0
  239. package/toolkit/dist/primitives/icons.js +15 -0
  240. package/toolkit/dist/primitives/index.js +44 -0
  241. package/toolkit/dist/react/client.js +95 -0
  242. package/toolkit/dist/react/index.js +11 -0
  243. package/toolkit/dist/react/runtime.js +30 -0
  244. package/toolkit/dist/theme/antdDocument.js +59 -0
  245. package/toolkit/dist/theme/api/api-data.js +8 -0
  246. package/toolkit/dist/theme/api/api.js +27 -0
  247. package/toolkit/dist/theme/api/httpClient.js +83 -0
  248. package/toolkit/dist/theme/api/json.js +5 -0
  249. package/toolkit/dist/theme/api/jsonp.js +5 -0
  250. package/toolkit/dist/theme/api-data.js +22 -0
  251. package/toolkit/dist/theme/api.js +27 -0
  252. package/toolkit/dist/theme/appearance.js +16 -0
  253. package/toolkit/dist/theme/assets.js +27 -0
  254. package/toolkit/dist/theme/authSession.js +92 -0
  255. package/toolkit/dist/theme/build/antdDocument.js +70 -0
  256. package/toolkit/dist/theme/build/next-config.js +63 -0
  257. package/toolkit/dist/theme/build/node.js +6 -0
  258. package/toolkit/dist/theme/colorMode.js +45 -0
  259. package/toolkit/dist/theme/commentAuthor.js +48 -0
  260. package/toolkit/dist/theme/content/archiveSlim.js +38 -0
  261. package/toolkit/dist/theme/content/articleSlim.js +35 -0
  262. package/toolkit/dist/theme/content/assets.js +106 -0
  263. package/toolkit/dist/theme/content/carouselArticles.js +39 -0
  264. package/toolkit/dist/theme/content/excerpt.js +42 -0
  265. package/toolkit/dist/theme/content/nav.js +30 -0
  266. package/toolkit/dist/theme/content/seo.js +12 -0
  267. package/toolkit/dist/theme/createAntdApp.js +175 -0
  268. package/toolkit/dist/theme/createApp.js +141 -0
  269. package/toolkit/dist/theme/createCatalogApp.js +168 -0
  270. package/toolkit/dist/theme/customizer.js +5 -0
  271. package/toolkit/dist/theme/excerpt.js +31 -0
  272. package/toolkit/dist/theme/extension/branding-mods.js +65 -0
  273. package/toolkit/dist/theme/extension/configuration/defaults.js +32 -0
  274. package/toolkit/dist/theme/extension/configuration/formily.js +170 -0
  275. package/toolkit/dist/theme/extension/configuration/index.js +28 -0
  276. package/toolkit/dist/theme/extension/configuration/paths.js +7 -0
  277. package/toolkit/dist/theme/extension/configuration/presets/twentytwentyfive.js +94 -0
  278. package/toolkit/dist/theme/extension/configuration/resolve.js +98 -0
  279. package/toolkit/dist/theme/extension/configuration/types.js +3 -0
  280. package/toolkit/dist/theme/extension/configuration/validate.js +21 -0
  281. package/toolkit/dist/theme/extension/index.js +38 -0
  282. package/toolkit/dist/theme/extension/manifest-normalize.js +75 -0
  283. package/toolkit/dist/theme/extension/presets/twentytwentyfive-appearance.js +193 -0
  284. package/toolkit/dist/theme/extension/preview.js +92 -0
  285. package/toolkit/dist/theme/extension/site-notices.js +88 -0
  286. package/toolkit/dist/theme/extension/site-settings.js +144 -0
  287. package/toolkit/dist/theme/extension/siteNav.js +17 -0
  288. package/toolkit/dist/theme/extension/theme-admin-locale.io.js +54 -0
  289. package/toolkit/dist/theme/extension/theme-admin-locale.js +68 -0
  290. package/toolkit/dist/theme/extension/theme.js +93 -0
  291. package/toolkit/dist/theme/extension/twentytwentyfive-vars.js +103 -0
  292. package/toolkit/dist/theme/fetch.js +241 -0
  293. package/toolkit/dist/theme/format.js +48 -0
  294. package/toolkit/dist/theme/httpClient.js +89 -0
  295. package/toolkit/dist/theme/index.js +226 -0
  296. package/toolkit/dist/theme/json.js +17 -0
  297. package/toolkit/dist/theme/jsonp.js +27 -0
  298. package/toolkit/dist/theme/locale.js +55 -0
  299. package/toolkit/dist/theme/nav.js +30 -0
  300. package/toolkit/dist/theme/next-config.js +18 -0
  301. package/toolkit/dist/theme/node.js +18 -0
  302. package/toolkit/dist/theme/preview/preview-config.js +65 -0
  303. package/toolkit/dist/theme/preview/preview-draft.js +51 -0
  304. package/toolkit/dist/theme/preview/preview-mods.js +78 -0
  305. package/toolkit/dist/theme/preview-config.js +65 -0
  306. package/toolkit/dist/theme/preview-draft.js +51 -0
  307. package/toolkit/dist/theme/preview-mods.js +78 -0
  308. package/toolkit/dist/theme/providers/index.js +251 -0
  309. package/toolkit/dist/theme/providers/setup.js +29 -0
  310. package/toolkit/dist/theme/runtime.js +19 -0
  311. package/toolkit/dist/theme/seo.js +12 -0
  312. package/toolkit/dist/theme/server.js +177 -0
  313. package/toolkit/dist/theme/setting.js +42 -0
  314. package/toolkit/dist/theme/ssr/bootstrap.js +112 -0
  315. package/toolkit/dist/theme/ssr/fetch.js +264 -0
  316. package/toolkit/dist/theme/ssr/format.js +8 -0
  317. package/toolkit/dist/theme/ssr/pageProps.js +155 -0
  318. package/toolkit/dist/theme/ssr/setting.js +45 -0
  319. package/toolkit/dist/theme/ssr/slimBootstrap.js +75 -0
  320. package/toolkit/dist/theme/ssr/static.js +17 -0
  321. package/toolkit/dist/theme/ssr/templates.js +50 -0
  322. package/toolkit/dist/theme/static.js +17 -0
  323. package/toolkit/dist/theme/templates.js +38 -0
  324. package/toolkit/dist/theme/ui-optional.js +21 -0
  325. package/toolkit/dist/theme/visitor/appearance.js +16 -0
  326. package/toolkit/dist/theme/visitor/authSession.js +92 -0
  327. package/toolkit/dist/theme/visitor/colorMode.js +59 -0
  328. package/toolkit/dist/theme/visitor/commentAuthor.js +45 -0
  329. package/toolkit/dist/theme/visitor/i18n.js +28 -0
  330. package/toolkit/dist/theme/visitor/locale.js +72 -0
  331. package/toolkit/dist/theme/visitor/runtime.js +19 -0
  332. package/toolkit/dist/theme/visitor/visitorLocale.js +56 -0
  333. package/toolkit/dist/theme/visitorLocale.js +39 -0
  334. package/toolkit/dist/types/index.js +12 -0
  335. package/toolkit/dist/ui/AntdStyleTransitionFix.js +16 -0
  336. package/toolkit/dist/ui/ArchiveEmptyState.js +8 -0
  337. package/toolkit/dist/ui/ArchivePageLayout.js +8 -0
  338. package/toolkit/dist/ui/ArticleCard.js +16 -0
  339. package/toolkit/dist/ui/ArticleList.js +16 -0
  340. package/toolkit/dist/ui/BaseGlobalStyles.js +18 -0
  341. package/toolkit/dist/ui/LocaleSwitcher.js +15 -0
  342. package/toolkit/dist/ui/NavMenu.js +8 -0
  343. package/toolkit/dist/ui/NotFoundPanel.js +8 -0
  344. package/toolkit/dist/ui/PageHeader.js +8 -0
  345. package/toolkit/dist/ui/SiteBranding.js +14 -0
  346. package/toolkit/dist/ui/SiteDocument.js +13 -0
  347. package/toolkit/dist/ui/SiteDocumentFallback.js +9 -0
  348. package/toolkit/dist/ui/SiteLogo.js +16 -0
  349. package/toolkit/dist/ui/SiteTagline.js +15 -0
  350. package/toolkit/dist/ui/TaxonomyList.js +30 -0
  351. package/toolkit/dist/ui/ThemeCssVars.js +85 -0
  352. package/toolkit/dist/ui/ThemeLayout.js +11 -0
  353. package/toolkit/dist/ui/components/AntdStyleTransitionFix.js +16 -0
  354. package/toolkit/dist/ui/components/ArchiveEmptyState.js +8 -0
  355. package/toolkit/dist/ui/components/ArchivePageLayout.js +8 -0
  356. package/toolkit/dist/ui/components/ArticleCard.js +16 -0
  357. package/toolkit/dist/ui/components/ArticleList.js +16 -0
  358. package/toolkit/dist/ui/components/BaseGlobalStyles.js +18 -0
  359. package/toolkit/dist/ui/components/LocaleSwitcher.js +11 -0
  360. package/toolkit/dist/ui/components/NavMenu.js +8 -0
  361. package/toolkit/dist/ui/components/NotFoundPanel.js +8 -0
  362. package/toolkit/dist/ui/components/PageHeader.js +8 -0
  363. package/toolkit/dist/ui/components/RouteProgress.js +40 -0
  364. package/toolkit/dist/ui/components/SiteAnalytics.js +42 -0
  365. package/toolkit/dist/ui/components/SiteBranding.js +14 -0
  366. package/toolkit/dist/ui/components/SiteDocument.js +13 -0
  367. package/toolkit/dist/ui/components/SiteDocumentFallback.js +9 -0
  368. package/toolkit/dist/ui/components/SiteLogo.js +23 -0
  369. package/toolkit/dist/ui/components/SiteSeo.js +19 -0
  370. package/toolkit/dist/ui/components/SiteTagline.js +15 -0
  371. package/toolkit/dist/ui/components/TaxonomyList.js +30 -0
  372. package/toolkit/dist/ui/components/ThemeCssVars.js +85 -0
  373. package/toolkit/dist/ui/components/ThemeLayout.js +11 -0
  374. package/toolkit/dist/ui/components/content/ArticleReader.js +23 -0
  375. package/toolkit/dist/ui/components/content/ArticleToc.js +75 -0
  376. package/toolkit/dist/ui/components/content/HtmlContent.js +237 -0
  377. package/toolkit/dist/ui/components/content/Image.js +13 -0
  378. package/toolkit/dist/ui/components/content/ImageViewer.js +33 -0
  379. package/toolkit/dist/ui/components/content/LocaleTime.js +63 -0
  380. package/toolkit/dist/ui/components/content/index.js +18 -0
  381. package/toolkit/dist/ui/components/toolbar/LocaleToggleButton.js +18 -0
  382. package/toolkit/dist/ui/components/toolbar/ThemeToggleButton.js +10 -0
  383. package/toolkit/dist/ui/components/toolbar/ToolbarIconButton.js +22 -0
  384. package/toolkit/dist/ui/components/toolbar/constants.js +8 -0
  385. package/toolkit/dist/ui/components/toolbar/icons.js +44 -0
  386. package/toolkit/dist/ui/components/toolbar/index.js +25 -0
  387. package/toolkit/dist/ui/components/toolbar/locale-label.js +19 -0
  388. package/toolkit/dist/ui/context/LocaleContext.js +59 -0
  389. package/toolkit/dist/ui/context/ReactPressProvider.js +10 -0
  390. package/toolkit/dist/ui/context/SiteCatalogContext.js +60 -0
  391. package/toolkit/dist/ui/context/ThemeRuntimeContext.js +59 -0
  392. package/toolkit/dist/ui/context/index.js +26 -0
  393. package/toolkit/dist/ui/context/siteCatalogTypes.js +20 -0
  394. package/toolkit/dist/ui/context/types.js +2 -0
  395. package/toolkit/dist/ui/hooks/index.js +29 -0
  396. package/toolkit/dist/ui/hooks/useAsyncLoading.js +31 -0
  397. package/toolkit/dist/ui/hooks/useForceUpdate.js +11 -0
  398. package/toolkit/dist/ui/hooks/useNavActive.js +11 -0
  399. package/toolkit/dist/ui/hooks/usePagination.js +55 -0
  400. package/toolkit/dist/ui/hooks/useReportArticleView.js +40 -0
  401. package/toolkit/dist/ui/hooks/useReportPageView.js +28 -0
  402. package/toolkit/dist/ui/hooks/useRouteParam.js +15 -0
  403. package/toolkit/dist/ui/hooks/useToggle.js +17 -0
  404. package/toolkit/dist/ui/hooks/useWarningOnExit.js +59 -0
  405. package/toolkit/dist/ui/index.js +87 -0
  406. package/toolkit/dist/utils/api-envelope.js +31 -0
  407. package/toolkit/dist/utils/clipboard.js +24 -0
  408. package/toolkit/dist/utils/cookie.js +15 -0
  409. package/toolkit/dist/utils/date.js +45 -0
  410. package/toolkit/dist/utils/email.js +9 -0
  411. package/toolkit/dist/utils/error.js +26 -0
  412. package/toolkit/dist/utils/image.js +34 -0
  413. package/toolkit/dist/utils/index.js +39 -0
  414. package/toolkit/dist/utils/json.js +18 -0
  415. package/toolkit/dist/utils/jsonp.js +27 -0
  416. package/toolkit/dist/utils/object.js +63 -0
  417. package/toolkit/dist/utils/setting.js +13 -0
  418. package/toolkit/dist/utils/string.js +15 -0
  419. package/toolkit/dist/utils/viewport.js +14 -0
  420. package/toolkit/package-lock.json +452 -0
  421. package/toolkit/package.json +96 -0
  422. package/dist/cli.d.ts +0 -4
  423. package/dist/cli.d.ts.map +0 -1
  424. package/dist/cli.js.map +0 -1
  425. package/dist/commands/config.d.ts +0 -8
  426. package/dist/commands/config.d.ts.map +0 -1
  427. package/dist/commands/config.js.map +0 -1
  428. package/dist/commands/init.d.ts +0 -6
  429. package/dist/commands/init.d.ts.map +0 -1
  430. package/dist/commands/init.js.map +0 -1
  431. package/dist/commands/restart.d.ts +0 -2
  432. package/dist/commands/restart.d.ts.map +0 -1
  433. package/dist/commands/restart.js.map +0 -1
  434. package/dist/commands/start.d.ts +0 -2
  435. package/dist/commands/start.d.ts.map +0 -1
  436. package/dist/commands/start.js.map +0 -1
  437. package/dist/commands/status.d.ts +0 -2
  438. package/dist/commands/status.d.ts.map +0 -1
  439. package/dist/commands/status.js.map +0 -1
  440. package/dist/commands/stop.d.ts +0 -5
  441. package/dist/commands/stop.d.ts.map +0 -1
  442. package/dist/commands/stop.js.map +0 -1
  443. package/dist/index.d.ts +0 -3
  444. package/dist/index.d.ts.map +0 -1
  445. package/dist/index.js.map +0 -1
  446. package/dist/services/config.d.ts +0 -11
  447. package/dist/services/config.d.ts.map +0 -1
  448. package/dist/services/config.js.map +0 -1
  449. package/dist/services/database.d.ts +0 -43
  450. package/dist/services/database.d.ts.map +0 -1
  451. package/dist/services/database.js.map +0 -1
  452. package/dist/services/exec.d.ts +0 -22
  453. package/dist/services/exec.d.ts.map +0 -1
  454. package/dist/services/exec.js.map +0 -1
  455. package/dist/services/init.d.ts +0 -10
  456. package/dist/services/init.d.ts.map +0 -1
  457. package/dist/services/init.js.map +0 -1
  458. package/dist/services/process.d.ts +0 -9
  459. package/dist/services/process.d.ts.map +0 -1
  460. package/dist/services/process.js.map +0 -1
  461. package/dist/services/server-health.d.ts +0 -4
  462. package/dist/services/server-health.d.ts.map +0 -1
  463. package/dist/services/server-health.js.map +0 -1
  464. package/dist/services/server.d.ts +0 -19
  465. package/dist/services/server.d.ts.map +0 -1
  466. package/dist/services/server.js.map +0 -1
  467. package/dist/types/config.d.ts +0 -30
  468. package/dist/types/config.d.ts.map +0 -1
  469. package/dist/types/config.js.map +0 -1
  470. package/dist/utils/cli-context.d.ts +0 -4
  471. package/dist/utils/cli-context.d.ts.map +0 -1
  472. package/dist/utils/cli-context.js.map +0 -1
  473. package/dist/utils/logger.d.ts +0 -10
  474. package/dist/utils/logger.d.ts.map +0 -1
  475. package/dist/utils/logger.js.map +0 -1
  476. package/dist/utils/paths.d.ts +0 -17
  477. package/dist/utils/paths.d.ts.map +0 -1
  478. package/dist/utils/paths.js.map +0 -1
  479. package/dist/utils/platform.d.ts +0 -8
  480. package/dist/utils/platform.d.ts.map +0 -1
  481. package/dist/utils/platform.js.map +0 -1
  482. package/dist/utils/port.d.ts +0 -5
  483. package/dist/utils/port.d.ts.map +0 -1
  484. package/dist/utils/port.js.map +0 -1
  485. package/dist/utils/server-bundle.d.ts +0 -11
  486. package/dist/utils/server-bundle.d.ts.map +0 -1
  487. package/dist/utils/server-bundle.js.map +0 -1
  488. package/out/bin/reactpress-cli-shim.d.ts +0 -3
  489. package/out/bin/reactpress-cli-shim.d.ts.map +0 -1
  490. package/out/bin/reactpress-cli-shim.js.map +0 -1
  491. package/out/bin/reactpress-theme-client.d.ts +0 -3
  492. package/out/bin/reactpress-theme-client.d.ts.map +0 -1
  493. package/out/bin/reactpress-theme-client.js.map +0 -1
  494. package/out/bin/reactpress.d.ts +0 -3
  495. package/out/bin/reactpress.d.ts.map +0 -1
  496. package/out/bin/reactpress.js.map +0 -1
  497. package/out/core/services/config.d.ts +0 -12
  498. package/out/core/services/config.d.ts.map +0 -1
  499. package/out/core/services/config.js.map +0 -1
  500. package/out/core/services/database/index.d.ts +0 -17
  501. package/out/core/services/database/index.d.ts.map +0 -1
  502. package/out/core/services/database/index.js.map +0 -1
  503. package/out/core/services/database/mysql.d.ts +0 -14
  504. package/out/core/services/database/mysql.d.ts.map +0 -1
  505. package/out/core/services/database/mysql.js.map +0 -1
  506. package/out/core/services/database/profile.d.ts +0 -6
  507. package/out/core/services/database/profile.d.ts.map +0 -1
  508. package/out/core/services/database/profile.js.map +0 -1
  509. package/out/core/services/database/sqlite.d.ts +0 -10
  510. package/out/core/services/database/sqlite.d.ts.map +0 -1
  511. package/out/core/services/database/sqlite.js.map +0 -1
  512. package/out/core/services/exec.d.ts +0 -21
  513. package/out/core/services/exec.d.ts.map +0 -1
  514. package/out/core/services/exec.js.map +0 -1
  515. package/out/core/services/init.d.ts +0 -11
  516. package/out/core/services/init.d.ts.map +0 -1
  517. package/out/core/services/init.js.map +0 -1
  518. package/out/core/services/local-site.d.ts +0 -24
  519. package/out/core/services/local-site.d.ts.map +0 -1
  520. package/out/core/services/local-site.js.map +0 -1
  521. package/out/core/utils/cli-context.d.ts +0 -3
  522. package/out/core/utils/cli-context.d.ts.map +0 -1
  523. package/out/core/utils/cli-context.js.map +0 -1
  524. package/out/core/utils/paths.d.ts +0 -20
  525. package/out/core/utils/paths.d.ts.map +0 -1
  526. package/out/core/utils/paths.js.map +0 -1
  527. package/out/core/utils/platform.d.ts +0 -7
  528. package/out/core/utils/platform.d.ts.map +0 -1
  529. package/out/core/utils/platform.js.map +0 -1
  530. package/out/core/utils/port.d.ts +0 -4
  531. package/out/core/utils/port.d.ts.map +0 -1
  532. package/out/core/utils/port.js.map +0 -1
  533. package/out/lib/api-dev-runner.d.ts +0 -3
  534. package/out/lib/api-dev-runner.d.ts.map +0 -1
  535. package/out/lib/api-dev-runner.js.map +0 -1
  536. package/out/lib/api-dev.d.ts +0 -2
  537. package/out/lib/api-dev.d.ts.map +0 -1
  538. package/out/lib/api-dev.js.map +0 -1
  539. package/out/lib/bootstrap.d.ts +0 -18
  540. package/out/lib/bootstrap.d.ts.map +0 -1
  541. package/out/lib/bootstrap.js.map +0 -1
  542. package/out/lib/build.d.ts +0 -2
  543. package/out/lib/build.d.ts.map +0 -1
  544. package/out/lib/build.js.map +0 -1
  545. package/out/lib/db-backup.d.ts +0 -2
  546. package/out/lib/db-backup.d.ts.map +0 -1
  547. package/out/lib/db-backup.js.map +0 -1
  548. package/out/lib/dev-banner.d.ts +0 -2
  549. package/out/lib/dev-banner.d.ts.map +0 -1
  550. package/out/lib/dev-banner.js.map +0 -1
  551. package/out/lib/dev-child-io.d.ts +0 -2
  552. package/out/lib/dev-child-io.d.ts.map +0 -1
  553. package/out/lib/dev-child-io.js.map +0 -1
  554. package/out/lib/dev-log.d.ts +0 -2
  555. package/out/lib/dev-log.d.ts.map +0 -1
  556. package/out/lib/dev-log.js.map +0 -1
  557. package/out/lib/dev-session.d.ts +0 -2
  558. package/out/lib/dev-session.d.ts.map +0 -1
  559. package/out/lib/dev-session.js.map +0 -1
  560. package/out/lib/dev.d.ts +0 -2
  561. package/out/lib/dev.d.ts.map +0 -1
  562. package/out/lib/dev.js.map +0 -1
  563. package/out/lib/docker.d.ts +0 -2
  564. package/out/lib/docker.d.ts.map +0 -1
  565. package/out/lib/docker.js.map +0 -1
  566. package/out/lib/doctor.d.ts +0 -2
  567. package/out/lib/doctor.d.ts.map +0 -1
  568. package/out/lib/doctor.js.map +0 -1
  569. package/out/lib/health-parse.d.ts +0 -5
  570. package/out/lib/health-parse.d.ts.map +0 -1
  571. package/out/lib/health-parse.js.map +0 -1
  572. package/out/lib/health-parse.test.d.ts +0 -2
  573. package/out/lib/health-parse.test.d.ts.map +0 -1
  574. package/out/lib/health-parse.test.js.map +0 -1
  575. package/out/lib/http.d.ts +0 -2
  576. package/out/lib/http.d.ts.map +0 -1
  577. package/out/lib/http.js.map +0 -1
  578. package/out/lib/i18n/index.d.ts +0 -2
  579. package/out/lib/i18n/index.d.ts.map +0 -1
  580. package/out/lib/i18n/index.js.map +0 -1
  581. package/out/lib/i18n/strings.d.ts +0 -2
  582. package/out/lib/i18n/strings.d.ts.map +0 -1
  583. package/out/lib/i18n/strings.js.map +0 -1
  584. package/out/lib/lifecycle.d.ts +0 -2
  585. package/out/lib/lifecycle.d.ts.map +0 -1
  586. package/out/lib/lifecycle.js.map +0 -1
  587. package/out/lib/nginx.d.ts +0 -2
  588. package/out/lib/nginx.d.ts.map +0 -1
  589. package/out/lib/nginx.js.map +0 -1
  590. package/out/lib/paths.d.ts +0 -2
  591. package/out/lib/paths.d.ts.map +0 -1
  592. package/out/lib/paths.js.map +0 -1
  593. package/out/lib/plugin-build.d.ts +0 -2
  594. package/out/lib/plugin-build.d.ts.map +0 -1
  595. package/out/lib/plugin-build.js.map +0 -1
  596. package/out/lib/plugin-cli.d.ts +0 -2
  597. package/out/lib/plugin-cli.d.ts.map +0 -1
  598. package/out/lib/plugin-cli.js.map +0 -1
  599. package/out/lib/pm2.d.ts +0 -2
  600. package/out/lib/pm2.d.ts.map +0 -1
  601. package/out/lib/pm2.js.map +0 -1
  602. package/out/lib/ports.d.ts +0 -2
  603. package/out/lib/ports.d.ts.map +0 -1
  604. package/out/lib/ports.js.map +0 -1
  605. package/out/lib/process.d.ts +0 -2
  606. package/out/lib/process.d.ts.map +0 -1
  607. package/out/lib/process.js.map +0 -1
  608. package/out/lib/prod-memory.d.ts +0 -6
  609. package/out/lib/prod-memory.d.ts.map +0 -1
  610. package/out/lib/prod-memory.js.map +0 -1
  611. package/out/lib/project-type.d.ts +0 -2
  612. package/out/lib/project-type.d.ts.map +0 -1
  613. package/out/lib/project-type.js.map +0 -1
  614. package/out/lib/publish.d.ts +0 -3
  615. package/out/lib/publish.d.ts.map +0 -1
  616. package/out/lib/publish.js.map +0 -1
  617. package/out/lib/remote-dev.d.ts +0 -2
  618. package/out/lib/remote-dev.d.ts.map +0 -1
  619. package/out/lib/remote-dev.js.map +0 -1
  620. package/out/lib/root.d.ts +0 -2
  621. package/out/lib/root.d.ts.map +0 -1
  622. package/out/lib/root.js.map +0 -1
  623. package/out/lib/spawn.d.ts +0 -2
  624. package/out/lib/spawn.d.ts.map +0 -1
  625. package/out/lib/spawn.js.map +0 -1
  626. package/out/lib/status.d.ts +0 -2
  627. package/out/lib/status.d.ts.map +0 -1
  628. package/out/lib/status.js.map +0 -1
  629. package/out/lib/theme-catalog.d.ts +0 -2
  630. package/out/lib/theme-catalog.d.ts.map +0 -1
  631. package/out/lib/theme-catalog.js.map +0 -1
  632. package/out/lib/theme-cli.d.ts +0 -2
  633. package/out/lib/theme-cli.d.ts.map +0 -1
  634. package/out/lib/theme-cli.js.map +0 -1
  635. package/out/lib/theme-dev.d.ts +0 -2
  636. package/out/lib/theme-dev.d.ts.map +0 -1
  637. package/out/lib/theme-dev.js.map +0 -1
  638. package/out/lib/theme-env.d.ts +0 -2
  639. package/out/lib/theme-env.d.ts.map +0 -1
  640. package/out/lib/theme-env.js.map +0 -1
  641. package/out/lib/theme-install.d.ts +0 -2
  642. package/out/lib/theme-install.d.ts.map +0 -1
  643. package/out/lib/theme-install.js.map +0 -1
  644. package/out/lib/theme-lock.d.ts +0 -2
  645. package/out/lib/theme-lock.d.ts.map +0 -1
  646. package/out/lib/theme-lock.js.map +0 -1
  647. package/out/lib/theme-paths.d.ts +0 -2
  648. package/out/lib/theme-paths.d.ts.map +0 -1
  649. package/out/lib/theme-paths.js.map +0 -1
  650. package/out/lib/theme-placeholder-cover.d.ts +0 -13
  651. package/out/lib/theme-placeholder-cover.d.ts.map +0 -1
  652. package/out/lib/theme-placeholder-cover.js.map +0 -1
  653. package/out/lib/theme-preview-frame.d.ts +0 -2
  654. package/out/lib/theme-preview-frame.d.ts.map +0 -1
  655. package/out/lib/theme-preview-frame.js.map +0 -1
  656. package/out/lib/theme-preview-pool.d.ts +0 -2
  657. package/out/lib/theme-preview-pool.d.ts.map +0 -1
  658. package/out/lib/theme-preview-pool.js.map +0 -1
  659. package/out/lib/theme-preview-proxy.d.ts +0 -2
  660. package/out/lib/theme-preview-proxy.d.ts.map +0 -1
  661. package/out/lib/theme-preview-proxy.js.map +0 -1
  662. package/out/lib/theme-prod.d.ts +0 -2
  663. package/out/lib/theme-prod.d.ts.map +0 -1
  664. package/out/lib/theme-prod.js.map +0 -1
  665. package/out/lib/theme-registry.d.ts +0 -2
  666. package/out/lib/theme-registry.d.ts.map +0 -1
  667. package/out/lib/theme-registry.js.map +0 -1
  668. package/out/lib/theme-runtime.d.ts +0 -2
  669. package/out/lib/theme-runtime.d.ts.map +0 -1
  670. package/out/lib/theme-runtime.js.map +0 -1
  671. package/out/lib/theme-sources.d.ts +0 -2
  672. package/out/lib/theme-sources.d.ts.map +0 -1
  673. package/out/lib/theme-sources.js.map +0 -1
  674. package/out/lib/theme-warmup.d.ts +0 -2
  675. package/out/lib/theme-warmup.d.ts.map +0 -1
  676. package/out/lib/theme-warmup.js.map +0 -1
  677. package/out/lib/toolkit-build.d.ts +0 -2
  678. package/out/lib/toolkit-build.d.ts.map +0 -1
  679. package/out/lib/toolkit-build.js.map +0 -1
  680. package/out/types/config.d.ts +0 -57
  681. package/out/types/config.d.ts.map +0 -1
  682. package/out/types/config.js.map +0 -1
  683. package/out/ui/banner.d.ts +0 -2
  684. package/out/ui/banner.d.ts.map +0 -1
  685. package/out/ui/banner.js.map +0 -1
  686. package/out/ui/interactive.d.ts +0 -2
  687. package/out/ui/interactive.d.ts.map +0 -1
  688. package/out/ui/interactive.js.map +0 -1
  689. package/out/ui/theme.d.ts +0 -2
  690. package/out/ui/theme.d.ts.map +0 -1
  691. package/out/ui/theme.js.map +0 -1
  692. package/server/dist/app.module.d.ts +0 -2
  693. package/server/dist/app.module.js.map +0 -1
  694. package/server/dist/common/api-messages.d.ts +0 -41
  695. package/server/dist/common/api-messages.js.map +0 -1
  696. package/server/dist/database/typeorm-options.d.ts +0 -3
  697. package/server/dist/database/typeorm-options.js.map +0 -1
  698. package/server/dist/filters/http-exception.filter.d.ts +0 -4
  699. package/server/dist/filters/http-exception.filter.js.map +0 -1
  700. package/server/dist/generate-swagger.d.ts +0 -1
  701. package/server/dist/generate-swagger.js.map +0 -1
  702. package/server/dist/interceptors/transform.interceptor.d.ts +0 -9
  703. package/server/dist/interceptors/transform.interceptor.js.map +0 -1
  704. package/server/dist/logger/index.d.ts +0 -4
  705. package/server/dist/logger/index.js.map +0 -1
  706. package/server/dist/main.d.ts +0 -6
  707. package/server/dist/main.js.map +0 -1
  708. package/server/dist/modules/api-key/api-key.controller.d.ts +0 -14
  709. package/server/dist/modules/api-key/api-key.controller.js.map +0 -1
  710. package/server/dist/modules/api-key/api-key.entity.d.ts +0 -11
  711. package/server/dist/modules/api-key/api-key.entity.js.map +0 -1
  712. package/server/dist/modules/api-key/api-key.guard.d.ts +0 -7
  713. package/server/dist/modules/api-key/api-key.guard.js.map +0 -1
  714. package/server/dist/modules/api-key/api-key.module.d.ts +0 -2
  715. package/server/dist/modules/api-key/api-key.module.js.map +0 -1
  716. package/server/dist/modules/api-key/api-key.service.d.ts +0 -15
  717. package/server/dist/modules/api-key/api-key.service.js.map +0 -1
  718. package/server/dist/modules/article/article-revision.entity.d.ts +0 -11
  719. package/server/dist/modules/article/article-revision.entity.js.map +0 -1
  720. package/server/dist/modules/article/article-slug.util.d.ts +0 -2
  721. package/server/dist/modules/article/article-slug.util.js.map +0 -1
  722. package/server/dist/modules/article/article.controller.d.ts +0 -27
  723. package/server/dist/modules/article/article.controller.js.map +0 -1
  724. package/server/dist/modules/article/article.entity.d.ts +0 -23
  725. package/server/dist/modules/article/article.entity.js.map +0 -1
  726. package/server/dist/modules/article/article.module.d.ts +0 -2
  727. package/server/dist/modules/article/article.module.js.map +0 -1
  728. package/server/dist/modules/article/article.service.d.ts +0 -30
  729. package/server/dist/modules/article/article.service.js.map +0 -1
  730. package/server/dist/modules/article/article.util.d.ts +0 -1
  731. package/server/dist/modules/article/article.util.js.map +0 -1
  732. package/server/dist/modules/article/scheduled-publish.service.d.ts +0 -13
  733. package/server/dist/modules/article/scheduled-publish.service.js.map +0 -1
  734. package/server/dist/modules/auth/auth.controller.d.ts +0 -12
  735. package/server/dist/modules/auth/auth.controller.js.map +0 -1
  736. package/server/dist/modules/auth/auth.module.d.ts +0 -2
  737. package/server/dist/modules/auth/auth.module.js.map +0 -1
  738. package/server/dist/modules/auth/auth.service.d.ts +0 -26
  739. package/server/dist/modules/auth/auth.service.js.map +0 -1
  740. package/server/dist/modules/auth/jwt-auth.guard.d.ts +0 -7
  741. package/server/dist/modules/auth/jwt-auth.guard.js.map +0 -1
  742. package/server/dist/modules/auth/jwt.strategy.d.ts +0 -9
  743. package/server/dist/modules/auth/jwt.strategy.js.map +0 -1
  744. package/server/dist/modules/auth/roles.guard.d.ts +0 -10
  745. package/server/dist/modules/auth/roles.guard.js.map +0 -1
  746. package/server/dist/modules/bootstrap/bootstrap.constants.d.ts +0 -20
  747. package/server/dist/modules/bootstrap/bootstrap.constants.js.map +0 -1
  748. package/server/dist/modules/bootstrap/bootstrap.service.d.ts +0 -22
  749. package/server/dist/modules/bootstrap/bootstrap.service.js.map +0 -1
  750. package/server/dist/modules/bootstrap/install-locale.d.ts +0 -2
  751. package/server/dist/modules/bootstrap/install-locale.js.map +0 -1
  752. package/server/dist/modules/category/category.controller.d.ts +0 -11
  753. package/server/dist/modules/category/category.controller.js.map +0 -1
  754. package/server/dist/modules/category/category.entity.d.ts +0 -9
  755. package/server/dist/modules/category/category.entity.js.map +0 -1
  756. package/server/dist/modules/category/category.module.d.ts +0 -2
  757. package/server/dist/modules/category/category.module.js.map +0 -1
  758. package/server/dist/modules/category/category.service.d.ts +0 -12
  759. package/server/dist/modules/category/category.service.js.map +0 -1
  760. package/server/dist/modules/comment/comment.controller.d.ts +0 -12
  761. package/server/dist/modules/comment/comment.controller.js.map +0 -1
  762. package/server/dist/modules/comment/comment.entity.d.ts +0 -17
  763. package/server/dist/modules/comment/comment.entity.js.map +0 -1
  764. package/server/dist/modules/comment/comment.module.d.ts +0 -2
  765. package/server/dist/modules/comment/comment.module.js.map +0 -1
  766. package/server/dist/modules/comment/comment.service.d.ts +0 -24
  767. package/server/dist/modules/comment/comment.service.js.map +0 -1
  768. package/server/dist/modules/comment/html.d.ts +0 -15
  769. package/server/dist/modules/comment/html.js.map +0 -1
  770. package/server/dist/modules/extension/extension.module.d.ts +0 -9
  771. package/server/dist/modules/extension/extension.module.js.map +0 -1
  772. package/server/dist/modules/extension/plugin-loader.service.d.ts +0 -12
  773. package/server/dist/modules/extension/plugin-loader.service.js.map +0 -1
  774. package/server/dist/modules/extension/plugin-registry.bridge.d.ts +0 -3
  775. package/server/dist/modules/extension/plugin-registry.bridge.js.map +0 -1
  776. package/server/dist/modules/extension/plugin.controller.d.ts +0 -22
  777. package/server/dist/modules/extension/plugin.controller.js.map +0 -1
  778. package/server/dist/modules/extension/plugin.service.d.ts +0 -52
  779. package/server/dist/modules/extension/plugin.service.js.map +0 -1
  780. package/server/dist/modules/extension/preview-draft.store.d.ts +0 -13
  781. package/server/dist/modules/extension/preview-draft.store.js.map +0 -1
  782. package/server/dist/modules/extension/theme-registry.bridge.d.ts +0 -56
  783. package/server/dist/modules/extension/theme-registry.bridge.js.map +0 -1
  784. package/server/dist/modules/extension/theme.controller.d.ts +0 -66
  785. package/server/dist/modules/extension/theme.controller.js.map +0 -1
  786. package/server/dist/modules/extension/theme.service.d.ts +0 -140
  787. package/server/dist/modules/extension/theme.service.js.map +0 -1
  788. package/server/dist/modules/file/file-optimization.controller.d.ts +0 -12
  789. package/server/dist/modules/file/file-optimization.controller.js.map +0 -1
  790. package/server/dist/modules/file/file-optimization.service.d.ts +0 -36
  791. package/server/dist/modules/file/file-optimization.service.js.map +0 -1
  792. package/server/dist/modules/file/file-optimization.types.d.ts +0 -66
  793. package/server/dist/modules/file/file-optimization.types.js.map +0 -1
  794. package/server/dist/modules/file/file.controller.d.ts +0 -10
  795. package/server/dist/modules/file/file.controller.js.map +0 -1
  796. package/server/dist/modules/file/file.entity.d.ts +0 -9
  797. package/server/dist/modules/file/file.entity.js.map +0 -1
  798. package/server/dist/modules/file/file.module.d.ts +0 -2
  799. package/server/dist/modules/file/file.module.js.map +0 -1
  800. package/server/dist/modules/file/file.service.d.ts +0 -17
  801. package/server/dist/modules/file/file.service.js.map +0 -1
  802. package/server/dist/modules/file/image-optimizer-plugin.guard.d.ts +0 -7
  803. package/server/dist/modules/file/image-optimizer-plugin.guard.js.map +0 -1
  804. package/server/dist/modules/health/health.controller.d.ts +0 -11
  805. package/server/dist/modules/health/health.controller.js.map +0 -1
  806. package/server/dist/modules/health/health.module.d.ts +0 -2
  807. package/server/dist/modules/health/health.module.js.map +0 -1
  808. package/server/dist/modules/hook/hook.module.d.ts +0 -2
  809. package/server/dist/modules/hook/hook.module.js.map +0 -1
  810. package/server/dist/modules/hook/hook.service.d.ts +0 -26
  811. package/server/dist/modules/hook/hook.service.js.map +0 -1
  812. package/server/dist/modules/install/install.controller.d.ts +0 -11
  813. package/server/dist/modules/install/install.controller.js.map +0 -1
  814. package/server/dist/modules/install/install.module.d.ts +0 -2
  815. package/server/dist/modules/install/install.module.js.map +0 -1
  816. package/server/dist/modules/install/install.service.d.ts +0 -12
  817. package/server/dist/modules/install/install.service.js.map +0 -1
  818. package/server/dist/modules/knowledge/knowledge.controller.d.ts +0 -14
  819. package/server/dist/modules/knowledge/knowledge.controller.js.map +0 -1
  820. package/server/dist/modules/knowledge/knowledge.entity.d.ts +0 -18
  821. package/server/dist/modules/knowledge/knowledge.entity.js.map +0 -1
  822. package/server/dist/modules/knowledge/knowledge.module.d.ts +0 -2
  823. package/server/dist/modules/knowledge/knowledge.module.js.map +0 -1
  824. package/server/dist/modules/knowledge/knowledge.service.d.ts +0 -14
  825. package/server/dist/modules/knowledge/knowledge.service.js.map +0 -1
  826. package/server/dist/modules/page/page.controller.d.ts +0 -12
  827. package/server/dist/modules/page/page.controller.js.map +0 -1
  828. package/server/dist/modules/page/page.entity.d.ts +0 -15
  829. package/server/dist/modules/page/page.entity.js.map +0 -1
  830. package/server/dist/modules/page/page.module.d.ts +0 -2
  831. package/server/dist/modules/page/page.module.js.map +0 -1
  832. package/server/dist/modules/page/page.service.d.ts +0 -12
  833. package/server/dist/modules/page/page.service.js.map +0 -1
  834. package/server/dist/modules/search/search.controller.d.ts +0 -8
  835. package/server/dist/modules/search/search.controller.js.map +0 -1
  836. package/server/dist/modules/search/search.entity.d.ts +0 -8
  837. package/server/dist/modules/search/search.entity.js.map +0 -1
  838. package/server/dist/modules/search/search.module.d.ts +0 -2
  839. package/server/dist/modules/search/search.module.js.map +0 -1
  840. package/server/dist/modules/search/search.service.d.ts +0 -12
  841. package/server/dist/modules/search/search.service.js.map +0 -1
  842. package/server/dist/modules/setting/setting.constant.d.ts +0 -3
  843. package/server/dist/modules/setting/setting.constant.js.map +0 -1
  844. package/server/dist/modules/setting/setting.controller.d.ts +0 -12
  845. package/server/dist/modules/setting/setting.controller.js.map +0 -1
  846. package/server/dist/modules/setting/setting.entity.d.ts +0 -26
  847. package/server/dist/modules/setting/setting.entity.js.map +0 -1
  848. package/server/dist/modules/setting/setting.module.d.ts +0 -2
  849. package/server/dist/modules/setting/setting.module.js.map +0 -1
  850. package/server/dist/modules/setting/setting.service.d.ts +0 -10
  851. package/server/dist/modules/setting/setting.service.js.map +0 -1
  852. package/server/dist/modules/smtp/mail.util.d.ts +0 -6
  853. package/server/dist/modules/smtp/mail.util.js.map +0 -1
  854. package/server/dist/modules/smtp/smtp.controller.d.ts +0 -9
  855. package/server/dist/modules/smtp/smtp.controller.js.map +0 -1
  856. package/server/dist/modules/smtp/smtp.entity.d.ts +0 -9
  857. package/server/dist/modules/smtp/smtp.entity.js.map +0 -1
  858. package/server/dist/modules/smtp/smtp.module.d.ts +0 -2
  859. package/server/dist/modules/smtp/smtp.module.js.map +0 -1
  860. package/server/dist/modules/smtp/smtp.service.d.ts +0 -11
  861. package/server/dist/modules/smtp/smtp.service.js.map +0 -1
  862. package/server/dist/modules/tag/tag.controller.d.ts +0 -12
  863. package/server/dist/modules/tag/tag.controller.js.map +0 -1
  864. package/server/dist/modules/tag/tag.entity.d.ts +0 -9
  865. package/server/dist/modules/tag/tag.entity.js.map +0 -1
  866. package/server/dist/modules/tag/tag.module.d.ts +0 -2
  867. package/server/dist/modules/tag/tag.module.js.map +0 -1
  868. package/server/dist/modules/tag/tag.service.d.ts +0 -13
  869. package/server/dist/modules/tag/tag.service.js.map +0 -1
  870. package/server/dist/modules/user/user.controller.d.ts +0 -13
  871. package/server/dist/modules/user/user.controller.js.map +0 -1
  872. package/server/dist/modules/user/user.entity.d.ts +0 -15
  873. package/server/dist/modules/user/user.entity.js.map +0 -1
  874. package/server/dist/modules/user/user.module.d.ts +0 -2
  875. package/server/dist/modules/user/user.module.js.map +0 -1
  876. package/server/dist/modules/user/user.service.d.ts +0 -16
  877. package/server/dist/modules/user/user.service.js.map +0 -1
  878. package/server/dist/modules/view/view.controller.d.ts +0 -11
  879. package/server/dist/modules/view/view.controller.js.map +0 -1
  880. package/server/dist/modules/view/view.entity.d.ts +0 -14
  881. package/server/dist/modules/view/view.entity.js.map +0 -1
  882. package/server/dist/modules/view/view.module.d.ts +0 -2
  883. package/server/dist/modules/view/view.module.js.map +0 -1
  884. package/server/dist/modules/view/view.service.d.ts +0 -11
  885. package/server/dist/modules/view/view.service.js.map +0 -1
  886. package/server/dist/modules/webhook/webhook.controller.d.ts +0 -12
  887. package/server/dist/modules/webhook/webhook.controller.js.map +0 -1
  888. package/server/dist/modules/webhook/webhook.entity.d.ts +0 -9
  889. package/server/dist/modules/webhook/webhook.entity.js.map +0 -1
  890. package/server/dist/modules/webhook/webhook.module.d.ts +0 -2
  891. package/server/dist/modules/webhook/webhook.module.js.map +0 -1
  892. package/server/dist/modules/webhook/webhook.service.d.ts +0 -16
  893. package/server/dist/modules/webhook/webhook.service.js.map +0 -1
  894. package/server/dist/public/apple-touch-icon.png +0 -0
  895. package/server/dist/public/favicon-16.png +0 -0
  896. package/server/dist/public/favicon-32.png +0 -0
  897. package/server/dist/public/favicon-48.png +0 -0
  898. package/server/dist/public/favicon.ico +0 -0
  899. package/server/dist/public/favicon.png +0 -0
  900. package/server/dist/public/icon-192.png +0 -0
  901. package/server/dist/public/icon-512.png +0 -0
  902. package/server/dist/public/index.html +0 -439
  903. package/server/dist/public/logo-200.png +0 -0
  904. package/server/dist/public/logo-400.png +0 -0
  905. package/server/dist/public/logo.png +0 -0
  906. package/server/dist/public/logo.svg +0 -7
  907. package/server/dist/public/swagger/custom.css +0 -11
  908. package/server/dist/public/uploads/2026-05-30/QR3X4UZQ93ZTUPGXCFA9II..png +0 -0
  909. package/server/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8.webp +0 -0
  910. package/server/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_medium.webp +0 -0
  911. package/server/dist/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_thumb.webp +0 -0
  912. package/server/dist/public/uploads/2026-05-31/I2SZC0ONA7CF31UM46MN56..jpg +0 -0
  913. package/server/dist/starter.d.ts +0 -1
  914. package/server/dist/starter.js.map +0 -1
  915. package/server/dist/tsconfig.build.tsbuildinfo +0 -16764
  916. package/server/dist/tsconfig.tsbuildinfo +0 -1
  917. package/server/dist/utils/date.util.d.ts +0 -1
  918. package/server/dist/utils/date.util.js.map +0 -1
  919. package/server/dist/utils/html-sanitize.util.d.ts +0 -1
  920. package/server/dist/utils/html-sanitize.util.js.map +0 -1
  921. package/server/dist/utils/image-processor.util.d.ts +0 -23
  922. package/server/dist/utils/image-processor.util.js.map +0 -1
  923. package/server/dist/utils/ip.util.d.ts +0 -2
  924. package/server/dist/utils/ip.util.js.map +0 -1
  925. package/server/dist/utils/local-api-quiet.util.d.ts +0 -1
  926. package/server/dist/utils/local-api-quiet.util.js.map +0 -1
  927. package/server/dist/utils/markdown.util.d.ts +0 -4
  928. package/server/dist/utils/markdown.util.js.map +0 -1
  929. package/server/dist/utils/oss/aliyun-oss-client.d.ts +0 -6
  930. package/server/dist/utils/oss/aliyun-oss-client.js.map +0 -1
  931. package/server/dist/utils/oss/oss-client.d.ts +0 -6
  932. package/server/dist/utils/oss/oss-client.js.map +0 -1
  933. package/server/dist/utils/oss.util.d.ts +0 -13
  934. package/server/dist/utils/oss.util.js.map +0 -1
  935. package/server/dist/utils/project-root.util.d.ts +0 -2
  936. package/server/dist/utils/project-root.util.js.map +0 -1
  937. package/server/dist/utils/query-whitelist.util.d.ts +0 -1
  938. package/server/dist/utils/query-whitelist.util.js.map +0 -1
  939. package/server/dist/utils/ua.util.d.ts +0 -9
  940. package/server/dist/utils/ua.util.js.map +0 -1
  941. package/server/dist/utils/uniqueid.util.d.ts +0 -1
  942. package/server/dist/utils/uniqueid.util.js.map +0 -1
  943. package/server/dist/utils/upload.util.d.ts +0 -5
  944. package/server/dist/utils/upload.util.js.map +0 -1
  945. package/server/dist/utils/user.util.d.ts +0 -1
  946. package/server/dist/utils/user.util.js.map +0 -1
  947. package/server/logs/error/error.log.-2026-05-19.log +0 -135
  948. package/server/logs/request/request.log.-2026-05-19.log +0 -0
  949. package/server/logs/response/response.log.-2026-05-19.log +0 -121
  950. package/server/public/uploads/2026-05-30/QR3X4UZQ93ZTUPGXCFA9II..png +0 -0
  951. package/server/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8.webp +0 -0
  952. package/server/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_medium.webp +0 -0
  953. package/server/public/uploads/2026-05-31/BXQV3NX9ZVWHGNOSX9AXD8_thumb.webp +0 -0
  954. package/server/public/uploads/2026-05-31/I2SZC0ONA7CF31UM46MN56..jpg +0 -0
@@ -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,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,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,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,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
+ }