@commonpub/layer 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (436) hide show
  1. package/LICENSE +661 -0
  2. package/app.vue +7 -0
  3. package/components/AnnouncementBand.vue +117 -0
  4. package/components/AppToast.vue +108 -0
  5. package/components/AuthorCard.vue +119 -0
  6. package/components/AuthorRow.vue +81 -0
  7. package/components/CommentSection.vue +330 -0
  8. package/components/ContentCard.vue +340 -0
  9. package/components/ContentPicker.vue +240 -0
  10. package/components/ContentStarterForm.vue +214 -0
  11. package/components/ContentTypeBadge.vue +46 -0
  12. package/components/CountdownTimer.vue +68 -0
  13. package/components/CpubEditor.vue +87 -0
  14. package/components/DiscussionItem.vue +191 -0
  15. package/components/EditorPropertiesPanel.vue +393 -0
  16. package/components/EngagementBar.vue +131 -0
  17. package/components/FederatedContentCard.vue +291 -0
  18. package/components/FeedItem.vue +283 -0
  19. package/components/FilterChip.vue +21 -0
  20. package/components/HeatmapGrid.vue +92 -0
  21. package/components/ImageUpload.vue +219 -0
  22. package/components/MemberCard.vue +163 -0
  23. package/components/MessageThread.vue +120 -0
  24. package/components/NotificationItem.vue +103 -0
  25. package/components/ProgressTracker.vue +41 -0
  26. package/components/PublishErrorsModal.vue +116 -0
  27. package/components/RemoteActorCard.vue +206 -0
  28. package/components/RemoteUserSearch.vue +117 -0
  29. package/components/SearchFilters.vue +188 -0
  30. package/components/SearchSidebar.vue +181 -0
  31. package/components/SectionHeader.vue +17 -0
  32. package/components/ShareToHubModal.vue +189 -0
  33. package/components/SiteLogo.vue +21 -0
  34. package/components/SkillBar.vue +57 -0
  35. package/components/SortSelect.vue +30 -0
  36. package/components/StatBar.vue +14 -0
  37. package/components/TOCNav.vue +69 -0
  38. package/components/TimelineItem.vue +82 -0
  39. package/components/VideoCard.vue +106 -0
  40. package/components/blocks/BlockBuildStepView.vue +92 -0
  41. package/components/blocks/BlockCalloutView.vue +82 -0
  42. package/components/blocks/BlockCheckpointView.vue +50 -0
  43. package/components/blocks/BlockCodeView.vue +212 -0
  44. package/components/blocks/BlockContentRenderer.vue +143 -0
  45. package/components/blocks/BlockDividerView.vue +11 -0
  46. package/components/blocks/BlockDownloadsView.vue +126 -0
  47. package/components/blocks/BlockEmbedView.vue +61 -0
  48. package/components/blocks/BlockGalleryView.vue +57 -0
  49. package/components/blocks/BlockHeadingView.vue +29 -0
  50. package/components/blocks/BlockImageView.vue +34 -0
  51. package/components/blocks/BlockMarkdownView.vue +118 -0
  52. package/components/blocks/BlockMathView.vue +45 -0
  53. package/components/blocks/BlockPartsListView.vue +104 -0
  54. package/components/blocks/BlockQuizView.vue +239 -0
  55. package/components/blocks/BlockQuoteView.vue +41 -0
  56. package/components/blocks/BlockSectionHeaderView.vue +58 -0
  57. package/components/blocks/BlockSliderView.vue +236 -0
  58. package/components/blocks/BlockTextView.vue +41 -0
  59. package/components/blocks/BlockToolListView.vue +87 -0
  60. package/components/blocks/BlockVideoView.vue +89 -0
  61. package/components/editors/ArticleEditor.vue +545 -0
  62. package/components/editors/BlockCanvas.vue +487 -0
  63. package/components/editors/BlockInsertZone.vue +84 -0
  64. package/components/editors/BlockPicker.vue +285 -0
  65. package/components/editors/BlockWrapper.vue +192 -0
  66. package/components/editors/BlogEditor.vue +567 -0
  67. package/components/editors/EditorBlocks.vue +248 -0
  68. package/components/editors/EditorSection.vue +81 -0
  69. package/components/editors/EditorShell.vue +168 -0
  70. package/components/editors/EditorTagInput.vue +114 -0
  71. package/components/editors/EditorVisibility.vue +110 -0
  72. package/components/editors/ExplainerEditor.vue +503 -0
  73. package/components/editors/MarkdownImportDialog.vue +249 -0
  74. package/components/editors/ProjectEditor.vue +446 -0
  75. package/components/editors/blocks/BuildStepBlock.vue +102 -0
  76. package/components/editors/blocks/CalloutBlock.vue +122 -0
  77. package/components/editors/blocks/CheckpointBlock.vue +27 -0
  78. package/components/editors/blocks/CodeBlock.vue +177 -0
  79. package/components/editors/blocks/DividerBlock.vue +22 -0
  80. package/components/editors/blocks/DownloadsBlock.vue +41 -0
  81. package/components/editors/blocks/EmbedBlock.vue +20 -0
  82. package/components/editors/blocks/GalleryBlock.vue +236 -0
  83. package/components/editors/blocks/HeadingBlock.vue +96 -0
  84. package/components/editors/blocks/ImageBlock.vue +271 -0
  85. package/components/editors/blocks/MarkdownBlock.vue +258 -0
  86. package/components/editors/blocks/MathBlock.vue +37 -0
  87. package/components/editors/blocks/PartsListBlock.vue +358 -0
  88. package/components/editors/blocks/QuizBlock.vue +47 -0
  89. package/components/editors/blocks/QuoteBlock.vue +101 -0
  90. package/components/editors/blocks/SectionHeaderBlock.vue +130 -0
  91. package/components/editors/blocks/SliderBlock.vue +318 -0
  92. package/components/editors/blocks/TextBlock.vue +201 -0
  93. package/components/editors/blocks/ToolListBlock.vue +70 -0
  94. package/components/editors/blocks/VideoBlock.vue +22 -0
  95. package/components/hub/HubDiscussions.vue +47 -0
  96. package/components/hub/HubFeed.vue +199 -0
  97. package/components/hub/HubHero.vue +185 -0
  98. package/components/hub/HubLayout.vue +103 -0
  99. package/components/hub/HubMembers.vue +40 -0
  100. package/components/hub/HubProducts.vue +93 -0
  101. package/components/hub/HubProjects.vue +207 -0
  102. package/components/hub/HubSidebar.vue +12 -0
  103. package/components/hub/HubSidebarCard.vue +35 -0
  104. package/components/views/ArticleView.vue +771 -0
  105. package/components/views/BlogView.vue +667 -0
  106. package/components/views/ExplainerView.vue +688 -0
  107. package/components/views/ProjectView.vue +1500 -0
  108. package/composables/useApiError.ts +39 -0
  109. package/composables/useAuth.ts +87 -0
  110. package/composables/useBlockEditor.ts +187 -0
  111. package/composables/useContentSave.ts +253 -0
  112. package/composables/useContentTypes.ts +37 -0
  113. package/composables/useEngagement.ts +196 -0
  114. package/composables/useFeatures.ts +33 -0
  115. package/composables/useFederation.ts +72 -0
  116. package/composables/useJsonLd.ts +183 -0
  117. package/composables/useMarkdownImport.ts +77 -0
  118. package/composables/useMirrorContent.ts +105 -0
  119. package/composables/useNotifications.ts +73 -0
  120. package/composables/usePublishValidation.ts +65 -0
  121. package/composables/useSanitize.ts +34 -0
  122. package/composables/useSiteName.ts +4 -0
  123. package/composables/useTheme.ts +34 -0
  124. package/composables/useToast.ts +35 -0
  125. package/error.vue +129 -0
  126. package/layouts/admin.vue +213 -0
  127. package/layouts/auth.vue +63 -0
  128. package/layouts/default.vue +269 -0
  129. package/layouts/editor.vue +129 -0
  130. package/middleware/auth.ts +6 -0
  131. package/nuxt.config.ts +83 -0
  132. package/package.json +59 -0
  133. package/pages/[type]/[slug]/edit.vue +676 -0
  134. package/pages/[type]/[slug]/index.vue +313 -0
  135. package/pages/[type]/index.vue +118 -0
  136. package/pages/about.vue +100 -0
  137. package/pages/admin/audit.vue +66 -0
  138. package/pages/admin/content.vue +116 -0
  139. package/pages/admin/federation.vue +446 -0
  140. package/pages/admin/index.vue +62 -0
  141. package/pages/admin/reports.vue +88 -0
  142. package/pages/admin/settings.vue +167 -0
  143. package/pages/admin/users.vue +145 -0
  144. package/pages/auth/forgot-password.vue +103 -0
  145. package/pages/auth/login.vue +216 -0
  146. package/pages/auth/oauth/authorize.vue +178 -0
  147. package/pages/auth/register.vue +246 -0
  148. package/pages/auth/reset-password.vue +124 -0
  149. package/pages/auth/verify-email.vue +80 -0
  150. package/pages/cert/[code].vue +154 -0
  151. package/pages/contests/[slug]/edit.vue +153 -0
  152. package/pages/contests/[slug]/index.vue +556 -0
  153. package/pages/contests/[slug]/judge.vue +160 -0
  154. package/pages/contests/create.vue +192 -0
  155. package/pages/contests/index.vue +69 -0
  156. package/pages/create.vue +219 -0
  157. package/pages/dashboard.vue +521 -0
  158. package/pages/docs/[siteSlug]/[...pagePath].vue +704 -0
  159. package/pages/docs/[siteSlug]/edit.vue +480 -0
  160. package/pages/docs/[siteSlug]/index.vue +380 -0
  161. package/pages/docs/create.vue +60 -0
  162. package/pages/docs/index.vue +181 -0
  163. package/pages/explore.vue +422 -0
  164. package/pages/federated-hubs/[id]/index.vue +385 -0
  165. package/pages/federated-hubs/[id]/posts/[postId].vue +309 -0
  166. package/pages/federation/index.vue +157 -0
  167. package/pages/federation/search.vue +43 -0
  168. package/pages/federation/users/[handle].vue +221 -0
  169. package/pages/feed.vue +135 -0
  170. package/pages/hubs/[slug]/index.vue +513 -0
  171. package/pages/hubs/[slug]/members.vue +134 -0
  172. package/pages/hubs/[slug]/posts/[postId].vue +352 -0
  173. package/pages/hubs/[slug]/settings.vue +254 -0
  174. package/pages/hubs/create.vue +201 -0
  175. package/pages/hubs/index.vue +207 -0
  176. package/pages/index.vue +1005 -0
  177. package/pages/learn/[slug]/[lessonSlug]/edit.vue +413 -0
  178. package/pages/learn/[slug]/[lessonSlug]/index.vue +438 -0
  179. package/pages/learn/[slug]/edit.vue +414 -0
  180. package/pages/learn/[slug]/index.vue +341 -0
  181. package/pages/learn/create.vue +71 -0
  182. package/pages/learn/index.vue +360 -0
  183. package/pages/messages/[conversationId].vue +113 -0
  184. package/pages/messages/index.vue +303 -0
  185. package/pages/mirror/[id].vue +115 -0
  186. package/pages/notifications.vue +91 -0
  187. package/pages/products/[slug].vue +128 -0
  188. package/pages/products/index.vue +122 -0
  189. package/pages/search.vue +692 -0
  190. package/pages/settings/account.vue +170 -0
  191. package/pages/settings/appearance.vue +80 -0
  192. package/pages/settings/index.vue +81 -0
  193. package/pages/settings/notifications.vue +68 -0
  194. package/pages/settings/profile.vue +838 -0
  195. package/pages/tags/[slug].vue +111 -0
  196. package/pages/tags/index.vue +73 -0
  197. package/pages/u/[username]/followers.vue +86 -0
  198. package/pages/u/[username]/following.vue +94 -0
  199. package/pages/u/[username]/index.vue +837 -0
  200. package/pages/videos/[id].vue +212 -0
  201. package/pages/videos/index.vue +327 -0
  202. package/pages/videos/submit.vue +112 -0
  203. package/plugins/auth.ts +23 -0
  204. package/server/api/admin/audit.get.ts +17 -0
  205. package/server/api/admin/content/[id].delete.ts +15 -0
  206. package/server/api/admin/content/[id].patch.ts +37 -0
  207. package/server/api/admin/federation/activity.get.ts +31 -0
  208. package/server/api/admin/federation/clients.get.ts +9 -0
  209. package/server/api/admin/federation/clients.post.ts +16 -0
  210. package/server/api/admin/federation/hub-mirrors/index.get.ts +10 -0
  211. package/server/api/admin/federation/hub-mirrors/index.post.ts +42 -0
  212. package/server/api/admin/federation/mirrors/[id]/backfill.post.ts +39 -0
  213. package/server/api/admin/federation/mirrors/[id].delete.ts +11 -0
  214. package/server/api/admin/federation/mirrors/[id].get.ts +15 -0
  215. package/server/api/admin/federation/mirrors/[id].put.ts +22 -0
  216. package/server/api/admin/federation/mirrors/index.get.ts +9 -0
  217. package/server/api/admin/federation/mirrors/index.post.ts +30 -0
  218. package/server/api/admin/federation/pending.get.ts +22 -0
  219. package/server/api/admin/federation/refederate.post.ts +92 -0
  220. package/server/api/admin/federation/repair-types.post.ts +57 -0
  221. package/server/api/admin/federation/retry.post.ts +41 -0
  222. package/server/api/admin/federation/stats.get.ts +26 -0
  223. package/server/api/admin/reports/[id]/resolve.post.ts +12 -0
  224. package/server/api/admin/reports.get.ts +17 -0
  225. package/server/api/admin/settings.get.ts +22 -0
  226. package/server/api/admin/settings.put.ts +11 -0
  227. package/server/api/admin/stats.get.ts +9 -0
  228. package/server/api/admin/users/[id]/role.put.ts +12 -0
  229. package/server/api/admin/users/[id]/status.put.ts +12 -0
  230. package/server/api/admin/users/[id].delete.ts +10 -0
  231. package/server/api/admin/users.get.ts +18 -0
  232. package/server/api/auth/federated/callback.get.ts +67 -0
  233. package/server/api/auth/federated/login.post.ts +60 -0
  234. package/server/api/auth/oauth2/authorize.get.ts +30 -0
  235. package/server/api/auth/oauth2/authorize.post.ts +51 -0
  236. package/server/api/auth/oauth2/register.post.ts +41 -0
  237. package/server/api/auth/oauth2/token.post.ts +48 -0
  238. package/server/api/cert/[code].get.ts +13 -0
  239. package/server/api/content/[id]/build.post.ts +9 -0
  240. package/server/api/content/[id]/fork.post.ts +10 -0
  241. package/server/api/content/[id]/index.delete.ts +18 -0
  242. package/server/api/content/[id]/index.get.ts +15 -0
  243. package/server/api/content/[id]/index.put.ts +23 -0
  244. package/server/api/content/[id]/products/[productId].delete.ts +28 -0
  245. package/server/api/content/[id]/products-sync.post.ts +29 -0
  246. package/server/api/content/[id]/products.get.ts +9 -0
  247. package/server/api/content/[id]/products.post.ts +31 -0
  248. package/server/api/content/[id]/publish.post.ts +17 -0
  249. package/server/api/content/[id]/report.post.ts +17 -0
  250. package/server/api/content/[id]/versions.get.ts +9 -0
  251. package/server/api/content/[id]/view.post.ts +34 -0
  252. package/server/api/content/index.get.ts +23 -0
  253. package/server/api/content/index.post.ts +11 -0
  254. package/server/api/contests/[slug]/entries.get.ts +18 -0
  255. package/server/api/contests/[slug]/entries.post.ts +23 -0
  256. package/server/api/contests/[slug]/index.delete.ts +21 -0
  257. package/server/api/contests/[slug]/index.get.ts +11 -0
  258. package/server/api/contests/[slug]/index.put.ts +15 -0
  259. package/server/api/contests/[slug]/judge.post.ts +12 -0
  260. package/server/api/contests/[slug]/transition.post.ts +24 -0
  261. package/server/api/contests/index.get.ts +10 -0
  262. package/server/api/contests/index.post.ts +28 -0
  263. package/server/api/docs/[siteSlug]/index.delete.ts +14 -0
  264. package/server/api/docs/[siteSlug]/index.get.ts +17 -0
  265. package/server/api/docs/[siteSlug]/index.put.ts +20 -0
  266. package/server/api/docs/[siteSlug]/nav.get.ts +26 -0
  267. package/server/api/docs/[siteSlug]/pages/[pageId].delete.ts +14 -0
  268. package/server/api/docs/[siteSlug]/pages/[pageId].get.ts +31 -0
  269. package/server/api/docs/[siteSlug]/pages/[pageId].put.ts +15 -0
  270. package/server/api/docs/[siteSlug]/pages/index.get.ts +34 -0
  271. package/server/api/docs/[siteSlug]/pages/index.post.ts +28 -0
  272. package/server/api/docs/[siteSlug]/pages/reorder.post.ts +26 -0
  273. package/server/api/docs/[siteSlug]/search.get.ts +20 -0
  274. package/server/api/docs/[siteSlug]/versions.post.ts +11 -0
  275. package/server/api/docs/index.get.ts +6 -0
  276. package/server/api/docs/index.post.ts +10 -0
  277. package/server/api/federated-hubs/[id]/posts/[postId].get.ts +16 -0
  278. package/server/api/federated-hubs/[id]/posts.get.ts +15 -0
  279. package/server/api/federated-hubs/[id].get.ts +16 -0
  280. package/server/api/federation/boost.post.ts +21 -0
  281. package/server/api/federation/content/[id].get.ts +15 -0
  282. package/server/api/federation/follow.post.ts +16 -0
  283. package/server/api/federation/health.get.ts +56 -0
  284. package/server/api/federation/hub-follow.post.ts +27 -0
  285. package/server/api/federation/hub-post-like.post.ts +115 -0
  286. package/server/api/federation/hub-post-likes.get.ts +24 -0
  287. package/server/api/federation/hub-post-reply.post.ts +42 -0
  288. package/server/api/federation/hub-post.post.ts +33 -0
  289. package/server/api/federation/like.post.ts +21 -0
  290. package/server/api/federation/remote-actor.get.ts +22 -0
  291. package/server/api/federation/reply.post.ts +22 -0
  292. package/server/api/federation/search.post.ts +17 -0
  293. package/server/api/federation/timeline.get.ts +22 -0
  294. package/server/api/federation/unfollow.post.ts +17 -0
  295. package/server/api/files/[id].delete.ts +35 -0
  296. package/server/api/files/mine.get.ts +31 -0
  297. package/server/api/files/upload-from-url.post.ts +68 -0
  298. package/server/api/files/upload.post.ts +105 -0
  299. package/server/api/health.get.ts +4 -0
  300. package/server/api/hubs/[slug]/bans/[userId].delete.ts +13 -0
  301. package/server/api/hubs/[slug]/bans.get.ts +20 -0
  302. package/server/api/hubs/[slug]/bans.post.ts +23 -0
  303. package/server/api/hubs/[slug]/feed.xml.get.ts +60 -0
  304. package/server/api/hubs/[slug]/gallery.get.ts +21 -0
  305. package/server/api/hubs/[slug]/index.delete.ts +18 -0
  306. package/server/api/hubs/[slug]/index.get.ts +14 -0
  307. package/server/api/hubs/[slug]/index.put.ts +22 -0
  308. package/server/api/hubs/[slug]/invites.get.ts +20 -0
  309. package/server/api/hubs/[slug]/invites.post.ts +27 -0
  310. package/server/api/hubs/[slug]/join.post.ts +17 -0
  311. package/server/api/hubs/[slug]/leave.post.ts +13 -0
  312. package/server/api/hubs/[slug]/members/[userId].delete.ts +13 -0
  313. package/server/api/hubs/[slug]/members/[userId].put.ts +16 -0
  314. package/server/api/hubs/[slug]/members.get.ts +20 -0
  315. package/server/api/hubs/[slug]/posts/[postId]/like.post.ts +21 -0
  316. package/server/api/hubs/[slug]/posts/[postId]/lock.post.ts +17 -0
  317. package/server/api/hubs/[slug]/posts/[postId]/pin.post.ts +17 -0
  318. package/server/api/hubs/[slug]/posts/[postId]/replies.get.ts +16 -0
  319. package/server/api/hubs/[slug]/posts/[postId]/replies.post.ts +21 -0
  320. package/server/api/hubs/[slug]/posts/[postId].delete.ts +23 -0
  321. package/server/api/hubs/[slug]/posts/[postId].get.ts +16 -0
  322. package/server/api/hubs/[slug]/posts/index.get.ts +16 -0
  323. package/server/api/hubs/[slug]/posts/index.post.ts +36 -0
  324. package/server/api/hubs/[slug]/products.get.ts +26 -0
  325. package/server/api/hubs/[slug]/products.post.ts +18 -0
  326. package/server/api/hubs/[slug]/share.post.ts +39 -0
  327. package/server/api/hubs/index.get.ts +15 -0
  328. package/server/api/hubs/index.post.ts +11 -0
  329. package/server/api/image-proxy.get.ts +91 -0
  330. package/server/api/learn/[slug]/[lessonSlug]/complete.post.ts +13 -0
  331. package/server/api/learn/[slug]/[lessonSlug]/index.get.ts +68 -0
  332. package/server/api/learn/[slug]/enroll.post.ts +12 -0
  333. package/server/api/learn/[slug]/index.delete.ts +12 -0
  334. package/server/api/learn/[slug]/index.get.ts +14 -0
  335. package/server/api/learn/[slug]/index.put.ts +19 -0
  336. package/server/api/learn/[slug]/lessons/[lessonId].delete.ts +14 -0
  337. package/server/api/learn/[slug]/lessons/[lessonId].put.ts +24 -0
  338. package/server/api/learn/[slug]/lessons.post.ts +10 -0
  339. package/server/api/learn/[slug]/modules/[moduleId].delete.ts +14 -0
  340. package/server/api/learn/[slug]/modules/[moduleId].put.ts +15 -0
  341. package/server/api/learn/[slug]/modules.post.ts +14 -0
  342. package/server/api/learn/[slug]/publish.post.ts +13 -0
  343. package/server/api/learn/[slug]/unenroll.post.ts +12 -0
  344. package/server/api/learn/certificates.get.ts +9 -0
  345. package/server/api/learn/enrollments.get.ts +9 -0
  346. package/server/api/learn/index.get.ts +17 -0
  347. package/server/api/learn/index.post.ts +11 -0
  348. package/server/api/me.get.ts +13 -0
  349. package/server/api/messages/[conversationId]/info.get.ts +43 -0
  350. package/server/api/messages/[conversationId]/stream.get.ts +73 -0
  351. package/server/api/messages/[conversationId].get.ts +13 -0
  352. package/server/api/messages/[conversationId].post.ts +12 -0
  353. package/server/api/messages/index.get.ts +39 -0
  354. package/server/api/messages/index.post.ts +58 -0
  355. package/server/api/notifications/[id].delete.ts +11 -0
  356. package/server/api/notifications/count.get.ts +10 -0
  357. package/server/api/notifications/index.get.ts +24 -0
  358. package/server/api/notifications/read.post.ts +15 -0
  359. package/server/api/notifications/stream.get.ts +59 -0
  360. package/server/api/openapi.get.ts +5 -0
  361. package/server/api/products/[id].delete.ts +15 -0
  362. package/server/api/products/[id].put.ts +18 -0
  363. package/server/api/products/[slug]/content.get.ts +21 -0
  364. package/server/api/products/[slug].get.ts +16 -0
  365. package/server/api/products/index.get.ts +28 -0
  366. package/server/api/profile.get.ts +15 -0
  367. package/server/api/profile.put.ts +24 -0
  368. package/server/api/resolve-identity.post.ts +34 -0
  369. package/server/api/search/index.get.ts +24 -0
  370. package/server/api/search/trending.get.ts +22 -0
  371. package/server/api/social/bookmark.get.ts +16 -0
  372. package/server/api/social/bookmark.post.ts +15 -0
  373. package/server/api/social/bookmarks.get.ts +16 -0
  374. package/server/api/social/comments/[id].delete.ts +13 -0
  375. package/server/api/social/comments.get.ts +18 -0
  376. package/server/api/social/comments.post.ts +11 -0
  377. package/server/api/social/like.get.ts +17 -0
  378. package/server/api/social/like.post.ts +35 -0
  379. package/server/api/stats.get.ts +8 -0
  380. package/server/api/user/hubs.get.ts +22 -0
  381. package/server/api/users/[username]/content.get.ts +21 -0
  382. package/server/api/users/[username]/feed.xml.get.ts +65 -0
  383. package/server/api/users/[username]/follow.delete.ts +15 -0
  384. package/server/api/users/[username]/follow.post.ts +15 -0
  385. package/server/api/users/[username]/followers.get.ts +22 -0
  386. package/server/api/users/[username]/following.get.ts +22 -0
  387. package/server/api/users/[username]/learning.get.ts +18 -0
  388. package/server/api/users/[username].get.ts +25 -0
  389. package/server/api/users/index.get.ts +78 -0
  390. package/server/api/videos/[id].get.ts +18 -0
  391. package/server/api/videos/categories/[id].delete.ts +15 -0
  392. package/server/api/videos/categories/[id].put.ts +17 -0
  393. package/server/api/videos/categories.get.ts +7 -0
  394. package/server/api/videos/categories.post.ts +11 -0
  395. package/server/api/videos/index.get.ts +20 -0
  396. package/server/api/videos/index.post.ts +11 -0
  397. package/server/middleware/auth.ts +180 -0
  398. package/server/middleware/features.ts +31 -0
  399. package/server/middleware/security.ts +54 -0
  400. package/server/plugins/auto-admin.ts +69 -0
  401. package/server/plugins/federation-delivery.ts +74 -0
  402. package/server/routes/.well-known/nodeinfo.ts +15 -0
  403. package/server/routes/.well-known/webfinger.ts +86 -0
  404. package/server/routes/actor/followers.ts +34 -0
  405. package/server/routes/actor/following.ts +34 -0
  406. package/server/routes/actor/outbox.ts +31 -0
  407. package/server/routes/actor.ts +30 -0
  408. package/server/routes/feed.xml.ts +59 -0
  409. package/server/routes/hubs/[slug]/followers.ts +39 -0
  410. package/server/routes/hubs/[slug]/inbox.ts +35 -0
  411. package/server/routes/hubs/[slug]/outbox.ts +43 -0
  412. package/server/routes/hubs/[slug]/posts/[postId].ts +63 -0
  413. package/server/routes/hubs/[slug].ts +29 -0
  414. package/server/routes/inbox.ts +34 -0
  415. package/server/routes/nodeinfo/2.1.ts +27 -0
  416. package/server/routes/robots.txt.ts +19 -0
  417. package/server/routes/sitemap.xml.ts +105 -0
  418. package/server/routes/users/[username]/followers.ts +33 -0
  419. package/server/routes/users/[username]/following.ts +33 -0
  420. package/server/routes/users/[username]/inbox.ts +34 -0
  421. package/server/routes/users/[username]/outbox.ts +35 -0
  422. package/server/routes/users/[username].ts +62 -0
  423. package/server/utils/auth.ts +36 -0
  424. package/server/utils/db.ts +34 -0
  425. package/server/utils/errors.ts +24 -0
  426. package/server/utils/inbox.ts +122 -0
  427. package/server/utils/validate.ts +82 -0
  428. package/theme/base.css +283 -0
  429. package/theme/components.css +322 -0
  430. package/theme/dark.css +87 -0
  431. package/theme/editor-panels.css +63 -0
  432. package/theme/forms.css +216 -0
  433. package/theme/generics.css +68 -0
  434. package/theme/layouts.css +415 -0
  435. package/theme/prose.css +342 -0
  436. package/types/hub.ts +61 -0
