@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,7 @@
1
+ import { ReactNode } from 'react';
2
+ interface BackLinkProps {
3
+ onClick: () => void;
4
+ children: ReactNode;
5
+ }
6
+ export declare function BackLink({ onClick, children }: BackLinkProps): import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1,6 @@
1
+ import { jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useTheme } from "./ThemeContext.js";
3
+ export function BackLink({ onClick, children }) {
4
+ const { t } = useTheme();
5
+ return (_jsxs("button", { onClick: onClick, className: `text-sm ${t.muted} mb-4 hover:underline`, children: ["\u2190 ", children] }));
6
+ }
@@ -0,0 +1,7 @@
1
+ import { ButtonHTMLAttributes, ReactNode } from 'react';
2
+ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
3
+ variant?: 'primary' | 'secondary' | 'danger' | 'ghost';
4
+ children: ReactNode;
5
+ }
6
+ export declare function Button({ variant, children, className, ...props }: ButtonProps): import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useTheme } from "./ThemeContext.js";
3
+ export function Button({ variant = 'primary', children, className = '', ...props }) {
4
+ const { t } = useTheme();
5
+ const styles = {
6
+ primary: `${t.btn} ${t.btnHover}`,
7
+ secondary: t.btnSecondary,
8
+ danger: 'bg-red-500/10 text-red-500 hover:bg-red-500/20',
9
+ ghost: `${t.muted} hover:opacity-70`
10
+ };
11
+ return (_jsx("button", { className: `text-sm font-medium rounded-full px-4 py-2 transition disabled:opacity-50 ${styles[variant]} ${className}`, ...props, children: children }));
12
+ }
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ interface CardProps {
3
+ children: ReactNode;
4
+ className?: string;
5
+ }
6
+ export declare function Card({ children, className }: CardProps): import("react").JSX.Element;
7
+ export {};
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useTheme } from "./ThemeContext.js";
3
+ export function Card({ children, className = '' }) {
4
+ const { t } = useTheme();
5
+ return (_jsx("div", { className: `p-4 rounded-xl ${t.card} border ${t.border} ${className}`, children: children }));
6
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The comments under a post: the approved thread, and a form to join it.
3
+ *
4
+ * Threaded to the depth the server allows (`form.max_depth`); the Reply
5
+ * button simply stops appearing at the last level rather than letting a
6
+ * reader write something the server will refuse.
7
+ *
8
+ * The form carries two things a person never notices. A signed timestamp
9
+ * from the list response, which tells the server how long the form was open —
10
+ * a bot posts back in milliseconds. And a honeypot field, kept off-screen and
11
+ * out of the tab order, that only a form-filling bot ever completes.
12
+ */
13
+ export declare function CommentThread({ postId }: {
14
+ postId: number | string;
15
+ }): import("react").JSX.Element;
@@ -0,0 +1,101 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState, useEffect } from 'react';
3
+ import { useAuth } from '@basicbenframework/core/client';
4
+ import { useTheme } from "./ThemeContext.js";
5
+ import { Card } from "./Card.js";
6
+ import { Avatar } from "./Avatar.js";
7
+ import { Button } from "./Button.js";
8
+ import { Input } from "./Input.js";
9
+ import { Textarea } from "./Textarea.js";
10
+ import { Alert } from "./Alert.js";
11
+ import { api } from "../../helpers/api.js";
12
+ function countAll(comments) {
13
+ return comments.reduce((n, c) => n + 1 + countAll(c.replies ?? []), 0);
14
+ }
15
+ /**
16
+ * The comments under a post: the approved thread, and a form to join it.
17
+ *
18
+ * Threaded to the depth the server allows (`form.max_depth`); the Reply
19
+ * button simply stops appearing at the last level rather than letting a
20
+ * reader write something the server will refuse.
21
+ *
22
+ * The form carries two things a person never notices. A signed timestamp
23
+ * from the list response, which tells the server how long the form was open —
24
+ * a bot posts back in milliseconds. And a honeypot field, kept off-screen and
25
+ * out of the tab order, that only a form-filling bot ever completes.
26
+ */
27
+ export function CommentThread({ postId }) {
28
+ const { t } = useTheme();
29
+ const [comments, setComments] = useState([]);
30
+ const [form, setForm] = useState(null);
31
+ const [replyTo, setReplyTo] = useState(null);
32
+ const [notice, setNotice] = useState(null);
33
+ const load = () => api(`/api/posts/${postId}/comments`)
34
+ .then(data => {
35
+ setComments(data.comments ?? []);
36
+ setForm(data.form ?? null);
37
+ })
38
+ .catch(() => setComments([]));
39
+ useEffect(() => { load(); }, [postId]);
40
+ // Arriving from a notification email's #comment-123 link: the comments
41
+ // load after the page, so the browser's own jump to the anchor has already
42
+ // happened and found nothing.
43
+ useEffect(() => {
44
+ const hash = typeof window !== 'undefined' ? window.location.hash : '';
45
+ if (hash.startsWith('#comment-'))
46
+ document.getElementById(hash.slice(1))?.scrollIntoView();
47
+ }, [comments]);
48
+ const posted = (message) => {
49
+ setNotice(message);
50
+ setReplyTo(null);
51
+ // Reloaded either way: an approved comment appears, and the form gets a
52
+ // fresh token for the next one.
53
+ load();
54
+ };
55
+ const total = countAll(comments);
56
+ return (_jsxs(Card, { className: "p-6 mt-4", children: [_jsx("h2", { className: "text-lg font-semibold mb-4", children: total === 0 ? 'Comments' : `${total} comment${total === 1 ? '' : 's'}` }), notice && _jsx("div", { className: "mb-4", children: _jsx(Alert, { type: "success", children: notice }) }), comments.length === 0 && (_jsx("p", { className: `text-sm ${t.muted} mb-4`, children: "No comments yet." })), _jsx("ol", { className: "space-y-4 mb-6", children: comments.map(comment => (_jsx(CommentItem, { comment: comment, depth: 1, form: form, postId: postId, replyTo: replyTo, onReply: setReplyTo, onPosted: posted }, comment.id))) }), form?.open
57
+ ? replyTo === null && _jsx(CommentForm, { postId: postId, form: form, onPosted: posted })
58
+ : form && _jsx("p", { className: `text-sm ${t.muted}`, children: "Comments are closed." })] }));
59
+ }
60
+ function CommentItem({ comment, depth, form, postId, replyTo, onReply, onPosted }) {
61
+ const { t } = useTheme();
62
+ const name = comment.author_name || 'Anonymous';
63
+ const canReply = !!form?.open && depth < (form?.max_depth ?? 1);
64
+ return (_jsxs("li", { id: `comment-${comment.id}`, children: [_jsxs("div", { className: "flex gap-3", children: [_jsx(Avatar, { name: name, size: "sm" }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("p", { className: "text-sm", children: [_jsx("span", { className: "font-medium", children: name }), Boolean(comment.verified) && _jsx("span", { className: `${t.muted} text-xs`, children: " \u2022 member" }), _jsxs("span", { className: `${t.muted} text-xs`, children: [" \u2022 ", new Date(comment.created_at).toLocaleDateString()] })] }), _jsx("p", { className: "text-sm whitespace-pre-wrap break-words mt-1", children: comment.content }), canReply && (_jsx("button", { type: "button", className: `text-xs ${t.muted} hover:opacity-70 mt-1`, onClick: () => onReply(replyTo === comment.id ? null : comment.id), children: replyTo === comment.id ? 'Cancel reply' : 'Reply' })), replyTo === comment.id && form && (_jsx("div", { className: "mt-3", children: _jsx(CommentForm, { postId: postId, form: form, parentId: comment.id, parentName: name, onPosted: onPosted }) }))] })] }), comment.replies && comment.replies.length > 0 && (_jsx("ol", { className: `mt-4 space-y-4 pl-4 border-l ${t.border}`, children: comment.replies.map(reply => (_jsx(CommentItem, { comment: reply, depth: depth + 1, form: form, postId: postId, replyTo: replyTo, onReply: onReply, onPosted: onPosted }, reply.id))) }))] }));
65
+ }
66
+ function CommentForm({ postId, form, parentId, parentName, onPosted }) {
67
+ const { t } = useTheme();
68
+ const { user } = useAuth();
69
+ const [content, setContent] = useState('');
70
+ const [authorName, setAuthorName] = useState('');
71
+ const [authorEmail, setAuthorEmail] = useState('');
72
+ const [notify, setNotify] = useState(false);
73
+ const [trap, setTrap] = useState('');
74
+ const [error, setError] = useState(null);
75
+ const [sending, setSending] = useState(false);
76
+ const submit = async (e) => {
77
+ e.preventDefault();
78
+ setError(null);
79
+ setSending(true);
80
+ try {
81
+ const res = await api.post(`/api/posts/${postId}/comments`, {
82
+ content,
83
+ ...(user ? {} : { author_name: authorName, author_email: authorEmail }),
84
+ parent_id: parentId,
85
+ notify_replies: notify,
86
+ form_token: form.token,
87
+ [form.honeypot]: trap
88
+ });
89
+ setContent('');
90
+ onPosted(res?.message || 'Comment posted.');
91
+ }
92
+ catch (err) {
93
+ setError(err.message);
94
+ }
95
+ finally {
96
+ setSending(false);
97
+ }
98
+ };
99
+ const id = `comment-form-${parentId ?? 'new'}`;
100
+ return (_jsxs("form", { onSubmit: submit, className: "space-y-3", children: [_jsx("label", { htmlFor: `${id}-content`, className: "text-sm font-medium block", children: parentId ? `Reply to ${parentName}` : 'Leave a comment' }), _jsx(Textarea, { id: `${id}-content`, rows: parentId ? 3 : 4, value: content, onChange: e => setContent(e.target.value), required: true, minLength: 3, maxLength: 2000 }), !user && (_jsxs("div", { className: "grid gap-3 sm:grid-cols-2", children: [_jsx(Input, { "aria-label": "Name", placeholder: "Name", value: authorName, onChange: e => setAuthorName(e.target.value), required: true, minLength: 2, maxLength: 100 }), _jsx(Input, { "aria-label": "Email", placeholder: "Email (never shown)", type: "email", value: authorEmail, onChange: e => setAuthorEmail(e.target.value), required: true })] })), _jsx("div", { "aria-hidden": "true", style: { position: 'absolute', left: '-10000px', width: 1, height: 1, overflow: 'hidden' }, children: _jsxs("label", { children: ["Leave this empty", _jsx("input", { type: "text", name: form.honeypot, tabIndex: -1, autoComplete: "off", value: trap, onChange: e => setTrap(e.target.value) })] }) }), _jsxs("label", { className: `flex items-center gap-2 text-sm ${t.muted}`, children: [_jsx("input", { type: "checkbox", checked: notify, onChange: e => setNotify(e.target.checked) }), "Email me when someone replies"] }), error && _jsx(Alert, { children: error }), _jsx(Button, { type: "submit", disabled: sending, children: sending ? 'Sending…' : parentId ? 'Post reply' : 'Post comment' })] }));
101
+ }
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ interface EmptyProps {
3
+ children: ReactNode;
4
+ }
5
+ export declare function Empty({ children }: EmptyProps): import("react").JSX.Element;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useTheme } from "./ThemeContext.js";
3
+ export function Empty({ children }) {
4
+ const { t } = useTheme();
5
+ return _jsx("p", { className: `text-center ${t.muted} py-12`, children: children });
6
+ }
@@ -0,0 +1,6 @@
1
+ import { InputHTMLAttributes } from 'react';
2
+ interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
3
+ type?: string;
4
+ }
5
+ export declare function Input({ type, className, ...props }: InputProps): import("react").JSX.Element;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useTheme } from "./ThemeContext.js";
3
+ export function Input({ type = 'text', className = '', ...props }) {
4
+ const { t } = useTheme();
5
+ return (_jsx("input", { type: type, className: `w-full px-3 py-2 text-sm rounded-lg ${t.card} border ${t.border} focus:outline-none ${className}`, ...props }));
6
+ }
@@ -0,0 +1,31 @@
1
+ import type { AnchorHTMLAttributes, ReactNode } from 'react';
2
+ interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
3
+ href: string;
4
+ children: ReactNode;
5
+ }
6
+ /**
7
+ * An internal link that navigates without reloading the document.
8
+ *
9
+ * The admin was built from plain `<a href>`, so every click tore down the app
10
+ * and fetched the page again: a white flash, the bundle re-parsed, every
11
+ * request re-issued, and any unsaved state gone. On a single-page app that is
12
+ * all avoidable — the router already knows how to swap the view.
13
+ *
14
+ * This stays an `<a>` rather than becoming a button, because the anchor is
15
+ * doing real work beyond the click. It gives the browser something to show in
16
+ * the status bar, something to copy from the context menu, something to open
17
+ * in a new tab, and it tells assistive technology this is a link and where it
18
+ * goes. A button with an onClick has none of that.
19
+ *
20
+ * So the element is unchanged and only the plain left-click is intercepted.
21
+ * Everything that should still reach the browser does:
22
+ *
23
+ * - modified clicks (cmd, ctrl, shift, alt) — open in a tab or window
24
+ * - middle-click, and anything that is not the primary button
25
+ * - a link with a `target`
26
+ * - a click something upstream has already handled
27
+ *
28
+ * External links pass straight through, so this is safe to use for any href.
29
+ */
30
+ export declare function Link({ href, children, onClick, ...rest }: LinkProps): import("react").JSX.Element;
31
+ export {};
@@ -0,0 +1,49 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useNavigate } from '@basicbenframework/core/client';
3
+ /**
4
+ * An internal link that navigates without reloading the document.
5
+ *
6
+ * The admin was built from plain `<a href>`, so every click tore down the app
7
+ * and fetched the page again: a white flash, the bundle re-parsed, every
8
+ * request re-issued, and any unsaved state gone. On a single-page app that is
9
+ * all avoidable — the router already knows how to swap the view.
10
+ *
11
+ * This stays an `<a>` rather than becoming a button, because the anchor is
12
+ * doing real work beyond the click. It gives the browser something to show in
13
+ * the status bar, something to copy from the context menu, something to open
14
+ * in a new tab, and it tells assistive technology this is a link and where it
15
+ * goes. A button with an onClick has none of that.
16
+ *
17
+ * So the element is unchanged and only the plain left-click is intercepted.
18
+ * Everything that should still reach the browser does:
19
+ *
20
+ * - modified clicks (cmd, ctrl, shift, alt) — open in a tab or window
21
+ * - middle-click, and anything that is not the primary button
22
+ * - a link with a `target`
23
+ * - a click something upstream has already handled
24
+ *
25
+ * External links pass straight through, so this is safe to use for any href.
26
+ */
27
+ export function Link({ href, children, onClick, ...rest }) {
28
+ const navigate = useNavigate();
29
+ const isInternal = href.startsWith('/') && !href.startsWith('//');
30
+ function handleClick(event) {
31
+ onClick?.(event);
32
+ if (event.defaultPrevented)
33
+ return;
34
+ if (!isInternal)
35
+ return;
36
+ if (rest.target)
37
+ return;
38
+ // `button === 0` is the primary button; the modifiers are the browser's own
39
+ // shortcuts for opening elsewhere. Swallowing either would take away a
40
+ // behaviour the anchor is expected to have.
41
+ if (event.button !== 0)
42
+ return;
43
+ if (event.metaKey || event.ctrlKey || event.shiftKey || event.altKey)
44
+ return;
45
+ event.preventDefault();
46
+ navigate(href);
47
+ }
48
+ return (_jsx("a", { href: href, onClick: handleClick, ...rest, children: children }));
49
+ }
@@ -0,0 +1 @@
1
+ export declare function Loading(): import("react").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useTheme } from "./ThemeContext.js";
3
+ export function Loading() {
4
+ const { t } = useTheme();
5
+ return _jsx("div", { className: `text-center ${t.muted} py-12`, children: "Loading..." });
6
+ }
@@ -0,0 +1,5 @@
1
+ interface LogoProps {
2
+ className?: string;
3
+ }
4
+ export declare function Logo({ className }: LogoProps): import("react").JSX.Element;
5
+ export {};
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export function Logo({ className = "w-6 h-6" }) {
3
+ return (_jsxs("svg", { viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", className: className, children: [_jsx("rect", { x: "2", y: "2", width: "28", height: "28", rx: "6", fill: "currentColor", fillOpacity: "0.1", stroke: "currentColor", strokeWidth: "2" }), _jsx("path", { d: "M10 8C10 8 8 8 8 10V14C8 16 10 16 10 16C10 16 8 16 8 18V22C8 24 10 24 10 24", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M22 8C22 8 24 8 24 10V14C24 16 22 16 22 16C22 16 24 16 24 18V22C24 24 22 24 22 24", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("circle", { cx: "16", cy: "16", r: "3", fill: "currentColor" })] }));
4
+ }
@@ -0,0 +1,41 @@
1
+ import React from 'react';
2
+ /**
3
+ * Markdown editor with a live preview.
4
+ *
5
+ * ## Why a textarea and not CodeMirror
6
+ *
7
+ * CodeMirror 6 would add syntax highlighting, and about a dozen packages to a
8
+ * framework whose whole premise is that it adds none. What an author actually
9
+ * needs from an editor is to see what they are about to publish, and that comes
10
+ * from the preview rather than from coloured asterisks in the source pane.
11
+ *
12
+ * A block editor like TipTap was the other candidate and is the wrong shape
13
+ * here: it wants to own the document model, which puts it at odds with Markdown
14
+ * being the source of truth. A blog should outlive the CMS that published it,
15
+ * and that only works if what is stored is the Markdown.
16
+ *
17
+ * ## The preview is the same renderer
18
+ *
19
+ * It calls `renderContentSync`, which is the server's pipeline minus the hook
20
+ * filter — parse, then sanitize, same code. A preview that renders through a
21
+ * different path is not a preview, it is a second opinion.
22
+ */
23
+ interface MarkdownEditorProps {
24
+ name: string;
25
+ value: string;
26
+ /** Takes the same handler a plain <textarea> would, so it drops into an existing form. */
27
+ onChange: (event: React.ChangeEvent<HTMLTextAreaElement>) => void;
28
+ placeholder?: string;
29
+ minHeight?: string;
30
+ required?: boolean;
31
+ /**
32
+ * Extra toolbar controls that drop text in at the caret — the post editor's
33
+ * snippet picker. Given the same insert the media button uses, so a caller
34
+ * adds a control without reaching into the textarea.
35
+ */
36
+ tools?: (insert: (text: string) => void, disabled: boolean) => React.ReactNode;
37
+ /** Make the source read-only, e.g. while someone else holds the post's edit lock. */
38
+ readOnly?: boolean;
39
+ }
40
+ export default function MarkdownEditor({ name, value, onChange, placeholder, minHeight, required, tools, readOnly }: MarkdownEditorProps): React.JSX.Element;
41
+ export {};
@@ -0,0 +1,156 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo, useRef, useState } from 'react';
3
+ import { renderContentSync } from '@basicbenframework/core/content';
4
+ import MediaPicker, { markdownFor } from "./admin/MediaPicker.js";
5
+ import { t, useT } from "../i18n/index.js";
6
+ /** The toolbar, in the current language: the titles and the text inserted when nothing is selected. */
7
+ function marks() {
8
+ return [
9
+ { id: 'bold', label: 'B', title: t('Bold (⌘B)'), before: '**', after: '**', placeholder: t('bold text') },
10
+ { id: 'italic', label: 'I', title: t('Italic (⌘I)'), before: '_', after: '_', placeholder: t('italic text') },
11
+ { id: 'strike', label: 'S', title: t('Strikethrough'), before: '~~', after: '~~', placeholder: t('struck out') },
12
+ { id: 'code', label: '<>', title: t('Code'), before: '`', after: '`', placeholder: t('code') },
13
+ { id: 'heading', label: 'H', title: t('Heading'), before: '', linePrefix: '## ', placeholder: t('Heading') },
14
+ { id: 'quote', label: '"', title: t('Quote'), before: '', linePrefix: '> ', placeholder: t('Quoted') },
15
+ { id: 'bullets', label: '•', title: t('Bulleted list'), before: '', linePrefix: '- ', placeholder: t('Item') },
16
+ { id: 'numbers', label: '1.', title: t('Numbered list'), before: '', linePrefix: '1. ', placeholder: t('Item') },
17
+ { id: 'link', label: '🔗', title: t('Link (⌘K)'), before: '[', after: '](https://)', placeholder: t('link text') }
18
+ ];
19
+ }
20
+ export default function MarkdownEditor({ name, value, onChange, placeholder, minHeight = '400px', required, tools, readOnly = false }) {
21
+ const { t, locale } = useT();
22
+ const MARKS = marks();
23
+ const [mode, setMode] = useState('write');
24
+ const [picking, setPicking] = useState(false);
25
+ const textareaRef = useRef(null);
26
+ // Rendering on every keystroke is wasteful but not slow — a long post takes a
27
+ // couple of milliseconds — and useMemo keeps it off the path when the source
28
+ // has not changed, such as when switching tabs.
29
+ const preview = useMemo(() => {
30
+ try {
31
+ return renderContentSync(value || '');
32
+ }
33
+ catch (error) {
34
+ return `<p class="markdown-editor-error">${t('Preview failed: {message}', { message: error.message })}</p>`;
35
+ }
36
+ }, [value, locale]);
37
+ /**
38
+ * Report a toolbar edit through the same handler a keystroke uses.
39
+ *
40
+ * Toolbar clicks change the value without the browser producing an event, so
41
+ * one is fabricated. Only the fields a form handler reads are supplied, hence
42
+ * the cast — building a whole synthetic React event would add nothing a
43
+ * caller could use.
44
+ */
45
+ const emit = (next) => {
46
+ onChange({
47
+ target: { name, value: next, type: 'textarea' }
48
+ });
49
+ };
50
+ const applyMark = (mark) => {
51
+ const textarea = textareaRef.current;
52
+ if (!textarea)
53
+ return;
54
+ const start = textarea.selectionStart;
55
+ const end = textarea.selectionEnd;
56
+ const selected = value.slice(start, end);
57
+ let next;
58
+ let cursorStart;
59
+ let cursorEnd;
60
+ if (mark.linePrefix) {
61
+ // Line marks apply to whole lines, so the selection is widened to line
62
+ // boundaries first — otherwise selecting mid-sentence inserts a '> ' into
63
+ // the middle of it.
64
+ const lineStart = value.lastIndexOf('\n', start - 1) + 1;
65
+ const lineEnd = value.indexOf('\n', end) === -1 ? value.length : value.indexOf('\n', end);
66
+ const block = value.slice(lineStart, lineEnd) || mark.placeholder || '';
67
+ const already = block.split('\n').every((line) => line.startsWith(mark.linePrefix));
68
+ const marked = block
69
+ .split('\n')
70
+ .map((line) => (already ? line.slice(mark.linePrefix.length) : mark.linePrefix + line))
71
+ .join('\n');
72
+ next = value.slice(0, lineStart) + marked + value.slice(lineEnd);
73
+ cursorStart = lineStart;
74
+ cursorEnd = lineStart + marked.length;
75
+ }
76
+ else {
77
+ const body = selected || mark.placeholder || '';
78
+ const after = mark.after ?? '';
79
+ // Toggle off when the mark is already there, so clicking B twice undoes it
80
+ // rather than producing ****text****.
81
+ const wrapped = selected &&
82
+ value.slice(start - mark.before.length, start) === mark.before &&
83
+ value.slice(end, end + after.length) === after;
84
+ if (wrapped) {
85
+ next = value.slice(0, start - mark.before.length) + selected + value.slice(end + after.length);
86
+ cursorStart = start - mark.before.length;
87
+ cursorEnd = cursorStart + selected.length;
88
+ }
89
+ else {
90
+ next = value.slice(0, start) + mark.before + body + after + value.slice(end);
91
+ cursorStart = start + mark.before.length;
92
+ cursorEnd = cursorStart + body.length;
93
+ }
94
+ }
95
+ emit(next);
96
+ // The value lands via React state, so the selection has to be restored
97
+ // after the re-render or the caret jumps to the end.
98
+ requestAnimationFrame(() => {
99
+ textarea.focus();
100
+ textarea.setSelectionRange(cursorStart, cursorEnd);
101
+ });
102
+ };
103
+ /**
104
+ * Drop text in at the caret, replacing any selection.
105
+ *
106
+ * Used by the media picker, which produces a finished piece of Markdown
107
+ * rather than wrapping what is already there the way the toolbar marks do.
108
+ */
109
+ const insertAtCursor = (text) => {
110
+ const textarea = textareaRef.current;
111
+ const start = textarea ? textarea.selectionStart : value.length;
112
+ const end = textarea ? textarea.selectionEnd : value.length;
113
+ emit(value.slice(0, start) + text + value.slice(end));
114
+ requestAnimationFrame(() => {
115
+ textarea?.focus();
116
+ textarea?.setSelectionRange(start + text.length, start + text.length);
117
+ });
118
+ };
119
+ const handleKeyDown = (event) => {
120
+ if (event.key === 'Tab') {
121
+ // Tab indents rather than leaving the field: inside a Markdown editor a
122
+ // tab almost always means "nest this list item".
123
+ event.preventDefault();
124
+ const textarea = event.currentTarget;
125
+ const start = textarea.selectionStart;
126
+ const next = `${value.slice(0, start)} ${value.slice(textarea.selectionEnd)}`;
127
+ emit(next);
128
+ requestAnimationFrame(() => textarea.setSelectionRange(start + 2, start + 2));
129
+ return;
130
+ }
131
+ if (!event.metaKey && !event.ctrlKey)
132
+ return;
133
+ const shortcuts = { b: 'bold', i: 'italic', k: 'link' };
134
+ const id = shortcuts[event.key.toLowerCase()];
135
+ if (!id)
136
+ return;
137
+ const mark = MARKS.find((m) => m.id === id);
138
+ if (!mark)
139
+ return;
140
+ event.preventDefault();
141
+ applyMark(mark);
142
+ };
143
+ return (_jsxs("div", { className: "markdown-editor", children: [_jsxs("div", { className: "markdown-editor-bar", children: [MARKS.map((mark) => (_jsx("button", { type: "button", title: mark.title, onClick: () => applyMark(mark), disabled: mode === 'preview', className: "markdown-editor-mark", style: {
144
+ fontWeight: mark.label === 'B' ? 700 : 400,
145
+ fontStyle: mark.label === 'I' ? 'italic' : 'normal',
146
+ textDecoration: mark.label === 'S' ? 'line-through' : 'none'
147
+ }, children: mark.label }, mark.id))), _jsx("button", { type: "button", title: t('Insert media'), onClick: () => setPicking(true), disabled: mode === 'preview', className: "markdown-editor-mark", children: "\uD83D\uDDBC" }), tools?.(insertAtCursor, mode === 'preview' || readOnly), _jsx("div", { className: "markdown-editor-tabs", children: ['write', 'preview'].map((tab) => (_jsx("button", { type: "button", onClick: () => setMode(tab), className: `markdown-editor-tab ${mode === tab ? 'active' : ''}`, children: tab === 'write' ? t('Write') : t('Preview') }, tab))) })] }), mode === 'write' ? (_jsx("textarea", { ref: textareaRef, name: name, value: value, onChange: onChange, onKeyDown: handleKeyDown, className: "admin-textarea markdown-editor-input", style: { minHeight }, placeholder: placeholder, required: required, readOnly: readOnly })) : (_jsx("div", { className: "markdown-editor-preview", style: { minHeight },
148
+ // The HTML here came from renderContentSync, which sanitizes against
149
+ // the same allowlist the server uses before storing anything.
150
+ dangerouslySetInnerHTML: {
151
+ __html: preview || `<p class="markdown-editor-empty">${t('Nothing to preview yet.')}</p>`
152
+ } })), _jsx("p", { className: "markdown-editor-hint", children: t('Markdown supported — headings, lists, links, tables, and fenced code. HTML is shown as text rather than rendered.') }), picking && (_jsx(MediaPicker, { onClose: () => setPicking(false), onSelect: (item) => {
153
+ insertAtCursor(markdownFor(item));
154
+ setPicking(false);
155
+ } }))] }));
156
+ }
@@ -0,0 +1,6 @@
1
+ interface DarkModeToggleProps {
2
+ dark: boolean;
3
+ setDark: (dark: boolean) => void;
4
+ }
5
+ export declare function DarkModeToggle({ dark, setDark }: DarkModeToggleProps): import("react").JSX.Element;
6
+ export {};
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useTheme } from "../ThemeContext.js";
3
+ export function DarkModeToggle({ dark, setDark }) {
4
+ const { t } = useTheme();
5
+ return (_jsx("button", { onClick: () => setDark(!dark), className: `p-2 rounded-lg ${t.card} transition`, "aria-label": dark ? 'Switch to light mode' : 'Switch to dark mode', children: dark ? (_jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z" }) })) : (_jsx("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z" }) })) }));
6
+ }
@@ -0,0 +1,8 @@
1
+ import type { User } from '../../../types/index.ts';
2
+ interface DesktopNavProps {
3
+ user: User | null;
4
+ navigate: (path: string) => void;
5
+ logout: () => void;
6
+ }
7
+ export declare function DesktopNav({ user, navigate, logout }: DesktopNavProps): import("react").JSX.Element;
8
+ export {};
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useTheme } from "../ThemeContext.js";
3
+ import { NavLink } from "../NavLink.js";
4
+ import { Button } from "../Button.js";
5
+ import { DarkModeToggle } from "./DarkModeToggle.js";
6
+ export function DesktopNav({ user, navigate, logout }) {
7
+ const { t, dark, setDark } = useTheme();
8
+ return (_jsxs("div", { className: "hidden sm:flex items-center gap-2", children: [!__DISABLE_PUBLIC_SITE__ && _jsx(NavLink, { onClick: () => navigate('/docs'), children: "Docs" }), _jsx("div", { className: `w-px h-5 mx-1 ${dark ? 'bg-white/20' : 'bg-black/20'}` }), _jsx(DarkModeToggle, { dark: dark, setDark: setDark }), user ? (_jsxs(_Fragment, { children: [!__DISABLE_PUBLIC_SITE__ && _jsx(NavLink, { onClick: () => navigate('/feed'), children: "Feed" }), _jsx(NavLink, { onClick: () => navigate('/posts'), children: "My Posts" }), _jsx(NavLink, { onClick: () => navigate('/profile'), children: "Profile" }), _jsx(Button, { variant: "secondary", onClick: logout, className: "px-3 py-1.5", children: "Log out" })] })) : (_jsxs(_Fragment, { children: [_jsx(NavLink, { onClick: () => navigate('/login'), children: "Sign in" }), !__DISABLE_REGISTRATION__ && (_jsx(Button, { onClick: () => navigate('/register'), className: "px-3 py-1.5", children: "Get started" }))] }))] }));
9
+ }
@@ -0,0 +1,9 @@
1
+ import type { User } from '../../../types/index.ts';
2
+ interface MobileNavProps {
3
+ user: User | null;
4
+ navigate: (path: string) => void;
5
+ onClose: () => void;
6
+ logout: () => void;
7
+ }
8
+ export declare function MobileNav({ user, navigate, onClose, logout }: MobileNavProps): import("react").JSX.Element;
9
+ export {};
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useTheme } from "../ThemeContext.js";
3
+ import { Logo } from "../Logo.js";
4
+ export function MobileNav({ user, navigate, onClose, logout }) {
5
+ const { t } = useTheme();
6
+ const handleNav = (view) => {
7
+ navigate(view);
8
+ onClose();
9
+ };
10
+ const handleLogout = () => {
11
+ logout();
12
+ onClose();
13
+ };
14
+ return (_jsx("div", { className: `fixed inset-0 z-50 ${t.bg} ${t.text}`, children: _jsxs("div", { className: "flex flex-col h-full", children: [_jsxs("div", { className: `flex items-center justify-between h-14 px-6 border-b ${t.border}`, children: [_jsxs("span", { className: "flex items-center gap-2 font-semibold", children: [_jsx(Logo, { className: "w-5 h-5" }), _jsx("span", { children: "BasicBen" })] }), _jsx("button", { onClick: onClose, className: `p-2 rounded-lg ${t.card} transition`, "aria-label": "Close menu", children: _jsx("svg", { className: "w-5 h-5", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })] }), _jsxs("div", { className: "flex-1 overflow-y-auto px-6 py-4", children: [!__DISABLE_PUBLIC_SITE__ && (_jsxs("div", { className: "space-y-1", children: [_jsx("button", { onClick: () => handleNav('/'), className: `w-full text-left px-4 py-3 rounded-lg ${t.card} hover:opacity-80 transition`, children: "Home" }), _jsx("button", { onClick: () => handleNav('/docs'), className: `w-full text-left px-4 py-3 rounded-lg ${t.card} hover:opacity-80 transition`, children: "Docs" })] })), user ? (_jsxs(_Fragment, { children: [_jsx("div", { className: `my-4 border-t ${t.border}` }), _jsx("p", { className: `px-4 py-2 text-xs font-medium uppercase tracking-wider ${t.muted}`, children: "Account" }), _jsxs("div", { className: "space-y-1", children: [!__DISABLE_PUBLIC_SITE__ && (_jsx("button", { onClick: () => handleNav('/feed'), className: `w-full text-left px-4 py-3 rounded-lg ${t.card} hover:opacity-80 transition`, children: "Feed" })), _jsx("button", { onClick: () => handleNav('/posts'), className: `w-full text-left px-4 py-3 rounded-lg ${t.card} hover:opacity-80 transition`, children: "My Posts" }), _jsx("button", { onClick: () => handleNav('/profile'), className: `w-full text-left px-4 py-3 rounded-lg ${t.card} hover:opacity-80 transition`, children: "Profile" })] }), _jsx("div", { className: `my-4 border-t ${t.border}` }), _jsx("button", { onClick: handleLogout, className: `w-full text-left px-4 py-3 rounded-lg ${t.btnSecondary} transition`, children: "Log out" })] })) : (_jsxs(_Fragment, { children: [_jsx("div", { className: `my-4 border-t ${t.border}` }), _jsxs("div", { className: "space-y-2", children: [_jsx("button", { onClick: () => handleNav('/login'), className: `w-full px-4 py-3 rounded-lg ${t.btnSecondary} transition`, children: "Sign in" }), !__DISABLE_REGISTRATION__ && (_jsx("button", { onClick: () => handleNav('/register'), className: `w-full px-4 py-3 rounded-lg ${t.btn} ${t.btnHover} transition`, children: "Get started" }))] })] }))] })] }) }));
15
+ }
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ interface NavLinkProps {
3
+ onClick: () => void;
4
+ children: ReactNode;
5
+ className?: string;
6
+ }
7
+ export declare function NavLink({ onClick, children, className }: NavLinkProps): import("react").JSX.Element;
8
+ export {};
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useTheme } from "./ThemeContext.js";
3
+ export function NavLink({ onClick, children, className = '' }) {
4
+ const { t } = useTheme();
5
+ return (_jsx("button", { onClick: onClick, className: `text-sm ${t.muted} hover:opacity-70 transition ${className}`, children: children }));
6
+ }
@@ -0,0 +1,8 @@
1
+ import { ReactNode } from 'react';
2
+ interface PageHeaderProps {
3
+ title: string;
4
+ subtitle?: string;
5
+ action?: ReactNode;
6
+ }
7
+ export declare function PageHeader({ title, subtitle, action }: PageHeaderProps): import("react").JSX.Element;
8
+ export {};
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useTheme } from "./ThemeContext.js";
3
+ export function PageHeader({ title, subtitle, action }) {
4
+ const { t } = useTheme();
5
+ return (_jsxs("div", { className: "flex items-start justify-between mb-6 gap-4", children: [_jsxs("div", { children: [_jsx("h1", { className: "text-2xl font-bold", children: title }), subtitle && _jsx("p", { className: `text-sm mt-1 ${t.muted}`, children: subtitle })] }), action] }));
6
+ }
@@ -0,0 +1,8 @@
1
+ import type { Post } from '../../types/index.ts';
2
+ interface PostCardProps {
3
+ post: Post;
4
+ onClick: () => void;
5
+ showAuthor?: boolean;
6
+ }
7
+ export declare function PostCard({ post, onClick, showAuthor }: PostCardProps): import("react").JSX.Element;
8
+ export {};