@basicbenframework/cms 0.0.0-stage → 0.6.1

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 (590) hide show
  1. package/LICENSE +9 -0
  2. package/README.md +206 -2
  3. package/db/migrations/001_create_users.js +15 -0
  4. package/db/migrations/002_create_posts.js +18 -0
  5. package/db/migrations/003_create_categories.js +19 -0
  6. package/db/migrations/004_create_tags.js +16 -0
  7. package/db/migrations/005_create_post_tags.js +16 -0
  8. package/db/migrations/006_create_pages.js +26 -0
  9. package/db/migrations/007_create_comments.js +24 -0
  10. package/db/migrations/008_create_media.js +22 -0
  11. package/db/migrations/009_update_posts_blogging.js +27 -0
  12. package/db/migrations/010_create_settings.js +29 -0
  13. package/db/migrations/011_add_user_roles.js +23 -0
  14. package/db/migrations/012_create_auth_tokens.js +30 -0
  15. package/db/migrations/013_add_email_verified.js +24 -0
  16. package/db/migrations/014_create_user_two_factor.js +30 -0
  17. package/db/migrations/015_create_user_credentials.js +35 -0
  18. package/db/migrations/016_create_rate_limits.js +31 -0
  19. package/db/migrations/017_add_content_html.js +38 -0
  20. package/db/migrations/018_create_api_tokens.js +34 -0
  21. package/db/migrations/019_create_post_categories.js +40 -0
  22. package/db/migrations/020_add_author_profiles.js +60 -0
  23. package/db/migrations/021_add_page_featured_image.js +23 -0
  24. package/db/migrations/022_backfill_post_slugs_and_excerpts.js +57 -0
  25. package/db/migrations/023_add_user_session_controls.js +25 -0
  26. package/db/migrations/024_add_post_status_and_trash.js +45 -0
  27. package/db/migrations/025_add_social_and_indexing_fields.js +40 -0
  28. package/db/migrations/026_create_post_revisions.js +29 -0
  29. package/db/migrations/027_add_media_dimensions.js +19 -0
  30. package/db/migrations/028_create_navigation_menus.js +65 -0
  31. package/db/migrations/029_create_redirects.js +40 -0
  32. package/db/migrations/030_add_comment_status_and_notifications.js +53 -0
  33. package/db/migrations/031_create_post_locks.js +38 -0
  34. package/db/migrations/032_create_snippets.js +31 -0
  35. package/db/migrations/033_create_members.js +70 -0
  36. package/db/migrations/034_add_post_visibility.js +28 -0
  37. package/db/migrations/035_create_newsletters.js +72 -0
  38. package/db/migrations/036_create_analytics.js +89 -0
  39. package/db/migrations/037_create_ops_heartbeats.js +30 -0
  40. package/db/migrations/038_create_content_types.js +84 -0
  41. package/db/migrations/039_create_content_type_fields.js +47 -0
  42. package/db/migrations/040_create_taxonomies.js +80 -0
  43. package/db/migrations/041_add_newsletter_handoff.js +28 -0
  44. package/db/migrations/042_create_mysendbox_contacts.js +63 -0
  45. package/lib/cli/backup.d.mts +2 -0
  46. package/lib/cli/backup.mjs +124 -0
  47. package/lib/cli/export.d.mts +2 -0
  48. package/lib/cli/export.mjs +54 -0
  49. package/lib/cli/import-ghost.d.mts +2 -0
  50. package/lib/cli/import-ghost.mjs +50 -0
  51. package/lib/cli/import-json.d.mts +2 -0
  52. package/lib/cli/import-json.mjs +61 -0
  53. package/lib/cli/import-wordpress.d.mts +2 -0
  54. package/lib/cli/import-wordpress.mjs +169 -0
  55. package/lib/cli/import-wxr.d.mts +2 -0
  56. package/lib/cli/import-wxr.mjs +55 -0
  57. package/lib/cli/index.d.mts +2 -0
  58. package/lib/cli/index.mjs +53 -0
  59. package/lib/cli/lib/backup.d.mts +112 -0
  60. package/lib/cli/lib/backup.mjs +297 -0
  61. package/lib/cli/lib/ghost.d.mts +30 -0
  62. package/lib/cli/lib/ghost.mjs +201 -0
  63. package/lib/cli/lib/html-to-markdown.d.mts +61 -0
  64. package/lib/cli/lib/html-to-markdown.mjs +523 -0
  65. package/lib/cli/lib/import-common.d.mts +100 -0
  66. package/lib/cli/lib/import-common.mjs +252 -0
  67. package/lib/cli/lib/json-import.d.mts +22 -0
  68. package/lib/cli/lib/json-import.mjs +422 -0
  69. package/lib/cli/lib/site-import.d.mts +32 -0
  70. package/lib/cli/lib/site-import.mjs +456 -0
  71. package/lib/cli/lib/wordpress-rest.d.mts +25 -0
  72. package/lib/cli/lib/wordpress-rest.mjs +177 -0
  73. package/lib/cli/lib/wxr.d.mts +18 -0
  74. package/lib/cli/lib/wxr.mjs +307 -0
  75. package/lib/cli/lib/xml.d.mts +33 -0
  76. package/lib/cli/lib/xml.mjs +186 -0
  77. package/lib/cli/restore.d.mts +2 -0
  78. package/lib/cli/restore.mjs +98 -0
  79. package/lib/client/components/Alert.d.ts +7 -0
  80. package/lib/client/components/Alert.js +8 -0
  81. package/lib/client/components/Avatar.d.ts +15 -0
  82. package/lib/client/components/Avatar.js +10 -0
  83. package/lib/client/components/BackLink.d.ts +7 -0
  84. package/lib/client/components/BackLink.js +6 -0
  85. package/lib/client/components/Button.d.ts +7 -0
  86. package/lib/client/components/Button.js +12 -0
  87. package/lib/client/components/Card.d.ts +7 -0
  88. package/lib/client/components/Card.js +6 -0
  89. package/lib/client/components/CommentThread.d.ts +15 -0
  90. package/lib/client/components/CommentThread.js +101 -0
  91. package/lib/client/components/Empty.d.ts +6 -0
  92. package/lib/client/components/Empty.js +6 -0
  93. package/lib/client/components/Input.d.ts +6 -0
  94. package/lib/client/components/Input.js +6 -0
  95. package/lib/client/components/Link.d.ts +31 -0
  96. package/lib/client/components/Link.js +49 -0
  97. package/lib/client/components/Loading.d.ts +1 -0
  98. package/lib/client/components/Loading.js +6 -0
  99. package/lib/client/components/Logo.d.ts +5 -0
  100. package/lib/client/components/Logo.js +4 -0
  101. package/lib/client/components/MarkdownEditor.d.ts +41 -0
  102. package/lib/client/components/MarkdownEditor.js +156 -0
  103. package/lib/client/components/Nav/DarkModeToggle.d.ts +6 -0
  104. package/lib/client/components/Nav/DarkModeToggle.js +6 -0
  105. package/lib/client/components/Nav/DesktopNav.d.ts +8 -0
  106. package/lib/client/components/Nav/DesktopNav.js +9 -0
  107. package/lib/client/components/Nav/MobileNav.d.ts +9 -0
  108. package/lib/client/components/Nav/MobileNav.js +15 -0
  109. package/lib/client/components/NavLink.d.ts +8 -0
  110. package/lib/client/components/NavLink.js +6 -0
  111. package/lib/client/components/PageHeader.d.ts +8 -0
  112. package/lib/client/components/PageHeader.js +6 -0
  113. package/lib/client/components/PostCard.d.ts +8 -0
  114. package/lib/client/components/PostCard.js +7 -0
  115. package/lib/client/components/Textarea.d.ts +6 -0
  116. package/lib/client/components/Textarea.js +6 -0
  117. package/lib/client/components/ThemeContext.d.ts +18 -0
  118. package/lib/client/components/ThemeContext.js +8 -0
  119. package/lib/client/components/admin/AdminIcons.d.ts +13 -0
  120. package/lib/client/components/admin/AdminIcons.js +66 -0
  121. package/lib/client/components/admin/ContentModelPanels.d.ts +22 -0
  122. package/lib/client/components/admin/ContentModelPanels.js +93 -0
  123. package/lib/client/components/admin/FeaturedImageBox.d.ts +21 -0
  124. package/lib/client/components/admin/FeaturedImageBox.js +24 -0
  125. package/lib/client/components/admin/MediaGrid.d.ts +23 -0
  126. package/lib/client/components/admin/MediaGrid.js +69 -0
  127. package/lib/client/components/admin/MediaPicker.d.ts +17 -0
  128. package/lib/client/components/admin/MediaPicker.js +61 -0
  129. package/lib/client/components/admin/Pagination.d.ts +27 -0
  130. package/lib/client/components/admin/Pagination.js +29 -0
  131. package/lib/client/components/admin/SnippetPicker.d.ts +27 -0
  132. package/lib/client/components/admin/SnippetPicker.js +65 -0
  133. package/lib/client/components/admin/TermPicker.d.ts +52 -0
  134. package/lib/client/components/admin/TermPicker.js +58 -0
  135. package/lib/client/contexts/ToastContext.d.ts +12 -0
  136. package/lib/client/contexts/ToastContext.js +49 -0
  137. package/lib/client/features.d.ts +11 -0
  138. package/lib/client/features.js +7 -0
  139. package/lib/client/hooks/useContentTypes.d.ts +48 -0
  140. package/lib/client/hooks/useContentTypes.js +48 -0
  141. package/lib/client/hooks/useMediaLibrary.d.ts +46 -0
  142. package/lib/client/hooks/useMediaLibrary.js +189 -0
  143. package/lib/client/hooks/usePostLock.d.ts +32 -0
  144. package/lib/client/hooks/usePostLock.js +107 -0
  145. package/lib/client/host/index.d.ts +71 -0
  146. package/lib/client/host/index.js +58 -0
  147. package/lib/client/i18n/index.d.ts +79 -0
  148. package/lib/client/i18n/index.js +177 -0
  149. package/lib/client/i18n/locales/es/content.d.ts +4 -0
  150. package/lib/client/i18n/locales/es/content.js +220 -0
  151. package/lib/client/i18n/locales/es/editor.d.ts +9 -0
  152. package/lib/client/i18n/locales/es/editor.js +144 -0
  153. package/lib/client/i18n/locales/es/index.d.ts +8 -0
  154. package/lib/client/i18n/locales/es/index.js +7 -0
  155. package/lib/client/i18n/locales/es/layout.d.ts +4 -0
  156. package/lib/client/i18n/locales/es/layout.js +35 -0
  157. package/lib/client/i18n/locales/es/people.d.ts +4 -0
  158. package/lib/client/i18n/locales/es/people.js +187 -0
  159. package/lib/client/i18n/locales/es/site.d.ts +4 -0
  160. package/lib/client/i18n/locales/es/site.js +208 -0
  161. package/lib/client/layouts/AdminLayout.d.ts +7 -0
  162. package/lib/client/layouts/AdminLayout.js +1046 -0
  163. package/lib/client/layouts/AppLayout.d.ts +6 -0
  164. package/lib/client/layouts/AppLayout.js +19 -0
  165. package/lib/client/layouts/AuthLayout.d.ts +6 -0
  166. package/lib/client/layouts/AuthLayout.js +14 -0
  167. package/lib/client/layouts/DocsLayout.d.ts +6 -0
  168. package/lib/client/layouts/DocsLayout.js +28 -0
  169. package/lib/client/layouts/RootLayout.d.ts +6 -0
  170. package/lib/client/layouts/RootLayout.js +11 -0
  171. package/lib/client/pages/AcceptInvite.d.ts +8 -0
  172. package/lib/client/pages/AcceptInvite.js +60 -0
  173. package/lib/client/pages/Auth.d.ts +1 -0
  174. package/lib/client/pages/Auth.js +40 -0
  175. package/lib/client/pages/Authentication.d.ts +1 -0
  176. package/lib/client/pages/Authentication.js +230 -0
  177. package/lib/client/pages/Content.d.ts +1 -0
  178. package/lib/client/pages/Content.js +21 -0
  179. package/lib/client/pages/Database.d.ts +1 -0
  180. package/lib/client/pages/Database.js +264 -0
  181. package/lib/client/pages/Extending.d.ts +1 -0
  182. package/lib/client/pages/Extending.js +28 -0
  183. package/lib/client/pages/Feed.d.ts +1 -0
  184. package/lib/client/pages/Feed.js +19 -0
  185. package/lib/client/pages/FeedPost.d.ts +1 -0
  186. package/lib/client/pages/FeedPost.js +31 -0
  187. package/lib/client/pages/ForgotPassword.d.ts +8 -0
  188. package/lib/client/pages/ForgotPassword.js +38 -0
  189. package/lib/client/pages/GettingStarted.d.ts +1 -0
  190. package/lib/client/pages/GettingStarted.js +84 -0
  191. package/lib/client/pages/Headless.d.ts +1 -0
  192. package/lib/client/pages/Headless.js +49 -0
  193. package/lib/client/pages/Home.d.ts +1 -0
  194. package/lib/client/pages/Home.js +67 -0
  195. package/lib/client/pages/PostForm.d.ts +1 -0
  196. package/lib/client/pages/PostForm.js +55 -0
  197. package/lib/client/pages/Posts.d.ts +1 -0
  198. package/lib/client/pages/Posts.js +35 -0
  199. package/lib/client/pages/Profile.d.ts +1 -0
  200. package/lib/client/pages/Profile.js +153 -0
  201. package/lib/client/pages/ResetPassword.d.ts +8 -0
  202. package/lib/client/pages/ResetPassword.js +52 -0
  203. package/lib/client/pages/Routing.d.ts +1 -0
  204. package/lib/client/pages/Routing.js +192 -0
  205. package/lib/client/pages/Storage.d.ts +1 -0
  206. package/lib/client/pages/Storage.js +54 -0
  207. package/lib/client/pages/Testing.d.ts +1 -0
  208. package/lib/client/pages/Testing.js +141 -0
  209. package/lib/client/pages/Validation.d.ts +1 -0
  210. package/lib/client/pages/Validation.js +123 -0
  211. package/lib/client/pages/admin/Categories.d.ts +2 -0
  212. package/lib/client/pages/admin/Categories.js +75 -0
  213. package/lib/client/pages/admin/Comments.d.ts +11 -0
  214. package/lib/client/pages/admin/Comments.js +247 -0
  215. package/lib/client/pages/admin/ContentTypes.d.ts +2 -0
  216. package/lib/client/pages/admin/ContentTypes.js +163 -0
  217. package/lib/client/pages/admin/Dashboard.d.ts +2 -0
  218. package/lib/client/pages/admin/Dashboard.js +66 -0
  219. package/lib/client/pages/admin/Health.d.ts +12 -0
  220. package/lib/client/pages/admin/Health.js +148 -0
  221. package/lib/client/pages/admin/Media.d.ts +2 -0
  222. package/lib/client/pages/admin/Media.js +101 -0
  223. package/lib/client/pages/admin/Navigation.d.ts +9 -0
  224. package/lib/client/pages/admin/Navigation.js +230 -0
  225. package/lib/client/pages/admin/Pages.d.ts +2 -0
  226. package/lib/client/pages/admin/Pages.js +53 -0
  227. package/lib/client/pages/admin/PostEditor.d.ts +17 -0
  228. package/lib/client/pages/admin/PostEditor.js +532 -0
  229. package/lib/client/pages/admin/Posts.d.ts +2 -0
  230. package/lib/client/pages/admin/Posts.js +152 -0
  231. package/lib/client/pages/admin/Redirects.d.ts +10 -0
  232. package/lib/client/pages/admin/Redirects.js +87 -0
  233. package/lib/client/pages/admin/Settings.d.ts +2 -0
  234. package/lib/client/pages/admin/Settings.js +111 -0
  235. package/lib/client/pages/admin/Snippets.d.ts +14 -0
  236. package/lib/client/pages/admin/Snippets.js +85 -0
  237. package/lib/client/pages/admin/Tags.d.ts +2 -0
  238. package/lib/client/pages/admin/Tags.js +74 -0
  239. package/lib/client/pages/admin/Taxonomies.d.ts +2 -0
  240. package/lib/client/pages/admin/Taxonomies.js +130 -0
  241. package/lib/client/pages/admin/Tokens.d.ts +9 -0
  242. package/lib/client/pages/admin/Tokens.js +260 -0
  243. package/lib/client/pages/admin/Tools.d.ts +12 -0
  244. package/lib/client/pages/admin/Tools.js +111 -0
  245. package/lib/client/pages/admin/Users.d.ts +13 -0
  246. package/lib/client/pages/admin/Users.js +313 -0
  247. package/lib/client/pages/api-reference.d.ts +33 -0
  248. package/lib/client/pages/api-reference.js +198 -0
  249. package/lib/client/styles.css +37 -0
  250. package/lib/config.d.ts +24 -0
  251. package/lib/config.js +39 -0
  252. package/lib/controllers/AdminController.d.ts +46 -0
  253. package/lib/controllers/AdminController.js +134 -0
  254. package/lib/controllers/AuthController.d.ts +15 -0
  255. package/lib/controllers/AuthController.js +194 -0
  256. package/lib/controllers/AuthorController.d.ts +17 -0
  257. package/lib/controllers/AuthorController.js +19 -0
  258. package/lib/controllers/CategoryController.d.ts +10 -0
  259. package/lib/controllers/CategoryController.js +88 -0
  260. package/lib/controllers/CommentController.d.ts +68 -0
  261. package/lib/controllers/CommentController.js +438 -0
  262. package/lib/controllers/ContentTypeController.d.ts +24 -0
  263. package/lib/controllers/ContentTypeController.js +91 -0
  264. package/lib/controllers/EmailVerificationController.d.ts +33 -0
  265. package/lib/controllers/EmailVerificationController.js +116 -0
  266. package/lib/controllers/ExportController.d.ts +15 -0
  267. package/lib/controllers/ExportController.js +41 -0
  268. package/lib/controllers/FeedController.d.ts +14 -0
  269. package/lib/controllers/FeedController.js +246 -0
  270. package/lib/controllers/HealthController.d.ts +21 -0
  271. package/lib/controllers/HealthController.js +176 -0
  272. package/lib/controllers/HomeController.d.ts +12 -0
  273. package/lib/controllers/HomeController.js +16 -0
  274. package/lib/controllers/MediaController.d.ts +24 -0
  275. package/lib/controllers/MediaController.js +189 -0
  276. package/lib/controllers/NavigationController.d.ts +22 -0
  277. package/lib/controllers/NavigationController.js +176 -0
  278. package/lib/controllers/PageController.d.ts +13 -0
  279. package/lib/controllers/PageController.js +172 -0
  280. package/lib/controllers/PasskeyController.d.ts +36 -0
  281. package/lib/controllers/PasskeyController.js +201 -0
  282. package/lib/controllers/PasswordResetController.d.ts +44 -0
  283. package/lib/controllers/PasswordResetController.js +160 -0
  284. package/lib/controllers/PostController.d.ts +51 -0
  285. package/lib/controllers/PostController.js +538 -0
  286. package/lib/controllers/PostLockController.d.ts +62 -0
  287. package/lib/controllers/PostLockController.js +101 -0
  288. package/lib/controllers/ProfileController.d.ts +13 -0
  289. package/lib/controllers/ProfileController.js +160 -0
  290. package/lib/controllers/PublicApiController.d.ts +23 -0
  291. package/lib/controllers/PublicApiController.js +100 -0
  292. package/lib/controllers/RedirectController.d.ts +32 -0
  293. package/lib/controllers/RedirectController.js +95 -0
  294. package/lib/controllers/SettingsController.d.ts +28 -0
  295. package/lib/controllers/SettingsController.js +105 -0
  296. package/lib/controllers/SnippetController.d.ts +27 -0
  297. package/lib/controllers/SnippetController.js +123 -0
  298. package/lib/controllers/TagController.d.ts +9 -0
  299. package/lib/controllers/TagController.js +70 -0
  300. package/lib/controllers/TaxonomyController.d.ts +24 -0
  301. package/lib/controllers/TaxonomyController.js +149 -0
  302. package/lib/controllers/TokenController.d.ts +27 -0
  303. package/lib/controllers/TokenController.js +83 -0
  304. package/lib/controllers/TwoFactorController.d.ts +31 -0
  305. package/lib/controllers/TwoFactorController.js +213 -0
  306. package/lib/controllers/UserController.d.ts +110 -0
  307. package/lib/controllers/UserController.js +504 -0
  308. package/lib/features/analytics/AnalyticsPage.d.ts +11 -0
  309. package/lib/features/analytics/AnalyticsPage.js +123 -0
  310. package/lib/features/analytics/admin.d.ts +3 -0
  311. package/lib/features/analytics/admin.js +9 -0
  312. package/lib/features/analytics/controller.d.ts +19 -0
  313. package/lib/features/analytics/controller.js +79 -0
  314. package/lib/features/analytics/helpers.d.ts +84 -0
  315. package/lib/features/analytics/helpers.js +181 -0
  316. package/lib/features/analytics/i18n/es.d.ts +4 -0
  317. package/lib/features/analytics/i18n/es.js +31 -0
  318. package/lib/features/analytics/index.d.ts +28 -0
  319. package/lib/features/analytics/index.js +91 -0
  320. package/lib/features/analytics/manifest.d.ts +8 -0
  321. package/lib/features/analytics/manifest.js +18 -0
  322. package/lib/features/analytics/model.d.ts +130 -0
  323. package/lib/features/analytics/model.js +206 -0
  324. package/lib/features/members/Member.d.ts +93 -0
  325. package/lib/features/members/Member.js +194 -0
  326. package/lib/features/members/MemberAdminController.d.ts +60 -0
  327. package/lib/features/members/MemberAdminController.js +262 -0
  328. package/lib/features/members/MemberController.d.ts +88 -0
  329. package/lib/features/members/MemberController.js +250 -0
  330. package/lib/features/members/MembersPage.d.ts +10 -0
  331. package/lib/features/members/MembersPage.js +216 -0
  332. package/lib/features/members/PostAccessBox.d.ts +15 -0
  333. package/lib/features/members/PostAccessBox.js +70 -0
  334. package/lib/features/members/admin.d.ts +3 -0
  335. package/lib/features/members/admin.js +12 -0
  336. package/lib/features/members/csv.d.ts +21 -0
  337. package/lib/features/members/csv.js +74 -0
  338. package/lib/features/members/events.d.ts +34 -0
  339. package/lib/features/members/events.js +34 -0
  340. package/lib/features/members/i18n/es.d.ts +4 -0
  341. package/lib/features/members/i18n/es.js +106 -0
  342. package/lib/features/members/index.d.ts +44 -0
  343. package/lib/features/members/index.js +106 -0
  344. package/lib/features/members/manifest.d.ts +8 -0
  345. package/lib/features/members/manifest.js +18 -0
  346. package/lib/features/members/middleware.d.ts +42 -0
  347. package/lib/features/members/middleware.js +74 -0
  348. package/lib/features/members/newsletter.d.ts +177 -0
  349. package/lib/features/members/newsletter.js +439 -0
  350. package/lib/features/members/rate-limits.d.ts +34 -0
  351. package/lib/features/members/rate-limits.js +50 -0
  352. package/lib/features/members/request.d.ts +13 -0
  353. package/lib/features/members/request.js +6 -0
  354. package/lib/features/members/routes.d.ts +15 -0
  355. package/lib/features/members/routes.js +59 -0
  356. package/lib/features/members/session.d.ts +102 -0
  357. package/lib/features/members/session.js +158 -0
  358. package/lib/features/members/settings.d.ts +14 -0
  359. package/lib/features/members/settings.js +23 -0
  360. package/lib/features/mysendbox/MySendboxSettingsCard.d.ts +7 -0
  361. package/lib/features/mysendbox/MySendboxSettingsCard.js +48 -0
  362. package/lib/features/mysendbox/admin.d.ts +3 -0
  363. package/lib/features/mysendbox/admin.js +9 -0
  364. package/lib/features/mysendbox/broadcasts.d.ts +61 -0
  365. package/lib/features/mysendbox/broadcasts.js +124 -0
  366. package/lib/features/mysendbox/client.d.ts +95 -0
  367. package/lib/features/mysendbox/client.js +61 -0
  368. package/lib/features/mysendbox/config.d.ts +27 -0
  369. package/lib/features/mysendbox/config.js +74 -0
  370. package/lib/features/mysendbox/contacts.d.ts +121 -0
  371. package/lib/features/mysendbox/contacts.js +378 -0
  372. package/lib/features/mysendbox/controller.d.ts +11 -0
  373. package/lib/features/mysendbox/controller.js +47 -0
  374. package/lib/features/mysendbox/i18n/es.d.ts +4 -0
  375. package/lib/features/mysendbox/i18n/es.js +28 -0
  376. package/lib/features/mysendbox/index.d.ts +18 -0
  377. package/lib/features/mysendbox/index.js +71 -0
  378. package/lib/features/mysendbox/manifest.d.ts +7 -0
  379. package/lib/features/mysendbox/manifest.js +6 -0
  380. package/lib/features/mysendbox/routes.d.ts +6 -0
  381. package/lib/features/mysendbox/routes.js +14 -0
  382. package/lib/features/mysendbox/webhook.d.ts +23 -0
  383. package/lib/features/mysendbox/webhook.js +104 -0
  384. package/lib/features/theme/OEmbedController.d.ts +31 -0
  385. package/lib/features/theme/OEmbedController.js +128 -0
  386. package/lib/features/theme/ThemeController.d.ts +20 -0
  387. package/lib/features/theme/ThemeController.js +256 -0
  388. package/lib/features/theme/ThemeSettingsCard.d.ts +7 -0
  389. package/lib/features/theme/ThemeSettingsCard.js +12 -0
  390. package/lib/features/theme/admin.d.ts +3 -0
  391. package/lib/features/theme/admin.js +9 -0
  392. package/lib/features/theme/html.d.ts +48 -0
  393. package/lib/features/theme/html.js +97 -0
  394. package/lib/features/theme/i18n/es.d.ts +4 -0
  395. package/lib/features/theme/i18n/es.js +9 -0
  396. package/lib/features/theme/index.d.ts +11 -0
  397. package/lib/features/theme/index.js +23 -0
  398. package/lib/features/theme/manifest.d.ts +7 -0
  399. package/lib/features/theme/manifest.js +6 -0
  400. package/lib/features/theme/oembed.d.ts +36 -0
  401. package/lib/features/theme/oembed.js +58 -0
  402. package/lib/features/theme/routes.d.ts +17 -0
  403. package/lib/features/theme/routes.js +54 -0
  404. package/lib/features/theme/templates.d.ts +103 -0
  405. package/lib/features/theme/templates.js +283 -0
  406. package/lib/features.d.ts +15 -0
  407. package/lib/features.js +6 -0
  408. package/lib/features.manifest.d.ts +10 -0
  409. package/lib/features.manifest.js +6 -0
  410. package/lib/helpers/access.d.ts +62 -0
  411. package/lib/helpers/access.js +92 -0
  412. package/lib/helpers/api.d.ts +20 -0
  413. package/lib/helpers/api.js +44 -0
  414. package/lib/helpers/comment-guard.d.ts +145 -0
  415. package/lib/helpers/comment-guard.js +253 -0
  416. package/lib/helpers/comment-mail.d.ts +53 -0
  417. package/lib/helpers/comment-mail.js +188 -0
  418. package/lib/helpers/content-model.d.ts +50 -0
  419. package/lib/helpers/content-model.js +84 -0
  420. package/lib/helpers/content-paths.d.ts +107 -0
  421. package/lib/helpers/content-paths.js +200 -0
  422. package/lib/helpers/export-data.d.ts +85 -0
  423. package/lib/helpers/export-data.js +229 -0
  424. package/lib/helpers/gating.d.ts +53 -0
  425. package/lib/helpers/gating.js +83 -0
  426. package/lib/helpers/health.d.ts +91 -0
  427. package/lib/helpers/health.js +279 -0
  428. package/lib/helpers/heartbeat.d.ts +35 -0
  429. package/lib/helpers/heartbeat.js +55 -0
  430. package/lib/helpers/image-size.d.ts +18 -0
  431. package/lib/helpers/image-size.js +83 -0
  432. package/lib/helpers/images.d.ts +29 -0
  433. package/lib/helpers/images.js +41 -0
  434. package/lib/helpers/mail-templates.d.ts +11 -0
  435. package/lib/helpers/mail-templates.js +42 -0
  436. package/lib/helpers/publish-due.d.ts +28 -0
  437. package/lib/helpers/publish-due.js +67 -0
  438. package/lib/helpers/redirects.d.ts +43 -0
  439. package/lib/helpers/redirects.js +80 -0
  440. package/lib/helpers/seo-fields.d.ts +13 -0
  441. package/lib/helpers/seo-fields.js +52 -0
  442. package/lib/helpers/session.d.ts +30 -0
  443. package/lib/helpers/session.js +27 -0
  444. package/lib/helpers/site-settings.d.ts +98 -0
  445. package/lib/helpers/site-settings.js +232 -0
  446. package/lib/helpers/site.d.ts +14 -0
  447. package/lib/helpers/site.js +23 -0
  448. package/lib/helpers/write-hooks.d.ts +33 -0
  449. package/lib/helpers/write-hooks.js +37 -0
  450. package/lib/hooks.d.ts +17 -0
  451. package/lib/hooks.js +101 -0
  452. package/lib/host/core-tasks.d.ts +4 -0
  453. package/lib/host/core-tasks.js +26 -0
  454. package/lib/host/cron.d.ts +39 -0
  455. package/lib/host/cron.js +85 -0
  456. package/lib/host/enabled.d.ts +4 -0
  457. package/lib/host/enabled.js +40 -0
  458. package/lib/host/index.d.ts +81 -0
  459. package/lib/host/index.js +87 -0
  460. package/lib/host/manifest.d.ts +34 -0
  461. package/lib/host/manifest.js +7 -0
  462. package/lib/host/menu.d.ts +18 -0
  463. package/lib/host/menu.js +15 -0
  464. package/lib/main.d.ts +1 -0
  465. package/lib/main.js +24 -0
  466. package/lib/middleware/api-auth.d.ts +59 -0
  467. package/lib/middleware/api-auth.js +164 -0
  468. package/lib/middleware/auth.d.ts +49 -0
  469. package/lib/middleware/auth.js +112 -0
  470. package/lib/middleware/cache.d.ts +17 -0
  471. package/lib/middleware/cache.js +52 -0
  472. package/lib/middleware/rate-limits.d.ts +199 -0
  473. package/lib/middleware/rate-limits.js +276 -0
  474. package/lib/middleware/viewer.d.ts +13 -0
  475. package/lib/middleware/viewer.js +16 -0
  476. package/lib/models/Category.d.ts +24 -0
  477. package/lib/models/Category.js +102 -0
  478. package/lib/models/Comment.d.ts +120 -0
  479. package/lib/models/Comment.js +283 -0
  480. package/lib/models/ContentType.d.ts +142 -0
  481. package/lib/models/ContentType.js +462 -0
  482. package/lib/models/Credential.d.ts +21 -0
  483. package/lib/models/Credential.js +31 -0
  484. package/lib/models/Media.d.ts +53 -0
  485. package/lib/models/Media.js +132 -0
  486. package/lib/models/Menu.d.ts +131 -0
  487. package/lib/models/Menu.js +312 -0
  488. package/lib/models/Page.d.ts +55 -0
  489. package/lib/models/Page.js +218 -0
  490. package/lib/models/Post.d.ts +136 -0
  491. package/lib/models/Post.js +406 -0
  492. package/lib/models/PostLock.d.ts +67 -0
  493. package/lib/models/PostLock.js +112 -0
  494. package/lib/models/PostRevision.d.ts +45 -0
  495. package/lib/models/PostRevision.js +82 -0
  496. package/lib/models/PublicContent.d.ts +283 -0
  497. package/lib/models/PublicContent.js +577 -0
  498. package/lib/models/Redirect.d.ts +123 -0
  499. package/lib/models/Redirect.js +225 -0
  500. package/lib/models/Settings.d.ts +61 -0
  501. package/lib/models/Settings.js +128 -0
  502. package/lib/models/Snippet.d.ts +36 -0
  503. package/lib/models/Snippet.js +64 -0
  504. package/lib/models/Tag.d.ts +23 -0
  505. package/lib/models/Tag.js +117 -0
  506. package/lib/models/Taxonomy.d.ts +127 -0
  507. package/lib/models/Taxonomy.js +321 -0
  508. package/lib/models/TwoFactor.d.ts +26 -0
  509. package/lib/models/TwoFactor.js +60 -0
  510. package/lib/models/User.d.ts +49 -0
  511. package/lib/models/User.js +128 -0
  512. package/lib/models/derive.d.ts +69 -0
  513. package/lib/models/derive.js +81 -0
  514. package/lib/models/pagination.d.ts +30 -0
  515. package/lib/models/pagination.js +36 -0
  516. package/lib/models/visibility.d.ts +31 -0
  517. package/lib/models/visibility.js +47 -0
  518. package/lib/routes/App.d.ts +2 -0
  519. package/lib/routes/App.js +146 -0
  520. package/lib/routes/api/admin.d.ts +6 -0
  521. package/lib/routes/api/admin.js +11 -0
  522. package/lib/routes/api/auth.d.ts +6 -0
  523. package/lib/routes/api/auth.js +24 -0
  524. package/lib/routes/api/authors.d.ts +5 -0
  525. package/lib/routes/api/authors.js +8 -0
  526. package/lib/routes/api/categories.d.ts +8 -0
  527. package/lib/routes/api/categories.js +15 -0
  528. package/lib/routes/api/comments.d.ts +8 -0
  529. package/lib/routes/api/comments.js +35 -0
  530. package/lib/routes/api/content-model.d.ts +17 -0
  531. package/lib/routes/api/content-model.js +67 -0
  532. package/lib/routes/api/cron.d.ts +6 -0
  533. package/lib/routes/api/cron.js +9 -0
  534. package/lib/routes/api/export.d.ts +5 -0
  535. package/lib/routes/api/export.js +11 -0
  536. package/lib/routes/api/feed.d.ts +5 -0
  537. package/lib/routes/api/feed.js +16 -0
  538. package/lib/routes/api/media.d.ts +8 -0
  539. package/lib/routes/api/media.js +25 -0
  540. package/lib/routes/api/navigation.d.ts +12 -0
  541. package/lib/routes/api/navigation.js +17 -0
  542. package/lib/routes/api/ops.d.ts +9 -0
  543. package/lib/routes/api/ops.js +19 -0
  544. package/lib/routes/api/pages.d.ts +8 -0
  545. package/lib/routes/api/pages.js +21 -0
  546. package/lib/routes/api/passkeys.d.ts +7 -0
  547. package/lib/routes/api/passkeys.js +13 -0
  548. package/lib/routes/api/posts.d.ts +8 -0
  549. package/lib/routes/api/posts.js +39 -0
  550. package/lib/routes/api/profile.d.ts +6 -0
  551. package/lib/routes/api/profile.js +8 -0
  552. package/lib/routes/api/redirects.d.ts +12 -0
  553. package/lib/routes/api/redirects.js +13 -0
  554. package/lib/routes/api/settings.d.ts +8 -0
  555. package/lib/routes/api/settings.js +15 -0
  556. package/lib/routes/api/snippets.d.ts +15 -0
  557. package/lib/routes/api/snippets.js +16 -0
  558. package/lib/routes/api/tags.d.ts +8 -0
  559. package/lib/routes/api/tags.js +14 -0
  560. package/lib/routes/api/tokens.d.ts +7 -0
  561. package/lib/routes/api/tokens.js +15 -0
  562. package/lib/routes/api/two-factor.d.ts +7 -0
  563. package/lib/routes/api/two-factor.js +15 -0
  564. package/lib/routes/api/users.d.ts +8 -0
  565. package/lib/routes/api/users.js +25 -0
  566. package/lib/routes/api/v1.d.ts +12 -0
  567. package/lib/routes/api/v1.js +55 -0
  568. package/lib/routes/api/verification.d.ts +6 -0
  569. package/lib/routes/api/verification.js +11 -0
  570. package/lib/server/index.d.ts +24 -0
  571. package/lib/server/index.js +110 -0
  572. package/lib/types/index.d.ts +298 -0
  573. package/lib/types/index.js +1 -0
  574. package/lib/vite.d.ts +2 -0
  575. package/lib/vite.js +101 -0
  576. package/mail/comment-moderation.html +27 -0
  577. package/mail/comment-moderation.txt +13 -0
  578. package/mail/comment-reply.html +28 -0
  579. package/mail/comment-reply.txt +14 -0
  580. package/mail/invitation.html +25 -0
  581. package/mail/invitation.txt +11 -0
  582. package/mail/member-magic-link.html +23 -0
  583. package/mail/member-magic-link.txt +10 -0
  584. package/mail/newsletter.html +26 -0
  585. package/mail/newsletter.txt +13 -0
  586. package/mail/password-reset.html +26 -0
  587. package/mail/password-reset.txt +10 -0
  588. package/mail/verify-email.html +25 -0
  589. package/mail/verify-email.txt +8 -0
  590. package/package.json +85 -4