@@ -0,0 +1,360 @@
1
+ <script setup lang="ts">
2
+ useSeoMeta({ title: `Learn — ${useSiteName()}` });
3
+
4
+ const { isAuthenticated, user } = useAuth();
5
+
6
+ const { data: pathsData, pending: loadingPaths } = useFetch('/api/learn');
7
+
8
+ // Fetch author's own paths (including drafts) when authenticated
9
+ const myPathsQuery = computed(() => user.value?.id ? { authorId: user.value.id } : {});
10
+ const { data: myPathsData } = useFetch('/api/learn', {
11
+ query: myPathsQuery,
12
+ immediate: isAuthenticated.value,
13
+ watch: [myPathsQuery],
14
+ });
15
+ const myPaths = computed(() => myPathsData.value?.items ?? []);
16
+ const { data: enrollments } = useFetch('/api/learn/enrollments', {
17
+ immediate: isAuthenticated.value,
18
+ });
19
+ const { data: certificates } = useFetch('/api/learn/certificates', {
20
+ immediate: isAuthenticated.value,
21
+ });
22
+
23
+ const allPaths = computed(() => pathsData.value?.items ?? []);
24
+ const paths = computed(() => {
25
+ if (!activeDifficultyFilter.value) return allPaths.value;
26
+ return allPaths.value.filter((p: { difficulty: string | null }) => p.difficulty === activeDifficultyFilter.value);
27
+ });
28
+ const totalPaths = computed(() => pathsData.value?.total ?? 0);
29
+ const inProgress = computed(() => enrollments.value?.filter(e => parseFloat(e.progress) > 0 && parseFloat(e.progress) < 100) ?? []);
30
+
31
+ function getDifficultyClass(difficulty: string | null): string {
32
+ switch (difficulty) {
33
+ case 'beginner': return 'cpub-tag-green';
34
+ case 'intermediate': return 'cpub-tag-yellow';
35
+ case 'advanced': return 'cpub-tag-red';
36
+ default: return '';
37
+ }
38
+ }
39
+
40
+ const heroCategories = [
41
+ { name: 'All', icon: 'fa-solid fa-layer-group', filter: '' },
42
+ { name: 'Beginner', icon: 'fa-solid fa-seedling', filter: 'beginner' },
43
+ { name: 'Intermediate', icon: 'fa-solid fa-bolt', filter: 'intermediate' },
44
+ { name: 'Advanced', icon: 'fa-solid fa-fire', filter: 'advanced' },
45
+ ];
46
+ const activeHeroCat = ref('All');
47
+ const activeDifficultyFilter = ref('');
48
+ </script>
49
+
50
+ <template>
51
+ <div class="cpub-learn">
52
+
53
+ <!-- HERO -->
54
+ <div class="cpub-learn-hero">
55
+ <div class="cpub-learn-hero-inner">
56
+ <div class="cpub-hero-eyebrow"><i class="fa-solid fa-graduation-cap"></i> &nbsp;Learning Hub</div>
57
+ <h1 class="cpub-hero-title">Learn</h1>
58
+ <p class="cpub-hero-sub">Structured courses, interactive explainers, and hands-on tutorials — from beginner to production-ready.</p>
59
+ <div class="cpub-hero-cats">
60
+ <div
61
+ v-for="c in heroCategories"
62
+ :key="c.name"
63
+ class="cpub-hero-cat"
64
+ :class="{ active: activeHeroCat === c.name }"
65
+ @click="activeHeroCat = c.name; activeDifficultyFilter = c.filter"
66
+ >
67
+ <span class="cpub-hero-cat-icon"><i :class="c.icon"></i></span> {{ c.name }}
68
+ </div>
69
+ </div>
70
+ <div class="cpub-hero-stats">
71
+ <div class="cpub-hero-stat"><div class="cpub-hero-stat-n">{{ totalPaths }}</div><div class="cpub-hero-stat-l">paths</div></div>
72
+ <div class="cpub-hero-stat"><div class="cpub-hero-stat-n">{{ inProgress.length }}</div><div class="cpub-hero-stat-l">in progress</div></div>
73
+ </div>
74
+ </div>
75
+ </div>
76
+
77
+ <!-- SHELL -->
78
+ <div class="cpub-shell">
79
+ <div class="cpub-main-content">
80
+ <div class="cpub-page">
81
+
82
+ <!-- MY LEARNING -->
83
+ <template v-if="isAuthenticated && inProgress.length">
84
+ <div class="cpub-sec-head">
85
+ <h2>My Learning</h2>
86
+ <span class="cpub-sec-sub">{{ inProgress.length }} in progress</span>
87
+ </div>
88
+
89
+ <div class="cpub-ip-row">
90
+ <div v-for="ip in inProgress" :key="ip.path.id" class="cpub-ip-card">
91
+ <div class="cpub-ip-thumb">
92
+ <div class="cpub-ip-thumb-icon"><i class="fa-solid fa-graduation-cap"></i></div>
93
+ </div>
94
+ <div class="cpub-ip-body">
95
+ <div class="cpub-ip-title">{{ ip.path.title }}</div>
96
+ <div class="cpub-ip-meta">In progress</div>
97
+ <div class="cpub-ip-progress-label">
98
+ <span class="cpub-ip-progress-text">{{ Math.round(parseFloat(ip.progress)) }}% complete</span>
99
+ <span class="cpub-ip-progress-pct">{{ Math.round(parseFloat(ip.progress)) }}%</span>
100
+ </div>
101
+ <div class="cpub-progress-track"><div class="cpub-progress-fill" :style="{ width: ip.progress + '%' }"></div></div>
102
+ <NuxtLink :to="`/learn/${ip.path.slug}`" class="cpub-ip-continue"><i class="fa-solid fa-play" style="font-size:9px;"></i> Continue Learning</NuxtLink>
103
+ </div>
104
+ </div>
105
+ </div>
106
+
107
+ <hr class="cpub-divider" />
108
+ </template>
109
+
110
+ <!-- MY PATHS (author's own, including drafts) -->
111
+ <template v-if="isAuthenticated && myPaths.length">
112
+ <div class="cpub-sec-head">
113
+ <h2>My Paths</h2>
114
+ <span class="cpub-sec-sub">{{ myPaths.length }} paths</span>
115
+ </div>
116
+
117
+ <div class="cpub-my-paths">
118
+ <div v-for="p in myPaths" :key="p.id" class="cpub-my-path-row">
119
+ <div class="cpub-my-path-info">
120
+ <NuxtLink :to="`/learn/${p.slug}`" class="cpub-my-path-title">{{ p.title }}</NuxtLink>
121
+ <span class="cpub-my-path-status" :class="{ draft: p.status === 'draft' }">{{ p.status }}</span>
122
+ </div>
123
+ <div class="cpub-my-path-meta">
124
+ <span>{{ p.moduleCount }} modules</span>
125
+ <span>{{ p.enrollmentCount }} enrolled</span>
126
+ </div>
127
+ </div>
128
+ </div>
129
+ <hr class="cpub-divider" />
130
+ </template>
131
+
132
+ <!-- LEARNING PATHS -->
133
+ <div class="cpub-sec-head">
134
+ <h2>Learning Paths</h2>
135
+ <span class="cpub-sec-sub">{{ totalPaths }} paths</span>
136
+ <NuxtLink v-if="isAuthenticated" to="/learn/create" class="cpub-btn cpub-btn-primary" style="margin-left: auto;">Create Path</NuxtLink>
137
+ </div>
138
+
139
+ <!-- Loading -->
140
+ <div v-if="loadingPaths" style="padding: 24px 0; text-align: center; color: var(--text-faint); font-size: 12px;">
141
+ Loading paths...
142
+ </div>
143
+
144
+ <!-- Real data -->
145
+ <template v-else-if="paths.length">
146
+ <NuxtLink v-for="p in paths" :key="p.id" :to="`/learn/${p.slug}`" class="cpub-path-card" style="text-decoration: none; color: inherit;">
147
+ <div class="cpub-path-icon-wrap"><i class="fa-solid fa-route"></i></div>
148
+ <div class="cpub-path-body">
149
+ <div style="display:flex;align-items:center;gap:8px;margin-bottom:6px;">
150
+ <div class="cpub-path-title">{{ p.title }}</div>
151
+ <span v-if="p.difficulty" class="cpub-tag" :class="getDifficultyClass(p.difficulty)">{{ p.difficulty }}</span>
152
+ </div>
153
+ <div v-if="p.description" class="cpub-path-desc">{{ p.description }}</div>
154
+ <div class="cpub-path-meta">
155
+ <div class="cpub-path-meta-item"><i class="fa-solid fa-book-open"></i> {{ p.moduleCount }} modules</div>
156
+ <div class="cpub-path-meta-item"><i class="fa-solid fa-users"></i> {{ p.enrollmentCount }} enrolled</div>
157
+ </div>
158
+ </div>
159
+ <div class="cpub-path-aside">
160
+ <button class="cpub-btn cpub-btn-sm cpub-btn-primary">View Path</button>
161
+ </div>
162
+ </NuxtLink>
163
+ </template>
164
+
165
+ <!-- Empty state -->
166
+ <div v-else class="cpub-empty-state">
167
+ <div class="cpub-empty-icon"><i class="fa-solid fa-graduation-cap"></i></div>
168
+ <p class="cpub-empty-title">No learning paths yet</p>
169
+ <p class="cpub-empty-sub">Learning paths will appear here once they're created.</p>
170
+ </div>
171
+
172
+ </div>
173
+ </div>
174
+
175
+ <!-- SIDEBAR -->
176
+ <aside class="cpub-sidebar">
177
+
178
+ <div class="cpub-sb-section">
179
+ <div class="cpub-sb-title">Stats</div>
180
+ <div style="font-size: 11px; color: var(--text-dim); font-family: var(--font-mono);">
181
+ {{ totalPaths }} learning paths
182
+ </div>
183
+ </div>
184
+
185
+ <template v-if="isAuthenticated && certificates?.length">
186
+ <div class="cpub-sb-section">
187
+ <div class="cpub-sb-title">Certificates Earned</div>
188
+ <div class="cpub-cert-grid">
189
+ <div v-for="c in certificates" :key="c.id" class="cpub-cert-item">
190
+ <div class="cpub-cert-badge"><i class="fa-solid fa-medal"></i></div>
191
+ <div class="cpub-cert-info">
192
+ <div class="cpub-cert-name">{{ c.path.title }}</div>
193
+ <div class="cpub-cert-date">{{ new Date(c.issuedAt).toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric' }) }}</div>
194
+ </div>
195
+ </div>
196
+ </div>
197
+ </div>
198
+ </template>
199
+
200
+ </aside>
201
+ </div>
202
+
203
+ </div>
204
+ </template>
205
+
206
+ <style scoped>
207
+ /* HERO */
208
+ .cpub-learn-hero { background: var(--surface); border-bottom: var(--border-width-default) solid var(--border); padding: 36px 32px 28px; }
209
+ .cpub-learn-hero-inner { max-width: 960px; margin: 0 auto; }
210
+ /* cpub-hero-eyebrow → global components.css */
211
+ .cpub-hero-title { font-size: 28px; font-weight: 700; line-height: 1.15; margin-bottom: 10px; letter-spacing: -.03em; }
212
+ .cpub-hero-sub { font-size: 14px; color: var(--text-dim); line-height: 1.6; max-width: 520px; margin-bottom: 24px; }
213
+ .cpub-hero-cats { display: flex; gap: 8px; flex-wrap: wrap; }
214
+ .cpub-hero-cat { font-size: 11px; font-family: var(--font-mono); padding: 6px 14px; border-radius: var(--radius); border: var(--border-width-default) solid var(--border); background: var(--surface); color: var(--text-dim); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
215
+ .cpub-hero-cat:hover { background: var(--surface2); color: var(--text); }
216
+ .cpub-hero-cat.active { border-color: var(--accent); background: var(--accent-bg); color: var(--accent); box-shadow: var(--shadow-sm); }
217
+ .cpub-hero-cat-icon { font-size: 12px; }
218
+ .cpub-hero-stats { display: flex; gap: 24px; margin-top: 24px; padding-top: 20px; border-top: var(--border-width-default) solid var(--border); }
219
+ .cpub-hero-stat { display: flex; flex-direction: column; gap: 2px; }
220
+ .cpub-hero-stat-n { font-size: 18px; font-weight: 700; color: var(--text); }
221
+ .cpub-hero-stat-l { font-size: 10px; font-family: var(--font-mono); color: var(--text-dim); }
222
+
223
+ /* SHELL LAYOUT */
224
+ .cpub-shell { display: flex; min-height: calc(100vh - 48px); }
225
+ .cpub-main-content { flex: 1; overflow-y: auto; overflow-x: hidden; }
226
+ .cpub-page { max-width: 960px; margin: 0 auto; padding: 28px 32px; }
227
+ .cpub-sidebar { width: 240px; background: var(--surface); border-left: var(--border-width-default) solid var(--border); flex-shrink: 0; overflow-y: auto; padding: 20px 0; }
228
+
229
+ /* PRIMITIVES (page-specific) */
230
+ .cpub-btn-xs { padding: 3px 8px; font-size: 10px; font-family: var(--font-mono); }
231
+ .cpub-btn-progress { background: var(--accent-bg); border-color: var(--accent-border); color: var(--accent); }
232
+
233
+ .cpub-progress-track { height: 4px; background: var(--surface3); border-radius: 0; overflow: hidden; border: var(--border-width-default) solid var(--border2); }
234
+ .cpub-progress-fill { height: 100%; border-radius: 0; background: var(--accent); }
235
+
236
+ /* cpub-sec-sub, cpub-sec-head-right → global components.css */
237
+
238
+ /* MY LEARNING */
239
+ .cpub-ip-row { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
240
+ .cpub-ip-row::-webkit-scrollbar { display: none; }
241
+ .cpub-ip-card { background: var(--surface); border: var(--border-width-default) solid var(--border); border-radius: var(--radius); overflow: hidden; min-width: 220px; max-width: 220px; flex-shrink: 0; box-shadow: var(--shadow-md); }
242
+ .cpub-ip-card:hover { box-shadow: var(--shadow-md); }
243
+ .cpub-ip-thumb { height: 100px; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--surface3); }
244
+ .cpub-ip-thumb-icon { font-size: 24px; position: relative; z-index: 1; color: var(--text-dim); }
245
+ .cpub-ip-thumb-badge { position: absolute; top: 8px; right: 8px; z-index: 2; }
246
+ .cpub-ip-body { padding: 14px; }
247
+ .cpub-ip-title { font-size: 12px; font-weight: 600; margin-bottom: 4px; line-height: 1.35; }
248
+ .cpub-ip-meta { font-size: 10px; font-family: var(--font-mono); color: var(--text-faint); margin-bottom: 10px; }
249
+ .cpub-ip-progress-label { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
250
+ .cpub-ip-progress-text { font-size: 10px; font-family: var(--font-mono); color: var(--text-dim); }
251
+ .cpub-ip-progress-pct { font-size: 10px; font-family: var(--font-mono); color: var(--accent); }
252
+ .cpub-ip-continue { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; padding: 7px; border-top: var(--border-width-default) solid var(--border); font-size: 11px; color: var(--accent); font-family: var(--font-mono); cursor: pointer; }
253
+ .cpub-ip-continue:hover { background: var(--accent-bg); }
254
+
255
+ /* LEARNING PATHS */
256
+ .cpub-path-card { background: var(--surface); border: var(--border-width-default) solid var(--border); border-radius: var(--radius); padding: 20px; display: flex; gap: 20px; align-items: flex-start; margin-bottom: 12px; box-shadow: var(--shadow-md); }
257
+ .cpub-path-card:hover { box-shadow: var(--shadow-md); }
258
+ .cpub-path-icon-wrap { width: 52px; height: 52px; border-radius: var(--radius); border: var(--border-width-default) solid var(--border); background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; color: var(--text-dim); }
259
+ .cpub-path-body { flex: 1; }
260
+ .cpub-path-title { font-size: 14px; font-weight: 600; }
261
+ .cpub-path-desc { font-size: 12px; color: var(--text-dim); line-height: 1.55; margin-bottom: 12px; }
262
+ .cpub-path-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
263
+ .cpub-path-meta-item { font-size: 11px; font-family: var(--font-mono); color: var(--text-faint); display: flex; align-items: center; gap: 5px; }
264
+ .cpub-path-courses-preview { display: flex; gap: 6px; margin-top: 12px; padding-top: 12px; border-top: var(--border-width-default) solid var(--border2); overflow-x: auto; }
265
+ .cpub-path-course-pill { font-size: 10px; font-family: var(--font-mono); padding: 3px 10px; border-radius: 0; border: var(--border-width-default) solid var(--border); background: var(--surface2); color: var(--text-dim); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
266
+ .cpub-pill-done { border-color: var(--green-border); color: var(--green); background: var(--green-bg); }
267
+ .cpub-path-aside { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex-shrink: 0; }
268
+ .cpub-path-aside-meta { font-size: 11px; font-family: var(--font-mono); color: var(--text-faint); }
269
+
270
+ /* COURSES */
271
+ .cpub-course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
272
+ .cpub-course-card { background: var(--surface); border: var(--border-width-default) solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow-md); }
273
+ .cpub-course-card:hover { box-shadow: var(--shadow-md); }
274
+ .cpub-course-cover { height: 120px; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--surface3); border-bottom: var(--border-width-default) solid var(--border); }
275
+ .cpub-course-cover-icon { font-size: 28px; position: relative; z-index: 1; color: var(--text-dim); }
276
+ .cpub-course-cover-price { position: absolute; top: 10px; right: 10px; z-index: 2; font-size: 11px; font-family: var(--font-mono); padding: 3px 8px; border-radius: 0; background: var(--surface); border: var(--border-width-default) solid var(--border); }
277
+ .cpub-price-free { color: var(--green); border-color: var(--green); }
278
+ .cpub-price-paid { color: var(--text); }
279
+ .cpub-course-body { padding: 14px; flex: 1; display: flex; flex-direction: column; }
280
+ .cpub-course-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; line-height: 1.35; }
281
+ .cpub-course-instructor { font-size: 11px; color: var(--text-dim); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
282
+ .cpub-instructor-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--surface3); border: var(--border-width-default) solid var(--border); font-size: 8px; display: flex; align-items: center; justify-content: center; font-family: var(--font-mono); color: var(--text-faint); flex-shrink: 0; }
283
+ .cpub-course-stars { display: flex; align-items: center; gap: 3px; margin-bottom: 8px; }
284
+ .cpub-star { color: var(--yellow); font-size: 10px; }
285
+ .cpub-star-empty { color: var(--border2); }
286
+ .cpub-star-score { font-size: 11px; font-family: var(--font-mono); color: var(--yellow); margin-left: 2px; }
287
+ .cpub-star-count { font-size: 10px; color: var(--text-faint); font-family: var(--font-mono); margin-left: 2px; }
288
+ .cpub-course-meta-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
289
+ .cpub-course-meta-item { font-size: 10px; font-family: var(--font-mono); color: var(--text-faint); display: flex; align-items: center; gap: 4px; }
290
+ .cpub-course-footer { margin-top: auto; padding-top: 10px; border-top: var(--border-width-default) solid var(--border2); }
291
+ .cpub-course-enrolled-progress { margin-bottom: 8px; }
292
+ .cpub-course-enrolled-label { font-size: 10px; font-family: var(--font-mono); color: var(--accent); margin-bottom: 5px; }
293
+ .cpub-course-actions { display: flex; align-items: center; justify-content: space-between; }
294
+ .cpub-course-lesson-label { font-size: 10px; font-family: var(--font-mono); color: var(--text-faint); }
295
+
296
+ /* EXPLAINERS */
297
+ .cpub-explainer-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
298
+ .cpub-explainer-card { background: var(--surface); border: var(--border-width-default) solid var(--border); border-radius: var(--radius); padding: 18px; display: flex; gap: 16px; align-items: flex-start; box-shadow: var(--shadow-md); }
299
+ .cpub-explainer-card:hover { box-shadow: var(--shadow-md); }
300
+ .cpub-explainer-icon { width: 44px; height: 44px; border-radius: var(--radius); border: var(--border-width-default) solid var(--border); background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; color: var(--text-dim); }
301
+ .cpub-explainer-body { flex: 1; }
302
+ .cpub-explainer-title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
303
+ .cpub-explainer-desc { font-size: 12px; color: var(--text-dim); line-height: 1.5; margin-bottom: 10px; }
304
+ .cpub-explainer-meta { display: flex; align-items: center; gap: 10px; }
305
+ .cpub-explainer-time { font-size: 10px; font-family: var(--font-mono); color: var(--text-faint); display: flex; align-items: center; gap: 4px; }
306
+ .cpub-explainer-action { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
307
+
308
+ /* TUTORIALS */
309
+ .cpub-tutorial-list { display: flex; flex-direction: column; }
310
+ .cpub-tutorial-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: var(--border-width-default) solid var(--border2); cursor: pointer; }
311
+ .cpub-tutorial-row:last-child { border-bottom: none; }
312
+ .cpub-tutorial-row:hover .cpub-tutorial-title { color: var(--accent); }
313
+ .cpub-tutorial-icon { width: 36px; height: 36px; border-radius: var(--radius); background: var(--surface2); border: var(--border-width-default) solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; color: var(--text-dim); }
314
+ .cpub-tutorial-body { flex: 1; }
315
+ .cpub-tutorial-title { font-size: 12px; font-weight: 600; margin-bottom: 3px; transition: color .1s; }
316
+ .cpub-tutorial-meta { font-size: 10px; font-family: var(--font-mono); color: var(--text-faint); display: flex; align-items: center; gap: 8px; }
317
+ .cpub-tutorial-aside { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
318
+ .cpub-tutorial-steps { font-size: 10px; font-family: var(--font-mono); color: var(--text-faint); }
319
+
320
+ /* SIDEBAR */
321
+ .cpub-sb-section { padding: 0 16px 20px; }
322
+ .cpub-sb-section + .cpub-sb-section { border-top: var(--border-width-default) solid var(--border); padding-top: 20px; }
323
+ .cpub-sb-title { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-faint); font-family: var(--font-mono); margin-bottom: 12px; }
324
+ .cpub-sb-cat-item { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: var(--border-width-default) solid var(--border2); cursor: pointer; }
325
+ .cpub-sb-cat-item:last-child { border-bottom: none; }
326
+ .cpub-sb-cat-item:hover .cpub-sb-cat-name { color: var(--text); }
327
+ .cpub-sb-cat-icon { width: 24px; height: 24px; border-radius: var(--radius); background: var(--surface2); border: var(--border-width-default) solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; color: var(--text-dim); }
328
+ .cpub-sb-cat-name { font-size: 12px; color: var(--text-dim); }
329
+ .cpub-sb-cat-count { margin-left: auto; font-size: 10px; font-family: var(--font-mono); color: var(--text-faint); }
330
+ .cpub-sb-level-row { display: flex; flex-direction: column; gap: 6px; }
331
+ .cpub-sb-level-item { display: flex; align-items: center; gap: 8px; cursor: pointer; }
332
+ .cpub-sb-level-check { width: 14px; height: 14px; border-radius: 0; border: var(--border-width-default) solid var(--border); background: var(--surface); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 8px; }
333
+ .cpub-checked { background: var(--accent); border-color: var(--border); color: var(--color-text-inverse); }
334
+ .cpub-sb-level-name { font-size: 12px; color: var(--text-dim); }
335
+ .cpub-sb-level-n { margin-left: auto; font-size: 10px; font-family: var(--font-mono); color: var(--text-faint); }
336
+ .cpub-sb-tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
337
+ .cpub-sb-tag { font-size: 10px; font-family: var(--font-mono); padding: 3px 8px; border-radius: 0; border: var(--border-width-default) solid var(--border); background: var(--surface2); color: var(--text-faint); cursor: pointer; }
338
+ .cpub-sb-tag:hover { border-color: var(--border); color: var(--text-dim); background: var(--surface3); }
339
+ .cpub-cert-grid { display: flex; flex-direction: column; gap: 8px; }
340
+ .cpub-cert-item { background: var(--surface2); border: var(--border-width-default) solid var(--border); border-radius: var(--radius); padding: 10px 12px; display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-sm); }
341
+ .cpub-cert-badge { width: 32px; height: 32px; border-radius: 50%; border: var(--border-width-default) solid var(--yellow); background: var(--yellow-bg); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; color: var(--yellow); }
342
+ .cpub-cert-info { flex: 1; }
343
+ .cpub-cert-name { font-size: 11px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
344
+ .cpub-cert-date { font-size: 10px; font-family: var(--font-mono); color: var(--text-faint); }
345
+
346
+ /* MY PATHS */
347
+ .cpub-my-paths { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
348
+ .cpub-my-path-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border: var(--border-width-default) solid var(--border); background: var(--surface); }
349
+ .cpub-my-path-info { display: flex; align-items: center; gap: 10px; }
350
+ .cpub-my-path-title { font-size: 13px; font-weight: 600; color: var(--text); text-decoration: none; }
351
+ .cpub-my-path-title:hover { color: var(--accent); }
352
+ .cpub-my-path-status { font-size: 10px; font-family: var(--font-mono); padding: 2px 8px; border: var(--border-width-default) solid var(--border); color: var(--text-dim); }
353
+ .cpub-my-path-status.draft { color: var(--yellow); border-color: var(--yellow-border); background: var(--yellow-bg); }
354
+ .cpub-my-path-meta { display: flex; gap: 12px; font-size: 11px; font-family: var(--font-mono); color: var(--text-faint); }
355
+
356
+ /* EMPTY STATE (page-specific) */
357
+ .cpub-empty-icon { font-size: 32px; color: var(--text-faint); margin-bottom: 12px; }
358
+ .cpub-empty-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
359
+ .cpub-empty-sub { font-size: 12px; color: var(--text-dim); }
360
+ </style>
@@ -0,0 +1,113 @@
1
+ <script setup lang="ts">
2
+ const route = useRoute();
3
+ const conversationId = route.params.conversationId as string;
4
+
5
+ useSeoMeta({ title: 'Message -- devEco.io' });
6
+ definePageMeta({ middleware: 'auth' });
7
+
8
+ const { user } = useAuth();
9
+
10
+ const { data: convInfo } = useLazyFetch<any>(`/api/messages/${conversationId}/info`, {
11
+ default: () => ({ id: conversationId, participants: [] as string[] }),
12
+ });
13
+
14
+ const { data: initialMessages, refresh } = useLazyFetch<any[]>(`/api/messages/${conversationId}`, {
15
+ default: () => [],
16
+ });
17
+
18
+ const messages = ref([...(initialMessages.value ?? [])]);
19
+
20
+ // SSE real-time stream
21
+ let eventSource: EventSource | null = null;
22
+
23
+ onMounted(() => {
24
+ eventSource = new EventSource(`/api/messages/${conversationId}/stream`);
25
+
26
+ eventSource.onmessage = (event) => {
27
+ try {
28
+ const data = JSON.parse(event.data);
29
+ if (data.type === 'init') {
30
+ messages.value = data.messages;
31
+ } else if (data.type === 'new') {
32
+ for (const msg of data.messages) {
33
+ if (!messages.value.some((m) => m.id === msg.id)) {
34
+ messages.value.push(msg);
35
+ }
36
+ }
37
+ }
38
+ } catch { /* ignore parse errors */ }
39
+ };
40
+
41
+ eventSource.onerror = () => {
42
+ // Connection lost — will auto-reconnect via EventSource spec
43
+ };
44
+ });
45
+
46
+ onUnmounted(() => {
47
+ eventSource?.close();
48
+ eventSource = null;
49
+ });
50
+
51
+ const participantLabel = computed(() => {
52
+ const parts = convInfo.value?.participants ?? [];
53
+ if (!parts.length) return 'Conversation';
54
+ const others = parts
55
+ .filter((p: any) => typeof p === 'object' ? p.id !== user.value?.id : p !== user.value?.id)
56
+ .map((p: any) => typeof p === 'object' ? (p.displayName || p.username) : p);
57
+ return others.length > 0 ? others.join(', ') : 'Conversation';
58
+ });
59
+
60
+ async function handleSend(text: string): Promise<void> {
61
+ await $fetch(`/api/messages/${conversationId}`, {
62
+ method: 'POST',
63
+ body: { body: text },
64
+ });
65
+ // SSE will pick up the new message, but also do an immediate refresh for responsiveness
66
+ refresh().then((result: any) => {
67
+ if (result?.data?.value) {
68
+ messages.value = result.data.value;
69
+ }
70
+ });
71
+ }
72
+ </script>
73
+
74
+ <template>
75
+ <div class="cpub-message-view">
76
+ <div class="cpub-message-topbar">
77
+ <NuxtLink to="/messages" class="cpub-btn cpub-btn-sm cpub-btn-ghost">
78
+ <i class="fa-solid fa-arrow-left"></i> Back
79
+ </NuxtLink>
80
+ <span style="font-size: 13px; font-weight: 600">{{ participantLabel }}</span>
81
+ </div>
82
+ <MessageThread
83
+ :messages="messages"
84
+ :current-user-id="user?.id ?? ''"
85
+ @send="handleSend"
86
+ />
87
+ </div>
88
+ </template>
89
+
90
+ <style scoped>
91
+ .cpub-message-view {
92
+ max-width: 720px;
93
+ height: calc(100vh - 120px);
94
+ display: flex;
95
+ flex-direction: column;
96
+ border: var(--border-width-default) solid var(--border);
97
+ background: var(--surface);
98
+ }
99
+
100
+ .cpub-message-topbar {
101
+ display: flex;
102
+ align-items: center;
103
+ gap: 12px;
104
+ padding: 8px 12px;
105
+ border-bottom: var(--border-width-default) solid var(--border);
106
+ }
107
+
108
+ @media (max-width: 768px) {
109
+ .msg-page { padding: 12px; }
110
+ .msg-scroll { height: calc(100vh - 160px); }
111
+ .msg-compose { padding: 8px; }
112
+ }
113
+ </style>