@@ -0,0 +1,1046 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState, useEffect } from 'react';
3
+ import { api } from "../../helpers/api.js";
4
+ import { useAuth, useNavigate, usePath } from '@basicbenframework/core/client';
5
+ import AdminIcon from "../components/admin/AdminIcons.js";
6
+ import { Link } from "../components/Link.js";
7
+ import { can } from '@basicbenframework/core/auth/permissions';
8
+ import { applySiteLocale, useT } from "../i18n/index.js";
9
+ import { withFeaturePages } from "../../host/menu.js";
10
+ import { enabledManifests } from "../host/index.js";
11
+ /*
12
+ The menu comes from the server, because that is the realm hooks run in.
13
+ Firing admin.menu in the browser would consult a registry nothing has
14
+ registered with, so a listener could never add a nav item.
15
+
16
+ The same list is hard-coded as a fallback: the sidebar must render even if the
17
+ request fails, and it must not flash empty while the request is in flight.
18
+ Keep the two in step — `admin-navigation.test.js` fails when they disagree,
19
+ because a difference is not a fallback, it is a flicker. Profile was added to
20
+ the server's list alone, so every navigation drew the sidebar without it and
21
+ then put it back a moment later.
22
+ */
23
+ const CORE_MENU = [
24
+ { path: '/admin', label: 'Dashboard' },
25
+ { path: '/admin/posts', label: 'Posts', section: 'Content' },
26
+ { path: '/admin/pages', label: 'Pages', section: 'Content' },
27
+ { path: '/admin/categories', label: 'Categories', section: 'Content' },
28
+ { path: '/admin/tags', label: 'Tags', section: 'Content' },
29
+ { path: '/admin/taxonomies', label: 'Taxonomies', section: 'Content', capability: 'settings.manage' },
30
+ { path: '/admin/comments', label: 'Comments', section: 'Content' },
31
+ { path: '/admin/media', label: 'Media', section: 'Content' },
32
+ { path: '/admin/snippets', label: 'Snippets', section: 'Content', capability: 'post.publish' },
33
+ { path: '/admin/tokens', label: 'API tokens', section: 'Site' },
34
+ { path: '/admin/settings', label: 'Settings', section: 'Site' },
35
+ { path: '/admin/content-types', label: 'Content types', section: 'Site', capability: 'settings.manage' },
36
+ { path: '/admin/navigation', label: 'Navigation', section: 'Site', capability: 'settings.manage' },
37
+ { path: '/admin/redirects', label: 'Redirects', section: 'Site', capability: 'settings.manage' },
38
+ { path: '/admin/users', label: 'Users', section: 'Site', capability: 'user.manage' },
39
+ { path: '/admin/tools', label: 'Tools', section: 'Site', capability: 'user.manage' },
40
+ { path: '/admin/health', label: 'Site health', section: 'Site', capability: 'user.manage' },
41
+ { path: '/profile', label: 'Profile', section: 'Account' },
42
+ ];
43
+ /** Core's menu with each enabled feature's pages placed in it, exactly as the server places them. */
44
+ function defaultMenu() {
45
+ return withFeaturePages(CORE_MENU, enabledManifests());
46
+ }
47
+ /** Features' sidebar icons, from their manifests. */
48
+ const featureIconPaths = () => new Map(enabledManifests().flatMap((m) => (m.pages ?? []).filter((p) => p.iconPath).map((p) => [p.path, p.iconPath])));
49
+ /*
50
+ The last menu the server gave us, kept for the life of the tab.
51
+
52
+ Every admin screen renders its own AdminLayout, so navigating unmounts this
53
+ component and mounts a new one: state starts from the fallback again and the
54
+ request is made again. Anything the server adds — a hook's item, Profile —
55
+ therefore vanished and came back on every single navigation.
56
+
57
+ Module scope rather than state, because the point is to survive the unmount.
58
+ It is a cache of one request per tab, not a store; the fetch still runs, so a
59
+ menu that changes underneath still arrives.
60
+ */
61
+ let lastMenu = null;
62
+ /**
63
+ * The menu split into its sections, in the order they first appear.
64
+ *
65
+ * Grouped by name rather than by adjacency, so an item a hook appends joins the
66
+ * heading it names instead of starting a second one with the same words. Items
67
+ * without a section share the leading group, which has no heading at all — the
68
+ * dashboard is not a category of one.
69
+ */
70
+ function bySection(items) {
71
+ const groups = [];
72
+ for (const item of items) {
73
+ const existing = groups.find((group) => group.title === item.section);
74
+ if (existing)
75
+ existing.items.push(item);
76
+ else
77
+ groups.push({ title: item.section, items: [item] });
78
+ }
79
+ return groups;
80
+ }
81
+ const THEME_KEY = 'admin-theme';
82
+ function storedAppearance() {
83
+ if (typeof localStorage === 'undefined')
84
+ return 'system';
85
+ const value = localStorage.getItem(THEME_KEY);
86
+ return value === 'light' || value === 'dark' ? value : 'system';
87
+ }
88
+ export default function AdminLayout({ children, title }) {
89
+ const { user, logout } = useAuth();
90
+ const navigate = useNavigate();
91
+ const currentPath = usePath();
92
+ const [sidebarOpen, setSidebarOpen] = useState(true);
93
+ const [appearance, setAppearance] = useState(storedAppearance);
94
+ const { t } = useT();
95
+ useEffect(() => {
96
+ if (appearance === 'system')
97
+ localStorage.removeItem(THEME_KEY);
98
+ else
99
+ localStorage.setItem(THEME_KEY, appearance);
100
+ }, [appearance]);
101
+ const handleLogout = () => {
102
+ // `logout()` clears the token and navigates to '/' itself. This used to
103
+ // follow it with navigate('/auth') — a route that has never existed, and
104
+ // the second navigation won, so signing out of the admin landed on a 404.
105
+ //
106
+ // '/' is right in both modes. Normally it is the home page; with
107
+ // DISABLE_PUBLIC_SITE it is the dashboard behind an auth guard, and the
108
+ // guard sends a signed-out visitor to /login.
109
+ logout();
110
+ };
111
+ const [menuItems, setMenuItems] = useState(() => lastMenu ?? defaultMenu());
112
+ const [iconPaths] = useState(featureIconPaths);
113
+ useEffect(() => {
114
+ let cancelled = false;
115
+ api.get('/api/admin/menu')
116
+ .then((data) => {
117
+ void applySiteLocale(data?.locale);
118
+ if (Array.isArray(data?.menu) && data.menu.length > 0) {
119
+ // Remembered across mounts, not merely across renders: see lastMenu.
120
+ lastMenu = data.menu;
121
+ if (!cancelled)
122
+ setMenuItems(data.menu);
123
+ }
124
+ })
125
+ .catch(() => { });
126
+ // Lets an admin.init listener do one-off setup before the first screen renders.
127
+ api.post('/api/admin/init').catch(() => { });
128
+ return () => { cancelled = true; };
129
+ }, []);
130
+ // 'system' sets no attribute, which is what lets the media query decide.
131
+ const themeAttr = appearance === 'system' ? undefined : appearance;
132
+ return (_jsxs("div", { className: "admin-layout", "data-theme": themeAttr, children: [_jsx("style", { children: adminStyles }), _jsxs("aside", { className: `admin-sidebar ${sidebarOpen ? 'open' : 'closed'}`, children: [_jsx("div", { className: "admin-sidebar-header", children: _jsxs(Link, { href: "/", className: "admin-logo", title: "BasicBen", children: [_jsx("span", { className: "admin-logo-mark", children: "B" }), sidebarOpen && _jsx("span", { className: "admin-logo-text", children: "BasicBen" })] }) }), _jsx("nav", { className: "admin-nav", children: bySection(menuItems.filter(item => !item.capability || can(user, item.capability))).map(group => (_jsxs("div", { className: "admin-nav-group", children: [group.title && (_jsx("div", { className: "admin-nav-section", children: _jsx("span", { className: "admin-nav-section-label", children: t(group.title) }) })), group.items.map(item => (_jsxs(Link, { href: item.path, className: `admin-nav-item ${currentPath === item.path ? 'active' : ''}`, title: sidebarOpen ? undefined : t(item.label), children: [_jsx(AdminIcon, { path: item.path, fallback: item.icon, iconPath: iconPaths.get(item.path) }), sidebarOpen && _jsx("span", { className: "admin-nav-label", children: t(item.label) })] }, item.path)))] }, group.title ?? 'top'))) }), _jsxs("div", { className: "admin-sidebar-footer", children: [!__DISABLE_PUBLIC_SITE__ && (_jsxs(Link, { href: "/", className: "admin-nav-item", title: sidebarOpen ? undefined : t('View site'), children: [_jsx(AdminIcon, { name: "site" }), sidebarOpen && _jsx("span", { className: "admin-nav-label", children: t('View site') })] })), _jsxs("button", { className: "admin-nav-item admin-collapse", onClick: () => setSidebarOpen(!sidebarOpen), title: sidebarOpen ? t('Collapse sidebar') : t('Expand sidebar'), "aria-label": sidebarOpen ? t('Collapse sidebar') : t('Expand sidebar'), children: [_jsx("svg", { className: "admin-nav-icon", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", style: { transform: sidebarOpen ? 'none' : 'rotate(180deg)' }, children: _jsx("path", { d: "M15 6l-6 6 6 6" }) }), sidebarOpen && _jsx("span", { className: "admin-nav-label", children: t('Collapse') })] })] })] }), _jsxs("div", { className: `admin-main ${sidebarOpen ? '' : 'expanded'}`, children: [_jsxs("header", { className: "admin-header", children: [title && _jsx("h1", { className: "admin-page-title", children: title }), _jsxs("div", { className: "admin-header-right", children: [_jsx("div", { className: "admin-appearance", role: "group", "aria-label": t('Appearance'), children: ['system', 'light', 'dark'].map(option => (_jsx("button", { type: "button", className: `admin-appearance-option ${appearance === option ? 'active' : ''}`, onClick: () => setAppearance(option), title: option === 'system' ? t('System theme') : option === 'light' ? t('Light theme') : t('Dark theme'), "aria-pressed": appearance === option, children: option === 'system' ? '◐' : option === 'light' ? '☀' : '☾' }, option))) }), _jsx("span", { className: "admin-user", children: user?.name || t('Admin') }), _jsx("button", { className: "admin-btn admin-btn-secondary", onClick: handleLogout, children: t('Log out') })] })] }), _jsx("main", { className: "admin-content", children: children })] })] }));
133
+ }
134
+ /*
135
+ One token set, themed three ways.
136
+
137
+ Bare `.admin-layout` carries the light palette. The media query redefines the
138
+ tokens for anyone whose system asks for dark *unless* they have explicitly
139
+ chosen light, and the attribute selector wins in both directions — which is
140
+ what makes the toggle work rather than merely agreeing with the OS.
141
+ */
142
+ const adminStyles = `
143
+ .admin-layout {
144
+ --bg: #fafafa;
145
+ --surface: #ffffff;
146
+ --surface-hover: #f4f4f5;
147
+ --surface-active: #ededee;
148
+ --border: #e7e7e9;
149
+ --border-strong: #d4d4d8;
150
+ --fg: #09090b;
151
+ --fg-muted: #64646b;
152
+ --fg-subtle: #909099;
153
+ --accent: #09090b;
154
+ --accent-fg: #ffffff;
155
+ --focus: #0070f3;
156
+ --danger: #e5484d;
157
+ --danger-fg: #ffffff;
158
+ --success: #1a7f45;
159
+ --warning: #9a6700;
160
+ --info: #0060df;
161
+ --tint-success: #e8f5ec;
162
+ --tint-warning: #fdf5e3;
163
+ --tint-info: #e8f1fd;
164
+ --tint-danger: #fdeaea;
165
+ --radius: 8px;
166
+ --radius-lg: 12px;
167
+ --sidebar-w: 232px;
168
+ --sidebar-w-closed: 60px;
169
+
170
+ display: flex;
171
+ min-height: 100vh;
172
+ background: var(--bg);
173
+ color: var(--fg);
174
+ font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
175
+ "Helvetica Neue", Arial, sans-serif;
176
+ font-size: 14px;
177
+ line-height: 1.5;
178
+ -webkit-font-smoothing: antialiased;
179
+ }
180
+
181
+ @media (prefers-color-scheme: dark) {
182
+ .admin-layout:not([data-theme="light"]) {
183
+ --bg: #0a0a0a;
184
+ --surface: #111113;
185
+ --surface-hover: #18181b;
186
+ --surface-active: #202024;
187
+ --border: #232327;
188
+ --border-strong: #333338;
189
+ --fg: #ededef;
190
+ --fg-muted: #a1a1a8;
191
+ --fg-subtle: #70707a;
192
+ --accent: #ededef;
193
+ --accent-fg: #09090b;
194
+ --focus: #3b82f6;
195
+ --danger: #f2555a;
196
+ --danger-fg: #0a0a0a;
197
+ --success: #3dd68c;
198
+ --warning: #f5b544;
199
+ --info: #6aa6ff;
200
+ --tint-success: #10261a;
201
+ --tint-warning: #2a2011;
202
+ --tint-info: #11213a;
203
+ --tint-danger: #2c1315;
204
+ }
205
+ }
206
+
207
+ .admin-layout[data-theme="dark"] {
208
+ --bg: #0a0a0a;
209
+ --surface: #111113;
210
+ --surface-hover: #18181b;
211
+ --surface-active: #202024;
212
+ --border: #232327;
213
+ --border-strong: #333338;
214
+ --fg: #ededef;
215
+ --fg-muted: #a1a1a8;
216
+ --fg-subtle: #70707a;
217
+ --accent: #ededef;
218
+ --accent-fg: #09090b;
219
+ --focus: #3b82f6;
220
+ --danger: #f2555a;
221
+ --danger-fg: #0a0a0a;
222
+ --success: #3dd68c;
223
+ --warning: #f5b544;
224
+ --info: #6aa6ff;
225
+ --tint-success: #10261a;
226
+ --tint-warning: #2a2011;
227
+ --tint-info: #11213a;
228
+ --tint-danger: #2c1315;
229
+ }
230
+
231
+ .admin-layout *,
232
+ .admin-layout *::before,
233
+ .admin-layout *::after { box-sizing: border-box; }
234
+
235
+ /* --- Sidebar ----------------------------------------------------------- */
236
+
237
+ .admin-sidebar {
238
+ width: var(--sidebar-w);
239
+ background: var(--surface);
240
+ border-right: 1px solid var(--border);
241
+ display: flex;
242
+ flex-direction: column;
243
+ position: fixed;
244
+ top: 0;
245
+ left: 0;
246
+ height: 100vh;
247
+ z-index: 100;
248
+ transition: width 0.15s ease;
249
+ }
250
+
251
+ .admin-sidebar.closed { width: var(--sidebar-w-closed); }
252
+
253
+ .admin-sidebar-header {
254
+ display: flex;
255
+ align-items: center;
256
+ height: 56px;
257
+ padding: 0 12px;
258
+ border-bottom: 1px solid var(--border);
259
+ }
260
+
261
+ .admin-logo {
262
+ display: flex;
263
+ align-items: center;
264
+ gap: 8px;
265
+ text-decoration: none;
266
+ color: var(--fg);
267
+ font-weight: 600;
268
+ letter-spacing: -0.01em;
269
+ padding: 6px;
270
+ border-radius: var(--radius);
271
+ }
272
+
273
+ .admin-logo:hover { background: var(--surface-hover); }
274
+
275
+ .admin-logo-mark {
276
+ display: grid;
277
+ place-items: center;
278
+ width: 24px;
279
+ height: 24px;
280
+ flex-shrink: 0;
281
+ border-radius: 6px;
282
+ background: var(--accent);
283
+ color: var(--accent-fg);
284
+ font-size: 13px;
285
+ font-weight: 700;
286
+ }
287
+
288
+ .admin-nav {
289
+ flex: 1;
290
+ padding: 8px;
291
+ overflow-y: auto;
292
+ display: flex;
293
+ flex-direction: column;
294
+ gap: 1px;
295
+ }
296
+
297
+ .admin-nav-group {
298
+ display: flex;
299
+ flex-direction: column;
300
+ gap: 1px;
301
+ }
302
+
303
+ /* A heading over each group. Small, muted and lettered wide, so it reads as
304
+ a label for what follows rather than as another thing to click. */
305
+ .admin-nav-section {
306
+ padding: 14px 10px 4px;
307
+ color: var(--fg-subtle);
308
+ font-size: 10.5px;
309
+ font-weight: 600;
310
+ letter-spacing: 0.07em;
311
+ text-transform: uppercase;
312
+ }
313
+
314
+ /* Collapsed to the icon rail, the word has nowhere to go — so the heading
315
+ becomes the divider it was already acting as. Both the toggle and the
316
+ narrow-screen breakpoint land here, so the rail is never left with a
317
+ wrapped word in it. */
318
+ .admin-sidebar.closed .admin-nav-section-label { display: none; }
319
+ .admin-sidebar.closed .admin-nav-section {
320
+ height: 0;
321
+ padding: 0;
322
+ margin: 9px 6px 8px;
323
+ border-top: 1px solid var(--border);
324
+ }
325
+
326
+ .admin-nav-item {
327
+ display: flex;
328
+ align-items: center;
329
+ gap: 10px;
330
+ padding: 7px 8px;
331
+ border-radius: var(--radius);
332
+ color: var(--fg-muted);
333
+ text-decoration: none;
334
+ font-size: 13.5px;
335
+ font-weight: 450;
336
+ white-space: nowrap;
337
+ border: none;
338
+ background: none;
339
+ width: 100%;
340
+ cursor: pointer;
341
+ font-family: inherit;
342
+ transition: background 0.12s, color 0.12s;
343
+ }
344
+
345
+ .admin-nav-item:hover { background: var(--surface-hover); color: var(--fg); }
346
+ .admin-nav-item.active { background: var(--surface-active); color: var(--fg); font-weight: 550; }
347
+
348
+ .admin-nav-icon {
349
+ width: 17px;
350
+ height: 17px;
351
+ flex-shrink: 0;
352
+ opacity: 0.85;
353
+ }
354
+
355
+ .admin-nav-icon-fallback {
356
+ display: grid;
357
+ place-items: center;
358
+ font-size: 13px;
359
+ line-height: 1;
360
+ }
361
+
362
+ .admin-sidebar-footer {
363
+ padding: 8px;
364
+ border-top: 1px solid var(--border);
365
+ display: flex;
366
+ flex-direction: column;
367
+ gap: 1px;
368
+ }
369
+
370
+ /* --- Main -------------------------------------------------------------- */
371
+
372
+ .admin-main {
373
+ flex: 1;
374
+ margin-left: var(--sidebar-w);
375
+ min-width: 0;
376
+ transition: margin-left 0.15s ease;
377
+ }
378
+
379
+ .admin-main.expanded { margin-left: var(--sidebar-w-closed); }
380
+
381
+ .admin-header {
382
+ display: flex;
383
+ align-items: center;
384
+ justify-content: space-between;
385
+ gap: 16px;
386
+ height: 56px;
387
+ padding: 0 24px;
388
+ background: color-mix(in srgb, var(--surface) 80%, transparent);
389
+ backdrop-filter: blur(8px);
390
+ border-bottom: 1px solid var(--border);
391
+ position: sticky;
392
+ top: 0;
393
+ z-index: 50;
394
+ }
395
+
396
+ .admin-page-title {
397
+ font-size: 15px;
398
+ font-weight: 550;
399
+ letter-spacing: -0.01em;
400
+ margin: 0;
401
+ }
402
+
403
+ .admin-header-right {
404
+ display: flex;
405
+ align-items: center;
406
+ gap: 12px;
407
+ margin-left: auto;
408
+ }
409
+
410
+ .admin-user { color: var(--fg-muted); font-size: 13px; }
411
+
412
+ .admin-appearance {
413
+ display: flex;
414
+ gap: 2px;
415
+ padding: 2px;
416
+ border: 1px solid var(--border);
417
+ border-radius: var(--radius);
418
+ }
419
+
420
+ .admin-appearance-option {
421
+ width: 24px;
422
+ height: 22px;
423
+ display: grid;
424
+ place-items: center;
425
+ border: none;
426
+ background: none;
427
+ border-radius: 5px;
428
+ color: var(--fg-subtle);
429
+ cursor: pointer;
430
+ font-size: 12px;
431
+ line-height: 1;
432
+ }
433
+
434
+ .admin-appearance-option:hover { color: var(--fg); background: var(--surface-hover); }
435
+ .admin-appearance-option.active { color: var(--fg); background: var(--surface-active); }
436
+
437
+ .admin-content { padding: 24px; max-width: 1400px; }
438
+
439
+ /* --- Cards ------------------------------------------------------------- */
440
+
441
+ .admin-card {
442
+ background: var(--surface);
443
+ border: 1px solid var(--border);
444
+ border-radius: var(--radius-lg);
445
+ padding: 20px;
446
+ margin-bottom: 20px;
447
+ }
448
+
449
+ .admin-card-header {
450
+ display: flex;
451
+ align-items: center;
452
+ justify-content: space-between;
453
+ gap: 12px;
454
+ margin-bottom: 16px;
455
+ }
456
+
457
+ .admin-card-title {
458
+ font-size: 14px;
459
+ font-weight: 550;
460
+ letter-spacing: -0.01em;
461
+ margin: 0;
462
+ }
463
+
464
+ /* Pages that use a bare title rather than a header row get the same gap the
465
+ header would have given them, instead of the title sitting on top of the
466
+ first field. */
467
+ .admin-card > .admin-card-title { margin-bottom: 16px; }
468
+
469
+ .admin-stat-card {
470
+ background: var(--surface);
471
+ border: 1px solid var(--border);
472
+ border-radius: var(--radius-lg);
473
+ padding: 18px 20px;
474
+ }
475
+
476
+ /* The label sits *under* the value in the markup, so its bottom margin was
477
+ padding the card rather than separating the two — the number and its name
478
+ were tight against each other and the card was bottom-heavy. */
479
+ .admin-stat-label {
480
+ color: var(--fg-muted);
481
+ font-size: 12.5px;
482
+ margin: 0;
483
+ }
484
+
485
+ .admin-stat-value {
486
+ font-size: 26px;
487
+ font-weight: 600;
488
+ letter-spacing: -0.02em;
489
+ margin: 0 0 4px;
490
+ font-variant-numeric: tabular-nums;
491
+ }
492
+
493
+ /* --- Grid -------------------------------------------------------------- */
494
+
495
+ /* A grid is a section like a card is, so it carries the same space beneath
496
+ it: without this the stats row sat flush against whatever followed, while
497
+ the gap below a card was 20px. The rhythm down the page is now one number.
498
+
499
+ Cards *inside* a grid are spaced by the gap, so their own margin would add
500
+ a second, uneven one. Only direct children are reset — a column of stacked
501
+ cards, which is what the editor's sidebar is, still needs its margins. */
502
+ .admin-grid { display: grid; gap: 16px; margin-bottom: 20px; }
503
+ .admin-grid > .admin-card { margin-bottom: 0; }
504
+ .admin-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
505
+ .admin-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
506
+ .admin-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
507
+
508
+ /* A column of buttons or fields inside a card. The title above it already
509
+ leaves 16px, so this adds nothing of its own at the top. */
510
+ .admin-stack { display: flex; flex-direction: column; gap: 8px; }
511
+
512
+ @media (max-width: 900px) {
513
+ .admin-grid-2, .admin-grid-3, .admin-grid-4 { grid-template-columns: minmax(0, 1fr); }
514
+ }
515
+
516
+ /* --- Buttons ----------------------------------------------------------- */
517
+
518
+ .admin-btn {
519
+ display: inline-flex;
520
+ align-items: center;
521
+ justify-content: center;
522
+ gap: 6px;
523
+ height: 32px;
524
+ padding: 0 12px;
525
+ border-radius: var(--radius);
526
+ border: 1px solid var(--border-strong);
527
+ background: var(--surface);
528
+ color: var(--fg);
529
+ font-family: inherit;
530
+ font-size: 13px;
531
+ font-weight: 500;
532
+ line-height: 1;
533
+ cursor: pointer;
534
+ text-decoration: none;
535
+ white-space: nowrap;
536
+ transition: background 0.12s, border-color 0.12s, opacity 0.12s;
537
+ }
538
+
539
+ .admin-btn:hover { background: var(--surface-hover); }
540
+ .admin-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
541
+ .admin-btn:disabled { opacity: 0.5; cursor: default; }
542
+ .admin-btn:disabled:hover { background: var(--surface); }
543
+
544
+ .admin-btn-primary {
545
+ background: var(--accent);
546
+ border-color: var(--accent);
547
+ color: var(--accent-fg);
548
+ }
549
+
550
+ .admin-btn-primary:hover { background: var(--accent); opacity: 0.85; }
551
+ .admin-btn-primary:disabled:hover { background: var(--accent); }
552
+
553
+ .admin-btn-secondary { background: var(--surface); color: var(--fg); }
554
+
555
+ /* The permalink, under the title where you write it rather than in an SEO
556
+ panel further down the page. Quieter than the title in every way — smaller,
557
+ muted, monospaced — because it is derived from it and mostly read, not
558
+ typed. */
559
+ .admin-slug {
560
+ display: flex;
561
+ align-items: center;
562
+ gap: 8px;
563
+ margin-top: 8px;
564
+ color: var(--fg-muted);
565
+ font-size: 12.5px;
566
+ }
567
+
568
+ .admin-slug-input {
569
+ flex: 1;
570
+ min-width: 0;
571
+ height: 28px;
572
+ padding: 0 8px;
573
+ border: 1px solid var(--border);
574
+ border-radius: var(--radius);
575
+ background: var(--bg);
576
+ color: var(--fg);
577
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
578
+ font-size: 12.5px;
579
+ transition: border-color 0.12s;
580
+ }
581
+
582
+ .admin-slug-input::placeholder { color: var(--fg-subtle); }
583
+ .admin-slug-input:focus { outline: none; border-color: var(--border-strong); }
584
+ .admin-slug-note { white-space: nowrap; }
585
+
586
+ /* Who the post is filed under, when there is nobody else to file it under.
587
+ A menu of one is a control that cannot be used. */
588
+ .admin-author {
589
+ display: flex;
590
+ align-items: center;
591
+ gap: 8px;
592
+ font-size: 13.5px;
593
+ }
594
+
595
+ .admin-author-avatar {
596
+ width: 28px;
597
+ height: 28px;
598
+ border-radius: 999px;
599
+ object-fit: cover;
600
+ }
601
+
602
+ /* A checkbox list that scrolls rather than pushing the rest of the sidebar
603
+ off the screen. A site with eighty categories is normal. */
604
+ .admin-term-list {
605
+ max-height: 12rem;
606
+ overflow-y: auto;
607
+ padding: 0.5rem 0.625rem;
608
+ border: 1px solid var(--border);
609
+ border-radius: var(--radius);
610
+ background: var(--bg);
611
+ }
612
+
613
+ .admin-term-option {
614
+ display: flex;
615
+ align-items: center;
616
+ gap: 0.5rem;
617
+ padding: 0.1875rem 0;
618
+ font-size: 0.875rem;
619
+ cursor: pointer;
620
+ }
621
+
622
+ .admin-term-option input { cursor: pointer; }
623
+ .admin-term-option:hover { color: var(--accent); }
624
+
625
+ /* Searching a taxonomy and adding to it are the same field, so it is a
626
+ full-width input above the list rather than half of a row shared with a
627
+ button. The appearance is reset because WebKit styles type=search itself
628
+ otherwise, ignoring the height and padding every other admin input has —
629
+ and a backtick in here would end the template literal this lives in. */
630
+ .admin-term-search {
631
+ appearance: none;
632
+ margin-bottom: 0.5rem;
633
+ }
634
+
635
+ .admin-term-search::-webkit-search-cancel-button { cursor: pointer; }
636
+
637
+ .admin-term-empty {
638
+ margin: 0;
639
+ color: var(--fg-muted);
640
+ font-size: 0.875rem;
641
+ }
642
+
643
+ .admin-term-add {
644
+ margin-top: 0.625rem;
645
+ padding: 0;
646
+ border: none;
647
+ background: none;
648
+ color: var(--accent);
649
+ font-size: 0.875rem;
650
+ cursor: pointer;
651
+ }
652
+
653
+ .admin-term-add:hover { text-decoration: underline; }
654
+
655
+ /* While the term is being created. Nothing to underline yet. */
656
+ .admin-term-add:disabled { opacity: 0.45; cursor: default; }
657
+ .admin-term-add:disabled:hover { text-decoration: none; }
658
+
659
+ /* What is actually on the post, each removable — so the selection is visible
660
+ without opening anything, and without scrolling a list to find the four
661
+ boxes that happen to be ticked.
662
+
663
+ Above the control rather than below it: the answer comes first, the way to
664
+ change it second. */
665
+ .admin-term-chips {
666
+ display: flex;
667
+ flex-wrap: wrap;
668
+ gap: 0.375rem;
669
+ margin-bottom: 0.625rem;
670
+ }
671
+
672
+ .admin-term-chip {
673
+ display: inline-flex;
674
+ align-items: center;
675
+ gap: 0.375rem;
676
+ padding: 0.1875rem 0.5rem;
677
+ border: 1px solid var(--border-strong);
678
+ border-radius: 999px;
679
+ background: var(--surface);
680
+ font-size: 0.8125rem;
681
+ }
682
+
683
+ .admin-term-chip button {
684
+ padding: 0;
685
+ border: none;
686
+ background: none;
687
+ color: var(--fg-muted);
688
+ font-size: 1rem;
689
+ line-height: 1;
690
+ cursor: pointer;
691
+ }
692
+
693
+ .admin-term-chip button:hover { color: var(--danger); }
694
+
695
+ /* --- Markdown editor -------------------------------------------------------
696
+ Every colour here was a hardcoded hex in the component's inline styles: a
697
+ #f9fafb toolbar, #d1d5db borders, a #ffffff preview. Inline styles cannot
698
+ answer to a theme, so the editor stayed lit while the rest of the admin
699
+ went dark. These are the same variables everything else uses. */
700
+
701
+ .markdown-editor-bar {
702
+ display: flex;
703
+ align-items: center;
704
+ gap: 0.25rem;
705
+ flex-wrap: wrap;
706
+ padding: 0.375rem;
707
+ border: 1px solid var(--border);
708
+ border-bottom: none;
709
+ border-radius: var(--radius) var(--radius) 0 0;
710
+ background: var(--surface);
711
+ }
712
+
713
+ .markdown-editor-mark {
714
+ min-width: 2rem;
715
+ padding: 0.25rem 0.5rem;
716
+ border: 1px solid transparent;
717
+ border-radius: 0.25rem;
718
+ background: transparent;
719
+ color: var(--fg);
720
+ font-size: 0.875rem;
721
+ cursor: pointer;
722
+ }
723
+
724
+ .markdown-editor-mark:hover:not(:disabled) { background: var(--surface-hover); }
725
+ .markdown-editor-mark:disabled { opacity: 0.4; cursor: default; }
726
+
727
+ .markdown-editor-tabs { margin-left: auto; display: flex; gap: 0.25rem; }
728
+
729
+ .markdown-editor-tab {
730
+ padding: 0.25rem 0.75rem;
731
+ border: 1px solid var(--border);
732
+ border-radius: 0.25rem;
733
+ background: transparent;
734
+ color: var(--fg-muted);
735
+ font-size: 0.875rem;
736
+ text-transform: capitalize;
737
+ cursor: pointer;
738
+ }
739
+
740
+ .markdown-editor-tab.active {
741
+ background: var(--bg);
742
+ color: var(--fg);
743
+ font-weight: 600;
744
+ }
745
+
746
+ .markdown-editor-input {
747
+ border-radius: 0 0 var(--radius) var(--radius);
748
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
749
+ font-size: 0.875rem;
750
+ line-height: 1.6;
751
+ }
752
+
753
+ .markdown-editor-hint {
754
+ margin: 0.375rem 0 0;
755
+ color: var(--fg-subtle);
756
+ font-size: 0.8125rem;
757
+ }
758
+
759
+ .markdown-editor-error { color: var(--danger); }
760
+ .markdown-editor-empty { color: var(--fg-subtle); }
761
+
762
+ /* The preview had no typography at all — rendered HTML fell back to browser
763
+ defaults inside a page that resets them, so headings, lists and code came
764
+ out flat and cramped. It is a preview; it has to look like prose. */
765
+ .markdown-editor-preview {
766
+ padding: 1rem 1.125rem;
767
+ border: 1px solid var(--border);
768
+ border-radius: 0 0 var(--radius) var(--radius);
769
+ background: var(--bg);
770
+ color: var(--fg);
771
+ overflow-wrap: break-word;
772
+ line-height: 1.7;
773
+ }
774
+
775
+ .markdown-editor-preview > :first-child { margin-top: 0; }
776
+ .markdown-editor-preview > :last-child { margin-bottom: 0; }
777
+
778
+ .markdown-editor-preview h1,
779
+ .markdown-editor-preview h2,
780
+ .markdown-editor-preview h3,
781
+ .markdown-editor-preview h4 {
782
+ margin: 1.6em 0 0.6em;
783
+ line-height: 1.25;
784
+ font-weight: 650;
785
+ color: var(--fg);
786
+ }
787
+
788
+ .markdown-editor-preview h1 { font-size: 1.75rem; }
789
+ .markdown-editor-preview h2 { font-size: 1.4rem; }
790
+ .markdown-editor-preview h3 { font-size: 1.15rem; }
791
+ .markdown-editor-preview h4 { font-size: 1rem; }
792
+
793
+ .markdown-editor-preview p { margin: 0 0 1em; }
794
+
795
+ .markdown-editor-preview ul,
796
+ .markdown-editor-preview ol { margin: 0 0 1em; padding-left: 1.5rem; }
797
+ .markdown-editor-preview li { margin: 0.25em 0; }
798
+ .markdown-editor-preview li > ul,
799
+ .markdown-editor-preview li > ol { margin: 0.25em 0; }
800
+
801
+ .markdown-editor-preview a { color: var(--accent); text-decoration: underline; }
802
+
803
+ .markdown-editor-preview blockquote {
804
+ margin: 0 0 1em;
805
+ padding: 0.25rem 0 0.25rem 1rem;
806
+ border-left: 3px solid var(--border-strong);
807
+ color: var(--fg-muted);
808
+ }
809
+
810
+ .markdown-editor-preview code {
811
+ padding: 0.15em 0.35em;
812
+ border-radius: 0.25rem;
813
+ background: var(--surface);
814
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
815
+ font-size: 0.875em;
816
+ }
817
+
818
+ .markdown-editor-preview pre {
819
+ margin: 0 0 1em;
820
+ padding: 0.875rem 1rem;
821
+ border: 1px solid var(--border);
822
+ border-radius: var(--radius);
823
+ background: var(--surface);
824
+ /* Long lines scroll inside the block rather than widening the editor. */
825
+ overflow-x: auto;
826
+ }
827
+
828
+ .markdown-editor-preview pre code {
829
+ padding: 0;
830
+ background: none;
831
+ font-size: 0.8125rem;
832
+ }
833
+
834
+ .markdown-editor-preview img {
835
+ max-width: 100%;
836
+ height: auto;
837
+ border-radius: var(--radius);
838
+ }
839
+
840
+ .markdown-editor-preview hr {
841
+ margin: 1.75em 0;
842
+ border: none;
843
+ border-top: 1px solid var(--border);
844
+ }
845
+
846
+ .markdown-editor-preview table {
847
+ width: 100%;
848
+ margin: 0 0 1em;
849
+ border-collapse: collapse;
850
+ font-size: 0.9375rem;
851
+ }
852
+
853
+ .markdown-editor-preview th,
854
+ .markdown-editor-preview td {
855
+ padding: 0.5rem 0.625rem;
856
+ border: 1px solid var(--border);
857
+ text-align: left;
858
+ }
859
+
860
+ .markdown-editor-preview th { background: var(--surface); font-weight: 600; }
861
+
862
+ /* Pager for the admin tables. Sits under the table, quiet by default: the
863
+ controls only matter when there is more than one page, and the component
864
+ renders nothing at all in that case. */
865
+ .admin-pagination {
866
+ display: flex;
867
+ align-items: center;
868
+ justify-content: space-between;
869
+ gap: 1rem;
870
+ flex-wrap: wrap;
871
+ margin-top: 1rem;
872
+ padding-top: 1rem;
873
+ border-top: 1px solid var(--border);
874
+ }
875
+
876
+ .admin-pagination-summary {
877
+ margin: 0;
878
+ font-size: 0.8125rem;
879
+ color: var(--muted);
880
+ }
881
+
882
+ .admin-pagination-controls {
883
+ display: flex;
884
+ align-items: center;
885
+ gap: 0.75rem;
886
+ }
887
+
888
+ .admin-pagination-position {
889
+ font-size: 0.8125rem;
890
+ color: var(--muted);
891
+ /* Keeps Previous and Next from shuffling sideways as the digits change. */
892
+ min-width: 9ch;
893
+ text-align: center;
894
+ }
895
+
896
+ .admin-pagination .admin-btn:disabled {
897
+ opacity: 0.45;
898
+ cursor: default;
899
+ }
900
+
901
+ .admin-btn-danger {
902
+ background: transparent;
903
+ border-color: var(--border-strong);
904
+ color: var(--danger);
905
+ }
906
+
907
+ .admin-btn-danger:hover { background: var(--tint-danger); border-color: var(--danger); }
908
+
909
+ /* --- Forms ------------------------------------------------------------- */
910
+
911
+ .admin-form-group { margin-bottom: 16px; }
912
+
913
+ .admin-label {
914
+ display: block;
915
+ margin-bottom: 6px;
916
+ font-size: 12.5px;
917
+ font-weight: 500;
918
+ color: var(--fg-muted);
919
+ }
920
+
921
+ .admin-input,
922
+ .admin-select,
923
+ .admin-textarea {
924
+ width: 100%;
925
+ min-height: 32px;
926
+ padding: 6px 10px;
927
+ border: 1px solid var(--border-strong);
928
+ border-radius: var(--radius);
929
+ background: var(--surface);
930
+ color: var(--fg);
931
+ font-family: inherit;
932
+ font-size: 13.5px;
933
+ line-height: 1.4;
934
+ transition: border-color 0.12s, box-shadow 0.12s;
935
+ }
936
+
937
+ .admin-input::placeholder,
938
+ .admin-textarea::placeholder { color: var(--fg-subtle); }
939
+
940
+ .admin-input:focus,
941
+ .admin-select:focus,
942
+ .admin-textarea:focus {
943
+ outline: none;
944
+ border-color: var(--focus);
945
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 18%, transparent);
946
+ }
947
+
948
+ .admin-textarea { min-height: 120px; resize: vertical; }
949
+
950
+ .admin-select {
951
+ appearance: none;
952
+ padding-right: 28px;
953
+ background-image: linear-gradient(45deg, transparent 50%, currentColor 50%),
954
+ linear-gradient(135deg, currentColor 50%, transparent 50%);
955
+ background-position: calc(100% - 15px) 14px, calc(100% - 11px) 14px;
956
+ background-size: 4px 4px, 4px 4px;
957
+ background-repeat: no-repeat;
958
+ }
959
+
960
+ /* --- Table ------------------------------------------------------------- */
961
+
962
+ .admin-table {
963
+ width: 100%;
964
+ border-collapse: collapse;
965
+ font-size: 13.5px;
966
+ }
967
+
968
+ .admin-table th {
969
+ text-align: left;
970
+ padding: 8px 12px;
971
+ color: var(--fg-muted);
972
+ font-weight: 500;
973
+ font-size: 12px;
974
+ text-transform: uppercase;
975
+ letter-spacing: 0.04em;
976
+ border-bottom: 1px solid var(--border);
977
+ white-space: nowrap;
978
+ }
979
+
980
+ .admin-table td {
981
+ padding: 11px 12px;
982
+ border-bottom: 1px solid var(--border);
983
+ vertical-align: middle;
984
+ }
985
+
986
+ .admin-table tr:last-child td { border-bottom: none; }
987
+ .admin-table tbody tr:hover { background: var(--surface-hover); }
988
+
989
+ /* --- Badges ------------------------------------------------------------ */
990
+
991
+ .admin-badge {
992
+ display: inline-flex;
993
+ align-items: center;
994
+ height: 20px;
995
+ padding: 0 8px;
996
+ border-radius: 999px;
997
+ font-size: 11.5px;
998
+ font-weight: 500;
999
+ background: var(--surface-active);
1000
+ color: var(--fg-muted);
1001
+ white-space: nowrap;
1002
+ }
1003
+
1004
+ .admin-badge-success { background: var(--tint-success); color: var(--success); }
1005
+ .admin-badge-warning { background: var(--tint-warning); color: var(--warning); }
1006
+ .admin-badge-info { background: var(--tint-info); color: var(--info); }
1007
+ .admin-badge-danger { background: var(--tint-danger); color: var(--danger); }
1008
+
1009
+ /* --- States ------------------------------------------------------------ */
1010
+
1011
+ /* Used by every page and previously undefined, so a loading screen was
1012
+ unstyled black text in the corner. */
1013
+ .admin-loading,
1014
+ .admin-empty {
1015
+ padding: 40px 20px;
1016
+ text-align: center;
1017
+ color: var(--fg-muted);
1018
+ font-size: 13.5px;
1019
+ }
1020
+
1021
+ /* Plain links inherit; anything wearing a button class keeps the colour that
1022
+ class gave it. Without the exclusion this rule outranks .admin-btn-primary
1023
+ and paints black text onto the black button. */
1024
+ .admin-layout a:not([class*="admin-btn"]) { color: inherit; text-decoration: none; }
1025
+
1026
+ /* Links in the content area carry no colour of their own — one accent in a
1027
+ neutral interface reads as noise once every table row has one — so the
1028
+ underline on hover is what marks them as links. */
1029
+ .admin-content a:not([class*="admin-btn"]):hover { text-decoration: underline; }
1030
+
1031
+ @media (max-width: 700px) {
1032
+ .admin-sidebar { width: var(--sidebar-w-closed); }
1033
+ .admin-sidebar .admin-nav-label,
1034
+ .admin-sidebar .admin-nav-section-label,
1035
+ .admin-sidebar .admin-logo-text { display: none; }
1036
+ .admin-sidebar .admin-nav-section {
1037
+ height: 0;
1038
+ padding: 0;
1039
+ margin: 9px 6px 8px;
1040
+ border-top: 1px solid var(--border);
1041
+ }
1042
+ .admin-main { margin-left: var(--sidebar-w-closed); }
1043
+ .admin-content { padding: 16px; }
1044
+ .admin-header { padding: 0 16px; }
1045
+ }
1046
+ `;